summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/postcss-gamut-mapping
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@csstools/postcss-gamut-mapping')
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/CHANGELOG.md9
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/dist/has-conditional-ancestor.d.ts2
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/dist/has-override-decl.d.ts5
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/dist/index.d.ts8
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-gamut-mapping/package.json43
7 files changed, 30 insertions, 41 deletions
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<r.length;e++){if(e===n)continue;const o=r[e];if("decl"===o.type&&o.prop.toLowerCase()===a){if(!(e<n)){t=!0;break}s=!0,e=n}}return{hasOverride:t,hasFallback:s}}const s=/\b(?:color|lab|lch|oklab|oklch)\(/i,r=/^(?:color|lab|lch|oklab|oklch)$/i,creator=()=>({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<s.length;e++){if(e===r)continue;const n=s[e];if("decl"===n.type&&n.prop.toLowerCase()===o){if(!(e<r)){a=!0;break}t=!0,e=r}}return{hasOverride:a,hasFallback:t}}const s=/\b(?:color|lab|lch|oklab|oklch)\(/i,r=/^(?:color|lab|lch|oklab|oklch)$/i,creator=()=>({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<pluginOptions>;
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<n.length;e++){if(e===s)continue;const o=n[e];if("decl"===o.type&&o.prop.toLowerCase()===t){if(!(e<s)){a=!0;break}r=!0,e=s}}return{hasOverride:a,hasFallback:r}}const d=/\b(?:color|lab|lch|oklab|oklch)\(/i,u=/^(?:color|lab|lch|oklab|oklch)$/i,creator=()=>({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<r.length;e++){if(e===s)continue;const n=r[e];if("decl"===n.type&&n.prop.toLowerCase()===o){if(!(e<s)){t=!0;break}a=!0,e=s}}return{hasOverride:t,hasFallback:a}}const d=/\b(?:color|lab|lch|oklab|oklch)\(/i,u=/^(?:color|lab|lch|oklab|oklch)$/i,creator=()=>({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"
- }
+ ]
}