summaryrefslogtreecommitdiff
path: root/node_modules/@csstools/postcss-logical-viewport-units
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/@csstools/postcss-logical-viewport-units')
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/CHANGELOG.md43
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/has-feature.d.ts1
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/has-supports-at-rule-ancestor.d.ts2
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/index.cjs2
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/index.d.ts18
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs2
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/lib/types.d.ts18
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/dist/transform.d.ts4
-rw-r--r--node_modules/@csstools/postcss-logical-viewport-units/package.json39
9 files changed, 35 insertions, 94 deletions
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<pluginOptions>;
+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<pluginOptions>;
-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"
- }
+ ]
}