@csstools/postcss-trigonometric-functions 3.0.1 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,63 +1,29 @@
1
1
  # Changes to PostCSS Trigonometric Functions
2
2
 
3
- ### 3.0.1
4
-
5
- _July 24, 2023_
6
-
7
- - Use the latest utilities from `@csstools/css-tokenizer` to reduce the bundle size.
8
- - 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)
9
- - 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)
10
- - 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)
11
-
12
- ### 3.0.0
13
-
14
- _July 3, 2023_
15
-
16
- - Change license to `MIT-0` ([read more about this change in the blog post](https://preset-env.cssdb.org/blog/license-change/))
17
- - 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)
18
- - 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)
19
-
20
- ### 2.1.1
21
-
22
- _April 10, 2023_
23
-
24
- - Updated `@csstools/css-tokenizer` to `2.1.1` (patch)
25
- - Updated `@csstools/css-parser-algorithms` to `2.1.1` (patch)
26
- - Updated `@csstools/css-calc` to `1.1.1` (patch)
27
-
28
- ### 2.1.0
3
+ ### 3.0.3
29
4
 
30
- _March 21, 2023_
5
+ _December 15, 2023_
31
6
 
32
- - Added: `@csstools/css-calc`
33
- - Added: unit conversions (`sin(30deg + (.125turn / 3))`)
7
+ - Fix type definitions
8
+ - 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)
9
+ - 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)
10
+ - 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)
34
11
 
35
- ### 2.0.1
12
+ ### 3.0.2
36
13
 
37
- _January 28, 2023_
14
+ _September 24, 2023_
38
15
 
39
- - Improve `types` declaration in `package.json`
16
+ - 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)
17
+ - 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)
18
+ - 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)
40
19
 
41
- ### 2.0.0
42
-
43
- _January 24, 2023_
44
-
45
- - Updated: Support for Node v14+ (major).
46
-
47
- ### 1.0.2
48
-
49
- _July 8, 2022_
50
-
51
- - Fix case insensitive matching.
52
-
53
- ### 1.0.1
54
-
55
- _May 31, 2022_
56
-
57
- - Ensure that the plugin works in node 14
20
+ ### 3.0.1
58
21
 
59
- ### 1.0.0
22
+ _July 24, 2023_
60
23
 
61
- _May 20, 2022_
24
+ - Use the latest utilities from `@csstools/css-tokenizer` to reduce the bundle size.
25
+ - 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)
26
+ - 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)
27
+ - 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)
62
28
 
63
- - Initial version
29
+ [Full CHANGELOG](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions/CHANGELOG.md)
package/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  [<img alt="npm version" src="https://img.shields.io/npm/v/@csstools/postcss-trigonometric-functions.svg" height="20">][npm-url] [<img alt="CSS Standard Status" src="https://cssdb.org/images/badges/trigonometric-functions.svg" height="20">][css-url] [<img alt="Build Status" src="https://github.com/csstools/postcss-plugins/workflows/test/badge.svg" height="20">][cli-url] [<img alt="Discord" src="https://shields.io/badge/Discord-5865F2?logo=discord&logoColor=white">][discord]
4
4
 
5
+ ```bash
6
+ npm install @csstools/postcss-trigonometric-functions --save-dev
7
+ ```
8
+
5
9
  [PostCSS Trigonometric Functions] lets you use `sin`, `cos`, `tan`, `asin`, `acos`, `atan` and `atan2` to be able to compute trigonometric relationships following the [CSS Values 4] specification.
6
10
 
