diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/site.css b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/site.css
index cfc4cd0..e2ea2b2 100644
--- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/site.css
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/css/site.css
@@ -90,18 +90,18 @@ th:not([align]) {
src: url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot");
/* IE9 Compat Modes */
src: local(""),
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff") format("woff"),
- /* Modern Browsers */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC")
- format("svg");
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.woff") format("woff"),
+ /* Modern Browsers */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.ttf")
+ format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-regular.svg#VollkornSC")
+ format("svg");
/* Legacy iOS */
}
@@ -114,17 +114,17 @@ th:not([align]) {
src: url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot");
/* IE9 Compat Modes */
src: local(""),
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff") format("woff"),
- /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC")
- format("svg");
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.woff") format("woff"),
+ /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.ttf")
+ format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-600.svg#VollkornSC")
+ format("svg");
/* Legacy iOS */
}
@@ -137,17 +137,17 @@ th:not([align]) {
src: url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot");
/* IE9 Compat Modes */
src: local(""),
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff") format("woff"),
- /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC")
- format("svg");
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.woff") format("woff"),
+ /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.ttf")
+ format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-700.svg#VollkornSC")
+ format("svg");
/* Legacy iOS */
}
@@ -160,17 +160,17 @@ th:not([align]) {
src: url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot");
/* IE9 Compat Modes */
src: local(""),
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff") format("woff"),
- /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC")
- format("svg");
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.woff") format("woff"),
+ /* Modern Browsers */ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.ttf")
+ format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/vollkorn-sc-v4-latin-ext_latin-900.svg#VollkornSC")
+ format("svg");
/* Legacy iOS */
}
@@ -183,18 +183,18 @@ th:not([align]) {
src: url("../fonts/vollkorn-v12-latin-ext_latin-500italic.eot");
/* IE9 Compat Modes */
src: local(""),
- url("../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/vollkorn-v12-latin-ext_latin-500italic.woff") format("woff"),
- /* Modern Browsers */
- url("../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn")
- format("svg");
+ url("../fonts/vollkorn-v12-latin-ext_latin-500italic.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-500italic.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/vollkorn-v12-latin-ext_latin-500italic.woff") format("woff"),
+ /* Modern Browsers */
+ url("../fonts/vollkorn-v12-latin-ext_latin-500italic.ttf")
+ format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/vollkorn-v12-latin-ext_latin-500italic.svg#Vollkorn")
+ format("svg");
/* Legacy iOS */
}
@@ -207,18 +207,18 @@ th:not([align]) {
src: url("../fonts/vollkorn-v12-latin-ext_latin-regular.eot");
/* IE9 Compat Modes */
src: local(""),
- url("../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-regular.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/vollkorn-v12-latin-ext_latin-regular.woff") format("woff"),
- /* Modern Browsers */
- url("../fonts/vollkorn-v12-latin-ext_latin-regular.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn")
- format("svg");
+ url("../fonts/vollkorn-v12-latin-ext_latin-regular.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-regular.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/vollkorn-v12-latin-ext_latin-regular.woff") format("woff"),
+ /* Modern Browsers */
+ url("../fonts/vollkorn-v12-latin-ext_latin-regular.ttf")
+ format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/vollkorn-v12-latin-ext_latin-regular.svg#Vollkorn")
+ format("svg");
/* Legacy iOS */
}
@@ -231,17 +231,17 @@ th:not([align]) {
src: url("../fonts/vollkorn-v12-latin-ext_latin-500.eot");
/* IE9 Compat Modes */
src: local(""),
- url("../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-500.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/vollkorn-v12-latin-ext_latin-500.woff") format("woff"),
- /* Modern Browsers */ url("../fonts/vollkorn-v12-latin-ext_latin-500.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn")
- format("svg");
+ url("../fonts/vollkorn-v12-latin-ext_latin-500.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-500.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/vollkorn-v12-latin-ext_latin-500.woff") format("woff"),
+ /* Modern Browsers */ url("../fonts/vollkorn-v12-latin-ext_latin-500.ttf")
+ format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/vollkorn-v12-latin-ext_latin-500.svg#Vollkorn")
+ format("svg");
/* Legacy iOS */
}
@@ -254,17 +254,17 @@ th:not([align]) {
src: url("../fonts/vollkorn-v12-latin-ext_latin-italic.eot");
/* IE9 Compat Modes */
src: local(""),
- url("../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-italic.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/vollkorn-v12-latin-ext_latin-italic.woff") format("woff"),
- /* Modern Browsers */
- url("../fonts/vollkorn-v12-latin-ext_latin-italic.ttf") format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn")
- format("svg");
+ url("../fonts/vollkorn-v12-latin-ext_latin-italic.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/vollkorn-v12-latin-ext_latin-italic.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/vollkorn-v12-latin-ext_latin-italic.woff") format("woff"),
+ /* Modern Browsers */
+ url("../fonts/vollkorn-v12-latin-ext_latin-italic.ttf") format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/vollkorn-v12-latin-ext_latin-italic.svg#Vollkorn")
+ format("svg");
/* Legacy iOS */
}
@@ -277,18 +277,18 @@ th:not([align]) {
src: url("../fonts/great-vibes-v7-latin-ext_latin-regular.eot");
/* IE9 Compat Modes */
src: local("Great Vibes"), local("GreatVibes-Regular"),
- url("../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix")
- format("embedded-opentype"),
- /* IE6-IE8 */ url("../fonts/great-vibes-v7-latin-ext_latin-regular.woff2")
- format("woff2"),
- /* Super Modern Browsers */
- url("../fonts/great-vibes-v7-latin-ext_latin-regular.woff") format("woff"),
- /* Modern Browsers */
- url("../fonts/great-vibes-v7-latin-ext_latin-regular.ttf")
- format("truetype"),
- /* Safari, Android, iOS */
- url("../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes")
- format("svg");
+ url("../fonts/great-vibes-v7-latin-ext_latin-regular.eot?#iefix")
+ format("embedded-opentype"),
+ /* IE6-IE8 */ url("../fonts/great-vibes-v7-latin-ext_latin-regular.woff2")
+ format("woff2"),
+ /* Super Modern Browsers */
+ url("../fonts/great-vibes-v7-latin-ext_latin-regular.woff") format("woff"),
+ /* Modern Browsers */
+ url("../fonts/great-vibes-v7-latin-ext_latin-regular.ttf")
+ format("truetype"),
+ /* Safari, Android, iOS */
+ url("../fonts/great-vibes-v7-latin-ext_latin-regular.svg#GreatVibes")
+ format("svg");
/* Legacy iOS */
}
@@ -477,8 +477,11 @@ ol li {
list-style-type: decimal;
}
-img {
- width: 100%;
+img, video {
+ max-width: 100%;
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
}
.supt {
@@ -575,9 +578,9 @@ img {
.rightcolumn {
/* display: grid;
- grid-column: 2;
- grid-template-columns: auto 1fr;
- grid-auto-rows: max-content; */
+ grid-column: 2;
+ grid-template-columns: auto 1fr;
+ grid-auto-rows: max-content; */
padding-left: 0.5rem;
}
@@ -592,6 +595,7 @@ img {
.hasauthors {
font-size: 1.6rem !important;
+ display: flex;
}
.hassup {
@@ -669,7 +673,7 @@ h6 {
padding-top: 1.2rem;
padding-bottom: 1.2rem;
background-color: rgba(0, 0, 0, 0.05);
- max-width: 70ch;
+ max-width: 45ch;
}
.authors {
@@ -775,7 +779,7 @@ h6:before {
color: rgba(0, 0, 0, 0.4);
counter-increment: h6;
content: counter(h2) "." counter(h3) "." counter(h4) "." counter(h5) "."
- counter(h6) ". ";
+ counter(h6) ". ";
}
h2.nocount:before,
@@ -834,9 +838,9 @@ details {
}
/* .glossline {
- border-bottom: lightgray solid 1px;
- border-top: lightgray solid 1px;
-} */
+ border-bottom: lightgray solid 1px;
+ border-top: lightgray solid 1px;
+ } */
.glosswords {
display: inline-block;
@@ -876,6 +880,11 @@ details {
background-color: #fff9f9;
}
+.svedit {
+ display: none;
+ margin-left: 0.5rem;
+}
+
@media (max-width: 767px) {
html {
box-sizing: border-box;
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js
index 1ffb04c..4d46e25 100644
--- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/assets/js/sandpoints.js
@@ -54,7 +54,48 @@ window.addEventListener("scroll", function (e) {
}
});
+function editPage(repoJsId) {
+ let relPath = "../".repeat(relPathDepth - 1);
+ var el = document.createElement('script');
+ el.onload = ()=> {
+ console.log("loading...")
+ console.log(repo)
+ }
+ el.src = `${relPath}js/repo/${repoJsId}.js`
+ document.body.appendChild(el)
+ document.location.href = `${relPath}edit/index.html?edit=${repoJsId}`
+ev}
+
+window.addEventListener("keyup", (e)=> {
+ if (e.key == "e" && location.protocol == "file:") {
+ editPage(sandpointsPageId)
+ } else if (e.key == "E" && location.protocol == "file:") {
+ let preview = document.querySelector("#preview");
+ if (preview.style.display == "flex") {
+ preview.style.display = "none";
+ } else {
+ preview.style.display = "flex";
+ }
+ console.log("preview: ", preview);
+ }
+})
+
window.addEventListener("DOMContentLoaded", (e) => {
+ if (location.protocol == "file:") {
+ document.querySelectorAll(".svedit").forEach((i) => {
+ i.style.display = "inline";
+ })
+ }
+
+ document.querySelectorAll('.triadlink').forEach((i) => {
+ i.addEventListener("click", (ev) => {
+ if (ev.ctrlKey) {
+ ev.preventDefault()
+ editPage(ev.target.getAttribute("repoid"))
+ }
+ })
+ })
+
let preview = document.querySelector("#preview");
if (
location.pathname.split("/").includes("_preview") ||
@@ -66,15 +107,17 @@ window.addEventListener("DOMContentLoaded", (e) => {
let par = document.querySelector(
"#TableOfContents > ol:first-child > li:first-child"
);
- let s = document.createElement("span");
- s.appendChild(par.cloneNode(true));
- par.remove();
- document
- .querySelector("#TableOfContents > ol:first-child")
- .insertBefore(
- s,
- document.querySelector("#TableOfContents > ol:first-child").firstChild
- );
+ if (par) {
+ let s = document.createElement("span");
+ s.appendChild(par.cloneNode(true));
+ par.remove();
+ document
+ .querySelector("#TableOfContents > ol:first-child")
+ .insertBefore(
+ s,
+ document.querySelector("#TableOfContents > ol:first-child").firstChild
+ );
+ }
if (document.querySelector(".soundcite")) {
let relPath = "../".repeat(relPathDepth - 1);
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/assets/css/site.css b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/assets/css/site.css
index 52ccedf..c30694e 100644
--- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/assets/css/site.css
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/assets/css/site.css
@@ -427,6 +427,7 @@ ol li {
.hasauthors {
font-size: 1.6rem !important;
+ display: flex;
}
.hassup {
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/layouts/_default/_markup/render-image.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/layouts/_default/_markup/render-image.html
index 7faa3d3..fad8dcd 100644
--- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/layouts/_default/_markup/render-image.html
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/layouts/_default/_markup/render-image.html
@@ -5,7 +5,17 @@
{{ $_.Add "triads" $k }}
{{- end -}}
-{{- if strings.HasPrefix .Destination "bib:" -}}
+{{- if strings.HasPrefix .Destination "img:" -}}
+ {{- $img_params := (substr .Destination 4) -}}
+ {{- $img_src := index (split $img_params " ") 0 -}}
+ {{- $img_attr := index (split $img_params $img_src) 1 -}}
+
+{{- else if strings.HasPrefix .Destination "vid:" -}}
+ {{- $vid_params := (substr .Destination 4) -}}
+ {{- $vid_src := index (split $vid_params " ") 0 -}}
+ {{- $vid_attr := index (split $vid_params $vid_src) 1 -}}
+
+{{- else if strings.HasPrefix .Destination "bib:" -}}
{{- $destination := (substr .Destination 4) -}}
{{- $c_prefix := .Page.Site.Params.sandpointsCatalogPrefix | default "/library/" -}}
{{- if index $.Page.Site.Data.books.catalog $destination -}}
@@ -22,16 +32,16 @@
bib⁄{{- $text_link -}}
{{- end -}}
{{- else -}}
- {{- $text_link -}}⦚bib:{{- $destination -}} not found
+ {{- $text_link -}}⦚bib:{{- $destination -}} not found
{{- end -}}
{{- else if in ($_.Get "triads") (index (split .Destination ":") 0) -}}
{{- if $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
{{- $session := $.Page.Site.GetPage (printf "/%s" (replace .Destination ":" "/")) -}}
{{ .Page.Scratch.Add "links" (slice $session) }}
{{- if not $text_link -}}
- {{- index (split .Destination ":") 0 -}}⁄{{- $session.Title -}}
+ {{- index (split .Destination ":") 0 -}}⁄{{- $session.Title -}}
{{- else -}}
- {{- index (split .Destination ":") 0 -}}⁄{{- $text_link -}}
+ {{- index (split .Destination ":") 0 -}}⁄{{- $text_link -}}
{{- end -}}
{{- else -}}
{{- $text_link -}}⦚{{- .Destination -}} not found
diff --git a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/layouts/partials/header.html b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/layouts/partials/header.html
index 8d506f2..c88addd 100644
--- a/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/layouts/partials/header.html
+++ b/_vendor/git.sandpoints.org/Drawwell/SandpointsTheme/customizations/Dotawo/layouts/partials/header.html
@@ -33,9 +33,19 @@
{{ with $scratch.mantle }}ADD_{{ index . 0 | upper }}{{ end }}
{{ with $scratch.crust }}ADD_{{ index . 0 | upper }}{{ end }}
{{ if not $scratch.core }}ADD_{{ substr $currentDir 0 -1 | upper }}{{ end }}
- PUBLISH
+ PUBLISH
?
+{{ else }}
+ {{ $editPage := $.Site.GetPage "/edit" }}
+
+
{{ end }}
@@ -2523,8 +2792,10 @@
this.hooks.renderNode = new Hook(this);
this.hooks.layoutNode = new Hook(this);
this.hooks.onOverflow = new Hook(this);
+ this.hooks.afterOverflowRemoved = new Hook(this);
this.hooks.onBreakToken = new Hook();
this.hooks.afterPageLayout = new Hook(this);
+ this.hooks.finalizePage = new Hook(this);
this.hooks.afterRendered = new Hook(this);
this.pages = [];
@@ -2631,7 +2902,7 @@
// }
async render(parsed, startAt) {
- let renderer = this.layout(parsed, startAt, this.settings);
+ let renderer = this.layout(parsed, startAt);
let done = false;
let result;
@@ -2681,7 +2952,7 @@
}
}
- async handleBreaks(node) {
+ async handleBreaks(node, force) {
let currentPage = this.total + 1;
let currentPosition = currentPage % 2 === 0 ? "left" : "right";
// TODO: Recto and Verso should reverse for rtl languages
@@ -2706,7 +2977,9 @@
breakBefore = node.dataset.breakBefore;
}
- if( previousBreakAfter &&
+ if (force) {
+ page = this.addPage(true);
+ } else if( previousBreakAfter &&
(previousBreakAfter === "left" || previousBreakAfter === "right") &&
previousBreakAfter !== currentPosition) {
page = this.addPage(true);
@@ -2729,14 +3002,16 @@
this.emit("page", page);
// await this.hooks.layout.trigger(page.element, page, undefined, this);
await this.hooks.afterPageLayout.trigger(page.element, page, undefined, this);
+ await this.hooks.finalizePage.trigger(page.element, page, undefined, this);
this.emit("renderedPage", page);
}
}
async *layout(content, startAt) {
let breakToken = startAt || false;
+ let tokens = [];
- while (breakToken !== undefined && ( true)) {
+ while (breakToken !== undefined && (true)) {
if (breakToken && breakToken.node) {
await this.handleBreaks(breakToken.node);
@@ -2752,7 +3027,20 @@
// Layout content in the page, starting from the breakToken
breakToken = await page.layout(content, breakToken, this.maxChars);
+ if (breakToken) {
+ let newToken = breakToken.toJSON(true);
+ if (tokens.lastIndexOf(newToken) > -1) {
+ // loop
+ let err = new OverflowContentError("Layout repeated", [breakToken.node]);
+ console.error("Layout repeated at: ", breakToken.node);
+ return err;
+ } else {
+ tokens.push(newToken);
+ }
+ }
+
await this.hooks.afterPageLayout.trigger(page.element, page, breakToken, this);
+ await this.hooks.finalizePage.trigger(page.element, page, undefined, this);
this.emit("renderedPage", page);
this.recoredCharLength(page.wrapper.textContent.length);
@@ -2803,7 +3091,7 @@
addPage(blank) {
let lastPage = this.pages[this.pages.length - 1];
// Create a new page from the template
- let page = new Page(this.pagesArea, this.pageTemplate, blank, this.hooks);
+ let page = new Page(this.pagesArea, this.pageTemplate, blank, this.hooks, this.settings);
this.pages.push(page);
@@ -2901,7 +3189,31 @@
}
*/
+ async clonePage(originalPage) {
+ let lastPage = this.pages[this.pages.length - 1];
+ let page = new Page(this.pagesArea, this.pageTemplate, false, this.hooks);
+
+ this.pages.push(page);
+
+ // Create the pages
+ page.create(undefined, lastPage && lastPage.element);
+
+ page.index(this.total);
+
+ await this.hooks.beforePageLayout.trigger(page, undefined, undefined, this);
+ this.emit("page", page);
+
+ for (const className of originalPage.element.classList) {
+ if (className !== "pagedjs_left_page" && className !== "pagedjs_right_page") {
+ page.element.classList.add(className);
+ }
+ }
+
+ await this.hooks.afterPageLayout.trigger(page.element, page, undefined, this);
+ await this.hooks.finalizePage.trigger(page.element, page, undefined, this);
+ this.emit("renderedPage", page);
+ }
loadFonts() {
let fontPromises = [];
@@ -2928,7 +3240,11 @@
}
- eventEmitter(Chunker.prototype);
+ EventEmitter(Chunker.prototype);
+
+ var syntax = {exports: {}};
+
+ var create$5 = {};
//
// list
@@ -2987,16 +3303,16 @@
}
var cursors = null;
- var List = function() {
+ var List$6 = function() {
this.cursor = null;
this.head = null;
this.tail = null;
};
- List.createItem = createItem;
- List.prototype.createItem = createItem;
+ List$6.createItem = createItem;
+ List$6.prototype.createItem = createItem;
- List.prototype.updateCursors = function(prevOld, prevNew, nextOld, nextNew) {
+ List$6.prototype.updateCursors = function(prevOld, prevNew, nextOld, nextNew) {
var cursor = this.cursor;
while (cursor !== null) {
@@ -3012,7 +3328,7 @@
}
};
- List.prototype.getSize = function() {
+ List$6.prototype.getSize = function() {
var size = 0;
var cursor = this.head;
@@ -3024,7 +3340,7 @@
return size;
};
- List.prototype.fromArray = function(array) {
+ List$6.prototype.fromArray = function(array) {
var cursor = null;
this.head = null;
@@ -3047,7 +3363,7 @@
return this;
};
- List.prototype.toArray = function() {
+ List$6.prototype.toArray = function() {
var cursor = this.head;
var result = [];
@@ -3059,21 +3375,21 @@
return result;
};
- List.prototype.toJSON = List.prototype.toArray;
+ List$6.prototype.toJSON = List$6.prototype.toArray;
- List.prototype.isEmpty = function() {
+ List$6.prototype.isEmpty = function() {
return this.head === null;
};
- List.prototype.first = function() {
+ List$6.prototype.first = function() {
return this.head && this.head.data;
};
- List.prototype.last = function() {
+ List$6.prototype.last = function() {
return this.tail && this.tail.data;
};
- List.prototype.each = function(fn, context) {
+ List$6.prototype.each = function(fn, context) {
var item;
if (context === undefined) {
@@ -3094,9 +3410,9 @@
releaseCursor(this);
};
- List.prototype.forEach = List.prototype.each;
+ List$6.prototype.forEach = List$6.prototype.each;
- List.prototype.eachRight = function(fn, context) {
+ List$6.prototype.eachRight = function(fn, context) {
var item;
if (context === undefined) {
@@ -3117,9 +3433,57 @@
releaseCursor(this);
};
- List.prototype.forEachRight = List.prototype.eachRight;
+ List$6.prototype.forEachRight = List$6.prototype.eachRight;
- List.prototype.nextUntil = function(start, fn, context) {
+ List$6.prototype.reduce = function(fn, initialValue, context) {
+ var item;
+
+ if (context === undefined) {
+ context = this;
+ }
+
+ // push cursor
+ var cursor = allocateCursor(this, null, this.head);
+ var acc = initialValue;
+
+ while (cursor.next !== null) {
+ item = cursor.next;
+ cursor.next = item.next;
+
+ acc = fn.call(context, acc, item.data, item, this);
+ }
+
+ // pop cursor
+ releaseCursor(this);
+
+ return acc;
+ };
+
+ List$6.prototype.reduceRight = function(fn, initialValue, context) {
+ var item;
+
+ if (context === undefined) {
+ context = this;
+ }
+
+ // push cursor
+ var cursor = allocateCursor(this, this.tail, null);
+ var acc = initialValue;
+
+ while (cursor.prev !== null) {
+ item = cursor.prev;
+ cursor.prev = item.prev;
+
+ acc = fn.call(context, acc, item.data, item, this);
+ }
+
+ // pop cursor
+ releaseCursor(this);
+
+ return acc;
+ };
+
+ List$6.prototype.nextUntil = function(start, fn, context) {
if (start === null) {
return;
}
@@ -3146,7 +3510,7 @@
releaseCursor(this);
};
- List.prototype.prevUntil = function(start, fn, context) {
+ List$6.prototype.prevUntil = function(start, fn, context) {
if (start === null) {
return;
}
@@ -3173,7 +3537,7 @@
releaseCursor(this);
};
- List.prototype.some = function(fn, context) {
+ List$6.prototype.some = function(fn, context) {
var cursor = this.head;
if (context === undefined) {
@@ -3191,8 +3555,8 @@
return false;
};
- List.prototype.map = function(fn, context) {
- var result = new List();
+ List$6.prototype.map = function(fn, context) {
+ var result = new List$6();
var cursor = this.head;
if (context === undefined) {
@@ -3207,8 +3571,8 @@
return result;
};
- List.prototype.filter = function(fn, context) {
- var result = new List();
+ List$6.prototype.filter = function(fn, context) {
+ var result = new List$6();
var cursor = this.head;
if (context === undefined) {
@@ -3225,13 +3589,13 @@
return result;
};
- List.prototype.clear = function() {
+ List$6.prototype.clear = function() {
this.head = null;
this.tail = null;
};
- List.prototype.copy = function() {
- var result = new List();
+ List$6.prototype.copy = function() {
+ var result = new List$6();
var cursor = this.head;
while (cursor !== null) {
@@ -3242,7 +3606,7 @@
return result;
};
- List.prototype.prepend = function(item) {
+ List$6.prototype.prepend = function(item) {
// head
// ^
// item
@@ -3267,19 +3631,19 @@
return this;
};
- List.prototype.prependData = function(data) {
+ List$6.prototype.prependData = function(data) {
return this.prepend(createItem(data));
};
- List.prototype.append = function(item) {
+ List$6.prototype.append = function(item) {
return this.insert(item);
};
- List.prototype.appendData = function(data) {
+ List$6.prototype.appendData = function(data) {
return this.insert(createItem(data));
};
- List.prototype.insert = function(item, before) {
+ List$6.prototype.insert = function(item, before) {
if (before !== undefined && before !== null) {
// prev before
// ^
@@ -3334,11 +3698,11 @@
return this;
};
- List.prototype.insertData = function(data, before) {
+ List$6.prototype.insertData = function(data, before) {
return this.insert(createItem(data), before);
};
- List.prototype.remove = function(item) {
+ List$6.prototype.remove = function(item) {
// item
// ^
// prev next
@@ -3370,35 +3734,35 @@
return item;
};
- List.prototype.push = function(data) {
+ List$6.prototype.push = function(data) {
this.insert(createItem(data));
};
- List.prototype.pop = function() {
+ List$6.prototype.pop = function() {
if (this.tail !== null) {
return this.remove(this.tail);
}
};
- List.prototype.unshift = function(data) {
+ List$6.prototype.unshift = function(data) {
this.prepend(createItem(data));
};
- List.prototype.shift = function() {
+ List$6.prototype.shift = function() {
if (this.head !== null) {
return this.remove(this.head);
}
};
- List.prototype.prependList = function(list) {
+ List$6.prototype.prependList = function(list) {
return this.insertList(list, this.head);
};
- List.prototype.appendList = function(list) {
+ List$6.prototype.appendList = function(list) {
return this.insertList(list);
};
- List.prototype.insertList = function(list, before) {
+ List$6.prototype.insertList = function(list, before) {
// ignore empty lists
if (list.head === null) {
return this;
@@ -3447,7 +3811,7 @@
return this;
};
- List.prototype.replace = function(oldItem, newItemOrList) {
+ List$6.prototype.replace = function(oldItem, newItemOrList) {
if ('head' in newItemOrList) {
this.insertList(newItemOrList, oldItem);
} else {
@@ -3457,9 +3821,9 @@
this.remove(oldItem);
};
- var List_1 = List;
+ var List_1 = List$6;
- var createCustomError = function createCustomError(name, message) {
+ var createCustomError$3 = function createCustomError(name, message) {
// use Object.create(), because some VMs prevent setting line/column otherwise
// (iOS Safari 10 even throws an exception)
var error = Object.create(SyntaxError.prototype);
@@ -3477,6 +3841,7 @@
return error;
};
+ var createCustomError$2 = createCustomError$3;
var MAX_LINE_LENGTH = 100;
var OFFSET_CORRECTION = 60;
var TAB_REPLACEMENT = ' ';
@@ -3527,8 +3892,8 @@
].filter(Boolean).join('\n');
}
- var SyntaxError$1 = function(message, source, offset, line, column) {
- var error = createCustomError('SyntaxError', message);
+ var SyntaxError$4 = function(message, source, offset, line, column) {
+ var error = createCustomError$2('SyntaxError', message);
error.source = source;
error.offset = offset;
@@ -3557,11 +3922,11 @@
return error;
};
- var _SyntaxError = SyntaxError$1;
+ var _SyntaxError$1 = SyntaxError$4;
// CSS Syntax Module Level 3
// https://www.w3.org/TR/css-syntax-3/
- var TYPE = {
+ var TYPE$H = {
EOF: 0, //
Ident: 1, //
Function: 2, //
@@ -3590,33 +3955,33 @@
Comment: 25
};
- var NAME = Object.keys(TYPE).reduce(function(result, key) {
- result[TYPE[key]] = key;
+ var NAME$3 = Object.keys(TYPE$H).reduce(function(result, key) {
+ result[TYPE$H[key]] = key;
return result;
}, {});
var _const = {
- TYPE: TYPE,
- NAME: NAME
+ TYPE: TYPE$H,
+ NAME: NAME$3
};
- var EOF = 0;
+ var EOF$1 = 0;
// https://drafts.csswg.org/css-syntax-3/
// § 4.2. Definitions
// digit
// A code point between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9).
- function isDigit(code) {
+ function isDigit$5(code) {
return code >= 0x0030 && code <= 0x0039;
}
// hex digit
// A digit, or a code point between U+0041 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F),
// or a code point between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL LETTER F (f).
- function isHexDigit(code) {
+ function isHexDigit$4(code) {
return (
- isDigit(code) || // 0 .. 9
+ isDigit$5(code) || // 0 .. 9
(code >= 0x0041 && code <= 0x0046) || // A .. F
(code >= 0x0061 && code <= 0x0066) // a .. f
);
@@ -3624,7 +3989,7 @@
// uppercase letter
// A code point between U+0041 LATIN CAPITAL LETTER A (A) and U+005A LATIN CAPITAL LETTER Z (Z).
- function isUppercaseLetter(code) {
+ function isUppercaseLetter$1(code) {
return code >= 0x0041 && code <= 0x005A;
}
@@ -3637,7 +4002,7 @@
// letter
// An uppercase letter or a lowercase letter.
function isLetter(code) {
- return isUppercaseLetter(code) || isLowercaseLetter(code);
+ return isUppercaseLetter$1(code) || isLowercaseLetter(code);
}
// non-ASCII code point
@@ -3654,8 +4019,8 @@
// name code point
// A name-start code point, a digit, or U+002D HYPHEN-MINUS (-).
- function isName(code) {
- return isNameStart(code) || isDigit(code) || code === 0x002D;
+ function isName$2(code) {
+ return isNameStart(code) || isDigit$5(code) || code === 0x002D;
}
// non-printable code point
@@ -3674,25 +4039,25 @@
// U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition,
// as they are converted to U+000A LINE FEED during preprocessing.
// TODO: we doesn't do a preprocessing, so check a code point for U+000D CARRIAGE RETURN and U+000C FORM FEED
- function isNewline(code) {
+ function isNewline$1(code) {
return code === 0x000A || code === 0x000D || code === 0x000C;
}
// whitespace
// A newline, U+0009 CHARACTER TABULATION, or U+0020 SPACE.
- function isWhiteSpace(code) {
- return isNewline(code) || code === 0x0020 || code === 0x0009;
+ function isWhiteSpace$2(code) {
+ return isNewline$1(code) || code === 0x0020 || code === 0x0009;
}
// § 4.3.8. Check if two code points are a valid escape
- function isValidEscape(first, second) {
+ function isValidEscape$2(first, second) {
// If the first code point is not U+005C REVERSE SOLIDUS (\), return false.
if (first !== 0x005C) {
return false;
}
// Otherwise, if the second code point is a newline or EOF, return false.
- if (isNewline(second) || second === EOF) {
+ if (isNewline$1(second) || second === EOF$1) {
return false;
}
@@ -3701,7 +4066,7 @@
}
// § 4.3.9. Check if three code points would start an identifier
- function isIdentifierStart(first, second, third) {
+ function isIdentifierStart$2(first, second, third) {
// Look at the first code point:
// U+002D HYPHEN-MINUS
@@ -3711,7 +4076,7 @@
return (
isNameStart(second) ||
second === 0x002D ||
- isValidEscape(second, third)
+ isValidEscape$2(second, third)
);
}
@@ -3724,7 +4089,7 @@
// U+005C REVERSE SOLIDUS (\)
if (first === 0x005C) {
// If the first and second code points are a valid escape, return true. Otherwise, return false.
- return isValidEscape(first, second);
+ return isValidEscape$2(first, second);
}
// anything else
@@ -3733,31 +4098,31 @@
}
// § 4.3.10. Check if three code points would start a number
- function isNumberStart(first, second, third) {
+ function isNumberStart$1(first, second, third) {
// Look at the first code point:
// U+002B PLUS SIGN (+)
// U+002D HYPHEN-MINUS (-)
if (first === 0x002B || first === 0x002D) {
// If the second code point is a digit, return true.
- if (isDigit(second)) {
+ if (isDigit$5(second)) {
return 2;
}
// Otherwise, if the second code point is a U+002E FULL STOP (.)
// and the third code point is a digit, return true.
// Otherwise, return false.
- return second === 0x002E && isDigit(third) ? 3 : 0;
+ return second === 0x002E && isDigit$5(third) ? 3 : 0;
}
// U+002E FULL STOP (.)
if (first === 0x002E) {
// If the second code point is a digit, return true. Otherwise, return false.
- return isDigit(second) ? 2 : 0;
+ return isDigit$5(second) ? 2 : 0;
}
// digit
- if (isDigit(first)) {
+ if (isDigit$5(first)) {
// Return true.
return 1;
}
@@ -3772,7 +4137,7 @@
//
// detect BOM (https://en.wikipedia.org/wiki/Byte_order_mark)
- function isBOM(code) {
+ function isBOM$2(code) {
// UTF-16BE
if (code === 0xFEFF) {
return 1;
@@ -3797,70 +4162,71 @@
// > A name-start code point, a digit, or U+002D HYPHEN-MINUS (-)
// That means only ASCII code points has a special meaning and we define a maps for 0..127 codes only
var CATEGORY = new Array(0x80);
- charCodeCategory.Eof = 0x80;
- charCodeCategory.WhiteSpace = 0x82;
- charCodeCategory.Digit = 0x83;
- charCodeCategory.NameStart = 0x84;
- charCodeCategory.NonPrintable = 0x85;
+ charCodeCategory$1.Eof = 0x80;
+ charCodeCategory$1.WhiteSpace = 0x82;
+ charCodeCategory$1.Digit = 0x83;
+ charCodeCategory$1.NameStart = 0x84;
+ charCodeCategory$1.NonPrintable = 0x85;
for (var i = 0; i < CATEGORY.length; i++) {
switch (true) {
- case isWhiteSpace(i):
- CATEGORY[i] = charCodeCategory.WhiteSpace;
+ case isWhiteSpace$2(i):
+ CATEGORY[i] = charCodeCategory$1.WhiteSpace;
break;
- case isDigit(i):
- CATEGORY[i] = charCodeCategory.Digit;
+ case isDigit$5(i):
+ CATEGORY[i] = charCodeCategory$1.Digit;
break;
case isNameStart(i):
- CATEGORY[i] = charCodeCategory.NameStart;
+ CATEGORY[i] = charCodeCategory$1.NameStart;
break;
case isNonPrintable(i):
- CATEGORY[i] = charCodeCategory.NonPrintable;
+ CATEGORY[i] = charCodeCategory$1.NonPrintable;
break;
default:
- CATEGORY[i] = i || charCodeCategory.Eof;
+ CATEGORY[i] = i || charCodeCategory$1.Eof;
}
}
- function charCodeCategory(code) {
- return code < 0x80 ? CATEGORY[code] : charCodeCategory.NameStart;
+ function charCodeCategory$1(code) {
+ return code < 0x80 ? CATEGORY[code] : charCodeCategory$1.NameStart;
}
- var charCodeDefinitions = {
- isDigit: isDigit,
- isHexDigit: isHexDigit,
- isUppercaseLetter: isUppercaseLetter,
+ var charCodeDefinitions$1 = {
+ isDigit: isDigit$5,
+ isHexDigit: isHexDigit$4,
+ isUppercaseLetter: isUppercaseLetter$1,
isLowercaseLetter: isLowercaseLetter,
isLetter: isLetter,
isNonAscii: isNonAscii,
isNameStart: isNameStart,
- isName: isName,
+ isName: isName$2,
isNonPrintable: isNonPrintable,
- isNewline: isNewline,
- isWhiteSpace: isWhiteSpace,
- isValidEscape: isValidEscape,
- isIdentifierStart: isIdentifierStart,
- isNumberStart: isNumberStart,
+ isNewline: isNewline$1,
+ isWhiteSpace: isWhiteSpace$2,
+ isValidEscape: isValidEscape$2,
+ isIdentifierStart: isIdentifierStart$2,
+ isNumberStart: isNumberStart$1,
- isBOM: isBOM,
- charCodeCategory: charCodeCategory
+ isBOM: isBOM$2,
+ charCodeCategory: charCodeCategory$1
};
- var isDigit$1 = charCodeDefinitions.isDigit;
- var isHexDigit$1 = charCodeDefinitions.isHexDigit;
- var isUppercaseLetter$1 = charCodeDefinitions.isUppercaseLetter;
- var isName$1 = charCodeDefinitions.isName;
- var isWhiteSpace$1 = charCodeDefinitions.isWhiteSpace;
- var isValidEscape$1 = charCodeDefinitions.isValidEscape;
+ var charCodeDef = charCodeDefinitions$1;
+ var isDigit$4 = charCodeDef.isDigit;
+ var isHexDigit$3 = charCodeDef.isHexDigit;
+ var isUppercaseLetter = charCodeDef.isUppercaseLetter;
+ var isName$1 = charCodeDef.isName;
+ var isWhiteSpace$1 = charCodeDef.isWhiteSpace;
+ var isValidEscape$1 = charCodeDef.isValidEscape;
function getCharCode(source, offset) {
return offset < source.length ? source.charCodeAt(offset) : 0;
}
- function getNewlineLength(source, offset, code) {
+ function getNewlineLength$1(source, offset, code) {
if (code === 13 /* \r */ && getCharCode(source, offset + 1) === 10 /* \n */) {
return 2;
}
@@ -3868,18 +4234,18 @@
return 1;
}
- function cmpChar(testStr, offset, referenceCode) {
+ function cmpChar$5(testStr, offset, referenceCode) {
var code = testStr.charCodeAt(offset);
// code.toLowerCase() for A..Z
- if (isUppercaseLetter$1(code)) {
+ if (isUppercaseLetter(code)) {
code = code | 32;
}
return code === referenceCode;
}
- function cmpStr(testStr, start, end, referenceStr) {
+ function cmpStr$6(testStr, start, end, referenceStr) {
if (end - start !== referenceStr.length) {
return false;
}
@@ -3893,7 +4259,7 @@
var referenceCode = referenceStr.charCodeAt(i - start);
// testCode.toLowerCase() for A..Z
- if (isUppercaseLetter$1(testCode)) {
+ if (isUppercaseLetter(testCode)) {
testCode = testCode | 32;
}
@@ -3905,7 +4271,7 @@
return true;
}
- function findWhiteSpaceStart(source, offset) {
+ function findWhiteSpaceStart$1(source, offset) {
for (; offset >= 0; offset--) {
if (!isWhiteSpace$1(source.charCodeAt(offset))) {
break;
@@ -3915,7 +4281,7 @@
return offset + 1;
}
- function findWhiteSpaceEnd(source, offset) {
+ function findWhiteSpaceEnd$1(source, offset) {
for (; offset < source.length; offset++) {
if (!isWhiteSpace$1(source.charCodeAt(offset))) {
break;
@@ -3927,7 +4293,7 @@
function findDecimalNumberEnd(source, offset) {
for (; offset < source.length; offset++) {
- if (!isDigit$1(source.charCodeAt(offset))) {
+ if (!isDigit$4(source.charCodeAt(offset))) {
break;
}
}
@@ -3936,17 +4302,17 @@
}
// § 4.3.7. Consume an escaped code point
- function consumeEscaped(source, offset) {
+ function consumeEscaped$1(source, offset) {
// It assumes that the U+005C REVERSE SOLIDUS (\) has already been consumed and
// that the next input code point has already been verified to be part of a valid escape.
offset += 2;
// hex digit
- if (isHexDigit$1(getCharCode(source, offset - 1))) {
+ if (isHexDigit$3(getCharCode(source, offset - 1))) {
// Consume as many hex digits as possible, but no more than 5.
// Note that this means 1-6 hex digits have been consumed in total.
for (var maxOffset = Math.min(source.length, offset + 5); offset < maxOffset; offset++) {
- if (!isHexDigit$1(getCharCode(source, offset))) {
+ if (!isHexDigit$3(getCharCode(source, offset))) {
break;
}
}
@@ -3954,7 +4320,7 @@
// If the next input code point is whitespace, consume it as well.
var code = getCharCode(source, offset);
if (isWhiteSpace$1(code)) {
- offset += getNewlineLength(source, offset, code);
+ offset += getNewlineLength$1(source, offset, code);
}
}
@@ -3965,7 +4331,7 @@
// Note: This algorithm does not do the verification of the first few code points that are necessary
// to ensure the returned code points would constitute an . If that is the intended use,
// ensure that the stream starts with an identifier before calling this algorithm.
- function consumeName(source, offset) {
+ function consumeName$1(source, offset) {
// Let result initially be an empty string.
// Repeatedly consume the next input code point from the stream:
for (; offset < source.length; offset++) {
@@ -3980,7 +4346,7 @@
// the stream starts with a valid escape
if (isValidEscape$1(code, getCharCode(source, offset + 1))) {
// Consume an escaped code point. Append the returned code point to result.
- offset = consumeEscaped(source, offset) - 1;
+ offset = consumeEscaped$1(source, offset) - 1;
continue;
}
@@ -3993,7 +4359,7 @@
}
// §4.3.12. Consume a number
- function consumeNumber(source, offset) {
+ function consumeNumber$5(source, offset) {
var code = source.charCodeAt(offset);
// 2. If the next input code point is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-),
@@ -4003,13 +4369,13 @@
}
// 3. While the next input code point is a digit, consume it and append it to repr.
- if (isDigit$1(code)) {
+ if (isDigit$4(code)) {
offset = findDecimalNumberEnd(source, offset + 1);
code = source.charCodeAt(offset);
}
// 4. If the next 2 input code points are U+002E FULL STOP (.) followed by a digit, then:
- if (code === 0x002E && isDigit$1(source.charCodeAt(offset + 1))) {
+ if (code === 0x002E && isDigit$4(source.charCodeAt(offset + 1))) {
// 4.1 Consume them.
// 4.2 Append them to repr.
code = source.charCodeAt(offset += 2);
@@ -4024,7 +4390,7 @@
// 5. If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E)
// or U+0065 LATIN SMALL LETTER E (e), ... , followed by a digit, then:
- if (cmpChar(source, offset, 101 /* e */)) {
+ if (cmpChar$5(source, offset, 101 /* e */)) {
var sign = 0;
code = source.charCodeAt(offset + 1);
@@ -4035,7 +4401,7 @@
}
// ... followed by a digit
- if (isDigit$1(code)) {
+ if (isDigit$4(code)) {
// 5.1 Consume them.
// 5.2 Append them to repr.
@@ -4053,7 +4419,7 @@
// § 4.3.14. Consume the remnants of a bad url
// ... its sole use is to consume enough of the input stream to reach a recovery point
// where normal tokenizing can resume.
- function consumeBadUrlRemnants(source, offset) {
+ function consumeBadUrlRemnants$1(source, offset) {
// Repeatedly consume the next input code point from the stream:
for (; offset < source.length; offset++) {
var code = source.charCodeAt(offset);
@@ -4071,48 +4437,49 @@
// Note: This allows an escaped right parenthesis ("\)") to be encountered
// without ending the . This is otherwise identical to
// the "anything else" clause.
- offset = consumeEscaped(source, offset);
+ offset = consumeEscaped$1(source, offset);
}
}
return offset;
}
- var utils = {
- consumeEscaped: consumeEscaped,
- consumeName: consumeName,
- consumeNumber: consumeNumber,
- consumeBadUrlRemnants: consumeBadUrlRemnants,
+ var utils$2 = {
+ consumeEscaped: consumeEscaped$1,
+ consumeName: consumeName$1,
+ consumeNumber: consumeNumber$5,
+ consumeBadUrlRemnants: consumeBadUrlRemnants$1,
- cmpChar: cmpChar,
- cmpStr: cmpStr,
+ cmpChar: cmpChar$5,
+ cmpStr: cmpStr$6,
- getNewlineLength: getNewlineLength,
- findWhiteSpaceStart: findWhiteSpaceStart,
- findWhiteSpaceEnd: findWhiteSpaceEnd
+ getNewlineLength: getNewlineLength$1,
+ findWhiteSpaceStart: findWhiteSpaceStart$1,
+ findWhiteSpaceEnd: findWhiteSpaceEnd$1
};
- var TYPE$1 = _const.TYPE;
- var NAME$1 = _const.NAME;
+ var constants$2 = _const;
+ var TYPE$G = constants$2.TYPE;
+ var NAME$2 = constants$2.NAME;
+ var utils$1 = utils$2;
+ var cmpStr$5 = utils$1.cmpStr;
- var cmpStr$1 = utils.cmpStr;
+ var EOF = TYPE$G.EOF;
+ var WHITESPACE$c = TYPE$G.WhiteSpace;
+ var COMMENT$a = TYPE$G.Comment;
- var EOF$1 = TYPE$1.EOF;
- var WHITESPACE = TYPE$1.WhiteSpace;
- var COMMENT = TYPE$1.Comment;
+ var OFFSET_MASK$1 = 0x00FFFFFF;
+ var TYPE_SHIFT$1 = 24;
- var OFFSET_MASK = 0x00FFFFFF;
- var TYPE_SHIFT = 24;
-
- var TokenStream = function() {
+ var TokenStream$4 = function() {
this.offsetAndType = null;
this.balance = null;
this.reset();
};
- TokenStream.prototype = {
+ TokenStream$4.prototype = {
reset: function() {
this.eof = false;
this.tokenIndex = -1;
@@ -4125,16 +4492,16 @@
offset += this.tokenIndex;
if (offset < this.tokenCount) {
- return this.offsetAndType[offset] >> TYPE_SHIFT;
+ return this.offsetAndType[offset] >> TYPE_SHIFT$1;
}
- return EOF$1;
+ return EOF;
},
lookupOffset: function(offset) {
offset += this.tokenIndex;
if (offset < this.tokenCount) {
- return this.offsetAndType[offset - 1] & OFFSET_MASK;
+ return this.offsetAndType[offset - 1] & OFFSET_MASK$1;
}
return this.source.length;
@@ -4143,10 +4510,10 @@
offset += this.tokenIndex;
if (offset < this.tokenCount) {
- return cmpStr$1(
+ return cmpStr$5(
this.source,
- this.offsetAndType[offset - 1] & OFFSET_MASK,
- this.offsetAndType[offset] & OFFSET_MASK,
+ this.offsetAndType[offset - 1] & OFFSET_MASK$1,
+ this.offsetAndType[offset] & OFFSET_MASK$1,
referenceStr
);
}
@@ -4160,8 +4527,8 @@
if (tokenIndex > 0) {
return tokenIndex < this.tokenCount
- ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK
- : this.offsetAndType[this.tokenCount] & OFFSET_MASK;
+ ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK$1
+ : this.offsetAndType[this.tokenCount] & OFFSET_MASK$1;
}
return this.firstCharOffset;
@@ -4171,7 +4538,7 @@
getRawLength: function(startToken, mode) {
var cursor = startToken;
var balanceEnd;
- var offset = this.offsetAndType[Math.max(cursor - 1, 0)] & OFFSET_MASK;
+ var offset = this.offsetAndType[Math.max(cursor - 1, 0)] & OFFSET_MASK$1;
var type;
loop:
@@ -4183,7 +4550,7 @@
break loop;
}
- type = this.offsetAndType[cursor] >> TYPE_SHIFT;
+ type = this.offsetAndType[cursor] >> TYPE_SHIFT$1;
// check token is stop type
switch (mode(type, this.source, offset)) {
@@ -4195,12 +4562,12 @@
break loop;
default:
- offset = this.offsetAndType[cursor] & OFFSET_MASK;
-
// fast forward to the end of balanced block
if (this.balance[balanceEnd] === cursor) {
cursor = balanceEnd;
}
+
+ offset = this.offsetAndType[cursor] & OFFSET_MASK$1;
}
}
@@ -4212,13 +4579,13 @@
isDelim: function(code, offset) {
if (offset) {
return (
- this.lookupType(offset) === TYPE$1.Delim &&
+ this.lookupType(offset) === TYPE$G.Delim &&
this.source.charCodeAt(this.lookupOffset(offset)) === code
);
}
return (
- this.tokenType === TYPE$1.Delim &&
+ this.tokenType === TYPE$G.Delim &&
this.source.charCodeAt(this.tokenStart) === code
);
},
@@ -4235,7 +4602,7 @@
skipWS: function() {
for (var i = this.tokenIndex, skipTokenCount = 0; i < this.tokenCount; i++, skipTokenCount++) {
- if ((this.offsetAndType[i] >> TYPE_SHIFT) !== WHITESPACE) {
+ if ((this.offsetAndType[i] >> TYPE_SHIFT$1) !== WHITESPACE$c) {
break;
}
}
@@ -4245,7 +4612,7 @@
}
},
skipSC: function() {
- while (this.tokenType === WHITESPACE || this.tokenType === COMMENT) {
+ while (this.tokenType === WHITESPACE$c || this.tokenType === COMMENT$a) {
this.next();
}
},
@@ -4254,10 +4621,10 @@
if (next < this.tokenCount) {
this.tokenIndex = next;
- this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;
+ this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK$1;
next = this.offsetAndType[next];
- this.tokenType = next >> TYPE_SHIFT;
- this.tokenEnd = next & OFFSET_MASK;
+ this.tokenType = next >> TYPE_SHIFT$1;
+ this.tokenEnd = next & OFFSET_MASK$1;
} else {
this.tokenIndex = this.tokenCount;
this.next();
@@ -4270,38 +4637,48 @@
this.tokenIndex = next;
this.tokenStart = this.tokenEnd;
next = this.offsetAndType[next];
- this.tokenType = next >> TYPE_SHIFT;
- this.tokenEnd = next & OFFSET_MASK;
+ this.tokenType = next >> TYPE_SHIFT$1;
+ this.tokenEnd = next & OFFSET_MASK$1;
} else {
this.tokenIndex = this.tokenCount;
this.eof = true;
- this.tokenType = EOF$1;
+ this.tokenType = EOF;
this.tokenStart = this.tokenEnd = this.source.length;
}
},
- dump: function() {
- var offset = this.firstCharOffset;
-
- return Array.prototype.slice.call(this.offsetAndType, 0, this.tokenCount).map(function(item, idx) {
+ forEachToken(fn) {
+ for (var i = 0, offset = this.firstCharOffset; i < this.tokenCount; i++) {
var start = offset;
- var end = item & OFFSET_MASK;
+ var item = this.offsetAndType[i];
+ var end = item & OFFSET_MASK$1;
+ var type = item >> TYPE_SHIFT$1;
offset = end;
- return {
- idx: idx,
- type: NAME$1[item >> TYPE_SHIFT],
+ fn(type, start, end, i);
+ }
+ },
+
+ dump() {
+ var tokens = new Array(this.tokenCount);
+
+ this.forEachToken((type, start, end, index) => {
+ tokens[index] = {
+ idx: index,
+ type: NAME$2[type],
chunk: this.source.substring(start, end),
- balance: this.balance[idx]
+ balance: this.balance[index]
};
- }, this);
+ });
+
+ return tokens;
}
};
- var TokenStream_1 = TokenStream;
+ var TokenStream_1 = TokenStream$4;
- function noop$1(value) {
+ function noop$3(value) {
return value;
}
@@ -4350,7 +4727,7 @@
function generateSequence(node, decorate, forceBraces, compact) {
var combinator = node.combinator === ' ' || compact ? node.combinator : ' ' + node.combinator + ' ';
var result = node.terms.map(function(term) {
- return generate(term, decorate, forceBraces, compact);
+ return generate$2(term, decorate, forceBraces, compact);
}).join(combinator);
if (node.explicit || forceBraces) {
@@ -4360,7 +4737,7 @@
return result;
}
- function generate(node, decorate, forceBraces, compact) {
+ function generate$2(node, decorate, forceBraces, compact) {
var result;
switch (node.type) {
@@ -4373,7 +4750,7 @@
case 'Multiplier':
// return since node is a composition
return (
- generate(node.term, decorate, forceBraces, compact) +
+ generate$2(node.term, decorate, forceBraces, compact) +
decorate(generateMultiplier(node), node)
);
@@ -4414,7 +4791,7 @@
}
var generate_1 = function(node, options) {
- var decorate = noop$1;
+ var decorate = noop$3;
var forceBraces = false;
var compact = false;
@@ -4428,23 +4805,34 @@
}
}
- return generate(node, decorate, forceBraces, compact);
+ return generate$2(node, decorate, forceBraces, compact);
};
- function fromMatchResult(matchResult) {
- var tokens = matchResult.tokens;
- var longestMatch = matchResult.longestMatch;
- var node = longestMatch < tokens.length ? tokens[longestMatch].node : null;
- var mismatchOffset = -1;
- var entries = 0;
- var css = '';
+ const createCustomError$1 = createCustomError$3;
+ const generate$1 = generate_1;
+ const defaultLoc = { offset: 0, line: 1, column: 1 };
+
+ function locateMismatch(matchResult, node) {
+ const tokens = matchResult.tokens;
+ const longestMatch = matchResult.longestMatch;
+ const mismatchNode = longestMatch < tokens.length ? tokens[longestMatch].node || null : null;
+ const badNode = mismatchNode !== node ? mismatchNode : null;
+ let mismatchOffset = 0;
+ let mismatchLength = 0;
+ let entries = 0;
+ let css = '';
+ let start;
+ let end;
+
+ for (let i = 0; i < tokens.length; i++) {
+ const token = tokens[i].value;
- for (var i = 0; i < tokens.length; i++) {
if (i === longestMatch) {
+ mismatchLength = token.length;
mismatchOffset = css.length;
}
- if (node !== null && tokens[i].node === node) {
+ if (badNode !== null && tokens[i].node === badNode) {
if (i <= longestMatch) {
entries++;
} else {
@@ -4452,33 +4840,58 @@
}
}
- css += tokens[i].value;
+ css += token;
+ }
+
+ if (longestMatch === tokens.length || entries > 1) { // last
+ start = fromLoc(badNode || node, 'end') || buildLoc(defaultLoc, css);
+ end = buildLoc(start);
+ } else {
+ start = fromLoc(badNode, 'start') ||
+ buildLoc(fromLoc(node, 'start') || defaultLoc, css.slice(0, mismatchOffset));
+ end = fromLoc(badNode, 'end') ||
+ buildLoc(start, css.substr(mismatchOffset, mismatchLength));
}
return {
- node: node,
- css: css,
- mismatchOffset: mismatchOffset === -1 ? css.length : mismatchOffset,
- last: node === null || entries > 1
+ css,
+ mismatchOffset,
+ mismatchLength,
+ start,
+ end
};
}
- function getLocation(node, point) {
- var loc = node && node.loc && node.loc[point];
+ function fromLoc(node, point) {
+ const value = node && node.loc && node.loc[point];
- if (loc) {
- return {
- offset: loc.offset,
- line: loc.line,
- column: loc.column
- };
+ if (value) {
+ return 'line' in value ? buildLoc(value) : value;
}
return null;
}
- var SyntaxReferenceError = function(type, referenceName) {
- var error = createCustomError(
+ function buildLoc({ offset, line, column }, extra) {
+ const loc = {
+ offset,
+ line,
+ column
+ };
+
+ if (extra) {
+ const lines = extra.split(/\n|\r\n?|\f/);
+
+ loc.offset += extra.length;
+ loc.line += lines.length - 1;
+ loc.column = lines.length === 1 ? loc.column + extra.length : lines.pop().length + 1;
+ }
+
+ return loc;
+ }
+
+ const SyntaxReferenceError$1 = function(type, referenceName) {
+ const error = createCustomError$1(
'SyntaxReferenceError',
type + (referenceName ? ' `' + referenceName + '`' : '')
);
@@ -4488,51 +4901,52 @@
return error;
};
- var MatchError = function(message, syntax, node, matchResult) {
- var error = createCustomError('SyntaxMatchError', message);
- var details = fromMatchResult(matchResult);
- var mismatchOffset = details.mismatchOffset || 0;
- var badNode = details.node || node;
- var end = getLocation(badNode, 'end');
- var start = details.last ? end : getLocation(badNode, 'start');
- var css = details.css;
+ const SyntaxMatchError$1 = function(message, syntax, node, matchResult) {
+ const error = createCustomError$1('SyntaxMatchError', message);
+ const {
+ css,
+ mismatchOffset,
+ mismatchLength,
+ start,
+ end
+ } = locateMismatch(matchResult, node);
error.rawMessage = message;
- error.syntax = syntax ? generate_1(syntax) : '';
+ error.syntax = syntax ? generate$1(syntax) : '';
error.css = css;
error.mismatchOffset = mismatchOffset;
- error.loc = {
- source: (badNode && badNode.loc && badNode.loc.source) || '',
- start: start,
- end: end
- };
- error.line = start ? start.line : undefined;
- error.column = start ? start.column : undefined;
- error.offset = start ? start.offset : undefined;
+ error.mismatchLength = mismatchLength;
error.message = message + '\n' +
' syntax: ' + error.syntax + '\n' +
- ' value: ' + (error.css || '') + '\n' +
+ ' value: ' + (css || '') + '\n' +
' --------' + new Array(error.mismatchOffset + 1).join('-') + '^';
+ Object.assign(error, start);
+ error.loc = {
+ source: (node && node.loc && node.loc.source) || '',
+ start,
+ end
+ };
+
return error;
};
var error = {
- SyntaxReferenceError: SyntaxReferenceError,
- MatchError: MatchError
+ SyntaxReferenceError: SyntaxReferenceError$1,
+ SyntaxMatchError: SyntaxMatchError$1
};
- var hasOwnProperty = Object.prototype.hasOwnProperty;
- var keywords = Object.create(null);
- var properties = Object.create(null);
- var HYPHENMINUS = 45; // '-'.charCodeAt()
+ var hasOwnProperty$7 = Object.prototype.hasOwnProperty;
+ var keywords$1 = Object.create(null);
+ var properties$1 = Object.create(null);
+ var HYPHENMINUS$5 = 45; // '-'.charCodeAt()
- function isCustomProperty(str, offset) {
+ function isCustomProperty$1(str, offset) {
offset = offset || 0;
return str.length - offset >= 2 &&
- str.charCodeAt(offset) === HYPHENMINUS &&
- str.charCodeAt(offset + 1) === HYPHENMINUS;
+ str.charCodeAt(offset) === HYPHENMINUS$5 &&
+ str.charCodeAt(offset + 1) === HYPHENMINUS$5;
}
function getVendorPrefix(str, offset) {
@@ -4541,8 +4955,8 @@
// verdor prefix should be at least 3 chars length
if (str.length - offset >= 3) {
// vendor prefix starts with hyper minus following non-hyper minus
- if (str.charCodeAt(offset) === HYPHENMINUS &&
- str.charCodeAt(offset + 1) !== HYPHENMINUS) {
+ if (str.charCodeAt(offset) === HYPHENMINUS$5 &&
+ str.charCodeAt(offset + 1) !== HYPHENMINUS$5) {
// vendor prefix should contain a hyper minus at the ending
var secondDashIndex = str.indexOf('-', offset + 2);
@@ -4556,20 +4970,20 @@
}
function getKeywordDescriptor(keyword) {
- if (hasOwnProperty.call(keywords, keyword)) {
- return keywords[keyword];
+ if (hasOwnProperty$7.call(keywords$1, keyword)) {
+ return keywords$1[keyword];
}
var name = keyword.toLowerCase();
- if (hasOwnProperty.call(keywords, name)) {
- return keywords[keyword] = keywords[name];
+ if (hasOwnProperty$7.call(keywords$1, name)) {
+ return keywords$1[keyword] = keywords$1[name];
}
- var custom = isCustomProperty(name, 0);
+ var custom = isCustomProperty$1(name, 0);
var vendor = !custom ? getVendorPrefix(name, 0) : '';
- return keywords[keyword] = Object.freeze({
+ return keywords$1[keyword] = Object.freeze({
basename: name.substr(vendor.length),
name: name,
vendor: vendor,
@@ -4579,8 +4993,8 @@
}
function getPropertyDescriptor(property) {
- if (hasOwnProperty.call(properties, property)) {
- return properties[property];
+ if (hasOwnProperty$7.call(properties$1, property)) {
+ return properties$1[property];
}
var name = property;
@@ -4597,20 +5011,20 @@
hack = '';
}
- var custom = isCustomProperty(name, hack.length);
+ var custom = isCustomProperty$1(name, hack.length);
// re-use result when possible (the same as for lower case)
if (!custom) {
name = name.toLowerCase();
- if (hasOwnProperty.call(properties, name)) {
- return properties[property] = properties[name];
+ if (hasOwnProperty$7.call(properties$1, name)) {
+ return properties$1[property] = properties$1[name];
}
}
var vendor = !custom ? getVendorPrefix(name, hack.length) : '';
var prefix = name.substr(0, hack.length + vendor.length);
- return properties[property] = Object.freeze({
+ return properties$1[property] = Object.freeze({
basename: name.substr(prefix.length),
name: name.substr(hack.length),
hack: hack,
@@ -4620,17 +5034,17 @@
});
}
- var names = {
+ var names$2 = {
keyword: getKeywordDescriptor,
property: getPropertyDescriptor,
- isCustomProperty: isCustomProperty,
+ isCustomProperty: isCustomProperty$1,
vendorPrefix: getVendorPrefix
};
var MIN_SIZE = 16 * 1024;
var SafeUint32Array = typeof Uint32Array !== 'undefined' ? Uint32Array : Array; // fallback on Array when TypedArray is not supported
- var adoptBuffer = function adoptBuffer(buffer, size) {
+ var adoptBuffer$2 = function adoptBuffer(buffer, size) {
if (buffer === null || buffer.length < size) {
return new SafeUint32Array(Math.max(size + 1024, MIN_SIZE));
}
@@ -4638,30 +5052,34 @@
return buffer;
};
- var TYPE$2 = _const.TYPE;
+ var TokenStream$3 = TokenStream_1;
+ var adoptBuffer$1 = adoptBuffer$2;
+ var constants$1 = _const;
+ var TYPE$F = constants$1.TYPE;
- var isNewline$1 = charCodeDefinitions.isNewline;
- var isName$2 = charCodeDefinitions.isName;
- var isValidEscape$2 = charCodeDefinitions.isValidEscape;
- var isNumberStart$1 = charCodeDefinitions.isNumberStart;
+ var charCodeDefinitions = charCodeDefinitions$1;
+ var isNewline = charCodeDefinitions.isNewline;
+ var isName = charCodeDefinitions.isName;
+ var isValidEscape = charCodeDefinitions.isValidEscape;
+ var isNumberStart = charCodeDefinitions.isNumberStart;
var isIdentifierStart$1 = charCodeDefinitions.isIdentifierStart;
- var charCodeCategory$1 = charCodeDefinitions.charCodeCategory;
+ var charCodeCategory = charCodeDefinitions.charCodeCategory;
var isBOM$1 = charCodeDefinitions.isBOM;
+ var utils = utils$2;
+ var cmpStr$4 = utils.cmpStr;
+ var getNewlineLength = utils.getNewlineLength;
+ var findWhiteSpaceEnd = utils.findWhiteSpaceEnd;
+ var consumeEscaped = utils.consumeEscaped;
+ var consumeName = utils.consumeName;
+ var consumeNumber$4 = utils.consumeNumber;
+ var consumeBadUrlRemnants = utils.consumeBadUrlRemnants;
- var cmpStr$2 = utils.cmpStr;
- var getNewlineLength$1 = utils.getNewlineLength;
- var findWhiteSpaceEnd$1 = utils.findWhiteSpaceEnd;
- var consumeEscaped$1 = utils.consumeEscaped;
- var consumeName$1 = utils.consumeName;
- var consumeNumber$1 = utils.consumeNumber;
- var consumeBadUrlRemnants$1 = utils.consumeBadUrlRemnants;
+ var OFFSET_MASK = 0x00FFFFFF;
+ var TYPE_SHIFT = 24;
- var OFFSET_MASK$1 = 0x00FFFFFF;
- var TYPE_SHIFT$1 = 24;
-
- function tokenize(source, stream) {
+ function tokenize$3(source, stream) {
function getCharCode(offset) {
return offset < sourceLength ? source.charCodeAt(offset) : 0;
}
@@ -4669,28 +5087,28 @@
// § 4.3.3. Consume a numeric token
function consumeNumericToken() {
// Consume a number and let number be the result.
- offset = consumeNumber$1(source, offset);
+ offset = consumeNumber$4(source, offset);
// If the next 3 input code points would start an identifier, then:
if (isIdentifierStart$1(getCharCode(offset), getCharCode(offset + 1), getCharCode(offset + 2))) {
// Create a with the same value and type flag as number, and a unit set initially to the empty string.
// Consume a name. Set the ’s unit to the returned value.
// Return the .
- type = TYPE$2.Dimension;
- offset = consumeName$1(source, offset);
+ type = TYPE$F.Dimension;
+ offset = consumeName(source, offset);
return;
}
// Otherwise, if the next input code point is U+0025 PERCENTAGE SIGN (%), consume it.
if (getCharCode(offset) === 0x0025) {
// Create a with the same value as number, and return it.
- type = TYPE$2.Percentage;
+ type = TYPE$F.Percentage;
offset++;
return;
}
// Otherwise, create a with the same value and type flag as number, and return it.
- type = TYPE$2.Number;
+ type = TYPE$F.Number;
}
// § 4.3.4. Consume an ident-like token
@@ -4698,20 +5116,20 @@
const nameStartOffset = offset;
// Consume a name, and let string be the result.
- offset = consumeName$1(source, offset);
+ offset = consumeName(source, offset);
// If string’s value is an ASCII case-insensitive match for "url",
// and the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
- if (cmpStr$2(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {
+ if (cmpStr$4(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {
// While the next two input code points are whitespace, consume the next input code point.
- offset = findWhiteSpaceEnd$1(source, offset + 1);
+ offset = findWhiteSpaceEnd(source, offset + 1);
// If the next one or two input code points are U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('),
// or whitespace followed by U+0022 QUOTATION MARK (") or U+0027 APOSTROPHE ('),
// then create a with its value set to string and return it.
if (getCharCode(offset) === 0x0022 ||
getCharCode(offset) === 0x0027) {
- type = TYPE$2.Function;
+ type = TYPE$F.Function;
offset = nameStartOffset + 4;
return;
}
@@ -4724,13 +5142,13 @@
// Otherwise, if the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
// Create a with its value set to string and return it.
if (getCharCode(offset) === 0x0028) {
- type = TYPE$2.Function;
+ type = TYPE$F.Function;
offset++;
return;
}
// Otherwise, create an with its value set to string and return it.
- type = TYPE$2.Ident;
+ type = TYPE$F.Ident;
}
// § 4.3.5. Consume a string token
@@ -4743,13 +5161,13 @@
}
// Initially create a with its value set to the empty string.
- type = TYPE$2.String;
+ type = TYPE$F.String;
// Repeatedly consume the next input code point from the stream:
for (; offset < source.length; offset++) {
var code = source.charCodeAt(offset);
- switch (charCodeCategory$1(code)) {
+ switch (charCodeCategory(code)) {
// ending code point
case endingCodePoint:
// Return the .
@@ -4757,17 +5175,17 @@
return;
// EOF
- case charCodeCategory$1.Eof:
+ case charCodeCategory.Eof:
// This is a parse error. Return the .
return;
// newline
- case charCodeCategory$1.WhiteSpace:
- if (isNewline$1(code)) {
+ case charCodeCategory.WhiteSpace:
+ if (isNewline(code)) {
// This is a parse error. Reconsume the current input code point,
// create a , and return it.
- offset += getNewlineLength$1(source, offset, code);
- type = TYPE$2.BadString;
+ offset += getNewlineLength(source, offset, code);
+ type = TYPE$F.BadString;
return;
}
break;
@@ -4782,13 +5200,13 @@
var nextCode = getCharCode(offset + 1);
// Otherwise, if the next input code point is a newline, consume it.
- if (isNewline$1(nextCode)) {
- offset += getNewlineLength$1(source, offset + 1, nextCode);
- } else if (isValidEscape$2(code, nextCode)) {
+ if (isNewline(nextCode)) {
+ offset += getNewlineLength(source, offset + 1, nextCode);
+ } else if (isValidEscape(code, nextCode)) {
// Otherwise, (the stream starts with a valid escape) consume
// an escaped code point and append the returned code point to
// the ’s value.
- offset = consumeEscaped$1(source, offset) - 1;
+ offset = consumeEscaped(source, offset) - 1;
}
break;
@@ -4805,16 +5223,16 @@
// automatically handles this distinction; this algorithm shouldn’t be called directly otherwise.
function consumeUrlToken() {
// Initially create a with its value set to the empty string.
- type = TYPE$2.Url;
+ type = TYPE$F.Url;
// Consume as much whitespace as possible.
- offset = findWhiteSpaceEnd$1(source, offset);
+ offset = findWhiteSpaceEnd(source, offset);
// Repeatedly consume the next input code point from the stream:
for (; offset < source.length; offset++) {
var code = source.charCodeAt(offset);
- switch (charCodeCategory$1(code)) {
+ switch (charCodeCategory(code)) {
// U+0029 RIGHT PARENTHESIS ())
case 0x0029:
// Return the .
@@ -4822,14 +5240,14 @@
return;
// EOF
- case charCodeCategory$1.Eof:
+ case charCodeCategory.Eof:
// This is a parse error. Return the .
return;
// whitespace
- case charCodeCategory$1.WhiteSpace:
+ case charCodeCategory.WhiteSpace:
// Consume as much whitespace as possible.
- offset = findWhiteSpaceEnd$1(source, offset);
+ offset = findWhiteSpaceEnd(source, offset);
// If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF,
// consume it and return the
@@ -4843,8 +5261,8 @@
// otherwise, consume the remnants of a bad url, create a ,
// and return it.
- offset = consumeBadUrlRemnants$1(source, offset);
- type = TYPE$2.BadUrl;
+ offset = consumeBadUrlRemnants(source, offset);
+ type = TYPE$F.BadUrl;
return;
// U+0022 QUOTATION MARK (")
@@ -4854,26 +5272,26 @@
case 0x0022:
case 0x0027:
case 0x0028:
- case charCodeCategory$1.NonPrintable:
+ case charCodeCategory.NonPrintable:
// This is a parse error. Consume the remnants of a bad url,
// create a , and return it.
- offset = consumeBadUrlRemnants$1(source, offset);
- type = TYPE$2.BadUrl;
+ offset = consumeBadUrlRemnants(source, offset);
+ type = TYPE$F.BadUrl;
return;
// U+005C REVERSE SOLIDUS (\)
case 0x005C:
// If the stream starts with a valid escape, consume an escaped code point and
// append the returned code point to the ’s value.
- if (isValidEscape$2(code, getCharCode(offset + 1))) {
- offset = consumeEscaped$1(source, offset) - 1;
+ if (isValidEscape(code, getCharCode(offset + 1))) {
+ offset = consumeEscaped(source, offset) - 1;
break;
}
// Otherwise, this is a parse error. Consume the remnants of a bad url,
// create a , and return it.
- offset = consumeBadUrlRemnants$1(source, offset);
- type = TYPE$2.BadUrl;
+ offset = consumeBadUrlRemnants(source, offset);
+ type = TYPE$F.BadUrl;
return;
// anything else
@@ -4883,15 +5301,15 @@
}
if (!stream) {
- stream = new TokenStream_1();
+ stream = new TokenStream$3();
}
// ensure source is a string
source = String(source || '');
var sourceLength = source.length;
- var offsetAndType = adoptBuffer(stream.offsetAndType, sourceLength + 1); // +1 because of eof-token
- var balance = adoptBuffer(stream.balance, sourceLength + 1);
+ var offsetAndType = adoptBuffer$1(stream.offsetAndType, sourceLength + 1); // +1 because of eof-token
+ var balance = adoptBuffer$1(stream.balance, sourceLength + 1);
var tokenCount = 0;
var start = isBOM$1(getCharCode(0));
var offset = start;
@@ -4907,12 +5325,12 @@
balance[tokenCount] = sourceLength;
- switch (charCodeCategory$1(code)) {
+ switch (charCodeCategory(code)) {
// whitespace
- case charCodeCategory$1.WhiteSpace:
+ case charCodeCategory.WhiteSpace:
// Consume as much whitespace as possible. Return a .
- type = TYPE$2.WhiteSpace;
- offset = findWhiteSpaceEnd$1(source, offset + 1);
+ type = TYPE$F.WhiteSpace;
+ offset = findWhiteSpaceEnd(source, offset + 1);
break;
// U+0022 QUOTATION MARK (")
@@ -4924,9 +5342,9 @@
// U+0023 NUMBER SIGN (#)
case 0x0023:
// If the next input code point is a name code point or the next two input code points are a valid escape, then:
- if (isName$2(getCharCode(offset + 1)) || isValidEscape$2(getCharCode(offset + 1), getCharCode(offset + 2))) {
+ if (isName(getCharCode(offset + 1)) || isValidEscape(getCharCode(offset + 1), getCharCode(offset + 2))) {
// Create a .
- type = TYPE$2.Hash;
+ type = TYPE$F.Hash;
// If the next 3 input code points would start an identifier, set the ’s type flag to "id".
// if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
@@ -4934,12 +5352,12 @@
// }
// Consume a name, and set the ’s value to the returned string.
- offset = consumeName$1(source, offset + 1);
+ offset = consumeName(source, offset + 1);
// Return the .
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
@@ -4954,26 +5372,26 @@
// U+0028 LEFT PARENTHESIS (()
case 0x0028:
// Return a <(-token>.
- type = TYPE$2.LeftParenthesis;
+ type = TYPE$F.LeftParenthesis;
offset++;
break;
// U+0029 RIGHT PARENTHESIS ())
case 0x0029:
// Return a <)-token>.
- type = TYPE$2.RightParenthesis;
+ type = TYPE$F.RightParenthesis;
offset++;
break;
// U+002B PLUS SIGN (+)
case 0x002B:
// If the input stream starts with a number, ...
- if (isNumberStart$1(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
+ if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
// ... reconsume the current input code point, consume a numeric token, and return it.
consumeNumericToken();
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
break;
@@ -4981,20 +5399,20 @@
// U+002C COMMA (,)
case 0x002C:
// Return a .
- type = TYPE$2.Comma;
+ type = TYPE$F.Comma;
offset++;
break;
// U+002D HYPHEN-MINUS (-)
case 0x002D:
// If the input stream starts with a number, reconsume the current input code point, consume a numeric token, and return it.
- if (isNumberStart$1(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
+ if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
consumeNumericToken();
} else {
// Otherwise, if the next 2 input code points are U+002D HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them and return a .
if (getCharCode(offset + 1) === 0x002D &&
getCharCode(offset + 2) === 0x003E) {
- type = TYPE$2.CDC;
+ type = TYPE$F.CDC;
offset = offset + 3;
} else {
// Otherwise, if the input stream starts with an identifier, ...
@@ -5003,7 +5421,7 @@
consumeIdentLikeToken();
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
}
@@ -5013,12 +5431,12 @@
// U+002E FULL STOP (.)
case 0x002E:
// If the input stream starts with a number, ...
- if (isNumberStart$1(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
+ if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
// ... reconsume the current input code point, consume a numeric token, and return it.
consumeNumericToken();
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
@@ -5030,13 +5448,13 @@
if (getCharCode(offset + 1) === 0x002A) {
// ... consume them and all following code points up to and including the first U+002A ASTERISK (*)
// followed by a U+002F SOLIDUS (/), or up to an EOF code point.
- type = TYPE$2.Comment;
+ type = TYPE$F.Comment;
offset = source.indexOf('*/', offset + 2) + 2;
if (offset === 1) {
offset = source.length;
}
} else {
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
break;
@@ -5044,14 +5462,14 @@
// U+003A COLON (:)
case 0x003A:
// Return a .
- type = TYPE$2.Colon;
+ type = TYPE$F.Colon;
offset++;
break;
// U+003B SEMICOLON (;)
case 0x003B:
// Return a .
- type = TYPE$2.Semicolon;
+ type = TYPE$F.Semicolon;
offset++;
break;
@@ -5062,11 +5480,11 @@
getCharCode(offset + 2) === 0x002D &&
getCharCode(offset + 3) === 0x002D) {
// ... consume them and return a .
- type = TYPE$2.CDO;
+ type = TYPE$F.CDO;
offset = offset + 4;
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
@@ -5077,11 +5495,11 @@
// If the next 3 input code points would start an identifier, ...
if (isIdentifierStart$1(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
// ... consume a name, create an with its value set to the returned value, and return it.
- type = TYPE$2.AtKeyword;
- offset = consumeName$1(source, offset + 1);
+ type = TYPE$F.AtKeyword;
+ offset = consumeName(source, offset + 1);
} else {
// Otherwise, return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
@@ -5090,19 +5508,19 @@
// U+005B LEFT SQUARE BRACKET ([)
case 0x005B:
// Return a <[-token>.
- type = TYPE$2.LeftSquareBracket;
+ type = TYPE$F.LeftSquareBracket;
offset++;
break;
// U+005C REVERSE SOLIDUS (\)
case 0x005C:
// If the input stream starts with a valid escape, ...
- if (isValidEscape$2(code, getCharCode(offset + 1))) {
+ if (isValidEscape(code, getCharCode(offset + 1))) {
// ... reconsume the current input code point, consume an ident-like token, and return it.
consumeIdentLikeToken();
} else {
// Otherwise, this is a parse error. Return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
break;
@@ -5110,53 +5528,53 @@
// U+005D RIGHT SQUARE BRACKET (])
case 0x005D:
// Return a <]-token>.
- type = TYPE$2.RightSquareBracket;
+ type = TYPE$F.RightSquareBracket;
offset++;
break;
// U+007B LEFT CURLY BRACKET ({)
case 0x007B:
// Return a <{-token>.
- type = TYPE$2.LeftCurlyBracket;
+ type = TYPE$F.LeftCurlyBracket;
offset++;
break;
// U+007D RIGHT CURLY BRACKET (})
case 0x007D:
// Return a <}-token>.
- type = TYPE$2.RightCurlyBracket;
+ type = TYPE$F.RightCurlyBracket;
offset++;
break;
// digit
- case charCodeCategory$1.Digit:
+ case charCodeCategory.Digit:
// Reconsume the current input code point, consume a numeric token, and return it.
consumeNumericToken();
break;
// name-start code point
- case charCodeCategory$1.NameStart:
+ case charCodeCategory.NameStart:
// Reconsume the current input code point, consume an ident-like token, and return it.
consumeIdentLikeToken();
break;
// EOF
- case charCodeCategory$1.Eof:
+ case charCodeCategory.Eof:
// Return an .
break;
// anything else
default:
// Return a with its value set to the current input code point.
- type = TYPE$2.Delim;
+ type = TYPE$F.Delim;
offset++;
}
switch (type) {
case balanceCloseType:
- balancePrev = balanceStart & OFFSET_MASK$1;
+ balancePrev = balanceStart & OFFSET_MASK;
balanceStart = balance[balancePrev];
- balanceCloseType = balanceStart >> TYPE_SHIFT$1;
+ balanceCloseType = balanceStart >> TYPE_SHIFT;
balance[tokenCount] = balancePrev;
balance[balancePrev++] = tokenCount;
for (; balancePrev < tokenCount; balancePrev++) {
@@ -5166,35 +5584,35 @@
}
break;
- case TYPE$2.LeftParenthesis:
- case TYPE$2.Function:
+ case TYPE$F.LeftParenthesis:
+ case TYPE$F.Function:
balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$2.RightParenthesis;
- balanceStart = (balanceCloseType << TYPE_SHIFT$1) | tokenCount;
+ balanceCloseType = TYPE$F.RightParenthesis;
+ balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
break;
- case TYPE$2.LeftSquareBracket:
+ case TYPE$F.LeftSquareBracket:
balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$2.RightSquareBracket;
- balanceStart = (balanceCloseType << TYPE_SHIFT$1) | tokenCount;
+ balanceCloseType = TYPE$F.RightSquareBracket;
+ balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
break;
- case TYPE$2.LeftCurlyBracket:
+ case TYPE$F.LeftCurlyBracket:
balance[tokenCount] = balanceStart;
- balanceCloseType = TYPE$2.RightCurlyBracket;
- balanceStart = (balanceCloseType << TYPE_SHIFT$1) | tokenCount;
+ balanceCloseType = TYPE$F.RightCurlyBracket;
+ balanceStart = (balanceCloseType << TYPE_SHIFT) | tokenCount;
break;
}
- offsetAndType[tokenCount++] = (type << TYPE_SHIFT$1) | offset;
+ offsetAndType[tokenCount++] = (type << TYPE_SHIFT) | offset;
}
// finalize buffers
- offsetAndType[tokenCount] = (TYPE$2.EOF << TYPE_SHIFT$1) | offset; //
+ offsetAndType[tokenCount] = (TYPE$F.EOF << TYPE_SHIFT) | offset; //
balance[tokenCount] = sourceLength;
balance[sourceLength] = sourceLength; // prevents false positive balance match with any token
while (balanceStart !== 0) {
- balancePrev = balanceStart & OFFSET_MASK$1;
+ balancePrev = balanceStart & OFFSET_MASK;
balanceStart = balance[balancePrev];
balance[balancePrev] = sourceLength;
}
@@ -5212,56 +5630,56 @@
}
// extend tokenizer with constants
- Object.keys(_const).forEach(function(key) {
- tokenize[key] = _const[key];
+ Object.keys(constants$1).forEach(function(key) {
+ tokenize$3[key] = constants$1[key];
});
// extend tokenizer with static methods from utils
Object.keys(charCodeDefinitions).forEach(function(key) {
- tokenize[key] = charCodeDefinitions[key];
+ tokenize$3[key] = charCodeDefinitions[key];
});
Object.keys(utils).forEach(function(key) {
- tokenize[key] = utils[key];
+ tokenize$3[key] = utils[key];
});
- var tokenizer = tokenize;
+ var tokenizer$3 = tokenize$3;
- var isDigit$2 = tokenizer.isDigit;
- var cmpChar$1 = tokenizer.cmpChar;
- var TYPE$3 = tokenizer.TYPE;
+ var isDigit$3 = tokenizer$3.isDigit;
+ var cmpChar$4 = tokenizer$3.cmpChar;
+ var TYPE$E = tokenizer$3.TYPE;
- var DELIM = TYPE$3.Delim;
- var WHITESPACE$1 = TYPE$3.WhiteSpace;
- var COMMENT$1 = TYPE$3.Comment;
- var IDENT = TYPE$3.Ident;
- var NUMBER = TYPE$3.Number;
- var DIMENSION = TYPE$3.Dimension;
- var PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
- var HYPHENMINUS$1 = 0x002D; // U+002D HYPHEN-MINUS (-)
- var N = 0x006E; // U+006E LATIN SMALL LETTER N (n)
- var DISALLOW_SIGN = true;
- var ALLOW_SIGN = false;
+ var DELIM$6 = TYPE$E.Delim;
+ var WHITESPACE$b = TYPE$E.WhiteSpace;
+ var COMMENT$9 = TYPE$E.Comment;
+ var IDENT$i = TYPE$E.Ident;
+ var NUMBER$9 = TYPE$E.Number;
+ var DIMENSION$7 = TYPE$E.Dimension;
+ var PLUSSIGN$8 = 0x002B; // U+002B PLUS SIGN (+)
+ var HYPHENMINUS$4 = 0x002D; // U+002D HYPHEN-MINUS (-)
+ var N$4 = 0x006E; // U+006E LATIN SMALL LETTER N (n)
+ var DISALLOW_SIGN$1 = true;
+ var ALLOW_SIGN$1 = false;
- function isDelim(token, code) {
- return token !== null && token.type === DELIM && token.value.charCodeAt(0) === code;
+ function isDelim$1(token, code) {
+ return token !== null && token.type === DELIM$6 && token.value.charCodeAt(0) === code;
}
function skipSC(token, offset, getNextToken) {
- while (token !== null && (token.type === WHITESPACE$1 || token.type === COMMENT$1)) {
+ while (token !== null && (token.type === WHITESPACE$b || token.type === COMMENT$9)) {
token = getNextToken(++offset);
}
return offset;
}
- function checkInteger(token, valueOffset, disallowSign, offset) {
+ function checkInteger$1(token, valueOffset, disallowSign, offset) {
if (!token) {
return 0;
}
var code = token.value.charCodeAt(valueOffset);
- if (code === PLUSSIGN || code === HYPHENMINUS$1) {
+ if (code === PLUSSIGN$8 || code === HYPHENMINUS$4) {
if (disallowSign) {
// Number sign is not allowed
return 0;
@@ -5270,7 +5688,7 @@
}
for (; valueOffset < token.value.length; valueOffset++) {
- if (!isDigit$2(token.value.charCodeAt(valueOffset))) {
+ if (!isDigit$3(token.value.charCodeAt(valueOffset))) {
// Integer is expected
return 0;
}
@@ -5281,7 +5699,7 @@
// ...
// ... ['+' | '-']
- function consumeB(token, offset_, getNextToken) {
+ function consumeB$1(token, offset_, getNextToken) {
var sign = false;
var offset = skipSC(token, offset_, getNextToken);
@@ -5291,13 +5709,13 @@
return offset_;
}
- if (token.type !== NUMBER) {
- if (isDelim(token, PLUSSIGN) || isDelim(token, HYPHENMINUS$1)) {
+ if (token.type !== NUMBER$9) {
+ if (isDelim$1(token, PLUSSIGN$8) || isDelim$1(token, HYPHENMINUS$4)) {
sign = true;
offset = skipSC(getNextToken(++offset), offset, getNextToken);
token = getNextToken(offset);
- if (token === null && token.type !== NUMBER) {
+ if (token === null && token.type !== NUMBER$9) {
return 0;
}
} else {
@@ -5307,13 +5725,13 @@
if (!sign) {
var code = token.value.charCodeAt(0);
- if (code !== PLUSSIGN && code !== HYPHENMINUS$1) {
+ if (code !== PLUSSIGN$8 && code !== HYPHENMINUS$4) {
// Number sign is expected
return 0;
}
}
- return checkInteger(token, sign ? 0 : 1, sign, offset);
+ return checkInteger$1(token, sign ? 0 : 1, sign, offset);
}
// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
@@ -5326,8 +5744,8 @@
}
//
- if (token.type === NUMBER) {
- return checkInteger(token, 0, ALLOW_SIGN, offset); // b
+ if (token.type === NUMBER$9) {
+ return checkInteger$1(token, 0, ALLOW_SIGN$1, offset); // b
}
// -n
@@ -5335,9 +5753,9 @@
// -n ['+' | '-']
// -n-
//
- else if (token.type === IDENT && token.value.charCodeAt(0) === HYPHENMINUS$1) {
+ else if (token.type === IDENT$i && token.value.charCodeAt(0) === HYPHENMINUS$4) {
// expect 1st char is N
- if (!cmpChar$1(token.value, 1, N)) {
+ if (!cmpChar$4(token.value, 1, N$4)) {
return 0;
}
@@ -5346,26 +5764,26 @@
// -n
// -n ['+' | '-']
case 2:
- return consumeB(getNextToken(++offset), offset, getNextToken);
+ return consumeB$1(getNextToken(++offset), offset, getNextToken);
// -n-
case 3:
- if (token.value.charCodeAt(2) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(2) !== HYPHENMINUS$4) {
return 0;
}
offset = skipSC(getNextToken(++offset), offset, getNextToken);
token = getNextToken(offset);
- return checkInteger(token, 0, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
//
default:
- if (token.value.charCodeAt(2) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(2) !== HYPHENMINUS$4) {
return 0;
}
- return checkInteger(token, 3, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 3, DISALLOW_SIGN$1, offset);
}
}
@@ -5374,13 +5792,13 @@
// '+'? n ['+' | '-']
// '+'? n-
// '+'?
- else if (token.type === IDENT || (isDelim(token, PLUSSIGN) && getNextToken(offset + 1).type === IDENT)) {
+ else if (token.type === IDENT$i || (isDelim$1(token, PLUSSIGN$8) && getNextToken(offset + 1).type === IDENT$i)) {
// just ignore a plus
- if (token.type !== IDENT) {
+ if (token.type !== IDENT$i) {
token = getNextToken(++offset);
}
- if (token === null || !cmpChar$1(token.value, 0, N)) {
+ if (token === null || !cmpChar$4(token.value, 0, N$4)) {
return 0;
}
@@ -5389,26 +5807,26 @@
// '+'? n
// '+'? n ['+' | '-']
case 1:
- return consumeB(getNextToken(++offset), offset, getNextToken);
+ return consumeB$1(getNextToken(++offset), offset, getNextToken);
// '+'? n-
case 2:
- if (token.value.charCodeAt(1) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(1) !== HYPHENMINUS$4) {
return 0;
}
offset = skipSC(getNextToken(++offset), offset, getNextToken);
token = getNextToken(offset);
- return checkInteger(token, 0, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
// '+'?
default:
- if (token.value.charCodeAt(1) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(1) !== HYPHENMINUS$4) {
return 0;
}
- return checkInteger(token, 2, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 2, DISALLOW_SIGN$1, offset);
}
}
@@ -5417,12 +5835,12 @@
//
//
// ['+' | '-']
- else if (token.type === DIMENSION) {
+ else if (token.type === DIMENSION$7) {
var code = token.value.charCodeAt(0);
- var sign = code === PLUSSIGN || code === HYPHENMINUS$1 ? 1 : 0;
+ var sign = code === PLUSSIGN$8 || code === HYPHENMINUS$4 ? 1 : 0;
for (var i = sign; i < token.value.length; i++) {
- if (!isDigit$2(token.value.charCodeAt(i))) {
+ if (!isDigit$3(token.value.charCodeAt(i))) {
break;
}
}
@@ -5432,7 +5850,7 @@
return 0;
}
- if (!cmpChar$1(token.value, i, N)) {
+ if (!cmpChar$4(token.value, i, N$4)) {
return 0;
}
@@ -5440,9 +5858,9 @@
//
// ['+' | '-']
if (i + 1 === token.value.length) {
- return consumeB(getNextToken(++offset), offset, getNextToken);
+ return consumeB$1(getNextToken(++offset), offset, getNextToken);
} else {
- if (token.value.charCodeAt(i + 1) !== HYPHENMINUS$1) {
+ if (token.value.charCodeAt(i + 1) !== HYPHENMINUS$4) {
return 0;
}
@@ -5451,11 +5869,11 @@
offset = skipSC(getNextToken(++offset), offset, getNextToken);
token = getNextToken(offset);
- return checkInteger(token, 0, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, 0, DISALLOW_SIGN$1, offset);
}
//
else {
- return checkInteger(token, i + 2, DISALLOW_SIGN, offset);
+ return checkInteger$1(token, i + 2, DISALLOW_SIGN$1, offset);
}
}
}
@@ -5463,24 +5881,24 @@
return 0;
};
- var isHexDigit$2 = tokenizer.isHexDigit;
- var cmpChar$2 = tokenizer.cmpChar;
- var TYPE$4 = tokenizer.TYPE;
+ var isHexDigit$2 = tokenizer$3.isHexDigit;
+ var cmpChar$3 = tokenizer$3.cmpChar;
+ var TYPE$D = tokenizer$3.TYPE;
- var IDENT$1 = TYPE$4.Ident;
- var DELIM$1 = TYPE$4.Delim;
- var NUMBER$1 = TYPE$4.Number;
- var DIMENSION$1 = TYPE$4.Dimension;
- var PLUSSIGN$1 = 0x002B; // U+002B PLUS SIGN (+)
- var HYPHENMINUS$2 = 0x002D; // U+002D HYPHEN-MINUS (-)
- var QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)
- var U = 0x0075; // U+0075 LATIN SMALL LETTER U (u)
+ var IDENT$h = TYPE$D.Ident;
+ var DELIM$5 = TYPE$D.Delim;
+ var NUMBER$8 = TYPE$D.Number;
+ var DIMENSION$6 = TYPE$D.Dimension;
+ var PLUSSIGN$7 = 0x002B; // U+002B PLUS SIGN (+)
+ var HYPHENMINUS$3 = 0x002D; // U+002D HYPHEN-MINUS (-)
+ var QUESTIONMARK$2 = 0x003F; // U+003F QUESTION MARK (?)
+ var U$2 = 0x0075; // U+0075 LATIN SMALL LETTER U (u)
- function isDelim$1(token, code) {
- return token !== null && token.type === DELIM$1 && token.value.charCodeAt(0) === code;
+ function isDelim(token, code) {
+ return token !== null && token.type === DELIM$5 && token.value.charCodeAt(0) === code;
}
- function startsWith(token, code) {
+ function startsWith$1(token, code) {
return token.value.charCodeAt(0) === code;
}
@@ -5488,7 +5906,7 @@
for (var pos = offset, hexlen = 0; pos < token.value.length; pos++) {
var code = token.value.charCodeAt(pos);
- if (code === HYPHENMINUS$2 && allowDash && hexlen !== 0) {
+ if (code === HYPHENMINUS$3 && allowDash && hexlen !== 0) {
if (hexSequence(token, offset + hexlen + 1, false) > 0) {
return 6; // dissallow following question marks
}
@@ -5512,7 +5930,7 @@
return 0; // nothing consumed
}
- while (isDelim$1(getNextToken(length), QUESTIONMARK)) {
+ while (isDelim(getNextToken(length), QUESTIONMARK$2)) {
if (++consumed > 6) {
return 0; // too many question marks
}
@@ -5546,7 +5964,7 @@
var length = 0;
// should start with `u` or `U`
- if (token === null || token.type !== IDENT$1 || !cmpChar$2(token.value, 0, U)) {
+ if (token === null || token.type !== IDENT$h || !cmpChar$3(token.value, 0, U$2)) {
return 0;
}
@@ -5557,18 +5975,18 @@
// u '+' '?'*
// u '+' '?'+
- if (isDelim$1(token, PLUSSIGN$1)) {
+ if (isDelim(token, PLUSSIGN$7)) {
token = getNextToken(++length);
if (token === null) {
return 0;
}
- if (token.type === IDENT$1) {
+ if (token.type === IDENT$h) {
// u '+' '?'*
return withQuestionMarkSequence(hexSequence(token, 0, true), ++length, getNextToken);
}
- if (isDelim$1(token, QUESTIONMARK)) {
+ if (isDelim(token, QUESTIONMARK$2)) {
// u '+' '?'+
return withQuestionMarkSequence(1, ++length, getNextToken);
}
@@ -5580,8 +5998,8 @@
// u '?'*
// u
// u
- if (token.type === NUMBER$1) {
- if (!startsWith(token, PLUSSIGN$1)) {
+ if (token.type === NUMBER$8) {
+ if (!startsWith$1(token, PLUSSIGN$7)) {
return 0;
}
@@ -5596,10 +6014,10 @@
return length;
}
- if (token.type === DIMENSION$1 || token.type === NUMBER$1) {
+ if (token.type === DIMENSION$6 || token.type === NUMBER$8) {
// u
// u
- if (!startsWith(token, HYPHENMINUS$2) || !hexSequence(token, 1, false)) {
+ if (!startsWith$1(token, HYPHENMINUS$3) || !hexSequence(token, 1, false)) {
return 0;
}
@@ -5611,8 +6029,8 @@
}
// u '?'*
- if (token.type === DIMENSION$1) {
- if (!startsWith(token, PLUSSIGN$1)) {
+ if (token.type === DIMENSION$6) {
+ if (!startsWith$1(token, PLUSSIGN$7)) {
return 0;
}
@@ -5622,16 +6040,17 @@
return 0;
};
- var isIdentifierStart$2 = tokenizer.isIdentifierStart;
- var isHexDigit$3 = tokenizer.isHexDigit;
- var isDigit$3 = tokenizer.isDigit;
- var cmpStr$3 = tokenizer.cmpStr;
- var consumeNumber$2 = tokenizer.consumeNumber;
- var TYPE$5 = tokenizer.TYPE;
+ var tokenizer$2 = tokenizer$3;
+ var isIdentifierStart = tokenizer$2.isIdentifierStart;
+ var isHexDigit$1 = tokenizer$2.isHexDigit;
+ var isDigit$2 = tokenizer$2.isDigit;
+ var cmpStr$3 = tokenizer$2.cmpStr;
+ var consumeNumber$3 = tokenizer$2.consumeNumber;
+ var TYPE$C = tokenizer$2.TYPE;
+ var anPlusB = genericAnPlusB;
+ var urange = genericUrange;
-
-
- var cssWideKeywords = ['unset', 'initial', 'inherit'];
+ var cssWideKeywords$1 = ['unset', 'initial', 'inherit'];
var calcFunctionNames = ['calc(', '-moz-calc(', '-webkit-calc('];
// https://www.w3.org/TR/css-values-3/#lengths
@@ -5726,7 +6145,7 @@
return (
str.charCodeAt(offset) === 0x005C && // U+005C REVERSE SOLIDUS (\)
- isDigit$3(str.charCodeAt(offset + 1))
+ isDigit$2(str.charCodeAt(offset + 1))
);
}
@@ -5779,7 +6198,7 @@
return 0;
}
- if (token.type === TYPE$5.Function && eqStrAny(token.value, calcFunctionNames)) {
+ if (token.type === TYPE$C.Function && eqStrAny(token.value, calcFunctionNames)) {
return consumeFunction(token, getNextToken);
}
@@ -5821,14 +6240,14 @@
//
// See also: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
function customIdent(token) {
- if (token === null || token.type !== TYPE$5.Ident) {
+ if (token === null || token.type !== TYPE$C.Ident) {
return 0;
}
var name = token.value.toLowerCase();
// The CSS-wide keywords are not valid s
- if (eqStrAny(name, cssWideKeywords)) {
+ if (eqStrAny(name, cssWideKeywords$1)) {
return 0;
}
@@ -5853,7 +6272,7 @@
// NOTE: Current implementation treat `--` as a valid name since most (all?) major browsers treat it as valid.
function customPropertyName(token) {
// ... defined as any valid identifier
- if (token === null || token.type !== TYPE$5.Ident) {
+ if (token === null || token.type !== TYPE$C.Ident) {
return 0;
}
@@ -5870,7 +6289,7 @@
// In other words, a hex color is written as a hash character, "#", followed by some number of digits 0-9 or
// letters a-f (the case of the letters doesn’t matter - #00ff00 is identical to #00FF00).
function hexColor(token) {
- if (token === null || token.type !== TYPE$5.Hash) {
+ if (token === null || token.type !== TYPE$C.Hash) {
return 0;
}
@@ -5882,7 +6301,7 @@
}
for (var i = 1; i < length; i++) {
- if (!isHexDigit$3(token.value.charCodeAt(i))) {
+ if (!isHexDigit$1(token.value.charCodeAt(i))) {
return 0;
}
}
@@ -5891,11 +6310,11 @@
}
function idSelector(token) {
- if (token === null || token.type !== TYPE$5.Hash) {
+ if (token === null || token.type !== TYPE$C.Hash) {
return 0;
}
- if (!isIdentifierStart$2(charCode(token.value, 1), charCode(token.value, 2), charCode(token.value, 3))) {
+ if (!isIdentifierStart(charCode(token.value, 1), charCode(token.value, 2), charCode(token.value, 3))) {
return 0;
}
@@ -5919,14 +6338,14 @@
do {
switch (token.type) {
// ... does not contain , ,
- case TYPE$5.BadString:
- case TYPE$5.BadUrl:
+ case TYPE$C.BadString:
+ case TYPE$C.BadUrl:
break scan;
// ... unmatched <)-token>, <]-token>, or <}-token>,
- case TYPE$5.RightCurlyBracket:
- case TYPE$5.RightParenthesis:
- case TYPE$5.RightSquareBracket:
+ case TYPE$C.RightCurlyBracket:
+ case TYPE$C.RightParenthesis:
+ case TYPE$C.RightSquareBracket:
if (token.balance > token.index || token.balance < startIdx) {
break scan;
}
@@ -5935,7 +6354,7 @@
break;
// ... or top-level tokens
- case TYPE$5.Semicolon:
+ case TYPE$C.Semicolon:
if (level === 0) {
break scan;
}
@@ -5943,17 +6362,17 @@
break;
// ... or tokens with a value of "!"
- case TYPE$5.Delim:
+ case TYPE$C.Delim:
if (token.value === '!' && level === 0) {
break scan;
}
break;
- case TYPE$5.Function:
- case TYPE$5.LeftParenthesis:
- case TYPE$5.LeftSquareBracket:
- case TYPE$5.LeftCurlyBracket:
+ case TYPE$C.Function:
+ case TYPE$C.LeftParenthesis:
+ case TYPE$C.LeftSquareBracket:
+ case TYPE$C.LeftCurlyBracket:
level++;
break;
}
@@ -5987,14 +6406,14 @@
do {
switch (token.type) {
// ... does not contain , ,
- case TYPE$5.BadString:
- case TYPE$5.BadUrl:
+ case TYPE$C.BadString:
+ case TYPE$C.BadUrl:
break scan;
// ... unmatched <)-token>, <]-token>, or <}-token>,
- case TYPE$5.RightCurlyBracket:
- case TYPE$5.RightParenthesis:
- case TYPE$5.RightSquareBracket:
+ case TYPE$C.RightCurlyBracket:
+ case TYPE$C.RightParenthesis:
+ case TYPE$C.RightSquareBracket:
if (token.balance > token.index || token.balance < startIdx) {
break scan;
}
@@ -6019,11 +6438,11 @@
function dimension(type) {
return function(token, getNextToken, opts) {
- if (token === null || token.type !== TYPE$5.Dimension) {
+ if (token === null || token.type !== TYPE$C.Dimension) {
return 0;
}
- var numberEnd = consumeNumber$2(token.value, 0);
+ var numberEnd = consumeNumber$3(token.value, 0);
// check unit
if (type !== null) {
@@ -6055,7 +6474,7 @@
// https://drafts.csswg.org/css-values-4/#percentages
function percentage(token, getNextToken, opts) {
// ... corresponds to the production
- if (token === null || token.type !== TYPE$5.Percentage) {
+ if (token === null || token.type !== TYPE$C.Percentage) {
return 0;
}
@@ -6083,7 +6502,7 @@
}
return function(token, getNextToken, opts) {
- if (token !== null && token.type === TYPE$5.Number) {
+ if (token !== null && token.type === TYPE$C.Number) {
if (Number(token.value) === 0) {
return 1;
}
@@ -6102,7 +6521,7 @@
return 0;
}
- var numberEnd = consumeNumber$2(token.value, 0);
+ var numberEnd = consumeNumber$3(token.value, 0);
var isNumber = numberEnd === token.value.length;
if (!isNumber && !isPostfixIeHack(token.value, numberEnd)) {
return 0;
@@ -6120,7 +6539,7 @@
// https://drafts.csswg.org/css-values-4/#integers
function integer(token, getNextToken, opts) {
// ... corresponds to a subset of the production
- if (token === null || token.type !== TYPE$5.Number) {
+ if (token === null || token.type !== TYPE$C.Number) {
return 0;
}
@@ -6130,7 +6549,7 @@
// When written literally, an integer is one or more decimal digits 0 through 9 ...
for (; i < token.value.length; i++) {
- if (!isDigit$3(token.value.charCodeAt(i))) {
+ if (!isDigit$2(token.value.charCodeAt(i))) {
return 0;
}
}
@@ -6143,44 +6562,44 @@
return 1;
}
- var generic = {
+ var generic$1 = {
// token types
- 'ident-token': tokenType(TYPE$5.Ident),
- 'function-token': tokenType(TYPE$5.Function),
- 'at-keyword-token': tokenType(TYPE$5.AtKeyword),
- 'hash-token': tokenType(TYPE$5.Hash),
- 'string-token': tokenType(TYPE$5.String),
- 'bad-string-token': tokenType(TYPE$5.BadString),
- 'url-token': tokenType(TYPE$5.Url),
- 'bad-url-token': tokenType(TYPE$5.BadUrl),
- 'delim-token': tokenType(TYPE$5.Delim),
- 'number-token': tokenType(TYPE$5.Number),
- 'percentage-token': tokenType(TYPE$5.Percentage),
- 'dimension-token': tokenType(TYPE$5.Dimension),
- 'whitespace-token': tokenType(TYPE$5.WhiteSpace),
- 'CDO-token': tokenType(TYPE$5.CDO),
- 'CDC-token': tokenType(TYPE$5.CDC),
- 'colon-token': tokenType(TYPE$5.Colon),
- 'semicolon-token': tokenType(TYPE$5.Semicolon),
- 'comma-token': tokenType(TYPE$5.Comma),
- '[-token': tokenType(TYPE$5.LeftSquareBracket),
- ']-token': tokenType(TYPE$5.RightSquareBracket),
- '(-token': tokenType(TYPE$5.LeftParenthesis),
- ')-token': tokenType(TYPE$5.RightParenthesis),
- '{-token': tokenType(TYPE$5.LeftCurlyBracket),
- '}-token': tokenType(TYPE$5.RightCurlyBracket),
+ 'ident-token': tokenType(TYPE$C.Ident),
+ 'function-token': tokenType(TYPE$C.Function),
+ 'at-keyword-token': tokenType(TYPE$C.AtKeyword),
+ 'hash-token': tokenType(TYPE$C.Hash),
+ 'string-token': tokenType(TYPE$C.String),
+ 'bad-string-token': tokenType(TYPE$C.BadString),
+ 'url-token': tokenType(TYPE$C.Url),
+ 'bad-url-token': tokenType(TYPE$C.BadUrl),
+ 'delim-token': tokenType(TYPE$C.Delim),
+ 'number-token': tokenType(TYPE$C.Number),
+ 'percentage-token': tokenType(TYPE$C.Percentage),
+ 'dimension-token': tokenType(TYPE$C.Dimension),
+ 'whitespace-token': tokenType(TYPE$C.WhiteSpace),
+ 'CDO-token': tokenType(TYPE$C.CDO),
+ 'CDC-token': tokenType(TYPE$C.CDC),
+ 'colon-token': tokenType(TYPE$C.Colon),
+ 'semicolon-token': tokenType(TYPE$C.Semicolon),
+ 'comma-token': tokenType(TYPE$C.Comma),
+ '[-token': tokenType(TYPE$C.LeftSquareBracket),
+ ']-token': tokenType(TYPE$C.RightSquareBracket),
+ '(-token': tokenType(TYPE$C.LeftParenthesis),
+ ')-token': tokenType(TYPE$C.RightParenthesis),
+ '{-token': tokenType(TYPE$C.LeftCurlyBracket),
+ '}-token': tokenType(TYPE$C.RightCurlyBracket),
// token type aliases
- 'string': tokenType(TYPE$5.String),
- 'ident': tokenType(TYPE$5.Ident),
+ 'string': tokenType(TYPE$C.String),
+ 'ident': tokenType(TYPE$C.Ident),
// complex types
'custom-ident': customIdent,
'custom-property-name': customPropertyName,
'hex-color': hexColor,
'id-selector': idSelector, // element( )
- 'an-plus-b': genericAnPlusB,
- 'urange': genericUrange,
+ 'an-plus-b': anPlusB,
+ 'urange': urange,
'declaration-value': declarationValue,
'any-value': anyValue,
@@ -6207,7 +6626,9 @@
'-ms-legacy-expression': func('expression')
};
- var _SyntaxError$1 = function SyntaxError(message, input, offset) {
+ var createCustomError = createCustomError$3;
+
+ var _SyntaxError = function SyntaxError(message, input, offset) {
var error = createCustomError('SyntaxError', message);
error.input = input;
@@ -6220,18 +6641,20 @@
return error;
};
- var TAB = 9;
- var N$1 = 10;
- var F = 12;
- var R = 13;
- var SPACE = 32;
+ var SyntaxError$3 = _SyntaxError;
- var Tokenizer = function(str) {
+ var TAB$1 = 9;
+ var N$3 = 10;
+ var F$2 = 12;
+ var R$2 = 13;
+ var SPACE$2 = 32;
+
+ var Tokenizer$1 = function(str) {
this.str = str;
this.pos = 0;
};
- Tokenizer.prototype = {
+ Tokenizer$1.prototype = {
charCodeAt: function(pos) {
return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
},
@@ -6247,7 +6670,7 @@
findWsEnd: function(pos) {
for (; pos < this.str.length; pos++) {
var code = this.str.charCodeAt(pos);
- if (code !== R && code !== N$1 && code !== F && code !== SPACE && code !== TAB) {
+ if (code !== R$2 && code !== N$3 && code !== F$2 && code !== SPACE$2 && code !== TAB$1) {
break;
}
}
@@ -6268,36 +6691,37 @@
return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
},
error: function(message) {
- throw new _SyntaxError$1(message, this.str, this.pos);
+ throw new SyntaxError$3(message, this.str, this.pos);
}
};
- var tokenizer$1 = Tokenizer;
+ var tokenizer$1 = Tokenizer$1;
- var TAB$1 = 9;
+ var Tokenizer = tokenizer$1;
+ var TAB = 9;
var N$2 = 10;
var F$1 = 12;
var R$1 = 13;
var SPACE$1 = 32;
- var EXCLAMATIONMARK = 33; // !
- var NUMBERSIGN = 35; // #
- var AMPERSAND = 38; // &
+ var EXCLAMATIONMARK$3 = 33; // !
+ var NUMBERSIGN$4 = 35; // #
+ var AMPERSAND$1 = 38; // &
var APOSTROPHE = 39; // '
- var LEFTPARENTHESIS = 40; // (
- var RIGHTPARENTHESIS = 41; // )
- var ASTERISK = 42; // *
- var PLUSSIGN$2 = 43; // +
- var COMMA = 44; // ,
+ var LEFTPARENTHESIS$7 = 40; // (
+ var RIGHTPARENTHESIS$7 = 41; // )
+ var ASTERISK$6 = 42; // *
+ var PLUSSIGN$6 = 43; // +
+ var COMMA$4 = 44; // ,
var HYPERMINUS = 45; // -
var LESSTHANSIGN = 60; // <
- var GREATERTHANSIGN = 62; // >
+ var GREATERTHANSIGN$2 = 62; // >
var QUESTIONMARK$1 = 63; // ?
var COMMERCIALAT = 64; // @
- var LEFTSQUAREBRACKET = 91; // [
- var RIGHTSQUAREBRACKET = 93; // ]
- var LEFTCURLYBRACKET = 123; // {
- var VERTICALLINE = 124; // |
- var RIGHTCURLYBRACKET = 125; // }
+ var LEFTSQUAREBRACKET$4 = 91; // [
+ var RIGHTSQUAREBRACKET$2 = 93; // ]
+ var LEFTCURLYBRACKET$4 = 123; // {
+ var VERTICALLINE$3 = 124; // |
+ var RIGHTCURLYBRACKET$2 = 125; // }
var INFINITY = 8734; // ∞
var NAME_CHAR = createCharMap(function(ch) {
return /[a-zA-Z0-9\-]/.test(ch);
@@ -6372,20 +6796,20 @@
var min = null;
var max = null;
- tokenizer.eat(LEFTCURLYBRACKET);
+ tokenizer.eat(LEFTCURLYBRACKET$4);
min = scanNumber(tokenizer);
- if (tokenizer.charCode() === COMMA) {
+ if (tokenizer.charCode() === COMMA$4) {
tokenizer.pos++;
- if (tokenizer.charCode() !== RIGHTCURLYBRACKET) {
+ if (tokenizer.charCode() !== RIGHTCURLYBRACKET$2) {
max = scanNumber(tokenizer);
}
} else {
max = min;
}
- tokenizer.eat(RIGHTCURLYBRACKET);
+ tokenizer.eat(RIGHTCURLYBRACKET$2);
return {
min: Number(min),
@@ -6398,7 +6822,7 @@
var comma = false;
switch (tokenizer.charCode()) {
- case ASTERISK:
+ case ASTERISK$6:
tokenizer.pos++;
range = {
@@ -6408,7 +6832,7 @@
break;
- case PLUSSIGN$2:
+ case PLUSSIGN$6:
tokenizer.pos++;
range = {
@@ -6428,12 +6852,12 @@
break;
- case NUMBERSIGN:
+ case NUMBERSIGN$4:
tokenizer.pos++;
comma = true;
- if (tokenizer.charCode() === LEFTCURLYBRACKET) {
+ if (tokenizer.charCode() === LEFTCURLYBRACKET$4) {
range = readMultiplierRange(tokenizer);
} else {
range = {
@@ -6444,7 +6868,7 @@
break;
- case LEFTCURLYBRACKET:
+ case LEFTCURLYBRACKET$4:
range = readMultiplierRange(tokenizer);
break;
@@ -6485,7 +6909,7 @@
};
}
- function readProperty(tokenizer) {
+ function readProperty$1(tokenizer) {
var name;
tokenizer.eat(LESSTHANSIGN);
@@ -6494,7 +6918,7 @@
name = scanWord(tokenizer);
tokenizer.eat(APOSTROPHE);
- tokenizer.eat(GREATERTHANSIGN);
+ tokenizer.eat(GREATERTHANSIGN$2);
return maybeMultiplied(tokenizer, {
type: 'Property',
@@ -6515,7 +6939,7 @@
var max = null; // Infinity
var sign = 1;
- tokenizer.eat(LEFTSQUAREBRACKET);
+ tokenizer.eat(LEFTSQUAREBRACKET$4);
if (tokenizer.charCode() === HYPERMINUS) {
tokenizer.peek();
@@ -6529,7 +6953,7 @@
}
scanSpaces(tokenizer);
- tokenizer.eat(COMMA);
+ tokenizer.eat(COMMA$4);
scanSpaces(tokenizer);
if (tokenizer.charCode() === INFINITY) {
@@ -6545,7 +6969,7 @@
max = sign * Number(scanNumber(tokenizer));
}
- tokenizer.eat(RIGHTSQUAREBRACKET);
+ tokenizer.eat(RIGHTSQUAREBRACKET$2);
// If no range is indicated, either by using the bracketed range notation
// or in the property description, then [−∞,∞] is assumed.
@@ -6567,18 +6991,18 @@
tokenizer.eat(LESSTHANSIGN);
name = scanWord(tokenizer);
- if (tokenizer.charCode() === LEFTPARENTHESIS &&
- tokenizer.nextCharCode() === RIGHTPARENTHESIS) {
+ if (tokenizer.charCode() === LEFTPARENTHESIS$7 &&
+ tokenizer.nextCharCode() === RIGHTPARENTHESIS$7) {
tokenizer.pos += 2;
name += '()';
}
- if (tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos)) === LEFTSQUAREBRACKET) {
+ if (tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos)) === LEFTSQUAREBRACKET$4) {
scanSpaces(tokenizer);
opts = readTypeRange(tokenizer);
}
- tokenizer.eat(GREATERTHANSIGN);
+ tokenizer.eat(GREATERTHANSIGN$2);
return maybeMultiplied(tokenizer, {
type: 'Type',
@@ -6592,7 +7016,7 @@
name = scanWord(tokenizer);
- if (tokenizer.charCode() === LEFTPARENTHESIS) {
+ if (tokenizer.charCode() === LEFTPARENTHESIS$7) {
tokenizer.pos++;
return {
@@ -6708,13 +7132,13 @@
function readGroup(tokenizer) {
var result;
- tokenizer.eat(LEFTSQUAREBRACKET);
+ tokenizer.eat(LEFTSQUAREBRACKET$4);
result = readImplicitGroup(tokenizer);
- tokenizer.eat(RIGHTSQUAREBRACKET);
+ tokenizer.eat(RIGHTSQUAREBRACKET$2);
result.explicit = true;
- if (tokenizer.charCode() === EXCLAMATIONMARK) {
+ if (tokenizer.charCode() === EXCLAMATIONMARK$3) {
tokenizer.pos++;
result.disallowEmpty = true;
}
@@ -6730,38 +7154,38 @@
}
switch (code) {
- case RIGHTSQUAREBRACKET:
+ case RIGHTSQUAREBRACKET$2:
// don't eat, stop scan a group
break;
- case LEFTSQUAREBRACKET:
+ case LEFTSQUAREBRACKET$4:
return maybeMultiplied(tokenizer, readGroup(tokenizer));
case LESSTHANSIGN:
return tokenizer.nextCharCode() === APOSTROPHE
- ? readProperty(tokenizer)
+ ? readProperty$1(tokenizer)
: readType(tokenizer);
- case VERTICALLINE:
+ case VERTICALLINE$3:
return {
type: 'Combinator',
value: tokenizer.substringToPos(
- tokenizer.nextCharCode() === VERTICALLINE
+ tokenizer.nextCharCode() === VERTICALLINE$3
? tokenizer.pos + 2
: tokenizer.pos + 1
)
};
- case AMPERSAND:
+ case AMPERSAND$1:
tokenizer.pos++;
- tokenizer.eat(AMPERSAND);
+ tokenizer.eat(AMPERSAND$1);
return {
type: 'Combinator',
value: '&&'
};
- case COMMA:
+ case COMMA$4:
tokenizer.pos++;
return {
type: 'Comma'
@@ -6774,7 +7198,7 @@
});
case SPACE$1:
- case TAB$1:
+ case TAB:
case N$2:
case R$1:
case F$1:
@@ -6796,15 +7220,15 @@
return maybeToken(tokenizer);
- case ASTERISK:
- case PLUSSIGN$2:
+ case ASTERISK$6:
+ case PLUSSIGN$6:
case QUESTIONMARK$1:
- case NUMBERSIGN:
- case EXCLAMATIONMARK:
+ case NUMBERSIGN$4:
+ case EXCLAMATIONMARK$3:
// prohibited tokens (used as a multiplier start)
break;
- case LEFTCURLYBRACKET:
+ case LEFTCURLYBRACKET$4:
// LEFTCURLYBRACKET is allowed since mdn/data uses it w/o quoting
// check next char isn't a number, because it's likely a disjoined multiplier
code = tokenizer.nextCharCode();
@@ -6820,8 +7244,8 @@
}
}
- function parse(source) {
- var tokenizer = new tokenizer$1(source);
+ function parse$2(source) {
+ var tokenizer = new Tokenizer(source);
var result = readImplicitGroup(tokenizer);
if (tokenizer.pos !== source.length) {
@@ -6838,13 +7262,13 @@
// warm up parse to elimitate code branches that never execute
// fix soft deoptimizations (insufficient type feedback)
- parse('[a&&#|<\'c\'>*||e() f{2} /,(% g#{1,2} h{2,})]!');
+ parse$2('[a&&#|<\'c\'>*||e() f{2} /,(% g#{1,2} h{2,})]!');
- var parse_1 = parse;
+ var parse_1 = parse$2;
var noop$2 = function() {};
- function ensureFunction(value) {
+ function ensureFunction$1(value) {
return typeof value === 'function' ? value : noop$2;
}
@@ -6884,8 +7308,8 @@
if (typeof options === 'function') {
enter = options;
} else if (options) {
- enter = ensureFunction(options.enter);
- leave = ensureFunction(options.leave);
+ enter = ensureFunction$1(options.enter);
+ leave = ensureFunction$1(options.leave);
}
if (enter === noop$2 && leave === noop$2) {
@@ -6895,7 +7319,9 @@
walk(node);
};
- var tokenStream = new TokenStream_1();
+ var tokenize$2 = tokenizer$3;
+ var TokenStream$2 = TokenStream_1;
+ var tokenStream = new TokenStream$2();
var astToTokens = {
decorator: function(handlers) {
var curNode = null;
@@ -6923,19 +7349,19 @@
}
},
result: function() {
- return prepareTokens(buffer, nodes);
+ return prepareTokens$1(buffer, nodes);
}
};
}
};
- function prepareTokens(str, nodes) {
+ function prepareTokens$1(str, nodes) {
var tokens = [];
var nodesOffset = 0;
var nodesIndex = 0;
var currentNode = nodes ? nodes[nodesIndex].node : null;
- tokenizer(str, tokenStream);
+ tokenize$2(str, tokenStream);
while (!tokenStream.eof) {
if (nodes) {
@@ -6961,29 +7387,31 @@
var prepareTokens_1 = function(value, syntax) {
if (typeof value === 'string') {
- return prepareTokens(value, null);
+ return prepareTokens$1(value, null);
}
return syntax.generate(value, astToTokens);
};
- var MATCH = { type: 'Match' };
- var MISMATCH = { type: 'Mismatch' };
- var DISALLOW_EMPTY = { type: 'DisallowEmpty' };
- var LEFTPARENTHESIS$1 = 40; // (
- var RIGHTPARENTHESIS$1 = 41; // )
+ var parse$1 = parse_1;
+
+ var MATCH$1 = { type: 'Match' };
+ var MISMATCH$1 = { type: 'Mismatch' };
+ var DISALLOW_EMPTY$1 = { type: 'DisallowEmpty' };
+ var LEFTPARENTHESIS$6 = 40; // (
+ var RIGHTPARENTHESIS$6 = 41; // )
function createCondition(match, thenBranch, elseBranch) {
// reduce node count
- if (thenBranch === MATCH && elseBranch === MISMATCH) {
+ if (thenBranch === MATCH$1 && elseBranch === MISMATCH$1) {
return match;
}
- if (match === MATCH && thenBranch === MATCH && elseBranch === MATCH) {
+ if (match === MATCH$1 && thenBranch === MATCH$1 && elseBranch === MATCH$1) {
return match;
}
- if (match.type === 'If' && match.else === MISMATCH && thenBranch === MATCH) {
+ if (match.type === 'If' && match.else === MISMATCH$1 && thenBranch === MATCH$1) {
thenBranch = match.then;
match = match.match;
}
@@ -6999,8 +7427,8 @@
function isFunctionType(name) {
return (
name.length > 2 &&
- name.charCodeAt(name.length - 2) === LEFTPARENTHESIS$1 &&
- name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS$1
+ name.charCodeAt(name.length - 2) === LEFTPARENTHESIS$6 &&
+ name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS$6
);
}
@@ -7027,7 +7455,7 @@
// else MISMATCH
// else MISMATCH
// else MISMATCH
- var result = MATCH;
+ var result = MATCH$1;
for (var i = terms.length - 1; i >= 0; i--) {
var term = terms[i];
@@ -7035,7 +7463,7 @@
result = createCondition(
term,
result,
- MISMATCH
+ MISMATCH$1
);
}
return result;
@@ -7053,7 +7481,7 @@
// then MATCH
// else MISMATCH
- var result = MISMATCH;
+ var result = MISMATCH$1;
var map = null;
for (var i = terms.length - 1; i >= 0; i--) {
@@ -7068,7 +7496,7 @@
type: 'Enum',
map: map
},
- MATCH,
+ MATCH$1,
result
);
}
@@ -7087,7 +7515,7 @@
// create a new conditonal node
result = createCondition(
term,
- MATCH,
+ MATCH$1,
result
);
}
@@ -7130,7 +7558,7 @@
// then MATCH
// else MISMATCH
// else MISMATCH
- var result = MISMATCH;
+ var result = MISMATCH$1;
for (var i = terms.length - 1; i >= 0; i--) {
var term = terms[i];
@@ -7145,7 +7573,7 @@
false
);
} else {
- thenClause = MATCH;
+ thenClause = MATCH$1;
}
result = createCondition(
@@ -7193,7 +7621,7 @@
// then MATCH
// else MATCH
// else MISMATCH
- var result = atLeastOneTermMatched ? MATCH : MISMATCH;
+ var result = atLeastOneTermMatched ? MATCH$1 : MISMATCH$1;
for (var i = terms.length - 1; i >= 0; i--) {
var term = terms[i];
@@ -7208,7 +7636,7 @@
true
);
} else {
- thenClause = MATCH;
+ thenClause = MATCH$1;
}
result = createCondition(
@@ -7222,15 +7650,15 @@
}
function buildMultiplierMatchGraph(node) {
- var result = MATCH;
- var matchTerm = buildMatchGraph(node.term);
+ var result = MATCH$1;
+ var matchTerm = buildMatchGraph$1(node.term);
if (node.max === 0) {
// disable repeating of empty match to prevent infinite loop
matchTerm = createCondition(
matchTerm,
- DISALLOW_EMPTY,
- MISMATCH
+ DISALLOW_EMPTY$1,
+ MISMATCH$1
);
// an occurrence count is not limited, make a cycle;
@@ -7238,12 +7666,12 @@
result = createCondition(
matchTerm,
null, // will be a loop
- MISMATCH
+ MISMATCH$1
);
result.then = createCondition(
- MATCH,
- MATCH,
+ MATCH$1,
+ MATCH$1,
result // make a loop
);
@@ -7251,28 +7679,28 @@
result.then.else = createCondition(
{ type: 'Comma', syntax: node },
result,
- MISMATCH
+ MISMATCH$1
);
}
} else {
// create a match node chain for [min .. max] interval with optional matches
for (var i = node.min || 1; i <= node.max; i++) {
- if (node.comma && result !== MATCH) {
+ if (node.comma && result !== MATCH$1) {
result = createCondition(
{ type: 'Comma', syntax: node },
result,
- MISMATCH
+ MISMATCH$1
);
}
result = createCondition(
matchTerm,
createCondition(
- MATCH,
- MATCH,
+ MATCH$1,
+ MATCH$1,
result
),
- MISMATCH
+ MISMATCH$1
);
}
}
@@ -7280,25 +7708,25 @@
if (node.min === 0) {
// allow zero match
result = createCondition(
- MATCH,
- MATCH,
+ MATCH$1,
+ MATCH$1,
result
);
} else {
// create a match node chain to collect [0 ... min - 1] required matches
for (var i = 0; i < node.min - 1; i++) {
- if (node.comma && result !== MATCH) {
+ if (node.comma && result !== MATCH$1) {
result = createCondition(
{ type: 'Comma', syntax: node },
result,
- MISMATCH
+ MISMATCH$1
);
}
result = createCondition(
matchTerm,
result,
- MISMATCH
+ MISMATCH$1
);
}
}
@@ -7306,7 +7734,7 @@
return result;
}
- function buildMatchGraph(node) {
+ function buildMatchGraph$1(node) {
if (typeof node === 'function') {
return {
type: 'Generic',
@@ -7318,15 +7746,15 @@
case 'Group':
var result = buildGroupMatchGraph(
node.combinator,
- node.terms.map(buildMatchGraph),
+ node.terms.map(buildMatchGraph$1),
false
);
if (node.disallowEmpty) {
result = createCondition(
result,
- DISALLOW_EMPTY,
- MISMATCH
+ DISALLOW_EMPTY$1,
+ MISMATCH$1
);
}
@@ -7399,30 +7827,30 @@
}
}
- var matchGraph = {
- MATCH: MATCH,
- MISMATCH: MISMATCH,
- DISALLOW_EMPTY: DISALLOW_EMPTY,
+ var matchGraph$1 = {
+ MATCH: MATCH$1,
+ MISMATCH: MISMATCH$1,
+ DISALLOW_EMPTY: DISALLOW_EMPTY$1,
buildMatchGraph: function(syntaxTree, ref) {
if (typeof syntaxTree === 'string') {
- syntaxTree = parse_1(syntaxTree);
+ syntaxTree = parse$1(syntaxTree);
}
return {
type: 'MatchGraph',
- match: buildMatchGraph(syntaxTree),
+ match: buildMatchGraph$1(syntaxTree),
syntax: ref || null,
source: syntaxTree
};
}
};
- var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
-
- var MATCH$1 = matchGraph.MATCH;
- var MISMATCH$1 = matchGraph.MISMATCH;
- var DISALLOW_EMPTY$1 = matchGraph.DISALLOW_EMPTY;
- var TYPE$6 = _const.TYPE;
+ var hasOwnProperty$6 = Object.prototype.hasOwnProperty;
+ var matchGraph = matchGraph$1;
+ var MATCH = matchGraph.MATCH;
+ var MISMATCH = matchGraph.MISMATCH;
+ var DISALLOW_EMPTY = matchGraph.DISALLOW_EMPTY;
+ var TYPE$B = _const.TYPE;
var STUB = 0;
var TOKEN = 1;
@@ -7473,18 +7901,28 @@
return true;
}
+ function isContextEdgeDelim(token) {
+ if (token.type !== TYPE$B.Delim) {
+ return false;
+ }
+
+ // Fix matching for unicode-range: U+30??, U+FF00-FF9F
+ // Probably we need to check out previous match instead
+ return token.value !== '?';
+ }
+
function isCommaContextStart(token) {
if (token === null) {
return true;
}
return (
- token.type === TYPE$6.Comma ||
- token.type === TYPE$6.Function ||
- token.type === TYPE$6.LeftParenthesis ||
- token.type === TYPE$6.LeftSquareBracket ||
- token.type === TYPE$6.LeftCurlyBracket ||
- token.type === TYPE$6.Delim
+ token.type === TYPE$B.Comma ||
+ token.type === TYPE$B.Function ||
+ token.type === TYPE$B.LeftParenthesis ||
+ token.type === TYPE$B.LeftSquareBracket ||
+ token.type === TYPE$B.LeftCurlyBracket ||
+ isContextEdgeDelim(token)
);
}
@@ -7494,10 +7932,10 @@
}
return (
- token.type === TYPE$6.RightParenthesis ||
- token.type === TYPE$6.RightSquareBracket ||
- token.type === TYPE$6.RightCurlyBracket ||
- token.type === TYPE$6.Delim
+ token.type === TYPE$B.RightParenthesis ||
+ token.type === TYPE$B.RightSquareBracket ||
+ token.type === TYPE$B.RightCurlyBracket ||
+ token.type === TYPE$B.Delim
);
}
@@ -7506,7 +7944,7 @@
do {
tokenIndex++;
token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
- } while (token !== null && (token.type === TYPE$6.WhiteSpace || token.type === TYPE$6.Comment));
+ } while (token !== null && (token.type === TYPE$B.WhiteSpace || token.type === TYPE$B.Comment));
}
function getNextToken(offset) {
@@ -7634,7 +8072,7 @@
if (token !== null) {
// doesn't mismatch if just one token left and it's an IE hack
if (tokenIndex !== tokens.length - 1 || (token.value !== '\\0' && token.value !== '\\9')) {
- state = MISMATCH$1;
+ state = MISMATCH;
break;
}
}
@@ -7648,12 +8086,12 @@
state = thenStack.nextState;
// check match is not empty
- if (state === DISALLOW_EMPTY$1) {
+ if (state === DISALLOW_EMPTY) {
if (thenStack.matchStack === matchStack) {
- state = MISMATCH$1;
+ state = MISMATCH;
break;
} else {
- state = MATCH$1;
+ state = MATCH;
}
}
@@ -7703,11 +8141,11 @@
case 'If':
// IMPORTANT: else stack push must go first,
// since it stores the state of thenStack before changes
- if (state.else !== MISMATCH$1) {
+ if (state.else !== MISMATCH) {
pushElseStack(state.else);
}
- if (state.then !== MATCH$1) {
+ if (state.then !== MATCH) {
pushThenStack(state.then);
}
@@ -7729,18 +8167,18 @@
if (state.index === terms.length) {
// no matches at all or it's required all terms to be matched
if (state.mask === 0 || state.syntax.all) {
- state = MISMATCH$1;
+ state = MISMATCH;
break;
}
// a partial match is ok
- state = MATCH$1;
+ state = MATCH;
break;
}
// all terms are matched
if (state.mask === (1 << terms.length) - 1) {
- state = MATCH$1;
+ state = MATCH;
break;
}
@@ -7782,13 +8220,13 @@
name = name.replace(/\\[09].*$/, '');
}
- if (hasOwnProperty$1.call(state.map, name)) {
+ if (hasOwnProperty$6.call(state.map, name)) {
state = state.map[name];
break;
}
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
case 'Generic':
@@ -7800,9 +8238,9 @@
addTokenToMatch();
}
- state = MATCH$1;
+ state = MATCH;
} else {
- state = MISMATCH$1;
+ state = MISMATCH;
}
break;
@@ -7810,7 +8248,7 @@
case 'Type':
case 'Property':
var syntaxDict = state.type === 'Type' ? 'types' : 'properties';
- var dictSyntax = hasOwnProperty$1.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;
+ var dictSyntax = hasOwnProperty$6.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;
if (!dictSyntax || !dictSyntax.match) {
throw new Error(
@@ -7827,7 +8265,7 @@
// https://drafts.csswg.org/css-values-4/#custom-idents
// When parsing positionally-ambiguous keywords in a property value, a production
// can only claim the keyword if no other unfulfilled production can claim it.
- (state.name === 'custom-ident' && token.type === TYPE$6.Ident) ||
+ (state.name === 'custom-ident' && token.type === TYPE$B.Ident) ||
// https://drafts.csswg.org/css-values-4/#lengths
// ... if a `0` could be parsed as either a or a in a property (such as line-height),
@@ -7839,7 +8277,7 @@
syntaxStash = stateSnapshotFromSyntax(state, elseStack);
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
}
}
@@ -7861,45 +8299,45 @@
if (areStringsEqualCaseInsensitive(keywordName, name)) {
addTokenToMatch();
- state = MATCH$1;
+ state = MATCH;
break;
}
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
case 'AtKeyword':
case 'Function':
if (token !== null && areStringsEqualCaseInsensitive(token.value, state.name)) {
addTokenToMatch();
- state = MATCH$1;
+ state = MATCH;
break;
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
case 'Token':
if (token !== null && token.value === state.value) {
addTokenToMatch();
- state = MATCH$1;
+ state = MATCH;
break;
}
- state = MISMATCH$1;
+ state = MISMATCH;
break;
case 'Comma':
- if (token !== null && token.type === TYPE$6.Comma) {
+ if (token !== null && token.type === TYPE$B.Comma) {
if (isCommaContextStart(matchStack.token)) {
- state = MISMATCH$1;
+ state = MISMATCH;
} else {
addTokenToMatch();
- state = isCommaContextEnd(token) ? MISMATCH$1 : MATCH$1;
+ state = isCommaContextEnd(token) ? MISMATCH : MATCH;
}
} else {
- state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? MATCH$1 : MISMATCH$1;
+ state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? MATCH : MISMATCH;
}
break;
@@ -7916,9 +8354,9 @@
addTokenToMatch();
}
- state = MATCH$1;
+ state = MATCH;
} else {
- state = MISMATCH$1;
+ state = MISMATCH;
}
break;
@@ -7992,7 +8430,7 @@
return matchResult;
}
- function matchAsTree(tokens, matchGraph, syntaxes) {
+ function matchAsTree$1(tokens, matchGraph, syntaxes) {
var matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
if (matchResult.match === null) {
@@ -8041,7 +8479,7 @@
var match = {
matchAsList: matchAsList,
- matchAsTree: matchAsTree,
+ matchAsTree: matchAsTree$1,
getTotalIterationCount: function() {
return totalIterationCount;
}
@@ -8120,13 +8558,15 @@
});
}
- var trace = {
+ var trace$1 = {
getTrace: getTrace,
isType: isType,
isProperty: isProperty,
isKeyword: isKeyword
};
+ var List$5 = List_1;
+
function getFirstMatchNode(matchNode) {
if ('node' in matchNode) {
return matchNode.node;
@@ -8153,7 +8593,7 @@
lexer.syntax.walk(ast, function(node, item, list) {
if (node === start) {
- var nodes = new List_1();
+ var nodes = new List$5();
do {
nodes.appendData(item.data);
@@ -8187,11 +8627,12 @@
return fragments;
}
- var search = {
+ var search$1 = {
matchFragments: matchFragments
};
- var hasOwnProperty$2 = Object.prototype.hasOwnProperty;
+ var List$4 = List_1;
+ var hasOwnProperty$5 = Object.prototype.hasOwnProperty;
function isValidNumber(value) {
// Number.isInteger(value) && value >= 0
@@ -8221,7 +8662,7 @@
for (var key in node) {
var valid = true;
- if (hasOwnProperty$2.call(node, key) === false) {
+ if (hasOwnProperty$5.call(node, key) === false) {
continue;
}
@@ -8266,7 +8707,7 @@
if (typeof fieldType === 'string') {
valid = node[key] && node[key].type === fieldType;
} else if (Array.isArray(fieldType)) {
- valid = node[key] instanceof List_1;
+ valid = node[key] instanceof List$4;
}
}
}
@@ -8280,8 +8721,8 @@
}
for (var key in fields) {
- if (hasOwnProperty$2.call(fields, key) &&
- hasOwnProperty$2.call(node, key) === false) {
+ if (hasOwnProperty$5.call(fields, key) &&
+ hasOwnProperty$5.call(node, key) === false) {
warn(node, 'Field `' + type + '.' + key + '` is missed');
}
}
@@ -8299,7 +8740,7 @@
};
for (var key in structure) {
- if (hasOwnProperty$2.call(structure, key) === false) {
+ if (hasOwnProperty$5.call(structure, key) === false) {
continue;
}
@@ -8338,7 +8779,7 @@
if (config.node) {
for (var name in config.node) {
- if (hasOwnProperty$2.call(config.node, name)) {
+ if (hasOwnProperty$5.call(config.node, name)) {
var nodeType = config.node[name];
if (nodeType.structure) {
@@ -8354,21 +8795,21 @@
}
};
- var SyntaxReferenceError$1 = error.SyntaxReferenceError;
- var MatchError$1 = error.MatchError;
-
-
-
-
-
-
- var buildMatchGraph$1 = matchGraph.buildMatchGraph;
- var matchAsTree$1 = match.matchAsTree;
-
-
+ var SyntaxReferenceError = error.SyntaxReferenceError;
+ var SyntaxMatchError = error.SyntaxMatchError;
+ var names$1 = names$2;
+ var generic = generic$1;
+ var parse = parse_1;
+ var generate = generate_1;
+ var walk = walk$1;
+ var prepareTokens = prepareTokens_1;
+ var buildMatchGraph = matchGraph$1.buildMatchGraph;
+ var matchAsTree = match.matchAsTree;
+ var trace = trace$1;
+ var search = search$1;
var getStructureFromConfig = structure.getStructureFromConfig;
- var cssWideKeywords$1 = buildMatchGraph$1('inherit | initial | unset');
- var cssWideKeywordsWithExpression = buildMatchGraph$1('inherit | initial | unset | <-ms-legacy-expression>');
+ var cssWideKeywords = buildMatchGraph('inherit | initial | unset');
+ var cssWideKeywordsWithExpression = buildMatchGraph('inherit | initial | unset | <-ms-legacy-expression>');
function dumpMapSyntax(map, compact, syntaxAsAst) {
var result = {};
@@ -8377,13 +8818,30 @@
if (map[name].syntax) {
result[name] = syntaxAsAst
? map[name].syntax
- : generate_1(map[name].syntax, { compact: compact });
+ : generate(map[name].syntax, { compact: compact });
}
}
return result;
}
+ function dumpAtruleMapSyntax(map, compact, syntaxAsAst) {
+ const result = {};
+
+ for (const [name, atrule] of Object.entries(map)) {
+ result[name] = {
+ prelude: atrule.prelude && (
+ syntaxAsAst
+ ? atrule.prelude.syntax
+ : generate(atrule.prelude.syntax, { compact })
+ ),
+ descriptors: atrule.descriptors && dumpMapSyntax(atrule.descriptors, compact, syntaxAsAst)
+ };
+ }
+
+ return result;
+ }
+
function valueHasVar(tokens) {
for (var i = 0; i < tokens.length; i++) {
if (tokens[i].value.toLowerCase() === 'var(') {
@@ -8407,7 +8865,7 @@
}
function matchSyntax(lexer, syntax, value, useCommon) {
- var tokens = prepareTokens_1(value, lexer.syntax);
+ var tokens = prepareTokens(value, lexer.syntax);
var result;
if (valueHasVar(tokens)) {
@@ -8415,15 +8873,15 @@
}
if (useCommon) {
- result = matchAsTree$1(tokens, lexer.valueCommonSyntax, lexer);
+ result = matchAsTree(tokens, lexer.valueCommonSyntax, lexer);
}
if (!useCommon || !result.match) {
- result = matchAsTree$1(tokens, syntax.match, lexer);
+ result = matchAsTree(tokens, syntax.match, lexer);
if (!result.match) {
return buildMatchResult(
null,
- new MatchError$1(result.reason, syntax.syntax, value, result),
+ new SyntaxMatchError(result.reason, syntax.syntax, value, result),
result.iterations
);
}
@@ -8432,8 +8890,8 @@
return buildMatchResult(result.match, null, result.iterations);
}
- var Lexer = function(config, syntax, structure) {
- this.valueCommonSyntax = cssWideKeywords$1;
+ var Lexer$1 = function(config, syntax, structure) {
+ this.valueCommonSyntax = cssWideKeywords;
this.syntax = syntax;
this.generic = false;
this.atrules = {};
@@ -8469,7 +8927,7 @@
}
};
- Lexer.prototype = {
+ Lexer$1.prototype = {
structure: {},
checkStructure: function(ast) {
function collectWarning(node, message) {
@@ -8493,7 +8951,7 @@
return warns.length ? warns : false;
},
- createDescriptor: function(syntax, type, name) {
+ createDescriptor: function(syntax, type, name, parent = null) {
var ref = {
type: type,
name: name
@@ -8501,19 +8959,20 @@
var descriptor = {
type: type,
name: name,
+ parent: parent,
syntax: null,
match: null
};
if (typeof syntax === 'function') {
- descriptor.match = buildMatchGraph$1(syntax, ref);
+ descriptor.match = buildMatchGraph(syntax, ref);
} else {
if (typeof syntax === 'string') {
// lazy parsing on first access
Object.defineProperty(descriptor, 'syntax', {
get: function() {
Object.defineProperty(descriptor, 'syntax', {
- value: parse_1(syntax)
+ value: parse(syntax)
});
return descriptor.syntax;
@@ -8527,7 +8986,7 @@
Object.defineProperty(descriptor, 'match', {
get: function() {
Object.defineProperty(descriptor, 'match', {
- value: buildMatchGraph$1(descriptor.syntax, ref)
+ value: buildMatchGraph(descriptor.syntax, ref)
});
return descriptor.match;
@@ -8538,20 +8997,34 @@
return descriptor;
},
addAtrule_: function(name, syntax) {
+ if (!syntax) {
+ return;
+ }
+
this.atrules[name] = {
+ type: 'Atrule',
+ name: name,
prelude: syntax.prelude ? this.createDescriptor(syntax.prelude, 'AtrulePrelude', name) : null,
descriptors: syntax.descriptors
- ? Object.keys(syntax.descriptors).reduce((res, name) => {
- res[name] = this.createDescriptor(syntax.descriptors[name], 'AtruleDescriptor', name);
+ ? Object.keys(syntax.descriptors).reduce((res, descName) => {
+ res[descName] = this.createDescriptor(syntax.descriptors[descName], 'AtruleDescriptor', descName, name);
return res;
}, {})
: null
};
},
addProperty_: function(name, syntax) {
+ if (!syntax) {
+ return;
+ }
+
this.properties[name] = this.createDescriptor(syntax, 'Property', name);
},
addType_: function(name, syntax) {
+ if (!syntax) {
+ return;
+ }
+
this.types[name] = this.createDescriptor(syntax, 'Type', name);
if (syntax === generic['-ms-legacy-expression']) {
@@ -8559,48 +9032,84 @@
}
},
- matchAtrulePrelude: function(atruleName, prelude) {
- var atrule = names.keyword(atruleName);
+ checkAtruleName: function(atruleName) {
+ if (!this.getAtrule(atruleName)) {
+ return new SyntaxReferenceError('Unknown at-rule', '@' + atruleName);
+ }
+ },
+ checkAtrulePrelude: function(atruleName, prelude) {
+ let error = this.checkAtruleName(atruleName);
- var atrulePreludeSyntax = atrule.vendor
- ? this.getAtrulePrelude(atrule.name) || this.getAtrulePrelude(atrule.basename)
- : this.getAtrulePrelude(atrule.name);
-
- if (!atrulePreludeSyntax) {
- if (atrule.basename in this.atrules) {
- return buildMatchResult(null, new Error('At-rule `' + atruleName + '` should not contain a prelude'));
- }
-
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown at-rule', atruleName));
+ if (error) {
+ return error;
}
- return matchSyntax(this, atrulePreludeSyntax, prelude, true);
+ var atrule = this.getAtrule(atruleName);
+
+ if (!atrule.prelude && prelude) {
+ return new SyntaxError('At-rule `@' + atruleName + '` should not contain a prelude');
+ }
+
+ if (atrule.prelude && !prelude) {
+ return new SyntaxError('At-rule `@' + atruleName + '` should contain a prelude');
+ }
+ },
+ checkAtruleDescriptorName: function(atruleName, descriptorName) {
+ let error = this.checkAtruleName(atruleName);
+
+ if (error) {
+ return error;
+ }
+
+ var atrule = this.getAtrule(atruleName);
+ var descriptor = names$1.keyword(descriptorName);
+
+ if (!atrule.descriptors) {
+ return new SyntaxError('At-rule `@' + atruleName + '` has no known descriptors');
+ }
+
+ if (!atrule.descriptors[descriptor.name] &&
+ !atrule.descriptors[descriptor.basename]) {
+ return new SyntaxReferenceError('Unknown at-rule descriptor', descriptorName);
+ }
+ },
+ checkPropertyName: function(propertyName) {
+ var property = names$1.property(propertyName);
+
+ // don't match syntax for a custom property
+ if (property.custom) {
+ return new Error('Lexer matching doesn\'t applicable for custom properties');
+ }
+
+ if (!this.getProperty(propertyName)) {
+ return new SyntaxReferenceError('Unknown property', propertyName);
+ }
+ },
+
+ matchAtrulePrelude: function(atruleName, prelude) {
+ var error = this.checkAtrulePrelude(atruleName, prelude);
+
+ if (error) {
+ return buildMatchResult(null, error);
+ }
+
+ if (!prelude) {
+ return buildMatchResult(null, null);
+ }
+
+ return matchSyntax(this, this.getAtrule(atruleName).prelude, prelude, false);
},
matchAtruleDescriptor: function(atruleName, descriptorName, value) {
- var atrule = names.keyword(atruleName);
- var descriptor = names.keyword(descriptorName);
+ var error = this.checkAtruleDescriptorName(atruleName, descriptorName);
- var atruleEntry = atrule.vendor
- ? this.atrules[atrule.name] || this.atrules[atrule.basename]
- : this.atrules[atrule.name];
-
- if (!atruleEntry) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown at-rule', atruleName));
+ if (error) {
+ return buildMatchResult(null, error);
}
- if (!atruleEntry.descriptors) {
- return buildMatchResult(null, new Error('At-rule `' + atruleName + '` has no known descriptors'));
- }
+ var atrule = this.getAtrule(atruleName);
+ var descriptor = names$1.keyword(descriptorName);
- var atruleDescriptorSyntax = descriptor.vendor
- ? atruleEntry.descriptors[descriptor.name] || atruleEntry.descriptors[descriptor.basename]
- : atruleEntry.descriptors[descriptor.name];
-
- if (!atruleDescriptorSyntax) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown at-rule descriptor', descriptorName));
- }
-
- return matchSyntax(this, atruleDescriptorSyntax, value, true);
+ return matchSyntax(this, atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename], value, false);
},
matchDeclaration: function(node) {
if (node.type !== 'Declaration') {
@@ -8610,35 +9119,26 @@
return this.matchProperty(node.property, node.value);
},
matchProperty: function(propertyName, value) {
- var property = names.property(propertyName);
+ var error = this.checkPropertyName(propertyName);
- // don't match syntax for a custom property
- if (property.custom) {
- return buildMatchResult(null, new Error('Lexer matching doesn\'t applicable for custom properties'));
+ if (error) {
+ return buildMatchResult(null, error);
}
- var propertySyntax = property.vendor
- ? this.getProperty(property.name) || this.getProperty(property.basename)
- : this.getProperty(property.name);
-
- if (!propertySyntax) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown property', propertyName));
- }
-
- return matchSyntax(this, propertySyntax, value, true);
+ return matchSyntax(this, this.getProperty(propertyName), value, true);
},
matchType: function(typeName, value) {
var typeSyntax = this.getType(typeName);
if (!typeSyntax) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Unknown type', typeName));
+ return buildMatchResult(null, new SyntaxReferenceError('Unknown type', typeName));
}
return matchSyntax(this, typeSyntax, value, false);
},
match: function(syntax, value) {
if (typeof syntax !== 'string' && (!syntax || !syntax.type)) {
- return buildMatchResult(null, new SyntaxReferenceError$1('Bad syntax'));
+ return buildMatchResult(null, new SyntaxReferenceError('Bad syntax'));
}
if (typeof syntax === 'string' || !syntax.match) {
@@ -8667,16 +9167,31 @@
return result;
},
- getAtrulePrelude: function(atruleName) {
- return this.atrules.hasOwnProperty(atruleName) ? this.atrules[atruleName].prelude : null;
+ getAtrule: function(atruleName, fallbackBasename = true) {
+ var atrule = names$1.keyword(atruleName);
+ var atruleEntry = atrule.vendor && fallbackBasename
+ ? this.atrules[atrule.name] || this.atrules[atrule.basename]
+ : this.atrules[atrule.name];
+
+ return atruleEntry || null;
+ },
+ getAtrulePrelude: function(atruleName, fallbackBasename = true) {
+ const atrule = this.getAtrule(atruleName, fallbackBasename);
+
+ return atrule && atrule.prelude || null;
},
getAtruleDescriptor: function(atruleName, name) {
return this.atrules.hasOwnProperty(atruleName) && this.atrules.declarators
? this.atrules[atruleName].declarators[name] || null
: null;
},
- getProperty: function(name) {
- return this.properties.hasOwnProperty(name) ? this.properties[name] : null;
+ getProperty: function(propertyName, fallbackBasename = true) {
+ var property = names$1.property(propertyName);
+ var propertyEntry = property.vendor && fallbackBasename
+ ? this.properties[property.name] || this.properties[property.basename]
+ : this.properties[property.name];
+
+ return propertyEntry || null;
},
getType: function(name) {
return this.types.hasOwnProperty(name) ? this.types[name] : null;
@@ -8690,7 +9205,7 @@
broken[name] = false;
if (descriptor.syntax !== null) {
- walk$1(descriptor.syntax, function(node) {
+ walk(descriptor.syntax, function(node) {
if (node.type !== 'Type' && node.type !== 'Property') {
return;
}
@@ -8736,7 +9251,8 @@
return {
generic: this.generic,
types: dumpMapSyntax(this.types, !pretty, syntaxAsAst),
- properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst)
+ properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst),
+ atrules: dumpAtruleMapSyntax(this.atrules, !pretty, syntaxAsAst)
};
},
toString: function() {
@@ -8744,20 +9260,21 @@
}
};
- var Lexer_1 = Lexer;
+ var Lexer_1 = Lexer$1;
- var definitionSyntax = {
- SyntaxError: _SyntaxError$1,
+ var definitionSyntax$1 = {
+ SyntaxError: _SyntaxError,
parse: parse_1,
generate: generate_1,
walk: walk$1
};
- var isBOM$2 = tokenizer.isBOM;
+ var adoptBuffer = adoptBuffer$2;
+ var isBOM = tokenizer$3.isBOM;
- var N$3 = 10;
- var F$2 = 12;
- var R$2 = 13;
+ var N$1 = 10;
+ var F = 12;
+ var R = 13;
function computeLinesAndColumns(host, source) {
var sourceLength = source.length;
@@ -8765,7 +9282,7 @@
var line = host.startLine;
var columns = adoptBuffer(host.columns, sourceLength);
var column = host.startColumn;
- var startOffset = source.length > 0 ? isBOM$2(source.charCodeAt(0)) : 0;
+ var startOffset = source.length > 0 ? isBOM(source.charCodeAt(0)) : 0;
for (var i = startOffset; i < sourceLength; i++) { // -1
var code = source.charCodeAt(i);
@@ -8773,8 +9290,8 @@
lines[i] = line;
columns[i] = column++;
- if (code === N$3 || code === R$2 || code === F$2) {
- if (code === R$2 && i + 1 < sourceLength && source.charCodeAt(i + 1) === N$3) {
+ if (code === N$1 || code === R || code === F) {
+ if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N$1) {
i++;
lines[i] = line;
columns[i] = column;
@@ -8792,13 +9309,13 @@
host.columns = columns;
}
- var OffsetToLocation = function() {
+ var OffsetToLocation$1 = function() {
this.lines = null;
this.columns = null;
this.linesAndColumnsComputed = false;
};
- OffsetToLocation.prototype = {
+ OffsetToLocation$1.prototype = {
setSource: function(source, startOffset, startLine, startColumn) {
this.source = source;
this.startOffset = typeof startOffset === 'undefined' ? 0 : startOffset;
@@ -8842,13 +9359,13 @@
}
};
- var OffsetToLocation_1 = OffsetToLocation;
+ var OffsetToLocation_1 = OffsetToLocation$1;
- var TYPE$7 = tokenizer.TYPE;
- var WHITESPACE$2 = TYPE$7.WhiteSpace;
- var COMMENT$2 = TYPE$7.Comment;
+ var TYPE$A = tokenizer$3.TYPE;
+ var WHITESPACE$a = TYPE$A.WhiteSpace;
+ var COMMENT$8 = TYPE$A.Comment;
- var sequence = function readSequence(recognizer) {
+ var sequence$1 = function readSequence(recognizer) {
var children = this.createList();
var child = null;
var context = {
@@ -8862,11 +9379,11 @@
while (!this.scanner.eof) {
switch (this.scanner.tokenType) {
- case COMMENT$2:
+ case COMMENT$8:
this.scanner.next();
continue;
- case WHITESPACE$2:
+ case WHITESPACE$a:
if (context.ignoreWS) {
this.scanner.next();
} else {
@@ -8899,20 +9416,27 @@
return children;
};
- var findWhiteSpaceStart$1 = utils.findWhiteSpaceStart;
+ var OffsetToLocation = OffsetToLocation_1;
+ var SyntaxError$2 = _SyntaxError$1;
+ var TokenStream$1 = TokenStream_1;
+ var List$3 = List_1;
+ var tokenize$1 = tokenizer$3;
+ var constants = _const;
+ var { findWhiteSpaceStart, cmpStr: cmpStr$2 } = utils$2;
+ var sequence = sequence$1;
+ var noop$1 = function() {};
- var noop$3 = function() {};
-
- var TYPE$8 = _const.TYPE;
- var NAME$2 = _const.NAME;
- var WHITESPACE$3 = TYPE$8.WhiteSpace;
- var IDENT$2 = TYPE$8.Ident;
- var FUNCTION = TYPE$8.Function;
- var URL$1 = TYPE$8.Url;
- var HASH = TYPE$8.Hash;
- var PERCENTAGE = TYPE$8.Percentage;
- var NUMBER$2 = TYPE$8.Number;
- var NUMBERSIGN$1 = 0x0023; // U+0023 NUMBER SIGN (#)
+ var TYPE$z = constants.TYPE;
+ var NAME$1 = constants.NAME;
+ var WHITESPACE$9 = TYPE$z.WhiteSpace;
+ var COMMENT$7 = TYPE$z.Comment;
+ var IDENT$g = TYPE$z.Ident;
+ var FUNCTION$6 = TYPE$z.Function;
+ var URL$4 = TYPE$z.Url;
+ var HASH$5 = TYPE$z.Hash;
+ var PERCENTAGE$3 = TYPE$z.Percentage;
+ var NUMBER$7 = TYPE$z.Number;
+ var NUMBERSIGN$3 = 0x0023; // U+0023 NUMBER SIGN (#)
var NULL = 0;
function createParseContext(name) {
@@ -8978,14 +9502,14 @@
return parserConfig;
}
- var create$1 = function createParser(config) {
+ var create$4 = function createParser(config) {
var parser = {
- scanner: new TokenStream_1(),
- locationMap: new OffsetToLocation_1(),
+ scanner: new TokenStream$1(),
+ locationMap: new OffsetToLocation(),
filename: '',
needPositions: false,
- onParseError: noop$3,
+ onParseError: noop$1,
onParseErrorThrow: false,
parseAtrulePrelude: true,
parseRulePrelude: true,
@@ -8995,10 +9519,10 @@
readSequence: sequence,
createList: function() {
- return new List_1();
+ return new List$3();
},
createSingleNodeList: function(node) {
- return new List_1().appendData(node);
+ return new List$3().appendData(node);
},
getFirstListNode: function(list) {
return list && list.first();
@@ -9030,7 +9554,7 @@
lookupNonWSType: function(offset) {
do {
var type = this.scanner.lookupType(offset++);
- if (type !== WHITESPACE$3) {
+ if (type !== WHITESPACE$9) {
return type;
}
} while (type !== NULL);
@@ -9041,13 +9565,13 @@
eat: function(tokenType) {
if (this.scanner.tokenType !== tokenType) {
var offset = this.scanner.tokenStart;
- var message = NAME$2[tokenType] + ' is expected';
+ var message = NAME$1[tokenType] + ' is expected';
// tweak message and offset
switch (tokenType) {
- case IDENT$2:
+ case IDENT$g:
// when identifier is expected but there is a function or url
- if (this.scanner.tokenType === FUNCTION || this.scanner.tokenType === URL$1) {
+ if (this.scanner.tokenType === FUNCTION$6 || this.scanner.tokenType === URL$4) {
offset = this.scanner.tokenEnd - 1;
message = 'Identifier is expected but function found';
} else {
@@ -9055,16 +9579,16 @@
}
break;
- case HASH:
- if (this.scanner.isDelim(NUMBERSIGN$1)) {
+ case HASH$5:
+ if (this.scanner.isDelim(NUMBERSIGN$3)) {
this.scanner.next();
offset++;
message = 'Name is expected';
}
break;
- case PERCENTAGE:
- if (this.scanner.tokenType === NUMBER$2) {
+ case PERCENTAGE$3:
+ if (this.scanner.tokenType === NUMBER$7) {
offset = this.scanner.tokenEnd;
message = 'Percent sign is expected';
}
@@ -9094,7 +9618,7 @@
consumeFunctionName: function() {
var name = this.scanner.source.substring(this.scanner.tokenStart, this.scanner.tokenEnd - 1);
- this.eat(FUNCTION);
+ this.eat(FUNCTION$6);
return name;
},
@@ -9128,10 +9652,10 @@
var location = typeof offset !== 'undefined' && offset < this.scanner.source.length
? this.locationMap.getLocation(offset)
: this.scanner.eof
- ? this.locationMap.getLocation(findWhiteSpaceStart$1(this.scanner.source, this.scanner.source.length - 1))
+ ? this.locationMap.getLocation(findWhiteSpaceStart(this.scanner.source, this.scanner.source.length - 1))
: this.locationMap.getLocation(this.scanner.tokenStart);
- throw new _SyntaxError(
+ throw new SyntaxError$2(
message || 'Unexpected input',
this.scanner.source,
location.offset,
@@ -9150,9 +9674,10 @@
options = options || {};
var context = options.context || 'default';
+ var onComment = options.onComment;
var ast;
- tokenizer(source, parser.scanner);
+ tokenize$1(source, parser.scanner);
parser.locationMap.setSource(
source,
options.offset,
@@ -9162,7 +9687,7 @@
parser.filename = options.filename || '';
parser.needPositions = Boolean(options.positions);
- parser.onParseError = typeof options.onParseError === 'function' ? options.onParseError : noop$3;
+ parser.onParseError = typeof options.onParseError === 'function' ? options.onParseError : noop$1;
parser.onParseErrorThrow = false;
parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;
parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;
@@ -9173,6 +9698,19 @@
throw new Error('Unknown context `' + context + '`');
}
+ if (typeof onComment === 'function') {
+ parser.scanner.forEachToken((type, start, end) => {
+ if (type === COMMENT$7) {
+ const loc = parser.getLocation(start, end);
+ const value = cmpStr$2(source, end - 2, end, '*/')
+ ? source.slice(start + 2, end - 2)
+ : source.slice(start + 2, end);
+
+ onComment(value, loc);
+ }
+ });
+ }
+
ast = parser.context[context].call(parser, options);
if (!parser.scanner.eof) {
@@ -9183,7 +9721,14 @@
};
};
+ var sourceMapGenerator = {};
+
+ var base64Vlq = {};
+
+ var base64$1 = {};
+
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -9195,7 +9740,7 @@
/**
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
*/
- var encode = function (number) {
+ base64$1.encode = function (number) {
if (0 <= number && number < intToCharMap.length) {
return intToCharMap[number];
}
@@ -9206,7 +9751,7 @@
* Decode a single base 64 character code digit to an integer. Returns -1 on
* failure.
*/
- var decode = function (charCode) {
+ base64$1.decode = function (charCode) {
var bigA = 65; // 'A'
var bigZ = 90; // 'Z'
@@ -9251,12 +9796,8 @@
return -1;
};
- var base64 = {
- encode: encode,
- decode: decode
- };
-
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -9293,7 +9834,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
+ var base64 = base64$1;
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
@@ -9347,7 +9888,7 @@
/**
* Returns the base 64 VLQ encoded value.
*/
- var encode$1 = function base64VLQ_encode(aValue) {
+ base64Vlq.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
@@ -9371,7 +9912,7 @@
* Decodes the next base 64 VLQ value from the given string and returns the
* value and the rest of the string via the out parameter.
*/
- var decode$1 = function base64VLQ_decode(aStr, aIndex, aOutParam) {
+ base64Vlq.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
var strLen = aStr.length;
var result = 0;
var shift = 0;
@@ -9397,13 +9938,11 @@
aOutParam.rest = aIndex;
};
- var base64Vlq = {
- encode: encode$1,
- decode: decode$1
- };
+ var util$3 = {};
- var util = createCommonjsModule(function (module, exports) {
/* -*- Mode: js; js-indent-level: 2; -*- */
+
+ (function (exports) {
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
@@ -9891,31 +10430,20 @@
return normalize(sourceURL);
}
exports.computeSourceURL = computeSourceURL;
- });
- var util_1 = util.getArg;
- var util_2 = util.urlParse;
- var util_3 = util.urlGenerate;
- var util_4 = util.normalize;
- var util_5 = util.join;
- var util_6 = util.isAbsolute;
- var util_7 = util.relative;
- var util_8 = util.toSetString;
- var util_9 = util.fromSetString;
- var util_10 = util.compareByOriginalPositions;
- var util_11 = util.compareByGeneratedPositionsDeflated;
- var util_12 = util.compareByGeneratedPositionsInflated;
- var util_13 = util.parseSourceMapInput;
- var util_14 = util.computeSourceURL;
+ }(util$3));
+
+ var arraySet = {};
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
-
- var has = Object.prototype.hasOwnProperty;
+ var util$2 = util$3;
+ var has$1 = Object.prototype.hasOwnProperty;
var hasNativeMap = typeof Map !== "undefined";
/**
@@ -9924,7 +10452,7 @@
* element is O(1). Removing elements from the set is not supported. Only
* strings are supported for membership.
*/
- function ArraySet() {
+ function ArraySet$1() {
this._array = [];
this._set = hasNativeMap ? new Map() : Object.create(null);
}
@@ -9932,8 +10460,8 @@
/**
* Static method for creating ArraySet instances from an existing array.
*/
- ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
- var set = new ArraySet();
+ ArraySet$1.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet$1();
for (var i = 0, len = aArray.length; i < len; i++) {
set.add(aArray[i], aAllowDuplicates);
}
@@ -9946,7 +10474,7 @@
*
* @returns Number
*/
- ArraySet.prototype.size = function ArraySet_size() {
+ ArraySet$1.prototype.size = function ArraySet_size() {
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
};
@@ -9955,9 +10483,9 @@
*
* @param String aStr
*/
- ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
- var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
- var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
+ ArraySet$1.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var sStr = hasNativeMap ? aStr : util$2.toSetString(aStr);
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has$1.call(this._set, sStr);
var idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
@@ -9976,12 +10504,12 @@
*
* @param String aStr
*/
- ArraySet.prototype.has = function ArraySet_has(aStr) {
+ ArraySet$1.prototype.has = function ArraySet_has(aStr) {
if (hasNativeMap) {
return this._set.has(aStr);
} else {
- var sStr = util.toSetString(aStr);
- return has.call(this._set, sStr);
+ var sStr = util$2.toSetString(aStr);
+ return has$1.call(this._set, sStr);
}
};
@@ -9990,15 +10518,15 @@
*
* @param String aStr
*/
- ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ ArraySet$1.prototype.indexOf = function ArraySet_indexOf(aStr) {
if (hasNativeMap) {
var idx = this._set.get(aStr);
if (idx >= 0) {
return idx;
}
} else {
- var sStr = util.toSetString(aStr);
- if (has.call(this._set, sStr)) {
+ var sStr = util$2.toSetString(aStr);
+ if (has$1.call(this._set, sStr)) {
return this._set[sStr];
}
}
@@ -10011,7 +10539,7 @@
*
* @param Number aIdx
*/
- ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ ArraySet$1.prototype.at = function ArraySet_at(aIdx) {
if (aIdx >= 0 && aIdx < this._array.length) {
return this._array[aIdx];
}
@@ -10023,24 +10551,23 @@
* indicated by indexOf). Note that this is a copy of the internal array used
* for storing the members so that no one can mess with internal state.
*/
- ArraySet.prototype.toArray = function ArraySet_toArray() {
+ ArraySet$1.prototype.toArray = function ArraySet_toArray() {
return this._array.slice();
};
- var ArraySet_1 = ArraySet;
+ arraySet.ArraySet = ArraySet$1;
- var arraySet = {
- ArraySet: ArraySet_1
- };
+ var mappingList = {};
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2014 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
-
+ var util$1 = util$3;
/**
* Determine whether mappingB is after mappingA with respect to generated
@@ -10053,7 +10580,7 @@
var columnA = mappingA.generatedColumn;
var columnB = mappingB.generatedColumn;
return lineB > lineA || lineB == lineA && columnB >= columnA ||
- util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
+ util$1.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
}
/**
@@ -10061,7 +10588,7 @@
* performance conscious manner. It trades a neglibable overhead in general
* case for a large speedup in case of mappings being added in order.
*/
- function MappingList() {
+ function MappingList$1() {
this._array = [];
this._sorted = true;
// Serves as infimum
@@ -10074,7 +10601,7 @@
*
* NOTE: The order of the mappings is NOT guaranteed.
*/
- MappingList.prototype.unsortedForEach =
+ MappingList$1.prototype.unsortedForEach =
function MappingList_forEach(aCallback, aThisArg) {
this._array.forEach(aCallback, aThisArg);
};
@@ -10084,7 +10611,7 @@
*
* @param Object aMapping
*/
- MappingList.prototype.add = function MappingList_add(aMapping) {
+ MappingList$1.prototype.add = function MappingList_add(aMapping) {
if (generatedPositionAfter(this._last, aMapping)) {
this._last = aMapping;
this._array.push(aMapping);
@@ -10103,31 +10630,28 @@
* an immutable borrow. If you want to take ownership, you must make your own
* copy.
*/
- MappingList.prototype.toArray = function MappingList_toArray() {
+ MappingList$1.prototype.toArray = function MappingList_toArray() {
if (!this._sorted) {
- this._array.sort(util.compareByGeneratedPositionsInflated);
+ this._array.sort(util$1.compareByGeneratedPositionsInflated);
this._sorted = true;
}
return this._array;
};
- var MappingList_1 = MappingList;
-
- var mappingList = {
- MappingList: MappingList_1
- };
+ mappingList.MappingList = MappingList$1;
/* -*- Mode: js; js-indent-level: 2; -*- */
+
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
-
-
- var ArraySet$1 = arraySet.ArraySet;
- var MappingList$1 = mappingList.MappingList;
+ var base64VLQ = base64Vlq;
+ var util = util$3;
+ var ArraySet = arraySet.ArraySet;
+ var MappingList = mappingList.MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
@@ -10137,30 +10661,30 @@
* - file: The filename of the generated source.
* - sourceRoot: A root for all relative URLs in this source map.
*/
- function SourceMapGenerator(aArgs) {
+ function SourceMapGenerator$1(aArgs) {
if (!aArgs) {
aArgs = {};
}
this._file = util.getArg(aArgs, 'file', null);
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
- this._sources = new ArraySet$1();
- this._names = new ArraySet$1();
- this._mappings = new MappingList$1();
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+ this._mappings = new MappingList();
this._sourcesContents = null;
}
- SourceMapGenerator.prototype._version = 3;
+ SourceMapGenerator$1.prototype._version = 3;
/**
* Creates a new SourceMapGenerator based on a SourceMapConsumer
*
* @param aSourceMapConsumer The SourceMap.
*/
- SourceMapGenerator.fromSourceMap =
+ SourceMapGenerator$1.fromSourceMap =
function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
- var generator = new SourceMapGenerator({
+ var generator = new SourceMapGenerator$1({
file: aSourceMapConsumer.file,
sourceRoot: sourceRoot
});
@@ -10218,7 +10742,7 @@
* - source: The original source file (relative to the sourceRoot).
* - name: An optional original token name for this mapping.
*/
- SourceMapGenerator.prototype.addMapping =
+ SourceMapGenerator$1.prototype.addMapping =
function SourceMapGenerator_addMapping(aArgs) {
var generated = util.getArg(aArgs, 'generated');
var original = util.getArg(aArgs, 'original', null);
@@ -10256,7 +10780,7 @@
/**
* Set the source content for a source file.
*/
- SourceMapGenerator.prototype.setSourceContent =
+ SourceMapGenerator$1.prototype.setSourceContent =
function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot != null) {
@@ -10296,7 +10820,7 @@
* paths. If so, those relative source paths need to be rewritten
* relative to the SourceMapGenerator.
*/
- SourceMapGenerator.prototype.applySourceMap =
+ SourceMapGenerator$1.prototype.applySourceMap =
function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
var sourceFile = aSourceFile;
// If aSourceFile is omitted, we will use the file property of the SourceMap
@@ -10316,8 +10840,8 @@
}
// Applying the SourceMap can add and remove items from the sources and
// the names array.
- var newSources = new ArraySet$1();
- var newNames = new ArraySet$1();
+ var newSources = new ArraySet();
+ var newNames = new ArraySet();
// Find mappings for the "sourceFile"
this._mappings.unsortedForEach(function (mapping) {
@@ -10384,7 +10908,7 @@
* To maintain consistency, we validate that any new mapping being added falls
* in to one of these categories.
*/
- SourceMapGenerator.prototype._validateMapping =
+ SourceMapGenerator$1.prototype._validateMapping =
function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
aName) {
// When aOriginal is truthy but has empty values for .line and .column,
@@ -10427,7 +10951,7 @@
* Serialize the accumulated mappings in to the stream of base 64 VLQs
* specified by the source map format.
*/
- SourceMapGenerator.prototype._serializeMappings =
+ SourceMapGenerator$1.prototype._serializeMappings =
function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
@@ -10462,27 +10986,27 @@
}
}
- next += base64Vlq.encode(mapping.generatedColumn
+ next += base64VLQ.encode(mapping.generatedColumn
- previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source != null) {
sourceIdx = this._sources.indexOf(mapping.source);
- next += base64Vlq.encode(sourceIdx - previousSource);
+ next += base64VLQ.encode(sourceIdx - previousSource);
previousSource = sourceIdx;
// lines are stored 0-based in SourceMap spec version 3
- next += base64Vlq.encode(mapping.originalLine - 1
+ next += base64VLQ.encode(mapping.originalLine - 1
- previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
- next += base64Vlq.encode(mapping.originalColumn
+ next += base64VLQ.encode(mapping.originalColumn
- previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name != null) {
nameIdx = this._names.indexOf(mapping.name);
- next += base64Vlq.encode(nameIdx - previousName);
+ next += base64VLQ.encode(nameIdx - previousName);
previousName = nameIdx;
}
}
@@ -10493,7 +11017,7 @@
return result;
};
- SourceMapGenerator.prototype._generateSourcesContent =
+ SourceMapGenerator$1.prototype._generateSourcesContent =
function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function (source) {
if (!this._sourcesContents) {
@@ -10512,7 +11036,7 @@
/**
* Externalize the source map.
*/
- SourceMapGenerator.prototype.toJSON =
+ SourceMapGenerator$1.prototype.toJSON =
function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
@@ -10536,26 +11060,22 @@
/**
* Render the source map being generated to a string.
*/
- SourceMapGenerator.prototype.toString =
+ SourceMapGenerator$1.prototype.toString =
function SourceMapGenerator_toString() {
return JSON.stringify(this.toJSON());
};
- var SourceMapGenerator_1 = SourceMapGenerator;
+ sourceMapGenerator.SourceMapGenerator = SourceMapGenerator$1;
- var sourceMapGenerator = {
- SourceMapGenerator: SourceMapGenerator_1
- };
-
- var SourceMapGenerator$1 = sourceMapGenerator.SourceMapGenerator;
+ var SourceMapGenerator = sourceMapGenerator.SourceMapGenerator;
var trackNodes = {
Atrule: true,
Selector: true,
Declaration: true
};
- var sourceMap = function generateSourceMap(handlers) {
- var map = new SourceMapGenerator$1();
+ var sourceMap$1 = function generateSourceMap(handlers) {
+ var map = new SourceMapGenerator();
var line = 1;
var column = 0;
var generated = {
@@ -10643,7 +11163,8 @@
return handlers;
};
- var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
+ var sourceMap = sourceMap$1;
+ var hasOwnProperty$4 = Object.prototype.hasOwnProperty;
function processChildren(node, delimeter) {
var list = node.children;
@@ -10663,9 +11184,9 @@
}
}
- var create$2 = function createGenerator(config) {
+ var create$3 = function createGenerator(config) {
function processNode(node) {
- if (hasOwnProperty$3.call(types, node.type)) {
+ if (hasOwnProperty$4.call(types, node.type)) {
types[node.type].call(this, node);
} else {
throw new Error('Unknown node type: ' + node.type);
@@ -10709,13 +11230,15 @@
};
};
- var create$3 = function createConvertors(walk) {
+ var List$2 = List_1;
+
+ var create$2 = function createConvertors(walk) {
return {
fromPlainObject: function(ast) {
walk(ast, {
enter: function(node) {
- if (node.children && node.children instanceof List_1 === false) {
- node.children = new List_1().fromArray(node.children);
+ if (node.children && node.children instanceof List$2 === false) {
+ node.children = new List$2().fromArray(node.children);
}
}
});
@@ -10725,7 +11248,7 @@
toPlainObject: function(ast) {
walk(ast, {
leave: function(node) {
- if (node.children && node.children instanceof List_1) {
+ if (node.children && node.children instanceof List$2) {
node.children = node.children.toArray();
}
}
@@ -10736,11 +11259,11 @@
};
};
- var hasOwnProperty$4 = Object.prototype.hasOwnProperty;
- var noop$4 = function() {};
+ var hasOwnProperty$3 = Object.prototype.hasOwnProperty;
+ var noop = function() {};
- function ensureFunction$1(value) {
- return typeof value === 'function' ? value : noop$4;
+ function ensureFunction(value) {
+ return typeof value === 'function' ? value : noop;
}
function invokeForType(fn, type) {
@@ -10756,7 +11279,7 @@
var walkers = [];
for (var key in structure) {
- if (hasOwnProperty$4.call(structure, key) === false) {
+ if (hasOwnProperty$3.call(structure, key) === false) {
continue;
}
@@ -10801,7 +11324,7 @@
var types = {};
for (var name in config.node) {
- if (hasOwnProperty$4.call(config.node, name)) {
+ if (hasOwnProperty$3.call(config.node, name)) {
var nodeType = config.node[name];
if (!nodeType.structure) {
@@ -10824,7 +11347,7 @@
fields.reverse();
}
- return function(node, context, walk) {
+ return function(node, context, walk, walkReducer) {
var prevContextValue;
if (useContext) {
@@ -10838,13 +11361,15 @@
if (!field.nullable || ref) {
if (field.type === 'list') {
- if (reverse) {
- ref.forEachRight(walk);
- } else {
- ref.forEach(walk);
+ var breakWalk = reverse
+ ? ref.reduceRight(walkReducer, false)
+ : ref.reduce(walkReducer, false);
+
+ if (breakWalk) {
+ return true;
}
- } else {
- walk(ref);
+ } else if (walk(ref)) {
+ return true;
}
}
}
@@ -10879,13 +11404,15 @@
};
}
- var create$4 = function createWalker(config) {
+ var create$1 = function createWalker(config) {
var types = getTypesFromConfig(config);
var iteratorsNatural = {};
var iteratorsReverse = {};
+ var breakWalk = Symbol('break-walk');
+ var skipNode = Symbol('skip-node');
for (var name in types) {
- if (hasOwnProperty$4.call(types, name) && types[name] !== null) {
+ if (hasOwnProperty$3.call(types, name) && types[name] !== null) {
iteratorsNatural[name] = createTypeIterator(types[name], false);
iteratorsReverse[name] = createTypeIterator(types[name], true);
}
@@ -10896,19 +11423,38 @@
var walk = function(root, options) {
function walkNode(node, item, list) {
- enter.call(context, node, item, list);
+ var enterRet = enter.call(context, node, item, list);
- if (iterators.hasOwnProperty(node.type)) {
- iterators[node.type](node, context, walkNode);
+ if (enterRet === breakWalk) {
+ debugger;
+ return true;
}
- leave.call(context, node, item, list);
+ if (enterRet === skipNode) {
+ return false;
+ }
+
+ if (iterators.hasOwnProperty(node.type)) {
+ if (iterators[node.type](node, context, walkNode, walkReducer)) {
+ return true;
+ }
+ }
+
+ if (leave.call(context, node, item, list) === breakWalk) {
+ return true;
+ }
+
+ return false;
}
- var enter = noop$4;
- var leave = noop$4;
+ var walkReducer = (ret, data, item, list) => ret || walkNode(data, item, list);
+ var enter = noop;
+ var leave = noop;
var iterators = iteratorsNatural;
var context = {
+ break: breakWalk,
+ skip: skipNode,
+
root: root,
stylesheet: null,
atrule: null,
@@ -10923,8 +11469,8 @@
if (typeof options === 'function') {
enter = options;
} else if (options) {
- enter = ensureFunction$1(options.enter);
- leave = ensureFunction$1(options.leave);
+ enter = ensureFunction(options.enter);
+ leave = ensureFunction(options.leave);
if (options.reverse) {
iterators = iteratorsReverse;
@@ -10944,26 +11490,23 @@
}
}
- if (enter === noop$4 && leave === noop$4) {
+ if (enter === noop && leave === noop) {
throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
}
- // swap handlers in reverse mode to invert visit order
- if (options.reverse) {
- var tmp = enter;
- enter = leave;
- leave = tmp;
- }
-
walkNode(root);
};
+ walk.break = breakWalk;
+ walk.skip = skipNode;
+
walk.find = function(ast, fn) {
var found = null;
walk(ast, function(node, item, list) {
- if (found === null && fn.call(this, node, item, list)) {
+ if (fn.call(this, node, item, list)) {
found = node;
+ return breakWalk;
}
});
@@ -10976,8 +11519,9 @@
walk(ast, {
reverse: true,
enter: function(node, item, list) {
- if (found === null && fn.call(this, node, item, list)) {
+ if (fn.call(this, node, item, list)) {
found = node;
+ return breakWalk;
}
}
});
@@ -11000,14 +11544,16 @@
return walk;
};
- var clone = function clone(node) {
+ var List$1 = List_1;
+
+ var clone$1 = function clone(node) {
var result = {};
for (var key in node) {
var value = node[key];
if (value) {
- if (Array.isArray(value) || value instanceof List_1) {
+ if (Array.isArray(value) || value instanceof List$1) {
value = value.map(clone);
} else if (value.constructor === Object) {
value = clone(value);
@@ -11020,84 +11566,138 @@
return result;
};
- var hasOwnProperty$5 = Object.prototype.hasOwnProperty;
- var shape = {
+ const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
+ const shape$1 = {
generic: true,
- types: {},
- atrules: {},
- properties: {},
- parseContext: {},
- scope: {},
+ types: appendOrAssign,
+ atrules: {
+ prelude: appendOrAssignOrNull,
+ descriptors: appendOrAssignOrNull
+ },
+ properties: appendOrAssign,
+ parseContext: assign,
+ scope: deepAssign,
atrule: ['parse'],
pseudo: ['parse'],
node: ['name', 'structure', 'parse', 'generate', 'walkContext']
};
- function isObject(value) {
+ function isObject$2(value) {
return value && value.constructor === Object;
}
function copy(value) {
- if (isObject(value)) {
- return Object.assign({}, value);
- } else {
- return value;
- }
+ return isObject$2(value)
+ ? Object.assign({}, value)
+ : value;
}
- function extend(dest, src) {
- for (var key in src) {
- if (hasOwnProperty$5.call(src, key)) {
- if (isObject(dest[key])) {
- extend(dest[key], copy(src[key]));
+
+ function assign(dest, src) {
+ return Object.assign(dest, src);
+ }
+
+ function deepAssign(dest, src) {
+ for (const key in src) {
+ if (hasOwnProperty$2.call(src, key)) {
+ if (isObject$2(dest[key])) {
+ deepAssign(dest[key], copy(src[key]));
} else {
dest[key] = copy(src[key]);
}
}
}
+
+ return dest;
}
- function mix(dest, src, shape) {
- for (var key in shape) {
- if (hasOwnProperty$5.call(shape, key) === false) {
+ function append(a, b) {
+ if (typeof b === 'string' && /^\s*\|/.test(b)) {
+ return typeof a === 'string'
+ ? a + b
+ : b.replace(/^\s*\|\s*/, '');
+ }
+
+ return b || null;
+ }
+
+ function appendOrAssign(a, b) {
+ if (typeof b === 'string') {
+ return append(a, b);
+ }
+
+ const result = Object.assign({}, a);
+ for (let key in b) {
+ if (hasOwnProperty$2.call(b, key)) {
+ result[key] = append(hasOwnProperty$2.call(a, key) ? a[key] : undefined, b[key]);
+ }
+ }
+
+ return result;
+ }
+
+ function appendOrAssignOrNull(a, b) {
+ const result = appendOrAssign(a, b);
+
+ return !isObject$2(result) || Object.keys(result).length
+ ? result
+ : null;
+ }
+
+ function mix$1(dest, src, shape) {
+ for (const key in shape) {
+ if (hasOwnProperty$2.call(shape, key) === false) {
continue;
}
if (shape[key] === true) {
if (key in src) {
- if (hasOwnProperty$5.call(src, key)) {
+ if (hasOwnProperty$2.call(src, key)) {
dest[key] = copy(src[key]);
}
}
} else if (shape[key]) {
- if (isObject(shape[key])) {
- var res = {};
- extend(res, dest[key]);
- extend(res, src[key]);
- dest[key] = res;
+ if (typeof shape[key] === 'function') {
+ const fn = shape[key];
+ dest[key] = fn({}, dest[key]);
+ dest[key] = fn(dest[key] || {}, src[key]);
+ } else if (isObject$2(shape[key])) {
+ const result = {};
+
+ for (let name in dest[key]) {
+ result[name] = mix$1({}, dest[key][name], shape[key]);
+ }
+
+ for (let name in src[key]) {
+ result[name] = mix$1(result[name] || {}, src[key][name], shape[key]);
+ }
+
+ dest[key] = result;
} else if (Array.isArray(shape[key])) {
- var res = {};
- var innerShape = shape[key].reduce(function(s, k) {
+ const res = {};
+ const innerShape = shape[key].reduce(function(s, k) {
s[k] = true;
return s;
}, {});
- for (var name in dest[key]) {
- if (hasOwnProperty$5.call(dest[key], name)) {
- res[name] = {};
- if (dest[key] && dest[key][name]) {
- mix(res[name], dest[key][name], innerShape);
- }
+
+ for (const [name, value] of Object.entries(dest[key] || {})) {
+ res[name] = {};
+ if (value) {
+ mix$1(res[name], value, innerShape);
}
}
- for (var name in src[key]) {
- if (hasOwnProperty$5.call(src[key], name)) {
+
+ for (const name in src[key]) {
+ if (hasOwnProperty$2.call(src[key], name)) {
if (!res[name]) {
res[name] = {};
}
+
if (src[key] && src[key][name]) {
- mix(res[name], src[key][name], innerShape);
+ mix$1(res[name], src[key][name], innerShape);
}
}
}
+
dest[key] = res;
}
}
@@ -11105,21 +11705,33 @@
return dest;
}
- var mix_1 = function(dest, src) {
- return mix(dest, src, shape);
- };
+ var mix_1 = (dest, src) => mix$1(dest, src, shape$1);
+
+ var List = List_1;
+ var SyntaxError$1 = _SyntaxError$1;
+ var TokenStream = TokenStream_1;
+ var Lexer = Lexer_1;
+ var definitionSyntax = definitionSyntax$1;
+ var tokenize = tokenizer$3;
+ var createParser = create$4;
+ var createGenerator = create$3;
+ var createConvertor = create$2;
+ var createWalker = create$1;
+ var clone = clone$1;
+ var names = names$2;
+ var mix = mix_1;
function createSyntax(config) {
- var parse = create$1(config);
- var walk = create$4(config);
- var generate = create$2(config);
- var convert = create$3(walk);
+ var parse = createParser(config);
+ var walk = createWalker(config);
+ var generate = createGenerator(config);
+ var convert = createConvertor(walk);
var syntax = {
- List: List_1,
- SyntaxError: _SyntaxError,
- TokenStream: TokenStream_1,
- Lexer: Lexer_1,
+ List: List,
+ SyntaxError: SyntaxError$1,
+ TokenStream: TokenStream,
+ Lexer: Lexer,
vendorPrefix: names.vendorPrefix,
keyword: names.keyword,
@@ -11129,10 +11741,10 @@
definitionSyntax: definitionSyntax,
lexer: null,
createLexer: function(config) {
- return new Lexer_1(config, syntax, syntax.lexer.structure);
+ return new Lexer(config, syntax, syntax.lexer.structure);
},
- tokenize: tokenizer,
+ tokenize: tokenize,
parse: parse,
walk: walk,
generate: generate,
@@ -11146,19 +11758,19 @@
toPlainObject: convert.toPlainObject,
createSyntax: function(config) {
- return createSyntax(mix_1({}, config));
+ return createSyntax(mix({}, config));
},
fork: function(extension) {
- var base = mix_1({}, config); // copy of config
+ var base = mix({}, config); // copy of config
return createSyntax(
typeof extension === 'function'
? extension(base, Object.assign)
- : mix_1(base, extension)
+ : mix(base, extension)
);
}
};
- syntax.lexer = new Lexer_1({
+ syntax.lexer = new Lexer({
generic: true,
types: config.types,
atrules: config.atrules,
@@ -11168,15 +11780,11 @@
return syntax;
}
- var create_1 = function(config) {
- return createSyntax(mix_1({}, config));
+ create$5.create = function(config) {
+ return createSyntax(mix({}, config));
};
- var create$5 = {
- create: create_1
- };
-
- var atRules = {
+ var require$$0 = {
"@charset": {
syntax: "@charset \"\";",
groups: [
@@ -11197,7 +11805,7 @@
"additive-symbols": {
syntax: "[ && ]#",
media: "all",
- initial: "N/A",
+ initial: "n/a (required)",
percentages: "no",
computed: "asSpecified",
order: "orderOfAppearance",
@@ -11269,7 +11877,7 @@
symbols: {
syntax: "+",
media: "all",
- initial: "N/A",
+ initial: "n/a (required)",
percentages: "no",
computed: "asSpecified",
order: "orderOfAppearance",
@@ -11476,7 +12084,7 @@
percentages: "no",
computed: "asSpecified",
order: "uniqueOrder",
- status: "experimental"
+ status: "standard"
},
marks: {
syntax: "none | [ crop || cross ]",
@@ -11488,11 +12096,64 @@
percentages: "no",
computed: "asSpecified",
order: "orderOfAppearance",
- status: "experimental"
+ status: "standard"
+ },
+ size: {
+ syntax: "{1,2} | auto | [ || [ portrait | landscape ] ]",
+ media: [
+ "visual",
+ "paged"
+ ],
+ initial: "auto",
+ percentages: "no",
+ computed: "asSpecifiedRelativeToAbsoluteLengths",
+ order: "orderOfAppearance",
+ status: "standard"
}
},
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@page"
+ },
+ "@property": {
+ syntax: "@property {\n \n}",
+ interfaces: [
+ "CSS",
+ "CSSPropertyRule"
+ ],
+ groups: [
+ "CSS Houdini"
+ ],
+ descriptors: {
+ syntax: {
+ syntax: "",
+ media: "all",
+ percentages: "no",
+ initial: "n/a (required)",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental"
+ },
+ inherits: {
+ syntax: "true | false",
+ media: "all",
+ percentages: "no",
+ initial: "auto",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental"
+ },
+ "initial-value": {
+ syntax: "",
+ media: "all",
+ initial: "n/a (required)",
+ percentages: "no",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental"
+ }
+ },
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/@property"
},
"@supports": {
syntax: "@supports {\n \n}",
@@ -11633,6 +12294,18 @@
order: "uniqueOrder",
status: "standard"
},
+ "viewport-fit": {
+ syntax: "auto | contain | cover",
+ media: [
+ "visual",
+ "continuous"
+ ],
+ initial: "auto",
+ percentages: "no",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "standard"
+ },
width: {
syntax: "{1,2}",
media: [
@@ -11672,11 +12345,6 @@
}
};
- var atRules$1 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- 'default': atRules
- });
-
var all = {
syntax: "initial | inherit | unset | revert",
media: "noPracticalMedia",
@@ -11728,7 +12396,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/animation"
};
var appearance = {
- syntax: "none | auto | button | textfield | ",
+ syntax: "none | auto | textfield | menulist-button | ",
media: "all",
inherited: false,
animationType: "discrete",
@@ -11741,7 +12409,7 @@
computed: "asSpecified",
order: "perGrammar",
status: "experimental",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-appearance"
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/appearance"
};
var azimuth = {
syntax: " | [ [ left-side | far-left | left | center-left | center | center-right | right | far-right | right-side ] || behind ] | leftwards | rightwards",
@@ -11888,7 +12556,7 @@
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/clip"
};
- var color = {
+ var color$1 = {
syntax: "",
media: "visual",
inherited: true,
@@ -11947,7 +12615,7 @@
appliesto: "allElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/contain"
};
var content = {
@@ -12141,7 +12809,7 @@
"row-gap",
"column-gap"
],
- appliesto: "gridContainers",
+ appliesto: "multiColumnElementsFlexContainersGridContainers",
computed: [
"row-gap",
"column-gap"
@@ -12194,7 +12862,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/grid"
};
var height = {
- syntax: "[ | ] && [ border-box | content-box ]? | available | min-content | max-content | fit-content | auto",
+ syntax: "auto | | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -12297,7 +12965,8 @@
],
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin"
@@ -12384,7 +13053,7 @@
],
order: "perGrammar",
stacking: true,
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/offset"
};
var opacity = {
@@ -12416,7 +13085,7 @@
"CSS Flexible Box Layout"
],
initial: "0",
- appliesto: "flexItemsAndAbsolutelyPositionedFlexContainerChildren",
+ appliesto: "flexItemsGridItemsAbsolutelyPositionedContainerChildren",
computed: "asSpecified",
order: "uniqueOrder",
status: "standard",
@@ -12480,7 +13149,10 @@
],
initial: "visible",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: [
+ "overflow-x",
+ "overflow-y"
+ ],
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overflow"
@@ -12509,7 +13181,8 @@
],
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding"
@@ -12531,7 +13204,7 @@
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/perspective"
};
- var position = {
+ var position$1 = {
syntax: "static | relative | absolute | sticky | fixed",
media: "visual",
inherited: false,
@@ -12739,7 +13412,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/widows"
};
var width = {
- syntax: "[ | ] && [ border-box | content-box ]? | available | min-content | max-content | fit-content | auto",
+ syntax: "auto | | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -12770,7 +13443,7 @@
status: "nonstandard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/zoom"
};
- var properties$1 = {
+ var require$$1 = {
"--*": {
syntax: "",
media: "all",
@@ -13009,6 +13682,38 @@
order: "uniqueOrder",
status: "nonstandard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-ms-flow-into"
+ },
+ "-ms-grid-columns": {
+ syntax: "none | | ",
+ media: "visual",
+ inherited: false,
+ animationType: "simpleListOfLpcDifferenceLpc",
+ percentages: "referToDimensionOfContentArea",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "none",
+ appliesto: "gridContainers",
+ computed: "asSpecifiedRelativeToAbsoluteLengths",
+ order: "uniqueOrder",
+ status: "nonstandard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-ms-grid-columns"
+ },
+ "-ms-grid-rows": {
+ syntax: "none | | ",
+ media: "visual",
+ inherited: false,
+ animationType: "simpleListOfLpcDifferenceLpc",
+ percentages: "referToDimensionOfContentArea",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "none",
+ appliesto: "gridContainers",
+ computed: "asSpecifiedRelativeToAbsoluteLengths",
+ order: "uniqueOrder",
+ status: "nonstandard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-ms-grid-rows"
},
"-ms-high-contrast-adjust": {
syntax: "auto | none",
@@ -13575,7 +14280,7 @@
computed: "asSpecified",
order: "uniqueOrder",
status: "nonstandard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-appearance"
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/appearance"
},
"-moz-binding": {
syntax: " | none",
@@ -13690,7 +14395,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-float-edge"
},
"-moz-force-broken-image-icon": {
- syntax: "",
+ syntax: "",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -13950,7 +14655,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-window-shadow"
},
"-webkit-appearance": {
- syntax: "none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield",
+ syntax: "none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -13963,7 +14668,7 @@
computed: "asSpecified",
order: "uniqueOrder",
status: "nonstandard",
- mdn_url: "https://developer.mozilla.org/docs/Web/CSS/-moz-appearance"
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/appearance"
},
"-webkit-border-before": {
syntax: "<'border-width'> || <'border-style'> || <'color'>",
@@ -14474,6 +15179,22 @@
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/align-self"
+ },
+ "align-tracks": {
+ syntax: "[ normal | | | ? ]#",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "normal",
+ appliesto: "gridContainersWithMasonryLayoutInTheirBlockAxis",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/align-tracks"
},
all: all,
animation: animation,
@@ -14636,7 +15357,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/backdrop-filter"
},
"backface-visibility": {
@@ -14804,7 +15525,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/background-position"
},
"background-position-x": {
- syntax: "[ center | [ left | right | x-start | x-end ]? ? ]#",
+ syntax: "[ center | [ [ left | right | x-start | x-end ]? ? ]! ]#",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -14820,7 +15541,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/background-position-x"
},
"background-position-y": {
- syntax: "[ center | [ top | bottom | y-start | y-end ]? ? ]#",
+ syntax: "[ center | [ [ top | bottom | y-start | y-end ]? ? ]! ]#",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -14896,7 +15617,7 @@
syntax: "<'width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "blockSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -14985,7 +15706,11 @@
syntax: "<'border-top-width'> || <'border-top-style'> || <'color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: [
+ "border-block-end-color",
+ "border-block-end-style",
+ "border-block-end-width"
+ ],
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15009,7 +15734,7 @@
syntax: "<'border-top-color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "color",
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15041,7 +15766,7 @@
syntax: "<'border-top-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -15057,7 +15782,11 @@
syntax: "<'border-top-width'> || <'border-top-style'> || <'color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: [
+ "border-block-start-color",
+ "border-block-start-style",
+ "border-block-start-width"
+ ],
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15081,7 +15810,7 @@
syntax: "<'border-top-color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "color",
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15113,7 +15842,7 @@
syntax: "<'border-top-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -15496,7 +16225,11 @@
syntax: "<'border-top-width'> || <'border-top-style'> || <'color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: [
+ "border-inline-end-color",
+ "border-inline-end-style",
+ "border-inline-end-width"
+ ],
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15568,7 +16301,7 @@
syntax: "<'border-top-color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "color",
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15600,7 +16333,7 @@
syntax: "<'border-top-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -15616,7 +16349,11 @@
syntax: "<'border-top-width'> || <'border-top-style'> || <'color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: [
+ "border-inline-start-color",
+ "border-inline-start-style",
+ "border-inline-start-width"
+ ],
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15640,7 +16377,7 @@
syntax: "<'border-top-color'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "color",
percentages: "no",
groups: [
"CSS Logical Properties"
@@ -15672,7 +16409,7 @@
syntax: "<'border-top-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -16423,7 +17160,7 @@
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/clip-path"
},
- color: color,
+ color: color$1,
"color-adjust": {
syntax: "economy | exact",
media: "visual",
@@ -16895,7 +17632,7 @@
"::first-line",
"::placeholder"
],
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/font-variation-settings"
},
"font-size": {
@@ -16939,6 +17676,22 @@
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/font-size-adjust"
+ },
+ "font-smooth": {
+ syntax: "auto | never | always | | ",
+ media: "visual",
+ inherited: true,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Fonts"
+ ],
+ initial: "auto",
+ appliesto: "allElements",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "nonstandard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/font-smooth"
},
"font-stretch": {
syntax: "",
@@ -17514,7 +18267,7 @@
groups: [
"CSS Images"
],
- initial: "0deg",
+ initial: "from-image",
appliesto: "allElements",
computed: "angleRoundedToNextQuarter",
order: "uniqueOrder",
@@ -17604,7 +18357,7 @@
syntax: "<'width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "inlineSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -17761,6 +18514,22 @@
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/justify-self"
+ },
+ "justify-tracks": {
+ syntax: "[ normal | | ? [ | left | right ] ]#",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "normal",
+ appliesto: "gridContainersWithMasonryLayoutInTheirInlineAxis",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/justify-tracks"
},
left: left,
"letter-spacing": {
@@ -17786,7 +18555,7 @@
"line-break": {
syntax: "auto | loose | normal | strict | anywhere",
media: "visual",
- inherited: false,
+ inherited: true,
animationType: "discrete",
percentages: "no",
groups: [
@@ -17944,7 +18713,7 @@
syntax: "<'margin-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "dependsOnLayoutModel",
groups: [
"CSS Logical Properties"
@@ -17960,7 +18729,7 @@
syntax: "<'margin-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "dependsOnLayoutModel",
groups: [
"CSS Logical Properties"
@@ -17986,7 +18755,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-bottom"
@@ -18011,7 +18781,7 @@
syntax: "<'margin-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "dependsOnLayoutModel",
groups: [
"CSS Logical Properties"
@@ -18027,7 +18797,7 @@
syntax: "<'margin-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "dependsOnLayoutModel",
groups: [
"CSS Logical Properties"
@@ -18053,7 +18823,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-left"
@@ -18072,7 +18843,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-right"
@@ -18091,10 +18863,31 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-top"
+ },
+ "margin-trim": {
+ syntax: "none | in-flow | all",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Box Model"
+ ],
+ initial: "none",
+ appliesto: "blockContainersAndMultiColumnContainers",
+ computed: "asSpecified",
+ order: "perGrammar",
+ alsoAppliesTo: [
+ "::first-letter",
+ "::first-line"
+ ],
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/margin-trim"
},
mask: mask,
"mask-border": {
@@ -18135,7 +18928,7 @@
],
order: "perGrammar",
stacking: true,
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border"
},
"mask-border-mode": {
@@ -18151,7 +18944,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-mode"
},
"mask-border-outset": {
@@ -18167,7 +18960,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecifiedRelativeToAbsoluteLengths",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-outset"
},
"mask-border-repeat": {
@@ -18183,7 +18976,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-repeat"
},
"mask-border-slice": {
@@ -18199,7 +18992,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-slice"
},
"mask-border-source": {
@@ -18215,7 +19008,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecifiedURLsAbsolute",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-source"
},
"mask-border-width": {
@@ -18231,7 +19024,7 @@
appliesto: "allElementsSVGContainerElements",
computed: "asSpecifiedRelativeToAbsoluteLengths",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-border-width"
},
"mask-clip": {
@@ -18377,12 +19170,44 @@
order: "perGrammar",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/mask-type"
+ },
+ "masonry-auto-flow": {
+ syntax: "[ pack | next ] || [ definite-first | ordered ]",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Grid Layout"
+ ],
+ initial: "pack",
+ appliesto: "gridContainersWithMasonryLayout",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "experimental",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/masonry-auto-flow"
+ },
+ "math-style": {
+ syntax: "normal | compact",
+ media: "visual",
+ inherited: true,
+ animationType: "notAnimatable",
+ percentages: "no",
+ groups: [
+ "MathML"
+ ],
+ initial: "normal",
+ appliesto: "allElements",
+ computed: "asSpecified",
+ order: "perGrammar",
+ status: "standard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/math-style"
},
"max-block-size": {
syntax: "<'max-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "blockSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18391,11 +19216,11 @@
appliesto: "sameAsWidthAndHeight",
computed: "sameAsMaxWidthAndMaxHeight",
order: "uniqueOrder",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/max-block-size"
},
"max-height": {
- syntax: " | | none | max-content | min-content | fit-content | fill-available",
+ syntax: "none | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -18414,7 +19239,7 @@
syntax: "<'max-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "inlineSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18423,7 +19248,7 @@
appliesto: "sameAsWidthAndHeight",
computed: "sameAsMaxWidthAndMaxHeight",
order: "uniqueOrder",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/max-inline-size"
},
"max-lines": {
@@ -18442,7 +19267,7 @@
status: "experimental"
},
"max-width": {
- syntax: " | | none | max-content | min-content | fit-content | fill-available",
+ syntax: "none | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -18461,7 +19286,7 @@
syntax: "<'min-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "blockSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18474,7 +19299,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/min-block-size"
},
"min-height": {
- syntax: " | | auto | max-content | min-content | fit-content | fill-available",
+ syntax: "auto | | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -18493,7 +19318,7 @@
syntax: "<'min-width'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "lpc",
percentages: "inlineSizeOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18506,7 +19331,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/min-inline-size"
},
"min-width": {
- syntax: " | | auto | max-content | min-content | fit-content | fill-available",
+ syntax: "auto | | | min-content | max-content | fit-content()",
media: "visual",
inherited: false,
animationType: "lpc",
@@ -18584,7 +19409,7 @@
appliesto: "transformableElements",
computed: "forLengthAbsoluteValueOtherwisePercentage",
order: "perGrammar",
- status: "experimental"
+ status: "standard"
},
"offset-distance": {
syntax: "",
@@ -18599,11 +19424,11 @@
appliesto: "transformableElements",
computed: "forLengthAbsoluteValueOtherwisePercentage",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/offset-distance"
},
"offset-path": {
- syntax: "none | ray( [ && ? && contain? ] ) | | | [ || ]",
+ syntax: "none | ray( [ && && contain? ] ) | | | [ || ]",
media: "visual",
inherited: false,
animationType: "angleOrBasicShapeOrPath",
@@ -18616,7 +19441,7 @@
computed: "asSpecified",
order: "perGrammar",
stacking: true,
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/offset-path"
},
"offset-position": {
@@ -18647,7 +19472,7 @@
appliesto: "transformableElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/offset-rotate"
},
opacity: opacity,
@@ -18744,7 +19569,7 @@
appliesto: "allElements",
computed: "asSpecified",
order: "perGrammar",
- status: "experimental"
+ status: "standard"
},
"overflow-block": {
syntax: "visible | hidden | clip | scroll | auto",
@@ -18757,9 +19582,9 @@
],
initial: "auto",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
order: "perGrammar",
- status: "experimental"
+ status: "standard"
},
"overflow-clip-box": {
syntax: "padding-box | content-box",
@@ -18788,9 +19613,9 @@
],
initial: "auto",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
order: "perGrammar",
- status: "experimental"
+ status: "standard"
},
"overflow-wrap": {
syntax: "normal | break-word | anywhere",
@@ -18819,7 +19644,7 @@
],
initial: "visible",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overflow-x"
@@ -18835,7 +19660,7 @@
],
initial: "visible",
appliesto: "blockContainersFlexContainersGridContainers",
- computed: "asSpecified",
+ computed: "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
order: "uniqueOrder",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overflow-y"
@@ -18853,8 +19678,40 @@
appliesto: "nonReplacedBlockAndInlineBlockElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "nonstandard",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior"
+ },
+ "overscroll-behavior-block": {
+ syntax: "contain | none | auto",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Box Model"
+ ],
+ initial: "auto",
+ appliesto: "nonReplacedBlockAndInlineBlockElements",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "standard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-block"
+ },
+ "overscroll-behavior-inline": {
+ syntax: "contain | none | auto",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Box Model"
+ ],
+ initial: "auto",
+ appliesto: "nonReplacedBlockAndInlineBlockElements",
+ computed: "asSpecified",
+ order: "uniqueOrder",
+ status: "standard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-inline"
},
"overscroll-behavior-x": {
syntax: "contain | none | auto",
@@ -18869,7 +19726,7 @@
appliesto: "nonReplacedBlockAndInlineBlockElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "nonstandard",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-x"
},
"overscroll-behavior-y": {
@@ -18885,7 +19742,7 @@
appliesto: "nonReplacedBlockAndInlineBlockElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "nonstandard",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-y"
},
padding: padding,
@@ -18909,7 +19766,7 @@
syntax: "<'padding-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18925,7 +19782,7 @@
syntax: "<'padding-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18951,7 +19808,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding-bottom"
@@ -18976,7 +19834,7 @@
syntax: "<'padding-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -18992,7 +19850,7 @@
syntax: "<'padding-left'>",
media: "visual",
inherited: false,
- animationType: "discrete",
+ animationType: "length",
percentages: "logicalWidthOfContainingBlock",
groups: [
"CSS Logical Properties"
@@ -19018,7 +19876,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding-left"
@@ -19037,7 +19896,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding-right"
@@ -19056,7 +19916,8 @@
computed: "percentageAsSpecifiedOrAbsoluteLength",
order: "uniqueOrder",
alsoAppliesTo: [
- "::first-letter"
+ "::first-letter",
+ "::first-line"
],
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/padding-top"
@@ -19131,7 +19992,7 @@
appliesto: "textElements",
computed: "asSpecified",
order: "uniqueOrder",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/paint-order"
},
perspective: perspective,
@@ -19227,7 +20088,7 @@
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/pointer-events"
},
- position: position,
+ position: position$1,
quotes: quotes,
resize: resize,
right: right,
@@ -19311,6 +20172,22 @@
order: "perGrammar",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/scrollbar-color"
+ },
+ "scrollbar-gutter": {
+ syntax: "auto | [ stable | always ] && both? && force?",
+ media: "visual",
+ inherited: false,
+ animationType: "discrete",
+ percentages: "no",
+ groups: [
+ "CSS Overflow"
+ ],
+ initial: "auto",
+ appliesto: "allElements",
+ computed: "asSpecified",
+ order: "perGrammar",
+ status: "standard",
+ mdn_url: "https://developer.mozilla.org/docs/Web/CSS/scrollbar-gutter"
},
"scrollbar-width": {
syntax: "auto | thin | none",
@@ -19959,7 +20836,7 @@
syntax: "none | all | [ digits ? ]",
media: "visual",
inherited: true,
- animationType: "discrete",
+ animationType: "notAnimatable",
percentages: "no",
groups: [
"CSS Writing Modes"
@@ -20065,7 +20942,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip"
},
"text-decoration-skip-ink": {
- syntax: "auto | none",
+ syntax: "auto | all | none",
media: "visual",
inherited: true,
animationType: "discrete",
@@ -20077,7 +20954,7 @@
appliesto: "allElements",
computed: "asSpecified",
order: "orderOfAppearance",
- status: "experimental",
+ status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip-ink"
},
"text-decoration-style": {
@@ -20102,11 +20979,11 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-decoration-style"
},
"text-decoration-thickness": {
- syntax: "auto | from-font | ",
+ syntax: "auto | from-font | | ",
media: "visual",
inherited: false,
animationType: "byComputedValueType",
- percentages: "no",
+ percentages: "referToElementFontSize",
groups: [
"CSS Text Decoration"
],
@@ -20337,11 +21214,11 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-transform"
},
"text-underline-offset": {
- syntax: "auto | from-font | ",
+ syntax: "auto | | ",
media: "visual",
inherited: true,
animationType: "byComputedValueType",
- percentages: "no",
+ percentages: "referToElementFontSize",
groups: [
"CSS Text Decoration"
],
@@ -20358,7 +21235,7 @@
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/text-underline-offset"
},
"text-underline-position": {
- syntax: "auto | [ under || [ left | right ] ]",
+ syntax: "auto | from-font | [ under || [ left | right ] ]",
media: "visual",
inherited: true,
animationType: "discrete",
@@ -20392,7 +21269,7 @@
},
transform: transform,
"transform-box": {
- syntax: "border-box | fill-box | view-box",
+ syntax: "content-box | border-box | fill-box | stroke-box | view-box",
media: "visual",
inherited: false,
animationType: "discrete",
@@ -20400,10 +21277,10 @@
groups: [
"CSS Transforms"
],
- initial: "border-box ",
+ initial: "view-box",
appliesto: "transformableElements",
computed: "asSpecified",
- order: "uniqueOrder",
+ order: "perGrammar",
status: "standard",
mdn_url: "https://developer.mozilla.org/docs/Web/CSS/transform-box"
},
@@ -20683,77 +21560,18 @@
zoom: zoom
};
- var properties$2 = /*#__PURE__*/Object.freeze({
- __proto__: null,
- all: all,
- animation: animation,
- appearance: appearance,
- azimuth: azimuth,
- background: background,
- border: border,
- bottom: bottom,
- clear: clear,
- clip: clip,
- color: color,
- columns: columns,
- contain: contain,
- content: content,
- cursor: cursor,
- direction: direction,
- display: display,
- filter: filter,
- flex: flex,
- float: float,
- font: font,
- gap: gap,
- grid: grid,
- height: height,
- hyphens: hyphens,
- inset: inset,
- isolation: isolation,
- left: left,
- margin: margin,
- mask: mask,
- offset: offset,
- opacity: opacity,
- order: order,
- orphans: orphans,
- outline: outline,
- overflow: overflow,
- padding: padding,
- perspective: perspective,
- position: position,
- quotes: quotes,
- resize: resize,
- right: right,
- rotate: rotate,
- scale: scale,
- top: top,
- transform: transform,
- transition: transition,
- translate: translate,
- visibility: visibility,
- widows: widows,
- width: width,
- zoom: zoom,
- 'default': properties$1
- });
-
var attachment = {
syntax: "scroll | fixed | local"
};
var box = {
syntax: "border-box | padding-box | content-box"
};
- var color$1 = {
+ var color = {
syntax: " | | | | | | currentcolor | "
};
var combinator = {
syntax: "'>' | '+' | '~' | [ '||' ]"
};
- var compat = {
- syntax: "searchfield | textarea | push-button | button-bevel | slider-horizontal | checkbox | radio | square-button | menulist | menulist-button | listbox | meter | progress-bar"
- };
var gradient = {
syntax: " | | | | "
};
@@ -20763,10 +21581,10 @@
var image = {
syntax: " | | | | | | "
};
- var nth = {
+ var nth$1 = {
syntax: " | even | odd"
};
- var position$1 = {
+ var position = {
syntax: "[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | ] [ top | center | bottom | ]? | [ [ left | right ] ] && [ [ top | bottom ] ] ]"
};
var quote = {
@@ -20775,7 +21593,7 @@
var shadow = {
syntax: "inset? && {2,4} && ?"
};
- var shape$1 = {
+ var shape = {
syntax: "rect(, , , )"
};
var size = {
@@ -20787,7 +21605,7 @@
var target = {
syntax: " | | "
};
- var syntaxes = {
+ var require$$2 = {
"absolute-size": {
syntax: "xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large"
},
@@ -20832,7 +21650,7 @@
syntax: "[ first | last ]? baseline"
},
"basic-shape": {
- syntax: " | | | "
+ syntax: " | | | | "
},
"bg-image": {
syntax: "none | "
@@ -20886,7 +21704,7 @@
"clip-source": {
syntax: ""
},
- color: color$1,
+ color: color,
"color-stop": {
syntax: " | "
},
@@ -20903,7 +21721,9 @@
"common-lig-values": {
syntax: "[ common-ligatures | no-common-ligatures ]"
},
- compat: compat,
+ "compat-auto": {
+ syntax: "searchfield | textarea | push-button | slider-horizontal | checkbox | radio | square-button | menulist | listbox | meter | progress-bar | button"
+ },
"composite-style": {
syntax: "clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor"
},
@@ -20959,7 +21779,7 @@
syntax: "cross-fade( , ? )"
},
"cubic-bezier-timing-function": {
- syntax: "ease | ease-in | ease-out | ease-in-out | cubic-bezier(, , , )"
+ syntax: "ease | ease-in | ease-out | ease-in-out | cubic-bezier(, , , )"
},
"deprecated-system-color": {
syntax: "ActiveBorder | ActiveCaption | AppWorkspace | Background | ButtonFace | ButtonHighlight | ButtonShadow | ButtonText | CaptionText | GrayText | Highlight | HighlightText | InactiveBorder | InactiveCaption | InactiveCaptionText | InfoBackground | InfoText | Menu | MenuText | Scrollbar | ThreeDDarkShadow | ThreeDFace | ThreeDHighlight | ThreeDLightShadow | ThreeDShadow | Window | WindowFrame | WindowText"
@@ -21064,7 +21884,7 @@
syntax: "[ normal | small-caps ]"
},
"font-weight-absolute": {
- syntax: "normal | bold |