diff --git a/.github/bin/license/allowed.mjs b/.github/bin/license/allowed.mjs index c74e03feb..b0a4ad22e 100644 --- a/.github/bin/license/allowed.mjs +++ b/.github/bin/license/allowed.mjs @@ -197,6 +197,9 @@ const missingLicenseExceptions = [ { file: 'node_modules/filter-iterator/package.json', }, + { + file: 'node_modules/@andrewbranch/untar.js/package.json', + }, ]; export function missingLicenseIsOkByException(file) { diff --git a/.github/bin/license/check-license.mjs b/.github/bin/license/check-license.mjs index bd240372c..e2130e88b 100644 --- a/.github/bin/license/check-license.mjs +++ b/.github/bin/license/check-license.mjs @@ -57,7 +57,7 @@ const allFiles = (await getFiles('./')).filter((file) => { for (const line of lines) { if (line.includes('@license')) { - if (line.startsWith(' * @license W3C')) { + if (line.trim().startsWith('* @license W3C')) { // W3C license is ok continue; } diff --git a/experimental/css-has-pseudo/dist/index.d.cts b/experimental/css-has-pseudo/dist/index.d.cts new file mode 100644 index 000000000..71d3a22e3 --- /dev/null +++ b/experimental/css-has-pseudo/dist/index.d.cts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export = creator; diff --git a/experimental/css-has-pseudo/dist/index.d.mts b/experimental/css-has-pseudo/dist/index.d.mts new file mode 100644 index 000000000..ab3aaf5d1 --- /dev/null +++ b/experimental/css-has-pseudo/dist/index.d.mts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export { creator as default }; diff --git a/experimental/css-has-pseudo/dist/index.d.ts b/experimental/css-has-pseudo/dist/index.d.ts index 37159ca64..71d3a22e3 100644 --- a/experimental/css-has-pseudo/dist/index.d.ts +++ b/experimental/css-has-pseudo/dist/index.d.ts @@ -1,3 +1,3 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; declare const creator: PluginCreator; -export default creator; +export = creator; diff --git a/experimental/css-has-pseudo/package.json b/experimental/css-has-pseudo/package.json index 0bd569042..5d007d467 100644 --- a/experimental/css-has-pseudo/package.json +++ b/experimental/css-has-pseudo/package.json @@ -17,14 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./browser": { "import": "./dist/browser.mjs", diff --git a/experimental/css-has-pseudo/tsconfig.json b/experimental/css-has-pseudo/tsconfig.json index e0d06239c..bb5e4ef3b 100644 --- a/experimental/css-has-pseudo/tsconfig.json +++ b/experimental/css-has-pseudo/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": "." + "declarationDir": "dist" }, "include": ["./src/**/*"], "exclude": ["dist"], diff --git a/experimental/postcss-gradient-stop-increments/dist/index.d.cts b/experimental/postcss-gradient-stop-increments/dist/index.d.cts new file mode 100644 index 000000000..9627a1bb7 --- /dev/null +++ b/experimental/postcss-gradient-stop-increments/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-gradient-stop-increments plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/experimental/postcss-gradient-stop-increments/dist/index.d.mts b/experimental/postcss-gradient-stop-increments/dist/index.d.mts new file mode 100644 index 000000000..2cdcf4962 --- /dev/null +++ b/experimental/postcss-gradient-stop-increments/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-gradient-stop-increments plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/experimental/postcss-gradient-stop-increments/dist/index.d.ts b/experimental/postcss-gradient-stop-increments/dist/index.d.ts index 8547e0f53..9627a1bb7 100644 --- a/experimental/postcss-gradient-stop-increments/dist/index.d.ts +++ b/experimental/postcss-gradient-stop-increments/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-gradient-stop-increments plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/experimental/postcss-gradient-stop-increments/package.json b/experimental/postcss-gradient-stop-increments/package.json index 615d2e7d5..0f5167f47 100644 --- a/experimental/postcss-gradient-stop-increments/package.json +++ b/experimental/postcss-gradient-stop-increments/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/experimental/postcss-gradient-stop-increments/tsconfig.json b/experimental/postcss-gradient-stop-increments/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/experimental/postcss-gradient-stop-increments/tsconfig.json +++ b/experimental/postcss-gradient-stop-increments/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/experimental/postcss-nesting/dist/index.d.cts b/experimental/postcss-nesting/dist/index.d.cts new file mode 100644 index 000000000..0e21b839b --- /dev/null +++ b/experimental/postcss-nesting/dist/index.d.cts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export = creator; diff --git a/experimental/postcss-nesting/dist/index.d.mts b/experimental/postcss-nesting/dist/index.d.mts new file mode 100644 index 000000000..9d7270ec8 --- /dev/null +++ b/experimental/postcss-nesting/dist/index.d.mts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export { creator as default }; diff --git a/experimental/postcss-nesting/dist/index.d.ts b/experimental/postcss-nesting/dist/index.d.ts index 89d75c8fd..0e21b839b 100644 --- a/experimental/postcss-nesting/dist/index.d.ts +++ b/experimental/postcss-nesting/dist/index.d.ts @@ -1,3 +1,3 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; declare const creator: PluginCreator; -export default creator; +export = creator; diff --git a/experimental/postcss-nesting/dist/lib/ampersand-to-scope.d.ts b/experimental/postcss-nesting/dist/lib/ampersand-to-scope.d.ts deleted file mode 100644 index f82c36f94..000000000 --- a/experimental/postcss-nesting/dist/lib/ampersand-to-scope.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Result, Rule } from 'postcss'; -export default function ampersandToScope(rule: Rule, result: Result): void; diff --git a/experimental/postcss-nesting/dist/lib/atrule-within-atrule.d.ts b/experimental/postcss-nesting/dist/lib/atrule-within-atrule.d.ts deleted file mode 100644 index f06ffa9a7..000000000 --- a/experimental/postcss-nesting/dist/lib/atrule-within-atrule.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AtRule } from 'postcss'; -export default function transformAtruleWithinAtrule(node: AtRule, parent: AtRule): void; -export declare function isAtruleWithinAtrule(node: AtRule, parent: AtRule): boolean; diff --git a/experimental/postcss-nesting/dist/lib/atrule-within-rule.d.ts b/experimental/postcss-nesting/dist/lib/atrule-within-rule.d.ts deleted file mode 100644 index 3632d999d..000000000 --- a/experimental/postcss-nesting/dist/lib/atrule-within-rule.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { walkFunc } from './walk-func.js'; -import type { AtRule, Result, Rule } from 'postcss'; -export default function atruleWithinRule(node: AtRule, parent: Rule, result: Result, walk: walkFunc): void; -export declare function isAtruleWithinRule(node: AtRule): boolean; diff --git a/experimental/postcss-nesting/dist/lib/cleanup-parent.d.ts b/experimental/postcss-nesting/dist/lib/cleanup-parent.d.ts deleted file mode 100644 index 5547db143..000000000 --- a/experimental/postcss-nesting/dist/lib/cleanup-parent.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ChildNode, Container } from 'postcss'; -export default function cleanupParent(parent: Container): void; diff --git a/experimental/postcss-nesting/dist/lib/group-declarations.d.ts b/experimental/postcss-nesting/dist/lib/group-declarations.d.ts deleted file mode 100644 index 116434201..000000000 --- a/experimental/postcss-nesting/dist/lib/group-declarations.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ChildNode, Container } from 'postcss'; -export default function groupDeclarations(node: Container): void; diff --git a/experimental/postcss-nesting/dist/lib/is-type-of-rule.d.ts b/experimental/postcss-nesting/dist/lib/is-type-of-rule.d.ts deleted file mode 100644 index 1df997c8f..000000000 --- a/experimental/postcss-nesting/dist/lib/is-type-of-rule.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AtRule, Node, Rule } from 'postcss'; -export declare function isAtRule(node?: Node): node is AtRule; -export declare function isRule(node?: Node): node is Rule; diff --git a/experimental/postcss-nesting/dist/lib/list.d.ts b/experimental/postcss-nesting/dist/lib/list.d.ts deleted file mode 100644 index 67a64736d..000000000 --- a/experimental/postcss-nesting/dist/lib/list.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function comma(string: string): string[]; diff --git a/experimental/postcss-nesting/dist/lib/merge-params.d.ts b/experimental/postcss-nesting/dist/lib/merge-params.d.ts deleted file mode 100644 index 0547e8f7b..000000000 --- a/experimental/postcss-nesting/dist/lib/merge-params.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function mergeParams(fromParams: string, toParams: string): string; diff --git a/experimental/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts b/experimental/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts deleted file mode 100644 index 760ba6abe..000000000 --- a/experimental/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node, Result } from 'postcss'; -export default function mergeSelectors(node: Node, postcssResult: Result, fromSelectors: Array, toSelectors: Array): any[]; diff --git a/experimental/postcss-nesting/dist/lib/rule-within-rule.d.ts b/experimental/postcss-nesting/dist/lib/rule-within-rule.d.ts deleted file mode 100644 index 9d1e0ee5c..000000000 --- a/experimental/postcss-nesting/dist/lib/rule-within-rule.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Result, Rule } from 'postcss'; -export default function transformRuleWithinRule(node: Rule, parent: Rule, result: Result): void; diff --git a/experimental/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts b/experimental/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts deleted file mode 100644 index 0876f2ba6..000000000 --- a/experimental/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ChildNode, Container } from 'postcss'; -export default function shiftNodesBeforeParent(node: ChildNode, parent: Container): void; diff --git a/experimental/postcss-nesting/dist/lib/valid-atrules.d.ts b/experimental/postcss-nesting/dist/lib/valid-atrules.d.ts deleted file mode 100644 index d451d2bc5..000000000 --- a/experimental/postcss-nesting/dist/lib/valid-atrules.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: string[]; -export default _default; diff --git a/experimental/postcss-nesting/dist/lib/walk-func.d.ts b/experimental/postcss-nesting/dist/lib/walk-func.d.ts deleted file mode 100644 index eaa8ff3c3..000000000 --- a/experimental/postcss-nesting/dist/lib/walk-func.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Container, Result } from 'postcss'; -export type walkFunc = (node: Container, result: Result) => void; diff --git a/experimental/postcss-nesting/dist/lib/walk.d.ts b/experimental/postcss-nesting/dist/lib/walk.d.ts deleted file mode 100644 index c4a943457..000000000 --- a/experimental/postcss-nesting/dist/lib/walk.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Container, Result } from 'postcss'; -export default function walk(node: Container, result: Result): void; diff --git a/experimental/postcss-nesting/tsconfig.json b/experimental/postcss-nesting/tsconfig.json index e0d06239c..bb5e4ef3b 100644 --- a/experimental/postcss-nesting/tsconfig.json +++ b/experimental/postcss-nesting/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": "." + "declarationDir": "dist" }, "include": ["./src/**/*"], "exclude": ["dist"], diff --git a/knip.json b/knip.json index 4797f21a8..bdb90dd66 100644 --- a/knip.json +++ b/knip.json @@ -108,6 +108,7 @@ "@rollup/plugin-terser", "@rollup/plugin-typescript", "@stryker-mutator/command-runner", + "rollup-plugin-ts", "tslib" ] } diff --git a/package-lock.json b/package-lock.json index 840a1c705..48f764acc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "plugins-stylelint/*" ], "devDependencies": { + "@arethetypeswrong/cli": "^0.13.1", "@babel/core": "^7.23.5", "@babel/preset-env": "^7.23.5", "@rollup/plugin-babel": "^6.0.3", @@ -39,6 +40,7 @@ "eslint": "^8.55.0", "knip": "^3.4.0", "rollup": "^4.6.1", + "rollup-plugin-ts": "^3.4.5", "tslib": "^2.6.2", "typescript": "^5.2.2" }, @@ -222,6 +224,49 @@ "node": ">=6.0.0" } }, + "node_modules/@andrewbranch/untar.js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@andrewbranch/untar.js/-/untar.js-1.0.3.tgz", + "integrity": "sha512-Jh15/qVmrLGhkKJBdXlK1+9tY4lZruYjsgkDFj08ZmDiWVBLJcqkok7Z0/R0In+i1rScBpJlSvrTS2Lm41Pbnw==", + "dev": true + }, + "node_modules/@arethetypeswrong/cli": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/cli/-/cli-0.13.2.tgz", + "integrity": "sha512-eqRWeFFiI58xwsiUfZSdZsmNCaqqtxmSPP9554ajiCDrB/aNzq5VktVK7dNiT9PamunNeoej4KbDBnkNwVacvg==", + "dev": true, + "dependencies": { + "@arethetypeswrong/core": "0.13.2", + "chalk": "^4.1.2", + "cli-table3": "^0.6.3", + "commander": "^10.0.1", + "marked": "^9.1.2", + "marked-terminal": "^6.0.0", + "semver": "^7.5.4" + }, + "bin": { + "attw": "dist/index.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@arethetypeswrong/core": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@arethetypeswrong/core/-/core-0.13.2.tgz", + "integrity": "sha512-1l6ygar+6TH4o1JipWWGCEZlOhAwEShm1yKx+CgIByNjCzufbu6k9DNbDmBjdouusNRhBIOYQe1UHnJig+GtAw==", + "dev": true, + "dependencies": { + "@andrewbranch/untar.js": "^1.0.3", + "fflate": "^0.7.4", + "semver": "^7.5.4", + "typescript": "5.3.2", + "validate-npm-package-name": "^5.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@babel/code-frame": { "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", @@ -235,6 +280,77 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/code-frame/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/code-frame/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/code-frame/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/code-frame/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/compat-data": { "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz", @@ -274,6 +390,15 @@ "url": "https://opencollective.com/babel" } }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/generator": { "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.5.tgz", @@ -329,6 +454,15 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-create-class-features-plugin": { "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.23.5.tgz", @@ -352,6 +486,15 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-create-class-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-create-regexp-features-plugin": { "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.22.15.tgz", @@ -369,6 +512,15 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-create-regexp-features-plugin/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/helper-define-polyfill-provider": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.4.3.tgz", @@ -622,6 +774,77 @@ "node": ">=6.9.0" } }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/@babel/parser": { "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.5.tgz", @@ -1889,6 +2112,15 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/preset-env/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/@babel/preset-modules": { "version": "0.1.6-no-external-plugins", "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz", @@ -1995,6 +2227,16 @@ "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", "dev": true }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", + "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/@csstools/base-cli": { "resolved": "packages/base-cli", "link": true @@ -2661,203 +2903,63 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/console/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } } }, - "node_modules/@jest/console/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/console/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/console/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@jest/console/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/console/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/core": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", - "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", - "dev": true, - "dependencies": { - "@jest/console": "^29.7.0", - "@jest/reporters": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/transform": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "ansi-escapes": "^4.2.1", - "chalk": "^4.0.0", - "ci-info": "^3.2.0", - "exit": "^0.1.2", - "graceful-fs": "^4.2.9", - "jest-changed-files": "^29.7.0", - "jest-config": "^29.7.0", - "jest-haste-map": "^29.7.0", - "jest-message-util": "^29.7.0", - "jest-regex-util": "^29.6.3", - "jest-resolve": "^29.7.0", - "jest-resolve-dependencies": "^29.7.0", - "jest-runner": "^29.7.0", - "jest-runtime": "^29.7.0", - "jest-snapshot": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "jest-watcher": "^29.7.0", - "micromatch": "^4.0.4", - "pretty-format": "^29.7.0", - "slash": "^3.0.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - }, - "peerDependencies": { - "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" - }, - "peerDependenciesMeta": { - "node-notifier": { - "optional": true - } - } - }, - "node_modules/@jest/core/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/core/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/core/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/core/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@jest/core/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/core/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/environment": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", - "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", - "dev": true, - "dependencies": { - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0" + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" }, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" @@ -2963,21 +3065,6 @@ } } }, - "node_modules/@jest/reporters/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/@jest/reporters/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -2988,40 +3075,6 @@ "concat-map": "0.0.1" } }, - "node_modules/@jest/reporters/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/reporters/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/reporters/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/@jest/reporters/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -3042,15 +3095,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@jest/reporters/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/reporters/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -3063,18 +3107,6 @@ "node": "*" } }, - "node_modules/@jest/reporters/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/@jest/schemas": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", @@ -3157,167 +3189,27 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/transform/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@jest/transform/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/transform/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/transform/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@jest/transform/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/transform/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/types": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", - "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", - "dev": true, - "dependencies": { - "@jest/schemas": "^29.6.3", - "@types/istanbul-lib-coverage": "^2.0.0", - "@types/istanbul-reports": "^3.0.0", - "@types/node": "*", - "@types/yargs": "^17.0.8", - "chalk": "^4.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/@jest/types/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@jest/types/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@jest/types/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/@jest/types/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/@jest/types/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jest/types/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", + "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", @@ -3384,6 +3276,12 @@ "node": ">= 0.4" } }, + "node_modules/@mdn/browser-compat-data": { + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/@mdn/browser-compat-data/-/browser-compat-data-5.4.3.tgz", + "integrity": "sha512-+VnaO5zYUwFQVuRqp2qLPGR5GwhhJ/lrp0yEmamJ/nI15P2GKwGBEWRDiITZR8i6AYxeiQSu2rOi/gqxehnPuA==", + "dev": true + }, "node_modules/@mrhenry/core-web": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@mrhenry/core-web/-/core-web-1.2.0.tgz", @@ -3394,39 +3292,6 @@ "semver": "^7.3.5" } }, - "node_modules/@mrhenry/core-web/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@mrhenry/core-web/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@mrhenry/core-web/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -3620,39 +3485,18 @@ "node": ">=14.6" } }, - "node_modules/@pnpm/npm-package-arg/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@pnpm/npm-package-arg/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "node_modules/@pnpm/npm-package-arg/node_modules/validate-npm-package-name": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", + "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", "dev": true, "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" + "builtins": "^5.0.0" }, "engines": { - "node": ">=10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/@pnpm/npm-package-arg/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@pnpm/npm-resolver": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/@pnpm/npm-resolver/-/npm-resolver-18.0.0.tgz", @@ -3700,39 +3544,6 @@ "node": "14 || >=16.14" } }, - "node_modules/@pnpm/npm-resolver/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@pnpm/npm-resolver/node_modules/semver/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@pnpm/npm-resolver/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@pnpm/resolve-workspace-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/@pnpm/resolve-workspace-range/-/resolve-workspace-range-5.0.1.tgz", @@ -3748,39 +3559,6 @@ "url": "https://opencollective.com/pnpm" } }, - "node_modules/@pnpm/resolve-workspace-range/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@pnpm/resolve-workspace-range/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@pnpm/resolve-workspace-range/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@pnpm/resolver-base": { "version": "11.0.0", "resolved": "https://registry.npmjs.org/@pnpm/resolver-base/-/resolver-base-11.0.0.tgz", @@ -4173,13 +3951,25 @@ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, - "node_modules/@sindresorhus/merge-streams": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-1.0.0.tgz", - "integrity": "sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw==", + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true, "engines": { - "node": ">=18" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, + "node_modules/@sindresorhus/merge-streams": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-1.0.0.tgz", + "integrity": "sha512-rUV5WyJrJLoloD4NDN1V1+LDMDWOa4OTsT4yYJwQNpTU6FWxkxHpL7eu4w+DmiH8x/EAM1otkPE1+LaspIbplw==", + "dev": true, + "engines": { + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -4298,6 +4088,15 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, + "node_modules/@stryker-mutator/core/node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, "node_modules/@stryker-mutator/core/node_modules/glob": { "version": "10.3.10", "resolved": "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz", @@ -4320,39 +4119,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/@stryker-mutator/core/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@stryker-mutator/core/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@stryker-mutator/core/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@stryker-mutator/instrumenter": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@stryker-mutator/instrumenter/-/instrumenter-8.0.0.tgz", @@ -4374,39 +4140,6 @@ "node": ">=18.0.0" } }, - "node_modules/@stryker-mutator/instrumenter/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@stryker-mutator/instrumenter/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@stryker-mutator/instrumenter/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@stryker-mutator/util": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/@stryker-mutator/util/-/util-8.0.0.tgz", @@ -4526,6 +4259,12 @@ "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, + "node_modules/@types/object-path": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/@types/object-path/-/object-path-0.11.4.tgz", + "integrity": "sha512-4tgJ1Z3elF/tOMpA8JLVuR9spt9Ynsf7+JjqsQ2IqtiPJtcLoHoXcT6qU4E10cPFqyXX5HDm9QwIzZhBSkLxsw==", + "dev": true + }, "node_modules/@types/resolve": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.20.2.tgz", @@ -4544,6 +4283,12 @@ "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, + "node_modules/@types/ua-parser-js": { + "version": "0.7.39", + "resolved": "https://registry.npmjs.org/@types/ua-parser-js/-/ua-parser-js-0.7.39.tgz", + "integrity": "sha512-P/oDfpofrdtF5xw433SPALpdSchtJmY7nsJItf8h3KXqOslkbySh8zq4dSWXH2oTjRvJ5PczVEoCZPow6GicLg==", + "dev": true + }, "node_modules/@types/yargs": { "version": "17.0.32", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", @@ -4604,39 +4349,6 @@ } } }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/eslint-plugin/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@typescript-eslint/parser": { "version": "6.13.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.13.1.tgz", @@ -4749,39 +4461,6 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@typescript-eslint/utils": { "version": "6.13.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.13.1.tgz", @@ -4807,39 +4486,6 @@ "eslint": "^7.0.0 || ^8.0.0" } }, - "node_modules/@typescript-eslint/utils/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/@typescript-eslint/utils/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/@typescript-eslint/visitor-keys": { "version": "6.13.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.13.1.tgz", @@ -4872,6 +4518,15 @@ "css-tree": "^2.3.1" } }, + "node_modules/@wessberg/stringutil": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/@wessberg/stringutil/-/stringutil-1.0.19.tgz", + "integrity": "sha512-9AZHVXWlpN8Cn9k5BC/O0Dzb9E9xfEMXzYrNunwvkUTvuK7xgQPVRZpLo+jWCOZ5r8oBa8NIrHuPEu1hzbb6bg==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/@zkochan/retry": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/@zkochan/retry/-/retry-0.2.0.tgz", @@ -4967,6 +4622,15 @@ "node": ">= 14" } }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -4992,17 +4656,26 @@ } }, "node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "dependencies": { - "color-convert": "^1.9.0" + "color-convert": "^2.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/ansicolors": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/ansicolors/-/ansicolors-0.3.2.tgz", + "integrity": "sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==", + "dev": true + }, "node_modules/anymatch": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", @@ -5142,121 +4815,60 @@ "@babel/core": "^7.8.0" } }, - "node_modules/babel-jest/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" }, "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/babel-jest/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": ">=8" } }, - "node_modules/babel-jest/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" }, "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/babel-jest/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/babel-jest/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-jest/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", - "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.0.0", - "@istanbuljs/load-nyc-config": "^1.0.0", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-instrument": "^5.0.4", - "test-exclude": "^6.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", - "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", - "dev": true, - "dependencies": { - "@babel/core": "^7.12.3", - "@babel/parser": "^7.14.7", - "@istanbuljs/schema": "^0.1.2", - "istanbul-lib-coverage": "^3.2.0", - "semver": "^6.3.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/babel-plugin-jest-hoist": { - "version": "29.6.3", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", - "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", - "dev": true, - "dependencies": { - "@babel/template": "^7.3.3", - "@babel/types": "^7.3.3", - "@types/babel__core": "^7.1.14", - "@types/babel__traverse": "^7.0.6" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/babel-plugin-polyfill-corejs2": { @@ -5273,6 +4885,15 @@ "@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0" } }, + "node_modules/babel-plugin-polyfill-corejs2/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/babel-plugin-polyfill-corejs3": { "version": "0.8.6", "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.8.6.tgz", @@ -5454,6 +5075,34 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/browserslist-generator": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/browserslist-generator/-/browserslist-generator-2.1.0.tgz", + "integrity": "sha512-ZFz4mAOgqm0cbwKaZsfJbYDbTXGoPANlte7qRsRJOfjB9KmmISQrXJxAVrnXG8C8v/QHNzXyeJt0Cfcks6zZvQ==", + "dev": true, + "dependencies": { + "@mdn/browser-compat-data": "^5.3.7", + "@types/object-path": "^0.11.1", + "@types/semver": "^7.5.0", + "@types/ua-parser-js": "^0.7.36", + "browserslist": "^4.21.10", + "caniuse-lite": "^1.0.30001518", + "isbot": "^3.6.13", + "object-path": "^0.11.8", + "semver": "^7.5.4", + "ua-parser-js": "^1.0.35" + }, + "engines": { + "node": ">=16.15.1", + "npm": ">=7.0.0", + "pnpm": ">=3.2.0", + "yarn": ">=1.13" + }, + "funding": { + "type": "github", + "url": "https://github.com/wessberg/browserslist-generator?sponsor=1" + } + }, "node_modules/bser": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", @@ -5523,39 +5172,6 @@ "semver": "^7.0.0" } }, - "node_modules/builtins/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/builtins/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/builtins/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/call-bind": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.5.tgz", @@ -5661,18 +5277,33 @@ } ] }, + "node_modules/cardinal": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/cardinal/-/cardinal-2.1.1.tgz", + "integrity": "sha512-JSr5eOgoEymtYHBjNWyjrMqet9Am2miJhlfKNdqLp6zoeAh0KN5dRAcxlecj5mAJrmQomgiOBj35xHLrFjqBpw==", + "dev": true, + "dependencies": { + "ansicolors": "~0.3.2", + "redeyed": "~2.1.0" + }, + "bin": { + "cdl": "bin/cdl.js" + } + }, "node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">=4" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" } }, "node_modules/char-regex": { @@ -5757,6 +5388,21 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-table3": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz", + "integrity": "sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "@colors/colors": "1.5.0" + } + }, "node_modules/cli-width": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-4.1.0.tgz", @@ -5780,39 +5426,6 @@ "node": ">=12" } }, - "node_modules/cliui/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/cliui/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/cliui/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/cliui/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -5856,18 +5469,21 @@ "dev": true }, "node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "dependencies": { - "color-name": "1.1.3" + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" } }, "node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "node_modules/colord": { @@ -5877,12 +5493,12 @@ "dev": true }, "node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", "dev": true, "engines": { - "node": ">=16" + "node": ">=14" } }, "node_modules/commondir": { @@ -5891,6 +5507,21 @@ "integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==", "dev": true }, + "node_modules/compatfactory": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/compatfactory/-/compatfactory-3.0.0.tgz", + "integrity": "sha512-WD5kF7koPwVoyKL8p0LlrmIZtilrD46sQStyzzxzTFinMKN2Dxk1hN+sddLSQU1mGIZvQfU8c+ONSghvvM40jg==", + "dev": true, + "dependencies": { + "helpertypes": "^0.0.19" + }, + "engines": { + "node": ">=14.9.0" + }, + "peerDependencies": { + "typescript": ">=3.x || >= 4.x || >= 5.x" + } + }, "node_modules/compose-function": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/compose-function/-/compose-function-3.0.3.tgz", @@ -5972,103 +5603,33 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/create-jest/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/cross-fetch": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", + "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node-fetch": "^2.6.12" } }, - "node_modules/create-jest/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/cross-fetch/node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "whatwg-url": "^5.0.0" }, "engines": { - "node": ">=10" + "node": "4.x || >=6.0.0" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/create-jest/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/create-jest/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/create-jest/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/create-jest/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cross-fetch": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", - "integrity": "sha512-e4a5N8lVvuLgAWgnCrLr2PP0YyDOTHa9H/Rj54dirp61qXnNq46m82bRhNqIA5VccJtWBvPTFRV3TtvHUKPB1g==", - "dev": true, - "dependencies": { - "node-fetch": "^2.6.12" - } - }, - "node_modules/cross-fetch/node_modules/node-fetch": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", - "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", - "dev": true, - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, "node_modules/cross-spawn": { @@ -6085,6 +5646,24 @@ "node": ">= 8" } }, + "node_modules/crosspath": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/crosspath/-/crosspath-2.0.0.tgz", + "integrity": "sha512-ju88BYCQ2uvjO2bR+SsgLSTwTSctU+6Vp2ePbKPgSCZyy4MWZxYsT738DlKVRE5utUjobjPRm1MkTYKJxCmpTA==", + "dev": true, + "dependencies": { + "@types/node": "^17.0.36" + }, + "engines": { + "node": ">=14.9.0" + } + }, + "node_modules/crosspath/node_modules/@types/node": { + "version": "17.0.45", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", + "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", + "dev": true + }, "node_modules/crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", @@ -6462,6 +6041,12 @@ "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", "dev": true }, + "node_modules/emojilib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/emojilib/-/emojilib-2.4.0.tgz", + "integrity": "sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==", + "dev": true + }, "node_modules/encode-registry": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/encode-registry/-/encode-registry-3.0.1.tgz", @@ -6512,12 +6097,15 @@ } }, "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, "engines": { - "node": ">=0.8.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/escodegen": { @@ -6650,21 +6238,6 @@ "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/eslint/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/eslint/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -6675,52 +6248,6 @@ "concat-map": "0.0.1" } }, - "node_modules/eslint/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/eslint/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/eslint/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/eslint/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/eslint/node_modules/globals": { "version": "13.23.0", "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz", @@ -6736,15 +6263,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/eslint/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -6763,18 +6281,6 @@ "node": "*" } }, - "node_modules/eslint/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/eslint/node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", @@ -7070,6 +6576,12 @@ } } }, + "node_modules/fflate": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.7.4.tgz", + "integrity": "sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==", + "dev": true + }, "node_modules/figures": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-5.0.0.tgz", @@ -7528,12 +7040,12 @@ } }, "node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/has-own-property": { @@ -7590,6 +7102,15 @@ "node": ">= 0.4" } }, + "node_modules/helpertypes": { + "version": "0.0.19", + "resolved": "https://registry.npmjs.org/helpertypes/-/helpertypes-0.0.19.tgz", + "integrity": "sha512-J00e55zffgi3yVnUp0UdbMztNkr2PnizEkOe9URNohnrNhW5X0QpegkuLpOmFQInpi93Nb8MCjQRHAiCDF42NQ==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/hosted-git-info": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-4.1.0.tgz", @@ -8037,6 +7558,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/isbot": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/isbot/-/isbot-3.7.1.tgz", + "integrity": "sha512-JfqOaY3O1lcWt2nc+D6Mq231CNpwZrBboLa59Go0J8hjGH+gY/Sy0CA/YLUSIScINmAVwTdJZIsOTk4PfBtRuw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", @@ -8068,39 +7598,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-instrument/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/istanbul-lib-instrument/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/istanbul-lib-report": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", @@ -8115,27 +7612,6 @@ "node": ">=10" } }, - "node_modules/istanbul-lib-report/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/istanbul-lib-report/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/istanbul-lib-source-maps": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", @@ -8377,99 +7853,29 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-circus/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-circus/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-circus/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-circus/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-circus/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-circus/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-cli": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", - "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", - "dev": true, - "dependencies": { - "@jest/core": "^29.7.0", - "@jest/test-result": "^29.7.0", - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "create-jest": "^29.7.0", - "exit": "^0.1.2", - "import-local": "^3.0.2", - "jest-config": "^29.7.0", - "jest-util": "^29.7.0", - "jest-validate": "^29.7.0", - "yargs": "^17.3.1" - }, - "bin": { - "jest": "bin/jest.js" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" }, "peerDependencies": { "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" @@ -8480,76 +7886,6 @@ } } }, - "node_modules/jest-cli/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-cli/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-cli/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-cli/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-cli/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-cli/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-config": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", @@ -8595,21 +7931,6 @@ } } }, - "node_modules/jest-config/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/jest-config/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -8620,40 +7941,6 @@ "concat-map": "0.0.1" } }, - "node_modules/jest-config/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-config/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-config/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/jest-config/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -8674,15 +7961,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-config/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-config/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -8695,18 +7973,6 @@ "node": "*" } }, - "node_modules/jest-config/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-diff": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", @@ -8722,189 +7988,49 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-diff/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", "dev": true, "dependencies": { - "color-convert": "^2.0.1" + "detect-newline": "^3.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-diff/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-diff/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", "dev": true, "dependencies": { - "color-name": "~1.1.4" + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" }, "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-diff/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-diff/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-diff/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-docblock": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", - "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", - "dev": true, - "dependencies": { - "detect-newline": "^3.0.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", - "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", - "dev": true, - "dependencies": { - "@jest/types": "^29.6.3", - "chalk": "^4.0.0", - "jest-get-type": "^29.6.3", - "jest-util": "^29.7.0", - "pretty-format": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" - } - }, - "node_modules/jest-each/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-each/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-each/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-each/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-each/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-each/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-environment-node": { - "version": "29.7.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", - "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", - "dev": true, - "dependencies": { - "@jest/environment": "^29.7.0", - "@jest/fake-timers": "^29.7.0", - "@jest/types": "^29.6.3", - "@types/node": "*", - "jest-mock": "^29.7.0", - "jest-util": "^29.7.0" - }, - "engines": { - "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, "node_modules/jest-get-type": { @@ -8969,76 +8095,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-matcher-utils/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-matcher-utils/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-matcher-utils/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-matcher-utils/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-matcher-utils/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-message-util": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", @@ -9059,76 +8115,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-message-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-message-util/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-message-util/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-message-util/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-message-util/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-mock": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", @@ -9214,76 +8200,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-resolve/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-resolve/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-resolve/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-resolve/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-resolve/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-resolve/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-runner": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", @@ -9316,64 +8232,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-runner/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-runner/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-runner/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-runner/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-runner/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-runner/node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -9393,18 +8251,6 @@ "source-map": "^0.6.0" } }, - "node_modules/jest-runner/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-runtime": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", @@ -9438,21 +8284,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-runtime/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/jest-runtime/node_modules/brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", @@ -9463,40 +8294,6 @@ "concat-map": "0.0.1" } }, - "node_modules/jest-runtime/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-runtime/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-runtime/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/jest-runtime/node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -9517,15 +8314,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/jest-runtime/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-runtime/node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -9538,18 +8326,6 @@ "node": "*" } }, - "node_modules/jest-runtime/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-snapshot": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", @@ -9581,109 +8357,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-snapshot/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-snapshot/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-snapshot/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-snapshot/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-snapshot/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-snapshot/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/jest-snapshot/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/jest-snapshot/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-snapshot/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/jest-util": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", @@ -9701,76 +8374,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-util/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-util/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-util/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-util/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-util/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-util/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-validate": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", @@ -9788,21 +8391,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-validate/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, "node_modules/jest-validate/node_modules/camelcase": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", @@ -9815,61 +8403,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/jest-validate/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-validate/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-validate/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-validate/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-validate/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-watcher": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", @@ -9889,76 +8422,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-watcher/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/jest-watcher/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/jest-watcher/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/jest-watcher/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/jest-watcher/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/jest-watcher/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-worker": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", @@ -9974,15 +8437,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/jest-worker/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/jest-worker/node_modules/supports-color": { "version": "8.1.1", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", @@ -10348,64 +8802,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-symbols/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/log-symbols/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/log-symbols/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/log-symbols/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/log-symbols/node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -10418,18 +8814,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/log-symbols/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/log4js": { "version": "6.9.1", "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.9.1.tgz", @@ -10482,39 +8866,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/make-dir/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/make-dir/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/makeerror": { "version": "1.0.12", "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", @@ -10545,6 +8896,77 @@ "node": ">=4" } }, + "node_modules/marked": { + "version": "9.1.6", + "resolved": "https://registry.npmjs.org/marked/-/marked-9.1.6.tgz", + "integrity": "sha512-jcByLnIFkd5gSXZmjNvS1TlmRhCXZjIzHYlaGkPlLIekG55JDR2Z4va9tZwCiP+/RDERiNhMOFu01xd6O5ct1Q==", + "dev": true, + "bin": { + "marked": "bin/marked.js" + }, + "engines": { + "node": ">= 16" + } + }, + "node_modules/marked-terminal": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/marked-terminal/-/marked-terminal-6.1.0.tgz", + "integrity": "sha512-QaCSF6NV82oo6K0szEnmc65ooDeW0T/Adcyf0fcW+Hto2GT1VADFg8dn1zaeHqzj65fqDH1hMNChGNRaC/lbkA==", + "dev": true, + "dependencies": { + "ansi-escapes": "^6.2.0", + "cardinal": "^2.1.1", + "chalk": "^5.3.0", + "cli-table3": "^0.6.3", + "node-emoji": "^2.1.0", + "supports-hyperlinks": "^3.0.0" + }, + "engines": { + "node": ">=16.0.0" + }, + "peerDependencies": { + "marked": ">=1 <11" + } + }, + "node_modules/marked-terminal/node_modules/ansi-escapes": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", + "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "dev": true, + "dependencies": { + "type-fest": "^3.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/marked-terminal/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/marked-terminal/node_modules/type-fest": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", + "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", + "dev": true, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/mathml-tag-names": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", @@ -10807,6 +9229,21 @@ "node": ">= 0.4.0" } }, + "node_modules/node-emoji": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-2.1.3.tgz", + "integrity": "sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^4.6.0", + "char-regex": "^1.0.2", + "emojilib": "^2.4.0", + "skin-tone": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/node-fetch": { "version": "3.0.0-beta.9", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.0.0-beta.9.tgz", @@ -10850,39 +9287,6 @@ "node": ">=10" } }, - "node_modules/normalize-package-data/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/normalize-package-data/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/normalize-package-data/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", @@ -10951,6 +9355,15 @@ "integrity": "sha512-3ECr6K831I4xX/Mduxr9UC+HPOz/d6WKKYj9p4cmC8Lg8p7g8gitzsxNX5IWlSIgFWN/a4JgrJaoAMKn20oKwA==", "dev": true }, + "node_modules/object-path": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/object-path/-/object-path-0.11.8.tgz", + "integrity": "sha512-YJjNZrlXJFM42wTBn6zgOJVar9KFJvzx6sTWDte8sWZF//cnjl0BxHNpfZx+ZffXX63A9q0b1zsFiBX4g4X5KA==", + "dev": true, + "engines": { + "node": ">= 10.12.0" + } + }, "node_modules/object-values": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/object-values/-/object-values-1.0.0.tgz", @@ -11042,64 +9455,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ora/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/ora/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/ora/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/ora/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/ora/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/ora/node_modules/is-unicode-supported": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", @@ -11112,18 +9467,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ora/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -11315,6 +9658,15 @@ "node": ">=8.15" } }, + "node_modules/parse-npm-tarball-url/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -12178,6 +10530,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/redeyed": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/redeyed/-/redeyed-2.1.1.tgz", + "integrity": "sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==", + "dev": true, + "dependencies": { + "esprima": "~4.0.0" + } + }, "node_modules/regenerate": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.2.tgz", @@ -12486,6 +10847,68 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup-plugin-ts": { + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/rollup-plugin-ts/-/rollup-plugin-ts-3.4.5.tgz", + "integrity": "sha512-9iCstRJpEZXSRQuXitlSZAzcGlrqTbJg1pE4CMbEi6xYldxVncdPyzA2I+j6vnh73wBymZckerS+Q/iEE/M3Ow==", + "dev": true, + "dependencies": { + "@rollup/pluginutils": "^5.0.2", + "@wessberg/stringutil": "^1.0.19", + "ansi-colors": "^4.1.3", + "browserslist": "^4.21.10", + "browserslist-generator": "^2.1.0", + "compatfactory": "^3.0.0", + "crosspath": "^2.0.0", + "magic-string": "^0.30.2", + "ts-clone-node": "^3.0.0", + "tslib": "^2.6.1" + }, + "engines": { + "node": ">=16.15.1", + "npm": ">=7.0.0", + "pnpm": ">=3.2.0", + "yarn": ">=1.13" + }, + "funding": { + "type": "github", + "url": "https://github.com/wessberg/rollup-plugin-ts?sponsor=1" + }, + "peerDependencies": { + "@babel/core": ">=7.x", + "@babel/plugin-transform-runtime": ">=7.x", + "@babel/preset-env": ">=7.x", + "@babel/preset-typescript": ">=7.x", + "@babel/runtime": ">=7.x", + "@swc/core": ">=1.x", + "@swc/helpers": ">=0.2", + "rollup": ">=1.x || >=2.x || >=3.x", + "typescript": ">=3.2.x || >= 4.x || >= 5.x" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@babel/plugin-transform-runtime": { + "optional": true + }, + "@babel/preset-env": { + "optional": true + }, + "@babel/preset-typescript": { + "optional": true + }, + "@babel/runtime": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "@swc/helpers": { + "optional": true + } + } + }, "node_modules/run-async": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-3.0.0.tgz", @@ -12554,14 +10977,38 @@ "dev": true }, "node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, "bin": { "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, + "node_modules/semver/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/serialize-javascript": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.1.tgz", @@ -12645,6 +11092,18 @@ "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", "dev": true }, + "node_modules/skin-tone": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/skin-tone/-/skin-tone-2.0.0.tgz", + "integrity": "sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==", + "dev": true, + "dependencies": { + "unicode-emoji-modifier-base": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", @@ -12671,39 +11130,6 @@ "url": "https://github.com/chalk/slice-ansi?sponsor=1" } }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/slice-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -13185,15 +11611,15 @@ "dev": true }, "node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, "node_modules/supports-hyperlinks": { @@ -13209,27 +11635,6 @@ "node": ">=14.18" } }, - "node_modules/supports-hyperlinks/node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/supports-hyperlinks/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -13498,6 +11903,25 @@ "typescript": ">=4.2.0" } }, + "node_modules/ts-clone-node": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ts-clone-node/-/ts-clone-node-3.0.0.tgz", + "integrity": "sha512-egavvyHbIoelkgh1IC2agNB1uMNjB8VJgh0g/cn0bg2XXTcrtjrGMzEk4OD3Fi2hocICjP3vMa56nkzIzq0FRg==", + "dev": true, + "dependencies": { + "compatfactory": "^3.0.0" + }, + "engines": { + "node": ">=14.9.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/wessberg/ts-clone-node?sponsor=1" + }, + "peerDependencies": { + "typescript": "^3.x || ^4.x || ^5.x" + } + }, "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", @@ -13579,6 +12003,29 @@ "node": ">=14.17" } }, + "node_modules/ua-parser-js": { + "version": "1.0.37", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.37.tgz", + "integrity": "sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "engines": { + "node": "*" + } + }, "node_modules/unbzip2-stream": { "version": "1.4.3", "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", @@ -13619,6 +12066,15 @@ "node": ">=4" } }, + "node_modules/unicode-emoji-modifier-base": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unicode-emoji-modifier-base/-/unicode-emoji-modifier-base-1.0.0.tgz", + "integrity": "sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/unicode-match-property-ecmascript": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", @@ -13757,15 +12213,15 @@ } }, "node_modules/validate-npm-package-name": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-4.0.0.tgz", - "integrity": "sha512-mzR0L8ZDktZjpX4OB46KT+56MAhl4EIazWP/+G/HPGuvfdaqg4YsCdtOm6U9+LOFyYDoh4dpnpxZRB9MQQns5Q==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz", + "integrity": "sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ==", "dev": true, "dependencies": { "builtins": "^5.0.0" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, "node_modules/version-selector-type": { @@ -13780,39 +12236,6 @@ "node": ">=10.13" } }, - "node_modules/version-selector-type/node_modules/lru-cache": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, - "dependencies": { - "yallist": "^4.0.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/version-selector-type/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", - "dev": true, - "dependencies": { - "lru-cache": "^6.0.0" - }, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/version-selector-type/node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true - }, "node_modules/vlq": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", @@ -13906,72 +12329,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi-cjs/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/wrap-ansi/node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/wrap-ansi/node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/wrap-ansi/node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", diff --git a/package.json b/package.json index 9eb4448d4..24bb88a2f 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "plugins-stylelint/*" ], "devDependencies": { + "@arethetypeswrong/cli": "^0.13.1", "@babel/core": "^7.23.5", "@babel/preset-env": "^7.23.5", "@rollup/plugin-babel": "^6.0.3", @@ -39,6 +40,7 @@ "eslint": "^8.55.0", "knip": "^3.4.0", "rollup": "^4.6.1", + "rollup-plugin-ts": "^3.4.5", "tslib": "^2.6.2", "typescript": "^5.2.2" }, diff --git a/packages/base-cli/dist/args.d.ts b/packages/base-cli/dist/args.d.ts deleted file mode 100644 index 74e1d3483..000000000 --- a/packages/base-cli/dist/args.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export type Arguments = { - stdin: boolean; - stdout: boolean; - inputs: Array; - output: string | undefined; - outputDir: string | undefined; - externalMap: boolean; - inlineMap: boolean; - replace: boolean; - pluginOptions: Record; - debug: boolean; -}; -export declare enum SignalValue { - InvalidArguments = "INVALID_ARGUMENTS" -} -export declare function parseArguments(args: Array, allowedPluginOpts: Array, helpLogger: () => void): Arguments | SignalValue; diff --git a/packages/base-cli/dist/get-stdin.d.ts b/packages/base-cli/dist/get-stdin.d.ts deleted file mode 100644 index e40e6c58f..000000000 --- a/packages/base-cli/dist/get-stdin.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function getStdin(): Promise; diff --git a/packages/base-cli/dist/help.d.ts b/packages/base-cli/dist/help.d.ts deleted file mode 100644 index 9c6178ebf..000000000 --- a/packages/base-cli/dist/help.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function helpTextLogger(command: string, name: string, description: string, exampleOptions?: Record | null): () => void; diff --git a/packages/base-cli/dist/index.d.cts b/packages/base-cli/dist/index.d.cts new file mode 100644 index 000000000..89e6f4628 --- /dev/null +++ b/packages/base-cli/dist/index.d.cts @@ -0,0 +1,21 @@ +import { PluginCreator } from 'postcss'; +type Arguments = { + stdin: boolean; + stdout: boolean; + inputs: Array; + output: string | undefined; + outputDir: string | undefined; + externalMap: boolean; + inlineMap: boolean; + replace: boolean; + pluginOptions: Record; + debug: boolean; +}; +declare enum SignalValue { + InvalidArguments = "INVALID_ARGUMENTS" +} +declare function parseArguments(args: Array, allowedPluginOpts: Array, helpLogger: () => void): Arguments | SignalValue; +declare function helpTextLogger(command: string, name: string, description: string, exampleOptions?: Record | null): () => void; +type PluginCreatorOptions = Record | null; +declare function cli(plugin: PluginCreator, allowedPluginOpts: Array, helpLogger: () => void, standalone?: boolean): Promise; +export { parseArguments, helpTextLogger, cli }; diff --git a/packages/base-cli/dist/index.d.mts b/packages/base-cli/dist/index.d.mts new file mode 100644 index 000000000..89e6f4628 --- /dev/null +++ b/packages/base-cli/dist/index.d.mts @@ -0,0 +1,21 @@ +import { PluginCreator } from 'postcss'; +type Arguments = { + stdin: boolean; + stdout: boolean; + inputs: Array; + output: string | undefined; + outputDir: string | undefined; + externalMap: boolean; + inlineMap: boolean; + replace: boolean; + pluginOptions: Record; + debug: boolean; +}; +declare enum SignalValue { + InvalidArguments = "INVALID_ARGUMENTS" +} +declare function parseArguments(args: Array, allowedPluginOpts: Array, helpLogger: () => void): Arguments | SignalValue; +declare function helpTextLogger(command: string, name: string, description: string, exampleOptions?: Record | null): () => void; +type PluginCreatorOptions = Record | null; +declare function cli(plugin: PluginCreator, allowedPluginOpts: Array, helpLogger: () => void, standalone?: boolean): Promise; +export { parseArguments, helpTextLogger, cli }; diff --git a/packages/base-cli/dist/index.d.ts b/packages/base-cli/dist/index.d.ts index 8f1b5ea92..89e6f4628 100644 --- a/packages/base-cli/dist/index.d.ts +++ b/packages/base-cli/dist/index.d.ts @@ -1,5 +1,21 @@ -import type { PluginCreator } from 'postcss'; -export { parseArguments } from './args'; -export { helpTextLogger } from './help'; +import { PluginCreator } from 'postcss'; +type Arguments = { + stdin: boolean; + stdout: boolean; + inputs: Array; + output: string | undefined; + outputDir: string | undefined; + externalMap: boolean; + inlineMap: boolean; + replace: boolean; + pluginOptions: Record; + debug: boolean; +}; +declare enum SignalValue { + InvalidArguments = "INVALID_ARGUMENTS" +} +declare function parseArguments(args: Array, allowedPluginOpts: Array, helpLogger: () => void): Arguments | SignalValue; +declare function helpTextLogger(command: string, name: string, description: string, exampleOptions?: Record | null): () => void; type PluginCreatorOptions = Record | null; -export declare function cli(plugin: PluginCreator, allowedPluginOpts: Array, helpLogger: () => void, standalone?: boolean): Promise; +declare function cli(plugin: PluginCreator, allowedPluginOpts: Array, helpLogger: () => void, standalone?: boolean): Promise; +export { parseArguments, helpTextLogger, cli }; diff --git a/packages/base-cli/dist/io-fs-to-fs.d.ts b/packages/base-cli/dist/io-fs-to-fs.d.ts deleted file mode 100644 index 58c29b384..000000000 --- a/packages/base-cli/dist/io-fs-to-fs.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Plugin } from 'postcss'; -import { Arguments } from './args'; -export declare function fsToFs(plugin: Plugin, argo: Arguments): Promise; diff --git a/packages/base-cli/dist/io-fs-to-stdout.d.ts b/packages/base-cli/dist/io-fs-to-stdout.d.ts deleted file mode 100644 index d657e78e1..000000000 --- a/packages/base-cli/dist/io-fs-to-stdout.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Plugin } from 'postcss'; -import { Arguments } from './args'; -export declare function fsToStdout(plugin: Plugin, argo: Arguments): Promise; diff --git a/packages/base-cli/dist/io-stdin-to-fs.d.ts b/packages/base-cli/dist/io-stdin-to-fs.d.ts deleted file mode 100644 index 4f136e51b..000000000 --- a/packages/base-cli/dist/io-stdin-to-fs.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Plugin } from 'postcss'; -import { Arguments } from './args'; -export declare function stdinToFs(plugin: Plugin, argo: Arguments, helpLogger: () => void): Promise; diff --git a/packages/base-cli/dist/io-stdin-to-stdout.d.ts b/packages/base-cli/dist/io-stdin-to-stdout.d.ts deleted file mode 100644 index 4c75c03c0..000000000 --- a/packages/base-cli/dist/io-stdin-to-stdout.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { Arguments } from './args'; -import type { Plugin } from 'postcss'; -export declare function stdinToStdout(plugin: Plugin, argo: Arguments, helpLogger: () => void): Promise; diff --git a/packages/base-cli/package.json b/packages/base-cli/package.json index 071594d9c..44aa6ab21 100644 --- a/packages/base-cli/package.json +++ b/packages/base-cli/package.json @@ -18,15 +18,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "peerDependencies": { diff --git a/packages/base-cli/tsconfig.json b/packages/base-cli/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/packages/base-cli/tsconfig.json +++ b/packages/base-cli/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/packages/cascade-layer-name-parser/dist/index.d.cts b/packages/cascade-layer-name-parser/dist/index.d.cts new file mode 100644 index 000000000..b61542a3c --- /dev/null +++ b/packages/cascade-layer-name-parser/dist/index.d.cts @@ -0,0 +1,37 @@ +import { CSSToken, ParseError } from "@csstools/css-tokenizer"; +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; + }; +} +// Insert new items after the most similar current item +// +// [["a", "b"]] +// insert "a.first" +// [["a", "a.first", "b"]] +// +// [["a", "a.first", "a.second", "b"]] +// insert "a.first.foo" +// [["a", "a.first", "a.first.foo", "a.second", "b"]] +// +// [["a", "b"]] +// insert "c" +// [["a", "b", "c"]] +declare function addLayerToModel(layers: Array, currentLayerNames: Array): LayerName[]; +type Options = { + onParseError?: (error: ParseError) => void; +}; +declare function parseFromTokens(tokens: Array, options?: Options): LayerName[]; +declare function parse(source: string, options?: Options): LayerName[]; +export { LayerName, addLayerToModel, parse, parseFromTokens }; diff --git a/packages/cascade-layer-name-parser/dist/index.d.mts b/packages/cascade-layer-name-parser/dist/index.d.mts new file mode 100644 index 000000000..b61542a3c --- /dev/null +++ b/packages/cascade-layer-name-parser/dist/index.d.mts @@ -0,0 +1,37 @@ +import { CSSToken, ParseError } from "@csstools/css-tokenizer"; +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; + }; +} +// Insert new items after the most similar current item +// +// [["a", "b"]] +// insert "a.first" +// [["a", "a.first", "b"]] +// +// [["a", "a.first", "a.second", "b"]] +// insert "a.first.foo" +// [["a", "a.first", "a.first.foo", "a.second", "b"]] +// +// [["a", "b"]] +// insert "c" +// [["a", "b", "c"]] +declare function addLayerToModel(layers: Array, currentLayerNames: Array): LayerName[]; +type Options = { + onParseError?: (error: ParseError) => void; +}; +declare function parseFromTokens(tokens: Array, options?: Options): LayerName[]; +declare function parse(source: string, options?: Options): LayerName[]; +export { LayerName, addLayerToModel, parse, parseFromTokens }; diff --git a/packages/cascade-layer-name-parser/dist/index.d.ts b/packages/cascade-layer-name-parser/dist/index.d.ts index 2592bc2e1..b61542a3c 100644 --- a/packages/cascade-layer-name-parser/dist/index.d.ts +++ b/packages/cascade-layer-name-parser/dist/index.d.ts @@ -1,3 +1,37 @@ -export { LayerName } from './nodes/layer-name'; -export { addLayerToModel } from './util/model'; -export { parse, parseFromTokens } from './parser/parse'; +import { CSSToken, ParseError } from "@csstools/css-tokenizer"; +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; + }; +} +// Insert new items after the most similar current item +// +// [["a", "b"]] +// insert "a.first" +// [["a", "a.first", "b"]] +// +// [["a", "a.first", "a.second", "b"]] +// insert "a.first.foo" +// [["a", "a.first", "a.first.foo", "a.second", "b"]] +// +// [["a", "b"]] +// insert "c" +// [["a", "b", "c"]] +declare function addLayerToModel(layers: Array, currentLayerNames: Array): LayerName[]; +type Options = { + onParseError?: (error: ParseError) => void; +}; +declare function parseFromTokens(tokens: Array, options?: Options): LayerName[]; +declare function parse(source: string, options?: Options): LayerName[]; +export { LayerName, addLayerToModel, parse, parseFromTokens }; diff --git a/packages/cascade-layer-name-parser/dist/nodes/layer-name.d.ts b/packages/cascade-layer-name-parser/dist/nodes/layer-name.d.ts deleted file mode 100644 index 94d956f5e..000000000 --- a/packages/cascade-layer-name-parser/dist/nodes/layer-name.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -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; - }; -} diff --git a/packages/cascade-layer-name-parser/dist/parser/parse.d.ts b/packages/cascade-layer-name-parser/dist/parser/parse.d.ts deleted file mode 100644 index 0b0c36edb..000000000 --- a/packages/cascade-layer-name-parser/dist/parser/parse.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { LayerName } from '../nodes/layer-name'; -type Options = { - onParseError?: (error: ParseError) => void; -}; -export declare function parseFromTokens(tokens: Array, options?: Options): LayerName[]; -export declare function parse(source: string, options?: Options): LayerName[]; -export {}; diff --git a/packages/cascade-layer-name-parser/dist/util/model.d.ts b/packages/cascade-layer-name-parser/dist/util/model.d.ts deleted file mode 100644 index 7347ce264..000000000 --- a/packages/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/packages/cascade-layer-name-parser/package.json b/packages/cascade-layer-name-parser/package.json index e244cb90a..144e4b1e8 100644 --- a/packages/cascade-layer-name-parser/package.json +++ b/packages/cascade-layer-name-parser/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/packages/cascade-layer-name-parser/tsconfig.json b/packages/cascade-layer-name-parser/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/packages/cascade-layer-name-parser/tsconfig.json +++ b/packages/cascade-layer-name-parser/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/packages/color-helpers/dist/calculations/binary-search-gamut.d.ts b/packages/color-helpers/dist/calculations/binary-search-gamut.d.ts deleted file mode 100644 index ddb9dcc92..000000000 --- a/packages/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/packages/color-helpers/dist/calculations/contrast.d.ts b/packages/color-helpers/dist/calculations/contrast.d.ts deleted file mode 100644 index 22d355bcb..000000000 --- a/packages/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/packages/color-helpers/dist/calculations/delta-EOK.d.ts b/packages/color-helpers/dist/calculations/delta-EOK.d.ts deleted file mode 100644 index 7fa98dee9..000000000 --- a/packages/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/packages/color-helpers/dist/calculations/index.d.ts b/packages/color-helpers/dist/calculations/index.d.ts deleted file mode 100644 index 86e5f3579..000000000 --- a/packages/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/packages/color-helpers/dist/calculations/map-gamut.d.ts b/packages/color-helpers/dist/calculations/map-gamut.d.ts deleted file mode 100644 index b1a0bbbb6..000000000 --- a/packages/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/packages/color-helpers/dist/calculations/multiply-matrices.d.ts b/packages/color-helpers/dist/calculations/multiply-matrices.d.ts deleted file mode 100644 index b78e13fd5..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/constants.d.ts b/packages/color-helpers/dist/conversions/constants.d.ts deleted file mode 100644 index 4d2e7a1e4..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/d50-to-d65.d.ts b/packages/color-helpers/dist/conversions/d50-to-d65.d.ts deleted file mode 100644 index 577959659..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/d65-to-d50.d.ts b/packages/color-helpers/dist/conversions/d65-to-d50.d.ts deleted file mode 100644 index 9db131cbf..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/gam-2020.d.ts b/packages/color-helpers/dist/conversions/gam-2020.d.ts deleted file mode 100644 index 0ab19f47b..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/gam-a98rgb.d.ts b/packages/color-helpers/dist/conversions/gam-a98rgb.d.ts deleted file mode 100644 index 3dbca9882..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/gam-p3.d.ts b/packages/color-helpers/dist/conversions/gam-p3.d.ts deleted file mode 100644 index 18d6d464e..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/gam-pro-photo.d.ts b/packages/color-helpers/dist/conversions/gam-pro-photo.d.ts deleted file mode 100644 index 0fbbf4c51..000000000 --- a/packages/color-helpers/dist/conversions/gam-pro-photo.d.ts +++ /dev/null @@ -1,12 +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; -export declare function foo(): void; diff --git a/packages/color-helpers/dist/conversions/gam-srgb.d.ts b/packages/color-helpers/dist/conversions/gam-srgb.d.ts deleted file mode 100644 index fc951cd90..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/hsl-to-srgb.d.ts b/packages/color-helpers/dist/conversions/hsl-to-srgb.d.ts deleted file mode 100644 index 3598a5447..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/hue-to-rgb.d.ts b/packages/color-helpers/dist/conversions/hue-to-rgb.d.ts deleted file mode 100644 index 8cb5ff7cd..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/hwb-to-srgb.d.ts b/packages/color-helpers/dist/conversions/hwb-to-srgb.d.ts deleted file mode 100644 index 2527a6416..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/index.d.ts b/packages/color-helpers/dist/conversions/index.d.ts deleted file mode 100644 index 9a2ed427c..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lab-to-lch.d.ts b/packages/color-helpers/dist/conversions/lab-to-lch.d.ts deleted file mode 100644 index dc9b715a4..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lab-to-xyz.d.ts b/packages/color-helpers/dist/conversions/lab-to-xyz.d.ts deleted file mode 100644 index 41e28669a..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lch-to-lab.d.ts b/packages/color-helpers/dist/conversions/lch-to-lab.d.ts deleted file mode 100644 index 0e029502c..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-2020-to-xyz.d.ts b/packages/color-helpers/dist/conversions/lin-2020-to-xyz.d.ts deleted file mode 100644 index a2c3300a6..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-2020.d.ts b/packages/color-helpers/dist/conversions/lin-2020.d.ts deleted file mode 100644 index ad510b212..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-a98rgb-to-xyz.d.ts b/packages/color-helpers/dist/conversions/lin-a98rgb-to-xyz.d.ts deleted file mode 100644 index f35928bb1..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-a98rgb.d.ts b/packages/color-helpers/dist/conversions/lin-a98rgb.d.ts deleted file mode 100644 index f69602d95..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-p3-to-xyz.d.ts b/packages/color-helpers/dist/conversions/lin-p3-to-xyz.d.ts deleted file mode 100644 index 0ff5c9687..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-p3.d.ts b/packages/color-helpers/dist/conversions/lin-p3.d.ts deleted file mode 100644 index 4fd2c5fd5..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-pro-photo-to-xyz.d.ts b/packages/color-helpers/dist/conversions/lin-pro-photo-to-xyz.d.ts deleted file mode 100644 index f8e1ce4ef..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-pro-photo.d.ts b/packages/color-helpers/dist/conversions/lin-pro-photo.d.ts deleted file mode 100644 index b29ff99f9..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-srgb-to-xyz.d.ts b/packages/color-helpers/dist/conversions/lin-srgb-to-xyz.d.ts deleted file mode 100644 index e99c9bd54..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/lin-srgb.d.ts b/packages/color-helpers/dist/conversions/lin-srgb.d.ts deleted file mode 100644 index 5f0bf371f..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/naive-cmyk-to-srgb.d.ts b/packages/color-helpers/dist/conversions/naive-cmyk-to-srgb.d.ts deleted file mode 100644 index 90f321c41..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/oklab-to-oklch.d.ts b/packages/color-helpers/dist/conversions/oklab-to-oklch.d.ts deleted file mode 100644 index 6e6b36d73..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/oklab-to-xyz.d.ts b/packages/color-helpers/dist/conversions/oklab-to-xyz.d.ts deleted file mode 100644 index cd822fd9f..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/oklch-to-oklab.d.ts b/packages/color-helpers/dist/conversions/oklch-to-oklab.d.ts deleted file mode 100644 index e651b5c31..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/srgb-to-hsl.d.ts b/packages/color-helpers/dist/conversions/srgb-to-hsl.d.ts deleted file mode 100644 index 6d7b77e89..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/srgb-to-hwb.d.ts b/packages/color-helpers/dist/conversions/srgb-to-hwb.d.ts deleted file mode 100644 index 4e3078b27..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/srgb-to-luminance.d.ts b/packages/color-helpers/dist/conversions/srgb-to-luminance.d.ts deleted file mode 100644 index 5e8cd84a9..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-lab.d.ts b/packages/color-helpers/dist/conversions/xyz-to-lab.d.ts deleted file mode 100644 index 8ae164cdc..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-lin-2020.d.ts b/packages/color-helpers/dist/conversions/xyz-to-lin-2020.d.ts deleted file mode 100644 index eebe97385..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-lin-a98rgb.d.ts b/packages/color-helpers/dist/conversions/xyz-to-lin-a98rgb.d.ts deleted file mode 100644 index 8e2b3de29..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-lin-p3.d.ts b/packages/color-helpers/dist/conversions/xyz-to-lin-p3.d.ts deleted file mode 100644 index 624ca5827..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-lin-pro-photo.d.ts b/packages/color-helpers/dist/conversions/xyz-to-lin-pro-photo.d.ts deleted file mode 100644 index a07e002ae..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-lin-srgb.d.ts b/packages/color-helpers/dist/conversions/xyz-to-lin-srgb.d.ts deleted file mode 100644 index 087949fbf..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-oklab.d.ts b/packages/color-helpers/dist/conversions/xyz-to-oklab.d.ts deleted file mode 100644 index 68a8f59ea..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-uv.d.ts b/packages/color-helpers/dist/conversions/xyz-to-uv.d.ts deleted file mode 100644 index 576bcca0e..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz-to-xy.d.ts b/packages/color-helpers/dist/conversions/xyz-to-xy.d.ts deleted file mode 100644 index e7a6dee72..000000000 --- a/packages/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/packages/color-helpers/dist/conversions/xyz/index.d.ts b/packages/color-helpers/dist/conversions/xyz/index.d.ts deleted file mode 100644 index b844701c0..000000000 --- a/packages/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/packages/color-helpers/dist/index.d.cts b/packages/color-helpers/dist/index.d.cts new file mode 100644 index 000000000..c046c7e9b --- /dev/null +++ b/packages/color-helpers/dist/index.d.cts @@ -0,0 +1,706 @@ +declare namespace calculations { + type Color = [ + number, + number, + number + ]; + function binarySearchGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color; + function mapGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): 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 + */ + function deltaEOK(reference: Color, sample: Color): number; + function contrast(RGB1: Color, RGB2: Color): number; + /** + * 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 + */ + // A is m x n. B is n x p. product is m x p. + function multiplyMatrices(a: Array> | Array, b: Array> | Array): Array> | Array; +} +declare namespace conversions { + // standard white points, defined by 4-figure CIE x,y chromaticities + const D50: number[]; + const D65: number[]; + type Color = [ + number, + number, + number + ]; + /** + * 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(XYZ: Color): 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 + */ + function D65_to_D50(XYZ: Color): 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). + */ + function gam_2020(RGB: Color): 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). + */ + function gam_a98rgb(RGB: Color): 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). + */ + function gam_P3(RGB: Color): 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). + */ + function gam_ProPhoto(RGB: Color): Color; + function foo(): void; + /** + * 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(RGB: Color): 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 + */ + function HSL_to_sRGB(HSL: 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/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js + */ + function hueToRGB(t1: number, t2: number, hue: number): number; + /** + * @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 + */ + function HWB_to_sRGB(HWB: 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). + */ + function Lab_to_LCH(Lab: Color): Color; + function Lab_to_XYZ(Lab: 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). + */ + function LCH_to_Lab(LCH: Color): 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). + */ + function lin_2020(RGB: Color): 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 + */ + function lin_2020_to_XYZ(rgb: Color): 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). + */ + function lin_a98rgb(RGB: Color): 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 + */ + function lin_a98rgb_to_XYZ(rgb: 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). + */ + 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 + */ + function lin_P3_to_XYZ(rgb: Color): 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). + */ + function lin_ProPhoto(RGB: Color): 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 + */ + function lin_ProPhoto_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 + */ + 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). + */ + function lin_sRGB_to_XYZ(rgb: Color): 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 + */ + function naive_CMYK_to_sRGB(CMYK: [ + number, + number, + number, + number + ]): 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 + */ + function OKLab_to_OKLCH(OKLab: Color): Color; + function OKLab_to_XYZ(OKLab: 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 + */ + function OKLCH_to_OKLab(OKLCH: Color): 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 + */ + function sRGB_to_HSL(RGB: Color): 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 + */ + function sRGB_to_HWB(RGB: Color): 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 + */ + function sRGB_to_luminance(RGB: Color): number; + function XYZ_to_Lab(XYZ: Color): 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). + */ + function XYZ_to_lin_2020(XYZ: Color): 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). + */ + function XYZ_to_lin_a98rgb(XYZ: 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). + */ + function XYZ_to_lin_P3(XYZ: Color): 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 + */ + function XYZ_to_lin_ProPhoto(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). + */ + 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 + */ + function XYZ_to_OKLab(XYZ: Color): 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 + */ + function XYZ_to_uv(XYZ: Color): [ + number, + number + ]; + /** + * 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 + */ + function XYZ_to_xy(XYZ: Color): [ + number, + number + ]; +} +declare namespace utils { + type Color = [ + number, + number, + number + ]; + /** + * @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(color: 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/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ + function inGamut(x: Color): boolean; +} +declare namespace xyz { + type Color = [ + number, + number, + number + ]; + /** + * @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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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] + */ + 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] + */ + function XYZ_D50_to_XYZ_D50(x: Color): Color; +} +type Color = [ + number, + number, + number +]; +// https://www.w3.org/TR/css-color-4/#named-colors +declare const namedColors: Record; +export { calculations, conversions, utils, xyz, namedColors }; +export type { Color }; diff --git a/packages/color-helpers/dist/index.d.mts b/packages/color-helpers/dist/index.d.mts new file mode 100644 index 000000000..c046c7e9b --- /dev/null +++ b/packages/color-helpers/dist/index.d.mts @@ -0,0 +1,706 @@ +declare namespace calculations { + type Color = [ + number, + number, + number + ]; + function binarySearchGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color; + function mapGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): 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 + */ + function deltaEOK(reference: Color, sample: Color): number; + function contrast(RGB1: Color, RGB2: Color): number; + /** + * 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 + */ + // A is m x n. B is n x p. product is m x p. + function multiplyMatrices(a: Array> | Array, b: Array> | Array): Array> | Array; +} +declare namespace conversions { + // standard white points, defined by 4-figure CIE x,y chromaticities + const D50: number[]; + const D65: number[]; + type Color = [ + number, + number, + number + ]; + /** + * 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(XYZ: Color): 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 + */ + function D65_to_D50(XYZ: Color): 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). + */ + function gam_2020(RGB: Color): 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). + */ + function gam_a98rgb(RGB: Color): 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). + */ + function gam_P3(RGB: Color): 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). + */ + function gam_ProPhoto(RGB: Color): Color; + function foo(): void; + /** + * 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(RGB: Color): 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 + */ + function HSL_to_sRGB(HSL: 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/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js + */ + function hueToRGB(t1: number, t2: number, hue: number): number; + /** + * @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 + */ + function HWB_to_sRGB(HWB: 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). + */ + function Lab_to_LCH(Lab: Color): Color; + function Lab_to_XYZ(Lab: 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). + */ + function LCH_to_Lab(LCH: Color): 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). + */ + function lin_2020(RGB: Color): 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 + */ + function lin_2020_to_XYZ(rgb: Color): 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). + */ + function lin_a98rgb(RGB: Color): 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 + */ + function lin_a98rgb_to_XYZ(rgb: 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). + */ + 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 + */ + function lin_P3_to_XYZ(rgb: Color): 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). + */ + function lin_ProPhoto(RGB: Color): 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 + */ + function lin_ProPhoto_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 + */ + 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). + */ + function lin_sRGB_to_XYZ(rgb: Color): 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 + */ + function naive_CMYK_to_sRGB(CMYK: [ + number, + number, + number, + number + ]): 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 + */ + function OKLab_to_OKLCH(OKLab: Color): Color; + function OKLab_to_XYZ(OKLab: 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 + */ + function OKLCH_to_OKLab(OKLCH: Color): 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 + */ + function sRGB_to_HSL(RGB: Color): 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 + */ + function sRGB_to_HWB(RGB: Color): 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 + */ + function sRGB_to_luminance(RGB: Color): number; + function XYZ_to_Lab(XYZ: Color): 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). + */ + function XYZ_to_lin_2020(XYZ: Color): 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). + */ + function XYZ_to_lin_a98rgb(XYZ: 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). + */ + function XYZ_to_lin_P3(XYZ: Color): 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 + */ + function XYZ_to_lin_ProPhoto(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). + */ + 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 + */ + function XYZ_to_OKLab(XYZ: Color): 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 + */ + function XYZ_to_uv(XYZ: Color): [ + number, + number + ]; + /** + * 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 + */ + function XYZ_to_xy(XYZ: Color): [ + number, + number + ]; +} +declare namespace utils { + type Color = [ + number, + number, + number + ]; + /** + * @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(color: 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/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ + function inGamut(x: Color): boolean; +} +declare namespace xyz { + type Color = [ + number, + number, + number + ]; + /** + * @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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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] + */ + 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] + */ + function XYZ_D50_to_XYZ_D50(x: Color): Color; +} +type Color = [ + number, + number, + number +]; +// https://www.w3.org/TR/css-color-4/#named-colors +declare const namedColors: Record; +export { calculations, conversions, utils, xyz, namedColors }; +export type { Color }; diff --git a/packages/color-helpers/dist/index.d.ts b/packages/color-helpers/dist/index.d.ts index 15af8c666..c046c7e9b 100644 --- a/packages/color-helpers/dist/index.d.ts +++ b/packages/color-helpers/dist/index.d.ts @@ -1,6 +1,706 @@ -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'; +declare namespace calculations { + type Color = [ + number, + number, + number + ]; + function binarySearchGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): Color; + function mapGamut(startOKLCH: Color, toDestination: (x: Color) => Color, fromDestination: (x: Color) => Color): 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 + */ + function deltaEOK(reference: Color, sample: Color): number; + function contrast(RGB1: Color, RGB2: Color): number; + /** + * 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 + */ + // A is m x n. B is n x p. product is m x p. + function multiplyMatrices(a: Array> | Array, b: Array> | Array): Array> | Array; +} +declare namespace conversions { + // standard white points, defined by 4-figure CIE x,y chromaticities + const D50: number[]; + const D65: number[]; + type Color = [ + number, + number, + number + ]; + /** + * 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(XYZ: Color): 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 + */ + function D65_to_D50(XYZ: Color): 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). + */ + function gam_2020(RGB: Color): 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). + */ + function gam_a98rgb(RGB: Color): 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). + */ + function gam_P3(RGB: Color): 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). + */ + function gam_ProPhoto(RGB: Color): Color; + function foo(): void; + /** + * 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(RGB: Color): 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 + */ + function HSL_to_sRGB(HSL: 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/utilities.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + * + * @see https://github.com/w3c/csswg-drafts/blob/main/css-color-4/utilities.js + */ + function hueToRGB(t1: number, t2: number, hue: number): number; + /** + * @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 + */ + function HWB_to_sRGB(HWB: 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). + */ + function Lab_to_LCH(Lab: Color): Color; + function Lab_to_XYZ(Lab: 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). + */ + function LCH_to_Lab(LCH: Color): 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). + */ + function lin_2020(RGB: Color): 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 + */ + function lin_2020_to_XYZ(rgb: Color): 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). + */ + function lin_a98rgb(RGB: Color): 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 + */ + function lin_a98rgb_to_XYZ(rgb: 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). + */ + 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 + */ + function lin_P3_to_XYZ(rgb: Color): 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). + */ + function lin_ProPhoto(RGB: Color): 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 + */ + function lin_ProPhoto_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 + */ + 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). + */ + function lin_sRGB_to_XYZ(rgb: Color): 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 + */ + function naive_CMYK_to_sRGB(CMYK: [ + number, + number, + number, + number + ]): 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 + */ + function OKLab_to_OKLCH(OKLab: Color): Color; + function OKLab_to_XYZ(OKLab: 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 + */ + function OKLCH_to_OKLab(OKLCH: Color): 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 + */ + function sRGB_to_HSL(RGB: Color): 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 + */ + function sRGB_to_HWB(RGB: Color): 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 + */ + function sRGB_to_luminance(RGB: Color): number; + function XYZ_to_Lab(XYZ: Color): 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). + */ + function XYZ_to_lin_2020(XYZ: Color): 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). + */ + function XYZ_to_lin_a98rgb(XYZ: 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). + */ + function XYZ_to_lin_P3(XYZ: Color): 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 + */ + function XYZ_to_lin_ProPhoto(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). + */ + 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 + */ + function XYZ_to_OKLab(XYZ: Color): 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 + */ + function XYZ_to_uv(XYZ: Color): [ + number, + number + ]; + /** + * 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 + */ + function XYZ_to_xy(XYZ: Color): [ + number, + number + ]; +} +declare namespace utils { + type Color = [ + number, + number, + number + ]; + /** + * @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(color: 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/map-gamut.js. Copyright © 2022 W3C® (MIT, ERCIM, Keio, Beihang). + */ + function inGamut(x: Color): boolean; +} +declare namespace xyz { + type Color = [ + number, + number, + number + ]; + /** + * @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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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; + */ + 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] + */ + 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] + */ + 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] + */ + function XYZ_D50_to_XYZ_D50(x: Color): Color; +} +type Color = [ + number, + number, + number +]; +// https://www.w3.org/TR/css-color-4/#named-colors +declare const namedColors: Record; +export { calculations, conversions, utils, xyz, namedColors }; +export type { Color }; diff --git a/packages/color-helpers/dist/named-colors/index.d.ts b/packages/color-helpers/dist/named-colors/index.d.ts deleted file mode 100644 index ea04dd4db..000000000 --- a/packages/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/packages/color-helpers/dist/types/color.d.ts b/packages/color-helpers/dist/types/color.d.ts deleted file mode 100644 index 4d390a28c..000000000 --- a/packages/color-helpers/dist/types/color.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type Color = [number, number, number]; diff --git a/packages/color-helpers/dist/utils/clip.d.ts b/packages/color-helpers/dist/utils/clip.d.ts deleted file mode 100644 index f5c617086..000000000 --- a/packages/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/packages/color-helpers/dist/utils/in-gamut.d.ts b/packages/color-helpers/dist/utils/in-gamut.d.ts deleted file mode 100644 index 7dd55becc..000000000 --- a/packages/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/packages/color-helpers/dist/utils/index.d.ts b/packages/color-helpers/dist/utils/index.d.ts deleted file mode 100644 index b73e4598c..000000000 --- a/packages/color-helpers/dist/utils/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './clip'; -export * from './in-gamut'; diff --git a/packages/color-helpers/package.json b/packages/color-helpers/package.json index 7d18aaa3c..c382ad7d7 100644 --- a/packages/color-helpers/package.json +++ b/packages/color-helpers/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/packages/color-helpers/tsconfig.json b/packages/color-helpers/tsconfig.json index 9c958577f..8f14c0f65 100644 --- a/packages/color-helpers/tsconfig.json +++ b/packages/color-helpers/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": [ diff --git a/packages/css-calc/dist/calculation.d.ts b/packages/css-calc/dist/calculation.d.ts deleted file mode 100644 index 963a38544..000000000 --- a/packages/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/packages/css-calc/dist/functions/abs.d.ts b/packages/css-calc/dist/functions/abs.d.ts deleted file mode 100644 index e8971e3b8..000000000 --- a/packages/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/packages/css-calc/dist/functions/acos.d.ts b/packages/css-calc/dist/functions/acos.d.ts deleted file mode 100644 index 964f74704..000000000 --- a/packages/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/packages/css-calc/dist/functions/asin.d.ts b/packages/css-calc/dist/functions/asin.d.ts deleted file mode 100644 index a1465cb7e..000000000 --- a/packages/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/packages/css-calc/dist/functions/atan.d.ts b/packages/css-calc/dist/functions/atan.d.ts deleted file mode 100644 index f800a7bf4..000000000 --- a/packages/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/packages/css-calc/dist/functions/atan2.d.ts b/packages/css-calc/dist/functions/atan2.d.ts deleted file mode 100644 index 651308f69..000000000 --- a/packages/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/packages/css-calc/dist/functions/calc.d.ts b/packages/css-calc/dist/functions/calc.d.ts deleted file mode 100644 index 6eabc645c..000000000 --- a/packages/css-calc/dist/functions/calc.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Calculation } from '../calculation'; -import type { Globals } from '../util/globals'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare const mathFunctions: Map; -declare function abs(absNode: FunctionNode, globals: Globals): Calculation | -1; -export {}; diff --git a/packages/css-calc/dist/functions/clamp.d.ts b/packages/css-calc/dist/functions/clamp.d.ts deleted file mode 100644 index 19a49c4be..000000000 --- a/packages/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/packages/css-calc/dist/functions/cos.d.ts b/packages/css-calc/dist/functions/cos.d.ts deleted file mode 100644 index 74359259b..000000000 --- a/packages/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/packages/css-calc/dist/functions/exp.d.ts b/packages/css-calc/dist/functions/exp.d.ts deleted file mode 100644 index 0d1a64d9c..000000000 --- a/packages/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/packages/css-calc/dist/functions/globals-and-constants.d.ts b/packages/css-calc/dist/functions/globals-and-constants.d.ts deleted file mode 100644 index d968bd11a..000000000 --- a/packages/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/packages/css-calc/dist/functions/hypot.d.ts b/packages/css-calc/dist/functions/hypot.d.ts deleted file mode 100644 index 9d22357fa..000000000 --- a/packages/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/packages/css-calc/dist/functions/log.d.ts b/packages/css-calc/dist/functions/log.d.ts deleted file mode 100644 index 9ed692936..000000000 --- a/packages/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/packages/css-calc/dist/functions/max.d.ts b/packages/css-calc/dist/functions/max.d.ts deleted file mode 100644 index 4181d6e5e..000000000 --- a/packages/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/packages/css-calc/dist/functions/min.d.ts b/packages/css-calc/dist/functions/min.d.ts deleted file mode 100644 index 9f76b07ce..000000000 --- a/packages/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/packages/css-calc/dist/functions/mod.d.ts b/packages/css-calc/dist/functions/mod.d.ts deleted file mode 100644 index 0a6172e1f..000000000 --- a/packages/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/packages/css-calc/dist/functions/pow.d.ts b/packages/css-calc/dist/functions/pow.d.ts deleted file mode 100644 index 33efc20cd..000000000 --- a/packages/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/packages/css-calc/dist/functions/rem.d.ts b/packages/css-calc/dist/functions/rem.d.ts deleted file mode 100644 index ebaacfd1c..000000000 --- a/packages/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/packages/css-calc/dist/functions/result-to-calculation.d.ts b/packages/css-calc/dist/functions/result-to-calculation.d.ts deleted file mode 100644 index 82c182f82..000000000 --- a/packages/css-calc/dist/functions/result-to-calculation.d.ts +++ /dev/null @@ -1,6 +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 numberToCalculation(node: FunctionNode, result: number): Calculation | -1; diff --git a/packages/css-calc/dist/functions/round.d.ts b/packages/css-calc/dist/functions/round.d.ts deleted file mode 100644 index 87b8d78f5..000000000 --- a/packages/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/packages/css-calc/dist/functions/sign.d.ts b/packages/css-calc/dist/functions/sign.d.ts deleted file mode 100644 index 391f3b567..000000000 --- a/packages/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/packages/css-calc/dist/functions/sin.d.ts b/packages/css-calc/dist/functions/sin.d.ts deleted file mode 100644 index 9a0f484b0..000000000 --- a/packages/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/packages/css-calc/dist/functions/sqrt.d.ts b/packages/css-calc/dist/functions/sqrt.d.ts deleted file mode 100644 index a9a43a695..000000000 --- a/packages/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/packages/css-calc/dist/functions/tan.d.ts b/packages/css-calc/dist/functions/tan.d.ts deleted file mode 100644 index 6294895d6..000000000 --- a/packages/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/packages/css-calc/dist/options.d.ts b/packages/css-calc/dist/index.d.cts similarity index 54% rename from packages/css-calc/dist/options.d.ts rename to packages/css-calc/dist/index.d.cts index f24a05fd4..633b2b07a 100644 --- a/packages/css-calc/dist/options.d.ts +++ b/packages/css-calc/dist/index.d.cts @@ -1,5 +1,7 @@ -import { GlobalsWithStrings } from './util/globals'; -export type conversionOptions = { +import { TokenDimension, TokenNumber, TokenPercentage } from "@csstools/css-tokenizer"; +import { ComponentValue } from '@csstools/css-parser-algorithms'; +type GlobalsWithStrings = Map; +type conversionOptions = { /** * Pass global values as a map of key value pairs. */ @@ -21,3 +23,8 @@ export type conversionOptions = { */ toCanonicalUnits?: boolean; }; +declare function calc(css: string, options?: conversionOptions): string; +declare function calcFromComponentValues(componentValuesList: Array>, options?: conversionOptions): ComponentValue[][]; +declare const mathFunctionNames: Set; +export type { conversionOptions }; +export { calc, calcFromComponentValues, mathFunctionNames }; diff --git a/packages/css-calc/dist/index.d.mts b/packages/css-calc/dist/index.d.mts new file mode 100644 index 000000000..633b2b07a --- /dev/null +++ b/packages/css-calc/dist/index.d.mts @@ -0,0 +1,30 @@ +import { TokenDimension, TokenNumber, TokenPercentage } from "@csstools/css-tokenizer"; +import { ComponentValue } from '@csstools/css-parser-algorithms'; +type GlobalsWithStrings = Map; +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; +}; +declare function calc(css: string, options?: conversionOptions): string; +declare function calcFromComponentValues(componentValuesList: Array>, options?: conversionOptions): ComponentValue[][]; +declare const mathFunctionNames: Set; +export type { conversionOptions }; +export { calc, calcFromComponentValues, mathFunctionNames }; diff --git a/packages/css-calc/dist/index.d.ts b/packages/css-calc/dist/index.d.ts index b7e6856b8..633b2b07a 100644 --- a/packages/css-calc/dist/index.d.ts +++ b/packages/css-calc/dist/index.d.ts @@ -1,6 +1,30 @@ -export type { conversionOptions } from './options'; -import type { conversionOptions } from './options'; +import { TokenDimension, TokenNumber, TokenPercentage } from "@csstools/css-tokenizer"; import { ComponentValue } from '@csstools/css-parser-algorithms'; -export declare function calc(css: string, options?: conversionOptions): string; -export declare function calcFromComponentValues(componentValuesList: Array>, options?: conversionOptions): ComponentValue[][]; -export declare const mathFunctionNames: Set; +type GlobalsWithStrings = Map; +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; +}; +declare function calc(css: string, options?: conversionOptions): string; +declare function calcFromComponentValues(componentValuesList: Array>, options?: conversionOptions): ComponentValue[][]; +declare const mathFunctionNames: Set; +export type { conversionOptions }; +export { calc, calcFromComponentValues, mathFunctionNames }; diff --git a/packages/css-calc/dist/operation/addition.d.ts b/packages/css-calc/dist/operation/addition.d.ts deleted file mode 100644 index 70e02cfd4..000000000 --- a/packages/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/packages/css-calc/dist/operation/division.d.ts b/packages/css-calc/dist/operation/division.d.ts deleted file mode 100644 index 5d6b01fdd..000000000 --- a/packages/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/packages/css-calc/dist/operation/multiplication.d.ts b/packages/css-calc/dist/operation/multiplication.d.ts deleted file mode 100644 index d48978d65..000000000 --- a/packages/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/packages/css-calc/dist/operation/operation.d.ts b/packages/css-calc/dist/operation/operation.d.ts deleted file mode 100644 index aed9e0e38..000000000 --- a/packages/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/packages/css-calc/dist/operation/subtraction.d.ts b/packages/css-calc/dist/operation/subtraction.d.ts deleted file mode 100644 index 0ac3f6bed..000000000 --- a/packages/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/packages/css-calc/dist/operation/unary.d.ts b/packages/css-calc/dist/operation/unary.d.ts deleted file mode 100644 index b27463ecb..000000000 --- a/packages/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/packages/css-calc/dist/unit-conversions/canonical.d.ts b/packages/css-calc/dist/unit-conversions/canonical.d.ts deleted file mode 100644 index 1c593d502..000000000 --- a/packages/css-calc/dist/unit-conversions/canonical.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const canonicalUnits: Record; diff --git a/packages/css-calc/dist/unit-conversions/cm.d.ts b/packages/css-calc/dist/unit-conversions/cm.d.ts deleted file mode 100644 index 030a42d8a..000000000 --- a/packages/css-calc/dist/unit-conversions/cm.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_cm: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/deg.d.ts b/packages/css-calc/dist/unit-conversions/deg.d.ts deleted file mode 100644 index 7e0fb6c0a..000000000 --- a/packages/css-calc/dist/unit-conversions/deg.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_deg: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/grad.d.ts b/packages/css-calc/dist/unit-conversions/grad.d.ts deleted file mode 100644 index 9423ffcfa..000000000 --- a/packages/css-calc/dist/unit-conversions/grad.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_grad: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/hz.d.ts b/packages/css-calc/dist/unit-conversions/hz.d.ts deleted file mode 100644 index 9957a80e1..000000000 --- a/packages/css-calc/dist/unit-conversions/hz.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_hz: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/in.d.ts b/packages/css-calc/dist/unit-conversions/in.d.ts deleted file mode 100644 index 5bf4ed817..000000000 --- a/packages/css-calc/dist/unit-conversions/in.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_in: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/index.d.ts b/packages/css-calc/dist/unit-conversions/index.d.ts deleted file mode 100644 index b93c1175e..000000000 --- a/packages/css-calc/dist/unit-conversions/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { CSSToken } from '@csstools/css-tokenizer'; -export declare function convertUnit(a: CSSToken, b: T): T; -export declare function toCanonicalUnit(a: T): T; diff --git a/packages/css-calc/dist/unit-conversions/khz.d.ts b/packages/css-calc/dist/unit-conversions/khz.d.ts deleted file mode 100644 index c1df1229a..000000000 --- a/packages/css-calc/dist/unit-conversions/khz.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_khz: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/mm.d.ts b/packages/css-calc/dist/unit-conversions/mm.d.ts deleted file mode 100644 index 570b24476..000000000 --- a/packages/css-calc/dist/unit-conversions/mm.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_mm: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/ms.d.ts b/packages/css-calc/dist/unit-conversions/ms.d.ts deleted file mode 100644 index 68d9231d3..000000000 --- a/packages/css-calc/dist/unit-conversions/ms.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_ms: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/pc.d.ts b/packages/css-calc/dist/unit-conversions/pc.d.ts deleted file mode 100644 index d13b7da9b..000000000 --- a/packages/css-calc/dist/unit-conversions/pc.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_pc: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/pt.d.ts b/packages/css-calc/dist/unit-conversions/pt.d.ts deleted file mode 100644 index 09407c956..000000000 --- a/packages/css-calc/dist/unit-conversions/pt.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_pt: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/px.d.ts b/packages/css-calc/dist/unit-conversions/px.d.ts deleted file mode 100644 index 641ea77f5..000000000 --- a/packages/css-calc/dist/unit-conversions/px.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_px: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/q.d.ts b/packages/css-calc/dist/unit-conversions/q.d.ts deleted file mode 100644 index 5862e51de..000000000 --- a/packages/css-calc/dist/unit-conversions/q.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_q: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/rad.d.ts b/packages/css-calc/dist/unit-conversions/rad.d.ts deleted file mode 100644 index 70faf8e9e..000000000 --- a/packages/css-calc/dist/unit-conversions/rad.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_rad: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/s.d.ts b/packages/css-calc/dist/unit-conversions/s.d.ts deleted file mode 100644 index 8240e359c..000000000 --- a/packages/css-calc/dist/unit-conversions/s.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_s: Map number>; diff --git a/packages/css-calc/dist/unit-conversions/turn.d.ts b/packages/css-calc/dist/unit-conversions/turn.d.ts deleted file mode 100644 index e721ff8e2..000000000 --- a/packages/css-calc/dist/unit-conversions/turn.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare const convert_turn: Map number>; diff --git a/packages/css-calc/dist/util/canonical-unit.d.ts b/packages/css-calc/dist/util/canonical-unit.d.ts deleted file mode 100644 index 49f5e457e..000000000 --- a/packages/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/packages/css-calc/dist/util/globals.d.ts b/packages/css-calc/dist/util/globals.d.ts deleted file mode 100644 index c9e43b74f..000000000 --- a/packages/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/packages/css-calc/dist/util/infinity.d.ts b/packages/css-calc/dist/util/infinity.d.ts deleted file mode 100644 index 588d3e131..000000000 --- a/packages/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/packages/css-calc/dist/util/kind-of-number.d.ts b/packages/css-calc/dist/util/kind-of-number.d.ts deleted file mode 100644 index dac78981a..000000000 --- a/packages/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/packages/css-calc/dist/util/minus-zero.d.ts b/packages/css-calc/dist/util/minus-zero.d.ts deleted file mode 100644 index 67b9e553f..000000000 --- a/packages/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/packages/css-calc/dist/util/nan.d.ts b/packages/css-calc/dist/util/nan.d.ts deleted file mode 100644 index a7e03354a..000000000 --- a/packages/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/packages/css-calc/dist/util/patch-result.d.ts b/packages/css-calc/dist/util/patch-result.d.ts deleted file mode 100644 index 03330b3e4..000000000 --- a/packages/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/packages/css-calc/dist/util/precision.d.ts b/packages/css-calc/dist/util/precision.d.ts deleted file mode 100644 index 424909c1d..000000000 --- a/packages/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/packages/css-calc/dist/util/to-lower-case-a-z.d.ts b/packages/css-calc/dist/util/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e7..000000000 --- a/packages/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/packages/css-calc/package.json b/packages/css-calc/package.json index 3744fe1e9..09e616456 100644 --- a/packages/css-calc/package.json +++ b/packages/css-calc/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/packages/css-calc/tsconfig.json b/packages/css-calc/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/packages/css-calc/tsconfig.json +++ b/packages/css-calc/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/packages/css-color-parser/dist/color-data.d.ts b/packages/css-color-parser/dist/color-data.d.ts deleted file mode 100644 index 1b41b4beb..000000000 --- a/packages/css-color-parser/dist/color-data.d.ts +++ /dev/null @@ -1,61 +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 { - /** 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 declare function colorData_to_XYZ_D50(colorData: ColorData): ColorData; -export declare function colorDataTo(colorData: ColorData, toNotation: ColorNotation): ColorData; -export declare function convertPowerlessComponentsToZeroValuesForDisplay(a: Color, colorNotation: ColorNotation): Color; -export declare function normalizeRelativeColorDataChannels(x: ColorData): Map; -export declare function noneToZeroInRelativeColorDataChannels(x: Map): Map; -/** - * 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; -/** - * 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; diff --git a/packages/css-color-parser/dist/color-notation.d.ts b/packages/css-color-parser/dist/color-notation.d.ts deleted file mode 100644 index 2349b20fd..000000000 --- a/packages/css-color-parser/dist/color-notation.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -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" -} diff --git a/packages/css-color-parser/dist/color-parser.d.ts b/packages/css-color-parser/dist/color-parser.d.ts deleted file mode 100644 index 325c0657b..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/color-keyword.d.ts b/packages/css-color-parser/dist/functions/color-keyword.d.ts deleted file mode 100644 index 6652208f2..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/color-mix.d.ts b/packages/css-color-parser/dist/functions/color-mix.d.ts deleted file mode 100644 index 8fc6aeda8..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/color-normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/color-normalize-channel-values.d.ts deleted file mode 100644 index 51b6624d4..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/color.d.ts b/packages/css-color-parser/dist/functions/color.d.ts deleted file mode 100644 index 34b95e2c3..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/hex.d.ts b/packages/css-color-parser/dist/functions/hex.d.ts deleted file mode 100644 index 8b66473e0..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/hsl-normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/hsl-normalize-channel-values.d.ts deleted file mode 100644 index 068bcae7e..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/hsl.d.ts b/packages/css-color-parser/dist/functions/hsl.d.ts deleted file mode 100644 index 919acdda6..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/hue-normalize-channel-value.d.ts b/packages/css-color-parser/dist/functions/hue-normalize-channel-value.d.ts deleted file mode 100644 index 41a96c643..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/hwb-normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/hwb-normalize-channel-values.d.ts deleted file mode 100644 index 81da6aacb..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/hwb.d.ts b/packages/css-color-parser/dist/functions/hwb.d.ts deleted file mode 100644 index 1ddffe98d..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/lab-normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/lab-normalize-channel-values.d.ts deleted file mode 100644 index 73587504c..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/lab.d.ts b/packages/css-color-parser/dist/functions/lab.d.ts deleted file mode 100644 index fbbf35aad..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/lch-normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/lch-normalize-channel-values.d.ts deleted file mode 100644 index a2227e446..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/lch.d.ts b/packages/css-color-parser/dist/functions/lch.d.ts deleted file mode 100644 index 917889031..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/named-color.d.ts b/packages/css-color-parser/dist/functions/named-color.d.ts deleted file mode 100644 index 376a093a6..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/normalize-channel-values.d.ts deleted file mode 100644 index c32172fdf..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/normalize.d.ts b/packages/css-color-parser/dist/functions/normalize.d.ts deleted file mode 100644 index 0b57af5e4..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/oklab-normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/oklab-normalize-channel-values.d.ts deleted file mode 100644 index 97b827928..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/oklab.d.ts b/packages/css-color-parser/dist/functions/oklab.d.ts deleted file mode 100644 index 96e03847b..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/oklch-normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/oklch-normalize-channel-values.d.ts deleted file mode 100644 index afd514b38..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/oklch.d.ts b/packages/css-color-parser/dist/functions/oklch.d.ts deleted file mode 100644 index d70197e74..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/rgb-normalize-channel-values.d.ts b/packages/css-color-parser/dist/functions/rgb-normalize-channel-values.d.ts deleted file mode 100644 index eb3e89bcf..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/rgb.d.ts b/packages/css-color-parser/dist/functions/rgb.d.ts deleted file mode 100644 index c4aacca10..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/three-channel-legacy-syntax.d.ts b/packages/css-color-parser/dist/functions/three-channel-legacy-syntax.d.ts deleted file mode 100644 index 5bfe8c385..000000000 --- a/packages/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/packages/css-color-parser/dist/functions/three-channel-space-separated.d.ts b/packages/css-color-parser/dist/functions/three-channel-space-separated.d.ts deleted file mode 100644 index 8fb7e41b7..000000000 --- a/packages/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/packages/css-color-parser/dist/gamut-mapping/p3.d.ts b/packages/css-color-parser/dist/gamut-mapping/p3.d.ts deleted file mode 100644 index d0130b521..000000000 --- a/packages/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/packages/css-color-parser/dist/gamut-mapping/srgb.d.ts b/packages/css-color-parser/dist/gamut-mapping/srgb.d.ts deleted file mode 100644 index 87b3ad800..000000000 --- a/packages/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/packages/css-color-parser/dist/index.d.cts b/packages/css-color-parser/dist/index.d.cts new file mode 100644 index 000000000..37aa93f6d --- /dev/null +++ b/packages/css-color-parser/dist/index.d.cts @@ -0,0 +1,125 @@ +import { Color } from "@csstools/color-helpers"; +import { ComponentValue, FunctionNode } from "@csstools/css-parser-algorithms"; +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" +} +type ColorData = { + colorNotation: ColorNotation; + channels: Color; + alpha: number | ComponentValue; + syntaxFlags: Set; +}; +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" +} +declare function colorDataTo(colorData: ColorData, toNotation: ColorNotation): ColorData; +/** + * 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. + */ +declare function colorDataFitsRGB_Gamut(x: ColorData): boolean; +/** + * 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. + */ +declare function colorDataFitsDisplayP3_Gamut(x: ColorData): boolean; +/** + * 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. + */ +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. + */ +declare function serializeRGB(color: ColorData, gamutMapping?: boolean): FunctionNode; +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. + */ +declare function serializeOKLCH(color: ColorData): FunctionNode; +/** + * 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. + */ +declare function color(colorNode: ComponentValue): ColorData | false; +export type { ColorData }; +export { ColorNotation, SyntaxFlag, colorDataTo, colorDataFitsRGB_Gamut, colorDataFitsDisplayP3_Gamut, serializeP3, serializeRGB, serializeHSL, serializeOKLCH, color }; diff --git a/packages/css-color-parser/dist/index.d.mts b/packages/css-color-parser/dist/index.d.mts new file mode 100644 index 000000000..37aa93f6d --- /dev/null +++ b/packages/css-color-parser/dist/index.d.mts @@ -0,0 +1,125 @@ +import { Color } from "@csstools/color-helpers"; +import { ComponentValue, FunctionNode } from "@csstools/css-parser-algorithms"; +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" +} +type ColorData = { + colorNotation: ColorNotation; + channels: Color; + alpha: number | ComponentValue; + syntaxFlags: Set; +}; +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" +} +declare function colorDataTo(colorData: ColorData, toNotation: ColorNotation): ColorData; +/** + * 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. + */ +declare function colorDataFitsRGB_Gamut(x: ColorData): boolean; +/** + * 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. + */ +declare function colorDataFitsDisplayP3_Gamut(x: ColorData): boolean; +/** + * 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. + */ +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. + */ +declare function serializeRGB(color: ColorData, gamutMapping?: boolean): FunctionNode; +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. + */ +declare function serializeOKLCH(color: ColorData): FunctionNode; +/** + * 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. + */ +declare function color(colorNode: ComponentValue): ColorData | false; +export type { ColorData }; +export { ColorNotation, SyntaxFlag, colorDataTo, colorDataFitsRGB_Gamut, colorDataFitsDisplayP3_Gamut, serializeP3, serializeRGB, serializeHSL, serializeOKLCH, color }; diff --git a/packages/css-color-parser/dist/index.d.ts b/packages/css-color-parser/dist/index.d.ts index 18c8e03c4..37aa93f6d 100644 --- a/packages/css-color-parser/dist/index.d.ts +++ b/packages/css-color-parser/dist/index.d.ts @@ -1,17 +1,125 @@ -import type { ColorData } from './color-data'; -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 { serializeHSL } from './serialize/hsl'; -export { serializeOKLCH } from './serialize/oklch'; +import { Color } from "@csstools/color-helpers"; +import { ComponentValue, FunctionNode } from "@csstools/css-parser-algorithms"; +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" +} +type ColorData = { + colorNotation: ColorNotation; + channels: Color; + alpha: number | ComponentValue; + syntaxFlags: Set; +}; +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" +} +declare function colorDataTo(colorData: ColorData, toNotation: ColorNotation): ColorData; +/** + * 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. + */ +declare function colorDataFitsRGB_Gamut(x: ColorData): boolean; +/** + * 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. + */ +declare function colorDataFitsDisplayP3_Gamut(x: ColorData): boolean; +/** + * 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. + */ +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. + */ +declare function serializeRGB(color: ColorData, gamutMapping?: boolean): FunctionNode; +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. + */ +declare function serializeOKLCH(color: ColorData): FunctionNode; /** * 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; +declare function color(colorNode: ComponentValue): ColorData | false; +export type { ColorData }; +export { ColorNotation, SyntaxFlag, colorDataTo, colorDataFitsRGB_Gamut, colorDataFitsDisplayP3_Gamut, serializeP3, serializeRGB, serializeHSL, serializeOKLCH, color }; diff --git a/packages/css-color-parser/dist/serialize/hsl.d.ts b/packages/css-color-parser/dist/serialize/hsl.d.ts deleted file mode 100644 index cce037c95..000000000 --- a/packages/css-color-parser/dist/serialize/hsl.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ColorData } from '../color-data'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function serializeHSL(color: ColorData, gamutMapping?: boolean): FunctionNode; diff --git a/packages/css-color-parser/dist/serialize/oklch.d.ts b/packages/css-color-parser/dist/serialize/oklch.d.ts deleted file mode 100644 index 97de044a3..000000000 --- a/packages/css-color-parser/dist/serialize/oklch.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { ColorData } from '../color-data'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -/** - * 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; diff --git a/packages/css-color-parser/dist/serialize/p3.d.ts b/packages/css-color-parser/dist/serialize/p3.d.ts deleted file mode 100644 index c5a0ba9a1..000000000 --- a/packages/css-color-parser/dist/serialize/p3.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ColorData } from '../color-data'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -/** - * 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; diff --git a/packages/css-color-parser/dist/serialize/rgb.d.ts b/packages/css-color-parser/dist/serialize/rgb.d.ts deleted file mode 100644 index 1da6080b6..000000000 --- a/packages/css-color-parser/dist/serialize/rgb.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { ColorData } from '../color-data'; -import { FunctionNode } from '@csstools/css-parser-algorithms'; -/** - * 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; diff --git a/packages/css-color-parser/dist/serialize/to-precision.d.ts b/packages/css-color-parser/dist/serialize/to-precision.d.ts deleted file mode 100644 index 1bcc6b272..000000000 --- a/packages/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/packages/css-color-parser/dist/serialize/with-alpha.d.ts b/packages/css-color-parser/dist/serialize/with-alpha.d.ts deleted file mode 100644 index c214a9ccc..000000000 --- a/packages/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/packages/css-color-parser/dist/util/to-lower-case-a-z.d.ts b/packages/css-color-parser/dist/util/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e7..000000000 --- a/packages/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/packages/css-color-parser/package.json b/packages/css-color-parser/package.json index 6ef632c92..19966b71e 100644 --- a/packages/css-color-parser/package.json +++ b/packages/css-color-parser/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/packages/css-color-parser/tsconfig.json b/packages/css-color-parser/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/packages/css-color-parser/tsconfig.json +++ b/packages/css-color-parser/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/packages/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts b/packages/css-parser-algorithms/dist/consume/consume-component-block-function.d.ts deleted file mode 100644 index 59cdf944a..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/index.d.cts b/packages/css-parser-algorithms/dist/index.d.cts new file mode 100644 index 000000000..b813d7b44 --- /dev/null +++ b/packages/css-parser-algorithms/dist/index.d.cts @@ -0,0 +1,162 @@ +import { CSSToken, TokenFunction, ParseError } from "@csstools/css-tokenizer"; +type Context = { + onParseError: (error: ParseError) => void; +}; +declare enum ComponentValueType { + Function = "function", + SimpleBlock = "simple-block", + Whitespace = "whitespace", + Comment = "comment", + Token = "token" +} +type ContainerNode = FunctionNode | SimpleBlockNode; +type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode; +// https://www.w3.org/TR/css-syntax-3/#consume-a-component-value +declare function consumeComponentValue(ctx: Context, tokens: Array): { + advance: number; + node: ComponentValue; +}; +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; +} +// https://www.w3.org/TR/css-syntax-3/#consume-function +declare function consumeFunction(ctx: Context, tokens: Array): { + advance: number; + node: FunctionNode; +}; +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 */ +declare function consumeSimpleBlock(ctx: Context, tokens: Array): { + advance: number; + node: SimpleBlockNode; +}; +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; +} +declare function consumeWhitespace(ctx: Context, tokens: Array): { + advance: number; + node: WhitespaceNode; +}; +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; +} +declare function consumeComment(ctx: Context, tokens: Array): { + advance: number; + node: CommentNode; +}; +declare function consumeAllCommentsAndWhitespace(ctx: Context, tokens: Array): { + advance: number; + nodes: Array; +}; +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; +} +declare function parseComponentValue(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue | undefined; +declare function parseListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[]; +declare function parseCommaSeparatedListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[][]; +interface walkable { + walk(cb: (entry: { + node: Array | unknown; + parent: unknown; + }, index: number | string) => boolean | void): false | undefined; +} +declare function gatherNodeAncestry(node: walkable): Map; +declare function replaceComponentValues(componentValuesList: Array>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][]; +declare function stringify(componentValueLists: Array>): string; +declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode; +declare function isFunctionNode(x: unknown): x is FunctionNode; +declare function isWhitespaceNode(x: unknown): x is WhitespaceNode; +declare function isCommentNode(x: unknown): x is CommentNode; +declare function isTokenNode(x: unknown): x is TokenNode; +interface TokenConvertible { + tokens(): Array; +} +/** + * Returns the start and end index of a node in the CSS source string. + */ +declare function sourceIndices(x: TokenConvertible | Array): [ + number, + number +]; +export { ContainerNode, ComponentValue, consumeComponentValue, FunctionNode, consumeFunction, SimpleBlockNode, consumeSimpleBlock, WhitespaceNode, consumeWhitespace, CommentNode, consumeComment, consumeAllCommentsAndWhitespace, TokenNode, parseComponentValue, parseListOfComponentValues, parseCommaSeparatedListOfComponentValues, gatherNodeAncestry, replaceComponentValues, stringify, ComponentValueType, isCommentNode, isFunctionNode, isSimpleBlockNode, isTokenNode, isWhitespaceNode, sourceIndices }; diff --git a/packages/css-parser-algorithms/dist/index.d.mts b/packages/css-parser-algorithms/dist/index.d.mts new file mode 100644 index 000000000..b813d7b44 --- /dev/null +++ b/packages/css-parser-algorithms/dist/index.d.mts @@ -0,0 +1,162 @@ +import { CSSToken, TokenFunction, ParseError } from "@csstools/css-tokenizer"; +type Context = { + onParseError: (error: ParseError) => void; +}; +declare enum ComponentValueType { + Function = "function", + SimpleBlock = "simple-block", + Whitespace = "whitespace", + Comment = "comment", + Token = "token" +} +type ContainerNode = FunctionNode | SimpleBlockNode; +type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode; +// https://www.w3.org/TR/css-syntax-3/#consume-a-component-value +declare function consumeComponentValue(ctx: Context, tokens: Array): { + advance: number; + node: ComponentValue; +}; +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; +} +// https://www.w3.org/TR/css-syntax-3/#consume-function +declare function consumeFunction(ctx: Context, tokens: Array): { + advance: number; + node: FunctionNode; +}; +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 */ +declare function consumeSimpleBlock(ctx: Context, tokens: Array): { + advance: number; + node: SimpleBlockNode; +}; +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; +} +declare function consumeWhitespace(ctx: Context, tokens: Array): { + advance: number; + node: WhitespaceNode; +}; +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; +} +declare function consumeComment(ctx: Context, tokens: Array): { + advance: number; + node: CommentNode; +}; +declare function consumeAllCommentsAndWhitespace(ctx: Context, tokens: Array): { + advance: number; + nodes: Array; +}; +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; +} +declare function parseComponentValue(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue | undefined; +declare function parseListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[]; +declare function parseCommaSeparatedListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[][]; +interface walkable { + walk(cb: (entry: { + node: Array | unknown; + parent: unknown; + }, index: number | string) => boolean | void): false | undefined; +} +declare function gatherNodeAncestry(node: walkable): Map; +declare function replaceComponentValues(componentValuesList: Array>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][]; +declare function stringify(componentValueLists: Array>): string; +declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode; +declare function isFunctionNode(x: unknown): x is FunctionNode; +declare function isWhitespaceNode(x: unknown): x is WhitespaceNode; +declare function isCommentNode(x: unknown): x is CommentNode; +declare function isTokenNode(x: unknown): x is TokenNode; +interface TokenConvertible { + tokens(): Array; +} +/** + * Returns the start and end index of a node in the CSS source string. + */ +declare function sourceIndices(x: TokenConvertible | Array): [ + number, + number +]; +export { ContainerNode, ComponentValue, consumeComponentValue, FunctionNode, consumeFunction, SimpleBlockNode, consumeSimpleBlock, WhitespaceNode, consumeWhitespace, CommentNode, consumeComment, consumeAllCommentsAndWhitespace, TokenNode, parseComponentValue, parseListOfComponentValues, parseCommaSeparatedListOfComponentValues, gatherNodeAncestry, replaceComponentValues, stringify, ComponentValueType, isCommentNode, isFunctionNode, isSimpleBlockNode, isTokenNode, isWhitespaceNode, sourceIndices }; diff --git a/packages/css-parser-algorithms/dist/index.d.ts b/packages/css-parser-algorithms/dist/index.d.ts index 47c3cec9e..b813d7b44 100644 --- a/packages/css-parser-algorithms/dist/index.d.ts +++ b/packages/css-parser-algorithms/dist/index.d.ts @@ -1,10 +1,162 @@ -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, TokenFunction, ParseError } from "@csstools/css-tokenizer"; +type Context = { + onParseError: (error: ParseError) => void; +}; +declare enum ComponentValueType { + Function = "function", + SimpleBlock = "simple-block", + Whitespace = "whitespace", + Comment = "comment", + Token = "token" +} +type ContainerNode = FunctionNode | SimpleBlockNode; +type ComponentValue = FunctionNode | SimpleBlockNode | WhitespaceNode | CommentNode | TokenNode; +// https://www.w3.org/TR/css-syntax-3/#consume-a-component-value +declare function consumeComponentValue(ctx: Context, tokens: Array): { + advance: number; + node: ComponentValue; +}; +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; +} +// https://www.w3.org/TR/css-syntax-3/#consume-function +declare function consumeFunction(ctx: Context, tokens: Array): { + advance: number; + node: FunctionNode; +}; +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 */ +declare function consumeSimpleBlock(ctx: Context, tokens: Array): { + advance: number; + node: SimpleBlockNode; +}; +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; +} +declare function consumeWhitespace(ctx: Context, tokens: Array): { + advance: number; + node: WhitespaceNode; +}; +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; +} +declare function consumeComment(ctx: Context, tokens: Array): { + advance: number; + node: CommentNode; +}; +declare function consumeAllCommentsAndWhitespace(ctx: Context, tokens: Array): { + advance: number; + nodes: Array; +}; +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; +} +declare function parseComponentValue(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue | undefined; +declare function parseListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[]; +declare function parseCommaSeparatedListOfComponentValues(tokens: Array, options?: { + onParseError?: (error: ParseError) => void; +}): ComponentValue[][]; +interface walkable { + walk(cb: (entry: { + node: Array | unknown; + parent: unknown; + }, index: number | string) => boolean | void): false | undefined; +} +declare function gatherNodeAncestry(node: walkable): Map; +declare function replaceComponentValues(componentValuesList: Array>, replaceWith: (componentValue: ComponentValue) => ComponentValue | void): ComponentValue[][]; +declare function stringify(componentValueLists: Array>): string; +declare function isSimpleBlockNode(x: unknown): x is SimpleBlockNode; +declare function isFunctionNode(x: unknown): x is FunctionNode; +declare function isWhitespaceNode(x: unknown): x is WhitespaceNode; +declare function isCommentNode(x: unknown): x is CommentNode; +declare function isTokenNode(x: unknown): x is TokenNode; +interface TokenConvertible { + tokens(): Array; +} +/** + * Returns the start and end index of a node in the CSS source string. + */ +declare function sourceIndices(x: TokenConvertible | Array): [ + number, + number +]; +export { ContainerNode, ComponentValue, consumeComponentValue, FunctionNode, consumeFunction, SimpleBlockNode, consumeSimpleBlock, WhitespaceNode, consumeWhitespace, CommentNode, consumeComment, consumeAllCommentsAndWhitespace, TokenNode, parseComponentValue, parseListOfComponentValues, parseCommaSeparatedListOfComponentValues, gatherNodeAncestry, replaceComponentValues, stringify, ComponentValueType, isCommentNode, isFunctionNode, isSimpleBlockNode, isTokenNode, isWhitespaceNode, sourceIndices }; diff --git a/packages/css-parser-algorithms/dist/interfaces/context.d.ts b/packages/css-parser-algorithms/dist/interfaces/context.d.ts deleted file mode 100644 index dc246e000..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts b/packages/css-parser-algorithms/dist/parse/parse-comma-separated-list-of-component-values.d.ts deleted file mode 100644 index 67dff1d04..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/parse/parse-component-value.d.ts b/packages/css-parser-algorithms/dist/parse/parse-component-value.d.ts deleted file mode 100644 index 2961290f9..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts b/packages/css-parser-algorithms/dist/parse/parse-list-of-component-values.d.ts deleted file mode 100644 index 737f554d2..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/util/component-value-type.d.ts b/packages/css-parser-algorithms/dist/util/component-value-type.d.ts deleted file mode 100644 index eda7ee93c..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/util/node-ancestry.d.ts b/packages/css-parser-algorithms/dist/util/node-ancestry.d.ts deleted file mode 100644 index a6a63303f..000000000 --- a/packages/css-parser-algorithms/dist/util/node-ancestry.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -interface walkable { - walk(cb: (entry: { - node: Array | unknown; - parent: unknown; - }, index: number | string) => boolean | void): false | undefined; -} -export declare function gatherNodeAncestry(node: walkable): Map; -export {}; diff --git a/packages/css-parser-algorithms/dist/util/replace-component-values.d.ts b/packages/css-parser-algorithms/dist/util/replace-component-values.d.ts deleted file mode 100644 index 774051c6d..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/util/source-indices.d.ts b/packages/css-parser-algorithms/dist/util/source-indices.d.ts deleted file mode 100644 index 92d124bef..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/util/stringify.d.ts b/packages/css-parser-algorithms/dist/util/stringify.d.ts deleted file mode 100644 index 6ab4140cf..000000000 --- a/packages/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/packages/css-parser-algorithms/dist/util/type-predicates.d.ts b/packages/css-parser-algorithms/dist/util/type-predicates.d.ts deleted file mode 100644 index 896d3036b..000000000 --- a/packages/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/packages/css-parser-algorithms/package.json b/packages/css-parser-algorithms/package.json index 009c0560d..df2baf088 100644 --- a/packages/css-parser-algorithms/package.json +++ b/packages/css-parser-algorithms/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/packages/css-parser-algorithms/tsconfig.json b/packages/css-parser-algorithms/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/packages/css-parser-algorithms/tsconfig.json +++ b/packages/css-parser-algorithms/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/packages/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts b/packages/css-tokenizer/dist/checks/four-code-points-would-start-cdo.d.ts deleted file mode 100644 index a9243f63a..000000000 --- a/packages/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/packages/css-tokenizer/dist/checks/matches-url-ident.d.ts b/packages/css-tokenizer/dist/checks/matches-url-ident.d.ts deleted file mode 100644 index 6af31e4e6..000000000 --- a/packages/css-tokenizer/dist/checks/matches-url-ident.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function checkIfCodePointsMatchURLIdent(codePoints: Array): boolean; diff --git a/packages/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts b/packages/css-tokenizer/dist/checks/three-code-points-would-start-cdc.d.ts deleted file mode 100644 index 09bd23237..000000000 --- a/packages/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/packages/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts b/packages/css-tokenizer/dist/checks/three-code-points-would-start-ident-sequence.d.ts deleted file mode 100644 index d48323bb9..000000000 --- a/packages/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/packages/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts b/packages/css-tokenizer/dist/checks/three-code-points-would-start-number.d.ts deleted file mode 100644 index 9c428a459..000000000 --- a/packages/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/packages/css-tokenizer/dist/checks/three-code-points-would-start-unicode-range.d.ts b/packages/css-tokenizer/dist/checks/three-code-points-would-start-unicode-range.d.ts deleted file mode 100644 index 46c91076a..000000000 --- a/packages/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/packages/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts b/packages/css-tokenizer/dist/checks/two-code-points-are-valid-escape.d.ts deleted file mode 100644 index 99d954fde..000000000 --- a/packages/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/packages/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts b/packages/css-tokenizer/dist/checks/two-code-points-start-comment.d.ts deleted file mode 100644 index 9d9fd4957..000000000 --- a/packages/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/packages/css-tokenizer/dist/code-points/code-points.d.ts b/packages/css-tokenizer/dist/code-points/code-points.d.ts deleted file mode 100644 index 3dcc47784..000000000 --- a/packages/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/packages/css-tokenizer/dist/code-points/ranges.d.ts b/packages/css-tokenizer/dist/code-points/ranges.d.ts deleted file mode 100644 index a1c442430..000000000 --- a/packages/css-tokenizer/dist/code-points/ranges.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -export declare function isDigitCodePoint(search: number): boolean; -export declare function isHexDigitCodePoint(search: number): boolean; -export declare function isIdentStartCodePoint(search: number): boolean; -export declare function isIdentCodePoint(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/packages/css-tokenizer/dist/consume/bad-url.d.ts b/packages/css-tokenizer/dist/consume/bad-url.d.ts deleted file mode 100644 index 4b18d0e8d..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/comment.d.ts b/packages/css-tokenizer/dist/consume/comment.d.ts deleted file mode 100644 index d4ba2211d..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/escaped-code-point.d.ts b/packages/css-tokenizer/dist/consume/escaped-code-point.d.ts deleted file mode 100644 index a6f8dc2e6..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/hash-token.d.ts b/packages/css-tokenizer/dist/consume/hash-token.d.ts deleted file mode 100644 index ac061a84c..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/ident-like-token.d.ts b/packages/css-tokenizer/dist/consume/ident-like-token.d.ts deleted file mode 100644 index 6be737627..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/ident-sequence.d.ts b/packages/css-tokenizer/dist/consume/ident-sequence.d.ts deleted file mode 100644 index 992520e2d..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/number.d.ts b/packages/css-tokenizer/dist/consume/number.d.ts deleted file mode 100644 index 18f1704f3..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/numeric-token.d.ts b/packages/css-tokenizer/dist/consume/numeric-token.d.ts deleted file mode 100644 index 1217bb0aa..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/string-token.d.ts b/packages/css-tokenizer/dist/consume/string-token.d.ts deleted file mode 100644 index 31f6448f7..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/unicode-range-token.d.ts b/packages/css-tokenizer/dist/consume/unicode-range-token.d.ts deleted file mode 100644 index 526bcfe18..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/url-token.d.ts b/packages/css-tokenizer/dist/consume/url-token.d.ts deleted file mode 100644 index 9140be704..000000000 --- a/packages/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/packages/css-tokenizer/dist/consume/whitespace-token.d.ts b/packages/css-tokenizer/dist/consume/whitespace-token.d.ts deleted file mode 100644 index 4584dc9a1..000000000 --- a/packages/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/packages/css-tokenizer/dist/index.d.cts b/packages/css-tokenizer/dist/index.d.cts new file mode 100644 index 000000000..686b35862 --- /dev/null +++ b/packages/css-tokenizer/dist/index.d.cts @@ -0,0 +1,196 @@ +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" +} +declare enum NumberType { + Integer = "integer", + Number = "number" +} +declare enum HashType { + Unrestricted = "unrestricted", + ID = "id" +} +type TokenAtKeyword = Token; +type TokenBadString = Token; +type TokenBadURL = Token; +type TokenCDC = Token; +type TokenCDO = Token; +type TokenColon = Token; +type TokenComma = Token; +type TokenComment = Token; +type TokenDelim = Token; +type TokenDimension = Token; +type TokenEOF = Token; +type TokenFunction = Token; +type TokenHash = Token; +type TokenIdent = Token; +type TokenNumber = Token; +type TokenPercentage = Token; +type TokenSemicolon = Token; +type TokenString = Token; +type TokenURL = Token; +type TokenWhitespace = Token; +type TokenOpenParen = Token; +type TokenCloseParen = Token; +type TokenOpenSquare = Token; +type TokenCloseSquare = Token; +type TokenOpenCurly = Token; +type TokenCloseCurly = Token; +type TokenUnicodeRange = Token; +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; +type Token = [ + /** The type of token */ + T, + /** The token representation */ + string, + /** Start position of representation */ + number, + /** End position of representation */ + number, + /** Extra data */ + U +]; +declare function mirrorVariantType(type: TokenType): TokenType | null; +declare function mirrorVariant(token: CSSToken): CSSToken | null; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare function isToken(x: any): x is CSSToken; +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); +} +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; +}; +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; +} +declare function cloneTokens(tokens: Array): Array; +declare function stringify(...tokens: Array): string; +interface Stringer { + valueOf(): string; +} +declare function tokenize(input: { + css: Stringer; + unicodeRangesAllowed?: boolean; +}, options?: { + onParseError?: (error: ParseError) => void; +}): Array; +declare function tokenizer(input: { + css: Stringer; + unicodeRangesAllowed?: boolean; +}, options?: { + onParseError?: (error: ParseError) => void; +}): { + nextToken: () => CSSToken | undefined; + endOfFile: () => boolean; +}; +declare function mutateIdent(ident: TokenIdent, newValue: string): void; +export type { CSSToken, Token, 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 }; +export { ParseError, Reader, TokenType, NumberType, mirrorVariantType, mirrorVariant, isToken, cloneTokens, stringify, tokenize, tokenizer, mutateIdent }; diff --git a/packages/css-tokenizer/dist/index.d.mts b/packages/css-tokenizer/dist/index.d.mts new file mode 100644 index 000000000..686b35862 --- /dev/null +++ b/packages/css-tokenizer/dist/index.d.mts @@ -0,0 +1,196 @@ +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" +} +declare enum NumberType { + Integer = "integer", + Number = "number" +} +declare enum HashType { + Unrestricted = "unrestricted", + ID = "id" +} +type TokenAtKeyword = Token; +type TokenBadString = Token; +type TokenBadURL = Token; +type TokenCDC = Token; +type TokenCDO = Token; +type TokenColon = Token; +type TokenComma = Token; +type TokenComment = Token; +type TokenDelim = Token; +type TokenDimension = Token; +type TokenEOF = Token; +type TokenFunction = Token; +type TokenHash = Token; +type TokenIdent = Token; +type TokenNumber = Token; +type TokenPercentage = Token; +type TokenSemicolon = Token; +type TokenString = Token; +type TokenURL = Token; +type TokenWhitespace = Token; +type TokenOpenParen = Token; +type TokenCloseParen = Token; +type TokenOpenSquare = Token; +type TokenCloseSquare = Token; +type TokenOpenCurly = Token; +type TokenCloseCurly = Token; +type TokenUnicodeRange = Token; +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; +type Token = [ + /** The type of token */ + T, + /** The token representation */ + string, + /** Start position of representation */ + number, + /** End position of representation */ + number, + /** Extra data */ + U +]; +declare function mirrorVariantType(type: TokenType): TokenType | null; +declare function mirrorVariant(token: CSSToken): CSSToken | null; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare function isToken(x: any): x is CSSToken; +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); +} +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; +}; +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; +} +declare function cloneTokens(tokens: Array): Array; +declare function stringify(...tokens: Array): string; +interface Stringer { + valueOf(): string; +} +declare function tokenize(input: { + css: Stringer; + unicodeRangesAllowed?: boolean; +}, options?: { + onParseError?: (error: ParseError) => void; +}): Array; +declare function tokenizer(input: { + css: Stringer; + unicodeRangesAllowed?: boolean; +}, options?: { + onParseError?: (error: ParseError) => void; +}): { + nextToken: () => CSSToken | undefined; + endOfFile: () => boolean; +}; +declare function mutateIdent(ident: TokenIdent, newValue: string): void; +export type { CSSToken, Token, 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 }; +export { ParseError, Reader, TokenType, NumberType, mirrorVariantType, mirrorVariant, isToken, cloneTokens, stringify, tokenize, tokenizer, mutateIdent }; diff --git a/packages/css-tokenizer/dist/index.d.ts b/packages/css-tokenizer/dist/index.d.ts index 5e32465f0..686b35862 100644 --- a/packages/css-tokenizer/dist/index.d.ts +++ b/packages/css-tokenizer/dist/index.d.ts @@ -1,10 +1,196 @@ -export type { CSSToken } from './interfaces/token'; -export type { Token } from './interfaces/token'; -export { ParseError } from './interfaces/error'; -export { Reader } from './reader'; -export { TokenType, NumberType, mirrorVariantType, mirrorVariant, isToken } from './interfaces/token'; -export { cloneTokens } from './util/clone-tokens'; -export { stringify } from './stringify'; -export { tokenize, tokenizer } from './tokenizer'; -export type { 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, } from './interfaces/token'; -export { mutateIdent, } from './util/mutations'; +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" +} +declare enum NumberType { + Integer = "integer", + Number = "number" +} +declare enum HashType { + Unrestricted = "unrestricted", + ID = "id" +} +type TokenAtKeyword = Token; +type TokenBadString = Token; +type TokenBadURL = Token; +type TokenCDC = Token; +type TokenCDO = Token; +type TokenColon = Token; +type TokenComma = Token; +type TokenComment = Token; +type TokenDelim = Token; +type TokenDimension = Token; +type TokenEOF = Token; +type TokenFunction = Token; +type TokenHash = Token; +type TokenIdent = Token; +type TokenNumber = Token; +type TokenPercentage = Token; +type TokenSemicolon = Token; +type TokenString = Token; +type TokenURL = Token; +type TokenWhitespace = Token; +type TokenOpenParen = Token; +type TokenCloseParen = Token; +type TokenOpenSquare = Token; +type TokenCloseSquare = Token; +type TokenOpenCurly = Token; +type TokenCloseCurly = Token; +type TokenUnicodeRange = Token; +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; +type Token = [ + /** The type of token */ + T, + /** The token representation */ + string, + /** Start position of representation */ + number, + /** End position of representation */ + number, + /** Extra data */ + U +]; +declare function mirrorVariantType(type: TokenType): TokenType | null; +declare function mirrorVariant(token: CSSToken): CSSToken | null; +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare function isToken(x: any): x is CSSToken; +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); +} +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; +}; +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; +} +declare function cloneTokens(tokens: Array): Array; +declare function stringify(...tokens: Array): string; +interface Stringer { + valueOf(): string; +} +declare function tokenize(input: { + css: Stringer; + unicodeRangesAllowed?: boolean; +}, options?: { + onParseError?: (error: ParseError) => void; +}): Array; +declare function tokenizer(input: { + css: Stringer; + unicodeRangesAllowed?: boolean; +}, options?: { + onParseError?: (error: ParseError) => void; +}): { + nextToken: () => CSSToken | undefined; + endOfFile: () => boolean; +}; +declare function mutateIdent(ident: TokenIdent, newValue: string): void; +export type { CSSToken, Token, 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 }; +export { ParseError, Reader, TokenType, NumberType, mirrorVariantType, mirrorVariant, isToken, cloneTokens, stringify, tokenize, tokenizer, mutateIdent }; diff --git a/packages/css-tokenizer/dist/interfaces/code-point-reader.d.ts b/packages/css-tokenizer/dist/interfaces/code-point-reader.d.ts deleted file mode 100644 index a178ed8fc..000000000 --- a/packages/css-tokenizer/dist/interfaces/code-point-reader.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export 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; -}; diff --git a/packages/css-tokenizer/dist/interfaces/context.d.ts b/packages/css-tokenizer/dist/interfaces/context.d.ts deleted file mode 100644 index 339bfe4e4..000000000 --- a/packages/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/packages/css-tokenizer/dist/interfaces/error.d.ts b/packages/css-tokenizer/dist/interfaces/error.d.ts deleted file mode 100644 index dc47e1d69..000000000 --- a/packages/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/packages/css-tokenizer/dist/interfaces/token.d.ts b/packages/css-tokenizer/dist/interfaces/token.d.ts deleted file mode 100644 index c4f2f4e3e..000000000 --- a/packages/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/packages/css-tokenizer/dist/reader.d.ts b/packages/css-tokenizer/dist/reader.d.ts deleted file mode 100644 index fc798c58d..000000000 --- a/packages/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/packages/css-tokenizer/dist/stringify.d.ts b/packages/css-tokenizer/dist/stringify.d.ts deleted file mode 100644 index 574d2043e..000000000 --- a/packages/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/packages/css-tokenizer/dist/tokenizer.d.ts b/packages/css-tokenizer/dist/tokenizer.d.ts deleted file mode 100644 index 318a16bbb..000000000 --- a/packages/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/packages/css-tokenizer/dist/util/clone-tokens.d.ts b/packages/css-tokenizer/dist/util/clone-tokens.d.ts deleted file mode 100644 index 1db05d036..000000000 --- a/packages/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/packages/css-tokenizer/dist/util/mutations.d.ts b/packages/css-tokenizer/dist/util/mutations.d.ts deleted file mode 100644 index 37f23cd29..000000000 --- a/packages/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/packages/css-tokenizer/package.json b/packages/css-tokenizer/package.json index d99e30d85..766ec16aa 100644 --- a/packages/css-tokenizer/package.json +++ b/packages/css-tokenizer/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/packages/css-tokenizer/tsconfig.json b/packages/css-tokenizer/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/packages/css-tokenizer/tsconfig.json +++ b/packages/css-tokenizer/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/packages/media-query-list-parser/dist/index.d.cts b/packages/media-query-list-parser/dist/index.d.cts new file mode 100644 index 000000000..2e8e7778d --- /dev/null +++ b/packages/media-query-list-parser/dist/index.d.cts @@ -0,0 +1,722 @@ +import { CSSToken, ParseError, TokenColon, TokenDelim, TokenIdent } from "@csstools/css-tokenizer"; +import { ComponentValue, ContainerNode } from "@csstools/css-parser-algorithms"; +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" +} +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; +} +type GeneralEnclosedWalkerEntry = ComponentValue; +type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; +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; +} +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; +} +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; +} +type MediaFeatureValueWalkerEntry = ComponentValue; +type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; +declare function matchesRatioExactly(componentValues: Array): number[] | -1; +declare function matchesRatio(componentValues: Array): number[] | -1; +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; +} +type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; +declare enum MediaFeatureLT { + LT = "<", + LT_OR_EQ = "<=" +} +declare enum MediaFeatureGT { + GT = ">", + GT_OR_EQ = ">=" +} +declare enum MediaFeatureEQ { + EQ = "=" +} +type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; +declare function matchesComparison(componentValues: Array): false | [ + number, + number +]; +declare function comparisonFromTokens(tokens: [ + TokenDelim, + TokenDelim +] | [ + TokenDelim +]): MediaFeatureComparison | false; +declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; +type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; +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; +} +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; +} +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; +} +type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; +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; +} +type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; +type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; +declare function newMediaFeatureBoolean(name: string): MediaFeature; +declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; +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; +} +type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; +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; +} +type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; +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; +} +type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; +type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; +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; +} +type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; +type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; +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; +} +type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; +type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; +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; +} +type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; +type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; +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; +} +type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; +type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; +type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; +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; +} +type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; +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; +} +type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; +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; +} +type MediaQueryInvalidWalkerEntry = ComponentValue; +type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; +type Options = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +declare function parseFromTokens(tokens: Array, options?: Options): MediaQuery[]; +declare function parse(source: string, options?: Options): MediaQuery[]; +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: import("../../../css-parser-algorithms/dist").ComponentValue[]; + })[] | undefined; + }; + isCustomMedia(): this is CustomMedia; + static isCustomMedia(x: unknown): x is CustomMedia; +} +type Options$0 = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +declare function parseCustomMediaFromTokens(tokens: Array, options?: Options$0): CustomMedia | false; +declare function parseCustomMedia(source: string, options?: Options$0): CustomMedia | false; +declare function isCustomMedia(x: unknown): x is GeneralEnclosed; +declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; +declare function isMediaAnd(x: unknown): x is MediaAnd; +declare function isMediaConditionList(x: unknown): x is MediaConditionList; +declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; +declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; +declare function isMediaCondition(x: unknown): x is MediaCondition; +declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; +declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; +declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; +declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; +declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; +declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; +declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; +declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; +declare function isMediaFeature(x: unknown): x is MediaFeature; +declare function isMediaInParens(x: unknown): x is MediaInParens; +declare function isMediaNot(x: unknown): x is MediaNot; +declare function isMediaOr(x: unknown): x is MediaOr; +declare function isMediaQuery(x: unknown): x is MediaQuery; +declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; +declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; +declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; +declare enum MediaQueryModifier { + Not = "not", + Only = "only" +} +declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; +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" +} +declare function typeFromToken(token: TokenIdent): MediaType | false; +declare function cloneMediaQuery(x: T): T; +export { parse, parseFromTokens, parseCustomMedia, parseCustomMediaFromTokens, NodeType, isCustomMedia, isGeneralEnclosed, isMediaAnd, isMediaCondition, isMediaConditionList, isMediaConditionListWithAnd, isMediaConditionListWithOr, isMediaFeature, isMediaFeatureBoolean, isMediaFeatureName, isMediaFeaturePlain, isMediaFeatureRange, isMediaFeatureRangeNameValue, isMediaFeatureRangeValueName, isMediaFeatureRangeValueNameValue, isMediaFeatureValue, isMediaInParens, isMediaNot, isMediaOr, isMediaQuery, isMediaQueryInvalid, isMediaQueryWithType, isMediaQueryWithoutType, CustomMedia, GeneralEnclosed, MediaAnd, MediaCondition, MediaConditionListWithAnd, MediaConditionListWithOr, MediaFeature, newMediaFeatureBoolean, newMediaFeaturePlain, MediaFeatureBoolean, MediaFeatureEQ, MediaFeatureGT, MediaFeatureLT, invertComparison, matchesComparison, comparisonFromTokens, MediaFeatureName, MediaFeaturePlain, MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue, MediaFeatureValue, matchesRatio, matchesRatioExactly, MediaInParens, MediaNot, MediaOr, MediaQueryModifier, modifierFromToken, MediaQueryWithType, MediaQueryWithoutType, MediaQueryInvalid, MediaType, typeFromToken, cloneMediaQuery }; +export type { MediaConditionList, MediaFeatureComparison, MediaFeatureRange, MediaQuery }; diff --git a/packages/media-query-list-parser/dist/index.d.mts b/packages/media-query-list-parser/dist/index.d.mts new file mode 100644 index 000000000..2e8e7778d --- /dev/null +++ b/packages/media-query-list-parser/dist/index.d.mts @@ -0,0 +1,722 @@ +import { CSSToken, ParseError, TokenColon, TokenDelim, TokenIdent } from "@csstools/css-tokenizer"; +import { ComponentValue, ContainerNode } from "@csstools/css-parser-algorithms"; +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" +} +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; +} +type GeneralEnclosedWalkerEntry = ComponentValue; +type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; +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; +} +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; +} +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; +} +type MediaFeatureValueWalkerEntry = ComponentValue; +type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; +declare function matchesRatioExactly(componentValues: Array): number[] | -1; +declare function matchesRatio(componentValues: Array): number[] | -1; +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; +} +type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; +declare enum MediaFeatureLT { + LT = "<", + LT_OR_EQ = "<=" +} +declare enum MediaFeatureGT { + GT = ">", + GT_OR_EQ = ">=" +} +declare enum MediaFeatureEQ { + EQ = "=" +} +type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; +declare function matchesComparison(componentValues: Array): false | [ + number, + number +]; +declare function comparisonFromTokens(tokens: [ + TokenDelim, + TokenDelim +] | [ + TokenDelim +]): MediaFeatureComparison | false; +declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; +type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; +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; +} +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; +} +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; +} +type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; +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; +} +type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; +type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; +declare function newMediaFeatureBoolean(name: string): MediaFeature; +declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; +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; +} +type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; +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; +} +type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; +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; +} +type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; +type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; +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; +} +type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; +type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; +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; +} +type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; +type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; +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; +} +type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; +type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; +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; +} +type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; +type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; +type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; +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; +} +type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; +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; +} +type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; +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; +} +type MediaQueryInvalidWalkerEntry = ComponentValue; +type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; +type Options = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +declare function parseFromTokens(tokens: Array, options?: Options): MediaQuery[]; +declare function parse(source: string, options?: Options): MediaQuery[]; +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: import("../../../css-parser-algorithms/dist").ComponentValue[]; + })[] | undefined; + }; + isCustomMedia(): this is CustomMedia; + static isCustomMedia(x: unknown): x is CustomMedia; +} +type Options$0 = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +declare function parseCustomMediaFromTokens(tokens: Array, options?: Options$0): CustomMedia | false; +declare function parseCustomMedia(source: string, options?: Options$0): CustomMedia | false; +declare function isCustomMedia(x: unknown): x is GeneralEnclosed; +declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; +declare function isMediaAnd(x: unknown): x is MediaAnd; +declare function isMediaConditionList(x: unknown): x is MediaConditionList; +declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; +declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; +declare function isMediaCondition(x: unknown): x is MediaCondition; +declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; +declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; +declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; +declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; +declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; +declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; +declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; +declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; +declare function isMediaFeature(x: unknown): x is MediaFeature; +declare function isMediaInParens(x: unknown): x is MediaInParens; +declare function isMediaNot(x: unknown): x is MediaNot; +declare function isMediaOr(x: unknown): x is MediaOr; +declare function isMediaQuery(x: unknown): x is MediaQuery; +declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; +declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; +declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; +declare enum MediaQueryModifier { + Not = "not", + Only = "only" +} +declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; +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" +} +declare function typeFromToken(token: TokenIdent): MediaType | false; +declare function cloneMediaQuery(x: T): T; +export { parse, parseFromTokens, parseCustomMedia, parseCustomMediaFromTokens, NodeType, isCustomMedia, isGeneralEnclosed, isMediaAnd, isMediaCondition, isMediaConditionList, isMediaConditionListWithAnd, isMediaConditionListWithOr, isMediaFeature, isMediaFeatureBoolean, isMediaFeatureName, isMediaFeaturePlain, isMediaFeatureRange, isMediaFeatureRangeNameValue, isMediaFeatureRangeValueName, isMediaFeatureRangeValueNameValue, isMediaFeatureValue, isMediaInParens, isMediaNot, isMediaOr, isMediaQuery, isMediaQueryInvalid, isMediaQueryWithType, isMediaQueryWithoutType, CustomMedia, GeneralEnclosed, MediaAnd, MediaCondition, MediaConditionListWithAnd, MediaConditionListWithOr, MediaFeature, newMediaFeatureBoolean, newMediaFeaturePlain, MediaFeatureBoolean, MediaFeatureEQ, MediaFeatureGT, MediaFeatureLT, invertComparison, matchesComparison, comparisonFromTokens, MediaFeatureName, MediaFeaturePlain, MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue, MediaFeatureValue, matchesRatio, matchesRatioExactly, MediaInParens, MediaNot, MediaOr, MediaQueryModifier, modifierFromToken, MediaQueryWithType, MediaQueryWithoutType, MediaQueryInvalid, MediaType, typeFromToken, cloneMediaQuery }; +export type { MediaConditionList, MediaFeatureComparison, MediaFeatureRange, MediaQuery }; diff --git a/packages/media-query-list-parser/dist/index.d.ts b/packages/media-query-list-parser/dist/index.d.ts index 763068775..2e8e7778d 100644 --- a/packages/media-query-list-parser/dist/index.d.ts +++ b/packages/media-query-list-parser/dist/index.d.ts @@ -1,27 +1,722 @@ -export { parse, parseFromTokens } from './parser/parse'; -export { parseCustomMedia, parseCustomMediaFromTokens } from './parser/parse-custom-media'; -export { NodeType } from './util/node-type'; -export { isCustomMedia, isGeneralEnclosed, isMediaAnd, isMediaCondition, isMediaConditionList, isMediaConditionListWithAnd, isMediaConditionListWithOr, isMediaFeature, isMediaFeatureBoolean, isMediaFeatureName, isMediaFeaturePlain, isMediaFeatureRange, isMediaFeatureRangeNameValue, isMediaFeatureRangeValueName, isMediaFeatureRangeValueNameValue, isMediaFeatureValue, isMediaInParens, isMediaNot, isMediaOr, isMediaQuery, isMediaQueryInvalid, isMediaQueryWithType, isMediaQueryWithoutType, } from './util/type-predicates'; -export type { MediaConditionList } from './nodes/media-condition-list'; -export type { MediaFeatureComparison } from './nodes/media-feature-comparison'; -export type { MediaFeatureRange } from './nodes/media-feature-range'; -export type { MediaQuery } from './nodes/media-query'; -export { CustomMedia } from './nodes/custom-media'; -export { GeneralEnclosed } from './nodes/general-enclosed'; -export { MediaAnd } from './nodes/media-and'; -export { MediaCondition } from './nodes/media-condition'; -export { MediaConditionListWithAnd, MediaConditionListWithOr } from './nodes/media-condition-list'; -export { MediaFeature, newMediaFeatureBoolean, newMediaFeaturePlain } from './nodes/media-feature'; -export { MediaFeatureBoolean } from './nodes/media-feature-boolean'; -export { MediaFeatureEQ, MediaFeatureGT, MediaFeatureLT, invertComparison, matchesComparison, comparisonFromTokens } from './nodes/media-feature-comparison'; -export { MediaFeatureName } from './nodes/media-feature-name'; -export { MediaFeaturePlain } from './nodes/media-feature-plain'; -export { MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue } from './nodes/media-feature-range'; -export { MediaFeatureValue, matchesRatio, matchesRatioExactly } from './nodes/media-feature-value'; -export { MediaInParens } from './nodes/media-in-parens'; -export { MediaNot } from './nodes/media-not'; -export { MediaOr } from './nodes/media-or'; -export { MediaQueryModifier, modifierFromToken } from './nodes/media-query-modifier'; -export { MediaQueryWithType, MediaQueryWithoutType, MediaQueryInvalid } from './nodes/media-query'; -export { MediaType, typeFromToken } from './nodes/media-type'; -export { cloneMediaQuery } from './util/clone-media-query'; +import { CSSToken, ParseError, TokenColon, TokenDelim, TokenIdent } from "@csstools/css-tokenizer"; +import { ComponentValue, ContainerNode } from "@csstools/css-parser-algorithms"; +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" +} +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; +} +type GeneralEnclosedWalkerEntry = ComponentValue; +type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; +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; +} +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; +} +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; +} +type MediaFeatureValueWalkerEntry = ComponentValue; +type MediaFeatureValueWalkerParent = ContainerNode | MediaFeatureValue; +declare function matchesRatioExactly(componentValues: Array): number[] | -1; +declare function matchesRatio(componentValues: Array): number[] | -1; +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; +} +type MediaFeaturePlainWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +type MediaFeaturePlainWalkerParent = MediaFeatureValueWalkerParent | MediaFeaturePlain; +declare enum MediaFeatureLT { + LT = "<", + LT_OR_EQ = "<=" +} +declare enum MediaFeatureGT { + GT = ">", + GT_OR_EQ = ">=" +} +declare enum MediaFeatureEQ { + EQ = "=" +} +type MediaFeatureComparison = MediaFeatureLT | MediaFeatureGT | MediaFeatureEQ; +declare function matchesComparison(componentValues: Array): false | [ + number, + number +]; +declare function comparisonFromTokens(tokens: [ + TokenDelim, + TokenDelim +] | [ + TokenDelim +]): MediaFeatureComparison | false; +declare function invertComparison(operator: MediaFeatureComparison): MediaFeatureComparison | false; +type MediaFeatureRange = MediaFeatureRangeNameValue | MediaFeatureRangeValueName | MediaFeatureRangeValueNameValue; +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; +} +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; +} +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; +} +type MediaFeatureRangeWalkerEntry = MediaFeatureValueWalkerEntry | MediaFeatureValue; +type MediaFeatureRangeWalkerParent = MediaFeatureValueWalkerParent | MediaFeatureRange; +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; +} +type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; +type MediaFeatureWalkerParent = MediaFeaturePlainWalkerParent | MediaFeatureRangeWalkerParent | MediaFeature; +declare function newMediaFeatureBoolean(name: string): MediaFeature; +declare function newMediaFeaturePlain(name: string, ...value: Array): MediaFeature; +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; +} +type MediaNotWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaNotWalkerParent = MediaInParensWalkerParent | MediaNot; +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; +} +type MediaOrWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaOrWalkerParent = MediaInParensWalkerParent | MediaOr; +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; +} +type MediaInParensWalkerEntry = ComponentValue | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; +type MediaInParensWalkerParent = ContainerNode | GeneralEnclosed | MediaAnd | MediaNot | MediaOr | MediaConditionList | MediaCondition | MediaFeatureBoolean | MediaFeatureName | MediaFeaturePlain | MediaFeatureRange | MediaFeatureValue | MediaFeature | GeneralEnclosed | MediaInParens; +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; +} +type MediaAndWalkerEntry = MediaInParensWalkerEntry | MediaInParens; +type MediaAndWalkerParent = MediaInParensWalkerParent | MediaAnd; +type MediaConditionList = MediaConditionListWithAnd | MediaConditionListWithOr; +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; +} +type MediaConditionListWithAndWalkerEntry = MediaAndWalkerEntry | MediaAnd; +type MediaConditionListWithAndWalkerParent = MediaAndWalkerParent | MediaConditionListWithAnd; +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; +} +type MediaConditionListWithOrWalkerEntry = MediaOrWalkerEntry | MediaOr; +type MediaConditionListWithOrWalkerParent = MediaOrWalkerParent | MediaConditionListWithOr; +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; +} +type MediaConditionWalkerEntry = MediaNotWalkerEntry | MediaConditionListWithAndWalkerEntry | MediaConditionListWithOrWalkerEntry | MediaNot | MediaConditionListWithAnd | MediaConditionListWithOr; +type MediaConditionWalkerParent = MediaNotWalkerParent | MediaConditionListWithAndWalkerParent | MediaConditionListWithOrWalkerParent | MediaCondition; +type MediaQuery = MediaQueryWithType | MediaQueryWithoutType | MediaQueryInvalid; +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; +} +type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +type MediaQueryWithTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithType; +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; +} +type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; +type MediaQueryWithoutTypeWalkerParent = MediaConditionWalkerParent | MediaQueryWithoutType; +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; +} +type MediaQueryInvalidWalkerEntry = ComponentValue; +type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; +type Options = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +declare function parseFromTokens(tokens: Array, options?: Options): MediaQuery[]; +declare function parse(source: string, options?: Options): MediaQuery[]; +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: import("../../../css-parser-algorithms/dist").ComponentValue[]; + })[] | undefined; + }; + isCustomMedia(): this is CustomMedia; + static isCustomMedia(x: unknown): x is CustomMedia; +} +type Options$0 = { + preserveInvalidMediaQueries?: boolean; + onParseError?: (error: ParseError) => void; +}; +declare function parseCustomMediaFromTokens(tokens: Array, options?: Options$0): CustomMedia | false; +declare function parseCustomMedia(source: string, options?: Options$0): CustomMedia | false; +declare function isCustomMedia(x: unknown): x is GeneralEnclosed; +declare function isGeneralEnclosed(x: unknown): x is GeneralEnclosed; +declare function isMediaAnd(x: unknown): x is MediaAnd; +declare function isMediaConditionList(x: unknown): x is MediaConditionList; +declare function isMediaConditionListWithAnd(x: unknown): x is MediaConditionListWithAnd; +declare function isMediaConditionListWithOr(x: unknown): x is MediaConditionListWithOr; +declare function isMediaCondition(x: unknown): x is MediaCondition; +declare function isMediaFeatureBoolean(x: unknown): x is MediaFeatureBoolean; +declare function isMediaFeatureName(x: unknown): x is MediaFeatureName; +declare function isMediaFeatureValue(x: unknown): x is MediaFeatureValue; +declare function isMediaFeaturePlain(x: unknown): x is MediaFeaturePlain; +declare function isMediaFeatureRange(x: unknown): x is MediaFeatureRange; +declare function isMediaFeatureRangeNameValue(x: unknown): x is MediaFeatureRangeNameValue; +declare function isMediaFeatureRangeValueName(x: unknown): x is MediaFeatureRangeValueName; +declare function isMediaFeatureRangeValueNameValue(x: unknown): x is MediaFeatureRangeValueNameValue; +declare function isMediaFeature(x: unknown): x is MediaFeature; +declare function isMediaInParens(x: unknown): x is MediaInParens; +declare function isMediaNot(x: unknown): x is MediaNot; +declare function isMediaOr(x: unknown): x is MediaOr; +declare function isMediaQuery(x: unknown): x is MediaQuery; +declare function isMediaQueryWithType(x: unknown): x is MediaQueryWithType; +declare function isMediaQueryWithoutType(x: unknown): x is MediaQueryWithoutType; +declare function isMediaQueryInvalid(x: unknown): x is MediaQueryInvalid; +declare enum MediaQueryModifier { + Not = "not", + Only = "only" +} +declare function modifierFromToken(token: TokenIdent): MediaQueryModifier | false; +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" +} +declare function typeFromToken(token: TokenIdent): MediaType | false; +declare function cloneMediaQuery(x: T): T; +export { parse, parseFromTokens, parseCustomMedia, parseCustomMediaFromTokens, NodeType, isCustomMedia, isGeneralEnclosed, isMediaAnd, isMediaCondition, isMediaConditionList, isMediaConditionListWithAnd, isMediaConditionListWithOr, isMediaFeature, isMediaFeatureBoolean, isMediaFeatureName, isMediaFeaturePlain, isMediaFeatureRange, isMediaFeatureRangeNameValue, isMediaFeatureRangeValueName, isMediaFeatureRangeValueNameValue, isMediaFeatureValue, isMediaInParens, isMediaNot, isMediaOr, isMediaQuery, isMediaQueryInvalid, isMediaQueryWithType, isMediaQueryWithoutType, CustomMedia, GeneralEnclosed, MediaAnd, MediaCondition, MediaConditionListWithAnd, MediaConditionListWithOr, MediaFeature, newMediaFeatureBoolean, newMediaFeaturePlain, MediaFeatureBoolean, MediaFeatureEQ, MediaFeatureGT, MediaFeatureLT, invertComparison, matchesComparison, comparisonFromTokens, MediaFeatureName, MediaFeaturePlain, MediaFeatureRangeNameValue, MediaFeatureRangeValueName, MediaFeatureRangeValueNameValue, MediaFeatureValue, matchesRatio, matchesRatioExactly, MediaInParens, MediaNot, MediaOr, MediaQueryModifier, modifierFromToken, MediaQueryWithType, MediaQueryWithoutType, MediaQueryInvalid, MediaType, typeFromToken, cloneMediaQuery }; +export type { MediaConditionList, MediaFeatureComparison, MediaFeatureRange, MediaQuery }; diff --git a/packages/media-query-list-parser/dist/nodes/custom-media.d.ts b/packages/media-query-list-parser/dist/nodes/custom-media.d.ts deleted file mode 100644 index 6e2a33cb2..000000000 --- a/packages/media-query-list-parser/dist/nodes/custom-media.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { CSSToken } from '@csstools/css-tokenizer'; -import { NodeType } from '../util/node-type'; -import { MediaQuery } from './media-query'; -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: 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/packages/media-query-list-parser/dist/nodes/general-enclosed.d.ts b/packages/media-query-list-parser/dist/nodes/general-enclosed.d.ts deleted file mode 100644 index 71a5f3704..000000000 --- a/packages/media-query-list-parser/dist/nodes/general-enclosed.d.ts +++ /dev/null @@ -1,26 +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; -} -type GeneralEnclosedWalkerEntry = ComponentValue; -type GeneralEnclosedWalkerParent = ContainerNode | GeneralEnclosed; -export {}; diff --git a/packages/media-query-list-parser/dist/nodes/media-and.d.ts b/packages/media-query-list-parser/dist/nodes/media-and.d.ts deleted file mode 100644 index ddd73d539..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-condition-list.d.ts b/packages/media-query-list-parser/dist/nodes/media-condition-list.d.ts deleted file mode 100644 index ddc51062d..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-condition.d.ts b/packages/media-query-list-parser/dist/nodes/media-condition.d.ts deleted file mode 100644 index faf2b49d2..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts b/packages/media-query-list-parser/dist/nodes/media-feature-boolean.d.ts deleted file mode 100644 index a5c64ec1f..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts b/packages/media-query-list-parser/dist/nodes/media-feature-comparison.d.ts deleted file mode 100644 index 377696577..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-feature-name.d.ts b/packages/media-query-list-parser/dist/nodes/media-feature-name.d.ts deleted file mode 100644 index 332b421a1..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-feature-plain.d.ts b/packages/media-query-list-parser/dist/nodes/media-feature-plain.d.ts deleted file mode 100644 index 32f22c401..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-feature-range.d.ts b/packages/media-query-list-parser/dist/nodes/media-feature-range.d.ts deleted file mode 100644 index afe322aeb..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-feature-value.d.ts b/packages/media-query-list-parser/dist/nodes/media-feature-value.d.ts deleted file mode 100644 index dda072bb1..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-feature.d.ts b/packages/media-query-list-parser/dist/nodes/media-feature.d.ts deleted file mode 100644 index 9c0ab852b..000000000 --- a/packages/media-query-list-parser/dist/nodes/media-feature.d.ts +++ /dev/null @@ -1,46 +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; -} -type MediaFeatureWalkerEntry = MediaFeaturePlainWalkerEntry | MediaFeatureRangeWalkerEntry | MediaFeaturePlain | MediaFeatureBoolean | MediaFeatureRange; -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; -export {}; diff --git a/packages/media-query-list-parser/dist/nodes/media-in-parens.d.ts b/packages/media-query-list-parser/dist/nodes/media-in-parens.d.ts deleted file mode 100644 index 904a0725e..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-not.d.ts b/packages/media-query-list-parser/dist/nodes/media-not.d.ts deleted file mode 100644 index 2bedcaa31..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-or.d.ts b/packages/media-query-list-parser/dist/nodes/media-or.d.ts deleted file mode 100644 index 4459412d4..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-query-modifier.d.ts b/packages/media-query-list-parser/dist/nodes/media-query-modifier.d.ts deleted file mode 100644 index df9733cb5..000000000 --- a/packages/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/packages/media-query-list-parser/dist/nodes/media-query.d.ts b/packages/media-query-list-parser/dist/nodes/media-query.d.ts deleted file mode 100644 index ad1e32fa4..000000000 --- a/packages/media-query-list-parser/dist/nodes/media-query.d.ts +++ /dev/null @@ -1,84 +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; -} -type MediaQueryWithTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; -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; -} -type MediaQueryWithoutTypeWalkerEntry = MediaConditionWalkerEntry | MediaCondition; -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; -} -type MediaQueryInvalidWalkerEntry = ComponentValue; -type MediaQueryInvalidWalkerParent = ComponentValue | MediaQueryInvalid; -export {}; diff --git a/packages/media-query-list-parser/dist/nodes/media-type.d.ts b/packages/media-query-list-parser/dist/nodes/media-type.d.ts deleted file mode 100644 index b7924b760..000000000 --- a/packages/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/packages/media-query-list-parser/dist/parser/parse-custom-media.d.ts b/packages/media-query-list-parser/dist/parser/parse-custom-media.d.ts deleted file mode 100644 index 1f747f8e1..000000000 --- a/packages/media-query-list-parser/dist/parser/parse-custom-media.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { CustomMedia } from '../nodes/custom-media'; -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; -export {}; diff --git a/packages/media-query-list-parser/dist/parser/parse-media-query.d.ts b/packages/media-query-list-parser/dist/parser/parse-media-query.d.ts deleted file mode 100644 index 4c00cb76a..000000000 --- a/packages/media-query-list-parser/dist/parser/parse-media-query.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { ComponentValue } from '@csstools/css-parser-algorithms'; -import { MediaQuery } from '../nodes/media-query'; -export declare function parseMediaQuery(componentValues: Array): MediaQuery | false; diff --git a/packages/media-query-list-parser/dist/parser/parse.d.ts b/packages/media-query-list-parser/dist/parser/parse.d.ts deleted file mode 100644 index b208e00a3..000000000 --- a/packages/media-query-list-parser/dist/parser/parse.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { CSSToken, ParseError } from '@csstools/css-tokenizer'; -import { MediaQuery } from '../nodes/media-query'; -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[]; -export {}; diff --git a/packages/media-query-list-parser/dist/util/clone-media-query.d.ts b/packages/media-query-list-parser/dist/util/clone-media-query.d.ts deleted file mode 100644 index e0702c235..000000000 --- a/packages/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/packages/media-query-list-parser/dist/util/component-value-is.d.ts b/packages/media-query-list-parser/dist/util/component-value-is.d.ts deleted file mode 100644 index f0763807b..000000000 --- a/packages/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/packages/media-query-list-parser/dist/util/node-type.d.ts b/packages/media-query-list-parser/dist/util/node-type.d.ts deleted file mode 100644 index 935e6eb54..000000000 --- a/packages/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/packages/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts b/packages/media-query-list-parser/dist/util/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e7..000000000 --- a/packages/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/packages/media-query-list-parser/dist/util/type-predicates.d.ts b/packages/media-query-list-parser/dist/util/type-predicates.d.ts deleted file mode 100644 index 2313f29b0..000000000 --- a/packages/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/packages/media-query-list-parser/package.json b/packages/media-query-list-parser/package.json index d9037c742..e828cb1dd 100644 --- a/packages/media-query-list-parser/package.json +++ b/packages/media-query-list-parser/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/packages/media-query-list-parser/tsconfig.json b/packages/media-query-list-parser/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/packages/media-query-list-parser/tsconfig.json +++ b/packages/media-query-list-parser/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/packages/postcss-tape/dist/format-asserts.d.ts b/packages/postcss-tape/dist/format-asserts.d.ts deleted file mode 100644 index 6750e2ce8..000000000 --- a/packages/postcss-tape/dist/format-asserts.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Warning } from 'postcss'; -import type { TestCaseOptions } from './test-case-options'; -export declare const dashesSeparator = "----------------------------------------"; -export declare function formatCSSAssertError(testCaseLabel: string, testCaseOptions: TestCaseOptions, err: Error, forGithubAnnotation?: boolean): string; -export declare function formatWarningsAssertError(testCaseLabel: string, testCaseOptions: TestCaseOptions, actual: Array, expected: number, forGithubAnnotation?: boolean): string; diff --git a/packages/postcss-tape/dist/github-annotations.d.ts b/packages/postcss-tape/dist/github-annotations.d.ts deleted file mode 100644 index 48161dab9..000000000 --- a/packages/postcss-tape/dist/github-annotations.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function formatGitHubActionAnnotation(message: string, level?: string, options?: Record): string; diff --git a/packages/postcss-tape/dist/test-case-options.d.ts b/packages/postcss-tape/dist/index.d.cts similarity index 56% rename from packages/postcss-tape/dist/test-case-options.d.ts rename to packages/postcss-tape/dist/index.d.cts index c1dd65223..5be0a7360 100644 --- a/packages/postcss-tape/dist/test-case-options.d.ts +++ b/packages/postcss-tape/dist/index.d.cts @@ -1,5 +1,5 @@ -import type { Plugin } from 'postcss'; -export type TestCaseOptions = { +import { AtRule, Declaration, Rule, PluginCreator, Plugin } from 'postcss'; +type TestCaseOptions = { /** Debug message */ message?: string; /** Plugin options. Only used if `plugins` is not specified. */ @@ -22,3 +22,21 @@ export type TestCaseOptions = { /** Process the test cases with "postcss-html" as the syntax */ postcssSyntaxHTML?: boolean; }; +declare function postcssTape(currentPlugin: PluginCreator): (options: Record) => Promise; +declare const declarationClonerPlugin: { + postcssPlugin: string; + Declaration(decl: Declaration): void; +}; +declare const ruleClonerPlugin: { + postcssPlugin: string; + prepare(): { + RuleExit(rule: Rule): void; + }; +}; +declare const atRuleClonerPlugin: { + postcssPlugin: string; + prepare(): { + AtRuleExit(atRule: AtRule): void; + }; +}; +export { postcssTape, declarationClonerPlugin, ruleClonerPlugin, atRuleClonerPlugin }; diff --git a/packages/postcss-tape/dist/index.d.mts b/packages/postcss-tape/dist/index.d.mts new file mode 100644 index 000000000..5be0a7360 --- /dev/null +++ b/packages/postcss-tape/dist/index.d.mts @@ -0,0 +1,42 @@ +import { AtRule, Declaration, Rule, PluginCreator, Plugin } from 'postcss'; +type TestCaseOptions = { + /** Debug message */ + message?: string; + /** Plugin options. Only used if `plugins` is not specified. */ + options?: unknown; + /** Plugins to use. When specified the original plugin is not used. */ + plugins?: Array; + /** The expected number of warnings. */ + warnings?: number; + /** Expected exception */ + /** NOTE: plugins should not throw exceptions, this goes against best practices. Use `errors` instead. */ + exception?: RegExp; + /** Override the file name of the "expect" file. */ + expect?: string; + /** Override the file name of the "result" file. */ + result?: string; + /** Do something before the test is run. */ + before?: () => void; + /** Do something after the test is run. */ + after?: () => void | Promise; + /** Process the test cases with "postcss-html" as the syntax */ + postcssSyntaxHTML?: boolean; +}; +declare function postcssTape(currentPlugin: PluginCreator): (options: Record) => Promise; +declare const declarationClonerPlugin: { + postcssPlugin: string; + Declaration(decl: Declaration): void; +}; +declare const ruleClonerPlugin: { + postcssPlugin: string; + prepare(): { + RuleExit(rule: Rule): void; + }; +}; +declare const atRuleClonerPlugin: { + postcssPlugin: string; + prepare(): { + AtRuleExit(atRule: AtRule): void; + }; +}; +export { postcssTape, declarationClonerPlugin, ruleClonerPlugin, atRuleClonerPlugin }; diff --git a/packages/postcss-tape/dist/index.d.ts b/packages/postcss-tape/dist/index.d.ts index 25e66c357..5be0a7360 100644 --- a/packages/postcss-tape/dist/index.d.ts +++ b/packages/postcss-tape/dist/index.d.ts @@ -1,20 +1,42 @@ -import type { AtRule, Declaration, Rule } from 'postcss'; -import type { PluginCreator } from 'postcss'; -import type { TestCaseOptions } from './test-case-options'; -export declare function postcssTape(currentPlugin: PluginCreator): (options: Record) => Promise; -export declare const declarationClonerPlugin: { +import { AtRule, Declaration, Rule, PluginCreator, Plugin } from 'postcss'; +type TestCaseOptions = { + /** Debug message */ + message?: string; + /** Plugin options. Only used if `plugins` is not specified. */ + options?: unknown; + /** Plugins to use. When specified the original plugin is not used. */ + plugins?: Array; + /** The expected number of warnings. */ + warnings?: number; + /** Expected exception */ + /** NOTE: plugins should not throw exceptions, this goes against best practices. Use `errors` instead. */ + exception?: RegExp; + /** Override the file name of the "expect" file. */ + expect?: string; + /** Override the file name of the "result" file. */ + result?: string; + /** Do something before the test is run. */ + before?: () => void; + /** Do something after the test is run. */ + after?: () => void | Promise; + /** Process the test cases with "postcss-html" as the syntax */ + postcssSyntaxHTML?: boolean; +}; +declare function postcssTape(currentPlugin: PluginCreator): (options: Record) => Promise; +declare const declarationClonerPlugin: { postcssPlugin: string; Declaration(decl: Declaration): void; }; -export declare const ruleClonerPlugin: { +declare const ruleClonerPlugin: { postcssPlugin: string; prepare(): { RuleExit(rule: Rule): void; }; }; -export declare const atRuleClonerPlugin: { +declare const atRuleClonerPlugin: { postcssPlugin: string; prepare(): { AtRuleExit(atRule: AtRule): void; }; }; +export { postcssTape, declarationClonerPlugin, ruleClonerPlugin, atRuleClonerPlugin }; diff --git a/packages/postcss-tape/dist/noop-plugin.d.ts b/packages/postcss-tape/dist/noop-plugin.d.ts deleted file mode 100644 index 458abbc03..000000000 --- a/packages/postcss-tape/dist/noop-plugin.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare const noopPlugin: { - (): { - postcssPlugin: string; - Rule(): void; - }; - postcss: boolean; -}; -export default noopPlugin; diff --git a/packages/postcss-tape/dist/reduce-css-syntax-error.d.ts b/packages/postcss-tape/dist/reduce-css-syntax-error.d.ts deleted file mode 100644 index 0786db68e..000000000 --- a/packages/postcss-tape/dist/reduce-css-syntax-error.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { CssSyntaxError } from 'postcss'; -export declare function reduceInformationInCssSyntaxError(err: CssSyntaxError | TypeError): void; diff --git a/packages/selector-specificity/dist/index.d.cts b/packages/selector-specificity/dist/index.d.cts new file mode 100644 index 000000000..c6e826b9f --- /dev/null +++ b/packages/selector-specificity/dist/index.d.cts @@ -0,0 +1,9 @@ +import { Node } from 'postcss-selector-parser'; +type Specificity = { + a: number; + b: number; + c: number; +}; +declare function compare(s1: Specificity, s2: Specificity): number; +declare function selectorSpecificity(node: Node): Specificity; +export { Specificity, compare, selectorSpecificity }; diff --git a/packages/selector-specificity/dist/index.d.mts b/packages/selector-specificity/dist/index.d.mts new file mode 100644 index 000000000..c6e826b9f --- /dev/null +++ b/packages/selector-specificity/dist/index.d.mts @@ -0,0 +1,9 @@ +import { Node } from 'postcss-selector-parser'; +type Specificity = { + a: number; + b: number; + c: number; +}; +declare function compare(s1: Specificity, s2: Specificity): number; +declare function selectorSpecificity(node: Node): Specificity; +export { Specificity, compare, selectorSpecificity }; diff --git a/packages/selector-specificity/dist/index.d.ts b/packages/selector-specificity/dist/index.d.ts index f92ce6d84..c6e826b9f 100644 --- a/packages/selector-specificity/dist/index.d.ts +++ b/packages/selector-specificity/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { Node } from 'postcss-selector-parser'; -export type Specificity = { +import { Node } from 'postcss-selector-parser'; +type Specificity = { a: number; b: number; c: number; }; -export declare function compare(s1: Specificity, s2: Specificity): number; -export declare function selectorSpecificity(node: Node): Specificity; +declare function compare(s1: Specificity, s2: Specificity): number; +declare function selectorSpecificity(node: Node): Specificity; +export { Specificity, compare, selectorSpecificity }; diff --git a/packages/selector-specificity/dist/to-lower-case-a-z.d.ts b/packages/selector-specificity/dist/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e7..000000000 --- a/packages/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/packages/selector-specificity/package.json b/packages/selector-specificity/package.json index 36e083896..027bc31ff 100644 --- a/packages/selector-specificity/package.json +++ b/packages/selector-specificity/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/packages/selector-specificity/tsconfig.json b/packages/selector-specificity/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/packages/selector-specificity/tsconfig.json +++ b/packages/selector-specificity/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugin-packs/postcss-bundler/dist/index.d.cts b/plugin-packs/postcss-bundler/dist/index.d.cts new file mode 100644 index 000000000..c62ecadd2 --- /dev/null +++ b/plugin-packs/postcss-bundler/dist/index.d.cts @@ -0,0 +1,6 @@ +import { PluginCreator } from 'postcss'; +/** postcss-bundler plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugin-packs/postcss-bundler/dist/index.d.mts b/plugin-packs/postcss-bundler/dist/index.d.mts new file mode 100644 index 000000000..60eb4297a --- /dev/null +++ b/plugin-packs/postcss-bundler/dist/index.d.mts @@ -0,0 +1,5 @@ +import { PluginCreator } from 'postcss'; +/** postcss-bundler plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugin-packs/postcss-bundler/dist/index.d.ts b/plugin-packs/postcss-bundler/dist/index.d.ts index 4ea42dfa5..c62ecadd2 100644 --- a/plugin-packs/postcss-bundler/dist/index.d.ts +++ b/plugin-packs/postcss-bundler/dist/index.d.ts @@ -1,5 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-bundler plugin options */ -export type pluginOptions = never; +type pluginOptions = never; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/index.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/index.d.ts deleted file mode 100644 index 89d75c8fd..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/index.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { PluginCreator } from 'postcss'; -declare const creator: PluginCreator; -export default creator; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/apply-conditions.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/apply-conditions.d.ts deleted file mode 100644 index 76feb6286..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/apply-conditions.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AtRule, AtRuleProps } from 'postcss'; -import { Stylesheet } from './statement'; -export declare function applyConditions(stylesheet: Stylesheet, atRule: (defaults?: AtRuleProps) => AtRule): void; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/apply-styles.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/apply-styles.d.ts deleted file mode 100644 index 24534276e..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/apply-styles.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Document, Root } from 'postcss'; -import { Stylesheet } from './statement'; -export declare function applyStyles(stylesheet: Stylesheet, styles: Root | Document): void; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/base64-encoded-import.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/base64-encoded-import.d.ts deleted file mode 100644 index 8e8284439..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/base64-encoded-import.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Condition } from './conditions'; -export declare function base64EncodedConditionalImport(prelude: string, conditions: Array): string; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/conditions.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/conditions.d.ts deleted file mode 100644 index ce1378ac2..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/conditions.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export type Condition = { - layer?: string; - media?: string; - supports?: string; -}; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/data-url.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/data-url.d.ts deleted file mode 100644 index 54aa5ba4c..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/data-url.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare function isValidDataURL(url?: string): boolean; -export declare function dataURLContents(url: string): string; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/format-import-prelude.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/format-import-prelude.d.ts deleted file mode 100644 index 257b3fb06..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/format-import-prelude.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function formatImportPrelude(layer: string | undefined, media: string | undefined, supports: string | undefined): string; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/load-content.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/load-content.d.ts deleted file mode 100644 index 30257103e..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/load-content.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function loadContent(filename: string): Promise; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/names.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/names.d.ts deleted file mode 100644 index 94f8376a3..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/names.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -export declare const IS_CHARSET: RegExp; -export declare const IS_IMPORT: RegExp; -export declare const IS_URL: RegExp; -export declare const IS_LAYER: RegExp; -export declare const IS_SUPPORTS: RegExp; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/noop-plugin.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/noop-plugin.d.ts deleted file mode 100644 index 44b4ea068..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/noop-plugin.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -declare const noopPlugin: { - (): { - postcssPlugin: string; - Once(): void; - }; - postcss: boolean; -}; -export default noopPlugin; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-at-import.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-at-import.d.ts deleted file mode 100644 index 99a6bd2dd..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-at-import.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export declare function parseAtImport(params: string): false | { - uri: string; - fullUri: string; - layer?: string; - media?: string; - supports?: string; -}; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-styles.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-styles.d.ts deleted file mode 100644 index 4ff88c005..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-styles.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Document, Postcss, Result, Root, AtRule } from 'postcss'; -import { Stylesheet } from './statement'; -import { Condition } from './conditions'; -export declare function parseStyles(result: Result, styles: Root | Document, importingNode: AtRule | null, conditions: Array, from: Array, postcss: Postcss): Promise; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-stylesheet.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-stylesheet.d.ts deleted file mode 100644 index 55813909a..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/parse-stylesheet.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AtRule, Document, Result, Root } from 'postcss'; -import { Condition } from './conditions'; -import { Stylesheet } from './statement'; -export declare function parseStylesheet(result: Result, styles: Root | Document, importingNode: AtRule | null, conditions: Array, from: Array): Stylesheet; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/post-process.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/post-process.d.ts deleted file mode 100644 index 68c59c20b..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/post-process.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AtRule, AtRuleProps } from 'postcss'; -import { Stylesheet } from './statement'; -export declare function postProcess(stylesheet: Stylesheet, atRule: (defaults?: AtRuleProps) => AtRule): void; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/resolve-id.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/resolve-id.d.ts deleted file mode 100644 index 09c13df9d..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/resolve-id.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -/// -import type { Node, Result } from 'postcss'; -export declare function resolveId(node: Node, require: NodeRequire, id: string, base: string): string; -export declare function createRequire(node: Node, result: Result): [NodeRequire, string, string] | []; diff --git a/plugin-packs/postcss-bundler/dist/postcss-import/lib/statement.d.ts b/plugin-packs/postcss-bundler/dist/postcss-import/lib/statement.d.ts deleted file mode 100644 index 0ce12e518..000000000 --- a/plugin-packs/postcss-bundler/dist/postcss-import/lib/statement.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import type { AtRule, ChildNode, Warning } from 'postcss'; -import { Condition } from './conditions'; -export type Stylesheet = { - charset?: AtRule; - statements: Array; -}; -export type Statement = ImportStatement | PreImportStatement | NodesStatement | Warning; -export type NodesStatement = { - type: 'nodes'; - nodes: Array; - conditions: Array; - from: Array; - parent?: Statement; - importingNode: AtRule | null; -}; -export type ImportStatement = { - type: 'import'; - uri: string; - fullUri: string; - node: AtRule; - conditions: Array; - from: Array; - parent?: Statement; - stylesheet?: Stylesheet; - importingNode: AtRule | null; -}; -type PreImportStatement = { - type: 'pre-import'; - node: ChildNode; - conditions: Array; - from: Array; - parent?: Statement; - importingNode: AtRule | null; -}; -export declare function isWarning(stmt: Statement): stmt is Warning; -export declare function isNodesStatement(stmt: Statement): stmt is NodesStatement; -export declare function isImportStatement(stmt: Statement): stmt is ImportStatement; -export declare function isPreImportStatement(stmt: Statement): stmt is PreImportStatement; -export {}; diff --git a/plugin-packs/postcss-bundler/package.json b/plugin-packs/postcss-bundler/package.json index 8c2451714..51b654cef 100644 --- a/plugin-packs/postcss-bundler/package.json +++ b/plugin-packs/postcss-bundler/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugin-packs/postcss-bundler/tsconfig.json b/plugin-packs/postcss-bundler/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugin-packs/postcss-bundler/tsconfig.json +++ b/plugin-packs/postcss-bundler/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugin-packs/postcss-preset-env/dist/index.d.cts b/plugin-packs/postcss-preset-env/dist/index.d.cts new file mode 100644 index 000000000..9e8bf294f --- /dev/null +++ b/plugin-packs/postcss-preset-env/dist/index.d.cts @@ -0,0 +1,291 @@ +import autoprefixer from "autoprefixer"; +import { pluginOptions as postcssInitial } from "@csstools/postcss-initial"; +import { pluginOptions as postcssPseudoClassAnyLink } from "postcss-pseudo-class-any-link"; +import { pluginOptions as postcssBlankPseudo } from "css-blank-pseudo"; +import { pluginOptions as postcssCascadeLayers } from "@csstools/postcss-cascade-layers"; +import { pluginOptions as postcssAttributeCaseInsensitive } from "postcss-attribute-case-insensitive"; +import { pluginOptions as postcssColorFunction } from "@csstools/postcss-color-function"; +import { pluginOptions as postcssColorFunctionalNotation } from "postcss-color-functional-notation"; +import { pluginOptions as postcssColorMixFunction } from "@csstools/postcss-color-mix-function"; +import { pluginOptions as postcssCustomMedia } from "postcss-custom-media"; +import { pluginOptions as postcssCustomProperties } from "postcss-custom-properties"; +import { pluginOptions as postcssCustomSelectors } from "postcss-custom-selectors"; +import { pluginOptions as postcssDirPseudoClass } from "postcss-dir-pseudo-class"; +import { pluginOptions as postcssNormalizeDisplayValues } from "@csstools/postcss-normalize-display-values"; +import { pluginOptions as postcssDoublePositionGradients } from "postcss-double-position-gradients"; +import { pluginOptions as postcssExponentialFunctions } from "@csstools/postcss-exponential-functions"; +import { pluginOptions as postcssLogicalFloatAndClear } from "@csstools/postcss-logical-float-and-clear"; +import { pluginOptions as postcssFocusVisible } from "postcss-focus-visible"; +import { pluginOptions as postcssFocusWithin } from "postcss-focus-within"; +import { pluginOptions as postcssFontFormatKeywords } from "@csstools/postcss-font-format-keywords"; +import { pluginOptions as postcssGamutMapping } from "@csstools/postcss-gamut-mapping"; +import { pluginOptions as postcssGapProperties } from "postcss-gap-properties"; +import { pluginOptions as postcssGradientsInterpolationMethod } from "@csstools/postcss-gradients-interpolation-method"; +import { pluginOptions as postcssHasPseudo } from "css-has-pseudo"; +import { pluginOptions as postcssColorHexAlpha } from "postcss-color-hex-alpha"; +import { pluginOptions as postcssHWBFunction } from "@csstools/postcss-hwb-function"; +import { pluginOptions as postcssICUnit } from "@csstools/postcss-ic-unit"; +import { pluginOptions as postcssImageSetFunction } from "postcss-image-set-function"; +import { pluginOptions as postcssIsPseudoClass } from "@csstools/postcss-is-pseudo-class"; +import { pluginOptions as postcssLabFunction } from "postcss-lab-function"; +import { pluginOptions as postcssLogicalOverflow } from "@csstools/postcss-logical-overflow"; +import { pluginOptions as postcssLogicalOverscrollBehavor } from "@csstools/postcss-logical-overscroll-behavior"; +import { pluginOptions as postcssLogical } from "postcss-logical"; +import { pluginOptions as postcssLogicalResize } from "@csstools/postcss-logical-resize"; +import { pluginOptions as postcssLogicalViewportUnits } from "@csstools/postcss-logical-viewport-units"; +import { pluginOptions as postcssMediaQueriesAspectRatioNumberValues } from "@csstools/postcss-media-queries-aspect-ratio-number-values"; +import { pluginOptions as postcssMediaMinmax } from "@csstools/postcss-media-minmax"; +import { pluginOptions as postcssNestedCalc } from "@csstools/postcss-nested-calc"; +import { pluginOptions as postcssNesting } from "postcss-nesting"; +import { pluginOptions as postcssSelectorNot } from "postcss-selector-not"; +import { pluginOptions as postcssOKLabFunction } from "@csstools/postcss-oklab-function"; +import { pluginOptions as postcssOverflowShorthand } from "postcss-overflow-shorthand"; +import { pluginOptions as postcssPlace } from "postcss-place"; +import { pluginOptions as postcssPrefersColorScheme } from "css-prefers-color-scheme"; +import { pluginOptions as postcssColorRebeccapurple } from "postcss-color-rebeccapurple"; +import { pluginOptions as postcssRelativeColorSyntax } from "@csstools/postcss-relative-color-syntax"; +import { pluginOptions as postcssScopePseudoClass } from "@csstools/postcss-scope-pseudo-class"; +import { pluginOptions as postcssSteppedValueFunctions } from "@csstools/postcss-stepped-value-functions"; +import { pluginOptions as postcssTextDecorationShorthand } from "@csstools/postcss-text-decoration-shorthand"; +import { pluginOptions as postcssTrigonometricFunctions } from "@csstools/postcss-trigonometric-functions"; +import { pluginOptions as postcssUnsetValue } from "@csstools/postcss-unset-value"; +import { PluginCreator } from 'postcss'; +/** postcss-page-break plugin options */ +type pluginOptions = Record; +type postcssPageBreak = pluginOptions; +/** postcss-clamp plugin options */ +type pluginOptions$0 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** + * The precalculate option determines whether values with the same unit should be precalculated. + * default: false + */ + precalculate?: boolean; +}; +type postcssClamp = pluginOptions$0; +/** postcss-font-variant plugin options */ +type pluginOptions$1 = Record; +type postcssFontVariant = pluginOptions$1; +/** postcss-opacity-percentage plugin options */ +type pluginOptions$2 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +type postcssOpacityPercentage = pluginOptions$2; +/** postcss-replace-overflow-wrap plugin options */ +type pluginOptions$3 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +type postcssReplaceOverflowWrap = pluginOptions$3; +/** postcss-system-ui-font-family plugin options */ +type pluginOptions$4 = Record; +type postcssFontFamilySystemUI = pluginOptions$4; +type pluginsOptions = { + /** plugin options for "@csstools/postcss-initial" */ + "all-property"?: postcssInitial | boolean; + /** plugin options for "postcss-pseudo-class-any-link" */ + "any-link-pseudo-class"?: postcssPseudoClassAnyLink | boolean; + /** plugin options for "css-blank-pseudo" */ + "blank-pseudo-class"?: postcssBlankPseudo | boolean; + /** plugin options for "postcss-page-break" */ + "break-properties"?: postcssPageBreak | boolean; + /** plugin options for "@csstools/postcss-cascade-layers" */ + "cascade-layers"?: postcssCascadeLayers | boolean; + /** plugin options for "postcss-attribute-case-insensitive" */ + "case-insensitive-attributes"?: postcssAttributeCaseInsensitive | boolean; + /** plugin options for "postcss-clamp" */ + "clamp"?: postcssClamp | boolean; + /** plugin options for "@csstools/postcss-color-function" */ + "color-function"?: postcssColorFunction | boolean; + /** plugin options for "postcss-color-functional-notation" */ + "color-functional-notation"?: postcssColorFunctionalNotation | boolean; + /** plugin options for "@csstools/postcss-color-mix-function" */ + "color-mix"?: postcssColorMixFunction | boolean; + /** plugin options for "postcss-custom-media" */ + "custom-media-queries"?: postcssCustomMedia | boolean; + /** plugin options for "postcss-custom-properties" */ + "custom-properties"?: postcssCustomProperties | boolean; + /** plugin options for "postcss-custom-selectors" */ + "custom-selectors"?: postcssCustomSelectors | boolean; + /** plugin options for "postcss-dir-pseudo-class" */ + "dir-pseudo-class"?: postcssDirPseudoClass | boolean; + /** plugin options for "@csstools/postcss-normalize-display-values" */ + "display-two-values"?: postcssNormalizeDisplayValues | boolean; + /** plugin options for "postcss-double-position-gradients" */ + "double-position-gradients"?: postcssDoublePositionGradients | boolean; + /** plugin options for "@csstools/postcss-exponential-functions" */ + "exponential-functions"?: postcssExponentialFunctions | boolean; + /** plugin options for "@csstools/postcss-logical-float-and-clear" */ + "float-clear-logical-values"?: postcssLogicalFloatAndClear | boolean; + /** plugin options for "postcss-focus-visible" */ + "focus-visible-pseudo-class"?: postcssFocusVisible | boolean; + /** plugin options for "postcss-focus-within" */ + "focus-within-pseudo-class"?: postcssFocusWithin | boolean; + /** plugin options for "@csstools/postcss-font-format-keywords" */ + "font-format-keywords"?: postcssFontFormatKeywords | boolean; + /** plugin options for "postcss-font-variant" */ + "font-variant-property"?: postcssFontVariant | boolean; + /** plugin options for "@csstools/postcss-gamut-mapping" */ + "gamut-mapping"?: postcssGamutMapping | boolean; + /** plugin options for "postcss-gap-properties" */ + "gap-properties"?: postcssGapProperties | boolean; + /** plugin options for "@csstools/postcss-gradients-interpolation-method" */ + "gradients-interpolation-method"?: postcssGradientsInterpolationMethod | boolean; + /** plugin options for "css-has-pseudo" */ + "has-pseudo-class"?: postcssHasPseudo | boolean; + /** plugin options for "postcss-color-hex-alpha" */ + "hexadecimal-alpha-notation"?: postcssColorHexAlpha | boolean; + /** plugin options for "@csstools/postcss-hwb-function" */ + "hwb-function"?: postcssHWBFunction | boolean; + /** plugin options for "@csstools/postcss-ic-unit" */ + "ic-unit"?: postcssICUnit | boolean; + /** plugin options for "postcss-image-set-function" */ + "image-set-function"?: postcssImageSetFunction | boolean; + /** plugin options for "@csstools/postcss-is-pseudo-class" */ + "is-pseudo-class"?: postcssIsPseudoClass | boolean; + /** plugin options for "postcss-lab-function" */ + "lab-function"?: postcssLabFunction | boolean; + /** plugin options for "@csstools/postcss-logical-overflow" */ + "logical-overflow"?: postcssLogicalOverflow | boolean; + /** plugin options for "@csstools/postcss-logical-overscroll-behavior" */ + "logical-overscroll-behavior"?: postcssLogicalOverscrollBehavor | boolean; + /** plugin options for "postcss-logical" */ + "logical-properties-and-values"?: postcssLogical | boolean; + /** plugin options for "@csstools/postcss-logical-resize" */ + "logical-resize"?: postcssLogicalResize | boolean; + /** plugin options for "@csstools/postcss-logical-viewport-units" */ + "logical-viewport-units"?: postcssLogicalViewportUnits | boolean; + /** plugin options for "@csstools/postcss-media-queries-aspect-ratio-number-values" */ + "media-queries-aspect-ratio-number-values"?: postcssMediaQueriesAspectRatioNumberValues | boolean; + /** plugin options for "@csstools/postcss-media-minmax" */ + "media-query-ranges"?: postcssMediaMinmax | boolean; + /** plugin options for "@csstools/postcss-nested-calc" */ + "nested-calc"?: postcssNestedCalc | boolean; + /** plugin options for "postcss-nesting" */ + "nesting-rules"?: postcssNesting | boolean; + /** plugin options for "postcss-selector-not" */ + "not-pseudo-class"?: postcssSelectorNot | boolean; + /** plugin options for "@csstools/postcss-oklab-function" */ + "oklab-function"?: postcssOKLabFunction | boolean; + /** plugin options for "postcss-opacity-percentage" */ + "opacity-percentage"?: postcssOpacityPercentage | boolean; + /** plugin options for "postcss-overflow-shorthand" */ + "overflow-property"?: postcssOverflowShorthand | boolean; + /** plugin options for "postcss-replace-overflow-wrap" */ + "overflow-wrap-property"?: postcssReplaceOverflowWrap | boolean; + /** plugin options for "postcss-place" */ + "place-properties"?: postcssPlace | boolean; + /** plugin options for "css-prefers-color-scheme" */ + "prefers-color-scheme-query"?: postcssPrefersColorScheme | boolean; + /** plugin options for "postcss-color-rebeccapurple" */ + "rebeccapurple-color"?: postcssColorRebeccapurple | boolean; + /** plugin options for "@csstools/postcss-relative-color-syntax" */ + "relative-color-syntax"?: postcssRelativeColorSyntax | boolean; + /** plugin options for "@csstools/postcss-scope-pseudo-class" */ + "scope-pseudo-class"?: postcssScopePseudoClass | boolean; + /** plugin options for "@csstools/postcss-stepped-value-functions" */ + "stepped-value-functions"?: postcssSteppedValueFunctions | boolean; + /** plugin options for "postcss-system-ui-font-family" */ + "system-ui-font-family"?: postcssFontFamilySystemUI | boolean; + /** plugin options for "@csstools/postcss-text-decoration-shorthand" */ + "text-decoration-shorthand"?: postcssTextDecorationShorthand | boolean; + /** plugin options for "@csstools/postcss-trigonometric-functions" */ + "trigonometric-functions"?: postcssTrigonometricFunctions | boolean; + /** plugin options for "@csstools/postcss-unset-value" */ + "unset-value"?: postcssUnsetValue | boolean; +}; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +type pluginOptions$5 = { + /** + * Determine which CSS features to polyfill, + * based upon their process in becoming web standards. + * default: 2 + */ + stage?: number | false; + /** + * Determine which CSS features to polyfill, + * based their implementation status. + * default: 0 + */ + minimumVendorImplementations?: number; + /** + * Enable any feature that would need an extra browser library to be loaded into the page for it to work. + * default: false + */ + enableClientSidePolyfills?: boolean; + /** + * PostCSS Preset Env supports any standard browserslist configuration, + * which can be a `.browserslistrc` file, + * a `browserslist` key in `package.json`, + * or `browserslist` environment variables. + * + * The `env` option is used to select a specific browserslist environment in the event that you have more than one. + */ + env?: string; + /** + * PostCSS Preset Env supports any standard browserslist configuration, + * which can be a `.browserslistrc` file, + * a `browserslist` key in `package.json`, + * or `browserslist` environment variables. + * + * The `browsers` option should only be used when a standard browserslist configuration is not available. + * When the `browsers` option is used the `env` option is ignored. + */ + browsers?: string | Array | null; + /** + * Determine whether all plugins should receive a `preserve` option, + * which may preserve or remove the original and now polyfilled CSS. + * Each plugin has it's own default, some true, others false. + * default: _not set_ + */ + preserve?: boolean; + /** + * [Configure autoprefixer](https://github.com/postcss/autoprefixer#options) + */ + autoprefixer?: autoprefixer.Options; + /** + * Enable or disable specific polyfills by ID. + * Passing `true` to a specific [feature ID](https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md) will enable its polyfill, + * while passing `false` will disable it. + * + * Passing an object to a specific feature ID will both enable and configure it. + */ + features?: pluginsOptions; + /** + * The `insertBefore` key allows you to insert other PostCSS plugins into the chain. + * This is only useful if you are also using sugary PostCSS plugins that must execute before certain polyfills. + * `insertBefore` supports chaining one or multiple plugins. + */ + insertBefore?: Record; + /** + * The `insertAfter` key allows you to insert other PostCSS plugins into the chain. + * This is only useful if you are also using sugary PostCSS plugins that must execute after certain polyfills. + * `insertAfter` supports chaining one or multiple plugins. + */ + insertAfter?: Record; + /** + * Enable debugging messages to stdout giving insights into which features have been enabled/disabled and why. + * default: false + */ + debug?: boolean; + /** + * The `logical` object allows to configure all plugins related to logical document flow at once. + * It accepts the same options as each plugin: `inlineDirection` and `blockDirection`. + */ + logical?: { + /** Set the inline flow direction. default: left-to-right */ + inlineDirection?: DirectionFlow; + /** Set the block flow direction. default: top-to-bottom */ + blockDirection?: DirectionFlow; + }; +}; +declare const creator: PluginCreator; +export type { pluginOptions$5 as pluginOptions }; +export = creator; diff --git a/plugin-packs/postcss-preset-env/dist/index.d.mts b/plugin-packs/postcss-preset-env/dist/index.d.mts new file mode 100644 index 000000000..7a865bc72 --- /dev/null +++ b/plugin-packs/postcss-preset-env/dist/index.d.mts @@ -0,0 +1,291 @@ +import autoprefixer from "autoprefixer"; +import { pluginOptions as postcssInitial } from "@csstools/postcss-initial"; +import { pluginOptions as postcssPseudoClassAnyLink } from "postcss-pseudo-class-any-link"; +import { pluginOptions as postcssBlankPseudo } from "css-blank-pseudo"; +import { pluginOptions as postcssCascadeLayers } from "@csstools/postcss-cascade-layers"; +import { pluginOptions as postcssAttributeCaseInsensitive } from "postcss-attribute-case-insensitive"; +import { pluginOptions as postcssColorFunction } from "@csstools/postcss-color-function"; +import { pluginOptions as postcssColorFunctionalNotation } from "postcss-color-functional-notation"; +import { pluginOptions as postcssColorMixFunction } from "@csstools/postcss-color-mix-function"; +import { pluginOptions as postcssCustomMedia } from "postcss-custom-media"; +import { pluginOptions as postcssCustomProperties } from "postcss-custom-properties"; +import { pluginOptions as postcssCustomSelectors } from "postcss-custom-selectors"; +import { pluginOptions as postcssDirPseudoClass } from "postcss-dir-pseudo-class"; +import { pluginOptions as postcssNormalizeDisplayValues } from "@csstools/postcss-normalize-display-values"; +import { pluginOptions as postcssDoublePositionGradients } from "postcss-double-position-gradients"; +import { pluginOptions as postcssExponentialFunctions } from "@csstools/postcss-exponential-functions"; +import { pluginOptions as postcssLogicalFloatAndClear } from "@csstools/postcss-logical-float-and-clear"; +import { pluginOptions as postcssFocusVisible } from "postcss-focus-visible"; +import { pluginOptions as postcssFocusWithin } from "postcss-focus-within"; +import { pluginOptions as postcssFontFormatKeywords } from "@csstools/postcss-font-format-keywords"; +import { pluginOptions as postcssGamutMapping } from "@csstools/postcss-gamut-mapping"; +import { pluginOptions as postcssGapProperties } from "postcss-gap-properties"; +import { pluginOptions as postcssGradientsInterpolationMethod } from "@csstools/postcss-gradients-interpolation-method"; +import { pluginOptions as postcssHasPseudo } from "css-has-pseudo"; +import { pluginOptions as postcssColorHexAlpha } from "postcss-color-hex-alpha"; +import { pluginOptions as postcssHWBFunction } from "@csstools/postcss-hwb-function"; +import { pluginOptions as postcssICUnit } from "@csstools/postcss-ic-unit"; +import { pluginOptions as postcssImageSetFunction } from "postcss-image-set-function"; +import { pluginOptions as postcssIsPseudoClass } from "@csstools/postcss-is-pseudo-class"; +import { pluginOptions as postcssLabFunction } from "postcss-lab-function"; +import { pluginOptions as postcssLogicalOverflow } from "@csstools/postcss-logical-overflow"; +import { pluginOptions as postcssLogicalOverscrollBehavor } from "@csstools/postcss-logical-overscroll-behavior"; +import { pluginOptions as postcssLogical } from "postcss-logical"; +import { pluginOptions as postcssLogicalResize } from "@csstools/postcss-logical-resize"; +import { pluginOptions as postcssLogicalViewportUnits } from "@csstools/postcss-logical-viewport-units"; +import { pluginOptions as postcssMediaQueriesAspectRatioNumberValues } from "@csstools/postcss-media-queries-aspect-ratio-number-values"; +import { pluginOptions as postcssMediaMinmax } from "@csstools/postcss-media-minmax"; +import { pluginOptions as postcssNestedCalc } from "@csstools/postcss-nested-calc"; +import { pluginOptions as postcssNesting } from "postcss-nesting"; +import { pluginOptions as postcssSelectorNot } from "postcss-selector-not"; +import { pluginOptions as postcssOKLabFunction } from "@csstools/postcss-oklab-function"; +import { pluginOptions as postcssOverflowShorthand } from "postcss-overflow-shorthand"; +import { pluginOptions as postcssPlace } from "postcss-place"; +import { pluginOptions as postcssPrefersColorScheme } from "css-prefers-color-scheme"; +import { pluginOptions as postcssColorRebeccapurple } from "postcss-color-rebeccapurple"; +import { pluginOptions as postcssRelativeColorSyntax } from "@csstools/postcss-relative-color-syntax"; +import { pluginOptions as postcssScopePseudoClass } from "@csstools/postcss-scope-pseudo-class"; +import { pluginOptions as postcssSteppedValueFunctions } from "@csstools/postcss-stepped-value-functions"; +import { pluginOptions as postcssTextDecorationShorthand } from "@csstools/postcss-text-decoration-shorthand"; +import { pluginOptions as postcssTrigonometricFunctions } from "@csstools/postcss-trigonometric-functions"; +import { pluginOptions as postcssUnsetValue } from "@csstools/postcss-unset-value"; +import { PluginCreator } from 'postcss'; +/** postcss-page-break plugin options */ +type pluginOptions = Record; +type postcssPageBreak = pluginOptions; +/** postcss-clamp plugin options */ +type pluginOptions$0 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** + * The precalculate option determines whether values with the same unit should be precalculated. + * default: false + */ + precalculate?: boolean; +}; +type postcssClamp = pluginOptions$0; +/** postcss-font-variant plugin options */ +type pluginOptions$1 = Record; +type postcssFontVariant = pluginOptions$1; +/** postcss-opacity-percentage plugin options */ +type pluginOptions$2 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +type postcssOpacityPercentage = pluginOptions$2; +/** postcss-replace-overflow-wrap plugin options */ +type pluginOptions$3 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +type postcssReplaceOverflowWrap = pluginOptions$3; +/** postcss-system-ui-font-family plugin options */ +type pluginOptions$4 = Record; +type postcssFontFamilySystemUI = pluginOptions$4; +type pluginsOptions = { + /** plugin options for "@csstools/postcss-initial" */ + "all-property"?: postcssInitial | boolean; + /** plugin options for "postcss-pseudo-class-any-link" */ + "any-link-pseudo-class"?: postcssPseudoClassAnyLink | boolean; + /** plugin options for "css-blank-pseudo" */ + "blank-pseudo-class"?: postcssBlankPseudo | boolean; + /** plugin options for "postcss-page-break" */ + "break-properties"?: postcssPageBreak | boolean; + /** plugin options for "@csstools/postcss-cascade-layers" */ + "cascade-layers"?: postcssCascadeLayers | boolean; + /** plugin options for "postcss-attribute-case-insensitive" */ + "case-insensitive-attributes"?: postcssAttributeCaseInsensitive | boolean; + /** plugin options for "postcss-clamp" */ + "clamp"?: postcssClamp | boolean; + /** plugin options for "@csstools/postcss-color-function" */ + "color-function"?: postcssColorFunction | boolean; + /** plugin options for "postcss-color-functional-notation" */ + "color-functional-notation"?: postcssColorFunctionalNotation | boolean; + /** plugin options for "@csstools/postcss-color-mix-function" */ + "color-mix"?: postcssColorMixFunction | boolean; + /** plugin options for "postcss-custom-media" */ + "custom-media-queries"?: postcssCustomMedia | boolean; + /** plugin options for "postcss-custom-properties" */ + "custom-properties"?: postcssCustomProperties | boolean; + /** plugin options for "postcss-custom-selectors" */ + "custom-selectors"?: postcssCustomSelectors | boolean; + /** plugin options for "postcss-dir-pseudo-class" */ + "dir-pseudo-class"?: postcssDirPseudoClass | boolean; + /** plugin options for "@csstools/postcss-normalize-display-values" */ + "display-two-values"?: postcssNormalizeDisplayValues | boolean; + /** plugin options for "postcss-double-position-gradients" */ + "double-position-gradients"?: postcssDoublePositionGradients | boolean; + /** plugin options for "@csstools/postcss-exponential-functions" */ + "exponential-functions"?: postcssExponentialFunctions | boolean; + /** plugin options for "@csstools/postcss-logical-float-and-clear" */ + "float-clear-logical-values"?: postcssLogicalFloatAndClear | boolean; + /** plugin options for "postcss-focus-visible" */ + "focus-visible-pseudo-class"?: postcssFocusVisible | boolean; + /** plugin options for "postcss-focus-within" */ + "focus-within-pseudo-class"?: postcssFocusWithin | boolean; + /** plugin options for "@csstools/postcss-font-format-keywords" */ + "font-format-keywords"?: postcssFontFormatKeywords | boolean; + /** plugin options for "postcss-font-variant" */ + "font-variant-property"?: postcssFontVariant | boolean; + /** plugin options for "@csstools/postcss-gamut-mapping" */ + "gamut-mapping"?: postcssGamutMapping | boolean; + /** plugin options for "postcss-gap-properties" */ + "gap-properties"?: postcssGapProperties | boolean; + /** plugin options for "@csstools/postcss-gradients-interpolation-method" */ + "gradients-interpolation-method"?: postcssGradientsInterpolationMethod | boolean; + /** plugin options for "css-has-pseudo" */ + "has-pseudo-class"?: postcssHasPseudo | boolean; + /** plugin options for "postcss-color-hex-alpha" */ + "hexadecimal-alpha-notation"?: postcssColorHexAlpha | boolean; + /** plugin options for "@csstools/postcss-hwb-function" */ + "hwb-function"?: postcssHWBFunction | boolean; + /** plugin options for "@csstools/postcss-ic-unit" */ + "ic-unit"?: postcssICUnit | boolean; + /** plugin options for "postcss-image-set-function" */ + "image-set-function"?: postcssImageSetFunction | boolean; + /** plugin options for "@csstools/postcss-is-pseudo-class" */ + "is-pseudo-class"?: postcssIsPseudoClass | boolean; + /** plugin options for "postcss-lab-function" */ + "lab-function"?: postcssLabFunction | boolean; + /** plugin options for "@csstools/postcss-logical-overflow" */ + "logical-overflow"?: postcssLogicalOverflow | boolean; + /** plugin options for "@csstools/postcss-logical-overscroll-behavior" */ + "logical-overscroll-behavior"?: postcssLogicalOverscrollBehavor | boolean; + /** plugin options for "postcss-logical" */ + "logical-properties-and-values"?: postcssLogical | boolean; + /** plugin options for "@csstools/postcss-logical-resize" */ + "logical-resize"?: postcssLogicalResize | boolean; + /** plugin options for "@csstools/postcss-logical-viewport-units" */ + "logical-viewport-units"?: postcssLogicalViewportUnits | boolean; + /** plugin options for "@csstools/postcss-media-queries-aspect-ratio-number-values" */ + "media-queries-aspect-ratio-number-values"?: postcssMediaQueriesAspectRatioNumberValues | boolean; + /** plugin options for "@csstools/postcss-media-minmax" */ + "media-query-ranges"?: postcssMediaMinmax | boolean; + /** plugin options for "@csstools/postcss-nested-calc" */ + "nested-calc"?: postcssNestedCalc | boolean; + /** plugin options for "postcss-nesting" */ + "nesting-rules"?: postcssNesting | boolean; + /** plugin options for "postcss-selector-not" */ + "not-pseudo-class"?: postcssSelectorNot | boolean; + /** plugin options for "@csstools/postcss-oklab-function" */ + "oklab-function"?: postcssOKLabFunction | boolean; + /** plugin options for "postcss-opacity-percentage" */ + "opacity-percentage"?: postcssOpacityPercentage | boolean; + /** plugin options for "postcss-overflow-shorthand" */ + "overflow-property"?: postcssOverflowShorthand | boolean; + /** plugin options for "postcss-replace-overflow-wrap" */ + "overflow-wrap-property"?: postcssReplaceOverflowWrap | boolean; + /** plugin options for "postcss-place" */ + "place-properties"?: postcssPlace | boolean; + /** plugin options for "css-prefers-color-scheme" */ + "prefers-color-scheme-query"?: postcssPrefersColorScheme | boolean; + /** plugin options for "postcss-color-rebeccapurple" */ + "rebeccapurple-color"?: postcssColorRebeccapurple | boolean; + /** plugin options for "@csstools/postcss-relative-color-syntax" */ + "relative-color-syntax"?: postcssRelativeColorSyntax | boolean; + /** plugin options for "@csstools/postcss-scope-pseudo-class" */ + "scope-pseudo-class"?: postcssScopePseudoClass | boolean; + /** plugin options for "@csstools/postcss-stepped-value-functions" */ + "stepped-value-functions"?: postcssSteppedValueFunctions | boolean; + /** plugin options for "postcss-system-ui-font-family" */ + "system-ui-font-family"?: postcssFontFamilySystemUI | boolean; + /** plugin options for "@csstools/postcss-text-decoration-shorthand" */ + "text-decoration-shorthand"?: postcssTextDecorationShorthand | boolean; + /** plugin options for "@csstools/postcss-trigonometric-functions" */ + "trigonometric-functions"?: postcssTrigonometricFunctions | boolean; + /** plugin options for "@csstools/postcss-unset-value" */ + "unset-value"?: postcssUnsetValue | boolean; +}; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +type pluginOptions$5 = { + /** + * Determine which CSS features to polyfill, + * based upon their process in becoming web standards. + * default: 2 + */ + stage?: number | false; + /** + * Determine which CSS features to polyfill, + * based their implementation status. + * default: 0 + */ + minimumVendorImplementations?: number; + /** + * Enable any feature that would need an extra browser library to be loaded into the page for it to work. + * default: false + */ + enableClientSidePolyfills?: boolean; + /** + * PostCSS Preset Env supports any standard browserslist configuration, + * which can be a `.browserslistrc` file, + * a `browserslist` key in `package.json`, + * or `browserslist` environment variables. + * + * The `env` option is used to select a specific browserslist environment in the event that you have more than one. + */ + env?: string; + /** + * PostCSS Preset Env supports any standard browserslist configuration, + * which can be a `.browserslistrc` file, + * a `browserslist` key in `package.json`, + * or `browserslist` environment variables. + * + * The `browsers` option should only be used when a standard browserslist configuration is not available. + * When the `browsers` option is used the `env` option is ignored. + */ + browsers?: string | Array | null; + /** + * Determine whether all plugins should receive a `preserve` option, + * which may preserve or remove the original and now polyfilled CSS. + * Each plugin has it's own default, some true, others false. + * default: _not set_ + */ + preserve?: boolean; + /** + * [Configure autoprefixer](https://github.com/postcss/autoprefixer#options) + */ + autoprefixer?: autoprefixer.Options; + /** + * Enable or disable specific polyfills by ID. + * Passing `true` to a specific [feature ID](https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md) will enable its polyfill, + * while passing `false` will disable it. + * + * Passing an object to a specific feature ID will both enable and configure it. + */ + features?: pluginsOptions; + /** + * The `insertBefore` key allows you to insert other PostCSS plugins into the chain. + * This is only useful if you are also using sugary PostCSS plugins that must execute before certain polyfills. + * `insertBefore` supports chaining one or multiple plugins. + */ + insertBefore?: Record; + /** + * The `insertAfter` key allows you to insert other PostCSS plugins into the chain. + * This is only useful if you are also using sugary PostCSS plugins that must execute after certain polyfills. + * `insertAfter` supports chaining one or multiple plugins. + */ + insertAfter?: Record; + /** + * Enable debugging messages to stdout giving insights into which features have been enabled/disabled and why. + * default: false + */ + debug?: boolean; + /** + * The `logical` object allows to configure all plugins related to logical document flow at once. + * It accepts the same options as each plugin: `inlineDirection` and `blockDirection`. + */ + logical?: { + /** Set the inline flow direction. default: left-to-right */ + inlineDirection?: DirectionFlow; + /** Set the block flow direction. default: top-to-bottom */ + blockDirection?: DirectionFlow; + }; +}; +declare const creator: PluginCreator; +export type { pluginOptions$5 as pluginOptions }; +export { creator as default }; diff --git a/plugin-packs/postcss-preset-env/dist/index.d.ts b/plugin-packs/postcss-preset-env/dist/index.d.ts index 8ffa75d06..9e8bf294f 100644 --- a/plugin-packs/postcss-preset-env/dist/index.d.ts +++ b/plugin-packs/postcss-preset-env/dist/index.d.ts @@ -1,5 +1,291 @@ -import type { pluginOptions } from './options'; -import type { PluginCreator } from 'postcss'; -export type { pluginOptions } from './options'; -declare const creator: PluginCreator; -export default creator; +import autoprefixer from "autoprefixer"; +import { pluginOptions as postcssInitial } from "@csstools/postcss-initial"; +import { pluginOptions as postcssPseudoClassAnyLink } from "postcss-pseudo-class-any-link"; +import { pluginOptions as postcssBlankPseudo } from "css-blank-pseudo"; +import { pluginOptions as postcssCascadeLayers } from "@csstools/postcss-cascade-layers"; +import { pluginOptions as postcssAttributeCaseInsensitive } from "postcss-attribute-case-insensitive"; +import { pluginOptions as postcssColorFunction } from "@csstools/postcss-color-function"; +import { pluginOptions as postcssColorFunctionalNotation } from "postcss-color-functional-notation"; +import { pluginOptions as postcssColorMixFunction } from "@csstools/postcss-color-mix-function"; +import { pluginOptions as postcssCustomMedia } from "postcss-custom-media"; +import { pluginOptions as postcssCustomProperties } from "postcss-custom-properties"; +import { pluginOptions as postcssCustomSelectors } from "postcss-custom-selectors"; +import { pluginOptions as postcssDirPseudoClass } from "postcss-dir-pseudo-class"; +import { pluginOptions as postcssNormalizeDisplayValues } from "@csstools/postcss-normalize-display-values"; +import { pluginOptions as postcssDoublePositionGradients } from "postcss-double-position-gradients"; +import { pluginOptions as postcssExponentialFunctions } from "@csstools/postcss-exponential-functions"; +import { pluginOptions as postcssLogicalFloatAndClear } from "@csstools/postcss-logical-float-and-clear"; +import { pluginOptions as postcssFocusVisible } from "postcss-focus-visible"; +import { pluginOptions as postcssFocusWithin } from "postcss-focus-within"; +import { pluginOptions as postcssFontFormatKeywords } from "@csstools/postcss-font-format-keywords"; +import { pluginOptions as postcssGamutMapping } from "@csstools/postcss-gamut-mapping"; +import { pluginOptions as postcssGapProperties } from "postcss-gap-properties"; +import { pluginOptions as postcssGradientsInterpolationMethod } from "@csstools/postcss-gradients-interpolation-method"; +import { pluginOptions as postcssHasPseudo } from "css-has-pseudo"; +import { pluginOptions as postcssColorHexAlpha } from "postcss-color-hex-alpha"; +import { pluginOptions as postcssHWBFunction } from "@csstools/postcss-hwb-function"; +import { pluginOptions as postcssICUnit } from "@csstools/postcss-ic-unit"; +import { pluginOptions as postcssImageSetFunction } from "postcss-image-set-function"; +import { pluginOptions as postcssIsPseudoClass } from "@csstools/postcss-is-pseudo-class"; +import { pluginOptions as postcssLabFunction } from "postcss-lab-function"; +import { pluginOptions as postcssLogicalOverflow } from "@csstools/postcss-logical-overflow"; +import { pluginOptions as postcssLogicalOverscrollBehavor } from "@csstools/postcss-logical-overscroll-behavior"; +import { pluginOptions as postcssLogical } from "postcss-logical"; +import { pluginOptions as postcssLogicalResize } from "@csstools/postcss-logical-resize"; +import { pluginOptions as postcssLogicalViewportUnits } from "@csstools/postcss-logical-viewport-units"; +import { pluginOptions as postcssMediaQueriesAspectRatioNumberValues } from "@csstools/postcss-media-queries-aspect-ratio-number-values"; +import { pluginOptions as postcssMediaMinmax } from "@csstools/postcss-media-minmax"; +import { pluginOptions as postcssNestedCalc } from "@csstools/postcss-nested-calc"; +import { pluginOptions as postcssNesting } from "postcss-nesting"; +import { pluginOptions as postcssSelectorNot } from "postcss-selector-not"; +import { pluginOptions as postcssOKLabFunction } from "@csstools/postcss-oklab-function"; +import { pluginOptions as postcssOverflowShorthand } from "postcss-overflow-shorthand"; +import { pluginOptions as postcssPlace } from "postcss-place"; +import { pluginOptions as postcssPrefersColorScheme } from "css-prefers-color-scheme"; +import { pluginOptions as postcssColorRebeccapurple } from "postcss-color-rebeccapurple"; +import { pluginOptions as postcssRelativeColorSyntax } from "@csstools/postcss-relative-color-syntax"; +import { pluginOptions as postcssScopePseudoClass } from "@csstools/postcss-scope-pseudo-class"; +import { pluginOptions as postcssSteppedValueFunctions } from "@csstools/postcss-stepped-value-functions"; +import { pluginOptions as postcssTextDecorationShorthand } from "@csstools/postcss-text-decoration-shorthand"; +import { pluginOptions as postcssTrigonometricFunctions } from "@csstools/postcss-trigonometric-functions"; +import { pluginOptions as postcssUnsetValue } from "@csstools/postcss-unset-value"; +import { PluginCreator } from 'postcss'; +/** postcss-page-break plugin options */ +type pluginOptions = Record; +type postcssPageBreak = pluginOptions; +/** postcss-clamp plugin options */ +type pluginOptions$0 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** + * The precalculate option determines whether values with the same unit should be precalculated. + * default: false + */ + precalculate?: boolean; +}; +type postcssClamp = pluginOptions$0; +/** postcss-font-variant plugin options */ +type pluginOptions$1 = Record; +type postcssFontVariant = pluginOptions$1; +/** postcss-opacity-percentage plugin options */ +type pluginOptions$2 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +type postcssOpacityPercentage = pluginOptions$2; +/** postcss-replace-overflow-wrap plugin options */ +type pluginOptions$3 = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +type postcssReplaceOverflowWrap = pluginOptions$3; +/** postcss-system-ui-font-family plugin options */ +type pluginOptions$4 = Record; +type postcssFontFamilySystemUI = pluginOptions$4; +type pluginsOptions = { + /** plugin options for "@csstools/postcss-initial" */ + "all-property"?: postcssInitial | boolean; + /** plugin options for "postcss-pseudo-class-any-link" */ + "any-link-pseudo-class"?: postcssPseudoClassAnyLink | boolean; + /** plugin options for "css-blank-pseudo" */ + "blank-pseudo-class"?: postcssBlankPseudo | boolean; + /** plugin options for "postcss-page-break" */ + "break-properties"?: postcssPageBreak | boolean; + /** plugin options for "@csstools/postcss-cascade-layers" */ + "cascade-layers"?: postcssCascadeLayers | boolean; + /** plugin options for "postcss-attribute-case-insensitive" */ + "case-insensitive-attributes"?: postcssAttributeCaseInsensitive | boolean; + /** plugin options for "postcss-clamp" */ + "clamp"?: postcssClamp | boolean; + /** plugin options for "@csstools/postcss-color-function" */ + "color-function"?: postcssColorFunction | boolean; + /** plugin options for "postcss-color-functional-notation" */ + "color-functional-notation"?: postcssColorFunctionalNotation | boolean; + /** plugin options for "@csstools/postcss-color-mix-function" */ + "color-mix"?: postcssColorMixFunction | boolean; + /** plugin options for "postcss-custom-media" */ + "custom-media-queries"?: postcssCustomMedia | boolean; + /** plugin options for "postcss-custom-properties" */ + "custom-properties"?: postcssCustomProperties | boolean; + /** plugin options for "postcss-custom-selectors" */ + "custom-selectors"?: postcssCustomSelectors | boolean; + /** plugin options for "postcss-dir-pseudo-class" */ + "dir-pseudo-class"?: postcssDirPseudoClass | boolean; + /** plugin options for "@csstools/postcss-normalize-display-values" */ + "display-two-values"?: postcssNormalizeDisplayValues | boolean; + /** plugin options for "postcss-double-position-gradients" */ + "double-position-gradients"?: postcssDoublePositionGradients | boolean; + /** plugin options for "@csstools/postcss-exponential-functions" */ + "exponential-functions"?: postcssExponentialFunctions | boolean; + /** plugin options for "@csstools/postcss-logical-float-and-clear" */ + "float-clear-logical-values"?: postcssLogicalFloatAndClear | boolean; + /** plugin options for "postcss-focus-visible" */ + "focus-visible-pseudo-class"?: postcssFocusVisible | boolean; + /** plugin options for "postcss-focus-within" */ + "focus-within-pseudo-class"?: postcssFocusWithin | boolean; + /** plugin options for "@csstools/postcss-font-format-keywords" */ + "font-format-keywords"?: postcssFontFormatKeywords | boolean; + /** plugin options for "postcss-font-variant" */ + "font-variant-property"?: postcssFontVariant | boolean; + /** plugin options for "@csstools/postcss-gamut-mapping" */ + "gamut-mapping"?: postcssGamutMapping | boolean; + /** plugin options for "postcss-gap-properties" */ + "gap-properties"?: postcssGapProperties | boolean; + /** plugin options for "@csstools/postcss-gradients-interpolation-method" */ + "gradients-interpolation-method"?: postcssGradientsInterpolationMethod | boolean; + /** plugin options for "css-has-pseudo" */ + "has-pseudo-class"?: postcssHasPseudo | boolean; + /** plugin options for "postcss-color-hex-alpha" */ + "hexadecimal-alpha-notation"?: postcssColorHexAlpha | boolean; + /** plugin options for "@csstools/postcss-hwb-function" */ + "hwb-function"?: postcssHWBFunction | boolean; + /** plugin options for "@csstools/postcss-ic-unit" */ + "ic-unit"?: postcssICUnit | boolean; + /** plugin options for "postcss-image-set-function" */ + "image-set-function"?: postcssImageSetFunction | boolean; + /** plugin options for "@csstools/postcss-is-pseudo-class" */ + "is-pseudo-class"?: postcssIsPseudoClass | boolean; + /** plugin options for "postcss-lab-function" */ + "lab-function"?: postcssLabFunction | boolean; + /** plugin options for "@csstools/postcss-logical-overflow" */ + "logical-overflow"?: postcssLogicalOverflow | boolean; + /** plugin options for "@csstools/postcss-logical-overscroll-behavior" */ + "logical-overscroll-behavior"?: postcssLogicalOverscrollBehavor | boolean; + /** plugin options for "postcss-logical" */ + "logical-properties-and-values"?: postcssLogical | boolean; + /** plugin options for "@csstools/postcss-logical-resize" */ + "logical-resize"?: postcssLogicalResize | boolean; + /** plugin options for "@csstools/postcss-logical-viewport-units" */ + "logical-viewport-units"?: postcssLogicalViewportUnits | boolean; + /** plugin options for "@csstools/postcss-media-queries-aspect-ratio-number-values" */ + "media-queries-aspect-ratio-number-values"?: postcssMediaQueriesAspectRatioNumberValues | boolean; + /** plugin options for "@csstools/postcss-media-minmax" */ + "media-query-ranges"?: postcssMediaMinmax | boolean; + /** plugin options for "@csstools/postcss-nested-calc" */ + "nested-calc"?: postcssNestedCalc | boolean; + /** plugin options for "postcss-nesting" */ + "nesting-rules"?: postcssNesting | boolean; + /** plugin options for "postcss-selector-not" */ + "not-pseudo-class"?: postcssSelectorNot | boolean; + /** plugin options for "@csstools/postcss-oklab-function" */ + "oklab-function"?: postcssOKLabFunction | boolean; + /** plugin options for "postcss-opacity-percentage" */ + "opacity-percentage"?: postcssOpacityPercentage | boolean; + /** plugin options for "postcss-overflow-shorthand" */ + "overflow-property"?: postcssOverflowShorthand | boolean; + /** plugin options for "postcss-replace-overflow-wrap" */ + "overflow-wrap-property"?: postcssReplaceOverflowWrap | boolean; + /** plugin options for "postcss-place" */ + "place-properties"?: postcssPlace | boolean; + /** plugin options for "css-prefers-color-scheme" */ + "prefers-color-scheme-query"?: postcssPrefersColorScheme | boolean; + /** plugin options for "postcss-color-rebeccapurple" */ + "rebeccapurple-color"?: postcssColorRebeccapurple | boolean; + /** plugin options for "@csstools/postcss-relative-color-syntax" */ + "relative-color-syntax"?: postcssRelativeColorSyntax | boolean; + /** plugin options for "@csstools/postcss-scope-pseudo-class" */ + "scope-pseudo-class"?: postcssScopePseudoClass | boolean; + /** plugin options for "@csstools/postcss-stepped-value-functions" */ + "stepped-value-functions"?: postcssSteppedValueFunctions | boolean; + /** plugin options for "postcss-system-ui-font-family" */ + "system-ui-font-family"?: postcssFontFamilySystemUI | boolean; + /** plugin options for "@csstools/postcss-text-decoration-shorthand" */ + "text-decoration-shorthand"?: postcssTextDecorationShorthand | boolean; + /** plugin options for "@csstools/postcss-trigonometric-functions" */ + "trigonometric-functions"?: postcssTrigonometricFunctions | boolean; + /** plugin options for "@csstools/postcss-unset-value" */ + "unset-value"?: postcssUnsetValue | boolean; +}; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +type pluginOptions$5 = { + /** + * Determine which CSS features to polyfill, + * based upon their process in becoming web standards. + * default: 2 + */ + stage?: number | false; + /** + * Determine which CSS features to polyfill, + * based their implementation status. + * default: 0 + */ + minimumVendorImplementations?: number; + /** + * Enable any feature that would need an extra browser library to be loaded into the page for it to work. + * default: false + */ + enableClientSidePolyfills?: boolean; + /** + * PostCSS Preset Env supports any standard browserslist configuration, + * which can be a `.browserslistrc` file, + * a `browserslist` key in `package.json`, + * or `browserslist` environment variables. + * + * The `env` option is used to select a specific browserslist environment in the event that you have more than one. + */ + env?: string; + /** + * PostCSS Preset Env supports any standard browserslist configuration, + * which can be a `.browserslistrc` file, + * a `browserslist` key in `package.json`, + * or `browserslist` environment variables. + * + * The `browsers` option should only be used when a standard browserslist configuration is not available. + * When the `browsers` option is used the `env` option is ignored. + */ + browsers?: string | Array | null; + /** + * Determine whether all plugins should receive a `preserve` option, + * which may preserve or remove the original and now polyfilled CSS. + * Each plugin has it's own default, some true, others false. + * default: _not set_ + */ + preserve?: boolean; + /** + * [Configure autoprefixer](https://github.com/postcss/autoprefixer#options) + */ + autoprefixer?: autoprefixer.Options; + /** + * Enable or disable specific polyfills by ID. + * Passing `true` to a specific [feature ID](https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md) will enable its polyfill, + * while passing `false` will disable it. + * + * Passing an object to a specific feature ID will both enable and configure it. + */ + features?: pluginsOptions; + /** + * The `insertBefore` key allows you to insert other PostCSS plugins into the chain. + * This is only useful if you are also using sugary PostCSS plugins that must execute before certain polyfills. + * `insertBefore` supports chaining one or multiple plugins. + */ + insertBefore?: Record; + /** + * The `insertAfter` key allows you to insert other PostCSS plugins into the chain. + * This is only useful if you are also using sugary PostCSS plugins that must execute after certain polyfills. + * `insertAfter` supports chaining one or multiple plugins. + */ + insertAfter?: Record; + /** + * Enable debugging messages to stdout giving insights into which features have been enabled/disabled and why. + * default: false + */ + debug?: boolean; + /** + * The `logical` object allows to configure all plugins related to logical document flow at once. + * It accepts the same options as each plugin: `inlineDirection` and `blockDirection`. + */ + logical?: { + /** Set the inline flow direction. default: left-to-right */ + inlineDirection?: DirectionFlow; + /** Set the block flow direction. default: top-to-bottom */ + blockDirection?: DirectionFlow; + }; +}; +declare const creator: PluginCreator; +export type { pluginOptions$5 as pluginOptions }; +export = creator; diff --git a/plugin-packs/postcss-preset-env/dist/options.d.ts b/plugin-packs/postcss-preset-env/dist/options.d.ts deleted file mode 100644 index 8522d1d8e..000000000 --- a/plugin-packs/postcss-preset-env/dist/options.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -import type autoprefixer from 'autoprefixer'; -import { pluginsOptions } from './plugins/plugins-options'; -declare enum DirectionFlow { - TopToBottom = "top-to-bottom", - BottomToTop = "bottom-to-top", - RightToLeft = "right-to-left", - LeftToRight = "left-to-right" -} -export type pluginOptions = { - /** - * Determine which CSS features to polyfill, - * based upon their process in becoming web standards. - * default: 2 - */ - stage?: number | false; - /** - * Determine which CSS features to polyfill, - * based their implementation status. - * default: 0 - */ - minimumVendorImplementations?: number; - /** - * Enable any feature that would need an extra browser library to be loaded into the page for it to work. - * default: false - */ - enableClientSidePolyfills?: boolean; - /** - * PostCSS Preset Env supports any standard browserslist configuration, - * which can be a `.browserslistrc` file, - * a `browserslist` key in `package.json`, - * or `browserslist` environment variables. - * - * The `env` option is used to select a specific browserslist environment in the event that you have more than one. - */ - env?: string; - /** - * PostCSS Preset Env supports any standard browserslist configuration, - * which can be a `.browserslistrc` file, - * a `browserslist` key in `package.json`, - * or `browserslist` environment variables. - * - * The `browsers` option should only be used when a standard browserslist configuration is not available. - * When the `browsers` option is used the `env` option is ignored. - */ - browsers?: string | Array | null; - /** - * Determine whether all plugins should receive a `preserve` option, - * which may preserve or remove the original and now polyfilled CSS. - * Each plugin has it's own default, some true, others false. - * default: _not set_ - */ - preserve?: boolean; - /** - * [Configure autoprefixer](https://github.com/postcss/autoprefixer#options) - */ - autoprefixer?: autoprefixer.Options; - /** - * Enable or disable specific polyfills by ID. - * Passing `true` to a specific [feature ID](https://github.com/csstools/postcss-plugins/blob/main/plugin-packs/postcss-preset-env/FEATURES.md) will enable its polyfill, - * while passing `false` will disable it. - * - * Passing an object to a specific feature ID will both enable and configure it. - */ - features?: pluginsOptions; - /** - * The `insertBefore` key allows you to insert other PostCSS plugins into the chain. - * This is only useful if you are also using sugary PostCSS plugins that must execute before certain polyfills. - * `insertBefore` supports chaining one or multiple plugins. - */ - insertBefore?: Record; - /** - * The `insertAfter` key allows you to insert other PostCSS plugins into the chain. - * This is only useful if you are also using sugary PostCSS plugins that must execute after certain polyfills. - * `insertAfter` supports chaining one or multiple plugins. - */ - insertAfter?: Record; - /** - * Enable debugging messages to stdout giving insights into which features have been enabled/disabled and why. - * default: false - */ - debug?: boolean; - /** - * The `logical` object allows to configure all plugins related to logical document flow at once. - * It accepts the same options as each plugin: `inlineDirection` and `blockDirection`. - */ - logical?: { - /** Set the inline flow direction. default: left-to-right */ - inlineDirection?: DirectionFlow; - /** Set the block flow direction. default: top-to-bottom */ - blockDirection?: DirectionFlow; - }; -}; -export {}; diff --git a/plugin-packs/postcss-preset-env/dist/plugins/plugins-options.d.ts b/plugin-packs/postcss-preset-env/dist/plugins/plugins-options.d.ts deleted file mode 100644 index 4d67f35d2..000000000 --- a/plugin-packs/postcss-preset-env/dist/plugins/plugins-options.d.ts +++ /dev/null @@ -1,170 +0,0 @@ -import type { pluginOptions as postcssInitial } from '@csstools/postcss-initial'; -import type { pluginOptions as postcssPseudoClassAnyLink } from 'postcss-pseudo-class-any-link'; -import type { pluginOptions as postcssBlankPseudo } from 'css-blank-pseudo'; -import type { pluginOptions as postcssPageBreak } from '../types/postcss-page-break/plugin-options'; -import type { pluginOptions as postcssCascadeLayers } from '@csstools/postcss-cascade-layers'; -import type { pluginOptions as postcssAttributeCaseInsensitive } from 'postcss-attribute-case-insensitive'; -import type { pluginOptions as postcssClamp } from '../types/postcss-clamp/plugin-options'; -import type { pluginOptions as postcssColorFunction } from '@csstools/postcss-color-function'; -import type { pluginOptions as postcssColorFunctionalNotation } from 'postcss-color-functional-notation'; -import type { pluginOptions as postcssColorMixFunction } from '@csstools/postcss-color-mix-function'; -import type { pluginOptions as postcssCustomMedia } from 'postcss-custom-media'; -import type { pluginOptions as postcssCustomProperties } from 'postcss-custom-properties'; -import type { pluginOptions as postcssCustomSelectors } from 'postcss-custom-selectors'; -import type { pluginOptions as postcssDirPseudoClass } from 'postcss-dir-pseudo-class'; -import type { pluginOptions as postcssNormalizeDisplayValues } from '@csstools/postcss-normalize-display-values'; -import type { pluginOptions as postcssDoublePositionGradients } from 'postcss-double-position-gradients'; -import type { pluginOptions as postcssExponentialFunctions } from '@csstools/postcss-exponential-functions'; -import type { pluginOptions as postcssLogicalFloatAndClear } from '@csstools/postcss-logical-float-and-clear'; -import type { pluginOptions as postcssFocusVisible } from 'postcss-focus-visible'; -import type { pluginOptions as postcssFocusWithin } from 'postcss-focus-within'; -import type { pluginOptions as postcssFontFormatKeywords } from '@csstools/postcss-font-format-keywords'; -import type { pluginOptions as postcssFontVariant } from '../types/postcss-font-variant/plugin-options'; -import type { pluginOptions as postcssGamutMapping } from '@csstools/postcss-gamut-mapping'; -import type { pluginOptions as postcssGapProperties } from 'postcss-gap-properties'; -import type { pluginOptions as postcssGradientsInterpolationMethod } from '@csstools/postcss-gradients-interpolation-method'; -import type { pluginOptions as postcssHasPseudo } from 'css-has-pseudo'; -import type { pluginOptions as postcssColorHexAlpha } from 'postcss-color-hex-alpha'; -import type { pluginOptions as postcssHWBFunction } from '@csstools/postcss-hwb-function'; -import type { pluginOptions as postcssICUnit } from '@csstools/postcss-ic-unit'; -import type { pluginOptions as postcssImageSetFunction } from 'postcss-image-set-function'; -import type { pluginOptions as postcssIsPseudoClass } from '@csstools/postcss-is-pseudo-class'; -import type { pluginOptions as postcssLabFunction } from 'postcss-lab-function'; -import type { pluginOptions as postcssLogicalOverflow } from '@csstools/postcss-logical-overflow'; -import type { pluginOptions as postcssLogicalOverscrollBehavor } from '@csstools/postcss-logical-overscroll-behavior'; -import type { pluginOptions as postcssLogical } from 'postcss-logical'; -import type { pluginOptions as postcssLogicalResize } from '@csstools/postcss-logical-resize'; -import type { pluginOptions as postcssLogicalViewportUnits } from '@csstools/postcss-logical-viewport-units'; -import type { pluginOptions as postcssMediaQueriesAspectRatioNumberValues } from '@csstools/postcss-media-queries-aspect-ratio-number-values'; -import type { pluginOptions as postcssMediaMinmax } from '@csstools/postcss-media-minmax'; -import type { pluginOptions as postcssNestedCalc } from '@csstools/postcss-nested-calc'; -import type { pluginOptions as postcssNesting } from 'postcss-nesting'; -import type { pluginOptions as postcssSelectorNot } from 'postcss-selector-not'; -import type { pluginOptions as postcssOKLabFunction } from '@csstools/postcss-oklab-function'; -import type { pluginOptions as postcssOpacityPercentage } from '../types/postcss-opacity-percentage/plugin-options'; -import type { pluginOptions as postcssOverflowShorthand } from 'postcss-overflow-shorthand'; -import type { pluginOptions as postcssReplaceOverflowWrap } from '../types/postcss-replace-overflow-wrap/plugin-options'; -import type { pluginOptions as postcssPlace } from 'postcss-place'; -import type { pluginOptions as postcssPrefersColorScheme } from 'css-prefers-color-scheme'; -import type { pluginOptions as postcssColorRebeccapurple } from 'postcss-color-rebeccapurple'; -import type { pluginOptions as postcssRelativeColorSyntax } from '@csstools/postcss-relative-color-syntax'; -import type { pluginOptions as postcssScopePseudoClass } from '@csstools/postcss-scope-pseudo-class'; -import type { pluginOptions as postcssSteppedValueFunctions } from '@csstools/postcss-stepped-value-functions'; -import type { pluginOptions as postcssFontFamilySystemUI } from '../types/postcss-system-ui-font-family/plugin-options'; -import type { pluginOptions as postcssTextDecorationShorthand } from '@csstools/postcss-text-decoration-shorthand'; -import type { pluginOptions as postcssTrigonometricFunctions } from '@csstools/postcss-trigonometric-functions'; -import type { pluginOptions as postcssUnsetValue } from '@csstools/postcss-unset-value'; -export type pluginsOptions = { - /** plugin options for "@csstools/postcss-initial" */ - 'all-property'?: postcssInitial | boolean; - /** plugin options for "postcss-pseudo-class-any-link" */ - 'any-link-pseudo-class'?: postcssPseudoClassAnyLink | boolean; - /** plugin options for "css-blank-pseudo" */ - 'blank-pseudo-class'?: postcssBlankPseudo | boolean; - /** plugin options for "postcss-page-break" */ - 'break-properties'?: postcssPageBreak | boolean; - /** plugin options for "@csstools/postcss-cascade-layers" */ - 'cascade-layers'?: postcssCascadeLayers | boolean; - /** plugin options for "postcss-attribute-case-insensitive" */ - 'case-insensitive-attributes'?: postcssAttributeCaseInsensitive | boolean; - /** plugin options for "postcss-clamp" */ - 'clamp'?: postcssClamp | boolean; - /** plugin options for "@csstools/postcss-color-function" */ - 'color-function'?: postcssColorFunction | boolean; - /** plugin options for "postcss-color-functional-notation" */ - 'color-functional-notation'?: postcssColorFunctionalNotation | boolean; - /** plugin options for "@csstools/postcss-color-mix-function" */ - 'color-mix'?: postcssColorMixFunction | boolean; - /** plugin options for "postcss-custom-media" */ - 'custom-media-queries'?: postcssCustomMedia | boolean; - /** plugin options for "postcss-custom-properties" */ - 'custom-properties'?: postcssCustomProperties | boolean; - /** plugin options for "postcss-custom-selectors" */ - 'custom-selectors'?: postcssCustomSelectors | boolean; - /** plugin options for "postcss-dir-pseudo-class" */ - 'dir-pseudo-class'?: postcssDirPseudoClass | boolean; - /** plugin options for "@csstools/postcss-normalize-display-values" */ - 'display-two-values'?: postcssNormalizeDisplayValues | boolean; - /** plugin options for "postcss-double-position-gradients" */ - 'double-position-gradients'?: postcssDoublePositionGradients | boolean; - /** plugin options for "@csstools/postcss-exponential-functions" */ - 'exponential-functions'?: postcssExponentialFunctions | boolean; - /** plugin options for "@csstools/postcss-logical-float-and-clear" */ - 'float-clear-logical-values'?: postcssLogicalFloatAndClear | boolean; - /** plugin options for "postcss-focus-visible" */ - 'focus-visible-pseudo-class'?: postcssFocusVisible | boolean; - /** plugin options for "postcss-focus-within" */ - 'focus-within-pseudo-class'?: postcssFocusWithin | boolean; - /** plugin options for "@csstools/postcss-font-format-keywords" */ - 'font-format-keywords'?: postcssFontFormatKeywords | boolean; - /** plugin options for "postcss-font-variant" */ - 'font-variant-property'?: postcssFontVariant | boolean; - /** plugin options for "@csstools/postcss-gamut-mapping" */ - 'gamut-mapping'?: postcssGamutMapping | boolean; - /** plugin options for "postcss-gap-properties" */ - 'gap-properties'?: postcssGapProperties | boolean; - /** plugin options for "@csstools/postcss-gradients-interpolation-method" */ - 'gradients-interpolation-method'?: postcssGradientsInterpolationMethod | boolean; - /** plugin options for "css-has-pseudo" */ - 'has-pseudo-class'?: postcssHasPseudo | boolean; - /** plugin options for "postcss-color-hex-alpha" */ - 'hexadecimal-alpha-notation'?: postcssColorHexAlpha | boolean; - /** plugin options for "@csstools/postcss-hwb-function" */ - 'hwb-function'?: postcssHWBFunction | boolean; - /** plugin options for "@csstools/postcss-ic-unit" */ - 'ic-unit'?: postcssICUnit | boolean; - /** plugin options for "postcss-image-set-function" */ - 'image-set-function'?: postcssImageSetFunction | boolean; - /** plugin options for "@csstools/postcss-is-pseudo-class" */ - 'is-pseudo-class'?: postcssIsPseudoClass | boolean; - /** plugin options for "postcss-lab-function" */ - 'lab-function'?: postcssLabFunction | boolean; - /** plugin options for "@csstools/postcss-logical-overflow" */ - 'logical-overflow'?: postcssLogicalOverflow | boolean; - /** plugin options for "@csstools/postcss-logical-overscroll-behavior" */ - 'logical-overscroll-behavior'?: postcssLogicalOverscrollBehavor | boolean; - /** plugin options for "postcss-logical" */ - 'logical-properties-and-values'?: postcssLogical | boolean; - /** plugin options for "@csstools/postcss-logical-resize" */ - 'logical-resize'?: postcssLogicalResize | boolean; - /** plugin options for "@csstools/postcss-logical-viewport-units" */ - 'logical-viewport-units'?: postcssLogicalViewportUnits | boolean; - /** plugin options for "@csstools/postcss-media-queries-aspect-ratio-number-values" */ - 'media-queries-aspect-ratio-number-values'?: postcssMediaQueriesAspectRatioNumberValues | boolean; - /** plugin options for "@csstools/postcss-media-minmax" */ - 'media-query-ranges'?: postcssMediaMinmax | boolean; - /** plugin options for "@csstools/postcss-nested-calc" */ - 'nested-calc'?: postcssNestedCalc | boolean; - /** plugin options for "postcss-nesting" */ - 'nesting-rules'?: postcssNesting | boolean; - /** plugin options for "postcss-selector-not" */ - 'not-pseudo-class'?: postcssSelectorNot | boolean; - /** plugin options for "@csstools/postcss-oklab-function" */ - 'oklab-function'?: postcssOKLabFunction | boolean; - /** plugin options for "postcss-opacity-percentage" */ - 'opacity-percentage'?: postcssOpacityPercentage | boolean; - /** plugin options for "postcss-overflow-shorthand" */ - 'overflow-property'?: postcssOverflowShorthand | boolean; - /** plugin options for "postcss-replace-overflow-wrap" */ - 'overflow-wrap-property'?: postcssReplaceOverflowWrap | boolean; - /** plugin options for "postcss-place" */ - 'place-properties'?: postcssPlace | boolean; - /** plugin options for "css-prefers-color-scheme" */ - 'prefers-color-scheme-query'?: postcssPrefersColorScheme | boolean; - /** plugin options for "postcss-color-rebeccapurple" */ - 'rebeccapurple-color'?: postcssColorRebeccapurple | boolean; - /** plugin options for "@csstools/postcss-relative-color-syntax" */ - 'relative-color-syntax'?: postcssRelativeColorSyntax | boolean; - /** plugin options for "@csstools/postcss-scope-pseudo-class" */ - 'scope-pseudo-class'?: postcssScopePseudoClass | boolean; - /** plugin options for "@csstools/postcss-stepped-value-functions" */ - 'stepped-value-functions'?: postcssSteppedValueFunctions | boolean; - /** plugin options for "postcss-system-ui-font-family" */ - 'system-ui-font-family'?: postcssFontFamilySystemUI | boolean; - /** plugin options for "@csstools/postcss-text-decoration-shorthand" */ - 'text-decoration-shorthand'?: postcssTextDecorationShorthand | boolean; - /** plugin options for "@csstools/postcss-trigonometric-functions" */ - 'trigonometric-functions'?: postcssTrigonometricFunctions | boolean; - /** plugin options for "@csstools/postcss-unset-value" */ - 'unset-value'?: postcssUnsetValue | boolean; -}; diff --git a/plugin-packs/postcss-preset-env/dist/types/postcss-clamp/plugin-options.d.ts b/plugin-packs/postcss-preset-env/dist/types/postcss-clamp/plugin-options.d.ts deleted file mode 100644 index c3ed79450..000000000 --- a/plugin-packs/postcss-preset-env/dist/types/postcss-clamp/plugin-options.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** postcss-clamp plugin options */ -export type pluginOptions = { - /** Preserve the original notation. default: false */ - preserve?: boolean; - /** - * The precalculate option determines whether values with the same unit should be precalculated. - * default: false - */ - precalculate?: boolean; -}; diff --git a/plugin-packs/postcss-preset-env/dist/types/postcss-font-variant/plugin-options.d.ts b/plugin-packs/postcss-preset-env/dist/types/postcss-font-variant/plugin-options.d.ts deleted file mode 100644 index b539e77b2..000000000 --- a/plugin-packs/postcss-preset-env/dist/types/postcss-font-variant/plugin-options.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** postcss-font-variant plugin options */ -export type pluginOptions = Record; diff --git a/plugin-packs/postcss-preset-env/dist/types/postcss-opacity-percentage/plugin-options.d.ts b/plugin-packs/postcss-preset-env/dist/types/postcss-opacity-percentage/plugin-options.d.ts deleted file mode 100644 index 81306fbba..000000000 --- a/plugin-packs/postcss-preset-env/dist/types/postcss-opacity-percentage/plugin-options.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** postcss-opacity-percentage plugin options */ -export type pluginOptions = { - /** Preserve the original notation. default: false */ - preserve?: boolean; -}; diff --git a/plugin-packs/postcss-preset-env/dist/types/postcss-page-break/plugin-options.d.ts b/plugin-packs/postcss-preset-env/dist/types/postcss-page-break/plugin-options.d.ts deleted file mode 100644 index 05d36d940..000000000 --- a/plugin-packs/postcss-preset-env/dist/types/postcss-page-break/plugin-options.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** postcss-page-break plugin options */ -export type pluginOptions = Record; diff --git a/plugin-packs/postcss-preset-env/dist/types/postcss-replace-overflow-wrap/plugin-options.d.ts b/plugin-packs/postcss-preset-env/dist/types/postcss-replace-overflow-wrap/plugin-options.d.ts deleted file mode 100644 index 5b9a3bfe3..000000000 --- a/plugin-packs/postcss-preset-env/dist/types/postcss-replace-overflow-wrap/plugin-options.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/** postcss-replace-overflow-wrap plugin options */ -export type pluginOptions = { - /** Preserve the original notation. default: false */ - preserve?: boolean; -}; diff --git a/plugin-packs/postcss-preset-env/dist/types/postcss-system-ui-font-family/plugin-options.d.ts b/plugin-packs/postcss-preset-env/dist/types/postcss-system-ui-font-family/plugin-options.d.ts deleted file mode 100644 index 6a5f429da..000000000 --- a/plugin-packs/postcss-preset-env/dist/types/postcss-system-ui-font-family/plugin-options.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -/** postcss-system-ui-font-family plugin options */ -export type pluginOptions = Record; diff --git a/plugin-packs/postcss-preset-env/package.json b/plugin-packs/postcss-preset-env/package.json index d231503ad..1109a5b59 100644 --- a/plugin-packs/postcss-preset-env/package.json +++ b/plugin-packs/postcss-preset-env/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugin-packs/postcss-preset-env/tsconfig.json b/plugin-packs/postcss-preset-env/tsconfig.json index e0d06239c..bb5e4ef3b 100644 --- a/plugin-packs/postcss-preset-env/tsconfig.json +++ b/plugin-packs/postcss-preset-env/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": "." + "declarationDir": "dist" }, "include": ["./src/**/*"], "exclude": ["dist"], diff --git a/plugins/css-blank-pseudo/dist/browser-global.js.map b/plugins/css-blank-pseudo/dist/browser-global.js.map index 9d9fdb725..1a84d591b 100644 --- a/plugins/css-blank-pseudo/dist/browser-global.js.map +++ b/plugins/css-blank-pseudo/dist/browser-global.js.map @@ -1 +1 @@ -{"version":3,"file":"browser-global.js","sources":["../src/is-valid-replacement.mjs","../src/browser.js","../src/browser-global.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.mjs';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n","/* global self,window */\nimport { default as cssBlankPseudoInit } from './browser';\n\n(function (global) {\n\tglobal.cssBlankPseudoInit = cssBlankPseudoInit;\n}('object' === typeof window && window || 'object' === typeof self && self || {}));\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","CSS_CLASS_LOADED","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","cssBlankPseudoInit","opts","options","force","replaceWith","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","handleInputOrChangeEvent","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","self","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"YAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EAASC,IACzEF,EAASI,QAAQN,EAAsBI,KAAO,IACjDD,GAAU,GAIZ,OAAOA,CACR,CCpBA,IAAMI,EAAmB,kBAGzB,SAASC,qBAAqBC,GAC7B,MAAyB,UAArBA,EAAQC,UAA6C,WAArBD,EAAQC,UAA8C,aAArBD,EAAQC,QAK9E,CAEA,SAASC,eAAeC,GACvB,IAAIC,EASJ,MAPsB,mBAAXC,MACVD,EAAQ,IAAIC,MAAMF,EAAW,CAAEG,SAAS,KAExCF,EAAQG,SAASC,YAAY,UACvBC,UAAUN,GAAW,GAAM,GAG3BC,CACR,CAqDA,SAASM,0BAA0BC,EAAaC,GAC/C,IAAMC,EAAaC,OAAOC,yBAAyBJ,EAAYK,UAAW,SACpEC,EAAYJ,EAAWK,IAE7BL,EAAWK,IAAM,SAASA,MACzBD,EAAUE,MAAMC,KAAMC,WACtBT,EAAQ,CAAEU,OAAQF,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,GACCtC,EAAQ,CAAEU,OAAQ4B,GACnB,KAsBF,GAlBI3C,SAASoC,KACZD,IAEAS,OAAOP,iBAAiB,OAAQF,IAGqC,IAAlEnC,SAAS6C,gBAAgBC,UAAUxD,QAAQC,KAC9CS,SAAS6C,gBAAgBC,eAAiBvD,GAG3CY,0BAA0B4C,KAAKC,iBAAkB3C,GACjDF,0BAA0B4C,KAAKE,kBAAmB5C,GAClDF,0BAA0B4C,KAAKG,oBAAqB7C,GAlFfD,EAmFR2C,KAAKI,kBAlF5B7C,EAAaC,OAAOC,yBAAyBJ,EAAYK,UAAW,YACpEC,EAAYJ,EAAWK,IAE7BL,EAAWK,IAAM,SAASA,IAAIuB,GAC7BxB,EAAUE,MAAMC,KAAMC,WAEtB,IAAMjB,EAAQF,eAAe,UAC7BkB,KAAKuC,cAAcC,cAAcxD,IAGlCU,OAAOS,eAAeZ,EAAYK,UAAW,WAAYH,GA2EzDgC,IAEqC,oBAA1BS,KAAKO,iBAEf,IAAIA,kBAAiB,SAAAC,GACpBA,EAAcf,SAAQ,SAAAgB,GACrBjB,MAAM9B,UAAU+B,QAAQC,KACvBe,EAASC,YAAc,IACvB,SAAAd,GACuB,IAAlBA,EAAKe,UAAkBlE,qBAAqBmD,IAC/CtC,EAAQ,CAAEU,OAAQ4B,GAEpB,GAEF,GACD,IAAGgB,QAAQ3D,SAAU,CAAE4D,WAAW,EAAMC,SAAS,QAC3C,CACN,IAAMC,EAAe,SAAfA,eAAY,OAASxB,GAAqB,EAEhDM,OAAOP,iBAAiB,OAAQyB,GAChClB,OAAOP,iBAAiB,mBAAoByB,EAC7C,CACD,ECtKE,iBAAoBlB,QAAUA,QAAU,iBAAoBG,MAAQA,MAAQ,IADtE9B,mBAAqBA"} \ No newline at end of file +{"version":3,"file":"browser-global.js","sources":["../src/is-valid-replacement.js","../src/browser.js","../src/browser-global.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.js';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n","/* global self,window */\nimport { default as cssBlankPseudoInit } from './browser';\n\n(function (global) {\n\tglobal.cssBlankPseudoInit = cssBlankPseudoInit;\n}('object' === typeof window && window || 'object' === typeof self && self || {}));\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","CSS_CLASS_LOADED","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","cssBlankPseudoInit","opts","options","force","replaceWith","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","handleInputOrChangeEvent","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","self","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"YAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EAASC,IACzEF,EAASI,QAAQN,EAAsBI,KAAO,IACjDD,GAAU,GAIZ,OAAOA,CACR,CCpBA,IAAMI,EAAmB,kBAGzB,SAASC,qBAAqBC,GAC7B,MAAyB,UAArBA,EAAQC,UAA6C,WAArBD,EAAQC,UAA8C,aAArBD,EAAQC,QAK9E,CAEA,SAASC,eAAeC,GACvB,IAAIC,EASJ,MAPsB,mBAAXC,MACVD,EAAQ,IAAIC,MAAMF,EAAW,CAAEG,SAAS,KAExCF,EAAQG,SAASC,YAAY,UACvBC,UAAUN,GAAW,GAAM,GAG3BC,CACR,CAqDA,SAASM,0BAA0BC,EAAaC,GAC/C,IAAMC,EAAaC,OAAOC,yBAAyBJ,EAAYK,UAAW,SACpEC,EAAYJ,EAAWK,IAE7BL,EAAWK,IAAM,SAASA,MACzBD,EAAUE,MAAMC,KAAMC,WACtBT,EAAQ,CAAEU,OAAQF,QAGnBN,OAAOS,eAAeZ,EAAYK,UAAW,QAASH,EACvD,CAEe,SAASW,mBAAmBC,GAE1C,IAAMC,EAAU,CACfC,OAAO,EACPC,YAAa,WAWd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6C,gBAAgBC,UAAUxD,QAAQC,KAC9CS,SAAS6C,gBAAgBC,eAAiBvD,GAG3CY,0BAA0B4C,KAAKC,iBAAkB3C,GACjDF,0BAA0B4C,KAAKE,kBAAmB5C,GAClDF,0BAA0B4C,KAAKG,oBAAqB7C,GAlFfD,EAmFR2C,KAAKI,kBAlF5B7C,EAAaC,OAAOC,yBAAyBJ,EAAYK,UAAW,YACpEC,EAAYJ,EAAWK,IAE7BL,EAAWK,IAAM,SAASA,IAAIuB,GAC7BxB,EAAUE,MAAMC,KAAMC,WAEtB,IAAMjB,EAAQF,eAAe,UAC7BkB,KAAKuC,cAAcC,cAAcxD,IAGlCU,OAAOS,eAAeZ,EAAYK,UAAW,WAAYH,GA2EzDgC,IAEqC,oBAA1BS,KAAKO,iBAEf,IAAIA,kBAAiB,SAAAC,GACpBA,EAAcf,SAAQ,SAAAgB,GACrBjB,MAAM9B,UAAU+B,QAAQC,KACvBe,EAASC,YAAc,IACvB,SAAAd,GACuB,IAAlBA,EAAKe,UAAkBlE,qBAAqBmD,IAC/CtC,EAAQ,CAAEU,OAAQ4B,GAEpB,GAEF,GACD,IAAGgB,QAAQ3D,SAAU,CAAE4D,WAAW,EAAMC,SAAS,QAC3C,CACN,IAAMC,EAAe,SAAfA,eAAY,OAASxB,GAAqB,EAEhDM,OAAOP,iBAAiB,OAAQyB,GAChClB,OAAOP,iBAAiB,mBAAoByB,EAC7C,CACD,ECtKE,iBAAoBlB,QAAUA,QAAU,iBAAoBG,MAAQA,MAAQ,IADtE9B,mBAAqBA"} \ No newline at end of file diff --git a/plugins/css-blank-pseudo/dist/browser.cjs.map b/plugins/css-blank-pseudo/dist/browser.cjs.map index 9717498c6..deccd627e 100644 --- a/plugins/css-blank-pseudo/dist/browser.cjs.map +++ b/plugins/css-blank-pseudo/dist/browser.cjs.map @@ -1 +1 @@ -{"version":3,"file":"browser.cjs","sources":["../src/is-valid-replacement.mjs","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.mjs';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","CSS_CLASS_LOADED","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","cssBlankPseudoInit","opts","options","force","replaceWith","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","handleInputOrChangeEvent","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","self","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"AAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EAASC,IACzEF,EAASI,QAAQN,EAAsBI,KAAO,IACjDD,GAAU,GAIZ,OAAOA,CACR,CCpBA,IAAMI,EAAmB,kBAGzB,SAASC,qBAAqBC,GAC7B,MAAyB,UAArBA,EAAQC,UAA6C,WAArBD,EAAQC,UAA8C,aAArBD,EAAQC,QAK9E,CAEA,SAASC,eAAeC,GACvB,IAAIC,EASJ,MAPsB,mBAAXC,MACVD,EAAQ,IAAIC,MAAMF,EAAW,CAAEG,SAAS,KAExCF,EAAQG,SAASC,YAAY,UACvBC,UAAUN,GAAW,GAAM,GAG3BC,CACR,CAqDA,SAASM,0BAA0BC,EAAaC,GAC/C,IAAMC,EAAaC,OAAOC,yBAAyBJ,EAAYK,UAAW,SACpEC,EAAYJ,EAAWK,IAE7BL,EAAWK,IAAM,SAASA,MACzBD,EAAUE,MAAMC,KAAMC,WACtBT,EAAQ,CAAEU,OAAQF,QAGnBN,OAAOS,eAAeZ,EAAYK,UAAW,QAASH,EACvD,gBAEe,SAASW,mBAAmBC,GAE1C,IAAMC,EAAU,CACfC,OAAO,EACPC,YAAa,WAWd,QARoB,IAATH,GAAwB,UAAWA,IAC7CC,EAAQC,MAAQF,EAAKE,YAGF,IAATF,GAAwB,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A0B4C,KAAKC,iBAAkB3C,GACjDF,0BAA0B4C,KAAKE,kBAAmB5C,GAClDF,0BAA0B4C,KAAKG,oBAAqB7C,GAlFfD,EAmFR2C,KAAKI,kBAlF5B7C,EAAaC,OAAOC,yBAAyBJ,EAAYK,UAAW,YACpEC,EAAYJ,EAAWK,IAE7BL,EAAWK,IAAM,SAASA,IAAIuB,GAC7BxB,EAAUE,MAAMC,KAAMC,WAEtB,IAAMjB,EAAQF,eAAe,UAC7BkB,KAAKuC,cAAcC,cAAcxD,IAGlCU,OAAOS,eAAeZ,EAAYK,UAAW,WAAYH,GA2EzDgC,IAEqC,oBAA1BS,KAAKO,iBAEf,IAAIA,kBAAiB,SAAAC,GACpBA,EAAcf,SAAQ,SAAAgB,GACrBjB,MAAM9B,UAAU+B,QAAQC,KACvBe,EAASC,YAAc,IACvB,SAAAd,GACuB,IAAlBA,EAAKe,UAAkBlE,qBAAqBmD,IAC/CtC,EAAQ,CAAEU,OAAQ4B,GAEpB,GAEF,GACD,IAAGgB,QAAQ3D,SAAU,CAAE4D,WAAW,EAAMC,SAAS,QAC3C,CACN,IAAMC,EAAe,SAAfA,eAAY,OAASxB,GAAqB,EAEhDM,OAAOP,iBAAiB,OAAQyB,GAChClB,OAAOP,iBAAiB,mBAAoByB,EAC7C,CACD"} \ No newline at end of file +{"version":3,"file":"browser.cjs","sources":["../src/is-valid-replacement.js","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.js';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","CSS_CLASS_LOADED","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","cssBlankPseudoInit","opts","options","force","replaceWith","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","handleInputOrChangeEvent","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","self","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"AAAA,IAAMA,EAAwB,CAC7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CU,OAAOS,eAAeZ,EAAYK,UAAW,WAAYH,GA2EzDgC,IAEqC,oBAA1BS,KAAKO,iBAEf,IAAIA,kBAAiB,SAAAC,GACpBA,EAAcf,SAAQ,SAAAgB,GACrBjB,MAAM9B,UAAU+B,QAAQC,KACvBe,EAASC,YAAc,IACvB,SAAAd,GACuB,IAAlBA,EAAKe,UAAkBlE,qBAAqBmD,IAC/CtC,EAAQ,CAAEU,OAAQ4B,GAEpB,GAEF,GACD,IAAGgB,QAAQ3D,SAAU,CAAE4D,WAAW,EAAMC,SAAS,QAC3C,CACN,IAAMC,EAAe,SAAfA,eAAY,OAASxB,GAAqB,EAEhDM,OAAOP,iBAAiB,OAAQyB,GAChClB,OAAOP,iBAAiB,mBAAoByB,EAC7C,CACD"} \ No newline at end of file diff --git a/plugins/css-blank-pseudo/dist/browser.mjs.map b/plugins/css-blank-pseudo/dist/browser.mjs.map index d8cf9664d..3d1cef483 100644 --- a/plugins/css-blank-pseudo/dist/browser.mjs.map +++ b/plugins/css-blank-pseudo/dist/browser.mjs.map @@ -1 +1 @@ -{"version":3,"file":"browser.mjs","sources":["../src/is-valid-replacement.mjs","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.mjs';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","CSS_CLASS_LOADED","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","cssBlankPseudoInit","opts","options","force","replaceWith","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","handleInputOrChangeEvent","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","self","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"AAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EA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B,UAAU+B,QAAQC,KACvBe,EAASC,YAAc,IACvB,SAAAd,GACuB,IAAlBA,EAAKe,UAAkBlE,qBAAqBmD,IAC/CtC,EAAQ,CAAEU,OAAQ4B,GAEpB,GAEF,GACD,IAAGgB,QAAQ3D,SAAU,CAAE4D,WAAW,EAAMC,SAAS,QAC3C,CACN,IAAMC,EAAe,SAAfA,eAAY,OAASxB,GAAqB,EAEhDM,OAAOP,iBAAiB,OAAQyB,GAChClB,OAAOP,iBAAiB,mBAAoByB,EAC7C,CACD"} \ No newline at end of file +{"version":3,"file":"browser.mjs","sources":["../src/is-valid-replacement.js","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document,window,self,MutationObserver */\nimport isValidReplacement from './is-valid-replacement.js';\n\nconst CSS_CLASS_LOADED = 'js-blank-pseudo';\n\n// form control elements selector\nfunction isFormControlElement(element) {\n\tif (element.nodeName === 'INPUT' || element.nodeName === 'SELECT' || element.nodeName === 'TEXTAREA') {\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction createNewEvent(eventName) {\n\tlet event;\n\n\tif (typeof(Event) === 'function') {\n\t\tevent = new Event(eventName, { bubbles: true });\n\t} else {\n\t\tevent = document.createEvent('Event');\n\t\tevent.initEvent(eventName, true, false);\n\t}\n\n\treturn event;\n}\n\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleInputOrChangeEvent(event) {\n\t\tconst element = event.target;\n\t\tif (!isFormControlElement(element)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst isSelect = element.nodeName === 'SELECT';\n\t\tconst hasValue = isSelect\n\t\t\t? !!element.options[element.selectedIndex].value\n\t\t\t: !!element.value;\n\n\t\tif (hasValue) {\n\t\t\tremove(element);\n\t\t} else {\n\t\t\tadd(element);\n\t\t}\n\t};\n}\n\n// observe changes to the \"selected\" property on an HTML Element\nfunction observeSelectedOfHTMLElement(HTMLElement) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'selected');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set(value) { // eslint-disable-line no-unused-vars\n\t\tnativeSet.apply(this, arguments);\n\n\t\tconst event = createNewEvent('change');\n\t\tthis.parentElement.dispatchEvent(event);\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'selected', descriptor);\n}\n\n// observe changes to the \"value\" property on an HTML Element\nfunction observeValueOfHTMLElement(HTMLElement, handler) {\n\tconst descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'value');\n\tconst nativeSet = descriptor.set;\n\n\tdescriptor.set = function set() {\n\t\tnativeSet.apply(this, arguments);\n\t\thandler({ target: this });\n\t};\n\n\tObject.defineProperty(HTMLElement.prototype, 'value', descriptor);\n}\n\nexport default function cssBlankPseudoInit(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[blank]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':blank');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handler = generateHandler(options.replaceWith);\n\tconst bindEvents = () => {\n\t\tif (document.body) {\n\t\t\tdocument.body.addEventListener('change', handler);\n\t\t\tdocument.body.addEventListener('input', handler);\n\t\t}\n\t};\n\tconst updateAllCandidates = () => {\n\t\tArray.prototype.forEach.call(\n\t\t\tdocument.querySelectorAll('input, select, textarea'),\n\t\t\tnode => {\n\t\t\t\thandler({ target: node });\n\t\t\t},\n\t\t);\n\t};\n\n\tif (document.body) {\n\t\tbindEvents();\n\t} else {\n\t\twindow.addEventListener('load', bindEvents);\n\t}\n\n\tif (document.documentElement.className.indexOf(CSS_CLASS_LOADED) === -1) {\n\t\tdocument.documentElement.className += ` ${CSS_CLASS_LOADED}`;\n\t}\n\n\tobserveValueOfHTMLElement(self.HTMLInputElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLSelectElement, handler);\n\tobserveValueOfHTMLElement(self.HTMLTextAreaElement, handler);\n\tobserveSelectedOfHTMLElement(self.HTMLOptionElement);\n\n\t// conditionally update all form control elements\n\tupdateAllCandidates();\n\n\tif (typeof self.MutationObserver !== 'undefined') {\n\t\t// conditionally observe added or unobserve removed form control elements\n\t\tnew MutationObserver(mutationsList => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\tArray.prototype.forEach.call(\n\t\t\t\t\tmutation.addedNodes || [],\n\t\t\t\t\tnode => {\n\t\t\t\t\t\tif (node.nodeType === 1 && isFormControlElement(node)) {\n\t\t\t\t\t\t\thandler({ target: node });\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t);\n\t\t\t});\n\t\t}).observe(document, { childList: true, subtree: true });\n\t} else {\n\t\tconst handleOnLoad = () => updateAllCandidates();\n\n\t\twindow.addEventListener('load', handleOnLoad);\n\t\twindow.addEventListener('DOMContentLoaded', handleOnLoad);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","CSS_CLASS_LOADED","isFormControlElement","element","nodeName","createNewEvent","eventName","event","Event","bubbles","document","createEvent","initEvent","observeValueOfHTMLElement","HTMLElement","handler","descriptor","Object","getOwnPropertyDescriptor","prototype","nativeSet","set","apply","this","arguments","target","defineProperty","cssBlankPseudoInit","opts","options","force","replaceWith","Error","querySelector","ignoredError","remove","add","slice","el","classList","removeAttribute","setAttribute","handleInputOrChangeEvent","selectedIndex","value","bindEvents","body","addEventListener","updateAllCandidates","Array","forEach","call","querySelectorAll","node","window","documentElement","className","self","HTMLInputElement","HTMLSelectElement","HTMLTextAreaElement","HTMLOptionElement","parentElement","dispatchEvent","MutationObserver","mutationsList","mutation","addedNodes","nodeType","observe","childList","subtree","handleOnLoad"],"mappings":"AAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EAASC,IACzEF,EAASI,QAAQN,EAAsBI,KAAO,IACjDD,GAAU,GAIZ,OAAOA,CACR,CCpBA,IAAMI,EAAmB,kBAGzB,SAASC,qBAAqBC,GAC7B,MAAyB,UAArBA,EAAQC,UAA6C,WAArBD,EAAQC,UAA8C,aAArBD,EAAQC,QAK9E,CAEA,SAASC,eAAeC,GACvB,IAAIC,EASJ,MAPsB,mBAAXC,MACVD,EAAQ,IAAIC,MAAMF,EAAW,CAAEG,SAAS,KAExCF,EAAQG,SAASC,YAAY,UACvBC,U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line at end of file diff --git a/plugins/css-blank-pseudo/dist/index.d.cts b/plugins/css-blank-pseudo/dist/index.d.cts new file mode 100644 index 000000000..ee2a8b317 --- /dev/null +++ b/plugins/css-blank-pseudo/dist/index.d.cts @@ -0,0 +1,13 @@ +import { PluginCreator } from 'postcss'; +/** css-blank-pseudo plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Replacement for ":blank". default: "[blank]" */ + replaceWith?: string; + /** Do not inject "js-blank-pseudo" before each selector with "[blank]". default: false */ + disablePolyfillReadyClass?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/css-blank-pseudo/dist/index.d.mts b/plugins/css-blank-pseudo/dist/index.d.mts new file mode 100644 index 000000000..611dd07cd --- /dev/null +++ b/plugins/css-blank-pseudo/dist/index.d.mts @@ -0,0 +1,12 @@ +import { PluginCreator } from 'postcss'; +/** css-blank-pseudo plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Replacement for ":blank". default: "[blank]" */ + replaceWith?: string; + /** Do not inject "js-blank-pseudo" before each selector with "[blank]". default: false */ + disablePolyfillReadyClass?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/css-blank-pseudo/dist/index.d.ts b/plugins/css-blank-pseudo/dist/index.d.ts index 488c813e6..ee2a8b317 100644 --- a/plugins/css-blank-pseudo/dist/index.d.ts +++ b/plugins/css-blank-pseudo/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** css-blank-pseudo plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** Replacement for ":blank". default: "[blank]" */ @@ -9,4 +9,5 @@ export type pluginOptions = { disablePolyfillReadyClass?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/css-blank-pseudo/package.json b/plugins/css-blank-pseudo/package.json index 8b5696a9b..1f5d86cad 100644 --- a/plugins/css-blank-pseudo/package.json +++ b/plugins/css-blank-pseudo/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./browser": { "import": "./dist/browser.mjs", diff --git a/plugins/css-blank-pseudo/src/browser.js b/plugins/css-blank-pseudo/src/browser.js index 4234c835e..bb2df4aa8 100644 --- a/plugins/css-blank-pseudo/src/browser.js +++ b/plugins/css-blank-pseudo/src/browser.js @@ -1,5 +1,5 @@ /* global document,window,self,MutationObserver */ -import isValidReplacement from './is-valid-replacement.mjs'; +import isValidReplacement from './is-valid-replacement.js'; const CSS_CLASS_LOADED = 'js-blank-pseudo'; diff --git a/plugins/css-blank-pseudo/src/index.ts b/plugins/css-blank-pseudo/src/index.ts index 875798615..9072b0704 100644 --- a/plugins/css-blank-pseudo/src/index.ts +++ b/plugins/css-blank-pseudo/src/index.ts @@ -1,6 +1,6 @@ import type { PluginCreator } from 'postcss'; import parser from 'postcss-selector-parser'; -import isValidReplacement from './is-valid-replacement.mjs'; +import isValidReplacement from './is-valid-replacement.js'; /** css-blank-pseudo plugin options */ export type pluginOptions = { @@ -91,7 +91,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { return [selector]; } - const selectorASTClone = selectorAST.clone(); + const selectorASTClone = selectorAST.clone() as parser.Root /* TODO : delete the "as" clause */; // html > .foo:focus-within // becomes: @@ -109,7 +109,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { if (i === selectorAST.nodes[0].nodes.length - 1) { // Append the class to the end of the selector if no combinator or pseudo element was found. - selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME })); + selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME }) as unknown as parser.Selector /* TODO : delete the "as" clause */); break; } } @@ -117,8 +117,8 @@ const creator: PluginCreator = (opts?: pluginOptions) => { if (selectorAST.nodes?.[0]?.nodes) { // Prepend a space combinator and the class to the beginning of the selector. - selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' })); - selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME })); + selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' }) as unknown as parser.Selector /* TODO : delete the "as" clause */); + selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME }) as unknown as parser.Selector /* TODO : delete the "as" clause */); } return [selectorAST.toString(), selectorASTClone.toString()]; diff --git a/plugins/css-blank-pseudo/src/is-valid-replacement.d.mts b/plugins/css-blank-pseudo/src/is-valid-replacement.d.ts similarity index 100% rename from plugins/css-blank-pseudo/src/is-valid-replacement.d.mts rename to plugins/css-blank-pseudo/src/is-valid-replacement.d.ts diff --git a/plugins/css-blank-pseudo/src/is-valid-replacement.mjs b/plugins/css-blank-pseudo/src/is-valid-replacement.js similarity index 100% rename from plugins/css-blank-pseudo/src/is-valid-replacement.mjs rename to plugins/css-blank-pseudo/src/is-valid-replacement.js diff --git a/plugins/css-blank-pseudo/test/_valid-replacements.mjs b/plugins/css-blank-pseudo/test/_valid-replacements.mjs index bcc4d294d..8654f0d31 100644 --- a/plugins/css-blank-pseudo/test/_valid-replacements.mjs +++ b/plugins/css-blank-pseudo/test/_valid-replacements.mjs @@ -1,5 +1,5 @@ import assert from 'assert'; -import isValidReplacement from '../src/is-valid-replacement.mjs'; +import isValidReplacement from '../src/is-valid-replacement.js'; const valid = [ '[some-attribute]', diff --git a/plugins/css-blank-pseudo/tsconfig.json b/plugins/css-blank-pseudo/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/css-blank-pseudo/tsconfig.json +++ b/plugins/css-blank-pseudo/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/css-has-pseudo/dist/browser-global.js.map b/plugins/css-has-pseudo/dist/browser-global.js.map index 5937dba2c..ec304b8a6 100644 --- a/plugins/css-has-pseudo/dist/browser-global.js.map +++ b/plugins/css-has-pseudo/dist/browser-global.js.map @@ -1 +1 @@ -{"version":3,"file":"browser-global.js","sources":["../src/encode/decode.mjs","../src/encode/extract.mjs","../src/encode/encode.mjs","../src/browser.js","../../../node_modules/@mrhenry/core-web/modules/~element-qsa-has.js","../src/browser-global.js"],"sourcesContent":["\n/** Decodes an identifier back into a CSS selector */\nexport default function decodeCSS(value) {\n\tif (value.slice(0, 13) !== 'csstools-has-') {\n\t\treturn '';\n\t}\n\n\tvalue = value.slice(13);\n\tlet values = value.split('-');\n\n\tlet result = '';\n\tfor (let i = 0; i < values.length; i++) {\n\t\tresult += String.fromCharCode(parseInt(values[i], 36));\n\t}\n\n\treturn result;\n}\n","import decodeCSS from './decode.mjs';\n\n/** Extract encoded selectors out of attribute selectors */\nexport default function extractEncodedSelectors(value) {\n\tlet out = [];\n\n\tlet depth = 0;\n\tlet candidate;\n\n\tlet quoted = false;\n\tlet quotedMark;\n\n\tlet containsUnescapedUnquotedHasAtDepth1 = false;\n\n\t// Stryker disable next-line EqualityOperator\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value[i];\n\n\t\tswitch (char) {\n\t\t\tcase '[':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\tcandidate = '';\n\t\t\t\t} else {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t}\n\n\t\t\t\tdepth++;\n\t\t\t\tcontinue;\n\t\t\tcase ']':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\tdepth--;\n\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\tconst decoded = decodeCSS(candidate);\n\t\t\t\t\t\tif (containsUnescapedUnquotedHasAtDepth1) {\n\t\t\t\t\t\t\tout.push(decoded);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcandidate += char;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\tcase '\\\\':\n\t\t\t\tcandidate += value[i];\n\t\t\t\tcandidate += value[i+1];\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\n\t\t\tcase '\"':\n\t\t\tcase '\\'':\n\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tquoted = true;\n\t\t\t\tquotedMark = char;\n\t\t\t\tcontinue;\n\n\t\t\tdefault:\n\t\t\t\tif (candidate === '' && depth === 1 && (value.slice(i, i + 13) === 'csstools-has-')) {\n\t\t\t\t\tcontainsUnescapedUnquotedHasAtDepth1 = true;\n\t\t\t\t}\n\n\t\t\t\tcandidate += char;\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\n\tconst unique = [];\n\tfor (let i = 0; i < out.length; i++) {\n\t\tif (unique.indexOf(out[i]) === -1) {\n\t\t\tunique.push(out[i]);\n\t\t}\n\t}\n\n\treturn unique;\n}\n","\n/** Returns the string as an encoded CSS identifier. */\nexport default function encodeCSS(value) {\n\tif (value === '') {\n\t\treturn '';\n\t}\n\n\tlet hex;\n\tlet result = '';\n\tfor (let i = 0; i < value.length; i++) {\n\t\thex = value.charCodeAt(i).toString(36);\n\t\tif (i === 0) {\n\t\t\tresult += hex;\n\t\t} else {\n\t\t\tresult += '-' + hex;\n\t\t}\n\t}\n\n\treturn 'csstools-has-' + result;\n}\n","/* global MutationObserver,requestAnimationFrame,cancelAnimationFrame,self,HTMLElement */\n\nimport '@mrhenry/core-web/modules/~element-qsa-has.js';\nimport extractEncodedSelectors from './encode/extract.mjs';\nimport encodeCSS from './encode/encode.mjs';\n\nfunction hasNativeSupport() {\n\ttry {\n\t\tif (!('CSS' in self) || !('supports' in self.CSS) || !self.CSS.supports('selector(:has(div))')) {\n\t\t\treturn false;\n\t\t}\n\n\t} catch (_) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default function cssHasPseudo(document, options) {\n\t// OPTIONS\n\t{\n\t\tif (!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\toptions = {\n\t\t\thover: (!!options.hover) || false,\n\t\t\tdebug: (!!options.debug) || false,\n\t\t\tobservedAttributes: options.observedAttributes || [],\n\t\t\tforcePolyfill: (!!options.forcePolyfill) || false,\n\t\t};\n\n\t\toptions.mustPolyfill = options.forcePolyfill || !hasNativeSupport();\n\n\t\tif (!Array.isArray(options.observedAttributes)) {\n\t\t\toptions.observedAttributes = [];\n\t\t}\n\n\t\toptions.observedAttributes = options.observedAttributes.filter((x) => {\n\t\t\treturn (typeof x === 'string');\n\t\t});\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n\t\t// `data-*` and `style` were omitted\n\t\toptions.observedAttributes = options.observedAttributes.concat(['accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'alt', 'async', 'autocapitalize', 'autocomplete', 'autofocus', 'autoplay', 'buffered', 'capture', 'challenge', 'charset', 'checked', 'cite', 'class', 'code', 'codebase', 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'data', 'datetime', 'decoding', 'default', 'defer', 'dir', 'dirname', 'disabled', 'download', 'draggable', 'enctype', 'enterkeyhint', 'for', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'headers', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'icon', 'id', 'importance', 'integrity', 'intrinsicsize', 'inputmode', 'ismap', 'itemprop', 'keytype', 'kind', 'label', 'lang', 'language', 'list', 'loop', 'low', 'manifest', 'max', 'maxlength', 'minlength', 'media', 'method', 'min', 'multiple', 'muted', 'name', 'novalidate', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'poster', 'preload', 'radiogroup', 'readonly', 'referrerpolicy', 'rel', 'required', 'reversed', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'summary', 'tabindex', 'target', 'title', 'translate', 'type', 'usemap', 'value', 'width', 'wrap']);\n\t}\n\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\tif (!options.mustPolyfill) {\n\t\t// Cleanup of rules will have happened in `walkStyleSheet`\n\t\t// Native support will take over from here\n\t\treturn;\n\t}\n\n\ttransformObservedItemsThrottled();\n\n\t// observe DOM modifications that affect selectors\n\tif ('MutationObserver' in self) {\n\t\tconst mutationObserver = new MutationObserver((mutationsList) => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// transform observed css rules\n\t\t\t\tcleanupObservedCssRules();\n\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t});\n\t\t});\n\n\t\tmutationObserver.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: options.observedAttributes });\n\t}\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('blur', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('input', transformObservedItemsThrottled);\n\tdocument.addEventListener('change', transformObservedItemsThrottled, true);\n\n\tif (options.hover) {\n\t\tif ('onpointerenter' in document) {\n\t\t\tdocument.addEventListener('pointerenter', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('pointerleave', transformObservedItemsThrottled, true);\n\t\t} else {\n\t\t\tdocument.addEventListener('mouseover', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('mouseout', transformObservedItemsThrottled, true);\n\t\t}\n\t}\n\n\t// observe Javascript setters that effect pseudo-selectors\n\tif ('defineProperty' in Object && 'getOwnPropertyDescriptor' in Object && 'hasOwnProperty' in Object) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction observeProperty(proto, property) {\n\t\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\t\tif (proto.hasOwnProperty(property)) {\n\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, property);\n\t\t\t\t\tif (descriptor && descriptor.configurable && 'set' in descriptor) {\n\t\t\t\t\t\tObject.defineProperty(proto, property, {\n\t\t\t\t\t\t\tconfigurable: descriptor.configurable,\n\t\t\t\t\t\t\tenumerable: descriptor.enumerable,\n\t\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\t\treturn descriptor.get.apply(this, arguments);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tset: function () {\n\t\t\t\t\t\t\t\tdescriptor.set.apply(this, arguments);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t\t\t// should never happen as there is an inner try/catch\n\t\t\t\t\t\t\t\t\t// but just in case\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ('HTMLElement' in self && HTMLElement.prototype) {\n\t\t\t\tobserveProperty(HTMLElement.prototype, 'disabled');\n\t\t\t}\n\n\t\t\t// Not all of these elements have all of these properties.\n\t\t\t// But the code above checks if they exist first.\n\t\t\t['checked', 'selected', 'readOnly', 'required'].forEach((property) => {\n\t\t\t\t[\n\t\t\t\t\t'HTMLButtonElement',\n\t\t\t\t\t'HTMLFieldSetElement',\n\t\t\t\t\t'HTMLInputElement',\n\t\t\t\t\t'HTMLMeterElement',\n\t\t\t\t\t'HTMLOptGroupElement',\n\t\t\t\t\t'HTMLOptionElement',\n\t\t\t\t\t'HTMLOutputElement',\n\t\t\t\t\t'HTMLProgressElement',\n\t\t\t\t\t'HTMLSelectElement',\n\t\t\t\t\t'HTMLTextAreaElement',\n\t\t\t\t].forEach((elementName) => {\n\t\t\t\t\tif (elementName in self && self[elementName].prototype) {\n\t\t\t\t\t\tobserveProperty(self[elementName].prototype, property);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet transformObservedItemsThrottledBusy = false;\n\tfunction transformObservedItemsThrottled() {\n\t\tif (transformObservedItemsThrottledBusy) {\n\t\t\tcancelAnimationFrame(transformObservedItemsThrottledBusy);\n\t\t}\n\n\t\ttransformObservedItemsThrottledBusy = requestAnimationFrame(() => {\n\t\t\ttransformObservedItems();\n\t\t});\n\t}\n\n\t// transform observed css rules\n\tfunction transformObservedItems() {\n\t\tobservedItems.forEach((item) => {\n\t\t\tconst nodes = [];\n\n\t\t\tlet matches = [];\n\t\t\ttry {\n\t\t\t\tmatches = document.querySelectorAll(item.selector);\n\t\t\t} catch (e) {\n\t\t\t\tif (options.debug) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t[].forEach.call(matches, (element) => {\n\t\t\t\t// memorize the node\n\t\t\t\tnodes.push(element);\n\n\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\tattributeElement.innerHTML = '';\n\n\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t});\n\n\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\titem.nodes.forEach(node => {\n\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// update the\n\t\t\titem.nodes = nodes;\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules() {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter((item) => {\n\t\t\t\treturn item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet(styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], (rule, index) => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\trule.selectorText = rule.selectorText.replace(/\\.js-has-pseudo\\s/g, '');\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t\tconst hasSelectors = extractEncodedSelectors(rule.selectorText.toString());\n\t\t\t\t\t\tif (hasSelectors.length === 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!options.mustPolyfill) {\n\t\t\t\t\t\t\tstyleSheet.deleteRule(index);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < hasSelectors.length; i++) {\n\t\t\t\t\t\t\tconst hasSelector = hasSelectors[i];\n\t\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\t\trule: rule,\n\t\t\t\t\t\t\t\tselector: hasSelector,\n\t\t\t\t\t\t\t\tattributeName: encodeCSS(hasSelector),\n\t\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n}\n","/* eslint-disable */\n(function (global) {\n\ttry {\n\t\t// test for has support\n\t\tglobal.document.querySelector(':has(*, :does-not-exist, > *)');\n\n\t\tif (\n\t\t\t!global.document.querySelector(':has(:scope *)') &&\n\t\t\tCSS.supports('selector(:has(div))')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t} catch (_) { }\n\n\t// ELEMENT\n\t// polyfill Element#querySelector\n\tvar querySelectorWithHasElement = polyfill(global.Element.prototype.querySelector);\n\n\tglobal.Element.prototype.querySelector = function querySelector(selectors) {\n\t\treturn querySelectorWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#querySelectorAll\n\tvar querySelectorAllWithHasElement = polyfill(global.Element.prototype.querySelectorAll);\n\n\tglobal.Element.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\treturn querySelectorAllWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#matches\n\tif (global.Element.prototype.matches) {\n\t\tvar matchesWithHasElement = polyfill(global.Element.prototype.matches);\n\n\t\tglobal.Element.prototype.matches = function matches(selectors) {\n\t\t\treturn matchesWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// polyfill Element#closest\n\tif (global.Element.prototype.closest) {\n\t\tvar closestWithHasElement = polyfill(global.Element.prototype.closest);\n\n\t\tglobal.Element.prototype.closest = function closest(selectors) {\n\t\t\treturn closestWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// DOCUMENT\n\tif ('Document' in global && 'prototype' in global.Document) {\n\t\t// polyfill Document#querySelector\n\t\tvar querySelectorWithHasDocument = polyfill(global.Document.prototype.querySelector);\n\n\t\tglobal.Document.prototype.querySelector = function querySelector(selectors) {\n\t\t\treturn querySelectorWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#querySelectorAll\n\t\tvar querySelectorAllWithHasDocument = polyfill(global.Document.prototype.querySelectorAll);\n\n\t\tglobal.Document.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\t\treturn querySelectorAllWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#matches\n\t\tif (global.Document.prototype.matches) {\n\t\t\tvar matchesWithHasDocument = polyfill(global.Document.prototype.matches);\n\n\t\t\tglobal.Document.prototype.matches = function matches(selectors) {\n\t\t\t\treturn matchesWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\n\t\t// polyfill Document#closest\n\t\tif (global.Document.prototype.closest) {\n\t\t\tvar closestWithHasDocument = polyfill(global.Document.prototype.closest);\n\n\t\t\tglobal.Document.prototype.closest = function closest(selectors) {\n\t\t\t\treturn closestWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction pseudoClassHasInnerQuery(query) {\n\t\tvar current = '';\n\t\tvar start = 0;\n\t\tvar depth = 0;\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar inHas = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':has(' && !inHas) {\n\t\t\t\tinHas = true;\n\t\t\t\tstart = i;\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tif (!inHas) {\n\t\t\t\t\t\tcurrent = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tdepth++;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase ')':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinnerQuery: current,\n\t\t\t\t\t\t\t\tstart: start,\n\t\t\t\t\t\t\t\tend: i-1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdepth--;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction replaceScopeWithAttr(query, attr) {\n\t\tvar parts = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':scope' && !bracketed && (/^[\\[\\.\\:\\\\\"\\s|+>~#&,)]/.test(char || ''))) {\n\t\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\t\tparts.push('[' + attr + ']');\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tparts.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (current.toLowerCase() === ':scope') {\n\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\tparts.push('[' + attr + ']');\n\t\t\tcurrent = '';\n\t\t}\n\n\t\tif (parts.length === 0) {\n\t\t\treturn query;\n\t\t}\n\n\t\treturn parts.join('') + current;\n\t}\n\n\tfunction charIsNestedMarkMirror(char, mark) {\n\t\tif (mark === '(' && char === ')') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (mark === '[' && char === ']') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction splitSelector(query) {\n\t\tvar selectors = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar nestedMark = false;\n\t\tvar nestedDepth = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ',':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nestedDepth > 0) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectors.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tquoted = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\tcase ')':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (charIsNestedMarkMirror(char, nestedMark)) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth--;\n\n\t\t\t\t\t\tif (nestedDepth === 0) {\n\t\t\t\t\t\t\tnestedMark = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (char === nestedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tnestedDepth++;\n\t\t\t\t\tnestedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t}\n\n\t\tselectors.push(current);\n\n\t\treturn selectors;\n\t}\n\n\tfunction replaceAllWithTempAttr(query, nested, callback) {\n\t\tvar inner = pseudoClassHasInnerQuery(query);\n\t\tif (!inner) {\n\t\t\treturn query;\n\t\t}\n\n\t\tif (nested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar innerQuery = inner.innerQuery;\n\t\tvar attr = 'q-has' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\tvar innerReplacement = '[' + attr + ']';\n\n\t\tvar x = query;\n\n\t\tif (inner.innerQuery.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar innerParts = splitSelector(inner.innerQuery);\n\t\t\tvar newInnerParts = [];\n\t\t\tfor (var i = 0; i < innerParts.length; i++) {\n\t\t\t\tvar innerPart = innerParts[i];\n\n\t\t\t\t// Nested has is not supported.\n\t\t\t\t// If a recursive/nested call returns \"false\" we throw\n\t\t\t\tvar innerPartReplaced = replaceAllWithTempAttr(innerPart, true, function () { });\n\t\t\t\tif (!innerPartReplaced) {\n\t\t\t\t\tthrow new Error(\"Nested :has() is not supported\")\n\t\t\t\t} else {\n\t\t\t\t\tnewInnerParts.push(innerPart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\t\treturn _prefix + newInnerParts.join(', ') + _suffix;\n\t\t}\n\n\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\tx = _prefix + innerReplacement + _suffix;\n\n\t\tcallback(innerQuery, attr);\n\t\tif (x.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar y = replaceAllWithTempAttr(x, false, callback);\n\t\t\tif (y) {\n\t\t\t\treturn y;\n\t\t\t}\n\t\t}\n\n\t\treturn x;\n\t}\n\n\tfunction walkNode(rootNode, callback) {\n\t\tif (('setAttribute' in (rootNode)) && ('querySelector' in (rootNode))) {\n\t\t\tcallback(rootNode);\n\t\t}\n\n\t\tif (rootNode.hasChildNodes()) {\n\t\t\tvar nodes = rootNode.childNodes;\n\t\t\tfor (var i = 0; i < nodes.length; ++i) {\n\t\t\t\twalkNode(nodes[i], callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction polyfill(qsa) {\n\t\treturn function (selectors) {\n\t\t\tif (!selectors) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar selectorsString = String(selectors);\n\t\t\tif (!selectorsString || (selectorsString.toLowerCase().indexOf(':has(') === -1) || !pseudoClassHasInnerQuery(selectorsString)) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar rootNode;\n\t\t\tif ('getRootNode' in this) {\n\t\t\t\trootNode = this.getRootNode();\n\t\t\t} else {\n\t\t\t\tvar r = this;\n\t\t\t\twhile (r) {\n\t\t\t\t\trootNode = r;\n\t\t\t\t\tr = r.parentNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _focus = this;\n\t\t\tif (_focus === global.document) {\n\t\t\t\t_focus = global.document.documentElement;\n\t\t\t}\n\n\t\t\tvar scopeAttr = 'q-has-scope' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t_focus.setAttribute(scopeAttr, '');\n\n\t\t\ttry {\n\t\t\t\tselectorsString = replaceScopeWithAttr(selectorsString, scopeAttr);\n\n\t\t\t\tvar attrs = [scopeAttr];\n\t\t\t\tvar newQuery = replaceAllWithTempAttr(selectorsString, false, function (inner, attr) {\n\t\t\t\t\tattrs.push(attr);\n\n\t\t\t\t\tvar selectorParts = splitSelector(inner);\n\t\t\t\t\tfor (var x = 0; x < selectorParts.length; x++) {\n\t\t\t\t\t\tvar selectorPart = selectorParts[x].trim();\n\t\t\t\t\t\tvar absoluteSelectorPart = selectorPart;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tselectorPart[0] === '>' ||\n\t\t\t\t\t\t\tselectorPart[0] === '+' ||\n\t\t\t\t\t\t\tselectorPart[0] === '~'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tabsoluteSelectorPart = selectorPart.slice(1).trim();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteSelectorPart = ':scope ' + selectorPart;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twalkNode(rootNode, function (node) {\n\t\t\t\t\t\t\tif (!(node.querySelector(absoluteSelectorPart))) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch (selectorPart[0]) {\n\t\t\t\t\t\t\t\tcase '~':\n\t\t\t\t\t\t\t\tcase '+':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar siblings = node.childNodes;\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < siblings.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tvar sibling = siblings[i];\n\t\t\t\t\t\t\t\t\t\t\tif (!('setAttribute' in sibling)) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope [' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tsibling.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\tnode.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope[' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnode.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\targuments[0] = newQuery;\n\n\t\t\t\t// results of the qsa\n\t\t\t\tvar elementOrNodeList = qsa.apply(this, arguments);\n\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// return the results of the qsa\n\t\t\t\treturn elementOrNodeList;\n\t\t\t} catch (err) {\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar errorMessage = '';\n\t\t\t\ttry {\n\t\t\t\t\tqsa.apply(this, [':core-web-does-not-exist']);\n\t\t\t\t} catch (dummyError) {\n\t\t\t\t\terrorMessage = dummyError.message;\n\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\terrorMessage = errorMessage.replace(':core-web-does-not-exist', selectorsString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!errorMessage) {\n\t\t\t\t\terrorMessage = \"Failed to execute 'querySelector' on 'Document': '\" + selectorsString + \"' is not a valid selector.\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new DOMException(errorMessage);\n\t\t\t\t} catch (_) {\n\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n})(self);\n","/* global self,window */\nimport { default as cssHasPseudo } from './browser';\n\n(function (global) {\n\tglobal.cssHasPseudo = cssHasPseudo;\n}('object' === typeof window && window || 'object' === typeof self && self || {}));\n"],"names":["decodeCSS","value","slice","values","split","result","i","length","String","fromCharCode","parseInt","extractEncodedSelectors","candidate","quotedMark","out","depth","quoted","containsUnescapedUnquotedHasAtDepth1","char","decoded","push","unique","indexOf","encodeCSS","hex","charCodeAt","toString","hasNativeSupport","self","CSS","supports","_","cssHasPseudo","document","options","hover","debug","observedAttributes","forcePolyfill","mustPolyfill","Array","isArray","filter","x","concat","observedItems","attributeElement","createElement","forEach","call","styleSheets","walkStyleSheet","transformObservedItemsThrottled","MutationObserver","mutationsList","mutation","addedNodes","node","nodeType","sheet","apply","splice","item","rule","parentStyleSheet","ownerNode","documentElement","contains","observe","childList","subtree","attributes","attributeFilter","addEventListener","Object","observeProperty","proto","property","hasOwnProperty","descriptor","getOwnPropertyDescriptor","configurable","defineProperty","enumerable","get","this","arguments","set","HTMLElement","prototype","elementName","e","console","error","transformObservedItemsThrottledBusy","cancelAnimationFrame","requestAnimationFrame","nodes","matches","querySelectorAll","selector","element","innerHTML","attributeName","setAttributeNode","children","cloneNode","style","zoom","removeAttribute","styleSheet","cssRules","index","selectorText","replace","hasSelectors","deleteRule","hasSelector","global","querySelector","querySelectorWithHasElement","polyfill","Element","selectors","querySelectorAllWithHasElement","matchesWithHasElement","closest","closestWithHasElement","Document","querySelectorWithHasDocument","querySelectorAllWithHasDocument","matchesWithHasDocument","closestWithHasDocument","pseudoClassHasInnerQuery","query","current","start","escaped","inHas","toLowerCase","innerQuery","end","replaceScopeWithAttr","attr","parts","bracketed","test","join","splitSelector","mark","nestedMark","nestedDepth","replaceAllWithTempAttr","nested","callback","inner","Math","floor","random","innerReplacement","innerParts","newInnerParts","innerPart","Error","_prefix","substring","_suffix","y","walkNode","rootNode","hasChildNodes","childNodes","qsa","selectorsString","getRootNode","r","parentNode","_focus","scopeAttr","setAttribute","attrs","newQuery","selectorParts","selectorPart","trim","absoluteSelectorPart","siblings","sibling","idAttr","elementOrNodeList","attrsForQuery","j","elements","k","l","err","errorMessage","dummyError","message","DOMException","window"],"mappings":"YAEe,SAASA,UAAUC,GACjC,GAA2B,kBAAvBA,EAAMC,MAAM,EAAG,IAClB,MAAO,GAOR,IAHA,IAAIC,GADJF,EAAQA,EAAMC,MAAM,KACDE,MAAM,KAErBC,EAAS,GACJC,EAAI,EAAGA,EAAIH,EAAOI,OAAQD,IAClCD,GAAUG,OAAOC,aAAaC,SAASP,EAAOG,GAAI,KAGnD,OAAOD,CACR,CCbe,SAASM,wBAAwBV,GAY/C,IAXA,IAGIW,EAGAC,EANAC,EAAM,G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,MAAOM,GAGR,GAFAlB,EAAOpE,gBAAgBqE,GAEnBE,EAAM7K,OAAS,EAAG,CAGrB,IADIuL,EAAgB,GACXC,EAAI,EAAGA,EAAIX,EAAM7K,OAAQwL,IACjCD,EAAc1K,KAAK,IAAMgK,EAAMW,GAAK,KAIrC,IADIC,EAAW1E,EAAOrF,SAASkE,iBAAiB2F,EAAc3C,KAAK,MAC1D8C,EAAI,EAAGA,EAAID,EAASzL,OAAQ0L,IAEpC,IADI5F,EAAU2F,EAASC,GACdC,EAAI,EAAGA,EAAId,EAAM7K,OAAQ2L,IACjC7F,EAAQQ,gBAAgBuE,EAAMc,GAGjC,CAEA,IAAIE,EAAe,GACnB,IACCxB,EAAIhH,MAAMyB,KAAM,CAAC,4BACjB,CAAC,MAAOgH,GACRD,EAAeC,EAAWC,QACtBF,IACHA,EAAeA,EAAalF,QAAQ,2BAA4B2D,GAElE,CAEKuB,IACJA,EAAe,qDAAuDvB,EAAkB,8BAGzF,IACC,MAAM,IAAI0B,aAAaH,EACvB,CAAC,MAAOrK,GACR,MAAM,IAAIoI,MAAMiC,EACjB,CACD,EAEF,CACA,CAvmBD,CAumBGxK,OCnmBD,iBAAoB4K,QAAUA,QAAU,iBAAoB5K,MAAQA,MAAQ,IADtEI,aAAeA","x_google_ignoreList":[4]} \ No newline at end of file +{"version":3,"file":"browser-global.js","sources":["../src/encode/decode.js","../src/encode/extract.js","../src/encode/encode.js","../src/browser.js","../../../node_modules/@mrhenry/core-web/modules/~element-qsa-has.js","../src/browser-global.js"],"sourcesContent":["/** Decodes an identifier back into a CSS selector */\nexport default function decodeCSS(value) {\n\tif (value.slice(0, 13) !== 'csstools-has-') {\n\t\treturn '';\n\t}\n\n\tvalue = value.slice(13);\n\tlet values = value.split('-');\n\n\tlet result = '';\n\tfor (let i = 0; i < values.length; i++) {\n\t\tresult += String.fromCharCode(parseInt(values[i], 36));\n\t}\n\n\treturn result;\n}\n","import decodeCSS from './decode.js';\n\n/** Extract encoded selectors out of attribute selectors */\nexport default function extractEncodedSelectors(value) {\n\tlet out = [];\n\n\tlet depth = 0;\n\tlet candidate;\n\n\tlet quoted = false;\n\tlet quotedMark;\n\n\tlet containsUnescapedUnquotedHasAtDepth1 = false;\n\n\t// Stryker disable next-line EqualityOperator\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value[i];\n\n\t\tswitch (char) {\n\t\t\tcase '[':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\tcandidate = '';\n\t\t\t\t} else {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t}\n\n\t\t\t\tdepth++;\n\t\t\t\tcontinue;\n\t\t\tcase ']':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\tdepth--;\n\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\tconst decoded = decodeCSS(candidate);\n\t\t\t\t\t\tif (containsUnescapedUnquotedHasAtDepth1) {\n\t\t\t\t\t\t\tout.push(decoded);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcandidate += char;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\tcase '\\\\':\n\t\t\t\tcandidate += value[i];\n\t\t\t\tcandidate += value[i+1];\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\n\t\t\tcase '\"':\n\t\t\tcase '\\'':\n\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tquoted = true;\n\t\t\t\tquotedMark = char;\n\t\t\t\tcontinue;\n\n\t\t\tdefault:\n\t\t\t\tif (candidate === '' && depth === 1 && (value.slice(i, i + 13) === 'csstools-has-')) {\n\t\t\t\t\tcontainsUnescapedUnquotedHasAtDepth1 = true;\n\t\t\t\t}\n\n\t\t\t\tcandidate += char;\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\n\tconst unique = [];\n\tfor (let i = 0; i < out.length; i++) {\n\t\tif (unique.indexOf(out[i]) === -1) {\n\t\t\tunique.push(out[i]);\n\t\t}\n\t}\n\n\treturn unique;\n}\n","/** Returns the string as an encoded CSS identifier. */\nexport default function encodeCSS(value) {\n\tif (value === '') {\n\t\treturn '';\n\t}\n\n\tlet hex;\n\tlet result = '';\n\tfor (let i = 0; i < value.length; i++) {\n\t\thex = value.charCodeAt(i).toString(36);\n\t\tif (i === 0) {\n\t\t\tresult += hex;\n\t\t} else {\n\t\t\tresult += '-' + hex;\n\t\t}\n\t}\n\n\treturn 'csstools-has-' + result;\n}\n","/* global MutationObserver,requestAnimationFrame,cancelAnimationFrame,self,HTMLElement */\n\nimport '@mrhenry/core-web/modules/~element-qsa-has.js';\nimport extractEncodedSelectors from './encode/extract.js';\nimport encodeCSS from './encode/encode.js';\n\nfunction hasNativeSupport() {\n\ttry {\n\t\tif (!('CSS' in self) || !('supports' in self.CSS) || !self.CSS.supports('selector(:has(div))')) {\n\t\t\treturn false;\n\t\t}\n\n\t} catch (_) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default function cssHasPseudo(document, options) {\n\t// OPTIONS\n\t{\n\t\tif (!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\toptions = {\n\t\t\thover: (!!options.hover) || false,\n\t\t\tdebug: (!!options.debug) || false,\n\t\t\tobservedAttributes: options.observedAttributes || [],\n\t\t\tforcePolyfill: (!!options.forcePolyfill) || false,\n\t\t};\n\n\t\toptions.mustPolyfill = options.forcePolyfill || !hasNativeSupport();\n\n\t\tif (!Array.isArray(options.observedAttributes)) {\n\t\t\toptions.observedAttributes = [];\n\t\t}\n\n\t\toptions.observedAttributes = options.observedAttributes.filter((x) => {\n\t\t\treturn (typeof x === 'string');\n\t\t});\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n\t\t// `data-*` and `style` were omitted\n\t\toptions.observedAttributes = options.observedAttributes.concat(['accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'alt', 'async', 'autocapitalize', 'autocomplete', 'autofocus', 'autoplay', 'buffered', 'capture', 'challenge', 'charset', 'checked', 'cite', 'class', 'code', 'codebase', 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'data', 'datetime', 'decoding', 'default', 'defer', 'dir', 'dirname', 'disabled', 'download', 'draggable', 'enctype', 'enterkeyhint', 'for', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'headers', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'icon', 'id', 'importance', 'integrity', 'intrinsicsize', 'inputmode', 'ismap', 'itemprop', 'keytype', 'kind', 'label', 'lang', 'language', 'list', 'loop', 'low', 'manifest', 'max', 'maxlength', 'minlength', 'media', 'method', 'min', 'multiple', 'muted', 'name', 'novalidate', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'poster', 'preload', 'radiogroup', 'readonly', 'referrerpolicy', 'rel', 'required', 'reversed', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'summary', 'tabindex', 'target', 'title', 'translate', 'type', 'usemap', 'value', 'width', 'wrap']);\n\t}\n\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\tif (!options.mustPolyfill) {\n\t\t// Cleanup of rules will have happened in `walkStyleSheet`\n\t\t// Native support will take over from here\n\t\treturn;\n\t}\n\n\ttransformObservedItemsThrottled();\n\n\t// observe DOM modifications that affect selectors\n\tif ('MutationObserver' in self) {\n\t\tconst mutationObserver = new MutationObserver((mutationsList) => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// transform observed css rules\n\t\t\t\tcleanupObservedCssRules();\n\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t});\n\t\t});\n\n\t\tmutationObserver.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: options.observedAttributes });\n\t}\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('blur', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('input', transformObservedItemsThrottled);\n\tdocument.addEventListener('change', transformObservedItemsThrottled, true);\n\n\tif (options.hover) {\n\t\tif ('onpointerenter' in document) {\n\t\t\tdocument.addEventListener('pointerenter', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('pointerleave', transformObservedItemsThrottled, true);\n\t\t} else {\n\t\t\tdocument.addEventListener('mouseover', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('mouseout', transformObservedItemsThrottled, true);\n\t\t}\n\t}\n\n\t// observe Javascript setters that effect pseudo-selectors\n\tif ('defineProperty' in Object && 'getOwnPropertyDescriptor' in Object && 'hasOwnProperty' in Object) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction observeProperty(proto, property) {\n\t\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\t\tif (proto.hasOwnProperty(property)) {\n\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, property);\n\t\t\t\t\tif (descriptor && descriptor.configurable && 'set' in descriptor) {\n\t\t\t\t\t\tObject.defineProperty(proto, property, {\n\t\t\t\t\t\t\tconfigurable: descriptor.configurable,\n\t\t\t\t\t\t\tenumerable: descriptor.enumerable,\n\t\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\t\treturn descriptor.get.apply(this, arguments);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tset: function () {\n\t\t\t\t\t\t\t\tdescriptor.set.apply(this, arguments);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t\t\t// should never happen as there is an inner try/catch\n\t\t\t\t\t\t\t\t\t// but just in case\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ('HTMLElement' in self && HTMLElement.prototype) {\n\t\t\t\tobserveProperty(HTMLElement.prototype, 'disabled');\n\t\t\t}\n\n\t\t\t// Not all of these elements have all of these properties.\n\t\t\t// But the code above checks if they exist first.\n\t\t\t['checked', 'selected', 'readOnly', 'required'].forEach((property) => {\n\t\t\t\t[\n\t\t\t\t\t'HTMLButtonElement',\n\t\t\t\t\t'HTMLFieldSetElement',\n\t\t\t\t\t'HTMLInputElement',\n\t\t\t\t\t'HTMLMeterElement',\n\t\t\t\t\t'HTMLOptGroupElement',\n\t\t\t\t\t'HTMLOptionElement',\n\t\t\t\t\t'HTMLOutputElement',\n\t\t\t\t\t'HTMLProgressElement',\n\t\t\t\t\t'HTMLSelectElement',\n\t\t\t\t\t'HTMLTextAreaElement',\n\t\t\t\t].forEach((elementName) => {\n\t\t\t\t\tif (elementName in self && self[elementName].prototype) {\n\t\t\t\t\t\tobserveProperty(self[elementName].prototype, property);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet transformObservedItemsThrottledBusy = false;\n\tfunction transformObservedItemsThrottled() {\n\t\tif (transformObservedItemsThrottledBusy) {\n\t\t\tcancelAnimationFrame(transformObservedItemsThrottledBusy);\n\t\t}\n\n\t\ttransformObservedItemsThrottledBusy = requestAnimationFrame(() => {\n\t\t\ttransformObservedItems();\n\t\t});\n\t}\n\n\t// transform observed css rules\n\tfunction transformObservedItems() {\n\t\tobservedItems.forEach((item) => {\n\t\t\tconst nodes = [];\n\n\t\t\tlet matches = [];\n\t\t\ttry {\n\t\t\t\tmatches = document.querySelectorAll(item.selector);\n\t\t\t} catch (e) {\n\t\t\t\tif (options.debug) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t[].forEach.call(matches, (element) => {\n\t\t\t\t// memorize the node\n\t\t\t\tnodes.push(element);\n\n\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\tattributeElement.innerHTML = '';\n\n\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t});\n\n\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\titem.nodes.forEach(node => {\n\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// update the\n\t\t\titem.nodes = nodes;\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules() {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter((item) => {\n\t\t\t\treturn item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet(styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], (rule, index) => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\trule.selectorText = rule.selectorText.replace(/\\.js-has-pseudo\\s/g, '');\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t\tconst hasSelectors = extractEncodedSelectors(rule.selectorText.toString());\n\t\t\t\t\t\tif (hasSelectors.length === 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!options.mustPolyfill) {\n\t\t\t\t\t\t\tstyleSheet.deleteRule(index);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < hasSelectors.length; i++) {\n\t\t\t\t\t\t\tconst hasSelector = hasSelectors[i];\n\t\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\t\trule: rule,\n\t\t\t\t\t\t\t\tselector: hasSelector,\n\t\t\t\t\t\t\t\tattributeName: encodeCSS(hasSelector),\n\t\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n}\n","/* eslint-disable */\n(function (global) {\n\ttry {\n\t\t// test for has support\n\t\tglobal.document.querySelector(':has(*, :does-not-exist, > *)');\n\n\t\tif (\n\t\t\t!global.document.querySelector(':has(:scope *)') &&\n\t\t\tCSS.supports('selector(:has(div))')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t} catch (_) { }\n\n\t// ELEMENT\n\t// polyfill Element#querySelector\n\tvar querySelectorWithHasElement = polyfill(global.Element.prototype.querySelector);\n\n\tglobal.Element.prototype.querySelector = function querySelector(selectors) {\n\t\treturn querySelectorWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#querySelectorAll\n\tvar querySelectorAllWithHasElement = polyfill(global.Element.prototype.querySelectorAll);\n\n\tglobal.Element.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\treturn querySelectorAllWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#matches\n\tif (global.Element.prototype.matches) {\n\t\tvar matchesWithHasElement = polyfill(global.Element.prototype.matches);\n\n\t\tglobal.Element.prototype.matches = function matches(selectors) {\n\t\t\treturn matchesWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// polyfill Element#closest\n\tif (global.Element.prototype.closest) {\n\t\tvar closestWithHasElement = polyfill(global.Element.prototype.closest);\n\n\t\tglobal.Element.prototype.closest = function closest(selectors) {\n\t\t\treturn closestWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// DOCUMENT\n\tif ('Document' in global && 'prototype' in global.Document) {\n\t\t// polyfill Document#querySelector\n\t\tvar querySelectorWithHasDocument = polyfill(global.Document.prototype.querySelector);\n\n\t\tglobal.Document.prototype.querySelector = function querySelector(selectors) {\n\t\t\treturn querySelectorWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#querySelectorAll\n\t\tvar querySelectorAllWithHasDocument = polyfill(global.Document.prototype.querySelectorAll);\n\n\t\tglobal.Document.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\t\treturn querySelectorAllWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#matches\n\t\tif (global.Document.prototype.matches) {\n\t\t\tvar matchesWithHasDocument = polyfill(global.Document.prototype.matches);\n\n\t\t\tglobal.Document.prototype.matches = function matches(selectors) {\n\t\t\t\treturn matchesWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\n\t\t// polyfill Document#closest\n\t\tif (global.Document.prototype.closest) {\n\t\t\tvar closestWithHasDocument = polyfill(global.Document.prototype.closest);\n\n\t\t\tglobal.Document.prototype.closest = function closest(selectors) {\n\t\t\t\treturn closestWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction pseudoClassHasInnerQuery(query) {\n\t\tvar current = '';\n\t\tvar start = 0;\n\t\tvar depth = 0;\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar inHas = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':has(' && !inHas) {\n\t\t\t\tinHas = true;\n\t\t\t\tstart = i;\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tif (!inHas) {\n\t\t\t\t\t\tcurrent = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tdepth++;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase ')':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinnerQuery: current,\n\t\t\t\t\t\t\t\tstart: start,\n\t\t\t\t\t\t\t\tend: i-1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdepth--;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction replaceScopeWithAttr(query, attr) {\n\t\tvar parts = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':scope' && !bracketed && (/^[\\[\\.\\:\\\\\"\\s|+>~#&,)]/.test(char || ''))) {\n\t\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\t\tparts.push('[' + attr + ']');\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tparts.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (current.toLowerCase() === ':scope') {\n\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\tparts.push('[' + attr + ']');\n\t\t\tcurrent = '';\n\t\t}\n\n\t\tif (parts.length === 0) {\n\t\t\treturn query;\n\t\t}\n\n\t\treturn parts.join('') + current;\n\t}\n\n\tfunction charIsNestedMarkMirror(char, mark) {\n\t\tif (mark === '(' && char === ')') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (mark === '[' && char === ']') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction splitSelector(query) {\n\t\tvar selectors = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar nestedMark = false;\n\t\tvar nestedDepth = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ',':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nestedDepth > 0) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectors.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tquoted = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\tcase ')':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (charIsNestedMarkMirror(char, nestedMark)) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth--;\n\n\t\t\t\t\t\tif (nestedDepth === 0) {\n\t\t\t\t\t\t\tnestedMark = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (char === nestedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tnestedDepth++;\n\t\t\t\t\tnestedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t}\n\n\t\tselectors.push(current);\n\n\t\treturn selectors;\n\t}\n\n\tfunction replaceAllWithTempAttr(query, nested, callback) {\n\t\tvar inner = pseudoClassHasInnerQuery(query);\n\t\tif (!inner) {\n\t\t\treturn query;\n\t\t}\n\n\t\tif (nested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar innerQuery = inner.innerQuery;\n\t\tvar attr = 'q-has' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\tvar innerReplacement = '[' + attr + ']';\n\n\t\tvar x = query;\n\n\t\tif (inner.innerQuery.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar innerParts = splitSelector(inner.innerQuery);\n\t\t\tvar newInnerParts = [];\n\t\t\tfor (var i = 0; i < innerParts.length; i++) {\n\t\t\t\tvar innerPart = innerParts[i];\n\n\t\t\t\t// Nested has is not supported.\n\t\t\t\t// If a recursive/nested call returns \"false\" we throw\n\t\t\t\tvar innerPartReplaced = replaceAllWithTempAttr(innerPart, true, function () { });\n\t\t\t\tif (!innerPartReplaced) {\n\t\t\t\t\tthrow new Error(\"Nested :has() is not supported\")\n\t\t\t\t} else {\n\t\t\t\t\tnewInnerParts.push(innerPart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\t\treturn _prefix + newInnerParts.join(', ') + _suffix;\n\t\t}\n\n\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\tx = _prefix + innerReplacement + _suffix;\n\n\t\tcallback(innerQuery, attr);\n\t\tif (x.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar y = replaceAllWithTempAttr(x, false, callback);\n\t\t\tif (y) {\n\t\t\t\treturn y;\n\t\t\t}\n\t\t}\n\n\t\treturn x;\n\t}\n\n\tfunction walkNode(rootNode, callback) {\n\t\tif (('setAttribute' in (rootNode)) && ('querySelector' in (rootNode))) {\n\t\t\tcallback(rootNode);\n\t\t}\n\n\t\tif (rootNode.hasChildNodes()) {\n\t\t\tvar nodes = rootNode.childNodes;\n\t\t\tfor (var i = 0; i < nodes.length; ++i) {\n\t\t\t\twalkNode(nodes[i], callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction polyfill(qsa) {\n\t\treturn function (selectors) {\n\t\t\tif (!selectors) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar selectorsString = String(selectors);\n\t\t\tif (!selectorsString || (selectorsString.toLowerCase().indexOf(':has(') === -1) || !pseudoClassHasInnerQuery(selectorsString)) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar rootNode;\n\t\t\tif ('getRootNode' in this) {\n\t\t\t\trootNode = this.getRootNode();\n\t\t\t} else {\n\t\t\t\tvar r = this;\n\t\t\t\twhile (r) {\n\t\t\t\t\trootNode = r;\n\t\t\t\t\tr = r.parentNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _focus = this;\n\t\t\tif (_focus === global.document) {\n\t\t\t\t_focus = global.document.documentElement;\n\t\t\t}\n\n\t\t\tvar scopeAttr = 'q-has-scope' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t_focus.setAttribute(scopeAttr, '');\n\n\t\t\ttry {\n\t\t\t\tselectorsString = replaceScopeWithAttr(selectorsString, scopeAttr);\n\n\t\t\t\tvar attrs = [scopeAttr];\n\t\t\t\tvar newQuery = replaceAllWithTempAttr(selectorsString, false, function (inner, attr) {\n\t\t\t\t\tattrs.push(attr);\n\n\t\t\t\t\tvar selectorParts = splitSelector(inner);\n\t\t\t\t\tfor (var x = 0; x < selectorParts.length; x++) {\n\t\t\t\t\t\tvar selectorPart = selectorParts[x].trim();\n\t\t\t\t\t\tvar absoluteSelectorPart = selectorPart;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tselectorPart[0] === '>' ||\n\t\t\t\t\t\t\tselectorPart[0] === '+' ||\n\t\t\t\t\t\t\tselectorPart[0] === '~'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tabsoluteSelectorPart = selectorPart.slice(1).trim();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteSelectorPart = ':scope ' + selectorPart;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twalkNode(rootNode, function (node) {\n\t\t\t\t\t\t\tif (!(node.querySelector(absoluteSelectorPart))) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch (selectorPart[0]) {\n\t\t\t\t\t\t\t\tcase '~':\n\t\t\t\t\t\t\t\tcase '+':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar siblings = node.childNodes;\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < siblings.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tvar sibling = siblings[i];\n\t\t\t\t\t\t\t\t\t\t\tif (!('setAttribute' in sibling)) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope [' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tsibling.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\tnode.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope[' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnode.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\targuments[0] = newQuery;\n\n\t\t\t\t// results of the qsa\n\t\t\t\tvar elementOrNodeList = qsa.apply(this, arguments);\n\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// return the results of the qsa\n\t\t\t\treturn elementOrNodeList;\n\t\t\t} catch (err) {\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar errorMessage = '';\n\t\t\t\ttry {\n\t\t\t\t\tqsa.apply(this, [':core-web-does-not-exist']);\n\t\t\t\t} catch (dummyError) {\n\t\t\t\t\terrorMessage = dummyError.message;\n\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\terrorMessage = errorMessage.replace(':core-web-does-not-exist', selectorsString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!errorMessage) {\n\t\t\t\t\terrorMessage = \"Failed to execute 'querySelector' on 'Document': '\" + selectorsString + \"' is not a valid selector.\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new DOMException(errorMessage);\n\t\t\t\t} catch (_) {\n\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n})(self);\n","/* global self,window */\nimport { default as cssHasPseudo } from './browser';\n\n(function (global) {\n\tglobal.cssHasPseudo = cssHasPseudo;\n}('object' === typeof window && window || 'object' === typeof self && self || {}));\n"],"names":["decodeCSS","value","slice","values","split","result","i","length","String","fromCharCode","parseInt","extractEncodedSelectors","candidate","quotedMark","out","depth","quoted","containsUnescapedUnquotedHasAtDepth1","char","decoded","push","unique","indexOf","encodeCSS","hex","charCodeAt","toString","hasNativeSupport","self","CSS","supports","_","cssHasPseudo","document","options","hover","debug","observedAttributes","forcePolyfill","mustPolyfill","Array","isArray","filter","x","concat","observedItems","attributeElement","createElement","forEach","call","styleSheets","walkStyleSheet","transformObservedItemsThrottled","MutationObserver","mutationsList","mutation","addedNodes","node","nodeType","sheet","apply","splice","item","rule","parentStyleSheet","ownerNode","documentElement","contains","observe","childList","subtree","attributes","attributeFilter","addEventListener","Object","observeProperty","proto","property","hasOwnProperty","descriptor","getOwnPropertyDescriptor","configurable","defineProperty","enumerable","get","this","arguments","set","HTMLElement","prototype","elementName","e","console","error","transformObservedItemsThrottledBusy","cancelAnimationFrame","requestAnimationFrame","nodes","matches","querySelectorAll","selector","element","innerHTML","attributeName","setAttributeNode","children","cloneNode","style","zoom","removeAttribute","styleSheet","cssRules","index","selectorText","replace","hasSelectors","deleteRule","hasSelector","global","querySelector","querySelectorWithHasElement","polyfill","Element","selectors","querySelectorAllWithHasElement","matchesWithHasElement","closest","closestWithHasElement","Document","querySelectorWithHasDocument","querySelectorAllWithHasDocument","matchesWithHasDocument","closestWithHasDocument","pseudoClassHasInnerQuery","query","current","start","escaped","inHas","toLowerCase","innerQuery","end","replaceScopeWithAttr","attr","parts","bracketed","test","join","splitSelector","mark","nestedMark","nestedDepth","replaceAllWithTempAttr","nested","callback","inner","Math","floor","random","innerReplacement","innerParts","newInnerParts","innerPart","Error","_prefix","substring","_suffix","y","walkNode","rootNode","hasChildNodes","childNodes","qsa","selectorsString","getRootNode","r","parentNode","_focus","scopeAttr","setAttribute","attrs","newQuery","selectorParts","selectorPart","trim","absoluteSelectorPart","siblings","sibling","idAttr","elementOrNodeList","attrsForQuery","j","elements","k","l","err","errorMessage","dummyError","message","DOMException","window"],"mappings":"YACe,SAASA,UAAUC,GACjC,GAA2B,kBAAvBA,EAAMC,MAAM,EAAG,IAClB,MAAO,GAOR,IAHA,IAAIC,GADJF,EAAQA,EAAMC,MAAM,KACDE,MAAM,KAErBC,EAAS,GACJC,EAAI,EAAGA,EAAIH,EAAOI,OAAQD,IAClCD,GAAUG,OAAOC,aAAaC,SAASP,EAAOG,GAAI,KAGnD,OAAOD,CACR,CCZe,SAASM,wBAAwBV,GAY/C,IAXA,IAGIW,EAGAC,EANAC,EAAM,GAENC,EAAQ,EAGRC,GAAS,EAGTC,GAAuC,EAGlCX,EAAI,EAAGA,EAAIL,EAAMM,OAAQD,IAAK,CACtC,IAAMY,EAAOjB,EAAMK,GAEnB,OAAQY,GACP,IAAK,IACJ,GAAIF,EAAQ,CACXJ,GAAaM,EACb,QACD,CAEc,IAAVH,EACHH,EAAY,GAEZA,GAAaM,EAGdH,IACA,SACD,IAAK,IACJ,GAAIC,EAAQ,CACXJ,GAAaM,EACb,QACD,CAIC,GAAc,MADdH,EACiB,CAChB,IAAMI,EAAUnB,UAAUY,GACtBK,GACHH,EAAIM,KAAKD,EAEX,MACCP,GAAaM,EAIf,SACD,IAAK,KACJN,GAAaX,EAAMK,GACnBM,GAAaX,EAAMK,EAAE,GACrBA,IACA,SAED,IAAK,IACL,IAAK,IACJ,GAAIU,GAAUE,IAASL,EAAY,CAClCG,GAAS,EACT,QACA,CAAM,GAAIA,EAAQ,CAClBJ,GAAaM,EACb,QACD,CAEAF,GAAS,EACTH,EAAaK,EACb,SAED,QACmB,KAAdN,GAA8B,IAAVG,GAA2C,kBAA3Bd,EAAMC,MAAMI,EAAGA,EAAI,MAC1DW,GAAuC,GAGxCL,GAAaM,EACb,SAEH,CAGA,IADA,IAAMG,EAAS,GACNf,EAAI,EAAGA,EAAIQ,EAAIP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4]} \ No newline at end of file diff --git a/plugins/css-has-pseudo/dist/browser.cjs.map b/plugins/css-has-pseudo/dist/browser.cjs.map index c295ea4b9..7e9217096 100644 --- a/plugins/css-has-pseudo/dist/browser.cjs.map +++ b/plugins/css-has-pseudo/dist/browser.cjs.map @@ -1 +1 @@ -{"version":3,"file":"browser.cjs","sources":["../src/encode/decode.mjs","../src/encode/extract.mjs","../src/encode/encode.mjs","../src/browser.js","../../../node_modules/@mrhenry/core-web/modules/~element-qsa-has.js"],"sourcesContent":["\n/** Decodes an identifier back into a CSS selector */\nexport default function decodeCSS(value) {\n\tif (value.slice(0, 13) !== 'csstools-has-') {\n\t\treturn '';\n\t}\n\n\tvalue = value.slice(13);\n\tlet values = value.split('-');\n\n\tlet result = '';\n\tfor (let i = 0; i < values.length; i++) {\n\t\tresult += String.fromCharCode(parseInt(values[i], 36));\n\t}\n\n\treturn result;\n}\n","import decodeCSS from './decode.mjs';\n\n/** Extract encoded selectors out of attribute selectors */\nexport default function extractEncodedSelectors(value) {\n\tlet out = [];\n\n\tlet depth = 0;\n\tlet candidate;\n\n\tlet quoted = false;\n\tlet quotedMark;\n\n\tlet containsUnescapedUnquotedHasAtDepth1 = false;\n\n\t// Stryker disable next-line EqualityOperator\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value[i];\n\n\t\tswitch (char) {\n\t\t\tcase '[':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\tcandidate = '';\n\t\t\t\t} else {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t}\n\n\t\t\t\tdepth++;\n\t\t\t\tcontinue;\n\t\t\tcase ']':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\tdepth--;\n\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\tconst decoded = decodeCSS(candidate);\n\t\t\t\t\t\tif (containsUnescapedUnquotedHasAtDepth1) {\n\t\t\t\t\t\t\tout.push(decoded);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcandidate += char;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\tcase '\\\\':\n\t\t\t\tcandidate += value[i];\n\t\t\t\tcandidate += value[i+1];\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\n\t\t\tcase '\"':\n\t\t\tcase '\\'':\n\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tquoted = true;\n\t\t\t\tquotedMark = char;\n\t\t\t\tcontinue;\n\n\t\t\tdefault:\n\t\t\t\tif (candidate === '' && depth === 1 && (value.slice(i, i + 13) === 'csstools-has-')) {\n\t\t\t\t\tcontainsUnescapedUnquotedHasAtDepth1 = true;\n\t\t\t\t}\n\n\t\t\t\tcandidate += char;\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\n\tconst unique = [];\n\tfor (let i = 0; i < out.length; i++) {\n\t\tif (unique.indexOf(out[i]) === -1) {\n\t\t\tunique.push(out[i]);\n\t\t}\n\t}\n\n\treturn unique;\n}\n","\n/** Returns the string as an encoded CSS identifier. */\nexport default function encodeCSS(value) {\n\tif (value === '') {\n\t\treturn '';\n\t}\n\n\tlet hex;\n\tlet result = '';\n\tfor (let i = 0; i < value.length; i++) {\n\t\thex = value.charCodeAt(i).toString(36);\n\t\tif (i === 0) {\n\t\t\tresult += hex;\n\t\t} else {\n\t\t\tresult += '-' + hex;\n\t\t}\n\t}\n\n\treturn 'csstools-has-' + result;\n}\n","/* global MutationObserver,requestAnimationFrame,cancelAnimationFrame,self,HTMLElement */\n\nimport '@mrhenry/core-web/modules/~element-qsa-has.js';\nimport extractEncodedSelectors from './encode/extract.mjs';\nimport encodeCSS from './encode/encode.mjs';\n\nfunction hasNativeSupport() {\n\ttry {\n\t\tif (!('CSS' in self) || !('supports' in self.CSS) || !self.CSS.supports('selector(:has(div))')) {\n\t\t\treturn false;\n\t\t}\n\n\t} catch (_) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default function cssHasPseudo(document, options) {\n\t// OPTIONS\n\t{\n\t\tif (!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\toptions = {\n\t\t\thover: (!!options.hover) || false,\n\t\t\tdebug: (!!options.debug) || false,\n\t\t\tobservedAttributes: options.observedAttributes || [],\n\t\t\tforcePolyfill: (!!options.forcePolyfill) || false,\n\t\t};\n\n\t\toptions.mustPolyfill = options.forcePolyfill || !hasNativeSupport();\n\n\t\tif (!Array.isArray(options.observedAttributes)) {\n\t\t\toptions.observedAttributes = [];\n\t\t}\n\n\t\toptions.observedAttributes = options.observedAttributes.filter((x) => {\n\t\t\treturn (typeof x === 'string');\n\t\t});\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n\t\t// `data-*` and `style` were omitted\n\t\toptions.observedAttributes = options.observedAttributes.concat(['accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'alt', 'async', 'autocapitalize', 'autocomplete', 'autofocus', 'autoplay', 'buffered', 'capture', 'challenge', 'charset', 'checked', 'cite', 'class', 'code', 'codebase', 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'data', 'datetime', 'decoding', 'default', 'defer', 'dir', 'dirname', 'disabled', 'download', 'draggable', 'enctype', 'enterkeyhint', 'for', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'headers', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'icon', 'id', 'importance', 'integrity', 'intrinsicsize', 'inputmode', 'ismap', 'itemprop', 'keytype', 'kind', 'label', 'lang', 'language', 'list', 'loop', 'low', 'manifest', 'max', 'maxlength', 'minlength', 'media', 'method', 'min', 'multiple', 'muted', 'name', 'novalidate', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'poster', 'preload', 'radiogroup', 'readonly', 'referrerpolicy', 'rel', 'required', 'reversed', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'summary', 'tabindex', 'target', 'title', 'translate', 'type', 'usemap', 'value', 'width', 'wrap']);\n\t}\n\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\tif (!options.mustPolyfill) {\n\t\t// Cleanup of rules will have happened in `walkStyleSheet`\n\t\t// Native support will take over from here\n\t\treturn;\n\t}\n\n\ttransformObservedItemsThrottled();\n\n\t// observe DOM modifications that affect selectors\n\tif ('MutationObserver' in self) {\n\t\tconst mutationObserver = new MutationObserver((mutationsList) => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// transform observed css rules\n\t\t\t\tcleanupObservedCssRules();\n\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t});\n\t\t});\n\n\t\tmutationObserver.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: options.observedAttributes });\n\t}\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('blur', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('input', transformObservedItemsThrottled);\n\tdocument.addEventListener('change', transformObservedItemsThrottled, true);\n\n\tif (options.hover) {\n\t\tif ('onpointerenter' in document) {\n\t\t\tdocument.addEventListener('pointerenter', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('pointerleave', transformObservedItemsThrottled, true);\n\t\t} else {\n\t\t\tdocument.addEventListener('mouseover', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('mouseout', transformObservedItemsThrottled, true);\n\t\t}\n\t}\n\n\t// observe Javascript setters that effect pseudo-selectors\n\tif ('defineProperty' in Object && 'getOwnPropertyDescriptor' in Object && 'hasOwnProperty' in Object) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction observeProperty(proto, property) {\n\t\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\t\tif (proto.hasOwnProperty(property)) {\n\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, property);\n\t\t\t\t\tif (descriptor && descriptor.configurable && 'set' in descriptor) {\n\t\t\t\t\t\tObject.defineProperty(proto, property, {\n\t\t\t\t\t\t\tconfigurable: descriptor.configurable,\n\t\t\t\t\t\t\tenumerable: descriptor.enumerable,\n\t\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\t\treturn descriptor.get.apply(this, arguments);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tset: function () {\n\t\t\t\t\t\t\t\tdescriptor.set.apply(this, arguments);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t\t\t// should never happen as there is an inner try/catch\n\t\t\t\t\t\t\t\t\t// but just in case\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ('HTMLElement' in self && HTMLElement.prototype) {\n\t\t\t\tobserveProperty(HTMLElement.prototype, 'disabled');\n\t\t\t}\n\n\t\t\t// Not all of these elements have all of these properties.\n\t\t\t// But the code above checks if they exist first.\n\t\t\t['checked', 'selected', 'readOnly', 'required'].forEach((property) => {\n\t\t\t\t[\n\t\t\t\t\t'HTMLButtonElement',\n\t\t\t\t\t'HTMLFieldSetElement',\n\t\t\t\t\t'HTMLInputElement',\n\t\t\t\t\t'HTMLMeterElement',\n\t\t\t\t\t'HTMLOptGroupElement',\n\t\t\t\t\t'HTMLOptionElement',\n\t\t\t\t\t'HTMLOutputElement',\n\t\t\t\t\t'HTMLProgressElement',\n\t\t\t\t\t'HTMLSelectElement',\n\t\t\t\t\t'HTMLTextAreaElement',\n\t\t\t\t].forEach((elementName) => {\n\t\t\t\t\tif (elementName in self && self[elementName].prototype) {\n\t\t\t\t\t\tobserveProperty(self[elementName].prototype, property);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet transformObservedItemsThrottledBusy = false;\n\tfunction transformObservedItemsThrottled() {\n\t\tif (transformObservedItemsThrottledBusy) {\n\t\t\tcancelAnimationFrame(transformObservedItemsThrottledBusy);\n\t\t}\n\n\t\ttransformObservedItemsThrottledBusy = requestAnimationFrame(() => {\n\t\t\ttransformObservedItems();\n\t\t});\n\t}\n\n\t// transform observed css rules\n\tfunction transformObservedItems() {\n\t\tobservedItems.forEach((item) => {\n\t\t\tconst nodes = [];\n\n\t\t\tlet matches = [];\n\t\t\ttry {\n\t\t\t\tmatches = document.querySelectorAll(item.selector);\n\t\t\t} catch (e) {\n\t\t\t\tif (options.debug) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t[].forEach.call(matches, (element) => {\n\t\t\t\t// memorize the node\n\t\t\t\tnodes.push(element);\n\n\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\tattributeElement.innerHTML = '';\n\n\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t});\n\n\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\titem.nodes.forEach(node => {\n\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// update the\n\t\t\titem.nodes = nodes;\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules() {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter((item) => {\n\t\t\t\treturn item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet(styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], (rule, index) => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\trule.selectorText = rule.selectorText.replace(/\\.js-has-pseudo\\s/g, '');\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t\tconst hasSelectors = extractEncodedSelectors(rule.selectorText.toString());\n\t\t\t\t\t\tif (hasSelectors.length === 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!options.mustPolyfill) {\n\t\t\t\t\t\t\tstyleSheet.deleteRule(index);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < hasSelectors.length; i++) {\n\t\t\t\t\t\t\tconst hasSelector = hasSelectors[i];\n\t\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\t\trule: rule,\n\t\t\t\t\t\t\t\tselector: hasSelector,\n\t\t\t\t\t\t\t\tattributeName: encodeCSS(hasSelector),\n\t\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n}\n","/* eslint-disable */\n(function (global) {\n\ttry {\n\t\t// test for has support\n\t\tglobal.document.querySelector(':has(*, :does-not-exist, > *)');\n\n\t\tif (\n\t\t\t!global.document.querySelector(':has(:scope *)') &&\n\t\t\tCSS.supports('selector(:has(div))')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t} catch (_) { }\n\n\t// ELEMENT\n\t// polyfill Element#querySelector\n\tvar querySelectorWithHasElement = polyfill(global.Element.prototype.querySelector);\n\n\tglobal.Element.prototype.querySelector = function querySelector(selectors) {\n\t\treturn querySelectorWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#querySelectorAll\n\tvar querySelectorAllWithHasElement = polyfill(global.Element.prototype.querySelectorAll);\n\n\tglobal.Element.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\treturn querySelectorAllWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#matches\n\tif (global.Element.prototype.matches) {\n\t\tvar matchesWithHasElement = polyfill(global.Element.prototype.matches);\n\n\t\tglobal.Element.prototype.matches = function matches(selectors) {\n\t\t\treturn matchesWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// polyfill Element#closest\n\tif (global.Element.prototype.closest) {\n\t\tvar closestWithHasElement = polyfill(global.Element.prototype.closest);\n\n\t\tglobal.Element.prototype.closest = function closest(selectors) {\n\t\t\treturn closestWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// DOCUMENT\n\tif ('Document' in global && 'prototype' in global.Document) {\n\t\t// polyfill Document#querySelector\n\t\tvar querySelectorWithHasDocument = polyfill(global.Document.prototype.querySelector);\n\n\t\tglobal.Document.prototype.querySelector = function querySelector(selectors) {\n\t\t\treturn querySelectorWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#querySelectorAll\n\t\tvar querySelectorAllWithHasDocument = polyfill(global.Document.prototype.querySelectorAll);\n\n\t\tglobal.Document.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\t\treturn querySelectorAllWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#matches\n\t\tif (global.Document.prototype.matches) {\n\t\t\tvar matchesWithHasDocument = polyfill(global.Document.prototype.matches);\n\n\t\t\tglobal.Document.prototype.matches = function matches(selectors) {\n\t\t\t\treturn matchesWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\n\t\t// polyfill Document#closest\n\t\tif (global.Document.prototype.closest) {\n\t\t\tvar closestWithHasDocument = polyfill(global.Document.prototype.closest);\n\n\t\t\tglobal.Document.prototype.closest = function closest(selectors) {\n\t\t\t\treturn closestWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction pseudoClassHasInnerQuery(query) {\n\t\tvar current = '';\n\t\tvar start = 0;\n\t\tvar depth = 0;\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar inHas = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':has(' && !inHas) {\n\t\t\t\tinHas = true;\n\t\t\t\tstart = i;\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tif (!inHas) {\n\t\t\t\t\t\tcurrent = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tdepth++;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase ')':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinnerQuery: current,\n\t\t\t\t\t\t\t\tstart: start,\n\t\t\t\t\t\t\t\tend: i-1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdepth--;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction replaceScopeWithAttr(query, attr) {\n\t\tvar parts = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':scope' && !bracketed && (/^[\\[\\.\\:\\\\\"\\s|+>~#&,)]/.test(char || ''))) {\n\t\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\t\tparts.push('[' + attr + ']');\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tparts.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (current.toLowerCase() === ':scope') {\n\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\tparts.push('[' + attr + ']');\n\t\t\tcurrent = '';\n\t\t}\n\n\t\tif (parts.length === 0) {\n\t\t\treturn query;\n\t\t}\n\n\t\treturn parts.join('') + current;\n\t}\n\n\tfunction charIsNestedMarkMirror(char, mark) {\n\t\tif (mark === '(' && char === ')') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (mark === '[' && char === ']') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction splitSelector(query) {\n\t\tvar selectors = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar nestedMark = false;\n\t\tvar nestedDepth = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ',':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nestedDepth > 0) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectors.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tquoted = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\tcase ')':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (charIsNestedMarkMirror(char, nestedMark)) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth--;\n\n\t\t\t\t\t\tif (nestedDepth === 0) {\n\t\t\t\t\t\t\tnestedMark = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (char === nestedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tnestedDepth++;\n\t\t\t\t\tnestedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t}\n\n\t\tselectors.push(current);\n\n\t\treturn selectors;\n\t}\n\n\tfunction replaceAllWithTempAttr(query, nested, callback) {\n\t\tvar inner = pseudoClassHasInnerQuery(query);\n\t\tif (!inner) {\n\t\t\treturn query;\n\t\t}\n\n\t\tif (nested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar innerQuery = inner.innerQuery;\n\t\tvar attr = 'q-has' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\tvar innerReplacement = '[' + attr + ']';\n\n\t\tvar x = query;\n\n\t\tif (inner.innerQuery.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar innerParts = splitSelector(inner.innerQuery);\n\t\t\tvar newInnerParts = [];\n\t\t\tfor (var i = 0; i < innerParts.length; i++) {\n\t\t\t\tvar innerPart = innerParts[i];\n\n\t\t\t\t// Nested has is not supported.\n\t\t\t\t// If a recursive/nested call returns \"false\" we throw\n\t\t\t\tvar innerPartReplaced = replaceAllWithTempAttr(innerPart, true, function () { });\n\t\t\t\tif (!innerPartReplaced) {\n\t\t\t\t\tthrow new Error(\"Nested :has() is not supported\")\n\t\t\t\t} else {\n\t\t\t\t\tnewInnerParts.push(innerPart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\t\treturn _prefix + newInnerParts.join(', ') + _suffix;\n\t\t}\n\n\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\tx = _prefix + innerReplacement + _suffix;\n\n\t\tcallback(innerQuery, attr);\n\t\tif (x.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar y = replaceAllWithTempAttr(x, false, callback);\n\t\t\tif (y) {\n\t\t\t\treturn y;\n\t\t\t}\n\t\t}\n\n\t\treturn x;\n\t}\n\n\tfunction walkNode(rootNode, callback) {\n\t\tif (('setAttribute' in (rootNode)) && ('querySelector' in (rootNode))) {\n\t\t\tcallback(rootNode);\n\t\t}\n\n\t\tif (rootNode.hasChildNodes()) {\n\t\t\tvar nodes = rootNode.childNodes;\n\t\t\tfor (var i = 0; i < nodes.length; ++i) {\n\t\t\t\twalkNode(nodes[i], callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction polyfill(qsa) {\n\t\treturn function (selectors) {\n\t\t\tif (!selectors) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar selectorsString = String(selectors);\n\t\t\tif (!selectorsString || (selectorsString.toLowerCase().indexOf(':has(') === -1) || !pseudoClassHasInnerQuery(selectorsString)) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar rootNode;\n\t\t\tif ('getRootNode' in this) {\n\t\t\t\trootNode = this.getRootNode();\n\t\t\t} else {\n\t\t\t\tvar r = this;\n\t\t\t\twhile (r) {\n\t\t\t\t\trootNode = r;\n\t\t\t\t\tr = r.parentNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _focus = this;\n\t\t\tif (_focus === global.document) {\n\t\t\t\t_focus = global.document.documentElement;\n\t\t\t}\n\n\t\t\tvar scopeAttr = 'q-has-scope' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t_focus.setAttribute(scopeAttr, '');\n\n\t\t\ttry {\n\t\t\t\tselectorsString = replaceScopeWithAttr(selectorsString, scopeAttr);\n\n\t\t\t\tvar attrs = [scopeAttr];\n\t\t\t\tvar newQuery = replaceAllWithTempAttr(selectorsString, false, function (inner, attr) {\n\t\t\t\t\tattrs.push(attr);\n\n\t\t\t\t\tvar selectorParts = splitSelector(inner);\n\t\t\t\t\tfor (var x = 0; x < selectorParts.length; x++) {\n\t\t\t\t\t\tvar selectorPart = selectorParts[x].trim();\n\t\t\t\t\t\tvar absoluteSelectorPart = selectorPart;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tselectorPart[0] === '>' ||\n\t\t\t\t\t\t\tselectorPart[0] === '+' ||\n\t\t\t\t\t\t\tselectorPart[0] === '~'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tabsoluteSelectorPart = selectorPart.slice(1).trim();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteSelectorPart = ':scope ' + selectorPart;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twalkNode(rootNode, function (node) {\n\t\t\t\t\t\t\tif (!(node.querySelector(absoluteSelectorPart))) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch (selectorPart[0]) {\n\t\t\t\t\t\t\t\tcase '~':\n\t\t\t\t\t\t\t\tcase '+':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar siblings = node.childNodes;\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < siblings.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tvar sibling = siblings[i];\n\t\t\t\t\t\t\t\t\t\t\tif (!('setAttribute' in sibling)) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope [' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tsibling.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\tnode.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope[' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnode.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\targuments[0] = newQuery;\n\n\t\t\t\t// results of the qsa\n\t\t\t\tvar elementOrNodeList = qsa.apply(this, arguments);\n\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// return the results of the qsa\n\t\t\t\treturn elementOrNodeList;\n\t\t\t} catch (err) {\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar errorMessage = '';\n\t\t\t\ttry {\n\t\t\t\t\tqsa.apply(this, [':core-web-does-not-exist']);\n\t\t\t\t} catch (dummyError) {\n\t\t\t\t\terrorMessage = dummyError.message;\n\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\terrorMessage = errorMessage.replace(':core-web-does-not-exist', selectorsString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!errorMessage) {\n\t\t\t\t\terrorMessage = \"Failed to execute 'querySelector' on 'Document': '\" + selectorsString + \"' is not a valid selector.\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new DOMException(errorMessage);\n\t\t\t\t} catch (_) {\n\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n})(self);\n"],"names":["decodeCSS","value","slice","values","split","result","i","length","String","fromCharCode","parseInt","extractEncodedSelectors","candidate","quotedMark","out","depth","quoted","containsUnescapedUnquotedHasAtDepth1","char","decoded","push","unique","indexOf","encodeCSS","hex","charCodeAt","toString","hasNativeSupport","self","CSS","supports","_","global","document","querySelector","querySelectorWithHasElement","polyfill","Element","prototype","selectors","apply","this","arguments","querySelectorAllWithHasElement","querySelectorAll","matches","matchesWithHasElement","closest","closestWithHasElement","Document","querySelectorWithHasDocument","querySelectorAllWithHasDocument","matchesWithHasDocument","closestWithHasDocument","pseudoClassHasInnerQuery","query","current","start","escaped","inHas","toLowerCase","innerQuery","end","replaceScopeWithAttr","attr","parts","bracketed","test","join","splitSelector","mark","nestedMark","nestedDepth","replaceAllWithTempAttr","nested","callback","inner","Math","floor","random","innerReplacement","x","innerParts","newInnerParts","innerPart","Error","_prefix","substring","_suffix","y","walkNode","rootNode","hasChildNodes","nodes","childNodes","qsa","selectorsString","getRootNode","r","parentNode","_focus","documentElement","scopeAttr","setAttribute","attrs","newQuery","selectorParts","selectorPart","trim","absoluteSelectorPart","node","siblings","sibling","idAttr","removeAttribute","elementOrNodeList","attrsForQuery","j","elements","k","element","l","err","errorMessage","dummyError","message","replace","DOMException","cssHasPseudo","options","hover","debug","observedAttributes","forcePolyfill","mustPolyfill","Array","isArray","filter","concat","observedItems","attributeElement","createElement","forEach","call","styleSheets","walkStyleSheet","transformObservedItemsThrottled","MutationObserver","mutationsList","mutation","addedNodes","nodeType","sheet","splice","item","rule","parentStyleSheet","ownerNode","contains","observe","childList","subtree","attributes","attributeFilter","addEventListener","Object","observeProperty","proto","property","hasOwnProperty","descriptor","getOwnPropertyDescriptor","configurable","defineProperty","enumerable","get","set","HTMLElement","elementName","e","console","error","transformObservedItemsThrottledBusy","cancelAnimationFrame","requestAnimationFrame","selector","innerHTML","attributeName","setAttributeNode","children","cloneNode","style","zoom","styleSheet","cssRules","index","selectorText","hasSelectors","deleteRule","hasSelector"],"mappings":"AAEe,SAASA,UAAUC,GACjC,GAA2B,kBAAvBA,EAAMC,MAAM,EAAG,IAClB,MAAO,GAOR,IAHA,IAAIC,GADJF,EAAQA,EAAMC,MAAM,KACDE,MAAM,KAErBC,EAAS,GACJC,EAAI,EAAGA,EAAIH,EAAOI,OAAQD,IAClCD,GAAUG,OAAOC,aAAaC,SAASP,EAAOG,GAAI,KAGnD,OAAOD,CACR,CCbe,SAASM,wBAAwBV,GAY/C,IAXA,IAGIW,EAGAC,EANAC,EAAM,GAENC,EAAQ,EAGRC,GAAS,EAGTC,GAAuC,EAGlCX,EAAI,EAAGA,EAAIL,EAAMM,OAAQD,IAAK,CACtC,IAAMY,EAAOjB,EAAMK,GAEnB,OAAQY,GACP,IAAK,IACJ,GAAIF,EAAQ,CACXJ,GAAaM,EACb,QACD,CAEc,IAAVH,EACHH,EAAY,GAEZA,GAAaM,EAGdH,IACA,SACD,IAAK,IACJ,GAAIC,EAAQ,CACXJ,GAAaM,EACb,QACD,CAIC,GAAc,MADdH,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EAAI,EAAGA,EAAI+L,EAAa9L,OAAQD,IAAK,CAC7C,IAAMiM,EAAcF,EAAa/L,GACjCqI,EAAcvH,KAAK,CAClBuI,KAAMA,EACN8B,SAAUc,EACVZ,cAAepK,UAAUgL,GACzB1G,MAAO,IAET,CACA,CAAC,MAAOsF,GACJlD,EAAQE,OACXiD,QAAQC,MAAMF,EAEhB,CACD,MACClC,eAAeU,EAEjB,GACA,CAAC,MAAOwB,GACJlD,EAAQE,OACXiD,QAAQC,MAAMF,EAEhB,CACD,CACD","x_google_ignoreList":[4]} \ No newline at end of file +{"version":3,"file":"browser.cjs","sources":["../src/encode/decode.js","../src/encode/extract.js","../src/encode/encode.js","../src/browser.js","../../../node_modules/@mrhenry/core-web/modules/~element-qsa-has.js"],"sourcesContent":["/** Decodes an identifier back into a CSS selector */\nexport default function decodeCSS(value) {\n\tif (value.slice(0, 13) !== 'csstools-has-') {\n\t\treturn '';\n\t}\n\n\tvalue = value.slice(13);\n\tlet values = value.split('-');\n\n\tlet result = '';\n\tfor (let i = 0; i < values.length; i++) {\n\t\tresult += String.fromCharCode(parseInt(values[i], 36));\n\t}\n\n\treturn result;\n}\n","import decodeCSS from './decode.js';\n\n/** Extract encoded selectors out of attribute selectors */\nexport default function extractEncodedSelectors(value) {\n\tlet out = [];\n\n\tlet depth = 0;\n\tlet candidate;\n\n\tlet quoted = false;\n\tlet quotedMark;\n\n\tlet containsUnescapedUnquotedHasAtDepth1 = false;\n\n\t// Stryker disable next-line EqualityOperator\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value[i];\n\n\t\tswitch (char) {\n\t\t\tcase '[':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\tcandidate = '';\n\t\t\t\t} else {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t}\n\n\t\t\t\tdepth++;\n\t\t\t\tcontinue;\n\t\t\tcase ']':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\tdepth--;\n\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\tconst decoded = decodeCSS(candidate);\n\t\t\t\t\t\tif (containsUnescapedUnquotedHasAtDepth1) {\n\t\t\t\t\t\t\tout.push(decoded);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcandidate += char;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\tcase '\\\\':\n\t\t\t\tcandidate += value[i];\n\t\t\t\tcandidate += value[i+1];\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\n\t\t\tcase '\"':\n\t\t\tcase '\\'':\n\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tquoted = true;\n\t\t\t\tquotedMark = char;\n\t\t\t\tcontinue;\n\n\t\t\tdefault:\n\t\t\t\tif (candidate === '' && depth === 1 && (value.slice(i, i + 13) === 'csstools-has-')) {\n\t\t\t\t\tcontainsUnescapedUnquotedHasAtDepth1 = true;\n\t\t\t\t}\n\n\t\t\t\tcandidate += char;\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\n\tconst unique = [];\n\tfor (let i = 0; i < out.length; i++) {\n\t\tif (unique.indexOf(out[i]) === -1) {\n\t\t\tunique.push(out[i]);\n\t\t}\n\t}\n\n\treturn unique;\n}\n","/** Returns the string as an encoded CSS identifier. */\nexport default function encodeCSS(value) {\n\tif (value === '') {\n\t\treturn '';\n\t}\n\n\tlet hex;\n\tlet result = '';\n\tfor (let i = 0; i < value.length; i++) {\n\t\thex = value.charCodeAt(i).toString(36);\n\t\tif (i === 0) {\n\t\t\tresult += hex;\n\t\t} else {\n\t\t\tresult += '-' + hex;\n\t\t}\n\t}\n\n\treturn 'csstools-has-' + result;\n}\n","/* global MutationObserver,requestAnimationFrame,cancelAnimationFrame,self,HTMLElement */\n\nimport '@mrhenry/core-web/modules/~element-qsa-has.js';\nimport extractEncodedSelectors from './encode/extract.js';\nimport encodeCSS from './encode/encode.js';\n\nfunction hasNativeSupport() {\n\ttry {\n\t\tif (!('CSS' in self) || !('supports' in self.CSS) || !self.CSS.supports('selector(:has(div))')) {\n\t\t\treturn false;\n\t\t}\n\n\t} catch (_) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default function cssHasPseudo(document, options) {\n\t// OPTIONS\n\t{\n\t\tif (!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\toptions = {\n\t\t\thover: (!!options.hover) || false,\n\t\t\tdebug: (!!options.debug) || false,\n\t\t\tobservedAttributes: options.observedAttributes || [],\n\t\t\tforcePolyfill: (!!options.forcePolyfill) || false,\n\t\t};\n\n\t\toptions.mustPolyfill = options.forcePolyfill || !hasNativeSupport();\n\n\t\tif (!Array.isArray(options.observedAttributes)) {\n\t\t\toptions.observedAttributes = [];\n\t\t}\n\n\t\toptions.observedAttributes = options.observedAttributes.filter((x) => {\n\t\t\treturn (typeof x === 'string');\n\t\t});\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n\t\t// `data-*` and `style` were omitted\n\t\toptions.observedAttributes = options.observedAttributes.concat(['accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'alt', 'async', 'autocapitalize', 'autocomplete', 'autofocus', 'autoplay', 'buffered', 'capture', 'challenge', 'charset', 'checked', 'cite', 'class', 'code', 'codebase', 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'data', 'datetime', 'decoding', 'default', 'defer', 'dir', 'dirname', 'disabled', 'download', 'draggable', 'enctype', 'enterkeyhint', 'for', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'headers', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'icon', 'id', 'importance', 'integrity', 'intrinsicsize', 'inputmode', 'ismap', 'itemprop', 'keytype', 'kind', 'label', 'lang', 'language', 'list', 'loop', 'low', 'manifest', 'max', 'maxlength', 'minlength', 'media', 'method', 'min', 'multiple', 'muted', 'name', 'novalidate', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'poster', 'preload', 'radiogroup', 'readonly', 'referrerpolicy', 'rel', 'required', 'reversed', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'summary', 'tabindex', 'target', 'title', 'translate', 'type', 'usemap', 'value', 'width', 'wrap']);\n\t}\n\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\tif (!options.mustPolyfill) {\n\t\t// Cleanup of rules will have happened in `walkStyleSheet`\n\t\t// Native support will take over from here\n\t\treturn;\n\t}\n\n\ttransformObservedItemsThrottled();\n\n\t// observe DOM modifications that affect selectors\n\tif ('MutationObserver' in self) {\n\t\tconst mutationObserver = new MutationObserver((mutationsList) => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// transform observed css rules\n\t\t\t\tcleanupObservedCssRules();\n\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t});\n\t\t});\n\n\t\tmutationObserver.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: options.observedAttributes });\n\t}\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('blur', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('input', transformObservedItemsThrottled);\n\tdocument.addEventListener('change', transformObservedItemsThrottled, true);\n\n\tif (options.hover) {\n\t\tif ('onpointerenter' in document) {\n\t\t\tdocument.addEventListener('pointerenter', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('pointerleave', transformObservedItemsThrottled, true);\n\t\t} else {\n\t\t\tdocument.addEventListener('mouseover', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('mouseout', transformObservedItemsThrottled, true);\n\t\t}\n\t}\n\n\t// observe Javascript setters that effect pseudo-selectors\n\tif ('defineProperty' in Object && 'getOwnPropertyDescriptor' in Object && 'hasOwnProperty' in Object) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction observeProperty(proto, property) {\n\t\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\t\tif (proto.hasOwnProperty(property)) {\n\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, property);\n\t\t\t\t\tif (descriptor && descriptor.configurable && 'set' in descriptor) {\n\t\t\t\t\t\tObject.defineProperty(proto, property, {\n\t\t\t\t\t\t\tconfigurable: descriptor.configurable,\n\t\t\t\t\t\t\tenumerable: descriptor.enumerable,\n\t\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\t\treturn descriptor.get.apply(this, arguments);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tset: function () {\n\t\t\t\t\t\t\t\tdescriptor.set.apply(this, arguments);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t\t\t// should never happen as there is an inner try/catch\n\t\t\t\t\t\t\t\t\t// but just in case\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ('HTMLElement' in self && HTMLElement.prototype) {\n\t\t\t\tobserveProperty(HTMLElement.prototype, 'disabled');\n\t\t\t}\n\n\t\t\t// Not all of these elements have all of these properties.\n\t\t\t// But the code above checks if they exist first.\n\t\t\t['checked', 'selected', 'readOnly', 'required'].forEach((property) => {\n\t\t\t\t[\n\t\t\t\t\t'HTMLButtonElement',\n\t\t\t\t\t'HTMLFieldSetElement',\n\t\t\t\t\t'HTMLInputElement',\n\t\t\t\t\t'HTMLMeterElement',\n\t\t\t\t\t'HTMLOptGroupElement',\n\t\t\t\t\t'HTMLOptionElement',\n\t\t\t\t\t'HTMLOutputElement',\n\t\t\t\t\t'HTMLProgressElement',\n\t\t\t\t\t'HTMLSelectElement',\n\t\t\t\t\t'HTMLTextAreaElement',\n\t\t\t\t].forEach((elementName) => {\n\t\t\t\t\tif (elementName in self && self[elementName].prototype) {\n\t\t\t\t\t\tobserveProperty(self[elementName].prototype, property);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet transformObservedItemsThrottledBusy = false;\n\tfunction transformObservedItemsThrottled() {\n\t\tif (transformObservedItemsThrottledBusy) {\n\t\t\tcancelAnimationFrame(transformObservedItemsThrottledBusy);\n\t\t}\n\n\t\ttransformObservedItemsThrottledBusy = requestAnimationFrame(() => {\n\t\t\ttransformObservedItems();\n\t\t});\n\t}\n\n\t// transform observed css rules\n\tfunction transformObservedItems() {\n\t\tobservedItems.forEach((item) => {\n\t\t\tconst nodes = [];\n\n\t\t\tlet matches = [];\n\t\t\ttry {\n\t\t\t\tmatches = document.querySelectorAll(item.selector);\n\t\t\t} catch (e) {\n\t\t\t\tif (options.debug) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t[].forEach.call(matches, (element) => {\n\t\t\t\t// memorize the node\n\t\t\t\tnodes.push(element);\n\n\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\tattributeElement.innerHTML = '';\n\n\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t});\n\n\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\titem.nodes.forEach(node => {\n\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// update the\n\t\t\titem.nodes = nodes;\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules() {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter((item) => {\n\t\t\t\treturn item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet(styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], (rule, index) => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\trule.selectorText = rule.selectorText.replace(/\\.js-has-pseudo\\s/g, '');\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t\tconst hasSelectors = extractEncodedSelectors(rule.selectorText.toString());\n\t\t\t\t\t\tif (hasSelectors.length === 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!options.mustPolyfill) {\n\t\t\t\t\t\t\tstyleSheet.deleteRule(index);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < hasSelectors.length; i++) {\n\t\t\t\t\t\t\tconst hasSelector = hasSelectors[i];\n\t\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\t\trule: rule,\n\t\t\t\t\t\t\t\tselector: hasSelector,\n\t\t\t\t\t\t\t\tattributeName: encodeCSS(hasSelector),\n\t\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n}\n","/* eslint-disable */\n(function (global) {\n\ttry {\n\t\t// test for has support\n\t\tglobal.document.querySelector(':has(*, :does-not-exist, > *)');\n\n\t\tif (\n\t\t\t!global.document.querySelector(':has(:scope *)') &&\n\t\t\tCSS.supports('selector(:has(div))')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t} catch (_) { }\n\n\t// ELEMENT\n\t// polyfill Element#querySelector\n\tvar querySelectorWithHasElement = polyfill(global.Element.prototype.querySelector);\n\n\tglobal.Element.prototype.querySelector = function querySelector(selectors) {\n\t\treturn querySelectorWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#querySelectorAll\n\tvar querySelectorAllWithHasElement = polyfill(global.Element.prototype.querySelectorAll);\n\n\tglobal.Element.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\treturn querySelectorAllWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#matches\n\tif (global.Element.prototype.matches) {\n\t\tvar matchesWithHasElement = polyfill(global.Element.prototype.matches);\n\n\t\tglobal.Element.prototype.matches = function matches(selectors) {\n\t\t\treturn matchesWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// polyfill Element#closest\n\tif (global.Element.prototype.closest) {\n\t\tvar closestWithHasElement = polyfill(global.Element.prototype.closest);\n\n\t\tglobal.Element.prototype.closest = function closest(selectors) {\n\t\t\treturn closestWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// DOCUMENT\n\tif ('Document' in global && 'prototype' in global.Document) {\n\t\t// polyfill Document#querySelector\n\t\tvar querySelectorWithHasDocument = polyfill(global.Document.prototype.querySelector);\n\n\t\tglobal.Document.prototype.querySelector = function querySelector(selectors) {\n\t\t\treturn querySelectorWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#querySelectorAll\n\t\tvar querySelectorAllWithHasDocument = polyfill(global.Document.prototype.querySelectorAll);\n\n\t\tglobal.Document.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\t\treturn querySelectorAllWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#matches\n\t\tif (global.Document.prototype.matches) {\n\t\t\tvar matchesWithHasDocument = polyfill(global.Document.prototype.matches);\n\n\t\t\tglobal.Document.prototype.matches = function matches(selectors) {\n\t\t\t\treturn matchesWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\n\t\t// polyfill Document#closest\n\t\tif (global.Document.prototype.closest) {\n\t\t\tvar closestWithHasDocument = polyfill(global.Document.prototype.closest);\n\n\t\t\tglobal.Document.prototype.closest = function closest(selectors) {\n\t\t\t\treturn closestWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction pseudoClassHasInnerQuery(query) {\n\t\tvar current = '';\n\t\tvar start = 0;\n\t\tvar depth = 0;\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar inHas = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':has(' && !inHas) {\n\t\t\t\tinHas = true;\n\t\t\t\tstart = i;\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tif (!inHas) {\n\t\t\t\t\t\tcurrent = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tdepth++;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase ')':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinnerQuery: current,\n\t\t\t\t\t\t\t\tstart: start,\n\t\t\t\t\t\t\t\tend: i-1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdepth--;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction replaceScopeWithAttr(query, attr) {\n\t\tvar parts = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':scope' && !bracketed && (/^[\\[\\.\\:\\\\\"\\s|+>~#&,)]/.test(char || ''))) {\n\t\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\t\tparts.push('[' + attr + ']');\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tparts.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (current.toLowerCase() === ':scope') {\n\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\tparts.push('[' + attr + ']');\n\t\t\tcurrent = '';\n\t\t}\n\n\t\tif (parts.length === 0) {\n\t\t\treturn query;\n\t\t}\n\n\t\treturn parts.join('') + current;\n\t}\n\n\tfunction charIsNestedMarkMirror(char, mark) {\n\t\tif (mark === '(' && char === ')') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (mark === '[' && char === ']') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction splitSelector(query) {\n\t\tvar selectors = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar nestedMark = false;\n\t\tvar nestedDepth = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ',':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nestedDepth > 0) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectors.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tquoted = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\tcase ')':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (charIsNestedMarkMirror(char, nestedMark)) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth--;\n\n\t\t\t\t\t\tif (nestedDepth === 0) {\n\t\t\t\t\t\t\tnestedMark = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (char === nestedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tnestedDepth++;\n\t\t\t\t\tnestedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t}\n\n\t\tselectors.push(current);\n\n\t\treturn selectors;\n\t}\n\n\tfunction replaceAllWithTempAttr(query, nested, callback) {\n\t\tvar inner = pseudoClassHasInnerQuery(query);\n\t\tif (!inner) {\n\t\t\treturn query;\n\t\t}\n\n\t\tif (nested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar innerQuery = inner.innerQuery;\n\t\tvar attr = 'q-has' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\tvar innerReplacement = '[' + attr + ']';\n\n\t\tvar x = query;\n\n\t\tif (inner.innerQuery.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar innerParts = splitSelector(inner.innerQuery);\n\t\t\tvar newInnerParts = [];\n\t\t\tfor (var i = 0; i < innerParts.length; i++) {\n\t\t\t\tvar innerPart = innerParts[i];\n\n\t\t\t\t// Nested has is not supported.\n\t\t\t\t// If a recursive/nested call returns \"false\" we throw\n\t\t\t\tvar innerPartReplaced = replaceAllWithTempAttr(innerPart, true, function () { });\n\t\t\t\tif (!innerPartReplaced) {\n\t\t\t\t\tthrow new Error(\"Nested :has() is not supported\")\n\t\t\t\t} else {\n\t\t\t\t\tnewInnerParts.push(innerPart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\t\treturn _prefix + newInnerParts.join(', ') + _suffix;\n\t\t}\n\n\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\tx = _prefix + innerReplacement + _suffix;\n\n\t\tcallback(innerQuery, attr);\n\t\tif (x.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar y = replaceAllWithTempAttr(x, false, callback);\n\t\t\tif (y) {\n\t\t\t\treturn y;\n\t\t\t}\n\t\t}\n\n\t\treturn x;\n\t}\n\n\tfunction walkNode(rootNode, callback) {\n\t\tif (('setAttribute' in (rootNode)) && ('querySelector' in (rootNode))) {\n\t\t\tcallback(rootNode);\n\t\t}\n\n\t\tif (rootNode.hasChildNodes()) {\n\t\t\tvar nodes = rootNode.childNodes;\n\t\t\tfor (var i = 0; i < nodes.length; ++i) {\n\t\t\t\twalkNode(nodes[i], callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction polyfill(qsa) {\n\t\treturn function (selectors) {\n\t\t\tif (!selectors) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar selectorsString = String(selectors);\n\t\t\tif (!selectorsString || (selectorsString.toLowerCase().indexOf(':has(') === -1) || !pseudoClassHasInnerQuery(selectorsString)) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar rootNode;\n\t\t\tif ('getRootNode' in this) {\n\t\t\t\trootNode = this.getRootNode();\n\t\t\t} else {\n\t\t\t\tvar r = this;\n\t\t\t\twhile (r) {\n\t\t\t\t\trootNode = r;\n\t\t\t\t\tr = r.parentNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _focus = this;\n\t\t\tif (_focus === global.document) {\n\t\t\t\t_focus = global.document.documentElement;\n\t\t\t}\n\n\t\t\tvar scopeAttr = 'q-has-scope' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t_focus.setAttribute(scopeAttr, '');\n\n\t\t\ttry {\n\t\t\t\tselectorsString = replaceScopeWithAttr(selectorsString, scopeAttr);\n\n\t\t\t\tvar attrs = [scopeAttr];\n\t\t\t\tvar newQuery = replaceAllWithTempAttr(selectorsString, false, function (inner, attr) {\n\t\t\t\t\tattrs.push(attr);\n\n\t\t\t\t\tvar selectorParts = splitSelector(inner);\n\t\t\t\t\tfor (var x = 0; x < selectorParts.length; x++) {\n\t\t\t\t\t\tvar selectorPart = selectorParts[x].trim();\n\t\t\t\t\t\tvar absoluteSelectorPart = selectorPart;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tselectorPart[0] === '>' ||\n\t\t\t\t\t\t\tselectorPart[0] === '+' ||\n\t\t\t\t\t\t\tselectorPart[0] === '~'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tabsoluteSelectorPart = selectorPart.slice(1).trim();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteSelectorPart = ':scope ' + selectorPart;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twalkNode(rootNode, function (node) {\n\t\t\t\t\t\t\tif (!(node.querySelector(absoluteSelectorPart))) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch (selectorPart[0]) {\n\t\t\t\t\t\t\t\tcase '~':\n\t\t\t\t\t\t\t\tcase '+':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar siblings = node.childNodes;\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < siblings.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tvar sibling = siblings[i];\n\t\t\t\t\t\t\t\t\t\t\tif (!('setAttribute' in sibling)) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope [' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tsibling.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\tnode.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope[' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnode.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\targuments[0] = newQuery;\n\n\t\t\t\t// results of the qsa\n\t\t\t\tvar elementOrNodeList = qsa.apply(this, arguments);\n\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// return the results of the qsa\n\t\t\t\treturn elementOrNodeList;\n\t\t\t} catch (err) {\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar errorMessage = '';\n\t\t\t\ttry {\n\t\t\t\t\tqsa.apply(this, [':core-web-does-not-exist']);\n\t\t\t\t} catch (dummyError) {\n\t\t\t\t\terrorMessage = dummyError.message;\n\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\terrorMessage = errorMessage.replace(':core-web-does-not-exist', selectorsString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!errorMessage) {\n\t\t\t\t\terrorMessage = \"Failed to execute 'querySelector' on 'Document': '\" + selectorsString + \"' is not a valid selector.\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new DOMException(errorMessage);\n\t\t\t\t} catch (_) {\n\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n})(self);\n"],"names":["decodeCSS","value","slice","values","split","result","i","length","String","fromCharCode","parseInt","extractEncodedSelectors","candidate","quotedMark","out","depth","quoted","containsUnescapedUnquotedHasAtDepth1","char","decoded","push","unique","indexOf","encodeCSS","hex","charCodeAt","toString","hasNativeSupport","self","CSS","supports","_","global","document","querySelector","querySelectorWithHasElement","polyfill","Element","prototype","selectors","apply","this","arguments","querySelectorAllWithHasElement","querySelectorAll","matches","matchesWithHasElement","closest","closestWithHasElement","Document","querySelectorWithHasDocument","querySelectorAllWithHasDocument","matchesWithHasDocument","closestWithHasDocument","pseudoClassHasInnerQuery","query","current","start","escaped","inHas","toLowerCase","innerQuery","end","replaceScopeWithAttr","attr","parts","bracketed","test","join","splitSelector","mark","nestedMark","nestedDepth","replaceAllWithTempAttr","nested","callback","inner","Math","floor","random","innerReplacement","x","innerParts","newInnerParts","innerPart","Error","_prefix","substring","_suffix","y","walkNode","rootNode","hasChildNodes","nodes","childNodes","qsa","selectorsString","getRootNode","r","parentNode","_focus","documentElement","scopeAttr","setAttribute","attrs","newQuery","selectorParts","selectorPart","trim","absoluteSelectorPart","node","siblings","sibling","idAttr","removeAttribute","elementOrNodeList","attrsForQuery","j","elements","k","element","l","err","errorMessage","dummyError","message","replace","DOMException","cssHasPseudo","options","hover","debug","observedAttributes","forcePolyfill","mustPolyfill","Array","isArray","filter","concat","observedItems","attributeElement","createElement","forEach","call","styleSheets","walkStyleSheet","transformObservedItemsThrottled","MutationObserver","mutationsList","mutation","addedNodes","nodeType","sheet","splice","item","rule","parentStyleSheet","ownerNode","contains","observe","childList","subtree","attributes","attributeFilter","addEventListener","Object","observeProperty","proto","property","hasOwnProperty","descriptor","getOwnPropertyDescriptor","configurable","defineProperty","enumerable","get","set","HTMLElement","elementName","e","console","error","transformObservedItemsThrottledBusy","cancelAnimationFrame","requestAnimationFrame","selector","innerHTML","attributeName","setAttributeNode","children","cloneNode","style","zoom","styleSheet","cssRules","index","selectorText","hasSelectors","deleteRule","hasSelector"],"mappings":"AACe,SAASA,UAAUC,GACjC,GAA2B,kBAAvBA,EAAMC,MAAM,EAAG,IAClB,MAAO,GAOR,IAHA,IAAIC,GADJF,EAAQA,EAAMC,MAAM,KACDE,MAAM,KAErBC,EAAS,GACJC,EAAI,EAAGA,EAAIH,EAAOI,OAAQD,IAClCD,GAAUG,OAAOC,aAAaC,SAASP,EAAOG,GAAI,KAGnD,OAAOD,CACR,CCZe,SAASM,wBAAwBV,GAY/C,IAXA,IAGIW,EAGAC,EANAC,EAAM,GAENC,EAAQ,EAGRC,GAAS,EAGTC,GAAuC,EAGlCX,EAAI,EAAGA,EAAIL,EAAMM,OAAQD,IAAK,CACtC,IAAMY,EAAOjB,EAAMK,GAEnB,OAAQY,GACP,IAAK,IACJ,GAAIF,EAAQ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E,EAAe1L,wBAAwBgJ,EAAKyC,aAAa1K,YAC/D,GAA4B,IAAxB2K,EAAa9L,OAChB,OAGD,IAAK0H,EAAQK,aAEZ,YADA2D,EAAWK,WAAWH,GAIvB,IAAK,IAAI7L,EAAI,EAAGA,EAAI+L,EAAa9L,OAAQD,IAAK,CAC7C,IAAMiM,EAAcF,EAAa/L,GACjCqI,EAAcvH,KAAK,CAClBuI,KAAMA,EACN8B,SAAUc,EACVZ,cAAepK,UAAUgL,GACzB1G,MAAO,IAET,CACA,CAAC,MAAOsF,GACJlD,EAAQE,OACXiD,QAAQC,MAAMF,EAEhB,CACD,MACClC,eAAeU,EAEjB,GACA,CAAC,MAAOwB,GACJlD,EAAQE,OACXiD,QAAQC,MAAMF,EAEhB,CACD,CACD","x_google_ignoreList":[4]} \ No newline at end of file diff --git a/plugins/css-has-pseudo/dist/browser.mjs.map b/plugins/css-has-pseudo/dist/browser.mjs.map index 0d427e8e6..03dc26e73 100644 --- a/plugins/css-has-pseudo/dist/browser.mjs.map +++ b/plugins/css-has-pseudo/dist/browser.mjs.map @@ -1 +1 @@ -{"version":3,"file":"browser.mjs","sources":["../src/encode/decode.mjs","../src/encode/extract.mjs","../src/encode/encode.mjs","../src/browser.js","../../../node_modules/@mrhenry/core-web/modules/~element-qsa-has.js"],"sourcesContent":["\n/** Decodes an identifier back into a CSS selector */\nexport default function decodeCSS(value) {\n\tif (value.slice(0, 13) !== 'csstools-has-') {\n\t\treturn '';\n\t}\n\n\tvalue = value.slice(13);\n\tlet values = value.split('-');\n\n\tlet result = '';\n\tfor (let i = 0; i < values.length; i++) {\n\t\tresult += String.fromCharCode(parseInt(values[i], 36));\n\t}\n\n\treturn result;\n}\n","import decodeCSS from './decode.mjs';\n\n/** Extract encoded selectors out of attribute selectors */\nexport default function extractEncodedSelectors(value) {\n\tlet out = [];\n\n\tlet depth = 0;\n\tlet candidate;\n\n\tlet quoted = false;\n\tlet quotedMark;\n\n\tlet containsUnescapedUnquotedHasAtDepth1 = false;\n\n\t// Stryker disable next-line EqualityOperator\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value[i];\n\n\t\tswitch (char) {\n\t\t\tcase '[':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\tcandidate = '';\n\t\t\t\t} else {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t}\n\n\t\t\t\tdepth++;\n\t\t\t\tcontinue;\n\t\t\tcase ']':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\tdepth--;\n\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\tconst decoded = decodeCSS(candidate);\n\t\t\t\t\t\tif (containsUnescapedUnquotedHasAtDepth1) {\n\t\t\t\t\t\t\tout.push(decoded);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcandidate += char;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\tcase '\\\\':\n\t\t\t\tcandidate += value[i];\n\t\t\t\tcandidate += value[i+1];\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\n\t\t\tcase '\"':\n\t\t\tcase '\\'':\n\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tquoted = true;\n\t\t\t\tquotedMark = char;\n\t\t\t\tcontinue;\n\n\t\t\tdefault:\n\t\t\t\tif (candidate === '' && depth === 1 && (value.slice(i, i + 13) === 'csstools-has-')) {\n\t\t\t\t\tcontainsUnescapedUnquotedHasAtDepth1 = true;\n\t\t\t\t}\n\n\t\t\t\tcandidate += char;\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\n\tconst unique = [];\n\tfor (let i = 0; i < out.length; i++) {\n\t\tif (unique.indexOf(out[i]) === -1) {\n\t\t\tunique.push(out[i]);\n\t\t}\n\t}\n\n\treturn unique;\n}\n","\n/** Returns the string as an encoded CSS identifier. */\nexport default function encodeCSS(value) {\n\tif (value === '') {\n\t\treturn '';\n\t}\n\n\tlet hex;\n\tlet result = '';\n\tfor (let i = 0; i < value.length; i++) {\n\t\thex = value.charCodeAt(i).toString(36);\n\t\tif (i === 0) {\n\t\t\tresult += hex;\n\t\t} else {\n\t\t\tresult += '-' + hex;\n\t\t}\n\t}\n\n\treturn 'csstools-has-' + result;\n}\n","/* global MutationObserver,requestAnimationFrame,cancelAnimationFrame,self,HTMLElement */\n\nimport '@mrhenry/core-web/modules/~element-qsa-has.js';\nimport extractEncodedSelectors from './encode/extract.mjs';\nimport encodeCSS from './encode/encode.mjs';\n\nfunction hasNativeSupport() {\n\ttry {\n\t\tif (!('CSS' in self) || !('supports' in self.CSS) || !self.CSS.supports('selector(:has(div))')) {\n\t\t\treturn false;\n\t\t}\n\n\t} catch (_) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default function cssHasPseudo(document, options) {\n\t// OPTIONS\n\t{\n\t\tif (!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\toptions = {\n\t\t\thover: (!!options.hover) || false,\n\t\t\tdebug: (!!options.debug) || false,\n\t\t\tobservedAttributes: options.observedAttributes || [],\n\t\t\tforcePolyfill: (!!options.forcePolyfill) || false,\n\t\t};\n\n\t\toptions.mustPolyfill = options.forcePolyfill || !hasNativeSupport();\n\n\t\tif (!Array.isArray(options.observedAttributes)) {\n\t\t\toptions.observedAttributes = [];\n\t\t}\n\n\t\toptions.observedAttributes = options.observedAttributes.filter((x) => {\n\t\t\treturn (typeof x === 'string');\n\t\t});\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n\t\t// `data-*` and `style` were omitted\n\t\toptions.observedAttributes = options.observedAttributes.concat(['accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'alt', 'async', 'autocapitalize', 'autocomplete', 'autofocus', 'autoplay', 'buffered', 'capture', 'challenge', 'charset', 'checked', 'cite', 'class', 'code', 'codebase', 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'data', 'datetime', 'decoding', 'default', 'defer', 'dir', 'dirname', 'disabled', 'download', 'draggable', 'enctype', 'enterkeyhint', 'for', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'headers', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'icon', 'id', 'importance', 'integrity', 'intrinsicsize', 'inputmode', 'ismap', 'itemprop', 'keytype', 'kind', 'label', 'lang', 'language', 'list', 'loop', 'low', 'manifest', 'max', 'maxlength', 'minlength', 'media', 'method', 'min', 'multiple', 'muted', 'name', 'novalidate', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'poster', 'preload', 'radiogroup', 'readonly', 'referrerpolicy', 'rel', 'required', 'reversed', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'summary', 'tabindex', 'target', 'title', 'translate', 'type', 'usemap', 'value', 'width', 'wrap']);\n\t}\n\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\tif (!options.mustPolyfill) {\n\t\t// Cleanup of rules will have happened in `walkStyleSheet`\n\t\t// Native support will take over from here\n\t\treturn;\n\t}\n\n\ttransformObservedItemsThrottled();\n\n\t// observe DOM modifications that affect selectors\n\tif ('MutationObserver' in self) {\n\t\tconst mutationObserver = new MutationObserver((mutationsList) => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// transform observed css rules\n\t\t\t\tcleanupObservedCssRules();\n\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t});\n\t\t});\n\n\t\tmutationObserver.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: options.observedAttributes });\n\t}\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('blur', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('input', transformObservedItemsThrottled);\n\tdocument.addEventListener('change', transformObservedItemsThrottled, true);\n\n\tif (options.hover) {\n\t\tif ('onpointerenter' in document) {\n\t\t\tdocument.addEventListener('pointerenter', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('pointerleave', transformObservedItemsThrottled, true);\n\t\t} else {\n\t\t\tdocument.addEventListener('mouseover', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('mouseout', transformObservedItemsThrottled, true);\n\t\t}\n\t}\n\n\t// observe Javascript setters that effect pseudo-selectors\n\tif ('defineProperty' in Object && 'getOwnPropertyDescriptor' in Object && 'hasOwnProperty' in Object) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction observeProperty(proto, property) {\n\t\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\t\tif (proto.hasOwnProperty(property)) {\n\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, property);\n\t\t\t\t\tif (descriptor && descriptor.configurable && 'set' in descriptor) {\n\t\t\t\t\t\tObject.defineProperty(proto, property, {\n\t\t\t\t\t\t\tconfigurable: descriptor.configurable,\n\t\t\t\t\t\t\tenumerable: descriptor.enumerable,\n\t\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\t\treturn descriptor.get.apply(this, arguments);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tset: function () {\n\t\t\t\t\t\t\t\tdescriptor.set.apply(this, arguments);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t\t\t// should never happen as there is an inner try/catch\n\t\t\t\t\t\t\t\t\t// but just in case\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ('HTMLElement' in self && HTMLElement.prototype) {\n\t\t\t\tobserveProperty(HTMLElement.prototype, 'disabled');\n\t\t\t}\n\n\t\t\t// Not all of these elements have all of these properties.\n\t\t\t// But the code above checks if they exist first.\n\t\t\t['checked', 'selected', 'readOnly', 'required'].forEach((property) => {\n\t\t\t\t[\n\t\t\t\t\t'HTMLButtonElement',\n\t\t\t\t\t'HTMLFieldSetElement',\n\t\t\t\t\t'HTMLInputElement',\n\t\t\t\t\t'HTMLMeterElement',\n\t\t\t\t\t'HTMLOptGroupElement',\n\t\t\t\t\t'HTMLOptionElement',\n\t\t\t\t\t'HTMLOutputElement',\n\t\t\t\t\t'HTMLProgressElement',\n\t\t\t\t\t'HTMLSelectElement',\n\t\t\t\t\t'HTMLTextAreaElement',\n\t\t\t\t].forEach((elementName) => {\n\t\t\t\t\tif (elementName in self && self[elementName].prototype) {\n\t\t\t\t\t\tobserveProperty(self[elementName].prototype, property);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet transformObservedItemsThrottledBusy = false;\n\tfunction transformObservedItemsThrottled() {\n\t\tif (transformObservedItemsThrottledBusy) {\n\t\t\tcancelAnimationFrame(transformObservedItemsThrottledBusy);\n\t\t}\n\n\t\ttransformObservedItemsThrottledBusy = requestAnimationFrame(() => {\n\t\t\ttransformObservedItems();\n\t\t});\n\t}\n\n\t// transform observed css rules\n\tfunction transformObservedItems() {\n\t\tobservedItems.forEach((item) => {\n\t\t\tconst nodes = [];\n\n\t\t\tlet matches = [];\n\t\t\ttry {\n\t\t\t\tmatches = document.querySelectorAll(item.selector);\n\t\t\t} catch (e) {\n\t\t\t\tif (options.debug) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t[].forEach.call(matches, (element) => {\n\t\t\t\t// memorize the node\n\t\t\t\tnodes.push(element);\n\n\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\tattributeElement.innerHTML = '';\n\n\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t});\n\n\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\titem.nodes.forEach(node => {\n\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// update the\n\t\t\titem.nodes = nodes;\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules() {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter((item) => {\n\t\t\t\treturn item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet(styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], (rule, index) => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\trule.selectorText = rule.selectorText.replace(/\\.js-has-pseudo\\s/g, '');\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t\tconst hasSelectors = extractEncodedSelectors(rule.selectorText.toString());\n\t\t\t\t\t\tif (hasSelectors.length === 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!options.mustPolyfill) {\n\t\t\t\t\t\t\tstyleSheet.deleteRule(index);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < hasSelectors.length; i++) {\n\t\t\t\t\t\t\tconst hasSelector = hasSelectors[i];\n\t\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\t\trule: rule,\n\t\t\t\t\t\t\t\tselector: hasSelector,\n\t\t\t\t\t\t\t\tattributeName: encodeCSS(hasSelector),\n\t\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n}\n","/* eslint-disable */\n(function (global) {\n\ttry {\n\t\t// test for has support\n\t\tglobal.document.querySelector(':has(*, :does-not-exist, > *)');\n\n\t\tif (\n\t\t\t!global.document.querySelector(':has(:scope *)') &&\n\t\t\tCSS.supports('selector(:has(div))')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t} catch (_) { }\n\n\t// ELEMENT\n\t// polyfill Element#querySelector\n\tvar querySelectorWithHasElement = polyfill(global.Element.prototype.querySelector);\n\n\tglobal.Element.prototype.querySelector = function querySelector(selectors) {\n\t\treturn querySelectorWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#querySelectorAll\n\tvar querySelectorAllWithHasElement = polyfill(global.Element.prototype.querySelectorAll);\n\n\tglobal.Element.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\treturn querySelectorAllWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#matches\n\tif (global.Element.prototype.matches) {\n\t\tvar matchesWithHasElement = polyfill(global.Element.prototype.matches);\n\n\t\tglobal.Element.prototype.matches = function matches(selectors) {\n\t\t\treturn matchesWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// polyfill Element#closest\n\tif (global.Element.prototype.closest) {\n\t\tvar closestWithHasElement = polyfill(global.Element.prototype.closest);\n\n\t\tglobal.Element.prototype.closest = function closest(selectors) {\n\t\t\treturn closestWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// DOCUMENT\n\tif ('Document' in global && 'prototype' in global.Document) {\n\t\t// polyfill Document#querySelector\n\t\tvar querySelectorWithHasDocument = polyfill(global.Document.prototype.querySelector);\n\n\t\tglobal.Document.prototype.querySelector = function querySelector(selectors) {\n\t\t\treturn querySelectorWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#querySelectorAll\n\t\tvar querySelectorAllWithHasDocument = polyfill(global.Document.prototype.querySelectorAll);\n\n\t\tglobal.Document.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\t\treturn querySelectorAllWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#matches\n\t\tif (global.Document.prototype.matches) {\n\t\t\tvar matchesWithHasDocument = polyfill(global.Document.prototype.matches);\n\n\t\t\tglobal.Document.prototype.matches = function matches(selectors) {\n\t\t\t\treturn matchesWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\n\t\t// polyfill Document#closest\n\t\tif (global.Document.prototype.closest) {\n\t\t\tvar closestWithHasDocument = polyfill(global.Document.prototype.closest);\n\n\t\t\tglobal.Document.prototype.closest = function closest(selectors) {\n\t\t\t\treturn closestWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction pseudoClassHasInnerQuery(query) {\n\t\tvar current = '';\n\t\tvar start = 0;\n\t\tvar depth = 0;\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar inHas = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':has(' && !inHas) {\n\t\t\t\tinHas = true;\n\t\t\t\tstart = i;\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tif (!inHas) {\n\t\t\t\t\t\tcurrent = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tdepth++;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase ')':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinnerQuery: current,\n\t\t\t\t\t\t\t\tstart: start,\n\t\t\t\t\t\t\t\tend: i-1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdepth--;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction replaceScopeWithAttr(query, attr) {\n\t\tvar parts = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':scope' && !bracketed && (/^[\\[\\.\\:\\\\\"\\s|+>~#&,)]/.test(char || ''))) {\n\t\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\t\tparts.push('[' + attr + ']');\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tparts.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (current.toLowerCase() === ':scope') {\n\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\tparts.push('[' + attr + ']');\n\t\t\tcurrent = '';\n\t\t}\n\n\t\tif (parts.length === 0) {\n\t\t\treturn query;\n\t\t}\n\n\t\treturn parts.join('') + current;\n\t}\n\n\tfunction charIsNestedMarkMirror(char, mark) {\n\t\tif (mark === '(' && char === ')') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (mark === '[' && char === ']') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction splitSelector(query) {\n\t\tvar selectors = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar nestedMark = false;\n\t\tvar nestedDepth = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ',':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nestedDepth > 0) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectors.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tquoted = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\tcase ')':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (charIsNestedMarkMirror(char, nestedMark)) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth--;\n\n\t\t\t\t\t\tif (nestedDepth === 0) {\n\t\t\t\t\t\t\tnestedMark = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (char === nestedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tnestedDepth++;\n\t\t\t\t\tnestedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t}\n\n\t\tselectors.push(current);\n\n\t\treturn selectors;\n\t}\n\n\tfunction replaceAllWithTempAttr(query, nested, callback) {\n\t\tvar inner = pseudoClassHasInnerQuery(query);\n\t\tif (!inner) {\n\t\t\treturn query;\n\t\t}\n\n\t\tif (nested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar innerQuery = inner.innerQuery;\n\t\tvar attr = 'q-has' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\tvar innerReplacement = '[' + attr + ']';\n\n\t\tvar x = query;\n\n\t\tif (inner.innerQuery.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar innerParts = splitSelector(inner.innerQuery);\n\t\t\tvar newInnerParts = [];\n\t\t\tfor (var i = 0; i < innerParts.length; i++) {\n\t\t\t\tvar innerPart = innerParts[i];\n\n\t\t\t\t// Nested has is not supported.\n\t\t\t\t// If a recursive/nested call returns \"false\" we throw\n\t\t\t\tvar innerPartReplaced = replaceAllWithTempAttr(innerPart, true, function () { });\n\t\t\t\tif (!innerPartReplaced) {\n\t\t\t\t\tthrow new Error(\"Nested :has() is not supported\")\n\t\t\t\t} else {\n\t\t\t\t\tnewInnerParts.push(innerPart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\t\treturn _prefix + newInnerParts.join(', ') + _suffix;\n\t\t}\n\n\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\tx = _prefix + innerReplacement + _suffix;\n\n\t\tcallback(innerQuery, attr);\n\t\tif (x.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar y = replaceAllWithTempAttr(x, false, callback);\n\t\t\tif (y) {\n\t\t\t\treturn y;\n\t\t\t}\n\t\t}\n\n\t\treturn x;\n\t}\n\n\tfunction walkNode(rootNode, callback) {\n\t\tif (('setAttribute' in (rootNode)) && ('querySelector' in (rootNode))) {\n\t\t\tcallback(rootNode);\n\t\t}\n\n\t\tif (rootNode.hasChildNodes()) {\n\t\t\tvar nodes = rootNode.childNodes;\n\t\t\tfor (var i = 0; i < nodes.length; ++i) {\n\t\t\t\twalkNode(nodes[i], callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction polyfill(qsa) {\n\t\treturn function (selectors) {\n\t\t\tif (!selectors) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar selectorsString = String(selectors);\n\t\t\tif (!selectorsString || (selectorsString.toLowerCase().indexOf(':has(') === -1) || !pseudoClassHasInnerQuery(selectorsString)) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar rootNode;\n\t\t\tif ('getRootNode' in this) {\n\t\t\t\trootNode = this.getRootNode();\n\t\t\t} else {\n\t\t\t\tvar r = this;\n\t\t\t\twhile (r) {\n\t\t\t\t\trootNode = r;\n\t\t\t\t\tr = r.parentNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _focus = this;\n\t\t\tif (_focus === global.document) {\n\t\t\t\t_focus = global.document.documentElement;\n\t\t\t}\n\n\t\t\tvar scopeAttr = 'q-has-scope' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t_focus.setAttribute(scopeAttr, '');\n\n\t\t\ttry {\n\t\t\t\tselectorsString = replaceScopeWithAttr(selectorsString, scopeAttr);\n\n\t\t\t\tvar attrs = [scopeAttr];\n\t\t\t\tvar newQuery = replaceAllWithTempAttr(selectorsString, false, function (inner, attr) {\n\t\t\t\t\tattrs.push(attr);\n\n\t\t\t\t\tvar selectorParts = splitSelector(inner);\n\t\t\t\t\tfor (var x = 0; x < selectorParts.length; x++) {\n\t\t\t\t\t\tvar selectorPart = selectorParts[x].trim();\n\t\t\t\t\t\tvar absoluteSelectorPart = selectorPart;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tselectorPart[0] === '>' ||\n\t\t\t\t\t\t\tselectorPart[0] === '+' ||\n\t\t\t\t\t\t\tselectorPart[0] === '~'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tabsoluteSelectorPart = selectorPart.slice(1).trim();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteSelectorPart = ':scope ' + selectorPart;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twalkNode(rootNode, function (node) {\n\t\t\t\t\t\t\tif (!(node.querySelector(absoluteSelectorPart))) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch (selectorPart[0]) {\n\t\t\t\t\t\t\t\tcase '~':\n\t\t\t\t\t\t\t\tcase '+':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar siblings = node.childNodes;\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < siblings.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tvar sibling = siblings[i];\n\t\t\t\t\t\t\t\t\t\t\tif (!('setAttribute' in sibling)) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope [' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tsibling.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\tnode.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope[' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnode.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\targuments[0] = newQuery;\n\n\t\t\t\t// results of the qsa\n\t\t\t\tvar elementOrNodeList = qsa.apply(this, arguments);\n\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// return the results of the qsa\n\t\t\t\treturn elementOrNodeList;\n\t\t\t} catch (err) {\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar errorMessage = '';\n\t\t\t\ttry {\n\t\t\t\t\tqsa.apply(this, [':core-web-does-not-exist']);\n\t\t\t\t} catch (dummyError) {\n\t\t\t\t\terrorMessage = dummyError.message;\n\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\terrorMessage = errorMessage.replace(':core-web-does-not-exist', selectorsString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!errorMessage) {\n\t\t\t\t\terrorMessage = \"Failed to execute 'querySelector' on 'Document': '\" + selectorsString + \"' is not a valid selector.\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new DOMException(errorMessage);\n\t\t\t\t} catch (_) {\n\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n})(self);\n"],"names":["decodeCSS","value","slice","values","split","result","i","length","String","fromCharCode","parseInt","extractEncodedSelectors","candidate","quotedMark","out","depth","quoted","containsUnescapedUnquotedHasAtDepth1","char","decoded","push","unique","indexOf","encodeCSS","hex","charCodeAt","toString","hasNativeSupport","self","CSS","supports","_","cssHasPseudo","document","options","hover","debug","observedAttributes","forcePolyfill","mustPolyfill","Array","isArray","filter","x","concat","observedItems","attributeElement","createElement","forEach","call","styleSheets","walkStyleSheet","transformObservedItemsThrottled","MutationObserver","mutationsList","mutation","addedNodes","node","nodeType","sheet","apply","splice","item","rule","parentStyleSheet","ownerNode","documentElement","contains","observe","childList","subtree","attributes","attributeFilter","addEventListener","Object","observeProperty","proto","property","hasOwnProperty","descriptor","getOwnPropertyDescriptor","configurable","defineProperty","enumerable","get","this","arguments","set","HTMLElement","prototype","elementName","e","console","error","transformObservedItemsThrottledBusy","cancelAnimationFrame","requestAnimationFrame","nodes","matches","querySelectorAll","selector","element","innerHTML","attributeName","setAttributeNode","children","cloneNode","style","zoom","removeAttribute","styleSheet","cssRules","index","selectorText","replace","hasSelectors","deleteRule","hasSelector","global","querySelector","querySelectorWithHasElement","polyfill","Element","selectors","querySelectorAllWithHasElement","matchesWithHasElement","closest","closestWithHasElement","Document","querySelectorWithHasDocument","querySelectorAllWithHasDocument","matchesWithHasDocument","closestWithHasDocument","pseudoClassHasInnerQuery","query","current","start","escaped","inHas","toLowerCase","innerQuery","end","replaceScopeWithAttr","attr","parts","bracketed","test","join","splitSelector","mark","nestedMark","nestedDepth","replaceAllWithTempAttr","nested","callback","inner","Math","floor","random","innerReplacement","innerParts","newInnerParts","innerPart","Error","_prefix","substring","_suffix","y","walkNode","rootNode","hasChildNodes","childNodes","qsa","selectorsString","getRootNode","r","parentNode","_focus","scopeAttr","setAttribute","attrs","newQuery","selectorParts","selectorPart","trim","absoluteSelectorPart","siblings","sibling","idAttr","elementOrNodeList","attrsForQuery","j","elements","k","l","err","errorMessage","dummyError","message","DOMException"],"mappings":"AAEe,SAASA,UAAUC,GACjC,GAA2B,kBAAvBA,EAAMC,MAAM,EAAG,IAClB,MAAO,GAOR,IAHA,IAAIC,GADJF,EAAQA,EAAMC,MAAM,KACDE,MAAM,K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8C,EAAI,EAAGA,EAAID,EAASzL,OAAQ0L,IAEpC,IADA,IAAI5F,EAAU2F,EAASC,GACdC,EAAI,EAAGA,EAAId,EAAM7K,OAAQ2L,IACjC7F,EAAQQ,gBAAgBuE,EAAMc,GAGjC,CAGA,OAAOL,CACP,CAAC,MAAOM,GAGR,GAFAlB,EAAOpE,gBAAgBqE,GAEnBE,EAAM7K,OAAS,EAAG,CAGrB,IADIuL,EAAgB,GACXC,EAAI,EAAGA,EAAIX,EAAM7K,OAAQwL,IACjCD,EAAc1K,KAAK,IAAMgK,EAAMW,GAAK,KAIrC,IADIC,EAAW1E,EAAOrF,SAASkE,iBAAiB2F,EAAc3C,KAAK,MAC1D8C,EAAI,EAAGA,EAAID,EAASzL,OAAQ0L,IAEpC,IADI5F,EAAU2F,EAASC,GACdC,EAAI,EAAGA,EAAId,EAAM7K,OAAQ2L,IACjC7F,EAAQQ,gBAAgBuE,EAAMc,GAGjC,CAEA,IAAIE,EAAe,GACnB,IACCxB,EAAIhH,MAAMyB,KAAM,CAAC,4BACjB,CAAC,MAAOgH,GACRD,EAAeC,EAAWC,QACtBF,IACHA,EAAeA,EAAalF,QAAQ,2BAA4B2D,GAElE,CAEKuB,IACJA,EAAe,qDAAuDvB,EAAkB,8BAGzF,IACC,MAAM,IAAI0B,aAAaH,EACvB,CAAC,MAAOrK,GACR,MAAM,IAAIoI,MAAMiC,EACjB,CACD,EAEF,CACA,CAvmBD,CAumBGxK","x_google_ignoreList":[4]} \ No newline at end of file +{"version":3,"file":"browser.mjs","sources":["../src/encode/decode.js","../src/encode/extract.js","../src/encode/encode.js","../src/browser.js","../../../node_modules/@mrhenry/core-web/modules/~element-qsa-has.js"],"sourcesContent":["/** Decodes an identifier back into a CSS selector */\nexport default function decodeCSS(value) {\n\tif (value.slice(0, 13) !== 'csstools-has-') {\n\t\treturn '';\n\t}\n\n\tvalue = value.slice(13);\n\tlet values = value.split('-');\n\n\tlet result = '';\n\tfor (let i = 0; i < values.length; i++) {\n\t\tresult += String.fromCharCode(parseInt(values[i], 36));\n\t}\n\n\treturn result;\n}\n","import decodeCSS from './decode.js';\n\n/** Extract encoded selectors out of attribute selectors */\nexport default function extractEncodedSelectors(value) {\n\tlet out = [];\n\n\tlet depth = 0;\n\tlet candidate;\n\n\tlet quoted = false;\n\tlet quotedMark;\n\n\tlet containsUnescapedUnquotedHasAtDepth1 = false;\n\n\t// Stryker disable next-line EqualityOperator\n\tfor (let i = 0; i < value.length; i++) {\n\t\tconst char = value[i];\n\n\t\tswitch (char) {\n\t\t\tcase '[':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (depth === 0) {\n\t\t\t\t\tcandidate = '';\n\t\t\t\t} else {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t}\n\n\t\t\t\tdepth++;\n\t\t\t\tcontinue;\n\t\t\tcase ']':\n\t\t\t\tif (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t{\n\t\t\t\t\tdepth--;\n\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\tconst decoded = decodeCSS(candidate);\n\t\t\t\t\t\tif (containsUnescapedUnquotedHasAtDepth1) {\n\t\t\t\t\t\t\tout.push(decoded);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcandidate += char;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcontinue;\n\t\t\tcase '\\\\':\n\t\t\t\tcandidate += value[i];\n\t\t\t\tcandidate += value[i+1];\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\n\t\t\tcase '\"':\n\t\t\tcase '\\'':\n\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t\tcontinue;\n\t\t\t\t} else if (quoted) {\n\t\t\t\t\tcandidate += char;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tquoted = true;\n\t\t\t\tquotedMark = char;\n\t\t\t\tcontinue;\n\n\t\t\tdefault:\n\t\t\t\tif (candidate === '' && depth === 1 && (value.slice(i, i + 13) === 'csstools-has-')) {\n\t\t\t\t\tcontainsUnescapedUnquotedHasAtDepth1 = true;\n\t\t\t\t}\n\n\t\t\t\tcandidate += char;\n\t\t\t\tcontinue;\n\t\t}\n\t}\n\n\tconst unique = [];\n\tfor (let i = 0; i < out.length; i++) {\n\t\tif (unique.indexOf(out[i]) === -1) {\n\t\t\tunique.push(out[i]);\n\t\t}\n\t}\n\n\treturn unique;\n}\n","/** Returns the string as an encoded CSS identifier. */\nexport default function encodeCSS(value) {\n\tif (value === '') {\n\t\treturn '';\n\t}\n\n\tlet hex;\n\tlet result = '';\n\tfor (let i = 0; i < value.length; i++) {\n\t\thex = value.charCodeAt(i).toString(36);\n\t\tif (i === 0) {\n\t\t\tresult += hex;\n\t\t} else {\n\t\t\tresult += '-' + hex;\n\t\t}\n\t}\n\n\treturn 'csstools-has-' + result;\n}\n","/* global MutationObserver,requestAnimationFrame,cancelAnimationFrame,self,HTMLElement */\n\nimport '@mrhenry/core-web/modules/~element-qsa-has.js';\nimport extractEncodedSelectors from './encode/extract.js';\nimport encodeCSS from './encode/encode.js';\n\nfunction hasNativeSupport() {\n\ttry {\n\t\tif (!('CSS' in self) || !('supports' in self.CSS) || !self.CSS.supports('selector(:has(div))')) {\n\t\t\treturn false;\n\t\t}\n\n\t} catch (_) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n\nexport default function cssHasPseudo(document, options) {\n\t// OPTIONS\n\t{\n\t\tif (!options) {\n\t\t\toptions = {};\n\t\t}\n\n\t\toptions = {\n\t\t\thover: (!!options.hover) || false,\n\t\t\tdebug: (!!options.debug) || false,\n\t\t\tobservedAttributes: options.observedAttributes || [],\n\t\t\tforcePolyfill: (!!options.forcePolyfill) || false,\n\t\t};\n\n\t\toptions.mustPolyfill = options.forcePolyfill || !hasNativeSupport();\n\n\t\tif (!Array.isArray(options.observedAttributes)) {\n\t\t\toptions.observedAttributes = [];\n\t\t}\n\n\t\toptions.observedAttributes = options.observedAttributes.filter((x) => {\n\t\t\treturn (typeof x === 'string');\n\t\t});\n\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes\n\t\t// `data-*` and `style` were omitted\n\t\toptions.observedAttributes = options.observedAttributes.concat(['accept', 'accept-charset', 'accesskey', 'action', 'align', 'allow', 'alt', 'async', 'autocapitalize', 'autocomplete', 'autofocus', 'autoplay', 'buffered', 'capture', 'challenge', 'charset', 'checked', 'cite', 'class', 'code', 'codebase', 'cols', 'colspan', 'content', 'contenteditable', 'contextmenu', 'controls', 'coords', 'crossorigin', 'csp', 'data', 'datetime', 'decoding', 'default', 'defer', 'dir', 'dirname', 'disabled', 'download', 'draggable', 'enctype', 'enterkeyhint', 'for', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'headers', 'hidden', 'high', 'href', 'hreflang', 'http-equiv', 'icon', 'id', 'importance', 'integrity', 'intrinsicsize', 'inputmode', 'ismap', 'itemprop', 'keytype', 'kind', 'label', 'lang', 'language', 'list', 'loop', 'low', 'manifest', 'max', 'maxlength', 'minlength', 'media', 'method', 'min', 'multiple', 'muted', 'name', 'novalidate', 'open', 'optimum', 'pattern', 'ping', 'placeholder', 'poster', 'preload', 'radiogroup', 'readonly', 'referrerpolicy', 'rel', 'required', 'reversed', 'rows', 'rowspan', 'sandbox', 'scope', 'scoped', 'selected', 'shape', 'size', 'sizes', 'slot', 'span', 'spellcheck', 'src', 'srcdoc', 'srclang', 'srcset', 'start', 'step', 'summary', 'tabindex', 'target', 'title', 'translate', 'type', 'usemap', 'value', 'width', 'wrap']);\n\t}\n\n\tconst observedItems = [];\n\n\t// document.createAttribute() doesn't support `:` in the name. innerHTML does\n\tconst attributeElement = document.createElement('x');\n\n\t// walk all stylesheets to collect observed css rules\n\t[].forEach.call(document.styleSheets, walkStyleSheet);\n\tif (!options.mustPolyfill) {\n\t\t// Cleanup of rules will have happened in `walkStyleSheet`\n\t\t// Native support will take over from here\n\t\treturn;\n\t}\n\n\ttransformObservedItemsThrottled();\n\n\t// observe DOM modifications that affect selectors\n\tif ('MutationObserver' in self) {\n\t\tconst mutationObserver = new MutationObserver((mutationsList) => {\n\t\t\tmutationsList.forEach(mutation => {\n\t\t\t\t[].forEach.call(mutation.addedNodes || [], node => {\n\t\t\t\t\t// walk stylesheets to collect observed css rules\n\t\t\t\t\tif (node.nodeType === 1 && node.sheet) {\n\t\t\t\t\t\twalkStyleSheet(node.sheet);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// transform observed css rules\n\t\t\t\tcleanupObservedCssRules();\n\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t});\n\t\t});\n\n\t\tmutationObserver.observe(document, { childList: true, subtree: true, attributes: true, attributeFilter: options.observedAttributes });\n\t}\n\n\t// observe DOM events that affect pseudo-selectors\n\tdocument.addEventListener('focus', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('blur', transformObservedItemsThrottled, true);\n\tdocument.addEventListener('input', transformObservedItemsThrottled);\n\tdocument.addEventListener('change', transformObservedItemsThrottled, true);\n\n\tif (options.hover) {\n\t\tif ('onpointerenter' in document) {\n\t\t\tdocument.addEventListener('pointerenter', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('pointerleave', transformObservedItemsThrottled, true);\n\t\t} else {\n\t\t\tdocument.addEventListener('mouseover', transformObservedItemsThrottled, true);\n\t\t\tdocument.addEventListener('mouseout', transformObservedItemsThrottled, true);\n\t\t}\n\t}\n\n\t// observe Javascript setters that effect pseudo-selectors\n\tif ('defineProperty' in Object && 'getOwnPropertyDescriptor' in Object && 'hasOwnProperty' in Object) {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-inner-declarations\n\t\t\tfunction observeProperty(proto, property) {\n\t\t\t\t// eslint-disable-next-line no-prototype-builtins\n\t\t\t\tif (proto.hasOwnProperty(property)) {\n\t\t\t\t\tconst descriptor = Object.getOwnPropertyDescriptor(proto, property);\n\t\t\t\t\tif (descriptor && descriptor.configurable && 'set' in descriptor) {\n\t\t\t\t\t\tObject.defineProperty(proto, property, {\n\t\t\t\t\t\t\tconfigurable: descriptor.configurable,\n\t\t\t\t\t\t\tenumerable: descriptor.enumerable,\n\t\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\t\treturn descriptor.get.apply(this, arguments);\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tset: function () {\n\t\t\t\t\t\t\t\tdescriptor.set.apply(this, arguments);\n\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\ttransformObservedItemsThrottled();\n\t\t\t\t\t\t\t\t} catch (_) {\n\t\t\t\t\t\t\t\t\t// should never happen as there is an inner try/catch\n\t\t\t\t\t\t\t\t\t// but just in case\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ('HTMLElement' in self && HTMLElement.prototype) {\n\t\t\t\tobserveProperty(HTMLElement.prototype, 'disabled');\n\t\t\t}\n\n\t\t\t// Not all of these elements have all of these properties.\n\t\t\t// But the code above checks if they exist first.\n\t\t\t['checked', 'selected', 'readOnly', 'required'].forEach((property) => {\n\t\t\t\t[\n\t\t\t\t\t'HTMLButtonElement',\n\t\t\t\t\t'HTMLFieldSetElement',\n\t\t\t\t\t'HTMLInputElement',\n\t\t\t\t\t'HTMLMeterElement',\n\t\t\t\t\t'HTMLOptGroupElement',\n\t\t\t\t\t'HTMLOptionElement',\n\t\t\t\t\t'HTMLOutputElement',\n\t\t\t\t\t'HTMLProgressElement',\n\t\t\t\t\t'HTMLSelectElement',\n\t\t\t\t\t'HTMLTextAreaElement',\n\t\t\t\t].forEach((elementName) => {\n\t\t\t\t\tif (elementName in self && self[elementName].prototype) {\n\t\t\t\t\t\tobserveProperty(self[elementName].prototype, property);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n\n\tlet transformObservedItemsThrottledBusy = false;\n\tfunction transformObservedItemsThrottled() {\n\t\tif (transformObservedItemsThrottledBusy) {\n\t\t\tcancelAnimationFrame(transformObservedItemsThrottledBusy);\n\t\t}\n\n\t\ttransformObservedItemsThrottledBusy = requestAnimationFrame(() => {\n\t\t\ttransformObservedItems();\n\t\t});\n\t}\n\n\t// transform observed css rules\n\tfunction transformObservedItems() {\n\t\tobservedItems.forEach((item) => {\n\t\t\tconst nodes = [];\n\n\t\t\tlet matches = [];\n\t\t\ttry {\n\t\t\t\tmatches = document.querySelectorAll(item.selector);\n\t\t\t} catch (e) {\n\t\t\t\tif (options.debug) {\n\t\t\t\t\tconsole.error(e);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t[].forEach.call(matches, (element) => {\n\t\t\t\t// memorize the node\n\t\t\t\tnodes.push(element);\n\n\t\t\t\t// set an attribute with an irregular attribute name\n\t\t\t\t// document.createAttribute() doesn't support special characters\n\t\t\t\tattributeElement.innerHTML = '';\n\n\t\t\t\telement.setAttributeNode(attributeElement.children[0].attributes[0].cloneNode());\n\n\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t});\n\n\t\t\t// remove the encoded attribute from all nodes that no longer match them\n\t\t\titem.nodes.forEach(node => {\n\t\t\t\tif (nodes.indexOf(node) === -1) {\n\t\t\t\t\tnode.removeAttribute(item.attributeName);\n\n\t\t\t\t\t// trigger a style refresh in IE and Edge\n\t\t\t\t\tdocument.documentElement.style.zoom = 1; document.documentElement.style.zoom = null;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// update the\n\t\t\titem.nodes = nodes;\n\t\t});\n\t}\n\n\t// remove any observed cssrules that no longer apply\n\tfunction cleanupObservedCssRules() {\n\t\t[].push.apply(\n\t\t\tobservedItems,\n\t\t\tobservedItems.splice(0).filter((item) => {\n\t\t\t\treturn item.rule.parentStyleSheet &&\n\t\t\t\t\titem.rule.parentStyleSheet.ownerNode &&\n\t\t\t\t\tdocument.documentElement.contains(item.rule.parentStyleSheet.ownerNode);\n\t\t\t}),\n\t\t);\n\t}\n\n\t// walk a stylesheet to collect observed css rules\n\tfunction walkStyleSheet(styleSheet) {\n\t\ttry {\n\t\t\t// walk a css rule to collect observed css rules\n\t\t\t[].forEach.call(styleSheet.cssRules || [], (rule, index) => {\n\t\t\t\tif (rule.selectorText) {\n\t\t\t\t\trule.selectorText = rule.selectorText.replace(/\\.js-has-pseudo\\s/g, '');\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\t// decode the selector text in all browsers to:\n\t\t\t\t\t\tconst hasSelectors = extractEncodedSelectors(rule.selectorText.toString());\n\t\t\t\t\t\tif (hasSelectors.length === 0) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!options.mustPolyfill) {\n\t\t\t\t\t\t\tstyleSheet.deleteRule(index);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (let i = 0; i < hasSelectors.length; i++) {\n\t\t\t\t\t\t\tconst hasSelector = hasSelectors[i];\n\t\t\t\t\t\t\tobservedItems.push({\n\t\t\t\t\t\t\t\trule: rule,\n\t\t\t\t\t\t\t\tselector: hasSelector,\n\t\t\t\t\t\t\t\tattributeName: encodeCSS(hasSelector),\n\t\t\t\t\t\t\t\tnodes: [],\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tif (options.debug) {\n\t\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\twalkStyleSheet(rule);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (e) {\n\t\t\tif (options.debug) {\n\t\t\t\tconsole.error(e);\n\t\t\t}\n\t\t}\n\t}\n}\n","/* eslint-disable */\n(function (global) {\n\ttry {\n\t\t// test for has support\n\t\tglobal.document.querySelector(':has(*, :does-not-exist, > *)');\n\n\t\tif (\n\t\t\t!global.document.querySelector(':has(:scope *)') &&\n\t\t\tCSS.supports('selector(:has(div))')\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t} catch (_) { }\n\n\t// ELEMENT\n\t// polyfill Element#querySelector\n\tvar querySelectorWithHasElement = polyfill(global.Element.prototype.querySelector);\n\n\tglobal.Element.prototype.querySelector = function querySelector(selectors) {\n\t\treturn querySelectorWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#querySelectorAll\n\tvar querySelectorAllWithHasElement = polyfill(global.Element.prototype.querySelectorAll);\n\n\tglobal.Element.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\treturn querySelectorAllWithHasElement.apply(this, arguments);\n\t};\n\n\t// polyfill Element#matches\n\tif (global.Element.prototype.matches) {\n\t\tvar matchesWithHasElement = polyfill(global.Element.prototype.matches);\n\n\t\tglobal.Element.prototype.matches = function matches(selectors) {\n\t\t\treturn matchesWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// polyfill Element#closest\n\tif (global.Element.prototype.closest) {\n\t\tvar closestWithHasElement = polyfill(global.Element.prototype.closest);\n\n\t\tglobal.Element.prototype.closest = function closest(selectors) {\n\t\t\treturn closestWithHasElement.apply(this, arguments);\n\t\t};\n\t}\n\n\t// DOCUMENT\n\tif ('Document' in global && 'prototype' in global.Document) {\n\t\t// polyfill Document#querySelector\n\t\tvar querySelectorWithHasDocument = polyfill(global.Document.prototype.querySelector);\n\n\t\tglobal.Document.prototype.querySelector = function querySelector(selectors) {\n\t\t\treturn querySelectorWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#querySelectorAll\n\t\tvar querySelectorAllWithHasDocument = polyfill(global.Document.prototype.querySelectorAll);\n\n\t\tglobal.Document.prototype.querySelectorAll = function querySelectorAll(selectors) {\n\t\t\treturn querySelectorAllWithHasDocument.apply(this, arguments);\n\t\t};\n\n\t\t// polyfill Document#matches\n\t\tif (global.Document.prototype.matches) {\n\t\t\tvar matchesWithHasDocument = polyfill(global.Document.prototype.matches);\n\n\t\t\tglobal.Document.prototype.matches = function matches(selectors) {\n\t\t\t\treturn matchesWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\n\t\t// polyfill Document#closest\n\t\tif (global.Document.prototype.closest) {\n\t\t\tvar closestWithHasDocument = polyfill(global.Document.prototype.closest);\n\n\t\t\tglobal.Document.prototype.closest = function closest(selectors) {\n\t\t\t\treturn closestWithHasDocument.apply(this, arguments);\n\t\t\t};\n\t\t}\n\t}\n\n\tfunction pseudoClassHasInnerQuery(query) {\n\t\tvar current = '';\n\t\tvar start = 0;\n\t\tvar depth = 0;\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar inHas = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':has(' && !inHas) {\n\t\t\t\tinHas = true;\n\t\t\t\tstart = i;\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tif (!inHas) {\n\t\t\t\t\t\tcurrent = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tdepth++;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase ')':\n\t\t\t\t\tif (inHas) {\n\t\t\t\t\t\tif (depth === 0) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tinnerQuery: current,\n\t\t\t\t\t\t\t\tstart: start,\n\t\t\t\t\t\t\t\tend: i-1\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdepth--;\n\t\t\t\t\t}\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction replaceScopeWithAttr(query, attr) {\n\t\tvar parts = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar bracketed = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (quoted) {\n\t\t\t\tif (char === quotedMark) {\n\t\t\t\t\tquoted = false;\n\t\t\t\t}\n\n\t\t\t\tcurrent += char;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (current.toLowerCase() === ':scope' && !bracketed && (/^[\\[\\.\\:\\\\\"\\s|+>~#&,)]/.test(char || ''))) {\n\t\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\t\tparts.push('[' + attr + ']');\n\t\t\t\tcurrent = '';\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ':':\n\t\t\t\t\tparts.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '[':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tbracketed++;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase \"]\":\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tif (bracketed > 0) {\n\t\t\t\t\t\tbracketed--\n\t\t\t\t\t}\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tif (current.toLowerCase() === ':scope') {\n\t\t\tparts.push(current.slice(0, current.length - 6));\n\t\t\tparts.push('[' + attr + ']');\n\t\t\tcurrent = '';\n\t\t}\n\n\t\tif (parts.length === 0) {\n\t\t\treturn query;\n\t\t}\n\n\t\treturn parts.join('') + current;\n\t}\n\n\tfunction charIsNestedMarkMirror(char, mark) {\n\t\tif (mark === '(' && char === ')') {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (mark === '[' && char === ']') {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tfunction splitSelector(query) {\n\t\tvar selectors = [];\n\t\tvar current = '';\n\n\t\tvar escaped = false;\n\n\t\tvar quoted = false;\n\t\tvar quotedMark = false;\n\n\t\tvar nestedMark = false;\n\t\tvar nestedDepth = 0;\n\n\t\tfor (var i = 0; i < query.length; i++) {\n\t\t\tvar char = query[i];\n\n\t\t\tif (escaped) {\n\t\t\t\tcurrent += char;\n\t\t\t\tescaped = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tswitch (char) {\n\t\t\t\tcase ',':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (nestedDepth > 0) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tselectors.push(current);\n\t\t\t\t\tcurrent = '';\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\\\\':\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tescaped = true;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '\"':\n\t\t\t\tcase \"'\":\n\t\t\t\t\tif (quoted && char === quotedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tquoted = false;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tquoted = true;\n\t\t\t\t\tquotedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tcase '(':\n\t\t\t\tcase ')':\n\t\t\t\tcase '[':\n\t\t\t\tcase ']':\n\t\t\t\t\tif (quoted) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (charIsNestedMarkMirror(char, nestedMark)) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth--;\n\n\t\t\t\t\t\tif (nestedDepth === 0) {\n\t\t\t\t\t\t\tnestedMark = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (char === nestedMark) {\n\t\t\t\t\t\tcurrent += char;\n\t\t\t\t\t\tnestedDepth++;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tnestedDepth++;\n\t\t\t\t\tnestedMark = char;\n\t\t\t\t\tcontinue;\n\n\t\t\t\tdefault:\n\t\t\t\t\tcurrent += char;\n\t\t\t\t\tcontinue;\n\n\t\t\t}\n\t\t}\n\n\t\tselectors.push(current);\n\n\t\treturn selectors;\n\t}\n\n\tfunction replaceAllWithTempAttr(query, nested, callback) {\n\t\tvar inner = pseudoClassHasInnerQuery(query);\n\t\tif (!inner) {\n\t\t\treturn query;\n\t\t}\n\n\t\tif (nested) {\n\t\t\treturn false;\n\t\t}\n\n\t\tvar innerQuery = inner.innerQuery;\n\t\tvar attr = 'q-has' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\tvar innerReplacement = '[' + attr + ']';\n\n\t\tvar x = query;\n\n\t\tif (inner.innerQuery.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar innerParts = splitSelector(inner.innerQuery);\n\t\t\tvar newInnerParts = [];\n\t\t\tfor (var i = 0; i < innerParts.length; i++) {\n\t\t\t\tvar innerPart = innerParts[i];\n\n\t\t\t\t// Nested has is not supported.\n\t\t\t\t// If a recursive/nested call returns \"false\" we throw\n\t\t\t\tvar innerPartReplaced = replaceAllWithTempAttr(innerPart, true, function () { });\n\t\t\t\tif (!innerPartReplaced) {\n\t\t\t\t\tthrow new Error(\"Nested :has() is not supported\")\n\t\t\t\t} else {\n\t\t\t\t\tnewInnerParts.push(innerPart);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\t\treturn _prefix + newInnerParts.join(', ') + _suffix;\n\t\t}\n\n\t\tvar _prefix = x.substring(0, inner.start - 5); // ':has('.length === 5\n\t\tvar _suffix = x.substring(inner.end + 2); // ')'.length === 1\n\n\t\tx = _prefix + innerReplacement + _suffix;\n\n\t\tcallback(innerQuery, attr);\n\t\tif (x.toLowerCase().indexOf(':has(') > -1) {\n\t\t\tvar y = replaceAllWithTempAttr(x, false, callback);\n\t\t\tif (y) {\n\t\t\t\treturn y;\n\t\t\t}\n\t\t}\n\n\t\treturn x;\n\t}\n\n\tfunction walkNode(rootNode, callback) {\n\t\tif (('setAttribute' in (rootNode)) && ('querySelector' in (rootNode))) {\n\t\t\tcallback(rootNode);\n\t\t}\n\n\t\tif (rootNode.hasChildNodes()) {\n\t\t\tvar nodes = rootNode.childNodes;\n\t\t\tfor (var i = 0; i < nodes.length; ++i) {\n\t\t\t\twalkNode(nodes[i], callback);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction polyfill(qsa) {\n\t\treturn function (selectors) {\n\t\t\tif (!selectors) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar selectorsString = String(selectors);\n\t\t\tif (!selectorsString || (selectorsString.toLowerCase().indexOf(':has(') === -1) || !pseudoClassHasInnerQuery(selectorsString)) {\n\t\t\t\treturn qsa.apply(this, arguments);\n\t\t\t}\n\n\t\t\tvar rootNode;\n\t\t\tif ('getRootNode' in this) {\n\t\t\t\trootNode = this.getRootNode();\n\t\t\t} else {\n\t\t\t\tvar r = this;\n\t\t\t\twhile (r) {\n\t\t\t\t\trootNode = r;\n\t\t\t\t\tr = r.parentNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar _focus = this;\n\t\t\tif (_focus === global.document) {\n\t\t\t\t_focus = global.document.documentElement;\n\t\t\t}\n\n\t\t\tvar scopeAttr = 'q-has-scope' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t_focus.setAttribute(scopeAttr, '');\n\n\t\t\ttry {\n\t\t\t\tselectorsString = replaceScopeWithAttr(selectorsString, scopeAttr);\n\n\t\t\t\tvar attrs = [scopeAttr];\n\t\t\t\tvar newQuery = replaceAllWithTempAttr(selectorsString, false, function (inner, attr) {\n\t\t\t\t\tattrs.push(attr);\n\n\t\t\t\t\tvar selectorParts = splitSelector(inner);\n\t\t\t\t\tfor (var x = 0; x < selectorParts.length; x++) {\n\t\t\t\t\t\tvar selectorPart = selectorParts[x].trim();\n\t\t\t\t\t\tvar absoluteSelectorPart = selectorPart;\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tselectorPart[0] === '>' ||\n\t\t\t\t\t\t\tselectorPart[0] === '+' ||\n\t\t\t\t\t\t\tselectorPart[0] === '~'\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tabsoluteSelectorPart = selectorPart.slice(1).trim();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tabsoluteSelectorPart = ':scope ' + selectorPart;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\twalkNode(rootNode, function (node) {\n\t\t\t\t\t\t\tif (!(node.querySelector(absoluteSelectorPart))) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitch (selectorPart[0]) {\n\t\t\t\t\t\t\t\tcase '~':\n\t\t\t\t\t\t\t\tcase '+':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar siblings = node.childNodes;\n\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < siblings.length; i++) {\n\t\t\t\t\t\t\t\t\t\t\tvar sibling = siblings[i];\n\t\t\t\t\t\t\t\t\t\t\tif (!('setAttribute' in sibling)) {\n\t\t\t\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope [' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\t\tsibling.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tsibling.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase '>':\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tvar idAttr = 'q-has-id' + (Math.floor(Math.random() * 9000000) + 1000000);\n\t\t\t\t\t\t\t\t\t\tnode.setAttribute(idAttr, '');\n\n\t\t\t\t\t\t\t\t\t\tif (node.querySelector(':scope[' + idAttr + ']' + ' ' + selectorPart)) {\n\t\t\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnode.removeAttribute(idAttr);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tnode.setAttribute(attr, '');\n\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\targuments[0] = newQuery;\n\n\t\t\t\t// results of the qsa\n\t\t\t\tvar elementOrNodeList = qsa.apply(this, arguments);\n\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// return the results of the qsa\n\t\t\t\treturn elementOrNodeList;\n\t\t\t} catch (err) {\n\t\t\t\t_focus.removeAttribute(scopeAttr);\n\n\t\t\t\tif (attrs.length > 0) {\n\t\t\t\t\t// remove the fallback attribute\n\t\t\t\t\tvar attrsForQuery = [];\n\t\t\t\t\tfor (var j = 0; j < attrs.length; j++) {\n\t\t\t\t\t\tattrsForQuery.push('[' + attrs[j] + ']');\n\t\t\t\t\t}\n\n\t\t\t\t\tvar elements = global.document.querySelectorAll(attrsForQuery.join(','));\n\t\t\t\t\tfor (var k = 0; k < elements.length; k++) {\n\t\t\t\t\t\tvar element = elements[k];\n\t\t\t\t\t\tfor (var l = 0; l < attrs.length; l++) {\n\t\t\t\t\t\t\telement.removeAttribute(attrs[l]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar errorMessage = '';\n\t\t\t\ttry {\n\t\t\t\t\tqsa.apply(this, [':core-web-does-not-exist']);\n\t\t\t\t} catch (dummyError) {\n\t\t\t\t\terrorMessage = dummyError.message;\n\t\t\t\t\tif (errorMessage) {\n\t\t\t\t\t\terrorMessage = errorMessage.replace(':core-web-does-not-exist', selectorsString);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (!errorMessage) {\n\t\t\t\t\terrorMessage = \"Failed to execute 'querySelector' on 'Document': '\" + selectorsString + \"' is not a valid selector.\";\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tthrow new DOMException(errorMessage);\n\t\t\t\t} catch (_) {\n\t\t\t\t\tthrow new Error(errorMessage);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}\n})(self);\n"],"names":["decodeCSS","value","slice","values","split","result","i","length","String","fromCharCode","parseInt","extractEncodedSelectors","candidate","quotedMark","out","depth","quoted","containsUnescapedUnquotedHasAtDepth1","char","decoded","push","unique","indexOf","encodeCSS","hex","charCodeAt","toString","hasNativeSupport","self","CSS","supports","_","cssHasPseudo","document","options","hover","debug","observedAttributes","forcePolyfill","mustPolyfill","Array","isArray","filter","x","concat","observedItems","attributeElement","createElement","forEach","call","styleSheets","walkStyleSheet","transformObservedItemsThrottled","MutationObserver","mutationsList","mutation","addedNodes","node","nodeType","sheet","apply","splice","item","rule","parentStyleSheet","ownerNode","documentElement","contains","observe","childList","subtree","attributes","attributeFilter","addEventListener","Object","observeProperty","proto","property","hasOwnProperty","descriptor","getOwnPropertyDescriptor","configurable","defineProperty","enumerable","get","this","arguments","set","HTMLElement","prototype","elementName","e","console","error","transformObservedItemsThrottledBusy","cancelAnimationFrame","requestAnimationFrame","nodes","matches","querySelectorAll","selector","element","innerHTML","attributeName","setAttributeNode","children","cloneNode","style","zoom","removeAttribute","styleSheet","cssRules","index","selectorText","replace","hasSelectors","deleteRule","hasSelector","global","querySelector","querySelectorWithHasElement","polyfill","Element","selectors","querySelectorAllWithHasElement","matchesWithHasElement","closest","closestWithHasElement","Document","querySelectorWithHasDocument","querySelectorAllWithHasDocument","matchesWithHasDocument","closestWithHasDocument","pseudoClassHasInnerQuery","query","current","start","escaped","inHas","toLowerCase","innerQuery","end","replaceScopeWithAttr","attr","parts","bracketed","test","join","splitSelector","mark","nestedMark","nestedDepth","replaceAllWithTempAttr","nested","callback","inner","Math","floor","random","innerReplacement","innerParts","newInnerParts","innerPart","Error","_prefix","substring","_suffix","y","walkNode","rootNode","hasChildNodes","childNodes","qsa","selectorsString","getRootNode","r","parentNode","_focus","scopeAttr","setAttribute","attrs","newQuery","selectorParts","selectorPart","trim","absoluteSelectorPart","siblings","sibling","idAttr","elementOrNodeList","attrsForQuery","j","elements","k","l","err","errorMessage","dummyError","message","DOMException"],"mappings":"AACe,SAASA,UAAUC,GACjC,GAA2B,kBAAvBA,EAAMC,MAAM,EAAG,IAClB,MAAO,GAOR,IAHA,IAAIC,GADJF,EAAQA,EAAMC,MAAM,KACDE,MAAM,KAErBC,EAAS,GACJC,EAAI,EAAGA,EAAIH,EAAOI,OAAQD,IAClCD,GAAUG,OAAOC,aAAaC,SAASP,EAAOG,GAAI,KAGnD,OAAOD,CACR,CCZe,SAASM,wBAAwBV,GAY/C,IAXA,IAGIW,EAGAC,EANAC,EAAM,GAENC,EAAQ,EAGRC,GAAS,EAGTC,GAAuC,EAGlCX,EAAI,EAAGA,EAAIL,EAAMM,OAAQD,IAAK,CACtC,IAAMY,EAAOjB,EAAMK,GAEnB,OAAQY,GACP,IAAK,IACJ,GAAIF,EAAQ,CACXJ,GAAaM,EACb,QACD,CAEc,IAAVH,EACHH,EAAY,GAEZA,GAAaM,EAGdH,IACA,SACD,IAAK,IACJ,GAAIC,EAAQ,CACXJ,GAAaM,EACb,QACD,CAIC,GAAc,MADdH,EACiB,CAChB,IAAMI,EAAUnB,UAAUY,GACtBK,GACHH,EAAIM,KAAKD,EAEX,MACCP,GAAaM,EAIf,SACD,IAAK,KACJN,GAAaX,EAAMK,GACnBM,GAAaX,EAAMK,EAAE,GACrBA,IACA,SAED,IAAK,IACL,IAAK,IACJ,GAAIU,GAAUE,IAASL,EAAY,CAClCG,GAAS,EACT,QACA,CAAM,GAAIA,EAAQ,CAClBJ,GAAaM,EACb,QACD,CAEAF,GAAS,EACTH,EAAaK,EACb,SAED,QACmB,KAAdN,GAA8B,IAAVG,GAA2C,kBAA3Bd,EAAMC,MAAMI,EAAGA,EAAI,MAC1DW,GAAuC,GAGxCL,GAAaM,EACb,SAEH,CAGA,IADA,IAAMG,EAAS,GACNf,EAAI,EAAGA,EAAIQ,EAAIP,OAAQD,KACC,IAA5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AAgBqE,GAEnBE,EAAM7K,OAAS,EAAG,CAGrB,IADA,IAAIuL,EAAgB,GACXC,EAAI,EAAGA,EAAIX,EAAM7K,OAAQwL,IACjCD,EAAc1K,KAAK,IAAMgK,EAAMW,GAAK,KAIrC,IADA,IAAIC,EAAW1E,EAAOrF,SAASkE,iBAAiB2F,EAAc3C,KAAK,MAC1D8C,EAAI,EAAGA,EAAID,EAASzL,OAAQ0L,IAEpC,IADA,IAAI5F,EAAU2F,EAASC,GACdC,EAAI,EAAGA,EAAId,EAAM7K,OAAQ2L,IACjC7F,EAAQQ,gBAAgBuE,EAAMc,GAGjC,CAGA,OAAOL,CACP,CAAC,MAAOM,GAGR,GAFAlB,EAAOpE,gBAAgBqE,GAEnBE,EAAM7K,OAAS,EAAG,CAGrB,IADIuL,EAAgB,GACXC,EAAI,EAAGA,EAAIX,EAAM7K,OAAQwL,IACjCD,EAAc1K,KAAK,IAAMgK,EAAMW,GAAK,KAIrC,IADIC,EAAW1E,EAAOrF,SAASkE,iBAAiB2F,EAAc3C,KAAK,MAC1D8C,EAAI,EAAGA,EAAID,EAASzL,OAAQ0L,IAEpC,IADI5F,EAAU2F,EAASC,GACdC,EAAI,EAAGA,EAAId,EAAM7K,OAAQ2L,IACjC7F,EAAQQ,gBAAgBuE,EAAMc,GAGjC,CAEA,IAAIE,EAAe,GACnB,IACCxB,EAAIhH,MAAMyB,KAAM,CAAC,4BACjB,CAAC,MAAOgH,GACRD,EAAeC,EAAWC,QACtBF,IACHA,EAAeA,EAAalF,QAAQ,2BAA4B2D,GAElE,CAEKuB,IACJA,EAAe,qDAAuDvB,EAAkB,8BAGzF,IACC,MAAM,IAAI0B,aAAaH,EACvB,CAAC,MAAOrK,GACR,MAAM,IAAIoI,MAAMiC,EACjB,CACD,EAEF,CACA,CAvmBD,CAumBGxK","x_google_ignoreList":[4]} \ No newline at end of file diff --git a/plugins/css-has-pseudo/dist/index.d.cts b/plugins/css-has-pseudo/dist/index.d.cts new file mode 100644 index 000000000..8df1a1261 --- /dev/null +++ b/plugins/css-has-pseudo/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +/** css-has-pseudo plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Change the selector that is used to adjust specificity. default: "does-not-exist" */ + specificityMatchingName?: string; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/css-has-pseudo/dist/index.d.mts b/plugins/css-has-pseudo/dist/index.d.mts new file mode 100644 index 000000000..992d85a80 --- /dev/null +++ b/plugins/css-has-pseudo/dist/index.d.mts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** css-has-pseudo plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Change the selector that is used to adjust specificity. default: "does-not-exist" */ + specificityMatchingName?: string; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/css-has-pseudo/dist/index.d.ts b/plugins/css-has-pseudo/dist/index.d.ts index 2f29343ac..8df1a1261 100644 --- a/plugins/css-has-pseudo/dist/index.d.ts +++ b/plugins/css-has-pseudo/dist/index.d.ts @@ -1,10 +1,11 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** css-has-pseudo plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** Change the selector that is used to adjust specificity. default: "does-not-exist" */ specificityMatchingName?: string; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/css-has-pseudo/dist/is-guarded-by-at-supports.d.ts b/plugins/css-has-pseudo/dist/is-guarded-by-at-supports.d.ts deleted file mode 100644 index 6cc9d4d69..000000000 --- a/plugins/css-has-pseudo/dist/is-guarded-by-at-supports.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function isGuardedByAtSupportsFromAtRuleParams(atSupportsParams: string): boolean; diff --git a/plugins/css-has-pseudo/package.json b/plugins/css-has-pseudo/package.json index 94123552b..db6324181 100644 --- a/plugins/css-has-pseudo/package.json +++ b/plugins/css-has-pseudo/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./browser": { "import": "./dist/browser.mjs", diff --git a/plugins/css-has-pseudo/src/browser.js b/plugins/css-has-pseudo/src/browser.js index 996456f13..0c29b5b9c 100644 --- a/plugins/css-has-pseudo/src/browser.js +++ b/plugins/css-has-pseudo/src/browser.js @@ -1,8 +1,8 @@ /* global MutationObserver,requestAnimationFrame,cancelAnimationFrame,self,HTMLElement */ import '@mrhenry/core-web/modules/~element-qsa-has.js'; -import extractEncodedSelectors from './encode/extract.mjs'; -import encodeCSS from './encode/encode.mjs'; +import extractEncodedSelectors from './encode/extract.js'; +import encodeCSS from './encode/encode.js'; function hasNativeSupport() { try { diff --git a/plugins/css-has-pseudo/src/encode/decode.mjs b/plugins/css-has-pseudo/src/encode/decode.js similarity index 99% rename from plugins/css-has-pseudo/src/encode/decode.mjs rename to plugins/css-has-pseudo/src/encode/decode.js index a24302530..ab738adb3 100644 --- a/plugins/css-has-pseudo/src/encode/decode.mjs +++ b/plugins/css-has-pseudo/src/encode/decode.js @@ -1,4 +1,3 @@ - /** Decodes an identifier back into a CSS selector */ export default function decodeCSS(value) { if (value.slice(0, 13) !== 'csstools-has-') { diff --git a/plugins/css-has-pseudo/src/encode/encode.d.mts b/plugins/css-has-pseudo/src/encode/encode.d.ts similarity index 100% rename from plugins/css-has-pseudo/src/encode/encode.d.mts rename to plugins/css-has-pseudo/src/encode/encode.d.ts diff --git a/plugins/css-has-pseudo/src/encode/encode.mjs b/plugins/css-has-pseudo/src/encode/encode.js similarity index 99% rename from plugins/css-has-pseudo/src/encode/encode.mjs rename to plugins/css-has-pseudo/src/encode/encode.js index 36d0a4ae8..f804af17d 100644 --- a/plugins/css-has-pseudo/src/encode/encode.mjs +++ b/plugins/css-has-pseudo/src/encode/encode.js @@ -1,4 +1,3 @@ - /** Returns the string as an encoded CSS identifier. */ export default function encodeCSS(value) { if (value === '') { diff --git a/plugins/css-has-pseudo/src/encode/extract.mjs b/plugins/css-has-pseudo/src/encode/extract.js similarity index 97% rename from plugins/css-has-pseudo/src/encode/extract.mjs rename to plugins/css-has-pseudo/src/encode/extract.js index 366ab150c..0cd4ee8cc 100644 --- a/plugins/css-has-pseudo/src/encode/extract.mjs +++ b/plugins/css-has-pseudo/src/encode/extract.js @@ -1,4 +1,4 @@ -import decodeCSS from './decode.mjs'; +import decodeCSS from './decode.js'; /** Extract encoded selectors out of attribute selectors */ export default function extractEncodedSelectors(value) { diff --git a/plugins/css-has-pseudo/src/encode/test.mjs b/plugins/css-has-pseudo/src/encode/test.mjs index 7ff593799..9c1750015 100644 --- a/plugins/css-has-pseudo/src/encode/test.mjs +++ b/plugins/css-has-pseudo/src/encode/test.mjs @@ -1,7 +1,7 @@ import { strict as assert } from 'assert'; -import encodeCSS from './encode.mjs'; -import decodeCSS from './decode.mjs'; -import extractEncodedSelectors from './extract.mjs'; +import encodeCSS from './encode.js'; +import decodeCSS from './decode.js'; +import extractEncodedSelectors from './extract.js'; function testEncoderDecoder(decoded, encoded) { assert.strictEqual(encodeCSS(decoded), encoded); diff --git a/plugins/css-has-pseudo/src/index.ts b/plugins/css-has-pseudo/src/index.ts index 0f866cfd7..ca8988017 100644 --- a/plugins/css-has-pseudo/src/index.ts +++ b/plugins/css-has-pseudo/src/index.ts @@ -1,7 +1,7 @@ -import encodeCSS from './encode/encode.mjs'; +import encodeCSS from './encode/encode.js'; import parser from 'postcss-selector-parser'; import type { AtRule, ChildNode, Container, Document, PluginCreator, Rule } from 'postcss'; -import { isGuardedByAtSupportsFromAtRuleParams } from './is-guarded-by-at-supports.js'; +import { isGuardedByAtSupportsFromAtRuleParams } from './is-guarded-by-at-supports'; import { selectorSpecificity } from '@csstools/selector-specificity'; /** css-has-pseudo plugin options */ @@ -136,11 +136,11 @@ const creator: PluginCreator = (opts?: pluginOptions) => { if (x.type === 'selector') { x.nodes.forEach((y) => { delete y.parent; - hasContainingSelector.append(y); + hasContainingSelector.append(y as unknown as parser.Selector /* TODO : delete the "as" clause */); }); } else { delete x.parent; - hasContainingSelector.append(x); + hasContainingSelector.append(x as unknown as parser.Selector /* TODO : delete the "as" clause */); } }); } @@ -165,7 +165,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { const replacementNodes = encodedSelectorAST.nodes[0].nodes; for (let i = replacementNodes.length - 1; i >= 0; i--) { - container.prepend(replacementNodes[i]); + container.prepend(replacementNodes[i] as unknown as parser.Selector /* TODO : delete the "as" clause */); } }); diff --git a/plugins/css-has-pseudo/tsconfig.json b/plugins/css-has-pseudo/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/css-has-pseudo/tsconfig.json +++ b/plugins/css-has-pseudo/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/css-prefers-color-scheme/dist/index.d.cts b/plugins/css-prefers-color-scheme/dist/index.d.cts new file mode 100644 index 000000000..18728f50f --- /dev/null +++ b/plugins/css-prefers-color-scheme/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-prefers-color-scheme plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/css-prefers-color-scheme/dist/index.d.mts b/plugins/css-prefers-color-scheme/dist/index.d.mts new file mode 100644 index 000000000..36568314d --- /dev/null +++ b/plugins/css-prefers-color-scheme/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-prefers-color-scheme plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/css-prefers-color-scheme/dist/index.d.ts b/plugins/css-prefers-color-scheme/dist/index.d.ts index e7060b756..18728f50f 100644 --- a/plugins/css-prefers-color-scheme/dist/index.d.ts +++ b/plugins/css-prefers-color-scheme/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-prefers-color-scheme plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/css-prefers-color-scheme/package.json b/plugins/css-prefers-color-scheme/package.json index d8bb6deed..8840f19d3 100644 --- a/plugins/css-prefers-color-scheme/package.json +++ b/plugins/css-prefers-color-scheme/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./browser": { "import": "./dist/browser.mjs", diff --git a/plugins/css-prefers-color-scheme/tsconfig.json b/plugins/css-prefers-color-scheme/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/css-prefers-color-scheme/tsconfig.json +++ b/plugins/css-prefers-color-scheme/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-attribute-case-insensitive/dist/index.d.cts b/plugins/postcss-attribute-case-insensitive/dist/index.d.cts new file mode 100644 index 000000000..d30561e6b --- /dev/null +++ b/plugins/postcss-attribute-case-insensitive/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-prefers-color-scheme plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-attribute-case-insensitive/dist/index.d.mts b/plugins/postcss-attribute-case-insensitive/dist/index.d.mts new file mode 100644 index 000000000..193f1e5fa --- /dev/null +++ b/plugins/postcss-attribute-case-insensitive/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-prefers-color-scheme plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-attribute-case-insensitive/dist/index.d.ts b/plugins/postcss-attribute-case-insensitive/dist/index.d.ts index c3aecebb7..d30561e6b 100644 --- a/plugins/postcss-attribute-case-insensitive/dist/index.d.ts +++ b/plugins/postcss-attribute-case-insensitive/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-prefers-color-scheme plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-attribute-case-insensitive/package.json b/plugins/postcss-attribute-case-insensitive/package.json index 30dd578a2..606820def 100644 --- a/plugins/postcss-attribute-case-insensitive/package.json +++ b/plugins/postcss-attribute-case-insensitive/package.json @@ -30,15 +30,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-attribute-case-insensitive/src/index.ts b/plugins/postcss-attribute-case-insensitive/src/index.ts index 73794546a..3399c204e 100644 --- a/plugins/postcss-attribute-case-insensitive/src/index.ts +++ b/plugins/postcss-attribute-case-insensitive/src/index.ts @@ -34,7 +34,7 @@ function createSensitiveAttributes(attribute: selectorParser.Attribute) { before: attribute.spaces.before, }, insensitive: false, - }); + }) as selectorParser.Attribute /* TODO : delete the "as" clause */; newAttribute.setValue(x); @@ -48,7 +48,7 @@ function createNewSelectors(selector: selectorParser.Selector) { selector.each((node) => { if (!nodeIsInsensitiveAttribute(node)) { newSelectors.forEach(newSelector => { - newSelector.append(node.clone()); + newSelector.append(node.clone() as unknown as selectorParser.Selector /* TODO : delete the "as" clause */); }); return; } @@ -58,8 +58,8 @@ function createNewSelectors(selector: selectorParser.Selector) { sensitiveAttributes.forEach(newNode => { newSelectors.forEach(newSelector => { - const newSelectorWithNewNode = newSelector.clone({}); - newSelectorWithNewNode.append(newNode); + const newSelectorWithNewNode = newSelector.clone({}) as selectorParser.Selector /* TODO : delete the "as" clause */; + newSelectorWithNewNode.append(newNode as unknown as selectorParser.Selector /* TODO : delete the "as" clause */); newSelectorsWithSensitiveAttributes.push(newSelectorWithNewNode); }); }); diff --git a/plugins/postcss-attribute-case-insensitive/tsconfig.json b/plugins/postcss-attribute-case-insensitive/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-attribute-case-insensitive/tsconfig.json +++ b/plugins/postcss-attribute-case-insensitive/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-base-plugin/dist/index.d.cts b/plugins/postcss-base-plugin/dist/index.d.cts new file mode 100644 index 000000000..6493b4d54 --- /dev/null +++ b/plugins/postcss-base-plugin/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +/** postcss-base-plugin plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Replacement color */ + color?: string; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-base-plugin/dist/index.d.mts b/plugins/postcss-base-plugin/dist/index.d.mts new file mode 100644 index 000000000..9f984efe9 --- /dev/null +++ b/plugins/postcss-base-plugin/dist/index.d.mts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** postcss-base-plugin plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Replacement color */ + color?: string; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-base-plugin/dist/index.d.ts b/plugins/postcss-base-plugin/dist/index.d.ts index e76bf4523..6493b4d54 100644 --- a/plugins/postcss-base-plugin/dist/index.d.ts +++ b/plugins/postcss-base-plugin/dist/index.d.ts @@ -1,10 +1,11 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-base-plugin plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Replacement color */ color?: string; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-base-plugin/package.json b/plugins/postcss-base-plugin/package.json index ab161175b..7924bc6a2 100644 --- a/plugins/postcss-base-plugin/package.json +++ b/plugins/postcss-base-plugin/package.json @@ -28,15 +28,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ @@ -52,6 +57,7 @@ "@csstools/postcss-tape": "*" }, "scripts": { + "attw": "attw --pack .", "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", diff --git a/plugins/postcss-base-plugin/tsconfig.json b/plugins/postcss-base-plugin/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-base-plugin/tsconfig.json +++ b/plugins/postcss-base-plugin/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts b/plugins/postcss-cascade-layers/dist/adjust-selector-specificity.d.ts deleted file mode 100644 index af7b5e19e..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/clean-blocks.d.ts b/plugins/postcss-cascade-layers/dist/clean-blocks.d.ts deleted file mode 100644 index b9f2a5647..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/constants.d.ts b/plugins/postcss-cascade-layers/dist/constants.d.ts deleted file mode 100644 index a2393c35e..000000000 --- a/plugins/postcss-cascade-layers/dist/constants.d.ts +++ /dev/null @@ -1,12 +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[]; -export declare const IS_REVERT_LAYER: RegExp; -export declare const IS_IMPORT: RegExp; -export declare const IS_LAYER: RegExp; -export declare const HAS_LAYER: RegExp; diff --git a/plugins/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts b/plugins/postcss-cascade-layers/dist/desugar-and-parse-layer-names.d.ts deleted file mode 100644 index d44fd4545..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/desugar-nested-layers.d.ts b/plugins/postcss-cascade-layers/dist/desugar-nested-layers.d.ts deleted file mode 100644 index e15d3bfba..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts b/plugins/postcss-cascade-layers/dist/get-conditional-atrule-ancestor.d.ts deleted file mode 100644 index 25a6756ac..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts b/plugins/postcss-cascade-layers/dist/get-layer-atrule-ancestor.d.ts deleted file mode 100644 index b59be340a..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/options.d.ts b/plugins/postcss-cascade-layers/dist/index.d.cts similarity index 50% rename from plugins/postcss-cascade-layers/dist/options.d.ts rename to plugins/postcss-cascade-layers/dist/index.d.cts index e3a1943d5..8b4e4a755 100644 --- a/plugins/postcss-cascade-layers/dist/options.d.ts +++ b/plugins/postcss-cascade-layers/dist/index.d.cts @@ -1,9 +1,13 @@ +import { PluginCreator } from 'postcss'; /** postcss-cascasde-layers plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Emit a warning when the "revert" keyword is found in your CSS. default: "warn" */ - onRevertLayerKeyword?: 'warn' | false; + onRevertLayerKeyword?: "warn" | false; /** Emit a warning when conditional rules could change the layer order. default: "warn" */ - onConditionalRulesChangingLayerOrder?: 'warn' | false; + onConditionalRulesChangingLayerOrder?: "warn" | false; /** Emit a warning when "layer" is used in "@import". default: "warn" */ - onImportLayerRule?: 'warn' | false; + onImportLayerRule?: "warn" | false; }; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-cascade-layers/dist/index.d.mts b/plugins/postcss-cascade-layers/dist/index.d.mts new file mode 100644 index 000000000..1c5a8ce1f --- /dev/null +++ b/plugins/postcss-cascade-layers/dist/index.d.mts @@ -0,0 +1,13 @@ +import { PluginCreator } from 'postcss'; +/** postcss-cascasde-layers plugin options */ +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; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export { creator as default }; diff --git a/plugins/postcss-cascade-layers/dist/index.d.ts b/plugins/postcss-cascade-layers/dist/index.d.ts index 9f366fbb9..8b4e4a755 100644 --- a/plugins/postcss-cascade-layers/dist/index.d.ts +++ b/plugins/postcss-cascade-layers/dist/index.d.ts @@ -1,5 +1,13 @@ -import type { PluginCreator } from 'postcss'; -import type { pluginOptions } from './options'; -export type { pluginOptions } from './options'; +import { PluginCreator } from 'postcss'; +/** postcss-cascasde-layers plugin options */ +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; +}; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts b/plugins/postcss-cascade-layers/dist/is-processable-layer-rule.d.ts deleted file mode 100644 index 115b5dbad..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/model.d.ts b/plugins/postcss-cascade-layers/dist/model.d.ts deleted file mode 100644 index 38a268e45..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/record-layer-order.d.ts b/plugins/postcss-cascade-layers/dist/record-layer-order.d.ts deleted file mode 100644 index 05d6ac7df..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/some-in-tree.d.ts b/plugins/postcss-cascade-layers/dist/some-in-tree.d.ts deleted file mode 100644 index 8c416c593..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/sort-root-nodes.d.ts b/plugins/postcss-cascade-layers/dist/sort-root-nodes.d.ts deleted file mode 100644 index 8eb479edb..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/dist/split-important-styles.d.ts b/plugins/postcss-cascade-layers/dist/split-important-styles.d.ts deleted file mode 100644 index 270c69a98..000000000 --- a/plugins/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/plugins/postcss-cascade-layers/package.json b/plugins/postcss-cascade-layers/package.json index 38826b704..1417aaa9c 100644 --- a/plugins/postcss-cascade-layers/package.json +++ b/plugins/postcss-cascade-layers/package.json @@ -35,15 +35,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-cascade-layers/tsconfig.json b/plugins/postcss-cascade-layers/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-cascade-layers/tsconfig.json +++ b/plugins/postcss-cascade-layers/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-color-function/dist/has-fallback-decl.d.ts b/plugins/postcss-color-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-color-function/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-color-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/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/plugins/postcss-color-function/dist/index.cjs b/plugins/postcss-color-function/dist/index.cjs index 031ddeea3..19243a694 100644 --- a/plugins/postcss-color-function/dist/index.cjs +++ b/plugins/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 i=a.value;if(!o.test(i))return;if(hasFallback(a))return;if(hasSupportsAtRuleAncestor(a))return;const l=s.tokenize({css:i}),c=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(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);p!==i&&(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 l=s.tokenize({css:i}),c=t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(l),(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);p!==i&&(a.cloneBefore({value:p}),null!=e&&e.preserve||a.remove())}});basePlugin.postcss=!0;const creator=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)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-color-function/dist/index.d.cts b/plugins/postcss-color-function/dist/index.d.cts new file mode 100644 index 000000000..93f57fe59 --- /dev/null +++ b/plugins/postcss-color-function/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-function/dist/index.d.mts b/plugins/postcss-color-function/dist/index.d.mts new file mode 100644 index 000000000..df8a07b6b --- /dev/null +++ b/plugins/postcss-color-function/dist/index.d.mts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-color-function/dist/index.d.ts b/plugins/postcss-color-function/dist/index.d.ts index 616abbd78..93f57fe59 100644 --- a/plugins/postcss-color-function/dist/index.d.ts +++ b/plugins/postcss-color-function/dist/index.d.ts @@ -1,10 +1,11 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-color-function plugin options */ -export type pluginOptions = { +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; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-function/dist/index.mjs b/plugins/postcss-color-function/dist/index.mjs index f3e23f3c4..a5ed26f7f 100644 --- a/plugins/postcss-color-function/dist/index.mjs +++ b/plugins/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 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(!l.test(f))return;if(hasFallback(u))return;if(hasSupportsAtRuleAncestor(u))return;const m=r({css:f}),g=n(a(m),(s=>{if(c(s)&&i.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}),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(!l.test(f))return;if(hasFallback(u))return;if(hasSupportsAtRuleAncestor(u))return;const m=r({css:f}),g=n(a(m),(s=>{if(c(s)&&i.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}),null!=s&&s.preserve||u.remove())}});basePlugin.postcss=!0;const creator=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)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-color-function/src/index.ts b/plugins/postcss-color-function/src/index.ts index fccb63686..6e6f63d6a 100644 --- a/plugins/postcss-color-function/src/index.ts +++ b/plugins/postcss-color-function/src/index.ts @@ -84,7 +84,7 @@ export type pluginOptions = { }; /* Transform the color() function in CSS. */ -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ preserve: false, enableProgressiveCustomProperties: true, @@ -103,6 +103,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-color-function/tsconfig.json b/plugins/postcss-color-function/tsconfig.json index d509dae3c..304cda47b 100644 --- a/plugins/postcss-color-function/tsconfig.json +++ b/plugins/postcss-color-function/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-color-functional-notation/dist/has-fallback-decl.d.ts b/plugins/postcss-color-functional-notation/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/postcss-color-functional-notation/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/plugins/postcss-color-functional-notation/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-color-functional-notation/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index 95f67a105..000000000 --- a/plugins/postcss-color-functional-notation/dist/has-supports-at-rule-ancestor.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Node } from 'postcss'; -export declare const rgb_hsl_functionRegex: RegExp; -export declare function hasSupportsAtRuleAncestor(node: Node): boolean; diff --git a/plugins/postcss-color-functional-notation/dist/index.cjs b/plugins/postcss-color-functional-notation/dist/index.cjs index aa200a934..ad62cafe8 100644 --- a/plugins/postcss-color-functional-notation/dist/index.cjs +++ b/plugins/postcss-color-functional-notation/dist/index.cjs @@ -1 +1 @@ -"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-tokenizer"),t=require("@csstools/css-color-parser"),r=require("@csstools/css-parser-algorithms");function hasFallback(s){const e=s.parent;if(!e)return!1;const t=s.prop.toLowerCase(),r=e.index(s);for(let s=0;s({postcssPlugin:"postcss-color-functional-notation",Declaration:n=>{const l=n.value;if(!o.test(l))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const i=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(e.tokenize({css:l})),(s=>{if(r.isFunctionNode(s)&&a.test(s.getName())){const e=t.color(s);if(!e)return;if(e.syntaxFlags.has(t.SyntaxFlag.HasNoneKeywords))return;if(e.syntaxFlags.has(t.SyntaxFlag.RelativeColorSyntax))return;if((e.syntaxFlags.has(t.SyntaxFlag.LegacyRGB)||e.syntaxFlags.has(t.SyntaxFlag.LegacyHSL))&&!e.syntaxFlags.has(t.SyntaxFlag.HasPercentageAlpha))return;return"hsl"===e.colorNotation?t.serializeHSL(e):t.serializeRGB(e)}})),c=r.stringify(i);c!==l&&(n.cloneBefore({value:c}),null!=s&&s.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=e=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-color-functional-notation",plugins:[s(),basePlugin(t)]}:basePlugin(t)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var s=require("@csstools/postcss-progressive-custom-properties"),e=require("@csstools/css-tokenizer"),t=require("@csstools/css-color-parser"),r=require("@csstools/css-parser-algorithms");function hasFallback(s){const e=s.parent;if(!e)return!1;const t=s.prop.toLowerCase(),r=e.index(s);for(let s=0;s({postcssPlugin:"postcss-color-functional-notation",Declaration:n=>{const l=n.value;if(!o.test(l))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;const i=r.replaceComponentValues(r.parseCommaSeparatedListOfComponentValues(e.tokenize({css:l})),(s=>{if(r.isFunctionNode(s)&&a.test(s.getName())){const e=t.color(s);if(!e)return;if(e.syntaxFlags.has(t.SyntaxFlag.HasNoneKeywords))return;if(e.syntaxFlags.has(t.SyntaxFlag.RelativeColorSyntax))return;if((e.syntaxFlags.has(t.SyntaxFlag.LegacyRGB)||e.syntaxFlags.has(t.SyntaxFlag.LegacyHSL))&&!e.syntaxFlags.has(t.SyntaxFlag.HasPercentageAlpha))return;return"hsl"===e.colorNotation?t.serializeHSL(e):t.serializeRGB(e)}})),c=r.stringify(i);c!==l&&(n.cloneBefore({value:c}),null!=s&&s.preserve||n.remove())}});basePlugin.postcss=!0;const creator=e=>{const t=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},e);return t.enableProgressiveCustomProperties&&t.preserve?{postcssPlugin:"postcss-color-functional-notation",plugins:[s(),basePlugin(t)]}:basePlugin(t)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-color-functional-notation/dist/index.d.cts b/plugins/postcss-color-functional-notation/dist/index.d.cts new file mode 100644 index 000000000..eea58c357 --- /dev/null +++ b/plugins/postcss-color-functional-notation/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-functional-notation plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-functional-notation/dist/index.d.mts b/plugins/postcss-color-functional-notation/dist/index.d.mts new file mode 100644 index 000000000..8d16d32be --- /dev/null +++ b/plugins/postcss-color-functional-notation/dist/index.d.mts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-functional-notation plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-color-functional-notation/dist/index.d.ts b/plugins/postcss-color-functional-notation/dist/index.d.ts index 7ed2f388e..eea58c357 100644 --- a/plugins/postcss-color-functional-notation/dist/index.d.ts +++ b/plugins/postcss-color-functional-notation/dist/index.d.ts @@ -1,10 +1,11 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-color-functional-notation plugin options */ -export type pluginOptions = { +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; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-functional-notation/dist/index.mjs b/plugins/postcss-color-functional-notation/dist/index.mjs index e012093e6..f23ce7e1d 100644 --- a/plugins/postcss-color-functional-notation/dist/index.mjs +++ b/plugins/postcss-color-functional-notation/dist/index.mjs @@ -1 +1 @@ -import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as t}from"@csstools/css-tokenizer";import{color as e,SyntaxFlag as r,serializeHSL as o,serializeRGB as n}from"@csstools/css-color-parser";import{replaceComponentValues as a,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as l,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const t=s.parent;if(!t)return!1;const e=s.prop.toLowerCase(),r=t.index(s);for(let s=0;s({postcssPlugin:"postcss-color-functional-notation",Declaration:f=>{const g=f.value;if(!i.test(g))return;if(hasFallback(f))return;if(hasSupportsAtRuleAncestor(f))return;const m=a(c(t({css:g})),(s=>{if(l(s)&&u.test(s.getName())){const t=e(s);if(!t)return;if(t.syntaxFlags.has(r.HasNoneKeywords))return;if(t.syntaxFlags.has(r.RelativeColorSyntax))return;if((t.syntaxFlags.has(r.LegacyRGB)||t.syntaxFlags.has(r.LegacyHSL))&&!t.syntaxFlags.has(r.HasPercentageAlpha))return;return"hsl"===t.colorNotation?o(t):n(t)}})),h=p(m);h!==g&&(f.cloneBefore({value:h}),null!=s&&s.preserve||f.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const e=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},t);return e.enableProgressiveCustomProperties&&e.preserve?{postcssPlugin:"postcss-color-functional-notation",plugins:[s(),basePlugin(e)]}:basePlugin(e)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import s from"@csstools/postcss-progressive-custom-properties";import{tokenize as t}from"@csstools/css-tokenizer";import{color as e,SyntaxFlag as r,serializeHSL as o,serializeRGB as n}from"@csstools/css-color-parser";import{replaceComponentValues as a,parseCommaSeparatedListOfComponentValues as c,isFunctionNode as l,stringify as p}from"@csstools/css-parser-algorithms";function hasFallback(s){const t=s.parent;if(!t)return!1;const e=s.prop.toLowerCase(),r=t.index(s);for(let s=0;s({postcssPlugin:"postcss-color-functional-notation",Declaration:f=>{const g=f.value;if(!i.test(g))return;if(hasFallback(f))return;if(hasSupportsAtRuleAncestor(f))return;const m=a(c(t({css:g})),(s=>{if(l(s)&&u.test(s.getName())){const t=e(s);if(!t)return;if(t.syntaxFlags.has(r.HasNoneKeywords))return;if(t.syntaxFlags.has(r.RelativeColorSyntax))return;if((t.syntaxFlags.has(r.LegacyRGB)||t.syntaxFlags.has(r.LegacyHSL))&&!t.syntaxFlags.has(r.HasPercentageAlpha))return;return"hsl"===t.colorNotation?o(t):n(t)}})),h=p(m);h!==g&&(f.cloneBefore({value:h}),null!=s&&s.preserve||f.remove())}});basePlugin.postcss=!0;const creator=t=>{const e=Object.assign({preserve:!1,enableProgressiveCustomProperties:!0},t);return e.enableProgressiveCustomProperties&&e.preserve?{postcssPlugin:"postcss-color-functional-notation",plugins:[s(),basePlugin(e)]}:basePlugin(e)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-color-functional-notation/src/index.ts b/plugins/postcss-color-functional-notation/src/index.ts index 97807f11a..7fbe73603 100644 --- a/plugins/postcss-color-functional-notation/src/index.ts +++ b/plugins/postcss-color-functional-notation/src/index.ts @@ -95,7 +95,7 @@ export type pluginOptions = { }; /* Transform the color functional notation in CSS. */ -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ preserve: false, enableProgressiveCustomProperties: true, @@ -114,6 +114,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-color-functional-notation/tsconfig.json b/plugins/postcss-color-functional-notation/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-color-functional-notation/tsconfig.json +++ b/plugins/postcss-color-functional-notation/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-color-hex-alpha/dist/has-fallback-decl.d.ts b/plugins/postcss-color-hex-alpha/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/postcss-color-hex-alpha/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/plugins/postcss-color-hex-alpha/dist/index.d.cts b/plugins/postcss-color-hex-alpha/dist/index.d.cts new file mode 100644 index 000000000..0506ef519 --- /dev/null +++ b/plugins/postcss-color-hex-alpha/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-hex-alpha plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-hex-alpha/dist/index.d.mts b/plugins/postcss-color-hex-alpha/dist/index.d.mts new file mode 100644 index 000000000..2c8744647 --- /dev/null +++ b/plugins/postcss-color-hex-alpha/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-hex-alpha plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-color-hex-alpha/dist/index.d.ts b/plugins/postcss-color-hex-alpha/dist/index.d.ts index 10220232f..0506ef519 100644 --- a/plugins/postcss-color-hex-alpha/dist/index.d.ts +++ b/plugins/postcss-color-hex-alpha/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-color-hex-alpha plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-hex-alpha/package.json b/plugins/postcss-color-hex-alpha/package.json index e19d3e54a..00d9c42cc 100644 --- a/plugins/postcss-color-hex-alpha/package.json +++ b/plugins/postcss-color-hex-alpha/package.json @@ -34,15 +34,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-color-hex-alpha/tsconfig.json b/plugins/postcss-color-hex-alpha/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-color-hex-alpha/tsconfig.json +++ b/plugins/postcss-color-hex-alpha/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-color-mix-function/dist/has-fallback-decl.d.ts b/plugins/postcss-color-mix-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-color-mix-function/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-color-mix-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/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/plugins/postcss-color-mix-function/dist/index.cjs b/plugins/postcss-color-mix-function/dist/index.cjs index f1c26e4af..aa93c032c 100644 --- a/plugins/postcss-color-mix-function/dist/index.cjs +++ b/plugins/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:a=>{const i=a.value;if(!o.test(i))return;if(hasFallback(a))return;if(hasSupportsAtRuleAncestor(a))return;const u=s.tokenize({css:i}),l=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;return r.serializeRGB(s)}})),c=t.stringify(l);if(c===i)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)}})))),a.cloneBefore({value:c}),null!=e&&e.subFeatures.displayP3&&p!==c&&a.cloneBefore({value:p}),null!=e&&e.preserve||a.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:a=>{const i=a.value;if(!o.test(i))return;if(hasFallback(a))return;if(hasSupportsAtRuleAncestor(a))return;const u=s.tokenize({css:i}),l=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;return r.serializeRGB(s)}})),c=t.stringify(l);if(c===i)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)}})))),a.cloneBefore({value:c}),null!=e&&e.subFeatures.displayP3&&p!==c&&a.cloneBefore({value:p}),null!=e&&e.preserve||a.remove()}});basePlugin.postcss=!0;const creator=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)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-color-mix-function/dist/index.d.cts b/plugins/postcss-color-mix-function/dist/index.d.cts new file mode 100644 index 000000000..3a018f101 --- /dev/null +++ b/plugins/postcss-color-mix-function/dist/index.d.cts @@ -0,0 +1,16 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-mix-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-mix-function/dist/index.d.mts b/plugins/postcss-color-mix-function/dist/index.d.mts new file mode 100644 index 000000000..9bf8c4043 --- /dev/null +++ b/plugins/postcss-color-mix-function/dist/index.d.mts @@ -0,0 +1,15 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-mix-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-color-mix-function/dist/index.d.ts b/plugins/postcss-color-mix-function/dist/index.d.ts index 22a656f08..3a018f101 100644 --- a/plugins/postcss-color-mix-function/dist/index.d.ts +++ b/plugins/postcss-color-mix-function/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-color-mix-function plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ @@ -11,5 +11,6 @@ export type pluginOptions = { displayP3?: boolean; }; }; -declare const postcssPlugin: PluginCreator; -export default postcssPlugin; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-mix-function/dist/index.mjs b/plugins/postcss-color-mix-function/dist/index.mjs index 90a2ede20..0d5e9e59f 100644 --- a/plugins/postcss-color-mix-function/dist/index.mjs +++ b/plugins/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,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 l,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:m=>{const b=m.value;if(!p.test(b))return;if(hasFallback(m))return;if(hasSupportsAtRuleAncestor(m))return;const g=e({css:b}),P=i(u(g),(s=>{if(l(s)&&f.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.Experimental))return;return o(e)}})),d=c(P);if(d===b)return;let v=d;null!=s&&s.subFeatures.displayP3&&(v=c(i(u(g),(s=>{if(l(s)&&f.test(s.getName())){const e=r(s);if(!e)return;return n(e)?o(e):a(e)}})))),m.cloneBefore({value:d}),null!=s&&s.subFeatures.displayP3&&v!==d&&m.cloneBefore({value:v}),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-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 l,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:m=>{const b=m.value;if(!p.test(b))return;if(hasFallback(m))return;if(hasSupportsAtRuleAncestor(m))return;const g=e({css:b}),P=i(u(g),(s=>{if(l(s)&&f.test(s.getName())){const e=r(s);if(!e)return;if(e.syntaxFlags.has(t.Experimental))return;return o(e)}})),d=c(P);if(d===b)return;let v=d;null!=s&&s.subFeatures.displayP3&&(v=c(i(u(g),(s=>{if(l(s)&&f.test(s.getName())){const e=r(s);if(!e)return;return n(e)?o(e):a(e)}})))),m.cloneBefore({value:d}),null!=s&&s.subFeatures.displayP3&&v!==d&&m.cloneBefore({value:v}),null!=s&&s.preserve||m.remove()}});basePlugin.postcss=!0;const creator=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)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-color-mix-function/package.json b/plugins/postcss-color-mix-function/package.json index 1636ac7f4..8ad446fdf 100644 --- a/plugins/postcss-color-mix-function/package.json +++ b/plugins/postcss-color-mix-function/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-color-mix-function/src/index.ts b/plugins/postcss-color-mix-function/src/index.ts index 07f5de5c1..f02b21785 100644 --- a/plugins/postcss-color-mix-function/src/index.ts +++ b/plugins/postcss-color-mix-function/src/index.ts @@ -109,7 +109,7 @@ export type pluginOptions = { }; /* Transform color-mix() functions in CSS. */ -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ enableProgressiveCustomProperties: true, preserve: false, @@ -136,6 +136,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-color-mix-function/tsconfig.json b/plugins/postcss-color-mix-function/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-color-mix-function/tsconfig.json +++ b/plugins/postcss-color-mix-function/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-color-rebeccapurple/dist/has-fallback-decl.d.ts b/plugins/postcss-color-rebeccapurple/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/postcss-color-rebeccapurple/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/plugins/postcss-color-rebeccapurple/dist/index.d.cts b/plugins/postcss-color-rebeccapurple/dist/index.d.cts new file mode 100644 index 000000000..1afad557d --- /dev/null +++ b/plugins/postcss-color-rebeccapurple/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-rebeccapurple plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-rebeccapurple/dist/index.d.mts b/plugins/postcss-color-rebeccapurple/dist/index.d.mts new file mode 100644 index 000000000..8a1b909de --- /dev/null +++ b/plugins/postcss-color-rebeccapurple/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-color-rebeccapurple plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-color-rebeccapurple/dist/index.d.ts b/plugins/postcss-color-rebeccapurple/dist/index.d.ts index 2909bb928..1afad557d 100644 --- a/plugins/postcss-color-rebeccapurple/dist/index.d.ts +++ b/plugins/postcss-color-rebeccapurple/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-color-rebeccapurple plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-color-rebeccapurple/package.json b/plugins/postcss-color-rebeccapurple/package.json index 67a793ad6..c019ee9ea 100644 --- a/plugins/postcss-color-rebeccapurple/package.json +++ b/plugins/postcss-color-rebeccapurple/package.json @@ -34,15 +34,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-color-rebeccapurple/tsconfig.json b/plugins/postcss-color-rebeccapurple/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-color-rebeccapurple/tsconfig.json +++ b/plugins/postcss-color-rebeccapurple/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-conditional-values/dist/index.d.cts b/plugins/postcss-conditional-values/dist/index.d.cts new file mode 100644 index 000000000..80a4a6623 --- /dev/null +++ b/plugins/postcss-conditional-values/dist/index.d.cts @@ -0,0 +1,7 @@ +import { PluginCreator } from 'postcss'; +type pluginOptions = { + functionName: string; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-conditional-values/dist/index.d.mts b/plugins/postcss-conditional-values/dist/index.d.mts new file mode 100644 index 000000000..b43cbd42e --- /dev/null +++ b/plugins/postcss-conditional-values/dist/index.d.mts @@ -0,0 +1,6 @@ +import { PluginCreator } from 'postcss'; +type pluginOptions = { + functionName: string; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-conditional-values/dist/index.d.ts b/plugins/postcss-conditional-values/dist/index.d.ts index 7d41e514f..80a4a6623 100644 --- a/plugins/postcss-conditional-values/dist/index.d.ts +++ b/plugins/postcss-conditional-values/dist/index.d.ts @@ -1,6 +1,7 @@ -import type { PluginCreator } from 'postcss'; -export type pluginOptions = { +import { PluginCreator } from 'postcss'; +type pluginOptions = { functionName: string; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-conditional-values/package.json b/plugins/postcss-conditional-values/package.json index 33f609abf..d829755b5 100644 --- a/plugins/postcss-conditional-values/package.json +++ b/plugins/postcss-conditional-values/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-conditional-values/tsconfig.json b/plugins/postcss-conditional-values/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-conditional-values/tsconfig.json +++ b/plugins/postcss-conditional-values/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-custom-media/dist/cascade-layers.d.ts b/plugins/postcss-custom-media/dist/cascade-layers.d.ts deleted file mode 100644 index b9891949e..000000000 --- a/plugins/postcss-custom-media/dist/cascade-layers.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Node, Root } from 'postcss'; -export declare function collectCascadeLayerOrder(root: Root): WeakMap; -export declare function cascadeLayerNumberForNode(node: Node, layers: WeakMap): number; diff --git a/plugins/postcss-custom-media/dist/custom-media-from-root.d.ts b/plugins/postcss-custom-media/dist/custom-media-from-root.d.ts deleted file mode 100644 index f248ed932..000000000 --- a/plugins/postcss-custom-media/dist/custom-media-from-root.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MediaQuery } from '@csstools/media-query-list-parser'; -import type { Result, Root as PostCSSRoot } from 'postcss'; -export default function getCustomMedia(root: PostCSSRoot, result: Result, opts: { - preserve?: boolean; -}): Map; - falsy: Array; -}>; diff --git a/plugins/postcss-custom-media/dist/index.d.cts b/plugins/postcss-custom-media/dist/index.d.cts new file mode 100644 index 000000000..d6a05fdbc --- /dev/null +++ b/plugins/postcss-custom-media/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-custom-media plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-custom-media/dist/index.d.mts b/plugins/postcss-custom-media/dist/index.d.mts new file mode 100644 index 000000000..fd4da2a3e --- /dev/null +++ b/plugins/postcss-custom-media/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-custom-media plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-custom-media/dist/index.d.ts b/plugins/postcss-custom-media/dist/index.d.ts index 79f6f1e73..d6a05fdbc 100644 --- a/plugins/postcss-custom-media/dist/index.d.ts +++ b/plugins/postcss-custom-media/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-custom-media plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-custom-media/dist/is-processable-custom-media-rule.d.ts b/plugins/postcss-custom-media/dist/is-processable-custom-media-rule.d.ts deleted file mode 100644 index 04c46a3d8..000000000 --- a/plugins/postcss-custom-media/dist/is-processable-custom-media-rule.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { AtRule } from 'postcss'; -export declare function isProcessableCustomMediaRule(atRule: AtRule): boolean; diff --git a/plugins/postcss-custom-media/dist/toposort.d.ts b/plugins/postcss-custom-media/dist/toposort.d.ts deleted file mode 100644 index ffb196fdd..000000000 --- a/plugins/postcss-custom-media/dist/toposort.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function removeCyclicReferences(nodes: Map, edges: Array>): Set; diff --git a/plugins/postcss-custom-media/dist/transform-at-media/always-true-or-false.d.ts b/plugins/postcss-custom-media/dist/transform-at-media/always-true-or-false.d.ts deleted file mode 100644 index e37de5a34..000000000 --- a/plugins/postcss-custom-media/dist/transform-at-media/always-true-or-false.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { TokenColon, TokenIdent, TokenNumber } from '@csstools/css-tokenizer'; -export declare const alwaysTrue: [TokenIdent, TokenColon, TokenNumber]; -export declare const neverTrue: [TokenIdent, TokenColon, TokenNumber]; diff --git a/plugins/postcss-custom-media/dist/transform-at-media/at-media-params-tokens.d.ts b/plugins/postcss-custom-media/dist/transform-at-media/at-media-params-tokens.d.ts deleted file mode 100644 index e9a831301..000000000 --- a/plugins/postcss-custom-media/dist/transform-at-media/at-media-params-tokens.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { CSSToken } from '@csstools/css-tokenizer'; -export declare function atMediaParamsTokens(params: string): Array; diff --git a/plugins/postcss-custom-media/dist/transform-at-media/custom-media.d.ts b/plugins/postcss-custom-media/dist/transform-at-media/custom-media.d.ts deleted file mode 100644 index 5ef92dc5f..000000000 --- a/plugins/postcss-custom-media/dist/transform-at-media/custom-media.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { MediaQuery } from '@csstools/media-query-list-parser'; -export declare function parseCustomMedia(params: string): { - name: string; - truthy: Array; - falsy: Array; - dependsOn: Array<[string, string]>; -} | false; diff --git a/plugins/postcss-custom-media/dist/transform-at-media/transform-at-media.d.ts b/plugins/postcss-custom-media/dist/transform-at-media/transform-at-media.d.ts deleted file mode 100644 index 065620ce6..000000000 --- a/plugins/postcss-custom-media/dist/transform-at-media/transform-at-media.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { MediaQuery } from '@csstools/media-query-list-parser'; -export declare function transformAtMediaListTokens(params: string, replacements: Map; - falsy: Array; -}>): Array<{ - replaceWith: string; - encapsulateWith?: string; -}>; diff --git a/plugins/postcss-custom-media/dist/transform-at-media/true-and-false.d.ts b/plugins/postcss-custom-media/dist/transform-at-media/true-and-false.d.ts deleted file mode 100644 index ba1fa3a9f..000000000 --- a/plugins/postcss-custom-media/dist/transform-at-media/true-and-false.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { CSSToken } from '@csstools/css-tokenizer'; -export declare function replaceTrueAndFalseTokens(tokens: Array): Array; diff --git a/plugins/postcss-custom-media/package.json b/plugins/postcss-custom-media/package.json index bdff6eb45..30773138e 100644 --- a/plugins/postcss-custom-media/package.json +++ b/plugins/postcss-custom-media/package.json @@ -34,15 +34,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-custom-media/tsconfig.json b/plugins/postcss-custom-media/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-custom-media/tsconfig.json +++ b/plugins/postcss-custom-media/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-custom-properties/dist/cascade-layers.d.ts b/plugins/postcss-custom-properties/dist/cascade-layers.d.ts deleted file mode 100644 index b9891949e..000000000 --- a/plugins/postcss-custom-properties/dist/cascade-layers.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Node, Root } from 'postcss'; -export declare function collectCascadeLayerOrder(root: Root): WeakMap; -export declare function cascadeLayerNumberForNode(node: Node, layers: WeakMap): number; diff --git a/plugins/postcss-custom-properties/dist/get-custom-properties-from-root.d.ts b/plugins/postcss-custom-properties/dist/get-custom-properties-from-root.d.ts deleted file mode 100644 index 5a9c1547f..000000000 --- a/plugins/postcss-custom-properties/dist/get-custom-properties-from-root.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Root } from 'postcss'; -import valuesParser from 'postcss-value-parser'; -export default function getCustomPropertiesFromRoot(root: Root, parsedValuesCache: Map): Map; diff --git a/plugins/postcss-custom-properties/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-custom-properties/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/postcss-custom-properties/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/plugins/postcss-custom-properties/dist/index.d.cts b/plugins/postcss-custom-properties/dist/index.d.cts new file mode 100644 index 000000000..bc05720f7 --- /dev/null +++ b/plugins/postcss-custom-properties/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-custom-properties plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-custom-properties/dist/index.d.mts b/plugins/postcss-custom-properties/dist/index.d.mts new file mode 100644 index 000000000..6087c598a --- /dev/null +++ b/plugins/postcss-custom-properties/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-custom-properties plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-custom-properties/dist/index.d.ts b/plugins/postcss-custom-properties/dist/index.d.ts index beebd186f..bc05720f7 100644 --- a/plugins/postcss-custom-properties/dist/index.d.ts +++ b/plugins/postcss-custom-properties/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-custom-properties plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-custom-properties/dist/is-ignored.d.ts b/plugins/postcss-custom-properties/dist/is-ignored.d.ts deleted file mode 100644 index 336cbebf9..000000000 --- a/plugins/postcss-custom-properties/dist/is-ignored.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Container, Declaration } from 'postcss'; -export declare function isBlockIgnored(container: Container | undefined): any; -export declare function isDeclarationIgnored(decl: Declaration | undefined): boolean; diff --git a/plugins/postcss-custom-properties/dist/is-processable-rule.d.ts b/plugins/postcss-custom-properties/dist/is-processable-rule.d.ts deleted file mode 100644 index 235ba67ed..000000000 --- a/plugins/postcss-custom-properties/dist/is-processable-rule.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { Rule } from 'postcss'; -export declare function isProcessableRule(rule: Rule): boolean; -export declare const HTML_SELECTOR_REGEXP: RegExp; -export declare const HTML_WHERE_SELECTOR_REGEXP: RegExp; -export declare const ROOT_SELECTOR_REGEXP: RegExp; -export declare const ROOT_WHERE_SELECTOR_REGEXP: RegExp; -export declare const MAYBE_HTML_OR_ROOT_RULE_REGEXP: RegExp; diff --git a/plugins/postcss-custom-properties/dist/is-var-function.d.ts b/plugins/postcss-custom-properties/dist/is-var-function.d.ts deleted file mode 100644 index dd9ad6cc5..000000000 --- a/plugins/postcss-custom-properties/dist/is-var-function.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { FunctionNode, Node } from 'postcss-value-parser'; -export declare function isVarFunction(node: Node): node is FunctionNode; -export declare const HAS_VAR_FUNCTION: RegExp; diff --git a/plugins/postcss-custom-properties/dist/parse-or-cached.d.ts b/plugins/postcss-custom-properties/dist/parse-or-cached.d.ts deleted file mode 100644 index c96e7b6c8..000000000 --- a/plugins/postcss-custom-properties/dist/parse-or-cached.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import valuesParser from 'postcss-value-parser'; -export declare function parseOrCached(value: string, parsedValuesCache: Map): valuesParser.ParsedValue; diff --git a/plugins/postcss-custom-properties/dist/toposort.d.ts b/plugins/postcss-custom-properties/dist/toposort.d.ts deleted file mode 100644 index ffb196fdd..000000000 --- a/plugins/postcss-custom-properties/dist/toposort.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function removeCyclicReferences(nodes: Map, edges: Array>): Set; diff --git a/plugins/postcss-custom-properties/dist/transform-properties.d.ts b/plugins/postcss-custom-properties/dist/transform-properties.d.ts deleted file mode 100644 index da417cbd8..000000000 --- a/plugins/postcss-custom-properties/dist/transform-properties.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import valuesParser from 'postcss-value-parser'; -import type { Declaration } from 'postcss'; -export declare function transformProperties(decl: Declaration, customProperties: Map, localCustomProperties: Map, parsedValuesCache: Map, opts: { - preserve?: boolean; -}): void; diff --git a/plugins/postcss-custom-properties/dist/transform-value-ast.d.ts b/plugins/postcss-custom-properties/dist/transform-value-ast.d.ts deleted file mode 100644 index 91a52d186..000000000 --- a/plugins/postcss-custom-properties/dist/transform-value-ast.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import valuesParser from 'postcss-value-parser'; -export default function transformValueAST(root: valuesParser.ParsedValue, customProperties: Map, localCustomProperties: Map): string; diff --git a/plugins/postcss-custom-properties/package.json b/plugins/postcss-custom-properties/package.json index 99bd789b5..d141f9245 100644 --- a/plugins/postcss-custom-properties/package.json +++ b/plugins/postcss-custom-properties/package.json @@ -20,15 +20,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-custom-properties/tsconfig.json b/plugins/postcss-custom-properties/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-custom-properties/tsconfig.json +++ b/plugins/postcss-custom-properties/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-custom-selectors/dist/cascade-layers.d.ts b/plugins/postcss-custom-selectors/dist/cascade-layers.d.ts deleted file mode 100644 index b9891949e..000000000 --- a/plugins/postcss-custom-selectors/dist/cascade-layers.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Node, Root } from 'postcss'; -export declare function collectCascadeLayerOrder(root: Root): WeakMap; -export declare function cascadeLayerNumberForNode(node: Node, layers: WeakMap): number; diff --git a/plugins/postcss-custom-selectors/dist/custom-selectors-from-root.d.ts b/plugins/postcss-custom-selectors/dist/custom-selectors-from-root.d.ts deleted file mode 100644 index 346923e8f..000000000 --- a/plugins/postcss-custom-selectors/dist/custom-selectors-from-root.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Result, Root as PostCSSRoot } from 'postcss'; -import type { Root as SelectorRoot } from 'postcss-selector-parser'; -export default function getCustomSelectors(root: PostCSSRoot, result: Result, opts: { - preserve?: boolean; -}): Map; diff --git a/plugins/postcss-custom-selectors/dist/index.d.cts b/plugins/postcss-custom-selectors/dist/index.d.cts new file mode 100644 index 000000000..488613c88 --- /dev/null +++ b/plugins/postcss-custom-selectors/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-custom-selectors plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-custom-selectors/dist/index.d.mts b/plugins/postcss-custom-selectors/dist/index.d.mts new file mode 100644 index 000000000..91990f387 --- /dev/null +++ b/plugins/postcss-custom-selectors/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-custom-selectors plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-custom-selectors/dist/index.d.ts b/plugins/postcss-custom-selectors/dist/index.d.ts index aa450f622..488613c88 100644 --- a/plugins/postcss-custom-selectors/dist/index.d.ts +++ b/plugins/postcss-custom-selectors/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-custom-selectors plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-custom-selectors/dist/is-processable-custom-selector-rule.d.ts b/plugins/postcss-custom-selectors/dist/is-processable-custom-selector-rule.d.ts deleted file mode 100644 index 2dd82837f..000000000 --- a/plugins/postcss-custom-selectors/dist/is-processable-custom-selector-rule.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { AtRule } from 'postcss'; -export declare function isProcessableCustomSelectorRule(atRule: AtRule): boolean; diff --git a/plugins/postcss-custom-selectors/dist/transform-rule.d.ts b/plugins/postcss-custom-selectors/dist/transform-rule.d.ts deleted file mode 100644 index deec52461..000000000 --- a/plugins/postcss-custom-selectors/dist/transform-rule.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Result, Rule } from 'postcss'; -import type { Root } from 'postcss-selector-parser'; -export declare function transformRule(rule: Rule, result: Result, customSelectors: Map): string; diff --git a/plugins/postcss-custom-selectors/package.json b/plugins/postcss-custom-selectors/package.json index 8bd7d7732..3a5bd4364 100644 --- a/plugins/postcss-custom-selectors/package.json +++ b/plugins/postcss-custom-selectors/package.json @@ -37,15 +37,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-custom-selectors/tsconfig.json b/plugins/postcss-custom-selectors/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-custom-selectors/tsconfig.json +++ b/plugins/postcss-custom-selectors/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-debug-logger/dist/index.d.cts b/plugins/postcss-debug-logger/dist/index.d.cts new file mode 100644 index 000000000..0e21b839b --- /dev/null +++ b/plugins/postcss-debug-logger/dist/index.d.cts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export = creator; diff --git a/plugins/postcss-debug-logger/dist/index.d.mts b/plugins/postcss-debug-logger/dist/index.d.mts new file mode 100644 index 000000000..9d7270ec8 --- /dev/null +++ b/plugins/postcss-debug-logger/dist/index.d.mts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export { creator as default }; diff --git a/plugins/postcss-debug-logger/dist/index.d.ts b/plugins/postcss-debug-logger/dist/index.d.ts index 89d75c8fd..0e21b839b 100644 --- a/plugins/postcss-debug-logger/dist/index.d.ts +++ b/plugins/postcss-debug-logger/dist/index.d.ts @@ -1,3 +1,3 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; declare const creator: PluginCreator; -export default creator; +export = creator; diff --git a/plugins/postcss-debug-logger/package.json b/plugins/postcss-debug-logger/package.json index 788645ff0..01d27b763 100644 --- a/plugins/postcss-debug-logger/package.json +++ b/plugins/postcss-debug-logger/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-debug-logger/tsconfig.json b/plugins/postcss-debug-logger/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-debug-logger/tsconfig.json +++ b/plugins/postcss-debug-logger/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-design-tokens/dist/constants.d.ts b/plugins/postcss-design-tokens/dist/constants.d.ts deleted file mode 100644 index 9f2732385..000000000 --- a/plugins/postcss-design-tokens/dist/constants.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare const DEFAULT_CONDITION = "6b4e71e7-4787-42f7-a092-8684961895db"; -export declare const DEFAULT_VALUE_FUNCTION_NAME = "design-token"; -export declare const DEFAULT_IMPORT_AT_RULE_NAME = "design-tokens"; diff --git a/plugins/postcss-design-tokens/dist/data-formats/base/token.d.ts b/plugins/postcss-design-tokens/dist/data-formats/base/token.d.ts deleted file mode 100644 index b5d8b4f80..000000000 --- a/plugins/postcss-design-tokens/dist/data-formats/base/token.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface TokenTransformOptions { - pluginOptions: { - rootFontSize: number; - }; - toUnit?: string; -} -export interface Token { - cssValue(opts?: TokenTransformOptions): string; -} diff --git a/plugins/postcss-design-tokens/dist/data-formats/parse-import.d.ts b/plugins/postcss-design-tokens/dist/data-formats/parse-import.d.ts deleted file mode 100644 index 8f15f9703..000000000 --- a/plugins/postcss-design-tokens/dist/data-formats/parse-import.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Token } from './base/token'; -import type { Helpers, Root } from 'postcss'; -export declare function tokensFromImport(root: Root, postcssHelpers: Helpers, buildIs: Array, sourceFilePath: string, statement: string, alreadyImported: Set): Promise<{ - filePath: string; - tokens: Map; -} | false>; diff --git a/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/style-dictionary.d.ts b/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/style-dictionary.d.ts deleted file mode 100644 index d4192cec2..000000000 --- a/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/style-dictionary.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Token } from '../base/token'; -export declare function extractStyleDictionaryTokens(version: string, node: unknown, filePath: string): Map; diff --git a/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/dereference.d.ts b/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/dereference.d.ts deleted file mode 100644 index b933a9478..000000000 --- a/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/dereference.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { StyleDictionaryV3TokenValue } from './value'; -export declare function dereferenceTokenValues(tokens: Map): Map; diff --git a/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/group.d.ts b/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/group.d.ts deleted file mode 100644 index fbaf531d7..000000000 --- a/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/group.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { Token } from '../../base/token'; -import { StyleDictionaryV3TokenValue } from './value'; -export type StyleDictionaryV3TokenGroup = { - [key: string]: StyleDictionaryV3TokenGroup | StyleDictionaryV3TokenValue; -}; -export declare function extractStyleDictionaryV3Tokens(node: StyleDictionaryV3TokenGroup, filePath: string): Map; diff --git a/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/value.d.ts b/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/value.d.ts deleted file mode 100644 index 2987abbd4..000000000 --- a/plugins/postcss-design-tokens/dist/data-formats/style-dictionary/v3/value.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { TokenTransformOptions } from '../../base/token'; -export type StyleDictionaryV3TokenValue = { - cssValue(transformOptions?: TokenTransformOptions): string; - value: unknown; - name?: string; - comment?: string; - themeable?: boolean; - attributes?: unknown; - metadata?: { - name?: string; - path: Array; - filePath: string; - isSource: boolean; - }; -}; -export declare function extractStyleDictionaryV3Token(node: Record, key: string, path: Array, filePath: string): StyleDictionaryV3TokenValue; -export declare function applyTransformsToValue(value: string | undefined | null, transformOptions?: TokenTransformOptions): string; diff --git a/plugins/postcss-design-tokens/dist/data-formats/token.d.ts b/plugins/postcss-design-tokens/dist/data-formats/token.d.ts deleted file mode 100644 index a25aec2a3..000000000 --- a/plugins/postcss-design-tokens/dist/data-formats/token.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Token } from './base/token'; -export declare function mergeTokens(a: Map, b: Map): Map; diff --git a/plugins/postcss-design-tokens/dist/data-formats/toposort/toposort.d.ts b/plugins/postcss-design-tokens/dist/data-formats/toposort/toposort.d.ts deleted file mode 100644 index 4d843c2f8..000000000 --- a/plugins/postcss-design-tokens/dist/data-formats/toposort/toposort.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function toposort(nodes: Array, edges: Array>): Array; diff --git a/plugins/postcss-design-tokens/dist/index.d.cts b/plugins/postcss-design-tokens/dist/index.d.cts new file mode 100644 index 000000000..a00408673 --- /dev/null +++ b/plugins/postcss-design-tokens/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +type pluginOptions = { + importAtRuleName: string; + is?: Array; + unitsAndValues?: { + rootFontSize?: number; + }; + valueFunctionName: string; +}; +declare const creator: PluginCreator; +export = creator; diff --git a/plugins/postcss-design-tokens/dist/index.d.mts b/plugins/postcss-design-tokens/dist/index.d.mts new file mode 100644 index 000000000..ffe07c426 --- /dev/null +++ b/plugins/postcss-design-tokens/dist/index.d.mts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +type pluginOptions = { + importAtRuleName: string; + is?: Array; + unitsAndValues?: { + rootFontSize?: number; + }; + valueFunctionName: string; +}; +declare const creator: PluginCreator; +export { creator as default }; diff --git a/plugins/postcss-design-tokens/dist/index.d.ts b/plugins/postcss-design-tokens/dist/index.d.ts index e009762a9..a00408673 100644 --- a/plugins/postcss-design-tokens/dist/index.d.ts +++ b/plugins/postcss-design-tokens/dist/index.d.ts @@ -1,4 +1,11 @@ -import type { PluginCreator } from 'postcss'; -import { pluginOptions } from './options'; +import { PluginCreator } from 'postcss'; +type pluginOptions = { + importAtRuleName: string; + is?: Array; + unitsAndValues?: { + rootFontSize?: number; + }; + valueFunctionName: string; +}; declare const creator: PluginCreator; -export default creator; +export = creator; diff --git a/plugins/postcss-design-tokens/dist/options.d.ts b/plugins/postcss-design-tokens/dist/options.d.ts deleted file mode 100644 index 8bdd0477a..000000000 --- a/plugins/postcss-design-tokens/dist/options.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export type pluginOptions = { - importAtRuleName: string; - is?: Array; - unitsAndValues?: { - rootFontSize?: number; - }; - valueFunctionName: string; -}; -export type parsedPluginOptions = { - importAtRuleName: string; - is: Array; - unitsAndValues: { - rootFontSize: number; - }; - valueFunctionName: string; -}; -export declare function parsePluginOptions(opts?: pluginOptions): parsedPluginOptions; diff --git a/plugins/postcss-design-tokens/dist/parse-component-values.d.ts b/plugins/postcss-design-tokens/dist/parse-component-values.d.ts deleted file mode 100644 index 9f19381c9..000000000 --- a/plugins/postcss-design-tokens/dist/parse-component-values.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function parseComponentValues(source: string): import("@csstools/css-parser-algorithms").ComponentValue[]; diff --git a/plugins/postcss-design-tokens/dist/transform.d.ts b/plugins/postcss-design-tokens/dist/transform.d.ts deleted file mode 100644 index 341f554d1..000000000 --- a/plugins/postcss-design-tokens/dist/transform.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Node, Result } from 'postcss'; -import { Token } from './data-formats/base/token'; -import { parsedPluginOptions } from './options'; -export declare function transform(tokens: Map, result: Result, postCSSNode: Node, source: string, opts: parsedPluginOptions): string; diff --git a/plugins/postcss-design-tokens/package.json b/plugins/postcss-design-tokens/package.json index 2730b899c..879ce56db 100644 --- a/plugins/postcss-design-tokens/package.json +++ b/plugins/postcss-design-tokens/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-design-tokens/tsconfig.json b/plugins/postcss-design-tokens/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-design-tokens/tsconfig.json +++ b/plugins/postcss-design-tokens/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-dir-pseudo-class/dist/index.d.cts b/plugins/postcss-dir-pseudo-class/dist/index.d.cts new file mode 100644 index 000000000..4aa961e99 --- /dev/null +++ b/plugins/postcss-dir-pseudo-class/dist/index.d.cts @@ -0,0 +1,13 @@ +import { PluginCreator } from 'postcss'; +/** postcss-dir-pseudo-class plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Assume a direction for the document. default: null */ + dir?: 'ltr' | 'rtl'; + /** Assume that the CSS is intended to be used in Shadow DOM with Custom Elements. default: false */ + shadow?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-dir-pseudo-class/dist/index.d.mts b/plugins/postcss-dir-pseudo-class/dist/index.d.mts new file mode 100644 index 000000000..146ddf622 --- /dev/null +++ b/plugins/postcss-dir-pseudo-class/dist/index.d.mts @@ -0,0 +1,12 @@ +import { PluginCreator } from 'postcss'; +/** postcss-dir-pseudo-class plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Assume a direction for the document. default: null */ + dir?: 'ltr' | 'rtl'; + /** Assume that the CSS is intended to be used in Shadow DOM with Custom Elements. default: false */ + shadow?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-dir-pseudo-class/dist/index.d.ts b/plugins/postcss-dir-pseudo-class/dist/index.d.ts index 8e6f1148b..4aa961e99 100644 --- a/plugins/postcss-dir-pseudo-class/dist/index.d.ts +++ b/plugins/postcss-dir-pseudo-class/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-dir-pseudo-class plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** Assume a direction for the document. default: null */ @@ -9,4 +9,5 @@ export type pluginOptions = { shadow?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-dir-pseudo-class/package.json b/plugins/postcss-dir-pseudo-class/package.json index 8abca57e0..50e02a58e 100644 --- a/plugins/postcss-dir-pseudo-class/package.json +++ b/plugins/postcss-dir-pseudo-class/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-dir-pseudo-class/src/index.ts b/plugins/postcss-dir-pseudo-class/src/index.ts index be26fb661..d9c59d24c 100644 --- a/plugins/postcss-dir-pseudo-class/src/index.ts +++ b/plugins/postcss-dir-pseudo-class/src/index.ts @@ -116,7 +116,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { parent.prepend( selectorParser.combinator({ value: ' ', - }), + }) as unknown as selectorParser.Selector /* TODO : delete the "as" clause */, ); } @@ -170,17 +170,17 @@ const creator: PluginCreator = (opts?: pluginOptions) => { parent.insertAfter(first, notDirAttr); } else { // prepend :root - parent.prepend(notDirAttr); + parent.prepend(notDirAttr as unknown as selectorParser.Selector /* TODO : delete the "as" clause */); } } else if (firstIsHtml) { // insert dir attribute after html tag parent.insertAfter(first, dirAttr); } else if (options.shadow && !firstIsRoot) { // prepend :host-context([dir]) - parent.prepend(hostContextPseudo); + parent.prepend(hostContextPseudo as unknown as selectorParser.Selector /* TODO : delete the "as" clause */); } else { // otherwise, prepend the dir attribute - parent.prepend(dirAttr); + parent.prepend(dirAttr as unknown as selectorParser.Selector /* TODO : delete the "as" clause */); } }); }); diff --git a/plugins/postcss-dir-pseudo-class/tsconfig.json b/plugins/postcss-dir-pseudo-class/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-dir-pseudo-class/tsconfig.json +++ b/plugins/postcss-dir-pseudo-class/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-double-position-gradients/dist/has-fallback-decl.d.ts b/plugins/postcss-double-position-gradients/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/postcss-double-position-gradients/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/plugins/postcss-double-position-gradients/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-double-position-gradients/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/postcss-double-position-gradients/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/plugins/postcss-double-position-gradients/dist/index.cjs b/plugins/postcss-double-position-gradients/dist/index.cjs index 3c38b391e..ae78a0a7f 100644 --- a/plugins/postcss-double-position-gradients/dist/index.cjs +++ b/plugins/postcss-double-position-gradients/dist/index.cjs @@ -1 +1 @@ -"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),t=require("postcss-value-parser");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"div"===e.type&&","===e.value;function isNumericNode(e){try{return!1!==t.unit(null==e?void 0:e.value)}catch(e){return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:i}){if(!r.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;let a;try{a=t(n.value)}catch(e){n.warn(i,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===a)return;a.walk((e=>{if("function"!==e.type||!s.test(e.value))return;const t=e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));let r=!1;t.forEach(((t,s,n)=>{if("word"===t.type&&o.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=Object(n[s-1]),a=Object(n[s-2]),c=Object(n[s+1]);if(a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}}))}));const c=a.toString();c!==n.value&&(n.cloneBefore({value:c}),null!=e&&e.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0,module.exports=postcssPlugin; +"use strict";var e=require("@csstools/postcss-progressive-custom-properties"),t=require("postcss-value-parser");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"div"===e.type&&","===e.value;function isNumericNode(e){try{return!1!==t.unit(null==e?void 0:e.value)}catch(e){return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:i}){if(!r.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;let a;try{a=t(n.value)}catch(e){n.warn(i,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===a)return;a.walk((e=>{if("function"!==e.type||!s.test(e.value))return;const t=e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));let r=!1;t.forEach(((t,s,n)=>{if("word"===t.type&&o.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=Object(n[s-1]),a=Object(n[s-2]),c=Object(n[s+1]);if(a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}}))}));const c=a.toString();c!==n.value&&(n.cloneBefore({value:c}),null!=e&&e.preserve||n.remove())}});basePlugin.postcss=!0;const creator=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-double-position-gradients/dist/index.d.cts b/plugins/postcss-double-position-gradients/dist/index.d.cts new file mode 100644 index 000000000..2b1101ae8 --- /dev/null +++ b/plugins/postcss-double-position-gradients/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +/** postcss-double-position-gradients plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-double-position-gradients/dist/index.d.mts b/plugins/postcss-double-position-gradients/dist/index.d.mts new file mode 100644 index 000000000..0969d9a06 --- /dev/null +++ b/plugins/postcss-double-position-gradients/dist/index.d.mts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** postcss-double-position-gradients plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-double-position-gradients/dist/index.d.ts b/plugins/postcss-double-position-gradients/dist/index.d.ts index 75ff88fb7..2b1101ae8 100644 --- a/plugins/postcss-double-position-gradients/dist/index.d.ts +++ b/plugins/postcss-double-position-gradients/dist/index.d.ts @@ -1,10 +1,11 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-double-position-gradients plugin options */ -export type pluginOptions = { +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; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-double-position-gradients/dist/index.mjs b/plugins/postcss-double-position-gradients/dist/index.mjs index f3fe49ec0..09df380df 100644 --- a/plugins/postcss-double-position-gradients/dist/index.mjs +++ b/plugins/postcss-double-position-gradients/dist/index.mjs @@ -1 +1 @@ -import e from"@csstools/postcss-progressive-custom-properties";import t from"postcss-value-parser";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"div"===e.type&&","===e.value;function isNumericNode(e){try{return!1!==t.unit(null==e?void 0:e.value)}catch(e){return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:i}){if(!r.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;let a;try{a=t(n.value)}catch(e){n.warn(i,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===a)return;a.walk((e=>{if("function"!==e.type||!s.test(e.value))return;const t=e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));let r=!1;t.forEach(((t,s,n)=>{if("word"===t.type&&o.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=Object(n[s-1]),a=Object(n[s-2]),c=Object(n[s+1]);if(a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}}))}));const c=a.toString();c!==n.value&&(n.cloneBefore({value:c}),null!=e&&e.preserve||n.remove())}});basePlugin.postcss=!0;const postcssPlugin=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};postcssPlugin.postcss=!0;export{postcssPlugin as default}; +import e from"@csstools/postcss-progressive-custom-properties";import t from"postcss-value-parser";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"div"===e.type&&","===e.value;function isNumericNode(e){try{return!1!==t.unit(null==e?void 0:e.value)}catch(e){return!1}}const basePlugin=e=>({postcssPlugin:"postcss-double-position-gradients",Declaration(n,{result:i}){if(!r.test(n.value))return;if(hasFallback(n))return;if(hasSupportsAtRuleAncestor(n))return;let a;try{a=t(n.value)}catch(e){n.warn(i,`Failed to parse value '${n.value}' as a CSS gradient. Leaving the original value intact.`)}if(void 0===a)return;a.walk((e=>{if("function"!==e.type||!s.test(e.value))return;const t=e.nodes.filter((e=>"comment"!==e.type&&"space"!==e.type));let r=!1;t.forEach(((t,s,n)=>{if("word"===t.type&&o.includes(t.value.toLowerCase())&&(r=!0),"div"===t.type&&","===t.value&&(r=!1),r)return;const i=Object(n[s-1]),a=Object(n[s-2]),c=Object(n[s+1]);if(a.type&&isNumericNode(i)&&isNumericNode(t)){const r=a,s={type:"div",value:",",before:isPunctuationCommaNode(c)?c.before:"",after:isPunctuationCommaNode(c)?"":" ",sourceIndex:0,sourceEndIndex:0};e.nodes.splice(e.nodes.indexOf(t)-1,0,s,r)}}))}));const c=a.toString();c!==n.value&&(n.cloneBefore({value:c}),null!=e&&e.preserve||n.remove())}});basePlugin.postcss=!0;const creator=t=>{const r=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},t);return r.enableProgressiveCustomProperties&&r.preserve?{postcssPlugin:"postcss-double-position-gradients",plugins:[e(),basePlugin(r)]}:basePlugin(r)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-double-position-gradients/dist/is-gradient.d.ts b/plugins/postcss-double-position-gradients/dist/is-gradient.d.ts deleted file mode 100644 index 72378209e..000000000 --- a/plugins/postcss-double-position-gradients/dist/is-gradient.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const HAS_GRADIENT_FUNCTION: RegExp; -export declare const IS_GRADIENT_FUNCTION: RegExp; diff --git a/plugins/postcss-double-position-gradients/package.json b/plugins/postcss-double-position-gradients/package.json index a94cfc0d1..dd9a52b8d 100644 --- a/plugins/postcss-double-position-gradients/package.json +++ b/plugins/postcss-double-position-gradients/package.json @@ -17,15 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-double-position-gradients/src/index.ts b/plugins/postcss-double-position-gradients/src/index.ts index 243191d5c..dd37de3ca 100644 --- a/plugins/postcss-double-position-gradients/src/index.ts +++ b/plugins/postcss-double-position-gradients/src/index.ts @@ -154,7 +154,7 @@ export type pluginOptions = { }; // Transform double-position gradients in CSS. -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ enableProgressiveCustomProperties: true, preserve: true, @@ -173,6 +173,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-double-position-gradients/tsconfig.json b/plugins/postcss-double-position-gradients/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-double-position-gradients/tsconfig.json +++ b/plugins/postcss-double-position-gradients/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-exponential-functions/dist/index.d.cts b/plugins/postcss-exponential-functions/dist/index.d.cts new file mode 100644 index 000000000..2ed533cca --- /dev/null +++ b/plugins/postcss-exponential-functions/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-exponential-functions plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-exponential-functions/dist/index.d.mts b/plugins/postcss-exponential-functions/dist/index.d.mts new file mode 100644 index 000000000..8bc2daeec --- /dev/null +++ b/plugins/postcss-exponential-functions/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-exponential-functions plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-exponential-functions/dist/index.d.ts b/plugins/postcss-exponential-functions/dist/index.d.ts index d216e5787..2ed533cca 100644 --- a/plugins/postcss-exponential-functions/dist/index.d.ts +++ b/plugins/postcss-exponential-functions/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-exponential-functions plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-exponential-functions/package.json b/plugins/postcss-exponential-functions/package.json index 5b6fd6834..5733db947 100644 --- a/plugins/postcss-exponential-functions/package.json +++ b/plugins/postcss-exponential-functions/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-exponential-functions/tsconfig.json b/plugins/postcss-exponential-functions/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-exponential-functions/tsconfig.json +++ b/plugins/postcss-exponential-functions/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-extract/dist/index.d.cts b/plugins/postcss-extract/dist/index.d.cts new file mode 100644 index 000000000..e9bcc4bca --- /dev/null +++ b/plugins/postcss-extract/dist/index.d.cts @@ -0,0 +1,12 @@ +import { PluginCreator } from 'postcss'; +type pluginOptions = { + /** Mapping of queries */ + queries: Record; + /** Extract after transforms are likely to be done, or before it */ + extractLate: boolean; + /** Callback for results */ + results: (results: Record>>) => void; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-extract/dist/index.d.mts b/plugins/postcss-extract/dist/index.d.mts new file mode 100644 index 000000000..8087a2ab5 --- /dev/null +++ b/plugins/postcss-extract/dist/index.d.mts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +type pluginOptions = { + /** Mapping of queries */ + queries: Record; + /** Extract after transforms are likely to be done, or before it */ + extractLate: boolean; + /** Callback for results */ + results: (results: Record>>) => void; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-extract/dist/index.d.ts b/plugins/postcss-extract/dist/index.d.ts index 9a1f9db25..e9bcc4bca 100644 --- a/plugins/postcss-extract/dist/index.d.ts +++ b/plugins/postcss-extract/dist/index.d.ts @@ -1,5 +1,5 @@ -import type { PluginCreator } from 'postcss'; -export type pluginOptions = { +import { PluginCreator } from 'postcss'; +type pluginOptions = { /** Mapping of queries */ queries: Record; /** Extract after transforms are likely to be done, or before it */ @@ -8,4 +8,5 @@ export type pluginOptions = { results: (results: Record>>) => void; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-extract/dist/node-list.d.ts b/plugins/postcss-extract/dist/node-list.d.ts deleted file mode 100644 index 9d38f61bf..000000000 --- a/plugins/postcss-extract/dist/node-list.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export type NodeList = Array; diff --git a/plugins/postcss-extract/dist/pseudos/not.d.ts b/plugins/postcss-extract/dist/pseudos/not.d.ts deleted file mode 100644 index 33ab38578..000000000 --- a/plugins/postcss-extract/dist/pseudos/not.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { NodeList } from '../node-list'; -export declare function notPseudo(list: NodeList, exclude: NodeList): NodeList; diff --git a/plugins/postcss-extract/dist/select-nodes.d.ts b/plugins/postcss-extract/dist/select-nodes.d.ts deleted file mode 100644 index a3f02519a..000000000 --- a/plugins/postcss-extract/dist/select-nodes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Node, Container } from 'postcss'; -import type selectorParser from 'postcss-selector-parser'; -export declare function extract(container: Container, selectors: Map): Record>>; diff --git a/plugins/postcss-extract/dist/selector-engine/combinators/adjacent-sibling.d.ts b/plugins/postcss-extract/dist/selector-engine/combinators/adjacent-sibling.d.ts deleted file mode 100644 index 7856083d8..000000000 --- a/plugins/postcss-extract/dist/selector-engine/combinators/adjacent-sibling.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { NodeList } from '../../node-list'; -export declare function adjacentSiblingCombinator(list: NodeList): NodeList; diff --git a/plugins/postcss-extract/dist/selector-engine/combinators/child.d.ts b/plugins/postcss-extract/dist/selector-engine/combinators/child.d.ts deleted file mode 100644 index 8e4098bb0..000000000 --- a/plugins/postcss-extract/dist/selector-engine/combinators/child.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { ChildNode, Container, Document } from 'postcss'; -import type { NodeList } from '../../node-list'; -export declare function childCombinator(list: NodeList): Array | Document>; diff --git a/plugins/postcss-extract/dist/selector-engine/combinators/descendant.d.ts b/plugins/postcss-extract/dist/selector-engine/combinators/descendant.d.ts deleted file mode 100644 index 9851cef73..000000000 --- a/plugins/postcss-extract/dist/selector-engine/combinators/descendant.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { NodeList } from '../../node-list'; -export declare function descendantCombinator(list: NodeList): NodeList; diff --git a/plugins/postcss-extract/dist/selector-engine/combinators/general-sibling.d.ts b/plugins/postcss-extract/dist/selector-engine/combinators/general-sibling.d.ts deleted file mode 100644 index 9a62270da..000000000 --- a/plugins/postcss-extract/dist/selector-engine/combinators/general-sibling.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { NodeList } from '../../node-list'; -export declare function generalSiblingCombinator(list: NodeList): NodeList; diff --git a/plugins/postcss-extract/dist/selector-engine/matchers/attribute.d.ts b/plugins/postcss-extract/dist/selector-engine/matchers/attribute.d.ts deleted file mode 100644 index 2ef515596..000000000 --- a/plugins/postcss-extract/dist/selector-engine/matchers/attribute.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import type { NodeList } from '../../node-list'; -export declare enum AttributeMatchingFlag { - Exact = "", - StartsWith = "^", - EndsWith = "$", - Contains = "*" -} -export declare function matchAttribute(list: NodeList, attributeName: string, attributeValue: string | null | undefined, flag: AttributeMatchingFlag, caseInsensitive?: boolean): NodeList; diff --git a/plugins/postcss-extract/dist/selector-engine/matchers/tag-name.d.ts b/plugins/postcss-extract/dist/selector-engine/matchers/tag-name.d.ts deleted file mode 100644 index b5f60aba3..000000000 --- a/plugins/postcss-extract/dist/selector-engine/matchers/tag-name.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { NodeList } from '../../node-list'; -export declare function matchTagName(list: NodeList, tagName: string): NodeList; diff --git a/plugins/postcss-extract/dist/simplify-ast-nodes.d.ts b/plugins/postcss-extract/dist/simplify-ast-nodes.d.ts deleted file mode 100644 index ae7f8b773..000000000 --- a/plugins/postcss-extract/dist/simplify-ast-nodes.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Node } from 'postcss'; -export declare function simplifyASTNode(node: Node): Record; diff --git a/plugins/postcss-extract/package.json b/plugins/postcss-extract/package.json index 0e46fcdb0..9bab49242 100644 --- a/plugins/postcss-extract/package.json +++ b/plugins/postcss-extract/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-extract/tsconfig.json b/plugins/postcss-extract/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-extract/tsconfig.json +++ b/plugins/postcss-extract/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-focus-visible/dist/index.d.cts b/plugins/postcss-focus-visible/dist/index.d.cts new file mode 100644 index 000000000..45b83274b --- /dev/null +++ b/plugins/postcss-focus-visible/dist/index.d.cts @@ -0,0 +1,13 @@ +import { PluginCreator } from 'postcss'; +/** postcss-focus-visible plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** The replacement class to be used in the polyfill. default: ".focus-visible" */ + replaceWith?: string; + /** Disable the selector prefix that is used to prevent a flash of incorrectly styled content. default: false */ + disablePolyfillReadyClass?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-focus-visible/dist/index.d.mts b/plugins/postcss-focus-visible/dist/index.d.mts new file mode 100644 index 000000000..b59cb64f6 --- /dev/null +++ b/plugins/postcss-focus-visible/dist/index.d.mts @@ -0,0 +1,12 @@ +import { PluginCreator } from 'postcss'; +/** postcss-focus-visible plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** The replacement class to be used in the polyfill. default: ".focus-visible" */ + replaceWith?: string; + /** Disable the selector prefix that is used to prevent a flash of incorrectly styled content. default: false */ + disablePolyfillReadyClass?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-focus-visible/dist/index.d.ts b/plugins/postcss-focus-visible/dist/index.d.ts index be2e9120a..45b83274b 100644 --- a/plugins/postcss-focus-visible/dist/index.d.ts +++ b/plugins/postcss-focus-visible/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-focus-visible plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** The replacement class to be used in the polyfill. default: ".focus-visible" */ @@ -9,4 +9,5 @@ export type pluginOptions = { disablePolyfillReadyClass?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-focus-visible/package.json b/plugins/postcss-focus-visible/package.json index 32b415c34..7e575f2b6 100644 --- a/plugins/postcss-focus-visible/package.json +++ b/plugins/postcss-focus-visible/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-focus-visible/src/index.ts b/plugins/postcss-focus-visible/src/index.ts index 1d2c9fe2c..03c90eae2 100644 --- a/plugins/postcss-focus-visible/src/index.ts +++ b/plugins/postcss-focus-visible/src/index.ts @@ -79,7 +79,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { return [selector]; } - const selectorASTClone = selectorAST.clone(); + const selectorASTClone = selectorAST.clone() as parser.Root /* TODO : delete the "as" clause */; // html > .foo:focus-visible // becomes: @@ -97,7 +97,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { if (i === selectorAST.nodes[0].nodes.length - 1) { // Append the class to the end of the selector if not combinator or pseudo element was found. - selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME })); + selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME }) as unknown as parser.Selector /* TODO : delete the "as" clause */); break; } } @@ -105,8 +105,8 @@ const creator: PluginCreator = (opts?: pluginOptions) => { if (selectorAST.nodes?.[0]?.nodes) { // Prepend a space combinator and the class to the beginning of the selector. - selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' })); - selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME })); + selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' }) as unknown as parser.Selector /* TODO : delete the "as" clause */); + selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME }) as unknown as parser.Selector /* TODO : delete the "as" clause */); } return [selectorAST.toString(), selectorASTClone.toString()]; diff --git a/plugins/postcss-focus-visible/tsconfig.json b/plugins/postcss-focus-visible/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-focus-visible/tsconfig.json +++ b/plugins/postcss-focus-visible/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-focus-within/dist/browser-global.js.map b/plugins/postcss-focus-within/dist/browser-global.js.map index f6bc8f087..4bf089141 100644 --- a/plugins/postcss-focus-within/dist/browser-global.js.map +++ b/plugins/postcss-focus-within/dist/browser-global.js.map @@ -1 +1 @@ -{"version":3,"file":"browser-global.js","sources":["../src/is-valid-replacement.mjs","../src/browser.js","../src/browser-global.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document */\nimport isValidReplacement from './is-valid-replacement.mjs';\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\tconst lastElements = [];\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleFocusChange() {\n\t\tlastElements.forEach(lastElement => remove(lastElement));\n\t\tlastElements.length = 0;\n\n\t\tlet activeElement = document.activeElement;\n\n\t\t// only add focus if it has not been added and is not the document element\n\t\tif (!/^(#document|HTML|BODY)$/.test(Object(activeElement).nodeName)) {\n\t\t\twhile (activeElement && activeElement.nodeType === 1) {\n\t\t\t\tadd(activeElement);\n\t\t\t\tlastElements.push(activeElement);\n\n\t\t\t\tactiveElement = activeElement.parentNode;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport default function focusWithin(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[focus-within]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':focus-within');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handleFocusChange = generateHandler(options.replaceWith);\n\n\tconst initialize = function initializeEventListeners() {\n\t\tif (document.documentElement.className.indexOf('js-focus-within') > -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.className = document.documentElement.className + ' js-focus-within';\n\t\tdocument.addEventListener('focus', handleFocusChange, true);\n\t\tdocument.addEventListener('blur', handleFocusChange, true);\n\t};\n\n\tif (document.readyState === 'complete') {\n\t\tinitialize();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', initialize);\n\t}\n}\n","/* global self,window */\nimport { default as focusWithinInit } from './browser';\n\n(function (global) {\n\tglobal.focusWithinInit = focusWithinInit;\n}('object' === typeof window && window || 'object' === typeof self && self || {}));\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","focusWithin","opts","options","force","replaceWith","Error","document","querySelector","ignoredError","remove","add","lastElements","handleFocusChange","slice","el","classList","removeAttribute","setAttribute","forEach","lastElement","activeElement","test","Object","nodeName","nodeType","push","parentNode","initialize","initializeEventListeners","documentElement","className","addEventListener","readyState","window","self","focusWithinInit"],"mappings":"YAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EAASC,IACzEF,EAASI,QAAQN,EAAsBI,KAAO,IACjDD,GAAU,GAIZ,OAAOA,CACR,CCce,SAASI,YAAYC,GAEnC,IAAMC,EAAU,CACfC,OAAO,EACPC,YAAa,kBAWd,QARoB,IAATH,GAAwB,UAAWA,IAC7CC,EAAQC,MAAQF,EAAKE,YAGF,IAATF,GAAwB,gBAAiBA,IACnDC,EAAQE,YAAcH,EAAKG,cAGvBV,mBAAmBQ,EAAQE,aAC/B,MAAM,IAAIC,MAASH,EAAQE,yFAG5B,IAGC,GAFAE,SAASC,cAAc,kBAElBL,EAAQC,MACZ,MAEF,CAAE,MAAOK,GAAgB,CAEzB,IA9DwBJ,EACpBT,EACAc,EACAC,EACEC,EA0DAC,GA9DkBR,EA8DkBF,EAAQE,YA1D5CO,EAAe,GAEE,MAAnBP,EAAY,IACfT,EAAWS,EAAYS,MAAM,GAC7BJ,EAAS,SAAAA,OAACK,GAAE,OAAKA,EAAGC,UAAUN,OAAOd,EAAS,EAC9Ce,EAAM,SAAAA,IAACI,GAAE,OAAKA,EAAGC,UAAUL,IAAIf,EAAS,IAGxCA,EAAWS,EAAYS,MAAM,GAAI,GACjCJ,EAAS,SAAAA,OAACK,GAAE,OAAKA,EAAGE,gBAAgBrB,EAAU,GAAG,EACjDe,EAAM,SAAAA,IAACI,GAAE,OAAKA,EAAGG,aAAatB,EAAU,GAAG,GAGrC,SAASiB,oBACfD,EAAaO,SAAQ,SAAAC,GAAW,OAAIV,EAAOU,MAC3CR,EAAab,OAAS,EAEtB,IAAIsB,EAAgBd,SAASc,cAG7B,IAAK,0BAA0BC,KAAKC,OAAOF,GAAeG,UACzD,KAAOH,GAA4C,IAA3BA,EAAcI,UACrCd,EAAIU,GACJT,EAAac,KAAKL,GAElBA,EAAgBA,EAAcM,aAmC3BC,EAAa,SAASC,2BACvBtB,SAASuB,gBAAgBC,UAAU/B,QAAQ,oBAAsB,IAIrEO,SAASuB,gBAAgBC,UAAYxB,SAASuB,gBAAgBC,UAAY,mBAC1ExB,SAASyB,iBAAiB,QAASnB,GAAmB,GACtDN,SAASyB,iBAAiB,OAAQnB,GAAmB,KAG1B,aAAxBN,SAAS0B,WACZL,IAEArB,SAASyB,iBAAiB,mBAAoBJ,EAEhD,EC5EE,iBAAoBM,QAAUA,QAAU,iBAAoBC,MAAQA,MAAQ,IADtEC,gBAAkBA"} \ No newline at end of file +{"version":3,"file":"browser-global.js","sources":["../src/is-valid-replacement.js","../src/browser.js","../src/browser-global.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document */\nimport isValidReplacement from './is-valid-replacement.js';\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\tconst lastElements = [];\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleFocusChange() {\n\t\tlastElements.forEach(lastElement => remove(lastElement));\n\t\tlastElements.length = 0;\n\n\t\tlet activeElement = document.activeElement;\n\n\t\t// only add focus if it has not been added and is not the document element\n\t\tif (!/^(#document|HTML|BODY)$/.test(Object(activeElement).nodeName)) {\n\t\t\twhile (activeElement && activeElement.nodeType === 1) {\n\t\t\t\tadd(activeElement);\n\t\t\t\tlastElements.push(activeElement);\n\n\t\t\t\tactiveElement = activeElement.parentNode;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport default function focusWithin(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[focus-within]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':focus-within');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handleFocusChange = generateHandler(options.replaceWith);\n\n\tconst initialize = function initializeEventListeners() {\n\t\tif (document.documentElement.className.indexOf('js-focus-within') > -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.className = document.documentElement.className + ' js-focus-within';\n\t\tdocument.addEventListener('focus', handleFocusChange, true);\n\t\tdocument.addEventListener('blur', handleFocusChange, true);\n\t};\n\n\tif (document.readyState === 'complete') {\n\t\tinitialize();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', initialize);\n\t}\n}\n","/* global self,window */\nimport { default as focusWithinInit } from './browser';\n\n(function (global) {\n\tglobal.focusWithinInit = focusWithinInit;\n}('object' === typeof window && window || 'object' === typeof self && self || {}));\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","focusWithin","opts","options","force","replaceWith","Error","document","querySelector","ignoredError","remove","add","lastElements","handleFocusChange","slice","el","classList","removeAttribute","setAttribute","forEach","lastElement","activeElement","test","Object","nodeName","nodeType","push","parentNode","initialize","initializeEventListeners","documentElement","className","addEventListener","readyState","window","self","focusWithinInit"],"mappings":"YAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EAASC,IACzEF,EAASI,QAAQN,EAAsBI,KAAO,IACjDD,GAAU,GAIZ,OAAOA,CACR,CCce,SAASI,YAAYC,GAEnC,IAAMC,EAAU,CACfC,OAAO,EACPC,YAAa,kBAWd,QARoB,IAATH,GAAwB,UAAWA,IAC7CC,EAAQC,MAAQF,EAAKE,YAGF,IAATF,GAAwB,gBAAiBA,IACnDC,EAAQE,YAAcH,EAAKG,cAGvBV,mBAAmBQ,EAAQE,aAC/B,MAAM,IAAIC,MAASH,EAAQE,yFAG5B,IAGC,GAFAE,SAASC,cAAc,kBAElBL,EAAQC,MACZ,MAEF,CAAE,MAAOK,GAAgB,CAEzB,IA9DwBJ,EACpBT,EACAc,EACAC,EACEC,EA0DAC,GA9DkBR,EA8DkBF,EAAQE,YA1D5CO,EAAe,GAEE,MAAnBP,EAAY,IACfT,EAAWS,EAAYS,MAAM,GAC7BJ,EAAS,SAAAA,OAACK,GAAE,OAAKA,EAAGC,UAAUN,OAAOd,EAAS,EAC9Ce,EAAM,SAAAA,IAACI,GAAE,OAAKA,EAAGC,UAAUL,IAAIf,EAAS,IAGxCA,EAAWS,EAAYS,MAAM,GAAI,GACjCJ,EAAS,SAAAA,OAACK,GAAE,OAAKA,EAAGE,gBAAgBrB,EAAU,GAAG,EACjDe,EAAM,SAAAA,IAACI,GAAE,OAAKA,EAAGG,aAAatB,EAAU,GAAG,GAGrC,SAASiB,oBACfD,EAAaO,SAAQ,SAAAC,GAAW,OAAIV,EAAOU,MAC3CR,EAAab,OAAS,EAEtB,IAAIsB,EAAgBd,SAASc,cAG7B,IAAK,0BAA0BC,KAAKC,OAAOF,GAAeG,UACzD,KAAOH,GAA4C,IAA3BA,EAAcI,UACrCd,EAAIU,GACJT,EAAac,KAAKL,GAElBA,EAAgBA,EAAcM,aAmC3BC,EAAa,SAASC,2BACvBtB,SAASuB,gBAAgBC,UAAU/B,QAAQ,oBAAsB,IAIrEO,SAASuB,gBAAgBC,UAAYxB,SAASuB,gBAAgBC,UAAY,mBAC1ExB,SAASyB,iBAAiB,QAASnB,GAAmB,GACtDN,SAASyB,iBAAiB,OAAQnB,GAAmB,KAG1B,aAAxBN,SAAS0B,WACZL,IAEArB,SAASyB,iBAAiB,mBAAoBJ,EAEhD,EC5EE,iBAAoBM,QAAUA,QAAU,iBAAoBC,MAAQA,MAAQ,IADtEC,gBAAkBA"} \ No newline at end of file diff --git a/plugins/postcss-focus-within/dist/browser.cjs.map b/plugins/postcss-focus-within/dist/browser.cjs.map index a725781d3..139afa337 100644 --- a/plugins/postcss-focus-within/dist/browser.cjs.map +++ b/plugins/postcss-focus-within/dist/browser.cjs.map @@ -1 +1 @@ -{"version":3,"file":"browser.cjs","sources":["../src/is-valid-replacement.mjs","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document */\nimport isValidReplacement from './is-valid-replacement.mjs';\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\tconst lastElements = [];\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleFocusChange() {\n\t\tlastElements.forEach(lastElement => remove(lastElement));\n\t\tlastElements.length = 0;\n\n\t\tlet activeElement = document.activeElement;\n\n\t\t// only add focus if it has not been added and is not the document element\n\t\tif (!/^(#document|HTML|BODY)$/.test(Object(activeElement).nodeName)) {\n\t\t\twhile (activeElement && activeElement.nodeType === 1) {\n\t\t\t\tadd(activeElement);\n\t\t\t\tlastElements.push(activeElement);\n\n\t\t\t\tactiveElement = activeElement.parentNode;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport default function focusWithin(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[focus-within]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':focus-within');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handleFocusChange = generateHandler(options.replaceWith);\n\n\tconst initialize = function initializeEventListeners() {\n\t\tif (document.documentElement.className.indexOf('js-focus-within') > -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.className = document.documentElement.className + ' js-focus-within';\n\t\tdocument.addEventListener('focus', handleFocusChange, true);\n\t\tdocument.addEventListener('blur', handleFocusChange, true);\n\t};\n\n\tif (document.readyState === 'complete') {\n\t\tinitialize();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', initialize);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","focusWithin","opts","options","force","replaceWith","Error","document","querySelector","ignoredError","remove","add","lastElements","handleFocusChange","slice","el","classList","removeAttribute","setAttribute","forEach","lastElement","activeElement","test","Object","nodeName","nodeType","push","parentNode","initialize","initializeEventListeners","documentElement","className","addEventListener","readyState"],"mappings":"AAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EAASC,IACzEF,EAASI,QAAQN,EAAsBI,KAAO,IACjDD,GAAU,GAIZ,OAAOA,CACR,gBCce,SAASI,YAAYC,GAEnC,IAAMC,EAAU,CACfC,OAAO,EACPC,YAAa,kBAWd,QARoB,IAATH,GAAwB,UAAWA,IAC7CC,EAAQC,MAAQF,EAAKE,YAGF,IAAT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browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document */\nimport isValidReplacement from './is-valid-replacement.js';\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\tconst lastElements = [];\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleFocusChange() {\n\t\tlastElements.forEach(lastElement => remove(lastElement));\n\t\tlastElements.length = 0;\n\n\t\tlet activeElement = document.activeElement;\n\n\t\t// only add focus if it has not been added and is not the document element\n\t\tif (!/^(#document|HTML|BODY)$/.test(Object(activeElement).nodeName)) {\n\t\t\twhile (activeElement && activeElement.nodeType === 1) {\n\t\t\t\tadd(activeElement);\n\t\t\t\tlastElements.push(activeElement);\n\n\t\t\t\tactiveElement = activeElement.parentNode;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport default function focusWithin(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[focus-within]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':focus-within');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handleFocusChange = generateHandler(options.replaceWith);\n\n\tconst initialize = function initializeEventListeners() {\n\t\tif (document.documentElement.className.indexOf('js-focus-within') > -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.className = document.documentElement.className + ' js-focus-within';\n\t\tdocument.addEventListener('focus', handleFocusChange, true);\n\t\tdocument.addEventListener('blur', handleFocusChange, true);\n\t};\n\n\tif (document.readyState === 'complete') {\n\t\tinitialize();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', initialize);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","focusWithin","opts","options","force","replaceWith","Error","document","querySelector","ignoredError","remove","add","lastElements","handleFocusChange","slice","el","classList","removeAttribute","setAttribute","forEach","lastElement","activeElement","test","Object","nodeName","nodeType","push","parentNode","initialize","initializeEventListeners","documentElement","className","addEventListener","readyState"],"mappings":"AAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD,EAAIC,GAAUF,EAASC,IACzEF,EAASI,QAAQN,EAAsBI,KAAO,IACjDD,GAAU,GAIZ,OAAOA,CACR,gBCce,SAASI,YAAYC,GAEnC,IAAMC,EAAU,CACfC,OAAO,EACPC,YAAa,kBAWd,QARoB,IAATH,GAAwB,UAAWA,IAC7CC,EAAQC,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dist/browser.mjs.map b/plugins/postcss-focus-within/dist/browser.mjs.map index 66b4ca10e..6894dde46 100644 --- a/plugins/postcss-focus-within/dist/browser.mjs.map +++ b/plugins/postcss-focus-within/dist/browser.mjs.map @@ -1 +1 @@ -{"version":3,"file":"browser.mjs","sources":["../src/is-valid-replacement.mjs","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document */\nimport isValidReplacement from './is-valid-replacement.mjs';\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\tconst lastElements = [];\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleFocusChange() {\n\t\tlastElements.forEach(lastElement => remove(lastElement));\n\t\tlastElements.length = 0;\n\n\t\tlet activeElement = document.activeElement;\n\n\t\t// only add focus if it has not been added and is not the document element\n\t\tif (!/^(#document|HTML|BODY)$/.test(Object(activeElement).nodeName)) {\n\t\t\twhile (activeElement && activeElement.nodeType === 1) {\n\t\t\t\tadd(activeElement);\n\t\t\t\tlastElements.push(activeElement);\n\n\t\t\t\tactiveElement = activeElement.parentNode;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport default function focusWithin(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[focus-within]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':focus-within');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handleFocusChange = generateHandler(options.replaceWith);\n\n\tconst initialize = function initializeEventListeners() {\n\t\tif (document.documentElement.className.indexOf('js-focus-within') > -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.className = document.documentElement.className + ' js-focus-within';\n\t\tdocument.addEventListener('focus', handleFocusChange, true);\n\t\tdocument.addEventListener('blur', handleFocusChange, true);\n\t};\n\n\tif (document.readyState === 'complete') {\n\t\tinitialize();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', initialize);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","focusWithin","opts","options","force","replaceWith","Error","document","querySelector","ignoredError","remove","add","lastElements","handleFocusChange","slice","el","classList","removeAttribute","setAttribute","forEach","lastElement","activeElement","test","Object","nodeName","nodeType","push","parentNode","initialize","initializeEventListeners","documentElement","className","addEventListener","readyState"],"mappings":"AAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAGC,EAASL,EAAsBK,OAAQD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gBAAgBC,UAAY,mBAC1ExB,SAASyB,iBAAiB,QAASnB,GAAmB,GACtDN,SAASyB,iBAAiB,OAAQnB,GAAmB,KAG1B,aAAxBN,SAAS0B,WACZL,IAEArB,SAASyB,iBAAiB,mBAAoBJ,EAEhD"} \ No newline at end of file +{"version":3,"file":"browser.mjs","sources":["../src/is-valid-replacement.js","../src/browser.js"],"sourcesContent":["const INVALID_SELECTOR_CHAR = [\n\t' ', // Can't use child selector\n\t'>', // Can't use direct child selector\n\t'~', // Can't use sibling selector\n\t':', // Can't use pseudo selector\n\t'+', // Can't use adjacent selector\n\t'@', // Can't use at\n\t'#', // Can't use id selector\n\t'(', // Can't use parenthesis\n\t')', // Can't use parenthesis\n];\n\nexport default function isValidReplacement(selector) {\n\tlet isValid = true;\n\n\t// Purposely archaic so it's interoperable in old browsers\n\tfor (let i = 0, length = INVALID_SELECTOR_CHAR.length; i < length && isValid; i++) {\n\t\tif (selector.indexOf(INVALID_SELECTOR_CHAR[i]) > -1) {\n\t\t\tisValid = false;\n\t\t}\n\t}\n\n\treturn isValid;\n}\n","/* global document */\nimport isValidReplacement from './is-valid-replacement.js';\nfunction generateHandler(replaceWith) {\n\tlet selector;\n\tlet remove;\n\tlet add;\n\tconst lastElements = [];\n\n\tif (replaceWith[0] === '.') {\n\t\tselector = replaceWith.slice(1);\n\t\tremove = (el) => el.classList.remove(selector);\n\t\tadd = (el) => el.classList.add(selector);\n\t} else {\n\t\t// A bit naive\n\t\tselector = replaceWith.slice(1, -1);\n\t\tremove = (el) => el.removeAttribute(selector, '');\n\t\tadd = (el) => el.setAttribute(selector, '');\n\t}\n\n\treturn function handleFocusChange() {\n\t\tlastElements.forEach(lastElement => remove(lastElement));\n\t\tlastElements.length = 0;\n\n\t\tlet activeElement = document.activeElement;\n\n\t\t// only add focus if it has not been added and is not the document element\n\t\tif (!/^(#document|HTML|BODY)$/.test(Object(activeElement).nodeName)) {\n\t\t\twhile (activeElement && activeElement.nodeType === 1) {\n\t\t\t\tadd(activeElement);\n\t\t\t\tlastElements.push(activeElement);\n\n\t\t\t\tactiveElement = activeElement.parentNode;\n\t\t\t}\n\t\t}\n\t};\n}\n\nexport default function focusWithin(opts) {\n\t// configuration\n\tconst options = {\n\t\tforce: false,\n\t\treplaceWith: '[focus-within]',\n\t};\n\n\tif (typeof opts !== 'undefined' && 'force' in opts) {\n\t\toptions.force = opts.force;\n\t}\n\n\tif (typeof opts !== 'undefined' && 'replaceWith' in opts) {\n\t\toptions.replaceWith = opts.replaceWith;\n\t}\n\n\tif (!isValidReplacement(options.replaceWith)) {\n\t\tthrow new Error(`${options.replaceWith} is not a valid replacement since it can't be applied to single elements.`);\n\t}\n\n\ttry {\n\t\tdocument.querySelector(':focus-within');\n\n\t\tif (!options.force) {\n\t\t\treturn;\n\t\t}\n\t} catch (ignoredError) { /* do nothing and continue */ }\n\n\tconst handleFocusChange = generateHandler(options.replaceWith);\n\n\tconst initialize = function initializeEventListeners() {\n\t\tif (document.documentElement.className.indexOf('js-focus-within') > -1) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument.documentElement.className = document.documentElement.className + ' js-focus-within';\n\t\tdocument.addEventListener('focus', handleFocusChange, true);\n\t\tdocument.addEventListener('blur', handleFocusChange, true);\n\t};\n\n\tif (document.readyState === 'complete') {\n\t\tinitialize();\n\t} else {\n\t\tdocument.addEventListener('DOMContentLoaded', initialize);\n\t}\n}\n"],"names":["INVALID_SELECTOR_CHAR","isValidReplacement","selector","isValid","i","length","indexOf","focusWithin","opts","options","force","replaceWith","Error","document","querySelector","ignoredError","remove","add","lastElements","handleFocusChange","slice","el","classList","removeAttribute","setAttribute","forEach","lastElement","activeElement","test","Object","nodeName","nodeType","push","parentNode","initialize","initializeEventListeners","documentElement","className","addEventListener","readyState"],"mappings":"AAAA,IAAMA,EAAwB,CAC7B,IACA,IACA,IACA,IACA,IACA,IACA,IACA,IACA,KAGc,SAASC,mBAAmBC,GAI1C,IAHA,IAAIC,GAAU,EAGLC,EAAI,EAAG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AAgBC,UAAYxB,SAASuB,gBAAgBC,UAAY,mBAC1ExB,SAASyB,iBAAiB,QAASnB,GAAmB,GACtDN,SAASyB,iBAAiB,OAAQnB,GAAmB,KAG1B,aAAxBN,SAAS0B,WACZL,IAEArB,SAASyB,iBAAiB,mBAAoBJ,EAEhD"} \ No newline at end of file diff --git a/plugins/postcss-focus-within/dist/index.d.cts b/plugins/postcss-focus-within/dist/index.d.cts new file mode 100644 index 000000000..b62d3eb55 --- /dev/null +++ b/plugins/postcss-focus-within/dist/index.d.cts @@ -0,0 +1,13 @@ +import { PluginCreator } from 'postcss'; +/** postcss-focus-within plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** The replacement class to be used in the polyfill. default: "[focus-within]" */ + replaceWith?: string; + /** Disable the selector prefix that is used to prevent a flash of incorrectly styled content. default: false */ + disablePolyfillReadyClass?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-focus-within/dist/index.d.mts b/plugins/postcss-focus-within/dist/index.d.mts new file mode 100644 index 000000000..fd6ee2a25 --- /dev/null +++ b/plugins/postcss-focus-within/dist/index.d.mts @@ -0,0 +1,12 @@ +import { PluginCreator } from 'postcss'; +/** postcss-focus-within plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** The replacement class to be used in the polyfill. default: "[focus-within]" */ + replaceWith?: string; + /** Disable the selector prefix that is used to prevent a flash of incorrectly styled content. default: false */ + disablePolyfillReadyClass?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-focus-within/dist/index.d.ts b/plugins/postcss-focus-within/dist/index.d.ts index 864b359f3..b62d3eb55 100644 --- a/plugins/postcss-focus-within/dist/index.d.ts +++ b/plugins/postcss-focus-within/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-focus-within plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** The replacement class to be used in the polyfill. default: "[focus-within]" */ @@ -9,4 +9,5 @@ export type pluginOptions = { disablePolyfillReadyClass?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-focus-within/package.json b/plugins/postcss-focus-within/package.json index 4448e193f..2eca55577 100644 --- a/plugins/postcss-focus-within/package.json +++ b/plugins/postcss-focus-within/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./browser": { "import": "./dist/browser.mjs", diff --git a/plugins/postcss-focus-within/src/browser.js b/plugins/postcss-focus-within/src/browser.js index 72234467f..fcc3a50ab 100644 --- a/plugins/postcss-focus-within/src/browser.js +++ b/plugins/postcss-focus-within/src/browser.js @@ -1,5 +1,5 @@ /* global document */ -import isValidReplacement from './is-valid-replacement.mjs'; +import isValidReplacement from './is-valid-replacement.js'; function generateHandler(replaceWith) { let selector; let remove; diff --git a/plugins/postcss-focus-within/src/index.ts b/plugins/postcss-focus-within/src/index.ts index 4c59579fb..f48d5fa58 100644 --- a/plugins/postcss-focus-within/src/index.ts +++ b/plugins/postcss-focus-within/src/index.ts @@ -1,6 +1,6 @@ import parser from 'postcss-selector-parser'; import type { PluginCreator } from 'postcss'; -import isValidReplacement from './is-valid-replacement.mjs'; +import isValidReplacement from './is-valid-replacement.js'; /** postcss-focus-within plugin options */ export type pluginOptions = { @@ -91,7 +91,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { return [selector]; } - const selectorASTClone = selectorAST.clone(); + const selectorASTClone = selectorAST.clone() as parser.Root /* TODO : delete the "as" clause */; // html > .foo:focus-within // becomes: @@ -109,7 +109,7 @@ const creator: PluginCreator = (opts?: pluginOptions) => { if (i === selectorAST.nodes[0].nodes.length - 1) { // Append the class to the end of the selector if not combinator or pseudo element was found. - selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME })); + selectorAST.nodes[0].append(parser.className({ value: POLYFILL_READY_CLASSNAME }) as unknown as parser.Selector /* TODO : delete the "as" clause */); break; } } @@ -117,8 +117,8 @@ const creator: PluginCreator = (opts?: pluginOptions) => { if (selectorAST.nodes?.[0]?.nodes) { // Prepend a space combinator and the class to the beginning of the selector. - selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' })); - selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME })); + selectorASTClone.nodes[0].prepend(parser.combinator({ value: ' ' }) as unknown as parser.Selector /* TODO : delete the "as" clause */); + selectorASTClone.nodes[0].prepend(parser.className({ value: POLYFILL_READY_CLASSNAME }) as unknown as parser.Selector /* TODO : delete the "as" clause */); } return [selectorAST.toString(), selectorASTClone.toString()]; diff --git a/plugins/postcss-focus-within/src/is-valid-replacement.d.mts b/plugins/postcss-focus-within/src/is-valid-replacement.d.ts similarity index 100% rename from plugins/postcss-focus-within/src/is-valid-replacement.d.mts rename to plugins/postcss-focus-within/src/is-valid-replacement.d.ts diff --git a/plugins/postcss-focus-within/src/is-valid-replacement.mjs b/plugins/postcss-focus-within/src/is-valid-replacement.js similarity index 100% rename from plugins/postcss-focus-within/src/is-valid-replacement.mjs rename to plugins/postcss-focus-within/src/is-valid-replacement.js diff --git a/plugins/postcss-focus-within/tsconfig.json b/plugins/postcss-focus-within/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-focus-within/tsconfig.json +++ b/plugins/postcss-focus-within/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-font-format-keywords/dist/has-fallback-decl.d.ts b/plugins/postcss-font-format-keywords/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-font-format-keywords/dist/index.d.cts b/plugins/postcss-font-format-keywords/dist/index.d.cts new file mode 100644 index 000000000..5b5076c52 --- /dev/null +++ b/plugins/postcss-font-format-keywords/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-font-format-keywords plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-font-format-keywords/dist/index.d.mts b/plugins/postcss-font-format-keywords/dist/index.d.mts new file mode 100644 index 000000000..e886d1860 --- /dev/null +++ b/plugins/postcss-font-format-keywords/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-font-format-keywords plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-font-format-keywords/dist/index.d.ts b/plugins/postcss-font-format-keywords/dist/index.d.ts index 08f712031..5b5076c52 100644 --- a/plugins/postcss-font-format-keywords/dist/index.d.ts +++ b/plugins/postcss-font-format-keywords/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-font-format-keywords plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-font-format-keywords/package.json b/plugins/postcss-font-format-keywords/package.json index 2f41adca7..ca3179530 100644 --- a/plugins/postcss-font-format-keywords/package.json +++ b/plugins/postcss-font-format-keywords/package.json @@ -17,15 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-font-format-keywords/tsconfig.json b/plugins/postcss-font-format-keywords/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-font-format-keywords/tsconfig.json +++ b/plugins/postcss-font-format-keywords/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-gamut-mapping/dist/has-conditional-ancestor.d.ts b/plugins/postcss-gamut-mapping/dist/has-conditional-ancestor.d.ts deleted file mode 100644 index 7c0862708..000000000 --- a/plugins/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/plugins/postcss-gamut-mapping/dist/has-override-decl.d.ts b/plugins/postcss-gamut-mapping/dist/has-override-decl.d.ts deleted file mode 100644 index e98c4f8ab..000000000 --- a/plugins/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/plugins/postcss-gamut-mapping/dist/index.d.cts b/plugins/postcss-gamut-mapping/dist/index.d.cts new file mode 100644 index 000000000..6c2272132 --- /dev/null +++ b/plugins/postcss-gamut-mapping/dist/index.d.cts @@ -0,0 +1,6 @@ +import { PluginCreator } from 'postcss'; +/** postcss-gamut-mapping plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-gamut-mapping/dist/index.d.mts b/plugins/postcss-gamut-mapping/dist/index.d.mts new file mode 100644 index 000000000..7331c276c --- /dev/null +++ b/plugins/postcss-gamut-mapping/dist/index.d.mts @@ -0,0 +1,5 @@ +import { PluginCreator } from 'postcss'; +/** postcss-gamut-mapping plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-gamut-mapping/dist/index.d.ts b/plugins/postcss-gamut-mapping/dist/index.d.ts index cf42343c3..6c2272132 100644 --- a/plugins/postcss-gamut-mapping/dist/index.d.ts +++ b/plugins/postcss-gamut-mapping/dist/index.d.ts @@ -1,5 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-gamut-mapping plugin options */ -export type pluginOptions = never; +type pluginOptions = never; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-gamut-mapping/package.json b/plugins/postcss-gamut-mapping/package.json index 452555188..cd1df9778 100644 --- a/plugins/postcss-gamut-mapping/package.json +++ b/plugins/postcss-gamut-mapping/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-gamut-mapping/tsconfig.json b/plugins/postcss-gamut-mapping/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-gamut-mapping/tsconfig.json +++ b/plugins/postcss-gamut-mapping/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-gap-properties/dist/index.d.cts b/plugins/postcss-gap-properties/dist/index.d.cts new file mode 100644 index 000000000..81bbf8456 --- /dev/null +++ b/plugins/postcss-gap-properties/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-gap-properties plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-gap-properties/dist/index.d.mts b/plugins/postcss-gap-properties/dist/index.d.mts new file mode 100644 index 000000000..cc301f0c6 --- /dev/null +++ b/plugins/postcss-gap-properties/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-gap-properties plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-gap-properties/dist/index.d.ts b/plugins/postcss-gap-properties/dist/index.d.ts index 8330bff7f..81bbf8456 100644 --- a/plugins/postcss-gap-properties/dist/index.d.ts +++ b/plugins/postcss-gap-properties/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-gap-properties plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-gap-properties/package.json b/plugins/postcss-gap-properties/package.json index bea3e4b26..7ff8e3a2b 100644 --- a/plugins/postcss-gap-properties/package.json +++ b/plugins/postcss-gap-properties/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-gap-properties/tsconfig.json b/plugins/postcss-gap-properties/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-gap-properties/tsconfig.json +++ b/plugins/postcss-gap-properties/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-global-data/dist/index.d.cts b/plugins/postcss-global-data/dist/index.d.cts new file mode 100644 index 000000000..29a5e1f8f --- /dev/null +++ b/plugins/postcss-global-data/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-global-data plugin options */ +type pluginOptions = { + /** List of files to be used as context */ + files?: Array; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-global-data/dist/index.d.mts b/plugins/postcss-global-data/dist/index.d.mts new file mode 100644 index 000000000..badfb07b8 --- /dev/null +++ b/plugins/postcss-global-data/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-global-data plugin options */ +type pluginOptions = { + /** List of files to be used as context */ + files?: Array; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-global-data/dist/index.d.ts b/plugins/postcss-global-data/dist/index.d.ts index 2fe0a07c8..29a5e1f8f 100644 --- a/plugins/postcss-global-data/dist/index.d.ts +++ b/plugins/postcss-global-data/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-global-data plugin options */ -export type pluginOptions = { +type pluginOptions = { /** List of files to be used as context */ files?: Array; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-global-data/dist/parse-import.d.ts b/plugins/postcss-global-data/dist/parse-import.d.ts deleted file mode 100644 index 63a0b8369..000000000 --- a/plugins/postcss-global-data/dist/parse-import.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Helpers, Root } from 'postcss'; -export declare function parseImport(root: Root, postcssHelpers: Helpers, filePath: string, alreadyImported: Set): false | Root; diff --git a/plugins/postcss-global-data/package.json b/plugins/postcss-global-data/package.json index 345a9d3d5..d7dc93764 100644 --- a/plugins/postcss-global-data/package.json +++ b/plugins/postcss-global-data/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-global-data/tsconfig.json b/plugins/postcss-global-data/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-global-data/tsconfig.json +++ b/plugins/postcss-global-data/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts b/plugins/postcss-gradients-interpolation-method/dist/color-stop-list.d.ts deleted file mode 100644 index 4159c39fc..000000000 --- a/plugins/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/plugins/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts b/plugins/postcss-gradients-interpolation-method/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-gradients-interpolation-method/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/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/plugins/postcss-gradients-interpolation-method/dist/index.cjs b/plugins/postcss-gradients-interpolation-method/dist/index.cjs index 78741d124..9912a4d1a 100644 --- a/plugins/postcss-gradients-interpolation-method/dist/index.cjs +++ b/plugins/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}),null!=e&&e.preserve||n.remove()}});basePlugin.postcss=!0;const creator=o=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},o);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[e(),basePlugin(t)]}:basePlugin(t)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-gradients-interpolation-method/dist/index.d.cts b/plugins/postcss-gradients-interpolation-method/dist/index.d.cts new file mode 100644 index 000000000..93212f5f4 --- /dev/null +++ b/plugins/postcss-gradients-interpolation-method/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +/** postcss-gradients-interpolation-method plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-gradients-interpolation-method/dist/index.d.mts b/plugins/postcss-gradients-interpolation-method/dist/index.d.mts new file mode 100644 index 000000000..31ba9749a --- /dev/null +++ b/plugins/postcss-gradients-interpolation-method/dist/index.d.mts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** postcss-gradients-interpolation-method plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-gradients-interpolation-method/dist/index.d.ts b/plugins/postcss-gradients-interpolation-method/dist/index.d.ts index 0520e9654..93212f5f4 100644 --- a/plugins/postcss-gradients-interpolation-method/dist/index.d.ts +++ b/plugins/postcss-gradients-interpolation-method/dist/index.d.ts @@ -1,10 +1,11 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-gradients-interpolation-method plugin options */ -export type pluginOptions = { +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; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-gradients-interpolation-method/dist/index.mjs b/plugins/postcss-gradients-interpolation-method/dist/index.mjs index ffbfa92c2..0fb9a098e 100644 --- a/plugins/postcss-gradients-interpolation-method/dist/index.mjs +++ b/plugins/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 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}),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}),null!=o&&o.preserve||e.remove()}});basePlugin.postcss=!0;const creator=e=>{const t=Object.assign({enableProgressiveCustomProperties:!0,preserve:!0},e);return t.enableProgressiveCustomProperties?{postcssPlugin:"postcss-gradients-interpolation-method",plugins:[o(),basePlugin(t)]}:basePlugin(t)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-gradients-interpolation-method/dist/is-gradient.d.ts b/plugins/postcss-gradients-interpolation-method/dist/is-gradient.d.ts deleted file mode 100644 index 2d83e89ed..000000000 --- a/plugins/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/plugins/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts b/plugins/postcss-gradients-interpolation-method/dist/modify-gradient-component-values.d.ts deleted file mode 100644 index 6917bedab..000000000 --- a/plugins/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/plugins/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts b/plugins/postcss-gradients-interpolation-method/dist/parse-color-stops.d.ts deleted file mode 100644 index 0342da5c6..000000000 --- a/plugins/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/plugins/postcss-gradients-interpolation-method/package.json b/plugins/postcss-gradients-interpolation-method/package.json index b6fdb43e8..21c88f405 100644 --- a/plugins/postcss-gradients-interpolation-method/package.json +++ b/plugins/postcss-gradients-interpolation-method/package.json @@ -17,15 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-gradients-interpolation-method/src/index.ts b/plugins/postcss-gradients-interpolation-method/src/index.ts index 2f4edce5b..48df63d78 100644 --- a/plugins/postcss-gradients-interpolation-method/src/index.ts +++ b/plugins/postcss-gradients-interpolation-method/src/index.ts @@ -85,7 +85,7 @@ export type pluginOptions = { }; /* Transform gradients with interpolation methods in CSS. */ -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ enableProgressiveCustomProperties: true, preserve: true, @@ -104,6 +104,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-gradients-interpolation-method/tsconfig.json b/plugins/postcss-gradients-interpolation-method/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-gradients-interpolation-method/tsconfig.json +++ b/plugins/postcss-gradients-interpolation-method/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-hwb-function/dist/has-fallback-decl.d.ts b/plugins/postcss-hwb-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-hwb-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index 7fbe0b290..000000000 --- a/plugins/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/plugins/postcss-hwb-function/dist/index.cjs b/plugins/postcss-hwb-function/dist/index.cjs index 1aae9a5f5..95e59d922 100644 --- a/plugins/postcss-hwb-function/dist/index.cjs +++ b/plugins/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: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; +"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: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)}creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-hwb-function/dist/index.d.cts b/plugins/postcss-hwb-function/dist/index.d.cts new file mode 100644 index 000000000..f4583bbdd --- /dev/null +++ b/plugins/postcss-hwb-function/dist/index.d.cts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** postcss-hwb-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +/** Transform hwb() functions in CSS. */ +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-hwb-function/dist/index.d.mts b/plugins/postcss-hwb-function/dist/index.d.mts new file mode 100644 index 000000000..cf6451182 --- /dev/null +++ b/plugins/postcss-hwb-function/dist/index.d.mts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-hwb-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +/** Transform hwb() functions in CSS. */ +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-hwb-function/dist/index.d.ts b/plugins/postcss-hwb-function/dist/index.d.ts index 0304f878c..f4583bbdd 100644 --- a/plugins/postcss-hwb-function/dist/index.d.ts +++ b/plugins/postcss-hwb-function/dist/index.d.ts @@ -1,9 +1,10 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-hwb-function plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; /** Transform hwb() functions in CSS. */ -declare const postcssPlugin: PluginCreator; -export default postcssPlugin; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-hwb-function/dist/index.mjs b/plugins/postcss-hwb-function/dist/index.mjs index f537127da..eaa1f3829 100644 --- a/plugins/postcss-hwb-function/dist/index.mjs +++ b/plugins/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.Experimental))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 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.Experimental))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)}creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-hwb-function/src/index.ts b/plugins/postcss-hwb-function/src/index.ts index 295131339..547a565d0 100644 --- a/plugins/postcss-hwb-function/src/index.ts +++ b/plugins/postcss-hwb-function/src/index.ts @@ -17,7 +17,7 @@ export type pluginOptions = { }; /** Transform hwb() functions in CSS. */ -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const preserve = 'preserve' in Object(opts) ? Boolean(opts?.preserve) : false; return { @@ -90,9 +90,9 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { }; }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; function insertAtSupportsAfterCorrectRule(atSupports: AtRule, parent: Container, params: string) { // Ensure correct order of @supports rules diff --git a/plugins/postcss-hwb-function/tsconfig.json b/plugins/postcss-hwb-function/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-hwb-function/tsconfig.json +++ b/plugins/postcss-hwb-function/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-ic-unit/dist/has-fallback-decl.d.ts b/plugins/postcss-ic-unit/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-ic-unit/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-ic-unit/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/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/plugins/postcss-ic-unit/dist/index.cjs b/plugins/postcss-ic-unit/dist/index.cjs index d85ab48a2..a28183aa9 100644 --- a/plugins/postcss-ic-unit/dist/index.cjs +++ b/plugins/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}),null!=e&&e.preserve||r.remove())}});basePlugin.postcss=!0;const creator=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)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-ic-unit/dist/index.d.cts b/plugins/postcss-ic-unit/dist/index.d.cts new file mode 100644 index 000000000..f04cdee0c --- /dev/null +++ b/plugins/postcss-ic-unit/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +/** postcss-ic-unit plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-ic-unit/dist/index.d.mts b/plugins/postcss-ic-unit/dist/index.d.mts new file mode 100644 index 000000000..660f43cc6 --- /dev/null +++ b/plugins/postcss-ic-unit/dist/index.d.mts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** postcss-ic-unit plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-ic-unit/dist/index.d.ts b/plugins/postcss-ic-unit/dist/index.d.ts index 6900fd7d3..f04cdee0c 100644 --- a/plugins/postcss-ic-unit/dist/index.d.ts +++ b/plugins/postcss-ic-unit/dist/index.d.ts @@ -1,10 +1,11 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-ic-unit plugin options */ -export type pluginOptions = { +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; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-ic-unit/dist/index.mjs b/plugins/postcss-ic-unit/dist/index.mjs index ef0b7a838..2fe22474c 100644 --- a/plugins/postcss-ic-unit/dist/index.mjs +++ b/plugins/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}),null!=e&&e.preserve||r.remove())}});basePlugin.postcss=!0;const creator=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)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-ic-unit/package.json b/plugins/postcss-ic-unit/package.json index e638c94a0..58b14a11a 100644 --- a/plugins/postcss-ic-unit/package.json +++ b/plugins/postcss-ic-unit/package.json @@ -17,15 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-ic-unit/src/index.ts b/plugins/postcss-ic-unit/src/index.ts index 45537fc19..830ba5e24 100644 --- a/plugins/postcss-ic-unit/src/index.ts +++ b/plugins/postcss-ic-unit/src/index.ts @@ -65,7 +65,7 @@ export type pluginOptions = { enableProgressiveCustomProperties?: boolean, }; -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ preserve: false, enableProgressiveCustomProperties: true, @@ -84,6 +84,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-ic-unit/tsconfig.json b/plugins/postcss-ic-unit/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-ic-unit/tsconfig.json +++ b/plugins/postcss-ic-unit/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-image-set-function/dist/has-fallback-decl.d.ts b/plugins/postcss-image-set-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/postcss-image-set-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/plugins/postcss-image-set-function/dist/index.d.cts b/plugins/postcss-image-set-function/dist/index.d.cts new file mode 100644 index 000000000..f2edb6f15 --- /dev/null +++ b/plugins/postcss-image-set-function/dist/index.d.cts @@ -0,0 +1,16 @@ +import { PluginCreator } from 'postcss'; +/** postcss-image-set-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** + * Determine how invalid usage of `image-set()` should be handled. + * By default, invalid usages of `image-set()` are ignored. + * They can be configured to emit a warning with `warn` or throw an exception with `throw`. + * default: 'ignore' + */ + onInvalid?: 'warn' | 'throw' | 'ignore' | false; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-image-set-function/dist/index.d.mts b/plugins/postcss-image-set-function/dist/index.d.mts new file mode 100644 index 000000000..30dffdc76 --- /dev/null +++ b/plugins/postcss-image-set-function/dist/index.d.mts @@ -0,0 +1,15 @@ +import { PluginCreator } from 'postcss'; +/** postcss-image-set-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** + * Determine how invalid usage of `image-set()` should be handled. + * By default, invalid usages of `image-set()` are ignored. + * They can be configured to emit a warning with `warn` or throw an exception with `throw`. + * default: 'ignore' + */ + onInvalid?: 'warn' | 'throw' | 'ignore' | false; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-image-set-function/dist/index.d.ts b/plugins/postcss-image-set-function/dist/index.d.ts index f421c2d74..f2edb6f15 100644 --- a/plugins/postcss-image-set-function/dist/index.d.ts +++ b/plugins/postcss-image-set-function/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-image-set-function plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** @@ -12,4 +12,5 @@ export type pluginOptions = { onInvalid?: 'warn' | 'throw' | 'ignore' | false; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-image-set-function/dist/lib/get-comma.d.ts b/plugins/postcss-image-set-function/dist/lib/get-comma.d.ts deleted file mode 100644 index 77c82734f..000000000 --- a/plugins/postcss-image-set-function/dist/lib/get-comma.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import valueParser from 'postcss-value-parser'; -export declare function getComma(node: valueParser.Node): boolean; diff --git a/plugins/postcss-image-set-function/dist/lib/get-image.d.ts b/plugins/postcss-image-set-function/dist/lib/get-image.d.ts deleted file mode 100644 index 2a1a4d208..000000000 --- a/plugins/postcss-image-set-function/dist/lib/get-image.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import valueParser from 'postcss-value-parser'; -export declare function getImage(node: valueParser.Node): string | false; diff --git a/plugins/postcss-image-set-function/dist/lib/get-media.d.ts b/plugins/postcss-image-set-function/dist/lib/get-media.d.ts deleted file mode 100644 index 324d41088..000000000 --- a/plugins/postcss-image-set-function/dist/lib/get-media.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Declaration, Postcss } from 'postcss'; -import type { Node } from 'postcss-value-parser'; -export declare function getMedia(dpi: number | false, postcss: Postcss, decl: Declaration): false | import("postcss/lib/at-rule").default; -export declare function getMediaDPI(node: Node): number | false; diff --git a/plugins/postcss-image-set-function/dist/lib/handle-invalidation.d.ts b/plugins/postcss-image-set-function/dist/lib/handle-invalidation.d.ts deleted file mode 100644 index 13aad1b43..000000000 --- a/plugins/postcss-image-set-function/dist/lib/handle-invalidation.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Declaration, Result } from 'postcss'; -export declare const handleInvalidation: (opts: { - oninvalid: 'warn' | 'throw' | unknown; - decl: Declaration; - result: Result; -}, message: string, word: string) => void; diff --git a/plugins/postcss-image-set-function/dist/lib/process-image-set.d.ts b/plugins/postcss-image-set-function/dist/lib/process-image-set.d.ts deleted file mode 100644 index 76a38653c..000000000 --- a/plugins/postcss-image-set-function/dist/lib/process-image-set.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { Declaration, Result, Postcss } from 'postcss'; -import type { Node } from 'postcss-value-parser'; -type imageSetFunction = { - imageSetFunction: Node; - imageSetOptionNodes: Array; -}; -export declare const processImageSet: (imageSetFunctions: Array, decl: Declaration, opts: { - decl: Declaration; - oninvalid: 'warn' | 'throw' | 'ignore' | false | undefined; - preserve: boolean; - result: Result; - postcss: Postcss; -}) => void; -export {}; diff --git a/plugins/postcss-image-set-function/package.json b/plugins/postcss-image-set-function/package.json index 8536ac8e3..f975fa64e 100644 --- a/plugins/postcss-image-set-function/package.json +++ b/plugins/postcss-image-set-function/package.json @@ -17,15 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-image-set-function/tsconfig.json b/plugins/postcss-image-set-function/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-image-set-function/tsconfig.json +++ b/plugins/postcss-image-set-function/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-initial/dist/has-fallback-decl.d.ts b/plugins/postcss-initial/dist/has-fallback-decl.d.ts deleted file mode 100644 index c044b7876..000000000 --- a/plugins/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/plugins/postcss-initial/dist/index.d.cts b/plugins/postcss-initial/dist/index.d.cts new file mode 100644 index 000000000..9416234ec --- /dev/null +++ b/plugins/postcss-initial/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-initial plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-initial/dist/index.d.mts b/plugins/postcss-initial/dist/index.d.mts new file mode 100644 index 000000000..942948a4f --- /dev/null +++ b/plugins/postcss-initial/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-initial plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-initial/dist/index.d.ts b/plugins/postcss-initial/dist/index.d.ts index 55f858c1a..9416234ec 100644 --- a/plugins/postcss-initial/dist/index.d.ts +++ b/plugins/postcss-initial/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-initial plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-initial/dist/properties.d.ts b/plugins/postcss-initial/dist/properties.d.ts deleted file mode 100644 index 5345546eb..000000000 --- a/plugins/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/plugins/postcss-initial/package.json b/plugins/postcss-initial/package.json index d5b6e09eb..fa46d5bb4 100644 --- a/plugins/postcss-initial/package.json +++ b/plugins/postcss-initial/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-initial/tsconfig.json b/plugins/postcss-initial/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-initial/tsconfig.json +++ b/plugins/postcss-initial/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-is-pseudo-class/dist/index.d.cts b/plugins/postcss-is-pseudo-class/dist/index.d.cts new file mode 100644 index 000000000..9b664a30c --- /dev/null +++ b/plugins/postcss-is-pseudo-class/dist/index.d.cts @@ -0,0 +1,24 @@ +import { PluginCreator } from 'postcss'; +/** postcss-is-pseudo-class plugin options */ +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. + * default: `does-not-exist`. + */ + specificityMatchingName?: string; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-is-pseudo-class/dist/index.d.mts b/plugins/postcss-is-pseudo-class/dist/index.d.mts new file mode 100644 index 000000000..16eb99cba --- /dev/null +++ b/plugins/postcss-is-pseudo-class/dist/index.d.mts @@ -0,0 +1,23 @@ +import { PluginCreator } from 'postcss'; +/** postcss-is-pseudo-class plugin options */ +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. + * default: `does-not-exist`. + */ + specificityMatchingName?: string; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-is-pseudo-class/dist/index.d.ts b/plugins/postcss-is-pseudo-class/dist/index.d.ts index 5b65f0161..9b664a30c 100644 --- a/plugins/postcss-is-pseudo-class/dist/index.d.ts +++ b/plugins/postcss-is-pseudo-class/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-is-pseudo-class plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** @@ -20,4 +20,5 @@ export type pluginOptions = { specificityMatchingName?: string; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-is-pseudo-class/dist/split-selectors/always-valid.d.ts b/plugins/postcss-is-pseudo-class/dist/split-selectors/always-valid.d.ts deleted file mode 100644 index a3bb60b3c..000000000 --- a/plugins/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/plugins/postcss-is-pseudo-class/dist/split-selectors/complex.d.ts b/plugins/postcss-is-pseudo-class/dist/split-selectors/complex.d.ts deleted file mode 100644 index 904515e72..000000000 --- a/plugins/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/plugins/postcss-is-pseudo-class/dist/split-selectors/complex/child-adjacent-child.d.ts b/plugins/postcss-is-pseudo-class/dist/split-selectors/complex/child-adjacent-child.d.ts deleted file mode 100644 index 644eaaec5..000000000 --- a/plugins/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/plugins/postcss-is-pseudo-class/dist/split-selectors/complex/is-in-compound.d.ts b/plugins/postcss-is-pseudo-class/dist/split-selectors/complex/is-in-compound.d.ts deleted file mode 100644 index 3a91eef6c..000000000 --- a/plugins/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/plugins/postcss-is-pseudo-class/dist/split-selectors/complex/is-pseudo-in-first-compound.d.ts b/plugins/postcss-is-pseudo-class/dist/split-selectors/complex/is-pseudo-in-first-compound.d.ts deleted file mode 100644 index 06ba1481e..000000000 --- a/plugins/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/plugins/postcss-is-pseudo-class/dist/split-selectors/compound-selector-order.d.ts b/plugins/postcss-is-pseudo-class/dist/split-selectors/compound-selector-order.d.ts deleted file mode 100644 index 3fb1e39f4..000000000 --- a/plugins/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/plugins/postcss-is-pseudo-class/dist/split-selectors/split-selectors.d.ts b/plugins/postcss-is-pseudo-class/dist/split-selectors/split-selectors.d.ts deleted file mode 100644 index 7bb70f21d..000000000 --- a/plugins/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/plugins/postcss-is-pseudo-class/package.json b/plugins/postcss-is-pseudo-class/package.json index e6e266d07..ae5713acc 100644 --- a/plugins/postcss-is-pseudo-class/package.json +++ b/plugins/postcss-is-pseudo-class/package.json @@ -17,15 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-is-pseudo-class/tsconfig.json b/plugins/postcss-is-pseudo-class/tsconfig.json index e0d06239c..bb5e4ef3b 100644 --- a/plugins/postcss-is-pseudo-class/tsconfig.json +++ b/plugins/postcss-is-pseudo-class/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": "." + "declarationDir": "dist" }, "include": ["./src/**/*"], "exclude": ["dist"], diff --git a/plugins/postcss-lab-function/dist/has-fallback-decl.d.ts b/plugins/postcss-lab-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/postcss-lab-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/plugins/postcss-lab-function/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-lab-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/postcss-lab-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/plugins/postcss-lab-function/dist/index.cjs b/plugins/postcss-lab-function/dist/index.cjs index 47cda196d..934b8f823 100644 --- a/plugins/postcss-lab-function/dist/index.cjs +++ b/plugins/postcss-lab-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-lab-function",Declaration:n=>{const l=n.value;if(!a.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)&&o.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===l)return;let c=p;null!=e&&e.subFeatures.displayP3&&(c=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(i),(e=>{if(t.isFunctionNode(e)&&o.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}),null!=e&&e.subFeatures.displayP3&&c!==p&&n.cloneBefore({value:c}),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-lab-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-lab-function",Declaration:n=>{const l=n.value;if(!a.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)&&o.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===l)return;let c=p;null!=e&&e.subFeatures.displayP3&&(c=t.stringify(t.replaceComponentValues(t.parseCommaSeparatedListOfComponentValues(i),(e=>{if(t.isFunctionNode(e)&&o.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}),null!=e&&e.subFeatures.displayP3&&c!==p&&n.cloneBefore({value:c}),null!=e&&e.preserve||n.remove()}});basePlugin.postcss=!0;const creator=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-lab-function",plugins:[e(),basePlugin(r)]}:basePlugin(r)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-lab-function/dist/index.d.cts b/plugins/postcss-lab-function/dist/index.d.cts new file mode 100644 index 000000000..38a393413 --- /dev/null +++ b/plugins/postcss-lab-function/dist/index.d.cts @@ -0,0 +1,16 @@ +import { PluginCreator } from 'postcss'; +/** postcss-lab-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-lab-function/dist/index.d.mts b/plugins/postcss-lab-function/dist/index.d.mts new file mode 100644 index 000000000..80d443861 --- /dev/null +++ b/plugins/postcss-lab-function/dist/index.d.mts @@ -0,0 +1,15 @@ +import { PluginCreator } from 'postcss'; +/** postcss-lab-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-lab-function/dist/index.d.ts b/plugins/postcss-lab-function/dist/index.d.ts index e94b09fe8..38a393413 100644 --- a/plugins/postcss-lab-function/dist/index.d.ts +++ b/plugins/postcss-lab-function/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-lab-function plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ @@ -11,5 +11,6 @@ export type pluginOptions = { displayP3?: boolean; }; }; -declare const postcssPlugin: PluginCreator; -export default postcssPlugin; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-lab-function/dist/index.mjs b/plugins/postcss-lab-function/dist/index.mjs index e3479305b..d54e4e59f 100644 --- a/plugins/postcss-lab-function/dist/index.mjs +++ b/plugins/postcss-lab-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-lab-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.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;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-lab-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 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-lab-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.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;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 creator=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-lab-function",plugins:[s(),basePlugin(r)]}:basePlugin(r)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-lab-function/src/index.ts b/plugins/postcss-lab-function/src/index.ts index febfa474e..400a6a462 100644 --- a/plugins/postcss-lab-function/src/index.ts +++ b/plugins/postcss-lab-function/src/index.ts @@ -125,7 +125,7 @@ export type pluginOptions = { }; /* Transform lab() and lch() functions in CSS. */ -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ enableProgressiveCustomProperties: true, preserve: false, @@ -152,6 +152,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-lab-function/tsconfig.json b/plugins/postcss-lab-function/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-lab-function/tsconfig.json +++ b/plugins/postcss-lab-function/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-logical-float-and-clear/dist/index.d.cts b/plugins/postcss-logical-float-and-clear/dist/index.d.cts new file mode 100644 index 000000000..84441a749 --- /dev/null +++ b/plugins/postcss-logical-float-and-clear/dist/index.d.cts @@ -0,0 +1,15 @@ +import { PluginCreator } from 'postcss'; +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 */ +type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-float-and-clear/dist/index.d.mts b/plugins/postcss-logical-float-and-clear/dist/index.d.mts new file mode 100644 index 000000000..7b2b43513 --- /dev/null +++ b/plugins/postcss-logical-float-and-clear/dist/index.d.mts @@ -0,0 +1,14 @@ +import { PluginCreator } from 'postcss'; +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 */ +type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-logical-float-and-clear/dist/index.d.ts b/plugins/postcss-logical-float-and-clear/dist/index.d.ts index 8faa333f6..84441a749 100644 --- a/plugins/postcss-logical-float-and-clear/dist/index.d.ts +++ b/plugins/postcss-logical-float-and-clear/dist/index.d.ts @@ -1,9 +1,15 @@ -import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; +import { PluginCreator } from 'postcss'; +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 = { +type pluginOptions = { /** Sets the direction for inline. default: left-to-right */ inlineDirection?: DirectionFlow; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts b/plugins/postcss-logical-float-and-clear/dist/lib/clone-declaration.d.ts deleted file mode 100644 index 1503bf6f1..000000000 --- a/plugins/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/plugins/postcss-logical-float-and-clear/dist/lib/types.d.ts b/plugins/postcss-logical-float-and-clear/dist/lib/types.d.ts deleted file mode 100644 index 2b3c47f9b..000000000 --- a/plugins/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/plugins/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts b/plugins/postcss-logical-float-and-clear/dist/utils/direction-flow-to-axes.d.ts deleted file mode 100644 index 2652d71d8..000000000 --- a/plugins/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/plugins/postcss-logical-float-and-clear/package.json b/plugins/postcss-logical-float-and-clear/package.json index 5738faeb2..99e99b139 100644 --- a/plugins/postcss-logical-float-and-clear/package.json +++ b/plugins/postcss-logical-float-and-clear/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-logical-float-and-clear/tsconfig.json b/plugins/postcss-logical-float-and-clear/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-logical-float-and-clear/tsconfig.json +++ b/plugins/postcss-logical-float-and-clear/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-logical-overflow/dist/index.d.cts b/plugins/postcss-logical-overflow/dist/index.d.cts new file mode 100644 index 000000000..501bc6a18 --- /dev/null +++ b/plugins/postcss-logical-overflow/dist/index.d.cts @@ -0,0 +1,15 @@ +import { PluginCreator } from 'postcss'; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +/** postcss-logical-overflow plugin options */ +type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-overflow/dist/index.d.mts b/plugins/postcss-logical-overflow/dist/index.d.mts new file mode 100644 index 000000000..cc672f419 --- /dev/null +++ b/plugins/postcss-logical-overflow/dist/index.d.mts @@ -0,0 +1,14 @@ +import { PluginCreator } from 'postcss'; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +/** postcss-logical-overflow plugin options */ +type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-logical-overflow/dist/index.d.ts b/plugins/postcss-logical-overflow/dist/index.d.ts index bd5398afc..501bc6a18 100644 --- a/plugins/postcss-logical-overflow/dist/index.d.ts +++ b/plugins/postcss-logical-overflow/dist/index.d.ts @@ -1,9 +1,15 @@ -import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; +import { PluginCreator } from 'postcss'; +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 type pluginOptions = { +type pluginOptions = { /** Sets the direction for inline. default: left-to-right */ inlineDirection?: DirectionFlow; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-overflow/dist/lib/transform-axes.d.ts b/plugins/postcss-logical-overflow/dist/lib/transform-axes.d.ts deleted file mode 100644 index 2bd08cdfa..000000000 --- a/plugins/postcss-logical-overflow/dist/lib/transform-axes.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function transformAxes(declaration: Declaration, isHorizontal: boolean): void; diff --git a/plugins/postcss-logical-overflow/dist/lib/types.d.ts b/plugins/postcss-logical-overflow/dist/lib/types.d.ts deleted file mode 100644 index 57d34e9f8..000000000 --- a/plugins/postcss-logical-overflow/dist/lib/types.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare enum DirectionFlow { - TopToBottom = "top-to-bottom", - BottomToTop = "bottom-to-top", - RightToLeft = "right-to-left", - LeftToRight = "left-to-right" -} diff --git a/plugins/postcss-logical-overflow/package.json b/plugins/postcss-logical-overflow/package.json index 19ef20a47..c64b3cd30 100644 --- a/plugins/postcss-logical-overflow/package.json +++ b/plugins/postcss-logical-overflow/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-logical-overflow/tsconfig.json b/plugins/postcss-logical-overflow/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-logical-overflow/tsconfig.json +++ b/plugins/postcss-logical-overflow/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-logical-overscroll-behavior/dist/index.d.cts b/plugins/postcss-logical-overscroll-behavior/dist/index.d.cts new file mode 100644 index 000000000..1bf865530 --- /dev/null +++ b/plugins/postcss-logical-overscroll-behavior/dist/index.d.cts @@ -0,0 +1,15 @@ +import { PluginCreator } from 'postcss'; +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 */ +type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-overscroll-behavior/dist/index.d.mts b/plugins/postcss-logical-overscroll-behavior/dist/index.d.mts new file mode 100644 index 000000000..3fab4f233 --- /dev/null +++ b/plugins/postcss-logical-overscroll-behavior/dist/index.d.mts @@ -0,0 +1,14 @@ +import { PluginCreator } from 'postcss'; +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 */ +type pluginOptions = { + /** Sets the direction for inline. default: left-to-right */ + inlineDirection?: DirectionFlow; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-logical-overscroll-behavior/dist/index.d.ts b/plugins/postcss-logical-overscroll-behavior/dist/index.d.ts index b285c6906..1bf865530 100644 --- a/plugins/postcss-logical-overscroll-behavior/dist/index.d.ts +++ b/plugins/postcss-logical-overscroll-behavior/dist/index.d.ts @@ -1,9 +1,15 @@ -import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; +import { PluginCreator } from 'postcss'; +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 type pluginOptions = { +type pluginOptions = { /** Sets the direction for inline. default: left-to-right */ inlineDirection?: DirectionFlow; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-overscroll-behavior/dist/lib/transform-axes.d.ts b/plugins/postcss-logical-overscroll-behavior/dist/lib/transform-axes.d.ts deleted file mode 100644 index 2bd08cdfa..000000000 --- a/plugins/postcss-logical-overscroll-behavior/dist/lib/transform-axes.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function transformAxes(declaration: Declaration, isHorizontal: boolean): void; diff --git a/plugins/postcss-logical-overscroll-behavior/dist/lib/types.d.ts b/plugins/postcss-logical-overscroll-behavior/dist/lib/types.d.ts deleted file mode 100644 index 57d34e9f8..000000000 --- a/plugins/postcss-logical-overscroll-behavior/dist/lib/types.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare enum DirectionFlow { - TopToBottom = "top-to-bottom", - BottomToTop = "bottom-to-top", - RightToLeft = "right-to-left", - LeftToRight = "left-to-right" -} diff --git a/plugins/postcss-logical-overscroll-behavior/package.json b/plugins/postcss-logical-overscroll-behavior/package.json index 65445f671..90fdcc421 100644 --- a/plugins/postcss-logical-overscroll-behavior/package.json +++ b/plugins/postcss-logical-overscroll-behavior/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-logical-overscroll-behavior/tsconfig.json b/plugins/postcss-logical-overscroll-behavior/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-logical-overscroll-behavior/tsconfig.json +++ b/plugins/postcss-logical-overscroll-behavior/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-logical-resize/dist/index.d.cts b/plugins/postcss-logical-resize/dist/index.d.cts new file mode 100644 index 000000000..6c0df86dd --- /dev/null +++ b/plugins/postcss-logical-resize/dist/index.d.cts @@ -0,0 +1,17 @@ +import { PluginCreator } from 'postcss'; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +/** postcss-logical-resize plugin options */ +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 type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-resize/dist/index.d.mts b/plugins/postcss-logical-resize/dist/index.d.mts new file mode 100644 index 000000000..2dcdc26f3 --- /dev/null +++ b/plugins/postcss-logical-resize/dist/index.d.mts @@ -0,0 +1,16 @@ +import { PluginCreator } from 'postcss'; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +/** postcss-logical-resize plugin options */ +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 { creator as default, pluginOptions }; diff --git a/plugins/postcss-logical-resize/dist/index.d.ts b/plugins/postcss-logical-resize/dist/index.d.ts index 0cac31d03..6c0df86dd 100644 --- a/plugins/postcss-logical-resize/dist/index.d.ts +++ b/plugins/postcss-logical-resize/dist/index.d.ts @@ -1,11 +1,17 @@ -import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; +import { PluginCreator } from 'postcss'; +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 = { +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 type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-resize/dist/lib/clone-declaration.d.ts b/plugins/postcss-logical-resize/dist/lib/clone-declaration.d.ts deleted file mode 100644 index 1503bf6f1..000000000 --- a/plugins/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/plugins/postcss-logical-resize/dist/lib/transform-resize.d.ts b/plugins/postcss-logical-resize/dist/lib/transform-resize.d.ts deleted file mode 100644 index 12100551c..000000000 --- a/plugins/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/plugins/postcss-logical-resize/dist/lib/types.d.ts b/plugins/postcss-logical-resize/dist/lib/types.d.ts deleted file mode 100644 index 53dd4d416..000000000 --- a/plugins/postcss-logical-resize/dist/lib/types.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -declare enum Direction { - Block = "block", - Inline = "inline" -} -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; -}; -export {}; diff --git a/plugins/postcss-logical-resize/dist/utils/direction-flow-to-axes.d.ts b/plugins/postcss-logical-resize/dist/utils/direction-flow-to-axes.d.ts deleted file mode 100644 index 2652d71d8..000000000 --- a/plugins/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/plugins/postcss-logical-resize/package.json b/plugins/postcss-logical-resize/package.json index 9fa60ff6d..c1d81c802 100644 --- a/plugins/postcss-logical-resize/package.json +++ b/plugins/postcss-logical-resize/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-logical-resize/tsconfig.json b/plugins/postcss-logical-resize/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-logical-resize/tsconfig.json +++ b/plugins/postcss-logical-resize/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-logical-viewport-units/dist/has-feature.d.ts b/plugins/postcss-logical-viewport-units/dist/has-feature.d.ts deleted file mode 100644 index a902b0da2..000000000 --- a/plugins/postcss-logical-viewport-units/dist/has-feature.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function hasFeature(source: string): boolean; diff --git a/plugins/postcss-logical-viewport-units/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-logical-viewport-units/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/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/plugins/postcss-logical-viewport-units/dist/index.d.cts b/plugins/postcss-logical-viewport-units/dist/index.d.cts new file mode 100644 index 000000000..a712d36fb --- /dev/null +++ b/plugins/postcss-logical-viewport-units/dist/index.d.cts @@ -0,0 +1,17 @@ +import { PluginCreator } from 'postcss'; +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 */ +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 type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-viewport-units/dist/index.d.mts b/plugins/postcss-logical-viewport-units/dist/index.d.mts new file mode 100644 index 000000000..425d1798e --- /dev/null +++ b/plugins/postcss-logical-viewport-units/dist/index.d.mts @@ -0,0 +1,16 @@ +import { PluginCreator } from 'postcss'; +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 */ +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 { creator as default, pluginOptions }; diff --git a/plugins/postcss-logical-viewport-units/dist/index.d.ts b/plugins/postcss-logical-viewport-units/dist/index.d.ts index bf4c6641b..a712d36fb 100644 --- a/plugins/postcss-logical-viewport-units/dist/index.d.ts +++ b/plugins/postcss-logical-viewport-units/dist/index.d.ts @@ -1,11 +1,17 @@ -import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; +import { PluginCreator } from 'postcss'; +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 = { +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 type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical-viewport-units/dist/lib/types.d.ts b/plugins/postcss-logical-viewport-units/dist/lib/types.d.ts deleted file mode 100644 index 57d34e9f8..000000000 --- a/plugins/postcss-logical-viewport-units/dist/lib/types.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export declare enum DirectionFlow { - TopToBottom = "top-to-bottom", - BottomToTop = "bottom-to-top", - RightToLeft = "right-to-left", - LeftToRight = "left-to-right" -} diff --git a/plugins/postcss-logical-viewport-units/dist/transform.d.ts b/plugins/postcss-logical-viewport-units/dist/transform.d.ts deleted file mode 100644 index 0d007ffa5..000000000 --- a/plugins/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/plugins/postcss-logical-viewport-units/package.json b/plugins/postcss-logical-viewport-units/package.json index f20a819d0..3896b9e3e 100644 --- a/plugins/postcss-logical-viewport-units/package.json +++ b/plugins/postcss-logical-viewport-units/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-logical-viewport-units/tsconfig.json b/plugins/postcss-logical-viewport-units/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-logical-viewport-units/tsconfig.json +++ b/plugins/postcss-logical-viewport-units/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-logical/dist/index.d.cts b/plugins/postcss-logical/dist/index.d.cts new file mode 100644 index 000000000..4fe44f1b6 --- /dev/null +++ b/plugins/postcss-logical/dist/index.d.cts @@ -0,0 +1,17 @@ +import { PluginCreator } from 'postcss'; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +/** postcss-logical plugin options */ +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 type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical/dist/index.d.mts b/plugins/postcss-logical/dist/index.d.mts new file mode 100644 index 000000000..0febbeec6 --- /dev/null +++ b/plugins/postcss-logical/dist/index.d.mts @@ -0,0 +1,16 @@ +import { PluginCreator } from 'postcss'; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} +/** postcss-logical plugin options */ +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 { creator as default, pluginOptions }; diff --git a/plugins/postcss-logical/dist/index.d.ts b/plugins/postcss-logical/dist/index.d.ts index 8e84fd80d..4fe44f1b6 100644 --- a/plugins/postcss-logical/dist/index.d.ts +++ b/plugins/postcss-logical/dist/index.d.ts @@ -1,11 +1,17 @@ -import type { PluginCreator } from 'postcss'; -import { DirectionFlow } from './lib/types'; +import { PluginCreator } from 'postcss'; +declare enum DirectionFlow { + TopToBottom = "top-to-bottom", + BottomToTop = "bottom-to-top", + RightToLeft = "right-to-left", + LeftToRight = "left-to-right" +} /** postcss-logical plugin options */ -export type pluginOptions = { +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 type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-logical/dist/lib/clone-declaration.d.ts b/plugins/postcss-logical/dist/lib/clone-declaration.d.ts deleted file mode 100644 index 3aef68c65..000000000 --- a/plugins/postcss-logical/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): Array; diff --git a/plugins/postcss-logical/dist/lib/transform-borders.d.ts b/plugins/postcss-logical/dist/lib/transform-borders.d.ts deleted file mode 100644 index 3da86c21f..000000000 --- a/plugins/postcss-logical/dist/lib/transform-borders.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import type { Declaration } from 'postcss'; -import { DirectionConfig } from './types'; -export declare function transformBorder(borderSetting: string, side: string): (declaration: Declaration) => Array; -export declare function transformBorderProperty(borderSetting: string, side: [string, string]): (declaration: Declaration) => Array; -export declare function transformBorderShorthand(side: [string] | [string, string]): (declaration: Declaration) => Array; -export declare function transformBorderRadius(config: DirectionConfig): (declaration: Declaration) => Array; diff --git a/plugins/postcss-logical/dist/lib/transform-inset.d.ts b/plugins/postcss-logical/dist/lib/transform-inset.d.ts deleted file mode 100644 index 6d028e216..000000000 --- a/plugins/postcss-logical/dist/lib/transform-inset.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function transformInset(): (declaration: Declaration) => Array; diff --git a/plugins/postcss-logical/dist/lib/transform-logical-size.d.ts b/plugins/postcss-logical/dist/lib/transform-logical-size.d.ts deleted file mode 100644 index 9831d2946..000000000 --- a/plugins/postcss-logical/dist/lib/transform-logical-size.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Declaration } from 'postcss'; -import { DirectionConfig } from './types'; -export declare function transformLogicalSize(directionConfig: DirectionConfig): (declaration: Declaration) => Array; diff --git a/plugins/postcss-logical/dist/lib/transform-offset.d.ts b/plugins/postcss-logical/dist/lib/transform-offset.d.ts deleted file mode 100644 index d8bf7e789..000000000 --- a/plugins/postcss-logical/dist/lib/transform-offset.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function transformOffset(prop: string): (declaration: Declaration) => Array; -export declare function transformOffsetShorthand(side: [string, string]): (declaration: Declaration) => Array; diff --git a/plugins/postcss-logical/dist/lib/transform-side.d.ts b/plugins/postcss-logical/dist/lib/transform-side.d.ts deleted file mode 100644 index 56396d740..000000000 --- a/plugins/postcss-logical/dist/lib/transform-side.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function transformSide(prop: string, side: string): (declaration: Declaration) => Array; -export declare function transformSideShorthand(prop: string, side: [string, string]): (declaration: Declaration) => Array; diff --git a/plugins/postcss-logical/dist/lib/transform-text-align.d.ts b/plugins/postcss-logical/dist/lib/transform-text-align.d.ts deleted file mode 100644 index 752a58082..000000000 --- a/plugins/postcss-logical/dist/lib/transform-text-align.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function transformTextAlign(inlineValues: [string, string]): (declaration: Declaration) => Array; diff --git a/plugins/postcss-logical/dist/lib/transform-transition.d.ts b/plugins/postcss-logical/dist/lib/transform-transition.d.ts deleted file mode 100644 index 8745ed168..000000000 --- a/plugins/postcss-logical/dist/lib/transform-transition.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Declaration, Postcss } from 'postcss'; -import { TransformFunction } from './types'; -export declare function transformTransition(declaration: Declaration, postcss: Postcss, transforms: Record): Array; diff --git a/plugins/postcss-logical/dist/lib/transform-value.d.ts b/plugins/postcss-logical/dist/lib/transform-value.d.ts deleted file mode 100644 index 23a30bbb6..000000000 --- a/plugins/postcss-logical/dist/lib/transform-value.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Declaration } from 'postcss'; -import { DirectionConfig } from './types'; -export declare function transformValue(config: DirectionConfig): (declaration: Declaration) => Array; diff --git a/plugins/postcss-logical/dist/lib/transforms.d.ts b/plugins/postcss-logical/dist/lib/transforms.d.ts deleted file mode 100644 index c54791689..000000000 --- a/plugins/postcss-logical/dist/lib/transforms.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { Axes, DirectionConfig, TransformFunction } from './types'; -export declare function prepareTransforms(directionConfig: DirectionConfig, blockStart: Axes, blockEnd: Axes, inlineStart: Axes, inlineEnd: Axes): Record; diff --git a/plugins/postcss-logical/dist/lib/types.d.ts b/plugins/postcss-logical/dist/lib/types.d.ts deleted file mode 100644 index 52166e042..000000000 --- a/plugins/postcss-logical/dist/lib/types.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { Declaration } from 'postcss'; -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; -}; -export type TransformFunction = (decl: Declaration) => Array; -export {}; diff --git a/plugins/postcss-logical/dist/utils/direction-flow-to-axes.d.ts b/plugins/postcss-logical/dist/utils/direction-flow-to-axes.d.ts deleted file mode 100644 index 2652d71d8..000000000 --- a/plugins/postcss-logical/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/plugins/postcss-logical/dist/utils/logical-to-physical.d.ts b/plugins/postcss-logical/dist/utils/logical-to-physical.d.ts deleted file mode 100644 index 764ee732c..000000000 --- a/plugins/postcss-logical/dist/utils/logical-to-physical.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { DirectionConfig } from '../lib/types'; -export declare function logicalToPhysical(logical: string, config: DirectionConfig): string; diff --git a/plugins/postcss-logical/dist/utils/parse-value-couple.d.ts b/plugins/postcss-logical/dist/utils/parse-value-couple.d.ts deleted file mode 100644 index 124566572..000000000 --- a/plugins/postcss-logical/dist/utils/parse-value-couple.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Declaration } from 'postcss'; -export declare function parseValueCouple(declaration: Declaration): [string, string]; diff --git a/plugins/postcss-logical/package.json b/plugins/postcss-logical/package.json index c408b37be..21e51d922 100644 --- a/plugins/postcss-logical/package.json +++ b/plugins/postcss-logical/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-logical/tsconfig.json b/plugins/postcss-logical/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-logical/tsconfig.json +++ b/plugins/postcss-logical/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-media-minmax/dist/index.d.cts b/plugins/postcss-media-minmax/dist/index.d.cts new file mode 100644 index 000000000..64722cfb5 --- /dev/null +++ b/plugins/postcss-media-minmax/dist/index.d.cts @@ -0,0 +1,6 @@ +import { PluginCreator } from 'postcss'; +/** postcss-media-minmax plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-media-minmax/dist/index.d.mts b/plugins/postcss-media-minmax/dist/index.d.mts new file mode 100644 index 000000000..981655ee7 --- /dev/null +++ b/plugins/postcss-media-minmax/dist/index.d.mts @@ -0,0 +1,5 @@ +import { PluginCreator } from 'postcss'; +/** postcss-media-minmax plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-media-minmax/dist/index.d.ts b/plugins/postcss-media-minmax/dist/index.d.ts index f22ef708d..64722cfb5 100644 --- a/plugins/postcss-media-minmax/dist/index.d.ts +++ b/plugins/postcss-media-minmax/dist/index.d.ts @@ -1,5 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-media-minmax plugin options */ -export type pluginOptions = never; +type pluginOptions = never; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-media-minmax/dist/to-lower-case-a-z.d.ts b/plugins/postcss-media-minmax/dist/to-lower-case-a-z.d.ts deleted file mode 100644 index 396b252e7..000000000 --- a/plugins/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/plugins/postcss-media-minmax/dist/transform-single-pair.d.ts b/plugins/postcss-media-minmax/dist/transform-single-pair.d.ts deleted file mode 100644 index 2b3e5ce09..000000000 --- a/plugins/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/plugins/postcss-media-minmax/dist/transform.d.ts b/plugins/postcss-media-minmax/dist/transform.d.ts deleted file mode 100644 index 9bcd62232..000000000 --- a/plugins/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/plugins/postcss-media-minmax/package.json b/plugins/postcss-media-minmax/package.json index 4ac91c9e2..57645d9b9 100644 --- a/plugins/postcss-media-minmax/package.json +++ b/plugins/postcss-media-minmax/package.json @@ -30,15 +30,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-media-minmax/tsconfig.json b/plugins/postcss-media-minmax/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-media-minmax/tsconfig.json +++ b/plugins/postcss-media-minmax/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.cts b/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.cts new file mode 100644 index 000000000..f2ecc2964 --- /dev/null +++ b/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-media-queries-aspect-ratio-number-values plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.mts b/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.mts new file mode 100644 index 000000000..09402a215 --- /dev/null +++ b/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-media-queries-aspect-ratio-number-values plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.ts b/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.ts index 92223f793..f2ecc2964 100644 --- a/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.ts +++ b/plugins/postcss-media-queries-aspect-ratio-number-values/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-media-queries-aspect-ratio-number-values plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-feature-value.d.ts b/plugins/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-feature-value.d.ts deleted file mode 100644 index 1808b9463..000000000 --- a/plugins/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/plugins/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-query-list.d.ts b/plugins/postcss-media-queries-aspect-ratio-number-values/dist/transform-media-query-list.d.ts deleted file mode 100644 index a2fcb6a91..000000000 --- a/plugins/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/plugins/postcss-media-queries-aspect-ratio-number-values/package.json b/plugins/postcss-media-queries-aspect-ratio-number-values/package.json index b7c3b0335..5287e68e1 100644 --- a/plugins/postcss-media-queries-aspect-ratio-number-values/package.json +++ b/plugins/postcss-media-queries-aspect-ratio-number-values/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-media-queries-aspect-ratio-number-values/tsconfig.json b/plugins/postcss-media-queries-aspect-ratio-number-values/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-media-queries-aspect-ratio-number-values/tsconfig.json +++ b/plugins/postcss-media-queries-aspect-ratio-number-values/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-minify/dist/index.d.cts b/plugins/postcss-minify/dist/index.d.cts new file mode 100644 index 000000000..513ea372f --- /dev/null +++ b/plugins/postcss-minify/dist/index.d.cts @@ -0,0 +1,6 @@ +import { PluginCreator } from 'postcss'; +/** postcss-minify plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-minify/dist/index.d.mts b/plugins/postcss-minify/dist/index.d.mts new file mode 100644 index 000000000..e2010f01c --- /dev/null +++ b/plugins/postcss-minify/dist/index.d.mts @@ -0,0 +1,5 @@ +import { PluginCreator } from 'postcss'; +/** postcss-minify plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-minify/dist/index.d.ts b/plugins/postcss-minify/dist/index.d.ts index 89d1b34a1..513ea372f 100644 --- a/plugins/postcss-minify/dist/index.d.ts +++ b/plugins/postcss-minify/dist/index.d.ts @@ -1,5 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-minify plugin options */ -export type pluginOptions = never; +type pluginOptions = never; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-minify/package.json b/plugins/postcss-minify/package.json index 750f3fba5..d6de20b00 100644 --- a/plugins/postcss-minify/package.json +++ b/plugins/postcss-minify/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-minify/tsconfig.json b/plugins/postcss-minify/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-minify/tsconfig.json +++ b/plugins/postcss-minify/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-nested-calc/dist/has-fallback-decl.d.ts b/plugins/postcss-nested-calc/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-nested-calc/dist/index.d.cts b/plugins/postcss-nested-calc/dist/index.d.cts new file mode 100644 index 000000000..346477c48 --- /dev/null +++ b/plugins/postcss-nested-calc/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-nested-calc plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-nested-calc/dist/index.d.mts b/plugins/postcss-nested-calc/dist/index.d.mts new file mode 100644 index 000000000..14db75111 --- /dev/null +++ b/plugins/postcss-nested-calc/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-nested-calc plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-nested-calc/dist/index.d.ts b/plugins/postcss-nested-calc/dist/index.d.ts index 139448bef..346477c48 100644 --- a/plugins/postcss-nested-calc/dist/index.d.ts +++ b/plugins/postcss-nested-calc/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-nested-calc plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-nested-calc/dist/occurrences.d.ts b/plugins/postcss-nested-calc/dist/occurrences.d.ts deleted file mode 100644 index 61f8b7842..000000000 --- a/plugins/postcss-nested-calc/dist/occurrences.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function numberOfCalcOccurrences(value: string): number; diff --git a/plugins/postcss-nested-calc/package.json b/plugins/postcss-nested-calc/package.json index 3f36e0b17..04f3c56c2 100644 --- a/plugins/postcss-nested-calc/package.json +++ b/plugins/postcss-nested-calc/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-nested-calc/tsconfig.json b/plugins/postcss-nested-calc/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-nested-calc/tsconfig.json +++ b/plugins/postcss-nested-calc/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-nesting/dist/index.d.cts b/plugins/postcss-nesting/dist/index.d.cts new file mode 100644 index 000000000..c25e87759 --- /dev/null +++ b/plugins/postcss-nesting/dist/index.d.cts @@ -0,0 +1,11 @@ +import { PluginCreator } from 'postcss'; +/** postcss-nesting plugin options */ +type pluginOptions = { + /** Avoid the `:is()` pseudo class as much as possible. default: false */ + noIsPseudoSelector?: boolean; + /** Silence the `@nest` warning. */ + silenceAtNestWarning?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-nesting/dist/index.d.mts b/plugins/postcss-nesting/dist/index.d.mts new file mode 100644 index 000000000..676229ff3 --- /dev/null +++ b/plugins/postcss-nesting/dist/index.d.mts @@ -0,0 +1,10 @@ +import { PluginCreator } from 'postcss'; +/** postcss-nesting plugin options */ +type pluginOptions = { + /** Avoid the `:is()` pseudo class as much as possible. default: false */ + noIsPseudoSelector?: boolean; + /** Silence the `@nest` warning. */ + silenceAtNestWarning?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-nesting/dist/index.d.ts b/plugins/postcss-nesting/dist/index.d.ts index 777ed3e50..c25e87759 100644 --- a/plugins/postcss-nesting/dist/index.d.ts +++ b/plugins/postcss-nesting/dist/index.d.ts @@ -1,10 +1,11 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-nesting plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Avoid the `:is()` pseudo class as much as possible. default: false */ noIsPseudoSelector?: boolean; /** Silence the `@nest` warning. */ silenceAtNestWarning?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-nesting/dist/lib/ampersand-to-scope.d.ts b/plugins/postcss-nesting/dist/lib/ampersand-to-scope.d.ts deleted file mode 100644 index f82c36f94..000000000 --- a/plugins/postcss-nesting/dist/lib/ampersand-to-scope.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Result, Rule } from 'postcss'; -export default function ampersandToScope(rule: Rule, result: Result): void; diff --git a/plugins/postcss-nesting/dist/lib/atrule-within-atrule.d.ts b/plugins/postcss-nesting/dist/lib/atrule-within-atrule.d.ts deleted file mode 100644 index f06ffa9a7..000000000 --- a/plugins/postcss-nesting/dist/lib/atrule-within-atrule.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { AtRule } from 'postcss'; -export default function transformAtruleWithinAtrule(node: AtRule, parent: AtRule): void; -export declare function isAtruleWithinAtrule(node: AtRule, parent: AtRule): boolean; diff --git a/plugins/postcss-nesting/dist/lib/atrule-within-rule.d.ts b/plugins/postcss-nesting/dist/lib/atrule-within-rule.d.ts deleted file mode 100644 index 3c7c0911c..000000000 --- a/plugins/postcss-nesting/dist/lib/atrule-within-rule.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { options } from './options.js'; -import { walkFunc } from './walk-func.js'; -import type { AtRule, Result, Rule } from 'postcss'; -export default function atruleWithinRule(node: AtRule, parent: Rule, result: Result, walk: walkFunc, opts: options): void; -export declare function isAtruleWithinRule(node: AtRule): boolean; diff --git a/plugins/postcss-nesting/dist/lib/cleanup-parent.d.ts b/plugins/postcss-nesting/dist/lib/cleanup-parent.d.ts deleted file mode 100644 index 5547db143..000000000 --- a/plugins/postcss-nesting/dist/lib/cleanup-parent.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ChildNode, Container } from 'postcss'; -export default function cleanupParent(parent: Container): void; diff --git a/plugins/postcss-nesting/dist/lib/group-declarations.d.ts b/plugins/postcss-nesting/dist/lib/group-declarations.d.ts deleted file mode 100644 index 116434201..000000000 --- a/plugins/postcss-nesting/dist/lib/group-declarations.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ChildNode, Container } from 'postcss'; -export default function groupDeclarations(node: Container): void; diff --git a/plugins/postcss-nesting/dist/lib/is-type-of-rule.d.ts b/plugins/postcss-nesting/dist/lib/is-type-of-rule.d.ts deleted file mode 100644 index d6cb2458e..000000000 --- a/plugins/postcss-nesting/dist/lib/is-type-of-rule.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { AtRule, Node, Rule } from 'postcss'; -export declare function isAtRule(node?: Node): node is AtRule; -export declare function isNestRule(node?: Node): node is AtRule; -export declare function isRule(node?: Node): node is Rule; diff --git a/plugins/postcss-nesting/dist/lib/list.d.ts b/plugins/postcss-nesting/dist/lib/list.d.ts deleted file mode 100644 index 67a64736d..000000000 --- a/plugins/postcss-nesting/dist/lib/list.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function comma(string: string): string[]; diff --git a/plugins/postcss-nesting/dist/lib/merge-params.d.ts b/plugins/postcss-nesting/dist/lib/merge-params.d.ts deleted file mode 100644 index 0547e8f7b..000000000 --- a/plugins/postcss-nesting/dist/lib/merge-params.d.ts +++ /dev/null @@ -1 +0,0 @@ -export default function mergeParams(fromParams: string, toParams: string): string; diff --git a/plugins/postcss-nesting/dist/lib/merge-selectors/combinations-of-size-n.d.ts b/plugins/postcss-nesting/dist/lib/merge-selectors/combinations-of-size-n.d.ts deleted file mode 100644 index 56bbf7231..000000000 --- a/plugins/postcss-nesting/dist/lib/merge-selectors/combinations-of-size-n.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function combinationsWithSizeN(set: Array, n: number): Array>; diff --git a/plugins/postcss-nesting/dist/lib/merge-selectors/compound-selector-order.d.ts b/plugins/postcss-nesting/dist/lib/merge-selectors/compound-selector-order.d.ts deleted file mode 100644 index 3d43458e3..000000000 --- a/plugins/postcss-nesting/dist/lib/merge-selectors/compound-selector-order.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Container, Node } from 'postcss-selector-parser'; -export declare function sortCompoundSelectorsInsideComplexSelector(node: Container): void; diff --git a/plugins/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts b/plugins/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts deleted file mode 100644 index f46fd8d7c..000000000 --- a/plugins/postcss-nesting/dist/lib/merge-selectors/merge-selectors.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { options } from '../options'; -export default function mergeSelectors(fromSelectors: Array, toSelectors: Array, opts: options): any[]; diff --git a/plugins/postcss-nesting/dist/lib/merge-selectors/specificity.d.ts b/plugins/postcss-nesting/dist/lib/merge-selectors/specificity.d.ts deleted file mode 100644 index 2afcbaf90..000000000 --- a/plugins/postcss-nesting/dist/lib/merge-selectors/specificity.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function nodesAreEquallySpecific(nodes: Array): boolean; diff --git a/plugins/postcss-nesting/dist/lib/nest-rule-within-rule.d.ts b/plugins/postcss-nesting/dist/lib/nest-rule-within-rule.d.ts deleted file mode 100644 index a0ea699ba..000000000 --- a/plugins/postcss-nesting/dist/lib/nest-rule-within-rule.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AtRule, Result, Rule } from 'postcss'; -import { walkFunc } from './walk-func.js'; -import { options } from './options.js'; -export default function transformNestRuleWithinRule(node: AtRule, parent: Rule, result: Result, walk: walkFunc, opts: options): void; -export declare function isValidNestRuleWithinRule(node: AtRule): boolean; diff --git a/plugins/postcss-nesting/dist/lib/options.d.ts b/plugins/postcss-nesting/dist/lib/options.d.ts deleted file mode 100644 index 876771840..000000000 --- a/plugins/postcss-nesting/dist/lib/options.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export type options = { - noIsPseudoSelector: boolean; - silenceAtNestWarning: boolean; -}; diff --git a/plugins/postcss-nesting/dist/lib/rule-within-rule.d.ts b/plugins/postcss-nesting/dist/lib/rule-within-rule.d.ts deleted file mode 100644 index 5f733d3b6..000000000 --- a/plugins/postcss-nesting/dist/lib/rule-within-rule.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Result, Rule } from 'postcss'; -import { options } from './options.js'; -export default function transformRuleWithinRule(node: Rule, parent: Rule, result: Result, opts: options): void; -export declare function isValidRuleWithinRule(node: Rule): boolean; diff --git a/plugins/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts b/plugins/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts deleted file mode 100644 index 0876f2ba6..000000000 --- a/plugins/postcss-nesting/dist/lib/shift-nodes-before-parent.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { ChildNode, Container } from 'postcss'; -export default function shiftNodesBeforeParent(node: ChildNode, parent: Container): void; diff --git a/plugins/postcss-nesting/dist/lib/valid-atrules.d.ts b/plugins/postcss-nesting/dist/lib/valid-atrules.d.ts deleted file mode 100644 index d451d2bc5..000000000 --- a/plugins/postcss-nesting/dist/lib/valid-atrules.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: string[]; -export default _default; diff --git a/plugins/postcss-nesting/dist/lib/walk-func.d.ts b/plugins/postcss-nesting/dist/lib/walk-func.d.ts deleted file mode 100644 index 36cff8339..000000000 --- a/plugins/postcss-nesting/dist/lib/walk-func.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import type { Container, Result } from 'postcss'; -export type walkFunc = (node: Container, result: Result, opts: { - noIsPseudoSelector: boolean; -}) => void; diff --git a/plugins/postcss-nesting/dist/lib/walk.d.ts b/plugins/postcss-nesting/dist/lib/walk.d.ts deleted file mode 100644 index b50ece788..000000000 --- a/plugins/postcss-nesting/dist/lib/walk.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { Container, Result } from 'postcss'; -import { options } from './options.js'; -export default function walk(node: Container, result: Result, opts: options): void; diff --git a/plugins/postcss-nesting/tsconfig.json b/plugins/postcss-nesting/tsconfig.json index e0d06239c..bb5e4ef3b 100644 --- a/plugins/postcss-nesting/tsconfig.json +++ b/plugins/postcss-nesting/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": "." + "declarationDir": "dist" }, "include": ["./src/**/*"], "exclude": ["dist"], diff --git a/plugins/postcss-normalize-display-values/dist/index.d.cts b/plugins/postcss-normalize-display-values/dist/index.d.cts new file mode 100644 index 000000000..abb598322 --- /dev/null +++ b/plugins/postcss-normalize-display-values/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-normalize-display-values plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-normalize-display-values/dist/index.d.mts b/plugins/postcss-normalize-display-values/dist/index.d.mts new file mode 100644 index 000000000..8a297da0d --- /dev/null +++ b/plugins/postcss-normalize-display-values/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-normalize-display-values plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-normalize-display-values/dist/index.d.ts b/plugins/postcss-normalize-display-values/dist/index.d.ts index b0606a311..abb598322 100644 --- a/plugins/postcss-normalize-display-values/dist/index.d.ts +++ b/plugins/postcss-normalize-display-values/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-normalize-display-values plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-normalize-display-values/dist/mappings.d.ts b/plugins/postcss-normalize-display-values/dist/mappings.d.ts deleted file mode 100644 index 7ca13f692..000000000 --- a/plugins/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/plugins/postcss-normalize-display-values/package.json b/plugins/postcss-normalize-display-values/package.json index d2fa0fad5..6535e81e6 100644 --- a/plugins/postcss-normalize-display-values/package.json +++ b/plugins/postcss-normalize-display-values/package.json @@ -17,15 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-normalize-display-values/tsconfig.json b/plugins/postcss-normalize-display-values/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-normalize-display-values/tsconfig.json +++ b/plugins/postcss-normalize-display-values/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-oklab-function/dist/has-fallback-decl.d.ts b/plugins/postcss-oklab-function/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-oklab-function/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-oklab-function/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/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/plugins/postcss-oklab-function/dist/index.cjs b/plugins/postcss-oklab-function/dist/index.cjs index d335abe0f..edac2196a 100644 --- a/plugins/postcss-oklab-function/dist/index.cjs +++ b/plugins/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.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===l)return;let c=p;null!=e&&e.subFeatures.displayP3&&(c=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:p}),null!=e&&e.subFeatures.displayP3&&c!==p&&n.cloneBefore({value:c}),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 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.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===l)return;let c=p;null!=e&&e.subFeatures.displayP3&&(c=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:p}),null!=e&&e.subFeatures.displayP3&&c!==p&&n.cloneBefore({value:c}),null!=e&&e.preserve||n.remove()}});basePlugin.postcss=!0;const creator=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)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-oklab-function/dist/index.d.cts b/plugins/postcss-oklab-function/dist/index.d.cts new file mode 100644 index 000000000..6845f25a5 --- /dev/null +++ b/plugins/postcss-oklab-function/dist/index.d.cts @@ -0,0 +1,16 @@ +import { PluginCreator } from 'postcss'; +/** postcss-oklab-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-oklab-function/dist/index.d.mts b/plugins/postcss-oklab-function/dist/index.d.mts new file mode 100644 index 000000000..678ccf005 --- /dev/null +++ b/plugins/postcss-oklab-function/dist/index.d.mts @@ -0,0 +1,15 @@ +import { PluginCreator } from 'postcss'; +/** postcss-oklab-function plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-oklab-function/dist/index.d.ts b/plugins/postcss-oklab-function/dist/index.d.ts index aee8de5ff..6845f25a5 100644 --- a/plugins/postcss-oklab-function/dist/index.d.ts +++ b/plugins/postcss-oklab-function/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-oklab-function plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ @@ -11,5 +11,6 @@ export type pluginOptions = { displayP3?: boolean; }; }; -declare const postcssPlugin: PluginCreator; -export default postcssPlugin; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-oklab-function/dist/index.mjs b/plugins/postcss-oklab-function/dist/index.mjs index a0b98b996..75bd33851 100644 --- a/plugins/postcss-oklab-function/dist/index.mjs +++ b/plugins/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.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;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 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.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;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 creator=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)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-oklab-function/src/index.ts b/plugins/postcss-oklab-function/src/index.ts index 2be18744f..ca5c2464f 100644 --- a/plugins/postcss-oklab-function/src/index.ts +++ b/plugins/postcss-oklab-function/src/index.ts @@ -125,7 +125,7 @@ export type pluginOptions = { }; /* Transform oklab() and oklch() functions in CSS. */ -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ enableProgressiveCustomProperties: true, preserve: false, @@ -152,6 +152,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-oklab-function/tsconfig.json b/plugins/postcss-oklab-function/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-oklab-function/tsconfig.json +++ b/plugins/postcss-oklab-function/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-overflow-shorthand/dist/index.d.cts b/plugins/postcss-overflow-shorthand/dist/index.d.cts new file mode 100644 index 000000000..8108c4c54 --- /dev/null +++ b/plugins/postcss-overflow-shorthand/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-overflow-shorthand plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-overflow-shorthand/dist/index.d.mts b/plugins/postcss-overflow-shorthand/dist/index.d.mts new file mode 100644 index 000000000..cc763b8ee --- /dev/null +++ b/plugins/postcss-overflow-shorthand/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-overflow-shorthand plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-overflow-shorthand/dist/index.d.ts b/plugins/postcss-overflow-shorthand/dist/index.d.ts index 017c3aad3..8108c4c54 100644 --- a/plugins/postcss-overflow-shorthand/dist/index.d.ts +++ b/plugins/postcss-overflow-shorthand/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-overflow-shorthand plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-overflow-shorthand/package.json b/plugins/postcss-overflow-shorthand/package.json index 7adc491d1..0694cfa47 100644 --- a/plugins/postcss-overflow-shorthand/package.json +++ b/plugins/postcss-overflow-shorthand/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-overflow-shorthand/tsconfig.json b/plugins/postcss-overflow-shorthand/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-overflow-shorthand/tsconfig.json +++ b/plugins/postcss-overflow-shorthand/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-place/dist/index.d.cts b/plugins/postcss-place/dist/index.d.cts new file mode 100644 index 000000000..2bd79b829 --- /dev/null +++ b/plugins/postcss-place/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-place plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-place/dist/index.d.mts b/plugins/postcss-place/dist/index.d.mts new file mode 100644 index 000000000..8e61fce8b --- /dev/null +++ b/plugins/postcss-place/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-place plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-place/dist/index.d.ts b/plugins/postcss-place/dist/index.d.ts index aaac93c53..2bd79b829 100644 --- a/plugins/postcss-place/dist/index.d.ts +++ b/plugins/postcss-place/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-place plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-place/dist/onCSSDeclaration.d.ts b/plugins/postcss-place/dist/onCSSDeclaration.d.ts deleted file mode 100644 index e1e7aa08e..000000000 --- a/plugins/postcss-place/dist/onCSSDeclaration.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { Declaration, Result } from 'postcss'; -export declare function onCSSDeclaration(decl: Declaration, result: Result, options: { - preserve: boolean; -}): void; -export declare const placeMatch: RegExp; diff --git a/plugins/postcss-place/package.json b/plugins/postcss-place/package.json index 1081abcbf..0813c40dd 100644 --- a/plugins/postcss-place/package.json +++ b/plugins/postcss-place/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-place/tsconfig.json b/plugins/postcss-place/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-place/tsconfig.json +++ b/plugins/postcss-place/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-progressive-custom-properties/dist/conditions-from-values.d.ts b/plugins/postcss-progressive-custom-properties/dist/conditions-from-values.d.ts deleted file mode 100644 index 250b5e914..000000000 --- a/plugins/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/plugins/postcss-progressive-custom-properties/dist/custom/double-position-gradients.d.ts b/plugins/postcss-progressive-custom-properties/dist/custom/double-position-gradients.d.ts deleted file mode 100644 index 6ca404c9a..000000000 --- a/plugins/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/plugins/postcss-progressive-custom-properties/dist/index.d.cts b/plugins/postcss-progressive-custom-properties/dist/index.d.cts new file mode 100644 index 000000000..43c7681b9 --- /dev/null +++ b/plugins/postcss-progressive-custom-properties/dist/index.d.cts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export = creator; diff --git a/plugins/postcss-progressive-custom-properties/dist/index.d.mts b/plugins/postcss-progressive-custom-properties/dist/index.d.mts new file mode 100644 index 000000000..2ff32fc22 --- /dev/null +++ b/plugins/postcss-progressive-custom-properties/dist/index.d.mts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export { creator as default }; diff --git a/plugins/postcss-progressive-custom-properties/dist/index.d.ts b/plugins/postcss-progressive-custom-properties/dist/index.d.ts index 5b5a74dd2..43c7681b9 100644 --- a/plugins/postcss-progressive-custom-properties/dist/index.d.ts +++ b/plugins/postcss-progressive-custom-properties/dist/index.d.ts @@ -1,3 +1,3 @@ -import { type PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; declare const creator: PluginCreator; -export default creator; +export = creator; diff --git a/plugins/postcss-progressive-custom-properties/dist/match.d.ts b/plugins/postcss-progressive-custom-properties/dist/match.d.ts deleted file mode 100644 index 95a56e037..000000000 --- a/plugins/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/plugins/postcss-progressive-custom-properties/dist/matchers.d.ts b/plugins/postcss-progressive-custom-properties/dist/matchers.d.ts deleted file mode 100644 index 746c0edbf..000000000 --- a/plugins/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/plugins/postcss-progressive-custom-properties/package.json b/plugins/postcss-progressive-custom-properties/package.json index 6a30f6543..e0491141b 100644 --- a/plugins/postcss-progressive-custom-properties/package.json +++ b/plugins/postcss-progressive-custom-properties/package.json @@ -17,15 +17,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-progressive-custom-properties/tsconfig.json b/plugins/postcss-progressive-custom-properties/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-progressive-custom-properties/tsconfig.json +++ b/plugins/postcss-progressive-custom-properties/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-pseudo-class-any-link/dist/index.d.cts b/plugins/postcss-pseudo-class-any-link/dist/index.d.cts new file mode 100644 index 000000000..6c5061bfa --- /dev/null +++ b/plugins/postcss-pseudo-class-any-link/dist/index.d.cts @@ -0,0 +1,13 @@ +import { PluginCreator } from 'postcss'; +/** postcss-pseudo-class-any-link plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Add an extra fallback for the "" element in IE and Edge. default: false */ + subFeatures?: { + areaHrefNeedsFixing?: boolean; + }; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-pseudo-class-any-link/dist/index.d.mts b/plugins/postcss-pseudo-class-any-link/dist/index.d.mts new file mode 100644 index 000000000..eec99ef56 --- /dev/null +++ b/plugins/postcss-pseudo-class-any-link/dist/index.d.mts @@ -0,0 +1,12 @@ +import { PluginCreator } from 'postcss'; +/** postcss-pseudo-class-any-link plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; + /** Add an extra fallback for the "" element in IE and Edge. default: false */ + subFeatures?: { + areaHrefNeedsFixing?: boolean; + }; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-pseudo-class-any-link/dist/index.d.ts b/plugins/postcss-pseudo-class-any-link/dist/index.d.ts index 691010554..6c5061bfa 100644 --- a/plugins/postcss-pseudo-class-any-link/dist/index.d.ts +++ b/plugins/postcss-pseudo-class-any-link/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-pseudo-class-any-link plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; /** Add an extra fallback for the "" element in IE and Edge. default: false */ @@ -9,4 +9,5 @@ export type pluginOptions = { }; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-pseudo-class-any-link/dist/replace-any-link.d.ts b/plugins/postcss-pseudo-class-any-link/dist/replace-any-link.d.ts deleted file mode 100644 index f465ab2b3..000000000 --- a/plugins/postcss-pseudo-class-any-link/dist/replace-any-link.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import type { Result, Rule } from 'postcss'; -export declare function replaceAnyLink(rule: Rule, result: Result, preserve: boolean, areaHrefNeedsFixing: boolean): boolean; diff --git a/plugins/postcss-pseudo-class-any-link/package.json b/plugins/postcss-pseudo-class-any-link/package.json index e4b0de328..093898104 100644 --- a/plugins/postcss-pseudo-class-any-link/package.json +++ b/plugins/postcss-pseudo-class-any-link/package.json @@ -31,15 +31,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-pseudo-class-any-link/src/replace-any-link.ts b/plugins/postcss-pseudo-class-any-link/src/replace-any-link.ts index 1622bff78..62ebd06e8 100644 --- a/plugins/postcss-pseudo-class-any-link/src/replace-any-link.ts +++ b/plugins/postcss-pseudo-class-any-link/src/replace-any-link.ts @@ -59,22 +59,37 @@ function modifiedSelector(selector: string, areaHrefNeedsFixing: boolean) { } if (!areaHrefNeedsFixing) { - replacements.push([linkAST.clone(), visitedAST.clone()]); + replacements.push( + [ + linkAST.clone() as parser.Selector /* TODO : delete the "as" clause */, + visitedAST.clone() as parser.Selector, /* TODO : delete the "as" clause */ + ]); return; } const tags = getTagElementsNextToPseudo(pseudo); if (tags.includes('area')) { - replacements.push([linkAST.clone(), visitedAST.clone(), hrefAST.clone()]); + replacements.push([ + linkAST.clone() as parser.Selector /* TODO : delete the "as" clause */, + visitedAST.clone() as parser.Selector /* TODO : delete the "as" clause */, + hrefAST.clone() as parser.Selector, /* TODO : delete the "as" clause */ + ]); return; } if (tags.length) { - replacements.push([linkAST.clone(), visitedAST.clone()]); + replacements.push([ + linkAST.clone() as parser.Selector /* TODO : delete the "as" clause */, + visitedAST.clone() as parser.Selector, /* TODO : delete the "as" clause */ + ]); return; } - replacements.push([linkAST.clone(), visitedAST.clone(), areaHrefAST.clone()]); + replacements.push([ + linkAST.clone() as parser.Selector /* TODO : delete the "as" clause */, + visitedAST.clone() as parser.Selector /* TODO : delete the "as" clause */, + areaHrefAST.clone() as parser.Selector, /* TODO : delete the "as" clause */ + ]); }); if (!replacements.length) { @@ -84,7 +99,7 @@ function modifiedSelector(selector: string, areaHrefNeedsFixing: boolean) { const replacementsCartesianProduct = cartesianProduct(...replacements); replacementsCartesianProduct.forEach((replacement) => { - const clone = selectorsAST.clone(); + const clone = selectorsAST.clone() as parser.Root /* TODO : delete the "as" clause */; clone.walkPseudos((pseudo) => { if (pseudo.value.toLowerCase() !== ':any-link' || (pseudo.nodes && pseudo.nodes.length)) { return; @@ -101,11 +116,11 @@ function modifiedSelector(selector: string, areaHrefNeedsFixing: boolean) { return out; } -function cartesianProduct(...args: Array>): Array> { - const r: Array> = []; +function cartesianProduct(...args: Array>): Array> { + const r: Array> = []; const max = args.length - 1; - function helper(arr: Array, i: number) { + function helper(arr: Array, i: number) { for (let j = 0, l = args[i].length; j < l; j++) { const a = arr.slice(0); a.push(args[i][j]); diff --git a/plugins/postcss-pseudo-class-any-link/tsconfig.json b/plugins/postcss-pseudo-class-any-link/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-pseudo-class-any-link/tsconfig.json +++ b/plugins/postcss-pseudo-class-any-link/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-rebase-url/dist/index.d.cts b/plugins/postcss-rebase-url/dist/index.d.cts new file mode 100644 index 000000000..92f917973 --- /dev/null +++ b/plugins/postcss-rebase-url/dist/index.d.cts @@ -0,0 +1,6 @@ +import { PluginCreator } from 'postcss'; +/** postcss-rebase-url plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-rebase-url/dist/index.d.mts b/plugins/postcss-rebase-url/dist/index.d.mts new file mode 100644 index 000000000..eeb500c10 --- /dev/null +++ b/plugins/postcss-rebase-url/dist/index.d.mts @@ -0,0 +1,5 @@ +import { PluginCreator } from 'postcss'; +/** postcss-rebase-url plugin options */ +type pluginOptions = never; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-rebase-url/dist/index.d.ts b/plugins/postcss-rebase-url/dist/index.d.ts index 877e03130..92f917973 100644 --- a/plugins/postcss-rebase-url/dist/index.d.ts +++ b/plugins/postcss-rebase-url/dist/index.d.ts @@ -1,5 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-rebase-url plugin options */ -export type pluginOptions = never; +type pluginOptions = never; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-rebase-url/dist/normalized-dir.d.ts b/plugins/postcss-rebase-url/dist/normalized-dir.d.ts deleted file mode 100644 index 70ed1c972..000000000 --- a/plugins/postcss-rebase-url/dist/normalized-dir.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * Returns a posix path for the directory of the given file path. - * - * @param {string} x The file path to normalize. - * @returns {string} The normalized directory path. - */ -export declare function normalizedDir(x: string): string; diff --git a/plugins/postcss-rebase-url/dist/serialize-string.d.ts b/plugins/postcss-rebase-url/dist/serialize-string.d.ts deleted file mode 100644 index ce83d6ae2..000000000 --- a/plugins/postcss-rebase-url/dist/serialize-string.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Serialize a string as a quoted CSS string. - * - * @param {string} str The contents for the string value. - * @returns {string} The quoted CSS string. - * - * @see https://www.w3.org/TR/cssom-1/#common-serializing-idioms - */ -export declare function serializeString(str: string): string; diff --git a/plugins/postcss-rebase-url/package.json b/plugins/postcss-rebase-url/package.json index c96e5c92f..1d2d79f0c 100644 --- a/plugins/postcss-rebase-url/package.json +++ b/plugins/postcss-rebase-url/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-rebase-url/tsconfig.json b/plugins/postcss-rebase-url/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-rebase-url/tsconfig.json +++ b/plugins/postcss-rebase-url/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-relative-color-syntax/dist/has-fallback-decl.d.ts b/plugins/postcss-relative-color-syntax/dist/has-fallback-decl.d.ts deleted file mode 100644 index d7ae8d890..000000000 --- a/plugins/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/plugins/postcss-relative-color-syntax/dist/has-supports-at-rule-ancestor.d.ts b/plugins/postcss-relative-color-syntax/dist/has-supports-at-rule-ancestor.d.ts deleted file mode 100644 index a46009ecc..000000000 --- a/plugins/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/plugins/postcss-relative-color-syntax/dist/index.cjs b/plugins/postcss-relative-color-syntax/dist/index.cjs index 2ab88ea7b..d2f9a5008 100644 --- a/plugins/postcss-relative-color-syntax/dist/index.cjs +++ b/plugins/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.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;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(!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.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;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 creator=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)};creator.postcss=!0,module.exports=creator; diff --git a/plugins/postcss-relative-color-syntax/dist/index.d.cts b/plugins/postcss-relative-color-syntax/dist/index.d.cts new file mode 100644 index 000000000..b4c343fb0 --- /dev/null +++ b/plugins/postcss-relative-color-syntax/dist/index.d.cts @@ -0,0 +1,16 @@ +import { PluginCreator } from 'postcss'; +/** postcss-relative-color-syntax plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-relative-color-syntax/dist/index.d.mts b/plugins/postcss-relative-color-syntax/dist/index.d.mts new file mode 100644 index 000000000..f774edc2a --- /dev/null +++ b/plugins/postcss-relative-color-syntax/dist/index.d.mts @@ -0,0 +1,15 @@ +import { PluginCreator } from 'postcss'; +/** postcss-relative-color-syntax plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; + /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ + enableProgressiveCustomProperties?: boolean; + /** Toggle sub features. default: { displayP3: true } */ + subFeatures?: { + /** Enable displayP3 fallbacks. default: true */ + displayP3?: boolean; + }; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-relative-color-syntax/dist/index.d.ts b/plugins/postcss-relative-color-syntax/dist/index.d.ts index 15f89fd40..b4c343fb0 100644 --- a/plugins/postcss-relative-color-syntax/dist/index.d.ts +++ b/plugins/postcss-relative-color-syntax/dist/index.d.ts @@ -1,6 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-relative-color-syntax plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; /** Enable "@csstools/postcss-progressive-custom-properties". default: true */ @@ -11,5 +11,6 @@ export type pluginOptions = { displayP3?: boolean; }; }; -declare const postcssPlugin: PluginCreator; -export default postcssPlugin; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-relative-color-syntax/dist/index.mjs b/plugins/postcss-relative-color-syntax/dist/index.mjs index 7964ee08d..79b48f9ca 100644 --- a/plugins/postcss-relative-color-syntax/dist/index.mjs +++ b/plugins/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 i,isFunctionNode as u,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-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(u(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=c(y);if(v===m)return;let F=v;null!=s&&s.subFeatures.displayP3&&(F=c(n(i(g),(s=>{if(u(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 u,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-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(u(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=c(y);if(v===m)return;let F=v;null!=s&&s.subFeatures.displayP3&&(F=c(n(i(g),(s=>{if(u(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 creator=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)};creator.postcss=!0;export{creator as default}; diff --git a/plugins/postcss-relative-color-syntax/package.json b/plugins/postcss-relative-color-syntax/package.json index 5667037c6..f7bbf9fe4 100644 --- a/plugins/postcss-relative-color-syntax/package.json +++ b/plugins/postcss-relative-color-syntax/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-relative-color-syntax/src/index.ts b/plugins/postcss-relative-color-syntax/src/index.ts index 20f42aa60..2e8710fa8 100644 --- a/plugins/postcss-relative-color-syntax/src/index.ts +++ b/plugins/postcss-relative-color-syntax/src/index.ts @@ -130,7 +130,7 @@ export type pluginOptions = { }; /* Transform relative color syntax in CSS. */ -const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { +const creator: PluginCreator = (opts?: pluginOptions) => { const options = Object.assign({ enableProgressiveCustomProperties: true, preserve: false, @@ -157,6 +157,6 @@ const postcssPlugin: PluginCreator = (opts?: pluginOptions) => { return basePlugin(options); }; -postcssPlugin.postcss = true; +creator.postcss = true; -export default postcssPlugin; +export default creator; diff --git a/plugins/postcss-relative-color-syntax/tsconfig.json b/plugins/postcss-relative-color-syntax/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-relative-color-syntax/tsconfig.json +++ b/plugins/postcss-relative-color-syntax/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-scope-pseudo-class/dist/index.d.cts b/plugins/postcss-scope-pseudo-class/dist/index.d.cts new file mode 100644 index 000000000..0e34b0731 --- /dev/null +++ b/plugins/postcss-scope-pseudo-class/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-scope-pseudo-class plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-scope-pseudo-class/dist/index.d.mts b/plugins/postcss-scope-pseudo-class/dist/index.d.mts new file mode 100644 index 000000000..c631ed8d1 --- /dev/null +++ b/plugins/postcss-scope-pseudo-class/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-scope-pseudo-class plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-scope-pseudo-class/dist/index.d.ts b/plugins/postcss-scope-pseudo-class/dist/index.d.ts index 77dc51e7b..0e34b0731 100644 --- a/plugins/postcss-scope-pseudo-class/dist/index.d.ts +++ b/plugins/postcss-scope-pseudo-class/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-scope-pseudo-class plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-scope-pseudo-class/package.json b/plugins/postcss-scope-pseudo-class/package.json index 2e67a4804..4ed742057 100644 --- a/plugins/postcss-scope-pseudo-class/package.json +++ b/plugins/postcss-scope-pseudo-class/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-scope-pseudo-class/tsconfig.json b/plugins/postcss-scope-pseudo-class/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-scope-pseudo-class/tsconfig.json +++ b/plugins/postcss-scope-pseudo-class/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-selector-not/dist/index.d.cts b/plugins/postcss-selector-not/dist/index.d.cts new file mode 100644 index 000000000..4bfd4bb38 --- /dev/null +++ b/plugins/postcss-selector-not/dist/index.d.cts @@ -0,0 +1,6 @@ +import { PluginCreator } from 'postcss'; +/** postcss-selector-not plugin options */ +type pluginOptions = Record; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-selector-not/dist/index.d.mts b/plugins/postcss-selector-not/dist/index.d.mts new file mode 100644 index 000000000..38344ccd1 --- /dev/null +++ b/plugins/postcss-selector-not/dist/index.d.mts @@ -0,0 +1,5 @@ +import { PluginCreator } from 'postcss'; +/** postcss-selector-not plugin options */ +type pluginOptions = Record; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-selector-not/dist/index.d.ts b/plugins/postcss-selector-not/dist/index.d.ts index af28b15e4..4bfd4bb38 100644 --- a/plugins/postcss-selector-not/dist/index.d.ts +++ b/plugins/postcss-selector-not/dist/index.d.ts @@ -1,5 +1,6 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-selector-not plugin options */ -export type pluginOptions = Record; +type pluginOptions = Record; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-selector-not/package.json b/plugins/postcss-selector-not/package.json index b4c492c86..0e24fe674 100644 --- a/plugins/postcss-selector-not/package.json +++ b/plugins/postcss-selector-not/package.json @@ -30,15 +30,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-selector-not/tsconfig.json b/plugins/postcss-selector-not/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-selector-not/tsconfig.json +++ b/plugins/postcss-selector-not/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-slow-plugins/dist/index.d.cts b/plugins/postcss-slow-plugins/dist/index.d.cts new file mode 100644 index 000000000..68450cb3b --- /dev/null +++ b/plugins/postcss-slow-plugins/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-slow-plugins plugin options */ +type pluginOptions = { + /** Plugins to ignore when reporting the results */ + ignore?: Array; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-slow-plugins/dist/index.d.mts b/plugins/postcss-slow-plugins/dist/index.d.mts new file mode 100644 index 000000000..62e066dcc --- /dev/null +++ b/plugins/postcss-slow-plugins/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-slow-plugins plugin options */ +type pluginOptions = { + /** Plugins to ignore when reporting the results */ + ignore?: Array; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-slow-plugins/dist/index.d.ts b/plugins/postcss-slow-plugins/dist/index.d.ts index 753b96144..68450cb3b 100644 --- a/plugins/postcss-slow-plugins/dist/index.d.ts +++ b/plugins/postcss-slow-plugins/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-slow-plugins plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Plugins to ignore when reporting the results */ ignore?: Array; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-slow-plugins/package.json b/plugins/postcss-slow-plugins/package.json index d9e551434..ca855404f 100644 --- a/plugins/postcss-slow-plugins/package.json +++ b/plugins/postcss-slow-plugins/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-slow-plugins/tsconfig.json b/plugins/postcss-slow-plugins/tsconfig.json index 500af6d26..6a99713d0 100644 --- a/plugins/postcss-slow-plugins/tsconfig.json +++ b/plugins/postcss-slow-plugins/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-stepped-value-functions/dist/index.d.cts b/plugins/postcss-stepped-value-functions/dist/index.d.cts new file mode 100644 index 000000000..c8a6acd15 --- /dev/null +++ b/plugins/postcss-stepped-value-functions/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-stepped-value-functions plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-stepped-value-functions/dist/index.d.mts b/plugins/postcss-stepped-value-functions/dist/index.d.mts new file mode 100644 index 000000000..7da5c17ba --- /dev/null +++ b/plugins/postcss-stepped-value-functions/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-stepped-value-functions plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-stepped-value-functions/dist/index.d.ts b/plugins/postcss-stepped-value-functions/dist/index.d.ts index c7772f768..c8a6acd15 100644 --- a/plugins/postcss-stepped-value-functions/dist/index.d.ts +++ b/plugins/postcss-stepped-value-functions/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-stepped-value-functions plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-stepped-value-functions/package.json b/plugins/postcss-stepped-value-functions/package.json index eab24b208..d0543d0e6 100644 --- a/plugins/postcss-stepped-value-functions/package.json +++ b/plugins/postcss-stepped-value-functions/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-stepped-value-functions/tsconfig.json b/plugins/postcss-stepped-value-functions/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-stepped-value-functions/tsconfig.json +++ b/plugins/postcss-stepped-value-functions/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-text-decoration-shorthand/dist/index.d.cts b/plugins/postcss-text-decoration-shorthand/dist/index.d.cts new file mode 100644 index 000000000..7c18f440e --- /dev/null +++ b/plugins/postcss-text-decoration-shorthand/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-text-decoration-shorthand plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-text-decoration-shorthand/dist/index.d.mts b/plugins/postcss-text-decoration-shorthand/dist/index.d.mts new file mode 100644 index 000000000..65189fd2d --- /dev/null +++ b/plugins/postcss-text-decoration-shorthand/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-text-decoration-shorthand plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: true */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-text-decoration-shorthand/dist/index.d.ts b/plugins/postcss-text-decoration-shorthand/dist/index.d.ts index c98089699..7c18f440e 100644 --- a/plugins/postcss-text-decoration-shorthand/dist/index.d.ts +++ b/plugins/postcss-text-decoration-shorthand/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-text-decoration-shorthand plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: true */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-text-decoration-shorthand/package.json b/plugins/postcss-text-decoration-shorthand/package.json index 6d1d60064..e23347ef1 100644 --- a/plugins/postcss-text-decoration-shorthand/package.json +++ b/plugins/postcss-text-decoration-shorthand/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-text-decoration-shorthand/tsconfig.json b/plugins/postcss-text-decoration-shorthand/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-text-decoration-shorthand/tsconfig.json +++ b/plugins/postcss-text-decoration-shorthand/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-todo-or-die/dist/died.d.ts b/plugins/postcss-todo-or-die/dist/died.d.ts deleted file mode 100644 index c44d72799..000000000 --- a/plugins/postcss-todo-or-die/dist/died.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function died(conditionResult: string | true | undefined): conditionResult is string; diff --git a/plugins/postcss-todo-or-die/dist/index.d.cts b/plugins/postcss-todo-or-die/dist/index.d.cts new file mode 100644 index 000000000..0e21b839b --- /dev/null +++ b/plugins/postcss-todo-or-die/dist/index.d.cts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export = creator; diff --git a/plugins/postcss-todo-or-die/dist/index.d.mts b/plugins/postcss-todo-or-die/dist/index.d.mts new file mode 100644 index 000000000..9d7270ec8 --- /dev/null +++ b/plugins/postcss-todo-or-die/dist/index.d.mts @@ -0,0 +1,3 @@ +import { PluginCreator } from 'postcss'; +declare const creator: PluginCreator; +export { creator as default }; diff --git a/plugins/postcss-todo-or-die/dist/index.d.ts b/plugins/postcss-todo-or-die/dist/index.d.ts index 89d75c8fd..0e21b839b 100644 --- a/plugins/postcss-todo-or-die/dist/index.d.ts +++ b/plugins/postcss-todo-or-die/dist/index.d.ts @@ -1,3 +1,3 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; declare const creator: PluginCreator; -export default creator; +export = creator; diff --git a/plugins/postcss-todo-or-die/dist/match/before-date.d.ts b/plugins/postcss-todo-or-die/dist/match/before-date.d.ts deleted file mode 100644 index 17cbf8058..000000000 --- a/plugins/postcss-todo-or-die/dist/match/before-date.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function matchBeforeDateCondition(year: number, month: number, day: number): string | true | undefined; diff --git a/plugins/postcss-todo-or-die/dist/match/browserslist.d.ts b/plugins/postcss-todo-or-die/dist/match/browserslist.d.ts deleted file mode 100644 index 0e958847a..000000000 --- a/plugins/postcss-todo-or-die/dist/match/browserslist.d.ts +++ /dev/null @@ -1 +0,0 @@ -export declare function matchBrowserslistCondition(condition: string, browsers: Set): string | true | undefined; diff --git a/plugins/postcss-todo-or-die/dist/match/if.d.ts b/plugins/postcss-todo-or-die/dist/match/if.d.ts deleted file mode 100644 index 82ad9d644..000000000 --- a/plugins/postcss-todo-or-die/dist/match/if.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { IfCondition } from '../parse/if'; -export declare function matchIfCondition(condition: IfCondition): string | true | undefined; diff --git a/plugins/postcss-todo-or-die/dist/match/not.d.ts b/plugins/postcss-todo-or-die/dist/match/not.d.ts deleted file mode 100644 index be0ffa5f1..000000000 --- a/plugins/postcss-todo-or-die/dist/match/not.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { IfCondition } from '../parse/if'; -export declare function matchNotCondition(condition: IfCondition): string | true | undefined; diff --git a/plugins/postcss-todo-or-die/dist/parse/before-data.d.ts b/plugins/postcss-todo-or-die/dist/parse/before-data.d.ts deleted file mode 100644 index 3802d2fa1..000000000 --- a/plugins/postcss-todo-or-die/dist/parse/before-data.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { FunctionNode } from '@csstools/css-parser-algorithms'; -type BeforeDateCondition = { - year: number; - month: number; - day: number; -}; -export declare function parseBeforeDateCondition(componentValue: FunctionNode): BeforeDateCondition | false; -export {}; diff --git a/plugins/postcss-todo-or-die/dist/parse/browserslist.d.ts b/plugins/postcss-todo-or-die/dist/parse/browserslist.d.ts deleted file mode 100644 index bd01ae86d..000000000 --- a/plugins/postcss-todo-or-die/dist/parse/browserslist.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -import { FunctionNode } from '@csstools/css-parser-algorithms'; -export declare function parseBrowserslistCondition(componentValue: FunctionNode): string | false; diff --git a/plugins/postcss-todo-or-die/dist/parse/if.d.ts b/plugins/postcss-todo-or-die/dist/parse/if.d.ts deleted file mode 100644 index c138f0592..000000000 --- a/plugins/postcss-todo-or-die/dist/parse/if.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FunctionNode } from '@csstools/css-parser-algorithms'; -import { TokenDimension, TokenIdent, TokenNumber, TokenPercentage } from '@csstools/css-tokenizer'; -type SubjectToken = TokenIdent | TokenNumber | TokenPercentage | TokenDimension; -export type IfCondition = { - a: SubjectToken; - b: SubjectToken; - operator: '<' | '>' | '='; -}; -export declare function parseIfCondition(componentValue: FunctionNode): IfCondition | false; -export {}; diff --git a/plugins/postcss-todo-or-die/dist/parse/not.d.ts b/plugins/postcss-todo-or-die/dist/parse/not.d.ts deleted file mode 100644 index 8918e965a..000000000 --- a/plugins/postcss-todo-or-die/dist/parse/not.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FunctionNode } from '@csstools/css-parser-algorithms'; -import { TokenDimension, TokenIdent, TokenNumber, TokenPercentage } from '@csstools/css-tokenizer'; -type SubjectToken = TokenIdent | TokenNumber | TokenPercentage | TokenDimension; -type NotCondition = { - a: SubjectToken; - b: SubjectToken; - operator: '<' | '>' | '='; -}; -export declare function parseNotCondition(componentValue: FunctionNode): NotCondition | false; -export {}; diff --git a/plugins/postcss-todo-or-die/tsconfig.json b/plugins/postcss-todo-or-die/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-todo-or-die/tsconfig.json +++ b/plugins/postcss-todo-or-die/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/plugins/postcss-trigonometric-functions/dist/index.d.cts b/plugins/postcss-trigonometric-functions/dist/index.d.cts new file mode 100644 index 000000000..bc95455c0 --- /dev/null +++ b/plugins/postcss-trigonometric-functions/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-trigonometric-functions plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-trigonometric-functions/dist/index.d.mts b/plugins/postcss-trigonometric-functions/dist/index.d.mts new file mode 100644 index 000000000..abb6bb396 --- /dev/null +++ b/plugins/postcss-trigonometric-functions/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-trigonometric-functions plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-trigonometric-functions/dist/index.d.ts b/plugins/postcss-trigonometric-functions/dist/index.d.ts index 40ac49ea1..bc95455c0 100644 --- a/plugins/postcss-trigonometric-functions/dist/index.d.ts +++ b/plugins/postcss-trigonometric-functions/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-trigonometric-functions plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-trigonometric-functions/package.json b/plugins/postcss-trigonometric-functions/package.json index 95a0b08f5..90a080999 100644 --- a/plugins/postcss-trigonometric-functions/package.json +++ b/plugins/postcss-trigonometric-functions/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-trigonometric-functions/tsconfig.json b/plugins/postcss-trigonometric-functions/tsconfig.json index 1b60a463a..a0b0c80bb 100644 --- a/plugins/postcss-trigonometric-functions/tsconfig.json +++ b/plugins/postcss-trigonometric-functions/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true }, "include": ["./src/**/*"], diff --git a/plugins/postcss-unset-value/dist/index.d.cts b/plugins/postcss-unset-value/dist/index.d.cts new file mode 100644 index 000000000..e82d260f5 --- /dev/null +++ b/plugins/postcss-unset-value/dist/index.d.cts @@ -0,0 +1,9 @@ +import { PluginCreator } from 'postcss'; +/** postcss-unset-value plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-unset-value/dist/index.d.mts b/plugins/postcss-unset-value/dist/index.d.mts new file mode 100644 index 000000000..81d1ac508 --- /dev/null +++ b/plugins/postcss-unset-value/dist/index.d.mts @@ -0,0 +1,8 @@ +import { PluginCreator } from 'postcss'; +/** postcss-unset-value plugin options */ +type pluginOptions = { + /** Preserve the original notation. default: false */ + preserve?: boolean; +}; +declare const creator: PluginCreator; +export { creator as default, pluginOptions }; diff --git a/plugins/postcss-unset-value/dist/index.d.ts b/plugins/postcss-unset-value/dist/index.d.ts index 9bf13c0d0..e82d260f5 100644 --- a/plugins/postcss-unset-value/dist/index.d.ts +++ b/plugins/postcss-unset-value/dist/index.d.ts @@ -1,8 +1,9 @@ -import type { PluginCreator } from 'postcss'; +import { PluginCreator } from 'postcss'; /** postcss-unset-value plugin options */ -export type pluginOptions = { +type pluginOptions = { /** Preserve the original notation. default: false */ preserve?: boolean; }; declare const creator: PluginCreator; -export default creator; +export type { pluginOptions }; +export = creator; diff --git a/plugins/postcss-unset-value/dist/property-def.d.ts b/plugins/postcss-unset-value/dist/property-def.d.ts deleted file mode 100644 index 46c840737..000000000 --- a/plugins/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/plugins/postcss-unset-value/package.json b/plugins/postcss-unset-value/package.json index 6ecdd94ed..86c79a951 100644 --- a/plugins/postcss-unset-value/package.json +++ b/plugins/postcss-unset-value/package.json @@ -27,15 +27,20 @@ "engines": { "node": "^14 || ^16 || >=18" }, - "main": "dist/index.cjs", - "module": "dist/index.mjs", + "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.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } } }, "files": [ diff --git a/plugins/postcss-unset-value/tsconfig.json b/plugins/postcss-unset-value/tsconfig.json index c4bc02ba4..623986b5d 100644 --- a/plugins/postcss-unset-value/tsconfig.json +++ b/plugins/postcss-unset-value/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "compilerOptions": { "outDir": "dist", - "declarationDir": ".", + "declarationDir": "dist", "strict": true, }, "include": ["./src/**/*"], diff --git a/rollup/presets/package-typescript.mjs b/rollup/presets/package-typescript.mjs index 8477a020c..f775a368f 100644 --- a/rollup/presets/package-typescript.mjs +++ b/rollup/presets/package-typescript.mjs @@ -1,8 +1,9 @@ import babel from '@rollup/plugin-babel'; import terser from '@rollup/plugin-terser'; -import typescript from '@rollup/plugin-typescript'; +import typescript from 'rollup-plugin-ts'; import { externalsForPlugin } from '../configs/externals.mjs'; import { packageBabelPreset } from '../configs/babel-presets.mjs'; +import { rewriteCjsTypeDeclarations } from '../transforms/rewrite-cjs-type-declarations.mjs'; export function packageTypescript() { return [ @@ -28,6 +29,7 @@ export function packageTypescript() { keep_classnames: true, keep_fnames: true, }), + rewriteCjsTypeDeclarations(), ], }, ]; diff --git a/rollup/transforms/rewrite-cjs-type-declarations.mjs b/rollup/transforms/rewrite-cjs-type-declarations.mjs new file mode 100644 index 000000000..23a069de6 --- /dev/null +++ b/rollup/transforms/rewrite-cjs-type-declarations.mjs @@ -0,0 +1,35 @@ +export function rewriteCjsTypeDeclarations() { + return { + name: 'rewrite-cjs-type-declarations', + generateBundle (_, bundle) { + if ( + bundle['index.d.cts']?.source && + bundle['index.d.cts'].source.includes('declare const creator: PluginCreator') + ) { + bundle['index.d.cts'].source = bundle['index.d.cts'].source.replace( + 'export { creator as default };', + 'export = creator;', + ); + + bundle['index.d.cts'].source = bundle['index.d.cts'].source.replace( + 'export { creator as default, pluginOptions };', + 'export type { pluginOptions };\nexport = creator;', + ); + + bundle['index.d.ts'] = { + ...bundle['index.d.cts'], + }; + + bundle['index.d.ts'].fileName = 'index.d.ts'; + } else if ( + bundle['index.d.cts']?.source + ) { + bundle['index.d.ts'] = { + ...bundle['index.d.cts'], + }; + + bundle['index.d.ts'].fileName = 'index.d.ts'; + } + }, + }; +}