7
11
  ```pcss
package/dist/index.cjs CHANGED
@@ -1 +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;
1
+ "use strict";var s=require("@csstools/css-calc");const e=/(?<![-\w])(?:asin|acos|atan|atan2|sin|cos|tan)\(/i,creator=t=>{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;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,12 @@
1
1
  import type { PluginCreator } from 'postcss';
2
+
3
+ declare const creator: PluginCreator<pluginOptions>;
4
+ export default creator;
5
+
2
6
  /** postcss-trigonometric-functions plugin options */
3
- export type pluginOptions = {
7
+ export declare type pluginOptions = {
4
8
  /** Preserve the original notation. default: false */
5
9
  preserve?: boolean;
6
10
  };
7
- declare const creator: PluginCreator<pluginOptions>;
8
- export default creator;
11
+
12
+ export { }
package/dist/index.mjs CHANGED
@@ -1 +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};
1
+ import{calc as s}from"@csstools/css-calc";const e=/(?<![-\w])(?:asin|acos|atan|atan2|sin|cos|tan)\(/i,creator=t=>{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};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@csstools/postcss-trigonometric-functions",
3
3
  "description": "Use sin(), cos(), tan(), acos(), atan(), and atan2() to compute trigonometric relationships",
4
- "version": "3.0.1",
4
+ "version": "3.0.3",
5
5
  "contributors": [
6
6
  {
7
7
  "name": "Antonio Laguna",
@@ -27,15 +27,18 @@
27
27
  "engines": {
28
28
  "node": "^14 || ^16 || >=18"
29
29
  },
30
+ "type": "module",
30
31
  "main": "dist/index.cjs",
31
32
  "module": "dist/index.mjs",
32
- "types": "dist/index.d.ts",
33
33
  "exports": {
34
34
  ".": {
35
- "types": "./dist/index.d.ts",
36
- "import": "./dist/index.mjs",
37
- "require": "./dist/index.cjs",
38
- "default": "./dist/index.mjs"
35
+ "import": {
36
+ "types": "./dist/index.d.ts",
37
+ "default": "./dist/index.mjs"
38
+ },
39
+ "require": {
40
+ "default": "./dist/index.cjs"
41
+ }
39
42
  }
40
43
  },
41
44
  "files": [
@@ -45,24 +48,13 @@
45
48
  "dist"
46
49
  ],
47
50
  "dependencies": {
48
- "@csstools/css-calc": "^1.1.3",
49
- "@csstools/css-parser-algorithms": "^2.3.1",
50
- "@csstools/css-tokenizer": "^2.2.0"
51
+ "@csstools/css-calc": "^1.1.5",
52
+ "@csstools/css-parser-algorithms": "^2.4.0",
53
+ "@csstools/css-tokenizer": "^2.2.2"
51
54
  },
52
55
  "peerDependencies": {
53
56
  "postcss": "^8.4"
54
57
  },
55
- "devDependencies": {
56
- "@csstools/postcss-tape": "*"
57
- },
58
- "scripts": {
59
- "build": "rollup -c ../../rollup/default.mjs",
60
- "docs": "node ../../.github/bin/generate-docs/install.mjs && node ../../.github/bin/generate-docs/readme.mjs",
61
- "lint": "node ../../.github/bin/format-package-json.mjs",
62
- "prepublishOnly": "npm run build && npm run test",
63
- "test": "node .tape.mjs && node ./test/_import.mjs && node ./test/_require.cjs",
64
- "test:rewrite-expects": "REWRITE_EXPECTS=true node .tape.mjs"
65
- },
66
58
  "homepage": "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-trigonometric-functions#readme",
67
59
  "repository": {
68
60
  "type": "git",
@@ -81,14 +73,5 @@
81
73
  "sin",
82
74
  "tan",
83
75
  "trigonometric"
84
- ],
85
- "csstools": {
86
- "cssdbId": "trigonometric-functions",
87
- "exportName": "postcssTrigonometricFunctions",
88
- "humanReadableName": "PostCSS Trigonometric Functions",
89
- "specUrl": "https://www.w3.org/TR/css-values-4/#trig-funcs"
90
- },
91
- "volta": {
92
- "extends": "../../package.json"
93
- }
76
+ ]
94
77
  }
package/dist/calc.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function calc(css: string): string;
package/dist/checks.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const FUNCTION_NAME_REGEXP: RegExp;
2
- export declare const FUNCTION_CALL_REGEXP: RegExp;