Fix code quality violations and exclude Manifest from checks
Document application modes (development/debug/production) Add global file drop handler, order column normalization, SPA hash fix Serve CDN assets via /_vendor/ URLs instead of merging into bundles Add production minification with license preservation Improve JSON formatting for debugging and production optimization Add CDN asset caching with CSS URL inlining for production builds Add three-mode system (development, debug, production) Update Manifest CLAUDE.md to reflect helper class architecture Refactor Manifest.php into helper classes for better organization Pre-manifest-refactor checkpoint: Add app_mode documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1
node_modules/laravel-mix/node_modules/.bin/svgo
generated
vendored
Symbolic link
1
node_modules/laravel-mix/node_modules/.bin/svgo
generated
vendored
Symbolic link
@@ -0,0 +1 @@
|
||||
../svgo/bin/svgo
|
||||
1824
node_modules/laravel-mix/node_modules/css-declaration-sorter/dist/main.cjs
generated
vendored
Executable file
1824
node_modules/laravel-mix/node_modules/css-declaration-sorter/dist/main.cjs
generated
vendored
Executable file
File diff suppressed because it is too large
Load Diff
15
node_modules/laravel-mix/node_modules/css-declaration-sorter/license.md
generated
vendored
Executable file
15
node_modules/laravel-mix/node_modules/css-declaration-sorter/license.md
generated
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
ISC License
|
||||
|
||||
Copyright (c)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
393
node_modules/laravel-mix/node_modules/css-declaration-sorter/orders/alphabetical.mjs
generated
vendored
Executable file
393
node_modules/laravel-mix/node_modules/css-declaration-sorter/orders/alphabetical.mjs
generated
vendored
Executable file
@@ -0,0 +1,393 @@
|
||||
export const properties = [
|
||||
"all",
|
||||
"-webkit-line-clamp",
|
||||
"-webkit-text-fill-color",
|
||||
"-webkit-text-stroke",
|
||||
"-webkit-text-stroke-color",
|
||||
"-webkit-text-stroke-width",
|
||||
"accent-color",
|
||||
"align-content",
|
||||
"align-items",
|
||||
"align-self",
|
||||
"animation",
|
||||
"animation-delay",
|
||||
"animation-direction",
|
||||
"animation-duration",
|
||||
"animation-fill-mode",
|
||||
"animation-iteration-count",
|
||||
"animation-name",
|
||||
"animation-play-state",
|
||||
"animation-timing-function",
|
||||
"appearance",
|
||||
"ascent-override",
|
||||
"aspect-ratio",
|
||||
"backdrop-filter",
|
||||
"backface-visibility",
|
||||
"background",
|
||||
"background-attachment",
|
||||
"background-blend-mode",
|
||||
"background-clip",
|
||||
"background-color",
|
||||
"background-image",
|
||||
"background-origin",
|
||||
"background-position",
|
||||
"background-position-x",
|
||||
"background-position-y",
|
||||
"background-repeat",
|
||||
"background-size",
|
||||
"block-size",
|
||||
"border",
|
||||
"border-block",
|
||||
"border-block-color",
|
||||
"border-block-end",
|
||||
"border-block-end-color",
|
||||
"border-block-end-style",
|
||||
"border-block-end-width",
|
||||
"border-block-start",
|
||||
"border-block-start-color",
|
||||
"border-block-start-style",
|
||||
"border-block-start-width",
|
||||
"border-block-style",
|
||||
"border-block-width",
|
||||
"border-bottom",
|
||||
"border-bottom-color",
|
||||
"border-bottom-left-radius",
|
||||
"border-bottom-right-radius",
|
||||
"border-bottom-style",
|
||||
"border-bottom-width",
|
||||
"border-collapse",
|
||||
"border-color",
|
||||
"border-end-end-radius",
|
||||
"border-end-start-radius",
|
||||
"border-image",
|
||||
"border-image-outset",
|
||||
"border-image-repeat",
|
||||
"border-image-slice",
|
||||
"border-image-source",
|
||||
"border-image-width",
|
||||
"border-inline",
|
||||
"border-inline-color",
|
||||
"border-inline-end",
|
||||
"border-inline-end-color",
|
||||
"border-inline-end-style",
|
||||
"border-inline-end-width",
|
||||
"border-inline-start",
|
||||
"border-inline-start-color",
|
||||
"border-inline-start-style",
|
||||
"border-inline-start-width",
|
||||
"border-inline-style",
|
||||
"border-inline-width",
|
||||
"border-left",
|
||||
"border-left-color",
|
||||
"border-left-style",
|
||||
"border-left-width",
|
||||
"border-radius",
|
||||
"border-right",
|
||||
"border-right-color",
|
||||
"border-right-style",
|
||||
"border-right-width",
|
||||
"border-spacing",
|
||||
"border-start-end-radius",
|
||||
"border-start-start-radius",
|
||||
"border-style",
|
||||
"border-top",
|
||||
"border-top-color",
|
||||
"border-top-left-radius",
|
||||
"border-top-right-radius",
|
||||
"border-top-style",
|
||||
"border-top-width",
|
||||
"border-width",
|
||||
"bottom",
|
||||
"box-decoration-break",
|
||||
"box-shadow",
|
||||
"box-sizing",
|
||||
"break-after",
|
||||
"break-before",
|
||||
"break-inside",
|
||||
"caption-side",
|
||||
"caret-color",
|
||||
"clear",
|
||||
"clip-path",
|
||||
"color",
|
||||
"color-scheme",
|
||||
"column-count",
|
||||
"column-fill",
|
||||
"column-gap",
|
||||
"column-rule",
|
||||
"column-rule-color",
|
||||
"column-rule-style",
|
||||
"column-rule-width",
|
||||
"column-span",
|
||||
"column-width",
|
||||
"columns",
|
||||
"contain",
|
||||
"contain-intrinsic-height",
|
||||
"contain-intrinsic-size",
|
||||
"contain-intrinsic-width",
|
||||
"container",
|
||||
"container-name",
|
||||
"container-type",
|
||||
"content",
|
||||
"content-visibility",
|
||||
"counter-increment",
|
||||
"counter-reset",
|
||||
"counter-set",
|
||||
"cursor",
|
||||
"descent-override",
|
||||
"direction",
|
||||
"display",
|
||||
"empty-cells",
|
||||
"filter",
|
||||
"flex",
|
||||
"flex-basis",
|
||||
"flex-direction",
|
||||
"flex-flow",
|
||||
"flex-grow",
|
||||
"flex-shrink",
|
||||
"flex-wrap",
|
||||
"float",
|
||||
"font",
|
||||
"font-display",
|
||||
"font-family",
|
||||
"font-kerning",
|
||||
"font-language-override",
|
||||
"font-optical-sizing",
|
||||
"font-palette",
|
||||
"font-size",
|
||||
"font-size-adjust",
|
||||
"font-stretch",
|
||||
"font-style",
|
||||
"font-synthesis",
|
||||
"font-variant",
|
||||
"font-variant-alternates",
|
||||
"font-variant-caps",
|
||||
"font-variant-east-asian",
|
||||
"font-variant-emoji",
|
||||
"font-variant-ligatures",
|
||||
"font-variant-numeric",
|
||||
"font-variant-position",
|
||||
"font-variation-settings",
|
||||
"font-weight",
|
||||
"forced-color-adjust",
|
||||
"gap",
|
||||
"grid",
|
||||
"grid-area",
|
||||
"grid-auto-columns",
|
||||
"grid-auto-flow",
|
||||
"grid-auto-rows",
|
||||
"grid-column",
|
||||
"grid-column-end",
|
||||
"grid-column-start",
|
||||
"grid-row",
|
||||
"grid-row-end",
|
||||
"grid-row-start",
|
||||
"grid-template",
|
||||
"grid-template-areas",
|
||||
"grid-template-columns",
|
||||
"grid-template-rows",
|
||||
"hanging-punctuation",
|
||||
"height",
|
||||
"hyphenate-character",
|
||||
"hyphens",
|
||||
"image-orientation",
|
||||
"image-rendering",
|
||||
"inline-size",
|
||||
"inset",
|
||||
"inset-block",
|
||||
"inset-block-end",
|
||||
"inset-block-start",
|
||||
"inset-inline",
|
||||
"inset-inline-end",
|
||||
"inset-inline-start",
|
||||
"isolation",
|
||||
"justify-content",
|
||||
"justify-items",
|
||||
"justify-self",
|
||||
"left",
|
||||
"letter-spacing",
|
||||
"line-break",
|
||||
"line-gap-override",
|
||||
"line-height",
|
||||
"list-style",
|
||||
"list-style-image",
|
||||
"list-style-position",
|
||||
"list-style-type",
|
||||
"margin",
|
||||
"margin-block",
|
||||
"margin-block-end",
|
||||
"margin-block-start",
|
||||
"margin-bottom",
|
||||
"margin-inline",
|
||||
"margin-inline-end",
|
||||
"margin-inline-start",
|
||||
"margin-left",
|
||||
"margin-right",
|
||||
"margin-top",
|
||||
"mask",
|
||||
"mask-border",
|
||||
"mask-border-outset",
|
||||
"mask-border-repeat",
|
||||
"mask-border-slice",
|
||||
"mask-border-source",
|
||||
"mask-border-width",
|
||||
"mask-clip",
|
||||
"mask-composite",
|
||||
"mask-image",
|
||||
"mask-mode",
|
||||
"mask-origin",
|
||||
"mask-position",
|
||||
"mask-repeat",
|
||||
"mask-size",
|
||||
"mask-type",
|
||||
"max-block-size",
|
||||
"max-height",
|
||||
"max-inline-size",
|
||||
"max-width",
|
||||
"min-block-size",
|
||||
"min-height",
|
||||
"min-inline-size",
|
||||
"min-width",
|
||||
"mix-blend-mode",
|
||||
"object-fit",
|
||||
"object-position",
|
||||
"offset",
|
||||
"offset-anchor",
|
||||
"offset-distance",
|
||||
"offset-path",
|
||||
"offset-rotate",
|
||||
"opacity",
|
||||
"order",
|
||||
"orphans",
|
||||
"outline",
|
||||
"outline-color",
|
||||
"outline-offset",
|
||||
"outline-style",
|
||||
"outline-width",
|
||||
"overflow",
|
||||
"overflow-anchor",
|
||||
"overflow-block",
|
||||
"overflow-clip-margin",
|
||||
"overflow-inline",
|
||||
"overflow-wrap",
|
||||
"overflow-x",
|
||||
"overflow-y",
|
||||
"overscroll-behavior",
|
||||
"overscroll-behavior-block",
|
||||
"overscroll-behavior-inline",
|
||||
"overscroll-behavior-x",
|
||||
"overscroll-behavior-y",
|
||||
"padding",
|
||||
"padding-block",
|
||||
"padding-block-end",
|
||||
"padding-block-start",
|
||||
"padding-bottom",
|
||||
"padding-inline",
|
||||
"padding-inline-end",
|
||||
"padding-inline-start",
|
||||
"padding-left",
|
||||
"padding-right",
|
||||
"padding-top",
|
||||
"page",
|
||||
"page-break-after",
|
||||
"page-break-before",
|
||||
"page-break-inside",
|
||||
"paint-order",
|
||||
"perspective",
|
||||
"perspective-origin",
|
||||
"place-content",
|
||||
"place-items",
|
||||
"place-self",
|
||||
"pointer-events",
|
||||
"position",
|
||||
"print-color-adjust",
|
||||
"quotes",
|
||||
"resize",
|
||||
"right",
|
||||
"rotate",
|
||||
"row-gap",
|
||||
"ruby-position",
|
||||
"scale",
|
||||
"scroll-behavior",
|
||||
"scroll-margin",
|
||||
"scroll-margin-block",
|
||||
"scroll-margin-block-end",
|
||||
"scroll-margin-block-start",
|
||||
"scroll-margin-bottom",
|
||||
"scroll-margin-inline",
|
||||
"scroll-margin-inline-end",
|
||||
"scroll-margin-inline-start",
|
||||
"scroll-margin-left",
|
||||
"scroll-margin-right",
|
||||
"scroll-margin-top",
|
||||
"scroll-padding",
|
||||
"scroll-padding-block",
|
||||
"scroll-padding-block-end",
|
||||
"scroll-padding-block-start",
|
||||
"scroll-padding-bottom",
|
||||
"scroll-padding-inline",
|
||||
"scroll-padding-inline-end",
|
||||
"scroll-padding-inline-start",
|
||||
"scroll-padding-left",
|
||||
"scroll-padding-right",
|
||||
"scroll-padding-top",
|
||||
"scroll-snap-align",
|
||||
"scroll-snap-stop",
|
||||
"scroll-snap-type",
|
||||
"scrollbar-color",
|
||||
"scrollbar-gutter",
|
||||
"scrollbar-width",
|
||||
"shape-image-threshold",
|
||||
"shape-margin",
|
||||
"shape-outside",
|
||||
"size-adjust",
|
||||
"src",
|
||||
"tab-size",
|
||||
"table-layout",
|
||||
"text-align",
|
||||
"text-align-last",
|
||||
"text-combine-upright",
|
||||
"text-decoration",
|
||||
"text-decoration-color",
|
||||
"text-decoration-line",
|
||||
"text-decoration-skip-ink",
|
||||
"text-decoration-style",
|
||||
"text-decoration-thickness",
|
||||
"text-emphasis",
|
||||
"text-emphasis-color",
|
||||
"text-emphasis-position",
|
||||
"text-emphasis-style",
|
||||
"text-indent",
|
||||
"text-justify",
|
||||
"text-orientation",
|
||||
"text-overflow",
|
||||
"text-rendering",
|
||||
"text-shadow",
|
||||
"text-transform",
|
||||
"text-underline-offset",
|
||||
"text-underline-position",
|
||||
"top",
|
||||
"touch-action",
|
||||
"transform",
|
||||
"transform-box",
|
||||
"transform-origin",
|
||||
"transform-style",
|
||||
"transition",
|
||||
"transition-delay",
|
||||
"transition-duration",
|
||||
"transition-property",
|
||||
"transition-timing-function",
|
||||
"translate",
|
||||
"unicode-bidi",
|
||||
"unicode-range",
|
||||
"user-select",
|
||||
"vertical-align",
|
||||
"visibility",
|
||||
"white-space",
|
||||
"widows",
|
||||
"width",
|
||||
"will-change",
|
||||
"word-break",
|
||||
"word-spacing",
|
||||
"writing-mode",
|
||||
"z-index"
|
||||
]
|
||||
397
node_modules/laravel-mix/node_modules/css-declaration-sorter/orders/concentric-css.mjs
generated
vendored
Executable file
397
node_modules/laravel-mix/node_modules/css-declaration-sorter/orders/concentric-css.mjs
generated
vendored
Executable file
@@ -0,0 +1,397 @@
|
||||
export const properties = [
|
||||
"all",
|
||||
"display",
|
||||
"position",
|
||||
"top",
|
||||
"right",
|
||||
"bottom",
|
||||
"left",
|
||||
"offset",
|
||||
"offset-anchor",
|
||||
"offset-distance",
|
||||
"offset-path",
|
||||
"offset-rotate",
|
||||
"grid",
|
||||
"grid-template-rows",
|
||||
"grid-template-columns",
|
||||
"grid-template-areas",
|
||||
"grid-auto-rows",
|
||||
"grid-auto-columns",
|
||||
"grid-auto-flow",
|
||||
"column-gap",
|
||||
"row-gap",
|
||||
"grid-area",
|
||||
"grid-row",
|
||||
"grid-row-start",
|
||||
"grid-row-end",
|
||||
"grid-column",
|
||||
"grid-column-start",
|
||||
"grid-column-end",
|
||||
"grid-template",
|
||||
"flex",
|
||||
"flex-grow",
|
||||
"flex-shrink",
|
||||
"flex-basis",
|
||||
"flex-direction",
|
||||
"flex-flow",
|
||||
"flex-wrap",
|
||||
"box-decoration-break",
|
||||
"place-content",
|
||||
"align-content",
|
||||
"justify-content",
|
||||
"place-items",
|
||||
"align-items",
|
||||
"justify-items",
|
||||
"place-self",
|
||||
"align-self",
|
||||
"justify-self",
|
||||
"vertical-align",
|
||||
"order",
|
||||
"float",
|
||||
"clear",
|
||||
"shape-margin",
|
||||
"shape-outside",
|
||||
"shape-image-threshold",
|
||||
"orphans",
|
||||
"gap",
|
||||
"columns",
|
||||
"column-fill",
|
||||
"column-rule",
|
||||
"column-rule-width",
|
||||
"column-rule-style",
|
||||
"column-rule-color",
|
||||
"column-width",
|
||||
"column-span",
|
||||
"column-count",
|
||||
"break-before",
|
||||
"break-after",
|
||||
"break-inside",
|
||||
"page",
|
||||
"page-break-before",
|
||||
"page-break-after",
|
||||
"page-break-inside",
|
||||
"transform",
|
||||
"transform-box",
|
||||
"transform-origin",
|
||||
"transform-style",
|
||||
"translate",
|
||||
"rotate",
|
||||
"scale",
|
||||
|
||||
"perspective",
|
||||
"perspective-origin",
|
||||
"appearance",
|
||||
"visibility",
|
||||
"content-visibility",
|
||||
"opacity",
|
||||
"z-index",
|
||||
"paint-order",
|
||||
"mix-blend-mode",
|
||||
"backface-visibility",
|
||||
"backdrop-filter",
|
||||
"clip-path",
|
||||
"mask",
|
||||
"mask-border",
|
||||
"mask-border-outset",
|
||||
"mask-border-repeat",
|
||||
"mask-border-slice",
|
||||
"mask-border-source",
|
||||
"mask-border-width",
|
||||
"mask-image",
|
||||
"mask-mode",
|
||||
"mask-position",
|
||||
"mask-size",
|
||||
"mask-repeat",
|
||||
"mask-origin",
|
||||
"mask-clip",
|
||||
"mask-composite",
|
||||
"mask-type",
|
||||
"filter",
|
||||
"animation",
|
||||
"animation-duration",
|
||||
"animation-timing-function",
|
||||
"animation-delay",
|
||||
"animation-iteration-count",
|
||||
"animation-direction",
|
||||
"animation-fill-mode",
|
||||
"animation-play-state",
|
||||
"animation-name",
|
||||
"transition",
|
||||
"transition-delay",
|
||||
"transition-duration",
|
||||
"transition-property",
|
||||
"transition-timing-function",
|
||||
"will-change",
|
||||
"counter-increment",
|
||||
"counter-reset",
|
||||
"counter-set",
|
||||
"cursor",
|
||||
|
||||
"box-sizing",
|
||||
"contain",
|
||||
"contain-intrinsic-height",
|
||||
"contain-intrinsic-size",
|
||||
"contain-intrinsic-width",
|
||||
"container",
|
||||
"container-name",
|
||||
"container-type",
|
||||
"margin",
|
||||
"margin-top",
|
||||
"margin-right",
|
||||
"margin-bottom",
|
||||
"margin-left",
|
||||
"margin-inline",
|
||||
"margin-inline-start",
|
||||
"margin-inline-end",
|
||||
"margin-block",
|
||||
"margin-block-start",
|
||||
"margin-block-end",
|
||||
"inset",
|
||||
"inset-block",
|
||||
"inset-block-end",
|
||||
"inset-block-start",
|
||||
"inset-inline",
|
||||
"inset-inline-end",
|
||||
"inset-inline-start",
|
||||
"outline",
|
||||
"outline-color",
|
||||
"outline-style",
|
||||
"outline-width",
|
||||
"outline-offset",
|
||||
"box-shadow",
|
||||
"border",
|
||||
"border-top",
|
||||
"border-right",
|
||||
"border-bottom",
|
||||
"border-left",
|
||||
"border-width",
|
||||
"border-top-width",
|
||||
"border-right-width",
|
||||
"border-bottom-width",
|
||||
"border-left-width",
|
||||
"border-style",
|
||||
"border-top-style",
|
||||
"border-right-style",
|
||||
"border-bottom-style",
|
||||
"border-left-style",
|
||||
"border-color",
|
||||
"border-top-color",
|
||||
"border-right-color",
|
||||
"border-bottom-color",
|
||||
"border-left-color",
|
||||
"border-radius",
|
||||
"border-top-right-radius",
|
||||
"border-top-left-radius",
|
||||
"border-bottom-right-radius",
|
||||
"border-bottom-left-radius",
|
||||
"border-inline",
|
||||
"border-inline-width",
|
||||
"border-inline-style",
|
||||
"border-inline-color",
|
||||
"border-inline-start",
|
||||
"border-inline-start-width",
|
||||
"border-inline-start-style",
|
||||
"border-inline-start-color",
|
||||
"border-inline-end",
|
||||
"border-inline-end-width",
|
||||
"border-inline-end-style",
|
||||
"border-inline-end-color",
|
||||
"border-block",
|
||||
"border-block-width",
|
||||
"border-block-style",
|
||||
"border-block-color",
|
||||
"border-block-start",
|
||||
"border-block-start-width",
|
||||
"border-block-start-style",
|
||||
"border-block-start-color",
|
||||
"border-block-end",
|
||||
"border-block-end-width",
|
||||
"border-block-end-style",
|
||||
"border-block-end-color",
|
||||
"border-image",
|
||||
"border-image-source",
|
||||
"border-image-slice",
|
||||
"border-image-width",
|
||||
"border-image-outset",
|
||||
"border-image-repeat",
|
||||
"border-collapse",
|
||||
"border-spacing",
|
||||
"border-start-start-radius",
|
||||
"border-start-end-radius",
|
||||
"border-end-start-radius",
|
||||
"border-end-end-radius",
|
||||
"background",
|
||||
"background-image",
|
||||
"background-position",
|
||||
"background-size",
|
||||
"background-repeat",
|
||||
"background-origin",
|
||||
"background-clip",
|
||||
"background-attachment",
|
||||
"background-color",
|
||||
"background-blend-mode",
|
||||
"background-position-x",
|
||||
"background-position-y",
|
||||
"isolation",
|
||||
"padding",
|
||||
"padding-top",
|
||||
"padding-right",
|
||||
"padding-bottom",
|
||||
"padding-left",
|
||||
"padding-inline",
|
||||
"padding-inline-start",
|
||||
"padding-inline-end",
|
||||
"padding-block",
|
||||
"padding-block-start",
|
||||
"padding-block-end",
|
||||
"image-orientation",
|
||||
"image-rendering",
|
||||
|
||||
"aspect-ratio",
|
||||
"width",
|
||||
"min-width",
|
||||
"max-width",
|
||||
"height",
|
||||
"min-height",
|
||||
"max-height",
|
||||
"-webkit-line-clamp",
|
||||
"-webkit-text-fill-color",
|
||||
"-webkit-text-stroke",
|
||||
"-webkit-text-stroke-color",
|
||||
"-webkit-text-stroke-width",
|
||||
"inline-size",
|
||||
"min-inline-size",
|
||||
"max-inline-size",
|
||||
"block-size",
|
||||
"min-block-size",
|
||||
"max-block-size",
|
||||
"table-layout",
|
||||
"caption-side",
|
||||
"empty-cells",
|
||||
"overflow",
|
||||
"overflow-anchor",
|
||||
"overflow-block",
|
||||
"overflow-clip-margin",
|
||||
"overflow-inline",
|
||||
"overflow-x",
|
||||
"overflow-y",
|
||||
"overscroll-behavior",
|
||||
"overscroll-behavior-block",
|
||||
"overscroll-behavior-inline",
|
||||
"overscroll-behavior-x",
|
||||
"overscroll-behavior-y",
|
||||
"resize",
|
||||
"object-fit",
|
||||
"object-position",
|
||||
"scroll-behavior",
|
||||
"scroll-margin",
|
||||
"scroll-margin-block",
|
||||
"scroll-margin-block-end",
|
||||
"scroll-margin-block-start",
|
||||
"scroll-margin-bottom",
|
||||
"scroll-margin-inline",
|
||||
"scroll-margin-inline-end",
|
||||
"scroll-margin-inline-start",
|
||||
"scroll-margin-left",
|
||||
"scroll-margin-right",
|
||||
"scroll-margin-top",
|
||||
"scroll-padding",
|
||||
"scroll-padding-block",
|
||||
"scroll-padding-block-end",
|
||||
"scroll-padding-block-start",
|
||||
"scroll-padding-bottom",
|
||||
"scroll-padding-inline",
|
||||
"scroll-padding-inline-end",
|
||||
"scroll-padding-inline-start",
|
||||
"scroll-padding-left",
|
||||
"scroll-padding-right",
|
||||
"scroll-padding-top",
|
||||
"scroll-snap-align",
|
||||
"scroll-snap-stop",
|
||||
"scroll-snap-type",
|
||||
"scrollbar-color",
|
||||
"scrollbar-gutter",
|
||||
"scrollbar-width",
|
||||
"touch-action",
|
||||
"pointer-events",
|
||||
|
||||
"content",
|
||||
"quotes",
|
||||
"hanging-punctuation",
|
||||
"color",
|
||||
"accent-color",
|
||||
"print-color-adjust",
|
||||
"forced-color-adjust",
|
||||
"color-scheme",
|
||||
"caret-color",
|
||||
"font",
|
||||
"font-style",
|
||||
"font-variant",
|
||||
"font-weight",
|
||||
"font-stretch",
|
||||
"font-size",
|
||||
"size-adjust",
|
||||
"line-height",
|
||||
"src",
|
||||
"font-family",
|
||||
"font-display",
|
||||
"font-kerning",
|
||||
"font-language-override",
|
||||
"font-optical-sizing",
|
||||
"font-palette",
|
||||
"font-size-adjust",
|
||||
"font-synthesis",
|
||||
"font-variant-alternates",
|
||||
"font-variant-caps",
|
||||
"font-variant-east-asian",
|
||||
"font-variant-emoji",
|
||||
"font-variant-ligatures",
|
||||
"font-variant-numeric",
|
||||
"font-variant-position",
|
||||
"font-variation-settings",
|
||||
"ascent-override",
|
||||
"descent-override",
|
||||
"line-gap-override",
|
||||
"hyphens",
|
||||
"hyphenate-character",
|
||||
"letter-spacing",
|
||||
"line-break",
|
||||
"list-style",
|
||||
"list-style-type",
|
||||
"list-style-image",
|
||||
"list-style-position",
|
||||
"writing-mode",
|
||||
"direction",
|
||||
"unicode-bidi",
|
||||
"unicode-range",
|
||||
"user-select",
|
||||
"ruby-position",
|
||||
"text-combine-upright",
|
||||
"text-align",
|
||||
"text-align-last",
|
||||
"text-decoration",
|
||||
"text-decoration-line",
|
||||
"text-decoration-style",
|
||||
"text-decoration-color",
|
||||
"text-decoration-thickness",
|
||||
"text-decoration-skip-ink",
|
||||
"text-emphasis",
|
||||
"text-emphasis-style",
|
||||
"text-emphasis-color",
|
||||
"text-emphasis-position",
|
||||
"text-indent",
|
||||
"text-justify",
|
||||
"text-underline-position",
|
||||
"text-underline-offset",
|
||||
"text-orientation",
|
||||
"text-overflow",
|
||||
"text-rendering",
|
||||
"text-shadow",
|
||||
"text-transform",
|
||||
"white-space",
|
||||
"word-break",
|
||||
"word-spacing",
|
||||
"overflow-wrap",
|
||||
"tab-size",
|
||||
"widows"
|
||||
]
|
||||
399
node_modules/laravel-mix/node_modules/css-declaration-sorter/orders/smacss.mjs
generated
vendored
Executable file
399
node_modules/laravel-mix/node_modules/css-declaration-sorter/orders/smacss.mjs
generated
vendored
Executable file
@@ -0,0 +1,399 @@
|
||||
export const properties = [
|
||||
"all",
|
||||
"box-sizing",
|
||||
"contain",
|
||||
"contain-intrinsic-height",
|
||||
"contain-intrinsic-size",
|
||||
"contain-intrinsic-width",
|
||||
"container",
|
||||
"container-name",
|
||||
"container-type",
|
||||
"display",
|
||||
"appearance",
|
||||
"visibility",
|
||||
"content-visibility",
|
||||
"z-index",
|
||||
"paint-order",
|
||||
"position",
|
||||
"top",
|
||||
"right",
|
||||
"bottom",
|
||||
"left",
|
||||
"offset",
|
||||
"offset-anchor",
|
||||
"offset-distance",
|
||||
"offset-path",
|
||||
"offset-rotate",
|
||||
|
||||
|
||||
"grid",
|
||||
"grid-template-rows",
|
||||
"grid-template-columns",
|
||||
"grid-template-areas",
|
||||
"grid-auto-rows",
|
||||
"grid-auto-columns",
|
||||
"grid-auto-flow",
|
||||
"column-gap",
|
||||
"row-gap",
|
||||
"grid-area",
|
||||
"grid-row",
|
||||
"grid-row-start",
|
||||
"grid-row-end",
|
||||
"grid-column",
|
||||
"grid-column-start",
|
||||
"grid-column-end",
|
||||
"grid-template",
|
||||
"flex",
|
||||
"flex-grow",
|
||||
"flex-shrink",
|
||||
"flex-basis",
|
||||
"flex-direction",
|
||||
"flex-flow",
|
||||
"flex-wrap",
|
||||
"box-decoration-break",
|
||||
"place-content",
|
||||
"place-items",
|
||||
"place-self",
|
||||
"align-content",
|
||||
"align-items",
|
||||
"align-self",
|
||||
"justify-content",
|
||||
"justify-items",
|
||||
"justify-self",
|
||||
"order",
|
||||
"aspect-ratio",
|
||||
"width",
|
||||
"min-width",
|
||||
"max-width",
|
||||
"height",
|
||||
"min-height",
|
||||
"max-height",
|
||||
"-webkit-line-clamp",
|
||||
"-webkit-text-fill-color",
|
||||
"-webkit-text-stroke",
|
||||
"-webkit-text-stroke-color",
|
||||
"-webkit-text-stroke-width",
|
||||
"inline-size",
|
||||
"min-inline-size",
|
||||
"max-inline-size",
|
||||
"block-size",
|
||||
"min-block-size",
|
||||
"max-block-size",
|
||||
"margin",
|
||||
"margin-top",
|
||||
"margin-right",
|
||||
"margin-bottom",
|
||||
"margin-left",
|
||||
"margin-inline",
|
||||
"margin-inline-start",
|
||||
"margin-inline-end",
|
||||
"margin-block",
|
||||
"margin-block-start",
|
||||
"margin-block-end",
|
||||
"inset",
|
||||
"inset-block",
|
||||
"inset-block-end",
|
||||
"inset-block-start",
|
||||
"inset-inline",
|
||||
"inset-inline-end",
|
||||
"inset-inline-start",
|
||||
"padding",
|
||||
"padding-top",
|
||||
"padding-right",
|
||||
"padding-bottom",
|
||||
"padding-left",
|
||||
"padding-inline",
|
||||
"padding-inline-start",
|
||||
"padding-inline-end",
|
||||
"padding-block",
|
||||
"padding-block-start",
|
||||
"padding-block-end",
|
||||
"float",
|
||||
"clear",
|
||||
"overflow",
|
||||
"overflow-anchor",
|
||||
"overflow-block",
|
||||
"overflow-clip-margin",
|
||||
"overflow-inline",
|
||||
"overflow-x",
|
||||
"overflow-y",
|
||||
"overscroll-behavior",
|
||||
"overscroll-behavior-block",
|
||||
"overscroll-behavior-inline",
|
||||
"overscroll-behavior-x",
|
||||
"overscroll-behavior-y",
|
||||
"orphans",
|
||||
"gap",
|
||||
"columns",
|
||||
"column-fill",
|
||||
"column-rule",
|
||||
"column-rule-color",
|
||||
"column-rule-style",
|
||||
"column-rule-width",
|
||||
"column-span",
|
||||
"column-count",
|
||||
"column-width",
|
||||
"object-fit",
|
||||
"object-position",
|
||||
"transform",
|
||||
"transform-box",
|
||||
"transform-origin",
|
||||
"transform-style",
|
||||
"translate",
|
||||
"rotate",
|
||||
"scale",
|
||||
|
||||
"border",
|
||||
"border-top",
|
||||
"border-right",
|
||||
"border-bottom",
|
||||
"border-left",
|
||||
"border-width",
|
||||
"border-top-width",
|
||||
"border-right-width",
|
||||
"border-bottom-width",
|
||||
"border-left-width",
|
||||
"border-style",
|
||||
"border-top-style",
|
||||
"border-right-style",
|
||||
"border-bottom-style",
|
||||
"border-left-style",
|
||||
"border-radius",
|
||||
"border-top-right-radius",
|
||||
"border-top-left-radius",
|
||||
"border-bottom-right-radius",
|
||||
"border-bottom-left-radius",
|
||||
"border-inline",
|
||||
"border-inline-color",
|
||||
"border-inline-style",
|
||||
"border-inline-width",
|
||||
"border-inline-start",
|
||||
"border-inline-start-color",
|
||||
"border-inline-start-style",
|
||||
"border-inline-start-width",
|
||||
"border-inline-end",
|
||||
"border-inline-end-color",
|
||||
"border-inline-end-style",
|
||||
"border-inline-end-width",
|
||||
"border-block",
|
||||
"border-block-color",
|
||||
"border-block-style",
|
||||
"border-block-width",
|
||||
"border-block-start",
|
||||
"border-block-start-color",
|
||||
"border-block-start-style",
|
||||
"border-block-start-width",
|
||||
"border-block-end",
|
||||
"border-block-end-color",
|
||||
"border-block-end-style",
|
||||
"border-block-end-width",
|
||||
"border-color",
|
||||
"border-image",
|
||||
"border-image-outset",
|
||||
"border-image-repeat",
|
||||
"border-image-slice",
|
||||
"border-image-source",
|
||||
"border-image-width",
|
||||
"border-top-color",
|
||||
"border-right-color",
|
||||
"border-bottom-color",
|
||||
"border-left-color",
|
||||
"border-collapse",
|
||||
"border-spacing",
|
||||
"border-start-start-radius",
|
||||
"border-start-end-radius",
|
||||
"border-end-start-radius",
|
||||
"border-end-end-radius",
|
||||
"outline",
|
||||
"outline-color",
|
||||
"outline-style",
|
||||
"outline-width",
|
||||
"outline-offset",
|
||||
|
||||
"backdrop-filter",
|
||||
"backface-visibility",
|
||||
"background",
|
||||
"background-image",
|
||||
"background-position",
|
||||
"background-size",
|
||||
"background-repeat",
|
||||
"background-origin",
|
||||
"background-clip",
|
||||
"background-attachment",
|
||||
"background-color",
|
||||
"background-blend-mode",
|
||||
"background-position-x",
|
||||
"background-position-y",
|
||||
"box-shadow",
|
||||
"isolation",
|
||||
|
||||
"content",
|
||||
"quotes",
|
||||
"hanging-punctuation",
|
||||
"color",
|
||||
"accent-color",
|
||||
"print-color-adjust",
|
||||
"forced-color-adjust",
|
||||
"color-scheme",
|
||||
"caret-color",
|
||||
"font",
|
||||
"font-style",
|
||||
"font-variant",
|
||||
"font-weight",
|
||||
"src",
|
||||
"font-stretch",
|
||||
"font-size",
|
||||
"size-adjust",
|
||||
"line-height",
|
||||
"font-family",
|
||||
"font-display",
|
||||
"font-kerning",
|
||||
"font-language-override",
|
||||
"font-optical-sizing",
|
||||
"font-palette",
|
||||
"font-size-adjust",
|
||||
"font-synthesis",
|
||||
"font-variant-alternates",
|
||||
"font-variant-caps",
|
||||
"font-variant-east-asian",
|
||||
"font-variant-emoji",
|
||||
"font-variant-ligatures",
|
||||
"font-variant-numeric",
|
||||
"font-variant-position",
|
||||
"font-variation-settings",
|
||||
"ascent-override",
|
||||
"descent-override",
|
||||
"line-gap-override",
|
||||
"hyphens",
|
||||
"hyphenate-character",
|
||||
"letter-spacing",
|
||||
"line-break",
|
||||
"list-style",
|
||||
"list-style-image",
|
||||
"list-style-position",
|
||||
"list-style-type",
|
||||
"direction",
|
||||
"text-align",
|
||||
"text-align-last",
|
||||
"text-decoration",
|
||||
"text-decoration-line",
|
||||
"text-decoration-style",
|
||||
"text-decoration-color",
|
||||
"text-decoration-thickness",
|
||||
"text-decoration-skip-ink",
|
||||
"text-emphasis",
|
||||
"text-emphasis-style",
|
||||
"text-emphasis-color",
|
||||
"text-emphasis-position",
|
||||
"text-indent",
|
||||
"text-justify",
|
||||
"text-underline-position",
|
||||
"text-underline-offset",
|
||||
"text-orientation",
|
||||
"text-overflow",
|
||||
"text-rendering",
|
||||
"text-shadow",
|
||||
"text-transform",
|
||||
"vertical-align",
|
||||
"white-space",
|
||||
"word-break",
|
||||
"word-spacing",
|
||||
"overflow-wrap",
|
||||
|
||||
"animation",
|
||||
"animation-duration",
|
||||
"animation-timing-function",
|
||||
"animation-delay",
|
||||
"animation-iteration-count",
|
||||
"animation-direction",
|
||||
"animation-fill-mode",
|
||||
"animation-play-state",
|
||||
"animation-name",
|
||||
"mix-blend-mode",
|
||||
"break-before",
|
||||
"break-after",
|
||||
"break-inside",
|
||||
"page",
|
||||
"page-break-before",
|
||||
"page-break-after",
|
||||
"page-break-inside",
|
||||
"caption-side",
|
||||
"clip-path",
|
||||
"counter-increment",
|
||||
"counter-reset",
|
||||
"counter-set",
|
||||
"cursor",
|
||||
"empty-cells",
|
||||
"filter",
|
||||
"image-orientation",
|
||||
"image-rendering",
|
||||
"mask",
|
||||
"mask-border",
|
||||
"mask-border-outset",
|
||||
"mask-border-repeat",
|
||||
"mask-border-slice",
|
||||
"mask-border-source",
|
||||
"mask-border-width",
|
||||
"mask-clip",
|
||||
"mask-composite",
|
||||
"mask-image",
|
||||
"mask-mode",
|
||||
"mask-origin",
|
||||
"mask-position",
|
||||
"mask-repeat",
|
||||
"mask-size",
|
||||
"mask-type",
|
||||
"opacity",
|
||||
"perspective",
|
||||
"perspective-origin",
|
||||
"pointer-events",
|
||||
"resize",
|
||||
"scroll-behavior",
|
||||
"scroll-margin",
|
||||
"scroll-margin-block",
|
||||
"scroll-margin-block-end",
|
||||
"scroll-margin-block-start",
|
||||
"scroll-margin-bottom",
|
||||
"scroll-margin-inline",
|
||||
"scroll-margin-inline-end",
|
||||
"scroll-margin-inline-start",
|
||||
"scroll-margin-left",
|
||||
"scroll-margin-right",
|
||||
"scroll-margin-top",
|
||||
"scroll-padding",
|
||||
"scroll-padding-block",
|
||||
"scroll-padding-block-end",
|
||||
"scroll-padding-block-start",
|
||||
"scroll-padding-bottom",
|
||||
"scroll-padding-inline",
|
||||
"scroll-padding-inline-end",
|
||||
"scroll-padding-inline-start",
|
||||
"scroll-padding-left",
|
||||
"scroll-padding-right",
|
||||
"scroll-padding-top",
|
||||
"scroll-snap-align",
|
||||
"scroll-snap-stop",
|
||||
"scroll-snap-type",
|
||||
"scrollbar-color",
|
||||
"scrollbar-gutter",
|
||||
"scrollbar-width",
|
||||
"shape-image-threshold",
|
||||
"shape-margin",
|
||||
"shape-outside",
|
||||
"tab-size",
|
||||
"table-layout",
|
||||
"ruby-position",
|
||||
"text-combine-upright",
|
||||
"touch-action",
|
||||
"transition",
|
||||
"transition-delay",
|
||||
"transition-duration",
|
||||
"transition-property",
|
||||
"transition-timing-function",
|
||||
"will-change",
|
||||
"unicode-bidi",
|
||||
"unicode-range",
|
||||
"user-select",
|
||||
"widows",
|
||||
"writing-mode"
|
||||
]
|
||||
59
node_modules/laravel-mix/node_modules/css-declaration-sorter/package.json
generated
vendored
Executable file
59
node_modules/laravel-mix/node_modules/css-declaration-sorter/package.json
generated
vendored
Executable file
@@ -0,0 +1,59 @@
|
||||
{
|
||||
"name": "css-declaration-sorter",
|
||||
"version": "6.4.1",
|
||||
"description": "Sorts CSS declarations fast and automatically in a certain order.",
|
||||
"type": "module",
|
||||
"main": "./dist/main.cjs",
|
||||
"exports": {
|
||||
"import": "./src/main.mjs",
|
||||
"require": "./dist/main.cjs"
|
||||
},
|
||||
"types": "./src/main.d.ts",
|
||||
"files": [
|
||||
"src/main.mjs",
|
||||
"src/main.d.ts",
|
||||
"src/shorthand-data.mjs",
|
||||
"src/bubble-sort.mjs",
|
||||
"orders",
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"preversion": "npm test",
|
||||
"test": "uvu src .+\\.test\\.mjs",
|
||||
"test:ci": "npm test && npm run lint -- --max-warnings 0",
|
||||
"lint": "eslint src/*.mjs",
|
||||
"scrape": "node --experimental-import-meta-resolve src/property-scraper.mjs",
|
||||
"prepack": "npm run build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@mdn/browser-compat-data": "^5.2.23",
|
||||
"@rollup/plugin-dynamic-import-vars": "^2.0.2",
|
||||
"@rollup/plugin-replace": "^5.0.2",
|
||||
"eslint": "^8.35.0",
|
||||
"postcss": "^8.4.18",
|
||||
"rollup": "^3.15.0",
|
||||
"uvu": "^0.5.6"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"postcss": "^8.0.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Siilwyn/css-declaration-sorter.git"
|
||||
},
|
||||
"author": "Selwyn <talk@selwyn.cc> (https://selwyn.cc/)",
|
||||
"license": "ISC",
|
||||
"keywords": [
|
||||
"postcss",
|
||||
"postcss-plugin",
|
||||
"css",
|
||||
"declaration",
|
||||
"sorter",
|
||||
"property",
|
||||
"order"
|
||||
]
|
||||
}
|
||||
126
node_modules/laravel-mix/node_modules/css-declaration-sorter/readme.md
generated
vendored
Executable file
126
node_modules/laravel-mix/node_modules/css-declaration-sorter/readme.md
generated
vendored
Executable file
@@ -0,0 +1,126 @@
|
||||
<img alt='CSS declaration sorter logo' src='https://raw.githubusercontent.com/Siilwyn/css-declaration-sorter/master/logo.svg?sanitize=true' height='260' align='right'>
|
||||
|
||||
# CSS Declaration Sorter
|
||||
[![npm][npm-badge]][npm]
|
||||
|
||||
A Node.js module and [PostCSS] plugin to sort CSS, SCSS or Less declarations based on their property names. Ensuring styling is organized, more consistent and in order... The goal of this package is to sort the source code of a project in the build process or to decrease the distributed CSS gzipped size.
|
||||
|
||||
Check out [the Prettier plugin](https://github.com/Siilwyn/prettier-plugin-css-order) for usage with a variety of file formats.
|
||||
|
||||
## Niceness
|
||||
- Up-to-date CSS properties fetched from the [MDN Compatibility Data](https://github.com/mdn/browser-compat-data/) project.
|
||||
- Choose your wanted order or provide your own.
|
||||
- Nested rules sorting support.
|
||||
- SCSS and Less support when combined with either [postcss-scss](https://github.com/postcss/postcss-scss) or [postcss-less](https://github.com/webschik/postcss-less).
|
||||
- Thought-out sorting orders out of the box, **approved by their authors**.
|
||||
|
||||
## Alphabetical example
|
||||
Input:
|
||||
```css
|
||||
body {
|
||||
display: block;
|
||||
animation: none;
|
||||
color: #C55;
|
||||
border: 0;
|
||||
}
|
||||
```
|
||||
|
||||
Output:
|
||||
```css
|
||||
body {
|
||||
animation: none;
|
||||
border: 0;
|
||||
color: #C55;
|
||||
display: block;
|
||||
}
|
||||
```
|
||||
|
||||
## Built-in sorting orders
|
||||
- Alphabetical
|
||||
`alphabetical`
|
||||
*Default, order in a simple alphabetical manner from a - z.*
|
||||
|
||||
- [SMACSS](http://smacss.com/book/formatting#grouping)
|
||||
`smacss`
|
||||
*Order from most important, flow affecting properties, to least important properties.*
|
||||
1. Box
|
||||
2. Border
|
||||
3. Background
|
||||
4. Text
|
||||
5. Other
|
||||
|
||||
- [Concentric CSS](https://github.com/brandon-rhodes/Concentric-CSS)
|
||||
`concentric-css`
|
||||
*Order properties applying outside the box model, moving inward to intrinsic changes.*
|
||||
1. Positioning
|
||||
2. Visibility
|
||||
3. Box model
|
||||
4. Dimensions
|
||||
5. Text
|
||||
|
||||
## Usage
|
||||
Following the PostCSS plugin guidelines, this package depends on PostCSS as a peer dependency:
|
||||
`npm install postcss css-declaration-sorter --save-dev`
|
||||
|
||||
### CLI
|
||||
This module does not include its own CLI but works with the official [PostCSS CLI](https://github.com/postcss/postcss-cli). To use the examples below, the `postcss-cli` package is a required dependency.
|
||||
|
||||
Piping out result from file:
|
||||
`postcss input.css --use css-declaration-sorter | cat`
|
||||
|
||||
Sorting multiple files by overwriting:
|
||||
`postcss *.css --use css-declaration-sorter --replace --no-map`
|
||||
|
||||
Sorting all files in a directory with SCSS syntax using [postcss-scss](https://github.com/postcss/postcss-scss) by overwriting:
|
||||
`postcss ./src/**/*.scss --syntax postcss-scss --use css-declaration-sorter --replace --no-map`
|
||||
|
||||
Sorting all files in the directory with SCSS syntax and SMACSS order by overwriting, using `package.json` configuration:
|
||||
```json
|
||||
"postcss": {
|
||||
"syntax": "postcss-scss",
|
||||
"map": false,
|
||||
"plugins": {
|
||||
"css-declaration-sorter": { "order": "smacss" }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`postcss ./src/**/*.scss --replace --config package.json`
|
||||
|
||||
### Vanilla JS
|
||||
```js
|
||||
import postcss from 'postcss';
|
||||
import { cssDeclarationSorter } from 'css-declaration-sorter';
|
||||
|
||||
postcss([cssDeclarationSorter({ order: 'smacss' })])
|
||||
.process('a { color: hyperblue; display: block; }', { from: undefined })
|
||||
.then(result => console.log(
|
||||
result.css === 'a { display: block; color: hyperblue; }'
|
||||
));
|
||||
```
|
||||
___
|
||||
|
||||
**[View more usage examples](/examples) in combination with other tools.**
|
||||
|
||||
___
|
||||
|
||||
## API
|
||||
### cssDeclarationSorter({ order, keepOverrides })
|
||||
|
||||
#### order
|
||||
Type: `string` or `function`
|
||||
Default: `alphabetical`
|
||||
Options: `alphabetical`, `smacss`, `concentric-css`
|
||||
|
||||
Provide the name of one of the built-in sort orders or a comparison function that is passed to ([`Array.sort`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort)). This function receives two declaration names and is expected to return `-1`, `0` or `1` depending on the wanted order.
|
||||
|
||||
#### keepOverrides
|
||||
Type: `Boolean`
|
||||
Default: `false`
|
||||
|
||||
To prevent breaking legacy CSS where shorthand declarations override longhand declarations (also taking into account vendor prefixes) this option can enabled. For example `animation-name: some; animation: greeting;` will be kept in this order when `keepOverrides` is `true`.
|
||||
|
||||
[PostCSS]: https://github.com/postcss/postcss
|
||||
|
||||
[npm]: https://www.npmjs.com/package/css-declaration-sorter
|
||||
[npm-badge]: https://tinyshields.dev/npm/css-declaration-sorter.svg
|
||||
20
node_modules/laravel-mix/node_modules/css-declaration-sorter/src/bubble-sort.mjs
generated
vendored
Executable file
20
node_modules/laravel-mix/node_modules/css-declaration-sorter/src/bubble-sort.mjs
generated
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
export function bubbleSort (list, comparator) {
|
||||
let upperIndex = list.length - 1;
|
||||
|
||||
while (upperIndex > 0) {
|
||||
let swapIndex = 0;
|
||||
|
||||
for (let i = 0; i < upperIndex; i += 1) {
|
||||
if (comparator(list[i], list[i + 1]) > 0) {
|
||||
const temp = list[i + 1];
|
||||
list[i + 1] = list[i];
|
||||
list[i] = temp;
|
||||
swapIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
upperIndex = swapIndex;
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
27
node_modules/laravel-mix/node_modules/css-declaration-sorter/src/main.d.ts
generated
vendored
Executable file
27
node_modules/laravel-mix/node_modules/css-declaration-sorter/src/main.d.ts
generated
vendored
Executable file
@@ -0,0 +1,27 @@
|
||||
import type { PluginCreator } from 'postcss';
|
||||
|
||||
declare const cssDeclarationSorter: PluginCreator<{
|
||||
/**
|
||||
Provide the name of one of the built-in sort orders or a comparison function that is passed to `Array.sort`.
|
||||
|
||||
@default 'alphabetical'
|
||||
*/
|
||||
order?: SortOrder | SortFunction | undefined;
|
||||
|
||||
/**
|
||||
To prevent breaking legacy CSS where shorthand declarations override longhand declarations. For example `animation-name: some; animation: greeting;` will be kept in this order.
|
||||
|
||||
@default false
|
||||
*/
|
||||
keepOverrides?: boolean;
|
||||
}>;
|
||||
|
||||
export = cssDeclarationSorter;
|
||||
|
||||
type SortOrder = 'alphabetical' | 'concentric-css' | 'smacss';
|
||||
|
||||
/**
|
||||
* This function receives two declaration property names and is expected
|
||||
* to return -1, 0 or 1 depending on the wanted order.
|
||||
*/
|
||||
type SortFunction = (propertyNameA: string, propertyNameB: string) => -1 | 0 | 1;
|
||||
146
node_modules/laravel-mix/node_modules/css-declaration-sorter/src/main.mjs
generated
vendored
Executable file
146
node_modules/laravel-mix/node_modules/css-declaration-sorter/src/main.mjs
generated
vendored
Executable file
@@ -0,0 +1,146 @@
|
||||
import { shorthandData } from './shorthand-data.mjs';
|
||||
import { bubbleSort } from './bubble-sort.mjs';
|
||||
|
||||
const builtInOrders = [
|
||||
'alphabetical',
|
||||
'concentric-css',
|
||||
'smacss',
|
||||
];
|
||||
|
||||
export const cssDeclarationSorter = ({ order = 'alphabetical', keepOverrides = false } = {}) => ({
|
||||
postcssPlugin: 'css-declaration-sorter',
|
||||
OnceExit (css) {
|
||||
let withKeepOverrides = comparator => comparator;
|
||||
if (keepOverrides) {
|
||||
withKeepOverrides = withOverridesComparator(shorthandData);
|
||||
}
|
||||
|
||||
if (typeof order === 'function') {
|
||||
return processCss({ css, comparator: withKeepOverrides(order) });
|
||||
}
|
||||
|
||||
if (!builtInOrders.includes(order))
|
||||
return Promise.reject(
|
||||
Error([
|
||||
`Invalid built-in order '${order}' provided.`,
|
||||
`Available built-in orders are: ${builtInOrders}`,
|
||||
].join('\n'))
|
||||
);
|
||||
|
||||
return import(`../orders/${order}.mjs`)
|
||||
.then(({ properties }) => processCss({
|
||||
css,
|
||||
comparator: withKeepOverrides(orderComparator(properties)),
|
||||
}));
|
||||
},
|
||||
});
|
||||
|
||||
cssDeclarationSorter.postcss = true;
|
||||
|
||||
// Kept for backward compatibility
|
||||
export default cssDeclarationSorter;
|
||||
|
||||
function processCss ({ css, comparator }) {
|
||||
const comments = [];
|
||||
const rulesCache = [];
|
||||
|
||||
css.walk(node => {
|
||||
const nodes = node.nodes;
|
||||
const type = node.type;
|
||||
|
||||
if (type === 'comment') {
|
||||
// Don't do anything to root comments or the last newline comment
|
||||
const isNewlineNode = node.raws.before && node.raws.before.includes('\n');
|
||||
const lastNewlineNode = isNewlineNode && !node.next();
|
||||
const onlyNode = !node.prev() && !node.next() || !node.parent;
|
||||
|
||||
if (lastNewlineNode || onlyNode || node.parent.type === 'root') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (isNewlineNode) {
|
||||
const pairedNode = node.next() || node.prev();
|
||||
if (pairedNode) {
|
||||
comments.unshift({
|
||||
'comment': node,
|
||||
'pairedNode': pairedNode,
|
||||
'insertPosition': node.next() ? 'Before' : 'After',
|
||||
});
|
||||
node.remove();
|
||||
}
|
||||
} else {
|
||||
const pairedNode = node.prev() || node.next();
|
||||
if (pairedNode) {
|
||||
comments.push({
|
||||
'comment': node,
|
||||
'pairedNode': pairedNode,
|
||||
'insertPosition': 'After',
|
||||
});
|
||||
node.remove();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Add rule-like nodes to a cache so that we can remove all
|
||||
// comment nodes before we start sorting.
|
||||
const isRule = type === 'rule' || type === 'atrule';
|
||||
if (isRule && nodes && nodes.length > 1) {
|
||||
rulesCache.push(nodes);
|
||||
}
|
||||
});
|
||||
|
||||
// Perform a sort once all comment nodes are removed
|
||||
rulesCache.forEach(nodes => {
|
||||
sortCssDeclarations({ nodes, comparator });
|
||||
});
|
||||
|
||||
// Add comments back to the nodes they are paired with
|
||||
comments.forEach(node => {
|
||||
const pairedNode = node.pairedNode;
|
||||
node.comment.remove();
|
||||
pairedNode.parent && pairedNode.parent['insert' + node.insertPosition](pairedNode, node.comment);
|
||||
});
|
||||
}
|
||||
|
||||
function sortCssDeclarations ({ nodes, comparator }) {
|
||||
bubbleSort(nodes, (a, b) => {
|
||||
if (a.type === 'decl' && b.type === 'decl') {
|
||||
return comparator(a.prop, b.prop);
|
||||
} else {
|
||||
return compareDifferentType(a, b);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function withOverridesComparator (shorthandData) {
|
||||
return function (comparator) {
|
||||
return function (a, b) {
|
||||
a = removeVendorPrefix(a);
|
||||
b = removeVendorPrefix(b);
|
||||
|
||||
if (shorthandData[a] && shorthandData[a].includes(b)) return 0;
|
||||
if (shorthandData[b] && shorthandData[b].includes(a)) return 0;
|
||||
|
||||
return comparator(a, b);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
function orderComparator (order) {
|
||||
return function (a, b) {
|
||||
return order.indexOf(a) - order.indexOf(b);
|
||||
};
|
||||
}
|
||||
|
||||
function compareDifferentType (a, b) {
|
||||
if (b.type === 'atrule' || a.type === 'atrule') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return a.type === 'decl' ? -1 : b.type === 'decl' ? 1 : 0;
|
||||
}
|
||||
|
||||
function removeVendorPrefix (property) {
|
||||
return property.replace(/^-\w+-/, '');
|
||||
}
|
||||
433
node_modules/laravel-mix/node_modules/css-declaration-sorter/src/shorthand-data.mjs
generated
vendored
Executable file
433
node_modules/laravel-mix/node_modules/css-declaration-sorter/src/shorthand-data.mjs
generated
vendored
Executable file
@@ -0,0 +1,433 @@
|
||||
export const shorthandData = {
|
||||
'animation': [
|
||||
'animation-name',
|
||||
'animation-duration',
|
||||
'animation-timing-function',
|
||||
'animation-delay',
|
||||
'animation-iteration-count',
|
||||
'animation-direction',
|
||||
'animation-fill-mode',
|
||||
'animation-play-state',
|
||||
],
|
||||
'background': [
|
||||
'background-image',
|
||||
'background-size',
|
||||
'background-position',
|
||||
'background-repeat',
|
||||
'background-origin',
|
||||
'background-clip',
|
||||
'background-attachment',
|
||||
'background-color',
|
||||
],
|
||||
'columns': [
|
||||
'column-width',
|
||||
'column-count',
|
||||
],
|
||||
'column-rule': [
|
||||
'column-rule-width',
|
||||
'column-rule-style',
|
||||
'column-rule-color',
|
||||
],
|
||||
'flex': [
|
||||
'flex-grow',
|
||||
'flex-shrink',
|
||||
'flex-basis',
|
||||
],
|
||||
'flex-flow': [
|
||||
'flex-direction',
|
||||
'flex-wrap',
|
||||
],
|
||||
'font': [
|
||||
'font-style',
|
||||
'font-variant',
|
||||
'font-weight',
|
||||
'font-stretch',
|
||||
'font-size',
|
||||
'font-family',
|
||||
'line-height',
|
||||
],
|
||||
'grid': [
|
||||
'grid-template-rows',
|
||||
'grid-template-columns',
|
||||
'grid-template-areas',
|
||||
'grid-auto-rows',
|
||||
'grid-auto-columns',
|
||||
'grid-auto-flow',
|
||||
'column-gap',
|
||||
'row-gap',
|
||||
],
|
||||
'grid-area': [
|
||||
'grid-row-start',
|
||||
'grid-column-start',
|
||||
'grid-row-end',
|
||||
'grid-column-end',
|
||||
],
|
||||
'grid-column': [
|
||||
'grid-column-start',
|
||||
'grid-column-end',
|
||||
],
|
||||
'grid-row': [
|
||||
'grid-row-start',
|
||||
'grid-row-end',
|
||||
],
|
||||
'grid-template': [
|
||||
'grid-template-columns',
|
||||
'grid-template-rows',
|
||||
'grid-template-areas',
|
||||
],
|
||||
'list-style': [
|
||||
'list-style-type',
|
||||
'list-style-position',
|
||||
'list-style-image',
|
||||
],
|
||||
'padding': [
|
||||
'padding-block',
|
||||
'padding-block-start',
|
||||
'padding-block-end',
|
||||
'padding-inline',
|
||||
'padding-inline-start',
|
||||
'padding-inline-end',
|
||||
'padding-top',
|
||||
'padding-right',
|
||||
'padding-bottom',
|
||||
'padding-left',
|
||||
],
|
||||
'padding-block': [
|
||||
'padding-block-start',
|
||||
'padding-block-end',
|
||||
'padding-top',
|
||||
'padding-right',
|
||||
'padding-bottom',
|
||||
'padding-left',
|
||||
],
|
||||
'padding-block-start': [
|
||||
'padding-top',
|
||||
'padding-right',
|
||||
'padding-left',
|
||||
],
|
||||
'padding-block-end': [
|
||||
'padding-right',
|
||||
'padding-bottom',
|
||||
'padding-left',
|
||||
],
|
||||
'padding-inline': [
|
||||
'padding-inline-start',
|
||||
'padding-inline-end',
|
||||
'padding-top',
|
||||
'padding-right',
|
||||
'padding-bottom',
|
||||
'padding-left',
|
||||
],
|
||||
'padding-inline-start': [
|
||||
'padding-top',
|
||||
'padding-right',
|
||||
'padding-left',
|
||||
],
|
||||
'padding-inline-end': [
|
||||
'padding-right',
|
||||
'padding-bottom',
|
||||
'padding-left',
|
||||
],
|
||||
'margin': [
|
||||
'margin-block',
|
||||
'margin-block-start',
|
||||
'margin-block-end',
|
||||
'margin-inline',
|
||||
'margin-inline-start',
|
||||
'margin-inline-end',
|
||||
'margin-top',
|
||||
'margin-right',
|
||||
'margin-bottom',
|
||||
'margin-left',
|
||||
],
|
||||
'margin-block': [
|
||||
'margin-block-start',
|
||||
'margin-block-end',
|
||||
'margin-top',
|
||||
'margin-right',
|
||||
'margin-bottom',
|
||||
'margin-left',
|
||||
],
|
||||
'margin-inline': [
|
||||
'margin-inline-start',
|
||||
'margin-inline-end',
|
||||
'margin-top',
|
||||
'margin-right',
|
||||
'margin-bottom',
|
||||
'margin-left',
|
||||
],
|
||||
'margin-inline-start': [
|
||||
'margin-top',
|
||||
'margin-right',
|
||||
'margin-bottom',
|
||||
'margin-left',
|
||||
],
|
||||
'margin-inline-end': [
|
||||
'margin-top',
|
||||
'margin-right',
|
||||
'margin-bottom',
|
||||
'margin-left',
|
||||
],
|
||||
'border': [
|
||||
'border-top',
|
||||
'border-right',
|
||||
'border-bottom',
|
||||
'border-left',
|
||||
'border-width',
|
||||
'border-style',
|
||||
'border-color',
|
||||
'border-top-width',
|
||||
'border-right-width',
|
||||
'border-bottom-width',
|
||||
'border-left-width',
|
||||
'border-inline-start-width',
|
||||
'border-inline-end-width',
|
||||
'border-block-start-width',
|
||||
'border-block-end-width',
|
||||
'border-top-style',
|
||||
'border-right-style',
|
||||
'border-bottom-style',
|
||||
'border-left-style',
|
||||
'border-inline-start-style',
|
||||
'border-inline-end-style',
|
||||
'border-block-start-style',
|
||||
'border-block-end-style',
|
||||
'border-top-color',
|
||||
'border-right-color',
|
||||
'border-bottom-color',
|
||||
'border-left-color',
|
||||
'border-inline-start-color',
|
||||
'border-inline-end-color',
|
||||
'border-block-start-color',
|
||||
'border-block-end-color',
|
||||
'border-block',
|
||||
'border-block-start',
|
||||
'border-block-end',
|
||||
'border-block-width',
|
||||
'border-block-style',
|
||||
'border-block-color',
|
||||
'border-inline',
|
||||
'border-inline-start',
|
||||
'border-inline-end',
|
||||
'border-inline-width',
|
||||
'border-inline-style',
|
||||
'border-inline-color',
|
||||
],
|
||||
'border-top': [
|
||||
'border-width',
|
||||
'border-style',
|
||||
'border-color',
|
||||
'border-top-width',
|
||||
'border-top-style',
|
||||
'border-top-color',
|
||||
],
|
||||
'border-right': [
|
||||
'border-width',
|
||||
'border-style',
|
||||
'border-color',
|
||||
'border-right-width',
|
||||
'border-right-style',
|
||||
'border-right-color',
|
||||
],
|
||||
'border-bottom': [
|
||||
'border-width',
|
||||
'border-style',
|
||||
'border-color',
|
||||
'border-bottom-width',
|
||||
'border-bottom-style',
|
||||
'border-bottom-color',
|
||||
],
|
||||
'border-left': [
|
||||
'border-width',
|
||||
'border-style',
|
||||
'border-color',
|
||||
'border-left-width',
|
||||
'border-left-style',
|
||||
'border-left-color',
|
||||
],
|
||||
'border-color': [
|
||||
'border-top-color',
|
||||
'border-bottom-color',
|
||||
'border-left-color',
|
||||
'border-right-color',
|
||||
'border-inline-start-color',
|
||||
'border-inline-end-color',
|
||||
'border-block-start-color',
|
||||
'border-block-end-color',
|
||||
],
|
||||
'border-width': [
|
||||
'border-top-width',
|
||||
'border-bottom-width',
|
||||
'border-left-width',
|
||||
'border-right-width',
|
||||
'border-inline-start-width',
|
||||
'border-inline-end-width',
|
||||
'border-block-start-width',
|
||||
'border-block-end-width',
|
||||
],
|
||||
'border-style': [
|
||||
'border-top-style',
|
||||
'border-bottom-style',
|
||||
'border-left-style',
|
||||
'border-right-style',
|
||||
'border-inline-start-style',
|
||||
'border-inline-end-style',
|
||||
'border-block-start-style',
|
||||
'border-block-end-style',
|
||||
],
|
||||
'border-radius': [
|
||||
'border-top-right-radius',
|
||||
'border-top-left-radius',
|
||||
'border-bottom-right-radius',
|
||||
'border-bottom-left-radius',
|
||||
],
|
||||
'border-block': [
|
||||
'border-block-start',
|
||||
'border-block-end',
|
||||
'border-block-width',
|
||||
'border-width',
|
||||
'border-block-style',
|
||||
'border-style',
|
||||
'border-block-color',
|
||||
'border-color',
|
||||
],
|
||||
'border-block-start': [
|
||||
'border-block-start-width',
|
||||
'border-width',
|
||||
'border-block-start-style',
|
||||
'border-style',
|
||||
'border-block-start-color',
|
||||
'border-color',
|
||||
],
|
||||
'border-block-end': [
|
||||
'border-block-end-width',
|
||||
'border-width',
|
||||
'border-block-end-style',
|
||||
'border-style',
|
||||
'border-block-end-color',
|
||||
'border-color',
|
||||
],
|
||||
'border-inline': [
|
||||
'border-inline-start',
|
||||
'border-inline-end',
|
||||
'border-inline-width',
|
||||
'border-width',
|
||||
'border-inline-style',
|
||||
'border-style',
|
||||
'border-inline-color',
|
||||
'border-color',
|
||||
],
|
||||
'border-inline-start': [
|
||||
'border-inline-start-width',
|
||||
'border-width',
|
||||
'border-inline-start-style',
|
||||
'border-style',
|
||||
'border-inline-start-color',
|
||||
'border-color',
|
||||
],
|
||||
'border-inline-end': [
|
||||
'border-inline-end-width',
|
||||
'border-width',
|
||||
'border-inline-end-style',
|
||||
'border-style',
|
||||
'border-inline-end-color',
|
||||
'border-color',
|
||||
],
|
||||
'border-image': [
|
||||
'border-image-source',
|
||||
'border-image-slice',
|
||||
'border-image-width',
|
||||
'border-image-outset',
|
||||
'border-image-repeat',
|
||||
],
|
||||
'mask': [
|
||||
'mask-image',
|
||||
'mask-mode',
|
||||
'mask-position',
|
||||
'mask-size',
|
||||
'mask-repeat',
|
||||
'mask-origin',
|
||||
'mask-clip',
|
||||
'mask-composite',
|
||||
],
|
||||
'inline-size': [
|
||||
'width',
|
||||
'height',
|
||||
],
|
||||
'block-size': [
|
||||
'width',
|
||||
'height',
|
||||
],
|
||||
'max-inline-size': [
|
||||
'max-width',
|
||||
'max-height',
|
||||
],
|
||||
'max-block-size': [
|
||||
'max-width',
|
||||
'max-height',
|
||||
],
|
||||
'inset': [
|
||||
'inset-block',
|
||||
'inset-block-start',
|
||||
'inset-block-end',
|
||||
'inset-inline',
|
||||
'inset-inline-start',
|
||||
'inset-inline-end',
|
||||
'top',
|
||||
'right',
|
||||
'bottom',
|
||||
'left',
|
||||
],
|
||||
'inset-block': [
|
||||
'inset-block-start',
|
||||
'inset-block-end',
|
||||
'top',
|
||||
'right',
|
||||
'bottom',
|
||||
'left',
|
||||
],
|
||||
'inset-inline': [
|
||||
'inset-inline-start',
|
||||
'inset-inline-end',
|
||||
'top',
|
||||
'right',
|
||||
'bottom',
|
||||
'left',
|
||||
],
|
||||
'outline': [
|
||||
'outline-color',
|
||||
'outline-style',
|
||||
'outline-width',
|
||||
],
|
||||
'overflow': [
|
||||
'overflow-x',
|
||||
'overflow-y',
|
||||
],
|
||||
'place-content': [
|
||||
'align-content',
|
||||
'justify-content',
|
||||
],
|
||||
'place-items': [
|
||||
'align-items',
|
||||
'justify-items',
|
||||
],
|
||||
'place-self': [
|
||||
'align-self',
|
||||
'justify-self',
|
||||
],
|
||||
'text-decoration': [
|
||||
'text-decoration-color',
|
||||
'text-decoration-style',
|
||||
'text-decoration-line',
|
||||
],
|
||||
'transition': [
|
||||
'transition-delay',
|
||||
'transition-duration',
|
||||
'transition-property',
|
||||
'transition-timing-function',
|
||||
],
|
||||
'text-emphasis': [
|
||||
'text-emphasis-style',
|
||||
'text-emphasis-color',
|
||||
],
|
||||
};
|
||||
11
node_modules/laravel-mix/node_modules/css-select/LICENSE
generated
vendored
Executable file
11
node_modules/laravel-mix/node_modules/css-select/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,11 @@
|
||||
Copyright (c) Felix Böhm
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
|
||||
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
255
node_modules/laravel-mix/node_modules/css-select/README.md
generated
vendored
Executable file
255
node_modules/laravel-mix/node_modules/css-select/README.md
generated
vendored
Executable file
@@ -0,0 +1,255 @@
|
||||
# css-select [](https://npmjs.org/package/css-select) [](http://travis-ci.com/fb55/css-select) [](https://npmjs.org/package/css-select) [](https://coveralls.io/r/fb55/css-select)
|
||||
|
||||
A CSS selector compiler and engine
|
||||
|
||||
## What?
|
||||
|
||||
As a **compiler**, css-select turns CSS selectors into functions that tests if
|
||||
elements match them.
|
||||
|
||||
As an **engine**, css-select looks through a DOM tree, searching for elements.
|
||||
Elements are tested "from the top", similar to how browsers execute CSS
|
||||
selectors.
|
||||
|
||||
In its default configuration, css-select queries the DOM structure of the
|
||||
[`domhandler`](https://github.com/fb55/domhandler) module (also known as
|
||||
htmlparser2 DOM). To query alternative DOM structures, see [`Options`](#options)
|
||||
below.
|
||||
|
||||
**Features:**
|
||||
|
||||
- 🔬 Full implementation of CSS3 selectors, as well as most CSS4 selectors
|
||||
- 🧪 Partial implementation of jQuery/Sizzle extensions (see
|
||||
[cheerio-select](https://github.com/cheeriojs/cheerio-select) for the
|
||||
remaining selectors)
|
||||
- 🧑🔬 High test coverage, including the full test suites from Sizzle, Qwery and
|
||||
NWMatcher.
|
||||
- 🥼 Reliably great performance
|
||||
|
||||
## Why?
|
||||
|
||||
Most CSS engines written in JavaScript execute selectors left-to-right. That
|
||||
means thet execute every component of the selector in order, from left to right
|
||||
_(duh)_. As an example: For the selector `a b`, these engines will first query
|
||||
for `a` elements, then search these for `b` elements. (That's the approach of
|
||||
eg. [`Sizzle`](https://github.com/jquery/sizzle),
|
||||
[`nwmatcher`](https://github.com/dperini/nwmatcher/) and
|
||||
[`qwery`](https://github.com/ded/qwery).)
|
||||
|
||||
While this works, it has some downsides: Children of `a`s will be checked
|
||||
multiple times; first, to check if they are also `a`s, then, for every superior
|
||||
`a` once, if they are `b`s. Using
|
||||
[Big O notation](http://en.wikipedia.org/wiki/Big_O_notation), that would be
|
||||
`O(n^(k+1))`, where `k` is the number of descendant selectors (that's the space
|
||||
in the example above).
|
||||
|
||||
The far more efficient approach is to first look for `b` elements, then check if
|
||||
they have superior `a` elements: Using big O notation again, that would be
|
||||
`O(n)`. That's called right-to-left execution.
|
||||
|
||||
And that's what css-select does – and why it's quite performant.
|
||||
|
||||
## How does it work?
|
||||
|
||||
By building a stack of functions.
|
||||
|
||||
_Wait, what?_
|
||||
|
||||
Okay, so let's suppose we want to compile the selector `a b`, for right-to-left
|
||||
execution. We start by _parsing_ the selector. This turns the selector into an
|
||||
array of the building blocks. That's what the
|
||||
[`css-what`](https://github.com/fb55/css-what) module is for, if you want to
|
||||
have a look.
|
||||
|
||||
Anyway, after parsing, we end up with an array like this one:
|
||||
|
||||
```js
|
||||
[
|
||||
{ type: "tag", name: "a" },
|
||||
{ type: "descendant" },
|
||||
{ type: "tag", name: "b" },
|
||||
];
|
||||
```
|
||||
|
||||
(Actually, this array is wrapped in another array, but that's another story,
|
||||
involving commas in selectors.)
|
||||
|
||||
Now that we know the meaning of every part of the selector, we can compile it.
|
||||
That is where things become interesting.
|
||||
|
||||
The basic idea is to turn every part of the selector into a function, which
|
||||
takes an element as its only argument. The function checks whether a passed
|
||||
element matches its part of the selector: If it does, the element is passed to
|
||||
the next function representing the next part of the selector. That function does
|
||||
the same. If an element is accepted by all parts of the selector, it _matches_
|
||||
the selector and double rainbow ALL THE WAY.
|
||||
|
||||
As said before, we want to do right-to-left execution with all the big O
|
||||
improvements. That means elements are passed from the rightmost part of the
|
||||
selector (`b` in our example) to the leftmost (~~which would be `c`~~ of course
|
||||
`a`).
|
||||
|
||||
For traversals, such as the _descendant_ operating the space between `a` and
|
||||
`b`, we walk up the DOM tree, starting from the element passed as argument.
|
||||
|
||||
_//TODO: More in-depth description. Implementation details. Build a spaceship._
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
const CSSselect = require("css-select");
|
||||
```
|
||||
|
||||
**Note:** css-select throws errors when invalid selectors are passed to it.This
|
||||
is done to aid with writing css selectors, but can be unexpected when processing
|
||||
arbitrary strings.
|
||||
|
||||
#### `CSSselect.selectAll(query, elems, options)`
|
||||
|
||||
Queries `elems`, returns an array containing all matches.
|
||||
|
||||
- `query` can be either a CSS selector or a function.
|
||||
- `elems` can be either an array of elements, or a single element. If it is an
|
||||
element, its children will be queried.
|
||||
- `options` is described below.
|
||||
|
||||
Aliases: `default` export, `CSSselect.iterate(query, elems)`.
|
||||
|
||||
#### `CSSselect.compile(query, options)`
|
||||
|
||||
Compiles the query, returns a function.
|
||||
|
||||
#### `CSSselect.is(elem, query, options)`
|
||||
|
||||
Tests whether or not an element is matched by `query`. `query` can be either a
|
||||
CSS selector or a function.
|
||||
|
||||
#### `CSSselect.selectOne(query, elems, options)`
|
||||
|
||||
Arguments are the same as for `CSSselect.selectAll(query, elems)`. Only returns
|
||||
the first match, or `null` if there was no match.
|
||||
|
||||
### Options
|
||||
|
||||
All options are optional.
|
||||
|
||||
- `xmlMode`: When enabled, tag names will be case-sensitive. Default: `false`.
|
||||
- `rootFunc`: The last function in the stack, will be called with the last
|
||||
element that's looked at.
|
||||
- `adapter`: The adapter to use when interacting with the backing DOM
|
||||
structure. By default it uses the `domutils` module.
|
||||
- `context`: The context of the current query. Used to limit the scope of
|
||||
searches. Can be matched directly using the `:scope` pseudo-selector.
|
||||
- `cacheResults`: Allow css-select to cache results for some selectors,
|
||||
sometimes greatly improving querying performance. Disable this if your
|
||||
document can change in between queries with the same compiled selector.
|
||||
Default: `true`.
|
||||
|
||||
#### Custom Adapters
|
||||
|
||||
A custom adapter must match the interface described
|
||||
[here](https://github.com/fb55/css-select/blob/1aa44bdd64aaf2ebdfd7f338e2e76bed36521957/src/types.ts#L6-L96).
|
||||
|
||||
You may want to have a look at [`domutils`](https://github.com/fb55/domutils) to
|
||||
see the default implementation, or at
|
||||
[`css-select-browser-adapter`](https://github.com/nrkn/css-select-browser-adapter/blob/master/index.js)
|
||||
for an implementation backed by the DOM.
|
||||
|
||||
## Supported selectors
|
||||
|
||||
_As defined by CSS 4 and / or jQuery._
|
||||
|
||||
- [Selector lists](https://developer.mozilla.org/en-US/docs/Web/CSS/Selector_list)
|
||||
(`,`)
|
||||
- [Universal](https://developer.mozilla.org/en-US/docs/Web/CSS/Universal_selectors)
|
||||
(`*`)
|
||||
- [Type](https://developer.mozilla.org/en-US/docs/Web/CSS/Type_selectors)
|
||||
(`<tagname>`)
|
||||
- [Descendant](https://developer.mozilla.org/en-US/docs/Web/CSS/Descendant_combinator)
|
||||
(` `)
|
||||
- [Child](https://developer.mozilla.org/en-US/docs/Web/CSS/Child_combinator)
|
||||
(`>`)
|
||||
- Parent (`<`)
|
||||
- [Adjacent sibling](https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator)
|
||||
(`+`)
|
||||
- [General sibling](https://developer.mozilla.org/en-US/docs/Web/CSS/General_sibling_combinator)
|
||||
(`~`)
|
||||
- [Attribute](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors)
|
||||
(`[attr=foo]`), with supported comparisons:
|
||||
- `[attr]` (existential)
|
||||
- `=`
|
||||
- `~=`
|
||||
- `|=`
|
||||
- `*=`
|
||||
- `^=`
|
||||
- `$=`
|
||||
- `!=`
|
||||
- `i` and `s` can be added after the comparison to make the comparison
|
||||
case-insensitive or case-sensitive (eg. `[attr=foo i]`). If neither is
|
||||
supplied, css-select will follow the HTML spec's
|
||||
[case-sensitivity rules](https://html.spec.whatwg.org/multipage/semantics-other.html#case-sensitivity-of-selectors).
|
||||
- Pseudos:
|
||||
- [`:not`](https://developer.mozilla.org/en-US/docs/Web/CSS/:not)
|
||||
- [`:contains`](https://api.jquery.com/contains-selector)
|
||||
- `:icontains` (case-insensitive version of `:contains`)
|
||||
- [`:has`](https://developer.mozilla.org/en-US/docs/Web/CSS/:has)
|
||||
- [`:root`](https://developer.mozilla.org/en-US/docs/Web/CSS/:root)
|
||||
- [`:empty`](https://developer.mozilla.org/en-US/docs/Web/CSS/:empty)
|
||||
- [`:parent`](https://api.jquery.com/parent-selector)
|
||||
- [`:first-child`](https://developer.mozilla.org/en-US/docs/Web/CSS/:first-child),
|
||||
[`:last-child`](https://developer.mozilla.org/en-US/docs/Web/CSS/:last-child),
|
||||
[`:first-of-type`](https://developer.mozilla.org/en-US/docs/Web/CSS/:first-of-type),
|
||||
[`:last-of-type`](https://developer.mozilla.org/en-US/docs/Web/CSS/:last-of-type)
|
||||
- [`:only-of-type`](https://developer.mozilla.org/en-US/docs/Web/CSS/:only-of-type),
|
||||
[`:only-child`](https://developer.mozilla.org/en-US/docs/Web/CSS/:only-child)
|
||||
- [`:nth-child`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-child),
|
||||
[`:nth-last-child`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-last-child),
|
||||
[`:nth-of-type`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-of-type),
|
||||
[`:nth-last-of-type`](https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-last-of-type),
|
||||
- [`:link`](https://developer.mozilla.org/en-US/docs/Web/CSS/:link),
|
||||
[`:any-link`](https://developer.mozilla.org/en-US/docs/Web/CSS/:any-link)
|
||||
- [`:visited`](https://developer.mozilla.org/en-US/docs/Web/CSS/:visited),
|
||||
[`:hover`](https://developer.mozilla.org/en-US/docs/Web/CSS/:hover),
|
||||
[`:active`](https://developer.mozilla.org/en-US/docs/Web/CSS/:active)
|
||||
(these depend on optional `Adapter` methods, so these will only match
|
||||
elements if implemented in `Adapter`)
|
||||
- [`:selected`](https://api.jquery.com/selected-selector),
|
||||
[`:checked`](https://developer.mozilla.org/en-US/docs/Web/CSS/:checked)
|
||||
- [`:enabled`](https://developer.mozilla.org/en-US/docs/Web/CSS/:enabled),
|
||||
[`:disabled`](https://developer.mozilla.org/en-US/docs/Web/CSS/:disabled)
|
||||
- [`:required`](https://developer.mozilla.org/en-US/docs/Web/CSS/:required),
|
||||
[`:optional`](https://developer.mozilla.org/en-US/docs/Web/CSS/:optional)
|
||||
- [`:header`](https://api.jquery.com/header-selector),
|
||||
[`:button`](https://api.jquery.com/button-selector),
|
||||
[`:input`](https://api.jquery.com/input-selector),
|
||||
[`:text`](https://api.jquery.com/text-selector),
|
||||
[`:checkbox`](https://api.jquery.com/checkbox-selector),
|
||||
[`:file`](https://api.jquery.com/file-selector),
|
||||
[`:password`](https://api.jquery.com/password-selector),
|
||||
[`:reset`](https://api.jquery.com/reset-selector),
|
||||
[`:radio`](https://api.jquery.com/radio-selector) etc.
|
||||
- [`:is`](https://developer.mozilla.org/en-US/docs/Web/CSS/:is), plus its
|
||||
legacy alias `:matches`
|
||||
- [`:scope`](https://developer.mozilla.org/en-US/docs/Web/CSS/:scope)
|
||||
(uses the context from the passed options)
|
||||
|
||||
---
|
||||
|
||||
License: BSD-2-Clause
|
||||
|
||||
## Security contact information
|
||||
|
||||
To report a security vulnerability, please use the
|
||||
[Tidelift security contact](https://tidelift.com/security). Tidelift will
|
||||
coordinate the fix and disclosure.
|
||||
|
||||
## `css-select` for enterprise
|
||||
|
||||
Available as part of the Tidelift Subscription
|
||||
|
||||
The maintainers of `css-select` and thousands of other packages are working with
|
||||
Tidelift to deliver commercial support and maintenance for the open source
|
||||
dependencies you use to build your applications. Save time, reduce risk, and
|
||||
improve code health, while paying the maintainers of the exact dependencies you
|
||||
use.
|
||||
[Learn more.](https://tidelift.com/subscription/pkg/npm-css-select?utm_source=npm-css-select&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
|
||||
7
node_modules/laravel-mix/node_modules/css-select/lib/attributes.d.ts
generated
vendored
Executable file
7
node_modules/laravel-mix/node_modules/css-select/lib/attributes.d.ts
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
import { CompiledQuery, InternalOptions } from "./types";
|
||||
import type { AttributeSelector, AttributeAction } from "css-what";
|
||||
/**
|
||||
* Attribute selectors
|
||||
*/
|
||||
export declare const attributeRules: Record<AttributeAction, <Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, data: AttributeSelector, options: InternalOptions<Node, ElementNode>) => CompiledQuery<ElementNode>>;
|
||||
//# sourceMappingURL=attributes.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/attributes.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/attributes.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"attributes.d.ts","sourceRoot":"","sources":["../src/attributes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA+EnE;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAC/B,eAAe,EACf,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC3B,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,KAC1C,aAAa,CAAC,WAAW,CAAC,CAsLlC,CAAC"}
|
||||
232
node_modules/laravel-mix/node_modules/css-select/lib/attributes.js
generated
vendored
Executable file
232
node_modules/laravel-mix/node_modules/css-select/lib/attributes.js
generated
vendored
Executable file
@@ -0,0 +1,232 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.attributeRules = void 0;
|
||||
var boolbase_1 = require("boolbase");
|
||||
/**
|
||||
* All reserved characters in a regex, used for escaping.
|
||||
*
|
||||
* Taken from XRegExp, (c) 2007-2020 Steven Levithan under the MIT license
|
||||
* https://github.com/slevithan/xregexp/blob/95eeebeb8fac8754d54eafe2b4743661ac1cf028/src/xregexp.js#L794
|
||||
*/
|
||||
var reChars = /[-[\]{}()*+?.,\\^$|#\s]/g;
|
||||
function escapeRegex(value) {
|
||||
return value.replace(reChars, "\\$&");
|
||||
}
|
||||
/**
|
||||
* Attributes that are case-insensitive in HTML.
|
||||
*
|
||||
* @private
|
||||
* @see https://html.spec.whatwg.org/multipage/semantics-other.html#case-sensitivity-of-selectors
|
||||
*/
|
||||
var caseInsensitiveAttributes = new Set([
|
||||
"accept",
|
||||
"accept-charset",
|
||||
"align",
|
||||
"alink",
|
||||
"axis",
|
||||
"bgcolor",
|
||||
"charset",
|
||||
"checked",
|
||||
"clear",
|
||||
"codetype",
|
||||
"color",
|
||||
"compact",
|
||||
"declare",
|
||||
"defer",
|
||||
"dir",
|
||||
"direction",
|
||||
"disabled",
|
||||
"enctype",
|
||||
"face",
|
||||
"frame",
|
||||
"hreflang",
|
||||
"http-equiv",
|
||||
"lang",
|
||||
"language",
|
||||
"link",
|
||||
"media",
|
||||
"method",
|
||||
"multiple",
|
||||
"nohref",
|
||||
"noresize",
|
||||
"noshade",
|
||||
"nowrap",
|
||||
"readonly",
|
||||
"rel",
|
||||
"rev",
|
||||
"rules",
|
||||
"scope",
|
||||
"scrolling",
|
||||
"selected",
|
||||
"shape",
|
||||
"target",
|
||||
"text",
|
||||
"type",
|
||||
"valign",
|
||||
"valuetype",
|
||||
"vlink",
|
||||
]);
|
||||
function shouldIgnoreCase(selector, options) {
|
||||
return typeof selector.ignoreCase === "boolean"
|
||||
? selector.ignoreCase
|
||||
: selector.ignoreCase === "quirks"
|
||||
? !!options.quirksMode
|
||||
: !options.xmlMode && caseInsensitiveAttributes.has(selector.name);
|
||||
}
|
||||
/**
|
||||
* Attribute selectors
|
||||
*/
|
||||
exports.attributeRules = {
|
||||
equals: function (next, data, options) {
|
||||
var adapter = options.adapter;
|
||||
var name = data.name;
|
||||
var value = data.value;
|
||||
if (shouldIgnoreCase(data, options)) {
|
||||
value = value.toLowerCase();
|
||||
return function (elem) {
|
||||
var attr = adapter.getAttributeValue(elem, name);
|
||||
return (attr != null &&
|
||||
attr.length === value.length &&
|
||||
attr.toLowerCase() === value &&
|
||||
next(elem));
|
||||
};
|
||||
}
|
||||
return function (elem) {
|
||||
return adapter.getAttributeValue(elem, name) === value && next(elem);
|
||||
};
|
||||
},
|
||||
hyphen: function (next, data, options) {
|
||||
var adapter = options.adapter;
|
||||
var name = data.name;
|
||||
var value = data.value;
|
||||
var len = value.length;
|
||||
if (shouldIgnoreCase(data, options)) {
|
||||
value = value.toLowerCase();
|
||||
return function hyphenIC(elem) {
|
||||
var attr = adapter.getAttributeValue(elem, name);
|
||||
return (attr != null &&
|
||||
(attr.length === len || attr.charAt(len) === "-") &&
|
||||
attr.substr(0, len).toLowerCase() === value &&
|
||||
next(elem));
|
||||
};
|
||||
}
|
||||
return function hyphen(elem) {
|
||||
var attr = adapter.getAttributeValue(elem, name);
|
||||
return (attr != null &&
|
||||
(attr.length === len || attr.charAt(len) === "-") &&
|
||||
attr.substr(0, len) === value &&
|
||||
next(elem));
|
||||
};
|
||||
},
|
||||
element: function (next, data, options) {
|
||||
var adapter = options.adapter;
|
||||
var name = data.name, value = data.value;
|
||||
if (/\s/.test(value)) {
|
||||
return boolbase_1.falseFunc;
|
||||
}
|
||||
var regex = new RegExp("(?:^|\\s)".concat(escapeRegex(value), "(?:$|\\s)"), shouldIgnoreCase(data, options) ? "i" : "");
|
||||
return function element(elem) {
|
||||
var attr = adapter.getAttributeValue(elem, name);
|
||||
return (attr != null &&
|
||||
attr.length >= value.length &&
|
||||
regex.test(attr) &&
|
||||
next(elem));
|
||||
};
|
||||
},
|
||||
exists: function (next, _a, _b) {
|
||||
var name = _a.name;
|
||||
var adapter = _b.adapter;
|
||||
return function (elem) { return adapter.hasAttrib(elem, name) && next(elem); };
|
||||
},
|
||||
start: function (next, data, options) {
|
||||
var adapter = options.adapter;
|
||||
var name = data.name;
|
||||
var value = data.value;
|
||||
var len = value.length;
|
||||
if (len === 0) {
|
||||
return boolbase_1.falseFunc;
|
||||
}
|
||||
if (shouldIgnoreCase(data, options)) {
|
||||
value = value.toLowerCase();
|
||||
return function (elem) {
|
||||
var attr = adapter.getAttributeValue(elem, name);
|
||||
return (attr != null &&
|
||||
attr.length >= len &&
|
||||
attr.substr(0, len).toLowerCase() === value &&
|
||||
next(elem));
|
||||
};
|
||||
}
|
||||
return function (elem) {
|
||||
var _a;
|
||||
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.startsWith(value)) &&
|
||||
next(elem);
|
||||
};
|
||||
},
|
||||
end: function (next, data, options) {
|
||||
var adapter = options.adapter;
|
||||
var name = data.name;
|
||||
var value = data.value;
|
||||
var len = -value.length;
|
||||
if (len === 0) {
|
||||
return boolbase_1.falseFunc;
|
||||
}
|
||||
if (shouldIgnoreCase(data, options)) {
|
||||
value = value.toLowerCase();
|
||||
return function (elem) {
|
||||
var _a;
|
||||
return ((_a = adapter
|
||||
.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.substr(len).toLowerCase()) === value && next(elem);
|
||||
};
|
||||
}
|
||||
return function (elem) {
|
||||
var _a;
|
||||
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.endsWith(value)) &&
|
||||
next(elem);
|
||||
};
|
||||
},
|
||||
any: function (next, data, options) {
|
||||
var adapter = options.adapter;
|
||||
var name = data.name, value = data.value;
|
||||
if (value === "") {
|
||||
return boolbase_1.falseFunc;
|
||||
}
|
||||
if (shouldIgnoreCase(data, options)) {
|
||||
var regex_1 = new RegExp(escapeRegex(value), "i");
|
||||
return function anyIC(elem) {
|
||||
var attr = adapter.getAttributeValue(elem, name);
|
||||
return (attr != null &&
|
||||
attr.length >= value.length &&
|
||||
regex_1.test(attr) &&
|
||||
next(elem));
|
||||
};
|
||||
}
|
||||
return function (elem) {
|
||||
var _a;
|
||||
return !!((_a = adapter.getAttributeValue(elem, name)) === null || _a === void 0 ? void 0 : _a.includes(value)) &&
|
||||
next(elem);
|
||||
};
|
||||
},
|
||||
not: function (next, data, options) {
|
||||
var adapter = options.adapter;
|
||||
var name = data.name;
|
||||
var value = data.value;
|
||||
if (value === "") {
|
||||
return function (elem) {
|
||||
return !!adapter.getAttributeValue(elem, name) && next(elem);
|
||||
};
|
||||
}
|
||||
else if (shouldIgnoreCase(data, options)) {
|
||||
value = value.toLowerCase();
|
||||
return function (elem) {
|
||||
var attr = adapter.getAttributeValue(elem, name);
|
||||
return ((attr == null ||
|
||||
attr.length !== value.length ||
|
||||
attr.toLowerCase() !== value) &&
|
||||
next(elem));
|
||||
};
|
||||
}
|
||||
return function (elem) {
|
||||
return adapter.getAttributeValue(elem, name) !== value && next(elem);
|
||||
};
|
||||
},
|
||||
};
|
||||
14
node_modules/laravel-mix/node_modules/css-select/lib/compile.d.ts
generated
vendored
Executable file
14
node_modules/laravel-mix/node_modules/css-select/lib/compile.d.ts
generated
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
import { InternalSelector } from "./types";
|
||||
import { Selector } from "css-what";
|
||||
import type { CompiledQuery, InternalOptions } from "./types";
|
||||
/**
|
||||
* Compiles a selector to an executable function.
|
||||
*
|
||||
* @param selector Selector to compile.
|
||||
* @param options Compilation options.
|
||||
* @param context Optional context for the selector.
|
||||
*/
|
||||
export declare function compile<Node, ElementNode extends Node>(selector: string | Selector[][], options: InternalOptions<Node, ElementNode>, context?: Node[] | Node): CompiledQuery<Node>;
|
||||
export declare function compileUnsafe<Node, ElementNode extends Node>(selector: string | Selector[][], options: InternalOptions<Node, ElementNode>, context?: Node[] | Node): CompiledQuery<ElementNode>;
|
||||
export declare function compileToken<Node, ElementNode extends Node>(token: InternalSelector[][], options: InternalOptions<Node, ElementNode>, context?: Node[] | Node): CompiledQuery<ElementNode>;
|
||||
//# sourceMappingURL=compile.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/compile.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/compile.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../src/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAS,QAAQ,EAAgB,MAAM,UAAU,CAAC;AASzD,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE9D;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAClD,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAC/B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,IAAI,CAAC,CAGrB;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACxD,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,EAAE,EAC/B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,WAAW,CAAC,CAG5B;AAiDD,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACvD,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAC3B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,GACxB,aAAa,CAAC,WAAW,CAAC,CA2C5B"}
|
||||
119
node_modules/laravel-mix/node_modules/css-select/lib/compile.js
generated
vendored
Executable file
119
node_modules/laravel-mix/node_modules/css-select/lib/compile.js
generated
vendored
Executable file
@@ -0,0 +1,119 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.compileToken = exports.compileUnsafe = exports.compile = void 0;
|
||||
var css_what_1 = require("css-what");
|
||||
var boolbase_1 = require("boolbase");
|
||||
var sort_1 = __importDefault(require("./sort"));
|
||||
var procedure_1 = require("./procedure");
|
||||
var general_1 = require("./general");
|
||||
var subselects_1 = require("./pseudo-selectors/subselects");
|
||||
/**
|
||||
* Compiles a selector to an executable function.
|
||||
*
|
||||
* @param selector Selector to compile.
|
||||
* @param options Compilation options.
|
||||
* @param context Optional context for the selector.
|
||||
*/
|
||||
function compile(selector, options, context) {
|
||||
var next = compileUnsafe(selector, options, context);
|
||||
return (0, subselects_1.ensureIsTag)(next, options.adapter);
|
||||
}
|
||||
exports.compile = compile;
|
||||
function compileUnsafe(selector, options, context) {
|
||||
var token = typeof selector === "string" ? (0, css_what_1.parse)(selector) : selector;
|
||||
return compileToken(token, options, context);
|
||||
}
|
||||
exports.compileUnsafe = compileUnsafe;
|
||||
function includesScopePseudo(t) {
|
||||
return (t.type === "pseudo" &&
|
||||
(t.name === "scope" ||
|
||||
(Array.isArray(t.data) &&
|
||||
t.data.some(function (data) { return data.some(includesScopePseudo); }))));
|
||||
}
|
||||
var DESCENDANT_TOKEN = { type: css_what_1.SelectorType.Descendant };
|
||||
var FLEXIBLE_DESCENDANT_TOKEN = {
|
||||
type: "_flexibleDescendant",
|
||||
};
|
||||
var SCOPE_TOKEN = {
|
||||
type: css_what_1.SelectorType.Pseudo,
|
||||
name: "scope",
|
||||
data: null,
|
||||
};
|
||||
/*
|
||||
* CSS 4 Spec (Draft): 3.3.1. Absolutizing a Scope-relative Selector
|
||||
* http://www.w3.org/TR/selectors4/#absolutizing
|
||||
*/
|
||||
function absolutize(token, _a, context) {
|
||||
var adapter = _a.adapter;
|
||||
// TODO Use better check if the context is a document
|
||||
var hasContext = !!(context === null || context === void 0 ? void 0 : context.every(function (e) {
|
||||
var parent = adapter.isTag(e) && adapter.getParent(e);
|
||||
return e === subselects_1.PLACEHOLDER_ELEMENT || (parent && adapter.isTag(parent));
|
||||
}));
|
||||
for (var _i = 0, token_1 = token; _i < token_1.length; _i++) {
|
||||
var t = token_1[_i];
|
||||
if (t.length > 0 && (0, procedure_1.isTraversal)(t[0]) && t[0].type !== "descendant") {
|
||||
// Don't continue in else branch
|
||||
}
|
||||
else if (hasContext && !t.some(includesScopePseudo)) {
|
||||
t.unshift(DESCENDANT_TOKEN);
|
||||
}
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
t.unshift(SCOPE_TOKEN);
|
||||
}
|
||||
}
|
||||
function compileToken(token, options, context) {
|
||||
var _a;
|
||||
token = token.filter(function (t) { return t.length > 0; });
|
||||
token.forEach(sort_1.default);
|
||||
context = (_a = options.context) !== null && _a !== void 0 ? _a : context;
|
||||
var isArrayContext = Array.isArray(context);
|
||||
var finalContext = context && (Array.isArray(context) ? context : [context]);
|
||||
absolutize(token, options, finalContext);
|
||||
var shouldTestNextSiblings = false;
|
||||
var query = token
|
||||
.map(function (rules) {
|
||||
if (rules.length >= 2) {
|
||||
var first = rules[0], second = rules[1];
|
||||
if (first.type !== "pseudo" || first.name !== "scope") {
|
||||
// Ignore
|
||||
}
|
||||
else if (isArrayContext && second.type === "descendant") {
|
||||
rules[1] = FLEXIBLE_DESCENDANT_TOKEN;
|
||||
}
|
||||
else if (second.type === "adjacent" ||
|
||||
second.type === "sibling") {
|
||||
shouldTestNextSiblings = true;
|
||||
}
|
||||
}
|
||||
return compileRules(rules, options, finalContext);
|
||||
})
|
||||
.reduce(reduceRules, boolbase_1.falseFunc);
|
||||
query.shouldTestNextSiblings = shouldTestNextSiblings;
|
||||
return query;
|
||||
}
|
||||
exports.compileToken = compileToken;
|
||||
function compileRules(rules, options, context) {
|
||||
var _a;
|
||||
return rules.reduce(function (previous, rule) {
|
||||
return previous === boolbase_1.falseFunc
|
||||
? boolbase_1.falseFunc
|
||||
: (0, general_1.compileGeneralSelector)(previous, rule, options, context, compileToken);
|
||||
}, (_a = options.rootFunc) !== null && _a !== void 0 ? _a : boolbase_1.trueFunc);
|
||||
}
|
||||
function reduceRules(a, b) {
|
||||
if (b === boolbase_1.falseFunc || a === boolbase_1.trueFunc) {
|
||||
return a;
|
||||
}
|
||||
if (a === boolbase_1.falseFunc || b === boolbase_1.trueFunc) {
|
||||
return b;
|
||||
}
|
||||
return function combine(elem) {
|
||||
return a(elem) || b(elem);
|
||||
};
|
||||
}
|
||||
3
node_modules/laravel-mix/node_modules/css-select/lib/general.d.ts
generated
vendored
Executable file
3
node_modules/laravel-mix/node_modules/css-select/lib/general.d.ts
generated
vendored
Executable file
@@ -0,0 +1,3 @@
|
||||
import type { CompiledQuery, InternalOptions, InternalSelector, CompileToken } from "./types";
|
||||
export declare function compileGeneralSelector<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, selector: InternalSelector, options: InternalOptions<Node, ElementNode>, context: Node[] | undefined, compileToken: CompileToken<Node, ElementNode>): CompiledQuery<ElementNode>;
|
||||
//# sourceMappingURL=general.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/general.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/general.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../src/general.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACR,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,YAAY,EACf,MAAM,SAAS,CAAC;AAOjB,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACjE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,EAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,GAC9C,aAAa,CAAC,WAAW,CAAC,CAiK5B"}
|
||||
140
node_modules/laravel-mix/node_modules/css-select/lib/general.js
generated
vendored
Executable file
140
node_modules/laravel-mix/node_modules/css-select/lib/general.js
generated
vendored
Executable file
@@ -0,0 +1,140 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.compileGeneralSelector = void 0;
|
||||
var attributes_1 = require("./attributes");
|
||||
var pseudo_selectors_1 = require("./pseudo-selectors");
|
||||
var css_what_1 = require("css-what");
|
||||
/*
|
||||
* All available rules
|
||||
*/
|
||||
function compileGeneralSelector(next, selector, options, context, compileToken) {
|
||||
var adapter = options.adapter, equals = options.equals;
|
||||
switch (selector.type) {
|
||||
case css_what_1.SelectorType.PseudoElement: {
|
||||
throw new Error("Pseudo-elements are not supported by css-select");
|
||||
}
|
||||
case css_what_1.SelectorType.ColumnCombinator: {
|
||||
throw new Error("Column combinators are not yet supported by css-select");
|
||||
}
|
||||
case css_what_1.SelectorType.Attribute: {
|
||||
if (selector.namespace != null) {
|
||||
throw new Error("Namespaced attributes are not yet supported by css-select");
|
||||
}
|
||||
if (!options.xmlMode || options.lowerCaseAttributeNames) {
|
||||
selector.name = selector.name.toLowerCase();
|
||||
}
|
||||
return attributes_1.attributeRules[selector.action](next, selector, options);
|
||||
}
|
||||
case css_what_1.SelectorType.Pseudo: {
|
||||
return (0, pseudo_selectors_1.compilePseudoSelector)(next, selector, options, context, compileToken);
|
||||
}
|
||||
// Tags
|
||||
case css_what_1.SelectorType.Tag: {
|
||||
if (selector.namespace != null) {
|
||||
throw new Error("Namespaced tag names are not yet supported by css-select");
|
||||
}
|
||||
var name_1 = selector.name;
|
||||
if (!options.xmlMode || options.lowerCaseTags) {
|
||||
name_1 = name_1.toLowerCase();
|
||||
}
|
||||
return function tag(elem) {
|
||||
return adapter.getName(elem) === name_1 && next(elem);
|
||||
};
|
||||
}
|
||||
// Traversal
|
||||
case css_what_1.SelectorType.Descendant: {
|
||||
if (options.cacheResults === false ||
|
||||
typeof WeakSet === "undefined") {
|
||||
return function descendant(elem) {
|
||||
var current = elem;
|
||||
while ((current = adapter.getParent(current))) {
|
||||
if (adapter.isTag(current) && next(current)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
// @ts-expect-error `ElementNode` is not extending object
|
||||
var isFalseCache_1 = new WeakSet();
|
||||
return function cachedDescendant(elem) {
|
||||
var current = elem;
|
||||
while ((current = adapter.getParent(current))) {
|
||||
if (!isFalseCache_1.has(current)) {
|
||||
if (adapter.isTag(current) && next(current)) {
|
||||
return true;
|
||||
}
|
||||
isFalseCache_1.add(current);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
case "_flexibleDescendant": {
|
||||
// Include element itself, only used while querying an array
|
||||
return function flexibleDescendant(elem) {
|
||||
var current = elem;
|
||||
do {
|
||||
if (adapter.isTag(current) && next(current))
|
||||
return true;
|
||||
} while ((current = adapter.getParent(current)));
|
||||
return false;
|
||||
};
|
||||
}
|
||||
case css_what_1.SelectorType.Parent: {
|
||||
return function parent(elem) {
|
||||
return adapter
|
||||
.getChildren(elem)
|
||||
.some(function (elem) { return adapter.isTag(elem) && next(elem); });
|
||||
};
|
||||
}
|
||||
case css_what_1.SelectorType.Child: {
|
||||
return function child(elem) {
|
||||
var parent = adapter.getParent(elem);
|
||||
return parent != null && adapter.isTag(parent) && next(parent);
|
||||
};
|
||||
}
|
||||
case css_what_1.SelectorType.Sibling: {
|
||||
return function sibling(elem) {
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
for (var i = 0; i < siblings.length; i++) {
|
||||
var currentSibling = siblings[i];
|
||||
if (equals(elem, currentSibling))
|
||||
break;
|
||||
if (adapter.isTag(currentSibling) && next(currentSibling)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
}
|
||||
case css_what_1.SelectorType.Adjacent: {
|
||||
if (adapter.prevElementSibling) {
|
||||
return function adjacent(elem) {
|
||||
var previous = adapter.prevElementSibling(elem);
|
||||
return previous != null && next(previous);
|
||||
};
|
||||
}
|
||||
return function adjacent(elem) {
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
var lastElement;
|
||||
for (var i = 0; i < siblings.length; i++) {
|
||||
var currentSibling = siblings[i];
|
||||
if (equals(elem, currentSibling))
|
||||
break;
|
||||
if (adapter.isTag(currentSibling)) {
|
||||
lastElement = currentSibling;
|
||||
}
|
||||
}
|
||||
return !!lastElement && next(lastElement);
|
||||
};
|
||||
}
|
||||
case css_what_1.SelectorType.Universal: {
|
||||
if (selector.namespace != null && selector.namespace !== "*") {
|
||||
throw new Error("Namespaced universal selectors are not yet supported by css-select");
|
||||
}
|
||||
return next;
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.compileGeneralSelector = compileGeneralSelector;
|
||||
49
node_modules/laravel-mix/node_modules/css-select/lib/index.d.ts
generated
vendored
Executable file
49
node_modules/laravel-mix/node_modules/css-select/lib/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
import type { CompiledQuery, Options, Query, Adapter } from "./types";
|
||||
export type { Options };
|
||||
/**
|
||||
* Compiles the query, returns a function.
|
||||
*/
|
||||
export declare const compile: <Node_1, ElementNode extends Node_1>(selector: string | import("css-what").Selector[][], options?: Options<Node_1, ElementNode> | undefined, context?: Node_1 | Node_1[] | undefined) => CompiledQuery<Node_1>;
|
||||
export declare const _compileUnsafe: <Node_1, ElementNode extends Node_1>(selector: string | import("css-what").Selector[][], options?: Options<Node_1, ElementNode> | undefined, context?: Node_1 | Node_1[] | undefined) => CompiledQuery<ElementNode>;
|
||||
export declare const _compileToken: <Node_1, ElementNode extends Node_1>(selector: import("./types").InternalSelector[][], options?: Options<Node_1, ElementNode> | undefined, context?: Node_1 | Node_1[] | undefined) => CompiledQuery<ElementNode>;
|
||||
export declare function prepareContext<Node, ElementNode extends Node>(elems: Node | Node[], adapter: Adapter<Node, ElementNode>, shouldTestNextSiblings?: boolean): Node[];
|
||||
/**
|
||||
* @template Node The generic Node type for the DOM adapter being used.
|
||||
* @template ElementNode The Node type for elements for the DOM adapter being used.
|
||||
* @param elems Elements to query. If it is an element, its children will be queried..
|
||||
* @param query can be either a CSS selector string or a compiled query function.
|
||||
* @param [options] options for querying the document.
|
||||
* @see compile for supported selector queries.
|
||||
* @returns All matching elements.
|
||||
*
|
||||
*/
|
||||
export declare const selectAll: <Node_1, ElementNode extends Node_1>(query: Query<ElementNode>, elements: Node_1 | Node_1[], options?: Options<Node_1, ElementNode> | undefined) => ElementNode[];
|
||||
/**
|
||||
* @template Node The generic Node type for the DOM adapter being used.
|
||||
* @template ElementNode The Node type for elements for the DOM adapter being used.
|
||||
* @param elems Elements to query. If it is an element, its children will be queried..
|
||||
* @param query can be either a CSS selector string or a compiled query function.
|
||||
* @param [options] options for querying the document.
|
||||
* @see compile for supported selector queries.
|
||||
* @returns the first match, or null if there was no match.
|
||||
*/
|
||||
export declare const selectOne: <Node_1, ElementNode extends Node_1>(query: Query<ElementNode>, elements: Node_1 | Node_1[], options?: Options<Node_1, ElementNode> | undefined) => ElementNode | null;
|
||||
/**
|
||||
* Tests whether or not an element is matched by query.
|
||||
*
|
||||
* @template Node The generic Node type for the DOM adapter being used.
|
||||
* @template ElementNode The Node type for elements for the DOM adapter being used.
|
||||
* @param elem The element to test if it matches the query.
|
||||
* @param query can be either a CSS selector string or a compiled query function.
|
||||
* @param [options] options for querying the document.
|
||||
* @see compile for supported selector queries.
|
||||
* @returns
|
||||
*/
|
||||
export declare function is<Node, ElementNode extends Node>(elem: ElementNode, query: Query<ElementNode>, options?: Options<Node, ElementNode>): boolean;
|
||||
/**
|
||||
* Alias for selectAll(query, elems, options).
|
||||
* @see [compile] for supported selector queries.
|
||||
*/
|
||||
export default selectAll;
|
||||
export { filters, pseudos, aliases } from "./pseudo-selectors";
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/index.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/index.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,aAAa,EACb,OAAO,EAEP,KAAK,EACL,OAAO,EAEV,MAAM,SAAS,CAAC;AAGjB,YAAY,EAAE,OAAO,EAAE,CAAC;AA0CxB;;GAEG;AACH,eAAO,MAAM,OAAO,gNAA0B,CAAC;AAC/C,eAAO,MAAM,cAAc,qNAA6B,CAAC;AACzD,eAAO,MAAM,aAAa,mNAA4B,CAAC;AA6BvD,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACzD,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,EACpB,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,EACnC,sBAAsB,UAAQ,GAC/B,IAAI,EAAE,CAYR;AAiBD;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS,mKASrB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,wKASrB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,EAAE,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC7C,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,EACzB,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACrC,OAAO,CAKT;AAED;;;GAGG;AACH,eAAe,SAAS,CAAC;AAGzB,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC"}
|
||||
149
node_modules/laravel-mix/node_modules/css-select/lib/index.js
generated
vendored
Executable file
149
node_modules/laravel-mix/node_modules/css-select/lib/index.js
generated
vendored
Executable file
@@ -0,0 +1,149 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.aliases = exports.pseudos = exports.filters = exports.is = exports.selectOne = exports.selectAll = exports.prepareContext = exports._compileToken = exports._compileUnsafe = exports.compile = void 0;
|
||||
var DomUtils = __importStar(require("domutils"));
|
||||
var boolbase_1 = require("boolbase");
|
||||
var compile_1 = require("./compile");
|
||||
var subselects_1 = require("./pseudo-selectors/subselects");
|
||||
var defaultEquals = function (a, b) { return a === b; };
|
||||
var defaultOptions = {
|
||||
adapter: DomUtils,
|
||||
equals: defaultEquals,
|
||||
};
|
||||
function convertOptionFormats(options) {
|
||||
var _a, _b, _c, _d;
|
||||
/*
|
||||
* We force one format of options to the other one.
|
||||
*/
|
||||
// @ts-expect-error Default options may have incompatible `Node` / `ElementNode`.
|
||||
var opts = options !== null && options !== void 0 ? options : defaultOptions;
|
||||
// @ts-expect-error Same as above.
|
||||
(_a = opts.adapter) !== null && _a !== void 0 ? _a : (opts.adapter = DomUtils);
|
||||
// @ts-expect-error `equals` does not exist on `Options`
|
||||
(_b = opts.equals) !== null && _b !== void 0 ? _b : (opts.equals = (_d = (_c = opts.adapter) === null || _c === void 0 ? void 0 : _c.equals) !== null && _d !== void 0 ? _d : defaultEquals);
|
||||
return opts;
|
||||
}
|
||||
function wrapCompile(func) {
|
||||
return function addAdapter(selector, options, context) {
|
||||
var opts = convertOptionFormats(options);
|
||||
return func(selector, opts, context);
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Compiles the query, returns a function.
|
||||
*/
|
||||
exports.compile = wrapCompile(compile_1.compile);
|
||||
exports._compileUnsafe = wrapCompile(compile_1.compileUnsafe);
|
||||
exports._compileToken = wrapCompile(compile_1.compileToken);
|
||||
function getSelectorFunc(searchFunc) {
|
||||
return function select(query, elements, options) {
|
||||
var opts = convertOptionFormats(options);
|
||||
if (typeof query !== "function") {
|
||||
query = (0, compile_1.compileUnsafe)(query, opts, elements);
|
||||
}
|
||||
var filteredElements = prepareContext(elements, opts.adapter, query.shouldTestNextSiblings);
|
||||
return searchFunc(query, filteredElements, opts);
|
||||
};
|
||||
}
|
||||
function prepareContext(elems, adapter, shouldTestNextSiblings) {
|
||||
if (shouldTestNextSiblings === void 0) { shouldTestNextSiblings = false; }
|
||||
/*
|
||||
* Add siblings if the query requires them.
|
||||
* See https://github.com/fb55/css-select/pull/43#issuecomment-225414692
|
||||
*/
|
||||
if (shouldTestNextSiblings) {
|
||||
elems = appendNextSiblings(elems, adapter);
|
||||
}
|
||||
return Array.isArray(elems)
|
||||
? adapter.removeSubsets(elems)
|
||||
: adapter.getChildren(elems);
|
||||
}
|
||||
exports.prepareContext = prepareContext;
|
||||
function appendNextSiblings(elem, adapter) {
|
||||
// Order matters because jQuery seems to check the children before the siblings
|
||||
var elems = Array.isArray(elem) ? elem.slice(0) : [elem];
|
||||
var elemsLength = elems.length;
|
||||
for (var i = 0; i < elemsLength; i++) {
|
||||
var nextSiblings = (0, subselects_1.getNextSiblings)(elems[i], adapter);
|
||||
elems.push.apply(elems, nextSiblings);
|
||||
}
|
||||
return elems;
|
||||
}
|
||||
/**
|
||||
* @template Node The generic Node type for the DOM adapter being used.
|
||||
* @template ElementNode The Node type for elements for the DOM adapter being used.
|
||||
* @param elems Elements to query. If it is an element, its children will be queried..
|
||||
* @param query can be either a CSS selector string or a compiled query function.
|
||||
* @param [options] options for querying the document.
|
||||
* @see compile for supported selector queries.
|
||||
* @returns All matching elements.
|
||||
*
|
||||
*/
|
||||
exports.selectAll = getSelectorFunc(function (query, elems, options) {
|
||||
return query === boolbase_1.falseFunc || !elems || elems.length === 0
|
||||
? []
|
||||
: options.adapter.findAll(query, elems);
|
||||
});
|
||||
/**
|
||||
* @template Node The generic Node type for the DOM adapter being used.
|
||||
* @template ElementNode The Node type for elements for the DOM adapter being used.
|
||||
* @param elems Elements to query. If it is an element, its children will be queried..
|
||||
* @param query can be either a CSS selector string or a compiled query function.
|
||||
* @param [options] options for querying the document.
|
||||
* @see compile for supported selector queries.
|
||||
* @returns the first match, or null if there was no match.
|
||||
*/
|
||||
exports.selectOne = getSelectorFunc(function (query, elems, options) {
|
||||
return query === boolbase_1.falseFunc || !elems || elems.length === 0
|
||||
? null
|
||||
: options.adapter.findOne(query, elems);
|
||||
});
|
||||
/**
|
||||
* Tests whether or not an element is matched by query.
|
||||
*
|
||||
* @template Node The generic Node type for the DOM adapter being used.
|
||||
* @template ElementNode The Node type for elements for the DOM adapter being used.
|
||||
* @param elem The element to test if it matches the query.
|
||||
* @param query can be either a CSS selector string or a compiled query function.
|
||||
* @param [options] options for querying the document.
|
||||
* @see compile for supported selector queries.
|
||||
* @returns
|
||||
*/
|
||||
function is(elem, query, options) {
|
||||
var opts = convertOptionFormats(options);
|
||||
return (typeof query === "function" ? query : (0, compile_1.compile)(query, opts))(elem);
|
||||
}
|
||||
exports.is = is;
|
||||
/**
|
||||
* Alias for selectAll(query, elems, options).
|
||||
* @see [compile] for supported selector queries.
|
||||
*/
|
||||
exports.default = exports.selectAll;
|
||||
// Export filters, pseudos and aliases to allow users to supply their own.
|
||||
var pseudo_selectors_1 = require("./pseudo-selectors");
|
||||
Object.defineProperty(exports, "filters", { enumerable: true, get: function () { return pseudo_selectors_1.filters; } });
|
||||
Object.defineProperty(exports, "pseudos", { enumerable: true, get: function () { return pseudo_selectors_1.pseudos; } });
|
||||
Object.defineProperty(exports, "aliases", { enumerable: true, get: function () { return pseudo_selectors_1.aliases; } });
|
||||
5
node_modules/laravel-mix/node_modules/css-select/lib/procedure.d.ts
generated
vendored
Executable file
5
node_modules/laravel-mix/node_modules/css-select/lib/procedure.d.ts
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
import type { Traversal } from "css-what";
|
||||
import type { InternalSelector } from "./types";
|
||||
export declare const procedure: Record<InternalSelector["type"], number>;
|
||||
export declare function isTraversal(t: InternalSelector): t is Traversal;
|
||||
//# sourceMappingURL=procedure.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/procedure.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/procedure.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../src/procedure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEhD,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAa9D,CAAC;AAEF,wBAAgB,WAAW,CAAC,CAAC,EAAE,gBAAgB,GAAG,CAAC,IAAI,SAAS,CAE/D"}
|
||||
21
node_modules/laravel-mix/node_modules/css-select/lib/procedure.js
generated
vendored
Executable file
21
node_modules/laravel-mix/node_modules/css-select/lib/procedure.js
generated
vendored
Executable file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isTraversal = exports.procedure = void 0;
|
||||
exports.procedure = {
|
||||
universal: 50,
|
||||
tag: 30,
|
||||
attribute: 1,
|
||||
pseudo: 0,
|
||||
"pseudo-element": 0,
|
||||
"column-combinator": -1,
|
||||
descendant: -1,
|
||||
child: -1,
|
||||
parent: -1,
|
||||
sibling: -1,
|
||||
adjacent: -1,
|
||||
_flexibleDescendant: -1,
|
||||
};
|
||||
function isTraversal(t) {
|
||||
return exports.procedure[t.type] < 0;
|
||||
}
|
||||
exports.isTraversal = isTraversal;
|
||||
5
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/aliases.d.ts
generated
vendored
Executable file
5
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/aliases.d.ts
generated
vendored
Executable file
@@ -0,0 +1,5 @@
|
||||
/**
|
||||
* Aliases are pseudos that are expressed as selectors.
|
||||
*/
|
||||
export declare const aliases: Record<string, string>;
|
||||
//# sourceMappingURL=aliases.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/aliases.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/aliases.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"aliases.d.ts","sourceRoot":"","sources":["../../src/pseudo-selectors/aliases.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAwC1C,CAAC"}
|
||||
33
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/aliases.js
generated
vendored
Executable file
33
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/aliases.js
generated
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.aliases = void 0;
|
||||
/**
|
||||
* Aliases are pseudos that are expressed as selectors.
|
||||
*/
|
||||
exports.aliases = {
|
||||
// Links
|
||||
"any-link": ":is(a, area, link)[href]",
|
||||
link: ":any-link:not(:visited)",
|
||||
// Forms
|
||||
// https://html.spec.whatwg.org/multipage/scripting.html#disabled-elements
|
||||
disabled: ":is(\n :is(button, input, select, textarea, optgroup, option)[disabled],\n optgroup[disabled] > option,\n fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)\n )",
|
||||
enabled: ":not(:disabled)",
|
||||
checked: ":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",
|
||||
required: ":is(input, select, textarea)[required]",
|
||||
optional: ":is(input, select, textarea):not([required])",
|
||||
// JQuery extensions
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#concept-option-selectedness
|
||||
selected: "option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",
|
||||
checkbox: "[type=checkbox]",
|
||||
file: "[type=file]",
|
||||
password: "[type=password]",
|
||||
radio: "[type=radio]",
|
||||
reset: "[type=reset]",
|
||||
image: "[type=image]",
|
||||
submit: "[type=submit]",
|
||||
parent: ":not(:empty)",
|
||||
header: ":is(h1, h2, h3, h4, h5, h6)",
|
||||
button: ":is(button, input[type=button])",
|
||||
input: ":is(input, textarea, select, button)",
|
||||
text: "input:is(:not([type!='']), [type=text])",
|
||||
};
|
||||
4
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/filters.d.ts
generated
vendored
Executable file
4
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/filters.d.ts
generated
vendored
Executable file
@@ -0,0 +1,4 @@
|
||||
import type { CompiledQuery, InternalOptions } from "../types";
|
||||
export declare type Filter = <Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, text: string, options: InternalOptions<Node, ElementNode>, context?: Node[]) => CompiledQuery<ElementNode>;
|
||||
export declare const filters: Record<string, Filter>;
|
||||
//# sourceMappingURL=filters.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/filters.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/filters.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/pseudo-selectors/filters.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAW,MAAM,UAAU,CAAC;AAExE,oBAAY,MAAM,GAAG,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAChD,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,KACf,aAAa,CAAC,WAAW,CAAC,CAAC;AAYhC,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2I1C,CAAC"}
|
||||
156
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/filters.js
generated
vendored
Executable file
156
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/filters.js
generated
vendored
Executable file
@@ -0,0 +1,156 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.filters = void 0;
|
||||
var nth_check_1 = __importDefault(require("nth-check"));
|
||||
var boolbase_1 = require("boolbase");
|
||||
function getChildFunc(next, adapter) {
|
||||
return function (elem) {
|
||||
var parent = adapter.getParent(elem);
|
||||
return parent != null && adapter.isTag(parent) && next(elem);
|
||||
};
|
||||
}
|
||||
exports.filters = {
|
||||
contains: function (next, text, _a) {
|
||||
var adapter = _a.adapter;
|
||||
return function contains(elem) {
|
||||
return next(elem) && adapter.getText(elem).includes(text);
|
||||
};
|
||||
},
|
||||
icontains: function (next, text, _a) {
|
||||
var adapter = _a.adapter;
|
||||
var itext = text.toLowerCase();
|
||||
return function icontains(elem) {
|
||||
return (next(elem) &&
|
||||
adapter.getText(elem).toLowerCase().includes(itext));
|
||||
};
|
||||
},
|
||||
// Location specific methods
|
||||
"nth-child": function (next, rule, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var func = (0, nth_check_1.default)(rule);
|
||||
if (func === boolbase_1.falseFunc)
|
||||
return boolbase_1.falseFunc;
|
||||
if (func === boolbase_1.trueFunc)
|
||||
return getChildFunc(next, adapter);
|
||||
return function nthChild(elem) {
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
var pos = 0;
|
||||
for (var i = 0; i < siblings.length; i++) {
|
||||
if (equals(elem, siblings[i]))
|
||||
break;
|
||||
if (adapter.isTag(siblings[i])) {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
return func(pos) && next(elem);
|
||||
};
|
||||
},
|
||||
"nth-last-child": function (next, rule, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var func = (0, nth_check_1.default)(rule);
|
||||
if (func === boolbase_1.falseFunc)
|
||||
return boolbase_1.falseFunc;
|
||||
if (func === boolbase_1.trueFunc)
|
||||
return getChildFunc(next, adapter);
|
||||
return function nthLastChild(elem) {
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
var pos = 0;
|
||||
for (var i = siblings.length - 1; i >= 0; i--) {
|
||||
if (equals(elem, siblings[i]))
|
||||
break;
|
||||
if (adapter.isTag(siblings[i])) {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
return func(pos) && next(elem);
|
||||
};
|
||||
},
|
||||
"nth-of-type": function (next, rule, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var func = (0, nth_check_1.default)(rule);
|
||||
if (func === boolbase_1.falseFunc)
|
||||
return boolbase_1.falseFunc;
|
||||
if (func === boolbase_1.trueFunc)
|
||||
return getChildFunc(next, adapter);
|
||||
return function nthOfType(elem) {
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
var pos = 0;
|
||||
for (var i = 0; i < siblings.length; i++) {
|
||||
var currentSibling = siblings[i];
|
||||
if (equals(elem, currentSibling))
|
||||
break;
|
||||
if (adapter.isTag(currentSibling) &&
|
||||
adapter.getName(currentSibling) === adapter.getName(elem)) {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
return func(pos) && next(elem);
|
||||
};
|
||||
},
|
||||
"nth-last-of-type": function (next, rule, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var func = (0, nth_check_1.default)(rule);
|
||||
if (func === boolbase_1.falseFunc)
|
||||
return boolbase_1.falseFunc;
|
||||
if (func === boolbase_1.trueFunc)
|
||||
return getChildFunc(next, adapter);
|
||||
return function nthLastOfType(elem) {
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
var pos = 0;
|
||||
for (var i = siblings.length - 1; i >= 0; i--) {
|
||||
var currentSibling = siblings[i];
|
||||
if (equals(elem, currentSibling))
|
||||
break;
|
||||
if (adapter.isTag(currentSibling) &&
|
||||
adapter.getName(currentSibling) === adapter.getName(elem)) {
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
return func(pos) && next(elem);
|
||||
};
|
||||
},
|
||||
// TODO determine the actual root element
|
||||
root: function (next, _rule, _a) {
|
||||
var adapter = _a.adapter;
|
||||
return function (elem) {
|
||||
var parent = adapter.getParent(elem);
|
||||
return (parent == null || !adapter.isTag(parent)) && next(elem);
|
||||
};
|
||||
},
|
||||
scope: function (next, rule, options, context) {
|
||||
var equals = options.equals;
|
||||
if (!context || context.length === 0) {
|
||||
// Equivalent to :root
|
||||
return exports.filters.root(next, rule, options);
|
||||
}
|
||||
if (context.length === 1) {
|
||||
// NOTE: can't be unpacked, as :has uses this for side-effects
|
||||
return function (elem) { return equals(context[0], elem) && next(elem); };
|
||||
}
|
||||
return function (elem) { return context.includes(elem) && next(elem); };
|
||||
},
|
||||
hover: dynamicStatePseudo("isHovered"),
|
||||
visited: dynamicStatePseudo("isVisited"),
|
||||
active: dynamicStatePseudo("isActive"),
|
||||
};
|
||||
/**
|
||||
* Dynamic state pseudos. These depend on optional Adapter methods.
|
||||
*
|
||||
* @param name The name of the adapter method to call.
|
||||
* @returns Pseudo for the `filters` object.
|
||||
*/
|
||||
function dynamicStatePseudo(name) {
|
||||
return function dynamicPseudo(next, _rule, _a) {
|
||||
var adapter = _a.adapter;
|
||||
var func = adapter[name];
|
||||
if (typeof func !== "function") {
|
||||
return boolbase_1.falseFunc;
|
||||
}
|
||||
return function active(elem) {
|
||||
return func(elem) && next(elem);
|
||||
};
|
||||
};
|
||||
}
|
||||
8
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/index.d.ts
generated
vendored
Executable file
8
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1,8 @@
|
||||
import type { CompiledQuery, InternalOptions, CompileToken } from "../types";
|
||||
import { PseudoSelector } from "css-what";
|
||||
import { filters } from "./filters";
|
||||
import { pseudos } from "./pseudos";
|
||||
import { aliases } from "./aliases";
|
||||
export { filters, pseudos, aliases };
|
||||
export declare function compilePseudoSelector<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, selector: PseudoSelector, options: InternalOptions<Node, ElementNode>, context: Node[] | undefined, compileToken: CompileToken<Node, ElementNode>): CompiledQuery<ElementNode>;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/index.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/index.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/pseudo-selectors/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAS,cAAc,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAoB,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC;AAErC,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAChE,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,QAAQ,EAAE,cAAc,EACxB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,EAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,GAC9C,aAAa,CAAC,WAAW,CAAC,CA6B5B"}
|
||||
54
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/index.js
generated
vendored
Executable file
54
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/index.js
generated
vendored
Executable file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.compilePseudoSelector = exports.aliases = exports.pseudos = exports.filters = void 0;
|
||||
/*
|
||||
* Pseudo selectors
|
||||
*
|
||||
* Pseudo selectors are available in three forms:
|
||||
*
|
||||
* 1. Filters are called when the selector is compiled and return a function
|
||||
* that has to return either false, or the results of `next()`.
|
||||
* 2. Pseudos are called on execution. They have to return a boolean.
|
||||
* 3. Subselects work like filters, but have an embedded selector that will be run separately.
|
||||
*
|
||||
* Filters are great if you want to do some pre-processing, or change the call order
|
||||
* of `next()` and your code.
|
||||
* Pseudos should be used to implement simple checks.
|
||||
*/
|
||||
var boolbase_1 = require("boolbase");
|
||||
var css_what_1 = require("css-what");
|
||||
var filters_1 = require("./filters");
|
||||
Object.defineProperty(exports, "filters", { enumerable: true, get: function () { return filters_1.filters; } });
|
||||
var pseudos_1 = require("./pseudos");
|
||||
Object.defineProperty(exports, "pseudos", { enumerable: true, get: function () { return pseudos_1.pseudos; } });
|
||||
var aliases_1 = require("./aliases");
|
||||
Object.defineProperty(exports, "aliases", { enumerable: true, get: function () { return aliases_1.aliases; } });
|
||||
var subselects_1 = require("./subselects");
|
||||
function compilePseudoSelector(next, selector, options, context, compileToken) {
|
||||
var name = selector.name, data = selector.data;
|
||||
if (Array.isArray(data)) {
|
||||
return subselects_1.subselects[name](next, data, options, context, compileToken);
|
||||
}
|
||||
if (name in aliases_1.aliases) {
|
||||
if (data != null) {
|
||||
throw new Error("Pseudo ".concat(name, " doesn't have any arguments"));
|
||||
}
|
||||
// The alias has to be parsed here, to make sure options are respected.
|
||||
var alias = (0, css_what_1.parse)(aliases_1.aliases[name]);
|
||||
return subselects_1.subselects.is(next, alias, options, context, compileToken);
|
||||
}
|
||||
if (name in filters_1.filters) {
|
||||
return filters_1.filters[name](next, data, options, context);
|
||||
}
|
||||
if (name in pseudos_1.pseudos) {
|
||||
var pseudo_1 = pseudos_1.pseudos[name];
|
||||
(0, pseudos_1.verifyPseudoArgs)(pseudo_1, name, data);
|
||||
return pseudo_1 === boolbase_1.falseFunc
|
||||
? boolbase_1.falseFunc
|
||||
: next === boolbase_1.trueFunc
|
||||
? function (elem) { return pseudo_1(elem, options, data); }
|
||||
: function (elem) { return pseudo_1(elem, options, data) && next(elem); };
|
||||
}
|
||||
throw new Error("unmatched pseudo-class :".concat(name));
|
||||
}
|
||||
exports.compilePseudoSelector = compilePseudoSelector;
|
||||
6
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/pseudos.d.ts
generated
vendored
Executable file
6
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/pseudos.d.ts
generated
vendored
Executable file
@@ -0,0 +1,6 @@
|
||||
import { PseudoSelector } from "css-what";
|
||||
import type { InternalOptions } from "../types";
|
||||
export declare type Pseudo = <Node, ElementNode extends Node>(elem: ElementNode, options: InternalOptions<Node, ElementNode>, subselect?: ElementNode | string | null) => boolean;
|
||||
export declare const pseudos: Record<string, Pseudo>;
|
||||
export declare function verifyPseudoArgs(func: Pseudo, name: string, subselect: PseudoSelector["data"]): void;
|
||||
//# sourceMappingURL=pseudos.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/pseudos.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/pseudos.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"pseudos.d.ts","sourceRoot":"","sources":["../../src/pseudo-selectors/pseudos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhD,oBAAY,MAAM,GAAG,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAChD,IAAI,EAAE,WAAW,EACjB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,SAAS,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,KACtC,OAAO,CAAC;AAGb,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA8E1C,CAAC;AAEF,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,cAAc,CAAC,MAAM,CAAC,GAClC,IAAI,CAQN"}
|
||||
89
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/pseudos.js
generated
vendored
Executable file
89
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/pseudos.js
generated
vendored
Executable file
@@ -0,0 +1,89 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.verifyPseudoArgs = exports.pseudos = void 0;
|
||||
// While filters are precompiled, pseudos get called when they are needed
|
||||
exports.pseudos = {
|
||||
empty: function (elem, _a) {
|
||||
var adapter = _a.adapter;
|
||||
return !adapter.getChildren(elem).some(function (elem) {
|
||||
// FIXME: `getText` call is potentially expensive.
|
||||
return adapter.isTag(elem) || adapter.getText(elem) !== "";
|
||||
});
|
||||
},
|
||||
"first-child": function (elem, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var firstChild = adapter
|
||||
.getSiblings(elem)
|
||||
.find(function (elem) { return adapter.isTag(elem); });
|
||||
return firstChild != null && equals(elem, firstChild);
|
||||
},
|
||||
"last-child": function (elem, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
for (var i = siblings.length - 1; i >= 0; i--) {
|
||||
if (equals(elem, siblings[i]))
|
||||
return true;
|
||||
if (adapter.isTag(siblings[i]))
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
"first-of-type": function (elem, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
var elemName = adapter.getName(elem);
|
||||
for (var i = 0; i < siblings.length; i++) {
|
||||
var currentSibling = siblings[i];
|
||||
if (equals(elem, currentSibling))
|
||||
return true;
|
||||
if (adapter.isTag(currentSibling) &&
|
||||
adapter.getName(currentSibling) === elemName) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
"last-of-type": function (elem, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
var elemName = adapter.getName(elem);
|
||||
for (var i = siblings.length - 1; i >= 0; i--) {
|
||||
var currentSibling = siblings[i];
|
||||
if (equals(elem, currentSibling))
|
||||
return true;
|
||||
if (adapter.isTag(currentSibling) &&
|
||||
adapter.getName(currentSibling) === elemName) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
"only-of-type": function (elem, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
var elemName = adapter.getName(elem);
|
||||
return adapter
|
||||
.getSiblings(elem)
|
||||
.every(function (sibling) {
|
||||
return equals(elem, sibling) ||
|
||||
!adapter.isTag(sibling) ||
|
||||
adapter.getName(sibling) !== elemName;
|
||||
});
|
||||
},
|
||||
"only-child": function (elem, _a) {
|
||||
var adapter = _a.adapter, equals = _a.equals;
|
||||
return adapter
|
||||
.getSiblings(elem)
|
||||
.every(function (sibling) { return equals(elem, sibling) || !adapter.isTag(sibling); });
|
||||
},
|
||||
};
|
||||
function verifyPseudoArgs(func, name, subselect) {
|
||||
if (subselect === null) {
|
||||
if (func.length > 2) {
|
||||
throw new Error("pseudo-selector :".concat(name, " requires an argument"));
|
||||
}
|
||||
}
|
||||
else if (func.length === 2) {
|
||||
throw new Error("pseudo-selector :".concat(name, " doesn't have any arguments"));
|
||||
}
|
||||
}
|
||||
exports.verifyPseudoArgs = verifyPseudoArgs;
|
||||
10
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/subselects.d.ts
generated
vendored
Executable file
10
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/subselects.d.ts
generated
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
import { CompileToken } from "./../types";
|
||||
import type { Selector } from "css-what";
|
||||
import type { CompiledQuery, InternalOptions, Adapter } from "../types";
|
||||
/** Used as a placeholder for :has. Will be replaced with the actual element. */
|
||||
export declare const PLACEHOLDER_ELEMENT: {};
|
||||
export declare function ensureIsTag<Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, adapter: Adapter<Node, ElementNode>): CompiledQuery<Node>;
|
||||
export declare type Subselect = <Node, ElementNode extends Node>(next: CompiledQuery<ElementNode>, subselect: Selector[][], options: InternalOptions<Node, ElementNode>, context: Node[] | undefined, compileToken: CompileToken<Node, ElementNode>) => CompiledQuery<ElementNode>;
|
||||
export declare function getNextSiblings<Node, ElementNode extends Node>(elem: Node, adapter: Adapter<Node, ElementNode>): ElementNode[];
|
||||
export declare const subselects: Record<string, Subselect>;
|
||||
//# sourceMappingURL=subselects.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/subselects.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/subselects.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"subselects.d.ts","sourceRoot":"","sources":["../../src/pseudo-selectors/subselects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGxE,gFAAgF;AAChF,eAAO,MAAM,mBAAmB,IAAK,CAAC;AAEtC,wBAAgB,WAAW,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACtD,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACpC,aAAa,CAAC,IAAI,CAAC,CAGrB;AAED,oBAAY,SAAS,GAAG,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EACnD,IAAI,EAAE,aAAa,CAAC,WAAW,CAAC,EAChC,SAAS,EAAE,QAAQ,EAAE,EAAE,EACvB,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,EAAE,IAAI,EAAE,GAAG,SAAS,EAC3B,YAAY,EAAE,YAAY,CAAC,IAAI,EAAE,WAAW,CAAC,KAC5C,aAAa,CAAC,WAAW,CAAC,CAAC;AAEhC,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,EAC1D,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,GACpC,WAAW,EAAE,CAMf;AAkBD,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CA6EhD,CAAC"}
|
||||
110
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/subselects.js
generated
vendored
Executable file
110
node_modules/laravel-mix/node_modules/css-select/lib/pseudo-selectors/subselects.js
generated
vendored
Executable file
@@ -0,0 +1,110 @@
|
||||
"use strict";
|
||||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
||||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
||||
if (ar || !(i in from)) {
|
||||
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
||||
ar[i] = from[i];
|
||||
}
|
||||
}
|
||||
return to.concat(ar || Array.prototype.slice.call(from));
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.subselects = exports.getNextSiblings = exports.ensureIsTag = exports.PLACEHOLDER_ELEMENT = void 0;
|
||||
var boolbase_1 = require("boolbase");
|
||||
var procedure_1 = require("../procedure");
|
||||
/** Used as a placeholder for :has. Will be replaced with the actual element. */
|
||||
exports.PLACEHOLDER_ELEMENT = {};
|
||||
function ensureIsTag(next, adapter) {
|
||||
if (next === boolbase_1.falseFunc)
|
||||
return boolbase_1.falseFunc;
|
||||
return function (elem) { return adapter.isTag(elem) && next(elem); };
|
||||
}
|
||||
exports.ensureIsTag = ensureIsTag;
|
||||
function getNextSiblings(elem, adapter) {
|
||||
var siblings = adapter.getSiblings(elem);
|
||||
if (siblings.length <= 1)
|
||||
return [];
|
||||
var elemIndex = siblings.indexOf(elem);
|
||||
if (elemIndex < 0 || elemIndex === siblings.length - 1)
|
||||
return [];
|
||||
return siblings.slice(elemIndex + 1).filter(adapter.isTag);
|
||||
}
|
||||
exports.getNextSiblings = getNextSiblings;
|
||||
var is = function (next, token, options, context, compileToken) {
|
||||
var opts = {
|
||||
xmlMode: !!options.xmlMode,
|
||||
adapter: options.adapter,
|
||||
equals: options.equals,
|
||||
};
|
||||
var func = compileToken(token, opts, context);
|
||||
return function (elem) { return func(elem) && next(elem); };
|
||||
};
|
||||
/*
|
||||
* :not, :has, :is, :matches and :where have to compile selectors
|
||||
* doing this in src/pseudos.ts would lead to circular dependencies,
|
||||
* so we add them here
|
||||
*/
|
||||
exports.subselects = {
|
||||
is: is,
|
||||
/**
|
||||
* `:matches` and `:where` are aliases for `:is`.
|
||||
*/
|
||||
matches: is,
|
||||
where: is,
|
||||
not: function (next, token, options, context, compileToken) {
|
||||
var opts = {
|
||||
xmlMode: !!options.xmlMode,
|
||||
adapter: options.adapter,
|
||||
equals: options.equals,
|
||||
};
|
||||
var func = compileToken(token, opts, context);
|
||||
if (func === boolbase_1.falseFunc)
|
||||
return next;
|
||||
if (func === boolbase_1.trueFunc)
|
||||
return boolbase_1.falseFunc;
|
||||
return function not(elem) {
|
||||
return !func(elem) && next(elem);
|
||||
};
|
||||
},
|
||||
has: function (next, subselect, options, _context, compileToken) {
|
||||
var adapter = options.adapter;
|
||||
var opts = {
|
||||
xmlMode: !!options.xmlMode,
|
||||
adapter: adapter,
|
||||
equals: options.equals,
|
||||
};
|
||||
// @ts-expect-error Uses an array as a pointer to the current element (side effects)
|
||||
var context = subselect.some(function (s) {
|
||||
return s.some(procedure_1.isTraversal);
|
||||
})
|
||||
? [exports.PLACEHOLDER_ELEMENT]
|
||||
: undefined;
|
||||
var compiled = compileToken(subselect, opts, context);
|
||||
if (compiled === boolbase_1.falseFunc)
|
||||
return boolbase_1.falseFunc;
|
||||
if (compiled === boolbase_1.trueFunc) {
|
||||
return function (elem) {
|
||||
return adapter.getChildren(elem).some(adapter.isTag) && next(elem);
|
||||
};
|
||||
}
|
||||
var hasElement = ensureIsTag(compiled, adapter);
|
||||
var _a = compiled.shouldTestNextSiblings, shouldTestNextSiblings = _a === void 0 ? false : _a;
|
||||
/*
|
||||
* `shouldTestNextSiblings` will only be true if the query starts with
|
||||
* a traversal (sibling or adjacent). That means we will always have a context.
|
||||
*/
|
||||
if (context) {
|
||||
return function (elem) {
|
||||
context[0] = elem;
|
||||
var childs = adapter.getChildren(elem);
|
||||
var nextElements = shouldTestNextSiblings
|
||||
? __spreadArray(__spreadArray([], childs, true), getNextSiblings(elem, adapter), true) : childs;
|
||||
return (next(elem) && adapter.existsOne(hasElement, nextElements));
|
||||
};
|
||||
}
|
||||
return function (elem) {
|
||||
return next(elem) &&
|
||||
adapter.existsOne(hasElement, adapter.getChildren(elem));
|
||||
};
|
||||
},
|
||||
};
|
||||
10
node_modules/laravel-mix/node_modules/css-select/lib/sort.d.ts
generated
vendored
Executable file
10
node_modules/laravel-mix/node_modules/css-select/lib/sort.d.ts
generated
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
import type { InternalSelector } from "./types";
|
||||
/**
|
||||
* Sort the parts of the passed selector,
|
||||
* as there is potential for optimization
|
||||
* (some types of selectors are faster than others)
|
||||
*
|
||||
* @param arr Selector to sort
|
||||
*/
|
||||
export default function sortByProcedure(arr: InternalSelector[]): void;
|
||||
//# sourceMappingURL=sort.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/sort.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/sort.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"sort.d.ts","sourceRoot":"","sources":["../src/sort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAehD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,GAAG,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAerE"}
|
||||
85
node_modules/laravel-mix/node_modules/css-select/lib/sort.js
generated
vendored
Executable file
85
node_modules/laravel-mix/node_modules/css-select/lib/sort.js
generated
vendored
Executable file
@@ -0,0 +1,85 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var css_what_1 = require("css-what");
|
||||
var procedure_1 = require("./procedure");
|
||||
var attributes = {
|
||||
exists: 10,
|
||||
equals: 8,
|
||||
not: 7,
|
||||
start: 6,
|
||||
end: 6,
|
||||
any: 5,
|
||||
hyphen: 4,
|
||||
element: 4,
|
||||
};
|
||||
/**
|
||||
* Sort the parts of the passed selector,
|
||||
* as there is potential for optimization
|
||||
* (some types of selectors are faster than others)
|
||||
*
|
||||
* @param arr Selector to sort
|
||||
*/
|
||||
function sortByProcedure(arr) {
|
||||
var procs = arr.map(getProcedure);
|
||||
for (var i = 1; i < arr.length; i++) {
|
||||
var procNew = procs[i];
|
||||
if (procNew < 0)
|
||||
continue;
|
||||
for (var j = i - 1; j >= 0 && procNew < procs[j]; j--) {
|
||||
var token = arr[j + 1];
|
||||
arr[j + 1] = arr[j];
|
||||
arr[j] = token;
|
||||
procs[j + 1] = procs[j];
|
||||
procs[j] = procNew;
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.default = sortByProcedure;
|
||||
function getProcedure(token) {
|
||||
var proc = procedure_1.procedure[token.type];
|
||||
if (token.type === css_what_1.SelectorType.Attribute) {
|
||||
proc = attributes[token.action];
|
||||
if (proc === attributes.equals && token.name === "id") {
|
||||
// Prefer ID selectors (eg. #ID)
|
||||
proc = 9;
|
||||
}
|
||||
if (token.ignoreCase) {
|
||||
/*
|
||||
* IgnoreCase adds some overhead, prefer "normal" token
|
||||
* this is a binary operation, to ensure it's still an int
|
||||
*/
|
||||
proc >>= 1;
|
||||
}
|
||||
}
|
||||
else if (token.type === css_what_1.SelectorType.Pseudo) {
|
||||
if (!token.data) {
|
||||
proc = 3;
|
||||
}
|
||||
else if (token.name === "has" || token.name === "contains") {
|
||||
proc = 0; // Expensive in any case
|
||||
}
|
||||
else if (Array.isArray(token.data)) {
|
||||
// "matches" and "not"
|
||||
proc = 0;
|
||||
for (var i = 0; i < token.data.length; i++) {
|
||||
// TODO better handling of complex selectors
|
||||
if (token.data[i].length !== 1)
|
||||
continue;
|
||||
var cur = getProcedure(token.data[i][0]);
|
||||
// Avoid executing :has or :contains
|
||||
if (cur === 0) {
|
||||
proc = 0;
|
||||
break;
|
||||
}
|
||||
if (cur > proc)
|
||||
proc = cur;
|
||||
}
|
||||
if (token.data.length > 1 && proc > 0)
|
||||
proc -= 1;
|
||||
}
|
||||
else {
|
||||
proc = 1;
|
||||
}
|
||||
}
|
||||
return proc;
|
||||
}
|
||||
144
node_modules/laravel-mix/node_modules/css-select/lib/types.d.ts
generated
vendored
Executable file
144
node_modules/laravel-mix/node_modules/css-select/lib/types.d.ts
generated
vendored
Executable file
@@ -0,0 +1,144 @@
|
||||
import type { Selector } from "css-what";
|
||||
export declare type InternalSelector = Selector | {
|
||||
type: "_flexibleDescendant";
|
||||
};
|
||||
export declare type Predicate<Value> = (v: Value) => boolean;
|
||||
export interface Adapter<Node, ElementNode extends Node> {
|
||||
/**
|
||||
* Is the node a tag?
|
||||
*/
|
||||
isTag: (node: Node) => node is ElementNode;
|
||||
/**
|
||||
* Does at least one of passed element nodes pass the test predicate?
|
||||
*/
|
||||
existsOne: (test: Predicate<ElementNode>, elems: Node[]) => boolean;
|
||||
/**
|
||||
* Get the attribute value.
|
||||
*/
|
||||
getAttributeValue: (elem: ElementNode, name: string) => string | undefined;
|
||||
/**
|
||||
* Get the node's children
|
||||
*/
|
||||
getChildren: (node: Node) => Node[];
|
||||
/**
|
||||
* Get the name of the tag
|
||||
*/
|
||||
getName: (elem: ElementNode) => string;
|
||||
/**
|
||||
* Get the parent of the node
|
||||
*/
|
||||
getParent: (node: ElementNode) => ElementNode | null;
|
||||
/**
|
||||
* Get the siblings of the node. Note that unlike jQuery's `siblings` method,
|
||||
* this is expected to include the current node as well
|
||||
*/
|
||||
getSiblings: (node: Node) => Node[];
|
||||
/**
|
||||
* Returns the previous element sibling of a node.
|
||||
*/
|
||||
prevElementSibling?: (node: Node) => ElementNode | null;
|
||||
/**
|
||||
* Get the text content of the node, and its children if it has any.
|
||||
*/
|
||||
getText: (node: Node) => string;
|
||||
/**
|
||||
* Does the element have the named attribute?
|
||||
*/
|
||||
hasAttrib: (elem: ElementNode, name: string) => boolean;
|
||||
/**
|
||||
* Takes an array of nodes, and removes any duplicates, as well as any
|
||||
* nodes whose ancestors are also in the array.
|
||||
*/
|
||||
removeSubsets: (nodes: Node[]) => Node[];
|
||||
/**
|
||||
* Finds all of the element nodes in the array that match the test predicate,
|
||||
* as well as any of their children that match it.
|
||||
*/
|
||||
findAll: (test: Predicate<ElementNode>, nodes: Node[]) => ElementNode[];
|
||||
/**
|
||||
* Finds the first node in the array that matches the test predicate, or one
|
||||
* of its children.
|
||||
*/
|
||||
findOne: (test: Predicate<ElementNode>, elems: Node[]) => ElementNode | null;
|
||||
/**
|
||||
* The adapter can also optionally include an equals method, if your DOM
|
||||
* structure needs a custom equality test to compare two objects which refer
|
||||
* to the same underlying node. If not provided, `css-select` will fall back to
|
||||
* `a === b`.
|
||||
*/
|
||||
equals?: (a: Node, b: Node) => boolean;
|
||||
/**
|
||||
* Is the element in hovered state?
|
||||
*/
|
||||
isHovered?: (elem: ElementNode) => boolean;
|
||||
/**
|
||||
* Is the element in visited state?
|
||||
*/
|
||||
isVisited?: (elem: ElementNode) => boolean;
|
||||
/**
|
||||
* Is the element in active state?
|
||||
*/
|
||||
isActive?: (elem: ElementNode) => boolean;
|
||||
}
|
||||
export interface Options<Node, ElementNode extends Node> {
|
||||
/**
|
||||
* When enabled, tag names will be case-sensitive.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
xmlMode?: boolean;
|
||||
/**
|
||||
* Lower-case attribute names.
|
||||
*
|
||||
* @default !xmlMode
|
||||
*/
|
||||
lowerCaseAttributeNames?: boolean;
|
||||
/**
|
||||
* Lower-case tag names.
|
||||
*
|
||||
* @default !xmlMode
|
||||
*/
|
||||
lowerCaseTags?: boolean;
|
||||
/**
|
||||
* Is the document in quirks mode?
|
||||
*
|
||||
* This will lead to .className and #id being case-insensitive.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
quirksMode?: boolean;
|
||||
/**
|
||||
* The last function in the stack, will be called with the last element
|
||||
* that's looked at.
|
||||
*/
|
||||
rootFunc?: (element: ElementNode) => boolean;
|
||||
/**
|
||||
* The adapter to use when interacting with the backing DOM structure. By
|
||||
* default it uses the `domutils` module.
|
||||
*/
|
||||
adapter?: Adapter<Node, ElementNode>;
|
||||
/**
|
||||
* The context of the current query. Used to limit the scope of searches.
|
||||
* Can be matched directly using the `:scope` pseudo-selector.
|
||||
*/
|
||||
context?: Node | Node[];
|
||||
/**
|
||||
* Allow css-select to cache results for some selectors, sometimes greatly
|
||||
* improving querying performance. Disable this if your document can
|
||||
* change in between queries with the same compiled selector.
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
cacheResults?: boolean;
|
||||
}
|
||||
export interface InternalOptions<Node, ElementNode extends Node> extends Options<Node, ElementNode> {
|
||||
adapter: Adapter<Node, ElementNode>;
|
||||
equals: (a: Node, b: Node) => boolean;
|
||||
}
|
||||
export interface CompiledQuery<ElementNode> {
|
||||
(node: ElementNode): boolean;
|
||||
shouldTestNextSiblings?: boolean;
|
||||
}
|
||||
export declare type Query<ElementNode> = string | CompiledQuery<ElementNode> | Selector[][];
|
||||
export declare type CompileToken<Node, ElementNode extends Node> = (token: InternalSelector[][], options: InternalOptions<Node, ElementNode>, context?: Node[] | Node) => CompiledQuery<ElementNode>;
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
1
node_modules/laravel-mix/node_modules/css-select/lib/types.d.ts.map
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-select/lib/types.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,oBAAY,gBAAgB,GAAG,QAAQ,GAAG;IAAE,IAAI,EAAE,qBAAqB,CAAA;CAAE,CAAC;AAE1E,oBAAY,SAAS,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,CAAC;AACrD,MAAM,WAAW,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI;IACnD;;OAEG;IACH,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,IAAI,WAAW,CAAC;IAE3C;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,OAAO,CAAC;IAEpE;;OAEG;IACH,iBAAiB,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IAE3E;;OAEG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,CAAC;IAEpC;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,MAAM,CAAC;IAEvC;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,WAAW,GAAG,IAAI,CAAC;IAErD;;;OAGG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,EAAE,CAAC;IAEpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,WAAW,GAAG,IAAI,CAAC;IAExD;;OAEG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAC;IAEhC;;OAEG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IAExD;;;OAGG;IACH,aAAa,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC;IAEzC;;;OAGG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,WAAW,EAAE,CAAC;IAExE;;;OAGG;IACH,OAAO,EAAE,CACL,IAAI,EAAE,SAAS,CAAC,WAAW,CAAC,EAC5B,KAAK,EAAE,IAAI,EAAE,KACZ,WAAW,GAAG,IAAI,CAAC;IAExB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC;IAEvC;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC;IAE3C;;OAEG;IACH,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC;IAE3C;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC;CAC7C;AAED,MAAM,WAAW,OAAO,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI;IACnD;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,OAAO,CAAC;IAC7C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC;IACxB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CAC1B;AAGD,MAAM,WAAW,eAAe,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,CAC3D,SAAQ,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IACpC,MAAM,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC;CACzC;AAED,MAAM,WAAW,aAAa,CAAC,WAAW;IACtC,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC;IAC7B,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC;AACD,oBAAY,KAAK,CAAC,WAAW,IACvB,MAAM,GACN,aAAa,CAAC,WAAW,CAAC,GAC1B,QAAQ,EAAE,EAAE,CAAC;AACnB,oBAAY,YAAY,CAAC,IAAI,EAAE,WAAW,SAAS,IAAI,IAAI,CACvD,KAAK,EAAE,gBAAgB,EAAE,EAAE,EAC3B,OAAO,EAAE,eAAe,CAAC,IAAI,EAAE,WAAW,CAAC,EAC3C,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI,KACtB,aAAa,CAAC,WAAW,CAAC,CAAC"}
|
||||
2
node_modules/laravel-mix/node_modules/css-select/lib/types.js
generated
vendored
Executable file
2
node_modules/laravel-mix/node_modules/css-select/lib/types.js
generated
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
70
node_modules/laravel-mix/node_modules/css-select/package.json
generated
vendored
Executable file
70
node_modules/laravel-mix/node_modules/css-select/package.json
generated
vendored
Executable file
@@ -0,0 +1,70 @@
|
||||
{
|
||||
"name": "css-select",
|
||||
"version": "4.3.0",
|
||||
"description": "a CSS selector compiler/engine",
|
||||
"author": "Felix Boehm <me@feedic.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/fb55"
|
||||
},
|
||||
"keywords": [
|
||||
"css",
|
||||
"selector",
|
||||
"sizzle"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/fb55/css-select.git"
|
||||
},
|
||||
"main": "lib/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"dependencies": {
|
||||
"boolbase": "^1.0.0",
|
||||
"css-what": "^6.0.1",
|
||||
"domhandler": "^4.3.1",
|
||||
"domutils": "^2.8.0",
|
||||
"nth-check": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/boolbase": "^1.0.1",
|
||||
"@types/jest": "^27.4.1",
|
||||
"@types/node": "^17.0.23",
|
||||
"@typescript-eslint/eslint-plugin": "^5.16.0",
|
||||
"@typescript-eslint/parser": "^5.16.0",
|
||||
"cheerio-soupselect": "^0.1.1",
|
||||
"eslint": "^8.12.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"htmlparser2": "^7.2.0",
|
||||
"jest": "^27.5.1",
|
||||
"prettier": "^2.6.1",
|
||||
"ts-jest": "^27.1.4",
|
||||
"typescript": "^4.6.3"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "npm run test:jest && npm run lint",
|
||||
"test:jest": "jest",
|
||||
"lint": "npm run lint:es && npm run lint:prettier",
|
||||
"lint:es": "eslint src",
|
||||
"lint:prettier": "npm run prettier -- --check",
|
||||
"format": "npm run format:es && npm run format:prettier",
|
||||
"format:es": "npm run lint:es -- --fix",
|
||||
"format:prettier": "npm run prettier -- --write",
|
||||
"prettier": "prettier '**/*.{ts,md,json,yml}'",
|
||||
"build": "tsc",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
"license": "BSD-2-Clause",
|
||||
"prettier": {
|
||||
"tabWidth": 4,
|
||||
"proseWrap": "always"
|
||||
},
|
||||
"jest": {
|
||||
"preset": "ts-jest",
|
||||
"testEnvironment": "node",
|
||||
"testMatch": [
|
||||
"<rootDir>/test/*.ts"
|
||||
]
|
||||
}
|
||||
}
|
||||
590
node_modules/laravel-mix/node_modules/css-tree/CHANGELOG.md
generated
vendored
Executable file
590
node_modules/laravel-mix/node_modules/css-tree/CHANGELOG.md
generated
vendored
Executable file
@@ -0,0 +1,590 @@
|
||||
## 1.1.3 (March 31, 2021)
|
||||
|
||||
- Fixed matching on CSS wide keywords for at-rule's prelude and descriptors
|
||||
- Added `fit-content` to `width` property patch as browsers are supported it as a keyword (nonstandard), but spec defines it as a function
|
||||
- Fixed parsing a value contains parentheses or brackets and `parseValue` option is set to `false`, in that case `!important` was included into a value but must not (#155)
|
||||
|
||||
## 1.1.2 (November 26, 2020)
|
||||
|
||||
- Rolled back to use spread syntax in object literals since it not supported by nodejs < 8.3 (#145)
|
||||
|
||||
## 1.1.1 (November 18, 2020)
|
||||
|
||||
- Fixed edge cases in mismatch location computation for `SyntaxMatchError`
|
||||
|
||||
## 1.1.0 (November 17, 2020)
|
||||
|
||||
- Bumped `mdn-data` to 2.0.14
|
||||
- Extended `fork()` method to allow append syntax instead of overriding for `types`, `properties` and `atrules`, e.g. `csstree.fork({ types: { color: '| foo | bar' } })`
|
||||
- Extended lexer API for validation
|
||||
- Added `Lexer#checkAtruleName(atruleName)`, `Lexer#checkAtrulePrelude(atruleName, prelude)`, `Lexer#checkAtruleDescriptorName(atruleName, descriptorName)` and `Lexer#checkPropertyName(propertyName)`
|
||||
- Added `Lexer#getAtrule(atruleName, fallbackBasename)` method
|
||||
- Extended `Lexer#getAtrulePrelude()` and `Lexer#getProperty()` methods to take `fallbackBasename` parameter
|
||||
- Improved `SyntaxMatchError` location details
|
||||
- Changed error messages
|
||||
|
||||
## 1.0.1 (November 11, 2020)
|
||||
|
||||
- Fixed edge cases for parsing of custom property value with a single whitespace when `parseCustomProperty:true`
|
||||
|
||||
## 1.0.0 (October 27, 2020)
|
||||
|
||||
- Added `onComment` option to parser config
|
||||
- Added support for `break` and `skip` values in `walk()` to control traversal
|
||||
- Added `List#reduce()` and `List#reduceRight()` methods
|
||||
- Bumped `mdn-data` to 2.0.12
|
||||
- Exposed version of the lib (i.e. `import { version } from 'css-tree'`)
|
||||
- Fixed `Lexer#dump()` to dump atrules syntaxes as well
|
||||
- Fixed matching comma separated `<urange>` list (#135)
|
||||
- Renamed `HexColor` node type into `Hash`
|
||||
- Removed `element()` specific parsing rules
|
||||
- Removed `dist/default-syntax.json` from package
|
||||
|
||||
## 1.0.0-alpha.39 (December 5, 2019)
|
||||
|
||||
- Fixed walker with `visit: "Declaration"` to iterate `DeclarationList` (#114)
|
||||
|
||||
## 1.0.0-alpha.38 (November 25, 2019)
|
||||
|
||||
- Bumped `mdn-data` to `2.0.6`
|
||||
- Added initial implmentation for at-rule matching via `Lexer#matchAtrulePrelude()` and `Lexer#matchAtruleDescriptor()` methods
|
||||
- Added `-moz-control-character-visibility`, `-ms-grid-columns`, `-ms-grid-rows` and `-ms-hyphenate-limit-last` properties to patch (#111)
|
||||
- Added `flow`, `flow-root` and `table-caption` values to patched `display` (#112)
|
||||
|
||||
## 1.0.0-alpha.37 (October 22, 2019)
|
||||
|
||||
- Bumped `source-map` version to `^0.6.1` to fix source map generation inconsistency across node.js versions due to mappings sorting bug and v8 moving to [a stable Array#sort](https://v8.dev/blog/array-sort) ([fix commit](https://github.com/mozilla/source-map/commit/f35a2e4212dd025cb5e1fc219e7ac8a4b96c2cc9) in `source-map`)
|
||||
|
||||
## 1.0.0-alpha.36 (October 13, 2019)
|
||||
|
||||
- Dropped support for Node < 8
|
||||
- Updated dev deps (fixed `npm audit` issues)
|
||||
- Reworked build pipeline
|
||||
- Package provides `dist/csstree.js` and `dist/csstree.min.js` now (instead of single `dist/csstree.js` that was a min version)
|
||||
- Bundle size (min version) reduced from 191Kb to 158Kb due to some optimisations
|
||||
- Definition syntax
|
||||
- Renamed `grammar` into `definitionSyntax` (named per spec)
|
||||
- Added `compact` option to `generate()` method to avoid formatting (spaces) when possible
|
||||
- Lexer
|
||||
- Changed `dump()` method to produce syntaxes in compact form by default
|
||||
|
||||
## 1.0.0-alpha.35 (October 7, 2019)
|
||||
|
||||
- Walker
|
||||
- Changed implementation to avoid runtime compilation due to CSP issues (see #91, #109)
|
||||
- Added `find()`, `findLast()` and `findAll()` methods (e.g. `csstree.find(ast, node => node.type === 'ClassSelector')`)
|
||||
|
||||
## 1.0.0-alpha.34 (July 27, 2019)
|
||||
|
||||
- Tokenizer
|
||||
- Added `isBOM()` function
|
||||
- Added `charCodeCategory()` function
|
||||
- Removed `firstCharOffset()` function (use `isBOM()` instead)
|
||||
- Removed `CHARCODE` dictionary
|
||||
- Removed `INPUT_STREAM_CODE*` dictionaries
|
||||
- Lexer
|
||||
- Allowed comments in matching value (just ignore them like whitespaces)
|
||||
- Increased iteration count in value matching from 10k up to 15k
|
||||
- Fixed missed `debugger` (#104)
|
||||
|
||||
## 1.0.0-alpha.33 (July 11, 2019)
|
||||
|
||||
- Lexer
|
||||
- Fixed low priority productions matching by changing an approach for robust one (#103)
|
||||
|
||||
## 1.0.0-alpha.32 (July 11, 2019)
|
||||
|
||||
- Lexer
|
||||
- Fixed low priority productions matching in long `||-` and `&&-` groups (#103)
|
||||
|
||||
## 1.0.0-alpha.31 (July 11, 2019)
|
||||
|
||||
- Bumped `mdn/data` to `2.0.4` (#99)
|
||||
- Lexer
|
||||
- Added [bracketed range notation](https://drafts.csswg.org/css-values-4/#numeric-ranges) support and related refactoring
|
||||
- Removed `<number-zero-one>`, `<number-one-or-greater>` and `<positive-integer>` from generic types. In fact, types moved to patch, because those types can be expressed in a regular grammar due to bracketed range notation implemented
|
||||
- Added support for multiple token string matching
|
||||
- Improved `<custom-ident>` production matching to claim the keyword only if no other unfulfilled production can claim it (#101)
|
||||
- Improved `<length>` production matching to claim "unitless zero" only if no other unfulfilled production can claim it
|
||||
- Changed lexer's constructor to prevent generic types override when used
|
||||
- Fixed large `||`- and `&&`-group matching, matching continues from the beginning on term match (#85)
|
||||
- Fixed checking that value has `var()` occurrences when value is a string (such values can't be matched on syntax currently and fail with specific error that can be used for ignorance in validation tools)
|
||||
- Fixed `<declaration-value>` and `<any-value>` matching when a value contains a function, parentheses or braces
|
||||
|
||||
## 1.0.0-alpha.30 (July 3, 2019)
|
||||
|
||||
- Bumped `mdn/data` to `~2.0.3`
|
||||
- Removed type removals from `mdn/data` due to lack of some generic types and specific lexer restictions (since lexer was reworked, see below)
|
||||
- Reduced and updated patches
|
||||
- Tokenizer
|
||||
- Reworked tokenizer itself to compliment [CSS Syntax Module Level 3](https://drafts.csswg.org/css-syntax/#tokenization)
|
||||
- `Tokenizer` class splitted into several abstractions:
|
||||
- Added `TokenStream` class
|
||||
- Added `OffsetToLocation` class
|
||||
- Added `tokenize()` function that creates `TokenStream` instance for given string or updates a `TokenStream` instance passed as second parameter
|
||||
- Removed `Tokenizer` class
|
||||
- Removed `Raw` token type
|
||||
- Renamed `Identifier` token type to `Ident`
|
||||
- Added token types: `Hash`, `BadString`, `BadUrl`, `Delim`, `Percentage`, `Dimension`, `Colon`, `Semicolon`, `Comma`, `LeftSquareBracket`, `RightSquareBracket`, `LeftParenthesis`, `RightParenthesis`, `LeftCurlyBracket`, `RightCurlyBracket`
|
||||
- Replaced `Punctuator` with `Delim` token type, that excludes specific characters with its own token type like `Colon`, `Semicolon` etc
|
||||
- Removed `findCommentEnd`, `findStringEnd`, `findDecimalNumberEnd`, `findNumberEnd`, `findEscapeEnd`, `findIdentifierEnd` and `findUrlRawEnd` helper function
|
||||
- Removed `SYMBOL_TYPE`, `PUNCTUATION` and `STOP_URL_RAW` dictionaries
|
||||
- Added `isDigit`, `isHexDigit`, `isUppercaseLetter`, `isLowercaseLetter`, `isLetter`, `isNonAscii`, `isNameStart`, `isName`, `isNonPrintable`, `isNewline`, `isWhiteSpace`, `isValidEscape`, `isIdentifierStart`, `isNumberStart`, `consumeEscaped`, `consumeName`, `consumeNumber` and `consumeBadUrlRemnants` helper functions
|
||||
- Parser
|
||||
- Changed parsing algorithms to work with new token type set
|
||||
- Changed `HexColor` consumption in way to relax checking a value, i.e. now `value` is a sequence of one or more name chars
|
||||
- Added `&` as a property hack
|
||||
- Relaxed `var()` parsing to only check that a first arguments is an identifier (not a custom property name as before)
|
||||
- Lexer
|
||||
- Reworked syntax matching to relay on token set only (having AST is optional now)
|
||||
- Extended `Lexer#match()`, `Lexer#matchType()` and `Lexer#matchProperty()` methods to take a string as value, beside AST as a value
|
||||
- Extended `Lexer#match()` method to take a string as a syntax, beside of syntax descriptor
|
||||
- Reworked generic types:
|
||||
- Removed `<attr()>`, `<url>` (moved to patch) and `<progid>` types
|
||||
- Added types:
|
||||
- Related to token types: `<ident-token>`, `<function-token>`, `<at-keyword-token>`, `<hash-token>`, `<string-token>`, `<bad-string-token>`, `<url-token>`, `<bad-url-token>`, `<delim-token>`, `<number-token>`, `<percentage-token>`, `<dimension-token>`, `<whitespace-token>`, `<CDO-token>`, `<CDC-token>`, `<colon-token>`, `<semicolon-token>`, `<comma-token>`, `<[-token>`, `<]-token>`, `<(-token>`, `<)-token>`, `<{-token>` and `<}-token>`
|
||||
- Complex types: `<an-plus-b>`, `<urange>`, `<custom-property-name>`, `<declaration-value>`, `<any-value>` and `<zero>`
|
||||
- Renamed `<unicode-range>` to `<urange>` as per spec
|
||||
- Renamed `<expression>` (IE legacy extension) to `<-ms-legacy-expression>` and may to be removed in next releases
|
||||
|
||||
## 1.0.0-alpha.29 (May 30, 2018)
|
||||
|
||||
- Lexer
|
||||
- Syntax matching was completely reworked. Now it's token-based and uses state machine. Public API has not changed. However, some internal data structures have changed. Most significal change in syntax match result tree structure, it's became token-based instead of node-based.
|
||||
- Grammar
|
||||
- Changed grammar tree format:
|
||||
- Added `Token` node type to represent a single code point (`<delim-token>`)
|
||||
- Added `Multiplier` that wraps a single node (`term` property)
|
||||
- Added `AtKeyword` to represent `<at-keyword-token>`
|
||||
- Removed `Slash` and `Percent` node types, they are replaced for a node with `Token` type
|
||||
- Changed `Function` to represent `<function-token>` with no children
|
||||
- Removed `multiplier` property from `Group`
|
||||
- Changed `generate()` method:
|
||||
- Method takes an `options` as second argument now (`generate(node, forceBraces, decorator)` -> `generate(node, options)`). Two options are supported: `forceBraces` and `decorator`
|
||||
- When a second parameter is a function it treats as `decorate` option value, i.e. `generate(node, fn)` -> `generate(node, { decorate: fn })`
|
||||
- Decorate function invokes with additional parameter – a reference to a node
|
||||
- Tokenizer
|
||||
- Renamed `Atrule` const to `AtKeyword`
|
||||
|
||||
## 1.0.0-alpha.28 (February 19, 2018)
|
||||
|
||||
- Renamed `lexer.grammar.translate()` method into `generate()`
|
||||
- Fixed `<'-webkit-font-smoothing'>` and `<'-moz-osx-font-smoothing'>` syntaxes (#75)
|
||||
- Added vendor keywords for `<'overflow'>` property syntax (#76)
|
||||
- Pinned `mdn-data` to `~1.1.0` and fixed issues with some updated property syntaxes
|
||||
|
||||
## 1.0.0-alpha.27 (January 14, 2018)
|
||||
|
||||
- Generator
|
||||
- Changed node's `generate()` methods invocation, methods now take a node as a single argument and context (i.e. `this`) that have methods: `chunk()`, `node()` and `children()`
|
||||
- Renamed `translate()` to `generate()` and changed to take `options` argument
|
||||
- Removed `translateMarkup(ast, enter, leave)` method, use `generate(ast, { decorator: (handlers) => { ... }})` instead
|
||||
- Removed `translateWithSourceMap(ast)`, use `generate(ast, { sourceMap: true })` instead
|
||||
- Changed to support for children as an array
|
||||
- Walker
|
||||
- Changed `walk()` to take an `options` argument instead of handler, with `enter`, `leave`, `visit` and `reverse` options (`walk(ast, fn)` is still works and equivalent to `walk(ast, { enter: fn })`)
|
||||
- Removed `walkUp(ast, fn)`, use `walk(ast, { leave: fn })`
|
||||
- Removed `walkRules(ast, fn)`, use `walk(ast, { visit: 'Rule', enter: fn })` instead
|
||||
- Removed `walkRulesRight(ast, fn)`, use `walk(ast, { visit: 'Rule', reverse: true, enter: fn })` instead
|
||||
- Removed `walkDeclarations(ast, fn)`, use `walk(ast, { visit: 'Declaration', enter: fn })` instead
|
||||
- Changed to support for children as array in most cases (`reverse: true` will fail on arrays since they have no `forEachRight()` method)
|
||||
- Misc
|
||||
- List
|
||||
- Added `List#forEach()` method
|
||||
- Added `List#forEachRight()` method
|
||||
- Added `List#filter()` method
|
||||
- Changed `List#map()` method to return a `List` instance instead of `Array`
|
||||
- Added `List#push()` method, similar to `List#appendData()` but returns nothing
|
||||
- Added `List#pop()` method
|
||||
- Added `List#unshift()` method, similar to `List#prependData()` but returns nothing
|
||||
- Added `List#shift()` method
|
||||
- Added `List#prependList()` method
|
||||
- Changed `List#insert()`, `List#insertData()`, `List#appendList()` and `List#insertList()` methods to return a list that performed an operation
|
||||
- Changed `keyword()` method
|
||||
- Changed `name` field to include a vendor prefix
|
||||
- Added `basename` field to contain a name without a vendor prefix
|
||||
- Added `custom` field that contain a `true` when keyword is a custom property reference
|
||||
- Changed `property()` method
|
||||
- Changed `name` field to include a vendor prefix
|
||||
- Added `basename` field to contain a name without any prefixes, i.e. a hack and a vendor prefix
|
||||
- Added `vendorPrefix()` method
|
||||
- Added `isCustomProperty()` method
|
||||
|
||||
## 1.0.0-alpha.26 (November 9, 2017)
|
||||
|
||||
- Tokenizer
|
||||
- Added `Tokenizer#isBalanceEdge()` method
|
||||
- Removed `Tokenizer.endsWith()` method
|
||||
- Parser
|
||||
- Made the parser tolerant to errors by default
|
||||
- Removed `tolerant` parser option (no parsing modes anymore)
|
||||
- Removed `property` parser option (a value parsing does not depend on property name anymore)
|
||||
- Canceled error for a handing semicolon in a block
|
||||
- Canceled error for unclosed `Brackets`, `Function` and `Parentheses` when EOF is reached
|
||||
- Fixed error when prelude ends with a comment for at-rules with custom prelude consumer
|
||||
- Relaxed at-rule parsing:
|
||||
- Canceled error when EOF is reached after a prelude
|
||||
- Canceled error for an at-rule with custom block consumer when at-rule has no block (just don't apply consumer in that case)
|
||||
- Canceled error on at-rule parsing when it occurs outside prelude or block (at-rule is converting to `Raw` node)
|
||||
- Allowed for any at-rule to have a prelude and a block, even if it's invalid per at-rule syntax (the responsibility for this check is moved to lexer, since it's possible to construct a AST with such errors)
|
||||
- Made a declaration value a safe parsing point (i.e. error on value parsing lead to a value is turning into `Raw` node, not a declaration as before)
|
||||
- Excluded surrounding white spaces and comments from a `Raw` node that represents a declaration value
|
||||
- Changed `Value` parse handler to return a node only with type `Value` (previously it returned a `Raw` node in some cases)
|
||||
- Fixed issue with `onParseError()` is not invoked for errors occured on selector or declaration value parsing in some cases
|
||||
- Changed using of `onParseError()` to stop parsing if handler throws an exception
|
||||
- Lexer
|
||||
- Changed `grammar.walk()` to invoke passed handler on entering to node rather than on leaving the node
|
||||
- Improved `grammar.walk()` to take a walk handler pair as an object, i.e. `walk(node, { enter: fn, leave: fn })`
|
||||
- Changed `Lexer#match*()` methods to take a node of any type, but with a `children` field
|
||||
- Added `Lexer#match(syntax, node)` method
|
||||
- Fixed `Lexer#matchType()` method to stop return a positive result for the CSS wide keywords
|
||||
|
||||
## 1.0.0-alpha25 (October 9, 2017)
|
||||
|
||||
- Parser
|
||||
- Added fallback node as argument to `onParseError()` handler
|
||||
- Fixed raw consuming in tolerant mode when selector is invalid (greedy consuming and redundant warnings)
|
||||
- Fixed exception in tolerant mode caused by unknown at-rule with unclosed block
|
||||
- Changed handling of semicolons:
|
||||
- Hanging semicolon inside declaration blocks raise an error or turns into a `Raw` node in tolerant mode instead of being ignored
|
||||
- Semicolon outside of declaration blocks opens a `Rule` node as part of selector instead of being ignored
|
||||
- Aligned `parseAtrulePrelude` behaviour to `parseRulePrelude`
|
||||
- Removed `Raw` node wraping into `AtrulePrelude` when `parseAtrulePrelude` is disabled
|
||||
- Removed error emitting when at-rule has a custom prelude customer but no prelude is found (it should be validated by a lexer later)
|
||||
- Generator
|
||||
- Fixed performance issue with `translateWithSourceMap()`, flattening the string (because of mixing building string and indexing into it) turned it into a quadratic algorithm (approximate numbers can be found in [the quiz created by this case](https://gist.github.com/lahmatiy/ea25d0e623d88ca9848384b5707d52d9))
|
||||
- Added support for a single solidus hack for `property()`
|
||||
- Minor fixes for custom errors
|
||||
|
||||
## 1.0.0-alpha24 (September 14, 2017)
|
||||
|
||||
- Improved CSSTree to be stable for standart build-in objects extension (#58)
|
||||
- Parser
|
||||
- Renamed rule's `selector` to `prelude`. The reasons: [spec names this part so](https://www.w3.org/TR/css-syntax-3/#qualified-rule), and this branch can contain not only a selector (`SelectorList`) but also a raw payload (`Raw`). What's changed:
|
||||
- Renamed `Rule.selector` to `Rule.prelude`
|
||||
- Renamed `parseSelector` parser option to `parseRulePrelude`
|
||||
- Removed option for selector parse in `SelectorList`
|
||||
- Lexer
|
||||
- Fixed undefined positions in a error when match a syntax to empty or white space only value
|
||||
- Improved `Lexer#checkStructure()`
|
||||
- Return a warning as an object with node reference and message
|
||||
- No exception on unknown node type, return a warning instead
|
||||
|
||||
## 1.0.0-alpha23 (September 10, 2017)
|
||||
|
||||
- Fixed `Tokenizer#getRawLength()`'s false positive balance match to the end of input in some cases (#56)
|
||||
- Rename walker's entry point methods to be the same as CSSTree exposed methods (i.e. `walk()`, `walkUp()` etc)
|
||||
- Rename at-rule's `expression` to `prelude` (since [spec names it so](https://www.w3.org/TR/css-syntax-3/#at-rule))
|
||||
- `AtruleExpression` node type → `AtrulePrelude`
|
||||
- `Atrule.expression` field → `Atrule.prelude`
|
||||
- `parseAtruleExpression` parser's option → `parseAtrulePrelude`
|
||||
- `atruleExpression` parse context → `atrulePrelude`
|
||||
- `atruleExpression` walk context reference → `atrulePrelude`
|
||||
|
||||
## 1.0.0-alpha22 (September 8, 2017)
|
||||
|
||||
- Parser
|
||||
- Fixed exception on parsing of unclosed `{}-block` in tolerant mode
|
||||
- Added tolerant mode support for `DeclarationList`
|
||||
- Added standalone entry point, i.e. default parser can be used via `require('css-tree/lib/parser')` (#47)
|
||||
- Generator
|
||||
- Changed generator to produce `+n` when `AnPlusB.a` is `+1` to be "round-trip" with parser
|
||||
- Added standalone entry point, i.e. default generators can be used via `require('css-tree/lib/generator')`
|
||||
- Walker
|
||||
- Added standalone entry point, i.e. default walkers can be used via `require('css-tree/lib/walker')` (#47)
|
||||
- Lexer
|
||||
- Added `default` keyword to the list of invalid values for `<custom-ident>` (since it reversed per [spec](https://www.w3.org/TR/css-values/#custom-idents))
|
||||
- Convertors (`toPlainObject()` and `fromPlainObject()`) moved to `lib/convertor` (entry point is `require('css-tree/lib/convertor')`)
|
||||
|
||||
## 1.0.0-alpha21 (September 5, 2017)
|
||||
|
||||
- Tokenizer
|
||||
- Added `Raw` token type
|
||||
- Improved tokenization of `url()` with raw as url to be more spec complient
|
||||
- Added `Tokenizer#balance` array computation on token layout
|
||||
- Added `Tokenizer#getRawLength()` to compute a raw length with respect of block balance
|
||||
- Added `Tokenizer#getTokenStart(offset)` method to get token start offset by token index
|
||||
- Added `idx` and `balance` fields to each token of `Tokenizer#dump()` method result
|
||||
- Parser
|
||||
- Added `onParseError` option
|
||||
- Reworked node parsers that consume a `Raw` node to use a new approach. Since now a `Raw` node builds in `parser#Raw()` function only
|
||||
- Changed semantic of `parser#Raw()`, it takes 5 parameters now (it might to be changed in future)
|
||||
- Changed `parser#tolerantParse()` to pass a start token index to fallback function instead of source offset
|
||||
- Fixed `AtruleExpression` consuming in tolerant mode
|
||||
- Atrule handler to convert an empty `AtruleExpression` node into `null`
|
||||
- Changed `AtruleExpression` handler to always return a node (before it could return a `null` in some cases)
|
||||
- Lexer
|
||||
- Fixed comma match node for `#` multiplier
|
||||
- Added reference name to `SyntaxReferenceError`
|
||||
- Additional fixes on custom errors
|
||||
- Reduced possible corruption of base config by `syntax.fork()`
|
||||
|
||||
## 1.0.0-alpha20 (August 28, 2017)
|
||||
|
||||
- Tokenizer
|
||||
- Added `Atrule` token type (`<at-rule-token>` per spec)
|
||||
- Added `Function` token type (`<function-token>` per spec)
|
||||
- Added `Url` token type
|
||||
- Replaced `Tokenizer#getTypes()` method with `Tokenizer#dump()` to get all tokens as an array
|
||||
- Renamed `Tokenizer.TYPE.Whitespace` to `Tokenizer.TYPE.WhiteSpace`
|
||||
- Renamed `Tokenizer.findWhitespaceEnd()` to `Tokenizer.findWhiteSpaceEnd()`
|
||||
- Parser
|
||||
- Added initial implementation of tollerant mode (turn on by passing `tolerant: true` option). In this mode parse errors are never occour and any invalid part of CSS turns into a `Raw` node. Current safe points: `Atrule`, `AtruleExpression`, `Rule`, `Selector` and `Declaration`. Feature is experimental and further improvements are planned.
|
||||
- Changed `Atrule.expression` to contain a `AtruleExpression` node or `null` only (other node types is wrapping into a `AtruleExpression` node)
|
||||
- Renamed `AttributeSelector.operator` to `AttributeSelector.matcher`
|
||||
- Generator
|
||||
- `translate()` method is now can take a function as second argument, that recieves every generated chunk. When no function is passed, default handler is used, it concats all the chunks and method returns a string.
|
||||
- Lexer
|
||||
- Used [mdn/data](https://github.com/mdn/data) package as source of lexer's grammar instead of local dictionaries
|
||||
- Added `x` unit to `<resolution>` generic type
|
||||
- Improved match tree:
|
||||
- Omited Group (sequences) match nodes
|
||||
- Omited empty match nodes (for terms with `zero or more` multipliers)
|
||||
- Added `ASTNode` node type to contain a reference to AST node
|
||||
- Fixed node duplication (uncompleted match were added to tree)
|
||||
- Added AST node reference in match nodes
|
||||
- Added comma match node by `#` multiplier
|
||||
- Grammar
|
||||
- Changed `translate()` function to get a handler as third argument (optional). That handler recieves result of node traslation and can be used for decoration purposes. See [example](https://github.com/csstree/docs/blob/04c65af44477b5ea05feb373482898122b2a4528/docs/syntax.html#L619-L627)
|
||||
- Added `SyntaxParseError` to grammar export
|
||||
- Reworked group and multipliers representation in syntax tree:
|
||||
- Replaced `Sequence` for `Group` node type (`Sequence` node type removed)
|
||||
- Added `explicit` boolean property for `Group`
|
||||
- Only groups can have a multiplier now (other node types is wrapping into a single term implicit group when multiplier is applied)
|
||||
- Renamed `nonEmpty` Group's property to `disallowEmpty`
|
||||
- Added optimisation for syntax tree by dropping redundant root `Group` when it contains a single `Group` term (return this `Group` as a result)
|
||||
- Changed lexer's match functionality
|
||||
- Changed `Lexer#matchProperty()` and `Lexer#matchType()` to return an object instead of match tree. A match tree stores in `matched` field when AST is matched to grammar successfully, otherwise an error in `error` field. The result object also has some methods to test AST node against a match tree: `getTrace()`, `isType()`, `isProperty()` and `isKeyword()`
|
||||
- Added `Lexer#matchDeclaration()` method
|
||||
- Removed `Lexer#lastMatchError` (error stores in match result object in `error` field)
|
||||
- Added initial implementation of search for AST segments (new lexer methods: `Lexer#findValueSegments()`, `Lexer#findDeclarationValueSegments()` and `Lexer#findAllSegments`)
|
||||
- Implemented `SyntaxReferenceError` for unknown property and type references
|
||||
- Renamed field in resulting object of `property()` function: `variable` → `custom`
|
||||
- Fixed issue with readonly properties (e.g. `line` and `column`) of `Error` and exception on attempt to write in iOS Safari
|
||||
|
||||
## 1.0.0-alpha19 (April 24, 2017)
|
||||
|
||||
- Extended `List` class with new methods:
|
||||
- `List#prepend(item)`
|
||||
- `List#prependData(data)`
|
||||
- `List#insertData(data)`
|
||||
- `List#insertList(list)`
|
||||
- `List#replace(item, itemOrList)`
|
||||
|
||||
## 1.0.0-alpha18 (April 3, 2017)
|
||||
|
||||
- Added `atrule` walk context (#39)
|
||||
- Changed a result of generate method for `AnPlusB`, `AttributeSelector`, `Function`, `MediaFeature` and `Ratio` ([1e95877](https://github.com/csstree/csstree/commit/1e9587710efa8e9338bcf0bc794b4b45f286231d))
|
||||
- Fixed typo in `List` exception messages (@strarsis, #42)
|
||||
- Improved tokenizer to convert an input to a string
|
||||
|
||||
## 1.0.0-alpha17 (March 13, 2017)
|
||||
|
||||
- Implemented new concept of `syntax`
|
||||
- Changed main `exports` to expose a default syntax
|
||||
- Defined initial [CSS syntax](lib/syntax/default.js)
|
||||
- Implemented `createSyntax()` method to create a new syntax from scratch
|
||||
- Implemented `fork()` method to create a new syntax based on given via extension
|
||||
- Parser
|
||||
- Implemented `mediaQueryList` and `mediaQuery` parsing contexts
|
||||
- Implemented `CDO` and `CDC` node types
|
||||
- Implemented additional declaration property prefix hacks (`#` and `+`)
|
||||
- Added support for UTF-16LE BOM
|
||||
- Added support for `@font-face` at-rule
|
||||
- Added `chroma()` to legacy IE filter functions
|
||||
- Improved `HexColor` to consume hex only
|
||||
- Improved support for `\0` and `\9` hacks (#2)
|
||||
- Relaxed number check for `Ratio` terms
|
||||
- Allowed fractal values as a `Ratio` term
|
||||
- Disallowed zero number as a `Ratio` term
|
||||
- Changed important clause parsing
|
||||
- Allowed any identifier for important (to support hacks like `!ie`)
|
||||
- Store `true` for `important` field in case identifier equals to `important` and string otherwise
|
||||
- Fixed parse error formatted message rendering to take into account tabs
|
||||
- Removed exposing of `Parser` class
|
||||
- Removed `readSelectorSequence()`, `readSequenceFallback()` and `readSelectorSequenceFallback` methods
|
||||
- Used single universal sequence consumer for `AtruleExpression`, `Selector` and `Value`
|
||||
- Generator
|
||||
- Reworked generator to use auto-generated functions based on syntax definition (additional work to be done in next releases)
|
||||
- Implemented `translateMarkup(ast, before, after)` method for complex cases
|
||||
- Reworked `translateWithSourceMap` to be more flexible (based on `translateMarkup`, additional work to be done in next releases)
|
||||
- Walker
|
||||
- Reworked walker to use auto-generated function based on syntax definition (additional work to be done in next releases)
|
||||
- Lexer
|
||||
- Prepared for better extensibility (additional work to be done in next releases)
|
||||
- Implemented `checkStructure(ast)` method to check AST structure based on syntax definition
|
||||
- Update syntax dictionaries to latest `mdn/data`
|
||||
- Add missing `<'offset-position'>` syntax
|
||||
- Extended `<position>` property with `-webkit-sticky` (@sergejmueller, #37)
|
||||
- Improved mismatch error position
|
||||
- Implemented script (`gen:syntax`) to generate AST format reference page (`docs/ast.md`) using syntax definition
|
||||
|
||||
## 1.0.0-alpha16 (February 12, 2017)
|
||||
|
||||
- Exposed `Parser` class
|
||||
- Added `startOffset` option to `Tokenizer` (constructor and `setSource()` method)
|
||||
- Added fallback functions for default (`readSequenceFallback`) and selector (`readSelectorSequenceFallback`) sequence readers
|
||||
- Fixed edge cases for `AnPlusB`
|
||||
- Fixed wrong whitespace ignoring in `Selector` consumer
|
||||
|
||||
## 1.0.0-alpha15 (February 8, 2017)
|
||||
|
||||
- Fixed broken `atruleExpression` context
|
||||
- Fixed vendor prefix detection in `keyword()` and `property()`
|
||||
- Fixed `property()` to not lowercase custom property names
|
||||
- Added `variable` boolean flag in `property()` result
|
||||
- Renamed `scanner` into `tokenizer`
|
||||
- Ranamed `syntax` into `lexer`
|
||||
- Moved `docs/*.html` files to [csstree/docs](https://github.com/csstree/docs) repo
|
||||
- Added `element()` function for `Value` context (`-moz-element()` supported as well)
|
||||
- Merged `Universal` node type into `Type`
|
||||
- Renamed node types:
|
||||
- `Id` -> `IdSelector`
|
||||
- `Class` -> `ClassSelector`
|
||||
- `Type` -> `TypeSelector`
|
||||
- `Attribute` -> `AttributeSelector`
|
||||
- `PseudoClass` -> `PseudoClassSelector`
|
||||
- `PseudoElement` -> `PseudoElementSelector`
|
||||
- `Hash` -> `HexColor`
|
||||
- `Space` -> `WhiteSpace`
|
||||
- `An+B` -> `AnPlusB`
|
||||
- Removed `Progid` node type
|
||||
- Relaxed `MediaQuery` consumer to not validate syntax on parse and to include whitespaces in children sequence as is
|
||||
- Added `WhiteSpace.value` property to store whitespace sequence
|
||||
- Implemented parser options to specify what should be parsed in details (when option is `false` some part of CSS represents as balanced `Raw`):
|
||||
- `parseAtruleExpression` – to parse at-rule expressions (`true` by default)
|
||||
- `parseSelector` – to parse rule's selector (`true` by default)
|
||||
- `parseValue` - to parse declaration's value (`true` by default)
|
||||
- `parseCustomProperty` – to parse value and fallback of custom property (`false` by default)
|
||||
- Changed tokenization to stick leading hyphen minus to identifier token
|
||||
- Changed selector parsing:
|
||||
- Don't convert spaces into descendant combinator
|
||||
- Don't validate selector structure on parsing (selectors may be checked by lexer later)
|
||||
- Initial refactoring of [docs](https://github.com/csstree/csstree/blob/master/docs)
|
||||
- Various improvements and fixes
|
||||
|
||||
## 1.0.0-alpha14 (February 3, 2017)
|
||||
|
||||
- Implemented `DeclarationList`, `MediaQueryList`, `MediaQuery`, `MediaFeature` and `Ratio` node types
|
||||
- Implemented `declarationList` context (useful to parse HTML `style` attribute content)
|
||||
- Implemented custom consumers for `@import`, `@media`, `@page` and `@supports` at-rules
|
||||
- Implemented `atrule` option for `parse()` config, is used for `atruleExpession` context to specify custom consumer for at-rule if any
|
||||
- Added `Scanner#skipWS()`, `Scanner#eatNonWS()`, `Scanner#consume()` and `Scanner#consumeNonWS()` helper methods
|
||||
- Added custom consumers for known functional-pseudos, consume unknown functional-pseudo content as balanced `Raw`
|
||||
- Allowed any `PseudoElement` to be a functional-pseudo (#33)
|
||||
- Improved walker implementations to reduce GC thrashing by reusing cursors
|
||||
- Changed `Atrule.block` to contain a `Block` node type only if any
|
||||
- Changed `Block.loc` positions to include curly brackets
|
||||
- Changed `Atrule.expression` to store a `null` if no expression
|
||||
- Changed parser to use `StyleSheet` node type only for top level node (when context is `stylesheet`, that's by default)
|
||||
- Changed `Parentheses`, `Brackets` and `Function` consumers to use passed sequence reader instead of its own
|
||||
- Changed `Value` and `AtruleExpression` consumers to use common sequence reader (that reader was used by `Value` consumer before)
|
||||
- Changed default sequence reader to exclude storage of spaces around `Comma`
|
||||
- Changed processing of custom properties:
|
||||
- Consume declaration value as balanced `Raw`
|
||||
- Consume `var()` fallback value as balanced `Raw`
|
||||
- Validate first argument of `var()` starts with double dash
|
||||
- Custom property's value and fallback includes spaces around
|
||||
- Fixed `Nth` to have a `loc` property
|
||||
- Fixed `SelectorList.loc` and `Selector.loc` positions to exclude spaces
|
||||
- Fixed issue Browserify build fail with `default-syntax.json` is not found error (#32, @philschatz)
|
||||
- Disallowed `Type` selector starting with dash (parser throws an error in this case now)
|
||||
- Disallowed empty selectors for `Rule` (not sure if it's correct but looks reasonable)
|
||||
- Removed `>>` combinator support until any browser support (no signals about that yet)
|
||||
- Removed `PseudoElement.legacy` property
|
||||
- Removed special case for `:before`, `:after`, `:first-letter` and `:first-line` to represent them as `PseudoElement`, now those pseudos are represented as `PseudoClass` nodes
|
||||
- Removed deprecated `Syntax#match()` method
|
||||
- Parser was splitted into modules and related changes, one step closer to an extensible parser
|
||||
- Various fixes and improvements, all changes have negligible impact on performance
|
||||
|
||||
## 1.0.0-alpha13 (January 19, 2017)
|
||||
|
||||
- Changed location storing in `SyntaxMatchError`
|
||||
- Changed property to store mismatch offset to `mismatchOffset`
|
||||
- Changed `offset` property to store bad node offset in source CSS if any
|
||||
- Added `loc` property that stores bad node `loc` if any
|
||||
|
||||
## 1.0.0-alpha12 (January 19, 2017)
|
||||
|
||||
- Fixed `Syntax#matchProperty()` method to always return a positive result for custom properties since syntax is never defined for them (#31)
|
||||
- Implemented `fromPlainObject()` and `toPlainObject()` to convert plain object to AST or AST to plain object (currently converts `List` <-> `Array`)
|
||||
|
||||
## 1.0.0-alpha11 (January 18, 2017)
|
||||
|
||||
- Added support for `:matches(<selector-list>)` (#28)
|
||||
- Added support for `:has(<relative-selector-list>)`
|
||||
- Added support for `::slotted(<compound-selector>)`
|
||||
- Implemented `Brackets` node type
|
||||
- Implemented basic support for at-rule inside rule block (#24)
|
||||
- Renamed `Selector` node type to `SelectorList`
|
||||
- Renamed `SimpleSelector` node type to `Selector`
|
||||
- Renamed `UnicodeRange.name` property to `UnicodeRange.value`
|
||||
- Replaced `Negation` node type for regular `PseudoClass`
|
||||
- Unified name of node property to store nested nodes, it always `children` now:
|
||||
- `StyleSheet.rules` -> `StyleSheet.children`
|
||||
- `SelectorList.selectors` -> `SelectorList.children`
|
||||
- `Block.declarations` -> `Block.children`
|
||||
- `*.sequence` -> `*.children`
|
||||
- Fixed edge cases in parsing `Hex` and `UnicodeRange` when number not an integer
|
||||
- Changed `nth-` pseudos parsing
|
||||
- Implemented `An+B` node type to represent expressions like `2n + 1` or `-3n`
|
||||
- Fixed edge cases when `a` or `b` is not an integer
|
||||
- Changed `odd` and `even` keywords processing, keywords are storing as `Identifier` node type now
|
||||
- Changed `Nth` node type format to store a `nth`-query and an optional `selector`
|
||||
- Implemented `of` clause for `nth-` pseudos (a.e. `:nth-child(2n + 1 of li, img)`)
|
||||
- Limited `Nth` parsing rules to `:nth-child()`, `:nth-last-child()`, `:nth-of-type()` and `:nth-last-of-type()` pseudos
|
||||
- Changed the way to store locations
|
||||
- Renamed `info` node property to `loc`
|
||||
- Changed format of `loc` to store `start` and `end` positions
|
||||
|
||||
## 1.0.0-alpha10 (January 11, 2017)
|
||||
|
||||
- Reworked `Scanner` to be a single point to its functionality
|
||||
- Exposed `Scanner` class to be useful for external projects
|
||||
- Changed `walk()` function behaviour to traverse AST nodes in natural order
|
||||
- Implemented `walkUp()` function to traverse AST nodes from deepest to parent (behaves as `walk()` before)
|
||||
|
||||
## 1.0.0-alpha9 (December 21, 2016)
|
||||
|
||||
- Fixed `<angle>` generic according to specs that allow a `<number>` equals to zero to be used as valid value (#30)
|
||||
|
||||
## 1.0.0-alpha8 (November 11, 2016)
|
||||
|
||||
- Fixed `Scanner#skip()` issue method when cursor is moving to the end of source
|
||||
- Simplified `Progid` node
|
||||
- Changed behaviour for bad selector processing, now parsing fails instead of selector ignoring
|
||||
- Fixed `<id-selector>` generic syntax
|
||||
- Added `q` unit for `<length>` generic syntax
|
||||
- Refactored syntax parser (performance)
|
||||
- Reduced startup time by implementing lazy syntax parsing (default syntax doesn't parse on module load)
|
||||
- Updated syntax dictionaries and used [`mdn/data`](https://github.com/mdn/data) instead of `Template:CSSData`
|
||||
- Renamed `syntax.stringify()` method to `syntax.translate()`
|
||||
- Simplified generic syntax functions, those functions receive a single AST node for checking and should return `true` or `false`
|
||||
- Added exception for values that contains `var()`, those values are always valid for now
|
||||
- Added more tests and increase code coverage to `98.5%`
|
||||
|
||||
## 1.0.0-alpha7 (October 7, 2016)
|
||||
|
||||
- Added support for explicit descendant combinator (`>>`)
|
||||
- Implemented `Type` and `Universal` type nodes
|
||||
- Improved `Number` parsing by including sign and exponent (#26)
|
||||
- Parse `before`, `after`, `first-letter` and `first-line` pseudos with single colon as `PseudoElement`
|
||||
- Changed `FunctionalPseudo` node type to `PseudoClass`
|
||||
- Fixed attribute selector name parsing (namespace edge cases)
|
||||
- Fixed location calculation for specified offset when `eof` is reached
|
||||
- Added more non-standard colors (#25)
|
||||
- Removed obsolete `Syntax#getAll()` method
|
||||
- Fixed various edge cases, code clean up and performance improvements
|
||||
|
||||
## 1.0.0-alpha6 (September 23, 2016)
|
||||
|
||||
- More accurate positions for syntax mismatch errors
|
||||
- Added [`apple`](https://webkit.org/blog/3709/using-the-system-font-in-web-content/) specific font keywords (#20)
|
||||
- Changed `Property` node stucture from object to string
|
||||
- Renamed `Ruleset` node type to `Rule`
|
||||
- Removed `Argument` node type
|
||||
- Fixed `Dimension` and `Percentage` position computation
|
||||
- Fixed bad selector parsing (temporary solution)
|
||||
- Fixed location computation for CSS with very long lines that may lead to really long parsing with `positions:true` (even freeze)
|
||||
- Fixed `line` and `column` computation for `SyntaxMatch` error
|
||||
- Improved performance of parsing and translation. Now CSSTree is under 10ms in [PostCSS benchmark](https://github.com/postcss/benchmark).
|
||||
19
node_modules/laravel-mix/node_modules/css-tree/LICENSE
generated
vendored
Executable file
19
node_modules/laravel-mix/node_modules/css-tree/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,19 @@
|
||||
Copyright (C) 2016-2019 by Roman Dvornov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
130
node_modules/laravel-mix/node_modules/css-tree/README.md
generated
vendored
Executable file
130
node_modules/laravel-mix/node_modules/css-tree/README.md
generated
vendored
Executable file
@@ -0,0 +1,130 @@
|
||||
<img align="right" width="111" height="111"
|
||||
alt="CSSTree logo"
|
||||
src="https://cloud.githubusercontent.com/assets/270491/19243723/6f9136c6-8f21-11e6-82ac-eeeee4c6c452.png"/>
|
||||
|
||||
# CSSTree
|
||||
|
||||
[](https://www.npmjs.com/package/css-tree)
|
||||
[](https://travis-ci.org/csstree/csstree)
|
||||
[](https://coveralls.io/github/csstree/csstree?branch=master)
|
||||
[](https://www.npmjs.com/package/css-tree)
|
||||
[](https://twitter.com/csstree)
|
||||
|
||||
CSSTree is a tool set for CSS: [fast](https://github.com/postcss/benchmark) detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations. The main goal is to be efficient and W3C specs compliant, with focus on CSS analyzing and source-to-source transforming tasks.
|
||||
|
||||
> NOTE: The library isn't in final shape and needs further improvements (e.g. AST format and API are subjects to change in next major versions). However it's stable enough and used by projects like [CSSO](https://github.com/css/csso) (CSS minifier) and [SVGO](https://github.com/svg/svgo) (SVG optimizer) in production.
|
||||
|
||||
## Features
|
||||
|
||||
- **Detailed parsing with an adjustable level of detail**
|
||||
|
||||
By default CSSTree parses CSS as detailed as possible, i.e. each single logical part is representing with its own AST node (see [AST format](docs/ast.md) for all possible node types). The parsing detail level can be changed through [parser options](docs/parsing.md#parsesource-options), for example, you can disable parsing of selectors or declaration values for component parts.
|
||||
|
||||
- **Tolerant to errors by design**
|
||||
|
||||
Parser behaves as [spec says](https://www.w3.org/TR/css-syntax-3/#error-handling): "When errors occur in CSS, the parser attempts to recover gracefully, throwing away only the minimum amount of content before returning to parsing as normal". The only thing the parser departs from the specification is that it doesn't throw away bad content, but wraps it in a special node type (`Raw`) that allows processing it later.
|
||||
|
||||
- **Fast and efficient**
|
||||
|
||||
CSSTree is created with focus on performance and effective memory consumption. Therefore it's [one of the fastest CSS parsers](https://github.com/postcss/benchmark) at the moment.
|
||||
|
||||
- **Syntax validation**
|
||||
|
||||
The build-in lexer can test CSS against syntaxes defined by W3C. CSSTree uses [mdn/data](https://github.com/mdn/data/) as a basis for lexer's dictionaries and extends it with vendor specific and legacy syntaxes. Lexer can only check the declaration values currently, but this feature will be extended to other parts of the CSS in the future.
|
||||
|
||||
## Documentation
|
||||
|
||||
- [AST format](docs/ast.md)
|
||||
- [Parsing CSS → AST](docs/parsing.md)
|
||||
- [parse(source[, options])](docs/parsing.md#parsesource-options)
|
||||
- [Serialization AST → CSS](docs/generate.md)
|
||||
- [generate(ast[, options])](docs/generate.md#generateast-options)
|
||||
- [AST traversal](docs/traversal.md)
|
||||
- [walk(ast, options)](docs/traversal.md#walkast-options)
|
||||
- [find(ast, fn)](docs/traversal.md#findast-fn)
|
||||
- [findLast(ast, fn)](docs/traversal.md#findlastast-fn)
|
||||
- [findAll(ast, fn)](docs/traversal.md#findallast-fn)
|
||||
- [Utils for AST](docs/utils.md)
|
||||
- [property(name)](docs/utils.md#propertyname)
|
||||
- [keyword(name)](docs/utils.md#keywordname)
|
||||
- [clone(ast)](docs/utils.md#cloneast)
|
||||
- [fromPlainObject(object)](docs/utils.md#fromplainobjectobject)
|
||||
- [toPlainObject(ast)](docs/utils.md#toplainobjectast)
|
||||
- [Value Definition Syntax](docs/definition-syntax.md)
|
||||
- [parse(source)](docs/definition-syntax.md#parsesource)
|
||||
- [walk(node, options, context)](docs/definition-syntax.md#walknode-options-context)
|
||||
- [generate(node, options)](docs/definition-syntax.md#generatenode-options)
|
||||
- [AST format](docs/definition-syntax.md#ast-format)
|
||||
|
||||
## Tools
|
||||
|
||||
* [AST Explorer](https://astexplorer.net/#/gist/244e2fb4da940df52bf0f4b94277db44/e79aff44611020b22cfd9708f3a99ce09b7d67a8) – explore CSSTree AST format with zero setup
|
||||
* [CSS syntax reference](https://csstree.github.io/docs/syntax.html)
|
||||
* [CSS syntax validator](https://csstree.github.io/docs/validator.html)
|
||||
|
||||
## Related projects
|
||||
|
||||
* [csstree-validator](https://github.com/csstree/validator) – NPM package to validate CSS
|
||||
* [stylelint-csstree-validator](https://github.com/csstree/stylelint-validator) – plugin for stylelint to validate CSS
|
||||
* [Grunt plugin](https://github.com/sergejmueller/grunt-csstree-validator)
|
||||
* [Gulp plugin](https://github.com/csstree/gulp-csstree)
|
||||
* [Sublime plugin](https://github.com/csstree/SublimeLinter-contrib-csstree)
|
||||
* [VS Code plugin](https://github.com/csstree/vscode-plugin)
|
||||
* [Atom plugin](https://github.com/csstree/atom-plugin)
|
||||
|
||||
## Usage
|
||||
|
||||
Install with npm:
|
||||
|
||||
```
|
||||
> npm install css-tree
|
||||
```
|
||||
|
||||
Basic usage:
|
||||
|
||||
```js
|
||||
var csstree = require('css-tree');
|
||||
|
||||
// parse CSS to AST
|
||||
var ast = csstree.parse('.example { world: "!" }');
|
||||
|
||||
// traverse AST and modify it
|
||||
csstree.walk(ast, function(node) {
|
||||
if (node.type === 'ClassSelector' && node.name === 'example') {
|
||||
node.name = 'hello';
|
||||
}
|
||||
});
|
||||
|
||||
// generate CSS from AST
|
||||
console.log(csstree.generate(ast));
|
||||
// .hello{world:"!"}
|
||||
```
|
||||
|
||||
Syntax matching:
|
||||
|
||||
```js
|
||||
// parse CSS to AST as a declaration value
|
||||
var ast = csstree.parse('red 1px solid', { context: 'value' });
|
||||
|
||||
// match to syntax of `border` property
|
||||
var matchResult = csstree.lexer.matchProperty('border', ast);
|
||||
|
||||
// check first value node is a <color>
|
||||
console.log(matchResult.isType(ast.children.first(), 'color'));
|
||||
// true
|
||||
|
||||
// get a type list matched to a node
|
||||
console.log(matchResult.getTrace(ast.children.first()));
|
||||
// [ { type: 'Property', name: 'border' },
|
||||
// { type: 'Type', name: 'color' },
|
||||
// { type: 'Type', name: 'named-color' },
|
||||
// { type: 'Keyword', name: 'red' } ]
|
||||
```
|
||||
|
||||
## Top level API
|
||||
|
||||

|
||||
|
||||
## License
|
||||
|
||||
MIT
|
||||
103
node_modules/laravel-mix/node_modules/css-tree/data/index.js
generated
vendored
Executable file
103
node_modules/laravel-mix/node_modules/css-tree/data/index.js
generated
vendored
Executable file
@@ -0,0 +1,103 @@
|
||||
const mdnAtrules = require('mdn-data/css/at-rules.json');
|
||||
const mdnProperties = require('mdn-data/css/properties.json');
|
||||
const mdnSyntaxes = require('mdn-data/css/syntaxes.json');
|
||||
const patch = require('./patch.json');
|
||||
const extendSyntax = /^\s*\|\s*/;
|
||||
|
||||
function preprocessAtrules(dict) {
|
||||
const result = Object.create(null);
|
||||
|
||||
for (const atruleName in dict) {
|
||||
const atrule = dict[atruleName];
|
||||
let descriptors = null;
|
||||
|
||||
if (atrule.descriptors) {
|
||||
descriptors = Object.create(null);
|
||||
|
||||
for (const descriptor in atrule.descriptors) {
|
||||
descriptors[descriptor] = atrule.descriptors[descriptor].syntax;
|
||||
}
|
||||
}
|
||||
|
||||
result[atruleName.substr(1)] = {
|
||||
prelude: atrule.syntax.trim().match(/^@\S+\s+([^;\{]*)/)[1].trim() || null,
|
||||
descriptors
|
||||
};
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function patchDictionary(dict, patchDict) {
|
||||
const result = {};
|
||||
|
||||
// copy all syntaxes for an original dict
|
||||
for (const key in dict) {
|
||||
result[key] = dict[key].syntax || dict[key];
|
||||
}
|
||||
|
||||
// apply a patch
|
||||
for (const key in patchDict) {
|
||||
if (key in dict) {
|
||||
if (patchDict[key].syntax) {
|
||||
result[key] = extendSyntax.test(patchDict[key].syntax)
|
||||
? result[key] + ' ' + patchDict[key].syntax.trim()
|
||||
: patchDict[key].syntax;
|
||||
} else {
|
||||
delete result[key];
|
||||
}
|
||||
} else {
|
||||
if (patchDict[key].syntax) {
|
||||
result[key] = patchDict[key].syntax.replace(extendSyntax, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function unpackSyntaxes(dict) {
|
||||
const result = {};
|
||||
|
||||
for (const key in dict) {
|
||||
result[key] = dict[key].syntax;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function patchAtrules(dict, patchDict) {
|
||||
const result = {};
|
||||
|
||||
// copy all syntaxes for an original dict
|
||||
for (const key in dict) {
|
||||
const patchDescriptors = (patchDict[key] && patchDict[key].descriptors) || null;
|
||||
|
||||
result[key] = {
|
||||
prelude: key in patchDict && 'prelude' in patchDict[key]
|
||||
? patchDict[key].prelude
|
||||
: dict[key].prelude || null,
|
||||
descriptors: dict[key].descriptors
|
||||
? patchDictionary(dict[key].descriptors, patchDescriptors || {})
|
||||
: patchDescriptors && unpackSyntaxes(patchDescriptors)
|
||||
};
|
||||
}
|
||||
|
||||
// apply a patch
|
||||
for (const key in patchDict) {
|
||||
if (!hasOwnProperty.call(dict, key)) {
|
||||
result[key] = {
|
||||
prelude: patchDict[key].prelude || null,
|
||||
descriptors: patchDict[key].descriptors && unpackSyntaxes(patchDict[key].descriptors)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
types: patchDictionary(mdnSyntaxes, patch.syntaxes),
|
||||
atrules: patchAtrules(preprocessAtrules(mdnAtrules), patch.atrules),
|
||||
properties: patchDictionary(mdnProperties, patch.properties)
|
||||
};
|
||||
721
node_modules/laravel-mix/node_modules/css-tree/data/patch.json
generated
vendored
Normal file
721
node_modules/laravel-mix/node_modules/css-tree/data/patch.json
generated
vendored
Normal file
@@ -0,0 +1,721 @@
|
||||
{
|
||||
"atrules": {
|
||||
"charset": {
|
||||
"prelude": "<string>"
|
||||
},
|
||||
"font-face": {
|
||||
"descriptors": {
|
||||
"unicode-range": {
|
||||
"comment": "replaces <unicode-range>, an old production name",
|
||||
"syntax": "<urange>#"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"-moz-background-clip": {
|
||||
"comment": "deprecated syntax in old Firefox, https://developer.mozilla.org/en/docs/Web/CSS/background-clip",
|
||||
"syntax": "padding | border"
|
||||
},
|
||||
"-moz-border-radius-bottomleft": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-left-radius",
|
||||
"syntax": "<'border-bottom-left-radius'>"
|
||||
},
|
||||
"-moz-border-radius-bottomright": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius",
|
||||
"syntax": "<'border-bottom-right-radius'>"
|
||||
},
|
||||
"-moz-border-radius-topleft": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-left-radius",
|
||||
"syntax": "<'border-top-left-radius'>"
|
||||
},
|
||||
"-moz-border-radius-topright": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius",
|
||||
"syntax": "<'border-bottom-right-radius'>"
|
||||
},
|
||||
"-moz-control-character-visibility": {
|
||||
"comment": "firefox specific keywords, https://bugzilla.mozilla.org/show_bug.cgi?id=947588",
|
||||
"syntax": "visible | hidden"
|
||||
},
|
||||
"-moz-osx-font-smoothing": {
|
||||
"comment": "misssed old syntax https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth",
|
||||
"syntax": "auto | grayscale"
|
||||
},
|
||||
"-moz-user-select": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/user-select",
|
||||
"syntax": "none | text | all | -moz-none"
|
||||
},
|
||||
"-ms-flex-align": {
|
||||
"comment": "misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-align",
|
||||
"syntax": "start | end | center | baseline | stretch"
|
||||
},
|
||||
"-ms-flex-item-align": {
|
||||
"comment": "misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-align",
|
||||
"syntax": "auto | start | end | center | baseline | stretch"
|
||||
},
|
||||
"-ms-flex-line-pack": {
|
||||
"comment": "misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-line-pack",
|
||||
"syntax": "start | end | center | justify | distribute | stretch"
|
||||
},
|
||||
"-ms-flex-negative": {
|
||||
"comment": "misssed old syntax implemented in IE; TODO: find references for comfirmation",
|
||||
"syntax": "<'flex-shrink'>"
|
||||
},
|
||||
"-ms-flex-pack": {
|
||||
"comment": "misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-pack",
|
||||
"syntax": "start | end | center | justify | distribute"
|
||||
},
|
||||
"-ms-flex-order": {
|
||||
"comment": "misssed old syntax implemented in IE; https://msdn.microsoft.com/en-us/library/jj127303(v=vs.85).aspx",
|
||||
"syntax": "<integer>"
|
||||
},
|
||||
"-ms-flex-positive": {
|
||||
"comment": "misssed old syntax implemented in IE; TODO: find references for comfirmation",
|
||||
"syntax": "<'flex-grow'>"
|
||||
},
|
||||
"-ms-flex-preferred-size": {
|
||||
"comment": "misssed old syntax implemented in IE; TODO: find references for comfirmation",
|
||||
"syntax": "<'flex-basis'>"
|
||||
},
|
||||
"-ms-interpolation-mode": {
|
||||
"comment": "https://msdn.microsoft.com/en-us/library/ff521095(v=vs.85).aspx",
|
||||
"syntax": "nearest-neighbor | bicubic"
|
||||
},
|
||||
"-ms-grid-column-align": {
|
||||
"comment": "add this property first since it uses as fallback for flexbox, https://msdn.microsoft.com/en-us/library/windows/apps/hh466338.aspx",
|
||||
"syntax": "start | end | center | stretch"
|
||||
},
|
||||
"-ms-grid-row-align": {
|
||||
"comment": "add this property first since it uses as fallback for flexbox, https://msdn.microsoft.com/en-us/library/windows/apps/hh466348.aspx",
|
||||
"syntax": "start | end | center | stretch"
|
||||
},
|
||||
"-ms-hyphenate-limit-last": {
|
||||
"comment": "misssed old syntax implemented in IE; https://www.w3.org/TR/css-text-4/#hyphenate-line-limits",
|
||||
"syntax": "none | always | column | page | spread"
|
||||
},
|
||||
"-webkit-appearance": {
|
||||
"comment": "webkit specific keywords",
|
||||
"references": [
|
||||
"http://css-infos.net/property/-webkit-appearance"
|
||||
],
|
||||
"syntax": "none | button | button-bevel | caps-lock-indicator | 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 | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbargripper-horizontal | scrollbargripper-vertical | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | 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"
|
||||
},
|
||||
"-webkit-background-clip": {
|
||||
"comment": "https://developer.mozilla.org/en/docs/Web/CSS/background-clip",
|
||||
"syntax": "[ <box> | border | padding | content | text ]#"
|
||||
},
|
||||
"-webkit-column-break-after": {
|
||||
"comment": "added, http://help.dottoro.com/lcrthhhv.php",
|
||||
"syntax": "always | auto | avoid"
|
||||
},
|
||||
"-webkit-column-break-before": {
|
||||
"comment": "added, http://help.dottoro.com/lcxquvkf.php",
|
||||
"syntax": "always | auto | avoid"
|
||||
},
|
||||
"-webkit-column-break-inside": {
|
||||
"comment": "added, http://help.dottoro.com/lclhnthl.php",
|
||||
"syntax": "always | auto | avoid"
|
||||
},
|
||||
"-webkit-font-smoothing": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth",
|
||||
"syntax": "auto | none | antialiased | subpixel-antialiased"
|
||||
},
|
||||
"-webkit-mask-box-image": {
|
||||
"comment": "missed; https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-mask-box-image",
|
||||
"syntax": "[ <url> | <gradient> | none ] [ <length-percentage>{4} <-webkit-mask-box-repeat>{2} ]?"
|
||||
},
|
||||
"-webkit-print-color-adjust": {
|
||||
"comment": "missed",
|
||||
"references": [
|
||||
"https://developer.mozilla.org/en/docs/Web/CSS/-webkit-print-color-adjust"
|
||||
],
|
||||
"syntax": "economy | exact"
|
||||
},
|
||||
"-webkit-text-security": {
|
||||
"comment": "missed; http://help.dottoro.com/lcbkewgt.php",
|
||||
"syntax": "none | circle | disc | square"
|
||||
},
|
||||
"-webkit-user-drag": {
|
||||
"comment": "missed; http://help.dottoro.com/lcbixvwm.php",
|
||||
"syntax": "none | element | auto"
|
||||
},
|
||||
"-webkit-user-select": {
|
||||
"comment": "auto is supported by old webkit, https://developer.mozilla.org/en-US/docs/Web/CSS/user-select",
|
||||
"syntax": "auto | none | text | all"
|
||||
},
|
||||
"alignment-baseline": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/text.html#AlignmentBaselineProperty"
|
||||
],
|
||||
"syntax": "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical"
|
||||
},
|
||||
"baseline-shift": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/text.html#BaselineShiftProperty"
|
||||
],
|
||||
"syntax": "baseline | sub | super | <svg-length>"
|
||||
},
|
||||
"behavior": {
|
||||
"comment": "added old IE property https://msdn.microsoft.com/en-us/library/ms530723(v=vs.85).aspx",
|
||||
"syntax": "<url>+"
|
||||
},
|
||||
"clip-rule": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/masking.html#ClipRuleProperty"
|
||||
],
|
||||
"syntax": "nonzero | evenodd"
|
||||
},
|
||||
"cue": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<'cue-before'> <'cue-after'>?"
|
||||
},
|
||||
"cue-after": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<url> <decibel>? | none"
|
||||
},
|
||||
"cue-before": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<url> <decibel>? | none"
|
||||
},
|
||||
"cursor": {
|
||||
"comment": "added legacy keywords: hand, -webkit-grab. -webkit-grabbing, -webkit-zoom-in, -webkit-zoom-out, -moz-grab, -moz-grabbing, -moz-zoom-in, -moz-zoom-out",
|
||||
"references": [
|
||||
"https://www.sitepoint.com/css3-cursor-styles/"
|
||||
],
|
||||
"syntax": "[ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing | hand | -webkit-grab | -webkit-grabbing | -webkit-zoom-in | -webkit-zoom-out | -moz-grab | -moz-grabbing | -moz-zoom-in | -moz-zoom-out ] ]"
|
||||
},
|
||||
"display": {
|
||||
"comment": "extended with -ms-flexbox",
|
||||
"syntax": "| <-non-standard-display>"
|
||||
},
|
||||
"position": {
|
||||
"comment": "extended with -webkit-sticky",
|
||||
"syntax": "| -webkit-sticky"
|
||||
},
|
||||
"dominant-baseline": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/text.html#DominantBaselineProperty"
|
||||
],
|
||||
"syntax": "auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge"
|
||||
},
|
||||
"image-rendering": {
|
||||
"comment": "extended with <-non-standard-image-rendering>, added SVG keywords optimizeSpeed and optimizeQuality",
|
||||
"references": [
|
||||
"https://developer.mozilla.org/en/docs/Web/CSS/image-rendering",
|
||||
"https://www.w3.org/TR/SVG/painting.html#ImageRenderingProperty"
|
||||
],
|
||||
"syntax": "| optimizeSpeed | optimizeQuality | <-non-standard-image-rendering>"
|
||||
},
|
||||
"fill": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#FillProperty"
|
||||
],
|
||||
"syntax": "<paint>"
|
||||
},
|
||||
"fill-opacity": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#FillProperty"
|
||||
],
|
||||
"syntax": "<number-zero-one>"
|
||||
},
|
||||
"fill-rule": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#FillProperty"
|
||||
],
|
||||
"syntax": "nonzero | evenodd"
|
||||
},
|
||||
"filter": {
|
||||
"comment": "extend with IE legacy syntaxes",
|
||||
"syntax": "| <-ms-filter-function-list>"
|
||||
},
|
||||
"glyph-orientation-horizontal": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/text.html#GlyphOrientationHorizontalProperty"
|
||||
],
|
||||
"syntax": "<angle>"
|
||||
},
|
||||
"glyph-orientation-vertical": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/text.html#GlyphOrientationVerticalProperty"
|
||||
],
|
||||
"syntax": "<angle>"
|
||||
},
|
||||
"kerning": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/text.html#KerningProperty"
|
||||
],
|
||||
"syntax": "auto | <svg-length>"
|
||||
},
|
||||
"letter-spacing": {
|
||||
"comment": "fix syntax <length> -> <length-percentage>",
|
||||
"references": [
|
||||
"https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/letter-spacing"
|
||||
],
|
||||
"syntax": "normal | <length-percentage>"
|
||||
},
|
||||
"marker": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#MarkerProperties"
|
||||
],
|
||||
"syntax": "none | <url>"
|
||||
},
|
||||
"marker-end": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#MarkerProperties"
|
||||
],
|
||||
"syntax": "none | <url>"
|
||||
},
|
||||
"marker-mid": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#MarkerProperties"
|
||||
],
|
||||
"syntax": "none | <url>"
|
||||
},
|
||||
"marker-start": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#MarkerProperties"
|
||||
],
|
||||
"syntax": "none | <url>"
|
||||
},
|
||||
"max-width": {
|
||||
"comment": "fix auto -> none (https://github.com/mdn/data/pull/431); extend by non-standard width keywords https://developer.mozilla.org/en-US/docs/Web/CSS/max-width",
|
||||
"syntax": "none | <length-percentage> | min-content | max-content | fit-content(<length-percentage>) | <-non-standard-width>"
|
||||
},
|
||||
"width": {
|
||||
"comment": "per spec fit-content should be a function, however browsers are supporting it as a keyword (https://github.com/csstree/stylelint-validator/issues/29)",
|
||||
"syntax": "| fit-content | -moz-fit-content | -webkit-fit-content"
|
||||
},
|
||||
"min-width": {
|
||||
"comment": "extend by non-standard width keywords https://developer.mozilla.org/en-US/docs/Web/CSS/width",
|
||||
"syntax": "auto | <length-percentage> | min-content | max-content | fit-content(<length-percentage>) | <-non-standard-width>"
|
||||
},
|
||||
"overflow": {
|
||||
"comment": "extend by vendor keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow",
|
||||
"syntax": "| <-non-standard-overflow>"
|
||||
},
|
||||
"pause": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<'pause-before'> <'pause-after'>?"
|
||||
},
|
||||
"pause-after": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<time> | none | x-weak | weak | medium | strong | x-strong"
|
||||
},
|
||||
"pause-before": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<time> | none | x-weak | weak | medium | strong | x-strong"
|
||||
},
|
||||
"rest": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<'rest-before'> <'rest-after'>?"
|
||||
},
|
||||
"rest-after": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<time> | none | x-weak | weak | medium | strong | x-strong"
|
||||
},
|
||||
"rest-before": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<time> | none | x-weak | weak | medium | strong | x-strong"
|
||||
},
|
||||
"shape-rendering": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#ShapeRenderingPropert"
|
||||
],
|
||||
"syntax": "auto | optimizeSpeed | crispEdges | geometricPrecision"
|
||||
},
|
||||
"src": {
|
||||
"comment": "added @font-face's src property https://developer.mozilla.org/en-US/docs/Web/CSS/@font-face/src",
|
||||
"syntax": "[ <url> [ format( <string># ) ]? | local( <family-name> ) ]#"
|
||||
},
|
||||
"speak": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "auto | none | normal"
|
||||
},
|
||||
"speak-as": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "normal | spell-out || digits || [ literal-punctuation | no-punctuation ]"
|
||||
},
|
||||
"stroke": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
|
||||
],
|
||||
"syntax": "<paint>"
|
||||
},
|
||||
"stroke-dasharray": {
|
||||
"comment": "added SVG property; a list of comma and/or white space separated <length>s and <percentage>s",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
|
||||
],
|
||||
"syntax": "none | [ <svg-length>+ ]#"
|
||||
},
|
||||
"stroke-dashoffset": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
|
||||
],
|
||||
"syntax": "<svg-length>"
|
||||
},
|
||||
"stroke-linecap": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
|
||||
],
|
||||
"syntax": "butt | round | square"
|
||||
},
|
||||
"stroke-linejoin": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
|
||||
],
|
||||
"syntax": "miter | round | bevel"
|
||||
},
|
||||
"stroke-miterlimit": {
|
||||
"comment": "added SVG property (<miterlimit> = <number-one-or-greater>) ",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
|
||||
],
|
||||
"syntax": "<number-one-or-greater>"
|
||||
},
|
||||
"stroke-opacity": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
|
||||
],
|
||||
"syntax": "<number-zero-one>"
|
||||
},
|
||||
"stroke-width": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
|
||||
],
|
||||
"syntax": "<svg-length>"
|
||||
},
|
||||
"text-anchor": {
|
||||
"comment": "added SVG property",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG/text.html#TextAlignmentProperties"
|
||||
],
|
||||
"syntax": "start | middle | end"
|
||||
},
|
||||
"unicode-bidi": {
|
||||
"comment": "added prefixed keywords https://developer.mozilla.org/en-US/docs/Web/CSS/unicode-bidi",
|
||||
"syntax": "| -moz-isolate | -moz-isolate-override | -moz-plaintext | -webkit-isolate | -webkit-isolate-override | -webkit-plaintext"
|
||||
},
|
||||
"unicode-range": {
|
||||
"comment": "added missed property https://developer.mozilla.org/en-US/docs/Web/CSS/%40font-face/unicode-range",
|
||||
"syntax": "<urange>#"
|
||||
},
|
||||
"voice-balance": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<number> | left | center | right | leftwards | rightwards"
|
||||
},
|
||||
"voice-duration": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "auto | <time>"
|
||||
},
|
||||
"voice-family": {
|
||||
"comment": "<name> -> <family-name>, https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "[ [ <family-name> | <generic-voice> ] , ]* [ <family-name> | <generic-voice> ] | preserve"
|
||||
},
|
||||
"voice-pitch": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<frequency> && absolute | [ [ x-low | low | medium | high | x-high ] || [ <frequency> | <semitones> | <percentage> ] ]"
|
||||
},
|
||||
"voice-range": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "<frequency> && absolute | [ [ x-low | low | medium | high | x-high ] || [ <frequency> | <semitones> | <percentage> ] ]"
|
||||
},
|
||||
"voice-rate": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "[ normal | x-slow | slow | medium | fast | x-fast ] || <percentage>"
|
||||
},
|
||||
"voice-stress": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "normal | strong | moderate | none | reduced"
|
||||
},
|
||||
"voice-volume": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#property-index",
|
||||
"syntax": "silent | [ [ x-soft | soft | medium | loud | x-loud ] || <decibel> ]"
|
||||
},
|
||||
"writing-mode": {
|
||||
"comment": "extend with SVG keywords",
|
||||
"syntax": "| <svg-writing-mode>"
|
||||
}
|
||||
},
|
||||
"syntaxes": {
|
||||
"-legacy-gradient": {
|
||||
"comment": "added collection of legacy gradient syntaxes",
|
||||
"syntax": "<-webkit-gradient()> | <-legacy-linear-gradient> | <-legacy-repeating-linear-gradient> | <-legacy-radial-gradient> | <-legacy-repeating-radial-gradient>"
|
||||
},
|
||||
"-legacy-linear-gradient": {
|
||||
"comment": "like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",
|
||||
"syntax": "-moz-linear-gradient( <-legacy-linear-gradient-arguments> ) | -webkit-linear-gradient( <-legacy-linear-gradient-arguments> ) | -o-linear-gradient( <-legacy-linear-gradient-arguments> )"
|
||||
},
|
||||
"-legacy-repeating-linear-gradient": {
|
||||
"comment": "like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",
|
||||
"syntax": "-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> ) | -webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> ) | -o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )"
|
||||
},
|
||||
"-legacy-linear-gradient-arguments": {
|
||||
"comment": "like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",
|
||||
"syntax": "[ <angle> | <side-or-corner> ]? , <color-stop-list>"
|
||||
},
|
||||
"-legacy-radial-gradient": {
|
||||
"comment": "deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",
|
||||
"syntax": "-moz-radial-gradient( <-legacy-radial-gradient-arguments> ) | -webkit-radial-gradient( <-legacy-radial-gradient-arguments> ) | -o-radial-gradient( <-legacy-radial-gradient-arguments> )"
|
||||
},
|
||||
"-legacy-repeating-radial-gradient": {
|
||||
"comment": "deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",
|
||||
"syntax": "-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> ) | -webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> ) | -o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )"
|
||||
},
|
||||
"-legacy-radial-gradient-arguments": {
|
||||
"comment": "deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",
|
||||
"syntax": "[ <position> , ]? [ [ [ <-legacy-radial-gradient-shape> || <-legacy-radial-gradient-size> ] | [ <length> | <percentage> ]{2} ] , ]? <color-stop-list>"
|
||||
},
|
||||
"-legacy-radial-gradient-size": {
|
||||
"comment": "before a standard it contains 2 extra keywords (`contain` and `cover`) https://www.w3.org/TR/2011/WD-css3-images-20110908/#ltsize",
|
||||
"syntax": "closest-side | closest-corner | farthest-side | farthest-corner | contain | cover"
|
||||
},
|
||||
"-legacy-radial-gradient-shape": {
|
||||
"comment": "define to double sure it doesn't extends in future https://www.w3.org/TR/2011/WD-css3-images-20110908/#ltshape",
|
||||
"syntax": "circle | ellipse"
|
||||
},
|
||||
"-non-standard-font": {
|
||||
"comment": "non standard fonts",
|
||||
"references": [
|
||||
"https://webkit.org/blog/3709/using-the-system-font-in-web-content/"
|
||||
],
|
||||
"syntax": "-apple-system-body | -apple-system-headline | -apple-system-subheadline | -apple-system-caption1 | -apple-system-caption2 | -apple-system-footnote | -apple-system-short-body | -apple-system-short-headline | -apple-system-short-subheadline | -apple-system-short-caption1 | -apple-system-short-footnote | -apple-system-tall-body"
|
||||
},
|
||||
"-non-standard-color": {
|
||||
"comment": "non standard colors",
|
||||
"references": [
|
||||
"http://cssdot.ru/%D0%A1%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%87%D0%BD%D0%B8%D0%BA_CSS/color-i305.html",
|
||||
"https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Mozilla_Color_Preference_Extensions"
|
||||
],
|
||||
"syntax": "-moz-ButtonDefault | -moz-ButtonHoverFace | -moz-ButtonHoverText | -moz-CellHighlight | -moz-CellHighlightText | -moz-Combobox | -moz-ComboboxText | -moz-Dialog | -moz-DialogText | -moz-dragtargetzone | -moz-EvenTreeRow | -moz-Field | -moz-FieldText | -moz-html-CellHighlight | -moz-html-CellHighlightText | -moz-mac-accentdarkestshadow | -moz-mac-accentdarkshadow | -moz-mac-accentface | -moz-mac-accentlightesthighlight | -moz-mac-accentlightshadow | -moz-mac-accentregularhighlight | -moz-mac-accentregularshadow | -moz-mac-chrome-active | -moz-mac-chrome-inactive | -moz-mac-focusring | -moz-mac-menuselect | -moz-mac-menushadow | -moz-mac-menutextselect | -moz-MenuHover | -moz-MenuHoverText | -moz-MenuBarText | -moz-MenuBarHoverText | -moz-nativehyperlinktext | -moz-OddTreeRow | -moz-win-communicationstext | -moz-win-mediatext | -moz-activehyperlinktext | -moz-default-background-color | -moz-default-color | -moz-hyperlinktext | -moz-visitedhyperlinktext | -webkit-activelink | -webkit-focus-ring-color | -webkit-link | -webkit-text"
|
||||
},
|
||||
"-non-standard-image-rendering": {
|
||||
"comment": "non-standard keywords http://phrogz.net/tmp/canvas_image_zoom.html",
|
||||
"syntax": "optimize-contrast | -moz-crisp-edges | -o-crisp-edges | -webkit-optimize-contrast"
|
||||
},
|
||||
"-non-standard-overflow": {
|
||||
"comment": "non-standard keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow",
|
||||
"syntax": "-moz-scrollbars-none | -moz-scrollbars-horizontal | -moz-scrollbars-vertical | -moz-hidden-unscrollable"
|
||||
},
|
||||
"-non-standard-width": {
|
||||
"comment": "non-standard keywords https://developer.mozilla.org/en-US/docs/Web/CSS/width",
|
||||
"syntax": "fill-available | min-intrinsic | intrinsic | -moz-available | -moz-fit-content | -moz-min-content | -moz-max-content | -webkit-min-content | -webkit-max-content"
|
||||
},
|
||||
"-webkit-gradient()": {
|
||||
"comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/ - TODO: simplify when after match algorithm improvement ( [, point, radius | , point] -> [, radius]? , point )",
|
||||
"syntax": "-webkit-gradient( <-webkit-gradient-type>, <-webkit-gradient-point> [, <-webkit-gradient-point> | , <-webkit-gradient-radius>, <-webkit-gradient-point> ] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )"
|
||||
},
|
||||
"-webkit-gradient-color-stop": {
|
||||
"comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",
|
||||
"syntax": "from( <color> ) | color-stop( [ <number-zero-one> | <percentage> ] , <color> ) | to( <color> )"
|
||||
},
|
||||
"-webkit-gradient-point": {
|
||||
"comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",
|
||||
"syntax": "[ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]"
|
||||
},
|
||||
"-webkit-gradient-radius": {
|
||||
"comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",
|
||||
"syntax": "<length> | <percentage>"
|
||||
},
|
||||
"-webkit-gradient-type": {
|
||||
"comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",
|
||||
"syntax": "linear | radial"
|
||||
},
|
||||
"-webkit-mask-box-repeat": {
|
||||
"comment": "missed; https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-mask-box-image",
|
||||
"syntax": "repeat | stretch | round"
|
||||
},
|
||||
"-webkit-mask-clip-style": {
|
||||
"comment": "missed; there is no enough information about `-webkit-mask-clip` property, but looks like all those keywords are working",
|
||||
"syntax": "border | border-box | padding | padding-box | content | content-box | text"
|
||||
},
|
||||
"-ms-filter-function-list": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",
|
||||
"syntax": "<-ms-filter-function>+"
|
||||
},
|
||||
"-ms-filter-function": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",
|
||||
"syntax": "<-ms-filter-function-progid> | <-ms-filter-function-legacy>"
|
||||
},
|
||||
"-ms-filter-function-progid": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",
|
||||
"syntax": "'progid:' [ <ident-token> '.' ]* [ <ident-token> | <function-token> <any-value>? ) ]"
|
||||
},
|
||||
"-ms-filter-function-legacy": {
|
||||
"comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",
|
||||
"syntax": "<ident-token> | <function-token> <any-value>? )"
|
||||
},
|
||||
"-ms-filter": {
|
||||
"syntax": "<string>"
|
||||
},
|
||||
"age": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#voice-family",
|
||||
"syntax": "child | young | old"
|
||||
},
|
||||
"attr-name": {
|
||||
"syntax": "<wq-name>"
|
||||
},
|
||||
"attr-fallback": {
|
||||
"syntax": "<any-value>"
|
||||
},
|
||||
"border-radius": {
|
||||
"comment": "missed, https://drafts.csswg.org/css-backgrounds-3/#the-border-radius",
|
||||
"syntax": "<length-percentage>{1,2}"
|
||||
},
|
||||
"bottom": {
|
||||
"comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
|
||||
"syntax": "<length> | auto"
|
||||
},
|
||||
"content-list": {
|
||||
"comment": "missed -> https://drafts.csswg.org/css-content/#typedef-content-list (document-url, <target> and leader() is omitted util stabilization)",
|
||||
"syntax": "[ <string> | contents | <image> | <quote> | <target> | <leader()> | <attr()> | counter( <ident>, <'list-style-type'>? ) ]+"
|
||||
},
|
||||
"element()": {
|
||||
"comment": "https://drafts.csswg.org/css-gcpm/#element-syntax & https://drafts.csswg.org/css-images-4/#element-notation",
|
||||
"syntax": "element( <custom-ident> , [ first | start | last | first-except ]? ) | element( <id-selector> )"
|
||||
},
|
||||
"generic-voice": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#voice-family",
|
||||
"syntax": "[ <age>? <gender> <integer>? ]"
|
||||
},
|
||||
"gender": {
|
||||
"comment": "https://www.w3.org/TR/css3-speech/#voice-family",
|
||||
"syntax": "male | female | neutral"
|
||||
},
|
||||
"generic-family": {
|
||||
"comment": "added -apple-system",
|
||||
"references": [
|
||||
"https://webkit.org/blog/3709/using-the-system-font-in-web-content/"
|
||||
],
|
||||
"syntax": "| -apple-system"
|
||||
},
|
||||
"gradient": {
|
||||
"comment": "added legacy syntaxes support",
|
||||
"syntax": "| <-legacy-gradient>"
|
||||
},
|
||||
"left": {
|
||||
"comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
|
||||
"syntax": "<length> | auto"
|
||||
},
|
||||
"mask-image": {
|
||||
"comment": "missed; https://drafts.fxtf.org/css-masking-1/#the-mask-image",
|
||||
"syntax": "<mask-reference>#"
|
||||
},
|
||||
"name-repeat": {
|
||||
"comment": "missed, and looks like obsolete, keep it as is since other property syntaxes should be changed too; https://www.w3.org/TR/2015/WD-css-grid-1-20150917/#typedef-name-repeat",
|
||||
"syntax": "repeat( [ <positive-integer> | auto-fill ], <line-names>+)"
|
||||
},
|
||||
"named-color": {
|
||||
"comment": "added non standard color names",
|
||||
"syntax": "| <-non-standard-color>"
|
||||
},
|
||||
"paint": {
|
||||
"comment": "used by SVG https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint",
|
||||
"syntax": "none | <color> | <url> [ none | <color> ]? | context-fill | context-stroke"
|
||||
},
|
||||
"page-size": {
|
||||
"comment": "https://www.w3.org/TR/css-page-3/#typedef-page-size-page-size",
|
||||
"syntax": "A5 | A4 | A3 | B5 | B4 | JIS-B5 | JIS-B4 | letter | legal | ledger"
|
||||
},
|
||||
"ratio": {
|
||||
"comment": "missed, https://drafts.csswg.org/mediaqueries-4/#typedef-ratio",
|
||||
"syntax": "<integer> / <integer>"
|
||||
},
|
||||
"right": {
|
||||
"comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
|
||||
"syntax": "<length> | auto"
|
||||
},
|
||||
"shape": {
|
||||
"comment": "missed spaces in function body and add backwards compatible syntax",
|
||||
"syntax": "rect( <top>, <right>, <bottom>, <left> ) | rect( <top> <right> <bottom> <left> )"
|
||||
},
|
||||
"svg-length": {
|
||||
"comment": "All coordinates and lengths in SVG can be specified with or without a unit identifier",
|
||||
"references": [
|
||||
"https://www.w3.org/TR/SVG11/coords.html#Units"
|
||||
],
|
||||
"syntax": "<percentage> | <length> | <number>"
|
||||
},
|
||||
"svg-writing-mode": {
|
||||
"comment": "SVG specific keywords (deprecated for CSS)",
|
||||
"references": [
|
||||
"https://developer.mozilla.org/en/docs/Web/CSS/writing-mode",
|
||||
"https://www.w3.org/TR/SVG/text.html#WritingModeProperty"
|
||||
],
|
||||
"syntax": "lr-tb | rl-tb | tb-rl | lr | rl | tb"
|
||||
},
|
||||
"top": {
|
||||
"comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
|
||||
"syntax": "<length> | auto"
|
||||
},
|
||||
"track-group": {
|
||||
"comment": "used by old grid-columns and grid-rows syntax v0",
|
||||
"syntax": "'(' [ <string>* <track-minmax> <string>* ]+ ')' [ '[' <positive-integer> ']' ]? | <track-minmax>"
|
||||
},
|
||||
"track-list-v0": {
|
||||
"comment": "used by old grid-columns and grid-rows syntax v0",
|
||||
"syntax": "[ <string>* <track-group> <string>* ]+ | none"
|
||||
},
|
||||
"track-minmax": {
|
||||
"comment": "used by old grid-columns and grid-rows syntax v0",
|
||||
"syntax": "minmax( <track-breadth> , <track-breadth> ) | auto | <track-breadth> | fit-content"
|
||||
},
|
||||
"x": {
|
||||
"comment": "missed; not sure we should add it, but no others except `cursor` is using it so it's ok for now; https://drafts.csswg.org/css-ui-3/#cursor",
|
||||
"syntax": "<number>"
|
||||
},
|
||||
"y": {
|
||||
"comment": "missed; not sure we should add it, but no others except `cursor` is using so it's ok for now; https://drafts.csswg.org/css-ui-3/#cursor",
|
||||
"syntax": "<number>"
|
||||
},
|
||||
"declaration": {
|
||||
"comment": "missed, restored by https://drafts.csswg.org/css-syntax",
|
||||
"syntax": "<ident-token> : <declaration-value>? [ '!' important ]?"
|
||||
},
|
||||
"declaration-list": {
|
||||
"comment": "missed, restored by https://drafts.csswg.org/css-syntax",
|
||||
"syntax": "[ <declaration>? ';' ]* <declaration>?"
|
||||
},
|
||||
"url": {
|
||||
"comment": "https://drafts.csswg.org/css-values-4/#urls",
|
||||
"syntax": "url( <string> <url-modifier>* ) | <url-token>"
|
||||
},
|
||||
"url-modifier": {
|
||||
"comment": "https://drafts.csswg.org/css-values-4/#typedef-url-modifier",
|
||||
"syntax": "<ident> | <function-token> <any-value> )"
|
||||
},
|
||||
"number-zero-one": {
|
||||
"syntax": "<number [0,1]>"
|
||||
},
|
||||
"number-one-or-greater": {
|
||||
"syntax": "<number [1,∞]>"
|
||||
},
|
||||
"positive-integer": {
|
||||
"syntax": "<integer [0,∞]>"
|
||||
},
|
||||
"-non-standard-display": {
|
||||
"syntax": "-ms-inline-flexbox | -ms-grid | -ms-inline-grid | -webkit-flex | -webkit-inline-flex | -webkit-box | -webkit-inline-box | -moz-inline-stack | -moz-box | -moz-inline-box"
|
||||
}
|
||||
}
|
||||
}
|
||||
12606
node_modules/laravel-mix/node_modules/css-tree/dist/csstree.js
generated
vendored
Normal file
12606
node_modules/laravel-mix/node_modules/css-tree/dist/csstree.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/laravel-mix/node_modules/css-tree/dist/csstree.min.js
generated
vendored
Normal file
1
node_modules/laravel-mix/node_modules/css-tree/dist/csstree.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
576
node_modules/laravel-mix/node_modules/css-tree/lib/common/List.js
generated
vendored
Executable file
576
node_modules/laravel-mix/node_modules/css-tree/lib/common/List.js
generated
vendored
Executable file
@@ -0,0 +1,576 @@
|
||||
//
|
||||
// list
|
||||
// ┌──────┐
|
||||
// ┌──────────────┼─head │
|
||||
// │ │ tail─┼──────────────┐
|
||||
// │ └──────┘ │
|
||||
// ▼ ▼
|
||||
// item item item item
|
||||
// ┌──────┐ ┌──────┐ ┌──────┐ ┌──────┐
|
||||
// null ◀──┼─prev │◀───┼─prev │◀───┼─prev │◀───┼─prev │
|
||||
// │ next─┼───▶│ next─┼───▶│ next─┼───▶│ next─┼──▶ null
|
||||
// ├──────┤ ├──────┤ ├──────┤ ├──────┤
|
||||
// │ data │ │ data │ │ data │ │ data │
|
||||
// └──────┘ └──────┘ └──────┘ └──────┘
|
||||
//
|
||||
|
||||
function createItem(data) {
|
||||
return {
|
||||
prev: null,
|
||||
next: null,
|
||||
data: data
|
||||
};
|
||||
}
|
||||
|
||||
function allocateCursor(node, prev, next) {
|
||||
var cursor;
|
||||
|
||||
if (cursors !== null) {
|
||||
cursor = cursors;
|
||||
cursors = cursors.cursor;
|
||||
cursor.prev = prev;
|
||||
cursor.next = next;
|
||||
cursor.cursor = node.cursor;
|
||||
} else {
|
||||
cursor = {
|
||||
prev: prev,
|
||||
next: next,
|
||||
cursor: node.cursor
|
||||
};
|
||||
}
|
||||
|
||||
node.cursor = cursor;
|
||||
|
||||
return cursor;
|
||||
}
|
||||
|
||||
function releaseCursor(node) {
|
||||
var cursor = node.cursor;
|
||||
|
||||
node.cursor = cursor.cursor;
|
||||
cursor.prev = null;
|
||||
cursor.next = null;
|
||||
cursor.cursor = cursors;
|
||||
cursors = cursor;
|
||||
}
|
||||
|
||||
var cursors = null;
|
||||
var List = function() {
|
||||
this.cursor = null;
|
||||
this.head = null;
|
||||
this.tail = null;
|
||||
};
|
||||
|
||||
List.createItem = createItem;
|
||||
List.prototype.createItem = createItem;
|
||||
|
||||
List.prototype.updateCursors = function(prevOld, prevNew, nextOld, nextNew) {
|
||||
var cursor = this.cursor;
|
||||
|
||||
while (cursor !== null) {
|
||||
if (cursor.prev === prevOld) {
|
||||
cursor.prev = prevNew;
|
||||
}
|
||||
|
||||
if (cursor.next === nextOld) {
|
||||
cursor.next = nextNew;
|
||||
}
|
||||
|
||||
cursor = cursor.cursor;
|
||||
}
|
||||
};
|
||||
|
||||
List.prototype.getSize = function() {
|
||||
var size = 0;
|
||||
var cursor = this.head;
|
||||
|
||||
while (cursor) {
|
||||
size++;
|
||||
cursor = cursor.next;
|
||||
}
|
||||
|
||||
return size;
|
||||
};
|
||||
|
||||
List.prototype.fromArray = function(array) {
|
||||
var cursor = null;
|
||||
|
||||
this.head = null;
|
||||
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
var item = createItem(array[i]);
|
||||
|
||||
if (cursor !== null) {
|
||||
cursor.next = item;
|
||||
} else {
|
||||
this.head = item;
|
||||
}
|
||||
|
||||
item.prev = cursor;
|
||||
cursor = item;
|
||||
}
|
||||
|
||||
this.tail = cursor;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
List.prototype.toArray = function() {
|
||||
var cursor = this.head;
|
||||
var result = [];
|
||||
|
||||
while (cursor) {
|
||||
result.push(cursor.data);
|
||||
cursor = cursor.next;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
List.prototype.toJSON = List.prototype.toArray;
|
||||
|
||||
List.prototype.isEmpty = function() {
|
||||
return this.head === null;
|
||||
};
|
||||
|
||||
List.prototype.first = function() {
|
||||
return this.head && this.head.data;
|
||||
};
|
||||
|
||||
List.prototype.last = function() {
|
||||
return this.tail && this.tail.data;
|
||||
};
|
||||
|
||||
List.prototype.each = function(fn, context) {
|
||||
var item;
|
||||
|
||||
if (context === undefined) {
|
||||
context = this;
|
||||
}
|
||||
|
||||
// push cursor
|
||||
var cursor = allocateCursor(this, null, this.head);
|
||||
|
||||
while (cursor.next !== null) {
|
||||
item = cursor.next;
|
||||
cursor.next = item.next;
|
||||
|
||||
fn.call(context, item.data, item, this);
|
||||
}
|
||||
|
||||
// pop cursor
|
||||
releaseCursor(this);
|
||||
};
|
||||
|
||||
List.prototype.forEach = List.prototype.each;
|
||||
|
||||
List.prototype.eachRight = function(fn, context) {
|
||||
var item;
|
||||
|
||||
if (context === undefined) {
|
||||
context = this;
|
||||
}
|
||||
|
||||
// push cursor
|
||||
var cursor = allocateCursor(this, this.tail, null);
|
||||
|
||||
while (cursor.prev !== null) {
|
||||
item = cursor.prev;
|
||||
cursor.prev = item.prev;
|
||||
|
||||
fn.call(context, item.data, item, this);
|
||||
}
|
||||
|
||||
// pop cursor
|
||||
releaseCursor(this);
|
||||
};
|
||||
|
||||
List.prototype.forEachRight = List.prototype.eachRight;
|
||||
|
||||
List.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.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.prototype.nextUntil = function(start, fn, context) {
|
||||
if (start === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var item;
|
||||
|
||||
if (context === undefined) {
|
||||
context = this;
|
||||
}
|
||||
|
||||
// push cursor
|
||||
var cursor = allocateCursor(this, null, start);
|
||||
|
||||
while (cursor.next !== null) {
|
||||
item = cursor.next;
|
||||
cursor.next = item.next;
|
||||
|
||||
if (fn.call(context, item.data, item, this)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// pop cursor
|
||||
releaseCursor(this);
|
||||
};
|
||||
|
||||
List.prototype.prevUntil = function(start, fn, context) {
|
||||
if (start === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
var item;
|
||||
|
||||
if (context === undefined) {
|
||||
context = this;
|
||||
}
|
||||
|
||||
// push cursor
|
||||
var cursor = allocateCursor(this, start, null);
|
||||
|
||||
while (cursor.prev !== null) {
|
||||
item = cursor.prev;
|
||||
cursor.prev = item.prev;
|
||||
|
||||
if (fn.call(context, item.data, item, this)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// pop cursor
|
||||
releaseCursor(this);
|
||||
};
|
||||
|
||||
List.prototype.some = function(fn, context) {
|
||||
var cursor = this.head;
|
||||
|
||||
if (context === undefined) {
|
||||
context = this;
|
||||
}
|
||||
|
||||
while (cursor !== null) {
|
||||
if (fn.call(context, cursor.data, cursor, this)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
cursor = cursor.next;
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
List.prototype.map = function(fn, context) {
|
||||
var result = new List();
|
||||
var cursor = this.head;
|
||||
|
||||
if (context === undefined) {
|
||||
context = this;
|
||||
}
|
||||
|
||||
while (cursor !== null) {
|
||||
result.appendData(fn.call(context, cursor.data, cursor, this));
|
||||
cursor = cursor.next;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
List.prototype.filter = function(fn, context) {
|
||||
var result = new List();
|
||||
var cursor = this.head;
|
||||
|
||||
if (context === undefined) {
|
||||
context = this;
|
||||
}
|
||||
|
||||
while (cursor !== null) {
|
||||
if (fn.call(context, cursor.data, cursor, this)) {
|
||||
result.appendData(cursor.data);
|
||||
}
|
||||
cursor = cursor.next;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
List.prototype.clear = function() {
|
||||
this.head = null;
|
||||
this.tail = null;
|
||||
};
|
||||
|
||||
List.prototype.copy = function() {
|
||||
var result = new List();
|
||||
var cursor = this.head;
|
||||
|
||||
while (cursor !== null) {
|
||||
result.insert(createItem(cursor.data));
|
||||
cursor = cursor.next;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
List.prototype.prepend = function(item) {
|
||||
// head
|
||||
// ^
|
||||
// item
|
||||
this.updateCursors(null, item, this.head, item);
|
||||
|
||||
// insert to the beginning of the list
|
||||
if (this.head !== null) {
|
||||
// new item <- first item
|
||||
this.head.prev = item;
|
||||
|
||||
// new item -> first item
|
||||
item.next = this.head;
|
||||
} else {
|
||||
// if list has no head, then it also has no tail
|
||||
// in this case tail points to the new item
|
||||
this.tail = item;
|
||||
}
|
||||
|
||||
// head always points to new item
|
||||
this.head = item;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
List.prototype.prependData = function(data) {
|
||||
return this.prepend(createItem(data));
|
||||
};
|
||||
|
||||
List.prototype.append = function(item) {
|
||||
return this.insert(item);
|
||||
};
|
||||
|
||||
List.prototype.appendData = function(data) {
|
||||
return this.insert(createItem(data));
|
||||
};
|
||||
|
||||
List.prototype.insert = function(item, before) {
|
||||
if (before !== undefined && before !== null) {
|
||||
// prev before
|
||||
// ^
|
||||
// item
|
||||
this.updateCursors(before.prev, item, before, item);
|
||||
|
||||
if (before.prev === null) {
|
||||
// insert to the beginning of list
|
||||
if (this.head !== before) {
|
||||
throw new Error('before doesn\'t belong to list');
|
||||
}
|
||||
|
||||
// since head points to before therefore list doesn't empty
|
||||
// no need to check tail
|
||||
this.head = item;
|
||||
before.prev = item;
|
||||
item.next = before;
|
||||
|
||||
this.updateCursors(null, item);
|
||||
} else {
|
||||
|
||||
// insert between two items
|
||||
before.prev.next = item;
|
||||
item.prev = before.prev;
|
||||
|
||||
before.prev = item;
|
||||
item.next = before;
|
||||
}
|
||||
} else {
|
||||
// tail
|
||||
// ^
|
||||
// item
|
||||
this.updateCursors(this.tail, item, null, item);
|
||||
|
||||
// insert to the ending of the list
|
||||
if (this.tail !== null) {
|
||||
// last item -> new item
|
||||
this.tail.next = item;
|
||||
|
||||
// last item <- new item
|
||||
item.prev = this.tail;
|
||||
} else {
|
||||
// if list has no tail, then it also has no head
|
||||
// in this case head points to new item
|
||||
this.head = item;
|
||||
}
|
||||
|
||||
// tail always points to new item
|
||||
this.tail = item;
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
List.prototype.insertData = function(data, before) {
|
||||
return this.insert(createItem(data), before);
|
||||
};
|
||||
|
||||
List.prototype.remove = function(item) {
|
||||
// item
|
||||
// ^
|
||||
// prev next
|
||||
this.updateCursors(item, item.prev, item, item.next);
|
||||
|
||||
if (item.prev !== null) {
|
||||
item.prev.next = item.next;
|
||||
} else {
|
||||
if (this.head !== item) {
|
||||
throw new Error('item doesn\'t belong to list');
|
||||
}
|
||||
|
||||
this.head = item.next;
|
||||
}
|
||||
|
||||
if (item.next !== null) {
|
||||
item.next.prev = item.prev;
|
||||
} else {
|
||||
if (this.tail !== item) {
|
||||
throw new Error('item doesn\'t belong to list');
|
||||
}
|
||||
|
||||
this.tail = item.prev;
|
||||
}
|
||||
|
||||
item.prev = null;
|
||||
item.next = null;
|
||||
|
||||
return item;
|
||||
};
|
||||
|
||||
List.prototype.push = function(data) {
|
||||
this.insert(createItem(data));
|
||||
};
|
||||
|
||||
List.prototype.pop = function() {
|
||||
if (this.tail !== null) {
|
||||
return this.remove(this.tail);
|
||||
}
|
||||
};
|
||||
|
||||
List.prototype.unshift = function(data) {
|
||||
this.prepend(createItem(data));
|
||||
};
|
||||
|
||||
List.prototype.shift = function() {
|
||||
if (this.head !== null) {
|
||||
return this.remove(this.head);
|
||||
}
|
||||
};
|
||||
|
||||
List.prototype.prependList = function(list) {
|
||||
return this.insertList(list, this.head);
|
||||
};
|
||||
|
||||
List.prototype.appendList = function(list) {
|
||||
return this.insertList(list);
|
||||
};
|
||||
|
||||
List.prototype.insertList = function(list, before) {
|
||||
// ignore empty lists
|
||||
if (list.head === null) {
|
||||
return this;
|
||||
}
|
||||
|
||||
if (before !== undefined && before !== null) {
|
||||
this.updateCursors(before.prev, list.tail, before, list.head);
|
||||
|
||||
// insert in the middle of dist list
|
||||
if (before.prev !== null) {
|
||||
// before.prev <-> list.head
|
||||
before.prev.next = list.head;
|
||||
list.head.prev = before.prev;
|
||||
} else {
|
||||
this.head = list.head;
|
||||
}
|
||||
|
||||
before.prev = list.tail;
|
||||
list.tail.next = before;
|
||||
} else {
|
||||
this.updateCursors(this.tail, list.tail, null, list.head);
|
||||
|
||||
// insert to end of the list
|
||||
if (this.tail !== null) {
|
||||
// if destination list has a tail, then it also has a head,
|
||||
// but head doesn't change
|
||||
|
||||
// dest tail -> source head
|
||||
this.tail.next = list.head;
|
||||
|
||||
// dest tail <- source head
|
||||
list.head.prev = this.tail;
|
||||
} else {
|
||||
// if list has no a tail, then it also has no a head
|
||||
// in this case points head to new item
|
||||
this.head = list.head;
|
||||
}
|
||||
|
||||
// tail always start point to new item
|
||||
this.tail = list.tail;
|
||||
}
|
||||
|
||||
list.head = null;
|
||||
list.tail = null;
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
List.prototype.replace = function(oldItem, newItemOrList) {
|
||||
if ('head' in newItemOrList) {
|
||||
this.insertList(newItemOrList, oldItem);
|
||||
} else {
|
||||
this.insert(newItemOrList, oldItem);
|
||||
}
|
||||
|
||||
this.remove(oldItem);
|
||||
};
|
||||
|
||||
module.exports = List;
|
||||
91
node_modules/laravel-mix/node_modules/css-tree/lib/common/OffsetToLocation.js
generated
vendored
Executable file
91
node_modules/laravel-mix/node_modules/css-tree/lib/common/OffsetToLocation.js
generated
vendored
Executable file
@@ -0,0 +1,91 @@
|
||||
var adoptBuffer = require('./adopt-buffer');
|
||||
var isBOM = require('../tokenizer').isBOM;
|
||||
|
||||
var N = 10;
|
||||
var F = 12;
|
||||
var R = 13;
|
||||
|
||||
function computeLinesAndColumns(host, source) {
|
||||
var sourceLength = source.length;
|
||||
var lines = adoptBuffer(host.lines, sourceLength); // +1
|
||||
var line = host.startLine;
|
||||
var columns = adoptBuffer(host.columns, sourceLength);
|
||||
var column = host.startColumn;
|
||||
var startOffset = source.length > 0 ? isBOM(source.charCodeAt(0)) : 0;
|
||||
|
||||
for (var i = startOffset; i < sourceLength; i++) { // -1
|
||||
var code = source.charCodeAt(i);
|
||||
|
||||
lines[i] = line;
|
||||
columns[i] = column++;
|
||||
|
||||
if (code === N || code === R || code === F) {
|
||||
if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N) {
|
||||
i++;
|
||||
lines[i] = line;
|
||||
columns[i] = column;
|
||||
}
|
||||
|
||||
line++;
|
||||
column = 1;
|
||||
}
|
||||
}
|
||||
|
||||
lines[i] = line;
|
||||
columns[i] = column;
|
||||
|
||||
host.lines = lines;
|
||||
host.columns = columns;
|
||||
}
|
||||
|
||||
var OffsetToLocation = function() {
|
||||
this.lines = null;
|
||||
this.columns = null;
|
||||
this.linesAndColumnsComputed = false;
|
||||
};
|
||||
|
||||
OffsetToLocation.prototype = {
|
||||
setSource: function(source, startOffset, startLine, startColumn) {
|
||||
this.source = source;
|
||||
this.startOffset = typeof startOffset === 'undefined' ? 0 : startOffset;
|
||||
this.startLine = typeof startLine === 'undefined' ? 1 : startLine;
|
||||
this.startColumn = typeof startColumn === 'undefined' ? 1 : startColumn;
|
||||
this.linesAndColumnsComputed = false;
|
||||
},
|
||||
|
||||
ensureLinesAndColumnsComputed: function() {
|
||||
if (!this.linesAndColumnsComputed) {
|
||||
computeLinesAndColumns(this, this.source);
|
||||
this.linesAndColumnsComputed = true;
|
||||
}
|
||||
},
|
||||
getLocation: function(offset, filename) {
|
||||
this.ensureLinesAndColumnsComputed();
|
||||
|
||||
return {
|
||||
source: filename,
|
||||
offset: this.startOffset + offset,
|
||||
line: this.lines[offset],
|
||||
column: this.columns[offset]
|
||||
};
|
||||
},
|
||||
getLocationRange: function(start, end, filename) {
|
||||
this.ensureLinesAndColumnsComputed();
|
||||
|
||||
return {
|
||||
source: filename,
|
||||
start: {
|
||||
offset: this.startOffset + start,
|
||||
line: this.lines[start],
|
||||
column: this.columns[start]
|
||||
},
|
||||
end: {
|
||||
offset: this.startOffset + end,
|
||||
line: this.lines[end],
|
||||
column: this.columns[end]
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = OffsetToLocation;
|
||||
82
node_modules/laravel-mix/node_modules/css-tree/lib/common/SyntaxError.js
generated
vendored
Executable file
82
node_modules/laravel-mix/node_modules/css-tree/lib/common/SyntaxError.js
generated
vendored
Executable file
@@ -0,0 +1,82 @@
|
||||
var createCustomError = require('../utils/createCustomError');
|
||||
var MAX_LINE_LENGTH = 100;
|
||||
var OFFSET_CORRECTION = 60;
|
||||
var TAB_REPLACEMENT = ' ';
|
||||
|
||||
function sourceFragment(error, extraLines) {
|
||||
function processLines(start, end) {
|
||||
return lines.slice(start, end).map(function(line, idx) {
|
||||
var num = String(start + idx + 1);
|
||||
|
||||
while (num.length < maxNumLength) {
|
||||
num = ' ' + num;
|
||||
}
|
||||
|
||||
return num + ' |' + line;
|
||||
}).join('\n');
|
||||
}
|
||||
|
||||
var lines = error.source.split(/\r\n?|\n|\f/);
|
||||
var line = error.line;
|
||||
var column = error.column;
|
||||
var startLine = Math.max(1, line - extraLines) - 1;
|
||||
var endLine = Math.min(line + extraLines, lines.length + 1);
|
||||
var maxNumLength = Math.max(4, String(endLine).length) + 1;
|
||||
var cutLeft = 0;
|
||||
|
||||
// column correction according to replaced tab before column
|
||||
column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\t/g) || []).length;
|
||||
|
||||
if (column > MAX_LINE_LENGTH) {
|
||||
cutLeft = column - OFFSET_CORRECTION + 3;
|
||||
column = OFFSET_CORRECTION - 2;
|
||||
}
|
||||
|
||||
for (var i = startLine; i <= endLine; i++) {
|
||||
if (i >= 0 && i < lines.length) {
|
||||
lines[i] = lines[i].replace(/\t/g, TAB_REPLACEMENT);
|
||||
lines[i] =
|
||||
(cutLeft > 0 && lines[i].length > cutLeft ? '\u2026' : '') +
|
||||
lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +
|
||||
(lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\u2026' : '');
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
processLines(startLine, line),
|
||||
new Array(column + maxNumLength + 2).join('-') + '^',
|
||||
processLines(line, endLine)
|
||||
].filter(Boolean).join('\n');
|
||||
}
|
||||
|
||||
var SyntaxError = function(message, source, offset, line, column) {
|
||||
var error = createCustomError('SyntaxError', message);
|
||||
|
||||
error.source = source;
|
||||
error.offset = offset;
|
||||
error.line = line;
|
||||
error.column = column;
|
||||
|
||||
error.sourceFragment = function(extraLines) {
|
||||
return sourceFragment(error, isNaN(extraLines) ? 0 : extraLines);
|
||||
};
|
||||
Object.defineProperty(error, 'formattedMessage', {
|
||||
get: function() {
|
||||
return (
|
||||
'Parse error: ' + error.message + '\n' +
|
||||
sourceFragment(error, 2)
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
// for backward capability
|
||||
error.parseError = {
|
||||
offset: offset,
|
||||
line: line,
|
||||
column: column
|
||||
};
|
||||
|
||||
return error;
|
||||
};
|
||||
|
||||
module.exports = SyntaxError;
|
||||
219
node_modules/laravel-mix/node_modules/css-tree/lib/common/TokenStream.js
generated
vendored
Executable file
219
node_modules/laravel-mix/node_modules/css-tree/lib/common/TokenStream.js
generated
vendored
Executable file
@@ -0,0 +1,219 @@
|
||||
var constants = require('../tokenizer/const');
|
||||
var TYPE = constants.TYPE;
|
||||
var NAME = constants.NAME;
|
||||
|
||||
var utils = require('../tokenizer/utils');
|
||||
var cmpStr = utils.cmpStr;
|
||||
|
||||
var EOF = TYPE.EOF;
|
||||
var WHITESPACE = TYPE.WhiteSpace;
|
||||
var COMMENT = TYPE.Comment;
|
||||
|
||||
var OFFSET_MASK = 0x00FFFFFF;
|
||||
var TYPE_SHIFT = 24;
|
||||
|
||||
var TokenStream = function() {
|
||||
this.offsetAndType = null;
|
||||
this.balance = null;
|
||||
|
||||
this.reset();
|
||||
};
|
||||
|
||||
TokenStream.prototype = {
|
||||
reset: function() {
|
||||
this.eof = false;
|
||||
this.tokenIndex = -1;
|
||||
this.tokenType = 0;
|
||||
this.tokenStart = this.firstCharOffset;
|
||||
this.tokenEnd = this.firstCharOffset;
|
||||
},
|
||||
|
||||
lookupType: function(offset) {
|
||||
offset += this.tokenIndex;
|
||||
|
||||
if (offset < this.tokenCount) {
|
||||
return this.offsetAndType[offset] >> TYPE_SHIFT;
|
||||
}
|
||||
|
||||
return EOF;
|
||||
},
|
||||
lookupOffset: function(offset) {
|
||||
offset += this.tokenIndex;
|
||||
|
||||
if (offset < this.tokenCount) {
|
||||
return this.offsetAndType[offset - 1] & OFFSET_MASK;
|
||||
}
|
||||
|
||||
return this.source.length;
|
||||
},
|
||||
lookupValue: function(offset, referenceStr) {
|
||||
offset += this.tokenIndex;
|
||||
|
||||
if (offset < this.tokenCount) {
|
||||
return cmpStr(
|
||||
this.source,
|
||||
this.offsetAndType[offset - 1] & OFFSET_MASK,
|
||||
this.offsetAndType[offset] & OFFSET_MASK,
|
||||
referenceStr
|
||||
);
|
||||
}
|
||||
|
||||
return false;
|
||||
},
|
||||
getTokenStart: function(tokenIndex) {
|
||||
if (tokenIndex === this.tokenIndex) {
|
||||
return this.tokenStart;
|
||||
}
|
||||
|
||||
if (tokenIndex > 0) {
|
||||
return tokenIndex < this.tokenCount
|
||||
? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK
|
||||
: this.offsetAndType[this.tokenCount] & OFFSET_MASK;
|
||||
}
|
||||
|
||||
return this.firstCharOffset;
|
||||
},
|
||||
|
||||
// TODO: -> skipUntilBalanced
|
||||
getRawLength: function(startToken, mode) {
|
||||
var cursor = startToken;
|
||||
var balanceEnd;
|
||||
var offset = this.offsetAndType[Math.max(cursor - 1, 0)] & OFFSET_MASK;
|
||||
var type;
|
||||
|
||||
loop:
|
||||
for (; cursor < this.tokenCount; cursor++) {
|
||||
balanceEnd = this.balance[cursor];
|
||||
|
||||
// stop scanning on balance edge that points to offset before start token
|
||||
if (balanceEnd < startToken) {
|
||||
break loop;
|
||||
}
|
||||
|
||||
type = this.offsetAndType[cursor] >> TYPE_SHIFT;
|
||||
|
||||
// check token is stop type
|
||||
switch (mode(type, this.source, offset)) {
|
||||
case 1:
|
||||
break loop;
|
||||
|
||||
case 2:
|
||||
cursor++;
|
||||
break loop;
|
||||
|
||||
default:
|
||||
// fast forward to the end of balanced block
|
||||
if (this.balance[balanceEnd] === cursor) {
|
||||
cursor = balanceEnd;
|
||||
}
|
||||
|
||||
offset = this.offsetAndType[cursor] & OFFSET_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
return cursor - this.tokenIndex;
|
||||
},
|
||||
isBalanceEdge: function(pos) {
|
||||
return this.balance[this.tokenIndex] < pos;
|
||||
},
|
||||
isDelim: function(code, offset) {
|
||||
if (offset) {
|
||||
return (
|
||||
this.lookupType(offset) === TYPE.Delim &&
|
||||
this.source.charCodeAt(this.lookupOffset(offset)) === code
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
this.tokenType === TYPE.Delim &&
|
||||
this.source.charCodeAt(this.tokenStart) === code
|
||||
);
|
||||
},
|
||||
|
||||
getTokenValue: function() {
|
||||
return this.source.substring(this.tokenStart, this.tokenEnd);
|
||||
},
|
||||
getTokenLength: function() {
|
||||
return this.tokenEnd - this.tokenStart;
|
||||
},
|
||||
substrToCursor: function(start) {
|
||||
return this.source.substring(start, this.tokenStart);
|
||||
},
|
||||
|
||||
skipWS: function() {
|
||||
for (var i = this.tokenIndex, skipTokenCount = 0; i < this.tokenCount; i++, skipTokenCount++) {
|
||||
if ((this.offsetAndType[i] >> TYPE_SHIFT) !== WHITESPACE) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (skipTokenCount > 0) {
|
||||
this.skip(skipTokenCount);
|
||||
}
|
||||
},
|
||||
skipSC: function() {
|
||||
while (this.tokenType === WHITESPACE || this.tokenType === COMMENT) {
|
||||
this.next();
|
||||
}
|
||||
},
|
||||
skip: function(tokenCount) {
|
||||
var next = this.tokenIndex + tokenCount;
|
||||
|
||||
if (next < this.tokenCount) {
|
||||
this.tokenIndex = next;
|
||||
this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;
|
||||
next = this.offsetAndType[next];
|
||||
this.tokenType = next >> TYPE_SHIFT;
|
||||
this.tokenEnd = next & OFFSET_MASK;
|
||||
} else {
|
||||
this.tokenIndex = this.tokenCount;
|
||||
this.next();
|
||||
}
|
||||
},
|
||||
next: function() {
|
||||
var next = this.tokenIndex + 1;
|
||||
|
||||
if (next < this.tokenCount) {
|
||||
this.tokenIndex = next;
|
||||
this.tokenStart = this.tokenEnd;
|
||||
next = this.offsetAndType[next];
|
||||
this.tokenType = next >> TYPE_SHIFT;
|
||||
this.tokenEnd = next & OFFSET_MASK;
|
||||
} else {
|
||||
this.tokenIndex = this.tokenCount;
|
||||
this.eof = true;
|
||||
this.tokenType = EOF;
|
||||
this.tokenStart = this.tokenEnd = this.source.length;
|
||||
}
|
||||
},
|
||||
|
||||
forEachToken(fn) {
|
||||
for (var i = 0, offset = this.firstCharOffset; i < this.tokenCount; i++) {
|
||||
var start = offset;
|
||||
var item = this.offsetAndType[i];
|
||||
var end = item & OFFSET_MASK;
|
||||
var type = item >> TYPE_SHIFT;
|
||||
|
||||
offset = end;
|
||||
|
||||
fn(type, start, end, i);
|
||||
}
|
||||
},
|
||||
|
||||
dump() {
|
||||
var tokens = new Array(this.tokenCount);
|
||||
|
||||
this.forEachToken((type, start, end, index) => {
|
||||
tokens[index] = {
|
||||
idx: index,
|
||||
type: NAME[type],
|
||||
chunk: this.source.substring(start, end),
|
||||
balance: this.balance[index]
|
||||
};
|
||||
});
|
||||
|
||||
return tokens;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = TokenStream;
|
||||
10
node_modules/laravel-mix/node_modules/css-tree/lib/common/adopt-buffer.js
generated
vendored
Executable file
10
node_modules/laravel-mix/node_modules/css-tree/lib/common/adopt-buffer.js
generated
vendored
Executable file
@@ -0,0 +1,10 @@
|
||||
var MIN_SIZE = 16 * 1024;
|
||||
var SafeUint32Array = typeof Uint32Array !== 'undefined' ? Uint32Array : Array; // fallback on Array when TypedArray is not supported
|
||||
|
||||
module.exports = function adoptBuffer(buffer, size) {
|
||||
if (buffer === null || buffer.length < size) {
|
||||
return new SafeUint32Array(Math.max(size + 1024, MIN_SIZE));
|
||||
}
|
||||
|
||||
return buffer;
|
||||
};
|
||||
28
node_modules/laravel-mix/node_modules/css-tree/lib/convertor/create.js
generated
vendored
Normal file
28
node_modules/laravel-mix/node_modules/css-tree/lib/convertor/create.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
var List = require('../common/List');
|
||||
|
||||
module.exports = function createConvertors(walk) {
|
||||
return {
|
||||
fromPlainObject: function(ast) {
|
||||
walk(ast, {
|
||||
enter: function(node) {
|
||||
if (node.children && node.children instanceof List === false) {
|
||||
node.children = new List().fromArray(node.children);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return ast;
|
||||
},
|
||||
toPlainObject: function(ast) {
|
||||
walk(ast, {
|
||||
leave: function(node) {
|
||||
if (node.children && node.children instanceof List) {
|
||||
node.children = node.children.toArray();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return ast;
|
||||
}
|
||||
};
|
||||
};
|
||||
3
node_modules/laravel-mix/node_modules/css-tree/lib/convertor/index.js
generated
vendored
Normal file
3
node_modules/laravel-mix/node_modules/css-tree/lib/convertor/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var createConvertor = require('./create');
|
||||
|
||||
module.exports = createConvertor(require('../walker'));
|
||||
14
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/SyntaxError.js
generated
vendored
Normal file
14
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/SyntaxError.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
var createCustomError = require('../utils/createCustomError');
|
||||
|
||||
module.exports = function SyntaxError(message, input, offset) {
|
||||
var error = createCustomError('SyntaxError', message);
|
||||
|
||||
error.input = input;
|
||||
error.offset = offset;
|
||||
error.rawMessage = message;
|
||||
error.message = error.rawMessage + '\n' +
|
||||
' ' + error.input + '\n' +
|
||||
'--' + new Array((error.offset || error.input.length) + 1).join('-') + '^';
|
||||
|
||||
return error;
|
||||
};
|
||||
129
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/generate.js
generated
vendored
Normal file
129
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/generate.js
generated
vendored
Normal file
@@ -0,0 +1,129 @@
|
||||
function noop(value) {
|
||||
return value;
|
||||
}
|
||||
|
||||
function generateMultiplier(multiplier) {
|
||||
if (multiplier.min === 0 && multiplier.max === 0) {
|
||||
return '*';
|
||||
}
|
||||
|
||||
if (multiplier.min === 0 && multiplier.max === 1) {
|
||||
return '?';
|
||||
}
|
||||
|
||||
if (multiplier.min === 1 && multiplier.max === 0) {
|
||||
return multiplier.comma ? '#' : '+';
|
||||
}
|
||||
|
||||
if (multiplier.min === 1 && multiplier.max === 1) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return (
|
||||
(multiplier.comma ? '#' : '') +
|
||||
(multiplier.min === multiplier.max
|
||||
? '{' + multiplier.min + '}'
|
||||
: '{' + multiplier.min + ',' + (multiplier.max !== 0 ? multiplier.max : '') + '}'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function generateTypeOpts(node) {
|
||||
switch (node.type) {
|
||||
case 'Range':
|
||||
return (
|
||||
' [' +
|
||||
(node.min === null ? '-∞' : node.min) +
|
||||
',' +
|
||||
(node.max === null ? '∞' : node.max) +
|
||||
']'
|
||||
);
|
||||
|
||||
default:
|
||||
throw new Error('Unknown node type `' + node.type + '`');
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}).join(combinator);
|
||||
|
||||
if (node.explicit || forceBraces) {
|
||||
result = (compact || result[0] === ',' ? '[' : '[ ') + result + (compact ? ']' : ' ]');
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function generate(node, decorate, forceBraces, compact) {
|
||||
var result;
|
||||
|
||||
switch (node.type) {
|
||||
case 'Group':
|
||||
result =
|
||||
generateSequence(node, decorate, forceBraces, compact) +
|
||||
(node.disallowEmpty ? '!' : '');
|
||||
break;
|
||||
|
||||
case 'Multiplier':
|
||||
// return since node is a composition
|
||||
return (
|
||||
generate(node.term, decorate, forceBraces, compact) +
|
||||
decorate(generateMultiplier(node), node)
|
||||
);
|
||||
|
||||
case 'Type':
|
||||
result = '<' + node.name + (node.opts ? decorate(generateTypeOpts(node.opts), node.opts) : '') + '>';
|
||||
break;
|
||||
|
||||
case 'Property':
|
||||
result = '<\'' + node.name + '\'>';
|
||||
break;
|
||||
|
||||
case 'Keyword':
|
||||
result = node.name;
|
||||
break;
|
||||
|
||||
case 'AtKeyword':
|
||||
result = '@' + node.name;
|
||||
break;
|
||||
|
||||
case 'Function':
|
||||
result = node.name + '(';
|
||||
break;
|
||||
|
||||
case 'String':
|
||||
case 'Token':
|
||||
result = node.value;
|
||||
break;
|
||||
|
||||
case 'Comma':
|
||||
result = ',';
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error('Unknown node type `' + node.type + '`');
|
||||
}
|
||||
|
||||
return decorate(result, node);
|
||||
}
|
||||
|
||||
module.exports = function(node, options) {
|
||||
var decorate = noop;
|
||||
var forceBraces = false;
|
||||
var compact = false;
|
||||
|
||||
if (typeof options === 'function') {
|
||||
decorate = options;
|
||||
} else if (options) {
|
||||
forceBraces = Boolean(options.forceBraces);
|
||||
compact = Boolean(options.compact);
|
||||
if (typeof options.decorate === 'function') {
|
||||
decorate = options.decorate;
|
||||
}
|
||||
}
|
||||
|
||||
return generate(node, decorate, forceBraces, compact);
|
||||
};
|
||||
6
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/index.js
generated
vendored
Normal file
6
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/index.js
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
SyntaxError: require('./SyntaxError'),
|
||||
parse: require('./parse'),
|
||||
generate: require('./generate'),
|
||||
walk: require('./walk')
|
||||
};
|
||||
568
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/parse.js
generated
vendored
Normal file
568
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/parse.js
generated
vendored
Normal file
@@ -0,0 +1,568 @@
|
||||
var Tokenizer = require('./tokenizer');
|
||||
var TAB = 9;
|
||||
var N = 10;
|
||||
var F = 12;
|
||||
var R = 13;
|
||||
var SPACE = 32;
|
||||
var EXCLAMATIONMARK = 33; // !
|
||||
var NUMBERSIGN = 35; // #
|
||||
var AMPERSAND = 38; // &
|
||||
var APOSTROPHE = 39; // '
|
||||
var LEFTPARENTHESIS = 40; // (
|
||||
var RIGHTPARENTHESIS = 41; // )
|
||||
var ASTERISK = 42; // *
|
||||
var PLUSSIGN = 43; // +
|
||||
var COMMA = 44; // ,
|
||||
var HYPERMINUS = 45; // -
|
||||
var LESSTHANSIGN = 60; // <
|
||||
var GREATERTHANSIGN = 62; // >
|
||||
var QUESTIONMARK = 63; // ?
|
||||
var COMMERCIALAT = 64; // @
|
||||
var LEFTSQUAREBRACKET = 91; // [
|
||||
var RIGHTSQUAREBRACKET = 93; // ]
|
||||
var LEFTCURLYBRACKET = 123; // {
|
||||
var VERTICALLINE = 124; // |
|
||||
var RIGHTCURLYBRACKET = 125; // }
|
||||
var INFINITY = 8734; // ∞
|
||||
var NAME_CHAR = createCharMap(function(ch) {
|
||||
return /[a-zA-Z0-9\-]/.test(ch);
|
||||
});
|
||||
var COMBINATOR_PRECEDENCE = {
|
||||
' ': 1,
|
||||
'&&': 2,
|
||||
'||': 3,
|
||||
'|': 4
|
||||
};
|
||||
|
||||
function createCharMap(fn) {
|
||||
var array = typeof Uint32Array === 'function' ? new Uint32Array(128) : new Array(128);
|
||||
for (var i = 0; i < 128; i++) {
|
||||
array[i] = fn(String.fromCharCode(i)) ? 1 : 0;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
function scanSpaces(tokenizer) {
|
||||
return tokenizer.substringToPos(
|
||||
tokenizer.findWsEnd(tokenizer.pos)
|
||||
);
|
||||
}
|
||||
|
||||
function scanWord(tokenizer) {
|
||||
var end = tokenizer.pos;
|
||||
|
||||
for (; end < tokenizer.str.length; end++) {
|
||||
var code = tokenizer.str.charCodeAt(end);
|
||||
if (code >= 128 || NAME_CHAR[code] === 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tokenizer.pos === end) {
|
||||
tokenizer.error('Expect a keyword');
|
||||
}
|
||||
|
||||
return tokenizer.substringToPos(end);
|
||||
}
|
||||
|
||||
function scanNumber(tokenizer) {
|
||||
var end = tokenizer.pos;
|
||||
|
||||
for (; end < tokenizer.str.length; end++) {
|
||||
var code = tokenizer.str.charCodeAt(end);
|
||||
if (code < 48 || code > 57) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (tokenizer.pos === end) {
|
||||
tokenizer.error('Expect a number');
|
||||
}
|
||||
|
||||
return tokenizer.substringToPos(end);
|
||||
}
|
||||
|
||||
function scanString(tokenizer) {
|
||||
var end = tokenizer.str.indexOf('\'', tokenizer.pos + 1);
|
||||
|
||||
if (end === -1) {
|
||||
tokenizer.pos = tokenizer.str.length;
|
||||
tokenizer.error('Expect an apostrophe');
|
||||
}
|
||||
|
||||
return tokenizer.substringToPos(end + 1);
|
||||
}
|
||||
|
||||
function readMultiplierRange(tokenizer) {
|
||||
var min = null;
|
||||
var max = null;
|
||||
|
||||
tokenizer.eat(LEFTCURLYBRACKET);
|
||||
|
||||
min = scanNumber(tokenizer);
|
||||
|
||||
if (tokenizer.charCode() === COMMA) {
|
||||
tokenizer.pos++;
|
||||
if (tokenizer.charCode() !== RIGHTCURLYBRACKET) {
|
||||
max = scanNumber(tokenizer);
|
||||
}
|
||||
} else {
|
||||
max = min;
|
||||
}
|
||||
|
||||
tokenizer.eat(RIGHTCURLYBRACKET);
|
||||
|
||||
return {
|
||||
min: Number(min),
|
||||
max: max ? Number(max) : 0
|
||||
};
|
||||
}
|
||||
|
||||
function readMultiplier(tokenizer) {
|
||||
var range = null;
|
||||
var comma = false;
|
||||
|
||||
switch (tokenizer.charCode()) {
|
||||
case ASTERISK:
|
||||
tokenizer.pos++;
|
||||
|
||||
range = {
|
||||
min: 0,
|
||||
max: 0
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
case PLUSSIGN:
|
||||
tokenizer.pos++;
|
||||
|
||||
range = {
|
||||
min: 1,
|
||||
max: 0
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
case QUESTIONMARK:
|
||||
tokenizer.pos++;
|
||||
|
||||
range = {
|
||||
min: 0,
|
||||
max: 1
|
||||
};
|
||||
|
||||
break;
|
||||
|
||||
case NUMBERSIGN:
|
||||
tokenizer.pos++;
|
||||
|
||||
comma = true;
|
||||
|
||||
if (tokenizer.charCode() === LEFTCURLYBRACKET) {
|
||||
range = readMultiplierRange(tokenizer);
|
||||
} else {
|
||||
range = {
|
||||
min: 1,
|
||||
max: 0
|
||||
};
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case LEFTCURLYBRACKET:
|
||||
range = readMultiplierRange(tokenizer);
|
||||
break;
|
||||
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'Multiplier',
|
||||
comma: comma,
|
||||
min: range.min,
|
||||
max: range.max,
|
||||
term: null
|
||||
};
|
||||
}
|
||||
|
||||
function maybeMultiplied(tokenizer, node) {
|
||||
var multiplier = readMultiplier(tokenizer);
|
||||
|
||||
if (multiplier !== null) {
|
||||
multiplier.term = node;
|
||||
return multiplier;
|
||||
}
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
function maybeToken(tokenizer) {
|
||||
var ch = tokenizer.peek();
|
||||
|
||||
if (ch === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'Token',
|
||||
value: ch
|
||||
};
|
||||
}
|
||||
|
||||
function readProperty(tokenizer) {
|
||||
var name;
|
||||
|
||||
tokenizer.eat(LESSTHANSIGN);
|
||||
tokenizer.eat(APOSTROPHE);
|
||||
|
||||
name = scanWord(tokenizer);
|
||||
|
||||
tokenizer.eat(APOSTROPHE);
|
||||
tokenizer.eat(GREATERTHANSIGN);
|
||||
|
||||
return maybeMultiplied(tokenizer, {
|
||||
type: 'Property',
|
||||
name: name
|
||||
});
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-values-3/#numeric-ranges
|
||||
// 4.1. Range Restrictions and Range Definition Notation
|
||||
//
|
||||
// Range restrictions can be annotated in the numeric type notation using CSS bracketed
|
||||
// range notation—[min,max]—within the angle brackets, after the identifying keyword,
|
||||
// indicating a closed range between (and including) min and max.
|
||||
// For example, <integer [0, 10]> indicates an integer between 0 and 10, inclusive.
|
||||
function readTypeRange(tokenizer) {
|
||||
// use null for Infinity to make AST format JSON serializable/deserializable
|
||||
var min = null; // -Infinity
|
||||
var max = null; // Infinity
|
||||
var sign = 1;
|
||||
|
||||
tokenizer.eat(LEFTSQUAREBRACKET);
|
||||
|
||||
if (tokenizer.charCode() === HYPERMINUS) {
|
||||
tokenizer.peek();
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
if (sign == -1 && tokenizer.charCode() === INFINITY) {
|
||||
tokenizer.peek();
|
||||
} else {
|
||||
min = sign * Number(scanNumber(tokenizer));
|
||||
}
|
||||
|
||||
scanSpaces(tokenizer);
|
||||
tokenizer.eat(COMMA);
|
||||
scanSpaces(tokenizer);
|
||||
|
||||
if (tokenizer.charCode() === INFINITY) {
|
||||
tokenizer.peek();
|
||||
} else {
|
||||
sign = 1;
|
||||
|
||||
if (tokenizer.charCode() === HYPERMINUS) {
|
||||
tokenizer.peek();
|
||||
sign = -1;
|
||||
}
|
||||
|
||||
max = sign * Number(scanNumber(tokenizer));
|
||||
}
|
||||
|
||||
tokenizer.eat(RIGHTSQUAREBRACKET);
|
||||
|
||||
// If no range is indicated, either by using the bracketed range notation
|
||||
// or in the property description, then [−∞,∞] is assumed.
|
||||
if (min === null && max === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'Range',
|
||||
min: min,
|
||||
max: max
|
||||
};
|
||||
}
|
||||
|
||||
function readType(tokenizer) {
|
||||
var name;
|
||||
var opts = null;
|
||||
|
||||
tokenizer.eat(LESSTHANSIGN);
|
||||
name = scanWord(tokenizer);
|
||||
|
||||
if (tokenizer.charCode() === LEFTPARENTHESIS &&
|
||||
tokenizer.nextCharCode() === RIGHTPARENTHESIS) {
|
||||
tokenizer.pos += 2;
|
||||
name += '()';
|
||||
}
|
||||
|
||||
if (tokenizer.charCodeAt(tokenizer.findWsEnd(tokenizer.pos)) === LEFTSQUAREBRACKET) {
|
||||
scanSpaces(tokenizer);
|
||||
opts = readTypeRange(tokenizer);
|
||||
}
|
||||
|
||||
tokenizer.eat(GREATERTHANSIGN);
|
||||
|
||||
return maybeMultiplied(tokenizer, {
|
||||
type: 'Type',
|
||||
name: name,
|
||||
opts: opts
|
||||
});
|
||||
}
|
||||
|
||||
function readKeywordOrFunction(tokenizer) {
|
||||
var name;
|
||||
|
||||
name = scanWord(tokenizer);
|
||||
|
||||
if (tokenizer.charCode() === LEFTPARENTHESIS) {
|
||||
tokenizer.pos++;
|
||||
|
||||
return {
|
||||
type: 'Function',
|
||||
name: name
|
||||
};
|
||||
}
|
||||
|
||||
return maybeMultiplied(tokenizer, {
|
||||
type: 'Keyword',
|
||||
name: name
|
||||
});
|
||||
}
|
||||
|
||||
function regroupTerms(terms, combinators) {
|
||||
function createGroup(terms, combinator) {
|
||||
return {
|
||||
type: 'Group',
|
||||
terms: terms,
|
||||
combinator: combinator,
|
||||
disallowEmpty: false,
|
||||
explicit: false
|
||||
};
|
||||
}
|
||||
|
||||
combinators = Object.keys(combinators).sort(function(a, b) {
|
||||
return COMBINATOR_PRECEDENCE[a] - COMBINATOR_PRECEDENCE[b];
|
||||
});
|
||||
|
||||
while (combinators.length > 0) {
|
||||
var combinator = combinators.shift();
|
||||
for (var i = 0, subgroupStart = 0; i < terms.length; i++) {
|
||||
var term = terms[i];
|
||||
if (term.type === 'Combinator') {
|
||||
if (term.value === combinator) {
|
||||
if (subgroupStart === -1) {
|
||||
subgroupStart = i - 1;
|
||||
}
|
||||
terms.splice(i, 1);
|
||||
i--;
|
||||
} else {
|
||||
if (subgroupStart !== -1 && i - subgroupStart > 1) {
|
||||
terms.splice(
|
||||
subgroupStart,
|
||||
i - subgroupStart,
|
||||
createGroup(terms.slice(subgroupStart, i), combinator)
|
||||
);
|
||||
i = subgroupStart + 1;
|
||||
}
|
||||
subgroupStart = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (subgroupStart !== -1 && combinators.length) {
|
||||
terms.splice(
|
||||
subgroupStart,
|
||||
i - subgroupStart,
|
||||
createGroup(terms.slice(subgroupStart, i), combinator)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return combinator;
|
||||
}
|
||||
|
||||
function readImplicitGroup(tokenizer) {
|
||||
var terms = [];
|
||||
var combinators = {};
|
||||
var token;
|
||||
var prevToken = null;
|
||||
var prevTokenPos = tokenizer.pos;
|
||||
|
||||
while (token = peek(tokenizer)) {
|
||||
if (token.type !== 'Spaces') {
|
||||
if (token.type === 'Combinator') {
|
||||
// check for combinator in group beginning and double combinator sequence
|
||||
if (prevToken === null || prevToken.type === 'Combinator') {
|
||||
tokenizer.pos = prevTokenPos;
|
||||
tokenizer.error('Unexpected combinator');
|
||||
}
|
||||
|
||||
combinators[token.value] = true;
|
||||
} else if (prevToken !== null && prevToken.type !== 'Combinator') {
|
||||
combinators[' '] = true; // a b
|
||||
terms.push({
|
||||
type: 'Combinator',
|
||||
value: ' '
|
||||
});
|
||||
}
|
||||
|
||||
terms.push(token);
|
||||
prevToken = token;
|
||||
prevTokenPos = tokenizer.pos;
|
||||
}
|
||||
}
|
||||
|
||||
// check for combinator in group ending
|
||||
if (prevToken !== null && prevToken.type === 'Combinator') {
|
||||
tokenizer.pos -= prevTokenPos;
|
||||
tokenizer.error('Unexpected combinator');
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'Group',
|
||||
terms: terms,
|
||||
combinator: regroupTerms(terms, combinators) || ' ',
|
||||
disallowEmpty: false,
|
||||
explicit: false
|
||||
};
|
||||
}
|
||||
|
||||
function readGroup(tokenizer) {
|
||||
var result;
|
||||
|
||||
tokenizer.eat(LEFTSQUAREBRACKET);
|
||||
result = readImplicitGroup(tokenizer);
|
||||
tokenizer.eat(RIGHTSQUAREBRACKET);
|
||||
|
||||
result.explicit = true;
|
||||
|
||||
if (tokenizer.charCode() === EXCLAMATIONMARK) {
|
||||
tokenizer.pos++;
|
||||
result.disallowEmpty = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function peek(tokenizer) {
|
||||
var code = tokenizer.charCode();
|
||||
|
||||
if (code < 128 && NAME_CHAR[code] === 1) {
|
||||
return readKeywordOrFunction(tokenizer);
|
||||
}
|
||||
|
||||
switch (code) {
|
||||
case RIGHTSQUAREBRACKET:
|
||||
// don't eat, stop scan a group
|
||||
break;
|
||||
|
||||
case LEFTSQUAREBRACKET:
|
||||
return maybeMultiplied(tokenizer, readGroup(tokenizer));
|
||||
|
||||
case LESSTHANSIGN:
|
||||
return tokenizer.nextCharCode() === APOSTROPHE
|
||||
? readProperty(tokenizer)
|
||||
: readType(tokenizer);
|
||||
|
||||
case VERTICALLINE:
|
||||
return {
|
||||
type: 'Combinator',
|
||||
value: tokenizer.substringToPos(
|
||||
tokenizer.nextCharCode() === VERTICALLINE
|
||||
? tokenizer.pos + 2
|
||||
: tokenizer.pos + 1
|
||||
)
|
||||
};
|
||||
|
||||
case AMPERSAND:
|
||||
tokenizer.pos++;
|
||||
tokenizer.eat(AMPERSAND);
|
||||
|
||||
return {
|
||||
type: 'Combinator',
|
||||
value: '&&'
|
||||
};
|
||||
|
||||
case COMMA:
|
||||
tokenizer.pos++;
|
||||
return {
|
||||
type: 'Comma'
|
||||
};
|
||||
|
||||
case APOSTROPHE:
|
||||
return maybeMultiplied(tokenizer, {
|
||||
type: 'String',
|
||||
value: scanString(tokenizer)
|
||||
});
|
||||
|
||||
case SPACE:
|
||||
case TAB:
|
||||
case N:
|
||||
case R:
|
||||
case F:
|
||||
return {
|
||||
type: 'Spaces',
|
||||
value: scanSpaces(tokenizer)
|
||||
};
|
||||
|
||||
case COMMERCIALAT:
|
||||
code = tokenizer.nextCharCode();
|
||||
|
||||
if (code < 128 && NAME_CHAR[code] === 1) {
|
||||
tokenizer.pos++;
|
||||
return {
|
||||
type: 'AtKeyword',
|
||||
name: scanWord(tokenizer)
|
||||
};
|
||||
}
|
||||
|
||||
return maybeToken(tokenizer);
|
||||
|
||||
case ASTERISK:
|
||||
case PLUSSIGN:
|
||||
case QUESTIONMARK:
|
||||
case NUMBERSIGN:
|
||||
case EXCLAMATIONMARK:
|
||||
// prohibited tokens (used as a multiplier start)
|
||||
break;
|
||||
|
||||
case LEFTCURLYBRACKET:
|
||||
// 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();
|
||||
|
||||
if (code < 48 || code > 57) {
|
||||
return maybeToken(tokenizer);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
return maybeToken(tokenizer);
|
||||
}
|
||||
}
|
||||
|
||||
function parse(source) {
|
||||
var tokenizer = new Tokenizer(source);
|
||||
var result = readImplicitGroup(tokenizer);
|
||||
|
||||
if (tokenizer.pos !== source.length) {
|
||||
tokenizer.error('Unexpected input');
|
||||
}
|
||||
|
||||
// reduce redundant groups with single group term
|
||||
if (result.terms.length === 1 && result.terms[0].type === 'Group') {
|
||||
result = result.terms[0];
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// warm up parse to elimitate code branches that never execute
|
||||
// fix soft deoptimizations (insufficient type feedback)
|
||||
parse('[a&&<b>#|<\'c\'>*||e() f{2} /,(% g#{1,2} h{2,})]!');
|
||||
|
||||
module.exports = parse;
|
||||
55
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/tokenizer.js
generated
vendored
Normal file
55
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/tokenizer.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
var SyntaxError = require('./SyntaxError');
|
||||
|
||||
var TAB = 9;
|
||||
var N = 10;
|
||||
var F = 12;
|
||||
var R = 13;
|
||||
var SPACE = 32;
|
||||
|
||||
var Tokenizer = function(str) {
|
||||
this.str = str;
|
||||
this.pos = 0;
|
||||
};
|
||||
|
||||
Tokenizer.prototype = {
|
||||
charCodeAt: function(pos) {
|
||||
return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
|
||||
},
|
||||
charCode: function() {
|
||||
return this.charCodeAt(this.pos);
|
||||
},
|
||||
nextCharCode: function() {
|
||||
return this.charCodeAt(this.pos + 1);
|
||||
},
|
||||
nextNonWsCode: function(pos) {
|
||||
return this.charCodeAt(this.findWsEnd(pos));
|
||||
},
|
||||
findWsEnd: function(pos) {
|
||||
for (; pos < this.str.length; pos++) {
|
||||
var code = this.str.charCodeAt(pos);
|
||||
if (code !== R && code !== N && code !== F && code !== SPACE && code !== TAB) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return pos;
|
||||
},
|
||||
substringToPos: function(end) {
|
||||
return this.str.substring(this.pos, this.pos = end);
|
||||
},
|
||||
eat: function(code) {
|
||||
if (this.charCode() !== code) {
|
||||
this.error('Expect `' + String.fromCharCode(code) + '`');
|
||||
}
|
||||
|
||||
this.pos++;
|
||||
},
|
||||
peek: function() {
|
||||
return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
|
||||
},
|
||||
error: function(message) {
|
||||
throw new SyntaxError(message, this.str, this.pos);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Tokenizer;
|
||||
52
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/walk.js
generated
vendored
Normal file
52
node_modules/laravel-mix/node_modules/css-tree/lib/definition-syntax/walk.js
generated
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
var noop = function() {};
|
||||
|
||||
function ensureFunction(value) {
|
||||
return typeof value === 'function' ? value : noop;
|
||||
}
|
||||
|
||||
module.exports = function(node, options, context) {
|
||||
function walk(node) {
|
||||
enter.call(context, node);
|
||||
|
||||
switch (node.type) {
|
||||
case 'Group':
|
||||
node.terms.forEach(walk);
|
||||
break;
|
||||
|
||||
case 'Multiplier':
|
||||
walk(node.term);
|
||||
break;
|
||||
|
||||
case 'Type':
|
||||
case 'Property':
|
||||
case 'Keyword':
|
||||
case 'AtKeyword':
|
||||
case 'Function':
|
||||
case 'String':
|
||||
case 'Token':
|
||||
case 'Comma':
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error('Unknown type: ' + node.type);
|
||||
}
|
||||
|
||||
leave.call(context, node);
|
||||
}
|
||||
|
||||
var enter = noop;
|
||||
var leave = noop;
|
||||
|
||||
if (typeof options === 'function') {
|
||||
enter = options;
|
||||
} else if (options) {
|
||||
enter = ensureFunction(options.enter);
|
||||
leave = ensureFunction(options.leave);
|
||||
}
|
||||
|
||||
if (enter === noop && leave === noop) {
|
||||
throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
|
||||
}
|
||||
|
||||
walk(node, context);
|
||||
};
|
||||
66
node_modules/laravel-mix/node_modules/css-tree/lib/generator/create.js
generated
vendored
Normal file
66
node_modules/laravel-mix/node_modules/css-tree/lib/generator/create.js
generated
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
var sourceMap = require('./sourceMap');
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
function processChildren(node, delimeter) {
|
||||
var list = node.children;
|
||||
var prev = null;
|
||||
|
||||
if (typeof delimeter !== 'function') {
|
||||
list.forEach(this.node, this);
|
||||
} else {
|
||||
list.forEach(function(node) {
|
||||
if (prev !== null) {
|
||||
delimeter.call(this, prev);
|
||||
}
|
||||
|
||||
this.node(node);
|
||||
prev = node;
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function createGenerator(config) {
|
||||
function processNode(node) {
|
||||
if (hasOwnProperty.call(types, node.type)) {
|
||||
types[node.type].call(this, node);
|
||||
} else {
|
||||
throw new Error('Unknown node type: ' + node.type);
|
||||
}
|
||||
}
|
||||
|
||||
var types = {};
|
||||
|
||||
if (config.node) {
|
||||
for (var name in config.node) {
|
||||
types[name] = config.node[name].generate;
|
||||
}
|
||||
}
|
||||
|
||||
return function(node, options) {
|
||||
var buffer = '';
|
||||
var handlers = {
|
||||
children: processChildren,
|
||||
node: processNode,
|
||||
chunk: function(chunk) {
|
||||
buffer += chunk;
|
||||
},
|
||||
result: function() {
|
||||
return buffer;
|
||||
}
|
||||
};
|
||||
|
||||
if (options) {
|
||||
if (typeof options.decorator === 'function') {
|
||||
handlers = options.decorator(handlers);
|
||||
}
|
||||
|
||||
if (options.sourceMap) {
|
||||
handlers = sourceMap(handlers);
|
||||
}
|
||||
}
|
||||
|
||||
handlers.node(node);
|
||||
|
||||
return handlers.result();
|
||||
};
|
||||
};
|
||||
4
node_modules/laravel-mix/node_modules/css-tree/lib/generator/index.js
generated
vendored
Normal file
4
node_modules/laravel-mix/node_modules/css-tree/lib/generator/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var createGenerator = require('./create');
|
||||
var config = require('../syntax/config/parser');
|
||||
|
||||
module.exports = createGenerator(config);
|
||||
95
node_modules/laravel-mix/node_modules/css-tree/lib/generator/sourceMap.js
generated
vendored
Normal file
95
node_modules/laravel-mix/node_modules/css-tree/lib/generator/sourceMap.js
generated
vendored
Normal file
@@ -0,0 +1,95 @@
|
||||
var SourceMapGenerator = require('source-map/lib/source-map-generator').SourceMapGenerator;
|
||||
var trackNodes = {
|
||||
Atrule: true,
|
||||
Selector: true,
|
||||
Declaration: true
|
||||
};
|
||||
|
||||
module.exports = function generateSourceMap(handlers) {
|
||||
var map = new SourceMapGenerator();
|
||||
var line = 1;
|
||||
var column = 0;
|
||||
var generated = {
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
var original = {
|
||||
line: 0, // should be zero to add first mapping
|
||||
column: 0
|
||||
};
|
||||
var sourceMappingActive = false;
|
||||
var activatedGenerated = {
|
||||
line: 1,
|
||||
column: 0
|
||||
};
|
||||
var activatedMapping = {
|
||||
generated: activatedGenerated
|
||||
};
|
||||
|
||||
var handlersNode = handlers.node;
|
||||
handlers.node = function(node) {
|
||||
if (node.loc && node.loc.start && trackNodes.hasOwnProperty(node.type)) {
|
||||
var nodeLine = node.loc.start.line;
|
||||
var nodeColumn = node.loc.start.column - 1;
|
||||
|
||||
if (original.line !== nodeLine ||
|
||||
original.column !== nodeColumn) {
|
||||
original.line = nodeLine;
|
||||
original.column = nodeColumn;
|
||||
|
||||
generated.line = line;
|
||||
generated.column = column;
|
||||
|
||||
if (sourceMappingActive) {
|
||||
sourceMappingActive = false;
|
||||
if (generated.line !== activatedGenerated.line ||
|
||||
generated.column !== activatedGenerated.column) {
|
||||
map.addMapping(activatedMapping);
|
||||
}
|
||||
}
|
||||
|
||||
sourceMappingActive = true;
|
||||
map.addMapping({
|
||||
source: node.loc.source,
|
||||
original: original,
|
||||
generated: generated
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
handlersNode.call(this, node);
|
||||
|
||||
if (sourceMappingActive && trackNodes.hasOwnProperty(node.type)) {
|
||||
activatedGenerated.line = line;
|
||||
activatedGenerated.column = column;
|
||||
}
|
||||
};
|
||||
|
||||
var handlersChunk = handlers.chunk;
|
||||
handlers.chunk = function(chunk) {
|
||||
for (var i = 0; i < chunk.length; i++) {
|
||||
if (chunk.charCodeAt(i) === 10) { // \n
|
||||
line++;
|
||||
column = 0;
|
||||
} else {
|
||||
column++;
|
||||
}
|
||||
}
|
||||
|
||||
handlersChunk(chunk);
|
||||
};
|
||||
|
||||
var handlersResult = handlers.result;
|
||||
handlers.result = function() {
|
||||
if (sourceMappingActive) {
|
||||
map.addMapping(activatedMapping);
|
||||
}
|
||||
|
||||
return {
|
||||
css: handlersResult(),
|
||||
map: map
|
||||
};
|
||||
};
|
||||
|
||||
return handlers;
|
||||
};
|
||||
1
node_modules/laravel-mix/node_modules/css-tree/lib/index.js
generated
vendored
Executable file
1
node_modules/laravel-mix/node_modules/css-tree/lib/index.js
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
module.exports = require('./syntax');
|
||||
466
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/Lexer.js
generated
vendored
Normal file
466
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/Lexer.js
generated
vendored
Normal file
@@ -0,0 +1,466 @@
|
||||
var SyntaxReferenceError = require('./error').SyntaxReferenceError;
|
||||
var SyntaxMatchError = require('./error').SyntaxMatchError;
|
||||
var names = require('../utils/names');
|
||||
var generic = require('./generic');
|
||||
var parse = require('../definition-syntax/parse');
|
||||
var generate = require('../definition-syntax/generate');
|
||||
var walk = require('../definition-syntax/walk');
|
||||
var prepareTokens = require('./prepare-tokens');
|
||||
var buildMatchGraph = require('./match-graph').buildMatchGraph;
|
||||
var matchAsTree = require('./match').matchAsTree;
|
||||
var trace = require('./trace');
|
||||
var search = require('./search');
|
||||
var getStructureFromConfig = require('./structure').getStructureFromConfig;
|
||||
var cssWideKeywords = buildMatchGraph('inherit | initial | unset');
|
||||
var cssWideKeywordsWithExpression = buildMatchGraph('inherit | initial | unset | <-ms-legacy-expression>');
|
||||
|
||||
function dumpMapSyntax(map, compact, syntaxAsAst) {
|
||||
var result = {};
|
||||
|
||||
for (var name in map) {
|
||||
if (map[name].syntax) {
|
||||
result[name] = syntaxAsAst
|
||||
? map[name].syntax
|
||||
: 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(') {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function buildMatchResult(match, error, iterations) {
|
||||
return {
|
||||
matched: match,
|
||||
iterations: iterations,
|
||||
error: error,
|
||||
getTrace: trace.getTrace,
|
||||
isType: trace.isType,
|
||||
isProperty: trace.isProperty,
|
||||
isKeyword: trace.isKeyword
|
||||
};
|
||||
}
|
||||
|
||||
function matchSyntax(lexer, syntax, value, useCommon) {
|
||||
var tokens = prepareTokens(value, lexer.syntax);
|
||||
var result;
|
||||
|
||||
if (valueHasVar(tokens)) {
|
||||
return buildMatchResult(null, new Error('Matching for a tree with var() is not supported'));
|
||||
}
|
||||
|
||||
if (useCommon) {
|
||||
result = matchAsTree(tokens, lexer.valueCommonSyntax, lexer);
|
||||
}
|
||||
|
||||
if (!useCommon || !result.match) {
|
||||
result = matchAsTree(tokens, syntax.match, lexer);
|
||||
if (!result.match) {
|
||||
return buildMatchResult(
|
||||
null,
|
||||
new SyntaxMatchError(result.reason, syntax.syntax, value, result),
|
||||
result.iterations
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return buildMatchResult(result.match, null, result.iterations);
|
||||
}
|
||||
|
||||
var Lexer = function(config, syntax, structure) {
|
||||
this.valueCommonSyntax = cssWideKeywords;
|
||||
this.syntax = syntax;
|
||||
this.generic = false;
|
||||
this.atrules = {};
|
||||
this.properties = {};
|
||||
this.types = {};
|
||||
this.structure = structure || getStructureFromConfig(config);
|
||||
|
||||
if (config) {
|
||||
if (config.types) {
|
||||
for (var name in config.types) {
|
||||
this.addType_(name, config.types[name]);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.generic) {
|
||||
this.generic = true;
|
||||
for (var name in generic) {
|
||||
this.addType_(name, generic[name]);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.atrules) {
|
||||
for (var name in config.atrules) {
|
||||
this.addAtrule_(name, config.atrules[name]);
|
||||
}
|
||||
}
|
||||
|
||||
if (config.properties) {
|
||||
for (var name in config.properties) {
|
||||
this.addProperty_(name, config.properties[name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Lexer.prototype = {
|
||||
structure: {},
|
||||
checkStructure: function(ast) {
|
||||
function collectWarning(node, message) {
|
||||
warns.push({
|
||||
node: node,
|
||||
message: message
|
||||
});
|
||||
}
|
||||
|
||||
var structure = this.structure;
|
||||
var warns = [];
|
||||
|
||||
this.syntax.walk(ast, function(node) {
|
||||
if (structure.hasOwnProperty(node.type)) {
|
||||
structure[node.type].check(node, collectWarning);
|
||||
} else {
|
||||
collectWarning(node, 'Unknown node type `' + node.type + '`');
|
||||
}
|
||||
});
|
||||
|
||||
return warns.length ? warns : false;
|
||||
},
|
||||
|
||||
createDescriptor: function(syntax, type, name, parent = null) {
|
||||
var ref = {
|
||||
type: type,
|
||||
name: name
|
||||
};
|
||||
var descriptor = {
|
||||
type: type,
|
||||
name: name,
|
||||
parent: parent,
|
||||
syntax: null,
|
||||
match: null
|
||||
};
|
||||
|
||||
if (typeof syntax === 'function') {
|
||||
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(syntax)
|
||||
});
|
||||
|
||||
return descriptor.syntax;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
descriptor.syntax = syntax;
|
||||
}
|
||||
|
||||
// lazy graph build on first access
|
||||
Object.defineProperty(descriptor, 'match', {
|
||||
get: function() {
|
||||
Object.defineProperty(descriptor, 'match', {
|
||||
value: buildMatchGraph(descriptor.syntax, ref)
|
||||
});
|
||||
|
||||
return descriptor.match;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
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, 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']) {
|
||||
this.valueCommonSyntax = cssWideKeywordsWithExpression;
|
||||
}
|
||||
},
|
||||
|
||||
checkAtruleName: function(atruleName) {
|
||||
if (!this.getAtrule(atruleName)) {
|
||||
return new SyntaxReferenceError('Unknown at-rule', '@' + atruleName);
|
||||
}
|
||||
},
|
||||
checkAtrulePrelude: function(atruleName, prelude) {
|
||||
let error = this.checkAtruleName(atruleName);
|
||||
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
|
||||
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.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.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 error = this.checkAtruleDescriptorName(atruleName, descriptorName);
|
||||
|
||||
if (error) {
|
||||
return buildMatchResult(null, error);
|
||||
}
|
||||
|
||||
var atrule = this.getAtrule(atruleName);
|
||||
var descriptor = names.keyword(descriptorName);
|
||||
|
||||
return matchSyntax(this, atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename], value, false);
|
||||
},
|
||||
matchDeclaration: function(node) {
|
||||
if (node.type !== 'Declaration') {
|
||||
return buildMatchResult(null, new Error('Not a Declaration node'));
|
||||
}
|
||||
|
||||
return this.matchProperty(node.property, node.value);
|
||||
},
|
||||
matchProperty: function(propertyName, value) {
|
||||
var error = this.checkPropertyName(propertyName);
|
||||
|
||||
if (error) {
|
||||
return buildMatchResult(null, error);
|
||||
}
|
||||
|
||||
return matchSyntax(this, this.getProperty(propertyName), value, true);
|
||||
},
|
||||
matchType: function(typeName, value) {
|
||||
var typeSyntax = this.getType(typeName);
|
||||
|
||||
if (!typeSyntax) {
|
||||
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('Bad syntax'));
|
||||
}
|
||||
|
||||
if (typeof syntax === 'string' || !syntax.match) {
|
||||
syntax = this.createDescriptor(syntax, 'Type', 'anonymous');
|
||||
}
|
||||
|
||||
return matchSyntax(this, syntax, value, false);
|
||||
},
|
||||
|
||||
findValueFragments: function(propertyName, value, type, name) {
|
||||
return search.matchFragments(this, value, this.matchProperty(propertyName, value), type, name);
|
||||
},
|
||||
findDeclarationValueFragments: function(declaration, type, name) {
|
||||
return search.matchFragments(this, declaration.value, this.matchDeclaration(declaration), type, name);
|
||||
},
|
||||
findAllFragments: function(ast, type, name) {
|
||||
var result = [];
|
||||
|
||||
this.syntax.walk(ast, {
|
||||
visit: 'Declaration',
|
||||
enter: function(declaration) {
|
||||
result.push.apply(result, this.findDeclarationValueFragments(declaration, type, name));
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
getAtrule: function(atruleName, fallbackBasename = true) {
|
||||
var atrule = names.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(propertyName, fallbackBasename = true) {
|
||||
var property = names.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;
|
||||
},
|
||||
|
||||
validate: function() {
|
||||
function validate(syntax, name, broken, descriptor) {
|
||||
if (broken.hasOwnProperty(name)) {
|
||||
return broken[name];
|
||||
}
|
||||
|
||||
broken[name] = false;
|
||||
if (descriptor.syntax !== null) {
|
||||
walk(descriptor.syntax, function(node) {
|
||||
if (node.type !== 'Type' && node.type !== 'Property') {
|
||||
return;
|
||||
}
|
||||
|
||||
var map = node.type === 'Type' ? syntax.types : syntax.properties;
|
||||
var brokenMap = node.type === 'Type' ? brokenTypes : brokenProperties;
|
||||
|
||||
if (!map.hasOwnProperty(node.name) || validate(syntax, node.name, brokenMap, map[node.name])) {
|
||||
broken[name] = true;
|
||||
}
|
||||
}, this);
|
||||
}
|
||||
}
|
||||
|
||||
var brokenTypes = {};
|
||||
var brokenProperties = {};
|
||||
|
||||
for (var key in this.types) {
|
||||
validate(this, key, brokenTypes, this.types[key]);
|
||||
}
|
||||
|
||||
for (var key in this.properties) {
|
||||
validate(this, key, brokenProperties, this.properties[key]);
|
||||
}
|
||||
|
||||
brokenTypes = Object.keys(brokenTypes).filter(function(name) {
|
||||
return brokenTypes[name];
|
||||
});
|
||||
brokenProperties = Object.keys(brokenProperties).filter(function(name) {
|
||||
return brokenProperties[name];
|
||||
});
|
||||
|
||||
if (brokenTypes.length || brokenProperties.length) {
|
||||
return {
|
||||
types: brokenTypes,
|
||||
properties: brokenProperties
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
dump: function(syntaxAsAst, pretty) {
|
||||
return {
|
||||
generic: this.generic,
|
||||
types: dumpMapSyntax(this.types, !pretty, syntaxAsAst),
|
||||
properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst),
|
||||
atrules: dumpAtruleMapSyntax(this.atrules, !pretty, syntaxAsAst)
|
||||
};
|
||||
},
|
||||
toString: function() {
|
||||
return JSON.stringify(this.dump());
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = Lexer;
|
||||
127
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/error.js
generated
vendored
Normal file
127
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/error.js
generated
vendored
Normal file
@@ -0,0 +1,127 @@
|
||||
const createCustomError = require('../utils/createCustomError');
|
||||
const generate = require('../definition-syntax/generate');
|
||||
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;
|
||||
|
||||
if (i === longestMatch) {
|
||||
mismatchLength = token.length;
|
||||
mismatchOffset = css.length;
|
||||
}
|
||||
|
||||
if (badNode !== null && tokens[i].node === badNode) {
|
||||
if (i <= longestMatch) {
|
||||
entries++;
|
||||
} else {
|
||||
entries = 0;
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
css,
|
||||
mismatchOffset,
|
||||
mismatchLength,
|
||||
start,
|
||||
end
|
||||
};
|
||||
}
|
||||
|
||||
function fromLoc(node, point) {
|
||||
const value = node && node.loc && node.loc[point];
|
||||
|
||||
if (value) {
|
||||
return 'line' in value ? buildLoc(value) : value;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
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 = function(type, referenceName) {
|
||||
const error = createCustomError(
|
||||
'SyntaxReferenceError',
|
||||
type + (referenceName ? ' `' + referenceName + '`' : '')
|
||||
);
|
||||
|
||||
error.reference = referenceName;
|
||||
|
||||
return error;
|
||||
};
|
||||
|
||||
const SyntaxMatchError = function(message, syntax, node, matchResult) {
|
||||
const error = createCustomError('SyntaxMatchError', message);
|
||||
const {
|
||||
css,
|
||||
mismatchOffset,
|
||||
mismatchLength,
|
||||
start,
|
||||
end
|
||||
} = locateMismatch(matchResult, node);
|
||||
|
||||
error.rawMessage = message;
|
||||
error.syntax = syntax ? generate(syntax) : '<generic>';
|
||||
error.css = css;
|
||||
error.mismatchOffset = mismatchOffset;
|
||||
error.mismatchLength = mismatchLength;
|
||||
error.message = message + '\n' +
|
||||
' syntax: ' + error.syntax + '\n' +
|
||||
' value: ' + (css || '<empty string>') + '\n' +
|
||||
' --------' + new Array(error.mismatchOffset + 1).join('-') + '^';
|
||||
|
||||
Object.assign(error, start);
|
||||
error.loc = {
|
||||
source: (node && node.loc && node.loc.source) || '<unknown>',
|
||||
start,
|
||||
end
|
||||
};
|
||||
|
||||
return error;
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
SyntaxReferenceError,
|
||||
SyntaxMatchError
|
||||
};
|
||||
236
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/generic-an-plus-b.js
generated
vendored
Normal file
236
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/generic-an-plus-b.js
generated
vendored
Normal file
@@ -0,0 +1,236 @@
|
||||
var isDigit = require('../tokenizer').isDigit;
|
||||
var cmpChar = require('../tokenizer').cmpChar;
|
||||
var TYPE = require('../tokenizer').TYPE;
|
||||
|
||||
var DELIM = TYPE.Delim;
|
||||
var WHITESPACE = TYPE.WhiteSpace;
|
||||
var COMMENT = TYPE.Comment;
|
||||
var IDENT = TYPE.Ident;
|
||||
var NUMBER = TYPE.Number;
|
||||
var DIMENSION = TYPE.Dimension;
|
||||
var PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
|
||||
var HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
|
||||
var N = 0x006E; // U+006E LATIN SMALL LETTER N (n)
|
||||
var DISALLOW_SIGN = true;
|
||||
var ALLOW_SIGN = false;
|
||||
|
||||
function isDelim(token, code) {
|
||||
return token !== null && token.type === DELIM && token.value.charCodeAt(0) === code;
|
||||
}
|
||||
|
||||
function skipSC(token, offset, getNextToken) {
|
||||
while (token !== null && (token.type === WHITESPACE || token.type === COMMENT)) {
|
||||
token = getNextToken(++offset);
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
function checkInteger(token, valueOffset, disallowSign, offset) {
|
||||
if (!token) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var code = token.value.charCodeAt(valueOffset);
|
||||
|
||||
if (code === PLUSSIGN || code === HYPHENMINUS) {
|
||||
if (disallowSign) {
|
||||
// Number sign is not allowed
|
||||
return 0;
|
||||
}
|
||||
valueOffset++;
|
||||
}
|
||||
|
||||
for (; valueOffset < token.value.length; valueOffset++) {
|
||||
if (!isDigit(token.value.charCodeAt(valueOffset))) {
|
||||
// Integer is expected
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return offset + 1;
|
||||
}
|
||||
|
||||
// ... <signed-integer>
|
||||
// ... ['+' | '-'] <signless-integer>
|
||||
function consumeB(token, offset_, getNextToken) {
|
||||
var sign = false;
|
||||
var offset = skipSC(token, offset_, getNextToken);
|
||||
|
||||
token = getNextToken(offset);
|
||||
|
||||
if (token === null) {
|
||||
return offset_;
|
||||
}
|
||||
|
||||
if (token.type !== NUMBER) {
|
||||
if (isDelim(token, PLUSSIGN) || isDelim(token, HYPHENMINUS)) {
|
||||
sign = true;
|
||||
offset = skipSC(getNextToken(++offset), offset, getNextToken);
|
||||
token = getNextToken(offset);
|
||||
|
||||
if (token === null && token.type !== NUMBER) {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return offset_;
|
||||
}
|
||||
}
|
||||
|
||||
if (!sign) {
|
||||
var code = token.value.charCodeAt(0);
|
||||
if (code !== PLUSSIGN && code !== HYPHENMINUS) {
|
||||
// Number sign is expected
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return checkInteger(token, sign ? 0 : 1, sign, offset);
|
||||
}
|
||||
|
||||
// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
|
||||
module.exports = function anPlusB(token, getNextToken) {
|
||||
/* eslint-disable brace-style*/
|
||||
var offset = 0;
|
||||
|
||||
if (!token) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// <integer>
|
||||
if (token.type === NUMBER) {
|
||||
return checkInteger(token, 0, ALLOW_SIGN, offset); // b
|
||||
}
|
||||
|
||||
// -n
|
||||
// -n <signed-integer>
|
||||
// -n ['+' | '-'] <signless-integer>
|
||||
// -n- <signless-integer>
|
||||
// <dashndashdigit-ident>
|
||||
else if (token.type === IDENT && token.value.charCodeAt(0) === HYPHENMINUS) {
|
||||
// expect 1st char is N
|
||||
if (!cmpChar(token.value, 1, N)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (token.value.length) {
|
||||
// -n
|
||||
// -n <signed-integer>
|
||||
// -n ['+' | '-'] <signless-integer>
|
||||
case 2:
|
||||
return consumeB(getNextToken(++offset), offset, getNextToken);
|
||||
|
||||
// -n- <signless-integer>
|
||||
case 3:
|
||||
if (token.value.charCodeAt(2) !== HYPHENMINUS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
offset = skipSC(getNextToken(++offset), offset, getNextToken);
|
||||
token = getNextToken(offset);
|
||||
|
||||
return checkInteger(token, 0, DISALLOW_SIGN, offset);
|
||||
|
||||
// <dashndashdigit-ident>
|
||||
default:
|
||||
if (token.value.charCodeAt(2) !== HYPHENMINUS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return checkInteger(token, 3, DISALLOW_SIGN, offset);
|
||||
}
|
||||
}
|
||||
|
||||
// '+'? n
|
||||
// '+'? n <signed-integer>
|
||||
// '+'? n ['+' | '-'] <signless-integer>
|
||||
// '+'? n- <signless-integer>
|
||||
// '+'? <ndashdigit-ident>
|
||||
else if (token.type === IDENT || (isDelim(token, PLUSSIGN) && getNextToken(offset + 1).type === IDENT)) {
|
||||
// just ignore a plus
|
||||
if (token.type !== IDENT) {
|
||||
token = getNextToken(++offset);
|
||||
}
|
||||
|
||||
if (token === null || !cmpChar(token.value, 0, N)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (token.value.length) {
|
||||
// '+'? n
|
||||
// '+'? n <signed-integer>
|
||||
// '+'? n ['+' | '-'] <signless-integer>
|
||||
case 1:
|
||||
return consumeB(getNextToken(++offset), offset, getNextToken);
|
||||
|
||||
// '+'? n- <signless-integer>
|
||||
case 2:
|
||||
if (token.value.charCodeAt(1) !== HYPHENMINUS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
offset = skipSC(getNextToken(++offset), offset, getNextToken);
|
||||
token = getNextToken(offset);
|
||||
|
||||
return checkInteger(token, 0, DISALLOW_SIGN, offset);
|
||||
|
||||
// '+'? <ndashdigit-ident>
|
||||
default:
|
||||
if (token.value.charCodeAt(1) !== HYPHENMINUS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return checkInteger(token, 2, DISALLOW_SIGN, offset);
|
||||
}
|
||||
}
|
||||
|
||||
// <ndashdigit-dimension>
|
||||
// <ndash-dimension> <signless-integer>
|
||||
// <n-dimension>
|
||||
// <n-dimension> <signed-integer>
|
||||
// <n-dimension> ['+' | '-'] <signless-integer>
|
||||
else if (token.type === DIMENSION) {
|
||||
var code = token.value.charCodeAt(0);
|
||||
var sign = code === PLUSSIGN || code === HYPHENMINUS ? 1 : 0;
|
||||
|
||||
for (var i = sign; i < token.value.length; i++) {
|
||||
if (!isDigit(token.value.charCodeAt(i))) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i === sign) {
|
||||
// Integer is expected
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!cmpChar(token.value, i, N)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// <n-dimension>
|
||||
// <n-dimension> <signed-integer>
|
||||
// <n-dimension> ['+' | '-'] <signless-integer>
|
||||
if (i + 1 === token.value.length) {
|
||||
return consumeB(getNextToken(++offset), offset, getNextToken);
|
||||
} else {
|
||||
if (token.value.charCodeAt(i + 1) !== HYPHENMINUS) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// <ndash-dimension> <signless-integer>
|
||||
if (i + 2 === token.value.length) {
|
||||
offset = skipSC(getNextToken(++offset), offset, getNextToken);
|
||||
token = getNextToken(offset);
|
||||
|
||||
return checkInteger(token, 0, DISALLOW_SIGN, offset);
|
||||
}
|
||||
// <ndashdigit-dimension>
|
||||
else {
|
||||
return checkInteger(token, i + 2, DISALLOW_SIGN, offset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
159
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/generic-urange.js
generated
vendored
Normal file
159
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/generic-urange.js
generated
vendored
Normal file
@@ -0,0 +1,159 @@
|
||||
var isHexDigit = require('../tokenizer').isHexDigit;
|
||||
var cmpChar = require('../tokenizer').cmpChar;
|
||||
var TYPE = require('../tokenizer').TYPE;
|
||||
|
||||
var IDENT = TYPE.Ident;
|
||||
var DELIM = TYPE.Delim;
|
||||
var NUMBER = TYPE.Number;
|
||||
var DIMENSION = TYPE.Dimension;
|
||||
var PLUSSIGN = 0x002B; // U+002B PLUS SIGN (+)
|
||||
var HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
|
||||
var QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)
|
||||
var U = 0x0075; // U+0075 LATIN SMALL LETTER U (u)
|
||||
|
||||
function isDelim(token, code) {
|
||||
return token !== null && token.type === DELIM && token.value.charCodeAt(0) === code;
|
||||
}
|
||||
|
||||
function startsWith(token, code) {
|
||||
return token.value.charCodeAt(0) === code;
|
||||
}
|
||||
|
||||
function hexSequence(token, offset, allowDash) {
|
||||
for (var pos = offset, hexlen = 0; pos < token.value.length; pos++) {
|
||||
var code = token.value.charCodeAt(pos);
|
||||
|
||||
if (code === HYPHENMINUS && allowDash && hexlen !== 0) {
|
||||
if (hexSequence(token, offset + hexlen + 1, false) > 0) {
|
||||
return 6; // dissallow following question marks
|
||||
}
|
||||
|
||||
return 0; // dash at the ending of a hex sequence is not allowed
|
||||
}
|
||||
|
||||
if (!isHexDigit(code)) {
|
||||
return 0; // not a hex digit
|
||||
}
|
||||
|
||||
if (++hexlen > 6) {
|
||||
return 0; // too many hex digits
|
||||
};
|
||||
}
|
||||
|
||||
return hexlen;
|
||||
}
|
||||
|
||||
function withQuestionMarkSequence(consumed, length, getNextToken) {
|
||||
if (!consumed) {
|
||||
return 0; // nothing consumed
|
||||
}
|
||||
|
||||
while (isDelim(getNextToken(length), QUESTIONMARK)) {
|
||||
if (++consumed > 6) {
|
||||
return 0; // too many question marks
|
||||
}
|
||||
|
||||
length++;
|
||||
}
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-syntax/#urange
|
||||
// Informally, the <urange> production has three forms:
|
||||
// U+0001
|
||||
// Defines a range consisting of a single code point, in this case the code point "1".
|
||||
// U+0001-00ff
|
||||
// Defines a range of codepoints between the first and the second value, in this case
|
||||
// the range between "1" and "ff" (255 in decimal) inclusive.
|
||||
// U+00??
|
||||
// Defines a range of codepoints where the "?" characters range over all hex digits,
|
||||
// in this case defining the same as the value U+0000-00ff.
|
||||
// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat "?" as a hexadecimal digit).
|
||||
//
|
||||
// <urange> =
|
||||
// u '+' <ident-token> '?'* |
|
||||
// u <dimension-token> '?'* |
|
||||
// u <number-token> '?'* |
|
||||
// u <number-token> <dimension-token> |
|
||||
// u <number-token> <number-token> |
|
||||
// u '+' '?'+
|
||||
module.exports = function urange(token, getNextToken) {
|
||||
var length = 0;
|
||||
|
||||
// should start with `u` or `U`
|
||||
if (token === null || token.type !== IDENT || !cmpChar(token.value, 0, U)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
token = getNextToken(++length);
|
||||
if (token === null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// u '+' <ident-token> '?'*
|
||||
// u '+' '?'+
|
||||
if (isDelim(token, PLUSSIGN)) {
|
||||
token = getNextToken(++length);
|
||||
if (token === null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (token.type === IDENT) {
|
||||
// u '+' <ident-token> '?'*
|
||||
return withQuestionMarkSequence(hexSequence(token, 0, true), ++length, getNextToken);
|
||||
}
|
||||
|
||||
if (isDelim(token, QUESTIONMARK)) {
|
||||
// u '+' '?'+
|
||||
return withQuestionMarkSequence(1, ++length, getNextToken);
|
||||
}
|
||||
|
||||
// Hex digit or question mark is expected
|
||||
return 0;
|
||||
}
|
||||
|
||||
// u <number-token> '?'*
|
||||
// u <number-token> <dimension-token>
|
||||
// u <number-token> <number-token>
|
||||
if (token.type === NUMBER) {
|
||||
if (!startsWith(token, PLUSSIGN)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var consumedHexLength = hexSequence(token, 1, true);
|
||||
if (consumedHexLength === 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
token = getNextToken(++length);
|
||||
if (token === null) {
|
||||
// u <number-token> <eof>
|
||||
return length;
|
||||
}
|
||||
|
||||
if (token.type === DIMENSION || token.type === NUMBER) {
|
||||
// u <number-token> <dimension-token>
|
||||
// u <number-token> <number-token>
|
||||
if (!startsWith(token, HYPHENMINUS) || !hexSequence(token, 1, false)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return length + 1;
|
||||
}
|
||||
|
||||
// u <number-token> '?'*
|
||||
return withQuestionMarkSequence(consumedHexLength, length, getNextToken);
|
||||
}
|
||||
|
||||
// u <dimension-token> '?'*
|
||||
if (token.type === DIMENSION) {
|
||||
if (!startsWith(token, PLUSSIGN)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return withQuestionMarkSequence(hexSequence(token, 1, true), ++length, getNextToken);
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
585
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/generic.js
generated
vendored
Normal file
585
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/generic.js
generated
vendored
Normal file
@@ -0,0 +1,585 @@
|
||||
var tokenizer = require('../tokenizer');
|
||||
var isIdentifierStart = tokenizer.isIdentifierStart;
|
||||
var isHexDigit = tokenizer.isHexDigit;
|
||||
var isDigit = tokenizer.isDigit;
|
||||
var cmpStr = tokenizer.cmpStr;
|
||||
var consumeNumber = tokenizer.consumeNumber;
|
||||
var TYPE = tokenizer.TYPE;
|
||||
var anPlusB = require('./generic-an-plus-b');
|
||||
var urange = require('./generic-urange');
|
||||
|
||||
var cssWideKeywords = ['unset', 'initial', 'inherit'];
|
||||
var calcFunctionNames = ['calc(', '-moz-calc(', '-webkit-calc('];
|
||||
|
||||
// https://www.w3.org/TR/css-values-3/#lengths
|
||||
var LENGTH = {
|
||||
// absolute length units
|
||||
'px': true,
|
||||
'mm': true,
|
||||
'cm': true,
|
||||
'in': true,
|
||||
'pt': true,
|
||||
'pc': true,
|
||||
'q': true,
|
||||
|
||||
// relative length units
|
||||
'em': true,
|
||||
'ex': true,
|
||||
'ch': true,
|
||||
'rem': true,
|
||||
|
||||
// viewport-percentage lengths
|
||||
'vh': true,
|
||||
'vw': true,
|
||||
'vmin': true,
|
||||
'vmax': true,
|
||||
'vm': true
|
||||
};
|
||||
|
||||
var ANGLE = {
|
||||
'deg': true,
|
||||
'grad': true,
|
||||
'rad': true,
|
||||
'turn': true
|
||||
};
|
||||
|
||||
var TIME = {
|
||||
's': true,
|
||||
'ms': true
|
||||
};
|
||||
|
||||
var FREQUENCY = {
|
||||
'hz': true,
|
||||
'khz': true
|
||||
};
|
||||
|
||||
// https://www.w3.org/TR/css-values-3/#resolution (https://drafts.csswg.org/css-values/#resolution)
|
||||
var RESOLUTION = {
|
||||
'dpi': true,
|
||||
'dpcm': true,
|
||||
'dppx': true,
|
||||
'x': true // https://github.com/w3c/csswg-drafts/issues/461
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-grid/#fr-unit
|
||||
var FLEX = {
|
||||
'fr': true
|
||||
};
|
||||
|
||||
// https://www.w3.org/TR/css3-speech/#mixing-props-voice-volume
|
||||
var DECIBEL = {
|
||||
'db': true
|
||||
};
|
||||
|
||||
// https://www.w3.org/TR/css3-speech/#voice-props-voice-pitch
|
||||
var SEMITONES = {
|
||||
'st': true
|
||||
};
|
||||
|
||||
// safe char code getter
|
||||
function charCode(str, index) {
|
||||
return index < str.length ? str.charCodeAt(index) : 0;
|
||||
}
|
||||
|
||||
function eqStr(actual, expected) {
|
||||
return cmpStr(actual, 0, actual.length, expected);
|
||||
}
|
||||
|
||||
function eqStrAny(actual, expected) {
|
||||
for (var i = 0; i < expected.length; i++) {
|
||||
if (eqStr(actual, expected[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// IE postfix hack, i.e. 123\0 or 123px\9
|
||||
function isPostfixIeHack(str, offset) {
|
||||
if (offset !== str.length - 2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
str.charCodeAt(offset) === 0x005C && // U+005C REVERSE SOLIDUS (\)
|
||||
isDigit(str.charCodeAt(offset + 1))
|
||||
);
|
||||
}
|
||||
|
||||
function outOfRange(opts, value, numEnd) {
|
||||
if (opts && opts.type === 'Range') {
|
||||
var num = Number(
|
||||
numEnd !== undefined && numEnd !== value.length
|
||||
? value.substr(0, numEnd)
|
||||
: value
|
||||
);
|
||||
|
||||
if (isNaN(num)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (opts.min !== null && num < opts.min) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (opts.max !== null && num > opts.max) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function consumeFunction(token, getNextToken) {
|
||||
var startIdx = token.index;
|
||||
var length = 0;
|
||||
|
||||
// balanced token consuming
|
||||
do {
|
||||
length++;
|
||||
|
||||
if (token.balance <= startIdx) {
|
||||
break;
|
||||
}
|
||||
} while (token = getNextToken(length));
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
// can be used wherever <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> values are allowed
|
||||
// https://drafts.csswg.org/css-values/#calc-notation
|
||||
function calc(next) {
|
||||
return function(token, getNextToken, opts) {
|
||||
if (token === null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (token.type === TYPE.Function && eqStrAny(token.value, calcFunctionNames)) {
|
||||
return consumeFunction(token, getNextToken);
|
||||
}
|
||||
|
||||
return next(token, getNextToken, opts);
|
||||
};
|
||||
}
|
||||
|
||||
function tokenType(expectedTokenType) {
|
||||
return function(token) {
|
||||
if (token === null || token.type !== expectedTokenType) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
|
||||
function func(name) {
|
||||
name = name + '(';
|
||||
|
||||
return function(token, getNextToken) {
|
||||
if (token !== null && eqStr(token.value, name)) {
|
||||
return consumeFunction(token, getNextToken);
|
||||
}
|
||||
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
// =========================
|
||||
// Complex types
|
||||
//
|
||||
|
||||
// https://drafts.csswg.org/css-values-4/#custom-idents
|
||||
// 4.2. Author-defined Identifiers: the <custom-ident> type
|
||||
// Some properties accept arbitrary author-defined identifiers as a component value.
|
||||
// This generic data type is denoted by <custom-ident>, and represents any valid CSS identifier
|
||||
// that would not be misinterpreted as a pre-defined keyword in that property’s value definition.
|
||||
//
|
||||
// See also: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
|
||||
function customIdent(token) {
|
||||
if (token === null || token.type !== TYPE.Ident) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var name = token.value.toLowerCase();
|
||||
|
||||
// The CSS-wide keywords are not valid <custom-ident>s
|
||||
if (eqStrAny(name, cssWideKeywords)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// The default keyword is reserved and is also not a valid <custom-ident>
|
||||
if (eqStr(name, 'default')) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// TODO: ignore property specific keywords (as described https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident)
|
||||
// Specifications using <custom-ident> must specify clearly what other keywords
|
||||
// are excluded from <custom-ident>, if any—for example by saying that any pre-defined keywords
|
||||
// in that property’s value definition are excluded. Excluded keywords are excluded
|
||||
// in all ASCII case permutations.
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-variables/#typedef-custom-property-name
|
||||
// A custom property is any property whose name starts with two dashes (U+002D HYPHEN-MINUS), like --foo.
|
||||
// The <custom-property-name> production corresponds to this: it’s defined as any valid identifier
|
||||
// that starts with two dashes, except -- itself, which is reserved for future use by CSS.
|
||||
// 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.Ident) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ... that starts with two dashes (U+002D HYPHEN-MINUS)
|
||||
if (charCode(token.value, 0) !== 0x002D || charCode(token.value, 1) !== 0x002D) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-color-4/#hex-notation
|
||||
// The syntax of a <hex-color> is a <hash-token> token whose value consists of 3, 4, 6, or 8 hexadecimal digits.
|
||||
// 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.Hash) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var length = token.value.length;
|
||||
|
||||
// valid values (length): #rgb (4), #rgba (5), #rrggbb (7), #rrggbbaa (9)
|
||||
if (length !== 4 && length !== 5 && length !== 7 && length !== 9) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
for (var i = 1; i < length; i++) {
|
||||
if (!isHexDigit(token.value.charCodeAt(i))) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
function idSelector(token) {
|
||||
if (token === null || token.type !== TYPE.Hash) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!isIdentifierStart(charCode(token.value, 1), charCode(token.value, 2), charCode(token.value, 3))) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-syntax/#any-value
|
||||
// It represents the entirety of what a valid declaration can have as its value.
|
||||
function declarationValue(token, getNextToken) {
|
||||
if (!token) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var length = 0;
|
||||
var level = 0;
|
||||
var startIdx = token.index;
|
||||
|
||||
// The <declaration-value> production matches any sequence of one or more tokens,
|
||||
// so long as the sequence ...
|
||||
scan:
|
||||
do {
|
||||
switch (token.type) {
|
||||
// ... does not contain <bad-string-token>, <bad-url-token>,
|
||||
case TYPE.BadString:
|
||||
case TYPE.BadUrl:
|
||||
break scan;
|
||||
|
||||
// ... unmatched <)-token>, <]-token>, or <}-token>,
|
||||
case TYPE.RightCurlyBracket:
|
||||
case TYPE.RightParenthesis:
|
||||
case TYPE.RightSquareBracket:
|
||||
if (token.balance > token.index || token.balance < startIdx) {
|
||||
break scan;
|
||||
}
|
||||
|
||||
level--;
|
||||
break;
|
||||
|
||||
// ... or top-level <semicolon-token> tokens
|
||||
case TYPE.Semicolon:
|
||||
if (level === 0) {
|
||||
break scan;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// ... or <delim-token> tokens with a value of "!"
|
||||
case TYPE.Delim:
|
||||
if (token.value === '!' && level === 0) {
|
||||
break scan;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case TYPE.Function:
|
||||
case TYPE.LeftParenthesis:
|
||||
case TYPE.LeftSquareBracket:
|
||||
case TYPE.LeftCurlyBracket:
|
||||
level++;
|
||||
break;
|
||||
}
|
||||
|
||||
length++;
|
||||
|
||||
// until balance closing
|
||||
if (token.balance <= startIdx) {
|
||||
break;
|
||||
}
|
||||
} while (token = getNextToken(length));
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-syntax/#any-value
|
||||
// The <any-value> production is identical to <declaration-value>, but also
|
||||
// allows top-level <semicolon-token> tokens and <delim-token> tokens
|
||||
// with a value of "!". It represents the entirety of what valid CSS can be in any context.
|
||||
function anyValue(token, getNextToken) {
|
||||
if (!token) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var startIdx = token.index;
|
||||
var length = 0;
|
||||
|
||||
// The <any-value> production matches any sequence of one or more tokens,
|
||||
// so long as the sequence ...
|
||||
scan:
|
||||
do {
|
||||
switch (token.type) {
|
||||
// ... does not contain <bad-string-token>, <bad-url-token>,
|
||||
case TYPE.BadString:
|
||||
case TYPE.BadUrl:
|
||||
break scan;
|
||||
|
||||
// ... unmatched <)-token>, <]-token>, or <}-token>,
|
||||
case TYPE.RightCurlyBracket:
|
||||
case TYPE.RightParenthesis:
|
||||
case TYPE.RightSquareBracket:
|
||||
if (token.balance > token.index || token.balance < startIdx) {
|
||||
break scan;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
length++;
|
||||
|
||||
// until balance closing
|
||||
if (token.balance <= startIdx) {
|
||||
break;
|
||||
}
|
||||
} while (token = getNextToken(length));
|
||||
|
||||
return length;
|
||||
}
|
||||
|
||||
// =========================
|
||||
// Dimensions
|
||||
//
|
||||
|
||||
function dimension(type) {
|
||||
return function(token, getNextToken, opts) {
|
||||
if (token === null || token.type !== TYPE.Dimension) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var numberEnd = consumeNumber(token.value, 0);
|
||||
|
||||
// check unit
|
||||
if (type !== null) {
|
||||
// check for IE postfix hack, i.e. 123px\0 or 123px\9
|
||||
var reverseSolidusOffset = token.value.indexOf('\\', numberEnd);
|
||||
var unit = reverseSolidusOffset === -1 || !isPostfixIeHack(token.value, reverseSolidusOffset)
|
||||
? token.value.substr(numberEnd)
|
||||
: token.value.substring(numberEnd, reverseSolidusOffset);
|
||||
|
||||
if (type.hasOwnProperty(unit.toLowerCase()) === false) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// check range if specified
|
||||
if (outOfRange(opts, token.value, numberEnd)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
};
|
||||
}
|
||||
|
||||
// =========================
|
||||
// Percentage
|
||||
//
|
||||
|
||||
// §5.5. Percentages: the <percentage> type
|
||||
// https://drafts.csswg.org/css-values-4/#percentages
|
||||
function percentage(token, getNextToken, opts) {
|
||||
// ... corresponds to the <percentage-token> production
|
||||
if (token === null || token.type !== TYPE.Percentage) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// check range if specified
|
||||
if (outOfRange(opts, token.value, token.value.length - 1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// =========================
|
||||
// Numeric
|
||||
//
|
||||
|
||||
// https://drafts.csswg.org/css-values-4/#numbers
|
||||
// The value <zero> represents a literal number with the value 0. Expressions that merely
|
||||
// evaluate to a <number> with the value 0 (for example, calc(0)) do not match <zero>;
|
||||
// only literal <number-token>s do.
|
||||
function zero(next) {
|
||||
if (typeof next !== 'function') {
|
||||
next = function() {
|
||||
return 0;
|
||||
};
|
||||
}
|
||||
|
||||
return function(token, getNextToken, opts) {
|
||||
if (token !== null && token.type === TYPE.Number) {
|
||||
if (Number(token.value) === 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return next(token, getNextToken, opts);
|
||||
};
|
||||
}
|
||||
|
||||
// § 5.3. Real Numbers: the <number> type
|
||||
// https://drafts.csswg.org/css-values-4/#numbers
|
||||
// Number values are denoted by <number>, and represent real numbers, possibly with a fractional component.
|
||||
// ... It corresponds to the <number-token> production
|
||||
function number(token, getNextToken, opts) {
|
||||
if (token === null) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
var numberEnd = consumeNumber(token.value, 0);
|
||||
var isNumber = numberEnd === token.value.length;
|
||||
if (!isNumber && !isPostfixIeHack(token.value, numberEnd)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// check range if specified
|
||||
if (outOfRange(opts, token.value, numberEnd)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
// §5.2. Integers: the <integer> type
|
||||
// https://drafts.csswg.org/css-values-4/#integers
|
||||
function integer(token, getNextToken, opts) {
|
||||
// ... corresponds to a subset of the <number-token> production
|
||||
if (token === null || token.type !== TYPE.Number) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// The first digit of an integer may be immediately preceded by `-` or `+` to indicate the integer’s sign.
|
||||
var i = token.value.charCodeAt(0) === 0x002B || // U+002B PLUS SIGN (+)
|
||||
token.value.charCodeAt(0) === 0x002D ? 1 : 0; // U+002D HYPHEN-MINUS (-)
|
||||
|
||||
// When written literally, an integer is one or more decimal digits 0 through 9 ...
|
||||
for (; i < token.value.length; i++) {
|
||||
if (!isDigit(token.value.charCodeAt(i))) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
// check range if specified
|
||||
if (outOfRange(opts, token.value, i)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
// token types
|
||||
'ident-token': tokenType(TYPE.Ident),
|
||||
'function-token': tokenType(TYPE.Function),
|
||||
'at-keyword-token': tokenType(TYPE.AtKeyword),
|
||||
'hash-token': tokenType(TYPE.Hash),
|
||||
'string-token': tokenType(TYPE.String),
|
||||
'bad-string-token': tokenType(TYPE.BadString),
|
||||
'url-token': tokenType(TYPE.Url),
|
||||
'bad-url-token': tokenType(TYPE.BadUrl),
|
||||
'delim-token': tokenType(TYPE.Delim),
|
||||
'number-token': tokenType(TYPE.Number),
|
||||
'percentage-token': tokenType(TYPE.Percentage),
|
||||
'dimension-token': tokenType(TYPE.Dimension),
|
||||
'whitespace-token': tokenType(TYPE.WhiteSpace),
|
||||
'CDO-token': tokenType(TYPE.CDO),
|
||||
'CDC-token': tokenType(TYPE.CDC),
|
||||
'colon-token': tokenType(TYPE.Colon),
|
||||
'semicolon-token': tokenType(TYPE.Semicolon),
|
||||
'comma-token': tokenType(TYPE.Comma),
|
||||
'[-token': tokenType(TYPE.LeftSquareBracket),
|
||||
']-token': tokenType(TYPE.RightSquareBracket),
|
||||
'(-token': tokenType(TYPE.LeftParenthesis),
|
||||
')-token': tokenType(TYPE.RightParenthesis),
|
||||
'{-token': tokenType(TYPE.LeftCurlyBracket),
|
||||
'}-token': tokenType(TYPE.RightCurlyBracket),
|
||||
|
||||
// token type aliases
|
||||
'string': tokenType(TYPE.String),
|
||||
'ident': tokenType(TYPE.Ident),
|
||||
|
||||
// complex types
|
||||
'custom-ident': customIdent,
|
||||
'custom-property-name': customPropertyName,
|
||||
'hex-color': hexColor,
|
||||
'id-selector': idSelector, // element( <id-selector> )
|
||||
'an-plus-b': anPlusB,
|
||||
'urange': urange,
|
||||
'declaration-value': declarationValue,
|
||||
'any-value': anyValue,
|
||||
|
||||
// dimensions
|
||||
'dimension': calc(dimension(null)),
|
||||
'angle': calc(dimension(ANGLE)),
|
||||
'decibel': calc(dimension(DECIBEL)),
|
||||
'frequency': calc(dimension(FREQUENCY)),
|
||||
'flex': calc(dimension(FLEX)),
|
||||
'length': calc(zero(dimension(LENGTH))),
|
||||
'resolution': calc(dimension(RESOLUTION)),
|
||||
'semitones': calc(dimension(SEMITONES)),
|
||||
'time': calc(dimension(TIME)),
|
||||
|
||||
// percentage
|
||||
'percentage': calc(percentage),
|
||||
|
||||
// numeric
|
||||
'zero': zero(),
|
||||
'number': calc(number),
|
||||
'integer': calc(integer),
|
||||
|
||||
// old IE stuff
|
||||
'-ms-legacy-expression': func('expression')
|
||||
};
|
||||
3
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/index.js
generated
vendored
Normal file
3
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/index.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
Lexer: require('./Lexer')
|
||||
};
|
||||
455
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/match-graph.js
generated
vendored
Normal file
455
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/match-graph.js
generated
vendored
Normal file
@@ -0,0 +1,455 @@
|
||||
var parse = require('../definition-syntax/parse');
|
||||
|
||||
var MATCH = { type: 'Match' };
|
||||
var MISMATCH = { type: 'Mismatch' };
|
||||
var DISALLOW_EMPTY = { type: 'DisallowEmpty' };
|
||||
var LEFTPARENTHESIS = 40; // (
|
||||
var RIGHTPARENTHESIS = 41; // )
|
||||
|
||||
function createCondition(match, thenBranch, elseBranch) {
|
||||
// reduce node count
|
||||
if (thenBranch === MATCH && elseBranch === MISMATCH) {
|
||||
return match;
|
||||
}
|
||||
|
||||
if (match === MATCH && thenBranch === MATCH && elseBranch === MATCH) {
|
||||
return match;
|
||||
}
|
||||
|
||||
if (match.type === 'If' && match.else === MISMATCH && thenBranch === MATCH) {
|
||||
thenBranch = match.then;
|
||||
match = match.match;
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'If',
|
||||
match: match,
|
||||
then: thenBranch,
|
||||
else: elseBranch
|
||||
};
|
||||
}
|
||||
|
||||
function isFunctionType(name) {
|
||||
return (
|
||||
name.length > 2 &&
|
||||
name.charCodeAt(name.length - 2) === LEFTPARENTHESIS &&
|
||||
name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS
|
||||
);
|
||||
}
|
||||
|
||||
function isEnumCapatible(term) {
|
||||
return (
|
||||
term.type === 'Keyword' ||
|
||||
term.type === 'AtKeyword' ||
|
||||
term.type === 'Function' ||
|
||||
term.type === 'Type' && isFunctionType(term.name)
|
||||
);
|
||||
}
|
||||
|
||||
function buildGroupMatchGraph(combinator, terms, atLeastOneTermMatched) {
|
||||
switch (combinator) {
|
||||
case ' ':
|
||||
// Juxtaposing components means that all of them must occur, in the given order.
|
||||
//
|
||||
// a b c
|
||||
// =
|
||||
// match a
|
||||
// then match b
|
||||
// then match c
|
||||
// then MATCH
|
||||
// else MISMATCH
|
||||
// else MISMATCH
|
||||
// else MISMATCH
|
||||
var result = MATCH;
|
||||
|
||||
for (var i = terms.length - 1; i >= 0; i--) {
|
||||
var term = terms[i];
|
||||
|
||||
result = createCondition(
|
||||
term,
|
||||
result,
|
||||
MISMATCH
|
||||
);
|
||||
};
|
||||
|
||||
return result;
|
||||
|
||||
case '|':
|
||||
// A bar (|) separates two or more alternatives: exactly one of them must occur.
|
||||
//
|
||||
// a | b | c
|
||||
// =
|
||||
// match a
|
||||
// then MATCH
|
||||
// else match b
|
||||
// then MATCH
|
||||
// else match c
|
||||
// then MATCH
|
||||
// else MISMATCH
|
||||
|
||||
var result = MISMATCH;
|
||||
var map = null;
|
||||
|
||||
for (var i = terms.length - 1; i >= 0; i--) {
|
||||
var term = terms[i];
|
||||
|
||||
// reduce sequence of keywords into a Enum
|
||||
if (isEnumCapatible(term)) {
|
||||
if (map === null && i > 0 && isEnumCapatible(terms[i - 1])) {
|
||||
map = Object.create(null);
|
||||
result = createCondition(
|
||||
{
|
||||
type: 'Enum',
|
||||
map: map
|
||||
},
|
||||
MATCH,
|
||||
result
|
||||
);
|
||||
}
|
||||
|
||||
if (map !== null) {
|
||||
var key = (isFunctionType(term.name) ? term.name.slice(0, -1) : term.name).toLowerCase();
|
||||
if (key in map === false) {
|
||||
map[key] = term;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
map = null;
|
||||
|
||||
// create a new conditonal node
|
||||
result = createCondition(
|
||||
term,
|
||||
MATCH,
|
||||
result
|
||||
);
|
||||
};
|
||||
|
||||
return result;
|
||||
|
||||
case '&&':
|
||||
// A double ampersand (&&) separates two or more components,
|
||||
// all of which must occur, in any order.
|
||||
|
||||
// Use MatchOnce for groups with a large number of terms,
|
||||
// since &&-groups produces at least N!-node trees
|
||||
if (terms.length > 5) {
|
||||
return {
|
||||
type: 'MatchOnce',
|
||||
terms: terms,
|
||||
all: true
|
||||
};
|
||||
}
|
||||
|
||||
// Use a combination tree for groups with small number of terms
|
||||
//
|
||||
// a && b && c
|
||||
// =
|
||||
// match a
|
||||
// then [b && c]
|
||||
// else match b
|
||||
// then [a && c]
|
||||
// else match c
|
||||
// then [a && b]
|
||||
// else MISMATCH
|
||||
//
|
||||
// a && b
|
||||
// =
|
||||
// match a
|
||||
// then match b
|
||||
// then MATCH
|
||||
// else MISMATCH
|
||||
// else match b
|
||||
// then match a
|
||||
// then MATCH
|
||||
// else MISMATCH
|
||||
// else MISMATCH
|
||||
var result = MISMATCH;
|
||||
|
||||
for (var i = terms.length - 1; i >= 0; i--) {
|
||||
var term = terms[i];
|
||||
var thenClause;
|
||||
|
||||
if (terms.length > 1) {
|
||||
thenClause = buildGroupMatchGraph(
|
||||
combinator,
|
||||
terms.filter(function(newGroupTerm) {
|
||||
return newGroupTerm !== term;
|
||||
}),
|
||||
false
|
||||
);
|
||||
} else {
|
||||
thenClause = MATCH;
|
||||
}
|
||||
|
||||
result = createCondition(
|
||||
term,
|
||||
thenClause,
|
||||
result
|
||||
);
|
||||
};
|
||||
|
||||
return result;
|
||||
|
||||
case '||':
|
||||
// A double bar (||) separates two or more options:
|
||||
// one or more of them must occur, in any order.
|
||||
|
||||
// Use MatchOnce for groups with a large number of terms,
|
||||
// since ||-groups produces at least N!-node trees
|
||||
if (terms.length > 5) {
|
||||
return {
|
||||
type: 'MatchOnce',
|
||||
terms: terms,
|
||||
all: false
|
||||
};
|
||||
}
|
||||
|
||||
// Use a combination tree for groups with small number of terms
|
||||
//
|
||||
// a || b || c
|
||||
// =
|
||||
// match a
|
||||
// then [b || c]
|
||||
// else match b
|
||||
// then [a || c]
|
||||
// else match c
|
||||
// then [a || b]
|
||||
// else MISMATCH
|
||||
//
|
||||
// a || b
|
||||
// =
|
||||
// match a
|
||||
// then match b
|
||||
// then MATCH
|
||||
// else MATCH
|
||||
// else match b
|
||||
// then match a
|
||||
// then MATCH
|
||||
// else MATCH
|
||||
// else MISMATCH
|
||||
var result = atLeastOneTermMatched ? MATCH : MISMATCH;
|
||||
|
||||
for (var i = terms.length - 1; i >= 0; i--) {
|
||||
var term = terms[i];
|
||||
var thenClause;
|
||||
|
||||
if (terms.length > 1) {
|
||||
thenClause = buildGroupMatchGraph(
|
||||
combinator,
|
||||
terms.filter(function(newGroupTerm) {
|
||||
return newGroupTerm !== term;
|
||||
}),
|
||||
true
|
||||
);
|
||||
} else {
|
||||
thenClause = MATCH;
|
||||
}
|
||||
|
||||
result = createCondition(
|
||||
term,
|
||||
thenClause,
|
||||
result
|
||||
);
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
function buildMultiplierMatchGraph(node) {
|
||||
var result = MATCH;
|
||||
var matchTerm = buildMatchGraph(node.term);
|
||||
|
||||
if (node.max === 0) {
|
||||
// disable repeating of empty match to prevent infinite loop
|
||||
matchTerm = createCondition(
|
||||
matchTerm,
|
||||
DISALLOW_EMPTY,
|
||||
MISMATCH
|
||||
);
|
||||
|
||||
// an occurrence count is not limited, make a cycle;
|
||||
// to collect more terms on each following matching mismatch
|
||||
result = createCondition(
|
||||
matchTerm,
|
||||
null, // will be a loop
|
||||
MISMATCH
|
||||
);
|
||||
|
||||
result.then = createCondition(
|
||||
MATCH,
|
||||
MATCH,
|
||||
result // make a loop
|
||||
);
|
||||
|
||||
if (node.comma) {
|
||||
result.then.else = createCondition(
|
||||
{ type: 'Comma', syntax: node },
|
||||
result,
|
||||
MISMATCH
|
||||
);
|
||||
}
|
||||
} 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) {
|
||||
result = createCondition(
|
||||
{ type: 'Comma', syntax: node },
|
||||
result,
|
||||
MISMATCH
|
||||
);
|
||||
}
|
||||
|
||||
result = createCondition(
|
||||
matchTerm,
|
||||
createCondition(
|
||||
MATCH,
|
||||
MATCH,
|
||||
result
|
||||
),
|
||||
MISMATCH
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (node.min === 0) {
|
||||
// allow zero match
|
||||
result = createCondition(
|
||||
MATCH,
|
||||
MATCH,
|
||||
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) {
|
||||
result = createCondition(
|
||||
{ type: 'Comma', syntax: node },
|
||||
result,
|
||||
MISMATCH
|
||||
);
|
||||
}
|
||||
|
||||
result = createCondition(
|
||||
matchTerm,
|
||||
result,
|
||||
MISMATCH
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function buildMatchGraph(node) {
|
||||
if (typeof node === 'function') {
|
||||
return {
|
||||
type: 'Generic',
|
||||
fn: node
|
||||
};
|
||||
}
|
||||
|
||||
switch (node.type) {
|
||||
case 'Group':
|
||||
var result = buildGroupMatchGraph(
|
||||
node.combinator,
|
||||
node.terms.map(buildMatchGraph),
|
||||
false
|
||||
);
|
||||
|
||||
if (node.disallowEmpty) {
|
||||
result = createCondition(
|
||||
result,
|
||||
DISALLOW_EMPTY,
|
||||
MISMATCH
|
||||
);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
case 'Multiplier':
|
||||
return buildMultiplierMatchGraph(node);
|
||||
|
||||
case 'Type':
|
||||
case 'Property':
|
||||
return {
|
||||
type: node.type,
|
||||
name: node.name,
|
||||
syntax: node
|
||||
};
|
||||
|
||||
case 'Keyword':
|
||||
return {
|
||||
type: node.type,
|
||||
name: node.name.toLowerCase(),
|
||||
syntax: node
|
||||
};
|
||||
|
||||
case 'AtKeyword':
|
||||
return {
|
||||
type: node.type,
|
||||
name: '@' + node.name.toLowerCase(),
|
||||
syntax: node
|
||||
};
|
||||
|
||||
case 'Function':
|
||||
return {
|
||||
type: node.type,
|
||||
name: node.name.toLowerCase() + '(',
|
||||
syntax: node
|
||||
};
|
||||
|
||||
case 'String':
|
||||
// convert a one char length String to a Token
|
||||
if (node.value.length === 3) {
|
||||
return {
|
||||
type: 'Token',
|
||||
value: node.value.charAt(1),
|
||||
syntax: node
|
||||
};
|
||||
}
|
||||
|
||||
// otherwise use it as is
|
||||
return {
|
||||
type: node.type,
|
||||
value: node.value.substr(1, node.value.length - 2).replace(/\\'/g, '\''),
|
||||
syntax: node
|
||||
};
|
||||
|
||||
case 'Token':
|
||||
return {
|
||||
type: node.type,
|
||||
value: node.value,
|
||||
syntax: node
|
||||
};
|
||||
|
||||
case 'Comma':
|
||||
return {
|
||||
type: node.type,
|
||||
syntax: node
|
||||
};
|
||||
|
||||
default:
|
||||
throw new Error('Unknown node type:', node.type);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
MATCH: MATCH,
|
||||
MISMATCH: MISMATCH,
|
||||
DISALLOW_EMPTY: DISALLOW_EMPTY,
|
||||
buildMatchGraph: function(syntaxTree, ref) {
|
||||
if (typeof syntaxTree === 'string') {
|
||||
syntaxTree = parse(syntaxTree);
|
||||
}
|
||||
|
||||
return {
|
||||
type: 'MatchGraph',
|
||||
match: buildMatchGraph(syntaxTree),
|
||||
syntax: ref || null,
|
||||
source: syntaxTree
|
||||
};
|
||||
}
|
||||
};
|
||||
639
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/match.js
generated
vendored
Normal file
639
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/match.js
generated
vendored
Normal file
@@ -0,0 +1,639 @@
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var matchGraph = require('./match-graph');
|
||||
var MATCH = matchGraph.MATCH;
|
||||
var MISMATCH = matchGraph.MISMATCH;
|
||||
var DISALLOW_EMPTY = matchGraph.DISALLOW_EMPTY;
|
||||
var TYPE = require('../tokenizer/const').TYPE;
|
||||
|
||||
var STUB = 0;
|
||||
var TOKEN = 1;
|
||||
var OPEN_SYNTAX = 2;
|
||||
var CLOSE_SYNTAX = 3;
|
||||
|
||||
var EXIT_REASON_MATCH = 'Match';
|
||||
var EXIT_REASON_MISMATCH = 'Mismatch';
|
||||
var EXIT_REASON_ITERATION_LIMIT = 'Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)';
|
||||
|
||||
var ITERATION_LIMIT = 15000;
|
||||
var totalIterationCount = 0;
|
||||
|
||||
function reverseList(list) {
|
||||
var prev = null;
|
||||
var next = null;
|
||||
var item = list;
|
||||
|
||||
while (item !== null) {
|
||||
next = item.prev;
|
||||
item.prev = prev;
|
||||
prev = item;
|
||||
item = next;
|
||||
}
|
||||
|
||||
return prev;
|
||||
}
|
||||
|
||||
function areStringsEqualCaseInsensitive(testStr, referenceStr) {
|
||||
if (testStr.length !== referenceStr.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (var i = 0; i < testStr.length; i++) {
|
||||
var testCode = testStr.charCodeAt(i);
|
||||
var referenceCode = referenceStr.charCodeAt(i);
|
||||
|
||||
// testCode.toLowerCase() for U+0041 LATIN CAPITAL LETTER A (A) .. U+005A LATIN CAPITAL LETTER Z (Z).
|
||||
if (testCode >= 0x0041 && testCode <= 0x005A) {
|
||||
testCode = testCode | 32;
|
||||
}
|
||||
|
||||
if (testCode !== referenceCode) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function isContextEdgeDelim(token) {
|
||||
if (token.type !== TYPE.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.Comma ||
|
||||
token.type === TYPE.Function ||
|
||||
token.type === TYPE.LeftParenthesis ||
|
||||
token.type === TYPE.LeftSquareBracket ||
|
||||
token.type === TYPE.LeftCurlyBracket ||
|
||||
isContextEdgeDelim(token)
|
||||
);
|
||||
}
|
||||
|
||||
function isCommaContextEnd(token) {
|
||||
if (token === null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return (
|
||||
token.type === TYPE.RightParenthesis ||
|
||||
token.type === TYPE.RightSquareBracket ||
|
||||
token.type === TYPE.RightCurlyBracket ||
|
||||
token.type === TYPE.Delim
|
||||
);
|
||||
}
|
||||
|
||||
function internalMatch(tokens, state, syntaxes) {
|
||||
function moveToNextToken() {
|
||||
do {
|
||||
tokenIndex++;
|
||||
token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
|
||||
} while (token !== null && (token.type === TYPE.WhiteSpace || token.type === TYPE.Comment));
|
||||
}
|
||||
|
||||
function getNextToken(offset) {
|
||||
var nextIndex = tokenIndex + offset;
|
||||
|
||||
return nextIndex < tokens.length ? tokens[nextIndex] : null;
|
||||
}
|
||||
|
||||
function stateSnapshotFromSyntax(nextState, prev) {
|
||||
return {
|
||||
nextState: nextState,
|
||||
matchStack: matchStack,
|
||||
syntaxStack: syntaxStack,
|
||||
thenStack: thenStack,
|
||||
tokenIndex: tokenIndex,
|
||||
prev: prev
|
||||
};
|
||||
}
|
||||
|
||||
function pushThenStack(nextState) {
|
||||
thenStack = {
|
||||
nextState: nextState,
|
||||
matchStack: matchStack,
|
||||
syntaxStack: syntaxStack,
|
||||
prev: thenStack
|
||||
};
|
||||
}
|
||||
|
||||
function pushElseStack(nextState) {
|
||||
elseStack = stateSnapshotFromSyntax(nextState, elseStack);
|
||||
}
|
||||
|
||||
function addTokenToMatch() {
|
||||
matchStack = {
|
||||
type: TOKEN,
|
||||
syntax: state.syntax,
|
||||
token: token,
|
||||
prev: matchStack
|
||||
};
|
||||
|
||||
moveToNextToken();
|
||||
syntaxStash = null;
|
||||
|
||||
if (tokenIndex > longestMatch) {
|
||||
longestMatch = tokenIndex;
|
||||
}
|
||||
}
|
||||
|
||||
function openSyntax() {
|
||||
syntaxStack = {
|
||||
syntax: state.syntax,
|
||||
opts: state.syntax.opts || (syntaxStack !== null && syntaxStack.opts) || null,
|
||||
prev: syntaxStack
|
||||
};
|
||||
|
||||
matchStack = {
|
||||
type: OPEN_SYNTAX,
|
||||
syntax: state.syntax,
|
||||
token: matchStack.token,
|
||||
prev: matchStack
|
||||
};
|
||||
}
|
||||
|
||||
function closeSyntax() {
|
||||
if (matchStack.type === OPEN_SYNTAX) {
|
||||
matchStack = matchStack.prev;
|
||||
} else {
|
||||
matchStack = {
|
||||
type: CLOSE_SYNTAX,
|
||||
syntax: syntaxStack.syntax,
|
||||
token: matchStack.token,
|
||||
prev: matchStack
|
||||
};
|
||||
}
|
||||
|
||||
syntaxStack = syntaxStack.prev;
|
||||
}
|
||||
|
||||
var syntaxStack = null;
|
||||
var thenStack = null;
|
||||
var elseStack = null;
|
||||
|
||||
// null – stashing allowed, nothing stashed
|
||||
// false – stashing disabled, nothing stashed
|
||||
// anithing else – fail stashable syntaxes, some syntax stashed
|
||||
var syntaxStash = null;
|
||||
|
||||
var iterationCount = 0; // count iterations and prevent infinite loop
|
||||
var exitReason = null;
|
||||
|
||||
var token = null;
|
||||
var tokenIndex = -1;
|
||||
var longestMatch = 0;
|
||||
var matchStack = {
|
||||
type: STUB,
|
||||
syntax: null,
|
||||
token: null,
|
||||
prev: null
|
||||
};
|
||||
|
||||
moveToNextToken();
|
||||
|
||||
while (exitReason === null && ++iterationCount < ITERATION_LIMIT) {
|
||||
// function mapList(list, fn) {
|
||||
// var result = [];
|
||||
// while (list) {
|
||||
// result.unshift(fn(list));
|
||||
// list = list.prev;
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
// console.log('--\n',
|
||||
// '#' + iterationCount,
|
||||
// require('util').inspect({
|
||||
// match: mapList(matchStack, x => x.type === TOKEN ? x.token && x.token.value : x.syntax ? ({ [OPEN_SYNTAX]: '<', [CLOSE_SYNTAX]: '</' }[x.type] || x.type) + '!' + x.syntax.name : null),
|
||||
// token: token && token.value,
|
||||
// tokenIndex,
|
||||
// syntax: syntax.type + (syntax.id ? ' #' + syntax.id : '')
|
||||
// }, { depth: null })
|
||||
// );
|
||||
switch (state.type) {
|
||||
case 'Match':
|
||||
if (thenStack === null) {
|
||||
// turn to MISMATCH when some tokens left unmatched
|
||||
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;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// break the main loop, return a result - MATCH
|
||||
exitReason = EXIT_REASON_MATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
// go to next syntax (`then` branch)
|
||||
state = thenStack.nextState;
|
||||
|
||||
// check match is not empty
|
||||
if (state === DISALLOW_EMPTY) {
|
||||
if (thenStack.matchStack === matchStack) {
|
||||
state = MISMATCH;
|
||||
break;
|
||||
} else {
|
||||
state = MATCH;
|
||||
}
|
||||
}
|
||||
|
||||
// close syntax if needed
|
||||
while (thenStack.syntaxStack !== syntaxStack) {
|
||||
closeSyntax();
|
||||
}
|
||||
|
||||
// pop stack
|
||||
thenStack = thenStack.prev;
|
||||
break;
|
||||
|
||||
case 'Mismatch':
|
||||
// when some syntax is stashed
|
||||
if (syntaxStash !== null && syntaxStash !== false) {
|
||||
// there is no else branches or a branch reduce match stack
|
||||
if (elseStack === null || tokenIndex > elseStack.tokenIndex) {
|
||||
// restore state from the stash
|
||||
elseStack = syntaxStash;
|
||||
syntaxStash = false; // disable stashing
|
||||
}
|
||||
} else if (elseStack === null) {
|
||||
// no else branches -> break the main loop
|
||||
// return a result - MISMATCH
|
||||
exitReason = EXIT_REASON_MISMATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
// go to next syntax (`else` branch)
|
||||
state = elseStack.nextState;
|
||||
|
||||
// restore all the rest stack states
|
||||
thenStack = elseStack.thenStack;
|
||||
syntaxStack = elseStack.syntaxStack;
|
||||
matchStack = elseStack.matchStack;
|
||||
tokenIndex = elseStack.tokenIndex;
|
||||
token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
|
||||
|
||||
// pop stack
|
||||
elseStack = elseStack.prev;
|
||||
break;
|
||||
|
||||
case 'MatchGraph':
|
||||
state = state.match;
|
||||
break;
|
||||
|
||||
case 'If':
|
||||
// IMPORTANT: else stack push must go first,
|
||||
// since it stores the state of thenStack before changes
|
||||
if (state.else !== MISMATCH) {
|
||||
pushElseStack(state.else);
|
||||
}
|
||||
|
||||
if (state.then !== MATCH) {
|
||||
pushThenStack(state.then);
|
||||
}
|
||||
|
||||
state = state.match;
|
||||
break;
|
||||
|
||||
case 'MatchOnce':
|
||||
state = {
|
||||
type: 'MatchOnceBuffer',
|
||||
syntax: state,
|
||||
index: 0,
|
||||
mask: 0
|
||||
};
|
||||
break;
|
||||
|
||||
case 'MatchOnceBuffer':
|
||||
var terms = state.syntax.terms;
|
||||
|
||||
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;
|
||||
break;
|
||||
}
|
||||
|
||||
// a partial match is ok
|
||||
state = MATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
// all terms are matched
|
||||
if (state.mask === (1 << terms.length) - 1) {
|
||||
state = MATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
for (; state.index < terms.length; state.index++) {
|
||||
var matchFlag = 1 << state.index;
|
||||
|
||||
if ((state.mask & matchFlag) === 0) {
|
||||
// IMPORTANT: else stack push must go first,
|
||||
// since it stores the state of thenStack before changes
|
||||
pushElseStack(state);
|
||||
pushThenStack({
|
||||
type: 'AddMatchOnce',
|
||||
syntax: state.syntax,
|
||||
mask: state.mask | matchFlag
|
||||
});
|
||||
|
||||
// match
|
||||
state = terms[state.index++];
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 'AddMatchOnce':
|
||||
state = {
|
||||
type: 'MatchOnceBuffer',
|
||||
syntax: state.syntax,
|
||||
index: 0,
|
||||
mask: state.mask
|
||||
};
|
||||
break;
|
||||
|
||||
case 'Enum':
|
||||
if (token !== null) {
|
||||
var name = token.value.toLowerCase();
|
||||
|
||||
// drop \0 and \9 hack from keyword name
|
||||
if (name.indexOf('\\') !== -1) {
|
||||
name = name.replace(/\\[09].*$/, '');
|
||||
}
|
||||
|
||||
if (hasOwnProperty.call(state.map, name)) {
|
||||
state = state.map[name];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
state = MISMATCH;
|
||||
break;
|
||||
|
||||
case 'Generic':
|
||||
var opts = syntaxStack !== null ? syntaxStack.opts : null;
|
||||
var lastTokenIndex = tokenIndex + Math.floor(state.fn(token, getNextToken, opts));
|
||||
|
||||
if (!isNaN(lastTokenIndex) && lastTokenIndex > tokenIndex) {
|
||||
while (tokenIndex < lastTokenIndex) {
|
||||
addTokenToMatch();
|
||||
}
|
||||
|
||||
state = MATCH;
|
||||
} else {
|
||||
state = MISMATCH;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'Type':
|
||||
case 'Property':
|
||||
var syntaxDict = state.type === 'Type' ? 'types' : 'properties';
|
||||
var dictSyntax = hasOwnProperty.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;
|
||||
|
||||
if (!dictSyntax || !dictSyntax.match) {
|
||||
throw new Error(
|
||||
'Bad syntax reference: ' +
|
||||
(state.type === 'Type'
|
||||
? '<' + state.name + '>'
|
||||
: '<\'' + state.name + '\'>')
|
||||
);
|
||||
}
|
||||
|
||||
// stash a syntax for types with low priority
|
||||
if (syntaxStash !== false && token !== null && state.type === 'Type') {
|
||||
var lowPriorityMatching =
|
||||
// https://drafts.csswg.org/css-values-4/#custom-idents
|
||||
// When parsing positionally-ambiguous keywords in a property value, a <custom-ident> production
|
||||
// can only claim the keyword if no other unfulfilled production can claim it.
|
||||
(state.name === 'custom-ident' && token.type === TYPE.Ident) ||
|
||||
|
||||
// https://drafts.csswg.org/css-values-4/#lengths
|
||||
// ... if a `0` could be parsed as either a <number> or a <length> in a property (such as line-height),
|
||||
// it must parse as a <number>
|
||||
(state.name === 'length' && token.value === '0');
|
||||
|
||||
if (lowPriorityMatching) {
|
||||
if (syntaxStash === null) {
|
||||
syntaxStash = stateSnapshotFromSyntax(state, elseStack);
|
||||
}
|
||||
|
||||
state = MISMATCH;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
openSyntax();
|
||||
state = dictSyntax.match;
|
||||
break;
|
||||
|
||||
case 'Keyword':
|
||||
var name = state.name;
|
||||
|
||||
if (token !== null) {
|
||||
var keywordName = token.value;
|
||||
|
||||
// drop \0 and \9 hack from keyword name
|
||||
if (keywordName.indexOf('\\') !== -1) {
|
||||
keywordName = keywordName.replace(/\\[09].*$/, '');
|
||||
}
|
||||
|
||||
if (areStringsEqualCaseInsensitive(keywordName, name)) {
|
||||
addTokenToMatch();
|
||||
state = MATCH;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
state = MISMATCH;
|
||||
break;
|
||||
|
||||
case 'AtKeyword':
|
||||
case 'Function':
|
||||
if (token !== null && areStringsEqualCaseInsensitive(token.value, state.name)) {
|
||||
addTokenToMatch();
|
||||
state = MATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
state = MISMATCH;
|
||||
break;
|
||||
|
||||
case 'Token':
|
||||
if (token !== null && token.value === state.value) {
|
||||
addTokenToMatch();
|
||||
state = MATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
state = MISMATCH;
|
||||
break;
|
||||
|
||||
case 'Comma':
|
||||
if (token !== null && token.type === TYPE.Comma) {
|
||||
if (isCommaContextStart(matchStack.token)) {
|
||||
state = MISMATCH;
|
||||
} else {
|
||||
addTokenToMatch();
|
||||
state = isCommaContextEnd(token) ? MISMATCH : MATCH;
|
||||
}
|
||||
} else {
|
||||
state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? MATCH : MISMATCH;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'String':
|
||||
var string = '';
|
||||
|
||||
for (var lastTokenIndex = tokenIndex; lastTokenIndex < tokens.length && string.length < state.value.length; lastTokenIndex++) {
|
||||
string += tokens[lastTokenIndex].value;
|
||||
}
|
||||
|
||||
if (areStringsEqualCaseInsensitive(string, state.value)) {
|
||||
while (tokenIndex < lastTokenIndex) {
|
||||
addTokenToMatch();
|
||||
}
|
||||
|
||||
state = MATCH;
|
||||
} else {
|
||||
state = MISMATCH;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error('Unknown node type: ' + state.type);
|
||||
}
|
||||
}
|
||||
|
||||
totalIterationCount += iterationCount;
|
||||
|
||||
switch (exitReason) {
|
||||
case null:
|
||||
console.warn('[csstree-match] BREAK after ' + ITERATION_LIMIT + ' iterations');
|
||||
exitReason = EXIT_REASON_ITERATION_LIMIT;
|
||||
matchStack = null;
|
||||
break;
|
||||
|
||||
case EXIT_REASON_MATCH:
|
||||
while (syntaxStack !== null) {
|
||||
closeSyntax();
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
matchStack = null;
|
||||
}
|
||||
|
||||
return {
|
||||
tokens: tokens,
|
||||
reason: exitReason,
|
||||
iterations: iterationCount,
|
||||
match: matchStack,
|
||||
longestMatch: longestMatch
|
||||
};
|
||||
}
|
||||
|
||||
function matchAsList(tokens, matchGraph, syntaxes) {
|
||||
var matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
|
||||
|
||||
if (matchResult.match !== null) {
|
||||
var item = reverseList(matchResult.match).prev;
|
||||
|
||||
matchResult.match = [];
|
||||
|
||||
while (item !== null) {
|
||||
switch (item.type) {
|
||||
case STUB:
|
||||
break;
|
||||
|
||||
case OPEN_SYNTAX:
|
||||
case CLOSE_SYNTAX:
|
||||
matchResult.match.push({
|
||||
type: item.type,
|
||||
syntax: item.syntax
|
||||
});
|
||||
break;
|
||||
|
||||
default:
|
||||
matchResult.match.push({
|
||||
token: item.token.value,
|
||||
node: item.token.node
|
||||
});
|
||||
break;
|
||||
}
|
||||
|
||||
item = item.prev;
|
||||
}
|
||||
}
|
||||
|
||||
return matchResult;
|
||||
}
|
||||
|
||||
function matchAsTree(tokens, matchGraph, syntaxes) {
|
||||
var matchResult = internalMatch(tokens, matchGraph, syntaxes || {});
|
||||
|
||||
if (matchResult.match === null) {
|
||||
return matchResult;
|
||||
}
|
||||
|
||||
var item = matchResult.match;
|
||||
var host = matchResult.match = {
|
||||
syntax: matchGraph.syntax || null,
|
||||
match: []
|
||||
};
|
||||
var hostStack = [host];
|
||||
|
||||
// revert a list and start with 2nd item since 1st is a stub item
|
||||
item = reverseList(item).prev;
|
||||
|
||||
// build a tree
|
||||
while (item !== null) {
|
||||
switch (item.type) {
|
||||
case OPEN_SYNTAX:
|
||||
host.match.push(host = {
|
||||
syntax: item.syntax,
|
||||
match: []
|
||||
});
|
||||
hostStack.push(host);
|
||||
break;
|
||||
|
||||
case CLOSE_SYNTAX:
|
||||
hostStack.pop();
|
||||
host = hostStack[hostStack.length - 1];
|
||||
break;
|
||||
|
||||
default:
|
||||
host.match.push({
|
||||
syntax: item.syntax || null,
|
||||
token: item.token.value,
|
||||
node: item.token.node
|
||||
});
|
||||
}
|
||||
|
||||
item = item.prev;
|
||||
}
|
||||
|
||||
return matchResult;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
matchAsList: matchAsList,
|
||||
matchAsTree: matchAsTree,
|
||||
getTotalIterationCount: function() {
|
||||
return totalIterationCount;
|
||||
}
|
||||
};
|
||||
73
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/prepare-tokens.js
generated
vendored
Normal file
73
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/prepare-tokens.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
var tokenize = require('../tokenizer');
|
||||
var TokenStream = require('../common/TokenStream');
|
||||
var tokenStream = new TokenStream();
|
||||
var astToTokens = {
|
||||
decorator: function(handlers) {
|
||||
var curNode = null;
|
||||
var prev = { len: 0, node: null };
|
||||
var nodes = [prev];
|
||||
var buffer = '';
|
||||
|
||||
return {
|
||||
children: handlers.children,
|
||||
node: function(node) {
|
||||
var tmp = curNode;
|
||||
curNode = node;
|
||||
handlers.node.call(this, node);
|
||||
curNode = tmp;
|
||||
},
|
||||
chunk: function(chunk) {
|
||||
buffer += chunk;
|
||||
if (prev.node !== curNode) {
|
||||
nodes.push({
|
||||
len: chunk.length,
|
||||
node: curNode
|
||||
});
|
||||
} else {
|
||||
prev.len += chunk.length;
|
||||
}
|
||||
},
|
||||
result: function() {
|
||||
return prepareTokens(buffer, nodes);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
function prepareTokens(str, nodes) {
|
||||
var tokens = [];
|
||||
var nodesOffset = 0;
|
||||
var nodesIndex = 0;
|
||||
var currentNode = nodes ? nodes[nodesIndex].node : null;
|
||||
|
||||
tokenize(str, tokenStream);
|
||||
|
||||
while (!tokenStream.eof) {
|
||||
if (nodes) {
|
||||
while (nodesIndex < nodes.length && nodesOffset + nodes[nodesIndex].len <= tokenStream.tokenStart) {
|
||||
nodesOffset += nodes[nodesIndex++].len;
|
||||
currentNode = nodes[nodesIndex].node;
|
||||
}
|
||||
}
|
||||
|
||||
tokens.push({
|
||||
type: tokenStream.tokenType,
|
||||
value: tokenStream.getTokenValue(),
|
||||
index: tokenStream.tokenIndex, // TODO: remove it, temporary solution
|
||||
balance: tokenStream.balance[tokenStream.tokenIndex], // TODO: remove it, temporary solution
|
||||
node: currentNode
|
||||
});
|
||||
tokenStream.next();
|
||||
// console.log({ ...tokens[tokens.length - 1], node: undefined });
|
||||
}
|
||||
|
||||
return tokens;
|
||||
}
|
||||
|
||||
module.exports = function(value, syntax) {
|
||||
if (typeof value === 'string') {
|
||||
return prepareTokens(value, null);
|
||||
}
|
||||
|
||||
return syntax.generate(value, astToTokens);
|
||||
};
|
||||
65
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/search.js
generated
vendored
Normal file
65
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/search.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
var List = require('../common/List');
|
||||
|
||||
function getFirstMatchNode(matchNode) {
|
||||
if ('node' in matchNode) {
|
||||
return matchNode.node;
|
||||
}
|
||||
|
||||
return getFirstMatchNode(matchNode.match[0]);
|
||||
}
|
||||
|
||||
function getLastMatchNode(matchNode) {
|
||||
if ('node' in matchNode) {
|
||||
return matchNode.node;
|
||||
}
|
||||
|
||||
return getLastMatchNode(matchNode.match[matchNode.match.length - 1]);
|
||||
}
|
||||
|
||||
function matchFragments(lexer, ast, match, type, name) {
|
||||
function findFragments(matchNode) {
|
||||
if (matchNode.syntax !== null &&
|
||||
matchNode.syntax.type === type &&
|
||||
matchNode.syntax.name === name) {
|
||||
var start = getFirstMatchNode(matchNode);
|
||||
var end = getLastMatchNode(matchNode);
|
||||
|
||||
lexer.syntax.walk(ast, function(node, item, list) {
|
||||
if (node === start) {
|
||||
var nodes = new List();
|
||||
|
||||
do {
|
||||
nodes.appendData(item.data);
|
||||
|
||||
if (item.data === end) {
|
||||
break;
|
||||
}
|
||||
|
||||
item = item.next;
|
||||
} while (item !== null);
|
||||
|
||||
fragments.push({
|
||||
parent: list,
|
||||
nodes: nodes
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (Array.isArray(matchNode.match)) {
|
||||
matchNode.match.forEach(findFragments);
|
||||
}
|
||||
}
|
||||
|
||||
var fragments = [];
|
||||
|
||||
if (match.matched !== null) {
|
||||
findFragments(match.matched);
|
||||
}
|
||||
|
||||
return fragments;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
matchFragments: matchFragments
|
||||
};
|
||||
163
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/structure.js
generated
vendored
Normal file
163
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/structure.js
generated
vendored
Normal file
@@ -0,0 +1,163 @@
|
||||
var List = require('../common/List');
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
function isValidNumber(value) {
|
||||
// Number.isInteger(value) && value >= 0
|
||||
return (
|
||||
typeof value === 'number' &&
|
||||
isFinite(value) &&
|
||||
Math.floor(value) === value &&
|
||||
value >= 0
|
||||
);
|
||||
}
|
||||
|
||||
function isValidLocation(loc) {
|
||||
return (
|
||||
Boolean(loc) &&
|
||||
isValidNumber(loc.offset) &&
|
||||
isValidNumber(loc.line) &&
|
||||
isValidNumber(loc.column)
|
||||
);
|
||||
}
|
||||
|
||||
function createNodeStructureChecker(type, fields) {
|
||||
return function checkNode(node, warn) {
|
||||
if (!node || node.constructor !== Object) {
|
||||
return warn(node, 'Type of node should be an Object');
|
||||
}
|
||||
|
||||
for (var key in node) {
|
||||
var valid = true;
|
||||
|
||||
if (hasOwnProperty.call(node, key) === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (key === 'type') {
|
||||
if (node.type !== type) {
|
||||
warn(node, 'Wrong node type `' + node.type + '`, expected `' + type + '`');
|
||||
}
|
||||
} else if (key === 'loc') {
|
||||
if (node.loc === null) {
|
||||
continue;
|
||||
} else if (node.loc && node.loc.constructor === Object) {
|
||||
if (typeof node.loc.source !== 'string') {
|
||||
key += '.source';
|
||||
} else if (!isValidLocation(node.loc.start)) {
|
||||
key += '.start';
|
||||
} else if (!isValidLocation(node.loc.end)) {
|
||||
key += '.end';
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
valid = false;
|
||||
} else if (fields.hasOwnProperty(key)) {
|
||||
for (var i = 0, valid = false; !valid && i < fields[key].length; i++) {
|
||||
var fieldType = fields[key][i];
|
||||
|
||||
switch (fieldType) {
|
||||
case String:
|
||||
valid = typeof node[key] === 'string';
|
||||
break;
|
||||
|
||||
case Boolean:
|
||||
valid = typeof node[key] === 'boolean';
|
||||
break;
|
||||
|
||||
case null:
|
||||
valid = node[key] === null;
|
||||
break;
|
||||
|
||||
default:
|
||||
if (typeof fieldType === 'string') {
|
||||
valid = node[key] && node[key].type === fieldType;
|
||||
} else if (Array.isArray(fieldType)) {
|
||||
valid = node[key] instanceof List;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
warn(node, 'Unknown field `' + key + '` for ' + type + ' node type');
|
||||
}
|
||||
|
||||
if (!valid) {
|
||||
warn(node, 'Bad value for `' + type + '.' + key + '`');
|
||||
}
|
||||
}
|
||||
|
||||
for (var key in fields) {
|
||||
if (hasOwnProperty.call(fields, key) &&
|
||||
hasOwnProperty.call(node, key) === false) {
|
||||
warn(node, 'Field `' + type + '.' + key + '` is missed');
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function processStructure(name, nodeType) {
|
||||
var structure = nodeType.structure;
|
||||
var fields = {
|
||||
type: String,
|
||||
loc: true
|
||||
};
|
||||
var docs = {
|
||||
type: '"' + name + '"'
|
||||
};
|
||||
|
||||
for (var key in structure) {
|
||||
if (hasOwnProperty.call(structure, key) === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
var docsTypes = [];
|
||||
var fieldTypes = fields[key] = Array.isArray(structure[key])
|
||||
? structure[key].slice()
|
||||
: [structure[key]];
|
||||
|
||||
for (var i = 0; i < fieldTypes.length; i++) {
|
||||
var fieldType = fieldTypes[i];
|
||||
if (fieldType === String || fieldType === Boolean) {
|
||||
docsTypes.push(fieldType.name);
|
||||
} else if (fieldType === null) {
|
||||
docsTypes.push('null');
|
||||
} else if (typeof fieldType === 'string') {
|
||||
docsTypes.push('<' + fieldType + '>');
|
||||
} else if (Array.isArray(fieldType)) {
|
||||
docsTypes.push('List'); // TODO: use type enum
|
||||
} else {
|
||||
throw new Error('Wrong value `' + fieldType + '` in `' + name + '.' + key + '` structure definition');
|
||||
}
|
||||
}
|
||||
|
||||
docs[key] = docsTypes.join(' | ');
|
||||
}
|
||||
|
||||
return {
|
||||
docs: docs,
|
||||
check: createNodeStructureChecker(name, fields)
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getStructureFromConfig: function(config) {
|
||||
var structure = {};
|
||||
|
||||
if (config.node) {
|
||||
for (var name in config.node) {
|
||||
if (hasOwnProperty.call(config.node, name)) {
|
||||
var nodeType = config.node[name];
|
||||
|
||||
if (nodeType.structure) {
|
||||
structure[name] = processStructure(name, nodeType);
|
||||
} else {
|
||||
throw new Error('Missed `structure` field in `' + name + '` node type definition');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return structure;
|
||||
}
|
||||
};
|
||||
79
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/trace.js
generated
vendored
Normal file
79
node_modules/laravel-mix/node_modules/css-tree/lib/lexer/trace.js
generated
vendored
Normal file
@@ -0,0 +1,79 @@
|
||||
function getTrace(node) {
|
||||
function shouldPutToTrace(syntax) {
|
||||
if (syntax === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (
|
||||
syntax.type === 'Type' ||
|
||||
syntax.type === 'Property' ||
|
||||
syntax.type === 'Keyword'
|
||||
);
|
||||
}
|
||||
|
||||
function hasMatch(matchNode) {
|
||||
if (Array.isArray(matchNode.match)) {
|
||||
// use for-loop for better perfomance
|
||||
for (var i = 0; i < matchNode.match.length; i++) {
|
||||
if (hasMatch(matchNode.match[i])) {
|
||||
if (shouldPutToTrace(matchNode.syntax)) {
|
||||
result.unshift(matchNode.syntax);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else if (matchNode.node === node) {
|
||||
result = shouldPutToTrace(matchNode.syntax)
|
||||
? [matchNode.syntax]
|
||||
: [];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
var result = null;
|
||||
|
||||
if (this.matched !== null) {
|
||||
hasMatch(this.matched);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function testNode(match, node, fn) {
|
||||
var trace = getTrace.call(match, node);
|
||||
|
||||
if (trace === null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return trace.some(fn);
|
||||
}
|
||||
|
||||
function isType(node, type) {
|
||||
return testNode(this, node, function(matchNode) {
|
||||
return matchNode.type === 'Type' && matchNode.name === type;
|
||||
});
|
||||
}
|
||||
|
||||
function isProperty(node, property) {
|
||||
return testNode(this, node, function(matchNode) {
|
||||
return matchNode.type === 'Property' && matchNode.name === property;
|
||||
});
|
||||
}
|
||||
|
||||
function isKeyword(node) {
|
||||
return testNode(this, node, function(matchNode) {
|
||||
return matchNode.type === 'Keyword';
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getTrace: getTrace,
|
||||
isType: isType,
|
||||
isProperty: isProperty,
|
||||
isKeyword: isKeyword
|
||||
};
|
||||
304
node_modules/laravel-mix/node_modules/css-tree/lib/parser/create.js
generated
vendored
Normal file
304
node_modules/laravel-mix/node_modules/css-tree/lib/parser/create.js
generated
vendored
Normal file
@@ -0,0 +1,304 @@
|
||||
var OffsetToLocation = require('../common/OffsetToLocation');
|
||||
var SyntaxError = require('../common/SyntaxError');
|
||||
var TokenStream = require('../common/TokenStream');
|
||||
var List = require('../common/List');
|
||||
var tokenize = require('../tokenizer');
|
||||
var constants = require('../tokenizer/const');
|
||||
var { findWhiteSpaceStart, cmpStr } = require('../tokenizer/utils');
|
||||
var sequence = require('./sequence');
|
||||
var noop = function() {};
|
||||
|
||||
var TYPE = constants.TYPE;
|
||||
var NAME = constants.NAME;
|
||||
var WHITESPACE = TYPE.WhiteSpace;
|
||||
var COMMENT = TYPE.Comment;
|
||||
var IDENT = TYPE.Ident;
|
||||
var FUNCTION = TYPE.Function;
|
||||
var URL = TYPE.Url;
|
||||
var HASH = TYPE.Hash;
|
||||
var PERCENTAGE = TYPE.Percentage;
|
||||
var NUMBER = TYPE.Number;
|
||||
var NUMBERSIGN = 0x0023; // U+0023 NUMBER SIGN (#)
|
||||
var NULL = 0;
|
||||
|
||||
function createParseContext(name) {
|
||||
return function() {
|
||||
return this[name]();
|
||||
};
|
||||
}
|
||||
|
||||
function processConfig(config) {
|
||||
var parserConfig = {
|
||||
context: {},
|
||||
scope: {},
|
||||
atrule: {},
|
||||
pseudo: {}
|
||||
};
|
||||
|
||||
if (config.parseContext) {
|
||||
for (var name in config.parseContext) {
|
||||
switch (typeof config.parseContext[name]) {
|
||||
case 'function':
|
||||
parserConfig.context[name] = config.parseContext[name];
|
||||
break;
|
||||
|
||||
case 'string':
|
||||
parserConfig.context[name] = createParseContext(config.parseContext[name]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config.scope) {
|
||||
for (var name in config.scope) {
|
||||
parserConfig.scope[name] = config.scope[name];
|
||||
}
|
||||
}
|
||||
|
||||
if (config.atrule) {
|
||||
for (var name in config.atrule) {
|
||||
var atrule = config.atrule[name];
|
||||
|
||||
if (atrule.parse) {
|
||||
parserConfig.atrule[name] = atrule.parse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config.pseudo) {
|
||||
for (var name in config.pseudo) {
|
||||
var pseudo = config.pseudo[name];
|
||||
|
||||
if (pseudo.parse) {
|
||||
parserConfig.pseudo[name] = pseudo.parse;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (config.node) {
|
||||
for (var name in config.node) {
|
||||
parserConfig[name] = config.node[name].parse;
|
||||
}
|
||||
}
|
||||
|
||||
return parserConfig;
|
||||
}
|
||||
|
||||
module.exports = function createParser(config) {
|
||||
var parser = {
|
||||
scanner: new TokenStream(),
|
||||
locationMap: new OffsetToLocation(),
|
||||
|
||||
filename: '<unknown>',
|
||||
needPositions: false,
|
||||
onParseError: noop,
|
||||
onParseErrorThrow: false,
|
||||
parseAtrulePrelude: true,
|
||||
parseRulePrelude: true,
|
||||
parseValue: true,
|
||||
parseCustomProperty: false,
|
||||
|
||||
readSequence: sequence,
|
||||
|
||||
createList: function() {
|
||||
return new List();
|
||||
},
|
||||
createSingleNodeList: function(node) {
|
||||
return new List().appendData(node);
|
||||
},
|
||||
getFirstListNode: function(list) {
|
||||
return list && list.first();
|
||||
},
|
||||
getLastListNode: function(list) {
|
||||
return list.last();
|
||||
},
|
||||
|
||||
parseWithFallback: function(consumer, fallback) {
|
||||
var startToken = this.scanner.tokenIndex;
|
||||
|
||||
try {
|
||||
return consumer.call(this);
|
||||
} catch (e) {
|
||||
if (this.onParseErrorThrow) {
|
||||
throw e;
|
||||
}
|
||||
|
||||
var fallbackNode = fallback.call(this, startToken);
|
||||
|
||||
this.onParseErrorThrow = true;
|
||||
this.onParseError(e, fallbackNode);
|
||||
this.onParseErrorThrow = false;
|
||||
|
||||
return fallbackNode;
|
||||
}
|
||||
},
|
||||
|
||||
lookupNonWSType: function(offset) {
|
||||
do {
|
||||
var type = this.scanner.lookupType(offset++);
|
||||
if (type !== WHITESPACE) {
|
||||
return type;
|
||||
}
|
||||
} while (type !== NULL);
|
||||
|
||||
return NULL;
|
||||
},
|
||||
|
||||
eat: function(tokenType) {
|
||||
if (this.scanner.tokenType !== tokenType) {
|
||||
var offset = this.scanner.tokenStart;
|
||||
var message = NAME[tokenType] + ' is expected';
|
||||
|
||||
// tweak message and offset
|
||||
switch (tokenType) {
|
||||
case IDENT:
|
||||
// when identifier is expected but there is a function or url
|
||||
if (this.scanner.tokenType === FUNCTION || this.scanner.tokenType === URL) {
|
||||
offset = this.scanner.tokenEnd - 1;
|
||||
message = 'Identifier is expected but function found';
|
||||
} else {
|
||||
message = 'Identifier is expected';
|
||||
}
|
||||
break;
|
||||
|
||||
case HASH:
|
||||
if (this.scanner.isDelim(NUMBERSIGN)) {
|
||||
this.scanner.next();
|
||||
offset++;
|
||||
message = 'Name is expected';
|
||||
}
|
||||
break;
|
||||
|
||||
case PERCENTAGE:
|
||||
if (this.scanner.tokenType === NUMBER) {
|
||||
offset = this.scanner.tokenEnd;
|
||||
message = 'Percent sign is expected';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// when test type is part of another token show error for current position + 1
|
||||
// e.g. eat(HYPHENMINUS) will fail on "-foo", but pointing on "-" is odd
|
||||
if (this.scanner.source.charCodeAt(this.scanner.tokenStart) === tokenType) {
|
||||
offset = offset + 1;
|
||||
}
|
||||
}
|
||||
|
||||
this.error(message, offset);
|
||||
}
|
||||
|
||||
this.scanner.next();
|
||||
},
|
||||
|
||||
consume: function(tokenType) {
|
||||
var value = this.scanner.getTokenValue();
|
||||
|
||||
this.eat(tokenType);
|
||||
|
||||
return value;
|
||||
},
|
||||
consumeFunctionName: function() {
|
||||
var name = this.scanner.source.substring(this.scanner.tokenStart, this.scanner.tokenEnd - 1);
|
||||
|
||||
this.eat(FUNCTION);
|
||||
|
||||
return name;
|
||||
},
|
||||
|
||||
getLocation: function(start, end) {
|
||||
if (this.needPositions) {
|
||||
return this.locationMap.getLocationRange(
|
||||
start,
|
||||
end,
|
||||
this.filename
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
getLocationFromList: function(list) {
|
||||
if (this.needPositions) {
|
||||
var head = this.getFirstListNode(list);
|
||||
var tail = this.getLastListNode(list);
|
||||
return this.locationMap.getLocationRange(
|
||||
head !== null ? head.loc.start.offset - this.locationMap.startOffset : this.scanner.tokenStart,
|
||||
tail !== null ? tail.loc.end.offset - this.locationMap.startOffset : this.scanner.tokenStart,
|
||||
this.filename
|
||||
);
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
error: function(message, offset) {
|
||||
var location = typeof offset !== 'undefined' && offset < this.scanner.source.length
|
||||
? this.locationMap.getLocation(offset)
|
||||
: this.scanner.eof
|
||||
? this.locationMap.getLocation(findWhiteSpaceStart(this.scanner.source, this.scanner.source.length - 1))
|
||||
: this.locationMap.getLocation(this.scanner.tokenStart);
|
||||
|
||||
throw new SyntaxError(
|
||||
message || 'Unexpected input',
|
||||
this.scanner.source,
|
||||
location.offset,
|
||||
location.line,
|
||||
location.column
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
config = processConfig(config || {});
|
||||
for (var key in config) {
|
||||
parser[key] = config[key];
|
||||
}
|
||||
|
||||
return function(source, options) {
|
||||
options = options || {};
|
||||
|
||||
var context = options.context || 'default';
|
||||
var onComment = options.onComment;
|
||||
var ast;
|
||||
|
||||
tokenize(source, parser.scanner);
|
||||
parser.locationMap.setSource(
|
||||
source,
|
||||
options.offset,
|
||||
options.line,
|
||||
options.column
|
||||
);
|
||||
|
||||
parser.filename = options.filename || '<unknown>';
|
||||
parser.needPositions = Boolean(options.positions);
|
||||
parser.onParseError = typeof options.onParseError === 'function' ? options.onParseError : noop;
|
||||
parser.onParseErrorThrow = false;
|
||||
parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;
|
||||
parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;
|
||||
parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;
|
||||
parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;
|
||||
|
||||
if (!parser.context.hasOwnProperty(context)) {
|
||||
throw new Error('Unknown context `' + context + '`');
|
||||
}
|
||||
|
||||
if (typeof onComment === 'function') {
|
||||
parser.scanner.forEachToken((type, start, end) => {
|
||||
if (type === COMMENT) {
|
||||
const loc = parser.getLocation(start, end);
|
||||
const value = cmpStr(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) {
|
||||
parser.error();
|
||||
}
|
||||
|
||||
return ast;
|
||||
};
|
||||
};
|
||||
4
node_modules/laravel-mix/node_modules/css-tree/lib/parser/index.js
generated
vendored
Normal file
4
node_modules/laravel-mix/node_modules/css-tree/lib/parser/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var createParser = require('./create');
|
||||
var config = require('../syntax/config/parser');
|
||||
|
||||
module.exports = createParser(config);
|
||||
54
node_modules/laravel-mix/node_modules/css-tree/lib/parser/sequence.js
generated
vendored
Normal file
54
node_modules/laravel-mix/node_modules/css-tree/lib/parser/sequence.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
var TYPE = require('../tokenizer').TYPE;
|
||||
var WHITESPACE = TYPE.WhiteSpace;
|
||||
var COMMENT = TYPE.Comment;
|
||||
|
||||
module.exports = function readSequence(recognizer) {
|
||||
var children = this.createList();
|
||||
var child = null;
|
||||
var context = {
|
||||
recognizer: recognizer,
|
||||
space: null,
|
||||
ignoreWS: false,
|
||||
ignoreWSAfter: false
|
||||
};
|
||||
|
||||
this.scanner.skipSC();
|
||||
|
||||
while (!this.scanner.eof) {
|
||||
switch (this.scanner.tokenType) {
|
||||
case COMMENT:
|
||||
this.scanner.next();
|
||||
continue;
|
||||
|
||||
case WHITESPACE:
|
||||
if (context.ignoreWS) {
|
||||
this.scanner.next();
|
||||
} else {
|
||||
context.space = this.WhiteSpace();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
child = recognizer.getNode.call(this, context);
|
||||
|
||||
if (child === undefined) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (context.space !== null) {
|
||||
children.push(context.space);
|
||||
context.space = null;
|
||||
}
|
||||
|
||||
children.push(child);
|
||||
|
||||
if (context.ignoreWSAfter) {
|
||||
context.ignoreWSAfter = false;
|
||||
context.ignoreWS = true;
|
||||
} else {
|
||||
context.ignoreWS = false;
|
||||
}
|
||||
}
|
||||
|
||||
return children;
|
||||
};
|
||||
8
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/font-face.js
generated
vendored
Normal file
8
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/font-face.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: null,
|
||||
block: function() {
|
||||
return this.Block(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
40
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/import.js
generated
vendored
Normal file
40
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/import.js
generated
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
var TYPE = require('../../tokenizer').TYPE;
|
||||
|
||||
var STRING = TYPE.String;
|
||||
var IDENT = TYPE.Ident;
|
||||
var URL = TYPE.Url;
|
||||
var FUNCTION = TYPE.Function;
|
||||
var LEFTPARENTHESIS = TYPE.LeftParenthesis;
|
||||
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: function() {
|
||||
var children = this.createList();
|
||||
|
||||
this.scanner.skipSC();
|
||||
|
||||
switch (this.scanner.tokenType) {
|
||||
case STRING:
|
||||
children.push(this.String());
|
||||
break;
|
||||
|
||||
case URL:
|
||||
case FUNCTION:
|
||||
children.push(this.Url());
|
||||
break;
|
||||
|
||||
default:
|
||||
this.error('String or url() is expected');
|
||||
}
|
||||
|
||||
if (this.lookupNonWSType(0) === IDENT ||
|
||||
this.lookupNonWSType(0) === LEFTPARENTHESIS) {
|
||||
children.push(this.WhiteSpace());
|
||||
children.push(this.MediaQueryList());
|
||||
}
|
||||
|
||||
return children;
|
||||
},
|
||||
block: null
|
||||
}
|
||||
};
|
||||
7
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/index.js
generated
vendored
Normal file
7
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
'font-face': require('./font-face'),
|
||||
'import': require('./import'),
|
||||
'media': require('./media'),
|
||||
'page': require('./page'),
|
||||
'supports': require('./supports')
|
||||
};
|
||||
12
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/media.js
generated
vendored
Normal file
12
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/media.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: function() {
|
||||
return this.createSingleNodeList(
|
||||
this.MediaQueryList()
|
||||
);
|
||||
},
|
||||
block: function() {
|
||||
return this.Block(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
12
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/page.js
generated
vendored
Normal file
12
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/page.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: function() {
|
||||
return this.createSingleNodeList(
|
||||
this.SelectorList()
|
||||
);
|
||||
},
|
||||
block: function() {
|
||||
return this.Block(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
89
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/supports.js
generated
vendored
Normal file
89
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/atrule/supports.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
var TYPE = require('../../tokenizer').TYPE;
|
||||
|
||||
var WHITESPACE = TYPE.WhiteSpace;
|
||||
var COMMENT = TYPE.Comment;
|
||||
var IDENT = TYPE.Ident;
|
||||
var FUNCTION = TYPE.Function;
|
||||
var COLON = TYPE.Colon;
|
||||
var LEFTPARENTHESIS = TYPE.LeftParenthesis;
|
||||
|
||||
function consumeRaw() {
|
||||
return this.createSingleNodeList(
|
||||
this.Raw(this.scanner.tokenIndex, null, false)
|
||||
);
|
||||
}
|
||||
|
||||
function parentheses() {
|
||||
this.scanner.skipSC();
|
||||
|
||||
if (this.scanner.tokenType === IDENT &&
|
||||
this.lookupNonWSType(1) === COLON) {
|
||||
return this.createSingleNodeList(
|
||||
this.Declaration()
|
||||
);
|
||||
}
|
||||
|
||||
return readSequence.call(this);
|
||||
}
|
||||
|
||||
function readSequence() {
|
||||
var children = this.createList();
|
||||
var space = null;
|
||||
var child;
|
||||
|
||||
this.scanner.skipSC();
|
||||
|
||||
scan:
|
||||
while (!this.scanner.eof) {
|
||||
switch (this.scanner.tokenType) {
|
||||
case WHITESPACE:
|
||||
space = this.WhiteSpace();
|
||||
continue;
|
||||
|
||||
case COMMENT:
|
||||
this.scanner.next();
|
||||
continue;
|
||||
|
||||
case FUNCTION:
|
||||
child = this.Function(consumeRaw, this.scope.AtrulePrelude);
|
||||
break;
|
||||
|
||||
case IDENT:
|
||||
child = this.Identifier();
|
||||
break;
|
||||
|
||||
case LEFTPARENTHESIS:
|
||||
child = this.Parentheses(parentheses, this.scope.AtrulePrelude);
|
||||
break;
|
||||
|
||||
default:
|
||||
break scan;
|
||||
}
|
||||
|
||||
if (space !== null) {
|
||||
children.push(space);
|
||||
space = null;
|
||||
}
|
||||
|
||||
children.push(child);
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
parse: {
|
||||
prelude: function() {
|
||||
var children = readSequence.call(this);
|
||||
|
||||
if (this.getFirstListNode(children) === null) {
|
||||
this.error('Condition is expected');
|
||||
}
|
||||
|
||||
return children;
|
||||
},
|
||||
block: function() {
|
||||
return this.Block(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
9
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/config/lexer.js
generated
vendored
Normal file
9
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/config/lexer.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
var data = require('../../../data');
|
||||
|
||||
module.exports = {
|
||||
generic: true,
|
||||
types: data.types,
|
||||
atrules: data.atrules,
|
||||
properties: data.properties,
|
||||
node: require('../node')
|
||||
};
|
||||
140
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/config/mix.js
generated
vendored
Normal file
140
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/config/mix.js
generated
vendored
Normal file
@@ -0,0 +1,140 @@
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
const shape = {
|
||||
generic: true,
|
||||
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) {
|
||||
return value && value.constructor === Object;
|
||||
}
|
||||
|
||||
function copy(value) {
|
||||
return isObject(value)
|
||||
? Object.assign({}, value)
|
||||
: value;
|
||||
}
|
||||
|
||||
function assign(dest, src) {
|
||||
return Object.assign(dest, src);
|
||||
}
|
||||
|
||||
function deepAssign(dest, src) {
|
||||
for (const key in src) {
|
||||
if (hasOwnProperty.call(src, key)) {
|
||||
if (isObject(dest[key])) {
|
||||
deepAssign(dest[key], copy(src[key]));
|
||||
} else {
|
||||
dest[key] = copy(src[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
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.call(b, key)) {
|
||||
result[key] = append(hasOwnProperty.call(a, key) ? a[key] : undefined, b[key]);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function appendOrAssignOrNull(a, b) {
|
||||
const result = appendOrAssign(a, b);
|
||||
|
||||
return !isObject(result) || Object.keys(result).length
|
||||
? result
|
||||
: null;
|
||||
}
|
||||
|
||||
function mix(dest, src, shape) {
|
||||
for (const key in shape) {
|
||||
if (hasOwnProperty.call(shape, key) === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (shape[key] === true) {
|
||||
if (key in src) {
|
||||
if (hasOwnProperty.call(src, key)) {
|
||||
dest[key] = copy(src[key]);
|
||||
}
|
||||
}
|
||||
} else if (shape[key]) {
|
||||
if (typeof shape[key] === 'function') {
|
||||
const fn = shape[key];
|
||||
dest[key] = fn({}, dest[key]);
|
||||
dest[key] = fn(dest[key] || {}, src[key]);
|
||||
} else if (isObject(shape[key])) {
|
||||
const result = {};
|
||||
|
||||
for (let name in dest[key]) {
|
||||
result[name] = mix({}, dest[key][name], shape[key]);
|
||||
}
|
||||
|
||||
for (let name in src[key]) {
|
||||
result[name] = mix(result[name] || {}, src[key][name], shape[key]);
|
||||
}
|
||||
|
||||
dest[key] = result;
|
||||
} else if (Array.isArray(shape[key])) {
|
||||
const res = {};
|
||||
const innerShape = shape[key].reduce(function(s, k) {
|
||||
s[k] = true;
|
||||
return s;
|
||||
}, {});
|
||||
|
||||
for (const [name, value] of Object.entries(dest[key] || {})) {
|
||||
res[name] = {};
|
||||
if (value) {
|
||||
mix(res[name], value, innerShape);
|
||||
}
|
||||
}
|
||||
|
||||
for (const name in src[key]) {
|
||||
if (hasOwnProperty.call(src[key], name)) {
|
||||
if (!res[name]) {
|
||||
res[name] = {};
|
||||
}
|
||||
|
||||
if (src[key] && src[key][name]) {
|
||||
mix(res[name], src[key][name], innerShape);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dest[key] = res;
|
||||
}
|
||||
}
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
module.exports = (dest, src) => mix(dest, src, shape);
|
||||
25
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/config/parser.js
generated
vendored
Normal file
25
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/config/parser.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
module.exports = {
|
||||
parseContext: {
|
||||
default: 'StyleSheet',
|
||||
stylesheet: 'StyleSheet',
|
||||
atrule: 'Atrule',
|
||||
atrulePrelude: function(options) {
|
||||
return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
|
||||
},
|
||||
mediaQueryList: 'MediaQueryList',
|
||||
mediaQuery: 'MediaQuery',
|
||||
rule: 'Rule',
|
||||
selectorList: 'SelectorList',
|
||||
selector: 'Selector',
|
||||
block: function() {
|
||||
return this.Block(true);
|
||||
},
|
||||
declarationList: 'DeclarationList',
|
||||
declaration: 'Declaration',
|
||||
value: 'Value'
|
||||
},
|
||||
scope: require('../scope'),
|
||||
atrule: require('../atrule'),
|
||||
pseudo: require('../pseudo'),
|
||||
node: require('../node')
|
||||
};
|
||||
3
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/config/walker.js
generated
vendored
Normal file
3
node_modules/laravel-mix/node_modules/css-tree/lib/syntax/config/walker.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
node: require('../node')
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user