From f06956efd2dc4bf77244a9fcce2b883a00b925af Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 21 Dec 2023 22:46:53 +0800 Subject: updated node modules --- .../cascade-layer-name-parser/CHANGELOG.md | 35 +- .../cascade-layer-name-parser/dist/index.cjs | 2 +- .../cascade-layer-name-parser/dist/index.d.ts | 34 +- .../cascade-layer-name-parser/dist/index.mjs | 2 +- .../dist/nodes/layer-name.d.ts | 17 - .../dist/parser/parse.d.ts | 7 - .../cascade-layer-name-parser/dist/util/model.d.ts | 2 - .../cascade-layer-name-parser/package.json | 32 +- node_modules/@csstools/color-helpers/CHANGELOG.md | 35 +- .../dist/calculations/binary-search-gamut.d.ts | 2 - .../color-helpers/dist/calculations/contrast.d.ts | 2 - .../color-helpers/dist/calculations/delta-EOK.d.ts | 14 - .../color-helpers/dist/calculations/index.d.ts | 5 - .../color-helpers/dist/calculations/map-gamut.d.ts | 2 - .../dist/calculations/multiply-matrices.d.ts | 12 - .../color-helpers/dist/conversions/constants.d.ts | 2 - .../color-helpers/dist/conversions/d50-to-d65.d.ts | 9 - .../color-helpers/dist/conversions/d65-to-d50.d.ts | 10 - .../color-helpers/dist/conversions/gam-2020.d.ts | 10 - .../color-helpers/dist/conversions/gam-a98rgb.d.ts | 10 - .../color-helpers/dist/conversions/gam-p3.d.ts | 10 - .../dist/conversions/gam-pro-photo.d.ts | 11 - .../color-helpers/dist/conversions/gam-srgb.d.ts | 14 - .../dist/conversions/hsl-to-srgb.d.ts | 14 - .../color-helpers/dist/conversions/hue-to-rgb.d.ts | 8 - .../dist/conversions/hwb-to-srgb.d.ts | 14 - .../color-helpers/dist/conversions/index.d.ts | 40 - .../color-helpers/dist/conversions/lab-to-lch.d.ts | 7 - .../color-helpers/dist/conversions/lab-to-xyz.d.ts | 2 - .../color-helpers/dist/conversions/lch-to-lab.d.ts | 7 - .../dist/conversions/lin-2020-to-xyz.d.ts | 12 - .../color-helpers/dist/conversions/lin-2020.d.ts | 11 - .../dist/conversions/lin-a98rgb-to-xyz.d.ts | 18 - .../color-helpers/dist/conversions/lin-a98rgb.d.ts | 10 - .../dist/conversions/lin-p3-to-xyz.d.ts | 12 - .../color-helpers/dist/conversions/lin-p3.d.ts | 10 - .../dist/conversions/lin-pro-photo-to-xyz.d.ts | 12 - .../dist/conversions/lin-pro-photo.d.ts | 11 - .../dist/conversions/lin-srgb-to-xyz.d.ts | 10 - .../color-helpers/dist/conversions/lin-srgb.d.ts | 15 - .../dist/conversions/naive-cmyk-to-srgb.d.ts | 14 - .../dist/conversions/oklab-to-oklch.d.ts | 9 - .../dist/conversions/oklab-to-xyz.d.ts | 2 - .../dist/conversions/oklch-to-oklab.d.ts | 9 - .../dist/conversions/srgb-to-hsl.d.ts | 16 - .../dist/conversions/srgb-to-hwb.d.ts | 11 - .../dist/conversions/srgb-to-luminance.d.ts | 12 - .../color-helpers/dist/conversions/xyz-to-lab.d.ts | 2 - .../dist/conversions/xyz-to-lin-2020.d.ts | 9 - .../dist/conversions/xyz-to-lin-a98rgb.d.ts | 9 - .../dist/conversions/xyz-to-lin-p3.d.ts | 9 - .../dist/conversions/xyz-to-lin-pro-photo.d.ts | 11 - .../dist/conversions/xyz-to-lin-srgb.d.ts | 7 - .../dist/conversions/xyz-to-oklab.d.ts | 10 - .../color-helpers/dist/conversions/xyz-to-uv.d.ts | 11 - .../color-helpers/dist/conversions/xyz-to-xy.d.ts | 11 - .../color-helpers/dist/conversions/xyz/index.d.ts | 253 ------- .../@csstools/color-helpers/dist/index.cjs | 322 ++------- .../@csstools/color-helpers/dist/index.d.ts | 404 ++++++++++- .../@csstools/color-helpers/dist/index.mjs | 322 ++------- .../color-helpers/dist/named-colors/index.d.ts | 2 - .../@csstools/color-helpers/dist/types/color.d.ts | 1 - .../@csstools/color-helpers/dist/utils/clip.d.ts | 7 - .../color-helpers/dist/utils/in-gamut.d.ts | 7 - .../@csstools/color-helpers/dist/utils/index.d.ts | 2 - node_modules/@csstools/color-helpers/package.json | 32 +- node_modules/@csstools/css-calc/CHANGELOG.md | 39 +- .../@csstools/css-calc/dist/calculation.d.ts | 8 - .../@csstools/css-calc/dist/functions/abs.d.ts | 3 - .../@csstools/css-calc/dist/functions/acos.d.ts | 3 - .../@csstools/css-calc/dist/functions/asin.d.ts | 3 - .../@csstools/css-calc/dist/functions/atan.d.ts | 3 - .../@csstools/css-calc/dist/functions/atan2.d.ts | 3 - .../@csstools/css-calc/dist/functions/calc.d.ts | 29 - .../@csstools/css-calc/dist/functions/clamp.d.ts | 3 - .../@csstools/css-calc/dist/functions/cos.d.ts | 3 - .../@csstools/css-calc/dist/functions/exp.d.ts | 3 - .../dist/functions/globals-and-constants.d.ts | 3 - .../@csstools/css-calc/dist/functions/hypot.d.ts | 3 - .../@csstools/css-calc/dist/functions/log.d.ts | 3 - .../@csstools/css-calc/dist/functions/max.d.ts | 3 - .../@csstools/css-calc/dist/functions/min.d.ts | 3 - .../@csstools/css-calc/dist/functions/mod.d.ts | 3 - .../@csstools/css-calc/dist/functions/pow.d.ts | 3 - .../@csstools/css-calc/dist/functions/rem.d.ts | 3 - .../dist/functions/result-to-calculation.d.ts | 7 - .../@csstools/css-calc/dist/functions/round.d.ts | 3 - .../@csstools/css-calc/dist/functions/sign.d.ts | 3 - .../@csstools/css-calc/dist/functions/sin.d.ts | 3 - .../@csstools/css-calc/dist/functions/sqrt.d.ts | 3 - .../@csstools/css-calc/dist/functions/tan.d.ts | 3 - node_modules/@csstools/css-calc/dist/index.cjs | 2 +- node_modules/@csstools/css-calc/dist/index.d.ts | 35 +- node_modules/@csstools/css-calc/dist/index.mjs | 2 +- .../css-calc/dist/operation/addition.d.ts | 2 - .../css-calc/dist/operation/division.d.ts | 2 - .../css-calc/dist/operation/multiplication.d.ts | 2 - .../css-calc/dist/operation/operation.d.ts | 2 - .../css-calc/dist/operation/subtraction.d.ts | 2 - .../@csstools/css-calc/dist/operation/unary.d.ts | 2 - node_modules/@csstools/css-calc/dist/options.d.ts | 23 - .../css-calc/dist/unit-conversions/canonical.d.ts | 1 - .../css-calc/dist/unit-conversions/cm.d.ts | 1 - .../css-calc/dist/unit-conversions/deg.d.ts | 1 - .../css-calc/dist/unit-conversions/grad.d.ts | 1 - .../css-calc/dist/unit-conversions/hz.d.ts | 1 - .../css-calc/dist/unit-conversions/in.d.ts | 1 - .../css-calc/dist/unit-conversions/index.d.ts | 4 - .../css-calc/dist/unit-conversions/khz.d.ts | 1 - .../css-calc/dist/unit-conversions/mm.d.ts | 1 - .../css-calc/dist/unit-conversions/ms.d.ts | 1 - .../css-calc/dist/unit-conversions/pc.d.ts | 1 - .../css-calc/dist/unit-conversions/pt.d.ts | 1 - .../css-calc/dist/unit-conversions/px.d.ts | 1 - .../css-calc/dist/unit-conversions/q.d.ts | 1 - .../css-calc/dist/unit-conversions/rad.d.ts | 1 - .../css-calc/dist/unit-conversions/s.d.ts | 1 - .../css-calc/dist/unit-conversions/turn.d.ts | 1 - .../css-calc/dist/util/canonical-unit.d.ts | 2 - .../@csstools/css-calc/dist/util/globals.d.ts | 4 - .../@csstools/css-calc/dist/util/infinity.d.ts | 2 - .../css-calc/dist/util/kind-of-number.d.ts | 5 - .../@csstools/css-calc/dist/util/minus-zero.d.ts | 2 - node_modules/@csstools/css-calc/dist/util/nan.d.ts | 2 - .../@csstools/css-calc/dist/util/patch-result.d.ts | 3 - .../@csstools/css-calc/dist/util/precision.d.ts | 2 - .../css-calc/dist/util/to-lower-case-a-z.d.ts | 1 - node_modules/@csstools/css-calc/package.json | 31 +- .../@csstools/css-color-parser/CHANGELOG.md | 98 +-- .../css-color-parser/dist/color-data.d.ts | 34 - .../css-color-parser/dist/color-notation.d.ts | 18 - .../css-color-parser/dist/color-parser.d.ts | 3 - .../dist/functions/color-keyword.d.ts | 2 - .../css-color-parser/dist/functions/color-mix.d.ts | 4 - .../functions/color-normalize-channel-values.d.ts | 3 - .../css-color-parser/dist/functions/color.d.ts | 4 - .../css-color-parser/dist/functions/hex.d.ts | 3 - .../functions/hsl-normalize-channel-values.d.ts | 4 - .../css-color-parser/dist/functions/hsl.d.ts | 4 - .../functions/hue-normalize-channel-value.d.ts | 3 - .../functions/hwb-normalize-channel-values.d.ts | 3 - .../css-color-parser/dist/functions/hwb.d.ts | 4 - .../functions/lab-normalize-channel-values.d.ts | 3 - .../css-color-parser/dist/functions/lab.d.ts | 4 - .../functions/lch-normalize-channel-values.d.ts | 3 - .../css-color-parser/dist/functions/lch.d.ts | 4 - .../dist/functions/named-color.d.ts | 2 - .../dist/functions/normalize-channel-values.d.ts | 3 - .../css-color-parser/dist/functions/normalize.d.ts | 1 - .../functions/oklab-normalize-channel-values.d.ts | 3 - .../css-color-parser/dist/functions/oklab.d.ts | 4 - .../functions/oklch-normalize-channel-values.d.ts | 3 - .../css-color-parser/dist/functions/oklch.d.ts | 4 - .../functions/rgb-normalize-channel-values.d.ts | 4 - .../css-color-parser/dist/functions/rgb.d.ts | 4 - .../functions/three-channel-legacy-syntax.d.ts | 6 - .../functions/three-channel-space-separated.d.ts | 7 - .../css-color-parser/dist/gamut-mapping/p3.d.ts | 2 - .../css-color-parser/dist/gamut-mapping/srgb.d.ts | 2 - .../@csstools/css-color-parser/dist/index.cjs | 2 +- .../@csstools/css-color-parser/dist/index.d.ts | 143 +++- .../@csstools/css-color-parser/dist/index.mjs | 2 +- .../css-color-parser/dist/serialize/oklch.d.ts | 3 - .../css-color-parser/dist/serialize/p3.d.ts | 3 - .../css-color-parser/dist/serialize/rgb.d.ts | 3 - .../dist/serialize/to-precision.d.ts | 1 - .../dist/serialize/with-alpha.d.ts | 4 - .../dist/util/to-lower-case-a-z.d.ts | 1 - .../@csstools/css-color-parser/package.json | 35 +- .../@csstools/css-parser-algorithms/CHANGELOG.md | 62 +- .../consume/consume-component-block-function.d.ts | 118 --- .../@csstools/css-parser-algorithms/dist/index.cjs | 2 +- .../css-parser-algorithms/dist/index.d.ts | 259 ++++++- .../@csstools/css-parser-algorithms/dist/index.mjs | 2 +- .../dist/interfaces/context.d.ts | 4 - ...e-comma-separated-list-of-component-values.d.ts | 5 - .../dist/parse/parse-component-value.d.ts | 4 - .../dist/parse/parse-list-of-component-values.d.ts | 5 - .../dist/util/component-value-type.d.ts | 7 - .../dist/util/node-ancestry.d.ts | 7 - .../dist/util/replace-component-values.d.ts | 2 - .../dist/util/source-indices.d.ts | 9 - .../css-parser-algorithms/dist/util/stringify.d.ts | 2 - .../dist/util/type-predicates.d.ts | 6 - .../@csstools/css-parser-algorithms/package.json | 30 +- node_modules/@csstools/css-tokenizer/CHANGELOG.md | 45 +- .../checks/four-code-points-would-start-cdo.d.ts | 2 - .../dist/checks/matches-url-ident.d.ts | 1 - .../checks/three-code-points-would-start-cdc.d.ts | 2 - ...ree-code-points-would-start-ident-sequence.d.ts | 3 - .../three-code-points-would-start-number.d.ts | 2 - ...hree-code-points-would-start-unicode-range.d.ts | 2 - .../checks/two-code-points-are-valid-escape.d.ts | 2 - .../dist/checks/two-code-points-start-comment.d.ts | 2 - .../dist/code-points/code-points.d.ts | 96 --- .../css-tokenizer/dist/code-points/ranges.d.ts | 13 - .../css-tokenizer/dist/consume/bad-url.d.ts | 3 - .../css-tokenizer/dist/consume/comment.d.ts | 4 - .../dist/consume/escaped-code-point.d.ts | 3 - .../css-tokenizer/dist/consume/hash-token.d.ts | 4 - .../dist/consume/ident-like-token.d.ts | 4 - .../css-tokenizer/dist/consume/ident-sequence.d.ts | 3 - .../css-tokenizer/dist/consume/number.d.ts | 4 - .../css-tokenizer/dist/consume/numeric-token.d.ts | 4 - .../css-tokenizer/dist/consume/string-token.d.ts | 4 - .../dist/consume/unicode-range-token.d.ts | 4 - .../css-tokenizer/dist/consume/url-token.d.ts | 4 - .../dist/consume/whitespace-token.d.ts | 3 - .../@csstools/css-tokenizer/dist/index.cjs | 2 +- .../@csstools/css-tokenizer/dist/index.d.ts | 247 ++++++- .../@csstools/css-tokenizer/dist/index.mjs | 2 +- .../dist/interfaces/code-point-reader.d.ts | 12 - .../css-tokenizer/dist/interfaces/context.d.ts | 4 - .../css-tokenizer/dist/interfaces/error.d.ts | 9 - .../css-tokenizer/dist/interfaces/token.d.ts | 137 ---- .../@csstools/css-tokenizer/dist/reader.d.ts | 15 - .../@csstools/css-tokenizer/dist/stringify.d.ts | 2 - .../@csstools/css-tokenizer/dist/tokenizer.d.ts | 21 - .../css-tokenizer/dist/util/clone-tokens.d.ts | 2 - .../css-tokenizer/dist/util/mutations.d.ts | 2 - node_modules/@csstools/css-tokenizer/package.json | 32 +- .../@csstools/media-query-list-parser/CHANGELOG.md | 80 +- .../media-query-list-parser/dist/index.cjs | 2 +- .../media-query-list-parser/dist/index.d.ts | 803 ++++++++++++++++++++- .../media-query-list-parser/dist/index.mjs | 2 +- .../dist/nodes/custom-media.d.ts | 44 -- .../dist/nodes/general-enclosed.d.ts | 25 - .../dist/nodes/media-and.d.ts | 23 - .../dist/nodes/media-condition-list.d.ts | 50 -- .../dist/nodes/media-condition.d.ts | 24 - .../dist/nodes/media-feature-boolean.d.ts | 27 - .../dist/nodes/media-feature-comparison.d.ts | 17 - .../dist/nodes/media-feature-name.d.ts | 24 - .../dist/nodes/media-feature-plain.d.ts | 42 -- .../dist/nodes/media-feature-range.d.ts | 123 ---- .../dist/nodes/media-feature-value.d.ts | 31 - .../dist/nodes/media-feature.d.ts | 45 -- .../dist/nodes/media-in-parens.d.ts | 41 -- .../dist/nodes/media-not.d.ts | 32 - .../dist/nodes/media-or.d.ts | 32 - .../dist/nodes/media-query-modifier.d.ts | 6 - .../dist/nodes/media-query.d.ts | 83 --- .../dist/nodes/media-type.d.ts | 24 - .../dist/parser/parse-custom-media.d.ts | 8 - .../dist/parser/parse-media-query.d.ts | 24 - .../media-query-list-parser/dist/parser/parse.d.ts | 8 - .../dist/util/clone-media-query.d.ts | 2 - .../dist/util/component-value-is.d.ts | 5 - .../dist/util/node-type.d.ts | 22 - .../dist/util/to-lower-case-a-z.d.ts | 1 - .../dist/util/type-predicates.d.ts | 37 - .../@csstools/media-query-list-parser/package.json | 32 +- .../@csstools/postcss-cascade-layers/CHANGELOG.md | 88 +-- .../@csstools/postcss-cascade-layers/README.md | 9 +- .../dist/adjust-selector-specificity.d.ts | 1 - .../postcss-cascade-layers/dist/clean-blocks.d.ts | 3 - .../postcss-cascade-layers/dist/constants.d.ts | 8 - .../dist/desugar-and-parse-layer-names.d.ts | 3 - .../dist/desugar-nested-layers.d.ts | 3 - .../dist/get-conditional-atrule-ancestor.d.ts | 2 - .../dist/get-layer-atrule-ancestor.d.ts | 2 - .../postcss-cascade-layers/dist/index.cjs | 2 +- .../postcss-cascade-layers/dist/index.d.ts | 15 +- .../postcss-cascade-layers/dist/index.mjs | 2 +- .../dist/is-processable-layer-rule.d.ts | 2 - .../postcss-cascade-layers/dist/model.d.ts | 18 - .../postcss-cascade-layers/dist/options.d.ts | 9 - .../dist/record-layer-order.d.ts | 7 - .../postcss-cascade-layers/dist/some-in-tree.d.ts | 3 - .../dist/sort-root-nodes.d.ts | 3 - .../dist/split-important-styles.d.ts | 2 - .../@csstools/postcss-cascade-layers/package.json | 43 +- .../@csstools/postcss-color-function/CHANGELOG.md | 152 +--- .../@csstools/postcss-color-function/README.md | 3 +- .../dist/has-fallback-decl.d.ts | 2 - .../dist/has-supports-at-rule-ancestor.d.ts | 2 - .../postcss-color-function/dist/index.cjs | 2 +- .../postcss-color-function/dist/index.d.ts | 6 +- .../postcss-color-function/dist/index.mjs | 2 +- .../@csstools/postcss-color-function/package.json | 46 +- .../postcss-color-mix-function/CHANGELOG.md | 81 +-- .../dist/has-fallback-decl.d.ts | 2 - .../dist/has-supports-at-rule-ancestor.d.ts | 2 - .../postcss-color-mix-function/dist/index.cjs | 2 +- .../postcss-color-mix-function/dist/index.d.ts | 6 +- .../postcss-color-mix-function/dist/index.mjs | 2 +- .../postcss-color-mix-function/package.json | 45 +- .../postcss-exponential-functions/CHANGELOG.md | 9 + .../postcss-exponential-functions/dist/calc.d.ts | 1 - .../postcss-exponential-functions/dist/checks.d.ts | 2 - .../postcss-exponential-functions/dist/index.cjs | 2 +- .../postcss-exponential-functions/dist/index.d.ts | 10 +- .../postcss-exponential-functions/dist/index.mjs | 2 +- .../postcss-exponential-functions/package.json | 43 +- .../postcss-font-format-keywords/CHANGELOG.md | 30 +- .../dist/has-fallback-decl.d.ts | 2 - .../postcss-font-format-keywords/dist/index.cjs | 2 +- .../postcss-font-format-keywords/dist/index.d.ts | 10 +- .../postcss-font-format-keywords/dist/index.mjs | 2 +- .../postcss-font-format-keywords/package.json | 35 +- .../@csstools/postcss-gamut-mapping/CHANGELOG.md | 9 + .../dist/has-conditional-ancestor.d.ts | 2 - .../dist/has-override-decl.d.ts | 5 - .../@csstools/postcss-gamut-mapping/dist/index.cjs | 2 +- .../postcss-gamut-mapping/dist/index.d.ts | 8 +- .../@csstools/postcss-gamut-mapping/dist/index.mjs | 2 +- .../@csstools/postcss-gamut-mapping/package.json | 43 +- .../CHANGELOG.md | 125 +--- .../README.md | 11 +- .../dist/color-stop-list.d.ts | 9 - .../dist/has-fallback-decl.d.ts | 2 - .../dist/has-supports-at-rule-ancestor.d.ts | 2 - .../dist/index.cjs | 2 +- .../dist/index.d.ts | 6 +- .../dist/index.mjs | 2 +- .../dist/is-gradient.d.ts | 2 - .../dist/modify-gradient-component-values.d.ts | 2 - .../dist/parse-color-stops.d.ts | 3 - .../package.json | 45 +- .../@csstools/postcss-hwb-function/CHANGELOG.md | 109 +-- .../dist/has-fallback-decl.d.ts | 2 - .../dist/has-supports-at-rule-ancestor.d.ts | 3 - .../@csstools/postcss-hwb-function/dist/index.cjs | 2 +- .../@csstools/postcss-hwb-function/dist/index.d.ts | 6 +- .../@csstools/postcss-hwb-function/dist/index.mjs | 2 +- .../@csstools/postcss-hwb-function/package.json | 41 +- .../@csstools/postcss-ic-unit/CHANGELOG.md | 58 +- .../postcss-ic-unit/dist/has-fallback-decl.d.ts | 2 - .../dist/has-supports-at-rule-ancestor.d.ts | 2 - .../@csstools/postcss-ic-unit/dist/index.cjs | 2 +- .../@csstools/postcss-ic-unit/dist/index.d.ts | 6 +- .../@csstools/postcss-ic-unit/dist/index.mjs | 2 +- .../@csstools/postcss-ic-unit/package.json | 37 +- .../@csstools/postcss-initial/CHANGELOG.md | 6 + .../postcss-initial/dist/has-fallback-decl.d.ts | 2 - .../@csstools/postcss-initial/dist/index.d.ts | 10 +- .../@csstools/postcss-initial/dist/properties.d.ts | 2 - .../@csstools/postcss-initial/package.json | 37 +- .../@csstools/postcss-is-pseudo-class/CHANGELOG.md | 142 +--- .../postcss-is-pseudo-class/dist/index.cjs | 2 +- .../postcss-is-pseudo-class/dist/index.d.ts | 14 +- .../postcss-is-pseudo-class/dist/index.mjs | 2 +- .../dist/split-selectors/always-valid.d.ts | 1 - .../dist/split-selectors/complex.d.ts | 3 - .../complex/child-adjacent-child.d.ts | 1 - .../split-selectors/complex/is-in-compound.d.ts | 1 - .../complex/is-pseudo-in-first-compound.d.ts | 1 - .../split-selectors/compound-selector-order.d.ts | 1 - .../dist/split-selectors/split-selectors.d.ts | 3 - .../@csstools/postcss-is-pseudo-class/package.json | 39 +- .../postcss-logical-float-and-clear/CHANGELOG.md | 12 +- .../postcss-logical-float-and-clear/README.md | 8 +- .../dist/index.d.ts | 18 +- .../dist/lib/clone-declaration.d.ts | 2 - .../dist/lib/types.d.ts | 18 - .../dist/utils/direction-flow-to-axes.d.ts | 2 - .../postcss-logical-float-and-clear/package.json | 37 +- .../postcss-logical-overflow/CHANGELOG.md | 13 + .../@csstools/postcss-logical-overflow/LICENSE.md | 18 + .../@csstools/postcss-logical-overflow/README.md | 109 +++ .../postcss-logical-overflow/dist/index.cjs | 1 + .../postcss-logical-overflow/dist/index.d.ts | 19 + .../postcss-logical-overflow/dist/index.mjs | 1 + .../postcss-logical-overflow/package.json | 66 ++ .../CHANGELOG.md | 13 + .../postcss-logical-overscroll-behavior/LICENSE.md | 18 + .../postcss-logical-overscroll-behavior/README.md | 109 +++ .../dist/index.cjs | 1 + .../dist/index.d.ts | 19 + .../dist/index.mjs | 1 + .../package.json | 66 ++ .../@csstools/postcss-logical-resize/CHANGELOG.md | 12 +- .../@csstools/postcss-logical-resize/README.md | 8 +- .../postcss-logical-resize/dist/index.cjs | 2 +- .../postcss-logical-resize/dist/index.d.ts | 18 +- .../postcss-logical-resize/dist/index.mjs | 2 +- .../dist/lib/clone-declaration.d.ts | 2 - .../dist/lib/transform-resize.d.ts | 3 - .../postcss-logical-resize/dist/lib/types.d.ts | 31 - .../dist/utils/direction-flow-to-axes.d.ts | 2 - .../@csstools/postcss-logical-resize/package.json | 37 +- .../postcss-logical-viewport-units/CHANGELOG.md | 43 +- .../dist/has-feature.d.ts | 1 - .../dist/has-supports-at-rule-ancestor.d.ts | 2 - .../postcss-logical-viewport-units/dist/index.cjs | 2 +- .../postcss-logical-viewport-units/dist/index.d.ts | 18 +- .../postcss-logical-viewport-units/dist/index.mjs | 2 +- .../dist/lib/types.d.ts | 18 - .../dist/transform.d.ts | 4 - .../postcss-logical-viewport-units/package.json | 39 +- .../@csstools/postcss-media-minmax/CHANGELOG.md | 62 +- .../@csstools/postcss-media-minmax/dist/index.d.ts | 8 +- .../dist/to-lower-case-a-z.d.ts | 1 - .../dist/transform-single-pair.d.ts | 2 - .../postcss-media-minmax/dist/transform.d.ts | 2 - .../@csstools/postcss-media-minmax/package.json | 46 +- .../CHANGELOG.md | 62 +- .../dist/index.cjs | 2 +- .../dist/index.d.ts | 10 +- .../dist/index.mjs | 2 +- .../dist/transform-media-feature-value.d.ts | 2 - .../dist/transform-media-query-list.d.ts | 1 - .../package.json | 43 +- .../@csstools/postcss-nested-calc/CHANGELOG.md | 24 +- .../@csstools/postcss-nested-calc/README.md | 4 + .../dist/has-fallback-decl.d.ts | 2 - .../@csstools/postcss-nested-calc/dist/index.d.ts | 10 +- .../postcss-nested-calc/dist/occurrences.d.ts | 1 - .../@csstools/postcss-nested-calc/package.json | 37 +- .../postcss-normalize-display-values/CHANGELOG.md | 30 +- .../dist/index.cjs | 2 +- .../dist/index.d.ts | 10 +- .../dist/index.mjs | 2 +- .../dist/mappings.d.ts | 5 - .../postcss-normalize-display-values/package.json | 35 +- .../@csstools/postcss-oklab-function/CHANGELOG.md | 161 +---- .../@csstools/postcss-oklab-function/README.md | 3 +- .../dist/has-fallback-decl.d.ts | 2 - .../dist/has-supports-at-rule-ancestor.d.ts | 2 - .../postcss-oklab-function/dist/index.cjs | 2 +- .../postcss-oklab-function/dist/index.d.ts | 6 +- .../postcss-oklab-function/dist/index.mjs | 2 +- .../@csstools/postcss-oklab-function/package.json | 43 +- .../CHANGELOG.md | 86 +-- .../README.md | 5 +- .../dist/conditions-from-values.d.ts | 3 - .../dist/custom/double-position-gradients.d.ts | 2 - .../dist/index.cjs | 2 +- .../dist/index.d.ts | 5 +- .../dist/index.mjs | 2 +- .../dist/match.d.ts | 11 - .../dist/matchers.d.ts | 33 - .../package.json | 35 +- .../postcss-relative-color-syntax/CHANGELOG.md | 75 +- .../dist/has-fallback-decl.d.ts | 2 - .../dist/has-supports-at-rule-ancestor.d.ts | 2 - .../postcss-relative-color-syntax/dist/index.cjs | 2 +- .../postcss-relative-color-syntax/dist/index.d.ts | 6 +- .../postcss-relative-color-syntax/dist/index.mjs | 2 +- .../postcss-relative-color-syntax/package.json | 45 +- .../postcss-scope-pseudo-class/CHANGELOG.md | 25 +- .../@csstools/postcss-scope-pseudo-class/README.md | 4 + .../postcss-scope-pseudo-class/dist/index.cjs | 2 +- .../postcss-scope-pseudo-class/dist/index.d.ts | 10 +- .../postcss-scope-pseudo-class/dist/index.mjs | 2 +- .../postcss-scope-pseudo-class/package.json | 37 +- .../postcss-stepped-value-functions/CHANGELOG.md | 57 +- .../postcss-stepped-value-functions/dist/calc.d.ts | 1 - .../dist/checks.d.ts | 2 - .../postcss-stepped-value-functions/dist/index.cjs | 2 +- .../dist/index.d.ts | 10 +- .../postcss-stepped-value-functions/dist/index.mjs | 2 +- .../postcss-stepped-value-functions/package.json | 43 +- .../postcss-text-decoration-shorthand/CHANGELOG.md | 76 +- .../dist/index.d.ts | 10 +- .../postcss-text-decoration-shorthand/package.json | 40 +- .../postcss-trigonometric-functions/CHANGELOG.md | 62 +- .../postcss-trigonometric-functions/dist/calc.d.ts | 1 - .../dist/checks.d.ts | 2 - .../postcss-trigonometric-functions/dist/index.cjs | 2 +- .../dist/index.d.ts | 10 +- .../postcss-trigonometric-functions/dist/index.mjs | 2 +- .../postcss-trigonometric-functions/package.json | 43 +- .../@csstools/postcss-unset-value/CHANGELOG.md | 30 +- .../@csstools/postcss-unset-value/dist/index.d.ts | 10 +- .../postcss-unset-value/dist/property-def.d.ts | 2 - .../@csstools/postcss-unset-value/package.json | 35 +- .../@csstools/selector-specificity/CHANGELOG.md | 52 +- .../@csstools/selector-specificity/dist/index.cjs | 2 +- .../@csstools/selector-specificity/dist/index.d.ts | 11 +- .../@csstools/selector-specificity/dist/index.mjs | 2 +- .../dist/to-lower-case-a-z.d.ts | 1 - .../@csstools/selector-specificity/package.json | 30 +- 473 files changed, 3472 insertions(+), 6119 deletions(-) delete mode 100644 node_modules/@csstools/cascade-layer-name-parser/dist/nodes/layer-name.d.ts delete mode 100644 node_modules/@csstools/cascade-layer-name-parser/dist/parser/parse.d.ts delete mode 100644 node_modules/@csstools/cascade-layer-name-parser/dist/util/model.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/calculations/binary-search-gamut.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/calculations/contrast.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/calculations/delta-EOK.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/calculations/index.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/calculations/map-gamut.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/calculations/multiply-matrices.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/constants.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/d50-to-d65.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/d65-to-d50.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/gam-2020.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/gam-a98rgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/gam-p3.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/gam-pro-photo.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/gam-srgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/hsl-to-srgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/hue-to-rgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/hwb-to-srgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/index.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lab-to-lch.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lab-to-xyz.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lch-to-lab.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-2020-to-xyz.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-2020.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-a98rgb-to-xyz.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-a98rgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-p3-to-xyz.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-p3.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-pro-photo-to-xyz.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-pro-photo.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-srgb-to-xyz.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/lin-srgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/naive-cmyk-to-srgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/oklab-to-oklch.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/oklab-to-xyz.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/oklch-to-oklab.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/srgb-to-hsl.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/srgb-to-hwb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/srgb-to-luminance.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lab.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-2020.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-a98rgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-p3.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-pro-photo.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-srgb.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-oklab.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-uv.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz-to-xy.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/conversions/xyz/index.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/named-colors/index.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/types/color.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/utils/clip.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/utils/in-gamut.d.ts delete mode 100644 node_modules/@csstools/color-helpers/dist/utils/index.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/calculation.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/abs.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/acos.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/asin.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/atan.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/atan2.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/calc.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/clamp.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/cos.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/exp.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/globals-and-constants.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/hypot.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/log.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/max.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/min.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/mod.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/pow.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/rem.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/result-to-calculation.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/round.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/sign.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/sin.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/sqrt.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/functions/tan.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/operation/addition.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/operation/division.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/operation/multiplication.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/operation/operation.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/operation/subtraction.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/operation/unary.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/options.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/canonical.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/cm.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/deg.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/grad.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/hz.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/in.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/index.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/khz.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/mm.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/ms.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/pc.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/pt.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/px.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/q.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/rad.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/s.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/unit-conversions/turn.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/canonical-unit.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/globals.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/infinity.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/kind-of-number.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/minus-zero.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/nan.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/patch-result.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/precision.d.ts delete mode 100644 node_modules/@csstools/css-calc/dist/util/to-lower-case-a-z.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/color-data.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/color-notation.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/color-parser.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/color-keyword.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/color-mix.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/color-normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/color.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/hex.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/hsl-normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/hsl.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/hue-normalize-channel-value.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/hwb-normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/hwb.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/lab-normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/lab.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/lch-normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/lch.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/named-color.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/normalize.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/oklab-normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/oklab.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/oklch-normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/oklch.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/rgb-normalize-channel-values.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/rgb.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/three-channel-legacy-syntax.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/functions/three-channel-space-separated.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/gamut-mapping/p3.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/gamut-mapping/srgb.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/serialize/oklch.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/serialize/p3.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/serialize/rgb.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/serialize/to-precision.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/serialize/with-alpha.d.ts delete mode 100644 node_modules/@csstools/css-color-parser/dist/util/to-lower-case-a-z.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts delete mode 100644 node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-unicode-range.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/unicode-range-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/code-point-reader.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/reader.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/stringify.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts delete mode 100644 node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/custom-media.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts delete mode 100644 node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/clean-blocks.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/constants.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/desugar-nested-layers.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/model.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/options.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/record-layer-order.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/some-in-tree.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/sort-root-nodes.d.ts delete mode 100644 node_modules/@csstools/postcss-cascade-layers/dist/split-important-styles.d.ts delete mode 100644 node_modules/@csstools/postcss-color-function/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-color-function/dist/has-supports-at-rule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-color-mix-function/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-color-mix-function/dist/has-supports-at-rule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-exponential-functions/dist/calc.d.ts delete mode 100644 node_modules/@csstools/postcss-exponential-functions/dist/checks.d.ts delete mode 100644 node_modules/@csstools/postcss-font-format-keywords/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-gamut-mapping/dist/has-conditional-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-gamut-mapping/dist/has-override-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts delete mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts delete mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts delete mode 100644 node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts delete mode 100644 node_modules/@csstools/postcss-hwb-function/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-ic-unit/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-ic-unit/dist/has-supports-at-rule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-initial/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-initial/dist/properties.d.ts delete mode 100644 node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/always-valid.d.ts delete mode 100644 node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex.d.ts delete mode 100644 node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/child-adjacent-child.d.ts delete mode 100644 node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/is-in-compound.d.ts delete mode 100644 node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/is-pseudo-in-first-compound.d.ts delete mode 100644 node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/compound-selector-order.d.ts delete mode 100644 node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/split-selectors.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts create mode 100644 node_modules/@csstools/postcss-logical-overflow/CHANGELOG.md create mode 100644 node_modules/@csstools/postcss-logical-overflow/LICENSE.md create mode 100644 node_modules/@csstools/postcss-logical-overflow/README.md create mode 100644 node_modules/@csstools/postcss-logical-overflow/dist/index.cjs create mode 100644 node_modules/@csstools/postcss-logical-overflow/dist/index.d.ts create mode 100644 node_modules/@csstools/postcss-logical-overflow/dist/index.mjs create mode 100644 node_modules/@csstools/postcss-logical-overflow/package.json create mode 100644 node_modules/@csstools/postcss-logical-overscroll-behavior/CHANGELOG.md create mode 100644 node_modules/@csstools/postcss-logical-overscroll-behavior/LICENSE.md create mode 100644 node_modules/@csstools/postcss-logical-overscroll-behavior/README.md create mode 100644 node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.cjs create mode 100644 node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.d.ts create mode 100644 node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.mjs create mode 100644 node_modules/@csstools/postcss-logical-overscroll-behavior/package.json delete mode 100644 node_modules/@csstools/postcss-logical-resize/dist/lib/clone-declaration.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-resize/dist/lib/transform-resize.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-resize/dist/lib/types.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-resize/dist/utils/direction-flow-to-axes.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-viewport-units/dist/has-feature.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-viewport-units/dist/has-supports-at-rule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-viewport-units/dist/lib/types.d.ts delete mode 100644 node_modules/@csstools/postcss-logical-viewport-units/dist/transform.d.ts delete mode 100644 node_modules/@csstools/postcss-media-minmax/dist/to-lower-case-a-z.d.ts delete mode 100644 node_modules/@csstools/postcss-media-minmax/dist/transform-single-pair.d.ts delete mode 100644 node_modules/@csstools/postcss-media-minmax/dist/transform.d.ts delete mode 100644 node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-feature-value.d.ts delete mode 100644 node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-query-list.d.ts delete mode 100644 node_modules/@csstools/postcss-nested-calc/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-nested-calc/dist/occurrences.d.ts delete mode 100644 node_modules/@csstools/postcss-normalize-display-values/dist/mappings.d.ts delete mode 100644 node_modules/@csstools/postcss-oklab-function/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-oklab-function/dist/has-supports-at-rule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-progressive-custom-properties/dist/conditions-from-values.d.ts delete mode 100644 node_modules/@csstools/postcss-progressive-custom-properties/dist/custom/double-position-gradients.d.ts delete mode 100644 node_modules/@csstools/postcss-progressive-custom-properties/dist/match.d.ts delete mode 100644 node_modules/@csstools/postcss-progressive-custom-properties/dist/matchers.d.ts delete mode 100644 node_modules/@csstools/postcss-relative-color-syntax/dist/has-fallback-decl.d.ts delete mode 100644 node_modules/@csstools/postcss-relative-color-syntax/dist/has-supports-at-rule-ancestor.d.ts delete mode 100644 node_modules/@csstools/postcss-stepped-value-functions/dist/calc.d.ts delete mode 100644 node_modules/@csstools/postcss-stepped-value-functions/dist/checks.d.ts delete mode 100644 node_modules/@csstools/postcss-trigonometric-functions/dist/calc.d.ts delete mode 100644 node_modules/@csstools/postcss-trigonometric-functions/dist/checks.d.ts delete mode 100644 node_modules/@csstools/postcss-unset-value/dist/property-def.d.ts delete mode 100644 node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts (limited to 'node_modules/@csstools') diff --git a/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md b/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md index d822b088..ac8681e8 100644 --- a/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md +++ b/node_modules/@csstools/cascade-layer-name-parser/CHANGELOG.md @@ -1,5 +1,13 @@ # Changes to Cascade Layer Name Parser +### 1.0.6 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) + ### 1.0.5 _September 24, 2023_ @@ -14,29 +22,4 @@ _July 24, 2023_ - Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) - Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) -### 1.0.3 - -_July 3, 2023_ - -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) - -### 1.0.2 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) - - - -### 1.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 1.0.0 - -_January 19, 2023_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/cascade-layer-name-parser/CHANGELOG.md) diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs b/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs index 08d61378..6d8efe7f 100644 --- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs +++ b/node_modules/@csstools/cascade-layer-name-parser/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/css-tokenizer"),n=require("@csstools/css-parser-algorithms");class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(n,r){const t=[];for(let n=0;nn[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim)),r,...n.parts.filter((n=>n[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim))])}segments(){return this.parts.filter((n=>n[0]===e.TokenType.Ident)).map((e=>e[4].value))}name(){return this.parts.filter((n=>n[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim)).map((e=>e[1])).join("")}equal(e){const n=this.segments(),r=e.segments();if(n.length!==r.length)return!1;for(let e=0;e{}),o=["6.4.2. Layer Naming and Nesting","Layer name syntax"," = [ '.' ]*"],i=r[0][2],l=r[r.length-1][3],p=[];for(let r=0;re.tokens()));let c=!1,T=!1,y=null;for(let n=0;n{const r=n.segments();e:for(let t=0;t=o&&(s=n,o=t)}-1===s?e.push(r):e.splice(s+1,0,r)}})),e},exports.parse=function parse(n,r){const t=e.tokenizer({css:n},{onParseError:null==r?void 0:r.onParseError}),a=[];for(;!t.endOfFile();)a.push(t.nextToken());return a.push(t.nextToken()),parseFromTokens(a,r)},exports.parseFromTokens=parseFromTokens; +"use strict";var e=require("@csstools/css-tokenizer"),n=require("@csstools/css-parser-algorithms");class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(n,r){const t=[];for(let n=0;nn[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim)),r,...n.parts.filter((n=>n[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim))])}segments(){return this.parts.filter((n=>n[0]===e.TokenType.Ident)).map((e=>e[4].value))}name(){return this.parts.filter((n=>n[0]===e.TokenType.Ident||n[0]===e.TokenType.Delim)).map((e=>e[1])).join("")}equal(e){const n=this.segments(),r=e.segments();if(n.length!==r.length)return!1;for(let e=0;e{}),o=["6.4.2. Layer Naming and Nesting","Layer name syntax"," = [ '.' ]*"],i=r[0][2],l=r[r.length-1][3],p=[];for(let r=0;re.tokens()));let c=!1,T=!1,y=null;for(let n=0;n{const r=n.segments();e:for(let t=0;t=o&&(s=n,o=t)}-1===s?e.push(r):e.splice(s+1,0,r)}})),e},exports.parse=function parse(n,r){const t=e.tokenizer({css:n},{onParseError:r?.onParseError}),a=[];for(;!t.endOfFile();)a.push(t.nextToken());return a.push(t.nextToken()),parseFromTokens(a,r)},exports.parseFromTokens=parseFromTokens; diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts b/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts index 2592bc2e..225d9fda 100644 --- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts +++ b/node_modules/@csstools/cascade-layer-name-parser/dist/index.d.ts @@ -1,3 +1,31 @@ -export { LayerName } from './nodes/layer-name'; -export { addLayerToModel } from './util/model'; -export { parse, parseFromTokens } from './parser/parse'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { ParseError } from '@csstools/css-tokenizer'; + +export declare function addLayerToModel(layers: Array, currentLayerNames: Array): LayerName[]; + +export declare class LayerName { + parts: Array; + constructor(parts: Array); + tokens(): Array; + slice(start: number, end: number): LayerName; + concat(other: LayerName): LayerName; + segments(): Array; + name(): string; + equal(other: LayerName): boolean; + toString(): string; + toJSON(): { + parts: CSSToken[]; + segments: string[]; + name: string; + }; +} + +export declare function parse(source: string, options?: { + onParseError?: (error: ParseError) => void; +}): LayerName[]; + +export declare function parseFromTokens(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): LayerName[]; + +export { } diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs b/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs index e9cc05e9..dffec78f 100644 --- a/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs +++ b/node_modules/@csstools/cascade-layer-name-parser/dist/index.mjs @@ -1 +1 @@ -import{TokenType as e,stringify as t,ParseError as n,tokenizer as r}from"@csstools/css-tokenizer";import{parseCommaSeparatedListOfComponentValues as a,isTokenNode as s,isCommentNode as l,isWhitespaceNode as i}from"@csstools/css-parser-algorithms";class LayerName{parts;constructor(e){this.parts=e}tokens(){return[...this.parts]}slice(t,n){const r=[];for(let t=0;tt[0]===e.Ident||t[0]===e.Delim)),n,...t.parts.filter((t=>t[0]===e.Ident||t[0]===e.Delim))])}segments(){return this.parts.filter((t=>t[0]===e.Ident)).map((e=>e[4].value))}name(){return this.parts.filter((t=>t[0]===e.Ident||t[0]===e.Delim)).map((e=>e[1])).join("")}equal(e){const t=this.segments(),n=e.segments();if(t.length!==n.length)return!1;for(let e=0;e{const n=t.segments();e:for(let r=0;r=l&&(s=t,l=r)}-1===s?e.push(n):e.splice(s+1,0,n)}})),e}function parseFromTokens(t,r){const o=a(t,{onParseError:null==r?void 0:r.onParseError}),m=(null==r?void 0:r.onParseError)??(()=>{}),c=["6.4.2. Layer Naming and Nesting","Layer name syntax"," = [ '.' ]*"],d=t[0][2],u=t[t.length-1][3],p=[];for(let t=0;te.tokens()));let h=!1,f=!1,y=null;for(let t=0;tt[0]===e.Ident||t[0]===e.Delim)),n,...t.parts.filter((t=>t[0]===e.Ident||t[0]===e.Delim))])}segments(){return this.parts.filter((t=>t[0]===e.Ident)).map((e=>e[4].value))}name(){return this.parts.filter((t=>t[0]===e.Ident||t[0]===e.Delim)).map((e=>e[1])).join("")}equal(e){const t=this.segments(),n=e.segments();if(t.length!==n.length)return!1;for(let e=0;e{const n=t.segments();e:for(let r=0;r=i&&(s=t,i=r)}-1===s?e.push(n):e.splice(s+1,0,n)}})),e}function parseFromTokens(t,r){const l=a(t,{onParseError:r?.onParseError}),m=r?.onParseError??(()=>{}),c=["6.4.2. Layer Naming and Nesting","Layer name syntax"," = [ '.' ]*"],d=t[0][2],u=t[t.length-1][3],p=[];for(let t=0;te.tokens()));let h=!1,f=!1,y=null;for(let t=0;t; - constructor(parts: Array); - tokens(): Array; - slice(start: number, end: number): LayerName; - concat(other: LayerName): LayerName; - segments(): Array; - name(): string; - equal(other: LayerName): boolean; - toString(): string; - toJSON(): { - parts: CSSToken[]; - segments: string[]; - name: string; - }; -} diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/parser/parse.d.ts b/node_modules/@csstools/cascade-layer-name-parser/dist/parser/parse.d.ts deleted file mode 100644 index 2f068c4c..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/dist/parser/parse.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { LayerName } from '../nodes/layer-name'; -export type Options = { - onParseError?: (error: ParseError) => void; -}; -export declare function parseFromTokens(tokens: Array, options?: Options): LayerName[]; -export declare function parse(source: string, options?: Options): LayerName[]; diff --git a/node_modules/@csstools/cascade-layer-name-parser/dist/util/model.d.ts b/node_modules/@csstools/cascade-layer-name-parser/dist/util/model.d.ts deleted file mode 100644 index 7347ce26..00000000 --- a/node_modules/@csstools/cascade-layer-name-parser/dist/util/model.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { LayerName } from '../nodes/layer-name'; -export declare function addLayerToModel(layers: Array, currentLayerNames: Array): LayerName[]; diff --git a/node_modules/@csstools/cascade-layer-name-parser/package.json b/node_modules/@csstools/cascade-layer-name-parser/package.json index e244cb90..593c2e88 100644 --- a/node_modules/@csstools/cascade-layer-name-parser/package.json +++ b/node_modules/@csstools/cascade-layer-name-parser/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/cascade-layer-name-parser", "description": "Parse CSS Cascade Layer names.", - "version": "1.0.5", + "version": "1.0.6", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,16 +48,8 @@ "dist" ], "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node ./test/test.mjs" + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/cascade-layer-name-parser#readme", "repository": { @@ -67,8 +62,5 @@ "cascade-layer", "css", "parser" - ], - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/color-helpers/CHANGELOG.md b/node_modules/@csstools/color-helpers/CHANGELOG.md index 032f0578..6d0272f2 100644 --- a/node_modules/@csstools/color-helpers/CHANGELOG.md +++ b/node_modules/@csstools/color-helpers/CHANGELOG.md @@ -1,5 +1,13 @@ # Changes to Color Helpers +### 4.0.0 + +_December 15, 2023_ + +- Remove barrel files +- Fix type definitions +- Use higher precision color conversion matrices. + ### 3.0.2 _September 2, 2023_ @@ -12,29 +20,4 @@ _August 28, 2023_ - Clamp negative saturation in `hsl` to `0`. -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) - -### 2.1.0 - -_May 19, 2023_ - -- Fix gamut mapping -- Fix `XYZ_D50_to_ProPhoto` -- Export `sRGB_to_HWB` - -### 2.0.0 - -_March 25, 2023_ - -- Removed certain implementation specific helpers. Keeping this package more focussed on general purpose color transformations. -- Added `xyz` specific helpers. These make it easy to transform to and from `xyz-d50` and any other color space. - -### 1.0.0 - -_February 2, 2023_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md) diff --git a/node_modules/@csstools/color-helpers/dist/calculations/binary-search-gamut.d.ts b/node_modules/@csstools/color-helpers/dist/calculations/binary-search-gamut.d.ts deleted file mode 100644 index a6569f95..00000000 --- a/node_modules/@csstools/color-helpers/dist/calculations/binary-search-gamut.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Color } from 'types/color'; -export declare function binarySearchGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/calculations/contrast.d.ts b/node_modules/@csstools/color-helpers/dist/calculations/contrast.d.ts deleted file mode 100644 index fee9456e..00000000 --- a/node_modules/@csstools/color-helpers/dist/calculations/contrast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Color } from 'types/color'; -export declare function contrast(RGB1: Color, RGB2: Color): number; diff --git a/node_modules/@csstools/color-helpers/dist/calculations/delta-EOK.d.ts b/node_modules/@csstools/color-helpers/dist/calculations/delta-EOK.d.ts deleted file mode 100644 index ad7878ba..00000000 --- a/node_modules/@csstools/color-helpers/dist/calculations/delta-EOK.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @description Calculate deltaE OK which is the simple root sum of squares - * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1 - * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1 - * @return {number} How different a color sample is from reference - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js - */ -export declare function deltaEOK(reference: Color, sample: Color): number; diff --git a/node_modules/@csstools/color-helpers/dist/calculations/index.d.ts b/node_modules/@csstools/color-helpers/dist/calculations/index.d.ts deleted file mode 100644 index 86e5f357..00000000 --- a/node_modules/@csstools/color-helpers/dist/calculations/index.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from './binary-search-gamut'; -export * from './map-gamut'; -export * from './delta-EOK'; -export * from './contrast'; -export * from './multiply-matrices'; diff --git a/node_modules/@csstools/color-helpers/dist/calculations/map-gamut.d.ts b/node_modules/@csstools/color-helpers/dist/calculations/map-gamut.d.ts deleted file mode 100644 index 7bf8f709..00000000 --- a/node_modules/@csstools/color-helpers/dist/calculations/map-gamut.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Color } from 'types/color'; -export declare function mapGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/calculations/multiply-matrices.d.ts b/node_modules/@csstools/color-helpers/dist/calculations/multiply-matrices.d.ts deleted file mode 100644 index b78e13fd..00000000 --- a/node_modules/@csstools/color-helpers/dist/calculations/multiply-matrices.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -/** - * Simple matrix (and vector) multiplication - * Warning: No error handling for incompatible dimensions! - * @author Lea Verou 2020 MIT License - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js - */ -export declare function multiplyMatrices(a: Array> | Array, b: Array> | Array): Array> | Array; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/constants.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/constants.d.ts deleted file mode 100644 index 4d2e7a1e..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/constants.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const D50: number[]; -export declare const D65: number[]; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/d50-to-d65.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/d50-to-d65.d.ts deleted file mode 100644 index 7afb26ae..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/d50-to-d65.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Bradford chromatic adaptation from D50 to D65 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function D50_to_D65(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/d65-to-d50.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/d65-to-d50.d.ts deleted file mode 100644 index 5409797a..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/d65-to-d50.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Bradford chromatic adaptation from D65 to D50 - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html - */ -export declare function D65_to_D50(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/gam-2020.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/gam-2020.d.ts deleted file mode 100644 index a4327761..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/gam-2020.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0 - * to gamma corrected form ITU-R BT.2020-2 p.4 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function gam_2020(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/gam-a98rgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/gam-a98rgb.d.ts deleted file mode 100644 index 87727af7..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/gam-a98rgb.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light a98-rgb in the range 0.0-1.0 - * to gamma corrected form. Negative values are also now accepted - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function gam_a98rgb(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/gam-p3.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/gam-p3.d.ts deleted file mode 100644 index 60d31f14..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/gam-p3.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0 - * to gamma corrected form - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function gam_P3(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/gam-pro-photo.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/gam-pro-photo.d.ts deleted file mode 100644 index fe2aba29..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/gam-pro-photo.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light prophoto-rgb in the range 0.0-1.0 - * to gamma corrected form. - * Transfer curve is gamma 1.8 with a small linear portion. - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function gam_ProPhoto(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/gam-srgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/gam-srgb.d.ts deleted file mode 100644 index c7cfba5f..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/gam-srgb.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form - * Extended transfer function: - * For negative values, linear portion extends on reflection - * of axis, then uses reflected pow below that - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://en.wikipedia.org/wiki/SRGB - */ -export declare function gam_sRGB(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/hsl-to-srgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/hsl-to-srgb.d.ts deleted file mode 100644 index 1366bc00..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/hsl-to-srgb.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @param {number} hue - Hue as degrees 0..360 - * @param {number} sat - Saturation as percentage 0..100 - * @param {number} light - Lightness as percentage 0..100 - * @return {number[]} Array of RGB components 0..1 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js - */ -export declare function HSL_to_sRGB(HSL: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/hue-to-rgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/hue-to-rgb.d.ts deleted file mode 100644 index 8cb5ff7c..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/hue-to-rgb.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ -export declare function hueToRGB(t1: number, t2: number, hue: number): number; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/hwb-to-srgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/hwb-to-srgb.d.ts deleted file mode 100644 index e359a498..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/hwb-to-srgb.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @param {number} hue - Hue as degrees 0..360 - * @param {number} white - Whiteness as percentage 0..100 - * @param {number} black - Blackness as percentage 0..100 - * @return {number[]} Array of RGB components 0..1 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js - */ -export declare function HWB_to_sRGB(HWB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/index.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/index.d.ts deleted file mode 100644 index 9a2ed427..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/index.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export * from './constants'; -export * from './d50-to-d65'; -export * from './d65-to-d50'; -export * from './gam-2020'; -export * from './gam-a98rgb'; -export * from './gam-p3'; -export * from './gam-pro-photo'; -export * from './gam-srgb'; -export * from './hsl-to-srgb'; -export * from './hue-to-rgb'; -export * from './hwb-to-srgb'; -export * from './lab-to-lch'; -export * from './lab-to-xyz'; -export * from './lch-to-lab'; -export * from './lin-2020'; -export * from './lin-2020-to-xyz'; -export * from './lin-a98rgb'; -export * from './lin-a98rgb-to-xyz'; -export * from './lin-p3'; -export * from './lin-p3-to-xyz'; -export * from './lin-pro-photo'; -export * from './lin-pro-photo-to-xyz'; -export * from './lin-srgb'; -export * from './lin-srgb-to-xyz'; -export * from './naive-cmyk-to-srgb'; -export * from './oklab-to-oklch'; -export * from './oklab-to-xyz'; -export * from './oklch-to-oklab'; -export * from './srgb-to-hsl'; -export * from './srgb-to-hwb'; -export * from './srgb-to-luminance'; -export * from './xyz-to-lab'; -export * from './xyz-to-lin-2020'; -export * from './xyz-to-lin-a98rgb'; -export * from './xyz-to-lin-p3'; -export * from './xyz-to-lin-pro-photo'; -export * from './xyz-to-lin-srgb'; -export * from './xyz-to-oklab'; -export * from './xyz-to-uv'; -export * from './xyz-to-xy'; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lab-to-lch.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lab-to-lch.d.ts deleted file mode 100644 index 8ecc0b61..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lab-to-lch.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function Lab_to_LCH(Lab: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lab-to-xyz.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lab-to-xyz.d.ts deleted file mode 100644 index dea458fe..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lab-to-xyz.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Color } from 'types/color'; -export declare function Lab_to_XYZ(Lab: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lch-to-lab.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lch-to-lab.d.ts deleted file mode 100644 index 107b5148..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lch-to-lab.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function LCH_to_Lab(LCH: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-2020-to-xyz.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-2020-to-xyz.d.ts deleted file mode 100644 index f9116c4a..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-2020-to-xyz.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light rec2020 values to CIE XYZ - * using D65 (no chromatic adaptation) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */ -export declare function lin_2020_to_XYZ(rgb: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-2020.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-2020.d.ts deleted file mode 100644 index 03a5a29d..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-2020.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of rec2020 RGB values in the range 0.0 - 1.0 - * to linear light (un-companded) form. - * ITU-R BT.2020-2 p.4 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function lin_2020(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-a98rgb-to-xyz.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-a98rgb-to-xyz.d.ts deleted file mode 100644 index e73f04f2..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-a98rgb-to-xyz.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light a98-rgb values to CIE XYZ - * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - * has greater numerical precision than section 4.3.5.3 of - * https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf - * but the values below were calculated from first principles - * from the chromaticity coordinates of R G B W - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - * @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html - */ -export declare function lin_a98rgb_to_XYZ(rgb: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-a98rgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-a98rgb.d.ts deleted file mode 100644 index ae9c470e..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-a98rgb.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of a98-rgb values in the range 0.0 - 1.0 - * to linear light (un-companded) form. Negative values are also now accepted - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function lin_a98rgb(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-p3-to-xyz.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-p3-to-xyz.d.ts deleted file mode 100644 index ed542c25..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-p3-to-xyz.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light display-p3 values to CIE XYZ - * using D65 (no chromatic adaptation) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */ -export declare function lin_P3_to_XYZ(rgb: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-p3.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-p3.d.ts deleted file mode 100644 index 2475231c..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-p3.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of display-p3 RGB values in the range 0.0 - 1.0 - * to linear light (un-companded) form. - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function lin_P3(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-pro-photo-to-xyz.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-pro-photo-to-xyz.d.ts deleted file mode 100644 index a857852d..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-pro-photo-to-xyz.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light prophoto-rgb values to CIE XYZ - * using D50 (so no chromatic adaptation needed afterwards) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */ -export declare function lin_ProPhoto_to_XYZ(rgb: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-pro-photo.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-pro-photo.d.ts deleted file mode 100644 index 3ecf2893..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-pro-photo.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of prophoto-rgb values where in-gamut Colors are in the - * range [0.0 - 1.0] to linear light (un-companded) form. Transfer curve is - * gamma 1.8 with a small linear portion. Extended transfer function - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function lin_ProPhoto(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-srgb-to-xyz.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-srgb-to-xyz.d.ts deleted file mode 100644 index 81384165..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-srgb-to-xyz.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of linear-light sRGB values to CIE XYZ - * using sRGB's own white, D65 (no chromatic adaptation) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function lin_sRGB_to_XYZ(rgb: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/lin-srgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/lin-srgb.d.ts deleted file mode 100644 index 4365c9b0..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/lin-srgb.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of of sRGB values where in-gamut values are in the range - * [0 - 1] to linear light (un-companded) form. - * Extended transfer function: - * For negative values, linear portion is extended on reflection of axis, - * then reflected power function is used. - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://en.wikipedia.org/wiki/SRGB - */ -export declare function lin_sRGB(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/naive-cmyk-to-srgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/naive-cmyk-to-srgb.d.ts deleted file mode 100644 index 9584f125..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/naive-cmyk-to-srgb.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Color } from 'types/color'; -/** - * CMYK is an array of four values in the range [0.0, 1.0] the output is an - * array of [RGB] also in the [0.0, 1.0] range because the naive algorithm - * does not generate out of gamut colors neither does it generate accurate - * simulations of practical CMYK colors - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ -export declare function naive_CMYK_to_sRGB(CMYK: [number, number, number, number]): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/oklab-to-oklch.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/oklab-to-oklch.d.ts deleted file mode 100644 index 0c75e2e5..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/oklab-to-oklch.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js - */ -export declare function OKLab_to_OKLCH(OKLab: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/oklab-to-xyz.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/oklab-to-xyz.d.ts deleted file mode 100644 index c42206d0..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/oklab-to-xyz.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Color } from 'types/color'; -export declare function OKLab_to_XYZ(OKLab: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/oklch-to-oklab.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/oklch-to-oklab.d.ts deleted file mode 100644 index 9ba9533d..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/oklch-to-oklab.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js - */ -export declare function OKLCH_to_OKLab(OKLCH: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-hsl.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-hsl.d.ts deleted file mode 100644 index 0159a182..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-hsl.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL. - * - * @param {Color} RGB [r, g, b] - * - Red component 0..1 - * - Green component 0..1 - * - Blue component 0..1 - * @return {number[]} Array of HSL values: Hue as degrees 0..360, Saturation and Lightness as percentages 0..100 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/rgbToHsl.js - */ -export declare function sRGB_to_HSL(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-hwb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-hwb.d.ts deleted file mode 100644 index 9a79caf7..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-hwb.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HWB. - * - * @param {Color} RGB [r, g, b] - * - Red component 0..1 - * - Green component 0..1 - * - Blue component 0..1 - * @return {number[]} Array of HWB values - */ -export declare function sRGB_to_HWB(RGB: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-luminance.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-luminance.d.ts deleted file mode 100644 index 681feb09..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/srgb-to-luminance.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range - * to linear-light sRGB, then to CIE XYZ and return luminance (the Y value) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ -export declare function sRGB_to_luminance(RGB: Color): number; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lab.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lab.d.ts deleted file mode 100644 index 65a3ecfe..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lab.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Color } from 'types/color'; -export declare function XYZ_to_Lab(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-2020.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-2020.d.ts deleted file mode 100644 index cae6c260..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-2020.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert XYZ to linear-light rec2020 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function XYZ_to_lin_2020(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-a98rgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-a98rgb.d.ts deleted file mode 100644 index 26353878..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-a98rgb.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert XYZ to linear-light a98-rgb - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function XYZ_to_lin_a98rgb(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-p3.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-p3.d.ts deleted file mode 100644 index e52917c7..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-p3.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert XYZ to linear-light P3 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function XYZ_to_lin_P3(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-pro-photo.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-pro-photo.d.ts deleted file mode 100644 index bf163166..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-pro-photo.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert XYZ to linear-light prophoto-rgb - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */ -export declare function XYZ_to_lin_ProPhoto(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-srgb.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-srgb.d.ts deleted file mode 100644 index 104891ff..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-lin-srgb.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function XYZ_to_lin_sRGB(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-oklab.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-oklab.d.ts deleted file mode 100644 index 5d190539..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-oklab.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * XYZ <-> LMS matrices recalculated for consistent reference white - * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484 - */ -export declare function XYZ_to_OKLab(XYZ: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-uv.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-uv.d.ts deleted file mode 100644 index ab9a978e..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-uv.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of three XYZ values to u*,v* chromaticity coordinates - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ -export declare function XYZ_to_uv(XYZ: Color): [number, number]; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-xy.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-xy.d.ts deleted file mode 100644 index ab662176..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz-to-xy.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Color } from 'types/color'; -/** - * Convert an array of three XYZ values to x,y chromaticity coordinates - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ -export declare function XYZ_to_xy(XYZ: Color): [number, number]; diff --git a/node_modules/@csstools/color-helpers/dist/conversions/xyz/index.d.ts b/node_modules/@csstools/color-helpers/dist/conversions/xyz/index.d.ts deleted file mode 100644 index f9e446f5..00000000 --- a/node_modules/@csstools/color-helpers/dist/conversions/xyz/index.d.ts +++ /dev/null @@ -1,253 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @param {Color} color [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function sRGB_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} sRGB [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - */ -export declare function XYZ_D50_to_sRGB(x: Color): Color; -/** - * @param {Color} color [h, s, l] - * - Hue as degrees 0..360; - * - Saturation as number 0..100; - * - Lightness as number 0..100; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function HSL_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} HSL [r, g, b] - * - Hue as degrees 0..360; - * - Saturation as number 0..100; - * - Lightness as number 0..100; - */ -export declare function XYZ_D50_to_HSL(x: Color): Color; -/** - * @param {Color} color [h, w, b] - * - Hue as degrees 0..360; - * - Whiteness as number 0..100; - * - Blackness as number 0..100; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function HWB_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} HWB [r, g, b] - * - Hue as degrees 0..360; - * - Whiteness as number 0..100; - * - Blackness as number 0..100; - */ -export declare function XYZ_D50_to_HWB(x: Color): Color; -/** - * @param {Color} color [l, a, b] - * - Lightness as number 0..100; - * - a as number -160..160; - * - b as number -160..160; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function Lab_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} Lab [r, g, b] - * - Lightness as number 0..100; - * - a as number -160..160; - * - b as number -160..160; - */ -export declare function XYZ_D50_to_Lab(x: Color): Color; -/** - * @param {Color} color [l, c, h] - * - Lightness as number 0..100; - * - Chroma as number 0..230; - * - Hue as degrees 0..360; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function LCH_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} LCH [r, g, b] - * - Lightness as number 0..100; - * - Chroma as number 0..230; - * - Hue as degrees 0..360; - */ -export declare function XYZ_D50_to_LCH(x: Color): Color; -/** - * @param {Color} color [l, a, b] - * - Lightness as number 0..1; - * - a as number 0..0.5; - * - b as number 0..0.5; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function OKLab_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} OKLab [r, g, b] - * - Lightness as number 0..1; - * - a as number 0..0.5; - * - b as number 0..0.5; - */ -export declare function XYZ_D50_to_OKLab(x: Color): Color; -/** - * @param {Color} color [l, c, h] - * - Lightness as number 0..1; - * - Chroma as number 0..0.5; - * - Hue as degrees 0..360; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function OKLCH_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} OKLCH [r, g, b] - * - Lightness as number 0..1; - * - Chroma as number 0..0.5; - * - Hue as degrees 0..360; - */ -export declare function XYZ_D50_to_OKLCH(x: Color): Color; -/** - * @param {Color} color [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function lin_sRGB_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} linear sRGB [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - */ -export declare function XYZ_D50_to_lin_sRGB(x: Color): Color; -/** - * @param {Color} color [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function a98_RGB_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} a98 sRGB [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - */ -export declare function XYZ_D50_to_a98_RGB(x: Color): Color; -/** - * @param {Color} color [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function P3_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} P3 [r, g, b] - * - R as number 0..1; - * - G as number 0..1; - * - B as number 0..1; - */ -export declare function XYZ_D50_to_P3(x: Color): Color; -/** - * @param {Color} color [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function rec_2020_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} rec 2020 [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - */ -export declare function XYZ_D50_to_rec_2020(x: Color): Color; -/** - * @param {Color} color [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function ProPhoto_RGB_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} ProPhoto [r, g, b] - * - Red as number 0..1; - * - Green as number 0..1; - * - Blue as number 0..1; - */ -export declare function XYZ_D50_to_ProPhoto(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function XYZ_D65_to_XYZ_D50(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} D65 XYZ [x, y, z] - */ -export declare function XYZ_D50_to_XYZ_D65(x: Color): Color; -/** - * @param {Color} color [x, y, z] - * - X as number 0..1; - * - Y as number 0..1; - * - Z as number 0..1; - * @return {Color} D50 XYZ [x, y, z] - */ -export declare function XYZ_D50_to_XYZ_D50(x: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/index.cjs b/node_modules/@csstools/color-helpers/dist/index.cjs index cf3e4310..41e8ee1d 100644 --- a/node_modules/@csstools/color-helpers/dist/index.cjs +++ b/node_modules/@csstools/color-helpers/dist/index.cjs @@ -1,148 +1,19 @@ "use strict"; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function clip(t){return t.map((t=>t<0?0:t>1?1:t))} -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js - */function OKLCH_to_OKLab(t){return[t[0],t[1]*Math.cos(t[2]*Math.PI/180),t[1]*Math.sin(t[2]*Math.PI/180)]} -/** - * @description Calculate deltaE OK which is the simple root sum of squares - * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1 - * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1 - * @return {number} How different a color sample is from reference - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js - */function deltaEOK(t,_){const[o,n,r]=t,[e,a,i]=_,l=o-e,u=n-a,c=r-i;return Math.sqrt(l**2+u**2+c**2)} -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function inGamut(t){const[_,o,n]=t;return _>=-1e-4&&_<=1.0001&&o>=-1e-4&&o<=1.0001&&n>=-1e-4&&n<=1.0001}var t=Object.freeze({__proto__:null,clip:clip,inGamut:inGamut});const _=.02,o=1e-5;function binarySearchGamut(t,n,r){const e=t;let a=0,i=e[1];for(;i-a>o;){const t=(a+i)/2;e[1]=t;const o=n(e);if(inGamut(o)){a=t;continue}const l=clip(o);if(deltaEOK(OKLCH_to_OKLab(r(l)),OKLCH_to_OKLab(e))<_)return l;i=t}return clip(n([...e]))} -/** - * Convert an array of of sRGB values where in-gamut values are in the range - * [0 - 1] to linear light (un-companded) form. - * Extended transfer function: - * For negative values, linear portion is extended on reflection of axis, - * then reflected power function is used. - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://en.wikipedia.org/wiki/SRGB - */ -function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<.04045?t/12.92:_*Math.pow((o+.055)/1.055,2.4)}))} /** * Simple matrix (and vector) multiplication * Warning: No error handling for incompatible dimensions! * @author Lea Verou 2020 MIT License * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js - */function multiplyMatrices(t,_){const o=t.length;let n,r;n=Array.isArray(t[0])?t:[t],r=Array.isArray(_[0])?_:_.map((t=>[t]));const e=r[0].length,a=r[0].map(((t,_)=>r.map((t=>t[_]))));let i=n.map((t=>a.map((_=>Array.isArray(t)?t.reduce(((t,o,n)=>t+o*(_[n]||0)),0):_.reduce(((_,o)=>_+o*t),0)))));return 1===o&&(i=i[0]),1===e?i.map((t=>t[0])):i} -/** - * Convert an array of linear-light sRGB values to CIE XYZ - * using sRGB's own white, D65 (no chromatic adaptation) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/245763,12673/70218],[87098/409605,175762/245763,12673/175545],[7918/409605,87881/737289,1001167/1053270]],t)} -/** - * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range - * to linear-light sRGB, then to CIE XYZ and return luminance (the Y value) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */function sRGB_to_luminance(t){return lin_sRGB_to_XYZ(lin_sRGB(t))[1]} -/** - * Return WCAG 2.1 contrast ratio for two sRGB values given as arrays - * - * of 0.0 to 1.0 - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - * @see https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio - */var n=Object.freeze({__proto__:null,binarySearchGamut:binarySearchGamut,contrast:function contrast(t,_){const o=sRGB_to_luminance(t),n=sRGB_to_luminance(_);return o>n?(o+.05)/(n+.05):(n+.05)/(o+.05)},deltaEOK:deltaEOK,mapGamut:function mapGamut(t,_,o){return binarySearchGamut(t,_,o)},multiplyMatrices:multiplyMatrices});const r=[.3457/.3585,1,.2958/.3585]; -/** - * Bradford chromatic adaptation from D50 to D65 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -function D50_to_D65(t){return multiplyMatrices([[.9554734527042182,-.023098536874261423,.0632593086610217],[-.028369706963208136,1.0099954580058226,.021041398966943008],[.012314001688319899,-.020507696433477912,1.3303659366080753]],t)} + */function multiplyMatrices(t,_){const o=t.length;let e,n;e=Array.isArray(t[0])?t:[t],n=Array.isArray(_[0])?_:_.map((t=>[t]));const r=n[0].length,a=n[0].map(((t,_)=>n.map((t=>t[_]))));let i=e.map((t=>a.map((_=>Array.isArray(t)?t.reduce(((t,o,e)=>t+o*(_[e]||0)),0):_.reduce(((_,o)=>_+o*t),0)))));return 1===o&&(i=i[0]),1===r?i.map((t=>t[0])):i} /** * Bradford chromatic adaptation from D65 to D50 * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html - */function D65_to_D50(t){return multiplyMatrices([[1.0479298208405488,.022946793341019088,-.05019222954313557],[.029627815688159344,.990434484573249,-.01707382502938514],[-.009243058152591178,.015055144896577895,.7518742899580008]],t)} -/** - * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0 - * to gamma corrected form ITU-R BT.2020-2 p.4 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function gam_2020(t){const _=1.09929682680944;return t.map((function(t){const o=t<0?-1:1,n=Math.abs(t);return n>.018053968510807?o*(_*Math.pow(n,.45)-(_-1)):4.5*t}))} -/** - * Convert an array of linear-light a98-rgb in the range 0.0-1.0 - * to gamma corrected form. Negative values are also now accepted - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function gam_a98rgb(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return _*Math.pow(o,256/563)}))} -/** - * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form - * Extended transfer function: - * For negative values, linear portion extends on reflection - * of axis, then uses reflected pow below that - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://en.wikipedia.org/wiki/SRGB - */function gam_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>.0031308?_*(1.055*Math.pow(o,1/2.4)-.055):12.92*t}))} -/** - * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0 - * to gamma corrected form - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function gam_P3(t){return gam_sRGB(t)} -/** - * Convert an array of linear-light prophoto-rgb in the range 0.0-1.0 - * to gamma corrected form. - * Transfer curve is gamma 1.8 with a small linear portion. - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function gam_ProPhoto(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>=.001953125?_*Math.pow(o,1/1.8):16*t}))} + */function D65_to_D50(t){return multiplyMatrices([[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]],t)} /** * @param {number} hue - Hue as degrees 0..360 * @param {number} sat - Saturation as percentage 0..100 @@ -150,18 +21,9 @@ function D50_to_D65(t){return multiplyMatrices([[.9554734527042182,-.02309853687 * @return {number[]} Array of RGB components 0..1 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js - */function HSL_to_sRGB(t){let _=t[0],o=t[1],n=t[2];function f(t){const r=(t+_/30)%12,e=o*Math.min(n,1-n);return n-e*Math.max(-1,Math.min(r-3,9-r,1))}return _%=360,_<0&&(_+=360),o/=100,n/=100,[f(0),f(8),f(4)]} -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ + */function HSL_to_sRGB(t){let _=t[0],o=t[1],e=t[2];function f(t){const n=(t+_/30)%12,r=o*Math.min(e,1-e);return e-r*Math.max(-1,Math.min(n-3,9-n,1))}return _%=360,_<0&&(_+=360),o/=100,e/=100,[f(0),f(8),f(4)]} /** * @param {number} hue - Hue as degrees 0..360 * @param {number} white - Whiteness as percentage 0..100 @@ -169,79 +31,64 @@ function D50_to_D65(t){return multiplyMatrices([[.9554734527042182,-.02309853687 * @return {number[]} Array of RGB components 0..1 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js - */ -function HWB_to_sRGB(t){const _=t[0];let o=t[1],n=t[2];if(o/=100,n/=100,o+n>=1){const t=o/(o+n);return[t,t,t]}const r=HSL_to_sRGB([_,100,50]);for(let t=0;t<3;t++)r[t]*=1-o-n,r[t]+=o;return r} + */function HWB_to_sRGB(t){const _=t[0];let o=t[1],e=t[2];if(o/=100,e/=100,o+e>=1){const t=o/(o+e);return[t,t,t]}const n=HSL_to_sRGB([_,100,50]);for(let t=0;t<3;t++)n[t]*=1-o-e,n[t]+=o;return n} /** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function Lab_to_LCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),_>=0?_:_+360]} + */const t=[.3457/.3585,1,.2958/.3585]; /** * Convert Lab to D50-adapted XYZ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */function Lab_to_XYZ(t){const _=24389/27,o=216/24389,n=[];n[1]=(t[0]+16)/116,n[0]=t[1]/500+n[1],n[2]=n[1]-t[2]/200;return[Math.pow(n[0],3)>o?Math.pow(n[0],3):(116*n[0]-16)/_,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/_,Math.pow(n[2],3)>o?Math.pow(n[2],3):(116*n[2]-16)/_].map(((t,_)=>t*r[_]))} + */function Lab_to_XYZ(_){const o=24389/27,e=216/24389,n=[];n[1]=(_[0]+16)/116,n[0]=_[1]/500+n[1],n[2]=n[1]-_[2]/200;return[Math.pow(n[0],3)>e?Math.pow(n[0],3):(116*n[0]-16)/o,_[0]>8?Math.pow((_[0]+16)/116,3):_[0]/o,Math.pow(n[2],3)>e?Math.pow(n[2],3):(116*n[2]-16)/o].map(((_,o)=>_*t[o]))} /** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */function OKLCH_to_OKLab(t){return[t[0],t[1]*Math.cos(t[2]*Math.PI/180),t[1]*Math.sin(t[2]*Math.PI/180)]} +/** + * Given OKLab, convert to XYZ relative to D65 * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function LCH_to_Lab(t){return[t[0],t[1]*Math.cos(t[2]*Math.PI/180),t[1]*Math.sin(t[2]*Math.PI/180)]} + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */function OKLab_to_XYZ(t){const _=multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],t);return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],_.map((t=>t**3)))} /** * Convert an array of rec2020 RGB values in the range 0.0 - 1.0 * to linear light (un-companded) form. * ITU-R BT.2020-2 p.4 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function lin_2020(t){const _=1.09929682680944;return t.map((function(t){const o=t<0?-1:1,n=Math.abs(t);return n<.08124285829863151?t/4.5:o*Math.pow((n+_-1)/_,1/.45)}))} + */function lin_2020(t){const _=1.09929682680944;return t.map((function(t){const o=t<0?-1:1,e=Math.abs(t);return e<.08124285829863151?t/4.5:o*Math.pow((e+_-1)/_,1/.45)}))} /** * Convert an array of linear-light rec2020 values to CIE XYZ * using D65 (no chromatic adaptation) * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */function lin_2020_to_XYZ(t){return multiplyMatrices([[63426534/99577255,20160776/139408157,47086771/278816314],[26158966/99577255,.677998071518871,8267143/139408157],[0,19567812/697040785,1.0609850577107909]],t)} -/** - * Convert an array of a98-rgb values in the range 0.0 - 1.0 - * to linear light (un-companded) form. Negative values are also now accepted - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function lin_a98rgb(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return _*Math.pow(o,563/256)}))} + */ /** - * Convert an array of linear-light a98-rgb values to CIE XYZ - * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - * has greater numerical precision than section 4.3.5.3 of - * https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf - * but the values below were calculated from first principles - * from the chromaticity coordinates of R G B W + * Convert an array of of sRGB values where in-gamut values are in the range + * [0 - 1] to linear light (un-companded) form. + * Extended transfer function: + * For negative values, linear portion is extended on reflection of axis, + * then reflected power function is used. * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - * @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html - */function lin_a98rgb_to_XYZ(t){return multiplyMatrices([[573536/994567,263643/1420810,187206/994567],[591459/1989134,6239551/9945670,374412/4972835],[53769/1989134,351524/4972835,4929758/4972835]],t)} + * @see https://en.wikipedia.org/wiki/SRGB + */ +function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<=.04045?t/12.92:_*Math.pow((o+.055)/1.055,2.4)}))} /** * Convert an array of display-p3 RGB values in the range 0.0 - 1.0 * to linear light (un-companded) form. * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). */function lin_P3(t){return lin_sRGB(t)} /** @@ -249,9 +96,7 @@ function HWB_to_sRGB(t){const _=t[0];let o=t[1],n=t[2];if(o/=100,n/=100,o+n>=1){ * using D65 (no chromatic adaptation) * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html */function lin_P3_to_XYZ(t){return multiplyMatrices([[608311/1250200,189793/714400,198249/1000160],[35783/156275,247089/357200,198249/2500400],[0,32229/714400,5220557/5000800]],t)} /** @@ -260,48 +105,36 @@ function HWB_to_sRGB(t){const _=t[0];let o=t[1],n=t[2];if(o/=100,n/=100,o+n>=1){ * gamma 1.8 with a small linear portion. Extended transfer function * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function lin_ProPhoto(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<=.03125?t/16:_*Math.pow(o,1.8)}))} + */ /** - * Convert an array of linear-light prophoto-rgb values to CIE XYZ - * using D50 (so no chromatic adaptation needed afterwards) + * Convert an array of linear-light sRGB values to CIE XYZ + * using sRGB's own white, D65 (no chromatic adaptation) * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */function lin_ProPhoto_to_XYZ(t){return multiplyMatrices([[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],t)} + */ +function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/245763,12673/70218],[87098/409605,175762/245763,12673/175545],[7918/409605,87881/737289,1001167/1053270]],t)} /** - * CMYK is an array of four values in the range [0.0, 1.0] the output is an - * array of [RGB] also in the [0.0, 1.0] range because the naive algorithm - * does not generate out of gamut colors neither does it generate accurate - * simulations of practical CMYK colors + * Bradford chromatic adaptation from D50 to D65 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */function D50_to_D65(t){return multiplyMatrices([[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]],t)} /** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js - */ -function OKLab_to_OKLCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),_>=0?_:_+360]} + */function XYZ_to_lin_sRGB(t){return multiplyMatrices([[12831/3959,-329/214,-1974/3959],[-851781/878810,1648619/878810,36519/878810],[705/12673,-2585/12673,705/667]],t)} /** - * Given OKLab, convert to XYZ relative to D65 + * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form + * Extended transfer function: + * For negative values, linear portion extends on reflection + * of axis, then uses reflected pow below that * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js - */function OKLab_to_XYZ(t){const _=multiplyMatrices([[.9999999984505198,.39633779217376786,.2158037580607588],[1.0000000088817609,-.10556134232365635,-.06385417477170591],[1.0000000546724108,-.08948418209496575,-1.2914855378640917]],t);return multiplyMatrices([[1.2268798733741557,-.5578149965554813,.28139105017721583],[-.04057576262431372,1.1122868293970594,-.07171106666151701],[-.07637294974672142,-.4214933239627914,1.5869240244272418]],_.map((t=>t**3)))} + * @see https://en.wikipedia.org/wiki/SRGB + */function gam_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>.0031308?_*(1.055*Math.pow(o,1/2.4)-.055):12.92*t}))} /** * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL. * @@ -315,74 +148,71 @@ function OKLab_to_OKLCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0] * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). * * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/rgbToHsl.js - */function sRGB_to_HSL(t){const _=t[0],o=t[1],n=t[2],r=Math.max(_,o,n),e=Math.min(_,o,n),a=(e+r)/2,i=r-e;let l=NaN,u=0;if(0!==Math.round(1e5*i)){switch(u=0===Math.round(1e5*a)||1e5===Math.round(1e5*a)?0:(r-a)/Math.min(a,1-a),r){case _:l=(o-n)/i+(ot/r[_])).map((t=>t>.008856451679035631?Math.cbrt(t):(903.2962962962963*t+16)/116));return[116*_[1]-16,500*(_[0]-_[1]),200*(_[1]-_[2])]} + */function XYZ_to_lin_P3(t){return multiplyMatrices([[446124/178915,-333277/357830,-72051/178915],[-14852/17905,63121/35810,423/17905],[11844/330415,-50337/660830,316169/330415]],t)} /** - * Convert XYZ to linear-light rec2020 + * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0 + * to gamma corrected form * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function XYZ_to_lin_2020(t){return multiplyMatrices([[30757411/17917100,-6372589/17917100,-4539589/17917100],[-.666684351832489,1.616481236634939,467509/29648200],[792561/44930125,-1921689/44930125,.942103121235474]],t)} + */function gam_P3(t){return gam_sRGB(t)} /** - * Convert XYZ to linear-light a98-rgb + * Assuming XYZ is relative to D50, convert to CIE Lab + * from CIE standard, which now defines these as a rational fraction * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function XYZ_to_lin_a98rgb(t){return multiplyMatrices([[1829569/896150,-506331/896150,-308931/896150],[-851781/878810,1648619/878810,36519/878810],[16779/1248040,-147721/1248040,1266979/1248040]],t)} + */function XYZ_to_Lab(_){const o=_.map(((_,o)=>_/t[o])).map((t=>t>.008856451679035631?Math.cbrt(t):(903.2962962962963*t+16)/116));return[116*o[1]-16,500*(o[0]-o[1]),200*(o[1]-o[2])]} /** - * Convert XYZ to linear-light P3 - * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function XYZ_to_lin_P3(t){return multiplyMatrices([[446124/178915,-333277/357830,-72051/178915],[-14852/17905,63121/35810,423/17905],[11844/330415,-50337/660830,316169/330415]],t)} -/** - * Convert XYZ to linear-light prophoto-rgb * + * XYZ <-> LMS matrices recalculated for consistent reference white + * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484 + */function XYZ_to_OKLab(t){const _=multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],t);return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],_.map((t=>Math.cbrt(t))))} +/** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */function XYZ_to_lin_ProPhoto(t){return multiplyMatrices([[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]],t)} + */function Lab_to_LCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),_>=0?_:_+360]} /** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function XYZ_to_lin_sRGB(t){return multiplyMatrices([[12831/3959,-329/214,-1974/3959],[-851781/878810,1648619/878810,36519/878810],[705/12673,-2585/12673,705/667]],t)} + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */function OKLab_to_OKLCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),_>=0?_:_+360]} /** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * Convert XYZ to linear-light a98-rgb * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * XYZ <-> LMS matrices recalculated for consistent reference white - * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484 - */function XYZ_to_OKLab(t){const _=multiplyMatrices([[.8190224432164319,.3619062562801221,-.12887378261216414],[.0329836671980271,.9292868468965546,.03614466816999844],[.048177199566046255,.26423952494422764,.6335478258136937]],t);return multiplyMatrices([[.2104542553,.793617785,-.0040720468],[1.9779984951,-2.428592205,.4505937099],[.0259040371,.7827717662,-.808675766]],_.map((t=>Math.cbrt(t))))} + */ /** - * Convert an array of three XYZ values to u*,v* chromaticity coordinates + * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0 + * to gamma corrected form ITU-R BT.2020-2 p.4 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */var e=Object.freeze({__proto__:null,D50:r,D50_to_D65:D50_to_D65,D65:[.3127/.329,1,.3583/.329],D65_to_D50:D65_to_D50,HSL_to_sRGB:HSL_to_sRGB,HWB_to_sRGB:HWB_to_sRGB,LCH_to_Lab:LCH_to_Lab,Lab_to_LCH:Lab_to_LCH,Lab_to_XYZ:Lab_to_XYZ,OKLCH_to_OKLab:OKLCH_to_OKLab,OKLab_to_OKLCH:OKLab_to_OKLCH,OKLab_to_XYZ:OKLab_to_XYZ,XYZ_to_Lab:XYZ_to_Lab,XYZ_to_OKLab:XYZ_to_OKLab,XYZ_to_lin_2020:XYZ_to_lin_2020,XYZ_to_lin_P3:XYZ_to_lin_P3,XYZ_to_lin_ProPhoto:XYZ_to_lin_ProPhoto,XYZ_to_lin_a98rgb:XYZ_to_lin_a98rgb,XYZ_to_lin_sRGB:XYZ_to_lin_sRGB,XYZ_to_uv:function XYZ_to_uv(t){const _=t[0],o=t[1],n=_+15*o+3*t[2];return[4*_/n,9*o/n]} + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ +function gam_2020(t){const _=1.09929682680944;return t.map((function(t){const o=t<0?-1:1,e=Math.abs(t);return e>.018053968510807?o*(_*Math.pow(e,.45)-(_-1)):4.5*t}))} /** - * Convert an array of three XYZ values to x,y chromaticity coordinates + * Convert XYZ to linear-light prophoto-rgb * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + */function inGamut(t){const[_,o,e]=t;return _>=-1e-4&&_<=1.0001&&o>=-1e-4&&o<=1.0001&&e>=-1e-4&&e<=1.0001}function clip(t){return t.map((t=>t<0?0:t>1?1:t))} +/** + * @description Calculate deltaE OK which is the simple root sum of squares + * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1 + * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1 + * @return {number} How different a color sample is from reference * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */,XYZ_to_xy:function XYZ_to_xy(t){const _=t[0],o=t[1],n=_+o+t[2];return[_/n,o/n]},gam_2020:gam_2020,gam_P3:gam_P3,gam_ProPhoto:gam_ProPhoto,gam_a98rgb:gam_a98rgb,gam_sRGB:gam_sRGB,hueToRGB:function hueToRGB(t,_,o){return o<0&&(o+=6),o>=6&&(o-=6),o<1?(_-t)*o+t:o<3?_:o<4?(_-t)*(4-o)+t:t},lin_2020:lin_2020,lin_2020_to_XYZ:lin_2020_to_XYZ,lin_P3:lin_P3,lin_P3_to_XYZ:lin_P3_to_XYZ,lin_ProPhoto:lin_ProPhoto,lin_ProPhoto_to_XYZ:lin_ProPhoto_to_XYZ,lin_a98rgb:lin_a98rgb,lin_a98rgb_to_XYZ:lin_a98rgb_to_XYZ,lin_sRGB:lin_sRGB,lin_sRGB_to_XYZ:lin_sRGB_to_XYZ,naive_CMYK_to_sRGB:function naive_CMYK_to_sRGB(t){const _=t[0],o=t[1],n=t[2],r=t[3];return[1-Math.min(1,_*(1-r)+r),1-Math.min(1,o*(1-r)+r),1-Math.min(1,n*(1-r)+r)]},sRGB_to_HSL:sRGB_to_HSL,sRGB_to_HWB:function sRGB_to_HWB(t){const _=sRGB_to_HSL(t),o=Math.min(t[0],t[1],t[2]),n=1-Math.max(t[0],t[1],t[2]);return[_[0],100*o,100*n]},sRGB_to_luminance:sRGB_to_luminance});var a=Object.freeze({__proto__:null,HSL_to_XYZ_D50:function HSL_to_XYZ_D50(t){let _=t;return _=HSL_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},HWB_to_XYZ_D50:function HWB_to_XYZ_D50(t){let _=t;return _=HWB_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},LCH_to_XYZ_D50:function LCH_to_XYZ_D50(t){let _=t;return _=LCH_to_Lab(_),_=Lab_to_XYZ(_),_},Lab_to_XYZ_D50:function Lab_to_XYZ_D50(t){let _=t;return _=Lab_to_XYZ(_),_},OKLCH_to_XYZ_D50:function OKLCH_to_XYZ_D50(t){let _=t;return _=OKLCH_to_OKLab(_),_=OKLab_to_XYZ(_),_=D65_to_D50(_),_},OKLab_to_XYZ_D50:function OKLab_to_XYZ_D50(t){let _=t;return _=OKLab_to_XYZ(_),_=D65_to_D50(_),_},P3_to_XYZ_D50:function P3_to_XYZ_D50(t){let _=t;return _=lin_P3(_),_=lin_P3_to_XYZ(_),_=D65_to_D50(_),_},ProPhoto_RGB_to_XYZ_D50:function ProPhoto_RGB_to_XYZ_D50(t){let _=t;return _=lin_ProPhoto(_),_=lin_ProPhoto_to_XYZ(_),_},XYZ_D50_to_HSL:function XYZ_D50_to_HSL(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_=sRGB_to_HSL(_),_},XYZ_D50_to_HWB:function XYZ_D50_to_HWB(t){let _=t;_=D50_to_D65(_),_=XYZ_to_lin_sRGB(_);const o=gam_sRGB(_);_=sRGB_to_HSL(o);const n=Math.min(o[0],o[1],o[2]),r=1-Math.max(o[0],o[1],o[2]);return[_[0],100*n,100*r]},XYZ_D50_to_LCH:function XYZ_D50_to_LCH(t){let _=t;return _=XYZ_to_Lab(_),_=Lab_to_LCH(_),_},XYZ_D50_to_Lab:function XYZ_D50_to_Lab(t){let _=t;return _=XYZ_to_Lab(_),_},XYZ_D50_to_OKLCH:function XYZ_D50_to_OKLCH(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_=OKLab_to_OKLCH(_),_},XYZ_D50_to_OKLab:function XYZ_D50_to_OKLab(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_},XYZ_D50_to_P3:function XYZ_D50_to_P3(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_P3(_),_=gam_P3(_),_},XYZ_D50_to_ProPhoto:function XYZ_D50_to_ProPhoto(t){let _=t;return _=XYZ_to_lin_ProPhoto(_),_=gam_ProPhoto(_),_},XYZ_D50_to_XYZ_D50:function XYZ_D50_to_XYZ_D50(t){return t},XYZ_D50_to_XYZ_D65:function XYZ_D50_to_XYZ_D65(t){let _=t;return _=D50_to_D65(_),_},XYZ_D50_to_a98_RGB:function XYZ_D50_to_a98_RGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_a98rgb(_),_=gam_a98rgb(_),_},XYZ_D50_to_lin_sRGB:function XYZ_D50_to_lin_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_},XYZ_D50_to_rec_2020:function XYZ_D50_to_rec_2020(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_2020(_),_=gam_2020(_),_},XYZ_D50_to_sRGB:function XYZ_D50_to_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_},XYZ_D65_to_XYZ_D50:function XYZ_D65_to_XYZ_D50(t){let _=t;return _=D65_to_D50(_),_},a98_RGB_to_XYZ_D50:function a98_RGB_to_XYZ_D50(t){let _=t;return _=lin_a98rgb(_),_=lin_a98rgb_to_XYZ(_),_=D65_to_D50(_),_},lin_sRGB_to_XYZ_D50:function lin_sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},rec_2020_to_XYZ_D50:function rec_2020_to_XYZ_D50(t){let _=t;return _=lin_2020(_),_=lin_2020_to_XYZ(_),_=D65_to_D50(_),_},sRGB_to_XYZ_D50:function sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}});exports.calculations=n,exports.conversions=e,exports.namedColors={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},exports.utils=t,exports.xyz=a; + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js + */function deltaEOK(t,_){const[o,e,n]=t,[r,a,i]=_,l=o-r,u=e-a,s=n-i;return Math.sqrt(l**2+u**2+s**2)}const _=.02,o=1e-5;function binarySearchGamut(t,e,n){const r=t;let a=0,i=r[1];for(;i-a>o;){const t=(a+i)/2;r[1]=t;const o=e(r);if(inGamut(o)){a=t;continue}const l=clip(o);if(deltaEOK(OKLCH_to_OKLab(n(l)),OKLCH_to_OKLab(r))<_)return l;i=t}return clip(e([...r]))}exports.HSL_to_XYZ_D50=function HSL_to_XYZ_D50(t){let _=t;return _=HSL_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},exports.HWB_to_XYZ_D50=function HWB_to_XYZ_D50(t){let _=t;return _=HWB_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},exports.LCH_to_XYZ_D50=function LCH_to_XYZ_D50(t){let _=t;var o;return _=[(o=_)[0],o[1]*Math.cos(o[2]*Math.PI/180),o[1]*Math.sin(o[2]*Math.PI/180)],_=Lab_to_XYZ(_),_},exports.Lab_to_XYZ_D50=function Lab_to_XYZ_D50(t){let _=t;return _=Lab_to_XYZ(_),_},exports.OKLCH_to_OKLab=OKLCH_to_OKLab,exports.OKLCH_to_XYZ_D50=function OKLCH_to_XYZ_D50(t){let _=t;return _=OKLCH_to_OKLab(_),_=OKLab_to_XYZ(_),_=D65_to_D50(_),_},exports.OKLab_to_OKLCH=OKLab_to_OKLCH,exports.OKLab_to_XYZ=OKLab_to_XYZ,exports.OKLab_to_XYZ_D50=function OKLab_to_XYZ_D50(t){let _=t;return _=OKLab_to_XYZ(_),_=D65_to_D50(_),_},exports.P3_to_XYZ_D50=function P3_to_XYZ_D50(t){let _=t;return _=lin_P3(_),_=lin_P3_to_XYZ(_),_=D65_to_D50(_),_},exports.ProPhoto_RGB_to_XYZ_D50=function ProPhoto_RGB_to_XYZ_D50(t){let _=t;return _=_.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<=.03125?t/16:_*Math.pow(o,1.8)})),_=multiplyMatrices([[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],_),_},exports.XYZ_D50_to_HSL=function XYZ_D50_to_HSL(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_=sRGB_to_HSL(_),_},exports.XYZ_D50_to_HWB=function XYZ_D50_to_HWB(t){let _=t;_=D50_to_D65(_),_=XYZ_to_lin_sRGB(_);const o=gam_sRGB(_);_=sRGB_to_HSL(o);const e=Math.min(o[0],o[1],o[2]),n=1-Math.max(o[0],o[1],o[2]);return[_[0],100*e,100*n]},exports.XYZ_D50_to_LCH=function XYZ_D50_to_LCH(t){let _=t;return _=XYZ_to_Lab(_),_=Lab_to_LCH(_),_},exports.XYZ_D50_to_Lab=function XYZ_D50_to_Lab(t){let _=t;return _=XYZ_to_Lab(_),_},exports.XYZ_D50_to_OKLCH=function XYZ_D50_to_OKLCH(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_=OKLab_to_OKLCH(_),_},exports.XYZ_D50_to_OKLab=function XYZ_D50_to_OKLab(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_},exports.XYZ_D50_to_P3=function XYZ_D50_to_P3(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_P3(_),_=gam_P3(_),_},exports.XYZ_D50_to_ProPhoto=function XYZ_D50_to_ProPhoto(t){let _=t;return _=multiplyMatrices([[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]],_),_=_.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>=.001953125?_*Math.pow(o,1/1.8):16*t})),_},exports.XYZ_D50_to_XYZ_D50=function XYZ_D50_to_XYZ_D50(t){return t},exports.XYZ_D50_to_XYZ_D65=function XYZ_D50_to_XYZ_D65(t){let _=t;return _=D50_to_D65(_),_},exports.XYZ_D50_to_a98_RGB=function XYZ_D50_to_a98_RGB(t){let _=t;return _=D50_to_D65(_),_=multiplyMatrices([[1829569/896150,-506331/896150,-308931/896150],[-851781/878810,1648619/878810,36519/878810],[16779/1248040,-147721/1248040,1266979/1248040]],_),_=_.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return _*Math.pow(o,256/563)})),_},exports.XYZ_D50_to_lin_sRGB=function XYZ_D50_to_lin_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_},exports.XYZ_D50_to_rec_2020=function XYZ_D50_to_rec_2020(t){let _=t;return _=D50_to_D65(_),_=multiplyMatrices([[30757411/17917100,-6372589/17917100,-4539589/17917100],[-.666684351832489,1.616481236634939,467509/29648200],[792561/44930125,-1921689/44930125,.942103121235474]],_),_=gam_2020(_),_},exports.XYZ_D50_to_sRGB=function XYZ_D50_to_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_},exports.XYZ_D65_to_XYZ_D50=function XYZ_D65_to_XYZ_D50(t){let _=t;return _=D65_to_D50(_),_},exports.XYZ_to_OKLab=XYZ_to_OKLab,exports.XYZ_to_lin_P3=XYZ_to_lin_P3,exports.XYZ_to_lin_sRGB=XYZ_to_lin_sRGB,exports.a98_RGB_to_XYZ_D50=function a98_RGB_to_XYZ_D50(t){let _=t;return _=_.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return _*Math.pow(o,563/256)})),_=multiplyMatrices([[573536/994567,263643/1420810,187206/994567],[591459/1989134,6239551/9945670,374412/4972835],[53769/1989134,351524/4972835,4929758/4972835]],_),_=D65_to_D50(_),_},exports.clip=clip,exports.gam_P3=gam_P3,exports.gam_sRGB=gam_sRGB,exports.inGamut=inGamut,exports.lin_P3=lin_P3,exports.lin_P3_to_XYZ=lin_P3_to_XYZ,exports.lin_sRGB=lin_sRGB,exports.lin_sRGB_to_XYZ=lin_sRGB_to_XYZ,exports.lin_sRGB_to_XYZ_D50=function lin_sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},exports.mapGamut=function mapGamut(t,_,o){return binarySearchGamut(t,_,o)},exports.namedColors={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},exports.rec_2020_to_XYZ_D50=function rec_2020_to_XYZ_D50(t){let _=t;return _=lin_2020(_),_=multiplyMatrices([[63426534/99577255,20160776/139408157,47086771/278816314],[26158966/99577255,.677998071518871,8267143/139408157],[0,19567812/697040785,1.0609850577107909]],_),_=D65_to_D50(_),_},exports.sRGB_to_XYZ_D50=function sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}; diff --git a/node_modules/@csstools/color-helpers/dist/index.d.ts b/node_modules/@csstools/color-helpers/dist/index.d.ts index 15af8c66..5b4405bd 100644 --- a/node_modules/@csstools/color-helpers/dist/index.d.ts +++ b/node_modules/@csstools/color-helpers/dist/index.d.ts @@ -1,6 +1,398 @@ -export * as calculations from './calculations'; -export * as conversions from './conversions'; -export * as utils from './utils'; -export * as xyz from './conversions/xyz'; -export type { Color } from './types/color'; -export { namedColors } from './named-colors'; +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function a98_RGB_to_XYZ_D50(x: Color): Color; + +export declare function clip(color: Color): Color; + +export declare type Color = [number, number, number]; + +/** + * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0 + * to gamma corrected form + * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ +export declare function gam_P3(RGB: Color): Color; + +/** + * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form + * Extended transfer function: + * For negative values, linear portion extends on reflection + * of axis, then uses reflected pow below that + * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://en.wikipedia.org/wiki/SRGB + */ +export declare function gam_sRGB(RGB: Color): Color; + +/** + * @param {Color} color [h, s, l] + * - Hue as degrees 0..360; + * - Saturation as number 0..100; + * - Lightness as number 0..100; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function HSL_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [h, w, b] + * - Hue as degrees 0..360; + * - Whiteness as number 0..100; + * - Blackness as number 0..100; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function HWB_to_XYZ_D50(x: Color): Color; + +export declare function inGamut(x: Color): boolean; + +/** + * @param {Color} color [l, a, b] + * - Lightness as number 0..100; + * - a as number -160..160; + * - b as number -160..160; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function Lab_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [l, c, h] + * - Lightness as number 0..100; + * - Chroma as number 0..230; + * - Hue as degrees 0..360; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function LCH_to_XYZ_D50(x: Color): Color; + +/** + * Convert an array of display-p3 RGB values in the range 0.0 - 1.0 + * to linear light (un-companded) form. + * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ +export declare function lin_P3(RGB: Color): Color; + +/** + * Convert an array of linear-light display-p3 values to CIE XYZ + * using D65 (no chromatic adaptation) + * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + */ +export declare function lin_P3_to_XYZ(rgb: Color): Color; + +/** + * Convert an array of of sRGB values where in-gamut values are in the range + * [0 - 1] to linear light (un-companded) form. + * Extended transfer function: + * For negative values, linear portion is extended on reflection of axis, + * then reflected power function is used. + * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://en.wikipedia.org/wiki/SRGB + */ +export declare function lin_sRGB(RGB: Color): Color; + +/** + * Convert an array of linear-light sRGB values to CIE XYZ + * using sRGB's own white, D65 (no chromatic adaptation) + * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ +export declare function lin_sRGB_to_XYZ(rgb: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function lin_sRGB_to_XYZ_D50(x: Color): Color; + +export declare function mapGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color; + +export declare const namedColors: Record; + +/** + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */ +export declare function OKLab_to_OKLCH(OKLab: Color): Color; + +/** + * Given OKLab, convert to XYZ relative to D65 + * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */ +export declare function OKLab_to_XYZ(OKLab: Color): Color; + +/** + * @param {Color} color [l, a, b] + * - Lightness as number 0..1; + * - a as number 0..0.5; + * - b as number 0..0.5; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function OKLab_to_XYZ_D50(x: Color): Color; + +/** + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */ +export declare function OKLCH_to_OKLab(OKLCH: Color): Color; + +/** + * @param {Color} color [l, c, h] + * - Lightness as number 0..1; + * - Chroma as number 0..0.5; + * - Hue as degrees 0..360; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function OKLCH_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function P3_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function ProPhoto_RGB_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function rec_2020_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function sRGB_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} a98 sRGB [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_a98_RGB(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} HSL [r, g, b] + * - Hue as degrees 0..360; + * - Saturation as number 0..100; + * - Lightness as number 0..100; + */ +export declare function XYZ_D50_to_HSL(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} HWB [r, g, b] + * - Hue as degrees 0..360; + * - Whiteness as number 0..100; + * - Blackness as number 0..100; + */ +export declare function XYZ_D50_to_HWB(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} Lab [r, g, b] + * - Lightness as number 0..100; + * - a as number -160..160; + * - b as number -160..160; + */ +export declare function XYZ_D50_to_Lab(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} LCH [r, g, b] + * - Lightness as number 0..100; + * - Chroma as number 0..230; + * - Hue as degrees 0..360; + */ +export declare function XYZ_D50_to_LCH(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} linear sRGB [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_lin_sRGB(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} OKLab [r, g, b] + * - Lightness as number 0..1; + * - a as number 0..0.5; + * - b as number 0..0.5; + */ +export declare function XYZ_D50_to_OKLab(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} OKLCH [r, g, b] + * - Lightness as number 0..1; + * - Chroma as number 0..0.5; + * - Hue as degrees 0..360; + */ +export declare function XYZ_D50_to_OKLCH(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} P3 [r, g, b] + * - R as number 0..1; + * - G as number 0..1; + * - B as number 0..1; + */ +export declare function XYZ_D50_to_P3(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} ProPhoto [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_ProPhoto(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} rec 2020 [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_rec_2020(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} sRGB [r, g, b] + * - Red as number 0..1; + * - Green as number 0..1; + * - Blue as number 0..1; + */ +export declare function XYZ_D50_to_sRGB(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function XYZ_D50_to_XYZ_D50(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} D65 XYZ [x, y, z] + */ +export declare function XYZ_D50_to_XYZ_D65(x: Color): Color; + +/** + * @param {Color} color [x, y, z] + * - X as number 0..1; + * - Y as number 0..1; + * - Z as number 0..1; + * @return {Color} D50 XYZ [x, y, z] + */ +export declare function XYZ_D65_to_XYZ_D50(x: Color): Color; + +/** + * Convert XYZ to linear-light P3 + * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ +export declare function XYZ_to_lin_P3(XYZ: Color): Color; + +/** + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ +export declare function XYZ_to_lin_sRGB(XYZ: Color): Color; + +/** + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * + * XYZ <-> LMS matrices recalculated for consistent reference white + * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484 + */ +export declare function XYZ_to_OKLab(XYZ: Color): Color; + +export { } diff --git a/node_modules/@csstools/color-helpers/dist/index.mjs b/node_modules/@csstools/color-helpers/dist/index.mjs index 9a1bb789..0971c853 100644 --- a/node_modules/@csstools/color-helpers/dist/index.mjs +++ b/node_modules/@csstools/color-helpers/dist/index.mjs @@ -1,148 +1,19 @@ -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -function clip(t){return t.map((t=>t<0?0:t>1?1:t))} -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js - */function OKLCH_to_OKLab(t){return[t[0],t[1]*Math.cos(t[2]*Math.PI/180),t[1]*Math.sin(t[2]*Math.PI/180)]} -/** - * @description Calculate deltaE OK which is the simple root sum of squares - * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1 - * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1 - * @return {number} How different a color sample is from reference - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js - */function deltaEOK(t,_){const[o,n,r]=t,[e,a,i]=_,l=o-e,u=n-a,c=r-i;return Math.sqrt(l**2+u**2+c**2)} -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function inGamut(t){const[_,o,n]=t;return _>=-1e-4&&_<=1.0001&&o>=-1e-4&&o<=1.0001&&n>=-1e-4&&n<=1.0001}var t=Object.freeze({__proto__:null,clip:clip,inGamut:inGamut});const _=.02,o=1e-5;function binarySearchGamut(t,n,r){const e=t;let a=0,i=e[1];for(;i-a>o;){const t=(a+i)/2;e[1]=t;const o=n(e);if(inGamut(o)){a=t;continue}const l=clip(o);if(deltaEOK(OKLCH_to_OKLab(r(l)),OKLCH_to_OKLab(e))<_)return l;i=t}return clip(n([...e]))} -/** - * Convert an array of of sRGB values where in-gamut values are in the range - * [0 - 1] to linear light (un-companded) form. - * Extended transfer function: - * For negative values, linear portion is extended on reflection of axis, - * then reflected power function is used. - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://en.wikipedia.org/wiki/SRGB - */ -function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<.04045?t/12.92:_*Math.pow((o+.055)/1.055,2.4)}))} /** * Simple matrix (and vector) multiplication * Warning: No error handling for incompatible dimensions! * @author Lea Verou 2020 MIT License * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/multiply-matrices.js - */function multiplyMatrices(t,_){const o=t.length;let n,r;n=Array.isArray(t[0])?t:[t],r=Array.isArray(_[0])?_:_.map((t=>[t]));const e=r[0].length,a=r[0].map(((t,_)=>r.map((t=>t[_]))));let i=n.map((t=>a.map((_=>Array.isArray(t)?t.reduce(((t,o,n)=>t+o*(_[n]||0)),0):_.reduce(((_,o)=>_+o*t),0)))));return 1===o&&(i=i[0]),1===e?i.map((t=>t[0])):i} -/** - * Convert an array of linear-light sRGB values to CIE XYZ - * using sRGB's own white, D65 (no chromatic adaptation) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/245763,12673/70218],[87098/409605,175762/245763,12673/175545],[7918/409605,87881/737289,1001167/1053270]],t)} -/** - * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range - * to linear-light sRGB, then to CIE XYZ and return luminance (the Y value) - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */function sRGB_to_luminance(t){return lin_sRGB_to_XYZ(lin_sRGB(t))[1]} -/** - * Return WCAG 2.1 contrast ratio for two sRGB values given as arrays - * - * of 0.0 to 1.0 - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - * @see https://www.w3.org/TR/WCAG21/#dfn-contrast-ratio - */var n=Object.freeze({__proto__:null,binarySearchGamut:binarySearchGamut,contrast:function contrast(t,_){const o=sRGB_to_luminance(t),n=sRGB_to_luminance(_);return o>n?(o+.05)/(n+.05):(n+.05)/(o+.05)},deltaEOK:deltaEOK,mapGamut:function mapGamut(t,_,o){return binarySearchGamut(t,_,o)},multiplyMatrices:multiplyMatrices});const r=[.3457/.3585,1,.2958/.3585]; -/** - * Bradford chromatic adaptation from D50 to D65 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). */ -function D50_to_D65(t){return multiplyMatrices([[.9554734527042182,-.023098536874261423,.0632593086610217],[-.028369706963208136,1.0099954580058226,.021041398966943008],[.012314001688319899,-.020507696433477912,1.3303659366080753]],t)} +function multiplyMatrices(t,_){const n=t.length;let o,e;o=Array.isArray(t[0])?t:[t],e=Array.isArray(_[0])?_:_.map((t=>[t]));const r=e[0].length,a=e[0].map(((t,_)=>e.map((t=>t[_]))));let i=o.map((t=>a.map((_=>Array.isArray(t)?t.reduce(((t,n,o)=>t+n*(_[o]||0)),0):_.reduce(((_,n)=>_+n*t),0)))));return 1===n&&(i=i[0]),1===r?i.map((t=>t[0])):i} /** * Bradford chromatic adaptation from D65 to D50 * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html - */function D65_to_D50(t){return multiplyMatrices([[1.0479298208405488,.022946793341019088,-.05019222954313557],[.029627815688159344,.990434484573249,-.01707382502938514],[-.009243058152591178,.015055144896577895,.7518742899580008]],t)} -/** - * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0 - * to gamma corrected form ITU-R BT.2020-2 p.4 - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function gam_2020(t){const _=1.09929682680944;return t.map((function(t){const o=t<0?-1:1,n=Math.abs(t);return n>.018053968510807?o*(_*Math.pow(n,.45)-(_-1)):4.5*t}))} -/** - * Convert an array of linear-light a98-rgb in the range 0.0-1.0 - * to gamma corrected form. Negative values are also now accepted - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function gam_a98rgb(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return _*Math.pow(o,256/563)}))} -/** - * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form - * Extended transfer function: - * For negative values, linear portion extends on reflection - * of axis, then uses reflected pow below that - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://en.wikipedia.org/wiki/SRGB - */function gam_sRGB(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>.0031308?_*(1.055*Math.pow(o,1/2.4)-.055):12.92*t}))} -/** - * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0 - * to gamma corrected form - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function gam_P3(t){return gam_sRGB(t)} -/** - * Convert an array of linear-light prophoto-rgb in the range 0.0-1.0 - * to gamma corrected form. - * Transfer curve is gamma 1.8 with a small linear portion. - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function gam_ProPhoto(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o>=.001953125?_*Math.pow(o,1/1.8):16*t}))} + */function D65_to_D50(t){return multiplyMatrices([[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]],t)} /** * @param {number} hue - Hue as degrees 0..360 * @param {number} sat - Saturation as percentage 0..100 @@ -150,18 +21,9 @@ function D50_to_D65(t){return multiplyMatrices([[.9554734527042182,-.02309853687 * @return {number[]} Array of RGB components 0..1 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hslToRgb.js - */function HSL_to_sRGB(t){let _=t[0],o=t[1],n=t[2];function f(t){const r=(t+_/30)%12,e=o*Math.min(n,1-n);return n-e*Math.max(-1,Math.min(r-3,9-r,1))}return _%=360,_<0&&(_+=360),o/=100,n/=100,[f(0),f(8),f(4)]} -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ + */function HSL_to_sRGB(t){let _=t[0],n=t[1],o=t[2];function f(t){const e=(t+_/30)%12,r=n*Math.min(o,1-o);return o-r*Math.max(-1,Math.min(e-3,9-e,1))}return _%=360,_<0&&(_+=360),n/=100,o/=100,[f(0),f(8),f(4)]} /** * @param {number} hue - Hue as degrees 0..360 * @param {number} white - Whiteness as percentage 0..100 @@ -169,79 +31,64 @@ function D50_to_D65(t){return multiplyMatrices([[.9554734527042182,-.02309853687 * @return {number[]} Array of RGB components 0..1 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/hwbToRgb.js - */ -function HWB_to_sRGB(t){const _=t[0];let o=t[1],n=t[2];if(o/=100,n/=100,o+n>=1){const t=o/(o+n);return[t,t,t]}const r=HSL_to_sRGB([_,100,50]);for(let t=0;t<3;t++)r[t]*=1-o-n,r[t]+=o;return r} + */function HWB_to_sRGB(t){const _=t[0];let n=t[1],o=t[2];if(n/=100,o/=100,n+o>=1){const t=n/(n+o);return[t,t,t]}const e=HSL_to_sRGB([_,100,50]);for(let t=0;t<3;t++)e[t]*=1-n-o,e[t]+=n;return e} /** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function Lab_to_LCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),_>=0?_:_+360]} + */const t=[.3457/.3585,1,.2958/.3585]; /** * Convert Lab to D50-adapted XYZ * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */function Lab_to_XYZ(t){const _=24389/27,o=216/24389,n=[];n[1]=(t[0]+16)/116,n[0]=t[1]/500+n[1],n[2]=n[1]-t[2]/200;return[Math.pow(n[0],3)>o?Math.pow(n[0],3):(116*n[0]-16)/_,t[0]>8?Math.pow((t[0]+16)/116,3):t[0]/_,Math.pow(n[2],3)>o?Math.pow(n[2],3):(116*n[2]-16)/_].map(((t,_)=>t*r[_]))} + */function Lab_to_XYZ(_){const n=24389/27,o=216/24389,e=[];e[1]=(_[0]+16)/116,e[0]=_[1]/500+e[1],e[2]=e[1]-_[2]/200;return[Math.pow(e[0],3)>o?Math.pow(e[0],3):(116*e[0]-16)/n,_[0]>8?Math.pow((_[0]+16)/116,3):_[0]/n,Math.pow(e[2],3)>o?Math.pow(e[2],3):(116*e[2]-16)/n].map(((_,n)=>_*t[n]))} /** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */function OKLCH_to_OKLab(t){return[t[0],t[1]*Math.cos(t[2]*Math.PI/180),t[1]*Math.sin(t[2]*Math.PI/180)]} +/** + * Given OKLab, convert to XYZ relative to D65 * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function LCH_to_Lab(t){return[t[0],t[1]*Math.cos(t[2]*Math.PI/180),t[1]*Math.sin(t[2]*Math.PI/180)]} + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */function OKLab_to_XYZ(t){const _=multiplyMatrices([[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],t);return multiplyMatrices([[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],_.map((t=>t**3)))} /** * Convert an array of rec2020 RGB values in the range 0.0 - 1.0 * to linear light (un-companded) form. * ITU-R BT.2020-2 p.4 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function lin_2020(t){const _=1.09929682680944;return t.map((function(t){const o=t<0?-1:1,n=Math.abs(t);return n<.08124285829863151?t/4.5:o*Math.pow((n+_-1)/_,1/.45)}))} + */function lin_2020(t){const _=1.09929682680944;return t.map((function(t){const n=t<0?-1:1,o=Math.abs(t);return o<.08124285829863151?t/4.5:n*Math.pow((o+_-1)/_,1/.45)}))} /** * Convert an array of linear-light rec2020 values to CIE XYZ * using D65 (no chromatic adaptation) * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */function lin_2020_to_XYZ(t){return multiplyMatrices([[63426534/99577255,20160776/139408157,47086771/278816314],[26158966/99577255,.677998071518871,8267143/139408157],[0,19567812/697040785,1.0609850577107909]],t)} -/** - * Convert an array of a98-rgb values in the range 0.0 - 1.0 - * to linear light (un-companded) form. Negative values are also now accepted - * - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function lin_a98rgb(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return _*Math.pow(o,563/256)}))} + */ /** - * Convert an array of linear-light a98-rgb values to CIE XYZ - * http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - * has greater numerical precision than section 4.3.5.3 of - * https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf - * but the values below were calculated from first principles - * from the chromaticity coordinates of R G B W + * Convert an array of of sRGB values where in-gamut values are in the range + * [0 - 1] to linear light (un-companded) form. + * Extended transfer function: + * For negative values, linear portion is extended on reflection of axis, + * then reflected power function is used. * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - * @see https://www.adobe.com/digitalimag/pdfs/AdobeRGB1998.pdf - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/matrixmaker.html - */function lin_a98rgb_to_XYZ(t){return multiplyMatrices([[573536/994567,263643/1420810,187206/994567],[591459/1989134,6239551/9945670,374412/4972835],[53769/1989134,351524/4972835,4929758/4972835]],t)} + * @see https://en.wikipedia.org/wiki/SRGB + */ +function lin_sRGB(t){return t.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n<=.04045?t/12.92:_*Math.pow((n+.055)/1.055,2.4)}))} /** * Convert an array of display-p3 RGB values in the range 0.0 - 1.0 * to linear light (un-companded) form. * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). */function lin_P3(t){return lin_sRGB(t)} /** @@ -249,9 +96,7 @@ function HWB_to_sRGB(t){const _=t[0];let o=t[1],n=t[2];if(o/=100,n/=100,o+n>=1){ * using D65 (no chromatic adaptation) * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html */function lin_P3_to_XYZ(t){return multiplyMatrices([[608311/1250200,189793/714400,198249/1000160],[35783/156275,247089/357200,198249/2500400],[0,32229/714400,5220557/5000800]],t)} /** @@ -260,48 +105,36 @@ function HWB_to_sRGB(t){const _=t[0];let o=t[1],n=t[2];if(o/=100,n/=100,o+n>=1){ * gamma 1.8 with a small linear portion. Extended transfer function * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function lin_ProPhoto(t){return t.map((function(t){const _=t<0?-1:1,o=Math.abs(t);return o<=.03125?t/16:_*Math.pow(o,1.8)}))} + */ /** - * Convert an array of linear-light prophoto-rgb values to CIE XYZ - * using D50 (so no chromatic adaptation needed afterwards) + * Convert an array of linear-light sRGB values to CIE XYZ + * using sRGB's own white, D65 (no chromatic adaptation) * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */function lin_ProPhoto_to_XYZ(t){return multiplyMatrices([[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],t)} + */ +function lin_sRGB_to_XYZ(t){return multiplyMatrices([[506752/1228815,87881/245763,12673/70218],[87098/409605,175762/245763,12673/175545],[7918/409605,87881/737289,1001167/1053270]],t)} /** - * CMYK is an array of four values in the range [0.0, 1.0] the output is an - * array of [RGB] also in the [0.0, 1.0] range because the naive algorithm - * does not generate out of gamut colors neither does it generate accurate - * simulations of practical CMYK colors + * Bradford chromatic adaptation from D50 to D65 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */ + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */function D50_to_D65(t){return multiplyMatrices([[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]],t)} /** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js - */ -function OKLab_to_OKLCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),_>=0?_:_+360]} + */function XYZ_to_lin_sRGB(t){return multiplyMatrices([[12831/3959,-329/214,-1974/3959],[-851781/878810,1648619/878810,36519/878810],[705/12673,-2585/12673,705/667]],t)} /** - * Given OKLab, convert to XYZ relative to D65 + * Convert an array of linear-light sRGB values in the range 0.0-1.0 to gamma corrected form + * Extended transfer function: + * For negative values, linear portion extends on reflection + * of axis, then uses reflected pow below that * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js - */function OKLab_to_XYZ(t){const _=multiplyMatrices([[.9999999984505198,.39633779217376786,.2158037580607588],[1.0000000088817609,-.10556134232365635,-.06385417477170591],[1.0000000546724108,-.08948418209496575,-1.2914855378640917]],t);return multiplyMatrices([[1.2268798733741557,-.5578149965554813,.28139105017721583],[-.04057576262431372,1.1122868293970594,-.07171106666151701],[-.07637294974672142,-.4214933239627914,1.5869240244272418]],_.map((t=>t**3)))} + * @see https://en.wikipedia.org/wiki/SRGB + */function gam_sRGB(t){return t.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n>.0031308?_*(1.055*Math.pow(n,1/2.4)-.055):12.92*t}))} /** * Convert an array of gamma-corrected sRGB values in the 0.0 to 1.0 range to HSL. * @@ -315,74 +148,71 @@ function OKLab_to_OKLCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0] * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). * * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/rgbToHsl.js - */function sRGB_to_HSL(t){const _=t[0],o=t[1],n=t[2],r=Math.max(_,o,n),e=Math.min(_,o,n),a=(e+r)/2,i=r-e;let l=NaN,u=0;if(0!==Math.round(1e5*i)){switch(u=0===Math.round(1e5*a)||1e5===Math.round(1e5*a)?0:(r-a)/Math.min(a,1-a),r){case _:l=(o-n)/i+(ot/r[_])).map((t=>t>.008856451679035631?Math.cbrt(t):(903.2962962962963*t+16)/116));return[116*_[1]-16,500*(_[0]-_[1]),200*(_[1]-_[2])]} + */function XYZ_to_lin_P3(t){return multiplyMatrices([[446124/178915,-333277/357830,-72051/178915],[-14852/17905,63121/35810,423/17905],[11844/330415,-50337/660830,316169/330415]],t)} /** - * Convert XYZ to linear-light rec2020 + * Convert an array of linear-light display-p3 RGB in the range 0.0-1.0 + * to gamma corrected form * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function XYZ_to_lin_2020(t){return multiplyMatrices([[30757411/17917100,-6372589/17917100,-4539589/17917100],[-.666684351832489,1.616481236634939,467509/29648200],[792561/44930125,-1921689/44930125,.942103121235474]],t)} + */function gam_P3(t){return gam_sRGB(t)} /** - * Convert XYZ to linear-light a98-rgb + * Assuming XYZ is relative to D50, convert to CIE Lab + * from CIE standard, which now defines these as a rational fraction * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function XYZ_to_lin_a98rgb(t){return multiplyMatrices([[1829569/896150,-506331/896150,-308931/896150],[-851781/878810,1648619/878810,36519/878810],[16779/1248040,-147721/1248040,1266979/1248040]],t)} + */function XYZ_to_Lab(_){const n=_.map(((_,n)=>_/t[n])).map((t=>t>.008856451679035631?Math.cbrt(t):(903.2962962962963*t+16)/116));return[116*n[1]-16,500*(n[0]-n[1]),200*(n[1]-n[2])]} /** - * Convert XYZ to linear-light P3 - * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function XYZ_to_lin_P3(t){return multiplyMatrices([[446124/178915,-333277/357830,-72051/178915],[-14852/17905,63121/35810,423/17905],[11844/330415,-50337/660830,316169/330415]],t)} -/** - * Convert XYZ to linear-light prophoto-rgb * + * XYZ <-> LMS matrices recalculated for consistent reference white + * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484 + */function XYZ_to_OKLab(t){const _=multiplyMatrices([[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],t);return multiplyMatrices([[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],_.map((t=>Math.cbrt(t))))} +/** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html - */function XYZ_to_lin_ProPhoto(t){return multiplyMatrices([[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]],t)} + */function Lab_to_LCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(Math.pow(t[1],2)+Math.pow(t[2],2)),_>=0?_:_+360]} /** * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */function XYZ_to_lin_sRGB(t){return multiplyMatrices([[12831/3959,-329/214,-1974/3959],[-851781/878810,1648619/878810,36519/878810],[705/12673,-2585/12673,705/667]],t)} + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js + */function OKLab_to_OKLCH(t){const _=180*Math.atan2(t[2],t[1])/Math.PI;return[t[0],Math.sqrt(t[1]**2+t[2]**2),_>=0?_:_+360]} /** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * Convert XYZ to linear-light a98-rgb * + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * XYZ <-> LMS matrices recalculated for consistent reference white - * @see https://github.com/w3c/csswg-drafts/issues/6642#issuecomment-943521484 - */function XYZ_to_OKLab(t){const _=multiplyMatrices([[.8190224432164319,.3619062562801221,-.12887378261216414],[.0329836671980271,.9292868468965546,.03614466816999844],[.048177199566046255,.26423952494422764,.6335478258136937]],t);return multiplyMatrices([[.2104542553,.793617785,-.0040720468],[1.9779984951,-2.428592205,.4505937099],[.0259040371,.7827717662,-.808675766]],_.map((t=>Math.cbrt(t))))} + */ /** - * Convert an array of three XYZ values to u*,v* chromaticity coordinates + * Convert an array of linear-light rec2020 RGB in the range 0.0-1.0 + * to gamma corrected form ITU-R BT.2020-2 p.4 * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */var e=Object.freeze({__proto__:null,D50:r,D50_to_D65:D50_to_D65,D65:[.3127/.329,1,.3583/.329],D65_to_D50:D65_to_D50,HSL_to_sRGB:HSL_to_sRGB,HWB_to_sRGB:HWB_to_sRGB,LCH_to_Lab:LCH_to_Lab,Lab_to_LCH:Lab_to_LCH,Lab_to_XYZ:Lab_to_XYZ,OKLCH_to_OKLab:OKLCH_to_OKLab,OKLab_to_OKLCH:OKLab_to_OKLCH,OKLab_to_XYZ:OKLab_to_XYZ,XYZ_to_Lab:XYZ_to_Lab,XYZ_to_OKLab:XYZ_to_OKLab,XYZ_to_lin_2020:XYZ_to_lin_2020,XYZ_to_lin_P3:XYZ_to_lin_P3,XYZ_to_lin_ProPhoto:XYZ_to_lin_ProPhoto,XYZ_to_lin_a98rgb:XYZ_to_lin_a98rgb,XYZ_to_lin_sRGB:XYZ_to_lin_sRGB,XYZ_to_uv:function XYZ_to_uv(t){const _=t[0],o=t[1],n=_+15*o+3*t[2];return[4*_/n,9*o/n]} + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ +function gam_2020(t){const _=1.09929682680944;return t.map((function(t){const n=t<0?-1:1,o=Math.abs(t);return o>.018053968510807?n*(_*Math.pow(o,.45)-(_-1)):4.5*t}))} /** - * Convert an array of three XYZ values to x,y chromaticity coordinates + * Convert XYZ to linear-light prophoto-rgb * * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/conversions.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html + */function sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_}function HSL_to_XYZ_D50(t){let _=t;return _=HSL_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_HSL(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_=sRGB_to_HSL(_),_}function HWB_to_XYZ_D50(t){let _=t;return _=HWB_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_HWB(t){let _=t;_=D50_to_D65(_),_=XYZ_to_lin_sRGB(_);const n=gam_sRGB(_);_=sRGB_to_HSL(n);const o=Math.min(n[0],n[1],n[2]),e=1-Math.max(n[0],n[1],n[2]);return[_[0],100*o,100*e]}function Lab_to_XYZ_D50(t){let _=t;return _=Lab_to_XYZ(_),_}function XYZ_D50_to_Lab(t){let _=t;return _=XYZ_to_Lab(_),_}function LCH_to_XYZ_D50(t){let _=t;var n;return _=[(n=_)[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)],_=Lab_to_XYZ(_),_}function XYZ_D50_to_LCH(t){let _=t;return _=XYZ_to_Lab(_),_=Lab_to_LCH(_),_}function OKLab_to_XYZ_D50(t){let _=t;return _=OKLab_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_OKLab(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_}function OKLCH_to_XYZ_D50(t){let _=t;return _=OKLCH_to_OKLab(_),_=OKLab_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_OKLCH(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_=OKLab_to_OKLCH(_),_}function lin_sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_lin_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_}function a98_RGB_to_XYZ_D50(t){let _=t;return _=_.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return _*Math.pow(n,563/256)})),_=multiplyMatrices([[573536/994567,263643/1420810,187206/994567],[591459/1989134,6239551/9945670,374412/4972835],[53769/1989134,351524/4972835,4929758/4972835]],_),_=D65_to_D50(_),_}function XYZ_D50_to_a98_RGB(t){let _=t;return _=D50_to_D65(_),_=multiplyMatrices([[1829569/896150,-506331/896150,-308931/896150],[-851781/878810,1648619/878810,36519/878810],[16779/1248040,-147721/1248040,1266979/1248040]],_),_=_.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return _*Math.pow(n,256/563)})),_}function P3_to_XYZ_D50(t){let _=t;return _=lin_P3(_),_=lin_P3_to_XYZ(_),_=D65_to_D50(_),_}function XYZ_D50_to_P3(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_P3(_),_=gam_P3(_),_}function rec_2020_to_XYZ_D50(t){let _=t;return _=lin_2020(_),_=multiplyMatrices([[63426534/99577255,20160776/139408157,47086771/278816314],[26158966/99577255,.677998071518871,8267143/139408157],[0,19567812/697040785,1.0609850577107909]],_),_=D65_to_D50(_),_}function XYZ_D50_to_rec_2020(t){let _=t;return _=D50_to_D65(_),_=multiplyMatrices([[30757411/17917100,-6372589/17917100,-4539589/17917100],[-.666684351832489,1.616481236634939,467509/29648200],[792561/44930125,-1921689/44930125,.942103121235474]],_),_=gam_2020(_),_}function ProPhoto_RGB_to_XYZ_D50(t){let _=t;return _=_.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n<=.03125?t/16:_*Math.pow(n,1.8)})),_=multiplyMatrices([[.7977604896723027,.13518583717574031,.0313493495815248],[.2880711282292934,.7118432178101014,8565396060525902e-20],[0,0,.8251046025104601]],_),_}function XYZ_D50_to_ProPhoto(t){let _=t;return _=multiplyMatrices([[1.3457989731028281,-.25558010007997534,-.05110628506753401],[-.5446224939028347,1.5082327413132781,.02053603239147973],[0,0,1.2119675456389454]],_),_=_.map((function(t){const _=t<0?-1:1,n=Math.abs(t);return n>=.001953125?_*Math.pow(n,1/1.8):16*t})),_}function XYZ_D65_to_XYZ_D50(t){let _=t;return _=D65_to_D50(_),_}function XYZ_D50_to_XYZ_D65(t){let _=t;return _=D50_to_D65(_),_}function XYZ_D50_to_XYZ_D50(t){return t}function inGamut(t){const[_,n,o]=t;return _>=-1e-4&&_<=1.0001&&n>=-1e-4&&n<=1.0001&&o>=-1e-4&&o<=1.0001}function clip(t){return t.map((t=>t<0?0:t>1?1:t))} +/** + * @description Calculate deltaE OK which is the simple root sum of squares + * @param {number[]} reference - Array of OKLab values: L as 0..1, a and b as -1..1 + * @param {number[]} sample - Array of OKLab values: L as 0..1, a and b as -1..1 + * @return {number} How different a color sample is from reference * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - * - * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js - */,XYZ_to_xy:function XYZ_to_xy(t){const _=t[0],o=t[1],n=_+o+t[2];return[_/n,o/n]},gam_2020:gam_2020,gam_P3:gam_P3,gam_ProPhoto:gam_ProPhoto,gam_a98rgb:gam_a98rgb,gam_sRGB:gam_sRGB,hueToRGB:function hueToRGB(t,_,o){return o<0&&(o+=6),o>=6&&(o-=6),o<1?(_-t)*o+t:o<3?_:o<4?(_-t)*(4-o)+t:t},lin_2020:lin_2020,lin_2020_to_XYZ:lin_2020_to_XYZ,lin_P3:lin_P3,lin_P3_to_XYZ:lin_P3_to_XYZ,lin_ProPhoto:lin_ProPhoto,lin_ProPhoto_to_XYZ:lin_ProPhoto_to_XYZ,lin_a98rgb:lin_a98rgb,lin_a98rgb_to_XYZ:lin_a98rgb_to_XYZ,lin_sRGB:lin_sRGB,lin_sRGB_to_XYZ:lin_sRGB_to_XYZ,naive_CMYK_to_sRGB:function naive_CMYK_to_sRGB(t){const _=t[0],o=t[1],n=t[2],r=t[3];return[1-Math.min(1,_*(1-r)+r),1-Math.min(1,o*(1-r)+r),1-Math.min(1,n*(1-r)+r)]},sRGB_to_HSL:sRGB_to_HSL,sRGB_to_HWB:function sRGB_to_HWB(t){const _=sRGB_to_HSL(t),o=Math.min(t[0],t[1],t[2]),n=1-Math.max(t[0],t[1],t[2]);return[_[0],100*o,100*n]},sRGB_to_luminance:sRGB_to_luminance});var a=Object.freeze({__proto__:null,HSL_to_XYZ_D50:function HSL_to_XYZ_D50(t){let _=t;return _=HSL_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},HWB_to_XYZ_D50:function HWB_to_XYZ_D50(t){let _=t;return _=HWB_to_sRGB(_),_=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},LCH_to_XYZ_D50:function LCH_to_XYZ_D50(t){let _=t;return _=LCH_to_Lab(_),_=Lab_to_XYZ(_),_},Lab_to_XYZ_D50:function Lab_to_XYZ_D50(t){let _=t;return _=Lab_to_XYZ(_),_},OKLCH_to_XYZ_D50:function OKLCH_to_XYZ_D50(t){let _=t;return _=OKLCH_to_OKLab(_),_=OKLab_to_XYZ(_),_=D65_to_D50(_),_},OKLab_to_XYZ_D50:function OKLab_to_XYZ_D50(t){let _=t;return _=OKLab_to_XYZ(_),_=D65_to_D50(_),_},P3_to_XYZ_D50:function P3_to_XYZ_D50(t){let _=t;return _=lin_P3(_),_=lin_P3_to_XYZ(_),_=D65_to_D50(_),_},ProPhoto_RGB_to_XYZ_D50:function ProPhoto_RGB_to_XYZ_D50(t){let _=t;return _=lin_ProPhoto(_),_=lin_ProPhoto_to_XYZ(_),_},XYZ_D50_to_HSL:function XYZ_D50_to_HSL(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_=sRGB_to_HSL(_),_},XYZ_D50_to_HWB:function XYZ_D50_to_HWB(t){let _=t;_=D50_to_D65(_),_=XYZ_to_lin_sRGB(_);const o=gam_sRGB(_);_=sRGB_to_HSL(o);const n=Math.min(o[0],o[1],o[2]),r=1-Math.max(o[0],o[1],o[2]);return[_[0],100*n,100*r]},XYZ_D50_to_LCH:function XYZ_D50_to_LCH(t){let _=t;return _=XYZ_to_Lab(_),_=Lab_to_LCH(_),_},XYZ_D50_to_Lab:function XYZ_D50_to_Lab(t){let _=t;return _=XYZ_to_Lab(_),_},XYZ_D50_to_OKLCH:function XYZ_D50_to_OKLCH(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_=OKLab_to_OKLCH(_),_},XYZ_D50_to_OKLab:function XYZ_D50_to_OKLab(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_OKLab(_),_},XYZ_D50_to_P3:function XYZ_D50_to_P3(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_P3(_),_=gam_P3(_),_},XYZ_D50_to_ProPhoto:function XYZ_D50_to_ProPhoto(t){let _=t;return _=XYZ_to_lin_ProPhoto(_),_=gam_ProPhoto(_),_},XYZ_D50_to_XYZ_D50:function XYZ_D50_to_XYZ_D50(t){return t},XYZ_D50_to_XYZ_D65:function XYZ_D50_to_XYZ_D65(t){let _=t;return _=D50_to_D65(_),_},XYZ_D50_to_a98_RGB:function XYZ_D50_to_a98_RGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_a98rgb(_),_=gam_a98rgb(_),_},XYZ_D50_to_lin_sRGB:function XYZ_D50_to_lin_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_},XYZ_D50_to_rec_2020:function XYZ_D50_to_rec_2020(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_2020(_),_=gam_2020(_),_},XYZ_D50_to_sRGB:function XYZ_D50_to_sRGB(t){let _=t;return _=D50_to_D65(_),_=XYZ_to_lin_sRGB(_),_=gam_sRGB(_),_},XYZ_D65_to_XYZ_D50:function XYZ_D65_to_XYZ_D50(t){let _=t;return _=D65_to_D50(_),_},a98_RGB_to_XYZ_D50:function a98_RGB_to_XYZ_D50(t){let _=t;return _=lin_a98rgb(_),_=lin_a98rgb_to_XYZ(_),_=D65_to_D50(_),_},lin_sRGB_to_XYZ_D50:function lin_sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_},rec_2020_to_XYZ_D50:function rec_2020_to_XYZ_D50(t){let _=t;return _=lin_2020(_),_=lin_2020_to_XYZ(_),_=D65_to_D50(_),_},sRGB_to_XYZ_D50:function sRGB_to_XYZ_D50(t){let _=t;return _=lin_sRGB(_),_=lin_sRGB_to_XYZ(_),_=D65_to_D50(_),_}});const i={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};export{n as calculations,e as conversions,i as namedColors,t as utils,a as xyz}; + * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document + * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/deltaEOK.js + */function deltaEOK(t,_){const[n,o,e]=t,[r,a,i]=_,l=n-r,u=o-a,c=e-i;return Math.sqrt(l**2+u**2+c**2)}const _=.02,n=1e-5;function binarySearchGamut(t,o,e){const r=t;let a=0,i=r[1];for(;i-a>n;){const t=(a+i)/2;r[1]=t;const n=o(r);if(inGamut(n)){a=t;continue}const l=clip(n);if(deltaEOK(OKLCH_to_OKLab(e(l)),OKLCH_to_OKLab(r))<_)return l;i=t}return clip(o([...r]))}function mapGamut(t,_,n){return binarySearchGamut(t,_,n)}const o={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};export{HSL_to_XYZ_D50,HWB_to_XYZ_D50,LCH_to_XYZ_D50,Lab_to_XYZ_D50,OKLCH_to_OKLab,OKLCH_to_XYZ_D50,OKLab_to_OKLCH,OKLab_to_XYZ,OKLab_to_XYZ_D50,P3_to_XYZ_D50,ProPhoto_RGB_to_XYZ_D50,XYZ_D50_to_HSL,XYZ_D50_to_HWB,XYZ_D50_to_LCH,XYZ_D50_to_Lab,XYZ_D50_to_OKLCH,XYZ_D50_to_OKLab,XYZ_D50_to_P3,XYZ_D50_to_ProPhoto,XYZ_D50_to_XYZ_D50,XYZ_D50_to_XYZ_D65,XYZ_D50_to_a98_RGB,XYZ_D50_to_lin_sRGB,XYZ_D50_to_rec_2020,XYZ_D50_to_sRGB,XYZ_D65_to_XYZ_D50,XYZ_to_OKLab,XYZ_to_lin_P3,XYZ_to_lin_sRGB,a98_RGB_to_XYZ_D50,clip,gam_P3,gam_sRGB,inGamut,lin_P3,lin_P3_to_XYZ,lin_sRGB,lin_sRGB_to_XYZ,lin_sRGB_to_XYZ_D50,mapGamut,o as namedColors,rec_2020_to_XYZ_D50,sRGB_to_XYZ_D50}; diff --git a/node_modules/@csstools/color-helpers/dist/named-colors/index.d.ts b/node_modules/@csstools/color-helpers/dist/named-colors/index.d.ts deleted file mode 100644 index 4d1a7edd..00000000 --- a/node_modules/@csstools/color-helpers/dist/named-colors/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Color } from 'types/color'; -export declare const namedColors: Record; diff --git a/node_modules/@csstools/color-helpers/dist/types/color.d.ts b/node_modules/@csstools/color-helpers/dist/types/color.d.ts deleted file mode 100644 index 4d390a28..00000000 --- a/node_modules/@csstools/color-helpers/dist/types/color.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type Color = [number, number, number]; diff --git a/node_modules/@csstools/color-helpers/dist/utils/clip.d.ts b/node_modules/@csstools/color-helpers/dist/utils/clip.d.ts deleted file mode 100644 index c5ed70f0..00000000 --- a/node_modules/@csstools/color-helpers/dist/utils/clip.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function clip(color: Color): Color; diff --git a/node_modules/@csstools/color-helpers/dist/utils/in-gamut.d.ts b/node_modules/@csstools/color-helpers/dist/utils/in-gamut.d.ts deleted file mode 100644 index b2217eb1..00000000 --- a/node_modules/@csstools/color-helpers/dist/utils/in-gamut.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Color } from 'types/color'; -/** - * @license W3C https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document - * - * @copyright This software or document includes material copied from or derived from https://github.com/w3c/csswg-drafts/blob/main/css-color-4/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). - */ -export declare function inGamut(x: Color): boolean; diff --git a/node_modules/@csstools/color-helpers/dist/utils/index.d.ts b/node_modules/@csstools/color-helpers/dist/utils/index.d.ts deleted file mode 100644 index b73e4598..00000000 --- a/node_modules/@csstools/color-helpers/dist/utils/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './clip'; -export * from './in-gamut'; diff --git a/node_modules/@csstools/color-helpers/package.json b/node_modules/@csstools/color-helpers/package.json index 9f8a26c8..49ccca2e 100644 --- a/node_modules/@csstools/color-helpers/package.json +++ b/node_modules/@csstools/color-helpers/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/color-helpers", "description": "Color helpers to ease transformation between formats, gamut, etc", - "version": "3.0.2", + "version": "4.0.0", "contributors": [ { "name": "Antonio Laguna", @@ -27,14 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -43,14 +47,6 @@ "README.md", "dist" ], - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "check-sources-integrity": "node ./scripts/check-changes.mjs", - "check-sources-integrity:rewrite": "REWRITE_HASHES=true node ./scripts/check-changes.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node ./test/_import.mjs && node ./test/_require.cjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers#readme", "repository": { "type": "git", @@ -61,13 +57,5 @@ "keywords": [ "colors", "css" - ], - "volta": { - "extends": "../../package.json" - }, - "eslintConfig": { - "rules": { - "@typescript-eslint/no-loss-of-precision": "off" - } - } + ] } diff --git a/node_modules/@csstools/css-calc/CHANGELOG.md b/node_modules/@csstools/css-calc/CHANGELOG.md index 78d8a5e1..95f0d5f4 100644 --- a/node_modules/@csstools/css-calc/CHANGELOG.md +++ b/node_modules/@csstools/css-calc/CHANGELOG.md @@ -1,5 +1,13 @@ # Changes to CSS Calc +### 1.1.5 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) + ### 1.1.4 _September 24, 2023_ @@ -15,33 +23,4 @@ _July 24, 2023_ - Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) - Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) -### 1.1.2 - -_July 3, 2023_ - -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) - -### 1.1.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) - -### 1.1.0 - -_April 10, 2023_ - -- Expose the list of supported math functions. - -### 1.0.1 - -_March 25, 2023_ - -- Improve case insensitive string matching. - -### 1.0.0 - -_February 21, 2023_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md) diff --git a/node_modules/@csstools/css-calc/dist/calculation.d.ts b/node_modules/@csstools/css-calc/dist/calculation.d.ts deleted file mode 100644 index 963a3854..00000000 --- a/node_modules/@csstools/css-calc/dist/calculation.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { Operation } from './operation/operation'; -import type { TokenNode } from '@csstools/css-parser-algorithms'; -export type Calculation = { - inputs: Array; - operation: Operation; -}; -export declare function isCalculation(x: unknown): x is Calculation; -export declare function solve(calculation: Calculation | -1): TokenNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/abs.d.ts b/node_modules/@csstools/css-calc/dist/functions/abs.d.ts deleted file mode 100644 index e8971e3b..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/abs.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveAbs(absNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/acos.d.ts b/node_modules/@csstools/css-calc/dist/functions/acos.d.ts deleted file mode 100644 index 964f7470..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/acos.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveACos(acosNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/asin.d.ts b/node_modules/@csstools/css-calc/dist/functions/asin.d.ts deleted file mode 100644 index a1465cb7..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/asin.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveASin(asinNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/atan.d.ts b/node_modules/@csstools/css-calc/dist/functions/atan.d.ts deleted file mode 100644 index f800a7bf..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/atan.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveATan(atanNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/atan2.d.ts b/node_modules/@csstools/css-calc/dist/functions/atan2.d.ts deleted file mode 100644 index 651308f6..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/atan2.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveATan2(atan2Node: FunctionNode, a: TokenNode, b: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/calc.d.ts b/node_modules/@csstools/css-calc/dist/functions/calc.d.ts deleted file mode 100644 index aa2f0dd4..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/calc.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { ComponentValue, SimpleBlockNode, TokenNode } from '@csstools/css-parser-algorithms'; -import type { Globals } from '../util/globals'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare const mathFunctions: Map; -export declare function calc(calcNode: FunctionNode | SimpleBlockNode, globals: Globals): Calculation | -1; -export declare function singleNodeSolver(fnNode: FunctionNode, globals: Globals, solveFn: (node: FunctionNode, a: TokenNode) => Calculation | -1): Calculation | -1; -export declare function twoCommaSeparatedNodesSolver(fnNode: FunctionNode, globals: Globals, solveFn: (node: FunctionNode, a: TokenNode, b: TokenNode) => Calculation | -1): Calculation | -1; -export declare function variadicNodesSolver(fnNode: FunctionNode, globals: Globals, solveFn: (node: FunctionNode, x: Array) => Calculation | -1): Calculation | -1; -export declare function clamp(clampNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function max(maxNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function min(minNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function round(roundNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function mod(modNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function rem(remNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function abs(absNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function sign(signNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function sin(sinNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function cos(codNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function tan(tanNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function asin(asinNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function acos(acosNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function atan(atanNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function atan2(atan2Node: FunctionNode, globals: Globals): Calculation | -1; -export declare function exp(expNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function sqrt(sqrtNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function pow(powNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function hypot(hypotNode: FunctionNode, globals: Globals): Calculation | -1; -export declare function log(logNode: FunctionNode, globals: Globals): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/clamp.d.ts b/node_modules/@csstools/css-calc/dist/functions/clamp.d.ts deleted file mode 100644 index 19a49c4b..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/clamp.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveClamp(clampNode: FunctionNode, minimum: TokenNode | -1, central: TokenNode | -1, maximum: TokenNode | -1): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/cos.d.ts b/node_modules/@csstools/css-calc/dist/functions/cos.d.ts deleted file mode 100644 index 74359259..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/cos.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveCos(cosNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/exp.d.ts b/node_modules/@csstools/css-calc/dist/functions/exp.d.ts deleted file mode 100644 index 0d1a64d9..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/exp.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveExp(expNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/globals-and-constants.d.ts b/node_modules/@csstools/css-calc/dist/functions/globals-and-constants.d.ts deleted file mode 100644 index d968bd11..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/globals-and-constants.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { Globals } from '../util/globals'; -export declare function resolveGlobalsAndConstants(nodes: Array, globals: Globals): Array; diff --git a/node_modules/@csstools/css-calc/dist/functions/hypot.d.ts b/node_modules/@csstools/css-calc/dist/functions/hypot.d.ts deleted file mode 100644 index 9d22357f..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/hypot.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function solveHypot(hypotNode: FunctionNode, solvedNodes: Array): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/log.d.ts b/node_modules/@csstools/css-calc/dist/functions/log.d.ts deleted file mode 100644 index 9ed69293..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/log.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function solveLog(logNode: FunctionNode, solvedNodes: Array): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/max.d.ts b/node_modules/@csstools/css-calc/dist/functions/max.d.ts deleted file mode 100644 index 4181d6e5..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/max.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function solveMax(maxNode: FunctionNode, solvedNodes: Array): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/min.d.ts b/node_modules/@csstools/css-calc/dist/functions/min.d.ts deleted file mode 100644 index 9f76b07c..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/min.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function solveMin(minNode: FunctionNode, solvedNodes: Array): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/mod.d.ts b/node_modules/@csstools/css-calc/dist/functions/mod.d.ts deleted file mode 100644 index 0a6172e1..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/mod.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveMod(modNode: FunctionNode, a: TokenNode, b: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/pow.d.ts b/node_modules/@csstools/css-calc/dist/functions/pow.d.ts deleted file mode 100644 index 33efc20c..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/pow.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solvePow(powNode: FunctionNode, a: TokenNode, b: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/rem.d.ts b/node_modules/@csstools/css-calc/dist/functions/rem.d.ts deleted file mode 100644 index ebaacfd1..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/rem.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveRem(remNode: FunctionNode, a: TokenNode, b: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/result-to-calculation.d.ts b/node_modules/@csstools/css-calc/dist/functions/result-to-calculation.d.ts deleted file mode 100644 index 1f79cf4e..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/result-to-calculation.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -import { Calculation } from '../calculation'; -export declare function resultToCalculation(node: FunctionNode, aToken: CSSToken, result: number): Calculation | -1; -export declare function dimensionToCalculation(node: FunctionNode, unit: string, result: number): Calculation | -1; -export declare function percentageToCalculation(node: FunctionNode, result: number): Calculation | -1; -export declare function numberToCalculation(node: FunctionNode, result: number): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/round.d.ts b/node_modules/@csstools/css-calc/dist/functions/round.d.ts deleted file mode 100644 index 87b8d78f..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/round.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveRound(roundNode: FunctionNode, roundingStrategy: string, a: TokenNode, b: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/sign.d.ts b/node_modules/@csstools/css-calc/dist/functions/sign.d.ts deleted file mode 100644 index 391f3b56..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/sign.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveSign(signNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/sin.d.ts b/node_modules/@csstools/css-calc/dist/functions/sin.d.ts deleted file mode 100644 index 9a0f484b..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/sin.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveSin(sinNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/sqrt.d.ts b/node_modules/@csstools/css-calc/dist/functions/sqrt.d.ts deleted file mode 100644 index a9a43a69..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/sqrt.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveSqrt(sqrtNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/functions/tan.d.ts b/node_modules/@csstools/css-calc/dist/functions/tan.d.ts deleted file mode 100644 index 6294895d..00000000 --- a/node_modules/@csstools/css-calc/dist/functions/tan.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function solveTan(tanNode: FunctionNode, a: TokenNode): Calculation | -1; diff --git a/node_modules/@csstools/css-calc/dist/index.cjs b/node_modules/@csstools/css-calc/dist/index.cjs index a9163530..65d449dc 100644 --- a/node_modules/@csstools/css-calc/dist/index.cjs +++ b/node_modules/@csstools/css-calc/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/css-parser-algorithms"),n=require("@csstools/css-tokenizer");const o=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(o,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}const t={cm:"px",in:"px",mm:"px",pc:"px",pt:"px",px:"px",q:"px",deg:"deg",grad:"deg",rad:"deg",turn:"deg",ms:"s",s:"s",hz:"hz",khz:"hz"},r=new Map([["cm",e=>e],["mm",e=>10*e],["q",e=>40*e],["in",e=>e/2.54],["pc",e=>e/2.54*6],["pt",e=>e/2.54*72],["px",e=>e/2.54*96]]),u=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),i=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),a=new Map([["hz",e=>e],["khz",e=>e/1e3]]),l=new Map([["cm",e=>2.54*e],["mm",e=>25.4*e],["q",e=>25.4*e*4],["in",e=>e],["pc",e=>6*e],["pt",e=>72*e],["px",e=>96*e]]),s=new Map([["hz",e=>1e3*e],["khz",e=>e]]),c=new Map([["cm",e=>e/10],["mm",e=>e],["q",e=>4*e],["in",e=>e/25.4],["pc",e=>e/25.4*6],["pt",e=>e/25.4*72],["px",e=>e/25.4*96]]),T=new Map([["ms",e=>e],["s",e=>e/1e3]]),p=new Map([["cm",e=>e/6*2.54],["mm",e=>e/6*25.4],["q",e=>e/6*25.4*4],["in",e=>e/6],["pc",e=>e],["pt",e=>e/6*72],["px",e=>e/6*96]]),v=new Map([["cm",e=>e/72*2.54],["mm",e=>e/72*25.4],["q",e=>e/72*25.4*4],["in",e=>e/72],["pc",e=>e/72*6],["pt",e=>e],["px",e=>e/72*96]]),m=new Map([["cm",e=>e/96*2.54],["mm",e=>e/96*25.4],["q",e=>e/96*25.4*4],["in",e=>e/96],["pc",e=>e/96*6],["pt",e=>e/96*72],["px",e=>e]]),N=new Map([["cm",e=>e/4/10],["mm",e=>e/4],["q",e=>e],["in",e=>e/4/25.4],["pc",e=>e/4/25.4*6],["pt",e=>e/4/25.4*72],["px",e=>e/4/25.4*96]]),f=new Map([["deg",e=>180*e/Math.PI],["grad",e=>180*e/Math.PI/.9],["rad",e=>e],["turn",e=>180*e/Math.PI/360]]),y=new Map([["ms",e=>1e3*e],["s",e=>e]]),k=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),d=new Map([["cm",r],["mm",c],["q",N],["in",l],["pc",p],["pt",v],["px",m],["ms",T],["s",y],["deg",u],["grad",i],["rad",f],["turn",k],["hz",a],["khz",s]]);function convertUnit(e,o){if(e[0]!==n.TokenType.Dimension)return o;if(o[0]!==n.TokenType.Dimension)return o;const t=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(o[4].unit);if(t===r)return o;const u=d.get(r);if(!u)return o;const i=u.get(t);if(!i)return o;const a=i(o[4].value);return[n.TokenType.Dimension,a.toString()+e[4].unit,o[2],o[3],{value:a,unit:e[4].unit,type:Number.isInteger(a)?n.NumberType.Integer:n.NumberType.Number}]}function toCanonicalUnit(e){if(e[0]!==n.TokenType.Dimension)return e;const o=toLowerCaseAZ(e[4].unit),r=t[o];if(o===r)return e;const u=d.get(o);if(!u)return e;const i=u.get(r);if(!i)return e;const a=i(e[4].value);return[n.TokenType.Dimension,a.toString()+r,e[2],e[3],{value:a,unit:r,type:Number.isInteger(a)?n.NumberType.Integer:n.NumberType.Number}]}function addition(o){if(2!==o.length)return-1;const t=o[0].value;let r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Percentage){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}return-1}function division(o){if(2!==o.length)return-1;const t=o[0].value,r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:Number.isInteger(o)?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:Number.isInteger(o)?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}return-1}function isCalculation(e){return!!e&&"object"==typeof e&&"inputs"in e&&Array.isArray(e.inputs)&&"operation"in e}function solve(n){if(-1===n)return-1;const o=[];for(let t=0;te.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.hypot(...i);return resultToCalculation(n,r,a)}function solveMax(n,o){const t=o[0];if(!t||!e.isTokenNode(t))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.max(...i);return resultToCalculation(n,r,a)}function solveMin(n,o){const t=o[0];if(!t||!e.isTokenNode(t))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.min(...i);return resultToCalculation(n,r,a)}function solveMod(e,n,o){const t=n.value;if(!isNumeric(t))return-1;const r=convertUnit(t,o.value);if(!twoOfSameNumeric(t,r))return-1;let u;return u=0===r[4].value?Number.NaN:Number.isFinite(t[4].value)&&(Number.isFinite(r[4].value)||(r[4].value!==Number.POSITIVE_INFINITY||t[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*t[4].value,-0))&&(r[4].value!==Number.NEGATIVE_INFINITY||t[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*t[4].value,0)))?Number.isFinite(r[4].value)?(t[4].value%r[4].value+r[4].value)%r[4].value:t[4].value:Number.NaN,resultToCalculation(e,t,u)}function solvePow(e,o,t){const r=o.value,u=t.value;if(r[0]!==n.TokenType.Number)return-1;if(!twoOfSameNumeric(r,u))return-1;return numberToCalculation(e,Math.pow(r[4].value,u[4].value))}function solveRem(e,n,o){const t=n.value;if(!isNumeric(t))return-1;const r=convertUnit(t,o.value);if(!twoOfSameNumeric(t,r))return-1;let u;return u=0===r[4].value?Number.NaN:Number.isFinite(t[4].value)?Number.isFinite(r[4].value)?t[4].value%r[4].value:t[4].value:Number.NaN,resultToCalculation(e,t,u)}function solveRound(e,n,o,t){const r=o.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;if(0===u[4].value)i=Number.NaN;else if(Number.isFinite(r[4].value)||Number.isFinite(u[4].value))if(!Number.isFinite(r[4].value)&&Number.isFinite(u[4].value))i=r[4].value;else if(Number.isFinite(r[4].value)&&!Number.isFinite(u[4].value))switch(n){case"down":i=r[4].value<0?-1/0:Object.is(-0,0*r[4].value)?-0:0;break;case"up":i=r[4].value>0?1/0:Object.is(0,0*r[4].value)?0:-0;break;default:i=Object.is(0,0*r[4].value)?0:-0}else if(Number.isFinite(u[4].value))switch(n){case"down":i=Math.floor(r[4].value/u[4].value)*u[4].value;break;case"up":i=Math.ceil(r[4].value/u[4].value)*u[4].value;break;case"to-zero":i=Math.trunc(r[4].value/u[4].value)*u[4].value;break;default:{let e=Math.floor(r[4].value/u[4].value)*u[4].value,n=Math.ceil(r[4].value/u[4].value)*u[4].value;if(e>n){const o=e;e=n,n=o}const o=Math.abs(r[4].value-e),t=Math.abs(r[4].value-n);i=o===t?n:o0?1/0:-1/0:Math.tan(l),numberToCalculation(e,l)}function subtraction(o){if(2!==o.length)return-1;const t=o[0].value;let r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Percentage){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}return-1}function solveLog(o,t){if(1===t.length){const r=t[0];if(!r||!e.isTokenNode(r))return-1;const u=r.value;if(u[0]!==n.TokenType.Number)return-1;return numberToCalculation(o,Math.log(u[4].value))}if(2===t.length){const r=t[0];if(!r||!e.isTokenNode(r))return-1;const u=r.value;if(u[0]!==n.TokenType.Number)return-1;const i=t[1];if(!i||!e.isTokenNode(i))return-1;const a=i.value;if(a[0]!==n.TokenType.Number)return-1;return numberToCalculation(o,Math.log(u[4].value)/Math.log(a[4].value))}return-1}const b=new Map([["abs",function abs(e,n){return singleNodeSolver(e,n,solveAbs)}],["acos",function acos(e,n){return singleNodeSolver(e,n,solveACos)}],["asin",function asin(e,n){return singleNodeSolver(e,n,solveASin)}],["atan",function atan(e,n){return singleNodeSolver(e,n,solveATan)}],["atan2",function atan2(e,n){return twoCommaSeparatedNodesSolver(e,n,solveATan2)}],["calc",calc$1],["clamp",function clamp(o,t){const r=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),u=[],i=[],a=[];{let o=u;for(let t=0;t!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t);let u="";const i=[],a=[];{let o=i;for(let t=0;t!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t);if(1===r.length&&e.isTokenNode(r[0]))return{inputs:[r[0]],operation:unary};let u=0;for(;u!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],u),t));return-1===i?-1:r(o,i)}function twoCommaSeparatedNodesSolver(o,t,r){const u=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=[],a=[];{let o=i;for(let t=0;t!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=[];{const o=[];let r=[];for(let t=0;t{if(e.isFunctionNode(n)){const e=b.get(toLowerCaseAZ(n.getName()));if(e){const r=patchCalcResult(solve(e(n,t)),o);if(-1!==r)return r}}}))}const h=new Set(b.keys());exports.calc=function calc(o,t){return calcFromComponentValues(e.parseCommaSeparatedListOfComponentValues(n.tokenize({css:o}),{}),t).map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")},exports.calcFromComponentValues=calcFromComponentValues,exports.mathFunctionNames=h; +"use strict";var e=require("@csstools/css-parser-algorithms"),n=require("@csstools/css-tokenizer");const o=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(o,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}const t={cm:"px",in:"px",mm:"px",pc:"px",pt:"px",px:"px",q:"px",deg:"deg",grad:"deg",rad:"deg",turn:"deg",ms:"s",s:"s",hz:"hz",khz:"hz"},r=new Map([["cm",e=>e],["mm",e=>10*e],["q",e=>40*e],["in",e=>e/2.54],["pc",e=>e/2.54*6],["pt",e=>e/2.54*72],["px",e=>e/2.54*96]]),u=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),i=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),a=new Map([["hz",e=>e],["khz",e=>e/1e3]]),l=new Map([["cm",e=>2.54*e],["mm",e=>25.4*e],["q",e=>25.4*e*4],["in",e=>e],["pc",e=>6*e],["pt",e=>72*e],["px",e=>96*e]]),s=new Map([["hz",e=>1e3*e],["khz",e=>e]]),c=new Map([["cm",e=>e/10],["mm",e=>e],["q",e=>4*e],["in",e=>e/25.4],["pc",e=>e/25.4*6],["pt",e=>e/25.4*72],["px",e=>e/25.4*96]]),T=new Map([["ms",e=>e],["s",e=>e/1e3]]),p=new Map([["cm",e=>e/6*2.54],["mm",e=>e/6*25.4],["q",e=>e/6*25.4*4],["in",e=>e/6],["pc",e=>e],["pt",e=>e/6*72],["px",e=>e/6*96]]),v=new Map([["cm",e=>e/72*2.54],["mm",e=>e/72*25.4],["q",e=>e/72*25.4*4],["in",e=>e/72],["pc",e=>e/72*6],["pt",e=>e],["px",e=>e/72*96]]),m=new Map([["cm",e=>e/96*2.54],["mm",e=>e/96*25.4],["q",e=>e/96*25.4*4],["in",e=>e/96],["pc",e=>e/96*6],["pt",e=>e/96*72],["px",e=>e]]),N=new Map([["cm",e=>e/4/10],["mm",e=>e/4],["q",e=>e],["in",e=>e/4/25.4],["pc",e=>e/4/25.4*6],["pt",e=>e/4/25.4*72],["px",e=>e/4/25.4*96]]),f=new Map([["deg",e=>180*e/Math.PI],["grad",e=>180*e/Math.PI/.9],["rad",e=>e],["turn",e=>180*e/Math.PI/360]]),y=new Map([["ms",e=>1e3*e],["s",e=>e]]),k=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),d=new Map([["cm",r],["mm",c],["q",N],["in",l],["pc",p],["pt",v],["px",m],["ms",T],["s",y],["deg",u],["grad",i],["rad",f],["turn",k],["hz",a],["khz",s]]);function convertUnit(e,o){if(e[0]!==n.TokenType.Dimension)return o;if(o[0]!==n.TokenType.Dimension)return o;const t=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(o[4].unit);if(t===r)return o;const u=d.get(r);if(!u)return o;const i=u.get(t);if(!i)return o;const a=i(o[4].value);return[n.TokenType.Dimension,a.toString()+e[4].unit,o[2],o[3],{value:a,unit:e[4].unit,type:Number.isInteger(a)?n.NumberType.Integer:n.NumberType.Number}]}function toCanonicalUnit(e){if(e[0]!==n.TokenType.Dimension)return e;const o=toLowerCaseAZ(e[4].unit),r=t[o];if(o===r)return e;const u=d.get(o);if(!u)return e;const i=u.get(r);if(!i)return e;const a=i(e[4].value);return[n.TokenType.Dimension,a.toString()+r,e[2],e[3],{value:a,unit:r,type:Number.isInteger(a)?n.NumberType.Integer:n.NumberType.Number}]}function addition(o){if(2!==o.length)return-1;const t=o[0].value;let r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Percentage){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const o=t[4].value+r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}return-1}function division(o){if(2!==o.length)return-1;const t=o[0].value,r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:Number.isInteger(o)?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Number){const o=t[4].value/r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:Number.isInteger(o)?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}return-1}function isCalculation(e){return!!e&&"object"==typeof e&&"inputs"in e&&Array.isArray(e.inputs)&&"operation"in e}function solve(n){if(-1===n)return-1;const o=[];for(let t=0;te.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.hypot(...i);return resultToCalculation(n,r,a)}function solveMax(n,o){const t=o[0];if(!t||!e.isTokenNode(t))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.max(...i);return resultToCalculation(n,r,a)}function solveMin(n,o){const t=o[0];if(!t||!e.isTokenNode(t))return-1;if(1!==new Set(o.map((e=>e.type))).size)return-1;const r=t.value;if(!isNumeric(r))return-1;const u=o.map((e=>convertUnit(r,e.value)));if(!arrayOfSameNumeric(u))return-1;const i=u.map((e=>e[4].value)),a=Math.min(...i);return resultToCalculation(n,r,a)}function solveMod(e,n,o){const t=n.value;if(!isNumeric(t))return-1;const r=convertUnit(t,o.value);if(!twoOfSameNumeric(t,r))return-1;let u;return u=0===r[4].value?Number.NaN:Number.isFinite(t[4].value)&&(Number.isFinite(r[4].value)||(r[4].value!==Number.POSITIVE_INFINITY||t[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*t[4].value,-0))&&(r[4].value!==Number.NEGATIVE_INFINITY||t[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*t[4].value,0)))?Number.isFinite(r[4].value)?(t[4].value%r[4].value+r[4].value)%r[4].value:t[4].value:Number.NaN,resultToCalculation(e,t,u)}function solvePow(e,o,t){const r=o.value,u=t.value;if(r[0]!==n.TokenType.Number)return-1;if(!twoOfSameNumeric(r,u))return-1;return numberToCalculation(e,Math.pow(r[4].value,u[4].value))}function solveRem(e,n,o){const t=n.value;if(!isNumeric(t))return-1;const r=convertUnit(t,o.value);if(!twoOfSameNumeric(t,r))return-1;let u;return u=0===r[4].value?Number.NaN:Number.isFinite(t[4].value)?Number.isFinite(r[4].value)?t[4].value%r[4].value:t[4].value:Number.NaN,resultToCalculation(e,t,u)}function solveRound(e,n,o,t){const r=o.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;if(0===u[4].value)i=Number.NaN;else if(Number.isFinite(r[4].value)||Number.isFinite(u[4].value))if(!Number.isFinite(r[4].value)&&Number.isFinite(u[4].value))i=r[4].value;else if(Number.isFinite(r[4].value)&&!Number.isFinite(u[4].value))switch(n){case"down":i=r[4].value<0?-1/0:Object.is(-0,0*r[4].value)?-0:0;break;case"up":i=r[4].value>0?1/0:Object.is(0,0*r[4].value)?0:-0;break;default:i=Object.is(0,0*r[4].value)?0:-0}else if(Number.isFinite(u[4].value))switch(n){case"down":i=Math.floor(r[4].value/u[4].value)*u[4].value;break;case"up":i=Math.ceil(r[4].value/u[4].value)*u[4].value;break;case"to-zero":i=Math.trunc(r[4].value/u[4].value)*u[4].value;break;default:{let e=Math.floor(r[4].value/u[4].value)*u[4].value,n=Math.ceil(r[4].value/u[4].value)*u[4].value;if(e>n){const o=e;e=n,n=o}const o=Math.abs(r[4].value-e),t=Math.abs(r[4].value-n);i=o===t?n:o0?1/0:-1/0:Math.tan(l),numberToCalculation(e,l)}function subtraction(o){if(2!==o.length)return-1;const t=o[0].value;let r=o[1].value;if(t[0]===n.TokenType.Number&&r[0]===n.TokenType.Number){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Number,o.toString(),t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number}])}if(t[0]===n.TokenType.Percentage&&r[0]===n.TokenType.Percentage){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Percentage,o.toString()+"%",t[2],r[3],{value:o}])}if(t[0]===n.TokenType.Dimension&&r[0]===n.TokenType.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const o=t[4].value-r[4].value;return new e.TokenNode([n.TokenType.Dimension,o.toString()+t[4].unit,t[2],r[3],{value:o,type:t[4].type===n.NumberType.Integer&&r[4].type===n.NumberType.Integer?n.NumberType.Integer:n.NumberType.Number,unit:t[4].unit}])}return-1}function solveLog(o,t){if(1===t.length){const r=t[0];if(!r||!e.isTokenNode(r))return-1;const u=r.value;if(u[0]!==n.TokenType.Number)return-1;return numberToCalculation(o,Math.log(u[4].value))}if(2===t.length){const r=t[0];if(!r||!e.isTokenNode(r))return-1;const u=r.value;if(u[0]!==n.TokenType.Number)return-1;const i=t[1];if(!i||!e.isTokenNode(i))return-1;const a=i.value;if(a[0]!==n.TokenType.Number)return-1;return numberToCalculation(o,Math.log(u[4].value)/Math.log(a[4].value))}return-1}const b=new Map([["abs",function abs(e,n){return singleNodeSolver(e,n,solveAbs)}],["acos",function acos(e,n){return singleNodeSolver(e,n,solveACos)}],["asin",function asin(e,n){return singleNodeSolver(e,n,solveASin)}],["atan",function atan(e,n){return singleNodeSolver(e,n,solveATan)}],["atan2",function atan2(e,n){return twoCommaSeparatedNodesSolver(e,n,solveATan2)}],["calc",calc$1],["clamp",function clamp(o,t){const r=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),u=[],i=[],a=[];{let o=u;for(let t=0;t!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t);let u="";const i=[],a=[];{let o=i;for(let t=0;t!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t);if(1===r.length&&e.isTokenNode(r[0]))return{inputs:[r[0]],operation:unary};let u=0;for(;u!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=solve(calc$1(new e.FunctionNode([n.TokenType.Function,"calc(",-1,-1,{value:"calc"}],[n.TokenType.CloseParen,")",-1,-1,void 0],u),t));return-1===i?-1:r(o,i)}function twoCommaSeparatedNodesSolver(o,t,r){const u=resolveGlobalsAndConstants([...o.value.filter((n=>!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=[],a=[];{let o=i;for(let t=0;t!e.isCommentNode(n)&&!e.isWhitespaceNode(n)))],t),i=[];{const o=[];let r=[];for(let t=0;t{if(e.isFunctionNode(n)){const e=b.get(toLowerCaseAZ(n.getName()));if(e){const r=patchCalcResult(solve(e(n,t)),o);if(-1!==r)return r}}}))}const h=new Set(b.keys());exports.calc=function calc(o,t){return calcFromComponentValues(e.parseCommaSeparatedListOfComponentValues(n.tokenize({css:o}),{}),t).map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")},exports.calcFromComponentValues=calcFromComponentValues,exports.mathFunctionNames=h; diff --git a/node_modules/@csstools/css-calc/dist/index.d.ts b/node_modules/@csstools/css-calc/dist/index.d.ts index b7e6856b..9d31d3b5 100644 --- a/node_modules/@csstools/css-calc/dist/index.d.ts +++ b/node_modules/@csstools/css-calc/dist/index.d.ts @@ -1,6 +1,37 @@ -export type { conversionOptions } from './options'; -import type { conversionOptions } from './options'; import { ComponentValue } from '@csstools/css-parser-algorithms'; +import type { TokenDimension } from '@csstools/css-tokenizer'; +import type { TokenNumber } from '@csstools/css-tokenizer'; +import type { TokenPercentage } from '@csstools/css-tokenizer'; + export declare function calc(css: string, options?: conversionOptions): string; + export declare function calcFromComponentValues(componentValuesList: Array>, options?: conversionOptions): ComponentValue[][]; + +export declare type conversionOptions = { + /** + * Pass global values as a map of key value pairs. + */ + globals?: GlobalsWithStrings; + /** + * The default precision is fairly high. + * It aims to be high enough to make rounding unnoticeable in the browser. + * You can set it to a lower number to suite your needs. + */ + precision?: number; + /** + * By default this package will try to preserve units. + * The heuristic to do this is very simplistic. + * We take the first unit we encounter and try to convert other dimensions to that unit. + * + * This better matches what users expect from a CSS dev tool. + * + * If you want to have outputs that are closes to CSS serialized values you can set `true`. + */ + toCanonicalUnits?: boolean; +}; + +export declare type GlobalsWithStrings = Map; + export declare const mathFunctionNames: Set; + +export { } diff --git a/node_modules/@csstools/css-calc/dist/index.mjs b/node_modules/@csstools/css-calc/dist/index.mjs index 0bf6b70e..a45745b5 100644 --- a/node_modules/@csstools/css-calc/dist/index.mjs +++ b/node_modules/@csstools/css-calc/dist/index.mjs @@ -1 +1 @@ -import{TokenNode as e,isTokenNode as n,isCommentNode as t,isWhitespaceNode as r,isSimpleBlockNode as u,isFunctionNode as i,FunctionNode as a,WhitespaceNode as o,parseCommaSeparatedListOfComponentValues as l,replaceComponentValues as c}from"@csstools/css-parser-algorithms";import{TokenType as s,NumberType as v,isToken as m,tokenizer as f,tokenize as p,stringify as N}from"@csstools/css-tokenizer";const g=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(g,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}const b={cm:"px",in:"px",mm:"px",pc:"px",pt:"px",px:"px",q:"px",deg:"deg",grad:"deg",rad:"deg",turn:"deg",ms:"s",s:"s",hz:"hz",khz:"hz"},d=new Map([["cm",e=>e],["mm",e=>10*e],["q",e=>40*e],["in",e=>e/2.54],["pc",e=>e/2.54*6],["pt",e=>e/2.54*72],["px",e=>e/2.54*96]]),w=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),h=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),C=new Map([["hz",e=>e],["khz",e=>e/1e3]]),I=new Map([["cm",e=>2.54*e],["mm",e=>25.4*e],["q",e=>25.4*e*4],["in",e=>e],["pc",e=>6*e],["pt",e=>72*e],["px",e=>96*e]]),S=new Map([["hz",e=>1e3*e],["khz",e=>e]]),y=new Map([["cm",e=>e/10],["mm",e=>e],["q",e=>4*e],["in",e=>e/25.4],["pc",e=>e/25.4*6],["pt",e=>e/25.4*72],["px",e=>e/25.4*96]]),M=new Map([["ms",e=>e],["s",e=>e/1e3]]),P=new Map([["cm",e=>e/6*2.54],["mm",e=>e/6*25.4],["q",e=>e/6*25.4*4],["in",e=>e/6],["pc",e=>e],["pt",e=>e/6*72],["px",e=>e/6*96]]),D=new Map([["cm",e=>e/72*2.54],["mm",e=>e/72*25.4],["q",e=>e/72*25.4*4],["in",e=>e/72],["pc",e=>e/72*6],["pt",e=>e],["px",e=>e/72*96]]),T=new Map([["cm",e=>e/96*2.54],["mm",e=>e/96*25.4],["q",e=>e/96*25.4*4],["in",e=>e/96],["pc",e=>e/96*6],["pt",e=>e/96*72],["px",e=>e]]),A=new Map([["cm",e=>e/4/10],["mm",e=>e/4],["q",e=>e],["in",e=>e/4/25.4],["pc",e=>e/4/25.4*6],["pt",e=>e/4/25.4*72],["px",e=>e/4/25.4*96]]),k=new Map([["deg",e=>180*e/Math.PI],["grad",e=>180*e/Math.PI/.9],["rad",e=>e],["turn",e=>180*e/Math.PI/360]]),F=new Map([["ms",e=>1e3*e],["s",e=>e]]),x=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),O=new Map([["cm",d],["mm",y],["q",A],["in",I],["pc",P],["pt",D],["px",T],["ms",M],["s",F],["deg",w],["grad",h],["rad",k],["turn",x],["hz",C],["khz",S]]);function convertUnit(e,n){if(e[0]!==s.Dimension)return n;if(n[0]!==s.Dimension)return n;const t=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(n[4].unit);if(t===r)return n;const u=O.get(r);if(!u)return n;const i=u.get(t);if(!i)return n;const a=i(n[4].value);return[s.Dimension,a.toString()+e[4].unit,n[2],n[3],{value:a,unit:e[4].unit,type:Number.isInteger(a)?v.Integer:v.Number}]}function toCanonicalUnit(e){if(e[0]!==s.Dimension)return e;const n=toLowerCaseAZ(e[4].unit),t=b[n];if(n===t)return e;const r=O.get(n);if(!r)return e;const u=r.get(t);if(!u)return e;const i=u(e[4].value);return[s.Dimension,i.toString()+t,e[2],e[3],{value:i,unit:t,type:Number.isInteger(i)?v.Integer:v.Number}]}function addition(n){if(2!==n.length)return-1;const t=n[0].value;let r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value+r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Percentage){const n=t[4].value+r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const n=t[4].value+r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number,unit:t[4].unit}])}return-1}function division(n){if(2!==n.length)return-1;const t=n[0].value,r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:Number.isInteger(n)?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:Number.isInteger(n)?v.Integer:v.Number,unit:t[4].unit}])}return-1}function isCalculation(e){return!!e&&"object"==typeof e&&"inputs"in e&&Array.isArray(e.inputs)&&"operation"in e}function solve(e){if(-1===e)return-1;const t=[];for(let r=0;re.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.hypot(...a);return resultToCalculation(e,u,o)}function solveMax(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.max(...a);return resultToCalculation(e,u,o)}function solveMin(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.min(...a);return resultToCalculation(e,u,o)}function solveMod(e,n,t){const r=n.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;return i=0===u[4].value?Number.NaN:Number.isFinite(r[4].value)&&(Number.isFinite(u[4].value)||(u[4].value!==Number.POSITIVE_INFINITY||r[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*r[4].value,-0))&&(u[4].value!==Number.NEGATIVE_INFINITY||r[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*r[4].value,0)))?Number.isFinite(u[4].value)?(r[4].value%u[4].value+u[4].value)%u[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,i)}function solvePow(e,n,t){const r=n.value,u=t.value;if(r[0]!==s.Number)return-1;if(!twoOfSameNumeric(r,u))return-1;return numberToCalculation(e,Math.pow(r[4].value,u[4].value))}function solveRem(e,n,t){const r=n.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;return i=0===u[4].value?Number.NaN:Number.isFinite(r[4].value)?Number.isFinite(u[4].value)?r[4].value%u[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,i)}function solveRound(e,n,t,r){const u=t.value;if(!isNumeric(u))return-1;const i=convertUnit(u,r.value);if(!twoOfSameNumeric(u,i))return-1;let a;if(0===i[4].value)a=Number.NaN;else if(Number.isFinite(u[4].value)||Number.isFinite(i[4].value))if(!Number.isFinite(u[4].value)&&Number.isFinite(i[4].value))a=u[4].value;else if(Number.isFinite(u[4].value)&&!Number.isFinite(i[4].value))switch(n){case"down":a=u[4].value<0?-1/0:Object.is(-0,0*u[4].value)?-0:0;break;case"up":a=u[4].value>0?1/0:Object.is(0,0*u[4].value)?0:-0;break;default:a=Object.is(0,0*u[4].value)?0:-0}else if(Number.isFinite(i[4].value))switch(n){case"down":a=Math.floor(u[4].value/i[4].value)*i[4].value;break;case"up":a=Math.ceil(u[4].value/i[4].value)*i[4].value;break;case"to-zero":a=Math.trunc(u[4].value/i[4].value)*i[4].value;break;default:{let e=Math.floor(u[4].value/i[4].value)*i[4].value,n=Math.ceil(u[4].value/i[4].value)*i[4].value;if(e>n){const t=e;e=n,n=t}const t=Math.abs(u[4].value-e),r=Math.abs(u[4].value-n);a=t===r?n:t0?1/0:-1/0:Math.tan(i),numberToCalculation(e,i)}function subtraction(n){if(2!==n.length)return-1;const t=n[0].value;let r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value-r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Percentage){const n=t[4].value-r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const n=t[4].value-r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number,unit:t[4].unit}])}return-1}function solveLog(e,t){if(1===t.length){const r=t[0];if(!r||!n(r))return-1;const u=r.value;if(u[0]!==s.Number)return-1;return numberToCalculation(e,Math.log(u[4].value))}if(2===t.length){const r=t[0];if(!r||!n(r))return-1;const u=r.value;if(u[0]!==s.Number)return-1;const i=t[1];if(!i||!n(i))return-1;const a=i.value;if(a[0]!==s.Number)return-1;return numberToCalculation(e,Math.log(u[4].value)/Math.log(a[4].value))}return-1}const Z=new Map([["abs",function abs(e,n){return singleNodeSolver(e,n,solveAbs)}],["acos",function acos(e,n){return singleNodeSolver(e,n,solveACos)}],["asin",function asin(e,n){return singleNodeSolver(e,n,solveASin)}],["atan",function atan(e,n){return singleNodeSolver(e,n,solveATan)}],["atan2",function atan2(e,n){return twoCommaSeparatedNodesSolver(e,n,solveATan2)}],["calc",calc$1],["clamp",function clamp(e,u){const i=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],u),o=[],l=[],c=[];{let e=o;for(let t=0;t!t(e)&&!r(e)))],u);let o="";const l=[],c=[];{let e=l;for(let t=0;t!t(e)&&!r(e)))],a);if(1===o.length&&n(o[0]))return{inputs:[o[0]],operation:unary};let l=0;for(;l!t(e)&&!r(e)))],n),o=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],i),n));return-1===o?-1:u(e,o)}function twoCommaSeparatedNodesSolver(e,u,i){const o=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],u),l=[],c=[];{let e=l;for(let t=0;t!t(e)&&!r(e)))],u),l=[];{const e=[];let t=[];for(let r=0;re.map((e=>N(...e.tokens()))).join(""))).join(",")}function calcFromComponentValues(e,n){const t=tokenizeGlobals(null==n?void 0:n.globals);return c(e,(e=>{if(i(e)){const r=Z.get(toLowerCaseAZ(e.getName()));if(r){const u=patchCalcResult(solve(r(e,t)),n);if(-1!==u)return u}}}))}const z=new Set(Z.keys());export{calc,calcFromComponentValues,z as mathFunctionNames}; +import{TokenNode as e,isTokenNode as n,isCommentNode as t,isWhitespaceNode as r,isSimpleBlockNode as u,isFunctionNode as i,FunctionNode as a,WhitespaceNode as o,parseCommaSeparatedListOfComponentValues as l,replaceComponentValues as c}from"@csstools/css-parser-algorithms";import{TokenType as s,NumberType as v,isToken as m,tokenizer as f,tokenize as p,stringify as N}from"@csstools/css-tokenizer";const g=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(g,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}const b={cm:"px",in:"px",mm:"px",pc:"px",pt:"px",px:"px",q:"px",deg:"deg",grad:"deg",rad:"deg",turn:"deg",ms:"s",s:"s",hz:"hz",khz:"hz"},d=new Map([["cm",e=>e],["mm",e=>10*e],["q",e=>40*e],["in",e=>e/2.54],["pc",e=>e/2.54*6],["pt",e=>e/2.54*72],["px",e=>e/2.54*96]]),w=new Map([["deg",e=>e],["grad",e=>e/.9],["rad",e=>e/180*Math.PI],["turn",e=>e/360]]),h=new Map([["deg",e=>.9*e],["grad",e=>e],["rad",e=>.9*e/180*Math.PI],["turn",e=>.9*e/360]]),C=new Map([["hz",e=>e],["khz",e=>e/1e3]]),I=new Map([["cm",e=>2.54*e],["mm",e=>25.4*e],["q",e=>25.4*e*4],["in",e=>e],["pc",e=>6*e],["pt",e=>72*e],["px",e=>96*e]]),S=new Map([["hz",e=>1e3*e],["khz",e=>e]]),y=new Map([["cm",e=>e/10],["mm",e=>e],["q",e=>4*e],["in",e=>e/25.4],["pc",e=>e/25.4*6],["pt",e=>e/25.4*72],["px",e=>e/25.4*96]]),M=new Map([["ms",e=>e],["s",e=>e/1e3]]),P=new Map([["cm",e=>e/6*2.54],["mm",e=>e/6*25.4],["q",e=>e/6*25.4*4],["in",e=>e/6],["pc",e=>e],["pt",e=>e/6*72],["px",e=>e/6*96]]),D=new Map([["cm",e=>e/72*2.54],["mm",e=>e/72*25.4],["q",e=>e/72*25.4*4],["in",e=>e/72],["pc",e=>e/72*6],["pt",e=>e],["px",e=>e/72*96]]),T=new Map([["cm",e=>e/96*2.54],["mm",e=>e/96*25.4],["q",e=>e/96*25.4*4],["in",e=>e/96],["pc",e=>e/96*6],["pt",e=>e/96*72],["px",e=>e]]),A=new Map([["cm",e=>e/4/10],["mm",e=>e/4],["q",e=>e],["in",e=>e/4/25.4],["pc",e=>e/4/25.4*6],["pt",e=>e/4/25.4*72],["px",e=>e/4/25.4*96]]),k=new Map([["deg",e=>180*e/Math.PI],["grad",e=>180*e/Math.PI/.9],["rad",e=>e],["turn",e=>180*e/Math.PI/360]]),F=new Map([["ms",e=>1e3*e],["s",e=>e]]),x=new Map([["deg",e=>360*e],["grad",e=>360*e/.9],["rad",e=>360*e/180*Math.PI],["turn",e=>e]]),O=new Map([["cm",d],["mm",y],["q",A],["in",I],["pc",P],["pt",D],["px",T],["ms",M],["s",F],["deg",w],["grad",h],["rad",k],["turn",x],["hz",C],["khz",S]]);function convertUnit(e,n){if(e[0]!==s.Dimension)return n;if(n[0]!==s.Dimension)return n;const t=toLowerCaseAZ(e[4].unit),r=toLowerCaseAZ(n[4].unit);if(t===r)return n;const u=O.get(r);if(!u)return n;const i=u.get(t);if(!i)return n;const a=i(n[4].value);return[s.Dimension,a.toString()+e[4].unit,n[2],n[3],{value:a,unit:e[4].unit,type:Number.isInteger(a)?v.Integer:v.Number}]}function toCanonicalUnit(e){if(e[0]!==s.Dimension)return e;const n=toLowerCaseAZ(e[4].unit),t=b[n];if(n===t)return e;const r=O.get(n);if(!r)return e;const u=r.get(t);if(!u)return e;const i=u(e[4].value);return[s.Dimension,i.toString()+t,e[2],e[3],{value:i,unit:t,type:Number.isInteger(i)?v.Integer:v.Number}]}function addition(n){if(2!==n.length)return-1;const t=n[0].value;let r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value+r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Percentage){const n=t[4].value+r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const n=t[4].value+r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number,unit:t[4].unit}])}return-1}function division(n){if(2!==n.length)return-1;const t=n[0].value,r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:Number.isInteger(n)?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Number){const n=t[4].value/r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:Number.isInteger(n)?v.Integer:v.Number,unit:t[4].unit}])}return-1}function isCalculation(e){return!!e&&"object"==typeof e&&"inputs"in e&&Array.isArray(e.inputs)&&"operation"in e}function solve(e){if(-1===e)return-1;const t=[];for(let r=0;re.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.hypot(...a);return resultToCalculation(e,u,o)}function solveMax(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.max(...a);return resultToCalculation(e,u,o)}function solveMin(e,t){const r=t[0];if(!r||!n(r))return-1;if(1!==new Set(t.map((e=>e.type))).size)return-1;const u=r.value;if(!isNumeric(u))return-1;const i=t.map((e=>convertUnit(u,e.value)));if(!arrayOfSameNumeric(i))return-1;const a=i.map((e=>e[4].value)),o=Math.min(...a);return resultToCalculation(e,u,o)}function solveMod(e,n,t){const r=n.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;return i=0===u[4].value?Number.NaN:Number.isFinite(r[4].value)&&(Number.isFinite(u[4].value)||(u[4].value!==Number.POSITIVE_INFINITY||r[4].value!==Number.NEGATIVE_INFINITY&&!Object.is(0*r[4].value,-0))&&(u[4].value!==Number.NEGATIVE_INFINITY||r[4].value!==Number.POSITIVE_INFINITY&&!Object.is(0*r[4].value,0)))?Number.isFinite(u[4].value)?(r[4].value%u[4].value+u[4].value)%u[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,i)}function solvePow(e,n,t){const r=n.value,u=t.value;if(r[0]!==s.Number)return-1;if(!twoOfSameNumeric(r,u))return-1;return numberToCalculation(e,Math.pow(r[4].value,u[4].value))}function solveRem(e,n,t){const r=n.value;if(!isNumeric(r))return-1;const u=convertUnit(r,t.value);if(!twoOfSameNumeric(r,u))return-1;let i;return i=0===u[4].value?Number.NaN:Number.isFinite(r[4].value)?Number.isFinite(u[4].value)?r[4].value%u[4].value:r[4].value:Number.NaN,resultToCalculation(e,r,i)}function solveRound(e,n,t,r){const u=t.value;if(!isNumeric(u))return-1;const i=convertUnit(u,r.value);if(!twoOfSameNumeric(u,i))return-1;let a;if(0===i[4].value)a=Number.NaN;else if(Number.isFinite(u[4].value)||Number.isFinite(i[4].value))if(!Number.isFinite(u[4].value)&&Number.isFinite(i[4].value))a=u[4].value;else if(Number.isFinite(u[4].value)&&!Number.isFinite(i[4].value))switch(n){case"down":a=u[4].value<0?-1/0:Object.is(-0,0*u[4].value)?-0:0;break;case"up":a=u[4].value>0?1/0:Object.is(0,0*u[4].value)?0:-0;break;default:a=Object.is(0,0*u[4].value)?0:-0}else if(Number.isFinite(i[4].value))switch(n){case"down":a=Math.floor(u[4].value/i[4].value)*i[4].value;break;case"up":a=Math.ceil(u[4].value/i[4].value)*i[4].value;break;case"to-zero":a=Math.trunc(u[4].value/i[4].value)*i[4].value;break;default:{let e=Math.floor(u[4].value/i[4].value)*i[4].value,n=Math.ceil(u[4].value/i[4].value)*i[4].value;if(e>n){const t=e;e=n,n=t}const t=Math.abs(u[4].value-e),r=Math.abs(u[4].value-n);a=t===r?n:t0?1/0:-1/0:Math.tan(i),numberToCalculation(e,i)}function subtraction(n){if(2!==n.length)return-1;const t=n[0].value;let r=n[1].value;if(t[0]===s.Number&&r[0]===s.Number){const n=t[4].value-r[4].value;return new e([s.Number,n.toString(),t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number}])}if(t[0]===s.Percentage&&r[0]===s.Percentage){const n=t[4].value-r[4].value;return new e([s.Percentage,n.toString()+"%",t[2],r[3],{value:n}])}if(t[0]===s.Dimension&&r[0]===s.Dimension&&(r=convertUnit(t,r),toLowerCaseAZ(t[4].unit)===toLowerCaseAZ(r[4].unit))){const n=t[4].value-r[4].value;return new e([s.Dimension,n.toString()+t[4].unit,t[2],r[3],{value:n,type:t[4].type===v.Integer&&r[4].type===v.Integer?v.Integer:v.Number,unit:t[4].unit}])}return-1}function solveLog(e,t){if(1===t.length){const r=t[0];if(!r||!n(r))return-1;const u=r.value;if(u[0]!==s.Number)return-1;return numberToCalculation(e,Math.log(u[4].value))}if(2===t.length){const r=t[0];if(!r||!n(r))return-1;const u=r.value;if(u[0]!==s.Number)return-1;const i=t[1];if(!i||!n(i))return-1;const a=i.value;if(a[0]!==s.Number)return-1;return numberToCalculation(e,Math.log(u[4].value)/Math.log(a[4].value))}return-1}const Z=new Map([["abs",function abs(e,n){return singleNodeSolver(e,n,solveAbs)}],["acos",function acos(e,n){return singleNodeSolver(e,n,solveACos)}],["asin",function asin(e,n){return singleNodeSolver(e,n,solveASin)}],["atan",function atan(e,n){return singleNodeSolver(e,n,solveATan)}],["atan2",function atan2(e,n){return twoCommaSeparatedNodesSolver(e,n,solveATan2)}],["calc",calc$1],["clamp",function clamp(e,u){const i=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],u),o=[],l=[],c=[];{let e=o;for(let t=0;t!t(e)&&!r(e)))],u);let o="";const l=[],c=[];{let e=l;for(let t=0;t!t(e)&&!r(e)))],a);if(1===o.length&&n(o[0]))return{inputs:[o[0]],operation:unary};let l=0;for(;l!t(e)&&!r(e)))],n),o=solve(calc$1(new a([s.Function,"calc(",-1,-1,{value:"calc"}],[s.CloseParen,")",-1,-1,void 0],i),n));return-1===o?-1:u(e,o)}function twoCommaSeparatedNodesSolver(e,u,i){const o=resolveGlobalsAndConstants([...e.value.filter((e=>!t(e)&&!r(e)))],u),l=[],c=[];{let e=l;for(let t=0;t!t(e)&&!r(e)))],u),l=[];{const e=[];let t=[];for(let r=0;re.map((e=>N(...e.tokens()))).join(""))).join(",")}function calcFromComponentValues(e,n){const t=tokenizeGlobals(n?.globals);return c(e,(e=>{if(i(e)){const r=Z.get(toLowerCaseAZ(e.getName()));if(r){const u=patchCalcResult(solve(r(e,t)),n);if(-1!==u)return u}}}))}const z=new Set(Z.keys());export{calc,calcFromComponentValues,z as mathFunctionNames}; diff --git a/node_modules/@csstools/css-calc/dist/operation/addition.d.ts b/node_modules/@csstools/css-calc/dist/operation/addition.d.ts deleted file mode 100644 index 70e02cfd..00000000 --- a/node_modules/@csstools/css-calc/dist/operation/addition.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { TokenNode } from '@csstools/css-parser-algorithms'; -export declare function addition(inputs: Array): TokenNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/operation/division.d.ts b/node_modules/@csstools/css-calc/dist/operation/division.d.ts deleted file mode 100644 index 5d6b01fd..00000000 --- a/node_modules/@csstools/css-calc/dist/operation/division.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { TokenNode } from '@csstools/css-parser-algorithms'; -export declare function division(inputs: Array): TokenNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/operation/multiplication.d.ts b/node_modules/@csstools/css-calc/dist/operation/multiplication.d.ts deleted file mode 100644 index d48978d6..00000000 --- a/node_modules/@csstools/css-calc/dist/operation/multiplication.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { TokenNode } from '@csstools/css-parser-algorithms'; -export declare function multiplication(inputs: Array): TokenNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/operation/operation.d.ts b/node_modules/@csstools/css-calc/dist/operation/operation.d.ts deleted file mode 100644 index aed9e0e3..00000000 --- a/node_modules/@csstools/css-calc/dist/operation/operation.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TokenNode } from '@csstools/css-parser-algorithms'; -export type Operation = (inputs: Array) => TokenNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/operation/subtraction.d.ts b/node_modules/@csstools/css-calc/dist/operation/subtraction.d.ts deleted file mode 100644 index 0ac3f6be..00000000 --- a/node_modules/@csstools/css-calc/dist/operation/subtraction.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { TokenNode } from '@csstools/css-parser-algorithms'; -export declare function subtraction(inputs: Array): TokenNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/operation/unary.d.ts b/node_modules/@csstools/css-calc/dist/operation/unary.d.ts deleted file mode 100644 index b27463ec..00000000 --- a/node_modules/@csstools/css-calc/dist/operation/unary.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { TokenNode } from '@csstools/css-parser-algorithms'; -export declare function unary(inputs: Array): TokenNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/options.d.ts b/node_modules/@csstools/css-calc/dist/options.d.ts deleted file mode 100644 index f24a05fd..00000000 --- a/node_modules/@csstools/css-calc/dist/options.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { GlobalsWithStrings } from './util/globals'; -export type conversionOptions = { - /** - * Pass global values as a map of key value pairs. - */ - globals?: GlobalsWithStrings; - /** - * The default precision is fairly high. - * It aims to be high enough to make rounding unnoticeable in the browser. - * You can set it to a lower number to suite your needs. - */ - precision?: number; - /** - * By default this package will try to preserve units. - * The heuristic to do this is very simplistic. - * We take the first unit we encounter and try to convert other dimensions to that unit. - * - * This better matches what users expect from a CSS dev tool. - * - * If you want to have outputs that are closes to CSS serialized values you can set `true`. - */ - toCanonicalUnits?: boolean; -}; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/canonical.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/canonical.d.ts deleted file mode 100644 index 1c593d50..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/canonical.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const canonicalUnits: Record; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/cm.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/cm.d.ts deleted file mode 100644 index 030a42d8..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/cm.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_cm: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/deg.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/deg.d.ts deleted file mode 100644 index 7e0fb6c0..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/deg.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_deg: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/grad.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/grad.d.ts deleted file mode 100644 index 9423ffcf..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/grad.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_grad: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/hz.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/hz.d.ts deleted file mode 100644 index 9957a80e..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/hz.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_hz: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/in.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/in.d.ts deleted file mode 100644 index 5bf4ed81..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/in.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_in: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/index.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/index.d.ts deleted file mode 100644 index e9a5468b..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/index.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { CSSToken } from '@csstools/css-tokenizer'; -export declare const conversions: Map number>>; -export declare function convertUnit(a: CSSToken, b: T): T; -export declare function toCanonicalUnit(a: T): T; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/khz.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/khz.d.ts deleted file mode 100644 index c1df1229..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/khz.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_khz: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/mm.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/mm.d.ts deleted file mode 100644 index 570b2447..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/mm.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_mm: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/ms.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/ms.d.ts deleted file mode 100644 index 68d9231d..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/ms.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_ms: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/pc.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/pc.d.ts deleted file mode 100644 index d13b7da9..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/pc.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_pc: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/pt.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/pt.d.ts deleted file mode 100644 index 09407c95..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/pt.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_pt: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/px.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/px.d.ts deleted file mode 100644 index 641ea77f..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/px.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_px: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/q.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/q.d.ts deleted file mode 100644 index 5862e51d..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/q.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_q: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/rad.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/rad.d.ts deleted file mode 100644 index 70faf8e9..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/rad.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_rad: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/s.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/s.d.ts deleted file mode 100644 index 8240e359..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/s.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_s: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/unit-conversions/turn.d.ts b/node_modules/@csstools/css-calc/dist/unit-conversions/turn.d.ts deleted file mode 100644 index e721ff8e..00000000 --- a/node_modules/@csstools/css-calc/dist/unit-conversions/turn.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_turn: Map number>; diff --git a/node_modules/@csstools/css-calc/dist/util/canonical-unit.d.ts b/node_modules/@csstools/css-calc/dist/util/canonical-unit.d.ts deleted file mode 100644 index 49f5e457..00000000 --- a/node_modules/@csstools/css-calc/dist/util/canonical-unit.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function patchCanonicalUnit(x: TokenNode | FunctionNode | -1): TokenNode | FunctionNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/util/globals.d.ts b/node_modules/@csstools/css-calc/dist/util/globals.d.ts deleted file mode 100644 index c9e43b74..00000000 --- a/node_modules/@csstools/css-calc/dist/util/globals.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { TokenDimension, TokenNumber, TokenPercentage } from '@csstools/css-tokenizer'; -export type Globals = Map; -export type GlobalsWithStrings = Map; -export declare function tokenizeGlobals(x: GlobalsWithStrings | undefined): Globals; diff --git a/node_modules/@csstools/css-calc/dist/util/infinity.d.ts b/node_modules/@csstools/css-calc/dist/util/infinity.d.ts deleted file mode 100644 index 588d3e13..00000000 --- a/node_modules/@csstools/css-calc/dist/util/infinity.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function patchInfinity(x: TokenNode | FunctionNode | -1): TokenNode | FunctionNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/util/kind-of-number.d.ts b/node_modules/@csstools/css-calc/dist/util/kind-of-number.d.ts deleted file mode 100644 index dac78981..00000000 --- a/node_modules/@csstools/css-calc/dist/util/kind-of-number.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CSSToken, TokenDimension, TokenNumber, TokenPercentage } from '@csstools/css-tokenizer'; -export declare function isNumeric(x: CSSToken): x is TokenDimension | TokenPercentage | TokenNumber; -export declare function isDimensionOrNumber(x: CSSToken): x is TokenDimension | TokenNumber; -export declare function arrayOfSameNumeric(x: Array): x is Array; -export declare function twoOfSameNumeric(x: T, y: CSSToken): y is T; diff --git a/node_modules/@csstools/css-calc/dist/util/minus-zero.d.ts b/node_modules/@csstools/css-calc/dist/util/minus-zero.d.ts deleted file mode 100644 index 67b9e553..00000000 --- a/node_modules/@csstools/css-calc/dist/util/minus-zero.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function patchMinusZero(x: TokenNode | FunctionNode | -1): TokenNode | FunctionNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/util/nan.d.ts b/node_modules/@csstools/css-calc/dist/util/nan.d.ts deleted file mode 100644 index a7e03354..00000000 --- a/node_modules/@csstools/css-calc/dist/util/nan.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function patchNaN(x: TokenNode | FunctionNode | -1): TokenNode | FunctionNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/util/patch-result.d.ts b/node_modules/@csstools/css-calc/dist/util/patch-result.d.ts deleted file mode 100644 index 03330b3e..00000000 --- a/node_modules/@csstools/css-calc/dist/util/patch-result.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -import { conversionOptions } from '../options'; -export declare function patchCalcResult(x: TokenNode | FunctionNode | -1, options?: conversionOptions): TokenNode | FunctionNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/util/precision.d.ts b/node_modules/@csstools/css-calc/dist/util/precision.d.ts deleted file mode 100644 index 424909c1..00000000 --- a/node_modules/@csstools/css-calc/dist/util/precision.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { FunctionNode, TokenNode } from '@csstools/css-parser-algorithms'; -export declare function patchPrecision(x: TokenNode | FunctionNode | -1, precision?: number): TokenNode | FunctionNode | -1; diff --git a/node_modules/@csstools/css-calc/dist/util/to-lower-case-a-z.d.ts b/node_modules/@csstools/css-calc/dist/util/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e..00000000 --- a/node_modules/@csstools/css-calc/dist/util/to-lower-case-a-z.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/css-calc/package.json b/node_modules/@csstools/css-calc/package.json index 3744fe1e..16e5350e 100644 --- a/node_modules/@csstools/css-calc/package.json +++ b/node_modules/@csstools/css-calc/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/css-calc", "description": "Solve CSS math expressions", - "version": "1.1.4", + "version": "1.1.5", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,15 +48,8 @@ "dist" ], "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs" + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc#readme", "repository": { @@ -65,8 +61,5 @@ "keywords": [ "calc", "css" - ], - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/css-color-parser/CHANGELOG.md b/node_modules/@csstools/css-color-parser/CHANGELOG.md index e0536567..be3d1ccf 100644 --- a/node_modules/@csstools/css-color-parser/CHANGELOG.md +++ b/node_modules/@csstools/css-color-parser/CHANGELOG.md @@ -1,5 +1,18 @@ # Changes to CSS Color Parser +### 1.5.0 + +_December 15, 2023_ + +- Add the `Experimental` syntax flag, to be used in future features. +- Add a `serializeHSL` function. +- Fix type definitions +- Improve JS Doc comments +- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#400) (major) +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch) + ### 1.4.0 _October 9, 2023_ @@ -12,87 +25,4 @@ _October 2, 2023_ - Fix interpolation of `hue` when either or both components are `none` and `longer` is the interpolation method. -### 1.3.2 - -_September 24, 2023_ - -- Small performance improvements -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) -- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#114) (patch) - -### 1.3.1 - -_September 2, 2023_ - -- Fix clipping of values in `hsl`, `hwb` and `rgb` color notations. -- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#302) (patch) - -### 1.3.0 - -_August 28, 2023_ - -- Add a `serializeOKLCH` function. -- Always convert to the target color space, even when the input color is already in that specific color space. -- Correctly apply the hue interpolation method when either angle is missing. -- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#301) (patch) - -### 1.2.3 - -_July 24, 2023_ - -- Allow number values in `hwb`. -- Fix value calculation for `s`, `l` (`hsl`) and `w`, `b` (`hwb`) components in relative color syntax. -- `a` and `b` components in `lab` and `oklab` are analogous. -- Powerless components are limited to achromatic colors and only affect `hue` unless otherwise specified. -- Fix value normalization. -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) -- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#113) (patch) - -### 1.2.2 - -_July 3, 2023_ - -- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#300) (major) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#112) (patch) - -### 1.2.1 - -_June 14, 2023_ - -- Fix value calculation for `hue` components in relative color syntax. - -### 1.2.0 - -_May 19, 2023_ - -- Add support for relative color syntax. -- Updated `@csstools/color-helpers` to `2.1.0` (minor) - -### 1.1.2 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-calc` to `1.1.1` (patch) - -### 1.1.1 - -_April 10, 2023_ - -- Improve the detection of math function in color notations. - -### 1.1.0 - -_March 28, 2023_ - -- Add a flag to `serializeP3` and `serializeRGB` to skip gamut mapping. - -### 1.0.0 - -_March 25, 2023_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md) diff --git a/node_modules/@csstools/css-color-parser/dist/color-data.d.ts b/node_modules/@csstools/css-color-parser/dist/color-data.d.ts deleted file mode 100644 index 9fa6a335..00000000 --- a/node_modules/@csstools/css-color-parser/dist/color-data.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Color } from '@csstools/color-helpers'; -import type { ComponentValue } from '@csstools/css-parser-algorithms'; -import { ColorNotation } from './color-notation'; -import { TokenNumber } from '@csstools/css-tokenizer'; -export type ColorData = { - colorNotation: ColorNotation; - channels: Color; - alpha: number | ComponentValue; - syntaxFlags: Set; -}; -export declare enum SyntaxFlag { - ColorKeyword = "color-keyword", - HasAlpha = "has-alpha", - HasDimensionValues = "has-dimension-values", - HasNoneKeywords = "has-none-keywords", - HasNumberValues = "has-number-values", - HasPercentageAlpha = "has-percentage-alpha", - HasPercentageValues = "has-percentage-values", - HasVariableAlpha = "has-variable-alpha", - Hex = "hex", - LegacyHSL = "legacy-hsl", - LegacyRGB = "legacy-rgb", - NamedColor = "named-color", - RelativeColorSyntax = "relative-color-syntax", - ColorMix = "color-mix" -} -export declare function colorData_to_XYZ_D50(colorData: ColorData): ColorData; -export declare function colorDataTo(colorData: ColorData, toNotation: ColorNotation): ColorData; -export declare function convertPowerlessComponentsToMissingComponents(a: Color, colorNotation: ColorNotation): Color; -export declare function convertPowerlessComponentsToZeroValuesForDisplay(a: Color, colorNotation: ColorNotation): Color; -export declare function normalizeRelativeColorDataChannels(x: ColorData): Map; -export declare function noneToZeroInRelativeColorDataChannels(x: Map): Map; -export declare function colorDataFitsRGB_Gamut(x: ColorData): boolean; -export declare function colorDataFitsDisplayP3_Gamut(x: ColorData): boolean; diff --git a/node_modules/@csstools/css-color-parser/dist/color-notation.d.ts b/node_modules/@csstools/css-color-parser/dist/color-notation.d.ts deleted file mode 100644 index 242ebfb8..00000000 --- a/node_modules/@csstools/css-color-parser/dist/color-notation.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare enum ColorNotation { - A98_RGB = "a98-rgb", - Display_P3 = "display-p3", - HEX = "hex", - HSL = "hsl", - HWB = "hwb", - LCH = "lch", - Lab = "lab", - Linear_sRGB = "srgb-linear", - OKLCH = "oklch", - OKLab = "oklab", - ProPhoto_RGB = "prophoto-rgb", - RGB = "rgb", - sRGB = "srgb", - Rec2020 = "rec2020", - XYZ_D50 = "xyz-d50", - XYZ_D65 = "xyz-d65" -} diff --git a/node_modules/@csstools/css-color-parser/dist/color-parser.d.ts b/node_modules/@csstools/css-color-parser/dist/color-parser.d.ts deleted file mode 100644 index 325c0657..00000000 --- a/node_modules/@csstools/css-color-parser/dist/color-parser.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from './color-data'; -import type { ComponentValue } from '@csstools/css-parser-algorithms'; -export type ColorParser = (x: ComponentValue) => ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/color-keyword.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/color-keyword.d.ts deleted file mode 100644 index 6652208f..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/color-keyword.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ColorData } from '../color-data'; -export declare function colorKeyword(name: string): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/color-mix.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/color-mix.d.ts deleted file mode 100644 index 8fc6aeda..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/color-mix.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import type { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function colorMix(colorMixNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/color-normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/color-normalize-channel-values.d.ts deleted file mode 100644 index 51b6624d..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/color-normalize-channel-values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalize_Color_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/color.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/color.d.ts deleted file mode 100644 index 34b95e2c..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/color.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function color(colorFunctionNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/hex.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/hex.d.ts deleted file mode 100644 index 8b66473e..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/hex.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { TokenHash } from '@csstools/css-tokenizer'; -export declare function hex(hexToken: TokenHash): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/hsl-normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/hsl-normalize-channel-values.d.ts deleted file mode 100644 index 068bcae7..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/hsl-normalize-channel-values.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalize_legacy_HSL_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; -export declare function normalize_modern_HSL_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/hsl.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/hsl.d.ts deleted file mode 100644 index 919acdda..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/hsl.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function hsl(hslNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/hue-normalize-channel-value.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/hue-normalize-channel-value.d.ts deleted file mode 100644 index 41a96c64..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/hue-normalize-channel-value.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TokenNumber } from '@csstools/css-tokenizer'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalizeHue(token: CSSToken): TokenNumber | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/hwb-normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/hwb-normalize-channel-values.d.ts deleted file mode 100644 index 81da6aac..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/hwb-normalize-channel-values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalize_HWB_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/hwb.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/hwb.d.ts deleted file mode 100644 index 1ddffe98..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/hwb.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import type { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function hwb(hwbNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/lab-normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/lab-normalize-channel-values.d.ts deleted file mode 100644 index 73587504..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/lab-normalize-channel-values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalize_Lab_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/lab.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/lab.d.ts deleted file mode 100644 index fbbf35aa..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/lab.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import type { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function lab(labNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/lch-normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/lch-normalize-channel-values.d.ts deleted file mode 100644 index a2227e44..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/lch-normalize-channel-values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalize_LCH_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/lch.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/lch.d.ts deleted file mode 100644 index 91788903..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/lch.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import type { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function lch(lchNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/named-color.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/named-color.d.ts deleted file mode 100644 index 376a093a..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/named-color.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ColorData } from '../color-data'; -export declare function namedColor(name: string): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/normalize-channel-values.d.ts deleted file mode 100644 index c32172fd..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/normalize-channel-values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export type normalizeChannelValuesFn = (token: CSSToken, index: number, colorData: ColorData) => CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/normalize.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/normalize.d.ts deleted file mode 100644 index 0b57af5e..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/normalize.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function normalize(x: number, scale: number, min: number, max: number): number; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/oklab-normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/oklab-normalize-channel-values.d.ts deleted file mode 100644 index 97b82792..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/oklab-normalize-channel-values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalize_OKLab_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/oklab.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/oklab.d.ts deleted file mode 100644 index 96e03847..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/oklab.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import type { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function oklab(oklabNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/oklch-normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/oklch-normalize-channel-values.d.ts deleted file mode 100644 index afd514b3..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/oklch-normalize-channel-values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalize_OKLCH_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/oklch.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/oklch.d.ts deleted file mode 100644 index d70197e7..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/oklch.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import type { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function oklch(oklchNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/rgb-normalize-channel-values.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/rgb-normalize-channel-values.d.ts deleted file mode 100644 index eb3e89bc..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/rgb-normalize-channel-values.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare function normalize_legacy_sRGB_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; -export declare function normalize_modern_sRGB_ChannelValues(token: CSSToken, index: number, colorData: ColorData): CSSToken | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/rgb.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/rgb.d.ts deleted file mode 100644 index c4aacca1..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/rgb.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { ColorParser } from '../color-parser'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function rgb(rgbNode: FunctionNode, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/three-channel-legacy-syntax.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/three-channel-legacy-syntax.d.ts deleted file mode 100644 index 5bfe8c38..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/three-channel-legacy-syntax.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { ColorData } from '../color-data'; -import type { FunctionNode } from '@csstools/css-parser-algorithms'; -import { ColorNotation } from '../color-notation'; -import { SyntaxFlag } from '../color-data'; -import { normalizeChannelValuesFn } from './normalize-channel-values'; -export declare function threeChannelLegacySyntax(colorFunctionNode: FunctionNode, normalizeChannelValues: normalizeChannelValuesFn, colorNotation: ColorNotation, syntaxFlags: Array): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/functions/three-channel-space-separated.d.ts b/node_modules/@csstools/css-color-parser/dist/functions/three-channel-space-separated.d.ts deleted file mode 100644 index 8fb7e41b..00000000 --- a/node_modules/@csstools/css-color-parser/dist/functions/three-channel-space-separated.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { ColorData } from '../color-data'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -import { ColorNotation } from '../color-notation'; -import { SyntaxFlag } from '../color-data'; -import { normalizeChannelValuesFn } from './normalize-channel-values'; -import { ColorParser } from '../color-parser'; -export declare function threeChannelSpaceSeparated(colorFunctionNode: FunctionNode, normalizeChannelValues: normalizeChannelValuesFn, colorNotation: ColorNotation, syntaxFlags: Array, colorParser: ColorParser): ColorData | false; diff --git a/node_modules/@csstools/css-color-parser/dist/gamut-mapping/p3.d.ts b/node_modules/@csstools/css-color-parser/dist/gamut-mapping/p3.d.ts deleted file mode 100644 index d0130b52..00000000 --- a/node_modules/@csstools/css-color-parser/dist/gamut-mapping/p3.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Color } from '@csstools/color-helpers'; -export declare function XYZ_D50_to_P3_Gamut(color: Color): Color; diff --git a/node_modules/@csstools/css-color-parser/dist/gamut-mapping/srgb.d.ts b/node_modules/@csstools/css-color-parser/dist/gamut-mapping/srgb.d.ts deleted file mode 100644 index 87b3ad80..00000000 --- a/node_modules/@csstools/css-color-parser/dist/gamut-mapping/srgb.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Color } from '@csstools/color-helpers'; -export declare function XYZ_D50_to_sRGB_Gamut(color: Color): Color; diff --git a/node_modules/@csstools/css-color-parser/dist/index.cjs b/node_modules/@csstools/css-color-parser/dist/index.cjs index 8cd9b2be..52d4c22c 100644 --- a/node_modules/@csstools/css-color-parser/dist/index.cjs +++ b/node_modules/@csstools/css-color-parser/dist/index.cjs @@ -1 +1 @@ -"use strict";var e,o,n=require("@csstools/css-tokenizer"),a=require("@csstools/color-helpers"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-calc");function colorData_to_XYZ_D50(e){switch(e.colorNotation){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:case exports.ColorNotation.sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.sRGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Linear_sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.lin_sRGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Display_P3:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.P3_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Rec2020:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.rec_2020_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.A98_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.a98_RGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.ProPhoto_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.ProPhoto_RGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.HSL:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.HSL_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.HWB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.HWB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Lab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.Lab_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.OKLab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.OKLab_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.LCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.LCH_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.OKLCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.OKLCH_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.XYZ_D50:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.XYZ_D50_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.XYZ_D65:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:a.xyz.XYZ_D65_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};default:throw new Error("Unsupported color notation")}}exports.ColorNotation=void 0,(e=exports.ColorNotation||(exports.ColorNotation={})).A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65",exports.SyntaxFlag=void 0,(o=exports.SyntaxFlag||(exports.SyntaxFlag={})).ColorKeyword="color-keyword",o.HasAlpha="has-alpha",o.HasDimensionValues="has-dimension-values",o.HasNoneKeywords="has-none-keywords",o.HasNumberValues="has-number-values",o.HasPercentageAlpha="has-percentage-alpha",o.HasPercentageValues="has-percentage-values",o.HasVariableAlpha="has-variable-alpha",o.Hex="hex",o.LegacyHSL="legacy-hsl",o.LegacyRGB="legacy-rgb",o.NamedColor="named-color",o.RelativeColorSyntax="relative-color-syntax",o.ColorMix="color-mix";const s=new Set([exports.ColorNotation.A98_RGB,exports.ColorNotation.Display_P3,exports.ColorNotation.HEX,exports.ColorNotation.Linear_sRGB,exports.ColorNotation.ProPhoto_RGB,exports.ColorNotation.RGB,exports.ColorNotation.sRGB,exports.ColorNotation.Rec2020,exports.ColorNotation.XYZ_D50,exports.ColorNotation.XYZ_D65]);function colorDataTo(e,o){const n={...e};if(e.colorNotation!==o){const e=colorData_to_XYZ_D50(n);switch(o){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:n.colorNotation=exports.ColorNotation.RGB,n.channels=a.xyz.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.sRGB:n.colorNotation=exports.ColorNotation.sRGB,n.channels=a.xyz.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.Linear_sRGB:n.colorNotation=exports.ColorNotation.Linear_sRGB,n.channels=a.xyz.XYZ_D50_to_lin_sRGB(e.channels);break;case exports.ColorNotation.Display_P3:n.colorNotation=exports.ColorNotation.Display_P3,n.channels=a.xyz.XYZ_D50_to_P3(e.channels);break;case exports.ColorNotation.Rec2020:n.colorNotation=exports.ColorNotation.Rec2020,n.channels=a.xyz.XYZ_D50_to_rec_2020(e.channels);break;case exports.ColorNotation.ProPhoto_RGB:n.colorNotation=exports.ColorNotation.ProPhoto_RGB,n.channels=a.xyz.XYZ_D50_to_ProPhoto(e.channels);break;case exports.ColorNotation.A98_RGB:n.colorNotation=exports.ColorNotation.A98_RGB,n.channels=a.xyz.XYZ_D50_to_a98_RGB(e.channels);break;case exports.ColorNotation.HSL:n.colorNotation=exports.ColorNotation.HSL,n.channels=a.xyz.XYZ_D50_to_HSL(e.channels);break;case exports.ColorNotation.HWB:n.colorNotation=exports.ColorNotation.HWB,n.channels=a.xyz.XYZ_D50_to_HWB(e.channels);break;case exports.ColorNotation.Lab:n.colorNotation=exports.ColorNotation.Lab,n.channels=a.xyz.XYZ_D50_to_Lab(e.channels);break;case exports.ColorNotation.LCH:n.colorNotation=exports.ColorNotation.LCH,n.channels=a.xyz.XYZ_D50_to_LCH(e.channels);break;case exports.ColorNotation.OKLCH:n.colorNotation=exports.ColorNotation.OKLCH,n.channels=a.xyz.XYZ_D50_to_OKLCH(e.channels);break;case exports.ColorNotation.OKLab:n.colorNotation=exports.ColorNotation.OKLab,n.channels=a.xyz.XYZ_D50_to_OKLab(e.channels);break;case exports.ColorNotation.XYZ_D50:n.colorNotation=exports.ColorNotation.XYZ_D50,n.channels=a.xyz.XYZ_D50_to_XYZ_D50(e.channels);break;case exports.ColorNotation.XYZ_D65:n.colorNotation=exports.ColorNotation.XYZ_D65,n.channels=a.xyz.XYZ_D50_to_XYZ_D65(e.channels);break;default:throw new Error("Unsupported color notation")}}else n.channels=e.channels.map((e=>Number.isNaN(e)?0:e));if(o===e.colorNotation)n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);else if(s.has(o)&&s.has(e.colorNotation))n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);else switch(o){case exports.ColorNotation.HSL:switch(e.colorNotation){case exports.ColorNotation.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:n.channels=carryForwardMissingComponents(e.channels,[2],n.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[2,1,0])}break;case exports.ColorNotation.HWB:switch(e.colorNotation){case exports.ColorNotation.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2])}break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:switch(e.colorNotation){case exports.ColorNotation.HSL:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0])}break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:switch(e.colorNotation){case exports.ColorNotation.HSL:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[2,1,0]);break;case exports.ColorNotation.HWB:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:n.channels=carryForwardMissingComponents(e.channels,[0],n.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:n.channels=carryForwardMissingComponents(e.channels,[0,1,2],n.channels,[0,1,2])}}return n.channels=convertPowerlessComponentsToMissingComponents(n.channels,o),n}function convertPowerlessComponentsToMissingComponents(e,o){const n=[...e];switch(o){case exports.ColorNotation.HSL:reducePrecision(n[1],4)<=0&&(n[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(n[1],4))+Math.max(0,reducePrecision(n[2],4))>=100&&(n[0]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(n[1],4)<=0&&(n[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(n[1],6)<=0&&(n[2]=NaN)}return n}function convertPowerlessComponentsToZeroValuesForDisplay(e,o){const n=[...e];switch(o){case exports.ColorNotation.HSL:(reducePrecision(n[2])<=0||reducePrecision(n[2])>=100)&&(n[0]=NaN,n[1]=NaN),reducePrecision(n[1])<=0&&(n[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(n[1]))+Math.max(0,reducePrecision(n[2]))>=100&&(n[0]=NaN);break;case exports.ColorNotation.Lab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case exports.ColorNotation.OKLab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN)}return n}function carryForwardMissingComponents(e,o,n,a){const t=[...n];for(const n of o)Number.isNaN(e[o[n]])&&(t[a[n]]=NaN);return t}function normalizeRelativeColorDataChannels(e){const o=new Map;switch(e.colorNotation){case exports.ColorNotation.RGB:case exports.ColorNotation.HEX:o.set("r",dummyNumberToken(255*e.channels[0])),o.set("g",dummyNumberToken(255*e.channels[1])),o.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HSL:o.set("h",dummyNumberToken(e.channels[0])),o.set("s",dummyNumberToken(e.channels[1])),o.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HWB:o.set("h",dummyNumberToken(e.channels[0])),o.set("w",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:o.set("l",dummyNumberToken(e.channels[0])),o.set("a",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:o.set("l",dummyNumberToken(e.channels[0])),o.set("c",dummyNumberToken(e.channels[1])),o.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.sRGB:case exports.ColorNotation.A98_RGB:case exports.ColorNotation.Display_P3:case exports.ColorNotation.Rec2020:case exports.ColorNotation.Linear_sRGB:case exports.ColorNotation.ProPhoto_RGB:o.set("r",dummyNumberToken(e.channels[0])),o.set("g",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.XYZ_D50:case exports.ColorNotation.XYZ_D65:o.set("x",dummyNumberToken(e.channels[0])),o.set("y",dummyNumberToken(e.channels[1])),o.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha))}return o}function noneToZeroInRelativeColorDataChannels(e){const o=new Map(e);for(const[n,a]of e)Number.isNaN(a[4].value)&&o.set(n,dummyNumberToken(0));return o}function dummyNumberToken(e){return[n.TokenType.Number,e.toString(),-1,-1,{value:e,type:n.NumberType.Number}]}function reducePrecision(e,o=7){if(Number.isNaN(e))return 0;const n=Math.pow(10,o);return Math.round(e*n)/n}function normalize(e,o,n,a){return Math.min(Math.max(e/o,n),a)}const l=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(l,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(e,o,a){if(e[0]===n.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return a.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[n.TokenType.Number,"none",e[2],e[3],{value:NaN,type:n.NumberType.Number}];if(e[0]===n.TokenType.Percentage){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}const i=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,o){const a=[],s=[],l=[],u=[];let c,p,N=!1,m=!1;const h={colorNotation:exports.ColorNotation.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let y=a;for(let x=0;x=0){i=u.value[4].value;continue}}return!1}if(!l)return!1;a.push({color:l,percentage:i}),l=!1,i=!1}}if(l&&a.push({color:l,percentage:i}),2!==a.length)return!1;let u=a[0].percentage,c=a[1].percentage;return(!1===u||!(u<0||u>100))&&((!1===c||!(c<0||c>100))&&(!1===u&&!1===c?(u=50,c=50):!1!==u&&!1===c?c=100-u:!1===u&&!1!==c&&(u=100-c),(0!==u||0!==c)&&(!1!==u&&!1!==c&&(u+c>100&&(u=u/(u+c)*100,c=c/(u+c)*100),u+c<100&&(s=(u+c)/100,u=u/(u+c)*100,c=c/(u+c)*100),{a:{color:a[0].color,percentage:u},b:{color:a[1].color,percentage:c},alphaMultiplier:s}))))}function colorMixRectangular(e,o){if(!o)return!1;const n=o.a.color,a=o.b.color,t=o.a.percentage/100;let r=n.channels,s=a.channels,l=exports.ColorNotation.RGB,i=n.alpha;if("number"!=typeof i)return!1;let u=a.alpha;if("number"!=typeof u)return!1;switch(i=Number.isNaN(i)?u:i,u=Number.isNaN(u)?i:u,e){case"srgb":l=exports.ColorNotation.RGB;break;case"srgb-linear":l=exports.ColorNotation.Linear_sRGB;break;case"lab":l=exports.ColorNotation.Lab;break;case"oklab":l=exports.ColorNotation.OKLab;break;case"xyz-d50":l=exports.ColorNotation.XYZ_D50;break;case"xyz":case"xyz-d65":l=exports.ColorNotation.XYZ_D65}r=colorDataTo(n,l).channels,s=colorDataTo(a,l).channels,r[0]=fillInMissingComponent(r[0],s[0]),s[0]=fillInMissingComponent(s[0],r[0]),r[1]=fillInMissingComponent(r[1],s[1]),s[1]=fillInMissingComponent(s[1],r[1]),r[2]=fillInMissingComponent(r[2],s[2]),s[2]=fillInMissingComponent(s[2],r[2]),r[0]=premultiply(r[0],i),r[1]=premultiply(r[1],i),r[2]=premultiply(r[2],i),s[0]=premultiply(s[0],u),s[1]=premultiply(s[1],u),s[2]=premultiply(s[2],u);const c=interpolate(i,u,t);return{colorNotation:l,channels:[un_premultiply(interpolate(r[0],s[0],t),c),un_premultiply(interpolate(r[1],s[1],t),c),un_premultiply(interpolate(r[2],s[2],t),c)],alpha:c*o.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])}}function colorMixPolar(e,o,n){if(!n)return!1;const a=n.a.color,t=n.b.color,r=n.a.percentage/100;let s=a.channels,l=t.channels,i=0,u=0,c=0,p=0,N=0,m=0,h=exports.ColorNotation.RGB,y=a.alpha;if("number"!=typeof y)return!1;let x=t.alpha;if("number"!=typeof x)return!1;switch(y=Number.isNaN(y)?x:y,x=Number.isNaN(x)?y:x,e){case"hsl":h=exports.ColorNotation.HSL;break;case"hwb":h=exports.ColorNotation.HWB;break;case"lch":h=exports.ColorNotation.LCH;break;case"oklch":h=exports.ColorNotation.OKLCH}switch(s=colorDataTo(a,h).channels,l=colorDataTo(t,h).channels,e){case"hsl":case"hwb":i=s[0],u=l[0],c=s[1],p=l[1],N=s[2],m=l[2];break;case"lch":case"oklch":c=s[0],p=l[0],N=s[1],m=l[1],i=s[2],u=l[2]}i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,p),p=fillInMissingComponent(p,c),N=fillInMissingComponent(N,m),m=fillInMissingComponent(m,N);const T=u-i;switch(o){case"shorter":T>180?i+=360:T<-180&&(u+=360);break;case"longer":-1800?i+=360:u+=360);break;case"increasing":T<0&&(u+=360);break;case"decreasing":T>0&&(i+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,y),N=premultiply(N,y),p=premultiply(p,x),m=premultiply(m,x);let b=[0,0,0];const C=interpolate(y,x,r);switch(e){case"hsl":case"hwb":b=[interpolate(i,u,r),un_premultiply(interpolate(c,p,r),C),un_premultiply(interpolate(N,m,r),C)];break;case"lch":case"oklch":b=[un_premultiply(interpolate(c,p,r),C),un_premultiply(interpolate(N,m,r),C),interpolate(i,u,r)]}return{colorNotation:h,channels:b,alpha:C*n.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])}}function fillInMissingComponent(e,o){return Number.isNaN(e)?o:e}function interpolate(e,o,n){return e*n+o*(1-n)}function premultiply(e,o){return Number.isNaN(o)?e:Number.isNaN(e)?NaN:e*o}function un_premultiply(e,o){return 0===o||Number.isNaN(o)?e:Number.isNaN(e)?NaN:e/o}function hex(e){const o=toLowerCaseAZ(e[4].value);if(o.match(/[^a-f0-9]/))return!1;const n={colorNotation:exports.ColorNotation.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.Hex])},a=o.length;if(3===a){const e=o[0],a=o[1],t=o[2];return n.channels=[parseInt(e+e,16)/255,parseInt(a+a,16)/255,parseInt(t+t,16)/255],n}if(6===a){const e=o[0]+o[1],a=o[2]+o[3],t=o[4]+o[5];return n.channels=[parseInt(e,16)/255,parseInt(a,16)/255,parseInt(t,16)/255],n}if(4===a){const e=o[0],a=o[1],t=o[2],r=o[3];return n.channels=[parseInt(e+e,16)/255,parseInt(a+a,16)/255,parseInt(t+t,16)/255],n.alpha=parseInt(r+r,16)/255,n.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),n}if(8===a){const e=o[0]+o[1],a=o[2]+o[3],t=o[4]+o[5],r=o[6]+o[7];return n.channels=[parseInt(e,16)/255,parseInt(a,16)/255,parseInt(t,16)/255],n.alpha=parseInt(r,16)/255,n.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),n}return!1}function normalizeHue(e){if(e[0]===n.TokenType.Number)return e[4].value=e[4].value%360,e[1]=e[4].value.toString(),e;if(e[0]===n.TokenType.Dimension){let o=e[4].value;switch(toLowerCaseAZ(e[4].unit)){case"deg":break;case"rad":o=180*e[4].value/Math.PI;break;case"grad":o=.9*e[4].value;break;case"turn":o=360*e[4].value;break;default:return!1}return o%=360,[n.TokenType.Number,o.toString(),e[2],e[3],{value:o,type:n.NumberType.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(e,o,a){if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===n.TokenType.Dimension&&a.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===n.TokenType.Percentage){3===o?a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){if(3!==o)return!1;let a=normalize(e[4].value,1,0,100);return 3===o&&(a=normalize(e[4].value,1,0,1)),[n.TokenType.Number,a.toString(),e[2],e[3],{value:a,type:n.NumberType.Number}]}return!1}function normalize_modern_HSL_ChannelValues(e,o,a){if(e[0]===n.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return a.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[n.TokenType.Number,"none",e[2],e[3],{value:NaN,type:n.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===n.TokenType.Dimension&&a.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===n.TokenType.Percentage){3===o?a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}function threeChannelLegacySyntax(e,o,a,s){const l=[],i=[],u=[],c=[],p={colorNotation:a,channels:[0,0,0],alpha:1,syntaxFlags:new Set(s)};let N=l;for(let o=0;ot.isTokenNode(e)&&e.value[0]===n.TokenType.Comma))){const o=hslCommaSeparated(e);if(!1!==o)return o}{const n=hslSpaceSeparated(e,o);if(!1!==n)return n}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,exports.ColorNotation.HSL,[exports.SyntaxFlag.LegacyHSL])}function hslSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,exports.ColorNotation.HSL,[],o)}function normalize_HWB_ChannelValues(e,o,a){if(e[0]===n.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return a.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[n.TokenType.Number,"none",e[2],e[3],{value:NaN,type:n.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===n.TokenType.Dimension&&a.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===n.TokenType.Percentage){3===o?a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}function normalize_Lab_ChannelValues(e,o,a){if(e[0]===n.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return a.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[n.TokenType.Number,"none",e[2],e[3],{value:NaN,type:n.NumberType.Number}];if(e[0]===n.TokenType.Percentage){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,.8,-1/0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,1,-1/0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}function lab(e,o){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,exports.ColorNotation.Lab,[],o)}function normalize_LCH_ChannelValues(e,o,a){if(e[0]===n.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return a.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[n.TokenType.Number,"none",e[2],e[3],{value:NaN,type:n.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(e[0]===n.TokenType.Dimension&&a.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===n.TokenType.Percentage){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,100/150,0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,1,0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}function lch(e,o){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,exports.ColorNotation.LCH,[],o)}const N=new Map;for(const[e,o]of Object.entries(a.namedColors))N.set(e,o);function namedColor(e){const o=N.get(toLowerCaseAZ(e));return!!o&&{colorNotation:exports.ColorNotation.RGB,channels:[o[0]/255,o[1]/255,o[2]/255],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword,exports.SyntaxFlag.NamedColor])}}function normalize_OKLab_ChannelValues(e,o,a){if(e[0]===n.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return a.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[n.TokenType.Number,"none",e[2],e[3],{value:NaN,type:n.NumberType.Number}];if(e[0]===n.TokenType.Percentage){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o||2===o?t=normalize(e[4].value,250,-1/0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o||2===o?t=normalize(e[4].value,1,-1/0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}function oklab(e,o){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,exports.ColorNotation.OKLab,[],o)}function normalize_OKLCH_ChannelValues(e,o,a){if(e[0]===n.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return a.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[n.TokenType.Number,"none",e[2],e[3],{value:NaN,type:n.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(e[0]===n.TokenType.Dimension&&a.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===n.TokenType.Percentage){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o?t=normalize(e[4].value,250,0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o?t=normalize(e[4].value,1,0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}function oklch(e,o){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,exports.ColorNotation.OKLCH,[],o)}function normalize_legacy_sRGB_ChannelValues(e,o,a){if(e[0]===n.TokenType.Percentage){3===o?a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);const t=normalize(e[4].value,100,0,1);return[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,0,1);return 3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(e,o,a){if(e[0]===n.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return a.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[n.TokenType.Number,"none",e[2],e[3],{value:NaN,type:n.NumberType.Number}];if(e[0]===n.TokenType.Percentage){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,100,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}if(e[0]===n.TokenType.Number){3!==o&&a.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,1,0,1)),[n.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:n.NumberType.Number}]}return!1}function rgb(e,o){if(e.value.some((e=>t.isTokenNode(e)&&e.value[0]===n.TokenType.Comma))){const o=rgbCommaSeparated(e);if(!1!==o)return(!o.syntaxFlags.has(exports.SyntaxFlag.HasNumberValues)||!o.syntaxFlags.has(exports.SyntaxFlag.HasPercentageValues))&&o}else{const n=rgbSpaceSeparated(e,o);if(!1!==n)return n}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,exports.ColorNotation.RGB,[exports.SyntaxFlag.LegacyRGB])}function rgbSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,exports.ColorNotation.RGB,[],o)}function toPrecision(e,o=7){e=+e,o=+o;const n=(Math.floor(e)+"").length;if(o>n)return+e.toFixed(o-n);{const a=10**(n-o);return Math.round(e/a)*a}}function XYZ_D50_to_P3_Gamut(e){const o=a.xyz.XYZ_D50_to_P3(e);if(a.utils.inGamut(o))return a.utils.clip(o);let n=e.slice();return n=a.conversions.D50_to_D65(n),n=a.conversions.XYZ_to_OKLab(n),n=a.conversions.OKLab_to_OKLCH(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),a.calculations.mapGamut(n,(e=>(e=a.conversions.OKLCH_to_OKLab(e),e=a.conversions.OKLab_to_XYZ(e),e=a.conversions.XYZ_to_lin_P3(e),a.conversions.gam_P3(e))),(e=>(e=a.conversions.lin_P3(e),e=a.conversions.lin_P3_to_XYZ(e),e=a.conversions.XYZ_to_OKLab(e),a.conversions.OKLab_to_OKLCH(e))))}function serializeWithAlpha(e,o,a,r){const s=[n.TokenType.CloseParen,")",-1,-1,void 0];if("number"==typeof e.alpha){const l=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(l,4)?new t.FunctionNode(o,s,r):new t.FunctionNode(o,s,[...r,new t.WhitespaceNode([a]),new t.TokenNode([n.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([a]),new t.TokenNode([n.TokenType.Number,toPrecision(l,4).toString(),-1,-1,{value:e.alpha,type:n.NumberType.Integer}])])}return new t.FunctionNode(o,s,[...r,new t.WhitespaceNode([a]),new t.TokenNode([n.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([a]),e.alpha])}function XYZ_D50_to_sRGB_Gamut(e){const o=a.xyz.XYZ_D50_to_sRGB(e);if(a.utils.inGamut(o))return a.utils.clip(o);let n=e.slice();return n=a.conversions.D50_to_D65(n),n=a.conversions.XYZ_to_OKLab(n),n=a.conversions.OKLab_to_OKLCH(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),a.calculations.mapGamut(n,(e=>(e=a.conversions.OKLCH_to_OKLab(e),e=a.conversions.OKLab_to_XYZ(e),e=a.conversions.XYZ_to_lin_sRGB(e),a.conversions.gam_sRGB(e))),(e=>(e=a.conversions.lin_sRGB(e),e=a.conversions.lin_sRGB_to_XYZ(e),e=a.conversions.XYZ_to_OKLab(e),a.conversions.OKLab_to_OKLCH(e))))}exports.color=function color(e){if(t.isFunctionNode(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return o=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,exports.ColorNotation.HWB,[],o);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color)}}var o;if(t.isTokenNode(e)){if(e.value[0]===n.TokenType.Hash)return hex(e.value);if(e.value[0]===n.TokenType.Ident){const o=namedColor(e.value[4].value);return!1!==o?o:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:exports.ColorNotation.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword])}}}return!1},exports.colorDataFitsDisplayP3_Gamut=function colorDataFitsDisplayP3_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataFitsRGB_Gamut=function colorDataFitsRGB_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.RGB).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataTo=colorDataTo,exports.serializeOKLCH=function serializeOKLCH(e){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let o=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.OKLCH&&(o=a.xyz.XYZ_D50_to_OKLCH(colorData_to_XYZ_D50(e).channels));const r=toPrecision(o[0],6),s=toPrecision(o[1],6),l=toPrecision(o[2],6),i=[n.TokenType.Function,"oklch(",-1,-1,{value:"oklch"}],u=[n.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,i,u,[new t.TokenNode([n.TokenType.Number,r.toString(),-1,-1,{value:o[0],type:n.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([n.TokenType.Number,s.toString(),-1,-1,{value:o[1],type:n.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([n.TokenType.Number,l.toString(),-1,-1,{value:o[2],type:n.NumberType.Number}])])},exports.serializeP3=function serializeP3(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.Display_P3&&(r=o?XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(e).channels):a.xyz.XYZ_D50_to_P3(colorData_to_XYZ_D50(e).channels));const s=toPrecision(r[0],6),l=toPrecision(r[1],6),i=toPrecision(r[2],6),u=[n.TokenType.Function,"color(",-1,-1,{value:"color"}],c=[n.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,u,c,[new t.TokenNode([n.TokenType.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new t.WhitespaceNode([c]),new t.TokenNode([n.TokenType.Number,s.toString(),-1,-1,{value:r[0],type:n.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([n.TokenType.Number,l.toString(),-1,-1,{value:r[1],type:n.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([n.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:n.NumberType.Number}])])},exports.serializeRGB=function serializeRGB(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels):a.xyz.XYZ_D50_to_sRGB(colorData_to_XYZ_D50(e).channels);const s=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[1])))),i=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[2])))),u=[n.TokenType.CloseParen,")",-1,-1,void 0],c=[n.TokenType.Whitespace," ",-1,-1,void 0],p=[n.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([n.TokenType.Number,s.toString(),-1,-1,{value:r[0],type:n.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([n.TokenType.Number,l.toString(),-1,-1,{value:r[1],type:n.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([n.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:n.NumberType.Integer}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([n.TokenType.Function,"rgb(",-1,-1,{value:"rgb"}],u,N):new t.FunctionNode([n.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([n.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:n.NumberType.Number}])])}return new t.FunctionNode([n.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])}; +"use strict";var e,o,a=require("@csstools/css-tokenizer"),n=require("@csstools/color-helpers"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-calc");function colorData_to_XYZ_D50(e){switch(e.colorNotation){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:case exports.ColorNotation.sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.sRGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Linear_sRGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.lin_sRGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Display_P3:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.P3_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Rec2020:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.rec_2020_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.A98_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.a98_RGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.ProPhoto_RGB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.ProPhoto_RGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.HSL:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HSL_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.HWB:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.HWB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.Lab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.Lab_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.OKLab:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLab_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.LCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.LCH_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.OKLCH:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.OKLCH_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.XYZ_D50:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D50_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case exports.ColorNotation.XYZ_D65:return{...e,colorNotation:exports.ColorNotation.XYZ_D50,channels:n.XYZ_D65_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};default:throw new Error("Unsupported color notation")}}exports.ColorNotation=void 0,(e=exports.ColorNotation||(exports.ColorNotation={})).A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65",exports.SyntaxFlag=void 0,(o=exports.SyntaxFlag||(exports.SyntaxFlag={})).ColorKeyword="color-keyword",o.HasAlpha="has-alpha",o.HasDimensionValues="has-dimension-values",o.HasNoneKeywords="has-none-keywords",o.HasNumberValues="has-number-values",o.HasPercentageAlpha="has-percentage-alpha",o.HasPercentageValues="has-percentage-values",o.HasVariableAlpha="has-variable-alpha",o.Hex="hex",o.LegacyHSL="legacy-hsl",o.LegacyRGB="legacy-rgb",o.NamedColor="named-color",o.RelativeColorSyntax="relative-color-syntax",o.ColorMix="color-mix",o.Experimental="experimental";const l=new Set([exports.ColorNotation.A98_RGB,exports.ColorNotation.Display_P3,exports.ColorNotation.HEX,exports.ColorNotation.Linear_sRGB,exports.ColorNotation.ProPhoto_RGB,exports.ColorNotation.RGB,exports.ColorNotation.sRGB,exports.ColorNotation.Rec2020,exports.ColorNotation.XYZ_D50,exports.ColorNotation.XYZ_D65]);function colorDataTo(e,o){const a={...e};if(e.colorNotation!==o){const e=colorData_to_XYZ_D50(a);switch(o){case exports.ColorNotation.HEX:case exports.ColorNotation.RGB:a.colorNotation=exports.ColorNotation.RGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.sRGB:a.colorNotation=exports.ColorNotation.sRGB,a.channels=n.XYZ_D50_to_sRGB(e.channels);break;case exports.ColorNotation.Linear_sRGB:a.colorNotation=exports.ColorNotation.Linear_sRGB,a.channels=n.XYZ_D50_to_lin_sRGB(e.channels);break;case exports.ColorNotation.Display_P3:a.colorNotation=exports.ColorNotation.Display_P3,a.channels=n.XYZ_D50_to_P3(e.channels);break;case exports.ColorNotation.Rec2020:a.colorNotation=exports.ColorNotation.Rec2020,a.channels=n.XYZ_D50_to_rec_2020(e.channels);break;case exports.ColorNotation.ProPhoto_RGB:a.colorNotation=exports.ColorNotation.ProPhoto_RGB,a.channels=n.XYZ_D50_to_ProPhoto(e.channels);break;case exports.ColorNotation.A98_RGB:a.colorNotation=exports.ColorNotation.A98_RGB,a.channels=n.XYZ_D50_to_a98_RGB(e.channels);break;case exports.ColorNotation.HSL:a.colorNotation=exports.ColorNotation.HSL,a.channels=n.XYZ_D50_to_HSL(e.channels);break;case exports.ColorNotation.HWB:a.colorNotation=exports.ColorNotation.HWB,a.channels=n.XYZ_D50_to_HWB(e.channels);break;case exports.ColorNotation.Lab:a.colorNotation=exports.ColorNotation.Lab,a.channels=n.XYZ_D50_to_Lab(e.channels);break;case exports.ColorNotation.LCH:a.colorNotation=exports.ColorNotation.LCH,a.channels=n.XYZ_D50_to_LCH(e.channels);break;case exports.ColorNotation.OKLCH:a.colorNotation=exports.ColorNotation.OKLCH,a.channels=n.XYZ_D50_to_OKLCH(e.channels);break;case exports.ColorNotation.OKLab:a.colorNotation=exports.ColorNotation.OKLab,a.channels=n.XYZ_D50_to_OKLab(e.channels);break;case exports.ColorNotation.XYZ_D50:a.colorNotation=exports.ColorNotation.XYZ_D50,a.channels=n.XYZ_D50_to_XYZ_D50(e.channels);break;case exports.ColorNotation.XYZ_D65:a.colorNotation=exports.ColorNotation.XYZ_D65,a.channels=n.XYZ_D50_to_XYZ_D65(e.channels);break;default:throw new Error("Unsupported color notation")}}else a.channels=e.channels.map((e=>Number.isNaN(e)?0:e));if(o===e.colorNotation)a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else if(l.has(o)&&l.has(e.colorNotation))a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);else switch(o){case exports.ColorNotation.HSL:switch(e.colorNotation){case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[2],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0])}break;case exports.ColorNotation.HWB:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2])}break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0])}break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:switch(e.colorNotation){case exports.ColorNotation.HSL:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[2,1,0]);break;case exports.ColorNotation.HWB:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[2]);break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:a.channels=carryForwardMissingComponents(e.channels,[0],a.channels,[0]);break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:a.channels=carryForwardMissingComponents(e.channels,[0,1,2],a.channels,[0,1,2])}}return a.channels=convertPowerlessComponentsToMissingComponents(a.channels,o),a}function convertPowerlessComponentsToMissingComponents(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:reducePrecision(a[1],4)<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1],4))+Math.max(0,reducePrecision(a[2],4))>=100&&(a[0]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(a[1],4)<=0&&(a[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(a[1],6)<=0&&(a[2]=NaN)}return a}function convertPowerlessComponentsToZeroValuesForDisplay(e,o){const a=[...e];switch(o){case exports.ColorNotation.HSL:(reducePrecision(a[2])<=0||reducePrecision(a[2])>=100)&&(a[0]=NaN,a[1]=NaN),reducePrecision(a[1])<=0&&(a[0]=NaN);break;case exports.ColorNotation.HWB:Math.max(0,reducePrecision(a[1]))+Math.max(0,reducePrecision(a[2]))>=100&&(a[0]=NaN);break;case exports.ColorNotation.Lab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.LCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=100)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLab:(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN);break;case exports.ColorNotation.OKLCH:reducePrecision(a[1])<=0&&(a[2]=NaN),(reducePrecision(a[0])<=0||reducePrecision(a[0])>=1)&&(a[1]=NaN,a[2]=NaN)}return a}function carryForwardMissingComponents(e,o,a,n){const t=[...a];for(const a of o)Number.isNaN(e[o[a]])&&(t[n[a]]=NaN);return t}function normalizeRelativeColorDataChannels(e){const o=new Map;switch(e.colorNotation){case exports.ColorNotation.RGB:case exports.ColorNotation.HEX:o.set("r",dummyNumberToken(255*e.channels[0])),o.set("g",dummyNumberToken(255*e.channels[1])),o.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HSL:o.set("h",dummyNumberToken(e.channels[0])),o.set("s",dummyNumberToken(e.channels[1])),o.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.HWB:o.set("h",dummyNumberToken(e.channels[0])),o.set("w",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.Lab:case exports.ColorNotation.OKLab:o.set("l",dummyNumberToken(e.channels[0])),o.set("a",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.LCH:case exports.ColorNotation.OKLCH:o.set("l",dummyNumberToken(e.channels[0])),o.set("c",dummyNumberToken(e.channels[1])),o.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.sRGB:case exports.ColorNotation.A98_RGB:case exports.ColorNotation.Display_P3:case exports.ColorNotation.Rec2020:case exports.ColorNotation.Linear_sRGB:case exports.ColorNotation.ProPhoto_RGB:o.set("r",dummyNumberToken(e.channels[0])),o.set("g",dummyNumberToken(e.channels[1])),o.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha));break;case exports.ColorNotation.XYZ_D50:case exports.ColorNotation.XYZ_D65:o.set("x",dummyNumberToken(e.channels[0])),o.set("y",dummyNumberToken(e.channels[1])),o.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&o.set("alpha",dummyNumberToken(e.alpha))}return o}function noneToZeroInRelativeColorDataChannels(e){const o=new Map(e);for(const[a,n]of e)Number.isNaN(n[4].value)&&o.set(a,dummyNumberToken(0));return o}function dummyNumberToken(e){return[a.TokenType.Number,e.toString(),-1,-1,{value:e,type:a.NumberType.Number}]}function reducePrecision(e,o=7){if(Number.isNaN(e))return 0;const a=Math.pow(10,o);return Math.round(e*a)/a}function normalize(e,o,a,n){return Math.min(Math.max(e/o,a),n)}const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}const i=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(e,o){const n=[],l=[],s=[],u=[];let c,p,N=!1,m=!1;const h={colorNotation:exports.ColorNotation.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let y=n;for(let x=0;x=0){i=u.value[4].value;continue}}return!1}if(!s)return!1;n.push({color:s,percentage:i}),s=!1,i=!1}}if(s&&n.push({color:s,percentage:i}),2!==n.length)return!1;let u=n[0].percentage,c=n[1].percentage;return(!1===u||!(u<0||u>100))&&((!1===c||!(c<0||c>100))&&(!1===u&&!1===c?(u=50,c=50):!1!==u&&!1===c?c=100-u:!1===u&&!1!==c&&(u=100-c),(0!==u||0!==c)&&(!1!==u&&!1!==c&&(u+c>100&&(u=u/(u+c)*100,c=c/(u+c)*100),u+c<100&&(l=(u+c)/100,u=u/(u+c)*100,c=c/(u+c)*100),{a:{color:n[0].color,percentage:u},b:{color:n[1].color,percentage:c},alphaMultiplier:l}))))}function colorMixRectangular(e,o){if(!o)return!1;const a=o.a.color,n=o.b.color,t=o.a.percentage/100;let r=a.channels,l=n.channels,s=exports.ColorNotation.RGB,i=a.alpha;if("number"!=typeof i)return!1;let u=n.alpha;if("number"!=typeof u)return!1;switch(i=Number.isNaN(i)?u:i,u=Number.isNaN(u)?i:u,e){case"srgb":s=exports.ColorNotation.RGB;break;case"srgb-linear":s=exports.ColorNotation.Linear_sRGB;break;case"lab":s=exports.ColorNotation.Lab;break;case"oklab":s=exports.ColorNotation.OKLab;break;case"xyz-d50":s=exports.ColorNotation.XYZ_D50;break;case"xyz":case"xyz-d65":s=exports.ColorNotation.XYZ_D65}r=colorDataTo(a,s).channels,l=colorDataTo(n,s).channels,r[0]=fillInMissingComponent(r[0],l[0]),l[0]=fillInMissingComponent(l[0],r[0]),r[1]=fillInMissingComponent(r[1],l[1]),l[1]=fillInMissingComponent(l[1],r[1]),r[2]=fillInMissingComponent(r[2],l[2]),l[2]=fillInMissingComponent(l[2],r[2]),r[0]=premultiply(r[0],i),r[1]=premultiply(r[1],i),r[2]=premultiply(r[2],i),l[0]=premultiply(l[0],u),l[1]=premultiply(l[1],u),l[2]=premultiply(l[2],u);const c=interpolate(i,u,t),p={colorNotation:s,channels:[un_premultiply(interpolate(r[0],l[0],t),c),un_premultiply(interpolate(r[1],l[1],t),c),un_premultiply(interpolate(r[2],l[2],t),c)],alpha:c*o.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(o.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||o.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&p.syntaxFlags.add(exports.SyntaxFlag.Experimental),p}function colorMixPolar(e,o,a){if(!a)return!1;const n=a.a.color,t=a.b.color,r=a.a.percentage/100;let l=n.channels,s=t.channels,i=0,u=0,c=0,p=0,N=0,m=0,h=exports.ColorNotation.RGB,y=n.alpha;if("number"!=typeof y)return!1;let x=t.alpha;if("number"!=typeof x)return!1;switch(y=Number.isNaN(y)?x:y,x=Number.isNaN(x)?y:x,e){case"hsl":h=exports.ColorNotation.HSL;break;case"hwb":h=exports.ColorNotation.HWB;break;case"lch":h=exports.ColorNotation.LCH;break;case"oklch":h=exports.ColorNotation.OKLCH}switch(l=colorDataTo(n,h).channels,s=colorDataTo(t,h).channels,e){case"hsl":case"hwb":i=l[0],u=s[0],c=l[1],p=s[1],N=l[2],m=s[2];break;case"lch":case"oklch":c=l[0],p=s[0],N=l[1],m=s[1],i=l[2],u=s[2]}i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),c=fillInMissingComponent(c,p),p=fillInMissingComponent(p,c),N=fillInMissingComponent(N,m),m=fillInMissingComponent(m,N);const T=u-i;switch(o){case"shorter":T>180?i+=360:T<-180&&(u+=360);break;case"longer":-1800?i+=360:u+=360);break;case"increasing":T<0&&(u+=360);break;case"decreasing":T>0&&(i+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,y),N=premultiply(N,y),p=premultiply(p,x),m=premultiply(m,x);let b=[0,0,0];const C=interpolate(y,x,r);switch(e){case"hsl":case"hwb":b=[interpolate(i,u,r),un_premultiply(interpolate(c,p,r),C),un_premultiply(interpolate(N,m,r),C)];break;case"lch":case"oklch":b=[un_premultiply(interpolate(c,p,r),C),un_premultiply(interpolate(N,m,r),C),interpolate(i,u,r)]}const d={colorNotation:h,channels:b,alpha:C*a.alphaMultiplier,syntaxFlags:new Set([exports.SyntaxFlag.ColorMix])};return(a.a.color.syntaxFlags.has(exports.SyntaxFlag.Experimental)||a.b.color.syntaxFlags.has(exports.SyntaxFlag.Experimental))&&d.syntaxFlags.add(exports.SyntaxFlag.Experimental),d}function fillInMissingComponent(e,o){return Number.isNaN(e)?o:e}function interpolate(e,o,a){return e*a+o*(1-a)}function premultiply(e,o){return Number.isNaN(o)?e:Number.isNaN(e)?NaN:e*o}function un_premultiply(e,o){return 0===o||Number.isNaN(o)?e:Number.isNaN(e)?NaN:e/o}function hex(e){const o=toLowerCaseAZ(e[4].value);if(o.match(/[^a-f0-9]/))return!1;const a={colorNotation:exports.ColorNotation.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.Hex])},n=o.length;if(3===n){const e=o[0],n=o[1],t=o[2];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a}if(6===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a}if(4===n){const e=o[0],n=o[1],t=o[2],r=o[3];return a.channels=[parseInt(e+e,16)/255,parseInt(n+n,16)/255,parseInt(t+t,16)/255],a.alpha=parseInt(r+r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}if(8===n){const e=o[0]+o[1],n=o[2]+o[3],t=o[4]+o[5],r=o[6]+o[7];return a.channels=[parseInt(e,16)/255,parseInt(n,16)/255,parseInt(t,16)/255],a.alpha=parseInt(r,16)/255,a.syntaxFlags.add(exports.SyntaxFlag.HasAlpha),a}return!1}function normalizeHue(e){if(e[0]===a.TokenType.Number)return e[4].value=e[4].value%360,e[1]=e[4].value.toString(),e;if(e[0]===a.TokenType.Dimension){let o=e[4].value;switch(toLowerCaseAZ(e[4].unit)){case"deg":break;case"rad":o=180*e[4].value/Math.PI;break;case"grad":o=.9*e[4].value;break;case"turn":o=360*e[4].value;break;default:return!1}return o%=360,[a.TokenType.Number,o.toString(),e[2],e[3],{value:o,type:a.NumberType.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(e,o,n){if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){if(3!==o)return!1;let n=normalize(e[4].value,1,0,100);return 3===o&&(n=normalize(e[4].value,1,0,1)),[a.TokenType.Number,n.toString(),e[2],e[3],{value:n,type:a.NumberType.Number}]}return!1}function normalize_modern_HSL_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function threeChannelLegacySyntax(e,o,n,l){const s=[],i=[],u=[],c=[],p={colorNotation:n,channels:[0,0,0],alpha:1,syntaxFlags:new Set(l)};let N=s;for(let o=0;ot.isTokenNode(e)&&e.value[0]===a.TokenType.Comma))){const o=hslCommaSeparated(e);if(!1!==o)return o}{const a=hslSpaceSeparated(e,o);if(!1!==a)return a}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,exports.ColorNotation.HSL,[exports.SyntaxFlag.LegacyHSL])}function hslSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,exports.ColorNotation.HSL,[],o)}function normalize_HWB_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(0===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=e[4].value;return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_Lab_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,.8,-1/0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o||2===o?t=normalize(e[4].value,1,-1/0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lab(e,o){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,exports.ColorNotation.Lab,[],o)}function normalize_LCH_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,100/150,0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,100);return 1===o?t=normalize(e[4].value,1,0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function lch(e,o){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,exports.ColorNotation.LCH,[],o)}const N=new Map;for(const[e,o]of Object.entries(n.namedColors))N.set(e,o);function namedColor(e){const o=N.get(toLowerCaseAZ(e));return!!o&&{colorNotation:exports.ColorNotation.RGB,channels:[o[0]/255,o[1]/255,o[2]/255],alpha:1,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword,exports.SyntaxFlag.NamedColor])}}function normalize_OKLab_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o||2===o?t=normalize(e[4].value,250,-1/0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o||2===o?t=normalize(e[4].value,1,-1/0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklab(e,o){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,exports.ColorNotation.OKLab,[],o)}function normalize_OKLCH_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(2===o){const o=normalizeHue(e);return!1!==o&&(e[0]===a.TokenType.Dimension&&n.syntaxFlags.add(exports.SyntaxFlag.HasDimensionValues),o)}if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,0,1);return 1===o?t=normalize(e[4].value,250,0,1/0):3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,1,0,1);return 1===o?t=normalize(e[4].value,1,0,1/0):3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function oklch(e,o){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,exports.ColorNotation.OKLCH,[],o)}function normalize_legacy_sRGB_ChannelValues(e,o,n){if(e[0]===a.TokenType.Percentage){3===o?n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageAlpha):n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);const t=normalize(e[4].value,100,0,1);return[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,0,1);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(e,o,n){if(e[0]===a.TokenType.Ident&&"none"===toLowerCaseAZ(e[4].value))return n.syntaxFlags.add(exports.SyntaxFlag.HasNoneKeywords),[a.TokenType.Number,"none",e[2],e[3],{value:NaN,type:a.NumberType.Number}];if(e[0]===a.TokenType.Percentage){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasPercentageValues);let t=normalize(e[4].value,100,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,100,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}if(e[0]===a.TokenType.Number){3!==o&&n.syntaxFlags.add(exports.SyntaxFlag.HasNumberValues);let t=normalize(e[4].value,255,-1/0,1/0);return 3===o&&(t=normalize(e[4].value,1,0,1)),[a.TokenType.Number,t.toString(),e[2],e[3],{value:t,type:a.NumberType.Number}]}return!1}function rgb(e,o){if(e.value.some((e=>t.isTokenNode(e)&&e.value[0]===a.TokenType.Comma))){const o=rgbCommaSeparated(e);if(!1!==o)return(!o.syntaxFlags.has(exports.SyntaxFlag.HasNumberValues)||!o.syntaxFlags.has(exports.SyntaxFlag.HasPercentageValues))&&o}else{const a=rgbSpaceSeparated(e,o);if(!1!==a)return a}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,exports.ColorNotation.RGB,[exports.SyntaxFlag.LegacyRGB])}function rgbSpaceSeparated(e,o){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,exports.ColorNotation.RGB,[],o)}function toPrecision(e,o=7){e=+e,o=+o;const a=(Math.floor(e)+"").length;if(o>a)return+e.toFixed(o-a);{const n=10**(a-o);return Math.round(e/n)*n}}function XYZ_D50_to_P3_Gamut(e){const o=n.XYZ_D50_to_P3(e);if(n.inGamut(o))return n.clip(o);let a=e.slice();return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.mapGamut(a,(e=>(e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),e=n.XYZ_to_lin_P3(e),n.gam_P3(e))),(e=>(e=n.lin_P3(e),e=n.lin_P3_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e))))}function serializeWithAlpha(e,o,n,r){const l=[a.TokenType.CloseParen,")",-1,-1,void 0];if("number"==typeof e.alpha){const s=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(s,4)?new t.FunctionNode(o,l,r):new t.FunctionNode(o,l,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Number,toPrecision(s,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Integer}])])}return new t.FunctionNode(o,l,[...r,new t.WhitespaceNode([n]),new t.TokenNode([a.TokenType.Delim,"/",-1,-1,{value:"/"}]),new t.WhitespaceNode([n]),e.alpha])}function XYZ_D50_to_sRGB_Gamut(e){const o=n.XYZ_D50_to_sRGB(e);if(n.inGamut(o))return n.clip(o);let a=e.slice();return a=n.XYZ_D50_to_OKLCH(a),a[0]<1e-6&&(a=[0,0,0]),a[0]>.999999&&(a=[1,0,0]),n.mapGamut(a,(e=>(e=n.OKLCH_to_OKLab(e),e=n.OKLab_to_XYZ(e),e=n.XYZ_to_lin_sRGB(e),n.gam_sRGB(e))),(e=>(e=n.lin_sRGB(e),e=n.lin_sRGB_to_XYZ(e),e=n.XYZ_to_OKLab(e),n.OKLab_to_OKLCH(e))))}exports.color=function color(e){if(t.isFunctionNode(e)){switch(toLowerCaseAZ(e.getName())){case"rgb":case"rgba":return rgb(e,color);case"hsl":case"hsla":return hsl(e,color);case"hwb":return o=color,threeChannelSpaceSeparated(e,normalize_HWB_ChannelValues,exports.ColorNotation.HWB,[],o);case"lab":return lab(e,color);case"lch":return lch(e,color);case"oklab":return oklab(e,color);case"oklch":return oklch(e,color);case"color":return color$1(e,color);case"color-mix":return colorMix(e,color)}}var o;if(t.isTokenNode(e)){if(e.value[0]===a.TokenType.Hash)return hex(e.value);if(e.value[0]===a.TokenType.Ident){const o=namedColor(e.value[4].value);return!1!==o?o:"transparent"===toLowerCaseAZ(e.value[4].value)&&{colorNotation:exports.ColorNotation.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([exports.SyntaxFlag.ColorKeyword])}}}return!1},exports.colorDataFitsDisplayP3_Gamut=function colorDataFitsDisplayP3_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataFitsRGB_Gamut=function colorDataFitsRGB_Gamut(e){const o={...e,channels:[...e.channels]};return o.channels=convertPowerlessComponentsToZeroValuesForDisplay(o.channels,o.colorNotation),!colorDataTo(o,exports.ColorNotation.RGB).channels.find((e=>e<-1e-5||e>1.00001))},exports.colorDataTo=colorDataTo,exports.serializeHSL=function serializeHSL(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?n.XYZ_D50_to_HSL(n.sRGB_to_XYZ_D50(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels))):n.XYZ_D50_to_HSL(colorData_to_XYZ_D50(e).channels),r=r.map((e=>Number.isNaN(e)?0:e));const l=Math.min(360,Math.max(0,Math.round(toPrecision(r[0])))),s=Math.min(100,Math.max(0,Math.round(toPrecision(r[1])))),i=Math.min(100,Math.max(0,Math.round(toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[0],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,s.toString()+"%",-1,-1,{value:r[1]}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Percentage,i.toString()+"%",-1,-1,{value:r[2]}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"hsl(",-1,-1,{value:"hsl"}],u,N):new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])},exports.serializeOKLCH=function serializeOKLCH(e){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let o=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.OKLCH&&(o=n.XYZ_D50_to_OKLCH(colorData_to_XYZ_D50(e).channels));const r=toPrecision(o[0],6),l=toPrecision(o[1],6),s=toPrecision(o[2],6),i=[a.TokenType.Function,"oklch(",-1,-1,{value:"oklch"}],u=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,i,u,[new t.TokenNode([a.TokenType.Number,r.toString(),-1,-1,{value:o[0],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:o[1],type:a.NumberType.Number}]),new t.WhitespaceNode([u]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:o[2],type:a.NumberType.Number}])])},exports.serializeP3=function serializeP3(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));e.colorNotation!==exports.ColorNotation.Display_P3&&(r=o?XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(e).channels):n.XYZ_D50_to_P3(colorData_to_XYZ_D50(e).channels));const l=toPrecision(r[0],6),s=toPrecision(r[1],6),i=toPrecision(r[2],6),u=[a.TokenType.Function,"color(",-1,-1,{value:"color"}],c=[a.TokenType.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(e,u,c,[new t.TokenNode([a.TokenType.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[0],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[1],type:a.NumberType.Number}]),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:a.NumberType.Number}])])},exports.serializeRGB=function serializeRGB(e,o=!0){e.channels=convertPowerlessComponentsToZeroValuesForDisplay(e.channels,e.colorNotation);let r=e.channels.map((e=>Number.isNaN(e)?0:e));r=o?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(e).channels):n.XYZ_D50_to_sRGB(colorData_to_XYZ_D50(e).channels);const l=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[0])))),s=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[1])))),i=Math.min(255,Math.max(0,Math.round(255*toPrecision(r[2])))),u=[a.TokenType.CloseParen,")",-1,-1,void 0],c=[a.TokenType.Whitespace," ",-1,-1,void 0],p=[a.TokenType.Comma,",",-1,-1,void 0],N=[new t.TokenNode([a.TokenType.Number,l.toString(),-1,-1,{value:r[0],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,s.toString(),-1,-1,{value:r[1],type:a.NumberType.Integer}]),new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,i.toString(),-1,-1,{value:r[2],type:a.NumberType.Integer}])];if("number"==typeof e.alpha){const o=Math.min(1,Math.max(0,toPrecision(Number.isNaN(e.alpha)?0:e.alpha)));return 1===toPrecision(o,4)?new t.FunctionNode([a.TokenType.Function,"rgb(",-1,-1,{value:"rgb"}],u,N):new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),new t.TokenNode([a.TokenType.Number,toPrecision(o,4).toString(),-1,-1,{value:e.alpha,type:a.NumberType.Number}])])}return new t.FunctionNode([a.TokenType.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...N,new t.TokenNode(p),new t.WhitespaceNode([c]),e.alpha])}; diff --git a/node_modules/@csstools/css-color-parser/dist/index.d.ts b/node_modules/@csstools/css-color-parser/dist/index.d.ts index 94de2a86..fa641ac5 100644 --- a/node_modules/@csstools/css-color-parser/dist/index.d.ts +++ b/node_modules/@csstools/css-color-parser/dist/index.d.ts @@ -1,10 +1,137 @@ -import type { ColorData } from './color-data'; +import type { Color } from '@csstools/color-helpers'; import type { ComponentValue } from '@csstools/css-parser-algorithms'; -export type { ColorData } from './color-data'; -export { ColorNotation } from './color-notation'; -export { SyntaxFlag } from './color-data'; -export { colorDataTo, colorDataFitsRGB_Gamut, colorDataFitsDisplayP3_Gamut } from './color-data'; -export { serializeP3 } from './serialize/p3'; -export { serializeRGB } from './serialize/rgb'; -export { serializeOKLCH } from './serialize/oklch'; +import { FunctionNode } from '@csstools/css-parser-algorithms'; + +/** + * Convert a color function to a `ColorData` object. + * + * @param {ComponentValue} colorNode - The color function to be converted. + * @returns {ColorData|false} The color function as a `ColorData` object or `false` if it could not be converted. + */ export declare function color(colorNode: ComponentValue): ColorData | false; + +export declare type ColorData = { + colorNotation: ColorNotation; + channels: Color; + alpha: number | ComponentValue; + syntaxFlags: Set; +}; + +/** + * Check if a color data object fits the `display-p3` gamut. + * + * @param {ColorData} x - The color data to be checked. + * @returns {boolean} Whether the color data fits the `display-p3` gamut. + */ +export declare function colorDataFitsDisplayP3_Gamut(x: ColorData): boolean; + +/** + * Check if a color data object fits the `sRGB` gamut. + * + * @param {ColorData} x - The color data to be checked. + * @returns {boolean} Whether the color data fits the `sRGB` gamut. + */ +export declare function colorDataFitsRGB_Gamut(x: ColorData): boolean; + +export declare function colorDataTo(colorData: ColorData, toNotation: ColorNotation): ColorData; + +export declare enum ColorNotation { + /** Adobe 1999, expressed through `color(a98-rgb 0 0 0)` */ + A98_RGB = "a98-rgb", + /** Display P3, expressed through `color(display-p3 0 0 0)` */ + Display_P3 = "display-p3", + /** Hex, expressed through `#000` */ + HEX = "hex", + /** HSL, expressed through `hsl(0 0% 0%)` */ + HSL = "hsl", + /** HWB, expressed through `hwb(0 0% 0%)` */ + HWB = "hwb", + /** LCH, expressed through `lch(0 0% 0deg)` */ + LCH = "lch", + /** Lab, expressed through `lab(0 0 0)` */ + Lab = "lab", + /** Linear sRGB, expressed through `color(linear-srgb 0 0 0)` */ + Linear_sRGB = "srgb-linear", + /** Oklch, expressed through `oklch(0 0% 0deg)` */ + OKLCH = "oklch", + /** Oklab, expressed through `oklab(0 0 0)` */ + OKLab = "oklab", + /** ProPhoto RGB, expressed through `color(prophoto-rgb 0 0 0)` */ + ProPhoto_RGB = "prophoto-rgb", + /** RGB, expressed through `rgb(0 0 0)` */ + RGB = "rgb", + /** sRGB, expressed through `color(srgb 0 0 0)` */ + sRGB = "srgb", + /** Rec. 2020, expressed through `color(rec2020 0 0 0)` */ + Rec2020 = "rec2020", + /** XYZ, expressed through `color(xyz-d50 0 0 0)` */ + XYZ_D50 = "xyz-d50", + /** XYZ, expressed through `color(xyz-d65 0 0 0)` */ + XYZ_D65 = "xyz-d65" +} + +export declare function serializeHSL(color: ColorData, gamutMapping?: boolean): FunctionNode; + +/** + * Convert color data to component values in the OKLCH color space. + * The return value can be converted to a string by calling `toString()` on it. + * + * @param {ColorData} color - The color data to be serialized. + * @returns {FunctionNode} The serialized color data as a FunctionNode object. + */ +export declare function serializeOKLCH(color: ColorData): FunctionNode; + +/** + * Convert color data to component values in the display-p3 color space. + * The return value can be converted to a string by calling `toString()` on it. + * + * @param {ColorData} color - The color data to be serialized. + * @param {boolean} gamutMapping - Whether to perform gamut mapping, defaults to `true`. + * @returns {FunctionNode} The serialized color data as a FunctionNode object. + */ +export declare function serializeP3(color: ColorData, gamutMapping?: boolean): FunctionNode; + +/** + * Convert color data to component values in the srgb color space. + * The return value can be converted to a string by calling `toString()` on it. + * + * @param {ColorData} color - The color data to be serialized. + * @param {boolean} gamutMapping - Whether to perform gamut mapping, defaults to `true`. + * @returns {FunctionNode} The serialized color data as a FunctionNode object. + */ +export declare function serializeRGB(color: ColorData, gamutMapping?: boolean): FunctionNode; + +export declare enum SyntaxFlag { + /** Is a color keyword, e.g. `transparent`, `currentColor`, ... */ + ColorKeyword = "color-keyword", + /** Has an explicit alpha channel */ + HasAlpha = "has-alpha", + /** Has a channel with a dimension value, e.g. `50deg` */ + HasDimensionValues = "has-dimension-values", + /** Has a channel with the `none` keyword */ + HasNoneKeywords = "has-none-keywords", + /** Has a channel with a number value */ + HasNumberValues = "has-number-values", + /** Has an alpha channel with a percentage value */ + HasPercentageAlpha = "has-percentage-alpha", + /** Has a channel with a percentage value */ + HasPercentageValues = "has-percentage-values", + /** Has an alpha channel with a `var()` function value */ + HasVariableAlpha = "has-variable-alpha", + /** Is Hex notation */ + Hex = "hex", + /** Is legacy HSL, e.g. `hsl(50deg, 0%, 0%)` */ + LegacyHSL = "legacy-hsl", + /** Is legacy RGB, e.g. `rgb(0, 0, 0)` */ + LegacyRGB = "legacy-rgb", + /** Is a named color, e.g. `red`, `blue` */ + NamedColor = "named-color", + /** Is a relative color syntax, e.g. `rgb(from purple r g b)` */ + RelativeColorSyntax = "relative-color-syntax", + /** Is a mixed color, e.g. `color-mix(in oklch, red, blue)` */ + ColorMix = "color-mix", + /** Is an experimental color syntax */ + Experimental = "experimental" +} + +export { } diff --git a/node_modules/@csstools/css-color-parser/dist/index.mjs b/node_modules/@csstools/css-color-parser/dist/index.mjs index 950bcf13..b3e7ae9b 100644 --- a/node_modules/@csstools/css-color-parser/dist/index.mjs +++ b/node_modules/@csstools/css-color-parser/dist/index.mjs @@ -1 +1 @@ -import{TokenType as e,NumberType as a}from"@csstools/css-tokenizer";import{xyz as n,namedColors as r,utils as o,conversions as t,calculations as l}from"@csstools/color-helpers";import{isWhitespaceNode as s,isCommentNode as u,isTokenNode as i,isFunctionNode as c,TokenNode as m,FunctionNode as h,WhitespaceNode as N}from"@csstools/css-parser-algorithms";import{mathFunctionNames as p,calcFromComponentValues as b}from"@csstools/css-calc";var _,g;function colorData_to_XYZ_D50(e){switch(e.colorNotation){case _.HEX:case _.RGB:case _.sRGB:return{...e,colorNotation:_.XYZ_D50,channels:n.sRGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.Linear_sRGB:return{...e,colorNotation:_.XYZ_D50,channels:n.lin_sRGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.Display_P3:return{...e,colorNotation:_.XYZ_D50,channels:n.P3_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.Rec2020:return{...e,colorNotation:_.XYZ_D50,channels:n.rec_2020_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.A98_RGB:return{...e,colorNotation:_.XYZ_D50,channels:n.a98_RGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.ProPhoto_RGB:return{...e,colorNotation:_.XYZ_D50,channels:n.ProPhoto_RGB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.HSL:return{...e,colorNotation:_.XYZ_D50,channels:n.HSL_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.HWB:return{...e,colorNotation:_.XYZ_D50,channels:n.HWB_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.Lab:return{...e,colorNotation:_.XYZ_D50,channels:n.Lab_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.OKLab:return{...e,colorNotation:_.XYZ_D50,channels:n.OKLab_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.LCH:return{...e,colorNotation:_.XYZ_D50,channels:n.LCH_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.OKLCH:return{...e,colorNotation:_.XYZ_D50,channels:n.OKLCH_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.XYZ_D50:return{...e,colorNotation:_.XYZ_D50,channels:n.XYZ_D50_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};case _.XYZ_D65:return{...e,colorNotation:_.XYZ_D50,channels:n.XYZ_D65_to_XYZ_D50(e.channels.map((e=>Number.isNaN(e)?0:e)))};default:throw new Error("Unsupported color notation")}}!function(e){e.A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65"}(_||(_={})),function(e){e.ColorKeyword="color-keyword",e.HasAlpha="has-alpha",e.HasDimensionValues="has-dimension-values",e.HasNoneKeywords="has-none-keywords",e.HasNumberValues="has-number-values",e.HasPercentageAlpha="has-percentage-alpha",e.HasPercentageValues="has-percentage-values",e.HasVariableAlpha="has-variable-alpha",e.Hex="hex",e.LegacyHSL="legacy-hsl",e.LegacyRGB="legacy-rgb",e.NamedColor="named-color",e.RelativeColorSyntax="relative-color-syntax",e.ColorMix="color-mix"}(g||(g={}));const f=new Set([_.A98_RGB,_.Display_P3,_.HEX,_.Linear_sRGB,_.ProPhoto_RGB,_.RGB,_.sRGB,_.Rec2020,_.XYZ_D50,_.XYZ_D65]);function colorDataTo(e,a){const r={...e};if(e.colorNotation!==a){const e=colorData_to_XYZ_D50(r);switch(a){case _.HEX:case _.RGB:r.colorNotation=_.RGB,r.channels=n.XYZ_D50_to_sRGB(e.channels);break;case _.sRGB:r.colorNotation=_.sRGB,r.channels=n.XYZ_D50_to_sRGB(e.channels);break;case _.Linear_sRGB:r.colorNotation=_.Linear_sRGB,r.channels=n.XYZ_D50_to_lin_sRGB(e.channels);break;case _.Display_P3:r.colorNotation=_.Display_P3,r.channels=n.XYZ_D50_to_P3(e.channels);break;case _.Rec2020:r.colorNotation=_.Rec2020,r.channels=n.XYZ_D50_to_rec_2020(e.channels);break;case _.ProPhoto_RGB:r.colorNotation=_.ProPhoto_RGB,r.channels=n.XYZ_D50_to_ProPhoto(e.channels);break;case _.A98_RGB:r.colorNotation=_.A98_RGB,r.channels=n.XYZ_D50_to_a98_RGB(e.channels);break;case _.HSL:r.colorNotation=_.HSL,r.channels=n.XYZ_D50_to_HSL(e.channels);break;case _.HWB:r.colorNotation=_.HWB,r.channels=n.XYZ_D50_to_HWB(e.channels);break;case _.Lab:r.colorNotation=_.Lab,r.channels=n.XYZ_D50_to_Lab(e.channels);break;case _.LCH:r.colorNotation=_.LCH,r.channels=n.XYZ_D50_to_LCH(e.channels);break;case _.OKLCH:r.colorNotation=_.OKLCH,r.channels=n.XYZ_D50_to_OKLCH(e.channels);break;case _.OKLab:r.colorNotation=_.OKLab,r.channels=n.XYZ_D50_to_OKLab(e.channels);break;case _.XYZ_D50:r.colorNotation=_.XYZ_D50,r.channels=n.XYZ_D50_to_XYZ_D50(e.channels);break;case _.XYZ_D65:r.colorNotation=_.XYZ_D65,r.channels=n.XYZ_D50_to_XYZ_D65(e.channels);break;default:throw new Error("Unsupported color notation")}}else r.channels=e.channels.map((e=>Number.isNaN(e)?0:e));if(a===e.colorNotation)r.channels=carryForwardMissingComponents(e.channels,[0,1,2],r.channels,[0,1,2]);else if(f.has(a)&&f.has(e.colorNotation))r.channels=carryForwardMissingComponents(e.channels,[0,1,2],r.channels,[0,1,2]);else switch(a){case _.HSL:switch(e.colorNotation){case _.HWB:r.channels=carryForwardMissingComponents(e.channels,[0],r.channels,[0]);break;case _.Lab:case _.OKLab:r.channels=carryForwardMissingComponents(e.channels,[2],r.channels,[0]);break;case _.LCH:case _.OKLCH:r.channels=carryForwardMissingComponents(e.channels,[0,1,2],r.channels,[2,1,0])}break;case _.HWB:switch(e.colorNotation){case _.HSL:r.channels=carryForwardMissingComponents(e.channels,[0],r.channels,[0]);break;case _.LCH:case _.OKLCH:r.channels=carryForwardMissingComponents(e.channels,[0],r.channels,[2])}break;case _.Lab:case _.OKLab:switch(e.colorNotation){case _.HSL:r.channels=carryForwardMissingComponents(e.channels,[0],r.channels,[2]);break;case _.Lab:case _.OKLab:r.channels=carryForwardMissingComponents(e.channels,[0,1,2],r.channels,[0,1,2]);break;case _.LCH:case _.OKLCH:r.channels=carryForwardMissingComponents(e.channels,[0],r.channels,[0])}break;case _.LCH:case _.OKLCH:switch(e.colorNotation){case _.HSL:r.channels=carryForwardMissingComponents(e.channels,[0,1,2],r.channels,[2,1,0]);break;case _.HWB:r.channels=carryForwardMissingComponents(e.channels,[0],r.channels,[2]);break;case _.Lab:case _.OKLab:r.channels=carryForwardMissingComponents(e.channels,[0],r.channels,[0]);break;case _.LCH:case _.OKLCH:r.channels=carryForwardMissingComponents(e.channels,[0,1,2],r.channels,[0,1,2])}}return r.channels=convertPowerlessComponentsToMissingComponents(r.channels,a),r}function convertPowerlessComponentsToMissingComponents(e,a){const n=[...e];switch(a){case _.HSL:reducePrecision(n[1],4)<=0&&(n[0]=NaN);break;case _.HWB:Math.max(0,reducePrecision(n[1],4))+Math.max(0,reducePrecision(n[2],4))>=100&&(n[0]=NaN);break;case _.LCH:reducePrecision(n[1],4)<=0&&(n[2]=NaN);break;case _.OKLCH:reducePrecision(n[1],6)<=0&&(n[2]=NaN)}return n}function convertPowerlessComponentsToZeroValuesForDisplay(e,a){const n=[...e];switch(a){case _.HSL:(reducePrecision(n[2])<=0||reducePrecision(n[2])>=100)&&(n[0]=NaN,n[1]=NaN),reducePrecision(n[1])<=0&&(n[0]=NaN);break;case _.HWB:Math.max(0,reducePrecision(n[1]))+Math.max(0,reducePrecision(n[2]))>=100&&(n[0]=NaN);break;case _.Lab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case _.LCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case _.OKLab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN);break;case _.OKLCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN)}return n}function carryForwardMissingComponents(e,a,n,r){const o=[...n];for(const n of a)Number.isNaN(e[a[n]])&&(o[r[n]]=NaN);return o}function normalizeRelativeColorDataChannels(e){const a=new Map;switch(e.colorNotation){case _.RGB:case _.HEX:a.set("r",dummyNumberToken(255*e.channels[0])),a.set("g",dummyNumberToken(255*e.channels[1])),a.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case _.HSL:a.set("h",dummyNumberToken(e.channels[0])),a.set("s",dummyNumberToken(e.channels[1])),a.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case _.HWB:a.set("h",dummyNumberToken(e.channels[0])),a.set("w",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case _.Lab:case _.OKLab:a.set("l",dummyNumberToken(e.channels[0])),a.set("a",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case _.LCH:case _.OKLCH:a.set("l",dummyNumberToken(e.channels[0])),a.set("c",dummyNumberToken(e.channels[1])),a.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case _.sRGB:case _.A98_RGB:case _.Display_P3:case _.Rec2020:case _.Linear_sRGB:case _.ProPhoto_RGB:a.set("r",dummyNumberToken(e.channels[0])),a.set("g",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case _.XYZ_D50:case _.XYZ_D65:a.set("x",dummyNumberToken(e.channels[0])),a.set("y",dummyNumberToken(e.channels[1])),a.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha))}return a}function noneToZeroInRelativeColorDataChannels(e){const a=new Map(e);for(const[n,r]of e)Number.isNaN(r[4].value)&&a.set(n,dummyNumberToken(0));return a}function dummyNumberToken(n){return[e.Number,n.toString(),-1,-1,{value:n,type:a.Number}]}function reducePrecision(e,a=7){if(Number.isNaN(e))return 0;const n=Math.pow(10,a);return Math.round(e*n)/n}function colorDataFitsRGB_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,_.RGB).channels.find((e=>e<-1e-5||e>1.00001))}function colorDataFitsDisplayP3_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,_.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))}function normalize(e,a,n,r){return Math.min(Math.max(e/a,n),r)}const v=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(v,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(g.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(g.HasPercentageValues);let t=normalize(n[4].value,100,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=normalize(n[4].value,1,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}const d=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(a,n){const r=[],o=[],t=[],l=[];let h,N,f=!1,v=!1;const y={colorNotation:_.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let C=r;for(let _=0;_=0){l=m.value[4].value;continue}}return!1}if(!t)return!1;r.push({color:t,percentage:l}),t=!1,l=!1}}if(t&&r.push({color:t,percentage:l}),2!==r.length)return!1;let m=r[0].percentage,h=r[1].percentage;return(!1===m||!(m<0||m>100))&&((!1===h||!(h<0||h>100))&&(!1===m&&!1===h?(m=50,h=50):!1!==m&&!1===h?h=100-m:!1===m&&!1!==h&&(m=100-h),(0!==m||0!==h)&&(!1!==m&&!1!==h&&(m+h>100&&(m=m/(m+h)*100,h=h/(m+h)*100),m+h<100&&(o=(m+h)/100,m=m/(m+h)*100,h=h/(m+h)*100),{a:{color:r[0].color,percentage:m},b:{color:r[1].color,percentage:h},alphaMultiplier:o}))))}function colorMixRectangular(e,a){if(!a)return!1;const n=a.a.color,r=a.b.color,o=a.a.percentage/100;let t=n.channels,l=r.channels,s=_.RGB,u=n.alpha;if("number"!=typeof u)return!1;let i=r.alpha;if("number"!=typeof i)return!1;switch(u=Number.isNaN(u)?i:u,i=Number.isNaN(i)?u:i,e){case"srgb":s=_.RGB;break;case"srgb-linear":s=_.Linear_sRGB;break;case"lab":s=_.Lab;break;case"oklab":s=_.OKLab;break;case"xyz-d50":s=_.XYZ_D50;break;case"xyz":case"xyz-d65":s=_.XYZ_D65}t=colorDataTo(n,s).channels,l=colorDataTo(r,s).channels,t[0]=fillInMissingComponent(t[0],l[0]),l[0]=fillInMissingComponent(l[0],t[0]),t[1]=fillInMissingComponent(t[1],l[1]),l[1]=fillInMissingComponent(l[1],t[1]),t[2]=fillInMissingComponent(t[2],l[2]),l[2]=fillInMissingComponent(l[2],t[2]),t[0]=premultiply(t[0],u),t[1]=premultiply(t[1],u),t[2]=premultiply(t[2],u),l[0]=premultiply(l[0],i),l[1]=premultiply(l[1],i),l[2]=premultiply(l[2],i);const c=interpolate(u,i,o);return{colorNotation:s,channels:[un_premultiply(interpolate(t[0],l[0],o),c),un_premultiply(interpolate(t[1],l[1],o),c),un_premultiply(interpolate(t[2],l[2],o),c)],alpha:c*a.alphaMultiplier,syntaxFlags:new Set([g.ColorMix])}}function colorMixPolar(e,a,n){if(!n)return!1;const r=n.a.color,o=n.b.color,t=n.a.percentage/100;let l=r.channels,s=o.channels,u=0,i=0,c=0,m=0,h=0,N=0,p=_.RGB,b=r.alpha;if("number"!=typeof b)return!1;let f=o.alpha;if("number"!=typeof f)return!1;switch(b=Number.isNaN(b)?f:b,f=Number.isNaN(f)?b:f,e){case"hsl":p=_.HSL;break;case"hwb":p=_.HWB;break;case"lch":p=_.LCH;break;case"oklch":p=_.OKLCH}switch(l=colorDataTo(r,p).channels,s=colorDataTo(o,p).channels,e){case"hsl":case"hwb":u=l[0],i=s[0],c=l[1],m=s[1],h=l[2],N=s[2];break;case"lch":case"oklch":c=l[0],m=s[0],h=l[1],N=s[1],u=l[2],i=s[2]}u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),c=fillInMissingComponent(c,m),m=fillInMissingComponent(m,c),h=fillInMissingComponent(h,N),N=fillInMissingComponent(N,h);const v=i-u;switch(a){case"shorter":v>180?u+=360:v<-180&&(i+=360);break;case"longer":-1800?u+=360:i+=360);break;case"increasing":v<0&&(i+=360);break;case"decreasing":v>0&&(u+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,b),h=premultiply(h,b),m=premultiply(m,f),N=premultiply(N,f);let d=[0,0,0];const y=interpolate(b,f,t);switch(e){case"hsl":case"hwb":d=[interpolate(u,i,t),un_premultiply(interpolate(c,m,t),y),un_premultiply(interpolate(h,N,t),y)];break;case"lch":case"oklch":d=[un_premultiply(interpolate(c,m,t),y),un_premultiply(interpolate(h,N,t),y),interpolate(u,i,t)]}return{colorNotation:p,channels:d,alpha:y*n.alphaMultiplier,syntaxFlags:new Set([g.ColorMix])}}function fillInMissingComponent(e,a){return Number.isNaN(e)?a:e}function interpolate(e,a,n){return e*n+a*(1-n)}function premultiply(e,a){return Number.isNaN(a)?e:Number.isNaN(e)?NaN:e*a}function un_premultiply(e,a){return 0===a||Number.isNaN(a)?e:Number.isNaN(e)?NaN:e/a}function hex(e){const a=toLowerCaseAZ(e[4].value);if(a.match(/[^a-f0-9]/))return!1;const n={colorNotation:_.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([g.Hex])},r=a.length;if(3===r){const e=a[0],r=a[1],o=a[2];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n}if(6===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n}if(4===r){const e=a[0],r=a[1],o=a[2],t=a[3];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n.alpha=parseInt(t+t,16)/255,n.syntaxFlags.add(g.HasAlpha),n}if(8===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5],t=a[6]+a[7];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n.alpha=parseInt(t,16)/255,n.syntaxFlags.add(g.HasAlpha),n}return!1}function normalizeHue(n){if(n[0]===e.Number)return n[4].value=n[4].value%360,n[1]=n[4].value.toString(),n;if(n[0]===e.Dimension){let r=n[4].value;switch(toLowerCaseAZ(n[4].unit)){case"deg":break;case"rad":r=180*n[4].value/Math.PI;break;case"grad":r=.9*n[4].value;break;case"turn":r=360*n[4].value;break;default:return!1}return r%=360,[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(n,r,o){if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(g.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(g.HasPercentageAlpha):o.syntaxFlags.add(g.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){if(3!==r)return!1;let o=normalize(n[4].value,1,0,100);return 3===r&&(o=normalize(n[4].value,1,0,1)),[e.Number,o.toString(),n[2],n[3],{value:o,type:a.Number}]}return!1}function normalize_modern_HSL_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(g.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(g.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(g.HasPercentageAlpha):o.syntaxFlags.add(g.HasPercentageValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function threeChannelLegacySyntax(a,n,r,o){const t=[],l=[],m=[],h=[],N={colorNotation:r,channels:[0,0,0],alpha:1,syntaxFlags:new Set(o)};let _=t;for(let n=0;ni(a)&&a.value[0]===e.Comma))){const e=hslCommaSeparated(a);if(!1!==e)return e}{const e=hslSpaceSeparated(a,n);if(!1!==e)return e}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,_.HSL,[g.LegacyHSL])}function hslSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,_.HSL,[],a)}function normalize_HWB_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(g.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(g.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(g.HasPercentageAlpha):o.syntaxFlags.add(g.HasPercentageValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function normalize_Lab_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(g.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(g.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 1===r||2===r?t=normalize(n[4].value,.8,-1/0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=normalize(n[4].value,1,0,100);return 1===r||2===r?t=normalize(n[4].value,1,-1/0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function lab(e,a){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,_.Lab,[],a)}function normalize_LCH_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(g.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(2===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(g.HasDimensionValues),a)}if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(g.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 1===r?t=normalize(n[4].value,100/150,0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=normalize(n[4].value,1,0,100);return 1===r?t=normalize(n[4].value,1,0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function lch(e,a){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,_.LCH,[],a)}const L=new Map;for(const[e,a]of Object.entries(r))L.set(e,a);function namedColor(e){const a=L.get(toLowerCaseAZ(e));return!!a&&{colorNotation:_.RGB,channels:[a[0]/255,a[1]/255,a[2]/255],alpha:1,syntaxFlags:new Set([g.ColorKeyword,g.NamedColor])}}function normalize_OKLab_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(g.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(g.HasPercentageValues);let t=normalize(n[4].value,100,0,1);return 1===r||2===r?t=normalize(n[4].value,250,-1/0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=normalize(n[4].value,1,0,1);return 1===r||2===r?t=normalize(n[4].value,1,-1/0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function oklab(e,a){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,_.OKLab,[],a)}function normalize_OKLCH_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(g.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(2===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(g.HasDimensionValues),a)}if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(g.HasPercentageValues);let t=normalize(n[4].value,100,0,1);return 1===r?t=normalize(n[4].value,250,0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=normalize(n[4].value,1,0,1);return 1===r?t=normalize(n[4].value,1,0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function oklch(e,a){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,_.OKLCH,[],a)}function normalize_legacy_sRGB_ChannelValues(n,r,o){if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(g.HasPercentageAlpha):o.syntaxFlags.add(g.HasPercentageValues);const t=normalize(n[4].value,100,0,1);return[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=normalize(n[4].value,255,0,1);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(g.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(g.HasPercentageValues);let t=normalize(n[4].value,100,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(g.HasNumberValues);let t=normalize(n[4].value,255,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function rgb(a,n){if(a.value.some((a=>i(a)&&a.value[0]===e.Comma))){const e=rgbCommaSeparated(a);if(!1!==e)return(!e.syntaxFlags.has(g.HasNumberValues)||!e.syntaxFlags.has(g.HasPercentageValues))&&e}else{const e=rgbSpaceSeparated(a,n);if(!1!==e)return e}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,_.RGB,[g.LegacyRGB])}function rgbSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,_.RGB,[],a)}function toPrecision(e,a=7){e=+e,a=+a;const n=(Math.floor(e)+"").length;if(a>n)return+e.toFixed(a-n);{const r=10**(n-a);return Math.round(e/r)*r}}function XYZ_D50_to_P3_Gamut(e){const a=n.XYZ_D50_to_P3(e);if(o.inGamut(a))return o.clip(a);let r=e.slice();return r=t.D50_to_D65(r),r=t.XYZ_to_OKLab(r),r=t.OKLab_to_OKLCH(r),r[0]<1e-6&&(r=[0,0,0]),r[0]>.999999&&(r=[1,0,0]),l.mapGamut(r,(e=>(e=t.OKLCH_to_OKLab(e),e=t.OKLab_to_XYZ(e),e=t.XYZ_to_lin_P3(e),t.gam_P3(e))),(e=>(e=t.lin_P3(e),e=t.lin_P3_to_XYZ(e),e=t.XYZ_to_OKLab(e),t.OKLab_to_OKLCH(e))))}function serializeWithAlpha(n,r,o,t){const l=[e.CloseParen,")",-1,-1,void 0];if("number"==typeof n.alpha){const s=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(s,4)?new h(r,l,t):new h(r,l,[...t,new N([o]),new m([e.Delim,"/",-1,-1,{value:"/"}]),new N([o]),new m([e.Number,toPrecision(s,4).toString(),-1,-1,{value:n.alpha,type:a.Integer}])])}return new h(r,l,[...t,new N([o]),new m([e.Delim,"/",-1,-1,{value:"/"}]),new N([o]),n.alpha])}function serializeP3(r,o=!0){r.channels=convertPowerlessComponentsToZeroValuesForDisplay(r.channels,r.colorNotation);let t=r.channels.map((e=>Number.isNaN(e)?0:e));r.colorNotation!==_.Display_P3&&(t=o?XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(r).channels):n.XYZ_D50_to_P3(colorData_to_XYZ_D50(r).channels));const l=toPrecision(t[0],6),s=toPrecision(t[1],6),u=toPrecision(t[2],6),i=[e.Function,"color(",-1,-1,{value:"color"}],c=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(r,i,c,[new m([e.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new N([c]),new m([e.Number,l.toString(),-1,-1,{value:t[0],type:a.Number}]),new N([c]),new m([e.Number,s.toString(),-1,-1,{value:t[1],type:a.Number}]),new N([c]),new m([e.Number,u.toString(),-1,-1,{value:t[2],type:a.Number}])])}function XYZ_D50_to_sRGB_Gamut(e){const a=n.XYZ_D50_to_sRGB(e);if(o.inGamut(a))return o.clip(a);let r=e.slice();return r=t.D50_to_D65(r),r=t.XYZ_to_OKLab(r),r=t.OKLab_to_OKLCH(r),r[0]<1e-6&&(r=[0,0,0]),r[0]>.999999&&(r=[1,0,0]),l.mapGamut(r,(e=>(e=t.OKLCH_to_OKLab(e),e=t.OKLab_to_XYZ(e),e=t.XYZ_to_lin_sRGB(e),t.gam_sRGB(e))),(e=>(e=t.lin_sRGB(e),e=t.lin_sRGB_to_XYZ(e),e=t.XYZ_to_OKLab(e),t.OKLab_to_OKLCH(e))))}function serializeRGB(r,o=!0){r.channels=convertPowerlessComponentsToZeroValuesForDisplay(r.channels,r.colorNotation);let t=r.channels.map((e=>Number.isNaN(e)?0:e));t=o?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(r).channels):n.XYZ_D50_to_sRGB(colorData_to_XYZ_D50(r).channels);const l=Math.min(255,Math.max(0,Math.round(255*toPrecision(t[0])))),s=Math.min(255,Math.max(0,Math.round(255*toPrecision(t[1])))),u=Math.min(255,Math.max(0,Math.round(255*toPrecision(t[2])))),i=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],p=[e.Comma,",",-1,-1,void 0],b=[new m([e.Number,l.toString(),-1,-1,{value:t[0],type:a.Integer}]),new m(p),new N([c]),new m([e.Number,s.toString(),-1,-1,{value:t[1],type:a.Integer}]),new m(p),new N([c]),new m([e.Number,u.toString(),-1,-1,{value:t[2],type:a.Integer}])];if("number"==typeof r.alpha){const n=Math.min(1,Math.max(0,toPrecision(Number.isNaN(r.alpha)?0:r.alpha)));return 1===toPrecision(n,4)?new h([e.Function,"rgb(",-1,-1,{value:"rgb"}],i,b):new h([e.Function,"rgba(",-1,-1,{value:"rgba"}],i,[...b,new m(p),new N([c]),new m([e.Number,toPrecision(n,4).toString(),-1,-1,{value:r.alpha,type:a.Number}])])}return new h([e.Function,"rgba(",-1,-1,{value:"rgba"}],i,[...b,new m(p),new N([c]),r.alpha])}function serializeOKLCH(r){r.channels=convertPowerlessComponentsToZeroValuesForDisplay(r.channels,r.colorNotation);let o=r.channels.map((e=>Number.isNaN(e)?0:e));r.colorNotation!==_.OKLCH&&(o=n.XYZ_D50_to_OKLCH(colorData_to_XYZ_D50(r).channels));const t=toPrecision(o[0],6),l=toPrecision(o[1],6),s=toPrecision(o[2],6),u=[e.Function,"oklch(",-1,-1,{value:"oklch"}],i=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(r,u,i,[new m([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Number}]),new N([i]),new m([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Number}]),new N([i]),new m([e.Number,s.toString(),-1,-1,{value:o[2],type:a.Number}])])}function color(a){if(c(a)){switch(toLowerCaseAZ(a.getName())){case"rgb":case"rgba":return rgb(a,color);case"hsl":case"hsla":return hsl(a,color);case"hwb":return n=color,threeChannelSpaceSeparated(a,normalize_HWB_ChannelValues,_.HWB,[],n);case"lab":return lab(a,color);case"lch":return lch(a,color);case"oklab":return oklab(a,color);case"oklch":return oklch(a,color);case"color":return color$1(a,color);case"color-mix":return colorMix(a,color)}}var n;if(i(a)){if(a.value[0]===e.Hash)return hex(a.value);if(a.value[0]===e.Ident){const e=namedColor(a.value[4].value);return!1!==e?e:"transparent"===toLowerCaseAZ(a.value[4].value)&&{colorNotation:_.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([g.ColorKeyword])}}}return!1}export{_ as ColorNotation,g as SyntaxFlag,color,colorDataFitsDisplayP3_Gamut,colorDataFitsRGB_Gamut,colorDataTo,serializeOKLCH,serializeP3,serializeRGB}; +import{TokenType as e,NumberType as a}from"@csstools/css-tokenizer";import{XYZ_D50_to_XYZ_D65 as n,XYZ_D50_to_XYZ_D50 as r,XYZ_D50_to_OKLab as o,XYZ_D50_to_OKLCH as t,XYZ_D50_to_LCH as l,XYZ_D50_to_Lab as s,XYZ_D50_to_HWB as u,XYZ_D50_to_HSL as i,XYZ_D50_to_a98_RGB as c,XYZ_D50_to_ProPhoto as m,XYZ_D50_to_rec_2020 as h,XYZ_D50_to_P3 as N,XYZ_D50_to_lin_sRGB as p,XYZ_D50_to_sRGB as b,XYZ_D65_to_XYZ_D50 as g,OKLCH_to_XYZ_D50 as v,LCH_to_XYZ_D50 as d,OKLab_to_XYZ_D50 as f,Lab_to_XYZ_D50 as y,HWB_to_XYZ_D50 as C,HSL_to_XYZ_D50 as w,ProPhoto_RGB_to_XYZ_D50 as _,a98_RGB_to_XYZ_D50 as H,rec_2020_to_XYZ_D50 as x,P3_to_XYZ_D50 as L,lin_sRGB_to_XYZ_D50 as P,sRGB_to_XYZ_D50 as D,namedColors as S,inGamut as k,clip as z,mapGamut as F,OKLCH_to_OKLab as Z,OKLab_to_XYZ as M,XYZ_to_lin_P3 as R,gam_P3 as B,lin_P3 as G,lin_P3_to_XYZ as V,XYZ_to_OKLab as A,OKLab_to_OKLCH as T,XYZ_to_lin_sRGB as I,gam_sRGB as X,lin_sRGB as K,lin_sRGB_to_XYZ as Y}from"@csstools/color-helpers";import{isWhitespaceNode as O,isCommentNode as E,isTokenNode as W,isFunctionNode as U,TokenNode as $,FunctionNode as j,WhitespaceNode as q}from"@csstools/css-parser-algorithms";import{mathFunctionNames as J,calcFromComponentValues as Q}from"@csstools/css-calc";var ee,ae;function colorData_to_XYZ_D50(e){switch(e.colorNotation){case ee.HEX:case ee.RGB:case ee.sRGB:return{...e,colorNotation:ee.XYZ_D50,channels:D(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.Linear_sRGB:return{...e,colorNotation:ee.XYZ_D50,channels:P(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.Display_P3:return{...e,colorNotation:ee.XYZ_D50,channels:L(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.Rec2020:return{...e,colorNotation:ee.XYZ_D50,channels:x(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.A98_RGB:return{...e,colorNotation:ee.XYZ_D50,channels:H(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.ProPhoto_RGB:return{...e,colorNotation:ee.XYZ_D50,channels:_(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.HSL:return{...e,colorNotation:ee.XYZ_D50,channels:w(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.HWB:return{...e,colorNotation:ee.XYZ_D50,channels:C(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.Lab:return{...e,colorNotation:ee.XYZ_D50,channels:y(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.OKLab:return{...e,colorNotation:ee.XYZ_D50,channels:f(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.LCH:return{...e,colorNotation:ee.XYZ_D50,channels:d(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.OKLCH:return{...e,colorNotation:ee.XYZ_D50,channels:v(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.XYZ_D50:return{...e,colorNotation:ee.XYZ_D50,channels:r(e.channels.map((e=>Number.isNaN(e)?0:e)))};case ee.XYZ_D65:return{...e,colorNotation:ee.XYZ_D50,channels:g(e.channels.map((e=>Number.isNaN(e)?0:e)))};default:throw new Error("Unsupported color notation")}}!function(e){e.A98_RGB="a98-rgb",e.Display_P3="display-p3",e.HEX="hex",e.HSL="hsl",e.HWB="hwb",e.LCH="lch",e.Lab="lab",e.Linear_sRGB="srgb-linear",e.OKLCH="oklch",e.OKLab="oklab",e.ProPhoto_RGB="prophoto-rgb",e.RGB="rgb",e.sRGB="srgb",e.Rec2020="rec2020",e.XYZ_D50="xyz-d50",e.XYZ_D65="xyz-d65"}(ee||(ee={})),function(e){e.ColorKeyword="color-keyword",e.HasAlpha="has-alpha",e.HasDimensionValues="has-dimension-values",e.HasNoneKeywords="has-none-keywords",e.HasNumberValues="has-number-values",e.HasPercentageAlpha="has-percentage-alpha",e.HasPercentageValues="has-percentage-values",e.HasVariableAlpha="has-variable-alpha",e.Hex="hex",e.LegacyHSL="legacy-hsl",e.LegacyRGB="legacy-rgb",e.NamedColor="named-color",e.RelativeColorSyntax="relative-color-syntax",e.ColorMix="color-mix",e.Experimental="experimental"}(ae||(ae={}));const ne=new Set([ee.A98_RGB,ee.Display_P3,ee.HEX,ee.Linear_sRGB,ee.ProPhoto_RGB,ee.RGB,ee.sRGB,ee.Rec2020,ee.XYZ_D50,ee.XYZ_D65]);function colorDataTo(e,a){const g={...e};if(e.colorNotation!==a){const e=colorData_to_XYZ_D50(g);switch(a){case ee.HEX:case ee.RGB:g.colorNotation=ee.RGB,g.channels=b(e.channels);break;case ee.sRGB:g.colorNotation=ee.sRGB,g.channels=b(e.channels);break;case ee.Linear_sRGB:g.colorNotation=ee.Linear_sRGB,g.channels=p(e.channels);break;case ee.Display_P3:g.colorNotation=ee.Display_P3,g.channels=N(e.channels);break;case ee.Rec2020:g.colorNotation=ee.Rec2020,g.channels=h(e.channels);break;case ee.ProPhoto_RGB:g.colorNotation=ee.ProPhoto_RGB,g.channels=m(e.channels);break;case ee.A98_RGB:g.colorNotation=ee.A98_RGB,g.channels=c(e.channels);break;case ee.HSL:g.colorNotation=ee.HSL,g.channels=i(e.channels);break;case ee.HWB:g.colorNotation=ee.HWB,g.channels=u(e.channels);break;case ee.Lab:g.colorNotation=ee.Lab,g.channels=s(e.channels);break;case ee.LCH:g.colorNotation=ee.LCH,g.channels=l(e.channels);break;case ee.OKLCH:g.colorNotation=ee.OKLCH,g.channels=t(e.channels);break;case ee.OKLab:g.colorNotation=ee.OKLab,g.channels=o(e.channels);break;case ee.XYZ_D50:g.colorNotation=ee.XYZ_D50,g.channels=r(e.channels);break;case ee.XYZ_D65:g.colorNotation=ee.XYZ_D65,g.channels=n(e.channels);break;default:throw new Error("Unsupported color notation")}}else g.channels=e.channels.map((e=>Number.isNaN(e)?0:e));if(a===e.colorNotation)g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[0,1,2]);else if(ne.has(a)&&ne.has(e.colorNotation))g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[0,1,2]);else switch(a){case ee.HSL:switch(e.colorNotation){case ee.HWB:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[0]);break;case ee.Lab:case ee.OKLab:g.channels=carryForwardMissingComponents(e.channels,[2],g.channels,[0]);break;case ee.LCH:case ee.OKLCH:g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[2,1,0])}break;case ee.HWB:switch(e.colorNotation){case ee.HSL:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[0]);break;case ee.LCH:case ee.OKLCH:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[2])}break;case ee.Lab:case ee.OKLab:switch(e.colorNotation){case ee.HSL:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[2]);break;case ee.Lab:case ee.OKLab:g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[0,1,2]);break;case ee.LCH:case ee.OKLCH:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[0])}break;case ee.LCH:case ee.OKLCH:switch(e.colorNotation){case ee.HSL:g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[2,1,0]);break;case ee.HWB:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[2]);break;case ee.Lab:case ee.OKLab:g.channels=carryForwardMissingComponents(e.channels,[0],g.channels,[0]);break;case ee.LCH:case ee.OKLCH:g.channels=carryForwardMissingComponents(e.channels,[0,1,2],g.channels,[0,1,2])}}return g.channels=convertPowerlessComponentsToMissingComponents(g.channels,a),g}function convertPowerlessComponentsToMissingComponents(e,a){const n=[...e];switch(a){case ee.HSL:reducePrecision(n[1],4)<=0&&(n[0]=NaN);break;case ee.HWB:Math.max(0,reducePrecision(n[1],4))+Math.max(0,reducePrecision(n[2],4))>=100&&(n[0]=NaN);break;case ee.LCH:reducePrecision(n[1],4)<=0&&(n[2]=NaN);break;case ee.OKLCH:reducePrecision(n[1],6)<=0&&(n[2]=NaN)}return n}function convertPowerlessComponentsToZeroValuesForDisplay(e,a){const n=[...e];switch(a){case ee.HSL:(reducePrecision(n[2])<=0||reducePrecision(n[2])>=100)&&(n[0]=NaN,n[1]=NaN),reducePrecision(n[1])<=0&&(n[0]=NaN);break;case ee.HWB:Math.max(0,reducePrecision(n[1]))+Math.max(0,reducePrecision(n[2]))>=100&&(n[0]=NaN);break;case ee.Lab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case ee.LCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=100)&&(n[1]=NaN,n[2]=NaN);break;case ee.OKLab:(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN);break;case ee.OKLCH:reducePrecision(n[1])<=0&&(n[2]=NaN),(reducePrecision(n[0])<=0||reducePrecision(n[0])>=1)&&(n[1]=NaN,n[2]=NaN)}return n}function carryForwardMissingComponents(e,a,n,r){const o=[...n];for(const n of a)Number.isNaN(e[a[n]])&&(o[r[n]]=NaN);return o}function normalizeRelativeColorDataChannels(e){const a=new Map;switch(e.colorNotation){case ee.RGB:case ee.HEX:a.set("r",dummyNumberToken(255*e.channels[0])),a.set("g",dummyNumberToken(255*e.channels[1])),a.set("b",dummyNumberToken(255*e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.HSL:a.set("h",dummyNumberToken(e.channels[0])),a.set("s",dummyNumberToken(e.channels[1])),a.set("l",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.HWB:a.set("h",dummyNumberToken(e.channels[0])),a.set("w",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.Lab:case ee.OKLab:a.set("l",dummyNumberToken(e.channels[0])),a.set("a",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.LCH:case ee.OKLCH:a.set("l",dummyNumberToken(e.channels[0])),a.set("c",dummyNumberToken(e.channels[1])),a.set("h",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.sRGB:case ee.A98_RGB:case ee.Display_P3:case ee.Rec2020:case ee.Linear_sRGB:case ee.ProPhoto_RGB:a.set("r",dummyNumberToken(e.channels[0])),a.set("g",dummyNumberToken(e.channels[1])),a.set("b",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha));break;case ee.XYZ_D50:case ee.XYZ_D65:a.set("x",dummyNumberToken(e.channels[0])),a.set("y",dummyNumberToken(e.channels[1])),a.set("z",dummyNumberToken(e.channels[2])),"number"==typeof e.alpha&&a.set("alpha",dummyNumberToken(e.alpha))}return a}function noneToZeroInRelativeColorDataChannels(e){const a=new Map(e);for(const[n,r]of e)Number.isNaN(r[4].value)&&a.set(n,dummyNumberToken(0));return a}function dummyNumberToken(n){return[e.Number,n.toString(),-1,-1,{value:n,type:a.Number}]}function reducePrecision(e,a=7){if(Number.isNaN(e))return 0;const n=Math.pow(10,a);return Math.round(e*n)/n}function colorDataFitsRGB_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,ee.RGB).channels.find((e=>e<-1e-5||e>1.00001))}function colorDataFitsDisplayP3_Gamut(e){const a={...e,channels:[...e.channels]};a.channels=convertPowerlessComponentsToZeroValuesForDisplay(a.channels,a.colorNotation);return!colorDataTo(a,ee.Display_P3).channels.find((e=>e<-1e-5||e>1.00001))}function normalize(e,a,n,r){return Math.min(Math.max(e/a,n),r)}const re=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(re,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function normalize_Color_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,100,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}const oe=new Set(["srgb","srgb-linear","display-p3","a98-rgb","prophoto-rgb","rec2020","xyz","xyz-d50","xyz-d65"]);function color$1(a,n){const r=[],o=[],t=[],l=[];let s,u,i=!1,c=!1;const m={colorNotation:ee.sRGB,channels:[0,0,0],alpha:1,syntaxFlags:new Set([])};let h=r;for(let N=0;N=0){l=s.value[4].value;continue}}return!1}if(!t)return!1;r.push({color:t,percentage:l}),t=!1,l=!1}}if(t&&r.push({color:t,percentage:l}),2!==r.length)return!1;let s=r[0].percentage,u=r[1].percentage;return(!1===s||!(s<0||s>100))&&((!1===u||!(u<0||u>100))&&(!1===s&&!1===u?(s=50,u=50):!1!==s&&!1===u?u=100-s:!1===s&&!1!==u&&(s=100-u),(0!==s||0!==u)&&(!1!==s&&!1!==u&&(s+u>100&&(s=s/(s+u)*100,u=u/(s+u)*100),s+u<100&&(o=(s+u)/100,s=s/(s+u)*100,u=u/(s+u)*100),{a:{color:r[0].color,percentage:s},b:{color:r[1].color,percentage:u},alphaMultiplier:o}))))}function colorMixRectangular(e,a){if(!a)return!1;const n=a.a.color,r=a.b.color,o=a.a.percentage/100;let t=n.channels,l=r.channels,s=ee.RGB,u=n.alpha;if("number"!=typeof u)return!1;let i=r.alpha;if("number"!=typeof i)return!1;switch(u=Number.isNaN(u)?i:u,i=Number.isNaN(i)?u:i,e){case"srgb":s=ee.RGB;break;case"srgb-linear":s=ee.Linear_sRGB;break;case"lab":s=ee.Lab;break;case"oklab":s=ee.OKLab;break;case"xyz-d50":s=ee.XYZ_D50;break;case"xyz":case"xyz-d65":s=ee.XYZ_D65}t=colorDataTo(n,s).channels,l=colorDataTo(r,s).channels,t[0]=fillInMissingComponent(t[0],l[0]),l[0]=fillInMissingComponent(l[0],t[0]),t[1]=fillInMissingComponent(t[1],l[1]),l[1]=fillInMissingComponent(l[1],t[1]),t[2]=fillInMissingComponent(t[2],l[2]),l[2]=fillInMissingComponent(l[2],t[2]),t[0]=premultiply(t[0],u),t[1]=premultiply(t[1],u),t[2]=premultiply(t[2],u),l[0]=premultiply(l[0],i),l[1]=premultiply(l[1],i),l[2]=premultiply(l[2],i);const c=interpolate(u,i,o),m={colorNotation:s,channels:[un_premultiply(interpolate(t[0],l[0],o),c),un_premultiply(interpolate(t[1],l[1],o),c),un_premultiply(interpolate(t[2],l[2],o),c)],alpha:c*a.alphaMultiplier,syntaxFlags:new Set([ae.ColorMix])};return(a.a.color.syntaxFlags.has(ae.Experimental)||a.b.color.syntaxFlags.has(ae.Experimental))&&m.syntaxFlags.add(ae.Experimental),m}function colorMixPolar(e,a,n){if(!n)return!1;const r=n.a.color,o=n.b.color,t=n.a.percentage/100;let l=r.channels,s=o.channels,u=0,i=0,c=0,m=0,h=0,N=0,p=ee.RGB,b=r.alpha;if("number"!=typeof b)return!1;let g=o.alpha;if("number"!=typeof g)return!1;switch(b=Number.isNaN(b)?g:b,g=Number.isNaN(g)?b:g,e){case"hsl":p=ee.HSL;break;case"hwb":p=ee.HWB;break;case"lch":p=ee.LCH;break;case"oklch":p=ee.OKLCH}switch(l=colorDataTo(r,p).channels,s=colorDataTo(o,p).channels,e){case"hsl":case"hwb":u=l[0],i=s[0],c=l[1],m=s[1],h=l[2],N=s[2];break;case"lch":case"oklch":c=l[0],m=s[0],h=l[1],N=s[1],u=l[2],i=s[2]}u=fillInMissingComponent(u,i),Number.isNaN(u)&&(u=0),i=fillInMissingComponent(i,u),Number.isNaN(i)&&(i=0),c=fillInMissingComponent(c,m),m=fillInMissingComponent(m,c),h=fillInMissingComponent(h,N),N=fillInMissingComponent(N,h);const v=i-u;switch(a){case"shorter":v>180?u+=360:v<-180&&(i+=360);break;case"longer":-1800?u+=360:i+=360);break;case"increasing":v<0&&(i+=360);break;case"decreasing":v>0&&(u+=360);break;default:throw new Error("Unknown hue interpolation method")}c=premultiply(c,b),h=premultiply(h,b),m=premultiply(m,g),N=premultiply(N,g);let d=[0,0,0];const f=interpolate(b,g,t);switch(e){case"hsl":case"hwb":d=[interpolate(u,i,t),un_premultiply(interpolate(c,m,t),f),un_premultiply(interpolate(h,N,t),f)];break;case"lch":case"oklch":d=[un_premultiply(interpolate(c,m,t),f),un_premultiply(interpolate(h,N,t),f),interpolate(u,i,t)]}const y={colorNotation:p,channels:d,alpha:f*n.alphaMultiplier,syntaxFlags:new Set([ae.ColorMix])};return(n.a.color.syntaxFlags.has(ae.Experimental)||n.b.color.syntaxFlags.has(ae.Experimental))&&y.syntaxFlags.add(ae.Experimental),y}function fillInMissingComponent(e,a){return Number.isNaN(e)?a:e}function interpolate(e,a,n){return e*n+a*(1-n)}function premultiply(e,a){return Number.isNaN(a)?e:Number.isNaN(e)?NaN:e*a}function un_premultiply(e,a){return 0===a||Number.isNaN(a)?e:Number.isNaN(e)?NaN:e/a}function hex(e){const a=toLowerCaseAZ(e[4].value);if(a.match(/[^a-f0-9]/))return!1;const n={colorNotation:ee.HEX,channels:[0,0,0],alpha:1,syntaxFlags:new Set([ae.Hex])},r=a.length;if(3===r){const e=a[0],r=a[1],o=a[2];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n}if(6===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n}if(4===r){const e=a[0],r=a[1],o=a[2],t=a[3];return n.channels=[parseInt(e+e,16)/255,parseInt(r+r,16)/255,parseInt(o+o,16)/255],n.alpha=parseInt(t+t,16)/255,n.syntaxFlags.add(ae.HasAlpha),n}if(8===r){const e=a[0]+a[1],r=a[2]+a[3],o=a[4]+a[5],t=a[6]+a[7];return n.channels=[parseInt(e,16)/255,parseInt(r,16)/255,parseInt(o,16)/255],n.alpha=parseInt(t,16)/255,n.syntaxFlags.add(ae.HasAlpha),n}return!1}function normalizeHue(n){if(n[0]===e.Number)return n[4].value=n[4].value%360,n[1]=n[4].value.toString(),n;if(n[0]===e.Dimension){let r=n[4].value;switch(toLowerCaseAZ(n[4].unit)){case"deg":break;case"rad":r=180*n[4].value/Math.PI;break;case"grad":r=.9*n[4].value;break;case"turn":r=360*n[4].value;break;default:return!1}return r%=360,[e.Number,r.toString(),n[2],n[3],{value:r,type:a.Number}]}return!1}function normalize_legacy_HSL_ChannelValues(n,r,o){if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(ae.HasPercentageAlpha):o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){if(3!==r)return!1;let o=normalize(n[4].value,1,0,100);return 3===r&&(o=normalize(n[4].value,1,0,1)),[e.Number,o.toString(),n[2],n[3],{value:o,type:a.Number}]}return!1}function normalize_modern_HSL_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(ae.HasPercentageAlpha):o.syntaxFlags.add(ae.HasPercentageValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function threeChannelLegacySyntax(a,n,r,o){const t=[],l=[],s=[],u=[],i={colorNotation:r,channels:[0,0,0],alpha:1,syntaxFlags:new Set(o)};let c=t;for(let n=0;nW(a)&&a.value[0]===e.Comma))){const e=hslCommaSeparated(a);if(!1!==e)return e}{const e=hslSpaceSeparated(a,n);if(!1!==e)return e}return!1}function hslCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_HSL_ChannelValues,ee.HSL,[ae.LegacyHSL])}function hslSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_HSL_ChannelValues,ee.HSL,[],a)}function normalize_HWB_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(0===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(ae.HasPercentageAlpha):o.syntaxFlags.add(ae.HasPercentageValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=n[4].value;return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function normalize_Lab_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 1===r||2===r?t=normalize(n[4].value,.8,-1/0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,0,100);return 1===r||2===r?t=normalize(n[4].value,1,-1/0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function lab(e,a){return threeChannelSpaceSeparated(e,normalize_Lab_ChannelValues,ee.Lab,[],a)}function normalize_LCH_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(2===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,1,0,100);return 1===r?t=normalize(n[4].value,100/150,0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,0,100);return 1===r?t=normalize(n[4].value,1,0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function lch(e,a){return threeChannelSpaceSeparated(e,normalize_LCH_ChannelValues,ee.LCH,[],a)}const ue=new Map;for(const[e,a]of Object.entries(S))ue.set(e,a);function namedColor(e){const a=ue.get(toLowerCaseAZ(e));return!!a&&{colorNotation:ee.RGB,channels:[a[0]/255,a[1]/255,a[2]/255],alpha:1,syntaxFlags:new Set([ae.ColorKeyword,ae.NamedColor])}}function normalize_OKLab_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,100,0,1);return 1===r||2===r?t=normalize(n[4].value,250,-1/0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,0,1);return 1===r||2===r?t=normalize(n[4].value,1,-1/0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function oklab(e,a){return threeChannelSpaceSeparated(e,normalize_OKLab_ChannelValues,ee.OKLab,[],a)}function normalize_OKLCH_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(2===r){const a=normalizeHue(n);return!1!==a&&(n[0]===e.Dimension&&o.syntaxFlags.add(ae.HasDimensionValues),a)}if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,100,0,1);return 1===r?t=normalize(n[4].value,250,0,1/0):3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,1,0,1);return 1===r?t=normalize(n[4].value,1,0,1/0):3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function oklch(e,a){return threeChannelSpaceSeparated(e,normalize_OKLCH_ChannelValues,ee.OKLCH,[],a)}function normalize_legacy_sRGB_ChannelValues(n,r,o){if(n[0]===e.Percentage){3===r?o.syntaxFlags.add(ae.HasPercentageAlpha):o.syntaxFlags.add(ae.HasPercentageValues);const t=normalize(n[4].value,100,0,1);return[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,255,0,1);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function normalize_modern_sRGB_ChannelValues(n,r,o){if(n[0]===e.Ident&&"none"===toLowerCaseAZ(n[4].value))return o.syntaxFlags.add(ae.HasNoneKeywords),[e.Number,"none",n[2],n[3],{value:NaN,type:a.Number}];if(n[0]===e.Percentage){3!==r&&o.syntaxFlags.add(ae.HasPercentageValues);let t=normalize(n[4].value,100,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,100,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}if(n[0]===e.Number){3!==r&&o.syntaxFlags.add(ae.HasNumberValues);let t=normalize(n[4].value,255,-1/0,1/0);return 3===r&&(t=normalize(n[4].value,1,0,1)),[e.Number,t.toString(),n[2],n[3],{value:t,type:a.Number}]}return!1}function rgb(a,n){if(a.value.some((a=>W(a)&&a.value[0]===e.Comma))){const e=rgbCommaSeparated(a);if(!1!==e)return(!e.syntaxFlags.has(ae.HasNumberValues)||!e.syntaxFlags.has(ae.HasPercentageValues))&&e}else{const e=rgbSpaceSeparated(a,n);if(!1!==e)return e}return!1}function rgbCommaSeparated(e){return threeChannelLegacySyntax(e,normalize_legacy_sRGB_ChannelValues,ee.RGB,[ae.LegacyRGB])}function rgbSpaceSeparated(e,a){return threeChannelSpaceSeparated(e,normalize_modern_sRGB_ChannelValues,ee.RGB,[],a)}function toPrecision(e,a=7){e=+e,a=+a;const n=(Math.floor(e)+"").length;if(a>n)return+e.toFixed(a-n);{const r=10**(n-a);return Math.round(e/r)*r}}function XYZ_D50_to_P3_Gamut(e){const a=N(e);if(k(a))return z(a);let n=e.slice();return n=t(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),F(n,(e=>(e=Z(e),e=M(e),e=R(e),B(e))),(e=>(e=G(e),e=V(e),e=A(e),T(e))))}function serializeWithAlpha(n,r,o,t){const l=[e.CloseParen,")",-1,-1,void 0];if("number"==typeof n.alpha){const s=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(s,4)?new j(r,l,t):new j(r,l,[...t,new q([o]),new $([e.Delim,"/",-1,-1,{value:"/"}]),new q([o]),new $([e.Number,toPrecision(s,4).toString(),-1,-1,{value:n.alpha,type:a.Integer}])])}return new j(r,l,[...t,new q([o]),new $([e.Delim,"/",-1,-1,{value:"/"}]),new q([o]),n.alpha])}function serializeP3(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));n.colorNotation!==ee.Display_P3&&(o=r?XYZ_D50_to_P3_Gamut(colorData_to_XYZ_D50(n).channels):N(colorData_to_XYZ_D50(n).channels));const t=toPrecision(o[0],6),l=toPrecision(o[1],6),s=toPrecision(o[2],6),u=[e.Function,"color(",-1,-1,{value:"color"}],i=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,u,i,[new $([e.Ident,"display-p3",-1,-1,{value:"display-p3"}]),new q([i]),new $([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Number}]),new q([i]),new $([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Number}]),new q([i]),new $([e.Number,s.toString(),-1,-1,{value:o[2],type:a.Number}])])}function XYZ_D50_to_sRGB_Gamut(e){const a=b(e);if(k(a))return z(a);let n=e.slice();return n=t(n),n[0]<1e-6&&(n=[0,0,0]),n[0]>.999999&&(n=[1,0,0]),F(n,(e=>(e=Z(e),e=M(e),e=I(e),X(e))),(e=>(e=K(e),e=Y(e),e=A(e),T(e))))}function serializeRGB(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=r?XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels):b(colorData_to_XYZ_D50(n).channels);const t=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[0])))),l=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[1])))),s=Math.min(255,Math.max(0,Math.round(255*toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],i=[e.Whitespace," ",-1,-1,void 0],c=[e.Comma,",",-1,-1,void 0],m=[new $([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Integer}]),new $(c),new q([i]),new $([e.Number,l.toString(),-1,-1,{value:o[1],type:a.Integer}]),new $(c),new q([i]),new $([e.Number,s.toString(),-1,-1,{value:o[2],type:a.Integer}])];if("number"==typeof n.alpha){const r=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(r,4)?new j([e.Function,"rgb(",-1,-1,{value:"rgb"}],u,m):new j([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...m,new $(c),new q([i]),new $([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new j([e.Function,"rgba(",-1,-1,{value:"rgba"}],u,[...m,new $(c),new q([i]),n.alpha])}function serializeHSL(n,r=!0){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let o=n.channels.map((e=>Number.isNaN(e)?0:e));o=i(r?D(XYZ_D50_to_sRGB_Gamut(colorData_to_XYZ_D50(n).channels)):colorData_to_XYZ_D50(n).channels),o=o.map((e=>Number.isNaN(e)?0:e));const t=Math.min(360,Math.max(0,Math.round(toPrecision(o[0])))),l=Math.min(100,Math.max(0,Math.round(toPrecision(o[1])))),s=Math.min(100,Math.max(0,Math.round(toPrecision(o[2])))),u=[e.CloseParen,")",-1,-1,void 0],c=[e.Whitespace," ",-1,-1,void 0],m=[e.Comma,",",-1,-1,void 0],h=[new $([e.Number,t.toString(),-1,-1,{value:o[0],type:a.Integer}]),new $(m),new q([c]),new $([e.Percentage,l.toString()+"%",-1,-1,{value:o[1]}]),new $(m),new q([c]),new $([e.Percentage,s.toString()+"%",-1,-1,{value:o[2]}])];if("number"==typeof n.alpha){const r=Math.min(1,Math.max(0,toPrecision(Number.isNaN(n.alpha)?0:n.alpha)));return 1===toPrecision(r,4)?new j([e.Function,"hsl(",-1,-1,{value:"hsl"}],u,h):new j([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new $(m),new q([c]),new $([e.Number,toPrecision(r,4).toString(),-1,-1,{value:n.alpha,type:a.Number}])])}return new j([e.Function,"hsla(",-1,-1,{value:"hsla"}],u,[...h,new $(m),new q([c]),n.alpha])}function serializeOKLCH(n){n.channels=convertPowerlessComponentsToZeroValuesForDisplay(n.channels,n.colorNotation);let r=n.channels.map((e=>Number.isNaN(e)?0:e));n.colorNotation!==ee.OKLCH&&(r=t(colorData_to_XYZ_D50(n).channels));const o=toPrecision(r[0],6),l=toPrecision(r[1],6),s=toPrecision(r[2],6),u=[e.Function,"oklch(",-1,-1,{value:"oklch"}],i=[e.Whitespace," ",-1,-1,void 0];return serializeWithAlpha(n,u,i,[new $([e.Number,o.toString(),-1,-1,{value:r[0],type:a.Number}]),new q([i]),new $([e.Number,l.toString(),-1,-1,{value:r[1],type:a.Number}]),new q([i]),new $([e.Number,s.toString(),-1,-1,{value:r[2],type:a.Number}])])}function color(a){if(U(a)){switch(toLowerCaseAZ(a.getName())){case"rgb":case"rgba":return rgb(a,color);case"hsl":case"hsla":return hsl(a,color);case"hwb":return n=color,threeChannelSpaceSeparated(a,normalize_HWB_ChannelValues,ee.HWB,[],n);case"lab":return lab(a,color);case"lch":return lch(a,color);case"oklab":return oklab(a,color);case"oklch":return oklch(a,color);case"color":return color$1(a,color);case"color-mix":return colorMix(a,color)}}var n;if(W(a)){if(a.value[0]===e.Hash)return hex(a.value);if(a.value[0]===e.Ident){const e=namedColor(a.value[4].value);return!1!==e?e:"transparent"===toLowerCaseAZ(a.value[4].value)&&{colorNotation:ee.RGB,channels:[0,0,0],alpha:0,syntaxFlags:new Set([ae.ColorKeyword])}}}return!1}export{ee as ColorNotation,ae as SyntaxFlag,color,colorDataFitsDisplayP3_Gamut,colorDataFitsRGB_Gamut,colorDataTo,serializeHSL,serializeOKLCH,serializeP3,serializeRGB}; diff --git a/node_modules/@csstools/css-color-parser/dist/serialize/oklch.d.ts b/node_modules/@csstools/css-color-parser/dist/serialize/oklch.d.ts deleted file mode 100644 index 1963c49e..00000000 --- a/node_modules/@csstools/css-color-parser/dist/serialize/oklch.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ColorData } from '../color-data'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function serializeOKLCH(color: ColorData): FunctionNode; diff --git a/node_modules/@csstools/css-color-parser/dist/serialize/p3.d.ts b/node_modules/@csstools/css-color-parser/dist/serialize/p3.d.ts deleted file mode 100644 index 503c5a25..00000000 --- a/node_modules/@csstools/css-color-parser/dist/serialize/p3.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ColorData } from '../color-data'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function serializeP3(color: ColorData, gamutMapping?: boolean): FunctionNode; diff --git a/node_modules/@csstools/css-color-parser/dist/serialize/rgb.d.ts b/node_modules/@csstools/css-color-parser/dist/serialize/rgb.d.ts deleted file mode 100644 index b4c38133..00000000 --- a/node_modules/@csstools/css-color-parser/dist/serialize/rgb.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ColorData } from '../color-data'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function serializeRGB(color: ColorData, gamutMapping?: boolean): FunctionNode; diff --git a/node_modules/@csstools/css-color-parser/dist/serialize/to-precision.d.ts b/node_modules/@csstools/css-color-parser/dist/serialize/to-precision.d.ts deleted file mode 100644 index 1bcc6b27..00000000 --- a/node_modules/@csstools/css-color-parser/dist/serialize/to-precision.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toPrecision(n: number, precision?: number): number; diff --git a/node_modules/@csstools/css-color-parser/dist/serialize/with-alpha.d.ts b/node_modules/@csstools/css-color-parser/dist/serialize/with-alpha.d.ts deleted file mode 100644 index c214a9cc..00000000 --- a/node_modules/@csstools/css-color-parser/dist/serialize/with-alpha.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ColorData } from '../color-data'; -import type { TokenFunction, TokenWhitespace } from '@csstools/css-tokenizer'; -import { FunctionNode, TokenNode, WhitespaceNode } from '@csstools/css-parser-algorithms'; -export declare function serializeWithAlpha(color: ColorData, fn: TokenFunction, space: TokenWhitespace, channels: Array): FunctionNode; diff --git a/node_modules/@csstools/css-color-parser/dist/util/to-lower-case-a-z.d.ts b/node_modules/@csstools/css-color-parser/dist/util/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e..00000000 --- a/node_modules/@csstools/css-color-parser/dist/util/to-lower-case-a-z.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/css-color-parser/package.json b/node_modules/@csstools/css-color-parser/package.json index 6ef632c9..12b43584 100644 --- a/node_modules/@csstools/css-color-parser/package.json +++ b/node_modules/@csstools/css-color-parser/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/css-color-parser", "description": "Parse CSS color values", - "version": "1.4.0", + "version": "1.5.0", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,19 +48,12 @@ "dist" ], "dependencies": { - "@csstools/color-helpers": "^3.0.2", - "@csstools/css-calc": "^1.1.4" + "@csstools/color-helpers": "^4.0.0", + "@csstools/css-calc": "^1.1.5" }, "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs" + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser#readme", "repository": { @@ -70,8 +66,5 @@ "color", "css", "parser" - ], - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md index 8d6ae2ff..6d228cd2 100644 --- a/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md +++ b/node_modules/@csstools/css-parser-algorithms/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes to CSS Parser Algorithms +### 2.4.0 + +_December 15, 2023_ + +- Fix type definitions +- Only `walk` child nodes if they are still part of the current AST tree [#1202](https://github.com/csstools/postcss-plugins/issues/1202) +- Make `walk` methods safe for mutations [#1204](https://github.com/csstools/postcss-plugins/issues/1204) +- Add a `forEach` method to `FunctionNode` and `SimpleBlockNode` +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) + ### 2.3.2 _September 24, 2023_ @@ -12,54 +22,4 @@ _July 24, 2023_ - Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -### 2.3.0 - -_July 3, 2023_ - -- Add `sourceIndices` helper function. - -This makes it easier to get the start and end indices of a node in the source string. -This function accepts any node that can be converted into an array of tokens. - -### 2.2.0 - -_June 1, 2023_ - -- Add `state` to `walk` methods. - -This makes it possible pass down information from a parent structure to children. -e.g. you can set `entry.state.isInCalcExpression = true` for `calc((10 + 5) / 2)` when walking the `FunctionNode` for `calc`. - -### 2.1.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) - -### 2.1.0 - -_March 25, 2023_ - -- Add `replaceComponentValues` utility function. -- Add `stringify` utility function. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 19, 2023_ - -- Fix: Removes `UnclosedFunctionNode` and `UnclosedSimpleBlockNode`. (breaking) -- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) -- Change `nameTokenValue` in `FunctionNode` to `getName` (breaking) -- Fix: Do not discard empty items in comma separated lists. - -### 1.0.0 - -_November 14, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md) diff --git a/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts deleted file mode 100644 index 59cdf944..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts +++ /dev/null @@ -1,118 +0,0 @@ -import { CSSToken, TokenFunction } from '@csstools/css-tokenizer'; -import { Context } from '../interfaces/context'; -import { ComponentValueType } from '../util/component-value-type'; -export type ContainerNode = FunctionNode | SimpleBlockNode; -export type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode; -export declare function consumeComponentValue(ctx: Context, tokens: Array): { - advance: number; - node: ComponentValue; -}; -export declare class FunctionNode { - type: ComponentValueType; - name: TokenFunction; - endToken: CSSToken; - value: Array; - constructor(name: TokenFunction, endToken: CSSToken, value: Array); - getName(): string; - /** - * Normalize the current Function: - * - if the "endToken" is EOF, replace with a ")-token" - */ - normalize(): void; - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | undefined; - walk>(cb: (entry: { - node: ComponentValue; - parent: ContainerNode; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isFunctionNode(): this is FunctionNode; - static isFunctionNode(x: unknown): x is FunctionNode; -} -export declare function consumeFunction(ctx: Context, tokens: Array): { - advance: number; - node: FunctionNode; -}; -export declare class SimpleBlockNode { - type: ComponentValueType; - startToken: CSSToken; - endToken: CSSToken; - value: Array; - constructor(startToken: CSSToken, endToken: CSSToken, value: Array); - /** - * Normalize the current Simple Block: - * - if the "endToken" is EOF, replace with the mirror token of the "startToken" - */ - normalize(): void; - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | undefined; - walk>(cb: (entry: { - node: ComponentValue; - parent: ContainerNode; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isSimpleBlockNode(): this is SimpleBlockNode; - static isSimpleBlockNode(x: unknown): x is SimpleBlockNode; -} -/** https://www.w3.org/TR/css-syntax-3/#consume-simple-block */ -export declare function consumeSimpleBlock(ctx: Context, tokens: Array): { - advance: number; - node: SimpleBlockNode; -}; -export declare class WhitespaceNode { - type: ComponentValueType; - value: Array; - constructor(value: Array); - tokens(): Array; - toString(): string; - toJSON(): { - type: ComponentValueType; - tokens: CSSToken[]; - }; - isWhitespaceNode(): this is WhitespaceNode; - static isWhitespaceNode(x: unknown): x is WhitespaceNode; -} -export declare function consumeWhitespace(ctx: Context, tokens: Array): { - advance: number; - node: WhitespaceNode; -}; -export declare class CommentNode { - type: ComponentValueType; - value: CSSToken; - constructor(value: CSSToken); - tokens(): Array; - toString(): string; - toJSON(): { - type: ComponentValueType; - tokens: CSSToken[]; - }; - isCommentNode(): this is CommentNode; - static isCommentNode(x: unknown): x is CommentNode; -} -export declare function consumeComment(ctx: Context, tokens: Array): { - advance: number; - node: CommentNode; -}; -export declare function consumeAllCommentsAndWhitespace(ctx: Context, tokens: Array): { - advance: number; - nodes: Array; -}; -export declare class TokenNode { - type: ComponentValueType; - value: CSSToken; - constructor(value: CSSToken); - tokens(): Array; - toString(): string; - toJSON(): { - type: ComponentValueType; - tokens: CSSToken[]; - }; - isTokenNode(): this is TokenNode; - static isTokenNode(x: unknown): x is TokenNode; -} diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.cjs b/node_modules/@csstools/css-parser-algorithms/dist/index.cjs index 4405dce4..eedf0293 100644 --- a/node_modules/@csstools/css-parser-algorithms/dist/index.cjs +++ b/node_modules/@csstools/css-parser-algorithms/dist/index.cjs @@ -1 +1 @@ -"use strict";var e,n=require("@csstools/css-tokenizer");function consumeComponentValue(e,o){const t=o[0];if(t[0]===n.TokenType.OpenParen||t[0]===n.TokenType.OpenCurly||t[0]===n.TokenType.OpenSquare){const n=consumeSimpleBlock(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Function){const n=consumeFunction(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Whitespace){const n=consumeWhitespace(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Comment){const n=consumeComment(e,o);return{advance:n.advance,node:n.node}}return{advance:1,node:new TokenNode(t)}}exports.ComponentValueType=void 0,(e=exports.ComponentValueType||(exports.ComponentValueType={})).Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token";class FunctionNode{type=exports.ComponentValueType.Function;name;endToken;value;constructor(e,n,o){this.name=e,this.endToken=n,this.value=o}getName(){return this.name[4].value}normalize(){this.endToken[0]===n.TokenType.EOF&&(this.endToken=[n.TokenType.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===n.TokenType.EOF?[this.name,...this.value.flatMap((e=>e.tokens()))]:[this.name,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.name)+e+n.stringify(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let o=!1;if(this.value.forEach(((t,s)=>{if(o)return;let i;n&&(i={...n}),!1!==e({node:t,parent:this,state:i},s)?"walk"in t&&!1===t.walk(e,i)&&(o=!0):o=!0})),o)return!1}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===exports.ComponentValueType.Function)}}function consumeFunction(e,o){const t=[];let s=1;for(;;){const i=o[s];if(!i||i[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a function.",o[0][2],o[o.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:o.length,node:new FunctionNode(o[0],i,t)};if(i[0]===n.TokenType.CloseParen)return{advance:s+1,node:new FunctionNode(o[0],i,t)};if(i[0]===n.TokenType.Comment||i[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(s));s+=n.advance,t.push(...n.nodes);continue}const r=consumeComponentValue(e,o.slice(s));s+=r.advance,t.push(r.node)}}class SimpleBlockNode{type=exports.ComponentValueType.SimpleBlock;startToken;endToken;value;constructor(e,n,o){this.startToken=e,this.endToken=n,this.value=o}normalize(){if(this.endToken[0]===n.TokenType.EOF){const e=n.mirrorVariant(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===n.TokenType.EOF?[this.startToken,...this.value.flatMap((e=>e.tokens()))]:[this.startToken,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.startToken)+e+n.stringify(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let o=!1;if(this.value.forEach(((t,s)=>{if(o)return;let i;n&&(i={...n}),!1!==e({node:t,parent:this,state:i},s)?"walk"in t&&!1===t.walk(e,i)&&(o=!0):o=!0})),o)return!1}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===exports.ComponentValueType.SimpleBlock)}}function consumeSimpleBlock(e,o){const t=n.mirrorVariantType(o[0][0]);if(!t)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const s=[];let i=1;for(;;){const r=o[i];if(!r||r[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a simple block.",o[0][2],o[o.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:o.length,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===t)return{advance:i+1,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===n.TokenType.Comment||r[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(i));i+=n.advance,s.push(...n.nodes);continue}const a=consumeComponentValue(e,o.slice(i));i+=a.advance,s.push(a.node)}}class WhitespaceNode{type=exports.ComponentValueType.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return n.stringify(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===exports.ComponentValueType.Whitespace)}}function consumeWhitespace(e,o){let t=0;for(;;){if(o[t][0]!==n.TokenType.Whitespace)return{advance:t,node:new WhitespaceNode(o.slice(0,t))};t++}}class CommentNode{type=exports.ComponentValueType.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===exports.ComponentValueType.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(e,o){const t=[];let s=0;for(;;)if(o[s][0]!==n.TokenType.Whitespace){if(o[s][0]!==n.TokenType.Comment)return{advance:s,nodes:t};t.push(new CommentNode(o[s])),s++}else{const e=consumeWhitespace(0,o.slice(s));s+=e.advance,t.push(e.node)}}class TokenNode{type=exports.ComponentValueType.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===exports.ComponentValueType.Token)}}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}exports.CommentNode=CommentNode,exports.FunctionNode=FunctionNode,exports.SimpleBlockNode=SimpleBlockNode,exports.TokenNode=TokenNode,exports.WhitespaceNode=WhitespaceNode,exports.consumeAllCommentsAndWhitespace=consumeAllCommentsAndWhitespace,exports.consumeComment=consumeComment,exports.consumeComponentValue=consumeComponentValue,exports.consumeFunction=consumeFunction,exports.consumeSimpleBlock=consumeSimpleBlock,exports.consumeWhitespace=consumeWhitespace,exports.gatherNodeAncestry=function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((o=>{n.set(o,e.parent)})):n.set(e.node,e.parent)})),n},exports.isCommentNode=function isCommentNode(e){return CommentNode.isCommentNode(e)},exports.isFunctionNode=isFunctionNode,exports.isSimpleBlockNode=isSimpleBlockNode,exports.isTokenNode=function isTokenNode(e){return TokenNode.isTokenNode(e)},exports.isWhitespaceNode=function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)},exports.parseCommaSeparatedListOfComponentValues=function parseCommaSeparatedListOfComponentValues(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];if(0===e.length)return[];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===n.TokenType.EOF)return r.length&&i.push(r),i;if(s[a][0]===n.TokenType.Comma){i.push(r),r=[],a++;continue}const o=consumeComponentValue(t,e.slice(a));r.push(o.node),a+=o.advance}},exports.parseComponentValue=function parseComponentValue(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=consumeComponentValue(t,s);if(s[Math.min(i.advance,s.length-1)][0]===n.TokenType.EOF)return i.node;t.onParseError(new n.ParseError("Expected EOF after parsing a component value.",e[0][2],e[e.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))},exports.parseListOfComponentValues=function parseListOfComponentValues(e,o){const t={onParseError:(null==o?void 0:o.onParseError)??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===n.TokenType.EOF)return i;const e=consumeComponentValue(t,s.slice(r));i.push(e.node),r+=e.advance}},exports.replaceComponentValues=function replaceComponentValues(e,n){for(let o=0;o{if("number"!=typeof o)return;const t=e.node,s=n(t);s&&e.parent.value.splice(o,1,s)}))}}return e},exports.sourceIndices=function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const o=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(o)[1]]}const n=e.tokens(),o=n[0],t=n[n.length-1];return o&&t?[o[2],t[3]]:[0,0]},exports.stringify=function stringify(e){return e.map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")}; +"use strict";var e,n=require("@csstools/css-tokenizer");function walkerIndexGenerator(e){let n=e.slice();return(e,o,t)=>{let s=-1;for(let i=n.indexOf(o);i=e.length)?-1:(n=e.slice(),s)}}function consumeComponentValue(e,o){const t=o[0];if(t[0]===n.TokenType.OpenParen||t[0]===n.TokenType.OpenCurly||t[0]===n.TokenType.OpenSquare){const n=consumeSimpleBlock(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Function){const n=consumeFunction(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Whitespace){const n=consumeWhitespace(e,o);return{advance:n.advance,node:n.node}}if(t[0]===n.TokenType.Comment){const n=consumeComment(e,o);return{advance:n.advance,node:n.node}}return{advance:1,node:new TokenNode(t)}}exports.ComponentValueType=void 0,(e=exports.ComponentValueType||(exports.ComponentValueType={})).Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token";class ContainerNodeBaseClass{value=[];indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}forEach(e,n){if(0===this.value.length)return;const o=walkerIndexGenerator(this.value);let t=0;for(;t!1!==e(n,o)&&((!("walk"in n.node)||!this.value.includes(n.node)||!1!==n.node.walk(e,n.state))&&void 0)),n)}}class FunctionNode extends ContainerNodeBaseClass{type=exports.ComponentValueType.Function;name;endToken;constructor(e,n,o){super(),this.name=e,this.endToken=n,this.value=o}getName(){return this.name[4].value}normalize(){this.endToken[0]===n.TokenType.EOF&&(this.endToken=[n.TokenType.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===n.TokenType.EOF?[this.name,...this.value.flatMap((e=>e.tokens()))]:[this.name,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.name)+e+n.stringify(this.endToken)}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===exports.ComponentValueType.Function)}}function consumeFunction(e,o){const t=[];let s=1;for(;;){const i=o[s];if(!i||i[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a function.",o[0][2],o[o.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:o.length,node:new FunctionNode(o[0],i,t)};if(i[0]===n.TokenType.CloseParen)return{advance:s+1,node:new FunctionNode(o[0],i,t)};if(i[0]===n.TokenType.Comment||i[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(s));s+=n.advance,t.push(...n.nodes);continue}const r=consumeComponentValue(e,o.slice(s));s+=r.advance,t.push(r.node)}}class SimpleBlockNode extends ContainerNodeBaseClass{type=exports.ComponentValueType.SimpleBlock;startToken;endToken;constructor(e,n,o){super(),this.startToken=e,this.endToken=n,this.value=o}normalize(){if(this.endToken[0]===n.TokenType.EOF){const e=n.mirrorVariant(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===n.TokenType.EOF?[this.startToken,...this.value.flatMap((e=>e.tokens()))]:[this.startToken,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n.isToken(e)?n.stringify(e):e.toString())).join("");return n.stringify(this.startToken)+e+n.stringify(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===exports.ComponentValueType.SimpleBlock)}}function consumeSimpleBlock(e,o){const t=n.mirrorVariantType(o[0][0]);if(!t)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const s=[];let i=1;for(;;){const r=o[i];if(!r||r[0]===n.TokenType.EOF)return e.onParseError(new n.ParseError("Unexpected EOF while consuming a simple block.",o[0][2],o[o.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:o.length,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===t)return{advance:i+1,node:new SimpleBlockNode(o[0],r,s)};if(r[0]===n.TokenType.Comment||r[0]===n.TokenType.Whitespace){const n=consumeAllCommentsAndWhitespace(e,o.slice(i));i+=n.advance,s.push(...n.nodes);continue}const a=consumeComponentValue(e,o.slice(i));i+=a.advance,s.push(a.node)}}class WhitespaceNode{type=exports.ComponentValueType.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return n.stringify(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===exports.ComponentValueType.Whitespace)}}function consumeWhitespace(e,o){let t=0;for(;;){if(o[t][0]!==n.TokenType.Whitespace)return{advance:t,node:new WhitespaceNode(o.slice(0,t))};t++}}class CommentNode{type=exports.ComponentValueType.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===exports.ComponentValueType.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(e,o){const t=[];let s=0;for(;;)if(o[s][0]!==n.TokenType.Whitespace){if(o[s][0]!==n.TokenType.Comment)return{advance:s,nodes:t};t.push(new CommentNode(o[s])),s++}else{const e=consumeWhitespace(0,o.slice(s));s+=e.advance,t.push(e.node)}}class TokenNode{type=exports.ComponentValueType.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return n.stringify(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===exports.ComponentValueType.Token)}}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}exports.CommentNode=CommentNode,exports.ContainerNodeBaseClass=ContainerNodeBaseClass,exports.FunctionNode=FunctionNode,exports.SimpleBlockNode=SimpleBlockNode,exports.TokenNode=TokenNode,exports.WhitespaceNode=WhitespaceNode,exports.gatherNodeAncestry=function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((o=>{n.set(o,e.parent)})):n.set(e.node,e.parent)})),n},exports.isCommentNode=function isCommentNode(e){return CommentNode.isCommentNode(e)},exports.isFunctionNode=isFunctionNode,exports.isSimpleBlockNode=isSimpleBlockNode,exports.isTokenNode=function isTokenNode(e){return TokenNode.isTokenNode(e)},exports.isWhitespaceNode=function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)},exports.parseCommaSeparatedListOfComponentValues=function parseCommaSeparatedListOfComponentValues(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];if(0===e.length)return[];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===n.TokenType.EOF)return r.length&&i.push(r),i;if(s[a][0]===n.TokenType.Comma){i.push(r),r=[],a++;continue}const o=consumeComponentValue(t,e.slice(a));r.push(o.node),a+=o.advance}},exports.parseComponentValue=function parseComponentValue(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=consumeComponentValue(t,s);if(s[Math.min(i.advance,s.length-1)][0]===n.TokenType.EOF)return i.node;t.onParseError(new n.ParseError("Expected EOF after parsing a component value.",e[0][2],e[e.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))},exports.parseListOfComponentValues=function parseListOfComponentValues(e,o){const t={onParseError:o?.onParseError??(()=>{})},s=[...e];s[s.length-1][0]!==n.TokenType.EOF&&s.push([n.TokenType.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===n.TokenType.EOF)return i;const e=consumeComponentValue(t,s.slice(r));i.push(e.node),r+=e.advance}},exports.replaceComponentValues=function replaceComponentValues(e,n){for(let o=0;o{if("number"!=typeof o)return;const t=e.node,s=n(t);s&&e.parent.value.splice(o,1,s)}))}}return e},exports.sourceIndices=function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const o=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(o)[1]]}const n=e.tokens(),o=n[0],t=n[n.length-1];return o&&t?[o[2],t[3]]:[0,0]},exports.stringify=function stringify(e){return e.map((e=>e.map((e=>n.stringify(...e.tokens()))).join(""))).join(",")},exports.walkerIndexGenerator=walkerIndexGenerator; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts index 47c3cec9..7df6e14c 100644 --- a/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts +++ b/node_modules/@csstools/css-parser-algorithms/dist/index.d.ts @@ -1,10 +1,249 @@ -export * from './consume/consume-component-block-function'; -export { parseComponentValue } from './parse/parse-component-value'; -export { parseListOfComponentValues } from './parse/parse-list-of-component-values'; -export { parseCommaSeparatedListOfComponentValues } from './parse/parse-comma-separated-list-of-component-values'; -export { gatherNodeAncestry } from './util/node-ancestry'; -export { replaceComponentValues } from './util/replace-component-values'; -export { stringify } from './util/stringify'; -export { ComponentValueType } from './util/component-value-type'; -export { isCommentNode, isFunctionNode, isSimpleBlockNode, isTokenNode, isWhitespaceNode, } from './util/type-predicates'; -export { sourceIndices } from './util/source-indices'; +import { CSSToken } from '@csstools/css-tokenizer'; +import { ParseError } from '@csstools/css-tokenizer'; +import { TokenFunction } from '@csstools/css-tokenizer'; + +export declare class CommentNode { + type: ComponentValueType; + value: CSSToken; + constructor(value: CSSToken); + tokens(): Array; + toString(): string; + toJSON(): { + type: ComponentValueType; + tokens: CSSToken[]; + }; + isCommentNode(): this is CommentNode; + static isCommentNode(x: unknown): x is CommentNode; +} + +export declare type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode; + +export declare enum ComponentValueType { + Function = "function", + SimpleBlock = "simple-block", + Whitespace = "whitespace", + Comment = "comment", + Token = "token" +} + +export declare type ContainerNode = FunctionNode | SimpleBlockNode; + +export declare abstract class ContainerNodeBaseClass { + /** + * The contents of the `Function` or `Simple Block`. + * This is a list of component values. + */ + value: Array; + /** + * Retrieve the index of the given item in the current node. + * For most node types this will be trivially implemented as `this.value.indexOf(item)`. + */ + indexOf(item: ComponentValue): number | string; + /** + * Retrieve the item at the given index in the current node. + * For most node types this will be trivially implemented as `this.value[index]`. + */ + at(index: number | string): ComponentValue | undefined; + /** + * Iterates over each item in the `value` array of the current node. + * + * @param cb - The callback function to execute for each item. + * The function receives an object containing the current node (`node`), its parent (`parent`), + * and an optional `state` object. + * A second parameter is the index of the current node. + * The function can return `false` to stop the iteration. + * + * @param state - An optional state object that can be used to pass additional information to the callback function. + * The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration. + * + * @returns `false` if the iteration was halted, `undefined` otherwise. + * + * @template T - The type of the `state` object. + * @template U - The type of the current node. + */ + forEach, U extends ContainerNode>(this: U, cb: (entry: { + node: ComponentValue; + parent: ContainerNode; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + /** + * Walks the current node and all its children. + * + * @param cb - The callback function to execute for each item. + * The function receives an object containing the current node (`node`), its parent (`parent`), + * and an optional `state` object. + * A second parameter is the index of the current node. + * The function can return `false` to stop the iteration. + * + * @param state - An optional state object that can be used to pass additional information to the callback function. + * The state object is cloned for each iteration. This means that changes to the state object are not reflected in the next iteration. + * However changes are passed down to child node iterations. + * + * @returns `false` if the iteration was halted, `undefined` otherwise. + * + * @template T - The type of the `state` object. + * @template U - The type of the current node. + */ + walk, U extends ContainerNode>(this: U, cb: (entry: { + node: ComponentValue; + parent: ContainerNode; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; +} + +export declare class FunctionNode extends ContainerNodeBaseClass { + /** + * The node type + * Always `ComponentValueType.Function` + */ + type: ComponentValueType; + /** + * The token for the name of the function. + */ + name: TokenFunction; + /** + * The token for the closing parenthesis of the function. + * If the function is unclosed, this will be an EOF token. + */ + endToken: CSSToken; + constructor(name: TokenFunction, endToken: CSSToken, value: Array); + /** + * Retrieve the name of the current Function. + * This is the parsed and unescaped name of the function. + */ + getName(): string; + /** + * Normalize the current Function: + * - if the "endToken" is EOF, replace with a ")-token" + */ + normalize(): void; + /** + * Retrieve the tokens for the current Function. + * This is the inverse of parsing from a list of tokens. + */ + tokens(): Array; + /** + * Convert the current Function to a string. + * This is not a true serialization. + * It is purely a concatenation of the string representation of the tokens. + */ + toString(): string; + /** + * A debug helper to convert the current object to a JSON representation. + * This is useful in asserts and to store large ASTs in files. + */ + toJSON(): unknown; + /** + * Check if the current object is a FunctionNode. + * This is a type guard to help with type narrowing. + */ + isFunctionNode(): this is FunctionNode; + /** + * Check if the given object is a FunctionNode. + * This is a type guard to help with type narrowing. + */ + static isFunctionNode(x: unknown): x is FunctionNode; +} + +export declare function gatherNodeAncestry(node: { + walk(cb: (entry: { + node: Array | unknown; + parent: unknown; + }, index: number | string) => boolean | void): false | undefined; +}): Map; + +export declare function isCommentNode(x: unknown): x is CommentNode; + +export declare function isFunctionNode(x: unknown): x is FunctionNode; + +export declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode; + +export declare function isTokenNode(x: unknown): x is TokenNode; + +export declare function isWhitespaceNode(x: unknown): x is WhitespaceNode; + +export declare function parseCommaSeparatedListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[][]; + +export declare function parseComponentValue(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue | undefined; + +export declare function parseListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[]; + +export declare function replaceComponentValues(componentValuesList: Array>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][]; + +export declare class SimpleBlockNode extends ContainerNodeBaseClass { + type: ComponentValueType; + startToken: CSSToken; + endToken: CSSToken; + constructor(startToken: CSSToken, endToken: CSSToken, value: Array); + /** + * Normalize the current Simple Block: + * - if the "endToken" is EOF, replace with the mirror token of the "startToken" + */ + normalize(): void; + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + toJSON(): unknown; + isSimpleBlockNode(): this is SimpleBlockNode; + static isSimpleBlockNode(x: unknown): x is SimpleBlockNode; +} + +/** + * Returns the start and end index of a node in the CSS source string. + */ +export declare function sourceIndices(x: { + tokens(): Array; +} | Array<{ + tokens(): Array; +}>): [number, number]; + +export declare function stringify(componentValueLists: Array>): string; + +export declare class TokenNode { + type: ComponentValueType; + value: CSSToken; + constructor(value: CSSToken); + tokens(): Array; + toString(): string; + toJSON(): { + type: ComponentValueType; + tokens: CSSToken[]; + }; + isTokenNode(): this is TokenNode; + static isTokenNode(x: unknown): x is TokenNode; +} + +/** + * Generate a function that finds the next element that should be visited when walking an AST. + * Rules : + * - the previous iteration is used as a reference, so any checks are relative to the start of the current iteration. + * - the next element always appears after the current index. + * - the next element always exists in the list. + * - replacing an element does not cause the replaced element to be visited. + * - removing an element does not cause elements to be skipped. + * - an element added later in the list will be visited. + */ +export declare function walkerIndexGenerator(initialList: Array): (list: Array, child: T, index: number) => number; + +export declare class WhitespaceNode { + type: ComponentValueType; + value: Array; + constructor(value: Array); + tokens(): Array; + toString(): string; + toJSON(): { + type: ComponentValueType; + tokens: CSSToken[]; + }; + isWhitespaceNode(): this is WhitespaceNode; + static isWhitespaceNode(x: unknown): x is WhitespaceNode; +} + +export { } diff --git a/node_modules/@csstools/css-parser-algorithms/dist/index.mjs b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs index cc63349e..63b5ace3 100644 --- a/node_modules/@csstools/css-parser-algorithms/dist/index.mjs +++ b/node_modules/@csstools/css-parser-algorithms/dist/index.mjs @@ -1 +1 @@ -import{TokenType as e,isToken as n,stringify as t,ParseError as o,mirrorVariant as s,mirrorVariantType as i}from"@csstools/css-tokenizer";var r;function consumeComponentValue(n,t){const o=t[0];if(o[0]===e.OpenParen||o[0]===e.OpenCurly||o[0]===e.OpenSquare){const e=consumeSimpleBlock(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Function){const e=consumeFunction(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Whitespace){const e=consumeWhitespace(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Comment){const e=consumeComment(n,t);return{advance:e.advance,node:e.node}}return{advance:1,node:new TokenNode(o)}}!function(e){e.Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token"}(r||(r={}));class FunctionNode{type=r.Function;name;endToken;value;constructor(e,n,t){this.name=e,this.endToken=n,this.value=t}getName(){return this.name[4].value}normalize(){this.endToken[0]===e.EOF&&(this.endToken=[e.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===e.EOF?[this.name,...this.value.flatMap((e=>e.tokens()))]:[this.name,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n(e)?t(e):e.toString())).join("");return t(this.name)+e+t(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let t=!1;if(this.value.forEach(((o,s)=>{if(t)return;let i;n&&(i={...n}),!1!==e({node:o,parent:this,state:i},s)?"walk"in o&&!1===o.walk(e,i)&&(t=!0):t=!0})),t)return!1}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===r.Function)}}function consumeFunction(n,t){const s=[];let i=1;for(;;){const r=t[i];if(!r||r[0]===e.EOF)return n.onParseError(new o("Unexpected EOF while consuming a function.",t[0][2],t[t.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:t.length,node:new FunctionNode(t[0],r,s)};if(r[0]===e.CloseParen)return{advance:i+1,node:new FunctionNode(t[0],r,s)};if(r[0]===e.Comment||r[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(i));i+=e.advance,s.push(...e.nodes);continue}const a=consumeComponentValue(n,t.slice(i));i+=a.advance,s.push(a.node)}}class SimpleBlockNode{type=r.SimpleBlock;startToken;endToken;value;constructor(e,n,t){this.startToken=e,this.endToken=n,this.value=t}normalize(){if(this.endToken[0]===e.EOF){const e=s(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===e.EOF?[this.startToken,...this.value.flatMap((e=>e.tokens()))]:[this.startToken,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n(e)?t(e):e.toString())).join("");return t(this.startToken)+e+t(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}walk(e,n){let t=!1;if(this.value.forEach(((o,s)=>{if(t)return;let i;n&&(i={...n}),!1!==e({node:o,parent:this,state:i},s)?"walk"in o&&!1===o.walk(e,i)&&(t=!0):t=!0})),t)return!1}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===r.SimpleBlock)}}function consumeSimpleBlock(n,t){const s=i(t[0][0]);if(!s)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const r=[];let a=1;for(;;){const i=t[a];if(!i||i[0]===e.EOF)return n.onParseError(new o("Unexpected EOF while consuming a simple block.",t[0][2],t[t.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:t.length,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===s)return{advance:a+1,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===e.Comment||i[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(a));a+=e.advance,r.push(...e.nodes);continue}const c=consumeComponentValue(n,t.slice(a));a+=c.advance,r.push(c.node)}}class WhitespaceNode{type=r.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return t(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===r.Whitespace)}}function consumeWhitespace(n,t){let o=0;for(;;){if(t[o][0]!==e.Whitespace)return{advance:o,node:new WhitespaceNode(t.slice(0,o))};o++}}class CommentNode{type=r.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===r.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(n,t){const o=[];let s=0;for(;;)if(t[s][0]!==e.Whitespace){if(t[s][0]!==e.Comment)return{advance:s,nodes:o};o.push(new CommentNode(t[s])),s++}else{const e=consumeWhitespace(0,t.slice(s));s+=e.advance,o.push(e.node)}}class TokenNode{type=r.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===r.Token)}}function parseComponentValue(n,t){const s={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},i=[...n];i[i.length-1][0]!==e.EOF&&i.push([e.EOF,"",i[i.length-1][2],i[i.length-1][3],void 0]);const r=consumeComponentValue(s,i);if(i[Math.min(r.advance,i.length-1)][0]===e.EOF)return r.node;s.onParseError(new o("Expected EOF after parsing a component value.",n[0][2],n[n.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))}function parseListOfComponentValues(n,t){const o={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},s=[...n];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===e.EOF)return i;const n=consumeComponentValue(o,s.slice(r));i.push(n.node),r+=n.advance}}function parseCommaSeparatedListOfComponentValues(n,t){const o={onParseError:(null==t?void 0:t.onParseError)??(()=>{})},s=[...n];if(0===n.length)return[];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===e.EOF)return r.length&&i.push(r),i;if(s[a][0]===e.Comma){i.push(r),r=[],a++;continue}const t=consumeComponentValue(o,n.slice(a));r.push(t.node),a+=t.advance}}function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((t=>{n.set(t,e.parent)})):n.set(e.node,e.parent)})),n}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)}function isCommentNode(e){return CommentNode.isCommentNode(e)}function isTokenNode(e){return TokenNode.isTokenNode(e)}function replaceComponentValues(e,n){for(let t=0;t{if("number"!=typeof t)return;const o=e.node,s=n(o);s&&e.parent.value.splice(t,1,s)}))}}return e}function stringify(e){return e.map((e=>e.map((e=>t(...e.tokens()))).join(""))).join(",")}function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const t=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(t)[1]]}const n=e.tokens(),t=n[0],o=n[n.length-1];return t&&o?[t[2],o[3]]:[0,0]}export{CommentNode,r as ComponentValueType,FunctionNode,SimpleBlockNode,TokenNode,WhitespaceNode,consumeAllCommentsAndWhitespace,consumeComment,consumeComponentValue,consumeFunction,consumeSimpleBlock,consumeWhitespace,gatherNodeAncestry,isCommentNode,isFunctionNode,isSimpleBlockNode,isTokenNode,isWhitespaceNode,parseCommaSeparatedListOfComponentValues,parseComponentValue,parseListOfComponentValues,replaceComponentValues,sourceIndices,stringify}; +import{TokenType as e,isToken as n,stringify as t,mirrorVariant as o,ParseError as s,mirrorVariantType as i}from"@csstools/css-tokenizer";var r;function walkerIndexGenerator(e){let n=e.slice();return(e,t,o)=>{let s=-1;for(let i=n.indexOf(t);i=e.length)?-1:(n=e.slice(),s)}}function consumeComponentValue(n,t){const o=t[0];if(o[0]===e.OpenParen||o[0]===e.OpenCurly||o[0]===e.OpenSquare){const e=consumeSimpleBlock(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Function){const e=consumeFunction(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Whitespace){const e=consumeWhitespace(n,t);return{advance:e.advance,node:e.node}}if(o[0]===e.Comment){const e=consumeComment(n,t);return{advance:e.advance,node:e.node}}return{advance:1,node:new TokenNode(o)}}!function(e){e.Function="function",e.SimpleBlock="simple-block",e.Whitespace="whitespace",e.Comment="comment",e.Token="token"}(r||(r={}));class ContainerNodeBaseClass{value=[];indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}forEach(e,n){if(0===this.value.length)return;const t=walkerIndexGenerator(this.value);let o=0;for(;o!1!==e(n,t)&&((!("walk"in n.node)||!this.value.includes(n.node)||!1!==n.node.walk(e,n.state))&&void 0)),n)}}class FunctionNode extends ContainerNodeBaseClass{type=r.Function;name;endToken;constructor(e,n,t){super(),this.name=e,this.endToken=n,this.value=t}getName(){return this.name[4].value}normalize(){this.endToken[0]===e.EOF&&(this.endToken=[e.CloseParen,")",-1,-1,void 0])}tokens(){return this.endToken[0]===e.EOF?[this.name,...this.value.flatMap((e=>e.tokens()))]:[this.name,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n(e)?t(e):e.toString())).join("");return t(this.name)+e+t(this.endToken)}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isFunctionNode(){return FunctionNode.isFunctionNode(this)}static isFunctionNode(e){return!!e&&(e instanceof FunctionNode&&e.type===r.Function)}}function consumeFunction(n,t){const o=[];let i=1;for(;;){const r=t[i];if(!r||r[0]===e.EOF)return n.onParseError(new s("Unexpected EOF while consuming a function.",t[0][2],t[t.length-1][3],["5.4.9. Consume a function","Unexpected EOF"])),{advance:t.length,node:new FunctionNode(t[0],r,o)};if(r[0]===e.CloseParen)return{advance:i+1,node:new FunctionNode(t[0],r,o)};if(r[0]===e.Comment||r[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(i));i+=e.advance,o.push(...e.nodes);continue}const a=consumeComponentValue(n,t.slice(i));i+=a.advance,o.push(a.node)}}class SimpleBlockNode extends ContainerNodeBaseClass{type=r.SimpleBlock;startToken;endToken;constructor(e,n,t){super(),this.startToken=e,this.endToken=n,this.value=t}normalize(){if(this.endToken[0]===e.EOF){const e=o(this.startToken);e&&(this.endToken=e)}}tokens(){return this.endToken[0]===e.EOF?[this.startToken,...this.value.flatMap((e=>e.tokens()))]:[this.startToken,...this.value.flatMap((e=>e.tokens())),this.endToken]}toString(){const e=this.value.map((e=>n(e)?t(e):e.toString())).join("");return t(this.startToken)+e+t(this.endToken)}indexOf(e){return this.value.indexOf(e)}at(e){if("number"==typeof e)return e<0&&(e=this.value.length+e),this.value[e]}toJSON(){return{type:this.type,startToken:this.startToken,tokens:this.tokens(),value:this.value.map((e=>e.toJSON()))}}isSimpleBlockNode(){return SimpleBlockNode.isSimpleBlockNode(this)}static isSimpleBlockNode(e){return!!e&&(e instanceof SimpleBlockNode&&e.type===r.SimpleBlock)}}function consumeSimpleBlock(n,t){const o=i(t[0][0]);if(!o)throw new Error("Failed to parse, a mirror variant must exist for all block open tokens.");const r=[];let a=1;for(;;){const i=t[a];if(!i||i[0]===e.EOF)return n.onParseError(new s("Unexpected EOF while consuming a simple block.",t[0][2],t[t.length-1][3],["5.4.8. Consume a simple block","Unexpected EOF"])),{advance:t.length,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===o)return{advance:a+1,node:new SimpleBlockNode(t[0],i,r)};if(i[0]===e.Comment||i[0]===e.Whitespace){const e=consumeAllCommentsAndWhitespace(n,t.slice(a));a+=e.advance,r.push(...e.nodes);continue}const c=consumeComponentValue(n,t.slice(a));a+=c.advance,r.push(c.node)}}class WhitespaceNode{type=r.Whitespace;value;constructor(e){this.value=e}tokens(){return this.value}toString(){return t(...this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isWhitespaceNode(){return WhitespaceNode.isWhitespaceNode(this)}static isWhitespaceNode(e){return!!e&&(e instanceof WhitespaceNode&&e.type===r.Whitespace)}}function consumeWhitespace(n,t){let o=0;for(;;){if(t[o][0]!==e.Whitespace)return{advance:o,node:new WhitespaceNode(t.slice(0,o))};o++}}class CommentNode{type=r.Comment;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isCommentNode(){return CommentNode.isCommentNode(this)}static isCommentNode(e){return!!e&&(e instanceof CommentNode&&e.type===r.Comment)}}function consumeComment(e,n){return{advance:1,node:new CommentNode(n[0])}}function consumeAllCommentsAndWhitespace(n,t){const o=[];let s=0;for(;;)if(t[s][0]!==e.Whitespace){if(t[s][0]!==e.Comment)return{advance:s,nodes:o};o.push(new CommentNode(t[s])),s++}else{const e=consumeWhitespace(0,t.slice(s));s+=e.advance,o.push(e.node)}}class TokenNode{type=r.Token;value;constructor(e){this.value=e}tokens(){return[this.value]}toString(){return t(this.value)}toJSON(){return{type:this.type,tokens:this.tokens()}}isTokenNode(){return TokenNode.isTokenNode(this)}static isTokenNode(e){return!!e&&(e instanceof TokenNode&&e.type===r.Token)}}function parseComponentValue(n,t){const o={onParseError:t?.onParseError??(()=>{})},i=[...n];i[i.length-1][0]!==e.EOF&&i.push([e.EOF,"",i[i.length-1][2],i[i.length-1][3],void 0]);const r=consumeComponentValue(o,i);if(i[Math.min(r.advance,i.length-1)][0]===e.EOF)return r.node;o.onParseError(new s("Expected EOF after parsing a component value.",n[0][2],n[n.length-1][3],["5.3.9. Parse a component value","Expected EOF"]))}function parseListOfComponentValues(n,t){const o={onParseError:t?.onParseError??(()=>{})},s=[...n];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=0;for(;;){if(!s[r]||s[r][0]===e.EOF)return i;const n=consumeComponentValue(o,s.slice(r));i.push(n.node),r+=n.advance}}function parseCommaSeparatedListOfComponentValues(n,t){const o={onParseError:t?.onParseError??(()=>{})},s=[...n];if(0===n.length)return[];s[s.length-1][0]!==e.EOF&&s.push([e.EOF,"",s[s.length-1][2],s[s.length-1][3],void 0]);const i=[];let r=[],a=0;for(;;){if(!s[a]||s[a][0]===e.EOF)return r.length&&i.push(r),i;if(s[a][0]===e.Comma){i.push(r),r=[],a++;continue}const t=consumeComponentValue(o,n.slice(a));r.push(t.node),a+=t.advance}}function gatherNodeAncestry(e){const n=new Map;return e.walk((e=>{Array.isArray(e.node)?e.node.forEach((t=>{n.set(t,e.parent)})):n.set(e.node,e.parent)})),n}function isSimpleBlockNode(e){return SimpleBlockNode.isSimpleBlockNode(e)}function isFunctionNode(e){return FunctionNode.isFunctionNode(e)}function isWhitespaceNode(e){return WhitespaceNode.isWhitespaceNode(e)}function isCommentNode(e){return CommentNode.isCommentNode(e)}function isTokenNode(e){return TokenNode.isTokenNode(e)}function replaceComponentValues(e,n){for(let t=0;t{if("number"!=typeof t)return;const o=e.node,s=n(o);s&&e.parent.value.splice(t,1,s)}))}}return e}function stringify(e){return e.map((e=>e.map((e=>t(...e.tokens()))).join(""))).join(",")}function sourceIndices(e){if(Array.isArray(e)){const n=e[0];if(!n)return[0,0];const t=e[e.length-1]||n;return[sourceIndices(n)[0],sourceIndices(t)[1]]}const n=e.tokens(),t=n[0],o=n[n.length-1];return t&&o?[t[2],o[3]]:[0,0]}export{CommentNode,r as ComponentValueType,ContainerNodeBaseClass,FunctionNode,SimpleBlockNode,TokenNode,WhitespaceNode,gatherNodeAncestry,isCommentNode,isFunctionNode,isSimpleBlockNode,isTokenNode,isWhitespaceNode,parseCommaSeparatedListOfComponentValues,parseComponentValue,parseListOfComponentValues,replaceComponentValues,sourceIndices,stringify,walkerIndexGenerator}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts deleted file mode 100644 index dc246e00..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/interfaces/context.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ParseError } from '@csstools/css-tokenizer'; -export type Context = { - onParseError: (error: ParseError) => void; -}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts deleted file mode 100644 index 67dff1d0..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { ComponentValue } from '../consume/consume-component-block-function'; -export declare function parseCommaSeparatedListOfComponentValues(tokens: Array, options?: { - onParseError?: (error: ParseError) => void; -}): ComponentValue[][]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts deleted file mode 100644 index 2961290f..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-component-value.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -export declare function parseComponentValue(tokens: Array, options?: { - onParseError?: (error: ParseError) => void; -}): import("../consume/consume-component-block-function").ComponentValue | undefined; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts deleted file mode 100644 index 737f554d..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { ComponentValue } from '../consume/consume-component-block-function'; -export declare function parseListOfComponentValues(tokens: Array, options?: { - onParseError?: (error: ParseError) => void; -}): ComponentValue[]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts deleted file mode 100644 index eda7ee93..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/component-value-type.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare enum ComponentValueType { - Function = "function", - SimpleBlock = "simple-block", - Whitespace = "whitespace", - Comment = "comment", - Token = "token" -} diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts deleted file mode 100644 index 219ea619..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/node-ancestry.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export interface walkable { - walk(cb: (entry: { - node: Array | unknown; - parent: unknown; - }, index: number | string) => boolean | void): false | undefined; -} -export declare function gatherNodeAncestry(node: walkable): Map; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts deleted file mode 100644 index 774051c6..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/replace-component-values.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ComponentValue } from '../consume/consume-component-block-function'; -export declare function replaceComponentValues(componentValuesList: Array>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][]; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts deleted file mode 100644 index 92d124be..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/source-indices.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -interface TokenConvertible { - tokens(): Array; -} -/** - * Returns the start and end index of a node in the CSS source string. - */ -export declare function sourceIndices(x: TokenConvertible | Array): [number, number]; -export {}; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts deleted file mode 100644 index 6ab4140c..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/stringify.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ComponentValue } from '../consume/consume-component-block-function'; -export declare function stringify(componentValueLists: Array>): string; diff --git a/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts b/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts deleted file mode 100644 index 896d3036..00000000 --- a/node_modules/@csstools/css-parser-algorithms/dist/util/type-predicates.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { CommentNode, FunctionNode, SimpleBlockNode, TokenNode, WhitespaceNode } from '../consume/consume-component-block-function'; -export declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode; -export declare function isFunctionNode(x: unknown): x is FunctionNode; -export declare function isWhitespaceNode(x: unknown): x is WhitespaceNode; -export declare function isCommentNode(x: unknown): x is CommentNode; -export declare function isTokenNode(x: unknown): x is TokenNode; diff --git a/node_modules/@csstools/css-parser-algorithms/package.json b/node_modules/@csstools/css-parser-algorithms/package.json index 009c0560..560095a7 100644 --- a/node_modules/@csstools/css-parser-algorithms/package.json +++ b/node_modules/@csstools/css-parser-algorithms/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/css-parser-algorithms", "description": "Algorithms to help you parse CSS from an array of tokens.", - "version": "2.3.2", + "version": "2.4.0", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,15 +48,7 @@ "dist" ], "peerDependencies": { - "@csstools/css-tokenizer": "^2.2.1" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node ./test/test.mjs" + "@csstools/css-tokenizer": "^2.2.2" }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms#readme", "repository": { @@ -65,8 +60,5 @@ "keywords": [ "css", "parser" - ], - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/css-tokenizer/CHANGELOG.md b/node_modules/@csstools/css-tokenizer/CHANGELOG.md index ee539e2a..00476bb4 100644 --- a/node_modules/@csstools/css-tokenizer/CHANGELOG.md +++ b/node_modules/@csstools/css-tokenizer/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to CSS Tokenizer +### 2.2.2 + +_December 15, 2023_ + +- Fix type definitions + ### 2.2.1 _September 24, 2023_ @@ -14,41 +20,4 @@ _July 24, 2023_ - Add `signCharacter` to `DimensionToken`, `NumberToken` and `PercentageToken` - Correctly tokenize negative zero `-0` -### 2.1.1 - -_April 10, 2023_ - -- Document `tokenize` helper function - -### 2.1.0 - -_February 21, 2023_ - -- Add `tokenize` helper function - -### 2.0.2 - -_February 13, 2023_ - -- Relax `isToken` to match artificial tokens that correctly follow the interface. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 19, 2023_ - -- Simplify `Reader` interface (breaking) -- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) -- Remove the `commentsAreTokens` option as `true` was the only desirable value (breaking) -- Improve performance - -### 1.0.0 - -_November 14, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md) diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts deleted file mode 100644 index a9243f63..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -export declare function checkIfFourCodePointsWouldStartCDO(reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts deleted file mode 100644 index 6af31e4e..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/matches-url-ident.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function checkIfCodePointsMatchURLIdent(codePoints: Array): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts deleted file mode 100644 index 09bd2323..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -export declare function checkIfThreeCodePointsWouldStartCDC(reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts deleted file mode 100644 index d48323bb..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function checkIfThreeCodePointsWouldStartAnIdentSequence(ctx: Context, reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts deleted file mode 100644 index 9c428a45..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -export declare function checkIfThreeCodePointsWouldStartANumber(reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-unicode-range.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-unicode-range.d.ts deleted file mode 100644 index 46c91076..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/three-code-points-would-start-unicode-range.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -export declare function checkIfThreeCodePointsWouldStartAUnicodeRange(reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts deleted file mode 100644 index 99d954fd..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -export declare function checkIfTwoCodePointsAreAValidEscape(reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts b/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts deleted file mode 100644 index 9d9fd495..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -export declare function checkIfTwoCodePointsStartAComment(reader: CodePointReader): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts b/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts deleted file mode 100644 index 3dcc4778..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/code-points/code-points.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** ' */ -export declare const APOSTROPHE = 39; -/** * */ -export declare const ASTERISK = 42; -/** \b */ -export declare const BACKSPACE = 8; -/** \r */ -export declare const CARRIAGE_RETURN = 13; -/** \t */ -export declare const CHARACTER_TABULATION = 9; -/** : */ -export declare const COLON = 58; -/** , */ -export declare const COMMA = 44; -/** @ */ -export declare const COMMERCIAL_AT = 64; -/** \x7F */ -export declare const DELETE = 127; -/** ! */ -export declare const EXCLAMATION_MARK = 33; -/** \f */ -export declare const FORM_FEED = 12; -/** . */ -export declare const FULL_STOP = 46; -/** > */ -export declare const GREATER_THAN_SIGN = 62; -/** - */ -export declare const HYPHEN_MINUS = 45; -/** \x1F */ -export declare const INFORMATION_SEPARATOR_ONE = 31; -/** E */ -export declare const LATIN_CAPITAL_LETTER_E = 69; -/** e */ -export declare const LATIN_SMALL_LETTER_E = 101; -/** { */ -export declare const LEFT_CURLY_BRACKET = 123; -/** ( */ -export declare const LEFT_PARENTHESIS = 40; -/** [ */ -export declare const LEFT_SQUARE_BRACKET = 91; -/** < */ -export declare const LESS_THAN_SIGN = 60; -/** \n */ -export declare const LINE_FEED = 10; -/** \v */ -export declare const LINE_TABULATION = 11; -/** _ */ -export declare const LOW_LINE = 95; -/** \x10FFFF */ -export declare const MAXIMUM_ALLOWED_CODEPOINT = 1114111; -/** \x00 */ -export declare const NULL = 0; -/** # */ -export declare const NUMBER_SIGN = 35; -/** % */ -export declare const PERCENTAGE_SIGN = 37; -/** + */ -export declare const PLUS_SIGN = 43; -/** " */ -export declare const QUOTATION_MARK = 34; -/** � */ -export declare const REPLACEMENT_CHARACTER = 65533; -/** \ */ -export declare const REVERSE_SOLIDUS = 92; -/** } */ -export declare const RIGHT_CURLY_BRACKET = 125; -/** ) */ -export declare const RIGHT_PARENTHESIS = 41; -/** ] */ -export declare const RIGHT_SQUARE_BRACKET = 93; -/** ; */ -export declare const SEMICOLON = 59; -/** \u0E */ -export declare const SHIFT_OUT = 14; -/** / */ -export declare const SOLIDUS = 47; -/** \u20 */ -export declare const SPACE = 32; -/** u */ -export declare const LATIN_SMALL_LETTER_U = 117; -/** U */ -export declare const LATIN_CAPITAL_LETTER_U = 85; -/** r */ -export declare const LATIN_SMALL_LETTER_R = 114; -/** R */ -export declare const LATIN_CAPITAL_LETTER_R = 82; -/** l */ -export declare const LATIN_SMALL_LETTER_L = 108; -/** L */ -export declare const LATIN_CAPITAL_LETTER_L = 76; -/** ? */ -export declare const QUESTION_MARK = 63; -/** 0 */ -export declare const DIGIT_ZERO = 48; -/** F */ -export declare const LATIN_CAPITAL_LETTER_F = 70; diff --git a/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts b/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts deleted file mode 100644 index 2fe67d8c..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/code-points/ranges.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export declare function isDigitCodePoint(search: number): boolean; -export declare function isUppercaseLetterCodePoint(search: number): boolean; -export declare function isLowercaseLetterCodePoint(search: number): boolean; -export declare function isHexDigitCodePoint(search: number): boolean; -export declare function isLetterCodePoint(search: number): boolean; -export declare function isNonASCIICodePoint(search: number): boolean; -export declare function isIdentStartCodePoint(search: number): boolean; -export declare function isIdentCodePoint(search: number): boolean; -export declare function isNonASCII_IdentCodePoint(search: number): boolean; -export declare function isNonPrintableCodePoint(search: number): boolean; -export declare function isNewLine(search: number): boolean; -export declare function isWhitespace(search: number): boolean; -export declare function isSurrogate(search: number): boolean; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts deleted file mode 100644 index 4b18d0e8..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/bad-url.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function consumeBadURL(ctx: Context, reader: CodePointReader): void; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts deleted file mode 100644 index d4ba2211..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/comment.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenComment } from '../interfaces/token'; -export declare function consumeComment(ctx: Context, reader: CodePointReader): TokenComment; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts deleted file mode 100644 index a6f8dc2e..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/escaped-code-point.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function consumeEscapedCodePoint(ctx: Context, reader: CodePointReader): number; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts deleted file mode 100644 index ac061a84..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/hash-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenDelim, TokenHash } from '../interfaces/token'; -export declare function consumeHashToken(ctx: Context, reader: CodePointReader): TokenDelim | TokenHash; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts deleted file mode 100644 index 6be73762..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/ident-like-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenBadURL, TokenFunction, TokenIdent, TokenURL } from '../interfaces/token'; -export declare function consumeIdentLikeToken(ctx: Context, reader: CodePointReader): TokenIdent | TokenFunction | TokenURL | TokenBadURL; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts deleted file mode 100644 index 992520e2..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/ident-sequence.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -export declare function consumeIdentSequence(ctx: Context, reader: CodePointReader): Array; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts deleted file mode 100644 index 18f1704f..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/number.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { NumberType } from '../interfaces/token'; -export declare function consumeNumber(ctx: Context, reader: CodePointReader): NumberType; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts deleted file mode 100644 index 1217bb0a..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/numeric-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenDimension, TokenNumber, TokenPercentage } from '../interfaces/token'; -export declare function consumeNumericToken(ctx: Context, reader: CodePointReader): TokenPercentage | TokenNumber | TokenDimension; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts deleted file mode 100644 index 31f6448f..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/string-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenBadString, TokenString } from '../interfaces/token'; -export declare function consumeStringToken(ctx: Context, reader: CodePointReader): TokenBadString | TokenString; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/unicode-range-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/unicode-range-token.d.ts deleted file mode 100644 index 526bcfe1..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/unicode-range-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenUnicodeRange } from '../interfaces/token'; -export declare function consumeUnicodeRangeToken(ctx: Context, reader: CodePointReader): TokenUnicodeRange; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts deleted file mode 100644 index 9140be70..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/url-token.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { Context } from '../interfaces/context'; -import { TokenBadURL, TokenURL } from '../interfaces/token'; -export declare function consumeUrlToken(ctx: Context, reader: CodePointReader): TokenURL | TokenBadURL; diff --git a/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts b/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts deleted file mode 100644 index 4584dc9a..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/consume/whitespace-token.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { CodePointReader } from '../interfaces/code-point-reader'; -import { TokenWhitespace } from '../interfaces/token'; -export declare function consumeWhiteSpace(reader: CodePointReader): TokenWhitespace; diff --git a/node_modules/@csstools/css-tokenizer/dist/index.cjs b/node_modules/@csstools/css-tokenizer/dist/index.cjs index 915afc28..499ca5f8 100644 --- a/node_modules/@csstools/css-tokenizer/dist/index.cjs +++ b/node_modules/@csstools/css-tokenizer/dist/index.cjs @@ -1 +1 @@ -"use strict";class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,o,n,r){super(e),this.name="ParseError",this.sourceStart=o,this.sourceEnd=n,this.parserState=r}}class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let o=-1,n="";for(n of e)o+=n.length,this.codePointSource.push(n.codePointAt(0)),this.representationIndices.push(o)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const o=this.codePointSource[this.cursor];return void 0!==o&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],o)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}var e,o,n;exports.TokenType=void 0,(e=exports.TokenType||(exports.TokenType={})).Comment="comment",e.AtKeyword="at-keyword-token",e.BadString="bad-string-token",e.BadURL="bad-url-token",e.CDC="CDC-token",e.CDO="CDO-token",e.Colon="colon-token",e.Comma="comma-token",e.Delim="delim-token",e.Dimension="dimension-token",e.EOF="EOF-token",e.Function="function-token",e.Hash="hash-token",e.Ident="ident-token",e.Number="number-token",e.Percentage="percentage-token",e.Semicolon="semicolon-token",e.String="string-token",e.URL="url-token",e.Whitespace="whitespace-token",e.OpenParen="(-token",e.CloseParen=")-token",e.OpenSquare="[-token",e.CloseSquare="]-token",e.OpenCurly="{-token",e.CloseCurly="}-token",e.UnicodeRange="unicode-range-token",exports.NumberType=void 0,(o=exports.NumberType||(exports.NumberType={})).Integer="integer",o.Number="number",function(e){e.Unrestricted="unrestricted",e.ID="id"}(n||(n={}));const r=Object.values(exports.TokenType);const t=39,i=42,s=8,c=13,a=9,u=58,d=44,p=64,P=127,S=33,C=12,T=46,l=62,k=45,f=31,m=69,h=101,E=123,v=40,x=91,y=60,g=10,I=11,O=95,U=1114111,w=0,D=35,R=37,A=43,L=34,N=65533,b=92,q=125,W=41,F=93,H=59,V=14,B=47,z=32,K=117,M=85,$=114,J=82,_=108,j=76,Q=63,G=48,X=70;function checkIfFourCodePointsWouldStartCDO(e){return e.codePointSource[e.cursor]===y&&e.codePointSource[e.cursor+1]===S&&e.codePointSource[e.cursor+2]===k&&e.codePointSource[e.cursor+3]===k}function isDigitCodePoint(e){return e>=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===O}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===k}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===b&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,o){return o.codePointSource[o.cursor]===k?o.codePointSource[o.cursor+1]===k||(!!isIdentStartCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===b&&!isNewLine(o.codePointSource[o.cursor+2])):!!isIdentStartCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===A||e.codePointSource[e.cursor]===k?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===T&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===T?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===B&&e.codePointSource[e.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===k&&e.codePointSource[e.cursor+1]===k&&e.codePointSource[e.cursor+2]===l}function consumeComment(e,o){for(o.advanceCodePoint(2);;){const n=o.readCodePoint();if(!1===n){e.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(n===i&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===B)){o.advanceCodePoint();break}}return[exports.TokenType.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,o){const n=o.readCodePoint();if(!1===n)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),N;if(isHexDigitCodePoint(n)){const e=[n];for(;void 0!==o.codePointSource[o.cursor]&&isHexDigitCodePoint(o.codePointSource[o.cursor])&&e.length<6;)e.push(o.codePointSource[o.cursor]),o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor])&&o.advanceCodePoint();const t=parseInt(String.fromCodePoint(...e),16);return 0===t?N:(r=t)>=55296&&r<=57343||t>U?N:t}var r;return n}function consumeIdentSequence(e,o){const n=[];for(;;)if(isIdentCodePoint(o.codePointSource[o.cursor]))n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(o))return n;o.advanceCodePoint(),n.push(consumeEscapedCodePoint(e,o))}}function consumeHashToken(e,o){if(o.advanceCodePoint(),void 0!==o.codePointSource[o.cursor]&&(isIdentCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o))){let r=n.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)&&(r=n.ID);const t=consumeIdentSequence(e,o);return[exports.TokenType.Hash,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...t),type:r}]}return[exports.TokenType.Delim,"#",o.representationStart,o.representationEnd,{value:"#"}]}function consumeNumber(e,o){let n=exports.NumberType.Integer;for(o.codePointSource[o.cursor]!==A&&o.codePointSource[o.cursor]!==k||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===T&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===h||o.codePointSource[o.cursor]===m){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==k&&o.codePointSource[o.cursor+1]!==A||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return n;o.advanceCodePoint(3)}for(n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return n}function consumeNumericToken(e,o){let n;{const e=o.codePointSource[o.cursor];e===k?n="-":e===A&&(n="+")}const r=consumeNumber(0,o),t=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1))||0;if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const i=consumeIdentSequence(e,o);return[exports.TokenType.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r,unit:String.fromCodePoint(...i)}]}return o.codePointSource[o.cursor]===R?(o.advanceCodePoint(),[exports.TokenType.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n}]):[exports.TokenType.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[exports.TokenType.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(e,o){let n="";const r=o.readCodePoint();for(;;){const t=o.readCodePoint();if(!1===t)return e.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(isNewLine(t))return e.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[exports.TokenType.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(t===r)return[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(t!==b)n+=String.fromCodePoint(t);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}n+=String.fromCodePoint(consumeEscapedCodePoint(e,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==K&&e[0]!==M||e[1]!==$&&e[1]!==J||e[2]!==_&&e[2]!==j)}function consumeBadURL(e,o){for(;;){if(void 0===o.codePointSource[o.cursor])return;if(o.codePointSource[o.cursor]===W)return void o.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(o)?(o.advanceCodePoint(),consumeEscapedCodePoint(e,o)):o.advanceCodePoint()}}function consumeUrlToken(e,o){for(;isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();let n="";for(;;){if(void 0===o.codePointSource[o.cursor])return e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(o.codePointSource[o.cursor]===W)return o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(isWhitespace(o.codePointSource[o.cursor])){for(o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();return void 0===o.codePointSource[o.cursor]?(e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}]):o.codePointSource[o.cursor]===W?(o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}]):(consumeBadURL(e,o),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0])}if(o.codePointSource[o.cursor]===L||o.codePointSource[o.cursor]===t||o.codePointSource[o.cursor]===v||((r=o.codePointSource[o.cursor])===I||r===P||w<=r&&r<=s||V<=r&&r<=f))return consumeBadURL(e,o),e.onParseError(new ParseError("Unexpected character while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(o.codePointSource[o.cursor]===b){if(checkIfTwoCodePointsAreAValidEscape(o)){o.advanceCodePoint(),n+=String.fromCodePoint(consumeEscapedCodePoint(e,o));continue}return consumeBadURL(e,o),e.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}n+=String.fromCodePoint(o.codePointSource[o.cursor]),o.advanceCodePoint()}var r}function consumeIdentLikeToken(e,o){const n=consumeIdentSequence(e,o);if(o.codePointSource[o.cursor]!==v)return[exports.TokenType.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}];if(checkIfCodePointsMatchURLIdent(n)){o.advanceCodePoint();let r=0;for(;;){const e=isWhitespace(o.codePointSource[o.cursor]),i=isWhitespace(o.codePointSource[o.cursor+1]);if(e&&i){r+=1,o.advanceCodePoint(1);continue}const s=e?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===L||s===t)return r>0&&o.unreadCodePoint(r),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}];break}return consumeUrlToken(e,o)}return o.advanceCodePoint(),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==K&&e.codePointSource[e.cursor]!==M||e.codePointSource[e.cursor+1]!==A||e.codePointSource[e.cursor+2]!==Q&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,o){o.advanceCodePoint(2);const n=[],r=[];for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&o.codePointSource[o.cursor]===Q;)0===r.length&&r.push(...n),n.push(G),r.push(X),o.advanceCodePoint();if(!r.length&&o.codePointSource[o.cursor]===k&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!r.length){const e=parseInt(String.fromCodePoint(...n),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:e,endOfRange:e}]}const t=parseInt(String.fromCodePoint(...n),16),i=parseInt(String.fromCodePoint(...r),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:t,endOfRange:i}]}function tokenizer(e,o){const n=e.css.valueOf(),r=e.unicodeRangesAllowed??!1,i=new Reader(n),s={onParseError:(null==o?void 0:o.onParseError)??(()=>{})};return{nextToken:function nextToken(){i.resetRepresentation();const e=i.codePointSource[i.cursor];if(void 0===e)return[exports.TokenType.EOF,"",-1,-1,void 0];if(e===B&&checkIfTwoCodePointsStartAComment(i))return consumeComment(s,i);if(r&&(e===K||e===M)&&checkIfThreeCodePointsWouldStartAUnicodeRange(i))return consumeUnicodeRangeToken(0,i);if(isIdentStartCodePoint(e))return consumeIdentLikeToken(s,i);if(isDigitCodePoint(e))return consumeNumericToken(s,i);switch(e){case d:return i.advanceCodePoint(),[exports.TokenType.Comma,",",i.representationStart,i.representationEnd,void 0];case u:return i.advanceCodePoint(),[exports.TokenType.Colon,":",i.representationStart,i.representationEnd,void 0];case H:return i.advanceCodePoint(),[exports.TokenType.Semicolon,";",i.representationStart,i.representationEnd,void 0];case v:return i.advanceCodePoint(),[exports.TokenType.OpenParen,"(",i.representationStart,i.representationEnd,void 0];case W:return i.advanceCodePoint(),[exports.TokenType.CloseParen,")",i.representationStart,i.representationEnd,void 0];case x:return i.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",i.representationStart,i.representationEnd,void 0];case F:return i.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",i.representationStart,i.representationEnd,void 0];case E:return i.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",i.representationStart,i.representationEnd,void 0];case q:return i.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",i.representationStart,i.representationEnd,void 0];case t:case L:return consumeStringToken(s,i);case D:return consumeHashToken(s,i);case A:case T:return checkIfThreeCodePointsWouldStartANumber(i)?consumeNumericToken(s,i):(i.advanceCodePoint(),[exports.TokenType.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]);case g:case c:case C:case a:case z:return consumeWhiteSpace(i);case k:return checkIfThreeCodePointsWouldStartANumber(i)?consumeNumericToken(s,i):checkIfThreeCodePointsWouldStartCDC(i)?(i.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",i.representationStart,i.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)?consumeIdentLikeToken(s,i):(i.advanceCodePoint(),[exports.TokenType.Delim,"-",i.representationStart,i.representationEnd,{value:"-"}]);case y:return checkIfFourCodePointsWouldStartCDO(i)?(i.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",i.representationStart,i.representationEnd,void 0]):(i.advanceCodePoint(),[exports.TokenType.Delim,"<",i.representationStart,i.representationEnd,{value:"<"}]);case p:if(i.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)){const e=consumeIdentSequence(s,i);return[exports.TokenType.AtKeyword,i.source.slice(i.representationStart,i.representationEnd+1),i.representationStart,i.representationEnd,{value:String.fromCodePoint(...e)}]}return[exports.TokenType.Delim,"@",i.representationStart,i.representationEnd,{value:"@"}];case b:return checkIfTwoCodePointsAreAValidEscape(i)?consumeIdentLikeToken(s,i):(i.advanceCodePoint(),s.onParseError(new ParseError('Invalid escape sequence after "\\"',i.representationStart,i.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.Delim,"\\",i.representationStart,i.representationEnd,{value:"\\"}])}return i.advanceCodePoint(),[exports.TokenType.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]},endOfFile:function endOfFile(){return void 0===i.codePointSource[i.cursor]}}}exports.ParseError=ParseError,exports.Reader=Reader,exports.cloneTokens=function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))},exports.isToken=function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!r.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,o){let n="";const r=[];{let e="";for(e of o)r.push(e.codePointAt(0))}let t=0;r[0]===k&&r[1]===k?(n="--",t=2):r[0]===k&&r[1]?(n="-",t=2,isIdentStartCodePoint(r[1])?n+=o[1]:n+=`\\${r[1].toString(16)} `):isIdentStartCodePoint(r[0])?(n=o[0],t=1):(n=`\\${r[0].toString(16)} `,t=1);for(let e=t;e=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===O}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===k}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===b&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,o){return o.codePointSource[o.cursor]===k?o.codePointSource[o.cursor+1]===k||(!!isIdentStartCodePoint(o.codePointSource[o.cursor+1])||o.codePointSource[o.cursor+1]===b&&!isNewLine(o.codePointSource[o.cursor+2])):!!isIdentStartCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===A||e.codePointSource[e.cursor]===k?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===T&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===T?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===B&&e.codePointSource[e.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===k&&e.codePointSource[e.cursor+1]===k&&e.codePointSource[e.cursor+2]===l}function consumeComment(e,o){for(o.advanceCodePoint(2);;){const n=o.readCodePoint();if(!1===n){e.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(n===i&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===B)){o.advanceCodePoint();break}}return[exports.TokenType.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,o){const n=o.readCodePoint();if(!1===n)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",o.representationStart,o.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),N;if(isHexDigitCodePoint(n)){const e=[n];for(;void 0!==o.codePointSource[o.cursor]&&isHexDigitCodePoint(o.codePointSource[o.cursor])&&e.length<6;)e.push(o.codePointSource[o.cursor]),o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor])&&o.advanceCodePoint();const t=parseInt(String.fromCodePoint(...e),16);return 0===t?N:(r=t)>=55296&&r<=57343||t>U?N:t}var r;return n}function consumeIdentSequence(e,o){const n=[];for(;;)if(isIdentCodePoint(o.codePointSource[o.cursor]))n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(o))return n;o.advanceCodePoint(),n.push(consumeEscapedCodePoint(e,o))}}function consumeHashToken(e,o){if(o.advanceCodePoint(),void 0!==o.codePointSource[o.cursor]&&(isIdentCodePoint(o.codePointSource[o.cursor])||checkIfTwoCodePointsAreAValidEscape(o))){let r=n.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)&&(r=n.ID);const t=consumeIdentSequence(e,o);return[exports.TokenType.Hash,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...t),type:r}]}return[exports.TokenType.Delim,"#",o.representationStart,o.representationEnd,{value:"#"}]}function consumeNumber(e,o){let n=exports.NumberType.Integer;for(o.codePointSource[o.cursor]!==A&&o.codePointSource[o.cursor]!==k||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===T&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===h||o.codePointSource[o.cursor]===m){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==k&&o.codePointSource[o.cursor+1]!==A||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return n;o.advanceCodePoint(3)}for(n=exports.NumberType.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return n}function consumeNumericToken(e,o){let n;{const e=o.codePointSource[o.cursor];e===k?n="-":e===A&&(n="+")}const r=consumeNumber(0,o),t=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1))||0;if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const i=consumeIdentSequence(e,o);return[exports.TokenType.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r,unit:String.fromCodePoint(...i)}]}return o.codePointSource[o.cursor]===R?(o.advanceCodePoint(),[exports.TokenType.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n}]):[exports.TokenType.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:t,signCharacter:n,type:r}]}function consumeWhiteSpace(e){for(;isWhitespace(e.codePointSource[e.cursor]);)e.advanceCodePoint();return[exports.TokenType.Whitespace,e.source.slice(e.representationStart,e.representationEnd+1),e.representationStart,e.representationEnd,void 0]}function consumeStringToken(e,o){let n="";const r=o.readCodePoint();for(;;){const t=o.readCodePoint();if(!1===t)return e.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(isNewLine(t))return e.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[exports.TokenType.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(t===r)return[exports.TokenType.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(t!==b)n+=String.fromCodePoint(t);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}n+=String.fromCodePoint(consumeEscapedCodePoint(e,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==K&&e[0]!==M||e[1]!==$&&e[1]!==J||e[2]!==_&&e[2]!==j)}function consumeBadURL(e,o){for(;;){if(void 0===o.codePointSource[o.cursor])return;if(o.codePointSource[o.cursor]===W)return void o.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(o)?(o.advanceCodePoint(),consumeEscapedCodePoint(e,o)):o.advanceCodePoint()}}function consumeUrlToken(e,o){for(;isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();let n="";for(;;){if(void 0===o.codePointSource[o.cursor])return e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(o.codePointSource[o.cursor]===W)return o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}];if(isWhitespace(o.codePointSource[o.cursor])){for(o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();return void 0===o.codePointSource[o.cursor]?(e.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}]):o.codePointSource[o.cursor]===W?(o.advanceCodePoint(),[exports.TokenType.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:n}]):(consumeBadURL(e,o),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0])}if(o.codePointSource[o.cursor]===L||o.codePointSource[o.cursor]===t||o.codePointSource[o.cursor]===v||((r=o.codePointSource[o.cursor])===I||r===P||w<=r&&r<=s||V<=r&&r<=f))return consumeBadURL(e,o),e.onParseError(new ParseError("Unexpected character while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(o.codePointSource[o.cursor]===b){if(checkIfTwoCodePointsAreAValidEscape(o)){o.advanceCodePoint(),n+=String.fromCodePoint(consumeEscapedCodePoint(e,o));continue}return consumeBadURL(e,o),e.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}n+=String.fromCodePoint(o.codePointSource[o.cursor]),o.advanceCodePoint()}var r}function consumeIdentLikeToken(e,o){const n=consumeIdentSequence(e,o);if(o.codePointSource[o.cursor]!==v)return[exports.TokenType.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}];if(checkIfCodePointsMatchURLIdent(n)){o.advanceCodePoint();let r=0;for(;;){const e=isWhitespace(o.codePointSource[o.cursor]),i=isWhitespace(o.codePointSource[o.cursor+1]);if(e&&i){r+=1,o.advanceCodePoint(1);continue}const s=e?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===L||s===t)return r>0&&o.unreadCodePoint(r),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}];break}return consumeUrlToken(e,o)}return o.advanceCodePoint(),[exports.TokenType.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...n)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==K&&e.codePointSource[e.cursor]!==M||e.codePointSource[e.cursor+1]!==A||e.codePointSource[e.cursor+2]!==Q&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(e,o){o.advanceCodePoint(2);const n=[],r=[];for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)n.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&n.length<6&&o.codePointSource[o.cursor]===Q;)0===r.length&&r.push(...n),n.push(G),r.push(X),o.advanceCodePoint();if(!r.length&&o.codePointSource[o.cursor]===k&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!r.length){const e=parseInt(String.fromCodePoint(...n),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:e,endOfRange:e}]}const t=parseInt(String.fromCodePoint(...n),16),i=parseInt(String.fromCodePoint(...r),16);return[exports.TokenType.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:t,endOfRange:i}]}function tokenizer(e,o){const n=e.css.valueOf(),r=e.unicodeRangesAllowed??!1,i=new Reader(n),s={onParseError:o?.onParseError??(()=>{})};return{nextToken:function nextToken(){i.resetRepresentation();const e=i.codePointSource[i.cursor];if(void 0===e)return[exports.TokenType.EOF,"",-1,-1,void 0];if(e===B&&checkIfTwoCodePointsStartAComment(i))return consumeComment(s,i);if(r&&(e===K||e===M)&&checkIfThreeCodePointsWouldStartAUnicodeRange(i))return consumeUnicodeRangeToken(0,i);if(isIdentStartCodePoint(e))return consumeIdentLikeToken(s,i);if(isDigitCodePoint(e))return consumeNumericToken(s,i);switch(e){case d:return i.advanceCodePoint(),[exports.TokenType.Comma,",",i.representationStart,i.representationEnd,void 0];case u:return i.advanceCodePoint(),[exports.TokenType.Colon,":",i.representationStart,i.representationEnd,void 0];case H:return i.advanceCodePoint(),[exports.TokenType.Semicolon,";",i.representationStart,i.representationEnd,void 0];case v:return i.advanceCodePoint(),[exports.TokenType.OpenParen,"(",i.representationStart,i.representationEnd,void 0];case W:return i.advanceCodePoint(),[exports.TokenType.CloseParen,")",i.representationStart,i.representationEnd,void 0];case x:return i.advanceCodePoint(),[exports.TokenType.OpenSquare,"[",i.representationStart,i.representationEnd,void 0];case F:return i.advanceCodePoint(),[exports.TokenType.CloseSquare,"]",i.representationStart,i.representationEnd,void 0];case E:return i.advanceCodePoint(),[exports.TokenType.OpenCurly,"{",i.representationStart,i.representationEnd,void 0];case q:return i.advanceCodePoint(),[exports.TokenType.CloseCurly,"}",i.representationStart,i.representationEnd,void 0];case t:case L:return consumeStringToken(s,i);case D:return consumeHashToken(s,i);case A:case T:return checkIfThreeCodePointsWouldStartANumber(i)?consumeNumericToken(s,i):(i.advanceCodePoint(),[exports.TokenType.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]);case g:case c:case C:case a:case z:return consumeWhiteSpace(i);case k:return checkIfThreeCodePointsWouldStartANumber(i)?consumeNumericToken(s,i):checkIfThreeCodePointsWouldStartCDC(i)?(i.advanceCodePoint(3),[exports.TokenType.CDC,"--\x3e",i.representationStart,i.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)?consumeIdentLikeToken(s,i):(i.advanceCodePoint(),[exports.TokenType.Delim,"-",i.representationStart,i.representationEnd,{value:"-"}]);case y:return checkIfFourCodePointsWouldStartCDO(i)?(i.advanceCodePoint(4),[exports.TokenType.CDO,"\x3c!--",i.representationStart,i.representationEnd,void 0]):(i.advanceCodePoint(),[exports.TokenType.Delim,"<",i.representationStart,i.representationEnd,{value:"<"}]);case p:if(i.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,i)){const e=consumeIdentSequence(s,i);return[exports.TokenType.AtKeyword,i.source.slice(i.representationStart,i.representationEnd+1),i.representationStart,i.representationEnd,{value:String.fromCodePoint(...e)}]}return[exports.TokenType.Delim,"@",i.representationStart,i.representationEnd,{value:"@"}];case b:return checkIfTwoCodePointsAreAValidEscape(i)?consumeIdentLikeToken(s,i):(i.advanceCodePoint(),s.onParseError(new ParseError('Invalid escape sequence after "\\"',i.representationStart,i.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[exports.TokenType.Delim,"\\",i.representationStart,i.representationEnd,{value:"\\"}])}return i.advanceCodePoint(),[exports.TokenType.Delim,i.source[i.representationStart],i.representationStart,i.representationEnd,{value:i.source[i.representationStart]}]},endOfFile:function endOfFile(){return void 0===i.codePointSource[i.cursor]}}}exports.ParseError=ParseError,exports.Reader=Reader,exports.cloneTokens=function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))},exports.isToken=function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!r.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))},exports.mirrorVariant=function mirrorVariant(e){switch(e[0]){case exports.TokenType.OpenParen:return[exports.TokenType.CloseParen,")",-1,-1,void 0];case exports.TokenType.CloseParen:return[exports.TokenType.OpenParen,"(",-1,-1,void 0];case exports.TokenType.OpenCurly:return[exports.TokenType.CloseCurly,"}",-1,-1,void 0];case exports.TokenType.CloseCurly:return[exports.TokenType.OpenCurly,"{",-1,-1,void 0];case exports.TokenType.OpenSquare:return[exports.TokenType.CloseSquare,"]",-1,-1,void 0];case exports.TokenType.CloseSquare:return[exports.TokenType.OpenSquare,"[",-1,-1,void 0];default:return null}},exports.mirrorVariantType=function mirrorVariantType(e){switch(e){case exports.TokenType.OpenParen:return exports.TokenType.CloseParen;case exports.TokenType.CloseParen:return exports.TokenType.OpenParen;case exports.TokenType.OpenCurly:return exports.TokenType.CloseCurly;case exports.TokenType.CloseCurly:return exports.TokenType.OpenCurly;case exports.TokenType.OpenSquare:return exports.TokenType.CloseSquare;case exports.TokenType.CloseSquare:return exports.TokenType.OpenSquare;default:return null}},exports.mutateIdent=function mutateIdent(e,o){let n="";const r=[];{let e="";for(e of o)r.push(e.codePointAt(0))}let t=0;r[0]===k&&r[1]===k?(n="--",t=2):r[0]===k&&r[1]?(n="-",t=2,isIdentStartCodePoint(r[1])?n+=o[1]:n+=`\\${r[1].toString(16)} `):isIdentStartCodePoint(r[0])?(n=o[0],t=1):(n=`\\${r[0].toString(16)} `,t=1);for(let e=t;e): Array; + +export declare type CodePointReader = { + representationStart: number; + representationEnd: number; + cursor: number; + codePointSource: Array; + representationIndices: Array; + source: string; + advanceCodePoint(n?: number): void; + readCodePoint(n?: number): number | false; + unreadCodePoint(n?: number): void; + resetRepresentation(): void; +}; + +export declare type CSSToken = TokenAtKeyword | TokenBadString | TokenBadURL | TokenCDC | TokenCDO | TokenColon | TokenComma | TokenComment | TokenDelim | TokenDimension | TokenEOF | TokenFunction | TokenHash | TokenIdent | TokenNumber | TokenPercentage | TokenSemicolon | TokenString | TokenURL | TokenWhitespace | TokenOpenParen | TokenCloseParen | TokenOpenSquare | TokenCloseSquare | TokenOpenCurly | TokenCloseCurly | TokenUnicodeRange; + +export declare enum HashType { + Unrestricted = "unrestricted", + ID = "id" +} + +export declare function isToken(x: any): x is CSSToken; + +export declare function mirrorVariant(token: CSSToken): CSSToken | null; + +export declare function mirrorVariantType(type: TokenType): TokenType | null; + +export declare function mutateIdent(ident: TokenIdent, newValue: string): void; + +export declare enum NumberType { + Integer = "integer", + Number = "number" +} + +export declare class ParseError extends Error { + /** The index of the start character of the current token. */ + sourceStart: number; + /** The index of the end character of the current token. */ + sourceEnd: number; + /** The parser steps that preceded the error. */ + parserState: Array; + constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array); +} + +export declare class Reader implements CodePointReader { + cursor: number; + source: string; + codePointSource: Array; + representationIndices: Array; + length: number; + representationStart: number; + representationEnd: number; + constructor(source: string); + advanceCodePoint(n?: number): void; + readCodePoint(n?: number): number | false; + unreadCodePoint(n?: number): void; + resetRepresentation(): void; +} + +export declare function stringify(...tokens: Array): string; + +export declare type Token = [ +/** The type of token */ +T, +/** The token representation */ +string, +/** Start position of representation */ +number, +/** End position of representation */ +number, +/** Extra data */ +U +]; + +export declare type TokenAtKeyword = Token; + +export declare type TokenBadString = Token; + +export declare type TokenBadURL = Token; + +export declare type TokenCDC = Token; + +export declare type TokenCDO = Token; + +export declare type TokenCloseCurly = Token; + +export declare type TokenCloseParen = Token; + +export declare type TokenCloseSquare = Token; + +export declare type TokenColon = Token; + +export declare type TokenComma = Token; + +export declare type TokenComment = Token; + +export declare type TokenDelim = Token; + +export declare type TokenDimension = Token; + +export declare type TokenEOF = Token; + +export declare type TokenFunction = Token; + +export declare type TokenHash = Token; + +export declare type TokenIdent = Token; + +export declare function tokenize(input: { + css: { + valueOf(): string; + }; + unicodeRangesAllowed?: boolean; +}, options?: { + onParseError?: (error: ParseError) => void; +}): Array; + +export declare function tokenizer(input: { + css: { + valueOf(): string; + }; + unicodeRangesAllowed?: boolean; +}, options?: { + onParseError?: (error: ParseError) => void; +}): { + nextToken: () => CSSToken | undefined; + endOfFile: () => boolean; +}; + +export declare type TokenNumber = Token; + +export declare type TokenOpenCurly = Token; + +export declare type TokenOpenParen = Token; + +export declare type TokenOpenSquare = Token; + +export declare type TokenPercentage = Token; + +export declare type TokenSemicolon = Token; + +export declare type TokenString = Token; + +export declare enum TokenType { + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#comment-diagram */ + Comment = "comment", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-at-keyword-token */ + AtKeyword = "at-keyword-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-string-token */ + BadString = "bad-string-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-url-token */ + BadURL = "bad-url-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdc-token */ + CDC = "CDC-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdo-token */ + CDO = "CDO-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-colon-token */ + Colon = "colon-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-comma-token */ + Comma = "comma-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-delim-token */ + Delim = "delim-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-dimension-token */ + Dimension = "dimension-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-eof-token */ + EOF = "EOF-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-function-token */ + Function = "function-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-hash-token */ + Hash = "hash-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-ident-token */ + Ident = "ident-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token */ + Number = "number-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token */ + Percentage = "percentage-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-semicolon-token */ + Semicolon = "semicolon-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-string-token */ + String = "string-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-url-token */ + URL = "url-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-whitespace-token */ + Whitespace = "whitespace-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-paren */ + OpenParen = "(-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-paren */ + CloseParen = ")-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-square */ + OpenSquare = "[-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-square */ + CloseSquare = "]-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-curly */ + OpenCurly = "{-token", + /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-curly */ + CloseCurly = "}-token", + /** https://drafts.csswg.org/css-syntax/#typedef-unicode-range-token */ + UnicodeRange = "unicode-range-token" +} + +export declare type TokenUnicodeRange = Token; + +export declare type TokenURL = Token; + +export declare type TokenWhitespace = Token; + +export { } diff --git a/node_modules/@csstools/css-tokenizer/dist/index.mjs b/node_modules/@csstools/css-tokenizer/dist/index.mjs index a073b6bc..855a5420 100644 --- a/node_modules/@csstools/css-tokenizer/dist/index.mjs +++ b/node_modules/@csstools/css-tokenizer/dist/index.mjs @@ -1 +1 @@ -class ParseError extends Error{sourceStart;sourceEnd;parserState;constructor(e,n,o,r){super(e),this.name="ParseError",this.sourceStart=n,this.sourceEnd=o,this.parserState=r}}class Reader{cursor=0;source="";codePointSource=[];representationIndices=[-1];length=0;representationStart=0;representationEnd=-1;constructor(e){this.source=e;{let n=-1,o="";for(o of e)n+=o.length,this.codePointSource.push(o.codePointAt(0)),this.representationIndices.push(n)}this.length=this.codePointSource.length}advanceCodePoint(e=1){this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor]}readCodePoint(e=1){const n=this.codePointSource[this.cursor];return void 0!==n&&(this.cursor=this.cursor+e,this.representationEnd=this.representationIndices[this.cursor],n)}unreadCodePoint(e=1){this.cursor=this.cursor-e,this.representationEnd=this.representationIndices[this.cursor]}resetRepresentation(){this.representationStart=this.representationIndices[this.cursor]+1,this.representationEnd=-1}}var e,n,o;function mirrorVariantType(n){switch(n){case e.OpenParen:return e.CloseParen;case e.CloseParen:return e.OpenParen;case e.OpenCurly:return e.CloseCurly;case e.CloseCurly:return e.OpenCurly;case e.OpenSquare:return e.CloseSquare;case e.CloseSquare:return e.OpenSquare;default:return null}}function mirrorVariant(n){switch(n[0]){case e.OpenParen:return[e.CloseParen,")",-1,-1,void 0];case e.CloseParen:return[e.OpenParen,"(",-1,-1,void 0];case e.OpenCurly:return[e.CloseCurly,"}",-1,-1,void 0];case e.CloseCurly:return[e.OpenCurly,"{",-1,-1,void 0];case e.OpenSquare:return[e.CloseSquare,"]",-1,-1,void 0];case e.CloseSquare:return[e.OpenSquare,"[",-1,-1,void 0];default:return null}}!function(e){e.Comment="comment",e.AtKeyword="at-keyword-token",e.BadString="bad-string-token",e.BadURL="bad-url-token",e.CDC="CDC-token",e.CDO="CDO-token",e.Colon="colon-token",e.Comma="comma-token",e.Delim="delim-token",e.Dimension="dimension-token",e.EOF="EOF-token",e.Function="function-token",e.Hash="hash-token",e.Ident="ident-token",e.Number="number-token",e.Percentage="percentage-token",e.Semicolon="semicolon-token",e.String="string-token",e.URL="url-token",e.Whitespace="whitespace-token",e.OpenParen="(-token",e.CloseParen=")-token",e.OpenSquare="[-token",e.CloseSquare="]-token",e.OpenCurly="{-token",e.CloseCurly="}-token",e.UnicodeRange="unicode-range-token"}(e||(e={})),function(e){e.Integer="integer",e.Number="number"}(n||(n={})),function(e){e.Unrestricted="unrestricted",e.ID="id"}(o||(o={}));const r=Object.values(e);function isToken(e){return!!Array.isArray(e)&&(!(e.length<4)&&(!!r.includes(e[0])&&("string"==typeof e[1]&&("number"==typeof e[2]&&"number"==typeof e[3]))))}function stringify(...e){let n="";for(let o=0;o=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===w}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===h}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===W&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.codePointSource[n.cursor]===h?n.codePointSource[n.cursor+1]===h||(!!isIdentStartCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===W&&!isNewLine(n.codePointSource[n.cursor+2])):!!isIdentStartCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===x||e.codePointSource[e.cursor]===h?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===l&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===l?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===B&&e.codePointSource[e.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===h&&e.codePointSource[e.cursor+1]===h&&e.codePointSource[e.cursor+2]===f}function consumeComment(n,o){for(o.advanceCodePoint(2);;){const e=o.readCodePoint();if(!1===e){n.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(e===i&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===B)){o.advanceCodePoint();break}}return[e.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,n){const o=n.readCodePoint();if(!1===o)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",n.representationStart,n.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),q;if(isHexDigitCodePoint(o)){const e=[o];for(;void 0!==n.codePointSource[n.cursor]&&isHexDigitCodePoint(n.codePointSource[n.cursor])&&e.length<6;)e.push(n.codePointSource[n.cursor]),n.advanceCodePoint();isWhitespace(n.codePointSource[n.cursor])&&n.advanceCodePoint();const t=parseInt(String.fromCodePoint(...e),16);return 0===t?q:(r=t)>=55296&&r<=57343||t>D?q:t}var r;return o}function consumeIdentSequence(e,n){const o=[];for(;;)if(isIdentCodePoint(n.codePointSource[n.cursor]))o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(n))return o;n.advanceCodePoint(),o.push(consumeEscapedCodePoint(e,n))}}function consumeHashToken(n,r){if(r.advanceCodePoint(),void 0!==r.codePointSource[r.cursor]&&(isIdentCodePoint(r.codePointSource[r.cursor])||checkIfTwoCodePointsAreAValidEscape(r))){let t=o.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,r)&&(t=o.ID);const i=consumeIdentSequence(n,r);return[e.Hash,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCodePoint(...i),type:t}]}return[e.Delim,"#",r.representationStart,r.representationEnd,{value:"#"}]}function consumeNumber(e,o){let r=n.Integer;for(o.codePointSource[o.cursor]!==x&&o.codePointSource[o.cursor]!==h||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===l&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),r=n.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===v||o.codePointSource[o.cursor]===m){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==h&&o.codePointSource[o.cursor+1]!==x||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return r;o.advanceCodePoint(3)}for(r=n.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return r}function consumeNumericToken(n,o){let r;{const e=o.codePointSource[o.cursor];e===h?r="-":e===x&&(r="+")}const t=consumeNumber(0,o),i=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1))||0;if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const c=consumeIdentSequence(n,o);return[e.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r,type:t,unit:String.fromCodePoint(...c)}]}return o.codePointSource[o.cursor]===L?(o.advanceCodePoint(),[e.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r}]):[e.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r,type:t}]}function consumeWhiteSpace(n){for(;isWhitespace(n.codePointSource[n.cursor]);)n.advanceCodePoint();return[e.Whitespace,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0]}function consumeStringToken(n,o){let r="";const t=o.readCodePoint();for(;;){const i=o.readCodePoint();if(!1===i)return n.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[e.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isNewLine(i))return n.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[e.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(i===t)return[e.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(i!==W)r+=String.fromCodePoint(i);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}r+=String.fromCodePoint(consumeEscapedCodePoint(n,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==K&&e[0]!==M||e[1]!==$&&e[1]!==J||e[2]!==_&&e[2]!==j)}function consumeBadURL(e,n){for(;;){if(void 0===n.codePointSource[n.cursor])return;if(n.codePointSource[n.cursor]===b)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,o){for(;isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();let r="";for(;;){if(void 0===o.codePointSource[o.cursor])return n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(o.codePointSource[o.cursor]===b)return o.advanceCodePoint(),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isWhitespace(o.codePointSource[o.cursor])){for(o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();return void 0===o.codePointSource[o.cursor]?(n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):o.codePointSource[o.cursor]===b?(o.advanceCodePoint(),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):(consumeBadURL(n,o),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0])}if(o.codePointSource[o.cursor]===y||o.codePointSource[o.cursor]===t||o.codePointSource[o.cursor]===k||((i=o.codePointSource[o.cursor])===U||i===p||A<=i&&i<=c||V<=i&&i<=E))return consumeBadURL(n,o),n.onParseError(new ParseError("Unexpected character while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(o.codePointSource[o.cursor]===W){if(checkIfTwoCodePointsAreAValidEscape(o)){o.advanceCodePoint(),r+=String.fromCodePoint(consumeEscapedCodePoint(n,o));continue}return consumeBadURL(n,o),n.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}r+=String.fromCodePoint(o.codePointSource[o.cursor]),o.advanceCodePoint()}var i}function consumeIdentLikeToken(n,o){const r=consumeIdentSequence(n,o);if(o.codePointSource[o.cursor]!==k)return[e.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];if(checkIfCodePointsMatchURLIdent(r)){o.advanceCodePoint();let i=0;for(;;){const n=isWhitespace(o.codePointSource[o.cursor]),c=isWhitespace(o.codePointSource[o.cursor+1]);if(n&&c){i+=1,o.advanceCodePoint(1);continue}const s=n?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===y||s===t)return i>0&&o.unreadCodePoint(i),[e.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];break}return consumeUrlToken(n,o)}return o.advanceCodePoint(),[e.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==K&&e.codePointSource[e.cursor]!==M||e.codePointSource[e.cursor+1]!==x||e.codePointSource[e.cursor+2]!==Q&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(n,o){o.advanceCodePoint(2);const r=[],t=[];for(;void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&r.length<6&&o.codePointSource[o.cursor]===Q;)0===t.length&&t.push(...r),r.push(G),t.push(X),o.advanceCodePoint();if(!t.length&&o.codePointSource[o.cursor]===h&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&t.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)t.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!t.length){const n=parseInt(String.fromCodePoint(...r),16);return[e.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:n,endOfRange:n}]}const i=parseInt(String.fromCodePoint(...r),16),c=parseInt(String.fromCodePoint(...t),16);return[e.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:i,endOfRange:c}]}function tokenize(e,n){const o=tokenizer(e,n),r=[];{for(;!o.endOfFile();){const e=o.nextToken();e&&r.push(e)}const e=o.nextToken();e&&r.push(e)}return r}function tokenizer(n,o){const r=n.css.valueOf(),i=n.unicodeRangesAllowed??!1,c=new Reader(r),p={onParseError:(null==o?void 0:o.onParseError)??(()=>{})};return{nextToken:function nextToken(){c.resetRepresentation();const n=c.codePointSource[c.cursor];if(void 0===n)return[e.EOF,"",-1,-1,void 0];if(n===B&&checkIfTwoCodePointsStartAComment(c))return consumeComment(p,c);if(i&&(n===K||n===M)&&checkIfThreeCodePointsWouldStartAUnicodeRange(c))return consumeUnicodeRangeToken(0,c);if(isIdentStartCodePoint(n))return consumeIdentLikeToken(p,c);if(isDigitCodePoint(n))return consumeNumericToken(p,c);switch(n){case d:return c.advanceCodePoint(),[e.Comma,",",c.representationStart,c.representationEnd,void 0];case u:return c.advanceCodePoint(),[e.Colon,":",c.representationStart,c.representationEnd,void 0];case H:return c.advanceCodePoint(),[e.Semicolon,";",c.representationStart,c.representationEnd,void 0];case k:return c.advanceCodePoint(),[e.OpenParen,"(",c.representationStart,c.representationEnd,void 0];case b:return c.advanceCodePoint(),[e.CloseParen,")",c.representationStart,c.representationEnd,void 0];case I:return c.advanceCodePoint(),[e.OpenSquare,"[",c.representationStart,c.representationEnd,void 0];case F:return c.advanceCodePoint(),[e.CloseSquare,"]",c.representationStart,c.representationEnd,void 0];case g:return c.advanceCodePoint(),[e.OpenCurly,"{",c.representationStart,c.representationEnd,void 0];case N:return c.advanceCodePoint(),[e.CloseCurly,"}",c.representationStart,c.representationEnd,void 0];case t:case y:return consumeStringToken(p,c);case R:return consumeHashToken(p,c);case x:case l:return checkIfThreeCodePointsWouldStartANumber(c)?consumeNumericToken(p,c):(c.advanceCodePoint(),[e.Delim,c.source[c.representationStart],c.representationStart,c.representationEnd,{value:c.source[c.representationStart]}]);case O:case s:case C:case a:case z:return consumeWhiteSpace(c);case h:return checkIfThreeCodePointsWouldStartANumber(c)?consumeNumericToken(p,c):checkIfThreeCodePointsWouldStartCDC(c)?(c.advanceCodePoint(3),[e.CDC,"--\x3e",c.representationStart,c.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,c)?consumeIdentLikeToken(p,c):(c.advanceCodePoint(),[e.Delim,"-",c.representationStart,c.representationEnd,{value:"-"}]);case T:return checkIfFourCodePointsWouldStartCDO(c)?(c.advanceCodePoint(4),[e.CDO,"\x3c!--",c.representationStart,c.representationEnd,void 0]):(c.advanceCodePoint(),[e.Delim,"<",c.representationStart,c.representationEnd,{value:"<"}]);case P:if(c.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,c)){const n=consumeIdentSequence(p,c);return[e.AtKeyword,c.source.slice(c.representationStart,c.representationEnd+1),c.representationStart,c.representationEnd,{value:String.fromCodePoint(...n)}]}return[e.Delim,"@",c.representationStart,c.representationEnd,{value:"@"}];case W:return checkIfTwoCodePointsAreAValidEscape(c)?consumeIdentLikeToken(p,c):(c.advanceCodePoint(),p.onParseError(new ParseError('Invalid escape sequence after "\\"',c.representationStart,c.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.Delim,"\\",c.representationStart,c.representationEnd,{value:"\\"}])}return c.advanceCodePoint(),[e.Delim,c.source[c.representationStart],c.representationStart,c.representationEnd,{value:c.source[c.representationStart]}]},endOfFile:function endOfFile(){return void 0===c.codePointSource[c.cursor]}}}function cloneTokens(e){return"undefined"!=typeof globalThis&&"structuredClone"in globalThis?structuredClone(e):JSON.parse(JSON.stringify(e))}function mutateIdent(e,n){let o="";const r=[];{let e="";for(e of n)r.push(e.codePointAt(0))}let t=0;r[0]===h&&r[1]===h?(o="--",t=2):r[0]===h&&r[1]?(o="-",t=2,isIdentStartCodePoint(r[1])?o+=n[1]:o+=`\\${r[1].toString(16)} `):isIdentStartCodePoint(r[0])?(o=n[0],t=1):(o=`\\${r[0].toString(16)} `,t=1);for(let e=t;e=48&&e<=57}function isUppercaseLetterCodePoint(e){return e>=65&&e<=90}function isLowercaseLetterCodePoint(e){return e>=97&&e<=122}function isHexDigitCodePoint(e){return isDigitCodePoint(e)||e>=97&&e<=102||e>=65&&e<=70}function isLetterCodePoint(e){return isLowercaseLetterCodePoint(e)||isUppercaseLetterCodePoint(e)}function isIdentStartCodePoint(e){return isLetterCodePoint(e)||isNonASCII_IdentCodePoint(e)||e===w}function isIdentCodePoint(e){return isIdentStartCodePoint(e)||isDigitCodePoint(e)||e===h}function isNonASCII_IdentCodePoint(e){return 183===e||8204===e||8205===e||8255===e||8256===e||8204===e||(192<=e&&e<=214||216<=e&&e<=246||248<=e&&e<=893||895<=e&&e<=8191||8304<=e&&e<=8591||11264<=e&&e<=12271||12289<=e&&e<=55295||63744<=e&&e<=64975||65008<=e&&e<=65533||e>=65536)}function isNewLine(e){return 10===e||13===e||12===e}function isWhitespace(e){return 32===e||10===e||9===e||13===e||12===e}function checkIfTwoCodePointsAreAValidEscape(e){return e.codePointSource[e.cursor]===W&&!isNewLine(e.codePointSource[e.cursor+1])}function checkIfThreeCodePointsWouldStartAnIdentSequence(e,n){return n.codePointSource[n.cursor]===h?n.codePointSource[n.cursor+1]===h||(!!isIdentStartCodePoint(n.codePointSource[n.cursor+1])||n.codePointSource[n.cursor+1]===W&&!isNewLine(n.codePointSource[n.cursor+2])):!!isIdentStartCodePoint(n.codePointSource[n.cursor])||checkIfTwoCodePointsAreAValidEscape(n)}function checkIfThreeCodePointsWouldStartANumber(e){return e.codePointSource[e.cursor]===x||e.codePointSource[e.cursor]===h?!!isDigitCodePoint(e.codePointSource[e.cursor+1])||e.codePointSource[e.cursor+1]===l&&isDigitCodePoint(e.codePointSource[e.cursor+2]):e.codePointSource[e.cursor]===l?isDigitCodePoint(e.codePointSource[e.cursor+1]):isDigitCodePoint(e.codePointSource[e.cursor])}function checkIfTwoCodePointsStartAComment(e){return e.codePointSource[e.cursor]===B&&e.codePointSource[e.cursor+1]===i}function checkIfThreeCodePointsWouldStartCDC(e){return e.codePointSource[e.cursor]===h&&e.codePointSource[e.cursor+1]===h&&e.codePointSource[e.cursor+2]===f}function consumeComment(n,o){for(o.advanceCodePoint(2);;){const e=o.readCodePoint();if(!1===e){n.onParseError(new ParseError("Unexpected EOF while consuming a comment.",o.representationStart,o.representationEnd,["4.3.2. Consume comments","Unexpected EOF"]));break}if(e===i&&(void 0!==o.codePointSource[o.cursor]&&o.codePointSource[o.cursor]===B)){o.advanceCodePoint();break}}return[e.Comment,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}function consumeEscapedCodePoint(e,n){const o=n.readCodePoint();if(!1===o)return e.onParseError(new ParseError("Unexpected EOF while consuming an escaped code point.",n.representationStart,n.representationEnd,["4.3.7. Consume an escaped code point","Unexpected EOF"])),q;if(isHexDigitCodePoint(o)){const e=[o];for(;void 0!==n.codePointSource[n.cursor]&&isHexDigitCodePoint(n.codePointSource[n.cursor])&&e.length<6;)e.push(n.codePointSource[n.cursor]),n.advanceCodePoint();isWhitespace(n.codePointSource[n.cursor])&&n.advanceCodePoint();const t=parseInt(String.fromCodePoint(...e),16);return 0===t?q:(r=t)>=55296&&r<=57343||t>D?q:t}var r;return o}function consumeIdentSequence(e,n){const o=[];for(;;)if(isIdentCodePoint(n.codePointSource[n.cursor]))o.push(n.codePointSource[n.cursor]),n.advanceCodePoint();else{if(!checkIfTwoCodePointsAreAValidEscape(n))return o;n.advanceCodePoint(),o.push(consumeEscapedCodePoint(e,n))}}function consumeHashToken(n,r){if(r.advanceCodePoint(),void 0!==r.codePointSource[r.cursor]&&(isIdentCodePoint(r.codePointSource[r.cursor])||checkIfTwoCodePointsAreAValidEscape(r))){let t=o.Unrestricted;checkIfThreeCodePointsWouldStartAnIdentSequence(0,r)&&(t=o.ID);const i=consumeIdentSequence(n,r);return[e.Hash,r.source.slice(r.representationStart,r.representationEnd+1),r.representationStart,r.representationEnd,{value:String.fromCodePoint(...i),type:t}]}return[e.Delim,"#",r.representationStart,r.representationEnd,{value:"#"}]}function consumeNumber(e,o){let r=n.Integer;for(o.codePointSource[o.cursor]!==x&&o.codePointSource[o.cursor]!==h||o.advanceCodePoint();isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===l&&isDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint(2),r=n.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint();if(o.codePointSource[o.cursor]===v||o.codePointSource[o.cursor]===m){if(isDigitCodePoint(o.codePointSource[o.cursor+1]))o.advanceCodePoint(2);else{if(o.codePointSource[o.cursor+1]!==h&&o.codePointSource[o.cursor+1]!==x||!isDigitCodePoint(o.codePointSource[o.cursor+2]))return r;o.advanceCodePoint(3)}for(r=n.Number;isDigitCodePoint(o.codePointSource[o.cursor]);)o.advanceCodePoint()}return r}function consumeNumericToken(n,o){let r;{const e=o.codePointSource[o.cursor];e===h?r="-":e===x&&(r="+")}const t=consumeNumber(0,o),i=parseFloat(o.source.slice(o.representationStart,o.representationEnd+1))||0;if(checkIfThreeCodePointsWouldStartAnIdentSequence(0,o)){const c=consumeIdentSequence(n,o);return[e.Dimension,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r,type:t,unit:String.fromCodePoint(...c)}]}return o.codePointSource[o.cursor]===L?(o.advanceCodePoint(),[e.Percentage,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r}]):[e.Number,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:i,signCharacter:r,type:t}]}function consumeWhiteSpace(n){for(;isWhitespace(n.codePointSource[n.cursor]);)n.advanceCodePoint();return[e.Whitespace,n.source.slice(n.representationStart,n.representationEnd+1),n.representationStart,n.representationEnd,void 0]}function consumeStringToken(n,o){let r="";const t=o.readCodePoint();for(;;){const i=o.readCodePoint();if(!1===i)return n.onParseError(new ParseError("Unexpected EOF while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected EOF"])),[e.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isNewLine(i))return n.onParseError(new ParseError("Unexpected newline while consuming a string token.",o.representationStart,o.representationEnd,["4.3.5. Consume a string token","Unexpected newline"])),o.unreadCodePoint(),[e.BadString,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(i===t)return[e.String,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(i!==W)r+=String.fromCodePoint(i);else{if(void 0===o.codePointSource[o.cursor])continue;if(isNewLine(o.codePointSource[o.cursor])){o.advanceCodePoint();continue}r+=String.fromCodePoint(consumeEscapedCodePoint(n,o))}}}function checkIfCodePointsMatchURLIdent(e){return!(3!==e.length||e[0]!==K&&e[0]!==M||e[1]!==$&&e[1]!==J||e[2]!==_&&e[2]!==j)}function consumeBadURL(e,n){for(;;){if(void 0===n.codePointSource[n.cursor])return;if(n.codePointSource[n.cursor]===b)return void n.advanceCodePoint();checkIfTwoCodePointsAreAValidEscape(n)?(n.advanceCodePoint(),consumeEscapedCodePoint(e,n)):n.advanceCodePoint()}}function consumeUrlToken(n,o){for(;isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();let r="";for(;;){if(void 0===o.codePointSource[o.cursor])return n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected EOF"])),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(o.codePointSource[o.cursor]===b)return o.advanceCodePoint(),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}];if(isWhitespace(o.codePointSource[o.cursor])){for(o.advanceCodePoint();isWhitespace(o.codePointSource[o.cursor]);)o.advanceCodePoint();return void 0===o.codePointSource[o.cursor]?(n.onParseError(new ParseError("Unexpected EOF while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Consume as much whitespace as possible","Unexpected EOF"])),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):o.codePointSource[o.cursor]===b?(o.advanceCodePoint(),[e.URL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:r}]):(consumeBadURL(n,o),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0])}if(o.codePointSource[o.cursor]===y||o.codePointSource[o.cursor]===t||o.codePointSource[o.cursor]===k||((i=o.codePointSource[o.cursor])===U||i===p||A<=i&&i<=c||V<=i&&i<=E))return consumeBadURL(n,o),n.onParseError(new ParseError("Unexpected character while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","Unexpected U+0022 QUOTATION MARK (\"), U+0027 APOSTROPHE ('), U+0028 LEFT PARENTHESIS (() or non-printable code point"])),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0];if(o.codePointSource[o.cursor]===W){if(checkIfTwoCodePointsAreAValidEscape(o)){o.advanceCodePoint(),r+=String.fromCodePoint(consumeEscapedCodePoint(n,o));continue}return consumeBadURL(n,o),n.onParseError(new ParseError("Invalid escape sequence while consuming a url token.",o.representationStart,o.representationEnd,["4.3.6. Consume a url token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.BadURL,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,void 0]}r+=String.fromCodePoint(o.codePointSource[o.cursor]),o.advanceCodePoint()}var i}function consumeIdentLikeToken(n,o){const r=consumeIdentSequence(n,o);if(o.codePointSource[o.cursor]!==k)return[e.Ident,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];if(checkIfCodePointsMatchURLIdent(r)){o.advanceCodePoint();let i=0;for(;;){const n=isWhitespace(o.codePointSource[o.cursor]),c=isWhitespace(o.codePointSource[o.cursor+1]);if(n&&c){i+=1,o.advanceCodePoint(1);continue}const s=n?o.codePointSource[o.cursor+1]:o.codePointSource[o.cursor];if(s===y||s===t)return i>0&&o.unreadCodePoint(i),[e.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}];break}return consumeUrlToken(n,o)}return o.advanceCodePoint(),[e.Function,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{value:String.fromCodePoint(...r)}]}function checkIfThreeCodePointsWouldStartAUnicodeRange(e){return!(e.codePointSource[e.cursor]!==K&&e.codePointSource[e.cursor]!==M||e.codePointSource[e.cursor+1]!==x||e.codePointSource[e.cursor+2]!==Q&&!isHexDigitCodePoint(e.codePointSource[e.cursor+2]))}function consumeUnicodeRangeToken(n,o){o.advanceCodePoint(2);const r=[],t=[];for(;void 0!==o.codePointSource[o.cursor]&&r.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)r.push(o.codePointSource[o.cursor]),o.advanceCodePoint();for(;void 0!==o.codePointSource[o.cursor]&&r.length<6&&o.codePointSource[o.cursor]===Q;)0===t.length&&t.push(...r),r.push(G),t.push(X),o.advanceCodePoint();if(!t.length&&o.codePointSource[o.cursor]===h&&isHexDigitCodePoint(o.codePointSource[o.cursor+1]))for(o.advanceCodePoint();void 0!==o.codePointSource[o.cursor]&&t.length<6&&isHexDigitCodePoint(o.codePointSource[o.cursor]);)t.push(o.codePointSource[o.cursor]),o.advanceCodePoint();if(!t.length){const n=parseInt(String.fromCodePoint(...r),16);return[e.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:n,endOfRange:n}]}const i=parseInt(String.fromCodePoint(...r),16),c=parseInt(String.fromCodePoint(...t),16);return[e.UnicodeRange,o.source.slice(o.representationStart,o.representationEnd+1),o.representationStart,o.representationEnd,{startOfRange:i,endOfRange:c}]}function tokenize(e,n){const o=tokenizer(e,n),r=[];{for(;!o.endOfFile();){const e=o.nextToken();e&&r.push(e)}const e=o.nextToken();e&&r.push(e)}return r}function tokenizer(n,o){const r=n.css.valueOf(),i=n.unicodeRangesAllowed??!1,c=new Reader(r),p={onParseError:o?.onParseError??(()=>{})};return{nextToken:function nextToken(){c.resetRepresentation();const n=c.codePointSource[c.cursor];if(void 0===n)return[e.EOF,"",-1,-1,void 0];if(n===B&&checkIfTwoCodePointsStartAComment(c))return consumeComment(p,c);if(i&&(n===K||n===M)&&checkIfThreeCodePointsWouldStartAUnicodeRange(c))return consumeUnicodeRangeToken(0,c);if(isIdentStartCodePoint(n))return consumeIdentLikeToken(p,c);if(isDigitCodePoint(n))return consumeNumericToken(p,c);switch(n){case d:return c.advanceCodePoint(),[e.Comma,",",c.representationStart,c.representationEnd,void 0];case u:return c.advanceCodePoint(),[e.Colon,":",c.representationStart,c.representationEnd,void 0];case H:return c.advanceCodePoint(),[e.Semicolon,";",c.representationStart,c.representationEnd,void 0];case k:return c.advanceCodePoint(),[e.OpenParen,"(",c.representationStart,c.representationEnd,void 0];case b:return c.advanceCodePoint(),[e.CloseParen,")",c.representationStart,c.representationEnd,void 0];case I:return c.advanceCodePoint(),[e.OpenSquare,"[",c.representationStart,c.representationEnd,void 0];case F:return c.advanceCodePoint(),[e.CloseSquare,"]",c.representationStart,c.representationEnd,void 0];case g:return c.advanceCodePoint(),[e.OpenCurly,"{",c.representationStart,c.representationEnd,void 0];case N:return c.advanceCodePoint(),[e.CloseCurly,"}",c.representationStart,c.representationEnd,void 0];case t:case y:return consumeStringToken(p,c);case R:return consumeHashToken(p,c);case x:case l:return checkIfThreeCodePointsWouldStartANumber(c)?consumeNumericToken(p,c):(c.advanceCodePoint(),[e.Delim,c.source[c.representationStart],c.representationStart,c.representationEnd,{value:c.source[c.representationStart]}]);case O:case s:case C:case a:case z:return consumeWhiteSpace(c);case h:return checkIfThreeCodePointsWouldStartANumber(c)?consumeNumericToken(p,c):checkIfThreeCodePointsWouldStartCDC(c)?(c.advanceCodePoint(3),[e.CDC,"--\x3e",c.representationStart,c.representationEnd,void 0]):checkIfThreeCodePointsWouldStartAnIdentSequence(0,c)?consumeIdentLikeToken(p,c):(c.advanceCodePoint(),[e.Delim,"-",c.representationStart,c.representationEnd,{value:"-"}]);case T:return checkIfFourCodePointsWouldStartCDO(c)?(c.advanceCodePoint(4),[e.CDO,"\x3c!--",c.representationStart,c.representationEnd,void 0]):(c.advanceCodePoint(),[e.Delim,"<",c.representationStart,c.representationEnd,{value:"<"}]);case P:if(c.advanceCodePoint(),checkIfThreeCodePointsWouldStartAnIdentSequence(0,c)){const n=consumeIdentSequence(p,c);return[e.AtKeyword,c.source.slice(c.representationStart,c.representationEnd+1),c.representationStart,c.representationEnd,{value:String.fromCodePoint(...n)}]}return[e.Delim,"@",c.representationStart,c.representationEnd,{value:"@"}];case W:return checkIfTwoCodePointsAreAValidEscape(c)?consumeIdentLikeToken(p,c):(c.advanceCodePoint(),p.onParseError(new ParseError('Invalid escape sequence after "\\"',c.representationStart,c.representationEnd,["4.3.1. Consume a token","U+005C REVERSE SOLIDUS (\\)","The input stream does not start with a valid escape sequence"])),[e.Delim,"\\",c.representationStart,c.representationEnd,{value:"\\"}])}return c.advanceCodePoint(),[e.Delim,c.source[c.representationStart],c.representationStart,c.representationEnd,{value:c.source[c.representationStart]}]},endOfFile:function endOfFile(){return void 0===c.codePointSource[c.cursor]}}}function mutateIdent(e,n){let o="";const r=[];{let e="";for(e of n)r.push(e.codePointAt(0))}let t=0;r[0]===h&&r[1]===h?(o="--",t=2):r[0]===h&&r[1]?(o="-",t=2,isIdentStartCodePoint(r[1])?o+=n[1]:o+=`\\${r[1].toString(16)} `):isIdentStartCodePoint(r[0])?(o=n[0],t=1):(o=`\\${r[0].toString(16)} `,t=1);for(let e=t;e; - representationIndices: Array; - source: string; - advanceCodePoint(n?: number): void; - readCodePoint(n?: number): number | false; - unreadCodePoint(n?: number): void; - resetRepresentation(): void; -}; diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts deleted file mode 100644 index 339bfe4e..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/interfaces/context.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { ParseError } from './error'; -export type Context = { - onParseError: (error: ParseError) => void; -}; diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts deleted file mode 100644 index dc47e1d6..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/interfaces/error.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export declare class ParseError extends Error { - /** The index of the start character of the current token. */ - sourceStart: number; - /** The index of the end character of the current token. */ - sourceEnd: number; - /** The parser steps that preceded the error. */ - parserState: Array; - constructor(message: string, sourceStart: number, sourceEnd: number, parserState: Array); -} diff --git a/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts b/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts deleted file mode 100644 index c4f2f4e3..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/interfaces/token.d.ts +++ /dev/null @@ -1,137 +0,0 @@ -export declare enum TokenType { - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#comment-diagram */ - Comment = "comment", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-at-keyword-token */ - AtKeyword = "at-keyword-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-string-token */ - BadString = "bad-string-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-bad-url-token */ - BadURL = "bad-url-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdc-token */ - CDC = "CDC-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-cdo-token */ - CDO = "CDO-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-colon-token */ - Colon = "colon-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-comma-token */ - Comma = "comma-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-delim-token */ - Delim = "delim-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-dimension-token */ - Dimension = "dimension-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-eof-token */ - EOF = "EOF-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-function-token */ - Function = "function-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-hash-token */ - Hash = "hash-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-ident-token */ - Ident = "ident-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token */ - Number = "number-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-percentage-token */ - Percentage = "percentage-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-semicolon-token */ - Semicolon = "semicolon-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-string-token */ - String = "string-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-url-token */ - URL = "url-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#typedef-whitespace-token */ - Whitespace = "whitespace-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-paren */ - OpenParen = "(-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-paren */ - CloseParen = ")-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-square */ - OpenSquare = "[-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-square */ - CloseSquare = "]-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-open-curly */ - OpenCurly = "{-token", - /** https://www.w3.org/TR/2021/CRD-css-syntax-3-20211224/#tokendef-close-curly */ - CloseCurly = "}-token", - /** https://drafts.csswg.org/css-syntax/#typedef-unicode-range-token */ - UnicodeRange = "unicode-range-token" -} -export declare enum NumberType { - Integer = "integer", - Number = "number" -} -export declare enum HashType { - Unrestricted = "unrestricted", - ID = "id" -} -export type TokenAtKeyword = Token; -export type TokenBadString = Token; -export type TokenBadURL = Token; -export type TokenCDC = Token; -export type TokenCDO = Token; -export type TokenColon = Token; -export type TokenComma = Token; -export type TokenComment = Token; -export type TokenDelim = Token; -export type TokenDimension = Token; -export type TokenEOF = Token; -export type TokenFunction = Token; -export type TokenHash = Token; -export type TokenIdent = Token; -export type TokenNumber = Token; -export type TokenPercentage = Token; -export type TokenSemicolon = Token; -export type TokenString = Token; -export type TokenURL = Token; -export type TokenWhitespace = Token; -export type TokenOpenParen = Token; -export type TokenCloseParen = Token; -export type TokenOpenSquare = Token; -export type TokenCloseSquare = Token; -export type TokenOpenCurly = Token; -export type TokenCloseCurly = Token; -export type TokenUnicodeRange = Token; -export type CSSToken = TokenAtKeyword | TokenBadString | TokenBadURL | TokenCDC | TokenCDO | TokenColon | TokenComma | TokenComment | TokenDelim | TokenDimension | TokenEOF | TokenFunction | TokenHash | TokenIdent | TokenNumber | TokenPercentage | TokenSemicolon | TokenString | TokenURL | TokenWhitespace | TokenOpenParen | TokenCloseParen | TokenOpenSquare | TokenCloseSquare | TokenOpenCurly | TokenCloseCurly | TokenUnicodeRange; -export type Token = [ - /** The type of token */ - T, - /** The token representation */ - string, - /** Start position of representation */ - number, - /** End position of representation */ - number, - /** Extra data */ - U -]; -export declare function mirrorVariantType(type: TokenType): TokenType | null; -export declare function mirrorVariant(token: CSSToken): CSSToken | null; -export declare function isToken(x: any): x is CSSToken; diff --git a/node_modules/@csstools/css-tokenizer/dist/reader.d.ts b/node_modules/@csstools/css-tokenizer/dist/reader.d.ts deleted file mode 100644 index fc798c58..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/reader.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { CodePointReader } from './interfaces/code-point-reader'; -export declare class Reader implements CodePointReader { - cursor: number; - source: string; - codePointSource: Array; - representationIndices: Array; - length: number; - representationStart: number; - representationEnd: number; - constructor(source: string); - advanceCodePoint(n?: number): void; - readCodePoint(n?: number): number | false; - unreadCodePoint(n?: number): void; - resetRepresentation(): void; -} diff --git a/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts b/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts deleted file mode 100644 index 574d2043..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/stringify.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { CSSToken } from './interfaces/token'; -export declare function stringify(...tokens: Array): string; diff --git a/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts b/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts deleted file mode 100644 index 318a16bb..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/tokenizer.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { CSSToken } from './interfaces/token'; -import { ParseError } from './interfaces/error'; -interface Stringer { - valueOf(): string; -} -export declare function tokenize(input: { - css: Stringer; - unicodeRangesAllowed?: boolean; -}, options?: { - onParseError?: (error: ParseError) => void; -}): Array; -export declare function tokenizer(input: { - css: Stringer; - unicodeRangesAllowed?: boolean; -}, options?: { - onParseError?: (error: ParseError) => void; -}): { - nextToken: () => CSSToken | undefined; - endOfFile: () => boolean; -}; -export {}; diff --git a/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts b/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts deleted file mode 100644 index 1db05d03..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/util/clone-tokens.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { CSSToken } from '../interfaces/token'; -export declare function cloneTokens(tokens: Array): Array; diff --git a/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts b/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts deleted file mode 100644 index 37f23cd2..00000000 --- a/node_modules/@csstools/css-tokenizer/dist/util/mutations.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { TokenIdent } from '../interfaces/token'; -export declare function mutateIdent(ident: TokenIdent, newValue: string): void; diff --git a/node_modules/@csstools/css-tokenizer/package.json b/node_modules/@csstools/css-tokenizer/package.json index 4fcbeb61..c438c3ee 100644 --- a/node_modules/@csstools/css-tokenizer/package.json +++ b/node_modules/@csstools/css-tokenizer/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/css-tokenizer", "description": "Tokenize CSS", - "version": "2.2.1", + "version": "2.2.2", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -44,18 +47,6 @@ "README.md", "dist" ], - "devDependencies": { - "@rmenke/css-tokenizer-tests": "^1.1.1", - "postcss-parser-tests": "^8.8.0" - }, - "scripts": { - "benchmark": "node ./test/benchmark.mjs", - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer#readme", "repository": { "type": "git", @@ -66,8 +57,5 @@ "keywords": [ "css", "tokenizer" - ], - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/media-query-list-parser/CHANGELOG.md b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md index d8f8b70f..70fce09b 100644 --- a/node_modules/@csstools/media-query-list-parser/CHANGELOG.md +++ b/node_modules/@csstools/media-query-list-parser/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes to Media Query List Parser +### 2.1.6 + +_December 15, 2023_ + +- Fix type definitions +- Only `walk` child nodes if they are still part of the current AST tree [#1202](https://github.com/csstools/postcss-plugins/issues/1202) +- Make `walk` methods safe for mutations [#1204](https://github.com/csstools/postcss-plugins/issues/1204) +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) + ### 2.1.5 _September 24, 2023_ @@ -13,72 +23,4 @@ _August 5, 2023_ - Do not allow keywords as media feature values in range context queries. -### 2.1.3 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - -### 2.1.2 - -_July 3, 2023_ - -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) - -### 2.1.1 - -_June 21, 2023_ - -- Fix parsing of `(width == 100px)`. This was erroneously parsed as a range query and will now instead be a general enclosed node. - -### 2.1.0 - -_June 1, 2023_ - -- Fix `walk` for `MediaFeatureValue` with complex component values. -- Add `state` to `walk` methods. - -This makes it possible pass down information from a parent structure to children. -e.g. you can set `entry.state.inInPrintQuery = true` for `print and (min-width: 30cm)`. - -### 2.0.4 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) - -### 2.0.3 - -_April 10, 2023_ - -- Add support for `env()` functions as values in media queries. -- Improve the detection of math function as values in media queries. - -### 2.0.2 - -_March 25, 2023_ - -- Improve case insensitive string matching. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 19, 2023_ - -- Refactor `MediaFeatureBoolean` so that it follows the same structure as `MediaFeaturePlain` (breaking) -- Change the `ParseError` interface, this is now a subclass of `Error` (breaking) -- Add `getName` and `getNameToken` to all nodes that have a feature name. -- Add `@custom-media` parsing. - -### 1.0.0 - -_November 14, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md) diff --git a/node_modules/@csstools/media-query-list-parser/dist/index.cjs b/node_modules/@csstools/media-query-list-parser/dist/index.cjs index aabcfbcc..8d3e5aea 100644 --- a/node_modules/@csstools/media-query-list-parser/dist/index.cjs +++ b/node_modules/@csstools/media-query-list-parser/dist/index.cjs @@ -1 +1 @@ -"use strict";var e,t=require("@csstools/css-parser-algorithms"),i=require("@csstools/css-tokenizer");exports.NodeType=void 0,(e=exports.NodeType||(exports.NodeType={})).CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid";const a=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(a,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=exports.NodeType.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===exports.NodeType.MediaCondition)}}class MediaInParens{type=exports.NodeType.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.media.toString()+i.stringify(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===exports.NodeType.MediaInParens)}}class MediaQueryWithType{type=exports.NodeType.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,t){let i=!1;if(this.media.forEach(((a,r)=>{if(i)return;let n;t&&(n={...t}),!1!==e({node:a,parent:this,state:n},r)?"walk"in a&&!1===a.walk(e,n)&&(i=!0):i=!0})),i)return!1}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===exports.NodeType.MediaQueryInvalid)}}class GeneralEnclosed{type=exports.NodeType.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===exports.NodeType.GeneralEnclosed)}}class MediaAnd{type=exports.NodeType.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return i.stringify(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===exports.NodeType.MediaAnd)}}class MediaConditionListWithAnd{type=exports.NodeType.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((r,n)=>{a||(t&&(i={...t}),!1!==e({node:r,parent:this,state:i},n)?"walk"in r&&!1===r.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===exports.NodeType.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=exports.NodeType.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((r,n)=>{a||(t&&(i={...t}),!1!==e({node:r,parent:this,state:i},n)?"walk"in r&&!1===r.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===exports.NodeType.MediaConditionListWithOr)}}function isNumber(e){return!!(e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Number||e.type===t.ComponentValueType.Function&&r.has(toLowerCaseAZ(e.name[4].value)))}const r=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Dimension}function isIdent(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Ident}function isEnvironmentVariable(e){return e.type===t.ComponentValueType.Function&&"env"===toLowerCaseAZ(e.name[4].value)}class MediaFeatureName{type=exports.NodeType.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.name.toString()+i.stringify(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===exports.NodeType.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;ae.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=exports.NodeType.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===exports.NodeType.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=exports.NodeType.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?i.stringify(...this.before)+this.value.map((e=>e.toString())).join("")+i.stringify(...this.after):i.stringify(...this.before)+this.value.toString()+i.stringify(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,t){if(Array.isArray(this.value)){let i=!1;if(this.value.forEach(((a,r)=>{if(i)return;let n;t&&(n={...t}),!1!==e({node:a,parent:this,state:n},r)?"walk"in a&&!1===a.walk(e,n)&&(i=!0):i=!0})),i)return!1}else{let i;if(t&&(i={...t}),!1===e({node:this.value,parent:this,state:i},"value"))return!1;if("walk"in this.value)return this.value.walk(e,i)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===exports.NodeType.MediaFeatureValue)}}function parseMediaFeatureValue(e,i=!1){let a=-1,r=-1;for(let n=0;ne.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==i.TokenType.Delim)return!1;if(1===e.length)switch(e[0][4].value){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT;default:return!1}if(e[1][0]!==i.TokenType.Delim)return!1;if(e[1][4].value!==exports.MediaFeatureEQ.EQ)return!1;switch(e[0][4].value){case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT_OR_EQ;default:return!1}}exports.MediaFeatureLT=void 0,(n=exports.MediaFeatureLT||(exports.MediaFeatureLT={})).LT="<",n.LT_OR_EQ="<=",exports.MediaFeatureGT=void 0,(s=exports.MediaFeatureGT||(exports.MediaFeatureGT={})).GT=">",s.GT_OR_EQ=">=",exports.MediaFeatureEQ=void 0,(exports.MediaFeatureEQ||(exports.MediaFeatureEQ={})).EQ="=";class MediaFeatureRangeNameValue{type=exports.NodeType.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===exports.NodeType.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=exports.NodeType.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+i.stringify(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===exports.NodeType.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=exports.NodeType.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,r){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=r}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+i.stringify(...this.valueOneOperator)+this.name.toString()+i.stringify(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===exports.NodeType.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let a=!1,r=!1;for(let n=0;ne.tokens())),-1!==r&&(o=e.slice(a+1,r+1).flatMap((e=>e.tokens())))):-1!==r&&(o=e.slice(0,r+1).flatMap((e=>e.tokens())));const u=parseMediaConditionWithoutOr(e.slice(Math.max(a,r,n)+1));return!1===u?new MediaQueryWithType(s,[...o,...e.slice(r+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(s,o,e.slice(r+1,n+1).flatMap((e=>e.tokens())),u)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;se.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;se.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const r=parseMediaInParens(e);return!1!==r&&new MediaCondition(r)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let a=-1;for(let i=0;ie.tokens())),r.startToken],s=[r.endToken,...e.slice(a+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(r,n,s);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(r.value);return!1!==u?new MediaInParens(u,n,s):new MediaInParens(new GeneralEnclosed(r),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==i.TokenType.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const a=parseMediaCondition(e.value);return!1!==a?new MediaInParens(a,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(e){let i=!1,a=null;for(let r=0;re.tokens())),t)}}}return a||!1}function parseMediaOr(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseMediaAnd(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,i){const a=t.parseCommaSeparatedListOfComponentValues(e,{onParseError:null==i?void 0:i.onParseError});return a.map(((e,t)=>{const r=parseMediaQuery(e);return 0==r&&!0===(null==i?void 0:i.preserveInvalidMediaQueries)?new MediaQueryInvalid(a[t]):r})).filter((e=>!!e))}exports.MediaQueryModifier=void 0,(o=exports.MediaQueryModifier||(exports.MediaQueryModifier={})).Not="not",o.Only="only";class CustomMedia{type=exports.NodeType.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===exports.NodeType.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let a=[],r=e;for(let t=0;tString.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=exports.NodeType.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===exports.NodeType.MediaCondition)}}class MediaInParens{type=exports.NodeType.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.media.toString()+i.stringify(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===exports.NodeType.MediaInParens)}}class MediaQueryWithType{type=exports.NodeType.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,i){if(0===this.media.length)return;const a=t.walkerIndexGenerator(this.media);let r=0;for(;re.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,i){let a;if(i&&(a={...i}),!1===e({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,a))return!1;if(0===this.list.length)return;const r=t.walkerIndexGenerator(this.list);let n=0;for(;ne.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===exports.NodeType.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=exports.NodeType.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return i.stringify(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+i.stringify(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,i){let a;if(i&&(a={...i}),!1===e({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,a))return!1;if(0===this.list.length)return;const r=t.walkerIndexGenerator(this.list);let n=0;for(;ne.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===exports.NodeType.MediaConditionListWithOr)}}function isNumber(e){return!!(e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Number||e.type===t.ComponentValueType.Function&&r.has(toLowerCaseAZ(e.name[4].value)))}const r=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Dimension}function isIdent(e){return e.type===t.ComponentValueType.Token&&e.value[0]===i.TokenType.Ident}function isEnvironmentVariable(e){return e.type===t.ComponentValueType.Function&&"env"===toLowerCaseAZ(e.name[4].value)}class MediaFeatureName{type=exports.NodeType.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return i.stringify(...this.before)+this.name.toString()+i.stringify(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===exports.NodeType.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;ae.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=exports.NodeType.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===exports.NodeType.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=exports.NodeType.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?i.stringify(...this.before)+this.value.map((e=>e.toString())).join("")+i.stringify(...this.after):i.stringify(...this.before)+this.value.toString()+i.stringify(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,i){if(Array.isArray(this.value)){if(0===this.value.length)return;const a=t.walkerIndexGenerator(this.value);let r=0;for(;re.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===exports.NodeType.MediaFeatureValue)}}function parseMediaFeatureValue(e,i=!1){let a=-1,r=-1;for(let n=0;ne.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==i.TokenType.Delim)return!1;if(1===e.length)switch(e[0][4].value){case exports.MediaFeatureEQ.EQ:return exports.MediaFeatureEQ.EQ;case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT;default:return!1}if(e[1][0]!==i.TokenType.Delim)return!1;if(e[1][4].value!==exports.MediaFeatureEQ.EQ)return!1;switch(e[0][4].value){case exports.MediaFeatureLT.LT:return exports.MediaFeatureLT.LT_OR_EQ;case exports.MediaFeatureGT.GT:return exports.MediaFeatureGT.GT_OR_EQ;default:return!1}}exports.MediaFeatureLT=void 0,(n=exports.MediaFeatureLT||(exports.MediaFeatureLT={})).LT="<",n.LT_OR_EQ="<=",exports.MediaFeatureGT=void 0,(s=exports.MediaFeatureGT||(exports.MediaFeatureGT={})).GT=">",s.GT_OR_EQ=">=",exports.MediaFeatureEQ=void 0,(exports.MediaFeatureEQ||(exports.MediaFeatureEQ={})).EQ="=";class MediaFeatureRangeNameValue{type=exports.NodeType.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+i.stringify(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===exports.NodeType.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=exports.NodeType.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+i.stringify(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===exports.NodeType.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=exports.NodeType.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,r){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=r}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+i.stringify(...this.valueOneOperator)+this.name.toString()+i.stringify(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===exports.NodeType.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let a=!1,r=!1;for(let n=0;ne.tokens())),-1!==r&&(o=e.slice(a+1,r+1).flatMap((e=>e.tokens())))):-1!==r&&(o=e.slice(0,r+1).flatMap((e=>e.tokens())));const u=parseMediaConditionWithoutOr(e.slice(Math.max(a,r,n)+1));return!1===u?new MediaQueryWithType(s,[...o,...e.slice(r+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(s,o,e.slice(r+1,n+1).flatMap((e=>e.tokens())),u)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;se.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let r=-1,n=-1;for(let s=0;se.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const r=parseMediaInParens(e);return!1!==r&&new MediaCondition(r)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let a=-1;for(let i=0;ie.tokens())),r.startToken],s=[r.endToken,...e.slice(a+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(r,n,s);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(r.value);return!1!==u?new MediaInParens(u,n,s):new MediaInParens(new GeneralEnclosed(r),e.slice(0,a).flatMap((e=>e.tokens())),e.slice(a+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==i.TokenType.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const a=parseMediaCondition(e.value);return!1!==a?new MediaInParens(a,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(e){let i=!1,a=null;for(let r=0;re.tokens())),t)}}}return a||!1}function parseMediaOr(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseMediaAnd(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,i){const a=t.parseCommaSeparatedListOfComponentValues(e,{onParseError:i?.onParseError});return a.map(((e,t)=>{const r=parseMediaQuery(e);return 0==r&&!0===i?.preserveInvalidMediaQueries?new MediaQueryInvalid(a[t]):r})).filter((e=>!!e))}exports.MediaQueryModifier=void 0,(o=exports.MediaQueryModifier||(exports.MediaQueryModifier={})).Not="not",o.Only="only";class CustomMedia{type=exports.NodeType.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===exports.NodeType.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let a=[],r=e;for(let t=0;t(x: T): T; + +export declare function comparisonFromTokens(tokens: [TokenDelim, TokenDelim] | [TokenDelim]): MediaFeatureComparison | false; + +export declare class CustomMedia { + type: NodeType; + name: Array; + mediaQueryList: Array | null; + trueOrFalseKeyword: Array | null; + constructor(name: Array, mediaQueryList: Array | null, trueOrFalseKeyword?: Array); + getName(): string; + getNameToken(): CSSToken | null; + hasMediaQueryList(): boolean; + hasTrueKeyword(): boolean; + hasFalseKeyword(): boolean; + tokens(): Array; + toString(): string; + toJSON(): { + type: NodeType; + string: string; + nameValue: string; + name: CSSToken[]; + hasFalseKeyword: boolean; + hasTrueKeyword: boolean; + trueOrFalseKeyword: CSSToken[] | null; + mediaQueryList: ({ + type: NodeType; + string: string; + modifier: CSSToken[]; + mediaType: CSSToken[]; + and: CSSToken[] | undefined; + media: MediaCondition | undefined; + } | { + type: NodeType; + string: string; + media: MediaCondition; + } | { + type: NodeType; + string: string; + media: ComponentValue[]; + })[] | undefined; + }; + isCustomMedia(): this is CustomMedia; + static isCustomMedia(x: unknown): x is CustomMedia; +} + +export declare class GeneralEnclosed { + type: NodeType; + value: ComponentValue; + constructor(value: ComponentValue); + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + walk>(cb: (entry: { + node: GeneralEnclosedWalkerEntry; + parent: GeneralEnclosedWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + tokens: CSSToken[]; + }; + isGeneralEnclosed(): this is GeneralEnclosed; + static isGeneralEnclosed(x: unknown): x is GeneralEnclosed; +} + +export declare type GeneralEnclosedWalkerEntry = ComponentValue; + +export declare type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; + +export declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; + +export declare function isCustomMedia(x: unknown): x is GeneralEnclosed; + +export declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; + +export declare function isMediaAnd(x: unknown): x is MediaAnd; + +export declare function isMediaCondition(x: unknown): x is MediaCondition; + +export declare function isMediaConditionList(x: unknown): x is MediaConditionList; + +export declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; + +export declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; + +export declare function isMediaFeature(x: unknown): x is MediaFeature; + +export declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; + +export declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; + +export declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; + +export declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; + +export declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; + +export declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; + +export declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; + +export declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; + +export declare function isMediaInParens(x: unknown): x is MediaInParens; + +export declare function isMediaNot(x: unknown): x is MediaNot; + +export declare function isMediaOr(x: unknown): x is MediaOr; + +export declare function isMediaQuery(x: unknown): x is MediaQuery; + +export declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; + +export declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; + +export declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; + +export declare function matchesComparison(componentValues: Array): false | [number, number]; + +export declare function matchesRatio(componentValues: Array): number[] | -1; + +export declare function matchesRatioExactly(componentValues: Array): number[] | -1; + +export declare class MediaAnd { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | null; + walk>(cb: (entry: { + node: MediaAndWalkerEntry; + parent: MediaAndWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaAnd(): this is MediaAnd; + static isMediaAnd(x: unknown): x is MediaAnd; +} + +export declare type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; + +export declare type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; + +export declare class MediaCondition { + type: NodeType; + media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr; + constructor(media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr); + tokens(): Array; + toString(): string; + indexOf(item: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr): number | string; + at(index: number | string): MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr | undefined; + walk>(cb: (entry: { + node: MediaConditionWalkerEntry; + parent: MediaConditionWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaCondition(): this is MediaCondition; + static isMediaCondition(x: unknown): x is MediaCondition; +} + +export declare type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; + +export declare class MediaConditionListWithAnd { + type: NodeType; + leading: MediaInParens; + list: Array; + before: Array; + after: Array; + constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens | MediaAnd): number | string; + at(index: number | string): MediaInParens | MediaAnd | undefined; + walk>(cb: (entry: { + node: MediaConditionListWithAndWalkerEntry; + parent: MediaConditionListWithAndWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaConditionListWithAnd(): this is MediaConditionListWithAnd; + static isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; +} + +export declare type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; + +export declare type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; + +export declare class MediaConditionListWithOr { + type: NodeType; + leading: MediaInParens; + list: Array; + before: Array; + after: Array; + constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens | MediaOr): number | string; + at(index: number | string): MediaInParens | MediaOr | undefined; + walk>(cb: (entry: { + node: MediaConditionListWithOrWalkerEntry; + parent: MediaConditionListWithOrWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): unknown; + isMediaConditionListWithOr(): this is MediaConditionListWithOr; + static isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; +} + +export declare type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; + +export declare type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; + +export declare type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; + +export declare type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; + +export declare class MediaFeature { + type: NodeType; + feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; + before: Array; + after: Array; + constructor(feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange, before?: Array, after?: Array); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange): number | string; + at(index: number | string): MediaFeatureBoolean | MediaFeaturePlain | MediaFeatureRange | undefined; + walk>(cb: (entry: { + node: MediaFeatureWalkerEntry; + parent: MediaFeatureWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + feature: { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + before: CSSToken[]; + after: CSSToken[]; + }; + isMediaFeature(): this is MediaFeature; + static isMediaFeature(x: unknown): x is MediaFeature; +} + +export declare class MediaFeatureBoolean { + type: NodeType; + name: MediaFeatureName; + constructor(name: MediaFeatureName); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName): number | string; + at(index: number | string): MediaFeatureName | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureBoolean(): this is MediaFeatureBoolean; + static isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; +} + +export declare type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; + +export declare enum MediaFeatureEQ { + EQ = "=" +} + +export declare enum MediaFeatureGT { + GT = ">", + GT_OR_EQ = ">=" +} + +export declare enum MediaFeatureLT { + LT = "<", + LT_OR_EQ = "<=" +} + +export declare class MediaFeatureName { + type: NodeType; + name: ComponentValue; + before: Array; + after: Array; + constructor(name: ComponentValue, before?: Array, after?: Array); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | undefined; + toJSON(): { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + isMediaFeatureName(): this is MediaFeatureName; + static isMediaFeatureName(x: unknown): x is MediaFeatureName; +} + +export declare class MediaFeaturePlain { + type: NodeType; + name: MediaFeatureName; + colon: TokenColon; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, colon: TokenColon, value: MediaFeatureValue); + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeaturePlainWalkerEntry; + parent: MediaFeaturePlainWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeaturePlain(): this is MediaFeaturePlain; + static isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; +} + +export declare type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; + +export declare type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; + +export declare type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; + +export declare class MediaFeatureRangeNameValue { + type: NodeType; + name: MediaFeatureName; + operator: [TokenDelim, TokenDelim] | [TokenDelim]; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); + operatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeNameValue(): this is MediaFeatureRangeNameValue; + static isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; +} + +export declare class MediaFeatureRangeValueName { + type: NodeType; + name: MediaFeatureName; + operator: [TokenDelim, TokenDelim] | [TokenDelim]; + value: MediaFeatureValue; + constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); + operatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + value: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeValueName(): this is MediaFeatureRangeValueName; + static isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; +} + +export declare class MediaFeatureRangeValueNameValue { + type: NodeType; + name: MediaFeatureName; + valueOne: MediaFeatureValue; + valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim]; + valueTwo: MediaFeatureValue; + valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]; + constructor(name: MediaFeatureName, valueOne: MediaFeatureValue, valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim], valueTwo: MediaFeatureValue, valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]); + valueOneOperatorKind(): MediaFeatureComparison | false; + valueTwoOperatorKind(): MediaFeatureComparison | false; + getName(): string; + getNameToken(): CSSToken; + tokens(): Array; + toString(): string; + indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; + at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; + walk>(cb: (entry: { + node: MediaFeatureRangeWalkerEntry; + parent: MediaFeatureRangeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + name: { + type: NodeType; + name: string; + tokens: CSSToken[]; + }; + valueOne: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + valueTwo: { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + tokens: CSSToken[]; + }; + isMediaFeatureRangeValueNameValue(): this is MediaFeatureRangeValueNameValue; + static isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; +} + +export declare type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; + +export declare type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; + +export declare class MediaFeatureValue { + type: NodeType; + value: ComponentValue | Array; + before: Array; + after: Array; + constructor(value: ComponentValue | Array, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: ComponentValue): number | string; + at(index: number | string): ComponentValue | Array | undefined; + walk>(cb: (entry: { + node: MediaFeatureValueWalkerEntry; + parent: MediaFeatureValueWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + value: unknown; + tokens: CSSToken[]; + }; + isMediaFeatureValue(): this is MediaFeatureValue; + static isMediaFeatureValue(x: unknown): x is MediaFeatureValue; +} + +export declare type MediaFeatureValueWalkerEntry = ComponentValue; + +export declare type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; + +export declare type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; + +export declare type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; + +export declare class MediaInParens { + type: NodeType; + media: MediaCondition | MediaFeature | GeneralEnclosed; + before: Array; + after: Array; + constructor(media: MediaCondition | MediaFeature | GeneralEnclosed, before?: Array, after?: Array); + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition | MediaFeature | GeneralEnclosed): number | string; + at(index: number | string): MediaCondition | MediaFeature | GeneralEnclosed | undefined; + walk>(cb: (entry: { + node: MediaInParensWalkerEntry; + parent: MediaInParensWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + isMediaInParens(): this is MediaInParens; + static isMediaInParens(x: unknown): x is MediaInParens; +} + +export declare type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; + +export declare type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; + +export declare class MediaNot { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | undefined; + walk>(cb: (entry: { + node: MediaNotWalkerEntry; + parent: MediaNotWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + modifier: CSSToken[]; + media: { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + }; + isMediaNot(): this is MediaNot; + static isMediaNot(x: unknown): x is MediaNot; +} + +export declare type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; + +export declare type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; + +export declare class MediaOr { + type: NodeType; + modifier: Array; + media: MediaInParens; + constructor(modifier: Array, media: MediaInParens); + tokens(): Array; + toString(): string; + indexOf(item: MediaInParens): number | string; + at(index: number | string): MediaInParens | undefined; + walk>(cb: (entry: { + node: MediaOrWalkerEntry; + parent: MediaOrWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + modifier: CSSToken[]; + media: { + type: NodeType; + media: unknown; + before: CSSToken[]; + after: CSSToken[]; + }; + }; + isMediaOr(): this is MediaOr; + static isMediaOr(x: unknown): x is MediaOr; +} + +export declare type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; + +export declare type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; + +export declare type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; + +export declare class MediaQueryInvalid { + type: NodeType; + media: Array; + constructor(media: Array); + negateQuery(): MediaQuery; + tokens(): Array; + toString(): string; + walk>(cb: (entry: { + node: MediaQueryInvalidWalkerEntry; + parent: MediaQueryInvalidWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + media: ComponentValue[]; + }; + isMediaQueryInvalid(): this is MediaQueryInvalid; + static isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; +} + +export declare type MediaQueryInvalidWalkerEntry = ComponentValue; + +export declare type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; + +export declare enum MediaQueryModifier { + Not = "not", + Only = "only" +} + +export declare class MediaQueryWithoutType { + type: NodeType; + media: MediaCondition; + constructor(media: MediaCondition); + negateQuery(): MediaQuery; + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition): number | string; + at(index: number | string): MediaCondition | undefined; + walk>(cb: (entry: { + node: MediaQueryWithoutTypeWalkerEntry; + parent: MediaQueryWithoutTypeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + media: MediaCondition; + }; + isMediaQueryWithoutType(): this is MediaQueryWithoutType; + static isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; +} + +export declare type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; + +export declare type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; + +export declare class MediaQueryWithType { + type: NodeType; + modifier: Array; + mediaType: Array; + and: Array | undefined; + media: MediaCondition | undefined; + constructor(modifier: Array, mediaType: Array, and?: Array | undefined, media?: MediaCondition | undefined); + getModifier(): string; + negateQuery(): MediaQuery; + getMediaType(): string; + tokens(): Array; + toString(): string; + indexOf(item: MediaCondition): number | string; + at(index: number | string): MediaCondition | undefined; + walk>(cb: (entry: { + node: MediaQueryWithTypeWalkerEntry; + parent: MediaQueryWithTypeWalkerParent; + state?: T; + }, index: number | string) => boolean | void, state?: T): false | undefined; + toJSON(): { + type: NodeType; + string: string; + modifier: CSSToken[]; + mediaType: CSSToken[]; + and: CSSToken[] | undefined; + media: MediaCondition | undefined; + }; + isMediaQueryWithType(): this is MediaQueryWithType; + static isMediaQueryWithType(x: unknown): x is MediaQueryWithType; +} + +export declare type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; + +export declare type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; + +export declare enum MediaType { + /** Always matches */ + All = "all", + Print = "print", + Screen = "screen", + /** Never matches */ + Tty = "tty", + /** Never matches */ + Tv = "tv", + /** Never matches */ + Projection = "projection", + /** Never matches */ + Handheld = "handheld", + /** Never matches */ + Braille = "braille", + /** Never matches */ + Embossed = "embossed", + /** Never matches */ + Aural = "aural", + /** Never matches */ + Speech = "speech" +} + +export declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; + +export declare function newMediaFeatureBoolean(name: string): MediaFeature; + +export declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; + +export declare enum NodeType { + CustomMedia = "custom-media", + GeneralEnclosed = "general-enclosed", + MediaAnd = "media-and", + MediaCondition = "media-condition", + MediaConditionListWithAnd = "media-condition-list-and", + MediaConditionListWithOr = "media-condition-list-or", + MediaFeature = "media-feature", + MediaFeatureBoolean = "mf-boolean", + MediaFeatureName = "mf-name", + MediaFeaturePlain = "mf-plain", + MediaFeatureRangeNameValue = "mf-range-name-value", + MediaFeatureRangeValueName = "mf-range-value-name", + MediaFeatureRangeValueNameValue = "mf-range-value-name-value", + MediaFeatureValue = "mf-value", + MediaInParens = "media-in-parens", + MediaNot = "media-not", + MediaOr = "media-or", + MediaQueryWithType = "media-query-with-type", + MediaQueryWithoutType = "media-query-without-type", + MediaQueryInvalid = "media-query-invalid" +} + +export declare function parse(source: string, options?: { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}): MediaQuery[]; + +export declare function parseCustomMedia(source: string, options?: { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}): CustomMedia | false; + +export declare function parseCustomMediaFromTokens(tokens: Array, options?: { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}): CustomMedia | false; + +export declare function parseFromTokens(tokens: Array, options?: { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}): MediaQuery[]; + +export declare function typeFromToken(token: TokenIdent): MediaType | false; + +export { } diff --git a/node_modules/@csstools/media-query-list-parser/dist/index.mjs b/node_modules/@csstools/media-query-list-parser/dist/index.mjs index 66bfa3f4..6a84592c 100644 --- a/node_modules/@csstools/media-query-list-parser/dist/index.mjs +++ b/node_modules/@csstools/media-query-list-parser/dist/index.mjs @@ -1 +1 @@ -import{ComponentValueType as e,TokenNode as t,parseListOfComponentValues as i,isWhitespaceNode as a,isCommentNode as n,isTokenNode as r,isSimpleBlockNode as s,parseCommaSeparatedListOfComponentValues as o}from"@csstools/css-parser-algorithms";import{stringify as u,TokenType as d,mutateIdent as l,tokenizer as h,cloneTokens as m}from"@csstools/css-tokenizer";var f;!function(e){e.CustomMedia="custom-media",e.GeneralEnclosed="general-enclosed",e.MediaAnd="media-and",e.MediaCondition="media-condition",e.MediaConditionListWithAnd="media-condition-list-and",e.MediaConditionListWithOr="media-condition-list-or",e.MediaFeature="media-feature",e.MediaFeatureBoolean="mf-boolean",e.MediaFeatureName="mf-name",e.MediaFeaturePlain="mf-plain",e.MediaFeatureRangeNameValue="mf-range-name-value",e.MediaFeatureRangeValueName="mf-range-value-name",e.MediaFeatureRangeValueNameValue="mf-range-value-name-value",e.MediaFeatureValue="mf-value",e.MediaInParens="media-in-parens",e.MediaNot="media-not",e.MediaOr="media-or",e.MediaQueryWithType="media-query-with-type",e.MediaQueryWithoutType="media-query-without-type",e.MediaQueryInvalid="media-query-invalid"}(f||(f={}));const c=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(c,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=f.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===f.MediaCondition)}}class MediaInParens{type=f.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return u(...this.before)+this.media.toString()+u(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===f.MediaInParens)}}class MediaQueryWithType{type=f.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(e,t){let i=!1;if(this.media.forEach(((a,n)=>{if(i)return;let r;t&&(r={...t}),!1!==e({node:a,parent:this,state:r},n)?"walk"in a&&!1===a.walk(e,r)&&(i=!0):i=!0})),i)return!1}toJSON(){return{type:this.type,string:this.toString(),media:this.media}}isMediaQueryInvalid(){return MediaQueryInvalid.isMediaQueryInvalid(this)}static isMediaQueryInvalid(e){return!!e&&(e instanceof MediaQueryInvalid&&e.type===f.MediaQueryInvalid)}}class GeneralEnclosed{type=f.GeneralEnclosed;value;constructor(e){this.value=e}tokens(){return this.value.tokens()}toString(){return this.value.toString()}indexOf(e){return e===this.value?"value":-1}at(e){if("value"===e)return this.value}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,tokens:this.tokens()}}isGeneralEnclosed(){return GeneralEnclosed.isGeneralEnclosed(this)}static isGeneralEnclosed(e){return!!e&&(e instanceof GeneralEnclosed&&e.type===f.GeneralEnclosed)}}class MediaAnd{type=f.MediaAnd;modifier;media;constructor(e,t){this.modifier=e,this.media=t}tokens(){return[...this.modifier,...this.media.tokens()]}toString(){return u(...this.modifier)+this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){return"media"===e?this.media:null}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,modifier:this.modifier,media:this.media.toJSON()}}isMediaAnd(){return MediaAnd.isMediaAnd(this)}static isMediaAnd(e){return!!e&&(e instanceof MediaAnd&&e.type===f.MediaAnd)}}class MediaConditionListWithAnd{type=f.MediaConditionListWithAnd;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return u(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+u(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((n,r)=>{a||(t&&(i={...t}),!1!==e({node:n,parent:this,state:i},r)?"walk"in n&&!1===n.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===f.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=f.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return u(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+u(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(e,t){let i;if(t&&(i={...t}),!1===e({node:this.leading,parent:this,state:i},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(e,i))return!1;let a=!1;return this.list.forEach(((n,r)=>{a||(t&&(i={...t}),!1!==e({node:n,parent:this,state:i},r)?"walk"in n&&!1===n.walk(e,i)&&(a=!0):a=!0)})),!a&&void 0}toJSON(){return{type:this.type,leading:this.leading.toJSON(),list:this.list.map((e=>e.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===f.MediaConditionListWithOr)}}function isNumber(t){return!!(t.type===e.Token&&t.value[0]===d.Number||t.type===e.Function&&M.has(toLowerCaseAZ(t.name[4].value)))}const M=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(t){return t.type===e.Token&&t.value[0]===d.Dimension}function isIdent(t){return t.type===e.Token&&t.value[0]===d.Ident}function isEnvironmentVariable(t){return t.type===e.Function&&"env"===toLowerCaseAZ(t.name[4].value)}class MediaFeatureName{type=f.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return u(...this.before)+this.name.toString()+u(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===f.MediaFeatureName)}}function parseMediaFeatureName(t){let i=-1;for(let a=0;ae.tokens())),t.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=f.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===f.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=f.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?u(...this.before)+this.value.map((e=>e.toString())).join("")+u(...this.after):u(...this.before)+this.value.toString()+u(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(e,t){if(Array.isArray(this.value)){let i=!1;if(this.value.forEach(((a,n)=>{if(i)return;let r;t&&(r={...t}),!1!==e({node:a,parent:this,state:r},n)?"walk"in a&&!1===a.walk(e,r)&&(i=!0):i=!0})),i)return!1}else{let i;if(t&&(i={...t}),!1===e({node:this.value,parent:this,state:i},"value"))return!1;if("walk"in this.value)return this.value.walk(e,i)}}toJSON(){return Array.isArray(this.value)?{type:this.type,value:this.value.map((e=>e.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===f.MediaFeatureValue)}}function parseMediaFeatureValue(t,i=!1){let a=-1,n=-1;for(let r=0;re.tokens())),t.slice(n+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==d.Delim)return!1;if(1===e.length)switch(e[0][4].value){case v.EQ:return v.EQ;case p.LT:return p.LT;case y.GT:return y.GT;default:return!1}if(e[1][0]!==d.Delim)return!1;if(e[1][4].value!==v.EQ)return!1;switch(e[0][4].value){case p.LT:return p.LT_OR_EQ;case y.GT:return y.GT_OR_EQ;default:return!1}}function invertComparison(e){switch(e){case v.EQ:return v.EQ;case p.LT:return y.GT;case p.LT_OR_EQ:return y.GT_OR_EQ;case y.GT:return p.LT;case y.GT_OR_EQ:return p.LT_OR_EQ;default:return!1}}!function(e){e.LT="<",e.LT_OR_EQ="<="}(p||(p={})),function(e){e.GT=">",e.GT_OR_EQ=">="}(y||(y={})),function(e){e.EQ="="}(v||(v={}));class MediaFeatureRangeNameValue{type=f.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+u(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===f.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=f.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+u(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===f.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=f.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,n){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=n}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+u(...this.valueOneOperator)+this.name.toString()+u(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===f.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(t){let i=!1,a=!1;for(let n=0;ne.tokens())),-1!==i&&(u=e.slice(t+1,i+1).flatMap((e=>e.tokens())))):-1!==i&&(u=e.slice(0,i+1).flatMap((e=>e.tokens())));const l=parseMediaConditionWithoutOr(e.slice(Math.max(t,i,s)+1));return!1===l?new MediaQueryWithType(o,[...u,...e.slice(i+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(o,u,e.slice(i+1,s+1).flatMap((e=>e.tokens())),l)}}function parseMediaConditionListWithOr(t){let i=!1;const a=[];let n=-1,r=-1;for(let o=0;oe.tokens())),t.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(t){let i=!1;const a=[];let n=-1,r=-1;for(let o=0;oe.tokens())),t.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const n=parseMediaInParens(e);return!1!==n&&new MediaCondition(n)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(t){let i=-1;for(let a=0;ae.tokens())),a.startToken],r=[a.endToken,...t.slice(i+1).flatMap((e=>e.tokens()))],o=parseMediaFeature(a,n,r);if(!1!==o)return new MediaInParens(o);const u=parseMediaCondition(a.value);return!1!==u?new MediaInParens(u,n,r):new MediaInParens(new GeneralEnclosed(a),t.slice(0,i).flatMap((e=>e.tokens())),t.slice(i+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==d.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const i=parseMediaCondition(e.value);return!1!==i?new MediaInParens(i,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(t){let i=!1,a=null;for(let n=0;ne.tokens())),e)}}}return a||!1}function parseMediaOr(t){let i=!1;for(let a=0;ae.tokens())),e)}}return!1}}return!1}function parseMediaAnd(t){let i=!1;for(let a=0;ae.tokens())),e)}}return!1}}return!1}function parseFromTokens(e,t){const i=o(e,{onParseError:null==t?void 0:t.onParseError});return i.map(((e,a)=>{const n=parseMediaQuery(e);return 0==n&&!0===(null==t?void 0:t.preserveInvalidMediaQueries)?new MediaQueryInvalid(i[a]):n})).filter((e=>!!e))}function parse(e,t){const i=h({css:e},{onParseError:null==t?void 0:t.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseFromTokens(a,t)}!function(e){e.Not="not",e.Only="only"}(g||(g={}));class CustomMedia{type=f.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===f.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let i=[],a=e;for(let t=0;tString.fromCharCode(e.charCodeAt(0)+32)))}class MediaCondition{type=c.MediaCondition;media;constructor(e){this.media=e}tokens(){return this.media.tokens()}toString(){return this.media.toString()}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&this.media.walk(e,i)}toJSON(){return{type:this.type,media:this.media.toJSON()}}isMediaCondition(){return MediaCondition.isMediaCondition(this)}static isMediaCondition(e){return!!e&&(e instanceof MediaCondition&&e.type===c.MediaCondition)}}class MediaInParens{type=c.MediaInParens;media;before;after;constructor(e,t=[],i=[]){this.media=e,this.before=t,this.after=i}tokens(){return[...this.before,...this.media.tokens(),...this.after]}toString(){return d(...this.before)+this.media.toString()+d(...this.after)}indexOf(e){return e===this.media?"media":-1}at(e){if("media"===e)return this.media}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.media,parent:this,state:i},"media")&&("walk"in this.media?this.media.walk(e,i):void 0)}toJSON(){return{type:this.type,media:this.media.toJSON(),before:this.before,after:this.after}}isMediaInParens(){return MediaInParens.isMediaInParens(this)}static isMediaInParens(e){return!!e&&(e instanceof MediaInParens&&e.type===c.MediaInParens)}}class MediaQueryWithType{type=c.MediaQueryWithType;modifier;mediaType;and=void 0;media=void 0;constructor(e,t,i,a){this.modifier=e,this.mediaType=t,i&&a&&(this.and=i,this.media=a)}getModifier(){if(!this.modifier.length)return"";for(let e=0;ee.tokens()))}toString(){return this.media.map((e=>e.toString())).join("")}walk(t,i){if(0===this.media.length)return;const a=e(this.media);let n=0;for(;ne.tokens())),...this.after]}toString(){return d(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+d(...this.after)}indexOf(e){return e===this.leading?"leading":"media-and"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(t,i){let a;if(i&&(a={...i}),!1===t({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(t,a))return!1;if(0===this.list.length)return;const n=e(this.list);let r=0;for(;re.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithAnd(){return MediaConditionListWithAnd.isMediaConditionListWithAnd(this)}static isMediaConditionListWithAnd(e){return!!e&&(e instanceof MediaConditionListWithAnd&&e.type===c.MediaConditionListWithAnd)}}class MediaConditionListWithOr{type=c.MediaConditionListWithOr;leading;list;before;after;constructor(e,t,i=[],a=[]){this.leading=e,this.list=t,this.before=i,this.after=a}tokens(){return[...this.before,...this.leading.tokens(),...this.list.flatMap((e=>e.tokens())),...this.after]}toString(){return d(...this.before)+this.leading.toString()+this.list.map((e=>e.toString())).join("")+d(...this.after)}indexOf(e){return e===this.leading?"leading":"media-or"===e.type?this.list.indexOf(e):-1}at(e){return"leading"===e?this.leading:"number"==typeof e?(e<0&&(e=this.list.length+e),this.list[e]):void 0}walk(t,i){let a;if(i&&(a={...i}),!1===t({node:this.leading,parent:this,state:a},"leading"))return!1;if("walk"in this.leading&&!1===this.leading.walk(t,a))return!1;if(0===this.list.length)return;const n=e(this.list);let r=0;for(;re.toJSON())),before:this.before,after:this.after}}isMediaConditionListWithOr(){return MediaConditionListWithOr.isMediaConditionListWithOr(this)}static isMediaConditionListWithOr(e){return!!e&&(e instanceof MediaConditionListWithOr&&e.type===c.MediaConditionListWithOr)}}function isNumber(e){return!!(e.type===t.Token&&e.value[0]===l.Number||e.type===t.Function&&p.has(toLowerCaseAZ(e.name[4].value)))}const p=new Set(["abs","acos","asin","atan","atan2","calc","clamp","cos","exp","hypot","log","max","min","mod","pow","rem","round","sign","sin","sqrt","tan"]);function isDimension(e){return e.type===t.Token&&e.value[0]===l.Dimension}function isIdent(e){return e.type===t.Token&&e.value[0]===l.Ident}function isEnvironmentVariable(e){return e.type===t.Function&&"env"===toLowerCaseAZ(e.name[4].value)}class MediaFeatureName{type=c.MediaFeatureName;name;before;after;constructor(e,t=[],i=[]){this.name=e,this.before=t,this.after=i}getName(){return this.name.value[4].value}getNameToken(){return this.name.value}tokens(){return[...this.before,...this.name.tokens(),...this.after]}toString(){return d(...this.before)+this.name.toString()+d(...this.after)}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.getName(),tokens:this.tokens()}}isMediaFeatureName(){return MediaFeatureName.isMediaFeatureName(this)}static isMediaFeatureName(e){return!!e&&(e instanceof MediaFeatureName&&e.type===c.MediaFeatureName)}}function parseMediaFeatureName(e){let i=-1;for(let a=0;ae.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}class MediaFeatureBoolean{type=c.MediaFeatureBoolean;name;constructor(e){this.name=e}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return this.name.tokens()}toString(){return this.name.toString()}indexOf(e){return e===this.name?"name":-1}at(e){if("name"===e)return this.name}toJSON(){return{type:this.type,name:this.name.toJSON(),tokens:this.tokens()}}isMediaFeatureBoolean(){return MediaFeatureBoolean.isMediaFeatureBoolean(this)}static isMediaFeatureBoolean(e){return!!e&&(e instanceof MediaFeatureBoolean&&e.type===c.MediaFeatureBoolean)}}function parseMediaFeatureBoolean(e){const t=parseMediaFeatureName(e);return!1===t?t:new MediaFeatureBoolean(t)}class MediaFeatureValue{type=c.MediaFeatureValue;value;before;after;constructor(e,t=[],i=[]){Array.isArray(e)&&1===e.length?this.value=e[0]:this.value=e,this.before=t,this.after=i}tokens(){return Array.isArray(this.value)?[...this.before,...this.value.flatMap((e=>e.tokens())),...this.after]:[...this.before,...this.value.tokens(),...this.after]}toString(){return Array.isArray(this.value)?d(...this.before)+this.value.map((e=>e.toString())).join("")+d(...this.after):d(...this.before)+this.value.toString()+d(...this.after)}indexOf(e){return e===this.value?"value":-1}at(e){return"value"===e?this.value:Array.isArray(this.value)&&"number"==typeof e?(e<0&&(e=this.value.length+e),this.value[e]):void 0}walk(t,i){if(Array.isArray(this.value)){if(0===this.value.length)return;const a=e(this.value);let n=0;for(;ne.toJSON())),tokens:this.tokens()}:{type:this.type,value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureValue(){return MediaFeatureValue.isMediaFeatureValue(this)}static isMediaFeatureValue(e){return!!e&&(e instanceof MediaFeatureValue&&e.type===c.MediaFeatureValue)}}function parseMediaFeatureValue(e,i=!1){let a=-1,n=-1;for(let r=0;re.tokens())),e.slice(n+1).flatMap((e=>e.tokens())))}function matchesRatioExactly(e){let t=-1,i=-1;const a=matchesRatio(e);if(-1===a)return-1;t=a[0],i=a[1];for(let t=i+1;t2)return!1;if(e[0][0]!==l.Delim)return!1;if(1===e.length)switch(e[0][4].value){case g.EQ:return g.EQ;case y.LT:return y.LT;case v.GT:return v.GT;default:return!1}if(e[1][0]!==l.Delim)return!1;if(e[1][4].value!==g.EQ)return!1;switch(e[0][4].value){case y.LT:return y.LT_OR_EQ;case v.GT:return v.GT_OR_EQ;default:return!1}}function invertComparison(e){switch(e){case g.EQ:return g.EQ;case y.LT:return v.GT;case y.LT_OR_EQ:return v.GT_OR_EQ;case v.GT:return y.LT;case v.GT_OR_EQ:return y.LT_OR_EQ;default:return!1}}!function(e){e.LT="<",e.LT_OR_EQ="<="}(y||(y={})),function(e){e.GT=">",e.GT_OR_EQ=">="}(v||(v={})),function(e){e.EQ="="}(g||(g={}));class MediaFeatureRangeNameValue{type=c.MediaFeatureRangeNameValue;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.name.tokens(),...this.operator,...this.value.tokens()]}toString(){return this.name.toString()+d(...this.operator)+this.value.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeNameValue(){return MediaFeatureRangeNameValue.isMediaFeatureRangeNameValue(this)}static isMediaFeatureRangeNameValue(e){return!!e&&(e instanceof MediaFeatureRangeNameValue&&e.type===c.MediaFeatureRangeNameValue)}}class MediaFeatureRangeValueName{type=c.MediaFeatureRangeValueName;name;operator;value;constructor(e,t,i){this.name=e,this.operator=t,this.value=i}operatorKind(){return comparisonFromTokens(this.operator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.value.tokens(),...this.operator,...this.name.tokens()]}toString(){return this.value.toString()+d(...this.operator)+this.name.toString()}indexOf(e){return e===this.name?"name":e===this.value?"value":-1}at(e){return"name"===e?this.name:"value"===e?this.value:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.value,parent:this,state:i},"value")&&("walk"in this.value?this.value.walk(e,i):void 0)}toJSON(){return{type:this.type,name:this.name.toJSON(),value:this.value.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueName(){return MediaFeatureRangeValueName.isMediaFeatureRangeValueName(this)}static isMediaFeatureRangeValueName(e){return!!e&&(e instanceof MediaFeatureRangeValueName&&e.type===c.MediaFeatureRangeValueName)}}class MediaFeatureRangeValueNameValue{type=c.MediaFeatureRangeValueNameValue;name;valueOne;valueOneOperator;valueTwo;valueTwoOperator;constructor(e,t,i,a,n){this.name=e,this.valueOne=t,this.valueOneOperator=i,this.valueTwo=a,this.valueTwoOperator=n}valueOneOperatorKind(){return comparisonFromTokens(this.valueOneOperator)}valueTwoOperatorKind(){return comparisonFromTokens(this.valueTwoOperator)}getName(){return this.name.getName()}getNameToken(){return this.name.getNameToken()}tokens(){return[...this.valueOne.tokens(),...this.valueOneOperator,...this.name.tokens(),...this.valueTwoOperator,...this.valueTwo.tokens()]}toString(){return this.valueOne.toString()+d(...this.valueOneOperator)+this.name.toString()+d(...this.valueTwoOperator)+this.valueTwo.toString()}indexOf(e){return e===this.name?"name":e===this.valueOne?"valueOne":e===this.valueTwo?"valueTwo":-1}at(e){return"name"===e?this.name:"valueOne"===e?this.valueOne:"valueTwo"===e?this.valueTwo:void 0}walk(e,t){let i;return t&&(i={...t}),!1!==e({node:this.valueOne,parent:this,state:i},"valueOne")&&((!("walk"in this.valueOne)||!1!==this.valueOne.walk(e,i))&&(t&&(i={...t}),!1!==e({node:this.valueTwo,parent:this,state:i},"valueTwo")&&((!("walk"in this.valueTwo)||!1!==this.valueTwo.walk(e,i))&&void 0)))}toJSON(){return{type:this.type,name:this.name.toJSON(),valueOne:this.valueOne.toJSON(),valueTwo:this.valueTwo.toJSON(),tokens:this.tokens()}}isMediaFeatureRangeValueNameValue(){return MediaFeatureRangeValueNameValue.isMediaFeatureRangeValueNameValue(this)}static isMediaFeatureRangeValueNameValue(e){return!!e&&(e instanceof MediaFeatureRangeValueNameValue&&e.type===c.MediaFeatureRangeValueNameValue)}}function parseMediaFeatureRange(e){let i=!1,a=!1;for(let n=0;ne.tokens())),-1!==i&&(u=e.slice(t+1,i+1).flatMap((e=>e.tokens())))):-1!==i&&(u=e.slice(0,i+1).flatMap((e=>e.tokens())));const d=parseMediaConditionWithoutOr(e.slice(Math.max(t,i,a)+1));return!1===d?new MediaQueryWithType(o,[...u,...e.slice(i+1).flatMap((e=>e.tokens()))]):new MediaQueryWithType(o,u,e.slice(i+1,a+1).flatMap((e=>e.tokens())),d)}}function parseMediaConditionListWithOr(e){let i=!1;const a=[];let n=-1,r=-1;for(let s=0;se.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaConditionListWithAnd(e){let i=!1;const a=[];let n=-1,r=-1;for(let s=0;se.tokens())),e.slice(r+1).flatMap((e=>e.tokens())))}function parseMediaCondition(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaConditionListWithOr(e);if(!1!==a)return new MediaCondition(a);const n=parseMediaInParens(e);return!1!==n&&new MediaCondition(n)}function parseMediaConditionWithoutOr(e){const t=parseMediaNot(e);if(!1!==t)return new MediaCondition(t);const i=parseMediaConditionListWithAnd(e);if(!1!==i)return new MediaCondition(i);const a=parseMediaInParens(e);return!1!==a&&new MediaCondition(a)}function parseMediaInParens(e){let i=-1;for(let a=0;ae.tokens())),a.startToken],r=[a.endToken,...e.slice(i+1).flatMap((e=>e.tokens()))],s=parseMediaFeature(a,n,r);if(!1!==s)return new MediaInParens(s);const u=parseMediaCondition(a.value);return!1!==u?new MediaInParens(u,n,r):new MediaInParens(new GeneralEnclosed(a),e.slice(0,i).flatMap((e=>e.tokens())),e.slice(i+1).flatMap((e=>e.tokens())))}function parseMediaInParensFromSimpleBlock(e){if(e.startToken[0]!==l.OpenParen)return!1;const t=parseMediaFeature(e,[e.startToken],[e.endToken]);if(!1!==t)return new MediaInParens(t);const i=parseMediaCondition(e.value);return!1!==i?new MediaInParens(i,[e.startToken],[e.endToken]):new MediaInParens(new GeneralEnclosed(e))}function parseMediaNot(e){let i=!1,a=null;for(let n=0;ne.tokens())),t)}}}return a||!1}function parseMediaOr(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseMediaAnd(e){let i=!1;for(let a=0;ae.tokens())),t)}}return!1}}return!1}function parseFromTokens(e,t){const i=u(e,{onParseError:t?.onParseError});return i.map(((e,a)=>{const n=parseMediaQuery(e);return 0==n&&!0===t?.preserveInvalidMediaQueries?new MediaQueryInvalid(i[a]):n})).filter((e=>!!e))}function parse(e,t){const i=m({css:e},{onParseError:t?.onParseError}),a=[];for(;!i.endOfFile();)a.push(i.nextToken());return a.push(i.nextToken()),parseFromTokens(a,t)}!function(e){e.Not="not",e.Only="only"}(k||(k={}));class CustomMedia{type=c.CustomMedia;name;mediaQueryList=null;trueOrFalseKeyword=null;constructor(e,t,i){this.name=e,this.mediaQueryList=t,this.trueOrFalseKeyword=i??null}getName(){for(let e=0;ee.toJSON()))}}isCustomMedia(){return CustomMedia.isCustomMedia(this)}static isCustomMedia(e){return!!e&&(e instanceof CustomMedia&&e.type===c.CustomMedia)}}function parseCustomMediaFromTokens(e,t){let i=[],a=e;for(let t=0;t; - mediaQueryList: Array | null; - trueOrFalseKeyword: Array | null; - constructor(name: Array, mediaQueryList: Array | null, trueOrFalseKeyword?: Array); - getName(): string; - getNameToken(): CSSToken | null; - hasMediaQueryList(): boolean; - hasTrueKeyword(): boolean; - hasFalseKeyword(): boolean; - tokens(): Array; - toString(): string; - toJSON(): { - type: NodeType; - string: string; - nameValue: string; - name: CSSToken[]; - hasFalseKeyword: boolean; - hasTrueKeyword: boolean; - trueOrFalseKeyword: CSSToken[] | null; - mediaQueryList: ({ - type: NodeType; - string: string; - modifier: CSSToken[]; - mediaType: CSSToken[]; - and: CSSToken[] | undefined; - media: import("./media-condition").MediaCondition | undefined; - } | { - type: NodeType; - string: string; - media: import("./media-condition").MediaCondition; - } | { - type: NodeType; - string: string; - media: import("@csstools/css-parser-algorithms").ComponentValue[]; - })[] | undefined; - }; - isCustomMedia(): this is CustomMedia; - static isCustomMedia(x: unknown): x is CustomMedia; -} diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts deleted file mode 100644 index 5ab840f5..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/general-enclosed.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -export declare class GeneralEnclosed { - type: NodeType; - value: ComponentValue; - constructor(value: ComponentValue); - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | undefined; - walk>(cb: (entry: { - node: GeneralEnclosedWalkerEntry; - parent: GeneralEnclosedWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - tokens: CSSToken[]; - }; - isGeneralEnclosed(): this is GeneralEnclosed; - static isGeneralEnclosed(x: unknown): x is GeneralEnclosed; -} -export type GeneralEnclosedWalkerEntry = ComponentValue; -export type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts deleted file mode 100644 index ddd73d53..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-and.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; -import { NodeType } from '../util/node-type'; -export declare class MediaAnd { - type: NodeType; - modifier: Array; - media: MediaInParens; - constructor(modifier: Array, media: MediaInParens); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens): number | string; - at(index: number | string): MediaInParens | null; - walk>(cb: (entry: { - node: MediaAndWalkerEntry; - parent: MediaAndWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isMediaAnd(): this is MediaAnd; - static isMediaAnd(x: unknown): x is MediaAnd; -} -export type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; -export type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts deleted file mode 100644 index ddc51062..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition-list.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaAnd, MediaAndWalkerEntry, MediaAndWalkerParent } from './media-and'; -import { MediaInParens } from './media-in-parens'; -import { MediaOr, MediaOrWalkerEntry, MediaOrWalkerParent } from './media-or'; -import { NodeType } from '../util/node-type'; -export type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; -export declare class MediaConditionListWithAnd { - type: NodeType; - leading: MediaInParens; - list: Array; - before: Array; - after: Array; - constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens | MediaAnd): number | string; - at(index: number | string): MediaInParens | MediaAnd | undefined; - walk>(cb: (entry: { - node: MediaConditionListWithAndWalkerEntry; - parent: MediaConditionListWithAndWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isMediaConditionListWithAnd(): this is MediaConditionListWithAnd; - static isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; -} -export type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; -export type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; -export declare class MediaConditionListWithOr { - type: NodeType; - leading: MediaInParens; - list: Array; - before: Array; - after: Array; - constructor(leading: MediaInParens, list: Array, before?: Array, after?: Array); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens | MediaOr): number | string; - at(index: number | string): MediaInParens | MediaOr | undefined; - walk>(cb: (entry: { - node: MediaConditionListWithOrWalkerEntry; - parent: MediaConditionListWithOrWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isMediaConditionListWithOr(): this is MediaConditionListWithOr; - static isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; -} -export type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; -export type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts deleted file mode 100644 index faf2b49d..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-condition.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaConditionListWithAnd, MediaConditionListWithAndWalkerEntry, MediaConditionListWithAndWalkerParent, MediaConditionListWithOr, MediaConditionListWithOrWalkerEntry, MediaConditionListWithOrWalkerParent } from './media-condition-list'; -import { MediaInParens } from './media-in-parens'; -import { MediaNot, MediaNotWalkerEntry, MediaNotWalkerParent } from './media-not'; -import { NodeType } from '../util/node-type'; -export declare class MediaCondition { - type: NodeType; - media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr; - constructor(media: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr); - tokens(): Array; - toString(): string; - indexOf(item: MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr): number | string; - at(index: number | string): MediaNot | MediaInParens | MediaConditionListWithAnd | MediaConditionListWithOr | undefined; - walk>(cb: (entry: { - node: MediaConditionWalkerEntry; - parent: MediaConditionWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): unknown; - isMediaCondition(): this is MediaCondition; - static isMediaCondition(x: unknown): x is MediaCondition; -} -export type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; -export type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts deleted file mode 100644 index a5c64ec1..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { MediaFeatureName } from './media-feature-name'; -import { NodeType } from '../util/node-type'; -import { CSSToken } from '@csstools/css-tokenizer'; -export declare class MediaFeatureBoolean { - type: NodeType; - name: MediaFeatureName; - constructor(name: MediaFeatureName); - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName): number | string; - at(index: number | string): MediaFeatureName | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeatureBoolean(): this is MediaFeatureBoolean; - static isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; -} -export declare function parseMediaFeatureBoolean(componentValues: Array): false | MediaFeatureBoolean; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts deleted file mode 100644 index 37769657..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { TokenDelim } from '@csstools/css-tokenizer'; -export declare enum MediaFeatureLT { - LT = "<", - LT_OR_EQ = "<=" -} -export declare enum MediaFeatureGT { - GT = ">", - GT_OR_EQ = ">=" -} -export declare enum MediaFeatureEQ { - EQ = "=" -} -export type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; -export declare function matchesComparison(componentValues: Array): false | [number, number]; -export declare function comparisonFromTokens(tokens: [TokenDelim, TokenDelim] | [TokenDelim]): MediaFeatureComparison | false; -export declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts deleted file mode 100644 index 332b421a..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-name.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -export declare class MediaFeatureName { - type: NodeType; - name: ComponentValue; - before: Array; - after: Array; - constructor(name: ComponentValue, before?: Array, after?: Array); - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | undefined; - toJSON(): { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - isMediaFeatureName(): this is MediaFeatureName; - static isMediaFeatureName(x: unknown): x is MediaFeatureName; -} -export declare function parseMediaFeatureName(componentValues: Array): MediaFeatureName | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts deleted file mode 100644 index 32f22c40..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-plain.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { CSSToken, TokenColon } from '@csstools/css-tokenizer'; -import { MediaFeatureName } from './media-feature-name'; -import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value'; -import { NodeType } from '../util/node-type'; -export declare class MediaFeaturePlain { - type: NodeType; - name: MediaFeatureName; - colon: TokenColon; - value: MediaFeatureValue; - constructor(name: MediaFeatureName, colon: TokenColon, value: MediaFeatureValue); - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; - at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; - walk>(cb: (entry: { - node: MediaFeaturePlainWalkerEntry; - parent: MediaFeaturePlainWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - value: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeaturePlain(): this is MediaFeaturePlain; - static isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; -} -export type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; -export type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; -export declare function parseMediaFeaturePlain(componentValues: Array): MediaFeaturePlain | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts deleted file mode 100644 index afe322ae..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-range.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { CSSToken, TokenDelim } from '@csstools/css-tokenizer'; -import { MediaFeatureComparison } from './media-feature-comparison'; -import { MediaFeatureName } from './media-feature-name'; -import { MediaFeatureValue, MediaFeatureValueWalkerEntry, MediaFeatureValueWalkerParent } from './media-feature-value'; -import { NodeType } from '../util/node-type'; -export type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; -export declare class MediaFeatureRangeNameValue { - type: NodeType; - name: MediaFeatureName; - operator: [TokenDelim, TokenDelim] | [TokenDelim]; - value: MediaFeatureValue; - constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); - operatorKind(): MediaFeatureComparison | false; - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; - at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; - walk>(cb: (entry: { - node: MediaFeatureRangeWalkerEntry; - parent: MediaFeatureRangeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - value: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeatureRangeNameValue(): this is MediaFeatureRangeNameValue; - static isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; -} -export declare class MediaFeatureRangeValueName { - type: NodeType; - name: MediaFeatureName; - operator: [TokenDelim, TokenDelim] | [TokenDelim]; - value: MediaFeatureValue; - constructor(name: MediaFeatureName, operator: [TokenDelim, TokenDelim] | [TokenDelim], value: MediaFeatureValue); - operatorKind(): MediaFeatureComparison | false; - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; - at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; - walk>(cb: (entry: { - node: MediaFeatureRangeWalkerEntry; - parent: MediaFeatureRangeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - value: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeatureRangeValueName(): this is MediaFeatureRangeValueName; - static isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; -} -export declare class MediaFeatureRangeValueNameValue { - type: NodeType; - name: MediaFeatureName; - valueOne: MediaFeatureValue; - valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim]; - valueTwo: MediaFeatureValue; - valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]; - constructor(name: MediaFeatureName, valueOne: MediaFeatureValue, valueOneOperator: [TokenDelim, TokenDelim] | [TokenDelim], valueTwo: MediaFeatureValue, valueTwoOperator: [TokenDelim, TokenDelim] | [TokenDelim]); - valueOneOperatorKind(): MediaFeatureComparison | false; - valueTwoOperatorKind(): MediaFeatureComparison | false; - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeatureName | MediaFeatureValue): number | string; - at(index: number | string): MediaFeatureName | MediaFeatureValue | undefined; - walk>(cb: (entry: { - node: MediaFeatureRangeWalkerEntry; - parent: MediaFeatureRangeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - valueOne: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - valueTwo: { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - isMediaFeatureRangeValueNameValue(): this is MediaFeatureRangeValueNameValue; - static isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; -} -export type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; -export type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; -export declare function parseMediaFeatureRange(componentValues: Array): MediaFeatureRange | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts deleted file mode 100644 index dda072bb..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature-value.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -export declare class MediaFeatureValue { - type: NodeType; - value: ComponentValue | Array; - before: Array; - after: Array; - constructor(value: ComponentValue | Array, before?: Array, after?: Array); - tokens(): Array; - toString(): string; - indexOf(item: ComponentValue): number | string; - at(index: number | string): ComponentValue | Array | undefined; - walk>(cb: (entry: { - node: MediaFeatureValueWalkerEntry; - parent: MediaFeatureValueWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - value: unknown; - tokens: CSSToken[]; - }; - isMediaFeatureValue(): this is MediaFeatureValue; - static isMediaFeatureValue(x: unknown): x is MediaFeatureValue; -} -export type MediaFeatureValueWalkerEntry = ComponentValue; -export type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; -export declare function parseMediaFeatureValue(componentValues: Array, inRangeContext?: boolean): MediaFeatureValue | false; -export declare function matchesRatioExactly(componentValues: Array): number[] | -1; -export declare function matchesRatio(componentValues: Array): number[] | -1; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts deleted file mode 100644 index bf9c0384..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-feature.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { SimpleBlockNode } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaFeatureBoolean } from './media-feature-boolean'; -import { MediaFeaturePlain, MediaFeaturePlainWalkerEntry, MediaFeaturePlainWalkerParent } from './media-feature-plain'; -import { MediaFeatureRange, MediaFeatureRangeWalkerEntry, MediaFeatureRangeWalkerParent } from './media-feature-range'; -import { NodeType } from '../util/node-type'; -export declare class MediaFeature { - type: NodeType; - feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; - before: Array; - after: Array; - constructor(feature: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange, before?: Array, after?: Array); - getName(): string; - getNameToken(): CSSToken; - tokens(): Array; - toString(): string; - indexOf(item: MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange): number | string; - at(index: number | string): MediaFeatureBoolean | MediaFeaturePlain | MediaFeatureRange | undefined; - walk>(cb: (entry: { - node: MediaFeatureWalkerEntry; - parent: MediaFeatureWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - feature: { - type: NodeType; - name: { - type: NodeType; - name: string; - tokens: CSSToken[]; - }; - tokens: CSSToken[]; - }; - before: CSSToken[]; - after: CSSToken[]; - }; - isMediaFeature(): this is MediaFeature; - static isMediaFeature(x: unknown): x is MediaFeature; -} -export type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; -export type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; -export declare function parseMediaFeature(simpleBlock: SimpleBlockNode, before?: Array, after?: Array): false | MediaFeature; -export declare function newMediaFeatureBoolean(name: string): MediaFeature; -export declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts deleted file mode 100644 index 904a0725..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-in-parens.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { ComponentValue, ContainerNode } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { GeneralEnclosed } from './general-enclosed'; -import { MediaAnd } from './media-and'; -import { MediaCondition } from './media-condition'; -import { MediaConditionList } from './media-condition-list'; -import { MediaFeature } from './media-feature'; -import { MediaFeatureBoolean } from './media-feature-boolean'; -import { MediaFeatureName } from './media-feature-name'; -import { MediaFeaturePlain } from './media-feature-plain'; -import { MediaFeatureRange } from './media-feature-range'; -import { MediaFeatureValue } from './media-feature-value'; -import { NodeType } from '../util/node-type'; -import { MediaNot } from './media-not'; -import { MediaOr } from './media-or'; -export declare class MediaInParens { - type: NodeType; - media: MediaCondition | MediaFeature | GeneralEnclosed; - before: Array; - after: Array; - constructor(media: MediaCondition | MediaFeature | GeneralEnclosed, before?: Array, after?: Array); - tokens(): Array; - toString(): string; - indexOf(item: MediaCondition | MediaFeature | GeneralEnclosed): number | string; - at(index: number | string): MediaCondition | MediaFeature | GeneralEnclosed | undefined; - walk>(cb: (entry: { - node: MediaInParensWalkerEntry; - parent: MediaInParensWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - media: unknown; - before: CSSToken[]; - after: CSSToken[]; - }; - isMediaInParens(): this is MediaInParens; - static isMediaInParens(x: unknown): x is MediaInParens; -} -export type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; -export type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts deleted file mode 100644 index 2bedcaa3..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-not.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; -import { NodeType } from '../util/node-type'; -export declare class MediaNot { - type: NodeType; - modifier: Array; - media: MediaInParens; - constructor(modifier: Array, media: MediaInParens); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens): number | string; - at(index: number | string): MediaInParens | undefined; - walk>(cb: (entry: { - node: MediaNotWalkerEntry; - parent: MediaNotWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - modifier: CSSToken[]; - media: { - type: NodeType; - media: unknown; - before: CSSToken[]; - after: CSSToken[]; - }; - }; - isMediaNot(): this is MediaNot; - static isMediaNot(x: unknown): x is MediaNot; -} -export type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; -export type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts deleted file mode 100644 index 4459412d..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-or.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { MediaInParens, MediaInParensWalkerEntry, MediaInParensWalkerParent } from './media-in-parens'; -import { NodeType } from '../util/node-type'; -export declare class MediaOr { - type: NodeType; - modifier: Array; - media: MediaInParens; - constructor(modifier: Array, media: MediaInParens); - tokens(): Array; - toString(): string; - indexOf(item: MediaInParens): number | string; - at(index: number | string): MediaInParens | undefined; - walk>(cb: (entry: { - node: MediaOrWalkerEntry; - parent: MediaOrWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - modifier: CSSToken[]; - media: { - type: NodeType; - media: unknown; - before: CSSToken[]; - after: CSSToken[]; - }; - }; - isMediaOr(): this is MediaOr; - static isMediaOr(x: unknown): x is MediaOr; -} -export type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; -export type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts deleted file mode 100644 index df9733cb..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query-modifier.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { TokenIdent } from '@csstools/css-tokenizer'; -export declare enum MediaQueryModifier { - Not = "not", - Only = "only" -} -export declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts deleted file mode 100644 index aa77dee0..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-query.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -import { MediaCondition, MediaConditionWalkerEntry, MediaConditionWalkerParent } from './media-condition'; -export type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; -export declare class MediaQueryWithType { - type: NodeType; - modifier: Array; - mediaType: Array; - and: Array | undefined; - media: MediaCondition | undefined; - constructor(modifier: Array, mediaType: Array, and?: Array | undefined, media?: MediaCondition | undefined); - getModifier(): string; - negateQuery(): MediaQuery; - getMediaType(): string; - tokens(): Array; - toString(): string; - indexOf(item: MediaCondition): number | string; - at(index: number | string): MediaCondition | undefined; - walk>(cb: (entry: { - node: MediaQueryWithTypeWalkerEntry; - parent: MediaQueryWithTypeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - string: string; - modifier: CSSToken[]; - mediaType: CSSToken[]; - and: CSSToken[] | undefined; - media: MediaCondition | undefined; - }; - isMediaQueryWithType(): this is MediaQueryWithType; - static isMediaQueryWithType(x: unknown): x is MediaQueryWithType; -} -export type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; -export type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; -export declare class MediaQueryWithoutType { - type: NodeType; - media: MediaCondition; - constructor(media: MediaCondition); - negateQuery(): MediaQuery; - tokens(): Array; - toString(): string; - indexOf(item: MediaCondition): number | string; - at(index: number | string): MediaCondition | undefined; - walk>(cb: (entry: { - node: MediaQueryWithoutTypeWalkerEntry; - parent: MediaQueryWithoutTypeWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - string: string; - media: MediaCondition; - }; - isMediaQueryWithoutType(): this is MediaQueryWithoutType; - static isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; -} -export type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; -export type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; -export declare class MediaQueryInvalid { - type: NodeType; - media: Array; - constructor(media: Array); - negateQuery(): MediaQuery; - tokens(): Array; - toString(): string; - walk>(cb: (entry: { - node: MediaQueryInvalidWalkerEntry; - parent: MediaQueryInvalidWalkerParent; - state?: T; - }, index: number | string) => boolean | void, state?: T): false | undefined; - toJSON(): { - type: NodeType; - string: string; - media: ComponentValue[]; - }; - isMediaQueryInvalid(): this is MediaQueryInvalid; - static isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; -} -export type MediaQueryInvalidWalkerEntry = ComponentValue; -export type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; diff --git a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts b/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts deleted file mode 100644 index b7924b76..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/nodes/media-type.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { TokenIdent } from '@csstools/css-tokenizer'; -export declare enum MediaType { - /** Always matches */ - All = "all", - Print = "print", - Screen = "screen", - /** Never matches */ - Tty = "tty", - /** Never matches */ - Tv = "tv", - /** Never matches */ - Projection = "projection", - /** Never matches */ - Handheld = "handheld", - /** Never matches */ - Braille = "braille", - /** Never matches */ - Embossed = "embossed", - /** Never matches */ - Aural = "aural", - /** Never matches */ - Speech = "speech" -} -export declare function typeFromToken(token: TokenIdent): MediaType | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts deleted file mode 100644 index 1be3d0f3..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-custom-media.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { CustomMedia } from '../nodes/custom-media'; -export type Options = { - preserveInvalidMediaQueries?: boolean; - onParseError?: (error: ParseError) => void; -}; -export declare function parseCustomMediaFromTokens(tokens: Array, options?: Options): CustomMedia | false; -export declare function parseCustomMedia(source: string, options?: Options): CustomMedia | false; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts deleted file mode 100644 index 3801d178..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/parser/parse-media-query.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { ComponentValue, SimpleBlockNode } from '@csstools/css-parser-algorithms'; -import { MediaAnd } from '../nodes/media-and'; -import { MediaCondition } from '../nodes/media-condition'; -import { MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list'; -import { MediaInParens } from '../nodes/media-in-parens'; -import { MediaNot } from '../nodes/media-not'; -import { MediaOr } from '../nodes/media-or'; -import { MediaQuery } from '../nodes/media-query'; -export declare function parseMediaQuery(componentValues: Array): MediaQuery | false; -export declare function parseMediaConditionListWithOr(componentValues: Array): MediaConditionListWithOr | false; -export declare function parseMediaConditionListWithAnd(componentValues: Array): MediaConditionListWithAnd | false; -export declare function parseMediaCondition(componentValues: Array): MediaCondition | false; -export declare function parseMediaConditionWithoutOr(componentValues: Array): MediaCondition | false; -export declare function parseMediaInParens(componentValues: Array): MediaInParens | false; -export declare function parseMediaInParensFromSimpleBlock(simpleBlock: SimpleBlockNode): MediaInParens | false; -export declare function parseMediaNot(componentValues: Array): MediaNot | false; -export declare function parseMediaOr(componentValues: Array): false | { - advance: number; - node: MediaOr; -}; -export declare function parseMediaAnd(componentValues: Array): false | { - advance: number; - node: MediaAnd; -}; diff --git a/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts b/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts deleted file mode 100644 index a09339bd..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/parser/parse.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { MediaQuery } from '../nodes/media-query'; -export type Options = { - preserveInvalidMediaQueries?: boolean; - onParseError?: (error: ParseError) => void; -}; -export declare function parseFromTokens(tokens: Array, options?: Options): MediaQuery[]; -export declare function parse(source: string, options?: Options): MediaQuery[]; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts deleted file mode 100644 index e0702c23..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/clone-media-query.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query'; -export declare function cloneMediaQuery(x: T): T; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts deleted file mode 100644 index f0763807..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/component-value-is.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -export declare function isNumber(componentValue: ComponentValue): boolean; -export declare function isDimension(componentValue: ComponentValue): boolean; -export declare function isIdent(componentValue: ComponentValue): boolean; -export declare function isEnvironmentVariable(componentValue: ComponentValue): boolean; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts deleted file mode 100644 index 935e6eb5..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/node-type.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export declare enum NodeType { - CustomMedia = "custom-media", - GeneralEnclosed = "general-enclosed", - MediaAnd = "media-and", - MediaCondition = "media-condition", - MediaConditionListWithAnd = "media-condition-list-and", - MediaConditionListWithOr = "media-condition-list-or", - MediaFeature = "media-feature", - MediaFeatureBoolean = "mf-boolean", - MediaFeatureName = "mf-name", - MediaFeaturePlain = "mf-plain", - MediaFeatureRangeNameValue = "mf-range-name-value", - MediaFeatureRangeValueName = "mf-range-value-name", - MediaFeatureRangeValueNameValue = "mf-range-value-name-value", - MediaFeatureValue = "mf-value", - MediaInParens = "media-in-parens", - MediaNot = "media-not", - MediaOr = "media-or", - MediaQueryWithType = "media-query-with-type", - MediaQueryWithoutType = "media-query-without-type", - MediaQueryInvalid = "media-query-invalid" -} diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts b/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts deleted file mode 100644 index 2313f29b..00000000 --- a/node_modules/@csstools/media-query-list-parser/dist/util/type-predicates.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { GeneralEnclosed } from '../nodes/general-enclosed'; -import { MediaAnd } from '../nodes/media-and'; -import { MediaCondition } from '../nodes/media-condition'; -import { MediaConditionList, MediaConditionListWithAnd, MediaConditionListWithOr } from '../nodes/media-condition-list'; -import { MediaFeature } from '../nodes/media-feature'; -import { MediaFeatureBoolean } from '../nodes/media-feature-boolean'; -import { MediaFeatureName } from '../nodes/media-feature-name'; -import { MediaFeaturePlain } from '../nodes/media-feature-plain'; -import { MediaFeatureRange, MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue } from '../nodes/media-feature-range'; -import { MediaFeatureValue } from '../nodes/media-feature-value'; -import { MediaInParens } from '../nodes/media-in-parens'; -import { MediaNot } from '../nodes/media-not'; -import { MediaOr } from '../nodes/media-or'; -import { MediaQuery, MediaQueryInvalid, MediaQueryWithoutType, MediaQueryWithType } from '../nodes/media-query'; -export declare function isCustomMedia(x: unknown): x is GeneralEnclosed; -export declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; -export declare function isMediaAnd(x: unknown): x is MediaAnd; -export declare function isMediaConditionList(x: unknown): x is MediaConditionList; -export declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; -export declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; -export declare function isMediaCondition(x: unknown): x is MediaCondition; -export declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; -export declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; -export declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; -export declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; -export declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; -export declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; -export declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; -export declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; -export declare function isMediaFeature(x: unknown): x is MediaFeature; -export declare function isMediaInParens(x: unknown): x is MediaInParens; -export declare function isMediaNot(x: unknown): x is MediaNot; -export declare function isMediaOr(x: unknown): x is MediaOr; -export declare function isMediaQuery(x: unknown): x is MediaQuery; -export declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; -export declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; -export declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; diff --git a/node_modules/@csstools/media-query-list-parser/package.json b/node_modules/@csstools/media-query-list-parser/package.json index d9037c74..c8d05288 100644 --- a/node_modules/@csstools/media-query-list-parser/package.json +++ b/node_modules/@csstools/media-query-list-parser/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/media-query-list-parser", "description": "Parse CSS media query lists.", - "version": "2.1.5", + "version": "2.1.6", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,16 +48,8 @@ "dist" ], "peerDependencies": { - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/test.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node ./test/test.mjs" + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser#readme", "repository": { @@ -67,8 +62,5 @@ "css", "media query", "parser" - ], - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md b/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md index ebe49f70..9cb80ecb 100644 --- a/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md +++ b/node_modules/@csstools/postcss-cascade-layers/CHANGELOG.md @@ -1,87 +1,23 @@ # Changes to PostCSS Cascade Layers -### 4.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/selector-specificity`](/packages/selector-specificity) to [`3.0.0`](/packages/selector-specificity/CHANGELOG.md#300) (major) - -### 3.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 3.0.0 - -_January 24, 2023_ - -- Run `postcss-cascade-layers` late compared to other PostCSS plugins (breaking) - -_This will be the last time we change this after several times back and forth. -We are sticking with this configuration now._ - -### 2.0.0 - -_November 14, 2022_ - -- Run `postcss-cascade-layers` early compared to other PostCSS plugins (breaking) -- Updated: Support for Node v14+ (major). -- Fix: Do not throw when a selector is invalid, show a warning instead. - -### 1.1.1 - -_September 17, 2022_ - -- Fix pre-defined layer order in nested `@layer` rules. +### 4.0.2 -### 1.1.0 +_December 15, 2023_ -_September 14, 2022_ +- Fix type definitions +- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#301) (patch) -- Add support for `@scope` and `@container` as parent rules for `@layer` +### 4.0.1 -### 1.0.6 +_October 31, 2023_ -_September 7, 2022_ +- Improve performance -- Fix broken `@keyframes` in `@layer`. - -### 1.0.5 - -_July 8, 2022_ - -- Fix case insensitive `@layer` matching (`@LaYeR`). -- Updated `@csstools/selector-specificity` to `2.0.2` (patch) - -### 1.0.4 - -_June 23, 2022_ - -- Fix selector order with any pseudo element. This plugin will no longer re-order selectors. - -### 1.0.3 - -_June 4, 2022_ - -- Update `@csstools/selector-specificity` (major) - -### 1.0.2 - -_May 20, 2022_ - -- Use only simple `:not(#\#)` selectors to adjust specificity. - -### 1.0.1 - -_May 17, 2022_ - -- Process CSS after most other plugins to ensure correct analysis and transformation of sugary CSS. -- Fix selector order with `:before` and other pseudo elements. +### 4.0.0 -### 1.0.0 +_July 3, 2023_ -_May 12, 2022_ +- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) +- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#300) (major) -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-cascade-layers/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-cascade-layers/README.md b/node_modules/@csstools/postcss-cascade-layers/README.md index 0bbceb7c..af14b6c8 100644 --- a/node_modules/@csstools/postcss-cascade-layers/README.md +++ b/node_modules/@csstools/postcss-cascade-layers/README.md @@ -2,6 +2,10 @@ [npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] +```bash +npm install @csstools/postcss-cascade-layers --save-dev +``` + [PostCSS Cascade Layers] lets you use `@layer` following the [Cascade Layers Specification]. For more information on layers, checkout [A Complete Guide to CSS Cascade Layers] by Miriam Suzanne. ```pcss @@ -81,8 +85,9 @@ And layers have enough room internally so that each selector works and overrides More layers with more specificity will cause longer `:not(...)` selectors to be generated. -⚠️ For this to work the plugin needs to analyze your entire stylesheet at once.
-If you have different assets that are unaware of each other it will not work correctly as the analysis will be incorrect. +> [!IMPORTANT] +> [PostCSS Cascade Layers] assumes to process your complete CSS bundle.
If your build tool processes files individually or processes files in parallel the output will be incorrect.
Using [`@csstools/postcss-bundler`](https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-bundler) and `@import` statements is one way to make sure your CSS is bundled before it is processed by this plugin. + ## Usage diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts deleted file mode 100644 index af7b5e19..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function adjustSelectorSpecificity(selector: string, amount: number): string; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/clean-blocks.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/clean-blocks.d.ts deleted file mode 100644 index b9f2a564..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/clean-blocks.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Container } from 'postcss'; -export declare function removeEmptyDescendantBlocks(block: Container | undefined): void; -export declare function removeEmptyAncestorBlocks(block: Container | undefined): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/constants.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/constants.d.ts deleted file mode 100644 index 6a4c9c36..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/constants.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -/** @constant {string} INVALID_LAYER_NAME Used to replace "layer" temporarily when an invalid layer is detected. This allows us to ignore this rule in further processing. */ -export declare const INVALID_LAYER_NAME = "csstools-invalid-layer"; -/** @constant {string} WITH_SELECTORS_LAYER_NAME Used to replace "layer" temporarily for any layer at rules that contain selectors. This allows us to sort these differently from other layer at rules. */ -export declare const WITH_SELECTORS_LAYER_NAME = "csstools-layer-with-selector-rules"; -export declare const ANONYMOUS_LAYER_SUFFIX = "6efdb677-bb05-44e5-840f-29d2175862fd"; -export declare const IMPLICIT_LAYER_SUFFIX = "b147acf6-11a6-4338-a4d0-80aef4cd1a2f"; -export declare const CONDITIONAL_ATRULES: string[]; -export declare const ATRULES_WITH_NON_SELECTOR_BLOCK_LISTS: string[]; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts deleted file mode 100644 index d44fd454..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Container } from 'postcss'; -import type { Model } from './model'; -export declare function desugarAndParseLayerNames(root: Container, model: Model): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/desugar-nested-layers.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/desugar-nested-layers.d.ts deleted file mode 100644 index e15d3bfb..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/desugar-nested-layers.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Container, ChildNode } from 'postcss'; -import type { Model } from './model'; -export declare function desugarNestedLayers(root: Container, model: Model): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts deleted file mode 100644 index 25a6756a..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { AtRule } from 'postcss'; -export declare function getConditionalAtRuleAncestor(layerRule: AtRule): AtRule | null; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts deleted file mode 100644 index b59be340..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { AtRule, Node } from 'postcss'; -export declare function getLayerAtRuleAncestor(node: Node): AtRule | null; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs b/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs index 6788e74a..a679b688 100644 --- a/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs +++ b/node_modules/@csstools/postcss-cascade-layers/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-selector-parser"),r=require("@csstools/selector-specificity");const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if("layer"!==e.name.toLowerCase())return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!i.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){var r;e&&(e.walk((e=>{var r;("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&(0===(null==(r=e.nodes)?void 0:r.length)&&e.remove())})),0===(null==(r=e.nodes)?void 0:r.length)&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{var s,n;if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===(null==(s=a.parent)?void 0:s.type)&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===(null==(n=a.parent)?void 0:n.type)){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),0===r.nodes.length&&r.remove(),0===t.nodes.length&&t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&"layer"===e.name.toLowerCase(),s="atrule"===t.type&&"layer"===t.name.toLowerCase();if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"}))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{var r;if(!e.important)return;const t=e.parent;if(!t)return;if("atrule"===(null==t||null==(r=t.parent)?void 0:r.type)&&l.includes(t.parent.name.toLowerCase()))return;const a=t.clone();a.each((e=>{"decl"===e.type&&e.important||e.remove()})),t.each((e=>{"decl"===e.type&&e.important&&e.remove()})),t.before(a),removeEmptyDescendantBlocks(t)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){s.onRevertLayerKeyword&&a.walkDecls((e=>{"revert-layer"===e.value.toLowerCase()&&e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.')})),s.onImportLayerRule&&a.walkAtRules((e=>{"import"===e.name.toLowerCase()&&e.params.toLowerCase().includes("layer")&&e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule.")})),splitImportantStyles(a);const o=new Model;if(desugarAndParseLayerNames(a,o),recordLayerOrder(a,o,{result:n,options:s}),!o.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let i=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r.selectorSpecificity(e().astSync(a));i=Math.max(i,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e.message}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,o.layerCount*i)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t.message}"`)}return r})))})),o.sortLayerNames(),desugarNestedLayers(a,o),sortRootNodes(a,o),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=o.getLayerParams(r).join(".");let a=(o.layerOrder.get(t)??0)*i;e.some((e=>"decl"===e.type&&e.important))&&(a=o.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&e.replaceWith(e.nodes)}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("postcss-selector-parser"),r=require("@csstools/selector-specificity");const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=/^revert-layer$/i,c=/^import$/i,u=/^layer$/i,y=/layer/i,m=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if(!u.test(e.name))return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!m.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){e&&(e.walk((e=>{("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&0===e.nodes?.length&&e.remove()})),0===e.nodes?.length&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===a.parent?.type&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===a.parent?.type){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),0===r.nodes.length&&r.remove(),0===t.nodes.length&&t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&u.test(e.name),s="atrule"===t.type&&u.test(t.name);if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"}))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{if(!e.important)return;const r=e.parent;if(!r)return;if("atrule"===r?.parent?.type&&l.includes(r.parent.name.toLowerCase()))return;const t=r.clone();t.each((e=>{"decl"===e.type&&e.important||e.remove()})),r.each((e=>{"decl"===e.type&&e.important&&e.remove()})),r.before(t),removeEmptyDescendantBlocks(r)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){let o=!1;if((s.onRevertLayerKeyword||s.onImportLayerRule)&&a.walk((e=>"decl"===e.type?i.test(e.value)?void e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.'):void 0:"atrule"===e.type?c.test(e.name)&&y.test(e.params)?void e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule."):u.test(e.name)?void(o=!0):void 0:void 0)),!o)return;splitImportantStyles(a);const m=new Model;if(desugarAndParseLayerNames(a,m),recordLayerOrder(a,m,{result:n,options:s}),!m.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let p=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r.selectorSpecificity(e().astSync(a));p=Math.max(p,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e instanceof Error?e.message:e}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,m.layerCount*p)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t instanceof Error?t.message:t}"`)}return r})))})),m.sortLayerNames(),desugarNestedLayers(a,m),sortRootNodes(a,m),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=m.getLayerParams(r).join(".");let a=(m.layerOrder.get(t)??0)*p;e.some((e=>"decl"===e.type&&e.important))&&(a=m.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&e.replaceWith(e.nodes)}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/index.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/index.d.ts index 9f366fbb..da46b302 100644 --- a/node_modules/@csstools/postcss-cascade-layers/dist/index.d.ts +++ b/node_modules/@csstools/postcss-cascade-layers/dist/index.d.ts @@ -1,5 +1,16 @@ import type { PluginCreator } from 'postcss'; -import type { pluginOptions } from './options'; -export type { pluginOptions } from './options'; + declare const creator: PluginCreator; export default creator; + +/** postcss-cascasde-layers plugin options */ +export declare type pluginOptions = { + /** Emit a warning when the "revert" keyword is found in your CSS. default: "warn" */ + onRevertLayerKeyword?: 'warn' | false; + /** Emit a warning when conditional rules could change the layer order. default: "warn" */ + onConditionalRulesChangingLayerOrder?: 'warn' | false; + /** Emit a warning when "layer" is used in "@import". default: "warn" */ + onImportLayerRule?: 'warn' | false; +}; + +export { } diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs b/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs index 5894e725..f28cd9e9 100644 --- a/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs +++ b/node_modules/@csstools/postcss-cascade-layers/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-selector-parser";import{selectorSpecificity as r}from"@csstools/selector-specificity";const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if("layer"!==e.name.toLowerCase())return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!i.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){var r;e&&(e.walk((e=>{var r;("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&(0===(null==(r=e.nodes)?void 0:r.length)&&e.remove())})),0===(null==(r=e.nodes)?void 0:r.length)&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{var s,n;if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===(null==(s=a.parent)?void 0:s.type)&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===(null==(n=a.parent)?void 0:n.type)){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),0===r.nodes.length&&r.remove(),0===t.nodes.length&&t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&"layer"===e.name.toLowerCase(),s="atrule"===t.type&&"layer"===t.name.toLowerCase();if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"}))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{var r;if(!e.important)return;const t=e.parent;if(!t)return;if("atrule"===(null==t||null==(r=t.parent)?void 0:r.type)&&l.includes(t.parent.name.toLowerCase()))return;const a=t.clone();a.each((e=>{"decl"===e.type&&e.important||e.remove()})),t.each((e=>{"decl"===e.type&&e.important&&e.remove()})),t.before(a),removeEmptyDescendantBlocks(t)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){s.onRevertLayerKeyword&&a.walkDecls((e=>{"revert-layer"===e.value.toLowerCase()&&e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.')})),s.onImportLayerRule&&a.walkAtRules((e=>{"import"===e.name.toLowerCase()&&e.params.toLowerCase().includes("layer")&&e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule.")})),splitImportantStyles(a);const o=new Model;if(desugarAndParseLayerNames(a,o),recordLayerOrder(a,o,{result:n,options:s}),!o.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let i=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r(e().astSync(a));i=Math.max(i,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e.message}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,o.layerCount*i)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t.message}"`)}return r})))})),o.sortLayerNames(),desugarNestedLayers(a,o),sortRootNodes(a,o),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=o.getLayerParams(r).join(".");let a=(o.layerOrder.get(t)??0)*i;e.some((e=>"decl"===e.type&&e.important))&&(a=o.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&e.replaceWith(e.nodes)}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0;export{creator as default}; +import e from"postcss-selector-parser";import{selectorSpecificity as r}from"@csstools/selector-specificity";const t="csstools-invalid-layer",a="csstools-layer-with-selector-rules",s="6efdb677-bb05-44e5-840f-29d2175862fd",n="b147acf6-11a6-4338-a4d0-80aef4cd1a2f",o=["media","supports"],l=["keyframes"],i=/^revert-layer$/i,c=/^import$/i,u=/^layer$/i,m=/layer/i,y=new Set(["layer","supports","media","container","scope"]);function isProcessableLayerRule(e){if("atrule"!==e.type)return!1;if(!u.test(e.name))return!1;let r=e.parent;for(;r;){if("rule"===r.type)return!1;if("atrule"===r.type&&!y.has(r.name.toLowerCase()))return!1;r=r.parent}return!0}class Model{anonymousLayerCount=0;layerCount=0;layerOrder;layerParamsParsed;layerNameParts;constructor(){this.anonymousLayerCount=0,this.layerCount=0,this.layerOrder=new Map,this.layerParamsParsed=new Map,this.layerNameParts=new Map}createAnonymousLayerName(){const e=`anonymous-${this.anonymousLayerCount}-${s}`;return this.addLayerNameParts(e),this.layerParamsParsed.set(e,[e]),this.anonymousLayerCount++,e}createImplicitLayerName(e){const r=this.layerNameParts.get(e)??[],t=`implicit-${r[r.length-1]}-${n}`;return this.addLayerNameParts([...r,t]),this.layerParamsParsed.set(t,[t]),t}addLayerParams(e,r){r?"string"!=typeof r?this.layerParamsParsed.set(e,r):this.layerParamsParsed.set(e,[r]):this.layerParamsParsed.set(e,[e])}addLayerNameParts(e){"string"!=typeof e?this.layerNameParts.set(e.join("."),e):this.layerNameParts.set(e,[e])}getLayerParams(e){const r=[...this.layerParamsParsed.get(e.params)??[]];let t=e.parent;for(;t;)"atrule"===t.type?(isProcessableLayerRule(t)&&r.push(...this.layerParamsParsed.get(t.params)??[]),t=t.parent):t=t.parent;return r.reverse(),r.flatMap((e=>this.layerNameParts.get(e)??[]))}getLayerNameList(e){const r=this.layerNameParts.get(e)??[],t=[];for(let e=0;e{const t=this.layerNameParts.get(e[0])??[],a=this.layerNameParts.get(r[0])??[];if(t[0]!==a[0])return(this.layerOrder.get(t[0])??0)-(this.layerOrder.get(a[0])??0);const s=Math.max(t.length,a.length);for(let e=0;e{this.layerOrder.set(e[0],r)}))}}function adjustSelectorSpecificity(r,t){const a=e().astSync(r),s=e().astSync(generateNot(t));let n=!1;for(let r=0;r{if(r(e))return t=!0,!1})),t}function someAtRuleInTree(e,r){let t=!1;return e.walkAtRules((e=>{if(r(e))return t=!0,!1})),t}function getLayerAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(isProcessableLayerRule(r))return r;r=r.parent}else r=r.parent;return null}function removeEmptyDescendantBlocks(e){e&&(e.walk((e=>{("rule"===e.type||"atrule"===e.type&&["layer",...o].includes(e.name.toLowerCase()))&&0===e.nodes?.length&&e.remove()})),0===e.nodes?.length&&e.remove())}function removeEmptyAncestorBlocks(e){if(!e)return;let r=e;for(;r;){if(void 0===r.nodes)return;if(r.nodes.length>0)return;const e=r.parent;r.remove(),r=e}}function desugarAndParseLayerNames(r,a){r.walkAtRules((r=>{if(!isProcessableLayerRule(r))return;if(r.params){const s=[];let n=!1;if(e().astSync(r.params).each((e=>{const r=[];e.walk((e=>{switch(e.type){case"class":case"tag":r.push(e.value);break;default:n=!0}})),n||(s.push(r.join(".")),a.addLayerNameParts(r))})),a.addLayerParams(r.params,s),r.nodes&&s.length>1&&(n=!0),n)return void(r.name=t);if(!r.nodes||0===r.nodes.length){if(s.length<=1)return;return s.slice(0,-1).forEach((e=>{a.addLayerParams(e,e),r.cloneBefore({params:e})})),a.addLayerParams(s[s.length-1],s[s.length-1]),void(r.params=s[s.length-1])}}r.params||(r.raws.afterName=" ",r.params=a.createAnonymousLayerName());const s=someAtRuleInTree(r,(e=>isProcessableLayerRule(e))),n=someInTree(r,(e=>{if("rule"!==e.type)return!1;return getLayerAtRuleAncestor(e)===r}));if(s&&n){const e=a.createImplicitLayerName(r.params),t=r.clone({params:e});t.walkAtRules((e=>{isProcessableLayerRule(e)&&e.remove()})),r.walk((e=>{if("atrule"===e.type&&isProcessableLayerRule(e))return;if("atrule"===e.type&&o.includes(e.name.toLowerCase()))return;getLayerAtRuleAncestor(e)===r&&e.remove()})),r.append(t),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)}}))}function desugarNestedLayers(e,r){for(;someAtRuleInTree(e,(e=>e.nodes&&someAtRuleInTree(e,(e=>isProcessableLayerRule(e)))));){let t=!1;if(e.walkAtRules((a=>{if(isProcessableLayerRule(a)&&a.parent!==e){if("atrule"===a.parent?.type&&isProcessableLayerRule(a.parent)){const e=a.parent;{const t=r.layerNameParts.get(e.params),s=r.layerNameParts.get(a.params);if(!t||!s)return;r.layerNameParts.set(`${e.params}.${a.params}`,[...t,...s]),r.layerParamsParsed.set(`${e.params}.${a.params}`,[`${e.params}.${a.params}`])}return a.params=`${e.params}.${a.params}`,e.before(a),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}if("atrule"===a.parent?.type){const e=a.parent,r=e.clone(),t=a.clone();return r.removeAll(),t.removeAll(),r.append(a.nodes),t.append(r),e.before(t),a.remove(),removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)}t=!0}})),t)break}}function sortRootNodes(e,r){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const r=e.clone(),t=e.clone();r.walkAtRules((e=>{if(l.includes(e.name.toLowerCase())){const r=e.parent;return e.remove(),removeEmptyDescendantBlocks(r),void removeEmptyAncestorBlocks(r)}if(someInTree(e,(e=>"rule"===e.type)))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=e.parent;e.remove(),removeEmptyDescendantBlocks(r),removeEmptyAncestorBlocks(r)})),t.walkAtRules((e=>{if(o.includes(e.name.toLowerCase()))return removeEmptyDescendantBlocks(e),void removeEmptyAncestorBlocks(e)})),r.name=a,e.replaceWith(r,t),0===r.nodes.length&&r.remove(),0===t.nodes.length&&t.remove()})),e.nodes.sort(((e,t)=>{const a="atrule"===e.type&&u.test(e.name),s="atrule"===t.type&&u.test(t.name);if(a&&s){return(r.layerOrder.get(e.params)??0)-(r.layerOrder.get(t.params)??0)}return a!==s?a?-1:1:0})),e.walkAtRules(a,(e=>{e.name="layer"}))}function getConditionalAtRuleAncestor(e){let r=e.parent;for(;r;)if("atrule"===r.type){if(o.includes(r.name.toLowerCase()))return r;r=r.parent}else r=r.parent;return null}function recordLayerOrder(e,r,{result:t,options:a}){e.walkAtRules((e=>{if(!isProcessableLayerRule(e))return;const o=r.getLayerParams(e),l=o.join(".");r.layerOrder.has(l)||(a.onConditionalRulesChangingLayerOrder&&getConditionalAtRuleAncestor(e)&&!e.params.endsWith(n)&&!e.params.endsWith(s)&&e.warn(t,"handling different layer orders in conditional rules is unsupported by this plugin and will cause style differences between browser versions."),r.layerParamsParsed.has(l)||r.layerParamsParsed.set(l,[l]),r.layerNameParts.has(l)||r.layerNameParts.set(l,[...o]),r.getLayerNameList(l).forEach((e=>{r.layerOrder.has(e)||(r.layerOrder.set(e,r.layerCount),r.layerCount+=1)}))),e.nodes&&0!==e.nodes.length||e.remove()}))}function splitImportantStyles(e){e.walkDecls((e=>{if(!e.important)return;const r=e.parent;if(!r)return;if("atrule"===r?.parent?.type&&l.includes(r.parent.name.toLowerCase()))return;const t=r.clone();t.each((e=>{"decl"===e.type&&e.important||e.remove()})),r.each((e=>{"decl"===e.type&&e.important&&e.remove()})),r.before(t),removeEmptyDescendantBlocks(r)}))}const creator=a=>{const s=Object.assign({onRevertLayerKeyword:"warn",onConditionalRulesChangingLayerOrder:"warn",onImportLayerRule:"warn"},a);return{postcssPlugin:"postcss-cascade-layers",OnceExit(a,{result:n}){let o=!1;if((s.onRevertLayerKeyword||s.onImportLayerRule)&&a.walk((e=>"decl"===e.type?i.test(e.value)?void e.warn(n,'handling "revert-layer" is unsupported by this plugin and will cause style differences between browser versions.'):void 0:"atrule"===e.type?c.test(e.name)&&m.test(e.params)?void e.warn(n,"To use @import with layers, the postcss-import plugin is also required. This plugin alone will not support using the @import at-rule."):u.test(e.name)?void(o=!0):void 0:void 0)),!o)return;splitImportantStyles(a);const y=new Model;if(desugarAndParseLayerNames(a,y),recordLayerOrder(a,y,{result:n,options:s}),!y.layerCount)return void a.walkAtRules(t,(e=>{e.name="layer"}));let p=0;for(a.walkRules((t=>{t.selectors.forEach((a=>{try{const t=r(e().astSync(a));p=Math.max(p,t.a+1)}catch(e){t.warn(n,`Failed to parse selector : "${a}" with message: "${e instanceof Error?e.message:e}"`)}}))})),a.walkRules((e=>{e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase())||getLayerAtRuleAncestor(e)||e.some((e=>"decl"===e.type&&e.important))||(e.selectors=e.selectors.map((r=>{try{return adjustSelectorSpecificity(r,y.layerCount*p)}catch(t){e.warn(n,`Failed to parse selector : "${r}" with message: "${t instanceof Error?t.message:t}"`)}return r})))})),y.sortLayerNames(),desugarNestedLayers(a,y),sortRootNodes(a,y),a.walkRules((e=>{if(e.parent&&"atrule"===e.parent.type&&l.includes(e.parent.name.toLowerCase()))return;const r=getLayerAtRuleAncestor(e);if(!r)return;const t=y.getLayerParams(r).join(".");let a=(y.layerOrder.get(t)??0)*p;e.some((e=>"decl"===e.type&&e.important))&&(a=y.layerCount-a),e.selectors=e.selectors.map((e=>adjustSelectorSpecificity(e,a)))}));someAtRuleInTree(a,(e=>isProcessableLayerRule(e)));)a.walkAtRules((e=>{isProcessableLayerRule(e)&&e.replaceWith(e.nodes)}));a.walkAtRules(t,(e=>{e.name="layer"}))}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts deleted file mode 100644 index 115b5dba..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { AtRule } from 'postcss'; -export declare function isProcessableLayerRule(atRule: AtRule): boolean; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/model.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/model.d.ts deleted file mode 100644 index 38a268e4..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/model.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { AtRule } from 'postcss'; -export declare class Model { - anonymousLayerCount: number; - layerCount: number; - layerOrder: Map; - layerParamsParsed: Map>; - layerNameParts: Map>; - constructor(); - createAnonymousLayerName(): string; - createImplicitLayerName(layerName: string): string; - addLayerParams(key: string, parts?: string): void; - addLayerParams(key: string, parts: Array): void; - addLayerNameParts(parts: string): void; - addLayerNameParts(parts: Array): void; - getLayerParams(layer: AtRule): Array; - getLayerNameList(layerName: string): Array; - sortLayerNames(): void; -} diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/options.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/options.d.ts deleted file mode 100644 index e3a1943d..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/options.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** postcss-cascasde-layers plugin options */ -export type pluginOptions = { - /** Emit a warning when the "revert" keyword is found in your CSS. default: "warn" */ - onRevertLayerKeyword?: 'warn' | false; - /** Emit a warning when conditional rules could change the layer order. default: "warn" */ - onConditionalRulesChangingLayerOrder?: 'warn' | false; - /** Emit a warning when "layer" is used in "@import". default: "warn" */ - onImportLayerRule?: 'warn' | false; -}; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/record-layer-order.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/record-layer-order.d.ts deleted file mode 100644 index 05d6ac7d..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/record-layer-order.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Container, Result } from 'postcss'; -import type { Model } from './model'; -import { pluginOptions } from './options'; -export declare function recordLayerOrder(root: Container, model: Model, { result, options }: { - result: Result; - options: pluginOptions; -}): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/some-in-tree.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/some-in-tree.d.ts deleted file mode 100644 index 8c416c59..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/some-in-tree.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Container, ChildNode, AtRule } from 'postcss'; -export declare function someInTree(container: Container, predicate: (node: ChildNode) => boolean): boolean; -export declare function someAtRuleInTree(container: Container, predicate: (node: AtRule) => boolean): boolean; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/sort-root-nodes.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/sort-root-nodes.d.ts deleted file mode 100644 index 8eb479ed..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/sort-root-nodes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Container } from 'postcss'; -import type { Model } from './model'; -export declare function sortRootNodes(root: Container, model: Model): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/dist/split-important-styles.d.ts b/node_modules/@csstools/postcss-cascade-layers/dist/split-important-styles.d.ts deleted file mode 100644 index 270c69a9..00000000 --- a/node_modules/@csstools/postcss-cascade-layers/dist/split-important-styles.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Container } from 'postcss'; -export declare function splitImportantStyles(root: Container): void; diff --git a/node_modules/@csstools/postcss-cascade-layers/package.json b/node_modules/@csstools/postcss-cascade-layers/package.json index 62751263..a0bc9cd1 100644 --- a/node_modules/@csstools/postcss-cascade-layers/package.json +++ b/node_modules/@csstools/postcss-cascade-layers/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-cascade-layers", "description": "Use cascade layers in CSS", - "version": "4.0.0", + "version": "4.0.2", "contributors": [ { "name": "Olu Niyi-Awosusi", @@ -35,15 +35,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -53,26 +56,12 @@ "dist" ], "dependencies": { - "@csstools/selector-specificity": "^3.0.0", + "@csstools/selector-specificity": "^3.0.1", "postcss-selector-parser": "^6.0.13" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*", - "postcss-import": "^15.1.0", - "puppeteer": "^20.7.4" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:browser": "node ./test/_browser.mjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-cascade-layers#readme", "repository": { "type": "git", @@ -88,15 +77,5 @@ "postcss-plugin", "selectors", "specificity" - ], - "csstools": { - "assumesToProcessBundledCSS": true, - "cssdbId": "cascade-layers", - "exportName": "postcssCascadeLayers", - "humanReadableName": "PostCSS Cascade Layers", - "specUrl": "https://www.w3.org/TR/css-cascade-5/#layering" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-color-function/CHANGELOG.md b/node_modules/@csstools/postcss-color-function/CHANGELOG.md index 53ab6b0a..774ddfe0 100644 --- a/node_modules/@csstools/postcss-color-function/CHANGELOG.md +++ b/node_modules/@csstools/postcss-color-function/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes to PostCSS Color Function +### 3.0.8 + +_December 15, 2023_ + +- Skip transforms when a color value contains experimental syntax +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor) + ### 3.0.7 _October 9, 2023_ @@ -13,144 +23,4 @@ _October 2, 2023_ - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#133) (patch) -### 3.0.5 - -_September 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#132) (patch) - -### 3.0.4 - -_September 18, 2023_ - -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch) - -### 3.0.3 - -_September 2, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#131) (patch) - -### 3.0.2 - -_August 28, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#130) (minor) - -### 3.0.1 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#300) (major) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#122) (patch) - -### 2.2.3 - -_June 1, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.3.0` (minor) - -### 2.2.2 - -_May 19, 2023_ - -- Ignore relative color syntax -- Updated `@csstools/postcss-progressive-custom-properties` to `2.2.0` (minor) -- Updated `@csstools/css-color-parser` to `1.2.0` (minor) - -### 2.2.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-color-parser` to `1.1.2` (patch) - -### 2.2.0 - -_March 25, 2023_ - -- Add `@csstools/css-color-parser` dependency for all color value transformations. -- Add support for `calc` expressions in color components. -- Remove support for missing channel values (`color(display-p3 1)`). This was never documented and was removed from the specification. - -### 2.1.0 - -_February 6, 2023_ - -- Add: `@csstools/color-helpers` dependency for all color value transformations. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.1.1 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 1.1.0 - -_April 4, 2022_ - -- Allow percentage units in XYZ color spaces. - -```css -.percentages { - color-1: color(xyz-d50 64.331% 19.245% 16.771%); - color-2: color(xyz-d65 64.331% 19.245% 16.771%); - color-3: color(xyz 64.331% 19.245% 16.771%); - - /* becomes */ - - color-1: rgb(245,0,135); - color-2: rgb(253,0,127); - color-3: rgb(253,0,127); -} -``` - -### 1.0.3 - -_March 8, 2022_ - -- Fix gamut mapping giving overly unsaturated colors. -- Implement powerless color components in gamut mapping. - -### 1.0.2 - -_February 12, 2022_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `1.1.0`. - -### 1.0.1 - -_February 11, 2022_ - -- Add tests for percentage values in non-xyz color spaces. -- Ignore percentage values in xyz color space as these are not supported. - -### 1.0.0 - -_February 7, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-color-function/README.md b/node_modules/@csstools/postcss-color-function/README.md index 44168b62..0470c54f 100644 --- a/node_modules/@csstools/postcss-color-function/README.md +++ b/node_modules/@csstools/postcss-color-function/README.md @@ -102,7 +102,8 @@ postcssColorFunction({ preserve: true }) The `enableProgressiveCustomProperties` option determines whether the original notation is wrapped with `@supports` when used in Custom Properties. By default, it is enabled. -⚠️ We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). +> [!NOTE] +> We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). ```js postcssColorFunction({ enableProgressiveCustomProperties: false }) diff --git a/node_modules/@csstools/postcss-color-function/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-color-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-color-function/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-color-function/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-color-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ec..00000000 --- a/node_modules/@csstools/postcss-color-function/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-color-function/dist/index.cjs b/node_modules/@csstools/postcss-color-function/dist/index.cjs index d6a9614a..9e08190c 100644 --- a/node_modules/@csstools/postcss-color-function/dist/index.cjs +++ b/node_modules/@csstools/postcss-color-function/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e({postcssPlugin:"postcss-color-function",Declaration:a=>{const c=a.value;if(!o.test(c))return;if(hasFallback(a))return;if(hasSupportsAtRuleAncestor(a))return;const i=s.tokenize({css:c}),l=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(i),(e=>{if(t.isFunctionNode(e)&&n.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.serializeRGB(s)}})),p=t.stringify(l);p!==c&&(a.cloneBefore({value:p}),null!=e&&e.preserve||a.remove())}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},s);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-color-function",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e({postcssPlugin:"postcss-color-function",Declaration:a=>{const i=a.value;if(!o.test(i))return;if(hasFallback(a))return;if(hasSupportsAtRuleAncestor(a))return;const c=s.tokenize({css:i}),l=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(c),(e=>{if(t.isFunctionNode(e)&&n.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.Experimental))return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.serializeRGB(s)}})),p=t.stringify(l);p!==i&&(a.cloneBefore({value:p}),e?.preserve||a.remove())}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},s);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-color-function",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-color-function/dist/index.d.ts b/node_modules/@csstools/postcss-color-function/dist/index.d.ts index 616abbd7..358de7ea 100644 --- a/node_modules/@csstools/postcss-color-function/dist/index.d.ts +++ b/node_modules/@csstools/postcss-color-function/dist/index.d.ts @@ -1,10 +1,14 @@ import type { PluginCreator } from 'postcss'; + /** postcss-color-function plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ enableProgressiveCustomProperties?: boolean; }; + declare const postcssPlugin: PluginCreator; export default postcssPlugin; + +export { } diff --git a/node_modules/@csstools/postcss-color-function/dist/index.mjs b/node_modules/@csstools/postcss-color-function/dist/index.mjs index b1bc9224..49c7c620 100644 --- a/node_modules/@csstools/postcss-color-function/dist/index.mjs +++ b/node_modules/@csstools/postcss-color-function/dist/index.mjs @@ -1 +1 @@ -import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as r}from"@csstools/css-tokenizer";import{color as e,SyntaxFlag as o,serializeRGB as t}from"@csstools/css-color-parser";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as a,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const r=s.parent;if(!r)return!1;const e=s.prop.toLowerCase(),o=r.index(s);for(let s=0;s({postcssPlugin:"postcss-color-function",Declaration:u=>{const f=u.value;if(!l.test(f))return;if(hasFallback(u))return;if(hasSupportsAtRuleAncestor(u))return;const m=r({css:f}),g=n(c(m),(s=>{if(a(s)&&i.test(s.getName())){const r=e(s);if(!r)return;if(r.syntaxFlags.has(o.HasNoneKeywords))return;if(r.syntaxFlags.has(o.RelativeColorSyntax))return;return t(r)}})),v=p(g);v!==f&&(u.cloneBefore({value:v}),null!=s&&s.preserve||u.remove())}});basePlugin.postcss=!0;const postcssPlugin=r=>{const e=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},r);return e.enableProgressiveCustomProperties&&e.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(e)]}:basePlugin(e)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as r}from"@csstools/css-tokenizer";import{color as e,SyntaxFlag as t,serializeRGB as o}from"@csstools/css-color-parser";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as a,isFunctionNode as c,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const r=s.parent;if(!r)return!1;const e=s.prop.toLowerCase(),t=r.index(s);for(let s=0;s({postcssPlugin:"postcss-color-function",Declaration:u=>{const f=u.value;if(!i.test(f))return;if(hasFallback(u))return;if(hasSupportsAtRuleAncestor(u))return;const m=r({css:f}),g=n(a(m),(s=>{if(c(s)&&l.test(s.getName())){const r=e(s);if(!r)return;if(r.syntaxFlags.has(t.Experimental))return;if(r.syntaxFlags.has(t.HasNoneKeywords))return;if(r.syntaxFlags.has(t.RelativeColorSyntax))return;return o(r)}})),v=p(g);v!==f&&(u.cloneBefore({value:v}),s?.preserve||u.remove())}});basePlugin.postcss=!0;const postcssPlugin=r=>{const e=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},r);return e.enableProgressiveCustomProperties&&e.preserve?{postcssPlugin:"postcss-color-function",plugins:[s(),basePlugin(e)]}:basePlugin(e)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-color-function/package.json b/node_modules/@csstools/postcss-color-function/package.json index a2b330a4..0fa8fe31 100644 --- a/node_modules/@csstools/postcss-color-function/package.json +++ b/node_modules/@csstools/postcss-color-function/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-color-function", "description": "Use the color() function in CSS", - "version": "3.0.7", + "version": "3.0.8", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -35,26 +38,14 @@ "dist" ], "dependencies": { - "@csstools/css-color-parser": "^1.4.0", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1", - "@csstools/postcss-progressive-custom-properties": "^3.0.2" + "@csstools/css-color-parser": "^1.5.0", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2", + "@csstools/postcss-progressive-custom-properties": "^3.0.3" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*", - "postcss-lab-function": "^6.0.0" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-function#readme", "repository": { "type": "git", @@ -76,14 +67,5 @@ "srgb-linear", "syntax", "xyz" - ], - "csstools": { - "cssdbId": "color-function", - "exportName": "postcssColorFunction", - "humanReadableName": "PostCSS Color Function", - "specUrl": "https://www.w3.org/TR/css-color-4/#funcdef-color" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md b/node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md index e56cec1c..fffe7b5d 100644 --- a/node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md +++ b/node_modules/@csstools/postcss-color-mix-function/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes to PostCSS Color Mix Function +### 2.0.8 + +_December 15, 2023_ + +- Skip transforms when a color value contains experimental syntax +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor) + ### 2.0.7 _October 9, 2023_ @@ -13,73 +23,4 @@ _October 2, 2023_ - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#133) (patch) -### 2.0.5 - -_September 24, 2023_ - -- Small performance improvements -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#132) (patch) - -### 2.0.4 - -_September 18, 2023_ - -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch) - -### 2.0.3 - -_September 2, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#131) (patch) - -### 2.0.2 - -_August 28, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#130) (minor) - -### 2.0.1 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - -### 2.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#300) (major) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#122) (patch) - -### 1.0.3 - -_June 1, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.3.0` (minor) - - -### 1.0.2 - -_May 19, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.2.0` (minor) -- Updated `@csstools/css-color-parser` to `1.2.0` (minor) - -### 1.0.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-color-parser` to `1.1.2` (patch) - -### 1.0.0 - -_March 25, 2023_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-color-mix-function/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-color-mix-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-color-mix-function/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-color-mix-function/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-color-mix-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ec..00000000 --- a/node_modules/@csstools/postcss-color-mix-function/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-color-mix-function/dist/index.cjs b/node_modules/@csstools/postcss-color-mix-function/dist/index.cjs index ef647904..8e43b99b 100644 --- a/node_modules/@csstools/postcss-color-mix-function/dist/index.cjs +++ b/node_modules/@csstools/postcss-color-mix-function/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e({postcssPlugin:"postcss-color-mix-function",Declaration:i=>{const a=i.value;if(!o.test(a))return;if(hasFallback(i))return;if(hasSupportsAtRuleAncestor(i))return;const u=s.tokenize({css:a}),l=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(e=>{if(t.isFunctionNode(e)&&n.test(e.getName())){const s=r.color(e);if(!s)return;return r.serializeRGB(s)}})),c=t.stringify(l);if(c===a)return;let p=c;null!=e&&e.subFeatures.displayP3&&(p=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(e=>{if(t.isFunctionNode(e)&&n.test(e.getName())){const s=r.color(e);if(!s)return;return r.colorDataFitsRGB_Gamut(s)?r.serializeRGB(s):r.serializeP3(s)}})))),i.cloneBefore({value:c}),null!=e&&e.subFeatures.displayP3&&p!==c&&i.cloneBefore({value:p}),null!=e&&e.preserve||i.remove()}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},s);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-color-mix-function",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e({postcssPlugin:"postcss-color-mix-function",Declaration:n=>{const i=n.value;if(!o.test(i))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const u=s.tokenize({css:i}),l=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(e=>{if(t.isFunctionNode(e)&&a.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.Experimental))return;return r.serializeRGB(s)}})),c=t.stringify(l);if(c===i)return;let p=c;e?.subFeatures.displayP3&&(p=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(e=>{if(t.isFunctionNode(e)&&a.test(e.getName())){const s=r.color(e);if(!s)return;return r.colorDataFitsRGB_Gamut(s)?r.serializeRGB(s):r.serializeP3(s)}})))),n.cloneBefore({value:c}),e?.subFeatures.displayP3&&p!==c&&n.cloneBefore({value:p}),e?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},s);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-color-mix-function",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-color-mix-function/dist/index.d.ts b/node_modules/@csstools/postcss-color-mix-function/dist/index.d.ts index 22a656f0..0cae0a44 100644 --- a/node_modules/@csstools/postcss-color-mix-function/dist/index.d.ts +++ b/node_modules/@csstools/postcss-color-mix-function/dist/index.d.ts @@ -1,6 +1,7 @@ import type { PluginCreator } from 'postcss'; + /** postcss-color-mix-function plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ @@ -11,5 +12,8 @@ export type pluginOptions = { displayP3?: boolean; }; }; + declare const postcssPlugin: PluginCreator; export default postcssPlugin; + +export { } diff --git a/node_modules/@csstools/postcss-color-mix-function/dist/index.mjs b/node_modules/@csstools/postcss-color-mix-function/dist/index.mjs index 35b6a3c0..14690269 100644 --- a/node_modules/@csstools/postcss-color-mix-function/dist/index.mjs +++ b/node_modules/@csstools/postcss-color-mix-function/dist/index.mjs @@ -1 +1 @@ -import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as r,serializeRGB as t,colorDataFitsRGB_Gamut as o,serializeP3 as n}from"@csstools/css-color-parser";import{replaceComponentValues as u,parseCommaSeparatedListOfComponentValues as i,isFunctionNode as a,stringify as c}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),t=e.index(s);for(let s=0;s({postcssPlugin:"postcss-color-mix-function",Declaration:f=>{const m=f.value;if(!l.test(m))return;if(hasFallback(f))return;if(hasSupportsAtRuleAncestor(f))return;const b=e({css:m}),g=u(i(b),(s=>{if(a(s)&&p.test(s.getName())){const e=r(s);if(!e)return;return t(e)}})),P=c(g);if(P===m)return;let d=P;null!=s&&s.subFeatures.displayP3&&(d=c(u(i(b),(s=>{if(a(s)&&p.test(s.getName())){const e=r(s);if(!e)return;return o(e)?t(e):n(e)}})))),f.cloneBefore({value:P}),null!=s&&s.subFeatures.displayP3&&d!==P&&f.cloneBefore({value:d}),null!=s&&s.preserve||f.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-color-mix-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as n,serializeP3 as a}from"@csstools/css-color-parser";import{replaceComponentValues as i,parseCommaSeparatedListOfComponentValues as u,isFunctionNode as c,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),t=e.index(s);for(let s=0;s({postcssPlugin:"postcss-color-mix-function",Declaration:m=>{const b=m.value;if(!l.test(b))return;if(hasFallback(m))return;if(hasSupportsAtRuleAncestor(m))return;const g=e({css:b}),P=i(u(g),(s=>{if(c(s)&&f.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.Experimental))return;return o(e)}})),d=p(P);if(d===b)return;let v=d;s?.subFeatures.displayP3&&(v=p(i(u(g),(s=>{if(c(s)&&f.test(s.getName())){const e=r(s);if(!e)return;return n(e)?o(e):a(e)}})))),m.cloneBefore({value:d}),s?.subFeatures.displayP3&&v!==d&&m.cloneBefore({value:v}),s?.preserve||m.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-color-mix-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-color-mix-function/package.json b/node_modules/@csstools/postcss-color-mix-function/package.json index 1636ac7f..7be8407b 100644 --- a/node_modules/@csstools/postcss-color-mix-function/package.json +++ b/node_modules/@csstools/postcss-color-mix-function/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-color-mix-function", "description": "Use the color-mix function in CSS", - "version": "2.0.7", + "version": "2.0.8", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,25 +48,14 @@ "dist" ], "dependencies": { - "@csstools/css-color-parser": "^1.4.0", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1", - "@csstools/postcss-progressive-custom-properties": "^3.0.2" + "@csstools/css-color-parser": "^1.5.0", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2", + "@csstools/postcss-progressive-custom-properties": "^3.0.3" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-color-mix-function#readme", "repository": { "type": "git", @@ -84,14 +76,5 @@ "srgb-linear", "syntax", "xyz" - ], - "csstools": { - "cssdbId": "color-mix", - "exportName": "postcssColorMixFunction", - "humanReadableName": "PostCSS Color Mix Function", - "specUrl": "https://www.w3.org/TR/css-color-5/#color-mix" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md b/node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md index cd08f07e..d937ae32 100644 --- a/node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md +++ b/node_modules/@csstools/postcss-exponential-functions/CHANGELOG.md @@ -1,5 +1,14 @@ # Changes to PostCSS Exponential Functions +### 1.0.2 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch) + ### 1.0.1 _September 24, 2023_ diff --git a/node_modules/@csstools/postcss-exponential-functions/dist/calc.d.ts b/node_modules/@csstools/postcss-exponential-functions/dist/calc.d.ts deleted file mode 100644 index 5a1ee11e..00000000 --- a/node_modules/@csstools/postcss-exponential-functions/dist/calc.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function calc(css: string): string; diff --git a/node_modules/@csstools/postcss-exponential-functions/dist/checks.d.ts b/node_modules/@csstools/postcss-exponential-functions/dist/checks.d.ts deleted file mode 100644 index 6623beb7..00000000 --- a/node_modules/@csstools/postcss-exponential-functions/dist/checks.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const FUNCTION_NAME_REGEXP: RegExp; -export declare const FUNCTION_CALL_REGEXP: RegExp; diff --git a/node_modules/@csstools/postcss-exponential-functions/dist/index.cjs b/node_modules/@csstools/postcss-exponential-functions/dist/index.cjs index defdaba9..111e7899 100644 --- a/node_modules/@csstools/postcss-exponential-functions/dist/index.cjs +++ b/node_modules/@csstools/postcss-exponential-functions/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/css-calc");const s=new RegExp(`(${["exp","hypot","log","pow","sqrt"].join("|")})\\(`,"i"),creator=o=>{const t=Object.assign({preserve:!1},o);return{postcssPlugin:"postcss-exponential-functions",Declaration(o){if(!s.test(o.value))return;const c=e.calc(o.value);c!==o.value&&(o.cloneBefore({value:c}),t.preserve||o.remove())}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("@csstools/css-calc");const s=/(?{const o=Object.assign({preserve:!1},t);return{postcssPlugin:"postcss-exponential-functions",Declaration(t){if(!s.test(t.value))return;const c=e.calc(t.value);c!==t.value&&(t.cloneBefore({value:c}),o.preserve||t.remove())}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-exponential-functions/dist/index.d.ts b/node_modules/@csstools/postcss-exponential-functions/dist/index.d.ts index d216e578..44407b78 100644 --- a/node_modules/@csstools/postcss-exponential-functions/dist/index.d.ts +++ b/node_modules/@csstools/postcss-exponential-functions/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-exponential-functions plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-exponential-functions/dist/index.mjs b/node_modules/@csstools/postcss-exponential-functions/dist/index.mjs index 748e9dbb..e27788f6 100644 --- a/node_modules/@csstools/postcss-exponential-functions/dist/index.mjs +++ b/node_modules/@csstools/postcss-exponential-functions/dist/index.mjs @@ -1 +1 @@ -import{calc as e}from"@csstools/css-calc";const s=new RegExp(`(${["exp","hypot","log","pow","sqrt"].join("|")})\\(`,"i"),creator=o=>{const t=Object.assign({preserve:!1},o);return{postcssPlugin:"postcss-exponential-functions",Declaration(o){if(!s.test(o.value))return;const n=e(o.value);n!==o.value&&(o.cloneBefore({value:n}),t.preserve||o.remove())}}};creator.postcss=!0;export{creator as default}; +import{calc as e}from"@csstools/css-calc";const s=/(?{const t=Object.assign({preserve:!1},o);return{postcssPlugin:"postcss-exponential-functions",Declaration(o){if(!s.test(o.value))return;const r=e(o.value);r!==o.value&&(o.cloneBefore({value:r}),t.preserve||o.remove())}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-exponential-functions/package.json b/node_modules/@csstools/postcss-exponential-functions/package.json index 5b6fd683..77d3bd3f 100644 --- a/node_modules/@csstools/postcss-exponential-functions/package.json +++ b/node_modules/@csstools/postcss-exponential-functions/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-exponential-functions", "description": "Use pow(), sqrt(), hypot(), log(), exp() exponential functions in CSS", - "version": "1.0.1", + "version": "1.0.2", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,24 +48,13 @@ "dist" ], "dependencies": { - "@csstools/css-calc": "^1.1.4", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1" + "@csstools/css-calc": "^1.1.5", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-exponential-functions#readme", "repository": { "type": "git", @@ -78,14 +70,5 @@ "postcss-plugin", "pow", "sqrt" - ], - "csstools": { - "cssdbId": "exponential-functions", - "exportName": "postcssExponentialFunctions", - "humanReadableName": "PostCSS Exponential Functions", - "specUrl": "https://www.w3.org/TR/css-values-4/#exponent-funcs" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md b/node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md index 78f76768..9714df58 100644 --- a/node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md +++ b/node_modules/@csstools/postcss-font-format-keywords/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Font Format +### 3.0.1 + +_December 15, 2023_ + +- Fix type definitions + ### 3.0.0 _July 3, 2023_ @@ -12,26 +18,4 @@ _February 8, 2023_ - Reduce the amount of duplicate fallback CSS. -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.1 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 1.0.0 - -_January 25, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-font-format-keywords/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-font-format-keywords/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-font-format-keywords/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-font-format-keywords/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs b/node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs index 7ffbcdcb..a14a3a26 100644 --- a/node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs +++ b/node_modules/@csstools/postcss-font-format-keywords/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-value-parser");function hasFallback(e){const t=e.parent;if(!t)return!1;const o=e.prop.toLowerCase(),r=t.index(e);for(let e=0;e{const r="preserve"in Object(o)&&Boolean(null==o?void 0:o.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(o){if("src"!==o.prop.toLowerCase())return;if(!o.value.toLowerCase().includes("format("))return;if(hasFallback(o))return;const n=o.parent;if(!n||"atrule"!==n.type)return;if("font-face"!==n.name.toLowerCase())return;const s=e(o.value);s.walk((o=>{"function"===o.type&&"format"===o.value.toLowerCase()&&o.nodes.forEach((o=>{"word"===o.type&&t.includes(o.value.toLowerCase())&&(o.value=e.stringify({type:"string",value:o.value,quote:'"'}))}))})),s.toString()!==o.value&&(o.cloneBefore({value:s.toString()}),r||o.remove())}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("postcss-value-parser");function hasFallback(e){const t=e.parent;if(!t)return!1;const o=e.prop.toLowerCase(),r=t.index(e);for(let e=0;e{const r="preserve"in Object(o)&&Boolean(o?.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(o){if("src"!==o.prop.toLowerCase())return;if(!o.value.toLowerCase().includes("format("))return;if(hasFallback(o))return;const s=o.parent;if(!s||"atrule"!==s.type)return;if("font-face"!==s.name.toLowerCase())return;const n=e(o.value);n.walk((o=>{"function"===o.type&&"format"===o.value.toLowerCase()&&o.nodes.forEach((o=>{"word"===o.type&&t.includes(o.value.toLowerCase())&&(o.value=e.stringify({type:"string",value:o.value,quote:'"'}))}))})),n.toString()!==o.value&&(o.cloneBefore({value:n.toString()}),r||o.remove())}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-font-format-keywords/dist/index.d.ts b/node_modules/@csstools/postcss-font-format-keywords/dist/index.d.ts index 08f71203..4bc6e82c 100644 --- a/node_modules/@csstools/postcss-font-format-keywords/dist/index.d.ts +++ b/node_modules/@csstools/postcss-font-format-keywords/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-font-format-keywords plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs b/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs index 896d2b41..4c88bb7a 100644 --- a/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs +++ b/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-value-parser";function hasFallback(e){const o=e.parent;if(!o)return!1;const t=e.prop.toLowerCase(),r=o.index(e);for(let e=0;e{const r="preserve"in Object(t)&&Boolean(null==t?void 0:t.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(t){if("src"!==t.prop.toLowerCase())return;if(!t.value.toLowerCase().includes("format("))return;if(hasFallback(t))return;const n=t.parent;if(!n||"atrule"!==n.type)return;if("font-face"!==n.name.toLowerCase())return;const s=e(t.value);s.walk((t=>{"function"===t.type&&"format"===t.value.toLowerCase()&&t.nodes.forEach((t=>{"word"===t.type&&o.includes(t.value.toLowerCase())&&(t.value=e.stringify({type:"string",value:t.value,quote:'"'}))}))})),s.toString()!==t.value&&(t.cloneBefore({value:s.toString()}),r||t.remove())}}};creator.postcss=!0;export{creator as default}; +import e from"postcss-value-parser";function hasFallback(e){const t=e.parent;if(!t)return!1;const o=e.prop.toLowerCase(),r=t.index(e);for(let e=0;e{const r="preserve"in Object(o)&&Boolean(o?.preserve);return{postcssPlugin:"postcss-font-format-keywords",Declaration(o){if("src"!==o.prop.toLowerCase())return;if(!o.value.toLowerCase().includes("format("))return;if(hasFallback(o))return;const n=o.parent;if(!n||"atrule"!==n.type)return;if("font-face"!==n.name.toLowerCase())return;const s=e(o.value);s.walk((o=>{"function"===o.type&&"format"===o.value.toLowerCase()&&o.nodes.forEach((o=>{"word"===o.type&&t.includes(o.value.toLowerCase())&&(o.value=e.stringify({type:"string",value:o.value,quote:'"'}))}))})),s.toString()!==o.value&&(o.cloneBefore({value:s.toString()}),r||o.remove())}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-font-format-keywords/package.json b/node_modules/@csstools/postcss-font-format-keywords/package.json index 2f41adca..c39466a7 100644 --- a/node_modules/@csstools/postcss-font-format-keywords/package.json +++ b/node_modules/@csstools/postcss-font-format-keywords/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-font-format-keywords", "description": "Use unquoted format on @font-face CSS definitions.", - "version": "3.0.0", + "version": "3.0.1", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -40,17 +43,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-font-format-keywords#readme", "repository": { "type": "git", @@ -68,12 +60,5 @@ "truetype", "woff", "woff2" - ], - "csstools": { - "exportName": "postcssFontFormatKeywords", - "humanReadableName": "PostCSS Font Format Keywords" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md b/node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md index 646591c8..966c92c7 100644 --- a/node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md +++ b/node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md @@ -1,5 +1,14 @@ # Changes to PostCSS gamut-mapping +### 1.0.1 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor) + ### 1.0.0 _October 9, 2023_ diff --git a/node_modules/@csstools/postcss-gamut-mapping/dist/has-conditional-ancestor.d.ts b/node_modules/@csstools/postcss-gamut-mapping/dist/has-conditional-ancestor.d.ts deleted file mode 100644 index 7c086270..00000000 --- a/node_modules/@csstools/postcss-gamut-mapping/dist/has-conditional-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasConditionalAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-gamut-mapping/dist/has-override-decl.d.ts b/node_modules/@csstools/postcss-gamut-mapping/dist/has-override-decl.d.ts deleted file mode 100644 index e98c4f8a..00000000 --- a/node_modules/@csstools/postcss-gamut-mapping/dist/has-override-decl.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasOverrideOrFallback(node: Declaration): { - hasOverride: boolean; - hasFallback: boolean; -}; diff --git a/node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs b/node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs index 77030d6a..e8bf04db 100644 --- a/node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs +++ b/node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/css-tokenizer"),o=require("@csstools/css-parser-algorithms"),a=require("@csstools/css-color-parser");const t=/\bcolor-gamut\b/i;function hasConditionalAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("media"===o.name.toLowerCase()&&t.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function hasOverrideOrFallback(e){var o;const a=e.prop.toLowerCase();let t=!1,s=!1;const r=(null==(o=e.parent)?void 0:o.nodes)??[],n=r.indexOf(e);for(let e=0;e({postcssPlugin:"postcss-gamut-mapping",prepare(){const t=new WeakMap;return{OnceExit:(n,{postcss:l})=>{n.walkDecls((n=>{const i=n.value;if(!s.test(i))return;if(!n.parent||hasConditionalAncestor(n))return;const{hasOverride:c,hasFallback:p}=hasOverrideOrFallback(n);if(c)return;const u=t.get(n.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{media:void 0},lastConditionalRule:void 0};t.set(n.parent,u);let d=!1;const m=o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(e.tokenize({css:i})),(e=>{if(!o.isFunctionNode(e)||!r.test(e.getName()))return;const t=a.color(e);return!t||t.syntaxFlags.has(a.SyntaxFlag.HasNoneKeywords)||a.colorDataFitsRGB_Gamut(t)?void 0:(d||a.colorDataFitsDisplayP3_Gamut(t)||(d=!0),a.serializeRGB(t,!0))})),f=o.stringify(m);if(f===i)return;const v=`(color-gamut: ${d?"rec2020":"p3"})`;if(u.lastConditionParams.media!==v&&(u.lastConditionalRule=void 0),u.lastConditionalRule)return p||n.cloneBefore({value:f}),u.lastConditionalRule.append(n.clone()),void n.remove();p||n.cloneBefore({value:f});const h=l.atRule({name:"media",params:v,source:n.parent.source,raws:{before:"\n\n",after:"\n"}}),C=n.parent.clone();C.removeAll(),C.raws.before="\n",C.append(n.clone()),n.remove(),u.lastConditionParams.media=h.params,u.lastConditionalRule=C,h.append(C),u.conditionalRules.push(h)})),n.walk((e=>{const o=t.get(e);o&&0!==o.conditionalRules.length&&o.conditionalRules.reverse().forEach((o=>{e.after(o)}))}))}}}});creator.postcss=!0,module.exports=creator; +"use strict";var e=require("@csstools/css-tokenizer"),o=require("@csstools/css-parser-algorithms"),a=require("@csstools/css-color-parser");const t=/\bcolor-gamut\b/i;function hasConditionalAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("media"===o.name.toLowerCase()&&t.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function hasOverrideOrFallback(e){const o=e.prop.toLowerCase();let a=!1,t=!1;const s=e.parent?.nodes??[],r=s.indexOf(e);for(let e=0;e({postcssPlugin:"postcss-gamut-mapping",prepare(){const t=new WeakMap;return{OnceExit:(n,{postcss:l})=>{n.walkDecls((n=>{const i=n.value;if(!s.test(i))return;if(!n.parent||hasConditionalAncestor(n))return;const{hasOverride:c,hasFallback:p}=hasOverrideOrFallback(n);if(c)return;const u=t.get(n.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{media:void 0},lastConditionalRule:void 0};t.set(n.parent,u);let d=!1;const m=o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(e.tokenize({css:i})),(e=>{if(!o.isFunctionNode(e)||!r.test(e.getName()))return;const t=a.color(e);return!t||t.syntaxFlags.has(a.SyntaxFlag.HasNoneKeywords)||a.colorDataFitsRGB_Gamut(t)?void 0:(d||a.colorDataFitsDisplayP3_Gamut(t)||(d=!0),a.serializeRGB(t,!0))})),f=o.stringify(m);if(f===i)return;const h=`(color-gamut: ${d?"rec2020":"p3"})`;if(u.lastConditionParams.media!==h&&(u.lastConditionalRule=void 0),u.lastConditionalRule)return p||n.cloneBefore({value:f}),u.lastConditionalRule.append(n.clone()),void n.remove();p||n.cloneBefore({value:f});const v=l.atRule({name:"media",params:h,source:n.parent.source,raws:{before:"\n\n",after:"\n"}}),C=n.parent.clone();C.removeAll(),C.raws.before="\n",C.append(n.clone()),n.remove(),u.lastConditionParams.media=v.params,u.lastConditionalRule=C,v.append(C),u.conditionalRules.push(v)})),n.walk((e=>{const o=t.get(e);o&&0!==o.conditionalRules.length&&o.conditionalRules.reverse().forEach((o=>{e.after(o)}))}))}}}});creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-gamut-mapping/dist/index.d.ts b/node_modules/@csstools/postcss-gamut-mapping/dist/index.d.ts index cf42343c..c8f9aec3 100644 --- a/node_modules/@csstools/postcss-gamut-mapping/dist/index.d.ts +++ b/node_modules/@csstools/postcss-gamut-mapping/dist/index.d.ts @@ -1,5 +1,9 @@ import type { PluginCreator } from 'postcss'; -/** postcss-gamut-mapping plugin options */ -export type pluginOptions = never; + declare const creator: PluginCreator; export default creator; + +/** postcss-gamut-mapping plugin options */ +export declare type pluginOptions = never; + +export { } diff --git a/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs b/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs index 1899c2c4..d4355811 100644 --- a/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs +++ b/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs @@ -1 +1 @@ -import{tokenize as e}from"@csstools/css-tokenizer";import{replaceComponentValues as o,parseCommaSeparatedListOfComponentValues as t,isFunctionNode as a,stringify as r}from"@csstools/css-parser-algorithms";import{color as n,SyntaxFlag as s,colorDataFitsRGB_Gamut as l,colorDataFitsDisplayP3_Gamut as i,serializeRGB as c}from"@csstools/css-color-parser";const p=/\bcolor-gamut\b/i;function hasConditionalAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("media"===o.name.toLowerCase()&&p.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function hasOverrideOrFallback(e){var o;const t=e.prop.toLowerCase();let a=!1,r=!1;const n=(null==(o=e.parent)?void 0:o.nodes)??[],s=n.indexOf(e);for(let e=0;e({postcssPlugin:"postcss-gamut-mapping",prepare(){const p=new WeakMap;return{OnceExit:(m,{postcss:f})=>{m.walkDecls((m=>{const h=m.value;if(!d.test(h))return;if(!m.parent||hasConditionalAncestor(m))return;const{hasOverride:v,hasFallback:b}=hasOverrideOrFallback(m);if(v)return;const k=p.get(m.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{media:void 0},lastConditionalRule:void 0};p.set(m.parent,k);let C=!1;const g=o(t(e({css:h})),(e=>{if(!a(e)||!u.test(e.getName()))return;const o=n(e);return!o||o.syntaxFlags.has(s.HasNoneKeywords)||l(o)?void 0:(C||i(o)||(C=!0),c(o,!0))})),w=r(g);if(w===h)return;const R=`(color-gamut: ${C?"rec2020":"p3"})`;if(k.lastConditionParams.media!==R&&(k.lastConditionalRule=void 0),k.lastConditionalRule)return b||m.cloneBefore({value:w}),k.lastConditionalRule.append(m.clone()),void m.remove();b||m.cloneBefore({value:w});const O=f.atRule({name:"media",params:R,source:m.parent.source,raws:{before:"\n\n",after:"\n"}}),F=m.parent.clone();F.removeAll(),F.raws.before="\n",F.append(m.clone()),m.remove(),k.lastConditionParams.media=O.params,k.lastConditionalRule=F,O.append(F),k.conditionalRules.push(O)})),m.walk((e=>{const o=p.get(e);o&&0!==o.conditionalRules.length&&o.conditionalRules.reverse().forEach((o=>{e.after(o)}))}))}}}});creator.postcss=!0;export{creator as default}; +import{tokenize as e}from"@csstools/css-tokenizer";import{replaceComponentValues as o,parseCommaSeparatedListOfComponentValues as t,isFunctionNode as a,stringify as r}from"@csstools/css-parser-algorithms";import{color as s,SyntaxFlag as n,colorDataFitsRGB_Gamut as l,colorDataFitsDisplayP3_Gamut as i,serializeRGB as c}from"@csstools/css-color-parser";const p=/\bcolor-gamut\b/i;function hasConditionalAncestor(e){let o=e.parent;for(;o;)if("atrule"===o.type){if("media"===o.name.toLowerCase()&&p.test(o.params))return!0;o=o.parent}else o=o.parent;return!1}function hasOverrideOrFallback(e){const o=e.prop.toLowerCase();let t=!1,a=!1;const r=e.parent?.nodes??[],s=r.indexOf(e);for(let e=0;e({postcssPlugin:"postcss-gamut-mapping",prepare(){const p=new WeakMap;return{OnceExit:(m,{postcss:f})=>{m.walkDecls((m=>{const h=m.value;if(!d.test(h))return;if(!m.parent||hasConditionalAncestor(m))return;const{hasOverride:v,hasFallback:b}=hasOverrideOrFallback(m);if(v)return;const k=p.get(m.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{media:void 0},lastConditionalRule:void 0};p.set(m.parent,k);let C=!1;const g=o(t(e({css:h})),(e=>{if(!a(e)||!u.test(e.getName()))return;const o=s(e);return!o||o.syntaxFlags.has(n.HasNoneKeywords)||l(o)?void 0:(C||i(o)||(C=!0),c(o,!0))})),w=r(g);if(w===h)return;const R=`(color-gamut: ${C?"rec2020":"p3"})`;if(k.lastConditionParams.media!==R&&(k.lastConditionalRule=void 0),k.lastConditionalRule)return b||m.cloneBefore({value:w}),k.lastConditionalRule.append(m.clone()),void m.remove();b||m.cloneBefore({value:w});const O=f.atRule({name:"media",params:R,source:m.parent.source,raws:{before:"\n\n",after:"\n"}}),F=m.parent.clone();F.removeAll(),F.raws.before="\n",F.append(m.clone()),m.remove(),k.lastConditionParams.media=O.params,k.lastConditionalRule=F,O.append(F),k.conditionalRules.push(O)})),m.walk((e=>{const o=p.get(e);o&&0!==o.conditionalRules.length&&o.conditionalRules.reverse().forEach((o=>{e.after(o)}))}))}}}});creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-gamut-mapping/package.json b/node_modules/@csstools/postcss-gamut-mapping/package.json index 45255518..6e5e4c14 100644 --- a/node_modules/@csstools/postcss-gamut-mapping/package.json +++ b/node_modules/@csstools/postcss-gamut-mapping/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-gamut-mapping", "description": "Gamut map css colors to fit display specific gamuts", - "version": "1.0.0", + "version": "1.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,24 +48,13 @@ "dist" ], "dependencies": { - "@csstools/css-color-parser": "^1.4.0", - "@csstools/css-parser-algorithms": "2.3.2", - "@csstools/css-tokenizer": "^2.2.1" + "@csstools/css-color-parser": "^1.5.0", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gamut-mapping#readme", "repository": { "type": "git", @@ -81,14 +73,5 @@ "rec2020", "srgb", "wide gamut" - ], - "csstools": { - "cssdbId": "gamut-mapping", - "exportName": "postcssGamutMapping", - "humanReadableName": "PostCSS Gamut Mapping", - "specUrl": "https://www.w3.org/TR/css-color-4/#gamut-mapping" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md b/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md index 1c0818d0..b952a1fe 100644 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes to PostCSS Gradients Interpolation Method +### 4.0.8 + +_December 15, 2023_ + +- Skip transforms when a color value contains experimental syntax +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor) + ### 4.0.7 _October 9, 2023_ @@ -13,117 +23,4 @@ _October 2, 2023_ - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#133) (patch) -### 4.0.5 - -_September 24, 2023_ - -- Small performance improvements -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#132) (patch) - -### 4.0.4 - -_September 18, 2023_ - -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch) - -### 4.0.3 - -_September 2, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#131) (patch) - -### 4.0.2 - -_August 28, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#130) (minor) - -### 4.0.1 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - -### 4.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#300) (major) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#122) (patch) - -### 3.0.6 - -_June 1, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.3.0` (minor) - - -### 3.0.5 - -_May 19, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.2.0` (minor) -- Updated `@csstools/css-color-parser` to `1.2.0` (minor) - - - -### 3.0.4 - -_April 17, 2023_ - -- Fix infinite loop when parsing gradient functions. (see : https://github.com/csstools/postcss-plugins/issues/948) - -### 3.0.3 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-color-parser` to `1.1.2` (patch) - -### 3.0.2 - -_April 10, 2023_ - -- Fix interpolation method `longer`, `increasing`,... for color stops with the same color. - -### 3.0.1 - -_March 28, 2023_ - -- Skip gamut mapping for interpolation color hints. - -### 3.0.0 - -_March 25, 2023_ - -- Handle `color-mix()` internally with `@csstools/css-color-parser` - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.1 - -_March 7, 2022_ - -- fix dependencies - -### 1.0.0 - -_March 4, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/README.md b/node_modules/@csstools/postcss-gradients-interpolation-method/README.md index 8412d0aa..6ac7234b 100644 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/README.md +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/README.md @@ -37,7 +37,8 @@ npm install @csstools/postcss-gradients-interpolation-method --save-dev ## Shortcomings -⚠️ Color stops with only a color or only an interpolation hint are not supported. +> [!CAUTION] +> Color stops with only a color or only an interpolation hint are not supported. For best results you should always provide at least the color and position for each color stop. Double position color stops are supported. @@ -52,8 +53,9 @@ Double position color stops are supported. } ``` -⚠️ Variable colors are also not supported. -We can not mix colors when the color is a variable. +> [!CAUTION] +> Variable colors are not supported. +> We can not mix colors when the color is a variable. ```pcss .foo { @@ -129,7 +131,8 @@ postcssGradientsInterpolationMethod({ preserve: false }) The `enableProgressiveCustomProperties` option determines whether the original notation is wrapped with `@supports` when used in Custom Properties. By default, it is enabled. -⚠️ We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). +> [!NOTE] +> We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). ```js postcssGradientsInterpolationMethod({ enableProgressiveCustomProperties: false }) diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts deleted file mode 100644 index 4159c39f..00000000 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { ColorData } from '@csstools/css-color-parser'; -import type { ComponentValue } from '@csstools/css-parser-algorithms'; -import { TokenNode } from '@csstools/css-parser-algorithms'; -export type ColorStop = { - color: ComponentValue; - colorData: ColorData; - position: ComponentValue; -}; -export declare function interpolateColorsInColorStopsList(colorStops: Array, colorSpace: TokenNode, hueInterpolationMethod: TokenNode | null, wideGamut?: boolean): Array | false; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ec..00000000 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs index 3ab3f55e..0a4d9bfc 100644 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),o=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer"),n=require("@csstools/css-color-parser");const i=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,s=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(e){const o=e.parent;if(!o)return!1;const t=e.prop.toLowerCase(),n=o.index(e);for(let e=0;e0&&N.some((e=>!o.isCommentNode(e)))&&N.push(new o.TokenNode([t.TokenType.Comma,",",-1,-1,void 0]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]])),trim([...N,...trim(g)])}function trim(e){let t=0,n=e.length-1;for(let n=0;n=0;t--)if(!o.isWhitespaceNode(e[t])){n=t;break}return e.slice(t,n+1)}const basePlugin=e=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(n){if(!i.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const s=t.tokenize({css:n.value}),r=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e);t&&(e.value=t)})));if(r===n.value)return;const a=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e,!0);t&&(e.value=t)})));n.cloneBefore({value:r}),r!==a&&n.cloneBefore({value:a}),null!=e&&e.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=o=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},o);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),o=require("@csstools/css-parser-algorithms"),t=require("@csstools/css-tokenizer"),n=require("@csstools/css-color-parser");const i=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,s=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(e){const o=e.parent;if(!o)return!1;const t=e.prop.toLowerCase(),n=o.index(e);for(let e=0;e0&&N.some((e=>!o.isCommentNode(e)))&&N.push(new o.TokenNode([t.TokenType.Comma,",",-1,-1,void 0]),new o.WhitespaceNode([[t.TokenType.Whitespace," ",-1,-1,void 0]])),trim([...N,...trim(g)])}function trim(e){let t=0,n=e.length-1;for(let n=0;n=0;t--)if(!o.isWhitespaceNode(e[t])){n=t;break}return e.slice(t,n+1)}const basePlugin=e=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(n){if(!i.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const s=t.tokenize({css:n.value}),r=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e);t&&(e.value=t)})));if(r===n.value)return;const a=o.stringify(o.replaceComponentValues(o.parseCommaSeparatedListOfComponentValues(s),(e=>{if(!o.isFunctionNode(e))return;const t=modifyGradientFunctionComponentValues(e,!0);t&&(e.value=t)})));n.cloneBefore({value:r}),r!==a&&n.cloneBefore({value:a}),e?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=o=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},o);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts index 0520e965..26b20e2f 100644 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.d.ts @@ -1,10 +1,14 @@ import type { PluginCreator } from 'postcss'; + /** postcss-gradients-interpolation-method plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ enableProgressiveCustomProperties?: boolean; }; + declare const postcssPlugin: PluginCreator; export default postcssPlugin; + +export { } diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs index 392d72e1..c0dfa7b5 100644 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs @@ -1 +1 @@ -import o from"@csstools/postcss-progressive-custom-properties";import{WhitespaceNode as e,TokenNode as t,FunctionNode as r,isCommentNode as n,isWhitespaceNode as i,isTokenNode as s,stringify as l,replaceComponentValues as a,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as u}from"@csstools/css-parser-algorithms";import{TokenType as p,tokenize as f}from"@csstools/css-tokenizer";import{serializeP3 as v,color as h,colorDataFitsRGB_Gamut as d,serializeRGB as m}from"@csstools/css-color-parser";const g=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,w=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(o){const e=o.parent;if(!e)return!1;const t=o.prop.toLowerCase(),r=e.index(o);for(let o=0;o0&&S.some((o=>!n(o)))&&S.push(new t([p.Comma,",",-1,-1,void 0]),new e([[p.Whitespace," ",-1,-1,void 0]])),trim([...S,...trim(g)])}function trim(o){let e=0,t=o.length-1;for(let t=0;t=0;e--)if(!i(o[e])){t=e;break}return o.slice(e,t+1)}const basePlugin=o=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(e){if(!g.test(e.value))return;if(hasFallback(e))return;if(hasSupportsAtRuleAncestor(e))return;const t=f({css:e.value}),r=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o);e&&(o.value=e)})));if(r===e.value)return;const n=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o,!0);e&&(o.value=e)})));e.cloneBefore({value:r}),r!==n&&e.cloneBefore({value:n}),null!=o&&o.preserve||e.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},e);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[o(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import o from"@csstools/postcss-progressive-custom-properties";import{WhitespaceNode as e,TokenNode as t,FunctionNode as r,isCommentNode as n,isWhitespaceNode as i,isTokenNode as s,stringify as l,replaceComponentValues as a,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as u}from"@csstools/css-parser-algorithms";import{TokenType as p,tokenize as f}from"@csstools/css-tokenizer";import{serializeP3 as v,color as h,colorDataFitsRGB_Gamut as m,serializeRGB as d,SyntaxFlag as g}from"@csstools/css-color-parser";const w=/(repeating-)?(linear|radial|conic)-gradient\(.*?in/i,C=/^(repeating-)?(linear|radial|conic)-gradient$/i;function hasFallback(o){const e=o.parent;if(!e)return!1;const t=o.prop.toLowerCase(),r=e.index(o);for(let o=0;o0&&w.some((o=>!n(o)))&&w.push(new t([p.Comma,",",-1,-1,void 0]),new e([[p.Whitespace," ",-1,-1,void 0]])),trim([...w,...trim(g)])}function trim(o){let e=0,t=o.length-1;for(let t=0;t=0;e--)if(!i(o[e])){t=e;break}return o.slice(e,t+1)}const basePlugin=o=>({postcssPlugin:"postcss-gradients-interpolation-method",Declaration(e){if(!w.test(e.value))return;if(hasFallback(e))return;if(hasSupportsAtRuleAncestor(e))return;const t=f({css:e.value}),r=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o);e&&(o.value=e)})));if(r===e.value)return;const n=l(a(c(t),(o=>{if(!u(o))return;const e=modifyGradientFunctionComponentValues(o,!0);e&&(o.value=e)})));e.cloneBefore({value:r}),r!==n&&e.cloneBefore({value:n}),o?.preserve||e.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},e);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[o(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts deleted file mode 100644 index 2d83e89e..00000000 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/is-gradient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const gradientFunctionRegex: RegExp; -export declare const gradientNameRegex: RegExp; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts deleted file mode 100644 index 6917beda..00000000 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ComponentValue, FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function modifyGradientFunctionComponentValues(gradientFunction: FunctionNode, wideGamut?: boolean): Array | false; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts b/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts deleted file mode 100644 index 0342da5c..00000000 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ColorStop } from './color-stop-list'; -import type { ComponentValue } from '@csstools/css-parser-algorithms'; -export declare function parseColorStops(componentValues: Array): Array | false; diff --git a/node_modules/@csstools/postcss-gradients-interpolation-method/package.json b/node_modules/@csstools/postcss-gradients-interpolation-method/package.json index b6fdb43e..94c16663 100644 --- a/node_modules/@csstools/postcss-gradients-interpolation-method/package.json +++ b/node_modules/@csstools/postcss-gradients-interpolation-method/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-gradients-interpolation-method", "description": "Use interpolation methods in CSS gradient functions", - "version": "4.0.7", + "version": "4.0.8", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -35,25 +38,14 @@ "dist" ], "dependencies": { - "@csstools/css-color-parser": "^1.4.0", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1", - "@csstools/postcss-progressive-custom-properties": "^3.0.2" + "@csstools/css-color-parser": "^1.5.0", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2", + "@csstools/postcss-progressive-custom-properties": "^3.0.3" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-gradients-interpolation-method#readme", "repository": { "type": "git", @@ -75,14 +67,5 @@ "radial", "repeating", "syntax" - ], - "csstools": { - "cssdbId": "gradients-interpolation-method", - "exportName": "postcssGradientsInterpolationMethod", - "humanReadableName": "PostCSS Gradients Interpolation Method", - "specUrl": "https://drafts.csswg.org/css-images-4/#linear-gradients" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md b/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md index d3d6844f..ef182ca8 100644 --- a/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md +++ b/node_modules/@csstools/postcss-hwb-function/CHANGELOG.md @@ -1,5 +1,14 @@ # Changes to PostCSS HWB Function +### 3.0.7 + +_December 15, 2023_ + +- Skip transforms when a color value contains experimental syntax +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor) + ### 3.0.6 _October 9, 2023_ @@ -12,102 +21,4 @@ _October 2, 2023_ - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#133) (patch) -### 3.0.4 - -_September 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#132) (patch) - -### 3.0.3 - -_September 2, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#131) (patch) - -### 3.0.2 - -_August 28, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#130) (minor) - -### 3.0.1 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#122) (patch) - -### 2.2.2 - -_May 19, 2023_ - -- Ignore relative color syntax -- Updated `@csstools/css-color-parser` to `1.2.0` (minor) - - -### 2.2.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-color-parser` to `1.1.2` (patch) - -### 2.2.0 - -_March 25, 2023_ - -- Add `@csstools/css-color-parser` dependency for all color value transformations. -- Add support for `calc` expressions in color components. - -### 2.1.1 - -_February 8, 2023_ - -- Reduce the amount of duplicate fallback CSS. - -### 2.1.0 - -_February 2, 2023_ - -- Add: `@csstools/color-helpers` dependency for all color value transformations. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.2 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 1.0.1 - -_May 18, 2022_ - -- Fix grayscale conversions. - -### 1.0.0 - -_January 22, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-hwb-function/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-hwb-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-hwb-function/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index 7fbe0b29..00000000 --- a/node_modules/@csstools/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Node } from 'postcss'; -export declare const atSupportsHwbParams = "(color: hwb(0 0% 0%))"; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.cjs b/node_modules/@csstools/postcss-hwb-function/dist/index.cjs index 19fafe2e..9e4a79aa 100644 --- a/node_modules/@csstools/postcss-hwb-function/dist/index.cjs +++ b/node_modules/@csstools/postcss-hwb-function/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-tokenizer");const s="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(s))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e{const l="preserve"in Object(a)&&Boolean(null==a?void 0:a.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(a,{postcss:c})=>{const p=a.value;if(!o.test(p))return;if(l&&hasSupportsAtRuleAncestor(a))return;if(hasFallback(a))return;const u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(r.tokenize({css:p})),(r=>{if(t.isFunctionNode(r)&&n.test(r.getName())){const t=e.color(r);if(!t)return;if(t.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords))return;if(t.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))return;return e.serializeRGB(t)}})),i=t.stringify(u);if(i!==p)if(a.variable&&l&&a.parent){const e=a.parent,t=c.atRule({name:"supports",params:s,source:a.source}),r=e.clone();r.removeAll(),r.append(a.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,s),a.replaceWith(a.clone({value:i}))}else l?a.cloneBefore({value:i}):a.replaceWith(a.clone({value:i}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms"),r=require("@csstools/css-tokenizer");const s="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(s))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e{const l="preserve"in Object(a)&&Boolean(a?.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(a,{postcss:p})=>{const c=a.value;if(!o.test(c))return;if(l&&hasSupportsAtRuleAncestor(a))return;if(hasFallback(a))return;const u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(r.tokenize({css:c})),(r=>{if(t.isFunctionNode(r)&&n.test(r.getName())){const t=e.color(r);if(!t)return;if(t.syntaxFlags.has(e.SyntaxFlag.Experimental))return;if(t.syntaxFlags.has(e.SyntaxFlag.HasNoneKeywords))return;if(t.syntaxFlags.has(e.SyntaxFlag.RelativeColorSyntax))return;return e.serializeRGB(t)}})),i=t.stringify(u);if(i!==c)if(a.variable&&l&&a.parent){const e=a.parent,t=p.atRule({name:"supports",params:s,source:a.source}),r=e.clone();r.removeAll(),r.append(a.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,s),a.replaceWith(a.clone({value:i}))}else l?a.cloneBefore({value:i}):a.replaceWith(a.clone({value:i}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts b/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts index 0304f878..d469e87a 100644 --- a/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts +++ b/node_modules/@csstools/postcss-hwb-function/dist/index.d.ts @@ -1,9 +1,13 @@ import type { PluginCreator } from 'postcss'; + /** postcss-hwb-function plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; + /** Transform hwb() functions in CSS. */ declare const postcssPlugin: PluginCreator; export default postcssPlugin; + +export { } diff --git a/node_modules/@csstools/postcss-hwb-function/dist/index.mjs b/node_modules/@csstools/postcss-hwb-function/dist/index.mjs index 067e6891..a8603a7a 100644 --- a/node_modules/@csstools/postcss-hwb-function/dist/index.mjs +++ b/node_modules/@csstools/postcss-hwb-function/dist/index.mjs @@ -1 +1 @@ -import{color as e,SyntaxFlag as t,serializeRGB as r}from"@csstools/css-color-parser";import{replaceComponentValues as s,parseCommaSeparatedListOfComponentValues as o,isFunctionNode as n,stringify as a}from"@csstools/css-parser-algorithms";import{tokenize as l}from"@csstools/css-tokenizer";const p="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(p))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e{const f="preserve"in Object(i)&&Boolean(null==i?void 0:i.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(i,{postcss:m})=>{const h=i.value;if(!c.test(h))return;if(f&&hasSupportsAtRuleAncestor(i))return;if(hasFallback(i))return;const v=s(o(l({css:h})),(s=>{if(n(s)&&u.test(s.getName())){const o=e(s);if(!o)return;if(o.syntaxFlags.has(t.HasNoneKeywords))return;if(o.syntaxFlags.has(t.RelativeColorSyntax))return;return r(o)}})),d=a(v);if(d!==h)if(i.variable&&f&&i.parent){const e=i.parent,t=m.atRule({name:"supports",params:p,source:i.source}),r=e.clone();r.removeAll(),r.append(i.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,p),i.replaceWith(i.clone({value:d}))}else f?i.cloneBefore({value:d}):i.replaceWith(i.clone({value:d}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import{color as e,SyntaxFlag as t,serializeRGB as r}from"@csstools/css-color-parser";import{replaceComponentValues as s,parseCommaSeparatedListOfComponentValues as o,isFunctionNode as n,stringify as a}from"@csstools/css-parser-algorithms";import{tokenize as p}from"@csstools/css-tokenizer";const l="(color: hwb(0 0% 0%))";function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&t.params.includes(l))return!0;t=t.parent}else t=t.parent;return!1}function hasFallback(e){const t=e.parent;if(!t)return!1;const r=e.prop.toLowerCase(),s=t.index(e);for(let e=0;e{const f="preserve"in Object(i)&&Boolean(i?.preserve);return{postcssPlugin:"postcss-hwb-function",Declaration:(i,{postcss:m})=>{const h=i.value;if(!c.test(h))return;if(f&&hasSupportsAtRuleAncestor(i))return;if(hasFallback(i))return;const v=s(o(p({css:h})),(s=>{if(n(s)&&u.test(s.getName())){const o=e(s);if(!o)return;if(o.syntaxFlags.has(t.Experimental))return;if(o.syntaxFlags.has(t.HasNoneKeywords))return;if(o.syntaxFlags.has(t.RelativeColorSyntax))return;return r(o)}})),w=a(v);if(w!==h)if(i.variable&&f&&i.parent){const e=i.parent,t=m.atRule({name:"supports",params:l,source:i.source}),r=e.clone();r.removeAll(),r.append(i.clone()),t.append(r),insertAtSupportsAfterCorrectRule(t,e,l),i.replaceWith(i.clone({value:w}))}else f?i.cloneBefore({value:w}):i.replaceWith(i.clone({value:w}))}}};function insertAtSupportsAfterCorrectRule(e,t,r){let s=t,o=t.next();for(;s&&o&&"atrule"===o.type&&"supports"===o.name.toLowerCase()&&o.params===r;)s=o,o=o.next();s.after(e)}postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-hwb-function/package.json b/node_modules/@csstools/postcss-hwb-function/package.json index de60d8d8..89ace0bb 100644 --- a/node_modules/@csstools/postcss-hwb-function/package.json +++ b/node_modules/@csstools/postcss-hwb-function/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-hwb-function", "description": "Use hwb() color functions in CSS", - "version": "3.0.6", + "version": "3.0.7", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -36,24 +39,13 @@ "dist" ], "dependencies": { - "@csstools/css-color-parser": "^1.4.0", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1" + "@csstools/css-color-parser": "^1.5.0", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-hwb-function#readme", "repository": { "type": "git", @@ -77,12 +69,5 @@ "rgba", "space", "syntax" - ], - "csstools": { - "exportName": "postcssHWBFunction", - "humanReadableName": "PostCSS HWB Function" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-ic-unit/CHANGELOG.md b/node_modules/@csstools/postcss-ic-unit/CHANGELOG.md index 33354058..31630c25 100644 --- a/node_modules/@csstools/postcss-ic-unit/CHANGELOG.md +++ b/node_modules/@csstools/postcss-ic-unit/CHANGELOG.md @@ -1,5 +1,12 @@ # Changes to PostCSS IC Unit +### 3.0.3 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch) + ### 3.0.2 _October 9, 2023_ @@ -13,53 +20,4 @@ _September 18, 2023_ - Improve performance - Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch) -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#300) (major) - -### 2.0.4 - -_June 1, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.3.0` (minor) - - -### 2.0.3 - -_May 19, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.2.0` (minor) - - -### 2.0.2 - -_February 8, 2023_ - -- Reduce the amount of duplicate fallback CSS. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.1 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 1.0.0 - -_February 15, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-ic-unit/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-ic-unit/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-ic-unit/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-ic-unit/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-ic-unit/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-ic-unit/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ec..00000000 --- a/node_modules/@csstools/postcss-ic-unit/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-ic-unit/dist/index.cjs b/node_modules/@csstools/postcss-ic-unit/dist/index.cjs index d85ab48a..5d207a0c 100644 --- a/node_modules/@csstools/postcss-ic-unit/dist/index.cjs +++ b/node_modules/@csstools/postcss-ic-unit/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("postcss-value-parser");function hasFallback(e){const s=e.parent;if(!s)return!1;const t=e.prop.toLowerCase(),r=s.index(e);for(let e=0;e({postcssPlugin:"postcss-ic-unit",Declaration(r){if(!t.test(r.value))return;if(hasFallback(r))return;if(hasSupportsAtRuleAncestor(r))return;const o=s(r.value);o.walk((e=>{if(!e.type||"word"!==e.type)return;const t=s.unit(e.value);t&&"ic"===t.unit.toLowerCase()&&(e.value=`${t.number}em`)}));const n=String(o);n!==r.value&&(r.cloneBefore({value:n}),null!=e&&e.preserve||r.remove())}});basePlugin.postcss=!0;const postcssPlugin=s=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},s);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-ic-unit",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("postcss-value-parser");function hasFallback(e){const s=e.parent;if(!s)return!1;const t=e.prop.toLowerCase(),r=s.index(e);for(let e=0;e({postcssPlugin:"postcss-ic-unit",Declaration(r){if(!t.test(r.value))return;if(hasFallback(r))return;if(hasSupportsAtRuleAncestor(r))return;const o=s(r.value);o.walk((e=>{if(!e.type||"word"!==e.type)return;const t=s.unit(e.value);t&&"ic"===t.unit.toLowerCase()&&(e.value=`${t.number}em`)}));const n=String(o);n!==r.value&&(r.cloneBefore({value:n}),e?.preserve||r.remove())}});basePlugin.postcss=!0;const postcssPlugin=s=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},s);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-ic-unit",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-ic-unit/dist/index.d.ts b/node_modules/@csstools/postcss-ic-unit/dist/index.d.ts index 6900fd7d..d894fc82 100644 --- a/node_modules/@csstools/postcss-ic-unit/dist/index.d.ts +++ b/node_modules/@csstools/postcss-ic-unit/dist/index.d.ts @@ -1,10 +1,14 @@ import type { PluginCreator } from 'postcss'; + /** postcss-ic-unit plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ enableProgressiveCustomProperties?: boolean; }; + declare const postcssPlugin: PluginCreator; export default postcssPlugin; + +export { } diff --git a/node_modules/@csstools/postcss-ic-unit/dist/index.mjs b/node_modules/@csstools/postcss-ic-unit/dist/index.mjs index ef0b7a83..def48e6e 100644 --- a/node_modules/@csstools/postcss-ic-unit/dist/index.mjs +++ b/node_modules/@csstools/postcss-ic-unit/dist/index.mjs @@ -1 +1 @@ -import e from"@csstools/postcss-progressive-custom-properties";import s from"postcss-value-parser";function hasFallback(e){const s=e.parent;if(!s)return!1;const t=e.prop.toLowerCase(),r=s.index(e);for(let e=0;e({postcssPlugin:"postcss-ic-unit",Declaration(r){if(!t.test(r.value))return;if(hasFallback(r))return;if(hasSupportsAtRuleAncestor(r))return;const o=s(r.value);o.walk((e=>{if(!e.type||"word"!==e.type)return;const t=s.unit(e.value);t&&"ic"===t.unit.toLowerCase()&&(e.value=`${t.number}em`)}));const n=String(o);n!==r.value&&(r.cloneBefore({value:n}),null!=e&&e.preserve||r.remove())}});basePlugin.postcss=!0;const postcssPlugin=s=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},s);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-ic-unit",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import e from"@csstools/postcss-progressive-custom-properties";import s from"postcss-value-parser";function hasFallback(e){const s=e.parent;if(!s)return!1;const t=e.prop.toLowerCase(),r=s.index(e);for(let e=0;e({postcssPlugin:"postcss-ic-unit",Declaration(r){if(!t.test(r.value))return;if(hasFallback(r))return;if(hasSupportsAtRuleAncestor(r))return;const o=s(r.value);o.walk((e=>{if(!e.type||"word"!==e.type)return;const t=s.unit(e.value);t&&"ic"===t.unit.toLowerCase()&&(e.value=`${t.number}em`)}));const n=String(o);n!==r.value&&(r.cloneBefore({value:n}),e?.preserve||r.remove())}});basePlugin.postcss=!0;const postcssPlugin=s=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},s);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-ic-unit",plugins:[e(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-ic-unit/package.json b/node_modules/@csstools/postcss-ic-unit/package.json index e638c94a..dc14e1da 100644 --- a/node_modules/@csstools/postcss-ic-unit/package.json +++ b/node_modules/@csstools/postcss-ic-unit/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-ic-unit", "description": "Use the ic length unit", - "version": "3.0.2", + "version": "3.0.3", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -35,23 +38,12 @@ "dist" ], "dependencies": { - "@csstools/postcss-progressive-custom-properties": "^3.0.2", + "@csstools/postcss-progressive-custom-properties": "^3.0.3", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-ic-unit#readme", "repository": { "type": "git", @@ -67,12 +59,5 @@ "length", "postcss-plugin", "values" - ], - "csstools": { - "exportName": "postcssIcUnit", - "humanReadableName": "PostCSS IC Unit" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-initial/CHANGELOG.md b/node_modules/@csstools/postcss-initial/CHANGELOG.md index 296a43b5..dd4e3eb9 100644 --- a/node_modules/@csstools/postcss-initial/CHANGELOG.md +++ b/node_modules/@csstools/postcss-initial/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Initial +### 1.0.1 + +_December 15, 2023_ + +- Fix type definitions + ### 1.0.0 _September 18, 2023_ diff --git a/node_modules/@csstools/postcss-initial/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-initial/dist/has-fallback-decl.d.ts deleted file mode 100644 index c044b787..00000000 --- a/node_modules/@csstools/postcss-initial/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasExactFallback(node: Declaration, newValue: string): boolean; diff --git a/node_modules/@csstools/postcss-initial/dist/index.d.ts b/node_modules/@csstools/postcss-initial/dist/index.d.ts index 55f858c1..20f8fc5d 100644 --- a/node_modules/@csstools/postcss-initial/dist/index.d.ts +++ b/node_modules/@csstools/postcss-initial/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-initial plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-initial/dist/properties.d.ts b/node_modules/@csstools/postcss-initial/dist/properties.d.ts deleted file mode 100644 index 5345546e..00000000 --- a/node_modules/@csstools/postcss-initial/dist/properties.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const properties: Map; -export declare const allProperties: string[]; diff --git a/node_modules/@csstools/postcss-initial/package.json b/node_modules/@csstools/postcss-initial/package.json index d5b6e09e..961cbbf9 100644 --- a/node_modules/@csstools/postcss-initial/package.json +++ b/node_modules/@csstools/postcss-initial/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-initial", "description": "PostCSS plugin to fallback initial keyword.", - "version": "1.0.0", + "version": "1.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -47,17 +50,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-initial#readme", "repository": { "type": "git", @@ -67,14 +59,5 @@ "bugs": "https://github.com/csstools/postcss-plugins/issues", "keywords": [ "postcss-plugin" - ], - "csstools": { - "cssdbId": "all-property", - "exportName": "postcssInitial", - "humanReadableName": "PostCSS Initial", - "specUrl": "https://www.w3.org/TR/css-cascade-4/#initial" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md b/node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md index 12453434..fb009385 100644 --- a/node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md +++ b/node_modules/@csstools/postcss-is-pseudo-class/CHANGELOG.md @@ -1,5 +1,12 @@ # Changes to PostCSS Is Pseudo Class +### 4.0.4 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#301) (patch) + ### 4.0.3 _October 2, 2023_ @@ -12,137 +19,4 @@ _September 18, 2023_ - Improve performance -### 4.0.1 - -_September 2, 2023_ - -- Fix substitution when selectors have mixed types for compound selectors where one of two parts is a `:is()` pseudo class. - -```diff -header:is(.a .b) {} - -/* becomes : */ - -- header.a .b {} -+ .a header.b {} -``` - -### 4.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/selector-specificity`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md#300) (major) - -### 3.2.1 - -_May 19, 2023_ - -- Fix compound selectors with `*`. - -```diff -:is(.a *):is(h1, h2, h3) {} - -/* becomes : */ - -- .a *h1, .a *h2, .a *h3 {} -+ .a h1, .a h2, .a h3 {} -``` - -### 3.2.0 - -_April 10, 2023_ - -- Add support for more complex selector patterns. In particular anything where `:is()` is in the left-most compound selector. - -### 3.1.1 - -_February 8, 2023_ - -- Reduce the amount of duplicate fallback CSS. - -### 3.1.0 - -_February 2, 2023_ - -- Fix is pseudo inside a not pseudo (`:not(:is(h1, h2, h3))`) -- Reduce the output size when all selectors are known to be valid - -### 3.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 3.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 2.0.7 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 2.0.6 - -_June 23, 2022_ - -- Fix selector order with any pseudo element. -- Fix transforming pseudo elements in `:is()`. Following the specification pseudo elements are invalid and we now transform to a known invalid pseudo element. -- Add `onPseudoElement` plugin option. Set `{ onPseudoElement: 'warning' }` to receive warnings when this plugin encounters an unprocessable pseudo element. - -### 2.0.5 - -_June 4, 2022_ - -- Update `@csstools/selector-specificity` (major) - -### 2.0.4 - -_May 17, 2022_ - -- Fix selector order with `:before` and other pseudo elements. - -### 2.0.3 - -_May 11, 2022_ - -- Use `@csstools/selector-specificity` for specificity calculations. - -### 2.0.2 - -_April 4, 2022_ - -- Improved : compound selector order with pseudo elements -- Improved : selector specificity calculation. - -### 2.0.1 - -_March 4, 2022_ - -- Preserve selector order as much as possible. Fixes issues where pseudo elements `::before` were moved. - -### 2.0.0 - -_January 31, 2022_ - -- Remove `skip` flag in `onComplexSelectors` option. - -If a complex selector is encountered that has no known equivalent, it will always be skipped and preserved now. - -The previous behavior was to remove `:is()` even if that broke the selector. - -### 1.0.1 - -_January 17, 2022_ - -- Fix selector order - -### 1.0.0 - -_January 13, 2022_ - -- initial release +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-is-pseudo-class/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs index 939299bd..d1355d60 100644 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs +++ b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-selector-parser"),o=require("@csstools/selector-specificity");function alwaysValidSelector(o){const s=e().astSync(o);let t=!0;return s.walk((e=>{var o,s;if("class"!==e.type&&"comment"!==e.type&&"id"!==e.type&&"root"!==e.type&&"selector"!==e.type&&"string"!==e.type&&"tag"!==e.type&&"universal"!==e.type&&("attribute"!==e.type||e.insensitive)&&("combinator"!==e.type||"+"!==e.value&&">"!==e.value&&"~"!==e.value&&" "!==e.value)&&("pseudo"!==e.type||null!=(o=e.nodes)&&o.length||":hover"!==e.value.toLowerCase()&&":focus"!==e.value.toLowerCase())){if("pseudo"===e.type&&1===(null==(s=e.nodes)?void 0:s.length)&&":not"===e.value.toLowerCase()){let o=!0;if(e.nodes[0].walkCombinators((()=>{o=!1})),o)return}return t=!1,!1}})),t}function sortCompoundSelectorsInsideComplexSelector(o){if(!o||!o.nodes||1===o.nodes.length)return;const s=[];let t=[];for(let n=0;n"selector"===e.type&&"selector"===o.type&&e.nodes.length&&o.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o,o.type):"selector"===o.type&&o.nodes.length?selectorTypeOrder(e,e.type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):selectorTypeOrder(e,e.type)-selectorTypeOrder(o,o.type)));const t=new Set(o.map((e=>e.type))),r=t.has("universal")&&(t.has("tag")||t.has("attribute")||t.has("class")||t.has("id")||t.has("pseudo"));for(let e=0;e=0;s--){const t=n[s-1];if(n[s].remove(),t&&"tag"===t.type&&"tag"===n[s].type){const t=e.pseudo({value:":is",nodes:[e.selector({value:"",nodes:[n[s]]})]});o.prepend(t)}else o.prepend(n[s])}}function selectorTypeOrder(o,t){return e.isPseudoElement(o)?s.pseudoElement:s[t]}const s={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function childAdjacentChild(e){return!(!e||!e.nodes)&&("selector"===e.type&&(3===e.nodes.length&&(!(!e.nodes[0]||"pseudo"!==e.nodes[0].type||":-csstools-matches"!==e.nodes[0].value)&&(!(!e.nodes[1]||"combinator"!==e.nodes[1].type||"+"!==e.nodes[1].value&&"~"!==e.nodes[1].value)&&(!(!e.nodes[2]||"pseudo"!==e.nodes[2].type||":-csstools-matches"!==e.nodes[2].value)&&(!(!e.nodes[0].nodes||1!==e.nodes[0].nodes.length)&&("selector"===e.nodes[0].nodes[0].type&&(!(!e.nodes[0].nodes[0].nodes||3!==e.nodes[0].nodes[0].nodes.length)&&(!(!e.nodes[0].nodes[0].nodes||"combinator"!==e.nodes[0].nodes[0].nodes[1].type||">"!==e.nodes[0].nodes[0].nodes[1].value)&&(!(!e.nodes[2].nodes||1!==e.nodes[2].nodes.length)&&("selector"===e.nodes[2].nodes[0].type&&(!(!e.nodes[2].nodes[0].nodes||3!==e.nodes[2].nodes[0].nodes.length)&&(!(!e.nodes[2].nodes[0].nodes||"combinator"!==e.nodes[2].nodes[0].nodes[1].type||">"!==e.nodes[2].nodes[0].nodes[1].value)&&(e.nodes[0].nodes[0].insertAfter(e.nodes[0].nodes[0].nodes[0],e.nodes[2].nodes[0].nodes[0].clone()),e.nodes[2].nodes[0].nodes[1].remove(),e.nodes[2].nodes[0].nodes[0].remove(),e.nodes[0].replaceWith(e.nodes[0].nodes[0]),e.nodes[2].replaceWith(e.nodes[2].nodes[0]),!0))))))))))))))}function isInCompoundWithOneOtherElement(o){if(!o||!o.nodes)return!1;if("selector"!==o.type)return!1;if(2!==o.nodes.length)return!1;let s,t;return o.nodes[0]&&"pseudo"===o.nodes[0].type&&":-csstools-matches"===o.nodes[0].value?(s=0,t=1):o.nodes[1]&&"pseudo"===o.nodes[1].type&&":-csstools-matches"===o.nodes[1].value&&(s=1,t=0),!!s&&(!!o.nodes[t]&&(("selector"!==o.nodes[t].type||!o.nodes[t].some((o=>"combinator"===o.type||e.isPseudoElement(o))))&&("combinator"!==o.nodes[t].type&&(o.nodes[s].nodes[0].append(o.nodes[t].clone()),o.nodes[s].replaceWith(...o.nodes[s].nodes[0].nodes),o.nodes[t].remove(),!0))))}function isPseudoInFirstCompound(e){if(!e||!e.nodes)return!1;if("selector"!==e.type)return!1;let o=-1;for(let s=0;s{t.nodes[0].append(e.clone())})),n.forEach((e=>{t.nodes[0].append(e.clone())})),t.replaceWith(...t.nodes),s.forEach((e=>{e.remove()})),n.forEach((e=>{e.remove()})),!0}function complexSelectors(o,s,t,n){return o.flatMap((o=>{if(-1===o.indexOf(":-csstools-matches")&&-1===o.toLowerCase().indexOf(":is"))return o;const r=e().astSync(o);return r.walkPseudos((o=>{if(":is"===o.value.toLowerCase()&&o.nodes&&o.nodes.length&&"selector"===o.nodes[0].type&&0===o.nodes[0].nodes.length)return o.value=":not",void o.nodes[0].append(e.universal());if(":-csstools-matches"===o.value)if(!o.nodes||o.nodes.length){if(o.walkPseudos((o=>{if(e.isPseudoElement(o)){let e=o.value;if(e.startsWith("::-csstools-invalid-"))return;for(;e.startsWith(":");)e=e.slice(1);o.value=`::-csstools-invalid-${e}`,n()}})),1===o.nodes.length&&"selector"===o.nodes[0].type){if(1===o.nodes[0].nodes.length)return void o.replaceWith(o.nodes[0].nodes[0]);if(!o.nodes[0].some((e=>"combinator"===e.type)))return void o.replaceWith(...o.nodes[0].nodes)}1!==r.nodes.length||"selector"!==r.nodes[0].type||1!==r.nodes[0].nodes.length||r.nodes[0].nodes[0]!==o?childAdjacentChild(o.parent)||isInCompoundWithOneOtherElement(o.parent)||isPseudoInFirstCompound(o.parent)||("warning"===s.onComplexSelector&&t(),o.value=":is"):o.replaceWith(...o.nodes[0].nodes)}else o.remove()})),r.walk((e=>{"selector"===e.type&&"nodes"in e&&1===e.nodes.length&&"selector"===e.nodes[0].type&&e.replaceWith(e.nodes[0])})),r.walk((e=>{"nodes"in e&&sortCompoundSelectorsInsideComplexSelector(e)})),r.toString()})).filter((e=>!!e))}function splitSelectors(s,t,n=0){const r=":not(#"+t.specificityMatchingName+")",l=":not(."+t.specificityMatchingName+")",d=":not("+t.specificityMatchingName+")";return s.flatMap((s=>{if(-1===s.toLowerCase().indexOf(":is"))return s;let i=!1;const c=[];if(e().astSync(s).walkPseudos((e=>{var s,t,n,a;if(":is"!==e.value.toLowerCase()||!e.nodes||!e.nodes.length)return;if("selector"===e.nodes[0].type&&0===e.nodes[0].nodes.length)return;if("pseudo"===(null==(s=e.parent)||null==(s=s.parent)?void 0:s.type)&&":not"===(null==(t=e.parent)||null==(t=t.parent)||null==(t=t.value)?void 0:t.toLowerCase()))return void c.push([{start:e.parent.parent.sourceIndex,end:e.parent.parent.sourceIndex+e.parent.parent.toString().length,option:`:not(${e.nodes.toString()})`}]);if("pseudo"===(null==(n=e.parent)||null==(n=n.parent)?void 0:n.type)&&":has"===(null==(a=e.parent)||null==(a=a.parent)||null==(a=a.value)?void 0:a.toLowerCase()))return void(e.value=":-csstools-matches");let p=e.parent;for(;p;){if(p.value&&":is"===p.value.toLowerCase()&&"pseudo"===p.type)return void(i=!0);p=p.parent}const u=o.selectorSpecificity(e),h=e.sourceIndex,f=h+e.toString().length,y=[];e.nodes.forEach((e=>{const s={start:h,end:f,option:""},t=o.selectorSpecificity(e);let n=e.toString().trim();const i=Math.max(0,u.a-t.a),c=Math.max(0,u.b-t.b),a=Math.max(0,u.c-t.c);for(let e=0;e{let o="";for(let n=0;n!!e))}function cartesianProduct(...e){const o=[],s=e.length-1;return function helper(t,n){for(let r=0,l=e[n].length;r{const o={specificityMatchingName:"does-not-exist",...e||{}};return{postcssPlugin:"postcss-is-pseudo-class",prepare(){const e=new WeakSet;return{Rule(s,{result:n}){if(!s.selector)return;if(!t.test(s.selector))return;if(e.has(s))return;let r=!1;const warnOnComplexSelector=()=>{"warning"===o.onComplexSelector&&(r||(r=!0,s.warn(n,`Complex selectors in '${s.selector}' can not be transformed to an equivalent selector without ':is()'.`)))};let l=!1;const warnOnPseudoElements=()=>{"warning"===o.onPseudoElement&&(l||(l=!0,s.warn(n,`Pseudo elements are not allowed in ':is()', unable to transform '${s.selector}'`)))};try{let t=!1;const n=[],r=complexSelectors(splitSelectors(s.selectors,{specificityMatchingName:o.specificityMatchingName}),{onComplexSelector:o.onComplexSelector},warnOnComplexSelector,warnOnPseudoElements);if(Array.from(new Set(r)).forEach((o=>{if(s.selectors.indexOf(o)>-1)n.push(o);else{if(alwaysValidSelector(o))return n.push(o),void(t=!0);e.add(s),s.cloneBefore({selector:o}),t=!0}})),n.length&&t&&(e.add(s),s.cloneBefore({selectors:n})),!o.preserve){if(!t)return;s.remove()}}catch(e){if(e.message.indexOf("call stack size exceeded")>-1)throw e;s.warn(n,`Failed to parse selector "${s.selector}"`)}}}}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("postcss-selector-parser"),o=require("@csstools/selector-specificity");function alwaysValidSelector(o){const s=e().astSync(o);let t=!0;return s.walk((e=>{if("class"!==e.type&&"comment"!==e.type&&"id"!==e.type&&"root"!==e.type&&"selector"!==e.type&&"string"!==e.type&&"tag"!==e.type&&"universal"!==e.type&&("attribute"!==e.type||e.insensitive)&&("combinator"!==e.type||"+"!==e.value&&">"!==e.value&&"~"!==e.value&&" "!==e.value)&&("pseudo"!==e.type||e.nodes?.length||":hover"!==e.value.toLowerCase()&&":focus"!==e.value.toLowerCase())){if("pseudo"===e.type&&1===e.nodes?.length&&":not"===e.value.toLowerCase()){let o=!0;if(e.nodes[0].walkCombinators((()=>{o=!1})),o)return}return t=!1,!1}})),t}function sortCompoundSelectorsInsideComplexSelector(o){if(!o||!o.nodes||1===o.nodes.length)return;const s=[];let t=[];for(let n=0;n"selector"===e.type&&"selector"===o.type&&e.nodes.length&&o.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o,o.type):"selector"===o.type&&o.nodes.length?selectorTypeOrder(e,e.type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):selectorTypeOrder(e,e.type)-selectorTypeOrder(o,o.type)));const t=new Set(o.map((e=>e.type))),r=t.has("universal")&&(t.has("tag")||t.has("attribute")||t.has("class")||t.has("id")||t.has("pseudo"));for(let e=0;e=0;s--){const t=n[s-1];if(n[s].remove(),t&&"tag"===t.type&&"tag"===n[s].type){const t=e.pseudo({value:":is",nodes:[e.selector({value:"",nodes:[n[s]]})]});o.prepend(t)}else o.prepend(n[s])}}function selectorTypeOrder(o,t){return e.isPseudoElement(o)?s.pseudoElement:s[t]}const s={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function childAdjacentChild(e){return!(!e||!e.nodes)&&("selector"===e.type&&(3===e.nodes.length&&(!(!e.nodes[0]||"pseudo"!==e.nodes[0].type||":-csstools-matches"!==e.nodes[0].value)&&(!(!e.nodes[1]||"combinator"!==e.nodes[1].type||"+"!==e.nodes[1].value&&"~"!==e.nodes[1].value)&&(!(!e.nodes[2]||"pseudo"!==e.nodes[2].type||":-csstools-matches"!==e.nodes[2].value)&&(!(!e.nodes[0].nodes||1!==e.nodes[0].nodes.length)&&("selector"===e.nodes[0].nodes[0].type&&(!(!e.nodes[0].nodes[0].nodes||3!==e.nodes[0].nodes[0].nodes.length)&&(!(!e.nodes[0].nodes[0].nodes||"combinator"!==e.nodes[0].nodes[0].nodes[1].type||">"!==e.nodes[0].nodes[0].nodes[1].value)&&(!(!e.nodes[2].nodes||1!==e.nodes[2].nodes.length)&&("selector"===e.nodes[2].nodes[0].type&&(!(!e.nodes[2].nodes[0].nodes||3!==e.nodes[2].nodes[0].nodes.length)&&(!(!e.nodes[2].nodes[0].nodes||"combinator"!==e.nodes[2].nodes[0].nodes[1].type||">"!==e.nodes[2].nodes[0].nodes[1].value)&&(e.nodes[0].nodes[0].insertAfter(e.nodes[0].nodes[0].nodes[0],e.nodes[2].nodes[0].nodes[0].clone()),e.nodes[2].nodes[0].nodes[1].remove(),e.nodes[2].nodes[0].nodes[0].remove(),e.nodes[0].replaceWith(e.nodes[0].nodes[0]),e.nodes[2].replaceWith(e.nodes[2].nodes[0]),!0))))))))))))))}function isInCompoundWithOneOtherElement(o){if(!o||!o.nodes)return!1;if("selector"!==o.type)return!1;if(2!==o.nodes.length)return!1;let s,t;return o.nodes[0]&&"pseudo"===o.nodes[0].type&&":-csstools-matches"===o.nodes[0].value?(s=0,t=1):o.nodes[1]&&"pseudo"===o.nodes[1].type&&":-csstools-matches"===o.nodes[1].value&&(s=1,t=0),!!s&&(!!o.nodes[t]&&(("selector"!==o.nodes[t].type||!o.nodes[t].some((o=>"combinator"===o.type||e.isPseudoElement(o))))&&("combinator"!==o.nodes[t].type&&(o.nodes[s].nodes[0].append(o.nodes[t].clone()),o.nodes[s].replaceWith(...o.nodes[s].nodes[0].nodes),o.nodes[t].remove(),!0))))}function isPseudoInFirstCompound(e){if(!e||!e.nodes)return!1;if("selector"!==e.type)return!1;let o=-1;for(let s=0;s{t.nodes[0].append(e.clone())})),n.forEach((e=>{t.nodes[0].append(e.clone())})),t.replaceWith(...t.nodes),s.forEach((e=>{e.remove()})),n.forEach((e=>{e.remove()})),!0}function complexSelectors(o,s,t,n){return o.flatMap((o=>{if(-1===o.indexOf(":-csstools-matches")&&-1===o.toLowerCase().indexOf(":is"))return o;const r=e().astSync(o);return r.walkPseudos((o=>{if(":is"===o.value.toLowerCase()&&o.nodes&&o.nodes.length&&"selector"===o.nodes[0].type&&0===o.nodes[0].nodes.length)return o.value=":not",void o.nodes[0].append(e.universal());if(":-csstools-matches"===o.value)if(!o.nodes||o.nodes.length){if(o.walkPseudos((o=>{if(e.isPseudoElement(o)){let e=o.value;if(e.startsWith("::-csstools-invalid-"))return;for(;e.startsWith(":");)e=e.slice(1);o.value=`::-csstools-invalid-${e}`,n()}})),1===o.nodes.length&&"selector"===o.nodes[0].type){if(1===o.nodes[0].nodes.length)return void o.replaceWith(o.nodes[0].nodes[0]);if(!o.nodes[0].some((e=>"combinator"===e.type)))return void o.replaceWith(...o.nodes[0].nodes)}1!==r.nodes.length||"selector"!==r.nodes[0].type||1!==r.nodes[0].nodes.length||r.nodes[0].nodes[0]!==o?childAdjacentChild(o.parent)||isInCompoundWithOneOtherElement(o.parent)||isPseudoInFirstCompound(o.parent)||("warning"===s.onComplexSelector&&t(),o.value=":is"):o.replaceWith(...o.nodes[0].nodes)}else o.remove()})),r.walk((e=>{"selector"===e.type&&"nodes"in e&&1===e.nodes.length&&"selector"===e.nodes[0].type&&e.replaceWith(e.nodes[0])})),r.walk((e=>{"nodes"in e&&sortCompoundSelectorsInsideComplexSelector(e)})),r.toString()})).filter((e=>!!e))}function splitSelectors(s,t,n=0){const r=":not(#"+t.specificityMatchingName+")",d=":not(."+t.specificityMatchingName+")",l=":not("+t.specificityMatchingName+")";return s.flatMap((s=>{if(-1===s.toLowerCase().indexOf(":is"))return s;let c=!1;const i=[];if(e().astSync(s).walkPseudos((e=>{if(":is"!==e.value.toLowerCase()||!e.nodes||!e.nodes.length)return;if("selector"===e.nodes[0].type&&0===e.nodes[0].nodes.length)return;if("pseudo"===e.parent?.parent?.type&&":not"===e.parent?.parent?.value?.toLowerCase())return void i.push([{start:e.parent.parent.sourceIndex,end:e.parent.parent.sourceIndex+e.parent.parent.toString().length,option:`:not(${e.nodes.toString()})`}]);if("pseudo"===e.parent?.parent?.type&&":has"===e.parent?.parent?.value?.toLowerCase())return void(e.value=":-csstools-matches");let s=e.parent;for(;s;){if(s.value&&":is"===s.value.toLowerCase()&&"pseudo"===s.type)return void(c=!0);s=s.parent}const t=o.selectorSpecificity(e),n=e.sourceIndex,a=n+e.toString().length,p=[];e.nodes.forEach((e=>{const s={start:n,end:a,option:""},c=o.selectorSpecificity(e);let i=e.toString().trim();const u=Math.max(0,t.a-c.a),h=Math.max(0,t.b-c.b),f=Math.max(0,t.c-c.c);for(let e=0;e{let o="";for(let t=0;t!!e))}function cartesianProduct(...e){const o=[],s=e.length-1;return function helper(t,n){for(let r=0,d=e[n].length;r{const o={specificityMatchingName:"does-not-exist",...e||{}};return{postcssPlugin:"postcss-is-pseudo-class",prepare(){const e=new WeakSet;return{Rule(s,{result:n}){if(!s.selector)return;if(!t.test(s.selector))return;if(e.has(s))return;let r=!1;const warnOnComplexSelector=()=>{"warning"===o.onComplexSelector&&(r||(r=!0,s.warn(n,`Complex selectors in '${s.selector}' can not be transformed to an equivalent selector without ':is()'.`)))};let d=!1;const warnOnPseudoElements=()=>{"warning"===o.onPseudoElement&&(d||(d=!0,s.warn(n,`Pseudo elements are not allowed in ':is()', unable to transform '${s.selector}'`)))};try{let t=!1;const n=[],r=complexSelectors(splitSelectors(s.selectors,{specificityMatchingName:o.specificityMatchingName}),{onComplexSelector:o.onComplexSelector},warnOnComplexSelector,warnOnPseudoElements);if(Array.from(new Set(r)).forEach((o=>{if(s.selectors.indexOf(o)>-1)n.push(o);else{if(alwaysValidSelector(o))return n.push(o),void(t=!0);e.add(s),s.cloneBefore({selector:o}),t=!0}})),n.length&&t&&(e.add(s),s.cloneBefore({selectors:n})),!o.preserve){if(!t)return;s.remove()}}catch(e){if(e.message.indexOf("call stack size exceeded")>-1)throw e;s.warn(n,`Failed to parse selector "${s.selector}"`)}}}}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.d.ts b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.d.ts index 5b65f016..6f69c11e 100644 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.d.ts +++ b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.d.ts @@ -1,17 +1,21 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-is-pseudo-class plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** * Warn on complex selectors in `:is` pseudo class functions. * default: _not set_ - */ + */ onComplexSelector?: 'warning'; /** * Warn when pseudo elements are used in `:is` pseudo class functions. * default: _not set_ - */ + */ onPseudoElement?: 'warning'; /** * Change the selector used to adjust specificity. @@ -19,5 +23,5 @@ export type pluginOptions = { */ specificityMatchingName?: string; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs index 98bdd1ac..a3b17fa5 100644 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs +++ b/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-selector-parser";import{selectorSpecificity as o}from"@csstools/selector-specificity";function alwaysValidSelector(o){const s=e().astSync(o);let t=!0;return s.walk((e=>{var o,s;if("class"!==e.type&&"comment"!==e.type&&"id"!==e.type&&"root"!==e.type&&"selector"!==e.type&&"string"!==e.type&&"tag"!==e.type&&"universal"!==e.type&&("attribute"!==e.type||e.insensitive)&&("combinator"!==e.type||"+"!==e.value&&">"!==e.value&&"~"!==e.value&&" "!==e.value)&&("pseudo"!==e.type||null!=(o=e.nodes)&&o.length||":hover"!==e.value.toLowerCase()&&":focus"!==e.value.toLowerCase())){if("pseudo"===e.type&&1===(null==(s=e.nodes)?void 0:s.length)&&":not"===e.value.toLowerCase()){let o=!0;if(e.nodes[0].walkCombinators((()=>{o=!1})),o)return}return t=!1,!1}})),t}function sortCompoundSelectorsInsideComplexSelector(o){if(!o||!o.nodes||1===o.nodes.length)return;const s=[];let t=[];for(let n=0;n"selector"===e.type&&"selector"===o.type&&e.nodes.length&&o.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o,o.type):"selector"===o.type&&o.nodes.length?selectorTypeOrder(e,e.type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):selectorTypeOrder(e,e.type)-selectorTypeOrder(o,o.type)));const t=new Set(o.map((e=>e.type))),r=t.has("universal")&&(t.has("tag")||t.has("attribute")||t.has("class")||t.has("id")||t.has("pseudo"));for(let e=0;e=0;s--){const t=n[s-1];if(n[s].remove(),t&&"tag"===t.type&&"tag"===n[s].type){const t=e.pseudo({value:":is",nodes:[e.selector({value:"",nodes:[n[s]]})]});o.prepend(t)}else o.prepend(n[s])}}function selectorTypeOrder(o,t){return e.isPseudoElement(o)?s.pseudoElement:s[t]}const s={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function childAdjacentChild(e){return!(!e||!e.nodes)&&("selector"===e.type&&(3===e.nodes.length&&(!(!e.nodes[0]||"pseudo"!==e.nodes[0].type||":-csstools-matches"!==e.nodes[0].value)&&(!(!e.nodes[1]||"combinator"!==e.nodes[1].type||"+"!==e.nodes[1].value&&"~"!==e.nodes[1].value)&&(!(!e.nodes[2]||"pseudo"!==e.nodes[2].type||":-csstools-matches"!==e.nodes[2].value)&&(!(!e.nodes[0].nodes||1!==e.nodes[0].nodes.length)&&("selector"===e.nodes[0].nodes[0].type&&(!(!e.nodes[0].nodes[0].nodes||3!==e.nodes[0].nodes[0].nodes.length)&&(!(!e.nodes[0].nodes[0].nodes||"combinator"!==e.nodes[0].nodes[0].nodes[1].type||">"!==e.nodes[0].nodes[0].nodes[1].value)&&(!(!e.nodes[2].nodes||1!==e.nodes[2].nodes.length)&&("selector"===e.nodes[2].nodes[0].type&&(!(!e.nodes[2].nodes[0].nodes||3!==e.nodes[2].nodes[0].nodes.length)&&(!(!e.nodes[2].nodes[0].nodes||"combinator"!==e.nodes[2].nodes[0].nodes[1].type||">"!==e.nodes[2].nodes[0].nodes[1].value)&&(e.nodes[0].nodes[0].insertAfter(e.nodes[0].nodes[0].nodes[0],e.nodes[2].nodes[0].nodes[0].clone()),e.nodes[2].nodes[0].nodes[1].remove(),e.nodes[2].nodes[0].nodes[0].remove(),e.nodes[0].replaceWith(e.nodes[0].nodes[0]),e.nodes[2].replaceWith(e.nodes[2].nodes[0]),!0))))))))))))))}function isInCompoundWithOneOtherElement(o){if(!o||!o.nodes)return!1;if("selector"!==o.type)return!1;if(2!==o.nodes.length)return!1;let s,t;return o.nodes[0]&&"pseudo"===o.nodes[0].type&&":-csstools-matches"===o.nodes[0].value?(s=0,t=1):o.nodes[1]&&"pseudo"===o.nodes[1].type&&":-csstools-matches"===o.nodes[1].value&&(s=1,t=0),!!s&&(!!o.nodes[t]&&(("selector"!==o.nodes[t].type||!o.nodes[t].some((o=>"combinator"===o.type||e.isPseudoElement(o))))&&("combinator"!==o.nodes[t].type&&(o.nodes[s].nodes[0].append(o.nodes[t].clone()),o.nodes[s].replaceWith(...o.nodes[s].nodes[0].nodes),o.nodes[t].remove(),!0))))}function isPseudoInFirstCompound(e){if(!e||!e.nodes)return!1;if("selector"!==e.type)return!1;let o=-1;for(let s=0;s{t.nodes[0].append(e.clone())})),n.forEach((e=>{t.nodes[0].append(e.clone())})),t.replaceWith(...t.nodes),s.forEach((e=>{e.remove()})),n.forEach((e=>{e.remove()})),!0}function complexSelectors(o,s,t,n){return o.flatMap((o=>{if(-1===o.indexOf(":-csstools-matches")&&-1===o.toLowerCase().indexOf(":is"))return o;const r=e().astSync(o);return r.walkPseudos((o=>{if(":is"===o.value.toLowerCase()&&o.nodes&&o.nodes.length&&"selector"===o.nodes[0].type&&0===o.nodes[0].nodes.length)return o.value=":not",void o.nodes[0].append(e.universal());if(":-csstools-matches"===o.value)if(!o.nodes||o.nodes.length){if(o.walkPseudos((o=>{if(e.isPseudoElement(o)){let e=o.value;if(e.startsWith("::-csstools-invalid-"))return;for(;e.startsWith(":");)e=e.slice(1);o.value=`::-csstools-invalid-${e}`,n()}})),1===o.nodes.length&&"selector"===o.nodes[0].type){if(1===o.nodes[0].nodes.length)return void o.replaceWith(o.nodes[0].nodes[0]);if(!o.nodes[0].some((e=>"combinator"===e.type)))return void o.replaceWith(...o.nodes[0].nodes)}1!==r.nodes.length||"selector"!==r.nodes[0].type||1!==r.nodes[0].nodes.length||r.nodes[0].nodes[0]!==o?childAdjacentChild(o.parent)||isInCompoundWithOneOtherElement(o.parent)||isPseudoInFirstCompound(o.parent)||("warning"===s.onComplexSelector&&t(),o.value=":is"):o.replaceWith(...o.nodes[0].nodes)}else o.remove()})),r.walk((e=>{"selector"===e.type&&"nodes"in e&&1===e.nodes.length&&"selector"===e.nodes[0].type&&e.replaceWith(e.nodes[0])})),r.walk((e=>{"nodes"in e&&sortCompoundSelectorsInsideComplexSelector(e)})),r.toString()})).filter((e=>!!e))}function splitSelectors(s,t,n=0){const r=":not(#"+t.specificityMatchingName+")",l=":not(."+t.specificityMatchingName+")",d=":not("+t.specificityMatchingName+")";return s.flatMap((s=>{if(-1===s.toLowerCase().indexOf(":is"))return s;let a=!1;const i=[];if(e().astSync(s).walkPseudos((e=>{var s,t,n,c;if(":is"!==e.value.toLowerCase()||!e.nodes||!e.nodes.length)return;if("selector"===e.nodes[0].type&&0===e.nodes[0].nodes.length)return;if("pseudo"===(null==(s=e.parent)||null==(s=s.parent)?void 0:s.type)&&":not"===(null==(t=e.parent)||null==(t=t.parent)||null==(t=t.value)?void 0:t.toLowerCase()))return void i.push([{start:e.parent.parent.sourceIndex,end:e.parent.parent.sourceIndex+e.parent.parent.toString().length,option:`:not(${e.nodes.toString()})`}]);if("pseudo"===(null==(n=e.parent)||null==(n=n.parent)?void 0:n.type)&&":has"===(null==(c=e.parent)||null==(c=c.parent)||null==(c=c.value)?void 0:c.toLowerCase()))return void(e.value=":-csstools-matches");let p=e.parent;for(;p;){if(p.value&&":is"===p.value.toLowerCase()&&"pseudo"===p.type)return void(a=!0);p=p.parent}const u=o(e),h=e.sourceIndex,f=h+e.toString().length,y=[];e.nodes.forEach((e=>{const s={start:h,end:f,option:""},t=o(e);let n=e.toString().trim();const a=Math.max(0,u.a-t.a),i=Math.max(0,u.b-t.b),c=Math.max(0,u.c-t.c);for(let e=0;e{let o="";for(let n=0;n!!e))}function cartesianProduct(...e){const o=[],s=e.length-1;return function helper(t,n){for(let r=0,l=e[n].length;r{const o={specificityMatchingName:"does-not-exist",...e||{}};return{postcssPlugin:"postcss-is-pseudo-class",prepare(){const e=new WeakSet;return{Rule(s,{result:n}){if(!s.selector)return;if(!t.test(s.selector))return;if(e.has(s))return;let r=!1;const warnOnComplexSelector=()=>{"warning"===o.onComplexSelector&&(r||(r=!0,s.warn(n,`Complex selectors in '${s.selector}' can not be transformed to an equivalent selector without ':is()'.`)))};let l=!1;const warnOnPseudoElements=()=>{"warning"===o.onPseudoElement&&(l||(l=!0,s.warn(n,`Pseudo elements are not allowed in ':is()', unable to transform '${s.selector}'`)))};try{let t=!1;const n=[],r=complexSelectors(splitSelectors(s.selectors,{specificityMatchingName:o.specificityMatchingName}),{onComplexSelector:o.onComplexSelector},warnOnComplexSelector,warnOnPseudoElements);if(Array.from(new Set(r)).forEach((o=>{if(s.selectors.indexOf(o)>-1)n.push(o);else{if(alwaysValidSelector(o))return n.push(o),void(t=!0);e.add(s),s.cloneBefore({selector:o}),t=!0}})),n.length&&t&&(e.add(s),s.cloneBefore({selectors:n})),!o.preserve){if(!t)return;s.remove()}}catch(e){if(e.message.indexOf("call stack size exceeded")>-1)throw e;s.warn(n,`Failed to parse selector "${s.selector}"`)}}}}}};creator.postcss=!0;export{creator as default}; +import e from"postcss-selector-parser";import{selectorSpecificity as o}from"@csstools/selector-specificity";function alwaysValidSelector(o){const s=e().astSync(o);let t=!0;return s.walk((e=>{if("class"!==e.type&&"comment"!==e.type&&"id"!==e.type&&"root"!==e.type&&"selector"!==e.type&&"string"!==e.type&&"tag"!==e.type&&"universal"!==e.type&&("attribute"!==e.type||e.insensitive)&&("combinator"!==e.type||"+"!==e.value&&">"!==e.value&&"~"!==e.value&&" "!==e.value)&&("pseudo"!==e.type||e.nodes?.length||":hover"!==e.value.toLowerCase()&&":focus"!==e.value.toLowerCase())){if("pseudo"===e.type&&1===e.nodes?.length&&":not"===e.value.toLowerCase()){let o=!0;if(e.nodes[0].walkCombinators((()=>{o=!1})),o)return}return t=!1,!1}})),t}function sortCompoundSelectorsInsideComplexSelector(o){if(!o||!o.nodes||1===o.nodes.length)return;const s=[];let t=[];for(let n=0;n"selector"===e.type&&"selector"===o.type&&e.nodes.length&&o.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):"selector"===e.type&&e.nodes.length?selectorTypeOrder(e.nodes[0],e.nodes[0].type)-selectorTypeOrder(o,o.type):"selector"===o.type&&o.nodes.length?selectorTypeOrder(e,e.type)-selectorTypeOrder(o.nodes[0],o.nodes[0].type):selectorTypeOrder(e,e.type)-selectorTypeOrder(o,o.type)));const t=new Set(o.map((e=>e.type))),r=t.has("universal")&&(t.has("tag")||t.has("attribute")||t.has("class")||t.has("id")||t.has("pseudo"));for(let e=0;e=0;s--){const t=n[s-1];if(n[s].remove(),t&&"tag"===t.type&&"tag"===n[s].type){const t=e.pseudo({value:":is",nodes:[e.selector({value:"",nodes:[n[s]]})]});o.prepend(t)}else o.prepend(n[s])}}function selectorTypeOrder(o,t){return e.isPseudoElement(o)?s.pseudoElement:s[t]}const s={universal:0,tag:1,pseudoElement:2,id:3,class:4,attribute:5,pseudo:6,selector:7,string:8,root:9,comment:10};function childAdjacentChild(e){return!(!e||!e.nodes)&&("selector"===e.type&&(3===e.nodes.length&&(!(!e.nodes[0]||"pseudo"!==e.nodes[0].type||":-csstools-matches"!==e.nodes[0].value)&&(!(!e.nodes[1]||"combinator"!==e.nodes[1].type||"+"!==e.nodes[1].value&&"~"!==e.nodes[1].value)&&(!(!e.nodes[2]||"pseudo"!==e.nodes[2].type||":-csstools-matches"!==e.nodes[2].value)&&(!(!e.nodes[0].nodes||1!==e.nodes[0].nodes.length)&&("selector"===e.nodes[0].nodes[0].type&&(!(!e.nodes[0].nodes[0].nodes||3!==e.nodes[0].nodes[0].nodes.length)&&(!(!e.nodes[0].nodes[0].nodes||"combinator"!==e.nodes[0].nodes[0].nodes[1].type||">"!==e.nodes[0].nodes[0].nodes[1].value)&&(!(!e.nodes[2].nodes||1!==e.nodes[2].nodes.length)&&("selector"===e.nodes[2].nodes[0].type&&(!(!e.nodes[2].nodes[0].nodes||3!==e.nodes[2].nodes[0].nodes.length)&&(!(!e.nodes[2].nodes[0].nodes||"combinator"!==e.nodes[2].nodes[0].nodes[1].type||">"!==e.nodes[2].nodes[0].nodes[1].value)&&(e.nodes[0].nodes[0].insertAfter(e.nodes[0].nodes[0].nodes[0],e.nodes[2].nodes[0].nodes[0].clone()),e.nodes[2].nodes[0].nodes[1].remove(),e.nodes[2].nodes[0].nodes[0].remove(),e.nodes[0].replaceWith(e.nodes[0].nodes[0]),e.nodes[2].replaceWith(e.nodes[2].nodes[0]),!0))))))))))))))}function isInCompoundWithOneOtherElement(o){if(!o||!o.nodes)return!1;if("selector"!==o.type)return!1;if(2!==o.nodes.length)return!1;let s,t;return o.nodes[0]&&"pseudo"===o.nodes[0].type&&":-csstools-matches"===o.nodes[0].value?(s=0,t=1):o.nodes[1]&&"pseudo"===o.nodes[1].type&&":-csstools-matches"===o.nodes[1].value&&(s=1,t=0),!!s&&(!!o.nodes[t]&&(("selector"!==o.nodes[t].type||!o.nodes[t].some((o=>"combinator"===o.type||e.isPseudoElement(o))))&&("combinator"!==o.nodes[t].type&&(o.nodes[s].nodes[0].append(o.nodes[t].clone()),o.nodes[s].replaceWith(...o.nodes[s].nodes[0].nodes),o.nodes[t].remove(),!0))))}function isPseudoInFirstCompound(e){if(!e||!e.nodes)return!1;if("selector"!==e.type)return!1;let o=-1;for(let s=0;s{t.nodes[0].append(e.clone())})),n.forEach((e=>{t.nodes[0].append(e.clone())})),t.replaceWith(...t.nodes),s.forEach((e=>{e.remove()})),n.forEach((e=>{e.remove()})),!0}function complexSelectors(o,s,t,n){return o.flatMap((o=>{if(-1===o.indexOf(":-csstools-matches")&&-1===o.toLowerCase().indexOf(":is"))return o;const r=e().astSync(o);return r.walkPseudos((o=>{if(":is"===o.value.toLowerCase()&&o.nodes&&o.nodes.length&&"selector"===o.nodes[0].type&&0===o.nodes[0].nodes.length)return o.value=":not",void o.nodes[0].append(e.universal());if(":-csstools-matches"===o.value)if(!o.nodes||o.nodes.length){if(o.walkPseudos((o=>{if(e.isPseudoElement(o)){let e=o.value;if(e.startsWith("::-csstools-invalid-"))return;for(;e.startsWith(":");)e=e.slice(1);o.value=`::-csstools-invalid-${e}`,n()}})),1===o.nodes.length&&"selector"===o.nodes[0].type){if(1===o.nodes[0].nodes.length)return void o.replaceWith(o.nodes[0].nodes[0]);if(!o.nodes[0].some((e=>"combinator"===e.type)))return void o.replaceWith(...o.nodes[0].nodes)}1!==r.nodes.length||"selector"!==r.nodes[0].type||1!==r.nodes[0].nodes.length||r.nodes[0].nodes[0]!==o?childAdjacentChild(o.parent)||isInCompoundWithOneOtherElement(o.parent)||isPseudoInFirstCompound(o.parent)||("warning"===s.onComplexSelector&&t(),o.value=":is"):o.replaceWith(...o.nodes[0].nodes)}else o.remove()})),r.walk((e=>{"selector"===e.type&&"nodes"in e&&1===e.nodes.length&&"selector"===e.nodes[0].type&&e.replaceWith(e.nodes[0])})),r.walk((e=>{"nodes"in e&&sortCompoundSelectorsInsideComplexSelector(e)})),r.toString()})).filter((e=>!!e))}function splitSelectors(s,t,n=0){const r=":not(#"+t.specificityMatchingName+")",d=":not(."+t.specificityMatchingName+")",l=":not("+t.specificityMatchingName+")";return s.flatMap((s=>{if(-1===s.toLowerCase().indexOf(":is"))return s;let a=!1;const c=[];if(e().astSync(s).walkPseudos((e=>{if(":is"!==e.value.toLowerCase()||!e.nodes||!e.nodes.length)return;if("selector"===e.nodes[0].type&&0===e.nodes[0].nodes.length)return;if("pseudo"===e.parent?.parent?.type&&":not"===e.parent?.parent?.value?.toLowerCase())return void c.push([{start:e.parent.parent.sourceIndex,end:e.parent.parent.sourceIndex+e.parent.parent.toString().length,option:`:not(${e.nodes.toString()})`}]);if("pseudo"===e.parent?.parent?.type&&":has"===e.parent?.parent?.value?.toLowerCase())return void(e.value=":-csstools-matches");let s=e.parent;for(;s;){if(s.value&&":is"===s.value.toLowerCase()&&"pseudo"===s.type)return void(a=!0);s=s.parent}const t=o(e),n=e.sourceIndex,i=n+e.toString().length,p=[];e.nodes.forEach((e=>{const s={start:n,end:i,option:""},a=o(e);let c=e.toString().trim();const u=Math.max(0,t.a-a.a),h=Math.max(0,t.b-a.b),f=Math.max(0,t.c-a.c);for(let e=0;e{let o="";for(let t=0;t!!e))}function cartesianProduct(...e){const o=[],s=e.length-1;return function helper(t,n){for(let r=0,d=e[n].length;r{const o={specificityMatchingName:"does-not-exist",...e||{}};return{postcssPlugin:"postcss-is-pseudo-class",prepare(){const e=new WeakSet;return{Rule(s,{result:n}){if(!s.selector)return;if(!t.test(s.selector))return;if(e.has(s))return;let r=!1;const warnOnComplexSelector=()=>{"warning"===o.onComplexSelector&&(r||(r=!0,s.warn(n,`Complex selectors in '${s.selector}' can not be transformed to an equivalent selector without ':is()'.`)))};let d=!1;const warnOnPseudoElements=()=>{"warning"===o.onPseudoElement&&(d||(d=!0,s.warn(n,`Pseudo elements are not allowed in ':is()', unable to transform '${s.selector}'`)))};try{let t=!1;const n=[],r=complexSelectors(splitSelectors(s.selectors,{specificityMatchingName:o.specificityMatchingName}),{onComplexSelector:o.onComplexSelector},warnOnComplexSelector,warnOnPseudoElements);if(Array.from(new Set(r)).forEach((o=>{if(s.selectors.indexOf(o)>-1)n.push(o);else{if(alwaysValidSelector(o))return n.push(o),void(t=!0);e.add(s),s.cloneBefore({selector:o}),t=!0}})),n.length&&t&&(e.add(s),s.cloneBefore({selectors:n})),!o.preserve){if(!t)return;s.remove()}}catch(e){if(e.message.indexOf("call stack size exceeded")>-1)throw e;s.warn(n,`Failed to parse selector "${s.selector}"`)}}}}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/always-valid.d.ts b/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/always-valid.d.ts deleted file mode 100644 index a3bb60b3..00000000 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/always-valid.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function alwaysValidSelector(selector: string): boolean; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex.d.ts b/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex.d.ts deleted file mode 100644 index 904515e7..00000000 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default function complexSelectors(selectors: Array, pluginOptions: { - onComplexSelector?: 'warning'; -}, warnOnComplexSelector: () => void, warnOnPseudoElements: () => void): string[]; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/child-adjacent-child.d.ts b/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/child-adjacent-child.d.ts deleted file mode 100644 index 644eaaec..00000000 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/child-adjacent-child.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function childAdjacentChild(selector: any): boolean; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/is-in-compound.d.ts b/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/is-in-compound.d.ts deleted file mode 100644 index 3a91eef6..00000000 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/is-in-compound.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function isInCompoundWithOneOtherElement(selector: any): boolean; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/is-pseudo-in-first-compound.d.ts b/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/is-pseudo-in-first-compound.d.ts deleted file mode 100644 index 06ba1481..00000000 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/complex/is-pseudo-in-first-compound.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function isPseudoInFirstCompound(selector: any): boolean; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/compound-selector-order.d.ts b/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/compound-selector-order.d.ts deleted file mode 100644 index 3fb1e39f..00000000 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/compound-selector-order.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function sortCompoundSelectorsInsideComplexSelector(node: any): void; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/split-selectors.d.ts b/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/split-selectors.d.ts deleted file mode 100644 index 7bb70f21..00000000 --- a/node_modules/@csstools/postcss-is-pseudo-class/dist/split-selectors/split-selectors.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export default function splitSelectors(selectors: Array, pluginOptions: { - specificityMatchingName: string; -}, recursionDepth?: number): Array; diff --git a/node_modules/@csstools/postcss-is-pseudo-class/package.json b/node_modules/@csstools/postcss-is-pseudo-class/package.json index 05e2749c..1ff045ec 100644 --- a/node_modules/@csstools/postcss-is-pseudo-class/package.json +++ b/node_modules/@csstools/postcss-is-pseudo-class/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-is-pseudo-class", "description": "A pseudo-class for matching elements in a selector list", - "version": "4.0.3", + "version": "4.0.4", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -35,25 +38,12 @@ "dist" ], "dependencies": { - "@csstools/selector-specificity": "^3.0.0", + "@csstools/selector-specificity": "^3.0.1", "postcss-selector-parser": "^6.0.13" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*", - "puppeteer": "^21.3.6" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:browser": "node ./test/_browser.mjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-is-pseudo-class#readme", "repository": { "type": "git", @@ -70,12 +60,5 @@ "postcss-plugin", "pseudo", "selector" - ], - "csstools": { - "exportName": "postcssIsPseudoClass", - "humanReadableName": "PostCSS Is Pseudo" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/CHANGELOG.md b/node_modules/@csstools/postcss-logical-float-and-clear/CHANGELOG.md index b11158f8..bf477f34 100644 --- a/node_modules/@csstools/postcss-logical-float-and-clear/CHANGELOG.md +++ b/node_modules/@csstools/postcss-logical-float-and-clear/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Logical Float And Clear +### 2.0.1 + +_December 15, 2023_ + +- Fix type definitions + ### 2.0.0 _July 3, 2023_ @@ -12,8 +18,4 @@ _January 28, 2023_ - Improve `types` declaration in `package.json` -### 1.0.0 - -_January 19, 2023_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-float-and-clear/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/README.md b/node_modules/@csstools/postcss-logical-float-and-clear/README.md index 268c3085..e350d956 100644 --- a/node_modules/@csstools/postcss-logical-float-and-clear/README.md +++ b/node_modules/@csstools/postcss-logical-float-and-clear/README.md @@ -2,6 +2,10 @@ [npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] +```bash +npm install @csstools/postcss-logical-float-and-clear --save-dev +``` + [PostCSS Logical Float And Clear] lets you use logical, rather than physical, direction and dimension mappings in CSS, following the [CSS Logical Properties and Values] specification. ```pcss @@ -52,9 +56,9 @@ instructions for: ### inlineDirection -The `inlineDirection` option allows you to specify the direction of the inline axe. The default value is `left-to-right` respectively which would match any latin language. +The `inlineDirection` option allows you to specify the direction of the inline axe. The default value is `left-to-right`, which would match any latin language. -You might want to tweak these value if you are using a different writing system, such as Arabic, Hebrew or Chinese for example. +**You should tweak this value so that it is specific to your language and writing mode.** ```js postcssLogicalFloatAndClear({ diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts index 8faa333f..44d0817a 100644 --- a/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts +++ b/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.d.ts @@ -1,9 +1,19 @@ import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; + +declare const creator: PluginCreator; +export default creator; + +export declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} + /** postcss-logical-float-and-clear plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Sets the direction for inline. default: left-to-right */ inlineDirection?: DirectionFlow; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts deleted file mode 100644 index 1503bf6f..00000000 --- a/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function cloneDeclaration(declaration: Declaration, value: string, prop: string): void; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts deleted file mode 100644 index 2b3c47f9..00000000 --- a/node_modules/@csstools/postcss-logical-float-and-clear/dist/lib/types.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare const DirectionValues: { - BlockStart: string; - BlockEnd: string; - InlineStart: string; - InlineEnd: string; -}; -export declare enum DirectionFlow { - TopToBottom = "top-to-bottom", - BottomToTop = "bottom-to-top", - RightToLeft = "right-to-left", - LeftToRight = "left-to-right" -} -export declare enum Axes { - Top = "top", - Right = "right", - Bottom = "bottom", - Left = "left" -} diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts b/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts deleted file mode 100644 index 2652d71d..00000000 --- a/node_modules/@csstools/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { DirectionFlow, Axes } from '../lib/types'; -export declare function directionFlowToAxes(directionFlow: DirectionFlow): [Axes, Axes]; diff --git a/node_modules/@csstools/postcss-logical-float-and-clear/package.json b/node_modules/@csstools/postcss-logical-float-and-clear/package.json index 5738faeb..dad11611 100644 --- a/node_modules/@csstools/postcss-logical-float-and-clear/package.json +++ b/node_modules/@csstools/postcss-logical-float-and-clear/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-logical-float-and-clear", "description": "Use flow-relative (inline-start and inline-end) values for float and clear", - "version": "2.0.0", + "version": "2.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -47,17 +50,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-float-and-clear#readme", "repository": { "type": "git", @@ -74,14 +66,5 @@ "logical", "postcss", "postcss-plugin" - ], - "csstools": { - "cssdbId": "float-clear-logical-values", - "exportName": "postcssLogicalFloatAndClear", - "humanReadableName": "PostCSS Logical Float And Clear", - "specUrl": "https://www.w3.org/TR/css-logical-1/#float-clear" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-logical-overflow/CHANGELOG.md b/node_modules/@csstools/postcss-logical-overflow/CHANGELOG.md new file mode 100644 index 00000000..12e74f71 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overflow/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changes to PostCSS Logical Overflow + +### 1.0.1 + +_December 15, 2023_ + +- Fix type definitions + +### 1.0.0 + +_October 31, 2023_ + +- Initial version diff --git a/node_modules/@csstools/postcss-logical-overflow/LICENSE.md b/node_modules/@csstools/postcss-logical-overflow/LICENSE.md new file mode 100644 index 00000000..e8ae93b9 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overflow/LICENSE.md @@ -0,0 +1,18 @@ +MIT No Attribution (MIT-0) + +Copyright © CSSTools Contributors + +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. + +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. diff --git a/node_modules/@csstools/postcss-logical-overflow/README.md b/node_modules/@csstools/postcss-logical-overflow/README.md new file mode 100644 index 00000000..dd7ed558 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overflow/README.md @@ -0,0 +1,109 @@ +# PostCSS Logical Overflow [PostCSS Logo][PostCSS] + +[npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] + +```bash +npm install @csstools/postcss-logical-overflow --save-dev +``` + +[PostCSS Logical Overflow] lets you use `overflow-inline` and `overflow-block` properties following the [CSS Overflow Specification]. + +```pcss +.inline { + overflow-inline: clip; +} + +.block { + overflow-block: scroll; +} + +/* becomes */ + +.inline { + overflow-x: clip; +} + +.block { + overflow-y: scroll; +} +``` + +## Usage + +Add [PostCSS Logical Overflow] to your project: + +```bash +npm install postcss @csstools/postcss-logical-overflow --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssLogicalOverflow = require('@csstools/postcss-logical-overflow'); + +postcss([ + postcssLogicalOverflow(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Logical Overflow] runs in all Node environments, with special +instructions for: + +- [Node](INSTALL.md#node) +- [PostCSS CLI](INSTALL.md#postcss-cli) +- [PostCSS Load Config](INSTALL.md#postcss-load-config) +- [Webpack](INSTALL.md#webpack) +- [Next.js](INSTALL.md#nextjs) +- [Gulp](INSTALL.md#gulp) +- [Grunt](INSTALL.md#grunt) + +## Options + +### inlineDirection + +The `inlineDirection` option allows you to specify the direction of the inline axe. The default value is `left-to-right`, which would match any latin language. + +**You should tweak this value so that it is specific to your language and writing mode.** + +```js +postcssLogicalOverflow({ + inlineDirection: 'top-to-bottom' +}) +``` + +```pcss +.inline { + overflow-inline: clip; +} + +.block { + overflow-block: scroll; +} + +/* becomes */ + +.inline { + overflow-y: clip; +} + +.block { + overflow-x: scroll; +} +``` + +Each direction must be one of the following: + +- `top-to-bottom` +- `bottom-to-top` +- `left-to-right` +- `right-to-left` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[css-url]: https://cssdb.org/#logical-overflow +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/postcss-logical-overflow + +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Logical Overflow]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-overflow +[CSS Overflow Specification]: https://www.w3.org/TR/css-overflow-3/#overflow-control diff --git a/node_modules/@csstools/postcss-logical-overflow/dist/index.cjs b/node_modules/@csstools/postcss-logical-overflow/dist/index.cjs new file mode 100644 index 00000000..ada0e798 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overflow/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var o;function transformAxes(o,t){const e=t?"-x":"-y",i=t?"-y":"-x",n=o.prop.toLowerCase().replace("-inline",e).replace("-block",i),s=o.value;o.parent?.some((o=>"decl"==o.type&&o.prop===n&&o.value===s))||(o.cloneBefore({prop:n,value:s}),o.remove())}!function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(o||(o={}));const creator=t=>{const e=Object.assign({inlineDirection:o.LeftToRight},t);switch(e.inlineDirection){case o.LeftToRight:case o.RightToLeft:case o.TopToBottom:case o.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(o).join(", ")}`)}const i=[o.LeftToRight,o.RightToLeft].includes(e.inlineDirection);return{postcssPlugin:"postcss-logical-overflow",Declaration:{"overflow-block":o=>transformAxes(o,i),"overflow-inline":o=>transformAxes(o,i)}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-logical-overflow/dist/index.d.ts b/node_modules/@csstools/postcss-logical-overflow/dist/index.d.ts new file mode 100644 index 00000000..d9afe9d4 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overflow/dist/index.d.ts @@ -0,0 +1,19 @@ +import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + +export declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} + +/** postcss-logical-overflow plugin options */ +export declare type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; + +export { } diff --git a/node_modules/@csstools/postcss-logical-overflow/dist/index.mjs b/node_modules/@csstools/postcss-logical-overflow/dist/index.mjs new file mode 100644 index 00000000..9169d1b6 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overflow/dist/index.mjs @@ -0,0 +1 @@ +var o;function transformAxes(o,t){const e=t?"-x":"-y",i=t?"-y":"-x",n=o.prop.toLowerCase().replace("-inline",e).replace("-block",i),s=o.value;o.parent?.some((o=>"decl"==o.type&&o.prop===n&&o.value===s))||(o.cloneBefore({prop:n,value:s}),o.remove())}!function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(o||(o={}));const creator=t=>{const e=Object.assign({inlineDirection:o.LeftToRight},t);switch(e.inlineDirection){case o.LeftToRight:case o.RightToLeft:case o.TopToBottom:case o.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(o).join(", ")}`)}const i=[o.LeftToRight,o.RightToLeft].includes(e.inlineDirection);return{postcssPlugin:"postcss-logical-overflow",Declaration:{"overflow-block":o=>transformAxes(o,i),"overflow-inline":o=>transformAxes(o,i)}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-logical-overflow/package.json b/node_modules/@csstools/postcss-logical-overflow/package.json new file mode 100644 index 00000000..4b480ff2 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overflow/package.json @@ -0,0 +1,66 @@ +{ + "name": "@csstools/postcss-logical-overflow", + "description": "Use logical overflow properties and values in CSS", + "version": "1.0.1", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT-0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "type": "module", + "main": "dist/index.cjs", + "module": "dist/index.mjs", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "postcss": "^8.4" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-overflow#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-logical-overflow" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "css", + "logical", + "overflow", + "postcss-plugin" + ] +} diff --git a/node_modules/@csstools/postcss-logical-overscroll-behavior/CHANGELOG.md b/node_modules/@csstools/postcss-logical-overscroll-behavior/CHANGELOG.md new file mode 100644 index 00000000..649e59d8 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overscroll-behavior/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changes to PostCSS Logical Overscroll Behavior + +### 1.0.1 + +_December 15, 2023_ + +- Fix type definitions + +### 1.0.0 + +_October 31, 2023_ + +- Initial version diff --git a/node_modules/@csstools/postcss-logical-overscroll-behavior/LICENSE.md b/node_modules/@csstools/postcss-logical-overscroll-behavior/LICENSE.md new file mode 100644 index 00000000..e8ae93b9 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overscroll-behavior/LICENSE.md @@ -0,0 +1,18 @@ +MIT No Attribution (MIT-0) + +Copyright © CSSTools Contributors + +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. + +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. diff --git a/node_modules/@csstools/postcss-logical-overscroll-behavior/README.md b/node_modules/@csstools/postcss-logical-overscroll-behavior/README.md new file mode 100644 index 00000000..eb130cd9 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overscroll-behavior/README.md @@ -0,0 +1,109 @@ +# PostCSS Logical Overscroll Behavior [PostCSS Logo][PostCSS] + +[npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] + +```bash +npm install @csstools/postcss-logical-overscroll-behavior --save-dev +``` + +[PostCSS Logical Overscroll Behavior] lets you use `overscroll-behavior-inline` and `overscroll-behavior-block` properties following the [CSS Overscroll Specification]. + +```pcss +.inline { + overscroll-behavior-inline: auto; +} + +.block { + overscroll-behavior-block: contain; +} + +/* becomes */ + +.inline { + overscroll-behavior-x: auto; +} + +.block { + overscroll-behavior-y: contain; +} +``` + +## Usage + +Add [PostCSS Logical Overscroll Behavior] to your project: + +```bash +npm install postcss @csstools/postcss-logical-overscroll-behavior --save-dev +``` + +Use it as a [PostCSS] plugin: + +```js +const postcss = require('postcss'); +const postcssLogicalOverscrollBehavior = require('@csstools/postcss-logical-overscroll-behavior'); + +postcss([ + postcssLogicalOverscrollBehavior(/* pluginOptions */) +]).process(YOUR_CSS /*, processOptions */); +``` + +[PostCSS Logical Overscroll Behavior] runs in all Node environments, with special +instructions for: + +- [Node](INSTALL.md#node) +- [PostCSS CLI](INSTALL.md#postcss-cli) +- [PostCSS Load Config](INSTALL.md#postcss-load-config) +- [Webpack](INSTALL.md#webpack) +- [Next.js](INSTALL.md#nextjs) +- [Gulp](INSTALL.md#gulp) +- [Grunt](INSTALL.md#grunt) + +## Options + +### inlineDirection + +The `inlineDirection` option allows you to specify the direction of the inline axe. The default value is `left-to-right`, which would match any latin language. + +**You should tweak this value so that it is specific to your language and writing mode.** + +```js +postcssLogicalOverscrollBehavior({ + inlineDirection: 'top-to-bottom' +}) +``` + +```pcss +.inline { + overscroll-behavior-inline: auto; +} + +.block { + overscroll-behavior-block: contain; +} + +/* becomes */ + +.inline { + overscroll-behavior-y: auto; +} + +.block { + overscroll-behavior-x: contain; +} +``` + +Each direction must be one of the following: + +- `top-to-bottom` +- `bottom-to-top` +- `left-to-right` +- `right-to-left` + +[cli-url]: https://github.com/csstools/postcss-plugins/actions/workflows/test.yml?query=workflow/test +[css-url]: https://cssdb.org/#logical-overscroll-behavior +[discord]: https://discord.gg/bUadyRwkJS +[npm-url]: https://www.npmjs.com/package/@csstools/postcss-logical-overscroll-behavior + +[PostCSS]: https://github.com/postcss/postcss +[PostCSS Logical Overscroll Behavior]: https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-overscroll-behavior +[CSS Overscroll Specification]: https://www.w3.org/TR/css-overscroll-1/#overscroll-behavior-longhands-logical diff --git a/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.cjs b/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.cjs new file mode 100644 index 00000000..d54f6b2c --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.cjs @@ -0,0 +1 @@ +"use strict";var o;function transformAxes(o,t){const e=t?"-x":"-y",i=t?"-y":"-x",r=o.prop.toLowerCase().replace("-inline",e).replace("-block",i),s=o.value;o.parent?.some((o=>"decl"==o.type&&o.prop===r&&o.value===s))||(o.cloneBefore({prop:r,value:s}),o.remove())}!function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(o||(o={}));const creator=t=>{const e=Object.assign({inlineDirection:o.LeftToRight},t);switch(e.inlineDirection){case o.LeftToRight:case o.RightToLeft:case o.TopToBottom:case o.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(o).join(", ")}`)}const i=[o.LeftToRight,o.RightToLeft].includes(e.inlineDirection);return{postcssPlugin:"postcss-logical-overscroll-behavior",Declaration:{"overscroll-behavior-block":o=>transformAxes(o,i),"overscroll-behavior-inline":o=>transformAxes(o,i)}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.d.ts b/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.d.ts new file mode 100644 index 00000000..69581fa5 --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.d.ts @@ -0,0 +1,19 @@ +import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + +export declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} + +/** postcss-logical-overscroll-behavior plugin options */ +export declare type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; + +export { } diff --git a/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.mjs b/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.mjs new file mode 100644 index 00000000..3cac5a7b --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.mjs @@ -0,0 +1 @@ +var o;function transformAxes(o,t){const e=t?"-x":"-y",i=t?"-y":"-x",r=o.prop.toLowerCase().replace("-inline",e).replace("-block",i),s=o.value;o.parent?.some((o=>"decl"==o.type&&o.prop===r&&o.value===s))||(o.cloneBefore({prop:r,value:s}),o.remove())}!function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(o||(o={}));const creator=t=>{const e=Object.assign({inlineDirection:o.LeftToRight},t);switch(e.inlineDirection){case o.LeftToRight:case o.RightToLeft:case o.TopToBottom:case o.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(o).join(", ")}`)}const i=[o.LeftToRight,o.RightToLeft].includes(e.inlineDirection);return{postcssPlugin:"postcss-logical-overscroll-behavior",Declaration:{"overscroll-behavior-block":o=>transformAxes(o,i),"overscroll-behavior-inline":o=>transformAxes(o,i)}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-logical-overscroll-behavior/package.json b/node_modules/@csstools/postcss-logical-overscroll-behavior/package.json new file mode 100644 index 00000000..df73f41e --- /dev/null +++ b/node_modules/@csstools/postcss-logical-overscroll-behavior/package.json @@ -0,0 +1,66 @@ +{ + "name": "@csstools/postcss-logical-overscroll-behavior", + "description": "Use logical overscroll behavior properties and values in CSS", + "version": "1.0.1", + "contributors": [ + { + "name": "Antonio Laguna", + "email": "antonio@laguna.es", + "url": "https://antonio.laguna.es" + }, + { + "name": "Romain Menke", + "email": "romainmenke@gmail.com" + } + ], + "license": "MIT-0", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/csstools" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/csstools" + } + ], + "engines": { + "node": "^14 || ^16 || >=18" + }, + "type": "module", + "main": "dist/index.cjs", + "module": "dist/index.mjs", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } + } + }, + "files": [ + "CHANGELOG.md", + "LICENSE.md", + "README.md", + "dist" + ], + "peerDependencies": { + "postcss": "^8.4" + }, + "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-overscroll-behavior#readme", + "repository": { + "type": "git", + "url": "https://github.com/csstools/postcss-plugins.git", + "directory": "plugins/postcss-logical-overscroll-behavior" + }, + "bugs": "https://github.com/csstools/postcss-plugins/issues", + "keywords": [ + "css", + "logical", + "overscroll-behavior", + "postcss-plugin" + ] +} diff --git a/node_modules/@csstools/postcss-logical-resize/CHANGELOG.md b/node_modules/@csstools/postcss-logical-resize/CHANGELOG.md index 5d9ea88f..b03cef01 100644 --- a/node_modules/@csstools/postcss-logical-resize/CHANGELOG.md +++ b/node_modules/@csstools/postcss-logical-resize/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Logical Resize +### 2.0.1 + +_December 15, 2023_ + +- Fix type definitions + ### 2.0.0 _July 3, 2023_ @@ -12,8 +18,4 @@ _January 28, 2023_ - Improve `types` declaration in `package.json` -### 1.0.0 - -_January 21, 20223_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-resize/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-logical-resize/README.md b/node_modules/@csstools/postcss-logical-resize/README.md index 3e0d3a24..ee6dfc83 100644 --- a/node_modules/@csstools/postcss-logical-resize/README.md +++ b/node_modules/@csstools/postcss-logical-resize/README.md @@ -2,6 +2,10 @@ [npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] +```bash +npm install @csstools/postcss-logical-resize --save-dev +``` + [PostCSS Logical Resize] lets you use logical, rather than physical, values for `resize`, following the [CSS Logical Properties and Values] specification. ```pcss @@ -58,9 +62,9 @@ instructions for: ### blockDirection & inlineDirection -The `blockDirection` and `inlineDirection` options allow you to specify the direction of the block and inline axes. The default values are `top-to-bottom` and `left-to-right` respectively which would match any latin language. +The `blockDirection` and `inlineDirection` options allow you to specify the direction of the block and inline axes. The default values are `top-to-bottom` and `left-to-right` respectively, which would match any latin language. -You might want to tweak these values if you are using a different writing system, such as Arabic, Hebrew or Chinese for example. +**You should tweak these values so that they are specific to your language and writing mode.** ```js postcssLogicalResize({ diff --git a/node_modules/@csstools/postcss-logical-resize/dist/index.cjs b/node_modules/@csstools/postcss-logical-resize/dist/index.cjs index 6c1aaad1..625c9b6e 100644 --- a/node_modules/@csstools/postcss-logical-resize/dist/index.cjs +++ b/node_modules/@csstools/postcss-logical-resize/dist/index.cjs @@ -1 +1 @@ -"use strict";var o,t,e,i,n=require("postcss-value-parser");function cloneDeclaration(o,t,e){o.parent&&o.parent.some((o=>"decl"==o.type&&o.prop===e&&o.value===t))||o.cloneBefore({value:t,prop:e})}function transformResize(o){return t=>{const{prop:e,value:i}=t,r=n(i),c=o.inlineIsHorizontal?"horizontal":"vertical",s=o.inlineIsHorizontal?"vertical":"horizontal";r.nodes.forEach((o=>{if("word"===o.type){const t=o.value.toLowerCase();if("inline"===t)return void(o.value=c);"block"===t&&(o.value=s)}}));const l=r.toString();return l!==i&&(cloneDeclaration(t,l,e),!0)}}function directionFlowToAxes(o){switch(o){case e.TopToBottom:return[i.Top,i.Bottom];case e.BottomToTop:return[i.Bottom,i.Top];case e.RightToLeft:return[i.Right,i.Left];case e.LeftToRight:return[i.Left,i.Right]}}!function(o){o.Block="block",o.Inline="inline"}(o||(o={})),function(o){o.Start="start",o.End="end"}(t||(t={})),function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(e||(e={})),function(o){o.Top="top",o.Right="right",o.Bottom="bottom",o.Left="left"}(i||(i={}));const creator=o=>{const t=Object.assign({blockDirection:e.TopToBottom,inlineDirection:e.LeftToRight},o),n=Object.values(e);if(!n.includes(t.blockDirection))throw new Error(`[postcss-logical-resize] "blockDirection" must be one of ${n.join(", ")}`);if(!n.includes(t.inlineDirection))throw new Error(`[postcss-logical-resize] "inlineDirection" must be one of ${n.join(", ")}`);const[r,c]=directionFlowToAxes(t.blockDirection),[s,l]=directionFlowToAxes(t.inlineDirection);if(!Object.values(i).every((o=>[r,c,s,l].includes(o))))throw new Error('[postcss-logical-resize] "blockDirection" and "inlineDirection" must be on separate axes');const a={block:[r,c],inline:[s,l],inlineIsHorizontal:[e.LeftToRight,e.RightToLeft].includes(t.inlineDirection)};return{postcssPlugin:"postcss-logical-resize",Declaration:{resize:(u=transformResize(a),(o,{result:t})=>{if(!u)return;let e=!1;try{e=u(o)}catch(e){return void o.warn(t,e.message)}e&&o.remove()})}};var u};creator.postcss=!0,module.exports=creator; +"use strict";var o,t,e,i=require("postcss-value-parser");function cloneDeclaration(o,t,e){o.parent&&o.parent.some((o=>"decl"==o.type&&o.prop===e&&o.value===t))||o.cloneBefore({value:t,prop:e})}function transformResize(o){return t=>{const{prop:e,value:n}=t,r=i(n),c=o.inlineIsHorizontal?"horizontal":"vertical",s=o.inlineIsHorizontal?"vertical":"horizontal";r.nodes.forEach((o=>{if("word"===o.type){const t=o.value.toLowerCase();if("inline"===t)return void(o.value=c);"block"===t&&(o.value=s)}}));const l=r.toString();return l!==n&&(cloneDeclaration(t,l,e),!0)}}function directionFlowToAxes(o){switch(o){case t.TopToBottom:return[e.Top,e.Bottom];case t.BottomToTop:return[e.Bottom,e.Top];case t.RightToLeft:return[e.Right,e.Left];case t.LeftToRight:return[e.Left,e.Right]}}!function(o){o.Block="block",o.Inline="inline"}(o||(o={})),function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(t||(t={})),function(o){o.Top="top",o.Right="right",o.Bottom="bottom",o.Left="left"}(e||(e={}));const creator=o=>{const i=Object.assign({blockDirection:t.TopToBottom,inlineDirection:t.LeftToRight},o),n=Object.values(t);if(!n.includes(i.blockDirection))throw new Error(`[postcss-logical-resize] "blockDirection" must be one of ${n.join(", ")}`);if(!n.includes(i.inlineDirection))throw new Error(`[postcss-logical-resize] "inlineDirection" must be one of ${n.join(", ")}`);const[r,c]=directionFlowToAxes(i.blockDirection),[s,l]=directionFlowToAxes(i.inlineDirection);if(!Object.values(e).every((o=>[r,c,s,l].includes(o))))throw new Error('[postcss-logical-resize] "blockDirection" and "inlineDirection" must be on separate axes');const a={block:[r,c],inline:[s,l],inlineIsHorizontal:[t.LeftToRight,t.RightToLeft].includes(i.inlineDirection)};return{postcssPlugin:"postcss-logical-resize",Declaration:{resize:(u=transformResize(a),(o,{result:t})=>{if(!u)return;let e=!1;try{e=u(o)}catch(e){return void o.warn(t,e instanceof Error?e.message:String(e))}e&&o.remove()})}};var u};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-logical-resize/dist/index.d.ts b/node_modules/@csstools/postcss-logical-resize/dist/index.d.ts index 0cac31d0..1a57d9f9 100644 --- a/node_modules/@csstools/postcss-logical-resize/dist/index.d.ts +++ b/node_modules/@csstools/postcss-logical-resize/dist/index.d.ts @@ -1,11 +1,21 @@ import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; + +declare const creator: PluginCreator; +export default creator; + +export declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} + /** postcss-logical-resize plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Sets the direction for block. default: top-to-bottom */ blockDirection?: DirectionFlow; /** Sets the direction for inline. default: left-to-right */ inlineDirection?: DirectionFlow; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-logical-resize/dist/index.mjs b/node_modules/@csstools/postcss-logical-resize/dist/index.mjs index 5cffc5e7..d0449a21 100644 --- a/node_modules/@csstools/postcss-logical-resize/dist/index.mjs +++ b/node_modules/@csstools/postcss-logical-resize/dist/index.mjs @@ -1 +1 @@ -import o from"postcss-value-parser";var t,e,i,n;function cloneDeclaration(o,t,e){o.parent&&o.parent.some((o=>"decl"==o.type&&o.prop===e&&o.value===t))||o.cloneBefore({value:t,prop:e})}function transformResize(t){return e=>{const{prop:i,value:n}=e,r=o(n),c=t.inlineIsHorizontal?"horizontal":"vertical",s=t.inlineIsHorizontal?"vertical":"horizontal";r.nodes.forEach((o=>{if("word"===o.type){const t=o.value.toLowerCase();if("inline"===t)return void(o.value=c);"block"===t&&(o.value=s)}}));const l=r.toString();return l!==n&&(cloneDeclaration(e,l,i),!0)}}function directionFlowToAxes(o){switch(o){case i.TopToBottom:return[n.Top,n.Bottom];case i.BottomToTop:return[n.Bottom,n.Top];case i.RightToLeft:return[n.Right,n.Left];case i.LeftToRight:return[n.Left,n.Right]}}!function(o){o.Block="block",o.Inline="inline"}(t||(t={})),function(o){o.Start="start",o.End="end"}(e||(e={})),function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(i||(i={})),function(o){o.Top="top",o.Right="right",o.Bottom="bottom",o.Left="left"}(n||(n={}));const creator=o=>{const t=Object.assign({blockDirection:i.TopToBottom,inlineDirection:i.LeftToRight},o),e=Object.values(i);if(!e.includes(t.blockDirection))throw new Error(`[postcss-logical-resize] "blockDirection" must be one of ${e.join(", ")}`);if(!e.includes(t.inlineDirection))throw new Error(`[postcss-logical-resize] "inlineDirection" must be one of ${e.join(", ")}`);const[r,c]=directionFlowToAxes(t.blockDirection),[s,l]=directionFlowToAxes(t.inlineDirection);if(!Object.values(n).every((o=>[r,c,s,l].includes(o))))throw new Error('[postcss-logical-resize] "blockDirection" and "inlineDirection" must be on separate axes');const a={block:[r,c],inline:[s,l],inlineIsHorizontal:[i.LeftToRight,i.RightToLeft].includes(t.inlineDirection)};return{postcssPlugin:"postcss-logical-resize",Declaration:{resize:(u=transformResize(a),(o,{result:t})=>{if(!u)return;let e=!1;try{e=u(o)}catch(e){return void o.warn(t,e.message)}e&&o.remove()})}};var u};creator.postcss=!0;export{creator as default}; +import o from"postcss-value-parser";var t,e,i;function cloneDeclaration(o,t,e){o.parent&&o.parent.some((o=>"decl"==o.type&&o.prop===e&&o.value===t))||o.cloneBefore({value:t,prop:e})}function transformResize(t){return e=>{const{prop:i,value:n}=e,r=o(n),c=t.inlineIsHorizontal?"horizontal":"vertical",s=t.inlineIsHorizontal?"vertical":"horizontal";r.nodes.forEach((o=>{if("word"===o.type){const t=o.value.toLowerCase();if("inline"===t)return void(o.value=c);"block"===t&&(o.value=s)}}));const l=r.toString();return l!==n&&(cloneDeclaration(e,l,i),!0)}}function directionFlowToAxes(o){switch(o){case e.TopToBottom:return[i.Top,i.Bottom];case e.BottomToTop:return[i.Bottom,i.Top];case e.RightToLeft:return[i.Right,i.Left];case e.LeftToRight:return[i.Left,i.Right]}}!function(o){o.Block="block",o.Inline="inline"}(t||(t={})),function(o){o.TopToBottom="top-to-bottom",o.BottomToTop="bottom-to-top",o.RightToLeft="right-to-left",o.LeftToRight="left-to-right"}(e||(e={})),function(o){o.Top="top",o.Right="right",o.Bottom="bottom",o.Left="left"}(i||(i={}));const creator=o=>{const t=Object.assign({blockDirection:e.TopToBottom,inlineDirection:e.LeftToRight},o),n=Object.values(e);if(!n.includes(t.blockDirection))throw new Error(`[postcss-logical-resize] "blockDirection" must be one of ${n.join(", ")}`);if(!n.includes(t.inlineDirection))throw new Error(`[postcss-logical-resize] "inlineDirection" must be one of ${n.join(", ")}`);const[r,c]=directionFlowToAxes(t.blockDirection),[s,l]=directionFlowToAxes(t.inlineDirection);if(!Object.values(i).every((o=>[r,c,s,l].includes(o))))throw new Error('[postcss-logical-resize] "blockDirection" and "inlineDirection" must be on separate axes');const a={block:[r,c],inline:[s,l],inlineIsHorizontal:[e.LeftToRight,e.RightToLeft].includes(t.inlineDirection)};return{postcssPlugin:"postcss-logical-resize",Declaration:{resize:(u=transformResize(a),(o,{result:t})=>{if(!u)return;let e=!1;try{e=u(o)}catch(e){return void o.warn(t,e instanceof Error?e.message:String(e))}e&&o.remove()})}};var u};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-logical-resize/dist/lib/clone-declaration.d.ts b/node_modules/@csstools/postcss-logical-resize/dist/lib/clone-declaration.d.ts deleted file mode 100644 index 1503bf6f..00000000 --- a/node_modules/@csstools/postcss-logical-resize/dist/lib/clone-declaration.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function cloneDeclaration(declaration: Declaration, value: string, prop: string): void; diff --git a/node_modules/@csstools/postcss-logical-resize/dist/lib/transform-resize.d.ts b/node_modules/@csstools/postcss-logical-resize/dist/lib/transform-resize.d.ts deleted file mode 100644 index 12100551..00000000 --- a/node_modules/@csstools/postcss-logical-resize/dist/lib/transform-resize.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Declaration } from 'postcss'; -import { DirectionConfig } from './types'; -export declare function transformResize(directionConfig: DirectionConfig): (declaration: Declaration) => boolean; diff --git a/node_modules/@csstools/postcss-logical-resize/dist/lib/types.d.ts b/node_modules/@csstools/postcss-logical-resize/dist/lib/types.d.ts deleted file mode 100644 index 7f27fd46..00000000 --- a/node_modules/@csstools/postcss-logical-resize/dist/lib/types.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export declare enum Direction { - Block = "block", - Inline = "inline" -} -export declare enum DirectionValue { - Start = "start", - End = "end" -} -export declare const DirectionValues: { - BlockStart: string; - BlockEnd: string; - InlineStart: string; - InlineEnd: string; -}; -export declare enum DirectionFlow { - TopToBottom = "top-to-bottom", - BottomToTop = "bottom-to-top", - RightToLeft = "right-to-left", - LeftToRight = "left-to-right" -} -export declare enum Axes { - Top = "top", - Right = "right", - Bottom = "bottom", - Left = "left" -} -export type DirectionConfig = { - [Direction.Block]: [Axes, Axes]; - [Direction.Inline]: [Axes, Axes]; - inlineIsHorizontal: boolean; -}; diff --git a/node_modules/@csstools/postcss-logical-resize/dist/utils/direction-flow-to-axes.d.ts b/node_modules/@csstools/postcss-logical-resize/dist/utils/direction-flow-to-axes.d.ts deleted file mode 100644 index 2652d71d..00000000 --- a/node_modules/@csstools/postcss-logical-resize/dist/utils/direction-flow-to-axes.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { DirectionFlow, Axes } from '../lib/types'; -export declare function directionFlowToAxes(directionFlow: DirectionFlow): [Axes, Axes]; diff --git a/node_modules/@csstools/postcss-logical-resize/package.json b/node_modules/@csstools/postcss-logical-resize/package.json index 9fa60ff6..cf9cc56c 100644 --- a/node_modules/@csstools/postcss-logical-resize/package.json +++ b/node_modules/@csstools/postcss-logical-resize/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-logical-resize", "description": "Use logical values in the resize property", - "version": "2.0.0", + "version": "2.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -50,17 +53,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-resize#readme", "repository": { "type": "git", @@ -76,14 +68,5 @@ "postcss", "postcss-plugin", "resize" - ], - "csstools": { - "cssdbId": "logical-resize", - "exportName": "postcssLogicalResize", - "humanReadableName": "PostCSS Logical Resize", - "specUrl": "https://www.w3.org/TR/css-logical-1/" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md b/node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md index a93e5c0c..4a51e4a4 100644 --- a/node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md +++ b/node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md @@ -1,5 +1,12 @@ # Changes to PostCSS Logical Viewport Units +### 2.0.4 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) + ### 2.0.3 _September 24, 2023_ @@ -12,38 +19,4 @@ _September 18, 2023_ - Improve performance -### 2.0.1 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) - -### 2.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) - -### 1.0.3 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) - -### 1.0.2 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 1.0.1 - -_January 24, 2023_ - -- Correctly list dependencies in `package.json` - -### 1.0.0 - -_January 19, 2023_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-viewport-units/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/has-feature.d.ts b/node_modules/@csstools/postcss-logical-viewport-units/dist/has-feature.d.ts deleted file mode 100644 index a902b0da..00000000 --- a/node_modules/@csstools/postcss-logical-viewport-units/dist/has-feature.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function hasFeature(source: string): boolean; diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-logical-viewport-units/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ec..00000000 --- a/node_modules/@csstools/postcss-logical-viewport-units/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs index 4371e8d6..8b0c9d63 100644 --- a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs +++ b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs @@ -1 +1 @@ -"use strict";var t,e,o=require("@csstools/css-tokenizer");function hasFeature(t){{const e=t.toLowerCase();if(!e.includes("vb")&&!e.includes("vi"))return!1}const e=o.tokenizer({css:t});for(;;){const t=e.nextToken();if(!t)break;if(t[0]===o.TokenType.EOF)break;if(t[0]!==o.TokenType.Dimension)continue;const n=t[4].unit.toLowerCase();if("vb"===n||"vi"===n)return!0}return!1}function hasSupportsAtRuleAncestor(t){let e=t.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()&&hasFeature(e.params))return!0;e=e.parent}else e=e.parent;return!1}function transform(t,e){const n=o.tokenizer({css:t}),r=[];let i=!1;for(;;){const t=n.nextToken();if(!t)break;if(r.push(t),t[0]===o.TokenType.EOF)break;if(t[0]!==o.TokenType.Dimension)continue;const s=t[4].unit.toLowerCase();let u;"vi"===s?u=e.vi:"vb"===s&&(u=e.vb),u&&(t[1]=t[4].value.toString()+u,t[4].unit=u,i=!0)}return i?o.stringify(...r):t}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(t||(t={})),function(t){t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left"}(e||(e={}));const n=/(?:vi|vb)\b/i,creator=e=>{const o=Object.assign({inlineDirection:t.LeftToRight,preserve:!0},e),r=Object.values(t);if(!r.includes(o.inlineDirection))throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${r.join(", ")}`);const i=[t.LeftToRight,t.RightToLeft].includes(o.inlineDirection),s={vb:"vh",vi:"vw"};return i||(s.vb="vw",s.vi="vh"),{postcssPlugin:"postcss-logical-viewport-units",Declaration(t,{atRule:e}){{if(!n.test(t.value))return;const e=t.prev();if(e&&"decl"===e.type&&e.prop===t.prop)return;if(hasSupportsAtRuleAncestor(t))return}const r=transform(t.value,s);if(r===t.value)return;if(t.cloneBefore({value:r}),!o.preserve)return void t.remove();if(!t.variable)return;const i=e({name:"supports",params:"(top: 1vi)",source:t.source}),u=t.parent;if(!u)return;const c=u.cloneAfter({nodes:[]});c.append(t),i.append(c),u.after(i)}}};creator.postcss=!0,module.exports=creator; +"use strict";var e,t=require("@csstools/css-tokenizer");function hasFeature(e){{const t=e.toLowerCase();if(!t.includes("vb")&&!t.includes("vi"))return!1}const o=t.tokenizer({css:e});for(;;){const e=o.nextToken();if(!e)break;if(e[0]===t.TokenType.EOF)break;if(e[0]!==t.TokenType.Dimension)continue;const n=e[4].unit.toLowerCase();if("vb"===n||"vi"===n)return!0}return!1}function hasSupportsAtRuleAncestor(e){let t=e.parent;for(;t;)if("atrule"===t.type){if("supports"===t.name.toLowerCase()&&hasFeature(t.params))return!0;t=t.parent}else t=t.parent;return!1}function transform(e,o){const n=t.tokenizer({css:e}),r=[];let i=!1;for(;;){const e=n.nextToken();if(!e)break;if(r.push(e),e[0]===t.TokenType.EOF)break;if(e[0]!==t.TokenType.Dimension)continue;const s=e[4].unit.toLowerCase();let c;"vi"===s?c=o.vi:"vb"===s&&(c=o.vb),c&&(e[1]=e[4].value.toString()+c,e[4].unit=c,i=!0)}return i?t.stringify(...r):e}!function(e){e.TopToBottom="top-to-bottom",e.BottomToTop="bottom-to-top",e.RightToLeft="right-to-left",e.LeftToRight="left-to-right"}(e||(e={}));const o=/(?:vi|vb)\b/i,creator=t=>{const n=Object.assign({inlineDirection:e.LeftToRight,preserve:!0},t);switch(n.inlineDirection){case e.LeftToRight:case e.RightToLeft:case e.TopToBottom:case e.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(e).join(", ")}`)}const r=[e.LeftToRight,e.RightToLeft].includes(n.inlineDirection),i={vb:"vh",vi:"vw"};return r||(i.vb="vw",i.vi="vh"),{postcssPlugin:"postcss-logical-viewport-units",Declaration(e,{atRule:t}){{if(!o.test(e.value))return;const t=e.prev();if(t&&"decl"===t.type&&t.prop===e.prop)return;if(hasSupportsAtRuleAncestor(e))return}const r=transform(e.value,i);if(r===e.value)return;if(e.cloneBefore({value:r}),!n.preserve)return void e.remove();if(!e.variable)return;const s=t({name:"supports",params:"(top: 1vi)",source:e.source}),c=e.parent;if(!c)return;const u=c.cloneAfter({nodes:[]});u.append(e),s.append(u),c.after(s)}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.d.ts b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.d.ts index bf4c6641..7933d724 100644 --- a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.d.ts +++ b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.d.ts @@ -1,11 +1,21 @@ import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; + +declare const creator: PluginCreator; +export default creator; + +export declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} + /** postcss-logical-viewport-units plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Sets the direction for inline. default: left-to-right */ inlineDirection?: DirectionFlow; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs index 5cd02459..0d970cf1 100644 --- a/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs +++ b/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs @@ -1 +1 @@ -import{tokenizer as t,TokenType as e,stringify as o}from"@csstools/css-tokenizer";function hasFeature(o){{const t=o.toLowerCase();if(!t.includes("vb")&&!t.includes("vi"))return!1}const n=t({css:o});for(;;){const t=n.nextToken();if(!t)break;if(t[0]===e.EOF)break;if(t[0]!==e.Dimension)continue;const o=t[4].unit.toLowerCase();if("vb"===o||"vi"===o)return!0}return!1}function hasSupportsAtRuleAncestor(t){let e=t.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()&&hasFeature(e.params))return!0;e=e.parent}else e=e.parent;return!1}var n,r;function transform(n,r){const i=t({css:n}),s=[];let u=!1;for(;;){const t=i.nextToken();if(!t)break;if(s.push(t),t[0]===e.EOF)break;if(t[0]!==e.Dimension)continue;const o=t[4].unit.toLowerCase();let n;"vi"===o?n=r.vi:"vb"===o&&(n=r.vb),n&&(t[1]=t[4].value.toString()+n,t[4].unit=n,u=!0)}return u?o(...s):n}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(n||(n={})),function(t){t.Top="top",t.Right="right",t.Bottom="bottom",t.Left="left"}(r||(r={}));const i=/(?:vi|vb)\b/i,creator=t=>{const e=Object.assign({inlineDirection:n.LeftToRight,preserve:!0},t),o=Object.values(n);if(!o.includes(e.inlineDirection))throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${o.join(", ")}`);const r=[n.LeftToRight,n.RightToLeft].includes(e.inlineDirection),s={vb:"vh",vi:"vw"};return r||(s.vb="vw",s.vi="vh"),{postcssPlugin:"postcss-logical-viewport-units",Declaration(t,{atRule:o}){{if(!i.test(t.value))return;const e=t.prev();if(e&&"decl"===e.type&&e.prop===t.prop)return;if(hasSupportsAtRuleAncestor(t))return}const n=transform(t.value,s);if(n===t.value)return;if(t.cloneBefore({value:n}),!e.preserve)return void t.remove();if(!t.variable)return;const r=o({name:"supports",params:"(top: 1vi)",source:t.source}),u=t.parent;if(!u)return;const c=u.cloneAfter({nodes:[]});c.append(t),r.append(c),u.after(r)}}};creator.postcss=!0;export{creator as default}; +import{tokenizer as t,TokenType as e,stringify as o}from"@csstools/css-tokenizer";function hasFeature(o){{const t=o.toLowerCase();if(!t.includes("vb")&&!t.includes("vi"))return!1}const r=t({css:o});for(;;){const t=r.nextToken();if(!t)break;if(t[0]===e.EOF)break;if(t[0]!==e.Dimension)continue;const o=t[4].unit.toLowerCase();if("vb"===o||"vi"===o)return!0}return!1}function hasSupportsAtRuleAncestor(t){let e=t.parent;for(;e;)if("atrule"===e.type){if("supports"===e.name.toLowerCase()&&hasFeature(e.params))return!0;e=e.parent}else e=e.parent;return!1}var r;function transform(r,n){const i=t({css:r}),s=[];let a=!1;for(;;){const t=i.nextToken();if(!t)break;if(s.push(t),t[0]===e.EOF)break;if(t[0]!==e.Dimension)continue;const o=t[4].unit.toLowerCase();let r;"vi"===o?r=n.vi:"vb"===o&&(r=n.vb),r&&(t[1]=t[4].value.toString()+r,t[4].unit=r,a=!0)}return a?o(...s):r}!function(t){t.TopToBottom="top-to-bottom",t.BottomToTop="bottom-to-top",t.RightToLeft="right-to-left",t.LeftToRight="left-to-right"}(r||(r={}));const n=/(?:vi|vb)\b/i,creator=t=>{const e=Object.assign({inlineDirection:r.LeftToRight,preserve:!0},t);switch(e.inlineDirection){case r.LeftToRight:case r.RightToLeft:case r.TopToBottom:case r.BottomToTop:break;default:throw new Error(`[postcss-logical-viewport-units] "inlineDirection" must be one of ${Object.values(r).join(", ")}`)}const o=[r.LeftToRight,r.RightToLeft].includes(e.inlineDirection),i={vb:"vh",vi:"vw"};return o||(i.vb="vw",i.vi="vh"),{postcssPlugin:"postcss-logical-viewport-units",Declaration(t,{atRule:o}){{if(!n.test(t.value))return;const e=t.prev();if(e&&"decl"===e.type&&e.prop===t.prop)return;if(hasSupportsAtRuleAncestor(t))return}const r=transform(t.value,i);if(r===t.value)return;if(t.cloneBefore({value:r}),!e.preserve)return void t.remove();if(!t.variable)return;const s=o({name:"supports",params:"(top: 1vi)",source:t.source}),a=t.parent;if(!a)return;const c=a.cloneAfter({nodes:[]});c.append(t),s.append(c),a.after(s)}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/lib/types.d.ts b/node_modules/@csstools/postcss-logical-viewport-units/dist/lib/types.d.ts deleted file mode 100644 index 2b3c47f9..00000000 --- a/node_modules/@csstools/postcss-logical-viewport-units/dist/lib/types.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export declare const DirectionValues: { - BlockStart: string; - BlockEnd: string; - InlineStart: string; - InlineEnd: string; -}; -export declare enum DirectionFlow { - TopToBottom = "top-to-bottom", - BottomToTop = "bottom-to-top", - RightToLeft = "right-to-left", - LeftToRight = "left-to-right" -} -export declare enum Axes { - Top = "top", - Right = "right", - Bottom = "bottom", - Left = "left" -} diff --git a/node_modules/@csstools/postcss-logical-viewport-units/dist/transform.d.ts b/node_modules/@csstools/postcss-logical-viewport-units/dist/transform.d.ts deleted file mode 100644 index 0d007ffa..00000000 --- a/node_modules/@csstools/postcss-logical-viewport-units/dist/transform.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export declare function transform(source: string, replacements: { - vi: 'vw' | 'vh'; - vb: 'vw' | 'vh'; -}): string; diff --git a/node_modules/@csstools/postcss-logical-viewport-units/package.json b/node_modules/@csstools/postcss-logical-viewport-units/package.json index f20a819d..c3626fe4 100644 --- a/node_modules/@csstools/postcss-logical-viewport-units/package.json +++ b/node_modules/@csstools/postcss-logical-viewport-units/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-logical-viewport-units", "description": "Use vb and vi length units in CSS", - "version": "2.0.3", + "version": "2.0.4", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,22 +48,11 @@ "dist" ], "dependencies": { - "@csstools/css-tokenizer": "^2.2.1" + "@csstools/css-tokenizer": "^2.2.2" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-logical-viewport-units#readme", "repository": { "type": "git", @@ -77,14 +69,5 @@ "postcss", "postcss-plugin", "viewport units" - ], - "csstools": { - "cssdbId": "logical-viewport-units", - "exportName": "postcssLogicalViewportUnits", - "humanReadableName": "PostCSS Logical Viewport Units", - "specUrl": "https://www.w3.org/TR/css-values-4/#viewport-relative-units" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-media-minmax/CHANGELOG.md b/node_modules/@csstools/postcss-media-minmax/CHANGELOG.md index 2ed00d6d..09166d6d 100644 --- a/node_modules/@csstools/postcss-media-minmax/CHANGELOG.md +++ b/node_modules/@csstools/postcss-media-minmax/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes to PostCSS Media MinMax +### 1.1.1 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch) +- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#216) (patch) + ### 1.1.0 _September 24, 2023_ @@ -16,54 +26,4 @@ _August 5, 2023_ - Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#214) (patch) -### 1.0.6 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) -- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#113) (patch) -- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#213) (patch) - -### 1.0.5 - -_July 3, 2023_ - -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#112) (patch) -- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#212) (patch) - -### 1.0.4 - -_June 21, 2023_ - -- Updated `@csstools/media-query-list-parser` to `2.1.1` (patch) - - -### 1.0.3 - -_June 1, 2023_ - -- Updated `@csstools/media-query-list-parser` to `2.1.0` (minor) - - -### 1.0.2 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-calc` to `1.1.1` (patch) -- Updated `@csstools/media-query-list-parser` to `2.0.4` (patch) - -### 1.0.1 - -_April 10, 2023_ - -- Improve the detection of math function in media queries. - -### 1.0.0 - -_March 30, 2023_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-minmax/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-media-minmax/dist/index.d.ts b/node_modules/@csstools/postcss-media-minmax/dist/index.d.ts index f22ef708..e60e05c0 100644 --- a/node_modules/@csstools/postcss-media-minmax/dist/index.d.ts +++ b/node_modules/@csstools/postcss-media-minmax/dist/index.d.ts @@ -1,5 +1,9 @@ import type { PluginCreator } from 'postcss'; -/** postcss-media-minmax plugin options */ -export type pluginOptions = never; + declare const creator: PluginCreator; export default creator; + +/** postcss-media-minmax plugin options */ +export declare type pluginOptions = never; + +export { } diff --git a/node_modules/@csstools/postcss-media-minmax/dist/to-lower-case-a-z.d.ts b/node_modules/@csstools/postcss-media-minmax/dist/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e..00000000 --- a/node_modules/@csstools/postcss-media-minmax/dist/to-lower-case-a-z.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/postcss-media-minmax/dist/transform-single-pair.d.ts b/node_modules/@csstools/postcss-media-minmax/dist/transform-single-pair.d.ts deleted file mode 100644 index 2b3e5ce0..00000000 --- a/node_modules/@csstools/postcss-media-minmax/dist/transform-single-pair.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { MediaFeature, MediaFeatureComparison, MediaFeatureValue } from '@csstools/media-query-list-parser'; -export declare function transformSingleNameValuePair(name: string, operator: MediaFeatureComparison, value: MediaFeatureValue, nameBeforeValue: boolean): MediaFeature | undefined; diff --git a/node_modules/@csstools/postcss-media-minmax/dist/transform.d.ts b/node_modules/@csstools/postcss-media-minmax/dist/transform.d.ts deleted file mode 100644 index 9bcd6223..00000000 --- a/node_modules/@csstools/postcss-media-minmax/dist/transform.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { MediaQuery } from '@csstools/media-query-list-parser'; -export declare function transform(mediaQueries: Array): string; diff --git a/node_modules/@csstools/postcss-media-minmax/package.json b/node_modules/@csstools/postcss-media-minmax/package.json index 1da41c6a..b4435755 100644 --- a/node_modules/@csstools/postcss-media-minmax/package.json +++ b/node_modules/@csstools/postcss-media-minmax/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-media-minmax", "description": "Use the range notation in CSS media queries", - "version": "1.1.0", + "version": "1.1.1", "contributors": [ { "name": "Antonio Laguna", @@ -30,15 +30,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -48,26 +51,14 @@ "dist" ], "dependencies": { - "@csstools/css-calc": "^1.1.4", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1", - "@csstools/media-query-list-parser": "^2.1.5" + "@csstools/css-calc": "^1.1.5", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2", + "@csstools/media-query-list-parser": "^2.1.6" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:browser": "node ./test/_browser.mjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-minmax#readme", "repository": { "type": "git", @@ -79,14 +70,5 @@ "media queries", "postcss-plugin", "range" - ], - "csstools": { - "cssdbId": "media-query-ranges", - "exportName": "postcssMediaMinMax", - "humanReadableName": "PostCSS Media MinMax", - "specUrl": "https://www.w3.org/TR/mediaqueries-4/#mq-features" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md index 71c37160..ff2b6f9e 100644 --- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md +++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md @@ -1,5 +1,14 @@ # Changes to PostCSS Media Queries Aspect-Ratio Number Values +### 2.0.4 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.6`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#216) (patch) + ### 2.0.3 _September 24, 2023_ @@ -14,55 +23,4 @@ _August 5, 2023_ - Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.4`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#214) (patch) -### 2.0.1 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) -- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#213) (patch) - -### 2.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/media-query-list-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser) to [`2.1.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/media-query-list-parser/CHANGELOG.md#212) (patch) - -### 1.0.4 - -_June 21, 2023_ - -- Updated `@csstools/media-query-list-parser` to `2.1.1` (patch) - - -### 1.0.3 - -_June 1, 2023_ - -- Updated `@csstools/media-query-list-parser` to `2.1.0` (minor) - - -### 1.0.2 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/media-query-list-parser` to `2.0.4` (patch) - -### 1.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` -- Updated `@csstools/css-parser-algorithms` to `2.0.0` (major) -- Updated `@csstools/css-tokenizer` to `2.0.0` (major) -- Updated `@csstools/media-query-list-parser` to `2.0.0` (major) - -### 1.0.0 - -_November 14, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-queries-aspect-ratio-number-values/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs index 836078f8..6b2cf88f 100644 --- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs +++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/media-query-list-parser"),r=require("@csstools/css-parser-algorithms"),n=require("@csstools/css-tokenizer");const o=1e5,t=2147483647;function transformMediaFeatureValue(a){if(Array.isArray(a.value)&&e.matchesRatioExactly(a.value)){const e=[];for(let o=0;oe&&([e,r]=[r,e]);;){if(0==r)return e;if(0==(e%=r))return r;r%=e}}const a=new Set(["aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio"]);function transformMediaQueryList(r,n){const o=e.parse(r,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw new Error(`Unable to parse media query "${r}"`)}}),t=new Set(o.map((e=>e.toString())));return o.flatMap((r=>{if(e.isMediaQueryInvalid(r))return[r.toString()];const o=e.cloneMediaQuery(r);o.walk((r=>{const n=r.node;if(e.isMediaFeaturePlain(n)||e.isMediaFeatureRangeNameValue(n)||e.isMediaFeatureRangeValueName(n)){const e=n.name.getName().toLowerCase();if(!a.has(e))return;transformMediaFeatureValue(n.value)}else if(e.isMediaFeatureRangeValueNameValue(n)){const e=n.name.getName().toLowerCase();if(!a.has(e))return;transformMediaFeatureValue(n.valueOne);transformMediaFeatureValue(n.valueTwo)}else;}));const i=r.toString(),u=o.toString();return u===i||t.has(u)?[i]:n?[i,u]:[u]})).join(",")}const creator=e=>{const r=Object.assign({preserve:!1},e);return{postcssPlugin:"postcss-media-queries-aspect-ratio-number-values",AtRule(e,{result:n}){if("media"!==e.name.toLowerCase())return;const o=e.params.toLowerCase();if(!(o.includes("aspect-ratio")||o.includes("min-aspect-ratio")||o.includes("max-aspect-ratio")||o.includes("device-aspect-ratio")||o.includes("min-device-aspect-ratio")||o.includes("max-device-aspect-ratio")))return;let t;try{if(t=transformMediaQueryList(e.params,r.preserve),t===e.params)return}catch(r){return void e.warn(n,`Failed to transform @media params for "${e.params}" with message: "${r.message}"`)}e.cloneBefore({params:t}),e.remove()}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("@csstools/media-query-list-parser"),r=require("@csstools/css-parser-algorithms"),n=require("@csstools/css-tokenizer");const o=1e5,t=2147483647;function transformMediaFeatureValue(a){if(Array.isArray(a.value)&&e.matchesRatioExactly(a.value)){const e=[];for(let o=0;oe&&([e,r]=[r,e]);;){if(0==r)return e;if(0==(e%=r))return r;r%=e}}const a=new Set(["aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio"]);function transformMediaQueryList(r,n){const o=e.parse(r,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw new Error(`Unable to parse media query "${r}"`)}}),t=new Set(o.map((e=>e.toString())));return o.flatMap((r=>{if(e.isMediaQueryInvalid(r))return[r.toString()];const o=e.cloneMediaQuery(r);o.walk((r=>{const n=r.node;if(e.isMediaFeaturePlain(n)||e.isMediaFeatureRangeNameValue(n)||e.isMediaFeatureRangeValueName(n)){const e=n.name.getName().toLowerCase();if(!a.has(e))return;transformMediaFeatureValue(n.value)}else if(e.isMediaFeatureRangeValueNameValue(n)){const e=n.name.getName().toLowerCase();if(!a.has(e))return;transformMediaFeatureValue(n.valueOne);transformMediaFeatureValue(n.valueTwo)}else;}));const i=r.toString(),u=o.toString();return u===i||t.has(u)?[i]:n?[i,u]:[u]})).join(",")}const creator=e=>{const r=Object.assign({preserve:!1},e);return{postcssPlugin:"postcss-media-queries-aspect-ratio-number-values",AtRule(e,{result:n}){if("media"!==e.name.toLowerCase())return;const o=e.params.toLowerCase();if(!(o.includes("aspect-ratio")||o.includes("min-aspect-ratio")||o.includes("max-aspect-ratio")||o.includes("device-aspect-ratio")||o.includes("min-device-aspect-ratio")||o.includes("max-device-aspect-ratio")))return;let t;try{if(t=transformMediaQueryList(e.params,r.preserve),t===e.params)return}catch(r){return void e.warn(n,`Failed to transform @media params for "${e.params}" with message: "${r instanceof Error?r.message:r}"`)}e.cloneBefore({params:t}),e.remove()}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.d.ts b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.d.ts index 92223f79..5c1498f8 100644 --- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.d.ts +++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-media-queries-aspect-ratio-number-values plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs index ceb624c5..9b382247 100644 --- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs +++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs @@ -1 +1 @@ -import{matchesRatioExactly as e,parse as r,isMediaQueryInvalid as t,cloneMediaQuery as a,isMediaFeaturePlain as n,isMediaFeatureRangeNameValue as o,isMediaFeatureRangeValueName as i,isMediaFeatureRangeValueNameValue as u}from"@csstools/media-query-list-parser";import{isTokenNode as s,isFunctionNode as l,TokenNode as c,FunctionNode as m,SimpleBlockNode as v,WhitespaceNode as d}from"@csstools/css-parser-algorithms";import{TokenType as p,NumberType as f}from"@csstools/css-tokenizer";const g=1e5,w=2147483647;function transformMediaFeatureValue(r){if(Array.isArray(r.value)&&e(r.value)){const e=[];for(let t=0;te&&([e,r]=[r,e]);;){if(0==r)return e;if(0==(e%=r))return r;r%=e}}const N=new Set(["aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio"]);function transformMediaQueryList(e,s){const l=r(e,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw new Error(`Unable to parse media query "${e}"`)}}),c=new Set(l.map((e=>e.toString())));return l.flatMap((e=>{if(t(e))return[e.toString()];const r=a(e);r.walk((e=>{const r=e.node;if(n(r)||o(r)||i(r)){const e=r.name.getName().toLowerCase();if(!N.has(e))return;transformMediaFeatureValue(r.value)}else if(u(r)){const e=r.name.getName().toLowerCase();if(!N.has(e))return;transformMediaFeatureValue(r.valueOne);transformMediaFeatureValue(r.valueTwo)}else;}));const l=e.toString(),m=r.toString();return m===l||c.has(m)?[l]:s?[l,m]:[m]})).join(",")}const creator=e=>{const r=Object.assign({preserve:!1},e);return{postcssPlugin:"postcss-media-queries-aspect-ratio-number-values",AtRule(e,{result:t}){if("media"!==e.name.toLowerCase())return;const a=e.params.toLowerCase();if(!(a.includes("aspect-ratio")||a.includes("min-aspect-ratio")||a.includes("max-aspect-ratio")||a.includes("device-aspect-ratio")||a.includes("min-device-aspect-ratio")||a.includes("max-device-aspect-ratio")))return;let n;try{if(n=transformMediaQueryList(e.params,r.preserve),n===e.params)return}catch(r){return void e.warn(t,`Failed to transform @media params for "${e.params}" with message: "${r.message}"`)}e.cloneBefore({params:n}),e.remove()}}};creator.postcss=!0;export{creator as default}; +import{matchesRatioExactly as e,parse as r,isMediaQueryInvalid as t,cloneMediaQuery as a,isMediaFeaturePlain as n,isMediaFeatureRangeNameValue as o,isMediaFeatureRangeValueName as i,isMediaFeatureRangeValueNameValue as u}from"@csstools/media-query-list-parser";import{isTokenNode as s,isFunctionNode as l,TokenNode as c,FunctionNode as m,SimpleBlockNode as v,WhitespaceNode as d}from"@csstools/css-parser-algorithms";import{TokenType as p,NumberType as f}from"@csstools/css-tokenizer";const g=1e5,w=2147483647;function transformMediaFeatureValue(r){if(Array.isArray(r.value)&&e(r.value)){const e=[];for(let t=0;te&&([e,r]=[r,e]);;){if(0==r)return e;if(0==(e%=r))return r;r%=e}}const N=new Set(["aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio"]);function transformMediaQueryList(e,s){const l=r(e,{preserveInvalidMediaQueries:!0,onParseError:()=>{throw new Error(`Unable to parse media query "${e}"`)}}),c=new Set(l.map((e=>e.toString())));return l.flatMap((e=>{if(t(e))return[e.toString()];const r=a(e);r.walk((e=>{const r=e.node;if(n(r)||o(r)||i(r)){const e=r.name.getName().toLowerCase();if(!N.has(e))return;transformMediaFeatureValue(r.value)}else if(u(r)){const e=r.name.getName().toLowerCase();if(!N.has(e))return;transformMediaFeatureValue(r.valueOne);transformMediaFeatureValue(r.valueTwo)}else;}));const l=e.toString(),m=r.toString();return m===l||c.has(m)?[l]:s?[l,m]:[m]})).join(",")}const creator=e=>{const r=Object.assign({preserve:!1},e);return{postcssPlugin:"postcss-media-queries-aspect-ratio-number-values",AtRule(e,{result:t}){if("media"!==e.name.toLowerCase())return;const a=e.params.toLowerCase();if(!(a.includes("aspect-ratio")||a.includes("min-aspect-ratio")||a.includes("max-aspect-ratio")||a.includes("device-aspect-ratio")||a.includes("min-device-aspect-ratio")||a.includes("max-device-aspect-ratio")))return;let n;try{if(n=transformMediaQueryList(e.params,r.preserve),n===e.params)return}catch(r){return void e.warn(t,`Failed to transform @media params for "${e.params}" with message: "${r instanceof Error?r.message:r}"`)}e.cloneBefore({params:n}),e.remove()}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-feature-value.d.ts b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-feature-value.d.ts deleted file mode 100644 index 1808b946..00000000 --- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-feature-value.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { MediaFeatureValue } from '@csstools/media-query-list-parser'; -export declare function transformMediaFeatureValue(value: MediaFeatureValue): void; diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-query-list.d.ts b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-query-list.d.ts deleted file mode 100644 index a2fcb6a9..00000000 --- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-query-list.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function transformMediaQueryList(params: string, preserve: boolean): string; diff --git a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json index b7c3b033..f515fa3c 100644 --- a/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json +++ b/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-media-queries-aspect-ratio-number-values", "description": "Use number values in aspect-ratio media queries.", - "version": "2.0.3", + "version": "2.0.4", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,24 +48,13 @@ "dist" ], "dependencies": { - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1", - "@csstools/media-query-list-parser": "^2.1.5" + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2", + "@csstools/media-query-list-parser": "^2.1.6" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-media-queries-aspect-ratio-number-values#readme", "repository": { "type": "git", @@ -74,14 +66,5 @@ "aspect-ratio", "media queries", "postcss-plugin" - ], - "csstools": { - "cssdbId": "media-queries-aspect-ratio-number-values", - "exportName": "postcssMediaQueriesAspectRatioNumberValues", - "humanReadableName": "PostCSS Media Queries Aspect-Ratio Number Values", - "specUrl": "https://www.w3.org/TR/mediaqueries-4/#aspect-ratio" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md b/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md index fc9be8f1..bd4cf68e 100644 --- a/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md +++ b/node_modules/@csstools/postcss-nested-calc/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Nested Calc +### 3.0.1 + +_December 15, 2023_ + +- Fix type definitions + ### 3.0.0 _July 3, 2023_ @@ -12,20 +18,4 @@ _February 9, 2023_ - Reduce the amount of duplicate fallback CSS. -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.0 - -_August 15, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nested-calc/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-nested-calc/README.md b/node_modules/@csstools/postcss-nested-calc/README.md index fb7beee0..5b822e35 100644 --- a/node_modules/@csstools/postcss-nested-calc/README.md +++ b/node_modules/@csstools/postcss-nested-calc/README.md @@ -2,6 +2,10 @@ [npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] +```bash +npm install @csstools/postcss-nested-calc --save-dev +``` + [PostCSS Nested Calc] lets you use nested `calc()` expressions following the [CSS Values and Units 4 specification]. ```pcss diff --git a/node_modules/@csstools/postcss-nested-calc/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-nested-calc/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-nested-calc/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-nested-calc/dist/index.d.ts b/node_modules/@csstools/postcss-nested-calc/dist/index.d.ts index 139448be..d6f1df1e 100644 --- a/node_modules/@csstools/postcss-nested-calc/dist/index.d.ts +++ b/node_modules/@csstools/postcss-nested-calc/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-nested-calc plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-nested-calc/dist/occurrences.d.ts b/node_modules/@csstools/postcss-nested-calc/dist/occurrences.d.ts deleted file mode 100644 index 61f8b784..00000000 --- a/node_modules/@csstools/postcss-nested-calc/dist/occurrences.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function numberOfCalcOccurrences(value: string): number; diff --git a/node_modules/@csstools/postcss-nested-calc/package.json b/node_modules/@csstools/postcss-nested-calc/package.json index 3f36e0b1..d4bb4e20 100644 --- a/node_modules/@csstools/postcss-nested-calc/package.json +++ b/node_modules/@csstools/postcss-nested-calc/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-nested-calc", "description": "Use nested calc() expressions in CSS", - "version": "3.0.0", + "version": "3.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -50,17 +53,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nested-calc#readme", "repository": { "type": "git", @@ -74,14 +66,5 @@ "math", "nested", "postcss-plugin" - ], - "csstools": { - "cssdbId": "nested-calc", - "exportName": "postcssNestedCalc", - "humanReadableName": "PostCSS Nested Calc", - "specUrl": "https://www.w3.org/TR/css-values/#calc-func" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-normalize-display-values/CHANGELOG.md b/node_modules/@csstools/postcss-normalize-display-values/CHANGELOG.md index a1c02e84..81ae9b16 100644 --- a/node_modules/@csstools/postcss-normalize-display-values/CHANGELOG.md +++ b/node_modules/@csstools/postcss-normalize-display-values/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Normalize Display Values +### 3.0.2 + +_December 15, 2023_ + +- Fix type definitions + ### 3.0.1 _September 18, 2023_ @@ -12,26 +18,4 @@ _July 3, 2023_ - Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.1 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 1.0.0 - -_January 25, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-normalize-display-values/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-normalize-display-values/dist/index.cjs b/node_modules/@csstools/postcss-normalize-display-values/dist/index.cjs index cdd54eb4..681198e8 100644 --- a/node_modules/@csstools/postcss-normalize-display-values/dist/index.cjs +++ b/node_modules/@csstools/postcss-normalize-display-values/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-value-parser"),l=new Map([["block,flow","block"],["block,flow-root","flow-root"],["inline,flow","inline"],["inline,flow-root","inline-block"],["run-in,flow","run-in"],["list-item,block,flow","list-item"],["inline,flow,list-item","inline list-item"],["block,flex","flex"],["inline,flex","inline-flex"],["block,grid","grid"],["inline,grid","inline-grid"],["inline,ruby","ruby"],["block,table","table"],["inline,table","inline-table"],["table-cell,flow","table-cell"],["table-caption,flow","table-caption"],["ruby-base,flow","ruby-base"],["ruby-text,flow","ruby-text"]]);function transform(n){const{nodes:t}=e(n);if(1===t.length)return n;const o=t.filter((e=>"word"===e.type)).map((e=>e.value.toLowerCase()));if(o.length<=1)return n;const i=l.get(o.join(","));return i||n}const n=/^display$/i,creator=e=>{const l=!("preserve"in Object(e))||Boolean(null==e?void 0:e.preserve);return{postcssPlugin:"postcss-normalize-display-values",prepare(){const e=new Map;return{Declaration(t){if(!n.test(t.prop))return;const o=t.value;if(!o)return;if(e.has(o))return void(t.value!==e.get(o)&&(t.cloneBefore({value:e.get(o)}),l||t.remove()));const i=transform(o);e.set(o,i),t.value!==i&&(t.cloneBefore({value:i}),l||t.remove())}}}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("postcss-value-parser"),l=new Map([["block,flow","block"],["block,flow-root","flow-root"],["inline,flow","inline"],["inline,flow-root","inline-block"],["run-in,flow","run-in"],["list-item,block,flow","list-item"],["inline,flow,list-item","inline list-item"],["block,flex","flex"],["inline,flex","inline-flex"],["block,grid","grid"],["inline,grid","inline-grid"],["inline,ruby","ruby"],["block,table","table"],["inline,table","inline-table"],["table-cell,flow","table-cell"],["table-caption,flow","table-caption"],["ruby-base,flow","ruby-base"],["ruby-text,flow","ruby-text"]]);function transform(n){const{nodes:t}=e(n);if(1===t.length)return n;const o=t.filter((e=>"word"===e.type)).map((e=>e.value.toLowerCase()));if(o.length<=1)return n;const i=l.get(o.join(","));return i||n}const n=/^display$/i,creator=e=>{const l=!("preserve"in Object(e))||Boolean(e?.preserve);return{postcssPlugin:"postcss-normalize-display-values",prepare(){const e=new Map;return{Declaration(t){if(!n.test(t.prop))return;const o=t.value;if(!o)return;if(e.has(o))return void(t.value!==e.get(o)&&(t.cloneBefore({value:e.get(o)}),l||t.remove()));const i=transform(o);e.set(o,i),t.value!==i&&(t.cloneBefore({value:i}),l||t.remove())}}}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-normalize-display-values/dist/index.d.ts b/node_modules/@csstools/postcss-normalize-display-values/dist/index.d.ts index b0606a31..54036ec0 100644 --- a/node_modules/@csstools/postcss-normalize-display-values/dist/index.d.ts +++ b/node_modules/@csstools/postcss-normalize-display-values/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-normalize-display-values plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs b/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs index bda81c6d..69df945a 100644 --- a/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs +++ b/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-value-parser";var l=new Map([["block,flow","block"],["block,flow-root","flow-root"],["inline,flow","inline"],["inline,flow-root","inline-block"],["run-in,flow","run-in"],["list-item,block,flow","list-item"],["inline,flow,list-item","inline list-item"],["block,flex","flex"],["inline,flex","inline-flex"],["block,grid","grid"],["inline,grid","inline-grid"],["inline,ruby","ruby"],["block,table","table"],["inline,table","inline-table"],["table-cell,flow","table-cell"],["table-caption,flow","table-caption"],["ruby-base,flow","ruby-base"],["ruby-text,flow","ruby-text"]]);function transform(n){const{nodes:o}=e(n);if(1===o.length)return n;const t=o.filter((e=>"word"===e.type)).map((e=>e.value.toLowerCase()));if(t.length<=1)return n;const i=l.get(t.join(","));return i||n}const n=/^display$/i,creator=e=>{const l=!("preserve"in Object(e))||Boolean(null==e?void 0:e.preserve);return{postcssPlugin:"postcss-normalize-display-values",prepare(){const e=new Map;return{Declaration(o){if(!n.test(o.prop))return;const t=o.value;if(!t)return;if(e.has(t))return void(o.value!==e.get(t)&&(o.cloneBefore({value:e.get(t)}),l||o.remove()));const i=transform(t);e.set(t,i),o.value!==i&&(o.cloneBefore({value:i}),l||o.remove())}}}}};creator.postcss=!0;export{creator as default}; +import e from"postcss-value-parser";var l=new Map([["block,flow","block"],["block,flow-root","flow-root"],["inline,flow","inline"],["inline,flow-root","inline-block"],["run-in,flow","run-in"],["list-item,block,flow","list-item"],["inline,flow,list-item","inline list-item"],["block,flex","flex"],["inline,flex","inline-flex"],["block,grid","grid"],["inline,grid","inline-grid"],["inline,ruby","ruby"],["block,table","table"],["inline,table","inline-table"],["table-cell,flow","table-cell"],["table-caption,flow","table-caption"],["ruby-base,flow","ruby-base"],["ruby-text,flow","ruby-text"]]);function transform(n){const{nodes:t}=e(n);if(1===t.length)return n;const o=t.filter((e=>"word"===e.type)).map((e=>e.value.toLowerCase()));if(o.length<=1)return n;const i=l.get(o.join(","));return i||n}const n=/^display$/i,creator=e=>{const l=!("preserve"in Object(e))||Boolean(e?.preserve);return{postcssPlugin:"postcss-normalize-display-values",prepare(){const e=new Map;return{Declaration(t){if(!n.test(t.prop))return;const o=t.value;if(!o)return;if(e.has(o))return void(t.value!==e.get(o)&&(t.cloneBefore({value:e.get(o)}),l||t.remove()));const i=transform(o);e.set(o,i),t.value!==i&&(t.cloneBefore({value:i}),l||t.remove())}}}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-normalize-display-values/dist/mappings.d.ts b/node_modules/@csstools/postcss-normalize-display-values/dist/mappings.d.ts deleted file mode 100644 index 7ca13f69..00000000 --- a/node_modules/@csstools/postcss-normalize-display-values/dist/mappings.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Specification: https://www.w3.org/TR/css-display-3/#the-display-properties - */ -declare const _default: Map; -export default _default; diff --git a/node_modules/@csstools/postcss-normalize-display-values/package.json b/node_modules/@csstools/postcss-normalize-display-values/package.json index d2fa0fad..40076298 100644 --- a/node_modules/@csstools/postcss-normalize-display-values/package.json +++ b/node_modules/@csstools/postcss-normalize-display-values/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-normalize-display-values", "description": "Use two values display syntax for inner and outer display types.", - "version": "3.0.1", + "version": "3.0.2", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -40,17 +43,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "repository": { "type": "git", "url": "https://github.com/csstools/postcss-plugins.git", @@ -78,12 +70,5 @@ "table", "table-caption", "table-cell" - ], - "csstools": { - "exportName": "postcssNormalizeDisplayValues", - "humanReadableName": "PostCSS Normalize Display Values" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-oklab-function/CHANGELOG.md b/node_modules/@csstools/postcss-oklab-function/CHANGELOG.md index ba174ce8..fc173d0e 100644 --- a/node_modules/@csstools/postcss-oklab-function/CHANGELOG.md +++ b/node_modules/@csstools/postcss-oklab-function/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes to PostCSS OKLab Function +### 3.0.8 + +_December 15, 2023_ + +- Skip transforms when a color value contains experimental syntax +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor) + ### 3.0.7 _October 9, 2023_ @@ -13,153 +23,4 @@ _October 2, 2023_ - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#133) (patch) -### 3.0.5 - -_September 24, 2023_ - -- Small performance improvements -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#132) (patch) - -### 3.0.4 - -_September 18, 2023_ - -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch) - -### 3.0.3 - -_September 2, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#131) (patch) - -### 3.0.2 - -_August 28, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#130) (minor) - -### 3.0.1 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#300) (major) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#122) (patch) - -### 2.2.3 - -_June 1, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.3.0` (minor) - - -### 2.2.2 - -_May 19, 2023_ - -- Ignore relative color syntax -- Updated `@csstools/postcss-progressive-custom-properties` to `2.2.0` (minor) -- Updated `@csstools/css-color-parser` to `1.2.0` (minor) - - - -### 2.2.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-color-parser` to `1.1.2` (patch) - -### 2.2.0 - -_March 25, 2023_ - -- Add `@csstools/css-color-parser` dependency for all color value transformations. -- Add support for `calc` expressions in color components. -- Skip `color(display-p3 0 0 0)` fallbacks when the color is already in the `srgb` gamut. - -### 2.1.0 - -_February 6, 2023_ - -- Add: `@csstools/color-helpers` dependency for all color value transformations. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.1.1 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 1.1.0 - -_April 4, 2022_ - -- Allow percentage and number units in more color components. - -```css -.percentages { - color-1: oklab(40% 0.309% 0.975%); - color-2: oklch(40% 31.718385875% 34.568626); - - /* becomes */ - - color-1: rgb(73, 71, 69); - color-1: color(display-p3 0.28515 0.27983 0.27246); - color-2: rgb(126, 37, 15); - color-2: color(display-p3 0.45368 0.16978 0.09411); -} - -.numbers { - color-1: oklab(0.40 0.001236 0.0039); - color-2: oklch(0.40 0.1268735435 34.568626); - - /* becomes */ - - color-1: rgb(73, 71, 69); - color-1: color(display-p3 0.28515 0.27983 0.27246); - color-2: rgb(126, 37, 15); - color-2: color(display-p3 0.45368 0.16978 0.09411); -} -``` - -### 1.0.2 - -_March 8, 2022_ - -- Fix gamut mapping giving overly unsaturated colors. -- Implement powerless color components in gamut mapping. - -### 1.0.1 - -_February 12, 2022_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `1.1.0`. - -### 1.0.0 - -_February 11, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-oklab-function/README.md b/node_modules/@csstools/postcss-oklab-function/README.md index 6543b063..6ee6fb54 100644 --- a/node_modules/@csstools/postcss-oklab-function/README.md +++ b/node_modules/@csstools/postcss-oklab-function/README.md @@ -95,7 +95,8 @@ postcssOKLabFunction({ preserve: true }) The `enableProgressiveCustomProperties` option determines whether the original notation is wrapped with `@supports` when used in Custom Properties. By default, it is enabled. -⚠️ We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). +> [!NOTE] +> We only recommend disabling this when you set `preserve` to `false` or if you bring your own fix for Custom Properties. See what the plugin does in its [README](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties#readme). ```js postcssOKLabFunction({ enableProgressiveCustomProperties: false }) diff --git a/node_modules/@csstools/postcss-oklab-function/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-oklab-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-oklab-function/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-oklab-function/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-oklab-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ec..00000000 --- a/node_modules/@csstools/postcss-oklab-function/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-oklab-function/dist/index.cjs b/node_modules/@csstools/postcss-oklab-function/dist/index.cjs index 161dff7e..b93e4cd1 100644 --- a/node_modules/@csstools/postcss-oklab-function/dist/index.cjs +++ b/node_modules/@csstools/postcss-oklab-function/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e({postcssPlugin:"postcss-oklab-function",Declaration:n=>{const l=n.value;if(!o.test(l))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const i=s.tokenize({css:l}),u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(i),(e=>{if(t.isFunctionNode(e)&&a.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.serializeRGB(s)}})),c=t.stringify(u);if(c===l)return;let p=c;null!=e&&e.subFeatures.displayP3&&(p=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(i),(e=>{if(t.isFunctionNode(e)&&a.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.colorDataFitsRGB_Gamut(s)?r.serializeRGB(s):r.serializeP3(s)}})))),n.cloneBefore({value:c}),null!=e&&e.subFeatures.displayP3&&p!==c&&n.cloneBefore({value:p}),null!=e&&e.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},s);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e({postcssPlugin:"postcss-oklab-function",Declaration:n=>{const i=n.value;if(!o.test(i))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const l=s.tokenize({css:i}),u=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(e=>{if(t.isFunctionNode(e)&&a.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.Experimental))return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.serializeRGB(s)}})),p=t.stringify(u);if(p===i)return;let c=p;e?.subFeatures.displayP3&&(c=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(e=>{if(t.isFunctionNode(e)&&a.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.colorDataFitsRGB_Gamut(s)?r.serializeRGB(s):r.serializeP3(s)}})))),n.cloneBefore({value:p}),e?.subFeatures.displayP3&&c!==p&&n.cloneBefore({value:c}),e?.preserve||n.remove()}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},s);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-oklab-function/dist/index.d.ts b/node_modules/@csstools/postcss-oklab-function/dist/index.d.ts index aee8de5f..cf304740 100644 --- a/node_modules/@csstools/postcss-oklab-function/dist/index.d.ts +++ b/node_modules/@csstools/postcss-oklab-function/dist/index.d.ts @@ -1,6 +1,7 @@ import type { PluginCreator } from 'postcss'; + /** postcss-oklab-function plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ @@ -11,5 +12,8 @@ export type pluginOptions = { displayP3?: boolean; }; }; + declare const postcssPlugin: PluginCreator; export default postcssPlugin; + +export { } diff --git a/node_modules/@csstools/postcss-oklab-function/dist/index.mjs b/node_modules/@csstools/postcss-oklab-function/dist/index.mjs index 8544a15e..194eaeda 100644 --- a/node_modules/@csstools/postcss-oklab-function/dist/index.mjs +++ b/node_modules/@csstools/postcss-oklab-function/dist/index.mjs @@ -1 +1 @@ -import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as a,serializeP3 as n}from"@csstools/css-color-parser";import{replaceComponentValues as l,parseCommaSeparatedListOfComponentValues as u,isFunctionNode as i,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),t=e.index(s);for(let s=0;s({postcssPlugin:"postcss-oklab-function",Declaration:m=>{const b=m.value;if(!c.test(b))return;if(hasFallback(m))return;if(hasSupportsAtRuleAncestor(m))return;const g=e({css:b}),y=l(u(g),(s=>{if(i(s)&&f.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.HasNoneKeywords))return;if(e.syntaxFlags.has(t.RelativeColorSyntax))return;return o(e)}})),d=p(y);if(d===b)return;let h=d;null!=s&&s.subFeatures.displayP3&&(h=p(l(u(g),(s=>{if(i(s)&&f.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.HasNoneKeywords))return;if(e.syntaxFlags.has(t.RelativeColorSyntax))return;return a(e)?o(e):n(e)}})))),m.cloneBefore({value:d}),null!=s&&s.subFeatures.displayP3&&h!==d&&m.cloneBefore({value:h}),null!=s&&s.preserve||m.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as a,serializeP3 as n}from"@csstools/css-color-parser";import{replaceComponentValues as i,parseCommaSeparatedListOfComponentValues as l,isFunctionNode as u,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),t=e.index(s);for(let s=0;s({postcssPlugin:"postcss-oklab-function",Declaration:m=>{const b=m.value;if(!c.test(b))return;if(hasFallback(m))return;if(hasSupportsAtRuleAncestor(m))return;const g=e({css:b}),y=i(l(g),(s=>{if(u(s)&&f.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.Experimental))return;if(e.syntaxFlags.has(t.HasNoneKeywords))return;if(e.syntaxFlags.has(t.RelativeColorSyntax))return;return o(e)}})),d=p(y);if(d===b)return;let h=d;s?.subFeatures.displayP3&&(h=p(i(l(g),(s=>{if(u(s)&&f.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.HasNoneKeywords))return;if(e.syntaxFlags.has(t.RelativeColorSyntax))return;return a(e)?o(e):n(e)}})))),m.cloneBefore({value:d}),s?.subFeatures.displayP3&&h!==d&&m.cloneBefore({value:h}),s?.preserve||m.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-oklab-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-oklab-function/package.json b/node_modules/@csstools/postcss-oklab-function/package.json index 34b11c0e..da33f788 100644 --- a/node_modules/@csstools/postcss-oklab-function/package.json +++ b/node_modules/@csstools/postcss-oklab-function/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-oklab-function", "description": "Use oklab() and oklch() color functions in CSS", - "version": "3.0.7", + "version": "3.0.8", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "./dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -35,25 +38,14 @@ "dist" ], "dependencies": { - "@csstools/css-color-parser": "^1.4.0", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1", - "@csstools/postcss-progressive-custom-properties": "^3.0.2" + "@csstools/css-color-parser": "^1.5.0", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2", + "@csstools/postcss-progressive-custom-properties": "^3.0.3" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-oklab-function#readme", "repository": { "type": "git", @@ -71,12 +63,5 @@ "postcss", "postcss-plugin", "syntax" - ], - "csstools": { - "exportName": "postcssOKLabFunction", - "humanReadableName": "PostCSS OKLab Function" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md b/node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md index ad87d81d..b7a01fef 100644 --- a/node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md +++ b/node_modules/@csstools/postcss-progressive-custom-properties/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Progressive Custom Properties +### 3.0.3 + +_December 15, 2023_ + +- Fix type definitions + ### 3.0.2 _October 9, 2023_ @@ -14,82 +20,4 @@ _September 18, 2023_ - Improve performance -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) - -### 2.3.0 - -_June 1, 2023_ - -- Add support for regular properties whose values contain `var()` - -```css -.property-with-var--1 { - color: rgba(87, 107, 149, var(--opacity)); - color: rgb(87 107 149 / var(--opacity)); -} - -/* becomes */ -.property-with-var--1 { - color: rgba(87, 107, 149, var(--opacity)); -} - -@supports (color: rgb(0 0 0 / 0)) and (top: var(--f)) { - .property-with-var--1 { - color: rgb(87 107 149 / var(--opacity)); - } -} -``` - -### 2.2.0 - -_May 19, 2023_ - -- Add relative color syntax support. -- Fix false positive matches for `rgb` and `hsl` modern function notations. - -### 2.1.1 - -_March 25, 2023_ - -- Smaller `@supports` check for `color-mix`. - -### 2.1.0 - -_February 2, 2023_ - -- Group support rules with the same params to reduce the output size. - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -## 1.3.0 (March 7, 2022) - -- Add matching rules for `color-mix` -- Fix matching rules for gradient functions -- Reduce matchers size - -## 1.2.0 (February 15, 2022) - -- More matching rules for [double position gradients](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-double-position-gradients#readme). - -## 1.1.0 (February 12, 2022) - -- No longer uses custom properties in `@supports` rules. -- Implement AST matching for values and units and generate minimal `@supports` for select features. - -## 1.0.0 (February 6, 2022) - -Initial release +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/README.md b/node_modules/@csstools/postcss-progressive-custom-properties/README.md index 1e59a3e4..9b3b68ab 100644 --- a/node_modules/@csstools/postcss-progressive-custom-properties/README.md +++ b/node_modules/@csstools/postcss-progressive-custom-properties/README.md @@ -6,8 +6,9 @@ [PostCSS Progressive Custom Properties] is a utility plugin to correctly declare Custom Property fallbacks and enhancements. -⚠️ It is not intended to be used directly by stylesheet authors. -Meant to be included in other PostCSS plugins that provide CSS value transforms as fallbacks. +> [!WARNING] +> It is not intended to be used directly by stylesheet authors. +> Meant to be included in other PostCSS plugins that provide CSS value transforms as fallbacks. [Custom Properties are not discarded like regular declarations when invalid.](https://www.w3.org/TR/css-variables-1/#invalid-variables) This makes it tricky to provide fallback values for older browsers. diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/conditions-from-values.d.ts b/node_modules/@csstools/postcss-progressive-custom-properties/dist/conditions-from-values.d.ts deleted file mode 100644 index 250b5e91..00000000 --- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/conditions-from-values.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare function conditionsFromValue(value: string, mustContainVar?: boolean): { - support: Array; -}; diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/custom/double-position-gradients.d.ts b/node_modules/@csstools/postcss-progressive-custom-properties/dist/custom/double-position-gradients.d.ts deleted file mode 100644 index 6ca404c9..00000000 --- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/custom/double-position-gradients.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss-value-parser'; -export declare function doublePositionGradients(node: Node): Array; diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs index 35a10519..550926ab 100644 --- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs +++ b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-value-parser");const a=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function doublePositionGradients(e){const r=[],p=e.value.toLowerCase();if("function"===e.type&&("conic-gradient"===p||"linear-gradient"===p||"radial-gradient"===p||"repeating-conic-gradient"===p||"repeating-linear-gradient"===p||"repeating-radial-gradient"===p)){let p=0,t=!1,i=!1;e:for(let o=0;oa.includes(e.sniff)));let s=!1;try{e(a).walk((a=>{"function"===a.type&&p.test(a.value)&&(s=!0);try{const r=e.unit(a.value);!1!==r&&(a.dimension=r)}catch{}for(let e=0;e({postcssPlugin:"postcss-progressive-custom-properties",prepare(){const e=new WeakMap;return{OnceExit:(a,{postcss:r})=>{a.walkDecls((a=>{if(!a.parent)return;const p=e.get(a.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{support:void 0},lastConditionalRule:void 0};if(e.set(a.parent,p),a.variable){if(!p.propNames.has(a.prop))return void p.propNames.add(a.prop)}else{const e=a.prop.toLowerCase();if(!p.propNames.has(e))return void p.propNames.add(e)}if(!a.variable&&!t.test(a.value))return;if(i.test(a.value))return;if(o.test(a.value))return;const s=!a.variable,l=conditionsFromValue(a.value,s).support.join(" and ");if(!l)return;if(p.lastConditionParams.support!==l&&(p.lastConditionalRule=void 0),p.lastConditionalRule)return p.lastConditionalRule.append(a.clone()),void a.remove();const y=[];if(l&&y.push(r.atRule({name:"supports",params:l,source:a.parent.source,raws:{before:"\n\n",after:"\n"}})),!y.length)return;for(let e=0;e{const r=e.get(a);r&&0!==r.conditionalRules.length&&r.conditionalRules.reverse().forEach((e=>{a.after(e)}))}))}}}});creator.postcss=!0,module.exports=creator; +"use strict";var e=require("postcss-value-parser");const a=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function doublePositionGradients(e){const r=[],p=e.value.toLowerCase();if("function"===e.type&&("conic-gradient"===p||"linear-gradient"===p||"radial-gradient"===p||"repeating-conic-gradient"===p||"repeating-linear-gradient"===p||"repeating-radial-gradient"===p)){let p=0,t=!1,i=!1;e:for(let o=0;oa.includes(e.sniff)));let s=!1;try{e(a).walk((a=>{"function"===a.type&&p.test(a.value)&&(s=!0);try{const r=e.unit(a.value);!1!==r&&(a.dimension=r)}catch{}for(let e=0;e({postcssPlugin:"postcss-progressive-custom-properties",prepare(){const e=new WeakMap;return{OnceExit:(a,{postcss:r})=>{a.walkDecls((a=>{if(!a.parent)return;const p=e.get(a.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{support:void 0},lastConditionalRule:void 0};if(e.set(a.parent,p),a.variable){if(!p.propNames.has(a.prop))return void p.propNames.add(a.prop)}else{const e=a.prop.toLowerCase();if(!p.propNames.has(e))return void p.propNames.add(e)}if(!a.variable&&!t.test(a.value))return;if(i.test(a.value))return;if(o.test(a.value))return;const s=!a.variable,l=conditionsFromValue(a.value,s).support.join(" and ");if(!l)return;if(p.lastConditionParams.support!==l&&(p.lastConditionalRule=void 0),p.lastConditionalRule)return p.lastConditionalRule.append(a.clone()),void a.remove();const y=[];if(l&&y.push(r.atRule({name:"supports",params:l,source:a.parent.source,raws:{before:"\n\n",after:"\n"}})),!y.length)return;for(let e=0;e{const r=e.get(a);r&&0!==r.conditionalRules.length&&r.conditionalRules.reverse().forEach((e=>{a.after(e)}))}))}}}});creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.d.ts b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.d.ts index 5b5a74dd..240fc585 100644 --- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.d.ts +++ b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.d.ts @@ -1,3 +1,6 @@ -import { type PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; + declare const creator: PluginCreator; export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs index 19ceb72e..4c343809 100644 --- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs +++ b/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-value-parser";const a=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function doublePositionGradients(e){const r=[],p=e.value.toLowerCase();if("function"===e.type&&("conic-gradient"===p||"linear-gradient"===p||"radial-gradient"===p||"repeating-conic-gradient"===p||"repeating-linear-gradient"===p||"repeating-radial-gradient"===p)){let p=0,t=!1,i=!1;e:for(let o=0;oa.includes(e.sniff)));let s=!1;try{e(a).walk((a=>{"function"===a.type&&p.test(a.value)&&(s=!0);try{const r=e.unit(a.value);!1!==r&&(a.dimension=r)}catch{}for(let e=0;e({postcssPlugin:"postcss-progressive-custom-properties",prepare(){const e=new WeakMap;return{OnceExit:(a,{postcss:r})=>{a.walkDecls((a=>{if(!a.parent)return;const p=e.get(a.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{support:void 0},lastConditionalRule:void 0};if(e.set(a.parent,p),a.variable){if(!p.propNames.has(a.prop))return void p.propNames.add(a.prop)}else{const e=a.prop.toLowerCase();if(!p.propNames.has(e))return void p.propNames.add(e)}if(!a.variable&&!t.test(a.value))return;if(i.test(a.value))return;if(o.test(a.value))return;const s=!a.variable,l=conditionsFromValue(a.value,s).support.join(" and ");if(!l)return;if(p.lastConditionParams.support!==l&&(p.lastConditionalRule=void 0),p.lastConditionalRule)return p.lastConditionalRule.append(a.clone()),void a.remove();const y=[];if(l&&y.push(r.atRule({name:"supports",params:l,source:a.parent.source,raws:{before:"\n\n",after:"\n"}})),!y.length)return;for(let e=0;e{const r=e.get(a);r&&0!==r.conditionalRules.length&&r.conditionalRules.reverse().forEach((e=>{a.after(e)}))}))}}}});creator.postcss=!0;export{creator as default}; +import e from"postcss-value-parser";const a=["at","bottom","center","circle","closest-corner","closest-side","ellipse","farthest-corner","farthest-side","from","in","left","right","to","top"];function doublePositionGradients(e){const r=[],p=e.value.toLowerCase();if("function"===e.type&&("conic-gradient"===p||"linear-gradient"===p||"radial-gradient"===p||"repeating-conic-gradient"===p||"repeating-linear-gradient"===p||"repeating-radial-gradient"===p)){let p=0,t=!1,i=!1;e:for(let o=0;oa.includes(e.sniff)));let s=!1;try{e(a).walk((a=>{"function"===a.type&&p.test(a.value)&&(s=!0);try{const r=e.unit(a.value);!1!==r&&(a.dimension=r)}catch{}for(let e=0;e({postcssPlugin:"postcss-progressive-custom-properties",prepare(){const e=new WeakMap;return{OnceExit:(a,{postcss:r})=>{a.walkDecls((a=>{if(!a.parent)return;const p=e.get(a.parent)||{conditionalRules:[],propNames:new Set,lastConditionParams:{support:void 0},lastConditionalRule:void 0};if(e.set(a.parent,p),a.variable){if(!p.propNames.has(a.prop))return void p.propNames.add(a.prop)}else{const e=a.prop.toLowerCase();if(!p.propNames.has(e))return void p.propNames.add(e)}if(!a.variable&&!t.test(a.value))return;if(i.test(a.value))return;if(o.test(a.value))return;const s=!a.variable,l=conditionsFromValue(a.value,s).support.join(" and ");if(!l)return;if(p.lastConditionParams.support!==l&&(p.lastConditionalRule=void 0),p.lastConditionalRule)return p.lastConditionalRule.append(a.clone()),void a.remove();const y=[];if(l&&y.push(r.atRule({name:"supports",params:l,source:a.parent.source,raws:{before:"\n\n",after:"\n"}})),!y.length)return;for(let e=0;e{const r=e.get(a);r&&0!==r.conditionalRules.length&&r.conditionalRules.reverse().forEach((e=>{a.after(e)}))}))}}}});creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/match.d.ts b/node_modules/@csstools/postcss-progressive-custom-properties/dist/match.d.ts deleted file mode 100644 index 95a56e03..00000000 --- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/match.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -type MatcherNode = { - type: string; - value?: string; - nodes?: Array; - dimension?: { - unit?: string; - }; - isVariable?: boolean; -}; -export declare function matches(a: MatcherNode, b: MatcherNode): boolean; -export {}; diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/dist/matchers.d.ts b/node_modules/@csstools/postcss-progressive-custom-properties/dist/matchers.d.ts deleted file mode 100644 index 746c0edb..00000000 --- a/node_modules/@csstools/postcss-progressive-custom-properties/dist/matchers.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -export declare const matchers: ({ - supports: string; - property: string; - sniff: string; - matchers: { - type: string; - value: string; - nodes: ({ - type: string; - value: string; - isVariable?: undefined; - } | { - type: string; - value?: undefined; - isVariable?: undefined; - } | { - type: string; - isVariable: boolean; - value?: undefined; - })[]; - }[]; -} | { - supports: string; - property: string; - sniff: string; - matchers: { - type: string; - value: string; - dimension: { - unit: string; - }; - }[]; -})[]; diff --git a/node_modules/@csstools/postcss-progressive-custom-properties/package.json b/node_modules/@csstools/postcss-progressive-custom-properties/package.json index 6a30f654..e9dc0109 100644 --- a/node_modules/@csstools/postcss-progressive-custom-properties/package.json +++ b/node_modules/@csstools/postcss-progressive-custom-properties/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-progressive-custom-properties", "description": "Correctly declare progressive enhancements for CSS Custom Properties.", - "version": "3.0.2", + "version": "3.0.3", "author": "Jonathan Neal ", "license": "MIT-0", "funding": [ @@ -17,15 +17,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -40,17 +43,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "node ./generate/matchers.mjs && eslint --fix ./src/matchers.ts && rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "repository": { "type": "git", "url": "https://github.com/csstools/postcss-plugins.git", @@ -67,12 +59,5 @@ "utility", "variables", "vars" - ], - "csstools": { - "exportName": "postcssProgressiveCustomProperties", - "humanReadableName": "PostCSS Progressive Custom Properties" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md b/node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md index 70ab0992..908afed8 100644 --- a/node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md +++ b/node_modules/@csstools/postcss-relative-color-syntax/CHANGELOG.md @@ -1,5 +1,15 @@ # Changes to PostCSS Relative Color Syntax +### 2.0.8 + +_December 15, 2023_ + +- Skip transforms when a color value contains experimental syntax +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.3`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#303) (patch) +- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.5.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#150) (minor) + ### 2.0.7 _October 9, 2023_ @@ -13,67 +23,4 @@ _October 2, 2023_ - Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#133) (patch) -### 2.0.5 - -_September 24, 2023_ - -- Small performance improvements -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#221) (patch) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#232) (patch) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#132) (patch) - -### 2.0.4 - -_September 18, 2023_ - -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#301) (patch) - -### 2.0.3 - -_September 2, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#131) (patch) - -### 2.0.2 - -_August 28, 2023_ - -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#130) (minor) - -### 2.0.1 - -_July 24, 2023_ - -- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#220) (minor) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - -### 2.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/postcss-progressive-custom-properties`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-progressive-custom-properties/CHANGELOG.md#300) (major) -- Updated [`@csstools/css-color-parser`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser) to [`1.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-color-parser/CHANGELOG.md#122) (patch) - -### 1.0.2 - -_June 14, 2023_ - -- Fix value calculation for `hue` components in relative color syntax. - -### 1.0.1 - -_June 1, 2023_ - -- Updated `@csstools/postcss-progressive-custom-properties` to `2.3.0` (minor) - -### 1.0.0 - -_May 19, 2023_ - -- Initial version -- Updated `@csstools/postcss-progressive-custom-properties` to `2.2.0` (minor) -- Updated `@csstools/css-color-parser` to `1.2.0` (minor) - - +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-relative-color-syntax/dist/has-fallback-decl.d.ts b/node_modules/@csstools/postcss-relative-color-syntax/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d89..00000000 --- a/node_modules/@csstools/postcss-relative-color-syntax/dist/has-fallback-decl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function hasFallback(node: Declaration): boolean; diff --git a/node_modules/@csstools/postcss-relative-color-syntax/dist/has-supports-at-rule-ancestor.d.ts b/node_modules/@csstools/postcss-relative-color-syntax/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ec..00000000 --- a/node_modules/@csstools/postcss-relative-color-syntax/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs index 6d266ad5..c811e0be 100644 --- a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs +++ b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e({postcssPlugin:"postcss-relative-color-syntax",Declaration:o=>{const i=o.value;if(!a.test(i))return;if(!n.test(i))return;if(hasFallback(o))return;if(hasSupportsAtRuleAncestor(o))return;const u=s.tokenize({css:i}),c=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(e=>{if(t.isFunctionNode(e)&&l.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(!s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.serializeRGB(s)}})),p=t.stringify(c);if(p===i)return;let f=p;null!=e&&e.subFeatures.displayP3&&(f=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(e=>{if(t.isFunctionNode(e)&&l.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(!s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.colorDataFitsRGB_Gamut(s)?r.serializeRGB(s):r.serializeP3(s)}})))),o.cloneBefore({value:p}),null!=e&&e.subFeatures.displayP3&&f!==p&&o.cloneBefore({value:f}),null!=e&&e.preserve||o.remove()}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},s);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),s=require("@csstools/css-tokenizer"),r=require("@csstools/css-color-parser"),t=require("@csstools/css-parser-algorithms");function hasFallback(e){const s=e.parent;if(!s)return!1;const r=e.prop.toLowerCase(),t=s.index(e);for(let e=0;e({postcssPlugin:"postcss-relative-color-syntax",Declaration:o=>{const i=o.value;if(!a.test(i))return;if(!l.test(i))return;if(hasFallback(o))return;if(hasSupportsAtRuleAncestor(o))return;const u=s.tokenize({css:i}),c=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(e=>{if(t.isFunctionNode(e)&&n.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.Experimental))return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(!s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.serializeRGB(s)}})),p=t.stringify(c);if(p===i)return;let f=p;e?.subFeatures.displayP3&&(f=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(u),(e=>{if(t.isFunctionNode(e)&&n.test(e.getName())){const s=r.color(e);if(!s)return;if(s.syntaxFlags.has(r.SyntaxFlag.HasNoneKeywords))return;if(!s.syntaxFlags.has(r.SyntaxFlag.RelativeColorSyntax))return;return r.colorDataFitsRGB_Gamut(s)?r.serializeRGB(s):r.serializeP3(s)}})))),o.cloneBefore({value:p}),e?.subFeatures.displayP3&&f!==p&&o.cloneBefore({value:f}),e?.preserve||o.remove()}});basePlugin.postcss=!0;const postcssPlugin=s=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},s);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; diff --git a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.d.ts b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.d.ts index 15f89fd4..5593b607 100644 --- a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.d.ts +++ b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.d.ts @@ -1,6 +1,7 @@ import type { PluginCreator } from 'postcss'; + /** postcss-relative-color-syntax plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ @@ -11,5 +12,8 @@ export type pluginOptions = { displayP3?: boolean; }; }; + declare const postcssPlugin: PluginCreator; export default postcssPlugin; + +export { } diff --git a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs index 0c2dd8bd..6da2bc63 100644 --- a/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs +++ b/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs @@ -1 +1 @@ -import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as a,serializeP3 as l}from"@csstools/css-color-parser";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as u,isFunctionNode as c,stringify as i}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),t=e.index(s);for(let s=0;s({postcssPlugin:"postcss-relative-color-syntax",Declaration:p=>{const m=p.value;if(!f.test(m))return;if(!h.test(m))return;if(hasFallback(p))return;if(hasSupportsAtRuleAncestor(p))return;const g=e({css:m}),y=n(u(g),(s=>{if(c(s)&&b.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.HasNoneKeywords))return;if(!e.syntaxFlags.has(t.RelativeColorSyntax))return;return o(e)}})),v=i(y);if(v===m)return;let F=v;null!=s&&s.subFeatures.displayP3&&(F=i(n(u(g),(s=>{if(c(s)&&b.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.HasNoneKeywords))return;if(!e.syntaxFlags.has(t.RelativeColorSyntax))return;return a(e)?o(e):l(e)}})))),p.cloneBefore({value:v}),null!=s&&s.subFeatures.displayP3&&F!==v&&p.cloneBefore({value:F}),null!=s&&s.preserve||p.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as e}from"@csstools/css-tokenizer";import{color as r,SyntaxFlag as t,serializeRGB as o,colorDataFitsRGB_Gamut as a,serializeP3 as l}from"@csstools/css-color-parser";import{replaceComponentValues as n,parseCommaSeparatedListOfComponentValues as i,isFunctionNode as c,stringify as u}from"@csstools/css-parser-algorithms";function hasFallback(s){const e=s.parent;if(!e)return!1;const r=s.prop.toLowerCase(),t=e.index(s);for(let s=0;s({postcssPlugin:"postcss-relative-color-syntax",Declaration:p=>{const m=p.value;if(!f.test(m))return;if(!h.test(m))return;if(hasFallback(p))return;if(hasSupportsAtRuleAncestor(p))return;const g=e({css:m}),y=n(i(g),(s=>{if(c(s)&&b.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.Experimental))return;if(e.syntaxFlags.has(t.HasNoneKeywords))return;if(!e.syntaxFlags.has(t.RelativeColorSyntax))return;return o(e)}})),v=u(y);if(v===m)return;let F=v;s?.subFeatures.displayP3&&(F=u(n(i(g),(s=>{if(c(s)&&b.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.HasNoneKeywords))return;if(!e.syntaxFlags.has(t.RelativeColorSyntax))return;return a(e)?o(e):l(e)}})))),p.cloneBefore({value:v}),s?.subFeatures.displayP3&&F!==v&&p.cloneBefore({value:F}),s?.preserve||p.remove()}});basePlugin.postcss=!0;const postcssPlugin=e=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!1,subFeatures:{displayP3:!0}},e);return r.subFeatures=Object.assign({displayP3:!0},r.subFeatures),r.enableProgressiveCustomProperties&&(r.preserve||r.subFeatures.displayP3)?{postcssPlugin:"postcss-relative-color-syntax",plugins:[s(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; diff --git a/node_modules/@csstools/postcss-relative-color-syntax/package.json b/node_modules/@csstools/postcss-relative-color-syntax/package.json index 5667037c..e872dffe 100644 --- a/node_modules/@csstools/postcss-relative-color-syntax/package.json +++ b/node_modules/@csstools/postcss-relative-color-syntax/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-relative-color-syntax", "description": "Use the relative color syntax in CSS", - "version": "2.0.7", + "version": "2.0.8", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,25 +48,14 @@ "dist" ], "dependencies": { - "@csstools/css-color-parser": "^1.4.0", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1", - "@csstools/postcss-progressive-custom-properties": "^3.0.2" + "@csstools/css-color-parser": "^1.5.0", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2", + "@csstools/postcss-progressive-custom-properties": "^3.0.3" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-relative-color-syntax#readme", "repository": { "type": "git", @@ -75,14 +67,5 @@ "color", "postcss-plugin", "relative color syntax" - ], - "csstools": { - "cssdbId": "relative-color-syntax", - "exportName": "postcssRelativeColorSyntax", - "humanReadableName": "PostCSS Relative Color Syntax", - "specUrl": "https://www.w3.org/TR/css-color-5/#relative-colors" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/CHANGELOG.md b/node_modules/@csstools/postcss-scope-pseudo-class/CHANGELOG.md index 18bfb712..68c46b9b 100644 --- a/node_modules/@csstools/postcss-scope-pseudo-class/CHANGELOG.md +++ b/node_modules/@csstools/postcss-scope-pseudo-class/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Scope Pseudo Class +### 3.0.1 + +_December 15, 2023_ + +- Fix type definitions + ### 3.0.0 _July 3, 2023_ @@ -12,21 +18,4 @@ _February 9, 2023_ - Reduce the amount of duplicate fallback CSS. -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). -- Fix: Do not throw when a selector is invalid, show a warning instead. - -### 1.0.0 - -_November 4, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-scope-pseudo-class/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/README.md b/node_modules/@csstools/postcss-scope-pseudo-class/README.md index eb1ff5ba..9a816556 100644 --- a/node_modules/@csstools/postcss-scope-pseudo-class/README.md +++ b/node_modules/@csstools/postcss-scope-pseudo-class/README.md @@ -2,6 +2,10 @@ [npm version][npm-url] [CSS Standard Status][css-url] [Build Status][cli-url] [Discord][discord] +```bash +npm install @csstools/postcss-scope-pseudo-class --save-dev +``` + [PostCSS Scope Pseudo Class] lets you use the `:scope` Pseudo-class following the [Selectors 4 specification]. ```pcss diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.cjs b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.cjs index e4bc3bd9..ef6057c1 100644 --- a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.cjs +++ b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-selector-parser");const creator=s=>{const r=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-scope-pseudo-class",prepare(){const s=new WeakSet;return{Rule(t,{result:o}){if(!t.selector.toLowerCase().includes(":scope"))return;if(s.has(t))return;{let e=t.parent;for(;e;){if("atrule"===e.type&&"scope"===e.name.toLowerCase())return;e=e.parent}}let a=t.selector;try{const s=e().astSync(a);if(!s)return;s.walkPseudos((e=>{if(":has"===e.value.toLowerCase())return!1;":scope"===e.value.toLowerCase()&&(e.value=":root")})),a=s.toString()}catch(e){t.warn(o,`Failed to parse selector : "${t.selector}" with message: "${e.message}"`)}a!==t.selector&&(s.add(t),t.cloneBefore({selector:a}),r.preserve||t.remove())}}}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("postcss-selector-parser");const creator=s=>{const r=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-scope-pseudo-class",prepare(){const s=new WeakSet;return{Rule(t,{result:o}){if(!t.selector.toLowerCase().includes(":scope"))return;if(s.has(t))return;{let e=t.parent;for(;e;){if("atrule"===e.type&&"scope"===e.name.toLowerCase())return;e=e.parent}}let a=t.selector;try{const s=e().astSync(a);if(!s)return;s.walkPseudos((e=>{if(":has"===e.value.toLowerCase())return!1;":scope"===e.value.toLowerCase()&&(e.value=":root")})),a=s.toString()}catch(e){t.warn(o,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}a!==t.selector&&(s.add(t),t.cloneBefore({selector:a}),r.preserve||t.remove())}}}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.d.ts b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.d.ts index 77dc51e7..69020b0f 100644 --- a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.d.ts +++ b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-scope-pseudo-class plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs index 76a5d07b..b814412b 100644 --- a/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs +++ b/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-selector-parser";const creator=s=>{const r=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-scope-pseudo-class",prepare(){const s=new WeakSet;return{Rule(t,{result:o}){if(!t.selector.toLowerCase().includes(":scope"))return;if(s.has(t))return;{let e=t.parent;for(;e;){if("atrule"===e.type&&"scope"===e.name.toLowerCase())return;e=e.parent}}let a=t.selector;try{const s=e().astSync(a);if(!s)return;s.walkPseudos((e=>{if(":has"===e.value.toLowerCase())return!1;":scope"===e.value.toLowerCase()&&(e.value=":root")})),a=s.toString()}catch(e){t.warn(o,`Failed to parse selector : "${t.selector}" with message: "${e.message}"`)}a!==t.selector&&(s.add(t),t.cloneBefore({selector:a}),r.preserve||t.remove())}}}}};creator.postcss=!0;export{creator as default}; +import e from"postcss-selector-parser";const creator=s=>{const r=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-scope-pseudo-class",prepare(){const s=new WeakSet;return{Rule(t,{result:o}){if(!t.selector.toLowerCase().includes(":scope"))return;if(s.has(t))return;{let e=t.parent;for(;e;){if("atrule"===e.type&&"scope"===e.name.toLowerCase())return;e=e.parent}}let a=t.selector;try{const s=e().astSync(a);if(!s)return;s.walkPseudos((e=>{if(":has"===e.value.toLowerCase())return!1;":scope"===e.value.toLowerCase()&&(e.value=":root")})),a=s.toString()}catch(e){t.warn(o,`Failed to parse selector : "${t.selector}" with message: "${e instanceof Error?e.message:e}"`)}a!==t.selector&&(s.add(t),t.cloneBefore({selector:a}),r.preserve||t.remove())}}}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-scope-pseudo-class/package.json b/node_modules/@csstools/postcss-scope-pseudo-class/package.json index 2e67a480..a5cd3572 100644 --- a/node_modules/@csstools/postcss-scope-pseudo-class/package.json +++ b/node_modules/@csstools/postcss-scope-pseudo-class/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-scope-pseudo-class", "description": "The Reference Element Pseudo-class: :scope", - "version": "3.0.0", + "version": "3.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -50,17 +53,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-scope-pseudo-class#readme", "repository": { "type": "git", @@ -73,14 +65,5 @@ "pseudo", "scope", "selector" - ], - "csstools": { - "cssdbId": "scope-pseudo-class", - "exportName": "postcssScopePseudoClass", - "humanReadableName": "PostCSS Scope Pseudo Class", - "specUrl": "https://www.w3.org/TR/selectors-4/#the-scope-pseudo" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md b/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md index 5f310e1a..5dc30d6b 100644 --- a/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md +++ b/node_modules/@csstools/postcss-stepped-value-functions/CHANGELOG.md @@ -1,5 +1,14 @@ # Changes to PostCSS Stepped Value Functions +### 3.0.3 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch) + ### 3.0.2 _September 24, 2023_ @@ -17,50 +26,4 @@ _July 24, 2023_ - Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#113) (patch) -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#112) (patch) - -### 2.1.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-calc` to `1.1.1` (patch) - -### 2.1.0 - -_February 21, 2023_ - -- Removed: warnings on `var()` or otherwise unconvertible values (doesn't affect the output, non-breaking) -- Added: `@csstools/css-calc` -- Added: unit conversions (`mod(735ms, 0.1s)`) - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.1 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 1.0.0 - -_May 2, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/calc.d.ts b/node_modules/@csstools/postcss-stepped-value-functions/dist/calc.d.ts deleted file mode 100644 index 5a1ee11e..00000000 --- a/node_modules/@csstools/postcss-stepped-value-functions/dist/calc.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function calc(css: string): string; diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/checks.d.ts b/node_modules/@csstools/postcss-stepped-value-functions/dist/checks.d.ts deleted file mode 100644 index 6623beb7..00000000 --- a/node_modules/@csstools/postcss-stepped-value-functions/dist/checks.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const FUNCTION_NAME_REGEXP: RegExp; -export declare const FUNCTION_CALL_REGEXP: RegExp; diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.cjs b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.cjs index 0ccad206..396dbe2c 100644 --- a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.cjs +++ b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/css-calc"),s=require("@csstools/css-parser-algorithms"),o=require("@csstools/css-tokenizer");const n=["mod","rem","round"],t=new RegExp(`^(${n.join("|")})$`,"i"),r=new RegExp(`(${n.join("|")})\\(`,"i");function calc(n){const r=o.tokenize({css:n});return r.some((e=>e[0]===o.TokenType.Function&&t.test(e[4].value)))?s.stringify(e.calcFromComponentValues(s.parseCommaSeparatedListOfComponentValues(r),{precision:5,toCanonicalUnits:!0})):n}const creator=e=>{const s=Object.assign({preserve:!1,onInvalid:""},e);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(e){if(!r.test(e.value))return;const o=calc(e.value);o!==e.value&&(e.cloneBefore({value:o}),s.preserve||e.remove())}}};creator.postcss=!0,module.exports=creator; +"use strict";var e=require("@csstools/css-calc");const s=/(?{const t=Object.assign({preserve:!1},o);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(o){if(!s.test(o.value))return;const c=e.calc(o.value,{precision:5,toCanonicalUnits:!0});c!==o.value&&(o.cloneBefore({value:c}),t.preserve||o.remove())}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.d.ts b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.d.ts index c7772f76..f5f73bbf 100644 --- a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.d.ts +++ b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-stepped-value-functions plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs index 2e8dbdf0..ac5168e5 100644 --- a/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs +++ b/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs @@ -1 +1 @@ -import{calcFromComponentValues as s}from"@csstools/css-calc";import{stringify as o,parseCommaSeparatedListOfComponentValues as e}from"@csstools/css-parser-algorithms";import{tokenize as t,TokenType as n}from"@csstools/css-tokenizer";const c=["mod","rem","round"],r=new RegExp(`^(${c.join("|")})$`,"i"),i=new RegExp(`(${c.join("|")})\\(`,"i");function calc(c){const i=t({css:c});return i.some((s=>s[0]===n.Function&&r.test(s[4].value)))?o(s(e(i),{precision:5,toCanonicalUnits:!0})):c}const creator=s=>{const o=Object.assign({preserve:!1,onInvalid:""},s);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(s){if(!i.test(s.value))return;const e=calc(s.value);e!==s.value&&(s.cloneBefore({value:e}),o.preserve||s.remove())}}};creator.postcss=!0;export{creator as default}; +import{calc as e}from"@csstools/css-calc";const s=/(?{const t=Object.assign({preserve:!1},o);return{postcssPlugin:"postcss-stepped-value-functions",Declaration(o){if(!s.test(o.value))return;const r=e(o.value,{precision:5,toCanonicalUnits:!0});r!==o.value&&(o.cloneBefore({value:r}),t.preserve||o.remove())}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-stepped-value-functions/package.json b/node_modules/@csstools/postcss-stepped-value-functions/package.json index eab24b20..b0db70c0 100644 --- a/node_modules/@csstools/postcss-stepped-value-functions/package.json +++ b/node_modules/@csstools/postcss-stepped-value-functions/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-stepped-value-functions", "description": "Use round, rem and mod functions in CSS", - "version": "3.0.2", + "version": "3.0.3", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,24 +48,13 @@ "dist" ], "dependencies": { - "@csstools/css-calc": "^1.1.4", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1" + "@csstools/css-calc": "^1.1.5", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-stepped-value-functions#readme", "repository": { "type": "git", @@ -77,14 +69,5 @@ "remainder", "round", "stepped" - ], - "csstools": { - "cssdbId": "stepped-value-functions", - "exportName": "postcssSteppedValueFunctions", - "humanReadableName": "PostCSS Stepped Value Functions", - "specUrl": "https://www.w3.org/TR/css-values-4/#round-func" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md b/node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md index 00ec3a12..66698668 100644 --- a/node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md +++ b/node_modules/@csstools/postcss-text-decoration-shorthand/CHANGELOG.md @@ -1,5 +1,12 @@ # Changes to PostCSS Text Decoration Shorthand +### 3.0.4 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`4.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#400) (major) + ### 3.0.3 _September 18, 2023_ @@ -12,71 +19,4 @@ _September 2, 2023_ - Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`3.0.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#302) (patch) -### 3.0.1 - -_August 28, 2023_ - -- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`3.0.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#301) (patch) - -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/color-helpers`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers) to [`3.0.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/color-helpers/CHANGELOG.md#300) (major) - -### 2.2.4 - -_May 19, 2023_ - -- Updated `@csstools/color-helpers` to `2.1.0` (minor) - - -### 2.2.3 - -_April 10, 2023_ - -- Updated: `@csstools/color-helpers` to `v2.0.0` - -### 2.2.2 - -_March 25, 2023_ - -- Add `color-mix` as a known color function. - -### 2.2.1 - -_February 13, 2023_ - -- Updated: `preserve` option defaults to `true` - -### 2.2.0 - -_February 2, 2023_ - -- Add: `@csstools/color-helpers` dependency for the named colors list. - -### 2.1.0 - -_January 28, 2023_ - -- Add: support for multiple line values (`text-decoration: overline underline;`) - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). -- Add: `-webkit-text-decoration` shorthand for single value `text-decoration: underline;`. [autoprefixer 1473](https://github.com/postcss/autoprefixer/issues/1473#issuecomment-1243370592) - -### 1.0.0 - -_August 15, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-text-decoration-shorthand/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.d.ts b/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.d.ts index c9808969..d0d73801 100644 --- a/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.d.ts +++ b/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-text-decoration-shorthand plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-text-decoration-shorthand/package.json b/node_modules/@csstools/postcss-text-decoration-shorthand/package.json index 6d1d6006..c8dc9de4 100644 --- a/node_modules/@csstools/postcss-text-decoration-shorthand/package.json +++ b/node_modules/@csstools/postcss-text-decoration-shorthand/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-text-decoration-shorthand", "description": "Use text-decoration in it's shorthand form in CSS", - "version": "3.0.3", + "version": "3.0.4", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,24 +48,12 @@ "dist" ], "dependencies": { - "@csstools/color-helpers": "^3.0.2", + "@csstools/color-helpers": "^4.0.0", "postcss-value-parser": "^4.2.0" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*", - "autoprefixer": "^10.4.15" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-text-decoration-shorthand#readme", "repository": { "type": "git", @@ -76,14 +67,5 @@ "shorthand", "text-decoration", "text-decoration-thickness" - ], - "csstools": { - "cssdbId": "text-decoration-shorthand", - "exportName": "postcssTextDecorationShorthand", - "humanReadableName": "PostCSS Text Decoration Shorthand", - "specUrl": "https://drafts.csswg.org/css-text-decor-4/#text-decoration-property" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md b/node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md index 9ec73779..b337b22f 100644 --- a/node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md +++ b/node_modules/@csstools/postcss-trigonometric-functions/CHANGELOG.md @@ -1,5 +1,14 @@ # Changes to PostCSS Trigonometric Functions +### 3.0.3 + +_December 15, 2023_ + +- Fix type definitions +- Updated [`@csstools/css-tokenizer`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer) to [`2.2.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-tokenizer/CHANGELOG.md#222) (patch) +- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.4.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#240) (minor) +- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.5`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#115) (patch) + ### 3.0.2 _September 24, 2023_ @@ -17,55 +26,4 @@ _July 24, 2023_ - Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.1`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#231) (patch) - Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.3`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#113) (patch) -### 3.0.0 - -_July 3, 2023_ - -- Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/)) -- Updated [`@csstools/css-parser-algorithms`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms) to [`2.3.0`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-parser-algorithms/CHANGELOG.md#230) (minor) -- Updated [`@csstools/css-calc`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc) to [`1.1.2`](https://github.com/csstools/postcss-plugins/tree/main/packages/css-calc/CHANGELOG.md#112) (patch) - -### 2.1.1 - -_April 10, 2023_ - -- Updated `@csstools/css-tokenizer` to `2.1.1` (patch) -- Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch) -- Updated `@csstools/css-calc` to `1.1.1` (patch) - -### 2.1.0 - -_March 21, 2023_ - -- Added: `@csstools/css-calc` -- Added: unit conversions (`sin(30deg + (.125turn / 3))`) - -### 2.0.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.2 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 1.0.1 - -_May 31, 2022_ - -- Ensure that the plugin works in node 14 - -### 1.0.0 - -_May 20, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-trigonometric-functions/dist/calc.d.ts b/node_modules/@csstools/postcss-trigonometric-functions/dist/calc.d.ts deleted file mode 100644 index 5a1ee11e..00000000 --- a/node_modules/@csstools/postcss-trigonometric-functions/dist/calc.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function calc(css: string): string; diff --git a/node_modules/@csstools/postcss-trigonometric-functions/dist/checks.d.ts b/node_modules/@csstools/postcss-trigonometric-functions/dist/checks.d.ts deleted file mode 100644 index 6623beb7..00000000 --- a/node_modules/@csstools/postcss-trigonometric-functions/dist/checks.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const FUNCTION_NAME_REGEXP: RegExp; -export declare const FUNCTION_CALL_REGEXP: RegExp; diff --git a/node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs b/node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs index 6fe36838..1ba42783 100644 --- a/node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs +++ b/node_modules/@csstools/postcss-trigonometric-functions/dist/index.cjs @@ -1 +1 @@ -"use strict";var s=require("@csstools/css-calc"),e=require("@csstools/css-parser-algorithms"),o=require("@csstools/css-tokenizer");const t=["asin","acos","atan","atan2","sin","cos","tan"],n=new RegExp(`^(${t.join("|")})$`,"i"),c=new RegExp(`(${t.join("|")})\\(`,"i");function calc(t){const c=o.tokenize({css:t});return c.some((s=>s[0]===o.TokenType.Function&&n.test(s[4].value)))?e.stringify(s.calcFromComponentValues(e.parseCommaSeparatedListOfComponentValues(c),{precision:5,toCanonicalUnits:!0})):t}const creator=s=>{const e=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-trigonometric-functions",Declaration(s){if(!c.test(s.value))return;const o=calc(s.value);o!==s.value&&(s.cloneBefore({value:o}),e.preserve||s.remove())}}};creator.postcss=!0,module.exports=creator; +"use strict";var s=require("@csstools/css-calc");const e=/(?{const c=Object.assign({preserve:!1},t);return{postcssPlugin:"postcss-trigonometric-functions",Declaration(t){if(!e.test(t.value))return;const o=s.calc(t.value,{precision:5,toCanonicalUnits:!0});o!==t.value&&(t.cloneBefore({value:o}),c.preserve||t.remove())}}};creator.postcss=!0,module.exports=creator; diff --git a/node_modules/@csstools/postcss-trigonometric-functions/dist/index.d.ts b/node_modules/@csstools/postcss-trigonometric-functions/dist/index.d.ts index 40ac49ea..21e16153 100644 --- a/node_modules/@csstools/postcss-trigonometric-functions/dist/index.d.ts +++ b/node_modules/@csstools/postcss-trigonometric-functions/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-trigonometric-functions plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-trigonometric-functions/dist/index.mjs b/node_modules/@csstools/postcss-trigonometric-functions/dist/index.mjs index 8fed33de..686ebd56 100644 --- a/node_modules/@csstools/postcss-trigonometric-functions/dist/index.mjs +++ b/node_modules/@csstools/postcss-trigonometric-functions/dist/index.mjs @@ -1 +1 @@ -import{calcFromComponentValues as s}from"@csstools/css-calc";import{stringify as o,parseCommaSeparatedListOfComponentValues as t}from"@csstools/css-parser-algorithms";import{tokenize as e,TokenType as n}from"@csstools/css-tokenizer";const c=["asin","acos","atan","atan2","sin","cos","tan"],r=new RegExp(`^(${c.join("|")})$`,"i"),a=new RegExp(`(${c.join("|")})\\(`,"i");function calc(c){const a=e({css:c});return a.some((s=>s[0]===n.Function&&r.test(s[4].value)))?o(s(t(a),{precision:5,toCanonicalUnits:!0})):c}const creator=s=>{const o=Object.assign({preserve:!1},s);return{postcssPlugin:"postcss-trigonometric-functions",Declaration(s){if(!a.test(s.value))return;const t=calc(s.value);t!==s.value&&(s.cloneBefore({value:t}),o.preserve||s.remove())}}};creator.postcss=!0;export{creator as default}; +import{calc as s}from"@csstools/css-calc";const e=/(?{const o=Object.assign({preserve:!1},t);return{postcssPlugin:"postcss-trigonometric-functions",Declaration(t){if(!e.test(t.value))return;const n=s(t.value,{precision:5,toCanonicalUnits:!0});n!==t.value&&(t.cloneBefore({value:n}),o.preserve||t.remove())}}};creator.postcss=!0;export{creator as default}; diff --git a/node_modules/@csstools/postcss-trigonometric-functions/package.json b/node_modules/@csstools/postcss-trigonometric-functions/package.json index 95a0b08f..24a059dd 100644 --- a/node_modules/@csstools/postcss-trigonometric-functions/package.json +++ b/node_modules/@csstools/postcss-trigonometric-functions/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-trigonometric-functions", "description": "Use sin(), cos(), tan(), acos(), atan(), and atan2() to compute trigonometric relationships", - "version": "3.0.2", + "version": "3.0.3", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -45,24 +48,13 @@ "dist" ], "dependencies": { - "@csstools/css-calc": "^1.1.4", - "@csstools/css-parser-algorithms": "^2.3.2", - "@csstools/css-tokenizer": "^2.2.1" + "@csstools/css-calc": "^1.1.5", + "@csstools/css-parser-algorithms": "^2.4.0", + "@csstools/css-tokenizer": "^2.2.2" }, "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions#readme", "repository": { "type": "git", @@ -81,14 +73,5 @@ "sin", "tan", "trigonometric" - ], - "csstools": { - "cssdbId": "trigonometric-functions", - "exportName": "postcssTrigonometricFunctions", - "humanReadableName": "PostCSS Trigonometric Functions", - "specUrl": "https://www.w3.org/TR/css-values-4/#trig-funcs" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/postcss-unset-value/CHANGELOG.md b/node_modules/@csstools/postcss-unset-value/CHANGELOG.md index 438f5c2d..d231e2ad 100644 --- a/node_modules/@csstools/postcss-unset-value/CHANGELOG.md +++ b/node_modules/@csstools/postcss-unset-value/CHANGELOG.md @@ -1,5 +1,11 @@ # Changes to PostCSS Unset Value +### 3.0.1 + +_December 15, 2023_ + +- Fix type definitions + ### 3.0.0 _July 3, 2023_ @@ -12,26 +18,4 @@ _January 28, 2023_ - Improve `types` declaration in `package.json` -### 2.0.0 - -_January 24, 2023_ - -- Updated: Support for Node v14+ (major). - -### 1.0.2 - -_July 8, 2022_ - -- Fixed: Case insensitive property and keyword matching. - -### 1.0.1 - -_May 11, 2022_ - -- No longer converts `all: unset;` to `all: initial;`. `all: unset` is now ignored. - -### 1.0.0 - -_February 21, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-unset-value/CHANGELOG.md) diff --git a/node_modules/@csstools/postcss-unset-value/dist/index.d.ts b/node_modules/@csstools/postcss-unset-value/dist/index.d.ts index 9bf13c0d..c211bb82 100644 --- a/node_modules/@csstools/postcss-unset-value/dist/index.d.ts +++ b/node_modules/@csstools/postcss-unset-value/dist/index.d.ts @@ -1,8 +1,12 @@ import type { PluginCreator } from 'postcss'; + +declare const creator: PluginCreator; +export default creator; + /** postcss-unset-value plugin options */ -export type pluginOptions = { +export declare type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; -declare const creator: PluginCreator; -export default creator; + +export { } diff --git a/node_modules/@csstools/postcss-unset-value/dist/property-def.d.ts b/node_modules/@csstools/postcss-unset-value/dist/property-def.d.ts deleted file mode 100644 index 46c84073..00000000 --- a/node_modules/@csstools/postcss-unset-value/dist/property-def.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const inherited: Set; -export declare const nonInherited: Set; diff --git a/node_modules/@csstools/postcss-unset-value/package.json b/node_modules/@csstools/postcss-unset-value/package.json index 6ecdd94e..3bb75c46 100644 --- a/node_modules/@csstools/postcss-unset-value/package.json +++ b/node_modules/@csstools/postcss-unset-value/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/postcss-unset-value", "description": "Use the unset keyword in CSS.", - "version": "3.0.0", + "version": "3.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -47,17 +50,6 @@ "peerDependencies": { "postcss": "^8.4" }, - "devDependencies": { - "@csstools/postcss-tape": "*" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "docs": "node ../../.github/bin/generate-docs/install.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs", - "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-unset-value#readme", "repository": { "type": "git", @@ -70,12 +62,5 @@ "initial", "postcss-plugin", "unset" - ], - "csstools": { - "exportName": "postcssUnsetValue", - "humanReadableName": "PostCSS Unset Value" - }, - "volta": { - "extends": "../../package.json" - } + ] } diff --git a/node_modules/@csstools/selector-specificity/CHANGELOG.md b/node_modules/@csstools/selector-specificity/CHANGELOG.md index 770a6b9f..8cf61c3e 100644 --- a/node_modules/@csstools/selector-specificity/CHANGELOG.md +++ b/node_modules/@csstools/selector-specificity/CHANGELOG.md @@ -1,5 +1,13 @@ # Changes to Selector Specificity +### 3.0.1 + +_December 15, 2023_ + +- Add support for: + - `:active-view-transition(*)` + - `:active-view-transition(name)` + ### 3.0.0 _July 3, 2023_ @@ -18,46 +26,4 @@ _March 21, 2023_ - `::view-transition-old(*)` and `::view-transition-old(name)` - `::view-transition-new(*)` and `::view-transition-new(name)` -### 2.1.1 - -_January 28, 2023_ - -- Improve `types` declaration in `package.json` - -### 2.1.0 - -_January 19, 2023_ - -- Add support for `::slotted` -- Add support for `:host` -- Add support for `:host-context` - -### 2.0.2 - -_July 8, 2022_ - -- Fix case insensitive matching. - -### 2.0.1 - -_June 10, 2022_ - -- Fixed: Exception on `:nth-child` without arguments. [#439](https://github.com/csstools/postcss-plugins/issues/439) - -### 2.0.0 - -_June 4, 2022_ - -- Breaking: use only named exports instead of `default` -- Added: `compare(a, b)` function to compare selectors by specificity - -```diff -- `import selectorSpecificity from '@csstools/selector-specificity';` -+ `import { selectorSpecificity } from '@csstools/selector-specificity';` -``` - -### 1.0.0 - -_April 26, 2022_ - -- Initial version +[Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity/CHANGELOG.md) diff --git a/node_modules/@csstools/selector-specificity/dist/index.cjs b/node_modules/@csstools/selector-specificity/dist/index.cjs index 4633d0fc..7139faff 100644 --- a/node_modules/@csstools/selector-specificity/dist/index.cjs +++ b/node_modules/@csstools/selector-specificity/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("postcss-selector-parser");const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,c=0,i=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)i+=1;else if("class"===s.type)c+=1;else if("attribute"===s.type)c+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(i+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":if(s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0]))return{a:0,b:0,c:0};i+=1;break;default:i+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(c+=1,s.nodes&&s.nodes.length>0){const n=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(n>-1){const o=[e.selector({nodes:s.nodes[0].nodes.slice(n+1),value:""})];s.nodes.length>1&&o.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(o);t+=a.a,c+=a.b,i+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));break;case":host":case":host-context":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;default:c+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));return{a:t,b:c,c:i}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.as.b?s=t:t.bs.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}exports.compare=function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a},exports.selectorSpecificity=selectorSpecificity; +"use strict";var e=require("postcss-selector-parser");const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,c=0,n=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)n+=1;else if("class"===s.type)c+=1;else if("attribute"===s.type)c+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(n+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,n+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":return s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0])?{a:0,b:0,c:0}:{a:0,b:0,c:1};default:n+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,n+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(c+=1,s.nodes&&s.nodes.length>0){const i=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(i>-1){const o=[e.selector({nodes:s.nodes[0].nodes.slice(i+1),value:""})];s.nodes.length>1&&o.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(o);t+=a.a,c+=a.b,n+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,n+=s.c}));break;case":host":case":host-context":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,n+=e.c}break;case":active-view-transition":return s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0])?{a:0,b:1,c:0}:{a:0,b:2,c:0};default:c+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,n+=s.c}));return{a:t,b:c,c:n}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.as.b?s=t:t.bs.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}exports.compare=function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a},exports.selectorSpecificity=selectorSpecificity; diff --git a/node_modules/@csstools/selector-specificity/dist/index.d.ts b/node_modules/@csstools/selector-specificity/dist/index.d.ts index f92ce6d8..90606de1 100644 --- a/node_modules/@csstools/selector-specificity/dist/index.d.ts +++ b/node_modules/@csstools/selector-specificity/dist/index.d.ts @@ -1,8 +1,13 @@ import type { Node } from 'postcss-selector-parser'; -export type Specificity = { + +export declare function compare(s1: Specificity, s2: Specificity): number; + +export declare function selectorSpecificity(node: Node): Specificity; + +export declare type Specificity = { a: number; b: number; c: number; }; -export declare function compare(s1: Specificity, s2: Specificity): number; -export declare function selectorSpecificity(node: Node): Specificity; + +export { } diff --git a/node_modules/@csstools/selector-specificity/dist/index.mjs b/node_modules/@csstools/selector-specificity/dist/index.mjs index 8ac79c74..83be7cda 100644 --- a/node_modules/@csstools/selector-specificity/dist/index.mjs +++ b/node_modules/@csstools/selector-specificity/dist/index.mjs @@ -1 +1 @@ -import e from"postcss-selector-parser";const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,c=0,i=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)i+=1;else if("class"===s.type)c+=1;else if("attribute"===s.type)c+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(i+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":if(s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0]))return{a:0,b:0,c:0};i+=1;break;default:i+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(c+=1,s.nodes&&s.nodes.length>0){const n=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(n>-1){const o=[e.selector({nodes:s.nodes[0].nodes.slice(n+1),value:""})];s.nodes.length>1&&o.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(o);t+=a.a,c+=a.b,i+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));break;case":host":case":host-context":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,c+=e.b,i+=e.c}break;default:c+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,c+=s.b,i+=s.c}));return{a:t,b:c,c:i}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.as.b?s=t:t.bs.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}export{compare,selectorSpecificity}; +import e from"postcss-selector-parser";const s=/[A-Z]/g;function toLowerCaseAZ(e){return e.replace(s,(e=>String.fromCharCode(e.charCodeAt(0)+32)))}function compare(e,s){return e.a===s.a?e.b===s.b?e.c-s.c:e.b-s.b:e.a-s.a}function selectorSpecificity(s){if(!s)return{a:0,b:0,c:0};let t=0,n=0,c=0;if("universal"==s.type)return{a:0,b:0,c:0};if("id"===s.type)t+=1;else if("tag"===s.type)c+=1;else if("class"===s.type)n+=1;else if("attribute"===s.type)n+=1;else if(isPseudoElement(s))switch(toLowerCaseAZ(s.value)){case"::slotted":if(c+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,n+=e.b,c+=e.c}break;case"::view-transition-group":case"::view-transition-image-pair":case"::view-transition-old":case"::view-transition-new":return s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0])?{a:0,b:0,c:0}:{a:0,b:0,c:1};default:c+=1}else if(e.isPseudoClass(s))switch(toLowerCaseAZ(s.value)){case":-moz-any":case":-webkit-any":case":any":case":has":case":is":case":matches":case":not":if(s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,n+=e.b,c+=e.c}break;case":where":break;case":nth-child":case":nth-last-child":if(n+=1,s.nodes&&s.nodes.length>0){const o=s.nodes[0].nodes.findIndex((e=>"tag"===e.type&&"of"===toLowerCaseAZ(e.value)));if(o>-1){const i=[e.selector({nodes:s.nodes[0].nodes.slice(o+1),value:""})];s.nodes.length>1&&i.push(...s.nodes.slice(1));const a=specificityOfMostSpecificListItem(i);t+=a.a,n+=a.b,c+=a.c}}break;case":local":case":global":s.nodes&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,n+=s.b,c+=s.c}));break;case":host":case":host-context":if(n+=1,s.nodes&&s.nodes.length>0){const e=specificityOfMostSpecificListItem(s.nodes);t+=e.a,n+=e.b,c+=e.c}break;case":active-view-transition":return s.nodes&&1===s.nodes.length&&"selector"===s.nodes[0].type&&selectorNodeContainsOnlyUniversal(s.nodes[0])?{a:0,b:1,c:0}:{a:0,b:2,c:0};default:n+=1}else e.isContainer(s)&&s.nodes.length>0&&s.nodes.forEach((e=>{const s=selectorSpecificity(e);t+=s.a,n+=s.b,c+=s.c}));return{a:t,b:n,c:c}}function specificityOfMostSpecificListItem(e){let s={a:0,b:0,c:0};return e.forEach((e=>{const t=selectorSpecificity(e);t.a>s.a?s=t:t.as.b?s=t:t.bs.c&&(s=t))})),s}function isPseudoElement(s){return e.isPseudoElement(s)}function selectorNodeContainsOnlyUniversal(e){if(!e)return!1;if(!e.nodes)return!1;const s=e.nodes.filter((e=>"comment"!==e.type));return 1===s.length&&"universal"===s[0].type}export{compare,selectorSpecificity}; diff --git a/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts b/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e..00000000 --- a/node_modules/@csstools/selector-specificity/dist/to-lower-case-a-z.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toLowerCaseAZ(x: string): string; diff --git a/node_modules/@csstools/selector-specificity/package.json b/node_modules/@csstools/selector-specificity/package.json index 36e08389..4d5fcfd7 100644 --- a/node_modules/@csstools/selector-specificity/package.json +++ b/node_modules/@csstools/selector-specificity/package.json @@ -1,7 +1,7 @@ { "name": "@csstools/selector-specificity", "description": "Determine selector specificity with postcss-selector-parser", - "version": "3.0.0", + "version": "3.0.1", "contributors": [ { "name": "Antonio Laguna", @@ -27,15 +27,18 @@ "engines": { "node": "^14 || ^16 || >=18" }, + "type": "module", "main": "dist/index.cjs", "module": "dist/index.mjs", - "types": "dist/index.d.ts", "exports": { ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.mjs", - "require": "./dist/index.cjs", - "default": "./dist/index.mjs" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.mjs" + }, + "require": { + "default": "./dist/index.cjs" + } } }, "files": [ @@ -47,16 +50,6 @@ "peerDependencies": { "postcss-selector-parser": "^6.0.13" }, - "devDependencies": { - "postcss-selector-parser": "^6.0.13" - }, - "scripts": { - "build": "rollup -c ../../rollup/default.mjs", - "lint": "node ../../.github/bin/format-package-json.mjs", - "prepublishOnly": "npm run build && npm run test", - "stryker": "stryker run --logLevel error", - "test": "node ./test/index.mjs && node ./test/_import.mjs && node ./test/_require.cjs" - }, "homepage": "https://github.com/csstools/postcss-plugins/tree/main/packages/selector-specificity#readme", "repository": { "type": "git", @@ -68,8 +61,5 @@ "css", "postcss-selector-parser", "specificity" - ], - "volta": { - "extends": "../../package.json" - } + ] } -- cgit v1.2.3