@weapp-tailwindcss/postcss 3.0.5 → 3.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compat/mini-program-css/predicates.d.ts +1 -0
- package/dist/compat/mini-program-css/selectors.d.ts +3 -0
- package/dist/css-macro/auto.d.ts +7 -0
- package/dist/css-macro/constants.d.ts +17 -0
- package/dist/css-macro/postcss.d.ts +6 -0
- package/dist/css-macro/postcss.js +7 -0
- package/dist/css-macro/postcss.mjs +2 -0
- package/dist/generator-plugin/config-directive.d.ts +1 -0
- package/dist/generator-plugin/context.d.ts +8 -0
- package/dist/generator-plugin/directives.d.ts +5 -0
- package/dist/generator-plugin/index.d.ts +4 -0
- package/dist/generator-plugin/package-version.d.ts +3 -0
- package/dist/generator-plugin/source-files.d.ts +7 -0
- package/dist/generator-plugin/tailwind-version.d.ts +3 -0
- package/dist/generator-plugin/types.d.ts +100 -0
- package/dist/html-transform.js +1 -1
- package/dist/html-transform.mjs +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1654 -190
- package/dist/index.mjs +1657 -220
- package/dist/postcss-BebUgs5n.mjs +158 -0
- package/dist/postcss-by-0mwIg.js +169 -0
- package/dist/postcss-config.d.ts +8 -0
- package/dist/postcss-runtime.d.ts +2 -0
- package/dist/source-scan/inline-source.d.ts +7 -0
- package/dist/source-scan.d.ts +31 -0
- package/dist/vite-css-rules.d.ts +17 -0
- package/package.json +14 -2
- package/dist/{html-transform-Dgak7hXa.js → html-transform-CMF3g0Cc.js} +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
import { n as creator, t as CSS_MACRO_POSTCSS_PLUGIN_NAME } from "./postcss-BebUgs5n.mjs";
|
|
1
2
|
import postcssHtmlTransform from "./html-transform.mjs";
|
|
2
3
|
import "./types.mjs";
|
|
3
4
|
import { createRequire } from "node:module";
|
|
4
|
-
import postcss, { Declaration, Rule } from "postcss";
|
|
5
|
+
import postcss, { Declaration, Rule, default as postcss$1 } from "postcss";
|
|
5
6
|
import valueParser from "postcss-value-parser";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import process$1 from "node:process";
|
|
9
|
+
import { readFile, stat } from "node:fs/promises";
|
|
10
|
+
import { loadConfig } from "tailwindcss-config";
|
|
11
|
+
import { extractRawCandidatesWithPositions, extractValidCandidates, resolveProjectSourceFiles } from "tailwindcss-patch";
|
|
12
|
+
import { existsSync, readFileSync, realpathSync } from "node:fs";
|
|
13
|
+
import micromatch from "micromatch";
|
|
6
14
|
import { defu, defuOverrideArray, regExpTest } from "@weapp-tailwindcss/shared";
|
|
7
15
|
import { LRUCache } from "lru-cache";
|
|
8
16
|
import selectorParser from "postcss-selector-parser";
|
|
@@ -10,9 +18,9 @@ import s from "autoprefixer";
|
|
|
10
18
|
import postcssCalc from "@weapp-tailwindcss/postcss-calc";
|
|
11
19
|
import postcssPxtrans from "postcss-pxtrans";
|
|
12
20
|
import postcssRem2rpx from "postcss-rem-to-responsive-pixel";
|
|
13
|
-
import process$1 from "node:process";
|
|
14
21
|
import postcssUnitConverter, { composeRules as unitConversionComposeRules, presets, presets as unitConversionPresets } from "postcss-rule-unit-converter";
|
|
15
22
|
import { MappingChars2String, escape } from "@weapp-core/escape";
|
|
23
|
+
import postcssrc from "postcss-load-config";
|
|
16
24
|
//#region \0rolldown/runtime.js
|
|
17
25
|
var __create = Object.create;
|
|
18
26
|
var __defProp = Object.defineProperty;
|
|
@@ -6743,7 +6751,7 @@ function protectDynamicColorMixAlpha(css, options = {}) {
|
|
|
6743
6751
|
restore: (value) => value
|
|
6744
6752
|
};
|
|
6745
6753
|
const replacements = /* @__PURE__ */ new Map();
|
|
6746
|
-
const root = postcss.parse(css);
|
|
6754
|
+
const root = postcss$1.parse(css);
|
|
6747
6755
|
const customPropertyValues = new Map(options.customPropertyValues);
|
|
6748
6756
|
let changed = false;
|
|
6749
6757
|
root.walkDecls((decl) => {
|
|
@@ -6828,7 +6836,7 @@ function removeAtRulesByScan(css, names) {
|
|
|
6828
6836
|
}
|
|
6829
6837
|
function removeUnsupportedMiniProgramAtRules(css) {
|
|
6830
6838
|
try {
|
|
6831
|
-
const root = postcss.parse(css);
|
|
6839
|
+
const root = postcss$1.parse(css);
|
|
6832
6840
|
root.walkAtRules((atRule) => {
|
|
6833
6841
|
if (MINI_PROGRAM_UNSUPPORTED_AT_RULES.has(atRule.name)) atRule.remove();
|
|
6834
6842
|
});
|
|
@@ -7260,7 +7268,7 @@ const TAILWIND_V4_BANNER_RE = /\/\*!\s*tailwindcss v4\./;
|
|
|
7260
7268
|
const GENERATOR_PLACEHOLDER_COMMENT_RE = /^\s*(?:!\s*)?weapp-tailwindcss generator-placeholder\s*$/i;
|
|
7261
7269
|
function hasTailwindcssV4Signal(css) {
|
|
7262
7270
|
if (TAILWIND_V4_BANNER_RE.test(css)) return true;
|
|
7263
|
-
const root = postcss.parse(css);
|
|
7271
|
+
const root = postcss$1.parse(css);
|
|
7264
7272
|
let hasProperty = false;
|
|
7265
7273
|
root.walkAtRules("property", (atRule) => {
|
|
7266
7274
|
if (atRule.params.trim().startsWith("--tw-")) {
|
|
@@ -7297,6 +7305,15 @@ const MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS = new Set([
|
|
|
7297
7305
|
"::before",
|
|
7298
7306
|
"::after"
|
|
7299
7307
|
]);
|
|
7308
|
+
const MINI_PROGRAM_NATIVE_ELEMENT_SELECTORS = new Set([
|
|
7309
|
+
...MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS,
|
|
7310
|
+
"button",
|
|
7311
|
+
"input",
|
|
7312
|
+
"textarea",
|
|
7313
|
+
"canvas",
|
|
7314
|
+
"video",
|
|
7315
|
+
"audio"
|
|
7316
|
+
]);
|
|
7300
7317
|
const MINI_PROGRAM_PREFLIGHT_SELECTORS = new Set(["*", ...MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS]);
|
|
7301
7318
|
const MINI_PROGRAM_THEME_SCOPE_SELECTORS = new Set([
|
|
7302
7319
|
":host",
|
|
@@ -7373,11 +7390,12 @@ const MINI_PROGRAM_UNSUPPORTED_BROWSER_TAG_SELECTORS = new Set([
|
|
|
7373
7390
|
"ul",
|
|
7374
7391
|
"video"
|
|
7375
7392
|
]);
|
|
7376
|
-
|
|
7393
|
+
const MINI_PROGRAM_UNSUPPORTED_BROWSER_PREFLIGHT_SELECTOR_PARTS = new Set([...MINI_PROGRAM_UNSUPPORTED_BROWSER_TAG_SELECTORS, "::file-selector-button"]);
|
|
7394
|
+
function normalizeSelector$2(selector) {
|
|
7377
7395
|
return selector.trim().replace(/\s+/g, "");
|
|
7378
7396
|
}
|
|
7379
7397
|
function normalizePseudoElementSelector(selector) {
|
|
7380
|
-
return normalizeSelector$
|
|
7398
|
+
return normalizeSelector$2(selector).replace(/^:(before|after)$/, "::$1");
|
|
7381
7399
|
}
|
|
7382
7400
|
function getRuleSelectors(rule) {
|
|
7383
7401
|
return rule.selector.split(",").map(normalizePseudoElementSelector).filter(Boolean);
|
|
@@ -7386,8 +7404,15 @@ function getSortedRuleSelectorKey(rule) {
|
|
|
7386
7404
|
return getRuleSelectors(rule).sort().join(",");
|
|
7387
7405
|
}
|
|
7388
7406
|
function isUnsupportedBrowserSelector(selector) {
|
|
7389
|
-
const normalized = normalizeSelector$
|
|
7390
|
-
return MINI_PROGRAM_UNSUPPORTED_BROWSER_SELECTORS.has(normalized) || MINI_PROGRAM_UNSUPPORTED_BROWSER_TAG_SELECTORS.has(normalized);
|
|
7407
|
+
const normalized = normalizeSelector$2(selector);
|
|
7408
|
+
return MINI_PROGRAM_UNSUPPORTED_BROWSER_SELECTORS.has(normalized) || MINI_PROGRAM_UNSUPPORTED_BROWSER_TAG_SELECTORS.has(normalized) && !MINI_PROGRAM_NATIVE_ELEMENT_SELECTORS.has(normalized);
|
|
7409
|
+
}
|
|
7410
|
+
function isUnsupportedBrowserPreflightSelector(selector) {
|
|
7411
|
+
const normalizedParts = selector.split(",").map(normalizeSelector$2).filter(Boolean);
|
|
7412
|
+
return normalizedParts.length > 1 && normalizedParts.every((part) => MINI_PROGRAM_UNSUPPORTED_BROWSER_PREFLIGHT_SELECTOR_PARTS.has(part));
|
|
7413
|
+
}
|
|
7414
|
+
function isMiniProgramNativeElementSelector(selector) {
|
|
7415
|
+
return MINI_PROGRAM_NATIVE_ELEMENT_SELECTORS.has(normalizePseudoElementSelector(selector));
|
|
7391
7416
|
}
|
|
7392
7417
|
function isMiniProgramPreflightSelector(selectors) {
|
|
7393
7418
|
return selectors.length > 0 && selectors.every((selector) => MINI_PROGRAM_PREFLIGHT_SELECTORS.has(selector)) && selectors.some((selector) => selector === "*" || selector === ":before" || selector === ":after" || selector === "::before" || selector === "::after");
|
|
@@ -7408,6 +7433,7 @@ const PREFLIGHT_RESET_PROPS = new Set([
|
|
|
7408
7433
|
]);
|
|
7409
7434
|
const PSEUDO_CONTENT_SELECTOR_RE = /^(?:::before|::after|:before|:after)(?:,(?:::before|::after|:before|:after))*$/;
|
|
7410
7435
|
const TW_CONTENT_VAR_RE = /var\(\s*--tw-content\b/;
|
|
7436
|
+
const BROWSER_PREFLIGHT_SINGLE_ELEMENT_DECLARATIONS = new Map([["button", new Set(["appearance:button", "-moz-appearance:button"])], ["textarea", new Set(["resize:vertical"])]]);
|
|
7411
7437
|
function hasTailwindPreflightDeclaration(rule) {
|
|
7412
7438
|
let hasTailwindVar = false;
|
|
7413
7439
|
let hasResetProp = false;
|
|
@@ -7417,6 +7443,13 @@ function hasTailwindPreflightDeclaration(rule) {
|
|
|
7417
7443
|
});
|
|
7418
7444
|
return hasTailwindVar || hasResetProp;
|
|
7419
7445
|
}
|
|
7446
|
+
function hasTailwindVariableDeclaration(rule) {
|
|
7447
|
+
let hasTailwindVar = false;
|
|
7448
|
+
rule.walkDecls((decl) => {
|
|
7449
|
+
if (decl.prop.startsWith("--tw-")) hasTailwindVar = true;
|
|
7450
|
+
});
|
|
7451
|
+
return hasTailwindVar;
|
|
7452
|
+
}
|
|
7420
7453
|
function isCustomPropertyRule(rule) {
|
|
7421
7454
|
let hasDeclaration = false;
|
|
7422
7455
|
let allCustomProperties = true;
|
|
@@ -7452,7 +7485,27 @@ function usesTwContentVariable(root) {
|
|
|
7452
7485
|
}
|
|
7453
7486
|
function isMiniProgramPreflightRule(node) {
|
|
7454
7487
|
if (node.type !== "rule") return false;
|
|
7455
|
-
|
|
7488
|
+
const selectors = getRuleSelectors(node);
|
|
7489
|
+
if (!isMiniProgramPreflightSelector(selectors)) return false;
|
|
7490
|
+
if (selectors.includes("*")) return hasTailwindPreflightDeclaration(node);
|
|
7491
|
+
if (hasTailwindVariableDeclaration(node)) return true;
|
|
7492
|
+
return selectors.some((selector) => selector === ":before" || selector === ":after" || selector === "::before" || selector === "::after") && selectors.some((selector) => selector === "view" || selector === "text") && hasTailwindPreflightDeclaration(node);
|
|
7493
|
+
}
|
|
7494
|
+
function isBrowserElementPreflightRule(node) {
|
|
7495
|
+
if (node.type !== "rule") return false;
|
|
7496
|
+
const selectors = getRuleSelectors(node);
|
|
7497
|
+
if (selectors.length !== 1) return false;
|
|
7498
|
+
const declarations = BROWSER_PREFLIGHT_SINGLE_ELEMENT_DECLARATIONS.get(selectors[0]);
|
|
7499
|
+
if (!declarations) return false;
|
|
7500
|
+
let hasDeclaration = false;
|
|
7501
|
+
let allBrowserPreflightDeclarations = true;
|
|
7502
|
+
node.each((child) => {
|
|
7503
|
+
if (child.type !== "decl") return;
|
|
7504
|
+
hasDeclaration = true;
|
|
7505
|
+
const key = `${child.prop.toLowerCase()}:${child.value.trim().toLowerCase()}`;
|
|
7506
|
+
if (!declarations.has(key)) allBrowserPreflightDeclarations = false;
|
|
7507
|
+
});
|
|
7508
|
+
return hasDeclaration && allBrowserPreflightDeclarations;
|
|
7456
7509
|
}
|
|
7457
7510
|
function isMiniProgramThemeVariableRule(node) {
|
|
7458
7511
|
if (node.type !== "rule") return false;
|
|
@@ -7488,7 +7541,7 @@ function reorderPreflightResetDeclarations(rule) {
|
|
|
7488
7541
|
}
|
|
7489
7542
|
function createHoistInsertionAnchor(root) {
|
|
7490
7543
|
for (const node of root.nodes ?? []) if (isMiniProgramPreflightRule(node) || isMiniProgramThemeVariableRule(node)) {
|
|
7491
|
-
const anchor = postcss.comment({ text: HOIST_ANCHOR_COMMENT });
|
|
7544
|
+
const anchor = postcss$1.comment({ text: HOIST_ANCHOR_COMMENT });
|
|
7492
7545
|
node.before(anchor);
|
|
7493
7546
|
return anchor;
|
|
7494
7547
|
}
|
|
@@ -7544,7 +7597,7 @@ function mergeEquivalentHoistedRules(rules) {
|
|
|
7544
7597
|
const MINI_PROGRAM_PSEUDO_CONTENT_SCOPE_SELECTOR$1 = "::before,\n::after";
|
|
7545
7598
|
const MINI_PROGRAM_PSEUDO_CONTENT_SELECTORS = new Set(["::before", "::after"]);
|
|
7546
7599
|
function createPseudoContentInitRule() {
|
|
7547
|
-
const rule = postcss.rule({ selector: MINI_PROGRAM_PSEUDO_CONTENT_SCOPE_SELECTOR$1 });
|
|
7600
|
+
const rule = postcss$1.rule({ selector: MINI_PROGRAM_PSEUDO_CONTENT_SCOPE_SELECTOR$1 });
|
|
7548
7601
|
rule.append({
|
|
7549
7602
|
prop: "--tw-content",
|
|
7550
7603
|
value: "''"
|
|
@@ -7598,7 +7651,7 @@ function collectPreflightRules(root, options = {}) {
|
|
|
7598
7651
|
}
|
|
7599
7652
|
function createPreflightResetRule(cssPreflight) {
|
|
7600
7653
|
if (!cssPreflight || typeof cssPreflight !== "object") return;
|
|
7601
|
-
const rule = postcss.rule({ selector: MINI_PROGRAM_ELEMENT_SCOPE_SELECTOR });
|
|
7654
|
+
const rule = postcss$1.rule({ selector: MINI_PROGRAM_ELEMENT_SCOPE_SELECTOR });
|
|
7602
7655
|
for (const [prop, value] of Object.entries(cssPreflight)) {
|
|
7603
7656
|
if (value === false) continue;
|
|
7604
7657
|
rule.append({
|
|
@@ -7636,7 +7689,7 @@ function removeSpecificityPlaceholders(root) {
|
|
|
7636
7689
|
function isEffectivelyEmptyContainer(container) {
|
|
7637
7690
|
return !container.nodes || container.nodes.every((node) => node.type === "comment");
|
|
7638
7691
|
}
|
|
7639
|
-
function removeEmptyAtRules(root) {
|
|
7692
|
+
function removeEmptyAtRules$1(root) {
|
|
7640
7693
|
root.walkAtRules((atRule) => {
|
|
7641
7694
|
if (isEffectivelyEmptyContainer(atRule)) atRule.remove();
|
|
7642
7695
|
});
|
|
@@ -7651,6 +7704,18 @@ function removeEmptyAtRuleAncestors(parent) {
|
|
|
7651
7704
|
function removeUnsupportedBrowserSelectors(root) {
|
|
7652
7705
|
root.walkRules((rule) => {
|
|
7653
7706
|
if (!rule.selectors || rule.selectors.length === 0) return;
|
|
7707
|
+
if (isUnsupportedBrowserPreflightSelector(rule.selector)) {
|
|
7708
|
+
const parent = rule.parent;
|
|
7709
|
+
rule.remove();
|
|
7710
|
+
removeEmptyAtRuleAncestors(parent);
|
|
7711
|
+
return;
|
|
7712
|
+
}
|
|
7713
|
+
if (isBrowserElementPreflightRule(rule)) {
|
|
7714
|
+
const parent = rule.parent;
|
|
7715
|
+
rule.remove();
|
|
7716
|
+
removeEmptyAtRuleAncestors(parent);
|
|
7717
|
+
return;
|
|
7718
|
+
}
|
|
7654
7719
|
const selectors = rule.selectors.filter((selector) => !isUnsupportedBrowserSelector(selector));
|
|
7655
7720
|
if (selectors.length === rule.selectors.length) return;
|
|
7656
7721
|
if (selectors.length === 0) {
|
|
@@ -7748,7 +7813,7 @@ function collectThemeVariableRule(root, options = {}) {
|
|
|
7748
7813
|
}
|
|
7749
7814
|
for (const rule of themeRules) rule.remove();
|
|
7750
7815
|
if (declarations.size === 0) return;
|
|
7751
|
-
const rule = postcss.rule({ selector: MINI_PROGRAM_THEME_SCOPE_SELECTOR });
|
|
7816
|
+
const rule = postcss$1.rule({ selector: MINI_PROGRAM_THEME_SCOPE_SELECTOR });
|
|
7752
7817
|
for (const decl of declarations.values()) rule.append(decl);
|
|
7753
7818
|
return rule;
|
|
7754
7819
|
}
|
|
@@ -7782,17 +7847,17 @@ function finalizeMiniProgramCssRoot(root, options = {}) {
|
|
|
7782
7847
|
const resetRule = createPreflightResetRule(options.cssPreflight);
|
|
7783
7848
|
if (resetRule) preflightRules.push(resetRule);
|
|
7784
7849
|
}
|
|
7785
|
-
if (tailwindcssV4DefaultNodes.length > 0) preflightRules.push(postcss.rule({
|
|
7850
|
+
if (tailwindcssV4DefaultNodes.length > 0) preflightRules.push(postcss$1.rule({
|
|
7786
7851
|
selector: MINI_PROGRAM_ELEMENT_SCOPE_SELECTOR,
|
|
7787
7852
|
nodes: tailwindcssV4DefaultNodes
|
|
7788
7853
|
}));
|
|
7789
7854
|
const themeRule = collectThemeVariableRule(root, options);
|
|
7790
7855
|
insertHoistedRules(root, mergeEquivalentHoistedRules(themeRule ? [...preflightRules, themeRule] : preflightRules), hoistAnchor);
|
|
7791
|
-
removeEmptyAtRules(root);
|
|
7856
|
+
removeEmptyAtRules$1(root);
|
|
7792
7857
|
}
|
|
7793
7858
|
function hoistTailwindPreflightBase(css) {
|
|
7794
7859
|
try {
|
|
7795
|
-
const root = postcss.parse(css);
|
|
7860
|
+
const root = postcss$1.parse(css);
|
|
7796
7861
|
insertHoistedRules(root, collectPreflightRules(root, { preservePseudoContentInit: true }));
|
|
7797
7862
|
return root.toString();
|
|
7798
7863
|
} catch {
|
|
@@ -7808,7 +7873,7 @@ function finalizeMiniProgramCss(css, options = {}) {
|
|
|
7808
7873
|
}
|
|
7809
7874
|
const cleanedCss = removeUnsupportedMiniProgramAtRules(css);
|
|
7810
7875
|
try {
|
|
7811
|
-
const root = postcss.parse(cleanedCss);
|
|
7876
|
+
const root = postcss$1.parse(cleanedCss);
|
|
7812
7877
|
finalizeMiniProgramCssRoot(root, {
|
|
7813
7878
|
...options,
|
|
7814
7879
|
isTailwindcssV4
|
|
@@ -7838,6 +7903,10 @@ function isMiniProgramElementVariableScopeRule(rule) {
|
|
|
7838
7903
|
const selectors = getRuleSelectors(rule);
|
|
7839
7904
|
return selectors.length > 0 && selectors.every((selector) => MINI_PROGRAM_ELEMENT_SCOPE_SELECTORS.has(selector));
|
|
7840
7905
|
}
|
|
7906
|
+
function isMiniProgramNativeElementRule(rule) {
|
|
7907
|
+
const selectors = getRuleSelectors(rule);
|
|
7908
|
+
return selectors.length > 0 && selectors.every((selector) => isMiniProgramNativeElementSelector(selector)) && !isMiniProgramPreflightRule(rule);
|
|
7909
|
+
}
|
|
7841
7910
|
function isOnlyTwContentDeclarations(rule) {
|
|
7842
7911
|
let hasDeclaration = false;
|
|
7843
7912
|
let onlyContentVariable = true;
|
|
@@ -7866,7 +7935,7 @@ function moveTailwindV4GradientRuntimeDeclarations(rule) {
|
|
|
7866
7935
|
decl.remove();
|
|
7867
7936
|
}
|
|
7868
7937
|
});
|
|
7869
|
-
if (gradientDeclarations.length > 0) rule.before(new postcss.Rule({
|
|
7938
|
+
if (gradientDeclarations.length > 0) rule.before(new postcss$1.Rule({
|
|
7870
7939
|
selector: MINI_PROGRAM_ELEMENT_SCOPE_SELECTOR,
|
|
7871
7940
|
nodes: gradientDeclarations
|
|
7872
7941
|
}));
|
|
@@ -7884,7 +7953,7 @@ function isKeyframesRule(rule) {
|
|
|
7884
7953
|
* 裁剪 Tailwind 生成 CSS 中面向浏览器的 classless 规则。
|
|
7885
7954
|
*/
|
|
7886
7955
|
function pruneMiniProgramGeneratedCss(css, options = {}) {
|
|
7887
|
-
const root = postcss.parse(css);
|
|
7956
|
+
const root = postcss$1.parse(css);
|
|
7888
7957
|
const shouldPreserveContentInit = options.preservePreflight || usesTwContentVariable(root);
|
|
7889
7958
|
root.walkComments((comment) => {
|
|
7890
7959
|
if (options.preserveConditionalComments && isConditionalCompilationComment(comment.text)) return;
|
|
@@ -7921,6 +7990,15 @@ function pruneMiniProgramGeneratedCss(css, options = {}) {
|
|
|
7921
7990
|
rule.selector = MINI_PROGRAM_ELEMENT_SCOPE_SELECTOR;
|
|
7922
7991
|
return;
|
|
7923
7992
|
}
|
|
7993
|
+
if (isUnsupportedBrowserPreflightSelector(rule.selector)) {
|
|
7994
|
+
rule.remove();
|
|
7995
|
+
return;
|
|
7996
|
+
}
|
|
7997
|
+
if (isBrowserElementPreflightRule(rule)) {
|
|
7998
|
+
rule.remove();
|
|
7999
|
+
return;
|
|
8000
|
+
}
|
|
8001
|
+
if (isMiniProgramNativeElementRule(rule)) return;
|
|
7924
8002
|
if (isMiniProgramThemeVariableRule(rule)) {
|
|
7925
8003
|
moveTailwindV4GradientRuntimeDeclarations(rule);
|
|
7926
8004
|
if (!rule.parent) return;
|
|
@@ -7929,7 +8007,11 @@ function pruneMiniProgramGeneratedCss(css, options = {}) {
|
|
|
7929
8007
|
}
|
|
7930
8008
|
if (hasClassSelector$2(rule.selector)) return;
|
|
7931
8009
|
if (!shouldPreserveContentInit) removeEmptyContentInitDeclarations(rule);
|
|
7932
|
-
if (
|
|
8010
|
+
if (isMiniProgramPreflightRule(rule)) {
|
|
8011
|
+
if (options.preservePreflight) return;
|
|
8012
|
+
rule.remove();
|
|
8013
|
+
return;
|
|
8014
|
+
}
|
|
7933
8015
|
if (isCustomPropertyRule(rule)) {
|
|
7934
8016
|
moveTailwindV4GradientRuntimeDeclarations(rule);
|
|
7935
8017
|
if (!rule.parent) return;
|
|
@@ -7944,6 +8026,875 @@ function pruneMiniProgramGeneratedCss(css, options = {}) {
|
|
|
7944
8026
|
return root.toString();
|
|
7945
8027
|
}
|
|
7946
8028
|
//#endregion
|
|
8029
|
+
//#region src/css-macro/auto.ts
|
|
8030
|
+
const CSS_MACRO_STYLE_OPTIONS_MARKER = "__weappTailwindcssCssMacroEnabled";
|
|
8031
|
+
const PLATFORM_ENV_KEYS$1 = [
|
|
8032
|
+
"WEAPP_TW_TARGET",
|
|
8033
|
+
"WEAPP_TAILWINDCSS_TARGET",
|
|
8034
|
+
"UNI_PLATFORM",
|
|
8035
|
+
"UNI_UTS_PLATFORM",
|
|
8036
|
+
"TARO_ENV",
|
|
8037
|
+
"MPX_CLI_MODE",
|
|
8038
|
+
"MPX_CURRENT_TARGET_MODE"
|
|
8039
|
+
];
|
|
8040
|
+
const CONDITIONAL_END_RE = /^\s*#endif\s*$/;
|
|
8041
|
+
function readEnvValue$1(key) {
|
|
8042
|
+
return typeof process$1 === "undefined" ? void 0 : process$1.env[key];
|
|
8043
|
+
}
|
|
8044
|
+
function normalizePlatformToken(value) {
|
|
8045
|
+
return value?.trim().replaceAll("_", "-").toUpperCase() || void 0;
|
|
8046
|
+
}
|
|
8047
|
+
function resolveCssMacroPlatform(options) {
|
|
8048
|
+
const explicit = normalizePlatformToken(options?.platform);
|
|
8049
|
+
if (explicit) return explicit;
|
|
8050
|
+
for (const key of PLATFORM_ENV_KEYS$1) {
|
|
8051
|
+
const value = normalizePlatformToken(readEnvValue$1(key));
|
|
8052
|
+
if (value) return value;
|
|
8053
|
+
}
|
|
8054
|
+
}
|
|
8055
|
+
function createPlatformTokenSet(platform) {
|
|
8056
|
+
const normalized = normalizePlatformToken(platform);
|
|
8057
|
+
const tokens = /* @__PURE__ */ new Set();
|
|
8058
|
+
if (!normalized) return tokens;
|
|
8059
|
+
tokens.add(normalized);
|
|
8060
|
+
if (normalized.startsWith("MP-")) tokens.add("MP");
|
|
8061
|
+
if (normalized === "WEAPP" || normalized === "WEIXIN" || normalized === "WX") {
|
|
8062
|
+
tokens.add("MP");
|
|
8063
|
+
tokens.add("MP-WEIXIN");
|
|
8064
|
+
}
|
|
8065
|
+
if (normalized === "MP-WEIXIN") {
|
|
8066
|
+
tokens.add("WEAPP");
|
|
8067
|
+
tokens.add("WEIXIN");
|
|
8068
|
+
tokens.add("WX");
|
|
8069
|
+
}
|
|
8070
|
+
if (normalized === "H5") tokens.add("WEB");
|
|
8071
|
+
if (normalized === "WEB") tokens.add("H5");
|
|
8072
|
+
if (normalized === "APP") tokens.add("APP-PLUS");
|
|
8073
|
+
if (normalized.startsWith("APP-")) tokens.add("APP");
|
|
8074
|
+
if (normalized.startsWith("QUICKAPP-WEBVIEW")) tokens.add("QUICKAPP-WEBVIEW");
|
|
8075
|
+
return tokens;
|
|
8076
|
+
}
|
|
8077
|
+
function combineAnd(values) {
|
|
8078
|
+
if (values.includes(false)) return false;
|
|
8079
|
+
return values.every((value) => value === true) ? true : void 0;
|
|
8080
|
+
}
|
|
8081
|
+
function combineOr(values) {
|
|
8082
|
+
if (values.includes(true)) return true;
|
|
8083
|
+
return values.every((value) => value === false) ? false : void 0;
|
|
8084
|
+
}
|
|
8085
|
+
function evaluatePlatformExpression(expression, platformTokens) {
|
|
8086
|
+
return combineOr(expression.split(/\s*\|\|\s*/).map((orPart) => {
|
|
8087
|
+
return combineAnd(orPart.split(/\s*&&\s*/).map((part) => {
|
|
8088
|
+
const token = normalizePlatformToken(part);
|
|
8089
|
+
if (!token || /[<>=!()]/.test(token)) return;
|
|
8090
|
+
return platformTokens.has(token);
|
|
8091
|
+
}));
|
|
8092
|
+
}));
|
|
8093
|
+
}
|
|
8094
|
+
function negateConditionalValue(value) {
|
|
8095
|
+
return value === void 0 ? void 0 : !value;
|
|
8096
|
+
}
|
|
8097
|
+
function getActiveConditionalValue(stack) {
|
|
8098
|
+
if (stack.includes(false)) return false;
|
|
8099
|
+
return stack.includes(void 0) ? void 0 : true;
|
|
8100
|
+
}
|
|
8101
|
+
function parseConditionalStart(text) {
|
|
8102
|
+
const normalized = text.trim();
|
|
8103
|
+
if (!normalized.startsWith("#")) return;
|
|
8104
|
+
const body = normalized.slice(1).trimStart();
|
|
8105
|
+
for (const directive of ["ifndef", "ifdef"]) {
|
|
8106
|
+
if (!body.startsWith(directive)) continue;
|
|
8107
|
+
const expression = body.slice(directive.length).trim();
|
|
8108
|
+
if (expression.length === 0) return;
|
|
8109
|
+
return {
|
|
8110
|
+
directive,
|
|
8111
|
+
expression
|
|
8112
|
+
};
|
|
8113
|
+
}
|
|
8114
|
+
}
|
|
8115
|
+
function compileCssMacroConditionalComments(css, options) {
|
|
8116
|
+
const platformTokens = createPlatformTokenSet(resolveCssMacroPlatform(options));
|
|
8117
|
+
if (platformTokens.size === 0 || !css.includes("#if")) return css;
|
|
8118
|
+
try {
|
|
8119
|
+
const root = postcss$1.parse(css);
|
|
8120
|
+
const transformContainer = (container) => {
|
|
8121
|
+
const stack = [];
|
|
8122
|
+
for (const node of [...container.nodes ?? []]) {
|
|
8123
|
+
if (node.type === "comment") {
|
|
8124
|
+
const start = parseConditionalStart(node.text);
|
|
8125
|
+
if (start) {
|
|
8126
|
+
const value = start.directive === "ifndef" ? negateConditionalValue(evaluatePlatformExpression(start.expression, platformTokens)) : evaluatePlatformExpression(start.expression, platformTokens);
|
|
8127
|
+
const parentActive = getActiveConditionalValue(stack);
|
|
8128
|
+
stack.push(value);
|
|
8129
|
+
if (parentActive !== void 0 && value !== void 0) node.remove();
|
|
8130
|
+
continue;
|
|
8131
|
+
}
|
|
8132
|
+
if (CONDITIONAL_END_RE.test(node.text)) {
|
|
8133
|
+
const value = stack.pop();
|
|
8134
|
+
if (getActiveConditionalValue(stack) !== void 0 && value !== void 0) node.remove();
|
|
8135
|
+
continue;
|
|
8136
|
+
}
|
|
8137
|
+
}
|
|
8138
|
+
if (getActiveConditionalValue(stack) === false) {
|
|
8139
|
+
node.remove();
|
|
8140
|
+
continue;
|
|
8141
|
+
}
|
|
8142
|
+
if ("nodes" in node && node.nodes) transformContainer(node);
|
|
8143
|
+
}
|
|
8144
|
+
};
|
|
8145
|
+
transformContainer(root);
|
|
8146
|
+
return root.toString();
|
|
8147
|
+
} catch {
|
|
8148
|
+
return css;
|
|
8149
|
+
}
|
|
8150
|
+
}
|
|
8151
|
+
function parseCssPluginRequest(params) {
|
|
8152
|
+
const value = params.trim();
|
|
8153
|
+
const quoted = /^(['"])(.*?)\1/.exec(value);
|
|
8154
|
+
if (quoted) return quoted[2];
|
|
8155
|
+
const url = /^url\(\s*(?:(['"])(.*?)\1|([^'")\s]+))\s*\)/.exec(value);
|
|
8156
|
+
return url?.[2] ?? url?.[3];
|
|
8157
|
+
}
|
|
8158
|
+
function isCssMacroPluginRequest(request) {
|
|
8159
|
+
if (request === "weapp-tailwindcss/css-macro") return true;
|
|
8160
|
+
if (!request?.includes("css-macro")) return false;
|
|
8161
|
+
return path.basename(request).startsWith("css-macro");
|
|
8162
|
+
}
|
|
8163
|
+
function hasCssMacroTailwindV4Directive(css) {
|
|
8164
|
+
if (!css?.includes("css-macro")) return false;
|
|
8165
|
+
try {
|
|
8166
|
+
let found = false;
|
|
8167
|
+
postcss$1.parse(css).walkAtRules("plugin", (rule) => {
|
|
8168
|
+
if (isCssMacroPluginRequest(parseCssPluginRequest(rule.params))) found = true;
|
|
8169
|
+
});
|
|
8170
|
+
return found;
|
|
8171
|
+
} catch {
|
|
8172
|
+
return /@plugin\s+(?:url\(\s*)?["']weapp-tailwindcss\/css-macro["']/.test(css);
|
|
8173
|
+
}
|
|
8174
|
+
}
|
|
8175
|
+
function isCssMacroPostcssPlugin(plugin) {
|
|
8176
|
+
if (plugin === creator) return true;
|
|
8177
|
+
return Boolean(plugin && (typeof plugin === "function" || typeof plugin === "object") && plugin.postcssPlugin === "postcss-weapp-tw-css-macro-plugin");
|
|
8178
|
+
}
|
|
8179
|
+
function withCssMacroPostcssPlugins(plugins) {
|
|
8180
|
+
const macroPlugin = creator();
|
|
8181
|
+
if (!plugins) return [macroPlugin];
|
|
8182
|
+
if (Array.isArray(plugins)) return plugins.some(isCssMacroPostcssPlugin) ? plugins : [...plugins, macroPlugin];
|
|
8183
|
+
if (typeof plugins === "object") {
|
|
8184
|
+
const values = Object.values(plugins).filter(Boolean);
|
|
8185
|
+
if (values.some(isCssMacroPostcssPlugin)) return values;
|
|
8186
|
+
return [...values, macroPlugin];
|
|
8187
|
+
}
|
|
8188
|
+
return [macroPlugin];
|
|
8189
|
+
}
|
|
8190
|
+
function withCssMacroStyleOptions(options) {
|
|
8191
|
+
const postcssOptions = options?.postcssOptions;
|
|
8192
|
+
return {
|
|
8193
|
+
...options,
|
|
8194
|
+
[CSS_MACRO_STYLE_OPTIONS_MARKER]: true,
|
|
8195
|
+
postcssOptions: {
|
|
8196
|
+
...postcssOptions,
|
|
8197
|
+
plugins: withCssMacroPostcssPlugins(postcssOptions?.plugins)
|
|
8198
|
+
}
|
|
8199
|
+
};
|
|
8200
|
+
}
|
|
8201
|
+
function hasCssMacroStyleOptions(options) {
|
|
8202
|
+
return Boolean(options?.[CSS_MACRO_STYLE_OPTIONS_MARKER]);
|
|
8203
|
+
}
|
|
8204
|
+
async function transformCssMacroCss(css, options) {
|
|
8205
|
+
const result = (await postcss$1([creator()]).process(css, { from: void 0 })).css;
|
|
8206
|
+
return compileCssMacroConditionalComments(result, options);
|
|
8207
|
+
}
|
|
8208
|
+
//#endregion
|
|
8209
|
+
//#region src/generator-plugin/config-directive.ts
|
|
8210
|
+
function quoteCssString(value) {
|
|
8211
|
+
return value.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
|
|
8212
|
+
}
|
|
8213
|
+
function toCssPath(value) {
|
|
8214
|
+
return value.replaceAll("\\", "/");
|
|
8215
|
+
}
|
|
8216
|
+
function prependConfigDirective(css, config) {
|
|
8217
|
+
if (!config || /@config\s+/.test(css)) return css;
|
|
8218
|
+
return `@config "${quoteCssString(toCssPath(config))}";\n${css}`;
|
|
8219
|
+
}
|
|
8220
|
+
//#endregion
|
|
8221
|
+
//#region src/generator-plugin/context.ts
|
|
8222
|
+
const PLUGIN_NAME$1 = "weapp-tailwindcss";
|
|
8223
|
+
function resolveInputFile(result) {
|
|
8224
|
+
const from = result.opts.from;
|
|
8225
|
+
if (typeof from !== "string" || from.length === 0) return;
|
|
8226
|
+
return path.isAbsolute(from) ? from : path.resolve(process$1.cwd(), from);
|
|
8227
|
+
}
|
|
8228
|
+
function resolvePostcssBase(result, options) {
|
|
8229
|
+
if (options.base) return options.base;
|
|
8230
|
+
const inputFile = resolveInputFile(result);
|
|
8231
|
+
return inputFile ? path.dirname(inputFile) : process$1.cwd();
|
|
8232
|
+
}
|
|
8233
|
+
function resolvePostcssProjectRoot(result, options) {
|
|
8234
|
+
if (options.projectRoot) return options.projectRoot;
|
|
8235
|
+
const inputFile = resolveInputFile(result);
|
|
8236
|
+
return inputFile ? path.dirname(inputFile) : process$1.cwd();
|
|
8237
|
+
}
|
|
8238
|
+
function replaceRootCss(root, css, result) {
|
|
8239
|
+
root.removeAll();
|
|
8240
|
+
try {
|
|
8241
|
+
const nextRoot = postcss$1.parse(css, { from: resolveInputFile(result) });
|
|
8242
|
+
root.append(nextRoot.nodes);
|
|
8243
|
+
} catch {
|
|
8244
|
+
root.raws = { after: css };
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
function addDependencyMessages(result, generated) {
|
|
8248
|
+
for (const file of generated.dependencies) result.messages.push({
|
|
8249
|
+
type: "dependency",
|
|
8250
|
+
plugin: PLUGIN_NAME$1,
|
|
8251
|
+
file
|
|
8252
|
+
});
|
|
8253
|
+
}
|
|
8254
|
+
function addSourceDependencyMessages(result, files) {
|
|
8255
|
+
for (const file of files) result.messages.push({
|
|
8256
|
+
type: "dependency",
|
|
8257
|
+
plugin: PLUGIN_NAME$1,
|
|
8258
|
+
file
|
|
8259
|
+
});
|
|
8260
|
+
}
|
|
8261
|
+
//#endregion
|
|
8262
|
+
//#region src/generator-plugin/directives.ts
|
|
8263
|
+
const TAILWIND_ROOT_DIRECTIVE_NAMES = new Set([
|
|
8264
|
+
"config",
|
|
8265
|
+
"custom-variant",
|
|
8266
|
+
"plugin",
|
|
8267
|
+
"source",
|
|
8268
|
+
"tailwind",
|
|
8269
|
+
"theme",
|
|
8270
|
+
"utility",
|
|
8271
|
+
"variant"
|
|
8272
|
+
]);
|
|
8273
|
+
function parseImportRequest(params) {
|
|
8274
|
+
return /^(?:url\(\s*)?(["']?)([^"')\s]+)\1\s*\)?/.exec(params.trim())?.[2];
|
|
8275
|
+
}
|
|
8276
|
+
function isTailwindImportRequest(request, options = {}) {
|
|
8277
|
+
const normalized = options.importFallback && (request === "weapp-tailwindcss" || request?.startsWith("weapp-tailwindcss/")) ? request.replace(/^weapp-tailwindcss/, "tailwindcss") : request;
|
|
8278
|
+
return normalized === "tailwindcss" || normalized === "tailwindcss4" || normalized?.startsWith("tailwindcss/") === true || normalized?.startsWith("tailwindcss4/") === true;
|
|
8279
|
+
}
|
|
8280
|
+
function hasTailwindApplyDirective(css) {
|
|
8281
|
+
return /@apply\b/.test(css);
|
|
8282
|
+
}
|
|
8283
|
+
function hasTailwindRootDirectives(root, options = {}) {
|
|
8284
|
+
let found = false;
|
|
8285
|
+
root.walkAtRules((rule) => {
|
|
8286
|
+
if (rule.name === "import" && isTailwindImportRequest(parseImportRequest(rule.params), options)) {
|
|
8287
|
+
found = true;
|
|
8288
|
+
return false;
|
|
8289
|
+
}
|
|
8290
|
+
if (TAILWIND_ROOT_DIRECTIVE_NAMES.has(rule.name)) {
|
|
8291
|
+
found = true;
|
|
8292
|
+
return false;
|
|
8293
|
+
}
|
|
8294
|
+
});
|
|
8295
|
+
return found;
|
|
8296
|
+
}
|
|
8297
|
+
//#endregion
|
|
8298
|
+
//#region src/source-scan/inline-source.ts
|
|
8299
|
+
const NUMERICAL_RANGE_RE = /^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;
|
|
8300
|
+
function segmentTopLevel(input, separator, options = {}) {
|
|
8301
|
+
const parts = [];
|
|
8302
|
+
const stack = [];
|
|
8303
|
+
let lastPos = 0;
|
|
8304
|
+
let quote;
|
|
8305
|
+
for (let index = 0; index < input.length; index++) {
|
|
8306
|
+
const char = input[index];
|
|
8307
|
+
if (char === "\\") {
|
|
8308
|
+
index += 1;
|
|
8309
|
+
continue;
|
|
8310
|
+
}
|
|
8311
|
+
if (quote) {
|
|
8312
|
+
if (char === quote) quote = void 0;
|
|
8313
|
+
continue;
|
|
8314
|
+
}
|
|
8315
|
+
if (char === "\"" || char === "'") {
|
|
8316
|
+
quote = char;
|
|
8317
|
+
continue;
|
|
8318
|
+
}
|
|
8319
|
+
if (char === "(") {
|
|
8320
|
+
stack.push(")");
|
|
8321
|
+
continue;
|
|
8322
|
+
}
|
|
8323
|
+
if (char === "[") {
|
|
8324
|
+
stack.push("]");
|
|
8325
|
+
continue;
|
|
8326
|
+
}
|
|
8327
|
+
if (char === "{") {
|
|
8328
|
+
stack.push("}");
|
|
8329
|
+
continue;
|
|
8330
|
+
}
|
|
8331
|
+
if (stack.length > 0 && char === stack[stack.length - 1]) {
|
|
8332
|
+
stack.pop();
|
|
8333
|
+
continue;
|
|
8334
|
+
}
|
|
8335
|
+
if (stack.length === 0 && char === separator) {
|
|
8336
|
+
const part = input.slice(lastPos, index);
|
|
8337
|
+
if (part || options.keepEmpty) parts.push(part);
|
|
8338
|
+
lastPos = index + 1;
|
|
8339
|
+
}
|
|
8340
|
+
}
|
|
8341
|
+
const part = input.slice(lastPos);
|
|
8342
|
+
if (part || options.keepEmpty) parts.push(part);
|
|
8343
|
+
return parts;
|
|
8344
|
+
}
|
|
8345
|
+
function isSequence(value) {
|
|
8346
|
+
return NUMERICAL_RANGE_RE.test(value);
|
|
8347
|
+
}
|
|
8348
|
+
function expandSequence(value) {
|
|
8349
|
+
const match = value.match(NUMERICAL_RANGE_RE);
|
|
8350
|
+
if (!match) return [value];
|
|
8351
|
+
const [, start, end, stepValue] = match;
|
|
8352
|
+
if (start === void 0 || end === void 0) return [value];
|
|
8353
|
+
let step = stepValue ? Number.parseInt(stepValue, 10) : void 0;
|
|
8354
|
+
const startNumber = Number.parseInt(start, 10);
|
|
8355
|
+
const endNumber = Number.parseInt(end, 10);
|
|
8356
|
+
const increasing = startNumber < endNumber;
|
|
8357
|
+
if (step === void 0) step = increasing ? 1 : -1;
|
|
8358
|
+
if (step === 0) return [];
|
|
8359
|
+
if (increasing && step < 0) step = -step;
|
|
8360
|
+
if (!increasing && step > 0) step = -step;
|
|
8361
|
+
const result = [];
|
|
8362
|
+
for (let value = startNumber; increasing ? value <= endNumber : value >= endNumber; value += step) result.push(String(value));
|
|
8363
|
+
return result;
|
|
8364
|
+
}
|
|
8365
|
+
function expandInlineSourceCandidatePattern(pattern) {
|
|
8366
|
+
const index = pattern.indexOf("{");
|
|
8367
|
+
if (index === -1) return [pattern];
|
|
8368
|
+
const prefix = pattern.slice(0, index);
|
|
8369
|
+
const rest = pattern.slice(index);
|
|
8370
|
+
let depth = 0;
|
|
8371
|
+
let endIndex = -1;
|
|
8372
|
+
for (let index = 0; index < rest.length; index++) {
|
|
8373
|
+
const char = rest[index];
|
|
8374
|
+
if (char === "{") depth += 1;
|
|
8375
|
+
else if (char === "}") {
|
|
8376
|
+
depth -= 1;
|
|
8377
|
+
if (depth === 0) {
|
|
8378
|
+
endIndex = index;
|
|
8379
|
+
break;
|
|
8380
|
+
}
|
|
8381
|
+
}
|
|
8382
|
+
}
|
|
8383
|
+
if (endIndex === -1) return [pattern];
|
|
8384
|
+
const inner = rest.slice(1, endIndex);
|
|
8385
|
+
const suffix = rest.slice(endIndex + 1);
|
|
8386
|
+
const parts = (isSequence(inner) ? expandSequence(inner) : segmentTopLevel(inner, ",", { keepEmpty: true })).flatMap((part) => expandInlineSourceCandidatePattern(part));
|
|
8387
|
+
return expandInlineSourceCandidatePattern(suffix).flatMap((suffix) => parts.map((part) => `${prefix}${part}${suffix}`));
|
|
8388
|
+
}
|
|
8389
|
+
function parseSourceInlineParam(params) {
|
|
8390
|
+
let value = params.trim();
|
|
8391
|
+
const negated = value.startsWith("not ");
|
|
8392
|
+
if (negated) value = value.slice(4).trim();
|
|
8393
|
+
if (!value.startsWith("inline(") || !value.endsWith(")")) return;
|
|
8394
|
+
const inlineValue = value.slice(7, -1).trim();
|
|
8395
|
+
const match = /^(['"])([\s\S]*)\1$/.exec(inlineValue);
|
|
8396
|
+
if (!match) return;
|
|
8397
|
+
const source = match[2];
|
|
8398
|
+
if (source === void 0) return;
|
|
8399
|
+
return {
|
|
8400
|
+
negated,
|
|
8401
|
+
source
|
|
8402
|
+
};
|
|
8403
|
+
}
|
|
8404
|
+
function collectCssInlineSourceCandidates(root) {
|
|
8405
|
+
const included = /* @__PURE__ */ new Set();
|
|
8406
|
+
const excluded = /* @__PURE__ */ new Set();
|
|
8407
|
+
root.walkAtRules("source", (rule) => {
|
|
8408
|
+
const parsed = parseSourceInlineParam(rule.params);
|
|
8409
|
+
if (!parsed) return;
|
|
8410
|
+
const target = parsed.negated ? excluded : included;
|
|
8411
|
+
for (const source of segmentTopLevel(parsed.source, " ")) {
|
|
8412
|
+
const trimmed = source.trim();
|
|
8413
|
+
if (!trimmed) continue;
|
|
8414
|
+
for (const candidate of expandInlineSourceCandidatePattern(trimmed)) {
|
|
8415
|
+
const normalized = candidate.trim();
|
|
8416
|
+
if (normalized) target.add(normalized);
|
|
8417
|
+
}
|
|
8418
|
+
}
|
|
8419
|
+
});
|
|
8420
|
+
for (const candidate of excluded) included.delete(candidate);
|
|
8421
|
+
return {
|
|
8422
|
+
included,
|
|
8423
|
+
excluded
|
|
8424
|
+
};
|
|
8425
|
+
}
|
|
8426
|
+
//#endregion
|
|
8427
|
+
//#region src/source-scan.ts
|
|
8428
|
+
const DEFAULT_SOURCE_SCAN_EXTENSIONS = [
|
|
8429
|
+
"html",
|
|
8430
|
+
"wxml",
|
|
8431
|
+
"axml",
|
|
8432
|
+
"jxml",
|
|
8433
|
+
"ksml",
|
|
8434
|
+
"ttml",
|
|
8435
|
+
"qml",
|
|
8436
|
+
"tyml",
|
|
8437
|
+
"xhsml",
|
|
8438
|
+
"swan",
|
|
8439
|
+
"vue",
|
|
8440
|
+
"mpx",
|
|
8441
|
+
"js",
|
|
8442
|
+
"jsx",
|
|
8443
|
+
"ts",
|
|
8444
|
+
"tsx"
|
|
8445
|
+
];
|
|
8446
|
+
const FULL_SOURCE_SCAN_EXTENSIONS = [
|
|
8447
|
+
"js",
|
|
8448
|
+
"jsx",
|
|
8449
|
+
"mjs",
|
|
8450
|
+
"cjs",
|
|
8451
|
+
"ts",
|
|
8452
|
+
"tsx",
|
|
8453
|
+
"mts",
|
|
8454
|
+
"cts",
|
|
8455
|
+
"vue",
|
|
8456
|
+
"uvue",
|
|
8457
|
+
"nvue",
|
|
8458
|
+
"svelte",
|
|
8459
|
+
"mpx",
|
|
8460
|
+
"html",
|
|
8461
|
+
"wxml",
|
|
8462
|
+
"axml",
|
|
8463
|
+
"jxml",
|
|
8464
|
+
"ksml",
|
|
8465
|
+
"ttml",
|
|
8466
|
+
"qml",
|
|
8467
|
+
"tyml",
|
|
8468
|
+
"xhsml",
|
|
8469
|
+
"swan",
|
|
8470
|
+
"css",
|
|
8471
|
+
"wxss",
|
|
8472
|
+
"acss",
|
|
8473
|
+
"jxss",
|
|
8474
|
+
"ttss",
|
|
8475
|
+
"qss",
|
|
8476
|
+
"tyss",
|
|
8477
|
+
"scss",
|
|
8478
|
+
"sass",
|
|
8479
|
+
"less",
|
|
8480
|
+
"styl",
|
|
8481
|
+
"stylus"
|
|
8482
|
+
];
|
|
8483
|
+
function createSourceScanPattern(extensions = DEFAULT_SOURCE_SCAN_EXTENSIONS) {
|
|
8484
|
+
return `**/*.{${extensions.join(",")}}`;
|
|
8485
|
+
}
|
|
8486
|
+
createSourceScanPattern(FULL_SOURCE_SCAN_EXTENSIONS);
|
|
8487
|
+
new RegExp(`\\.(?:${FULL_SOURCE_SCAN_EXTENSIONS.map((extension) => extension.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|")})$`);
|
|
8488
|
+
function toPosixPath(value) {
|
|
8489
|
+
return value.split(path.sep).join("/");
|
|
8490
|
+
}
|
|
8491
|
+
function resolveSourceScanPath(value) {
|
|
8492
|
+
const resolved = path.resolve(value);
|
|
8493
|
+
try {
|
|
8494
|
+
return realpathSync.native(resolved);
|
|
8495
|
+
} catch {
|
|
8496
|
+
return resolved;
|
|
8497
|
+
}
|
|
8498
|
+
}
|
|
8499
|
+
function normalizeEntryPattern(entry) {
|
|
8500
|
+
return path.isAbsolute(entry.pattern) ? toPosixPath(path.relative(resolveSourceScanPath(entry.base), entry.pattern)) : entry.pattern;
|
|
8501
|
+
}
|
|
8502
|
+
function isFileMatchedByTailwindSourceEntry(file, entry) {
|
|
8503
|
+
const relative = toPosixPath(path.relative(resolveSourceScanPath(entry.base), file));
|
|
8504
|
+
return relative && !relative.startsWith("../") && !path.isAbsolute(relative) && micromatch.isMatch(relative, normalizeEntryPattern(entry));
|
|
8505
|
+
}
|
|
8506
|
+
function isFileExcludedByTailwindSourceEntries(file, entries) {
|
|
8507
|
+
if (!entries?.length) return false;
|
|
8508
|
+
const resolvedFile = resolveSourceScanPath(file);
|
|
8509
|
+
return entries.some((entry) => entry.negated && isFileMatchedByTailwindSourceEntry(resolvedFile, entry));
|
|
8510
|
+
}
|
|
8511
|
+
function parseConfigParam(params) {
|
|
8512
|
+
const value = params.trim();
|
|
8513
|
+
return /^(['"])(.+)\1$/.exec(value)?.[2];
|
|
8514
|
+
}
|
|
8515
|
+
function isLegacyContentObject(value) {
|
|
8516
|
+
return typeof value === "object" && value !== null && "files" in value;
|
|
8517
|
+
}
|
|
8518
|
+
function normalizeGlobPattern(pattern) {
|
|
8519
|
+
return pattern.startsWith("./") ? pattern.slice(2) : pattern;
|
|
8520
|
+
}
|
|
8521
|
+
function hasGlobMagic(value) {
|
|
8522
|
+
return /[*?[\]{}()!+@]/.test(value);
|
|
8523
|
+
}
|
|
8524
|
+
function splitStaticGlobPrefix(pattern) {
|
|
8525
|
+
const segments = normalizeGlobPattern(pattern).split(/[\\/]+/);
|
|
8526
|
+
const prefix = [];
|
|
8527
|
+
const rest = [];
|
|
8528
|
+
let reachedGlob = false;
|
|
8529
|
+
for (const segment of segments) {
|
|
8530
|
+
if (!reachedGlob && segment && !hasGlobMagic(segment)) {
|
|
8531
|
+
prefix.push(segment);
|
|
8532
|
+
continue;
|
|
8533
|
+
}
|
|
8534
|
+
reachedGlob = true;
|
|
8535
|
+
rest.push(segment);
|
|
8536
|
+
}
|
|
8537
|
+
return {
|
|
8538
|
+
prefix,
|
|
8539
|
+
rest
|
|
8540
|
+
};
|
|
8541
|
+
}
|
|
8542
|
+
function normalizeLegacyContentEntries(content, base, options = {}) {
|
|
8543
|
+
if (typeof content === "string") {
|
|
8544
|
+
const negated = content.startsWith("!");
|
|
8545
|
+
return [{
|
|
8546
|
+
base,
|
|
8547
|
+
negated,
|
|
8548
|
+
pattern: normalizeGlobPattern(negated ? content.slice(1) : content)
|
|
8549
|
+
}];
|
|
8550
|
+
}
|
|
8551
|
+
if (Array.isArray(content)) return content.flatMap((item) => normalizeLegacyContentEntries(item, base, options));
|
|
8552
|
+
if (isLegacyContentObject(content)) return normalizeLegacyContentEntries(content.files, content.relative && options.relativeBase ? options.relativeBase : base, options);
|
|
8553
|
+
return [];
|
|
8554
|
+
}
|
|
8555
|
+
async function pathExistsAsDirectory(file) {
|
|
8556
|
+
try {
|
|
8557
|
+
return (await stat(file)).isDirectory();
|
|
8558
|
+
} catch {
|
|
8559
|
+
return false;
|
|
8560
|
+
}
|
|
8561
|
+
}
|
|
8562
|
+
async function resolveTailwindSourceEntry(sourcePath, base, negated, defaultPattern = createSourceScanPattern()) {
|
|
8563
|
+
const absoluteSource = path.isAbsolute(sourcePath) ? path.resolve(sourcePath) : path.resolve(base, sourcePath);
|
|
8564
|
+
if (await pathExistsAsDirectory(absoluteSource)) return {
|
|
8565
|
+
base: absoluteSource,
|
|
8566
|
+
negated,
|
|
8567
|
+
pattern: normalizeGlobPattern(defaultPattern)
|
|
8568
|
+
};
|
|
8569
|
+
if (path.isAbsolute(sourcePath)) return {
|
|
8570
|
+
base: path.dirname(absoluteSource),
|
|
8571
|
+
negated,
|
|
8572
|
+
pattern: normalizeGlobPattern(path.basename(absoluteSource))
|
|
8573
|
+
};
|
|
8574
|
+
const { prefix, rest } = splitStaticGlobPrefix(sourcePath);
|
|
8575
|
+
if (prefix.length > 0 && rest.length > 0) return {
|
|
8576
|
+
base: path.resolve(base, ...prefix),
|
|
8577
|
+
negated,
|
|
8578
|
+
pattern: normalizeGlobPattern(rest.join("/"))
|
|
8579
|
+
};
|
|
8580
|
+
return {
|
|
8581
|
+
base,
|
|
8582
|
+
negated,
|
|
8583
|
+
pattern: normalizeGlobPattern(sourcePath)
|
|
8584
|
+
};
|
|
8585
|
+
}
|
|
8586
|
+
function parseSourceFileParam(params) {
|
|
8587
|
+
const value = params.trim();
|
|
8588
|
+
if (!value || value === "none" || value.startsWith("inline(")) return;
|
|
8589
|
+
const negated = value.startsWith("not ");
|
|
8590
|
+
const sourceValue = negated ? value.slice(4).trim() : value;
|
|
8591
|
+
if (sourceValue.startsWith("inline(")) return;
|
|
8592
|
+
const match = /^(['"])(.+)\1$/.exec(sourceValue);
|
|
8593
|
+
return match?.[2] ? {
|
|
8594
|
+
negated,
|
|
8595
|
+
sourcePath: match[2]
|
|
8596
|
+
} : void 0;
|
|
8597
|
+
}
|
|
8598
|
+
async function resolveCssSourceEntries(root, base, defaultPattern = createSourceScanPattern()) {
|
|
8599
|
+
const entries = [];
|
|
8600
|
+
const tasks = [];
|
|
8601
|
+
root.walkAtRules("source", (rule) => {
|
|
8602
|
+
const parsed = parseSourceFileParam(rule.params);
|
|
8603
|
+
if (!parsed) return;
|
|
8604
|
+
tasks.push(resolveTailwindSourceEntry(parsed.sourcePath, base, parsed.negated, defaultPattern));
|
|
8605
|
+
});
|
|
8606
|
+
entries.push(...await Promise.all(tasks));
|
|
8607
|
+
return entries;
|
|
8608
|
+
}
|
|
8609
|
+
async function expandTailwindSourceEntries(entries, options = {}) {
|
|
8610
|
+
if (entries.length === 0) return [];
|
|
8611
|
+
const files = /* @__PURE__ */ new Set();
|
|
8612
|
+
const entriesByBase = /* @__PURE__ */ new Map();
|
|
8613
|
+
for (const entry of entries) {
|
|
8614
|
+
const base = path.resolve(entry.base);
|
|
8615
|
+
const group = entriesByBase.get(base) ?? [];
|
|
8616
|
+
group.push({
|
|
8617
|
+
...entry,
|
|
8618
|
+
base
|
|
8619
|
+
});
|
|
8620
|
+
entriesByBase.set(base, group);
|
|
8621
|
+
}
|
|
8622
|
+
await Promise.all([...entriesByBase.entries()].map(async ([base, group]) => {
|
|
8623
|
+
const ignoredSources = options.ignore?.map((pattern) => ({
|
|
8624
|
+
base,
|
|
8625
|
+
pattern: normalizeGlobPattern(pattern),
|
|
8626
|
+
negated: true
|
|
8627
|
+
}));
|
|
8628
|
+
const matched = await resolveProjectSourceFiles({
|
|
8629
|
+
cwd: base,
|
|
8630
|
+
sources: group,
|
|
8631
|
+
...ignoredSources === void 0 ? {} : { ignoredSources }
|
|
8632
|
+
});
|
|
8633
|
+
for (const file of matched) files.add(path.resolve(file));
|
|
8634
|
+
}));
|
|
8635
|
+
return [...files].filter((file) => !isFileExcludedByTailwindSourceEntries(file, entries));
|
|
8636
|
+
}
|
|
8637
|
+
//#endregion
|
|
8638
|
+
//#region src/generator-plugin/source-files.ts
|
|
8639
|
+
const POSTCSS_SOURCE_PATTERN = createSourceScanPattern(DEFAULT_SOURCE_SCAN_EXTENSIONS);
|
|
8640
|
+
function isTailwindV4ApplyOnlyCss$1(root, options) {
|
|
8641
|
+
return options.version === 4 && hasTailwindApplyDirective(root.toString()) && !hasTailwindRootDirectives(root, { importFallback: true });
|
|
8642
|
+
}
|
|
8643
|
+
function getSourceExtension(file) {
|
|
8644
|
+
return path.extname(file).slice(1) || void 0;
|
|
8645
|
+
}
|
|
8646
|
+
function collectConfigPaths(root, base) {
|
|
8647
|
+
const configPaths = [];
|
|
8648
|
+
root.walkAtRules("config", (rule) => {
|
|
8649
|
+
const configPath = parseConfigParam(rule.params);
|
|
8650
|
+
if (configPath) configPaths.push(path.isAbsolute(configPath) ? configPath : path.resolve(base, configPath));
|
|
8651
|
+
});
|
|
8652
|
+
return [...new Set(configPaths)];
|
|
8653
|
+
}
|
|
8654
|
+
function resolveOptionConfigPath(config, base) {
|
|
8655
|
+
if (!config) return;
|
|
8656
|
+
return path.isAbsolute(config) ? config : path.resolve(base, config);
|
|
8657
|
+
}
|
|
8658
|
+
async function collectConfigContentFiles(root, base, options) {
|
|
8659
|
+
const configPaths = [...new Set([...resolveOptionConfigPath(options.config, base) ? [resolveOptionConfigPath(options.config, base)] : [], ...collectConfigPaths(root, base)])];
|
|
8660
|
+
const files = [];
|
|
8661
|
+
for (const configPath of configPaths) {
|
|
8662
|
+
const contentEntries = normalizeLegacyContentEntries((await loadConfig({
|
|
8663
|
+
config: configPath,
|
|
8664
|
+
cwd: path.dirname(configPath)
|
|
8665
|
+
}))?.config.content, options.version === 3 ? options.projectRoot ?? base : path.dirname(configPath), { relativeBase: path.dirname(configPath) });
|
|
8666
|
+
files.push(...await expandTailwindSourceEntries(contentEntries));
|
|
8667
|
+
}
|
|
8668
|
+
return {
|
|
8669
|
+
configPaths,
|
|
8670
|
+
files: [...new Set(files)]
|
|
8671
|
+
};
|
|
8672
|
+
}
|
|
8673
|
+
async function collectConfiguredContentEntries(root, base, options) {
|
|
8674
|
+
const configPath = resolveOptionConfigPath(options.generator?.config ?? options.config, base) ?? collectConfigPaths(root, base)[0];
|
|
8675
|
+
if (!configPath) return [];
|
|
8676
|
+
const resolvedConfigPath = path.isAbsolute(configPath) ? configPath : path.resolve(base, configPath);
|
|
8677
|
+
return normalizeLegacyContentEntries((await loadConfig({
|
|
8678
|
+
config: resolvedConfigPath,
|
|
8679
|
+
cwd: path.dirname(resolvedConfigPath)
|
|
8680
|
+
}))?.config.content, options.version === 3 ? options.projectRoot ?? base : path.dirname(resolvedConfigPath), { relativeBase: path.dirname(resolvedConfigPath) });
|
|
8681
|
+
}
|
|
8682
|
+
async function collectRawCandidatesFromSourceEntries(sourceEntries) {
|
|
8683
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
8684
|
+
const files = await expandTailwindSourceEntries(sourceEntries);
|
|
8685
|
+
await Promise.all(files.map(async (file) => {
|
|
8686
|
+
const matches = await extractRawCandidatesWithPositions(await readFile(file, "utf8"), getSourceExtension(file));
|
|
8687
|
+
for (const match of matches) {
|
|
8688
|
+
const candidate = match?.rawCandidate;
|
|
8689
|
+
if (typeof candidate === "string" && candidate.length > 0) candidates.add(candidate);
|
|
8690
|
+
}
|
|
8691
|
+
}));
|
|
8692
|
+
return candidates;
|
|
8693
|
+
}
|
|
8694
|
+
async function collectAutoTailwindCandidates(root, result, options) {
|
|
8695
|
+
if (options.scanSources === false) return /* @__PURE__ */ new Set();
|
|
8696
|
+
const base = resolvePostcssBase(result, options);
|
|
8697
|
+
const projectRoot = resolvePostcssProjectRoot(result, options);
|
|
8698
|
+
const sourceEntries = [];
|
|
8699
|
+
const hasSourceNone = root.toString().includes("source(none)");
|
|
8700
|
+
const shouldSkipAutoScan = isTailwindV4ApplyOnlyCss$1(root, options);
|
|
8701
|
+
const inlineCandidates = collectCssInlineSourceCandidates(root);
|
|
8702
|
+
const configuredContentEntries = options.version === 3 ? await collectConfiguredContentEntries(root, base, options) : [];
|
|
8703
|
+
if (configuredContentEntries.length > 0) sourceEntries.push(...configuredContentEntries);
|
|
8704
|
+
else if (!hasSourceNone && !shouldSkipAutoScan) sourceEntries.push({
|
|
8705
|
+
base,
|
|
8706
|
+
negated: false,
|
|
8707
|
+
pattern: POSTCSS_SOURCE_PATTERN
|
|
8708
|
+
});
|
|
8709
|
+
sourceEntries.push(...await resolveCssSourceEntries(root, base, POSTCSS_SOURCE_PATTERN));
|
|
8710
|
+
const candidates = sourceEntries.length === 0 ? [] : options.version === 3 ? await collectRawCandidatesFromSourceEntries(sourceEntries) : await extractValidCandidates({
|
|
8711
|
+
base,
|
|
8712
|
+
css: root.toString(),
|
|
8713
|
+
cwd: projectRoot,
|
|
8714
|
+
sources: sourceEntries
|
|
8715
|
+
});
|
|
8716
|
+
return new Set([...[...candidates].filter((candidate) => !inlineCandidates.excluded.has(candidate)), ...inlineCandidates.included]);
|
|
8717
|
+
}
|
|
8718
|
+
async function collectPostcssLocalSources(root, result, options) {
|
|
8719
|
+
const base = resolvePostcssBase(result, options);
|
|
8720
|
+
const sourceEntries = await resolveCssSourceEntries(root, base, POSTCSS_SOURCE_PATTERN);
|
|
8721
|
+
const configContentFiles = await collectConfigContentFiles(root, base, options);
|
|
8722
|
+
const files = [...new Set([...await expandTailwindSourceEntries(sourceEntries), ...configContentFiles.files])];
|
|
8723
|
+
const sources = await Promise.all(files.map(async (file) => {
|
|
8724
|
+
const extension = getSourceExtension(file);
|
|
8725
|
+
return {
|
|
8726
|
+
content: await readFile(file, "utf8"),
|
|
8727
|
+
...extension === void 0 ? {} : { extension }
|
|
8728
|
+
};
|
|
8729
|
+
}));
|
|
8730
|
+
return {
|
|
8731
|
+
files: [...files, ...configContentFiles.configPaths],
|
|
8732
|
+
sources
|
|
8733
|
+
};
|
|
8734
|
+
}
|
|
8735
|
+
//#endregion
|
|
8736
|
+
//#region src/generator-plugin/package-version.ts
|
|
8737
|
+
function normalizeSupportedTailwindcssMajorVersion(version) {
|
|
8738
|
+
return version === 3 || version === 4 ? version : void 0;
|
|
8739
|
+
}
|
|
8740
|
+
function readPackageJson(packageJsonPath) {
|
|
8741
|
+
try {
|
|
8742
|
+
return JSON.parse(readFileSync(packageJsonPath, "utf8"));
|
|
8743
|
+
} catch {
|
|
8744
|
+
return;
|
|
8745
|
+
}
|
|
8746
|
+
}
|
|
8747
|
+
function readDeclaredPackageVersion(packageName, pkg) {
|
|
8748
|
+
return pkg?.dependencies?.[packageName] ?? pkg?.devDependencies?.[packageName] ?? pkg?.peerDependencies?.[packageName] ?? pkg?.optionalDependencies?.[packageName];
|
|
8749
|
+
}
|
|
8750
|
+
function findPackageJsonDeclaringPackage(packageName, base) {
|
|
8751
|
+
let current = path.resolve(base);
|
|
8752
|
+
while (true) {
|
|
8753
|
+
const pkgPath = path.join(current, "package.json");
|
|
8754
|
+
if (existsSync(pkgPath)) {
|
|
8755
|
+
const pkg = readPackageJson(pkgPath);
|
|
8756
|
+
if (readDeclaredPackageVersion(packageName, pkg)) return pkgPath;
|
|
8757
|
+
if (pkg?.name !== "weapp-tailwindcss") return;
|
|
8758
|
+
}
|
|
8759
|
+
const parent = path.dirname(current);
|
|
8760
|
+
if (parent === current) return;
|
|
8761
|
+
current = parent;
|
|
8762
|
+
}
|
|
8763
|
+
}
|
|
8764
|
+
function readDeclaredPackageMajorVersion(version) {
|
|
8765
|
+
const match = version?.match(/(?:^|\D)([34])(?:\.|\b)/);
|
|
8766
|
+
return normalizeSupportedTailwindcssMajorVersion(match ? Number(match[1]) : void 0);
|
|
8767
|
+
}
|
|
8768
|
+
function readInstalledPackageMajorVersion(packageName, base) {
|
|
8769
|
+
const packageJsonPath = findPackageJsonDeclaringPackage(packageName, base);
|
|
8770
|
+
if (!packageJsonPath) return;
|
|
8771
|
+
const declaredVersion = readDeclaredPackageVersion(packageName, readPackageJson(packageJsonPath));
|
|
8772
|
+
if (!declaredVersion) return;
|
|
8773
|
+
try {
|
|
8774
|
+
const pkg = createRequire(packageJsonPath)(`${packageName}/package.json`);
|
|
8775
|
+
return normalizeSupportedTailwindcssMajorVersion(Number(pkg.version?.split(".")[0]));
|
|
8776
|
+
} catch {
|
|
8777
|
+
return readDeclaredPackageMajorVersion(declaredVersion);
|
|
8778
|
+
}
|
|
8779
|
+
}
|
|
8780
|
+
//#endregion
|
|
8781
|
+
//#region src/generator-plugin/tailwind-version.ts
|
|
8782
|
+
function hasTailwindV4CssSyntax(root) {
|
|
8783
|
+
let hasV4Syntax = false;
|
|
8784
|
+
root.walkAtRules((rule) => {
|
|
8785
|
+
if (rule.name === "theme" || rule.name === "source" || rule.name === "custom-variant") hasV4Syntax = true;
|
|
8786
|
+
if (rule.name === "import" && /(['"])tailwindcss\1/.test(rule.params)) hasV4Syntax = true;
|
|
8787
|
+
});
|
|
8788
|
+
return hasV4Syntax;
|
|
8789
|
+
}
|
|
8790
|
+
function resolvePostcssTailwindVersion(root, result, options) {
|
|
8791
|
+
if (options.version) return options.version;
|
|
8792
|
+
const packageName = options.packageName ?? "tailwindcss";
|
|
8793
|
+
const installedVersion = readInstalledPackageMajorVersion(packageName, resolvePostcssProjectRoot(result, options));
|
|
8794
|
+
if (installedVersion) return installedVersion;
|
|
8795
|
+
if (packageName === "@tailwindcss/postcss" || packageName.includes("tailwindcss4")) return 4;
|
|
8796
|
+
if (packageName.includes("tailwindcss3")) return 3;
|
|
8797
|
+
if (hasTailwindV4CssSyntax(root)) return 4;
|
|
8798
|
+
return 4;
|
|
8799
|
+
}
|
|
8800
|
+
//#endregion
|
|
8801
|
+
//#region src/generator-plugin/index.ts
|
|
8802
|
+
const PLUGIN_NAME = "weapp-tailwindcss";
|
|
8803
|
+
function isTailwindV4ApplyOnlyCss(css, root) {
|
|
8804
|
+
return hasTailwindApplyDirective(css) && !hasTailwindRootDirectives(root, { importFallback: true });
|
|
8805
|
+
}
|
|
8806
|
+
function resolveTailwindV4PostcssSourceCss(css, sourceOptions, root) {
|
|
8807
|
+
return isTailwindV4ApplyOnlyCss(css, root) ? `@import "${sourceOptions.packageName ?? "tailwindcss"}" source(none);\n${css}` : css;
|
|
8808
|
+
}
|
|
8809
|
+
function normalizeSelector$1(selector) {
|
|
8810
|
+
return selector.replace(/:not\(#\\#\)/g, "").trim();
|
|
8811
|
+
}
|
|
8812
|
+
function collectApplyOnlyCssSelectors(css) {
|
|
8813
|
+
const selectors = /* @__PURE__ */ new Set();
|
|
8814
|
+
try {
|
|
8815
|
+
postcss$1.parse(css).walkRules((rule) => {
|
|
8816
|
+
if (!rule.nodes?.some((node) => node.type === "atrule" && node.name === "apply")) return;
|
|
8817
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
8818
|
+
const normalized = normalizeSelector$1(selector);
|
|
8819
|
+
if (normalized) selectors.add(normalized);
|
|
8820
|
+
}
|
|
8821
|
+
});
|
|
8822
|
+
} catch {}
|
|
8823
|
+
return selectors;
|
|
8824
|
+
}
|
|
8825
|
+
function ruleMatchesApplyOnlySelector(rule, selectors) {
|
|
8826
|
+
return (rule.selectors ?? [rule.selector]).some((selector) => selectors.has(normalizeSelector$1(selector)));
|
|
8827
|
+
}
|
|
8828
|
+
function filterApplyOnlyGeneratedCss(css, rawCss) {
|
|
8829
|
+
const selectors = collectApplyOnlyCssSelectors(rawCss);
|
|
8830
|
+
if (selectors.size === 0) return css;
|
|
8831
|
+
try {
|
|
8832
|
+
const root = postcss$1.parse(css);
|
|
8833
|
+
root.walkRules((rule) => {
|
|
8834
|
+
if (!ruleMatchesApplyOnlySelector(rule, selectors) && !rule.nodes?.some((node) => node.type === "decl" && node.prop.startsWith("--"))) rule.remove();
|
|
8835
|
+
});
|
|
8836
|
+
root.walkAtRules((rule) => {
|
|
8837
|
+
if (rule.nodes !== void 0 && rule.nodes.length === 0) rule.remove();
|
|
8838
|
+
});
|
|
8839
|
+
return root.toString();
|
|
8840
|
+
} catch {
|
|
8841
|
+
return css;
|
|
8842
|
+
}
|
|
8843
|
+
}
|
|
8844
|
+
function createWeappTailwindcssPostcssPlugin(adapters) {
|
|
8845
|
+
const plugin = (options = {}) => {
|
|
8846
|
+
return {
|
|
8847
|
+
postcssPlugin: PLUGIN_NAME,
|
|
8848
|
+
async Once(root, { result }) {
|
|
8849
|
+
const { candidates, generator: userGeneratorOptions, scanSources, sources, styleOptions, ...sourceOptions } = options;
|
|
8850
|
+
const generatorOptions = adapters.normalizeGeneratorOptions(userGeneratorOptions);
|
|
8851
|
+
const tailwindVersion = resolvePostcssTailwindVersion(root, result, options);
|
|
8852
|
+
const [collectedSources, autoCandidates] = await Promise.all([collectPostcssLocalSources(root, result, options), collectAutoTailwindCandidates(root, result, options)]);
|
|
8853
|
+
const generatorConfig = generatorOptions.config ?? options.config;
|
|
8854
|
+
const rawCss = sourceOptions.css ?? root.toString();
|
|
8855
|
+
const isApplyOnlyTailwindV4Css = tailwindVersion === 4 && isTailwindV4ApplyOnlyCss(rawCss, root);
|
|
8856
|
+
const source = tailwindVersion === 3 ? await adapters.resolveTailwindV3Source({
|
|
8857
|
+
config: generatorConfig,
|
|
8858
|
+
css: rawCss,
|
|
8859
|
+
base: resolvePostcssBase(result, options),
|
|
8860
|
+
cwd: resolvePostcssProjectRoot(result, options),
|
|
8861
|
+
projectRoot: resolvePostcssProjectRoot(result, options),
|
|
8862
|
+
packageName: options.packageName,
|
|
8863
|
+
postcssPlugin: options.postcssPlugin
|
|
8864
|
+
}) : await adapters.resolveTailwindV4Source({
|
|
8865
|
+
...sourceOptions,
|
|
8866
|
+
css: prependConfigDirective(resolveTailwindV4PostcssSourceCss(rawCss, sourceOptions, root), generatorConfig),
|
|
8867
|
+
base: resolvePostcssBase(result, options),
|
|
8868
|
+
projectRoot: resolvePostcssProjectRoot(result, options)
|
|
8869
|
+
});
|
|
8870
|
+
const generated = await adapters.createGenerator(source).generate({
|
|
8871
|
+
candidates: new Set([...autoCandidates, ...candidates ?? []]),
|
|
8872
|
+
scanSources: scanSources ?? false,
|
|
8873
|
+
sources: [...collectedSources.sources, ...sources ?? []],
|
|
8874
|
+
styleOptions: {
|
|
8875
|
+
...generatorOptions.styleOptions,
|
|
8876
|
+
...styleOptions
|
|
8877
|
+
},
|
|
8878
|
+
tailwindcssV3Compatibility: generatorOptions.tailwindcssV3Compatibility,
|
|
8879
|
+
target: generatorOptions.target
|
|
8880
|
+
});
|
|
8881
|
+
replaceRootCss(root, isApplyOnlyTailwindV4Css ? filterApplyOnlyGeneratedCss(generated.css, rawCss) : generated.css, result);
|
|
8882
|
+
addDependencyMessages(result, generated);
|
|
8883
|
+
addSourceDependencyMessages(result, collectedSources.files);
|
|
8884
|
+
result.messages.push({
|
|
8885
|
+
type: "weapp-tailwindcss:generated",
|
|
8886
|
+
plugin: PLUGIN_NAME,
|
|
8887
|
+
target: generated.target,
|
|
8888
|
+
classSet: generated.classSet,
|
|
8889
|
+
rawCss: generated.rawCss
|
|
8890
|
+
});
|
|
8891
|
+
}
|
|
8892
|
+
};
|
|
8893
|
+
};
|
|
8894
|
+
plugin.postcss = true;
|
|
8895
|
+
return plugin;
|
|
8896
|
+
}
|
|
8897
|
+
//#endregion
|
|
7947
8898
|
//#region src/compat/uni-app-x.ts
|
|
7948
8899
|
const UNI_APP_X_BASE_CARRIER_SELECTORS = new Set([
|
|
7949
8900
|
"*",
|
|
@@ -8013,7 +8964,7 @@ function injectUniAppXBaseDefaults(result, defaults) {
|
|
|
8013
8964
|
const declaration = defaults.get(variableName);
|
|
8014
8965
|
if (declaration) prependDecls.push(declaration);
|
|
8015
8966
|
}
|
|
8016
|
-
for (const declaration of prependDecls.reverse()) rule.prepend(postcss.decl({
|
|
8967
|
+
for (const declaration of prependDecls.reverse()) rule.prepend(postcss$1.decl({
|
|
8017
8968
|
prop: declaration.prop,
|
|
8018
8969
|
value: declaration.value,
|
|
8019
8970
|
important: declaration.important
|
|
@@ -38186,7 +39137,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38186
39137
|
var feature = require_feature().default;
|
|
38187
39138
|
var region = require_region().default;
|
|
38188
39139
|
var fs = __require("fs");
|
|
38189
|
-
var path$
|
|
39140
|
+
var path$2 = __require("path");
|
|
38190
39141
|
var BrowserslistError = require_error();
|
|
38191
39142
|
var IS_SECTION = /^\s*\[(.+)]\s*$/;
|
|
38192
39143
|
var CONFIG_PATTERN = /^browserslist-config-/;
|
|
@@ -38224,7 +39175,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38224
39175
|
return getPathType(dir) === PATHTYPE_DIR;
|
|
38225
39176
|
}
|
|
38226
39177
|
function eachParent(file, callback, cache) {
|
|
38227
|
-
var loc = path$
|
|
39178
|
+
var loc = path$2.resolve(file);
|
|
38228
39179
|
var pathsForCacheResult = [];
|
|
38229
39180
|
var result;
|
|
38230
39181
|
do {
|
|
@@ -38240,7 +39191,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38240
39191
|
result = locResult;
|
|
38241
39192
|
break;
|
|
38242
39193
|
}
|
|
38243
|
-
} while (loc !== (loc = path$
|
|
39194
|
+
} while (loc !== (loc = path$2.dirname(loc)));
|
|
38244
39195
|
if (cache && !process.env.BROWSERSLIST_DISABLE_CACHE) pathsForCacheResult.forEach(function(cachePath) {
|
|
38245
39196
|
cache[cachePath] = result;
|
|
38246
39197
|
});
|
|
@@ -38248,8 +39199,8 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38248
39199
|
}
|
|
38249
39200
|
function pathInRoot(p) {
|
|
38250
39201
|
if (!process.env.BROWSERSLIST_ROOT_PATH) return true;
|
|
38251
|
-
var rootPath = path$
|
|
38252
|
-
if (path$
|
|
39202
|
+
var rootPath = path$2.resolve(process.env.BROWSERSLIST_ROOT_PATH);
|
|
39203
|
+
if (path$2.relative(rootPath, p).substring(0, 2) === "..") return false;
|
|
38253
39204
|
return true;
|
|
38254
39205
|
}
|
|
38255
39206
|
function check(section) {
|
|
@@ -38283,7 +39234,7 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38283
39234
|
}
|
|
38284
39235
|
function parsePackageOrReadConfig(file) {
|
|
38285
39236
|
if (file in parseConfigCache) return parseConfigCache[file];
|
|
38286
|
-
var result = path$
|
|
39237
|
+
var result = path$2.basename(file) === "package.json" ? parsePackage(file) : module.exports.readConfig(file);
|
|
38287
39238
|
if (!process.env.BROWSERSLIST_DISABLE_CACHE) parseConfigCache[file] = result;
|
|
38288
39239
|
return result;
|
|
38289
39240
|
}
|
|
@@ -38343,14 +39294,14 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38343
39294
|
},
|
|
38344
39295
|
loadStat: function loadStat(ctx, name, data) {
|
|
38345
39296
|
if (!ctx.dangerousExtend && !process.env.BROWSERSLIST_DANGEROUS_EXTEND) checkExtend(name);
|
|
38346
|
-
return normalizeStats(data, __require(__require.resolve(path$
|
|
39297
|
+
return normalizeStats(data, __require(__require.resolve(path$2.posix.join(name, "browserslist-stats.json"), { paths: ["."] })));
|
|
38347
39298
|
},
|
|
38348
39299
|
getStat: function getStat(opts, data) {
|
|
38349
39300
|
var stats;
|
|
38350
39301
|
if (opts.stats) stats = opts.stats;
|
|
38351
39302
|
else if (process.env.BROWSERSLIST_STATS) stats = process.env.BROWSERSLIST_STATS;
|
|
38352
|
-
else if (opts.path && path$
|
|
38353
|
-
var file = path$
|
|
39303
|
+
else if (opts.path && path$2.resolve && fs.existsSync) stats = eachParent(opts.path, function(dir) {
|
|
39304
|
+
var file = path$2.join(dir, "browserslist-stats.json");
|
|
38354
39305
|
return isFile(file) ? file : void 0;
|
|
38355
39306
|
}, statCache);
|
|
38356
39307
|
if (typeof stats === "string") try {
|
|
@@ -38423,9 +39374,9 @@ var require_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
38423
39374
|
},
|
|
38424
39375
|
findConfigFile: function findConfigFile(from) {
|
|
38425
39376
|
return eachParent(from, function(dir) {
|
|
38426
|
-
var config = path$
|
|
38427
|
-
var pkg = path$
|
|
38428
|
-
var rc = path$
|
|
39377
|
+
var config = path$2.join(dir, "browserslist");
|
|
39378
|
+
var pkg = path$2.join(dir, "package.json");
|
|
39379
|
+
var rc = path$2.join(dir, ".browserslistrc");
|
|
38429
39380
|
var pkgBrowserslist;
|
|
38430
39381
|
if (isFile(pkg)) try {
|
|
38431
39382
|
pkgBrowserslist = parsePackage(pkg);
|
|
@@ -38547,7 +39498,7 @@ var import_browserslist = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin
|
|
|
38547
39498
|
var agents = require_agents().agents;
|
|
38548
39499
|
var e2c = require_versions();
|
|
38549
39500
|
var jsEOL = require_release_schedule();
|
|
38550
|
-
var path = __require("path");
|
|
39501
|
+
var path$1 = __require("path");
|
|
38551
39502
|
var BrowserslistError = require_error();
|
|
38552
39503
|
var env = require_node();
|
|
38553
39504
|
var parseWithoutCache = require_parse();
|
|
@@ -38800,7 +39751,7 @@ var import_browserslist = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin
|
|
|
38800
39751
|
}
|
|
38801
39752
|
function prepareOpts(opts) {
|
|
38802
39753
|
if (typeof opts === "undefined") opts = {};
|
|
38803
|
-
if (typeof opts.path === "undefined") opts.path = path.resolve ? path.resolve(".") : ".";
|
|
39754
|
+
if (typeof opts.path === "undefined") opts.path = path$1.resolve ? path$1.resolve(".") : ".";
|
|
38804
39755
|
return opts;
|
|
38805
39756
|
}
|
|
38806
39757
|
function prepareQueries(queries, opts) {
|
|
@@ -38917,7 +39868,7 @@ var import_browserslist = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin
|
|
|
38917
39868
|
if (typeof stats === "undefined") data = browserslist.usage.global;
|
|
38918
39869
|
else if (stats === "my stats") {
|
|
38919
39870
|
var opts = {};
|
|
38920
|
-
opts.path = path.resolve ? path.resolve(".") : ".";
|
|
39871
|
+
opts.path = path$1.resolve ? path$1.resolve(".") : ".";
|
|
38921
39872
|
var customStats = env.getStat(opts);
|
|
38922
39873
|
if (!customStats) throw new BrowserslistError("Custom usage statistics was not provided");
|
|
38923
39874
|
data = {};
|
|
@@ -39816,7 +40767,7 @@ const e$10 = /^\s?initial\s?$/i, n$11 = /^font$/i, r$8 = /^all$/i, i$9 = [
|
|
|
39816
40767
|
"font-weight",
|
|
39817
40768
|
"font-stretch",
|
|
39818
40769
|
"line-height"
|
|
39819
|
-
], creator$
|
|
40770
|
+
], creator$52 = (a) => {
|
|
39820
40771
|
const l = Object.assign({ preserve: !0 }, a);
|
|
39821
40772
|
return {
|
|
39822
40773
|
postcssPlugin: "postcss-initial",
|
|
@@ -39836,7 +40787,7 @@ const e$10 = /^\s?initial\s?$/i, n$11 = /^font$/i, r$8 = /^all$/i, i$9 = [
|
|
|
39836
40787
|
}
|
|
39837
40788
|
};
|
|
39838
40789
|
};
|
|
39839
|
-
creator$
|
|
40790
|
+
creator$52.postcss = !0;
|
|
39840
40791
|
//#endregion
|
|
39841
40792
|
//#region ../../node_modules/.pnpm/@csstools+postcss-progressive-custom-properties@5.1.0_postcss@8.5.15/node_modules/@csstools/postcss-progressive-custom-properties/dist/index.mjs
|
|
39842
40793
|
const a$6 = [
|
|
@@ -42815,7 +43766,7 @@ function conditionsFromValue(a, t = !1) {
|
|
|
42815
43766
|
} catch {}
|
|
42816
43767
|
return t && !y ? { support: [] } : { support: Array.from(new Set(o)).sort() };
|
|
42817
43768
|
}
|
|
42818
|
-
const t$14 = /var\(/i, i$8 = /^initial$/i, o$23 = /^\s*$/, creator$
|
|
43769
|
+
const t$14 = /var\(/i, i$8 = /^initial$/i, o$23 = /^\s*$/, creator$51 = () => ({
|
|
42819
43770
|
postcssPlugin: "postcss-progressive-custom-properties",
|
|
42820
43771
|
prepare() {
|
|
42821
43772
|
const e = /* @__PURE__ */ new WeakMap();
|
|
@@ -42868,7 +43819,7 @@ const t$14 = /var\(/i, i$8 = /^initial$/i, o$23 = /^\s*$/, creator$50 = () => ({
|
|
|
42868
43819
|
};
|
|
42869
43820
|
}
|
|
42870
43821
|
});
|
|
42871
|
-
creator$
|
|
43822
|
+
creator$51.postcss = !0;
|
|
42872
43823
|
//#endregion
|
|
42873
43824
|
//#region ../../node_modules/.pnpm/@csstools+utilities@3.0.0_postcss@8.5.15/node_modules/@csstools/utilities/dist/index.mjs
|
|
42874
43825
|
function hasFallback$1(e) {
|
|
@@ -43109,7 +44060,7 @@ const postcssPlugin$16 = (o) => {
|
|
|
43109
44060
|
}, o);
|
|
43110
44061
|
return r.enableProgressiveCustomProperties && r.preserve ? {
|
|
43111
44062
|
postcssPlugin: "postcss-color-function",
|
|
43112
|
-
plugins: [creator$
|
|
44063
|
+
plugins: [creator$51(), basePlugin$16(r)]
|
|
43113
44064
|
} : basePlugin$16(r);
|
|
43114
44065
|
};
|
|
43115
44066
|
postcssPlugin$16.postcss = !0;
|
|
@@ -43185,7 +44136,7 @@ function insertNode(t, s, n) {
|
|
|
43185
44136
|
t.insertAfter(t.at(r), n);
|
|
43186
44137
|
} else t.insertBefore(t.at(r), n);
|
|
43187
44138
|
}
|
|
43188
|
-
const creator$
|
|
44139
|
+
const creator$50 = (e) => {
|
|
43189
44140
|
const t = {
|
|
43190
44141
|
preserve: e?.preserve ?? !0,
|
|
43191
44142
|
subFeatures: { areaHrefNeedsFixing: e?.subFeatures?.areaHrefNeedsFixing ?? !1 }
|
|
@@ -43206,7 +44157,7 @@ const creator$49 = (e) => {
|
|
|
43206
44157
|
}
|
|
43207
44158
|
};
|
|
43208
44159
|
};
|
|
43209
|
-
creator$
|
|
44160
|
+
creator$50.postcss = !0;
|
|
43210
44161
|
//#endregion
|
|
43211
44162
|
//#region ../../node_modules/.pnpm/css-blank-pseudo@8.0.1_postcss@8.5.15/node_modules/css-blank-pseudo/dist/index.mjs
|
|
43212
44163
|
const s$14 = [
|
|
@@ -43225,7 +44176,7 @@ function isValidReplacement$1(e) {
|
|
|
43225
44176
|
for (let t = 0, o = s$14.length; t < o && n; t++) e.indexOf(s$14[t]) > -1 && (n = !1);
|
|
43226
44177
|
return n;
|
|
43227
44178
|
}
|
|
43228
|
-
const n$9 = "js-blank-pseudo", t$12 = ":blank", creator$
|
|
44179
|
+
const n$9 = "js-blank-pseudo", t$12 = ":blank", creator$49 = (s) => {
|
|
43229
44180
|
const o = Object.assign({
|
|
43230
44181
|
preserve: !0,
|
|
43231
44182
|
replaceWith: "[blank]",
|
|
@@ -43281,7 +44232,7 @@ const n$9 = "js-blank-pseudo", t$12 = ":blank", creator$48 = (s) => {
|
|
|
43281
44232
|
}
|
|
43282
44233
|
};
|
|
43283
44234
|
};
|
|
43284
|
-
creator$
|
|
44235
|
+
creator$49.postcss = !0;
|
|
43285
44236
|
//#endregion
|
|
43286
44237
|
//#region ../../node_modules/.pnpm/@csstools+selector-specificity@6.0.0_postcss-selector-parser@7.1.2/node_modules/@csstools/selector-specificity/dist/index.mjs
|
|
43287
44238
|
var import_postcss_page_break = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -43698,7 +44649,7 @@ function splitImportantStyles(e) {
|
|
|
43698
44649
|
}), r.before(t), removeEmptyDescendantBlocks(r);
|
|
43699
44650
|
});
|
|
43700
44651
|
}
|
|
43701
|
-
const creator$
|
|
44652
|
+
const creator$48 = (a) => {
|
|
43702
44653
|
const s = Object.assign({
|
|
43703
44654
|
onRevertLayerKeyword: "warn",
|
|
43704
44655
|
onConditionalRulesChangingLayerOrder: "warn",
|
|
@@ -43752,7 +44703,7 @@ const creator$47 = (a) => {
|
|
|
43752
44703
|
}
|
|
43753
44704
|
};
|
|
43754
44705
|
};
|
|
43755
|
-
creator$
|
|
44706
|
+
creator$48.postcss = !0;
|
|
43756
44707
|
//#endregion
|
|
43757
44708
|
//#region ../../node_modules/.pnpm/postcss-attribute-case-insensitive@8.0.0_postcss@8.5.15/node_modules/postcss-attribute-case-insensitive/dist/index.mjs
|
|
43758
44709
|
function nodeIsInsensitiveAttribute(e) {
|
|
@@ -43797,7 +44748,7 @@ function createNewSelectors(t) {
|
|
|
43797
44748
|
}), s = n;
|
|
43798
44749
|
}), s;
|
|
43799
44750
|
}
|
|
43800
|
-
const creator$
|
|
44751
|
+
const creator$47 = (t) => {
|
|
43801
44752
|
const s = Object.assign({ preserve: !1 }, t);
|
|
43802
44753
|
return {
|
|
43803
44754
|
postcssPlugin: "postcss-attribute-case-insensitive",
|
|
@@ -43826,7 +44777,7 @@ const creator$46 = (t) => {
|
|
|
43826
44777
|
}
|
|
43827
44778
|
};
|
|
43828
44779
|
};
|
|
43829
|
-
creator$
|
|
44780
|
+
creator$47.postcss = !0;
|
|
43830
44781
|
//#endregion
|
|
43831
44782
|
//#region ../../node_modules/.pnpm/@csstools+postcss-color-function@5.0.4_postcss@8.5.15/node_modules/@csstools/postcss-color-function/dist/index.mjs
|
|
43832
44783
|
var import_postcss_clamp = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -43928,7 +44879,7 @@ const postcssPlugin$15 = (o) => {
|
|
|
43928
44879
|
}, o);
|
|
43929
44880
|
return e.enableProgressiveCustomProperties && e.preserve ? {
|
|
43930
44881
|
postcssPlugin: "postcss-color-function",
|
|
43931
|
-
plugins: [creator$
|
|
44882
|
+
plugins: [creator$51(), basePlugin$15(e)]
|
|
43932
44883
|
} : basePlugin$15(e);
|
|
43933
44884
|
};
|
|
43934
44885
|
postcssPlugin$15.postcss = !0;
|
|
@@ -43957,7 +44908,7 @@ const postcssPlugin$14 = (o) => {
|
|
|
43957
44908
|
}, o);
|
|
43958
44909
|
return r.enableProgressiveCustomProperties && r.preserve ? {
|
|
43959
44910
|
postcssPlugin: "postcss-color-function-display-p3-linear",
|
|
43960
|
-
plugins: [creator$
|
|
44911
|
+
plugins: [creator$51(), basePlugin$14(r)]
|
|
43961
44912
|
} : basePlugin$14(r);
|
|
43962
44913
|
};
|
|
43963
44914
|
postcssPlugin$14.postcss = !0;
|
|
@@ -43986,7 +44937,7 @@ const postcssPlugin$13 = (o) => {
|
|
|
43986
44937
|
}, o);
|
|
43987
44938
|
return t.enableProgressiveCustomProperties && t.preserve ? {
|
|
43988
44939
|
postcssPlugin: "postcss-color-functional-notation",
|
|
43989
|
-
plugins: [creator$
|
|
44940
|
+
plugins: [creator$51(), basePlugin$13(t)]
|
|
43990
44941
|
} : basePlugin$13(t);
|
|
43991
44942
|
};
|
|
43992
44943
|
postcssPlugin$13.postcss = !0;
|
|
@@ -44022,7 +44973,7 @@ const postcssPlugin$12 = (e) => {
|
|
|
44022
44973
|
}, e);
|
|
44023
44974
|
return r.subFeatures = Object.assign({ displayP3: !0 }, r.subFeatures), r.enableProgressiveCustomProperties && (r.preserve || r.subFeatures.displayP3) ? {
|
|
44024
44975
|
postcssPlugin: "postcss-color-mix-function",
|
|
44025
|
-
plugins: [creator$
|
|
44976
|
+
plugins: [creator$51(), basePlugin$12(r)]
|
|
44026
44977
|
} : basePlugin$12(r);
|
|
44027
44978
|
};
|
|
44028
44979
|
postcssPlugin$12.postcss = !0;
|
|
@@ -44058,13 +45009,13 @@ const postcssPlugin$11 = (e) => {
|
|
|
44058
45009
|
}, e);
|
|
44059
45010
|
return r.subFeatures = Object.assign({ displayP3: !0 }, r.subFeatures), r.enableProgressiveCustomProperties && (r.preserve || r.subFeatures.displayP3) ? {
|
|
44060
45011
|
postcssPlugin: "color-mix-variadic-function-arguments",
|
|
44061
|
-
plugins: [creator$
|
|
45012
|
+
plugins: [creator$51(), basePlugin$11(r)]
|
|
44062
45013
|
} : basePlugin$11(r);
|
|
44063
45014
|
};
|
|
44064
45015
|
postcssPlugin$11.postcss = !0;
|
|
44065
45016
|
//#endregion
|
|
44066
45017
|
//#region ../../node_modules/.pnpm/@csstools+postcss-container-rule-prelude-list@1.0.1_postcss@8.5.15/node_modules/@csstools/postcss-container-rule-prelude-list/dist/index.mjs
|
|
44067
|
-
const t$10 = /^container$/i, creator$
|
|
45018
|
+
const t$10 = /^container$/i, creator$46 = (o) => {
|
|
44068
45019
|
const a = Object.assign({ preserve: !1 }, o);
|
|
44069
45020
|
return {
|
|
44070
45021
|
postcssPlugin: "postcss-container-rule-prelude-list",
|
|
@@ -44078,7 +45029,7 @@ const t$10 = /^container$/i, creator$45 = (o) => {
|
|
|
44078
45029
|
}
|
|
44079
45030
|
};
|
|
44080
45031
|
};
|
|
44081
|
-
creator$
|
|
45032
|
+
creator$46.postcss = !0;
|
|
44082
45033
|
//#endregion
|
|
44083
45034
|
//#region ../../node_modules/.pnpm/@csstools+postcss-content-alt-text@3.0.1_postcss@8.5.15/node_modules/@csstools/postcss-content-alt-text/dist/index.mjs
|
|
44084
45035
|
function transform$3(s, t) {
|
|
@@ -44112,7 +45063,7 @@ const p$2 = { test: (s) => s.includes("content:") && s.includes("/") }, basePlug
|
|
|
44112
45063
|
}
|
|
44113
45064
|
});
|
|
44114
45065
|
basePlugin$10.postcss = !0;
|
|
44115
|
-
const creator$
|
|
45066
|
+
const creator$45 = (t) => {
|
|
44116
45067
|
const e = Object.assign({
|
|
44117
45068
|
enableProgressiveCustomProperties: !0,
|
|
44118
45069
|
preserve: !0,
|
|
@@ -44120,10 +45071,10 @@ const creator$44 = (t) => {
|
|
|
44120
45071
|
}, t);
|
|
44121
45072
|
return e.enableProgressiveCustomProperties && e.preserve ? {
|
|
44122
45073
|
postcssPlugin: "postcss-content-alt-text",
|
|
44123
|
-
plugins: [creator$
|
|
45074
|
+
plugins: [creator$51(), basePlugin$10(e)]
|
|
44124
45075
|
} : basePlugin$10(e);
|
|
44125
45076
|
};
|
|
44126
|
-
creator$
|
|
45077
|
+
creator$45.postcss = !0;
|
|
44127
45078
|
//#endregion
|
|
44128
45079
|
//#region ../../node_modules/.pnpm/@csstools+postcss-contrast-color-function@3.0.4_postcss@8.5.15/node_modules/@csstools/postcss-contrast-color-function/dist/index.mjs
|
|
44129
45080
|
const u$6 = /\bcontrast-color\(/i, m$4 = /^contrast-color$/i, basePlugin$9 = (s) => ({
|
|
@@ -44152,7 +45103,7 @@ const postcssPlugin$10 = (o) => {
|
|
|
44152
45103
|
}, o);
|
|
44153
45104
|
return r.enableProgressiveCustomProperties && r.preserve ? {
|
|
44154
45105
|
postcssPlugin: "postcss-contrast-color-function",
|
|
44155
|
-
plugins: [creator$
|
|
45106
|
+
plugins: [creator$51(), basePlugin$9(r)]
|
|
44156
45107
|
} : basePlugin$9(r);
|
|
44157
45108
|
};
|
|
44158
45109
|
postcssPlugin$10.postcss = !0;
|
|
@@ -46427,7 +47378,7 @@ function mediaQueryIsSimple(e) {
|
|
|
46427
47378
|
if (isMediaAnd(e.node) || isMediaOr(e.node) || isMediaNot(e.node) || isMediaConditionList(e.node) || isGeneralEnclosed(e.node)) return r = !1, !1;
|
|
46428
47379
|
}), r;
|
|
46429
47380
|
}
|
|
46430
|
-
const creator$
|
|
47381
|
+
const creator$44 = (e) => {
|
|
46431
47382
|
const r = e?.preserve ?? !1;
|
|
46432
47383
|
if ("importFrom" in Object(e)) throw new Error("[postcss-custom-media] \"importFrom\" is no longer supported");
|
|
46433
47384
|
if ("exportTo" in Object(e)) throw new Error("[postcss-custom-media] \"exportTo\" is no longer supported");
|
|
@@ -46481,7 +47432,7 @@ const creator$43 = (e) => {
|
|
|
46481
47432
|
}
|
|
46482
47433
|
};
|
|
46483
47434
|
};
|
|
46484
|
-
creator$
|
|
47435
|
+
creator$44.postcss = !0;
|
|
46485
47436
|
//#endregion
|
|
46486
47437
|
//#region ../../node_modules/.pnpm/postcss-custom-properties@15.0.1_postcss@8.5.15/node_modules/postcss-custom-properties/dist/index.mjs
|
|
46487
47438
|
const o$20 = parse$1("csstools-implicit-layer")[0];
|
|
@@ -46768,7 +47719,7 @@ function parentHasExactFallback(e, t) {
|
|
|
46768
47719
|
const n = e.parent.index(e);
|
|
46769
47720
|
return e.parent.each((o, s) => o !== e && !(s >= n) && void ("decl" === o.type && o.prop.toLowerCase() === e.prop.toLowerCase() && o.value === t && (r = !0))), r;
|
|
46770
47721
|
}
|
|
46771
|
-
const g$4 = /\bvar\(|\(top: var\(--f\)/i, creator$
|
|
47722
|
+
const g$4 = /\bvar\(|\(top: var\(--f\)/i, creator$43 = (e) => {
|
|
46772
47723
|
const t = !("preserve" in Object(e)) || Boolean(e?.preserve);
|
|
46773
47724
|
if ("importFrom" in Object(e)) throw new Error("[postcss-custom-properties] \"importFrom\" is no longer supported");
|
|
46774
47725
|
if ("exportTo" in Object(e)) throw new Error("[postcss-custom-properties] \"exportTo\" is no longer supported");
|
|
@@ -46792,7 +47743,7 @@ const g$4 = /\bvar\(|\(top: var\(--f\)/i, creator$42 = (e) => {
|
|
|
46792
47743
|
}
|
|
46793
47744
|
};
|
|
46794
47745
|
};
|
|
46795
|
-
creator$
|
|
47746
|
+
creator$43.postcss = !0;
|
|
46796
47747
|
//#endregion
|
|
46797
47748
|
//#region ../../node_modules/.pnpm/postcss-custom-selectors@9.0.1_postcss@8.5.15/node_modules/postcss-custom-selectors/dist/index.mjs
|
|
46798
47749
|
const s$11 = parse$1("csstools-implicit-layer")[0];
|
|
@@ -46904,7 +47855,7 @@ function transformRule(r, t, s) {
|
|
|
46904
47855
|
}
|
|
46905
47856
|
return o;
|
|
46906
47857
|
}
|
|
46907
|
-
const creator$
|
|
47858
|
+
const creator$42 = (e) => {
|
|
46908
47859
|
const r = e?.preserve ?? !1;
|
|
46909
47860
|
if ("importFrom" in Object(e)) throw new Error("[postcss-custom-selectors] \"importFrom\" is no longer supported");
|
|
46910
47861
|
if ("exportTo" in Object(e)) throw new Error("[postcss-custom-selectors] \"exportTo\" is no longer supported");
|
|
@@ -46928,10 +47879,10 @@ const creator$41 = (e) => {
|
|
|
46928
47879
|
}
|
|
46929
47880
|
};
|
|
46930
47881
|
};
|
|
46931
|
-
creator$
|
|
47882
|
+
creator$42.postcss = !0;
|
|
46932
47883
|
//#endregion
|
|
46933
47884
|
//#region ../../node_modules/.pnpm/postcss-dir-pseudo-class@10.0.0_postcss@8.5.15/node_modules/postcss-dir-pseudo-class/dist/index.mjs
|
|
46934
|
-
const creator$
|
|
47885
|
+
const creator$41 = (t) => {
|
|
46935
47886
|
const r = Object.assign({
|
|
46936
47887
|
dir: null,
|
|
46937
47888
|
preserve: !1,
|
|
@@ -46999,7 +47950,7 @@ const creator$40 = (t) => {
|
|
|
46999
47950
|
}
|
|
47000
47951
|
};
|
|
47001
47952
|
};
|
|
47002
|
-
creator$
|
|
47953
|
+
creator$41.postcss = !0;
|
|
47003
47954
|
//#endregion
|
|
47004
47955
|
//#region ../../node_modules/.pnpm/@csstools+postcss-normalize-display-values@5.0.1_postcss@8.5.15/node_modules/@csstools/postcss-normalize-display-values/dist/index.mjs
|
|
47005
47956
|
var l$5 = new Map([
|
|
@@ -47053,7 +48004,7 @@ function transform$2(e) {
|
|
|
47053
48004
|
if (n.length <= 1) return e;
|
|
47054
48005
|
return l$5.get(n.join(",")) || e;
|
|
47055
48006
|
}
|
|
47056
|
-
const e$9 = /^display$/i, t$9 = /\b\s\b/, creator$
|
|
48007
|
+
const e$9 = /^display$/i, t$9 = /\b\s\b/, creator$40 = (i) => {
|
|
47057
48008
|
const l = !("preserve" in Object(i)) || Boolean(i?.preserve);
|
|
47058
48009
|
return {
|
|
47059
48010
|
postcssPlugin: "postcss-normalize-display-values",
|
|
@@ -47067,7 +48018,7 @@ const e$9 = /^display$/i, t$9 = /\b\s\b/, creator$39 = (i) => {
|
|
|
47067
48018
|
}
|
|
47068
48019
|
};
|
|
47069
48020
|
};
|
|
47070
|
-
creator$
|
|
48021
|
+
creator$40.postcss = !0;
|
|
47071
48022
|
//#endregion
|
|
47072
48023
|
//#region ../../node_modules/.pnpm/postcss-double-position-gradients@7.0.1_postcss@8.5.15/node_modules/postcss-double-position-gradients/dist/index.mjs
|
|
47073
48024
|
const o$18 = /(?:repeating-)?(?:conic|linear|radial)-gradient\(/i, i$5 = /^(?:repeating-)?(?:conic|linear|radial)-gradient$/i, n$7 = [
|
|
@@ -47143,13 +48094,13 @@ const postcssPlugin$9 = (t) => {
|
|
|
47143
48094
|
}, t);
|
|
47144
48095
|
return s.enableProgressiveCustomProperties && s.preserve ? {
|
|
47145
48096
|
postcssPlugin: "postcss-double-position-gradients",
|
|
47146
|
-
plugins: [creator$
|
|
48097
|
+
plugins: [creator$51(), basePlugin$8(s)]
|
|
47147
48098
|
} : basePlugin$8(s);
|
|
47148
48099
|
};
|
|
47149
48100
|
postcssPlugin$9.postcss = !0;
|
|
47150
48101
|
//#endregion
|
|
47151
48102
|
//#region ../../node_modules/.pnpm/@csstools+postcss-exponential-functions@3.0.3_postcss@8.5.15/node_modules/@csstools/postcss-exponential-functions/dist/index.mjs
|
|
47152
|
-
const s$10 = /(?<![-\w])(?:exp|hypot|log|pow|sqrt)\(/i, creator$
|
|
48103
|
+
const s$10 = /(?<![-\w])(?:exp|hypot|log|pow|sqrt)\(/i, creator$39 = (o) => {
|
|
47153
48104
|
const t = Object.assign({ preserve: !1 }, o);
|
|
47154
48105
|
return {
|
|
47155
48106
|
postcssPlugin: "postcss-exponential-functions",
|
|
@@ -47160,7 +48111,7 @@ const s$10 = /(?<![-\w])(?:exp|hypot|log|pow|sqrt)\(/i, creator$38 = (o) => {
|
|
|
47160
48111
|
}
|
|
47161
48112
|
};
|
|
47162
48113
|
};
|
|
47163
|
-
creator$
|
|
48114
|
+
creator$39.postcss = !0;
|
|
47164
48115
|
//#endregion
|
|
47165
48116
|
//#region ../../node_modules/.pnpm/@csstools+postcss-logical-float-and-clear@4.0.0_postcss@8.5.15/node_modules/@csstools/postcss-logical-float-and-clear/dist/index.mjs
|
|
47166
48117
|
const t$8 = "inline-start", o$17 = "inline-end";
|
|
@@ -47184,7 +48135,7 @@ function cloneDeclaration$2(t, o, e) {
|
|
|
47184
48135
|
})(e$8 || (e$8 = {})), function(t) {
|
|
47185
48136
|
t.Top = "top", t.Right = "right", t.Bottom = "bottom", t.Left = "left";
|
|
47186
48137
|
}(n$6 || (n$6 = {}));
|
|
47187
|
-
const creator$
|
|
48138
|
+
const creator$38 = (n) => {
|
|
47188
48139
|
const i = Object.assign({ inlineDirection: e$8.LeftToRight }, n), c = Object.values(e$8);
|
|
47189
48140
|
if (!c.includes(i.inlineDirection)) throw new Error(`[postcss-logical-float-and-clear] "inlineDirection" must be one of ${c.join(", ")}`);
|
|
47190
48141
|
if (![e$8.LeftToRight, e$8.RightToLeft].includes(i.inlineDirection)) return {
|
|
@@ -47204,10 +48155,10 @@ const creator$37 = (n) => {
|
|
|
47204
48155
|
}
|
|
47205
48156
|
};
|
|
47206
48157
|
};
|
|
47207
|
-
creator$
|
|
48158
|
+
creator$38.postcss = !0;
|
|
47208
48159
|
//#endregion
|
|
47209
48160
|
//#region ../../node_modules/.pnpm/postcss-focus-visible@11.0.0_postcss@8.5.15/node_modules/postcss-focus-visible/dist/index.mjs
|
|
47210
|
-
const s$9 = "js-focus-visible", o$16 = ":focus-visible", creator$
|
|
48161
|
+
const s$9 = "js-focus-visible", o$16 = ":focus-visible", creator$37 = (t) => {
|
|
47211
48162
|
const r = Object.assign({
|
|
47212
48163
|
preserve: !0,
|
|
47213
48164
|
replaceWith: ".focus-visible",
|
|
@@ -47258,7 +48209,7 @@ const s$9 = "js-focus-visible", o$16 = ":focus-visible", creator$36 = (t) => {
|
|
|
47258
48209
|
}
|
|
47259
48210
|
};
|
|
47260
48211
|
};
|
|
47261
|
-
creator$
|
|
48212
|
+
creator$37.postcss = !0;
|
|
47262
48213
|
//#endregion
|
|
47263
48214
|
//#region ../../node_modules/.pnpm/postcss-focus-within@10.0.0_postcss@8.5.15/node_modules/postcss-focus-within/dist/index.mjs
|
|
47264
48215
|
const s$8 = [
|
|
@@ -47277,7 +48228,7 @@ function isValidReplacement(e) {
|
|
|
47277
48228
|
for (let n = 0, o = s$8.length; n < o && t; n++) e.indexOf(s$8[n]) > -1 && (t = !1);
|
|
47278
48229
|
return t;
|
|
47279
48230
|
}
|
|
47280
|
-
const t$7 = "js-focus-within", n$5 = ":focus-within", creator$
|
|
48231
|
+
const t$7 = "js-focus-within", n$5 = ":focus-within", creator$36 = (s) => {
|
|
47281
48232
|
const o = Object.assign({
|
|
47282
48233
|
preserve: !0,
|
|
47283
48234
|
replaceWith: "[focus-within]",
|
|
@@ -47333,7 +48284,7 @@ const t$7 = "js-focus-within", n$5 = ":focus-within", creator$35 = (s) => {
|
|
|
47333
48284
|
}
|
|
47334
48285
|
};
|
|
47335
48286
|
};
|
|
47336
|
-
creator$
|
|
48287
|
+
creator$36.postcss = !0;
|
|
47337
48288
|
//#endregion
|
|
47338
48289
|
//#region ../../node_modules/.pnpm/@csstools+postcss-font-format-keywords@5.0.0_postcss@8.5.15/node_modules/@csstools/postcss-font-format-keywords/dist/index.mjs
|
|
47339
48290
|
const t$6 = [
|
|
@@ -47344,7 +48295,7 @@ const t$6 = [
|
|
|
47344
48295
|
"embedded-opentype",
|
|
47345
48296
|
"collection",
|
|
47346
48297
|
"svg"
|
|
47347
|
-
], creator$
|
|
48298
|
+
], creator$35 = (r) => {
|
|
47348
48299
|
const s = "preserve" in Object(r) && Boolean(r?.preserve);
|
|
47349
48300
|
return {
|
|
47350
48301
|
postcssPlugin: "postcss-font-format-keywords",
|
|
@@ -47368,7 +48319,7 @@ const t$6 = [
|
|
|
47368
48319
|
}
|
|
47369
48320
|
};
|
|
47370
48321
|
};
|
|
47371
|
-
creator$
|
|
48322
|
+
creator$35.postcss = !0;
|
|
47372
48323
|
//#endregion
|
|
47373
48324
|
//#region ../../node_modules/.pnpm/@csstools+postcss-font-width-property@1.0.0_postcss@8.5.15/node_modules/@csstools/postcss-font-width-property/dist/index.mjs
|
|
47374
48325
|
var import_postcss_font_variant = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -47464,7 +48415,7 @@ var import_postcss_font_variant = /* @__PURE__ */ __toESM((/* @__PURE__ */ __com
|
|
|
47464
48415
|
};
|
|
47465
48416
|
module.exports.postcss = true;
|
|
47466
48417
|
})))(), 1);
|
|
47467
|
-
const e$7 = /^font-width$/i, o$15 = /\bfont-width\b/i, s$7 = /^font-stretch$/i, creator$
|
|
48418
|
+
const e$7 = /^font-width$/i, o$15 = /\bfont-width\b/i, s$7 = /^font-stretch$/i, creator$34 = (s) => {
|
|
47468
48419
|
const r = Object.assign({ preserve: !1 }, s);
|
|
47469
48420
|
return {
|
|
47470
48421
|
postcssPlugin: "postcss-font-width-property",
|
|
@@ -47479,7 +48430,7 @@ function hasFallback(t) {
|
|
|
47479
48430
|
for (const o of e.nodes) if (o !== t && "decl" === o.type && s$7.test(o.prop)) return !0;
|
|
47480
48431
|
return !1;
|
|
47481
48432
|
}
|
|
47482
|
-
creator$
|
|
48433
|
+
creator$34.postcss = !0;
|
|
47483
48434
|
//#endregion
|
|
47484
48435
|
//#region ../../node_modules/.pnpm/@csstools+postcss-gamut-mapping@3.0.4_postcss@8.5.15/node_modules/@csstools/postcss-gamut-mapping/dist/index.mjs
|
|
47485
48436
|
const p = /\bcolor-gamut\b/i;
|
|
@@ -47499,7 +48450,7 @@ function sameProperty(e) {
|
|
|
47499
48450
|
}
|
|
47500
48451
|
return t;
|
|
47501
48452
|
}
|
|
47502
|
-
const d = /\b(?:color|lab|lch|oklab|oklch)\(/i, u$4 = /^(?:color|lab|lch|oklab|oklch)$/i, creator$
|
|
48453
|
+
const d = /\b(?:color|lab|lch|oklab|oklch)\(/i, u$4 = /^(?:color|lab|lch|oklab|oklch)$/i, creator$33 = () => ({
|
|
47503
48454
|
postcssPlugin: "postcss-gamut-mapping",
|
|
47504
48455
|
prepare() {
|
|
47505
48456
|
const p = /* @__PURE__ */ new WeakMap(), m = /* @__PURE__ */ new WeakSet();
|
|
@@ -47574,14 +48525,14 @@ const d = /\b(?:color|lab|lch|oklab|oklch)\(/i, u$4 = /^(?:color|lab|lch|oklab|o
|
|
|
47574
48525
|
};
|
|
47575
48526
|
}
|
|
47576
48527
|
});
|
|
47577
|
-
creator$
|
|
48528
|
+
creator$33.postcss = !0;
|
|
47578
48529
|
//#endregion
|
|
47579
48530
|
//#region ../../node_modules/.pnpm/postcss-gap-properties@7.0.0_postcss@8.5.15/node_modules/postcss-gap-properties/dist/index.mjs
|
|
47580
48531
|
const e$6 = [
|
|
47581
48532
|
"column-gap",
|
|
47582
48533
|
"gap",
|
|
47583
48534
|
"row-gap"
|
|
47584
|
-
], creator$
|
|
48535
|
+
], creator$32 = (o) => {
|
|
47585
48536
|
const r = Object.assign({ preserve: !0 }, o);
|
|
47586
48537
|
return {
|
|
47587
48538
|
postcssPlugin: "postcss-gap-properties",
|
|
@@ -47593,7 +48544,7 @@ const e$6 = [
|
|
|
47593
48544
|
}
|
|
47594
48545
|
};
|
|
47595
48546
|
};
|
|
47596
|
-
creator$
|
|
48547
|
+
creator$32.postcss = !0;
|
|
47597
48548
|
//#endregion
|
|
47598
48549
|
//#region ../../node_modules/.pnpm/@csstools+postcss-gradients-interpolation-method@6.0.4_postcss@8.5.15/node_modules/@csstools/postcss-gradients-interpolation-method/dist/index.mjs
|
|
47599
48550
|
const x = /(?:repeating-)?(?:linear|radial|conic)-gradient\(/i, W = /\bin\b/i, P$1 = { test: (o) => x.test(o) && W.test(o) }, A$1 = /^(repeating-)?(linear|radial|conic)-gradient$/i;
|
|
@@ -47878,7 +48829,7 @@ const postcssPlugin$8 = (e) => {
|
|
|
47878
48829
|
}, e);
|
|
47879
48830
|
return t.enableProgressiveCustomProperties ? {
|
|
47880
48831
|
postcssPlugin: "postcss-gradients-interpolation-method",
|
|
47881
|
-
plugins: [creator$
|
|
48832
|
+
plugins: [creator$51(), basePlugin$7(t)]
|
|
47882
48833
|
} : basePlugin$7(t);
|
|
47883
48834
|
};
|
|
47884
48835
|
postcssPlugin$8.postcss = !0;
|
|
@@ -47913,7 +48864,7 @@ function selectorContainsHasPseudo(t) {
|
|
|
47913
48864
|
} catch {}
|
|
47914
48865
|
return s;
|
|
47915
48866
|
}
|
|
47916
|
-
const creator$
|
|
48867
|
+
const creator$31 = (t) => {
|
|
47917
48868
|
const o = {
|
|
47918
48869
|
preserve: !0,
|
|
47919
48870
|
specificityMatchingName: "does-not-exist",
|
|
@@ -47992,10 +48943,10 @@ function isWithinSupportCheck(e) {
|
|
|
47992
48943
|
}
|
|
47993
48944
|
return !1;
|
|
47994
48945
|
}
|
|
47995
|
-
creator$
|
|
48946
|
+
creator$31.postcss = !0;
|
|
47996
48947
|
//#endregion
|
|
47997
48948
|
//#region ../../node_modules/.pnpm/postcss-color-hex-alpha@11.0.0_postcss@8.5.15/node_modules/postcss-color-hex-alpha/dist/index.mjs
|
|
47998
|
-
const creator$
|
|
48949
|
+
const creator$30 = (a) => {
|
|
47999
48950
|
const o = Object.assign({ preserve: !1 }, a);
|
|
48000
48951
|
return {
|
|
48001
48952
|
postcssPlugin: "postcss-color-hex-alpha",
|
|
@@ -48012,7 +48963,7 @@ const creator$29 = (a) => {
|
|
|
48012
48963
|
}
|
|
48013
48964
|
};
|
|
48014
48965
|
};
|
|
48015
|
-
creator$
|
|
48966
|
+
creator$30.postcss = !0;
|
|
48016
48967
|
const t$5 = /#[0-9a-f]{4}(?:[0-9a-f]{4})?\b/i, r$6 = /^#[0-9a-f]{4}(?:[0-9a-f]{4})?$/i, a$3 = 1e5, o$14 = /[0-9a-f]/gi;
|
|
48017
48968
|
function hexa2rgba(e) {
|
|
48018
48969
|
const s = e.value, t = `0x${5 === s.length ? s.slice(1).replace(o$14, "$&$&") : s.slice(1)}`, [r, l, n, c] = [
|
|
@@ -48048,7 +48999,7 @@ const postcssPlugin$7 = (o) => {
|
|
|
48048
48999
|
}, o);
|
|
48049
49000
|
return e.enableProgressiveCustomProperties && e.preserve ? {
|
|
48050
49001
|
postcssPlugin: "postcss-hwb-function",
|
|
48051
|
-
plugins: [creator$
|
|
49002
|
+
plugins: [creator$51(), basePlugin$6(e)]
|
|
48052
49003
|
} : basePlugin$6(e);
|
|
48053
49004
|
};
|
|
48054
49005
|
postcssPlugin$7.postcss = !0;
|
|
@@ -48078,7 +49029,7 @@ const postcssPlugin$6 = (e) => {
|
|
|
48078
49029
|
}, e);
|
|
48079
49030
|
return t.enableProgressiveCustomProperties && t.preserve ? {
|
|
48080
49031
|
postcssPlugin: "postcss-ic-unit",
|
|
48081
|
-
plugins: [creator$
|
|
49032
|
+
plugins: [creator$51(), basePlugin$5(t)]
|
|
48082
49033
|
} : basePlugin$5(t);
|
|
48083
49034
|
};
|
|
48084
49035
|
postcssPlugin$6.postcss = !0;
|
|
@@ -48121,7 +49072,7 @@ const postcssPlugin$5 = (s) => {
|
|
|
48121
49072
|
}, s);
|
|
48122
49073
|
return o.enableProgressiveCustomProperties && o.preserve ? {
|
|
48123
49074
|
postcssPlugin: "postcss-image-function",
|
|
48124
|
-
plugins: [creator$
|
|
49075
|
+
plugins: [creator$51(), basePlugin$4(o)]
|
|
48125
49076
|
} : basePlugin$4(o);
|
|
48126
49077
|
};
|
|
48127
49078
|
postcssPlugin$5.postcss = !0;
|
|
@@ -48201,7 +49152,7 @@ const handleInvalidation = (e, t, n) => {
|
|
|
48201
49152
|
if (!l) return;
|
|
48202
49153
|
const c = u.slice(1);
|
|
48203
49154
|
c.length && r.after(c), n.cloneBefore({ value: l.trim() }), i.preserve || (n.remove(), r.nodes?.length || r.remove());
|
|
48204
|
-
}, r$5 = /(?:^|[^\w-])(?:-webkit-)?image-set\(/i, o$12 = /^(?:-webkit-)?image-set$/i, creator$
|
|
49155
|
+
}, r$5 = /(?:^|[^\w-])(?:-webkit-)?image-set\(/i, o$12 = /^(?:-webkit-)?image-set$/i, creator$29 = (n) => {
|
|
48205
49156
|
const i = !("preserve" in Object(n)) || Boolean(n?.preserve), s = "onInvalid" in Object(n) ? n?.onInvalid : "ignore";
|
|
48206
49157
|
if ("oninvalid" in Object(n)) throw new Error("\"oninvalid\" was changed to \"onInvalid\" to match other plugins with similar options");
|
|
48207
49158
|
return {
|
|
@@ -48244,7 +49195,7 @@ const handleInvalidation = (e, t, n) => {
|
|
|
48244
49195
|
}
|
|
48245
49196
|
};
|
|
48246
49197
|
};
|
|
48247
|
-
creator$
|
|
49198
|
+
creator$29.postcss = !0;
|
|
48248
49199
|
//#endregion
|
|
48249
49200
|
//#region ../../node_modules/.pnpm/@csstools+postcss-is-pseudo-class@6.0.0_postcss@8.5.15/node_modules/@csstools/postcss-is-pseudo-class/dist/index.mjs
|
|
48250
49201
|
function alwaysValidSelector(s) {
|
|
@@ -48467,7 +49418,7 @@ function cartesianProduct(...e) {
|
|
|
48467
49418
|
}
|
|
48468
49419
|
}([], 0), s;
|
|
48469
49420
|
}
|
|
48470
|
-
const n$3 = /:is\(/i, creator$
|
|
49421
|
+
const n$3 = /:is\(/i, creator$28 = (e) => {
|
|
48471
49422
|
const s = {
|
|
48472
49423
|
specificityMatchingName: "does-not-exist",
|
|
48473
49424
|
...e || {}
|
|
@@ -48513,7 +49464,7 @@ const n$3 = /:is\(/i, creator$27 = (e) => {
|
|
|
48513
49464
|
}
|
|
48514
49465
|
};
|
|
48515
49466
|
};
|
|
48516
|
-
creator$
|
|
49467
|
+
creator$28.postcss = !0;
|
|
48517
49468
|
//#endregion
|
|
48518
49469
|
//#region ../../node_modules/.pnpm/postcss-lab-function@8.0.4_postcss@8.5.15/node_modules/postcss-lab-function/dist/index.mjs
|
|
48519
49470
|
const g$2 = /\b(?:lab|lch)\(/i, f$2 = /^(?:lab|lch)$/i, basePlugin$3 = (s) => ({
|
|
@@ -48546,7 +49497,7 @@ const postcssPlugin$4 = (e) => {
|
|
|
48546
49497
|
}, e);
|
|
48547
49498
|
return t.subFeatures = Object.assign({ displayP3: !0 }, t.subFeatures), t.enableProgressiveCustomProperties && (t.preserve || t.subFeatures.displayP3) ? {
|
|
48548
49499
|
postcssPlugin: "postcss-lab-function",
|
|
48549
|
-
plugins: [creator$
|
|
49500
|
+
plugins: [creator$51(), basePlugin$3(t)]
|
|
48550
49501
|
} : basePlugin$3(t);
|
|
48551
49502
|
};
|
|
48552
49503
|
postcssPlugin$4.postcss = !0;
|
|
@@ -48743,7 +49694,7 @@ const postcssPlugin$3 = (r) => {
|
|
|
48743
49694
|
}, r);
|
|
48744
49695
|
return t.enableProgressiveCustomProperties && t.preserve ? {
|
|
48745
49696
|
postcssPlugin: "postcss-light-dark-function",
|
|
48746
|
-
plugins: [creator$
|
|
49697
|
+
plugins: [creator$51(), basePlugin$2(t)]
|
|
48747
49698
|
} : basePlugin$2(t);
|
|
48748
49699
|
};
|
|
48749
49700
|
postcssPlugin$3.postcss = !0;
|
|
@@ -48760,7 +49711,7 @@ function transformAxes$1(o, t) {
|
|
|
48760
49711
|
(function(o) {
|
|
48761
49712
|
o.TopToBottom = "top-to-bottom", o.BottomToTop = "bottom-to-top", o.RightToLeft = "right-to-left", o.LeftToRight = "left-to-right";
|
|
48762
49713
|
})(o$10 || (o$10 = {}));
|
|
48763
|
-
const creator$
|
|
49714
|
+
const creator$27 = (t) => {
|
|
48764
49715
|
const e = Object.assign({ inlineDirection: o$10.LeftToRight }, t);
|
|
48765
49716
|
switch (e.inlineDirection) {
|
|
48766
49717
|
case o$10.LeftToRight:
|
|
@@ -48778,7 +49729,7 @@ const creator$26 = (t) => {
|
|
|
48778
49729
|
}
|
|
48779
49730
|
};
|
|
48780
49731
|
};
|
|
48781
|
-
creator$
|
|
49732
|
+
creator$27.postcss = !0;
|
|
48782
49733
|
//#endregion
|
|
48783
49734
|
//#region ../../node_modules/.pnpm/@csstools+postcss-logical-overscroll-behavior@3.0.0_postcss@8.5.15/node_modules/@csstools/postcss-logical-overscroll-behavior/dist/index.mjs
|
|
48784
49735
|
var o$9;
|
|
@@ -48792,7 +49743,7 @@ function transformAxes(o, t) {
|
|
|
48792
49743
|
(function(o) {
|
|
48793
49744
|
o.TopToBottom = "top-to-bottom", o.BottomToTop = "bottom-to-top", o.RightToLeft = "right-to-left", o.LeftToRight = "left-to-right";
|
|
48794
49745
|
})(o$9 || (o$9 = {}));
|
|
48795
|
-
const creator$
|
|
49746
|
+
const creator$26 = (t) => {
|
|
48796
49747
|
const e = Object.assign({ inlineDirection: o$9.LeftToRight }, t);
|
|
48797
49748
|
switch (e.inlineDirection) {
|
|
48798
49749
|
case o$9.LeftToRight:
|
|
@@ -48810,7 +49761,7 @@ const creator$25 = (t) => {
|
|
|
48810
49761
|
}
|
|
48811
49762
|
};
|
|
48812
49763
|
};
|
|
48813
|
-
creator$
|
|
49764
|
+
creator$26.postcss = !0;
|
|
48814
49765
|
//#endregion
|
|
48815
49766
|
//#region ../../node_modules/.pnpm/postcss-logical@9.0.0_postcss@8.5.15/node_modules/postcss-logical/dist/index.mjs
|
|
48816
49767
|
var e$5, n$2;
|
|
@@ -49064,7 +50015,7 @@ function prepareTransforms(e, t, i, l, a) {
|
|
|
49064
50015
|
})(t$4 || (t$4 = {})), function(r) {
|
|
49065
50016
|
r.Top = "top", r.Right = "right", r.Bottom = "bottom", r.Left = "left";
|
|
49066
50017
|
}(i$2 || (i$2 = {}));
|
|
49067
|
-
const l$4 = /var\(/i, creator$
|
|
50018
|
+
const l$4 = /var\(/i, creator$25 = (r) => {
|
|
49068
50019
|
const e = Object.assign({
|
|
49069
50020
|
blockDirection: t$4.TopToBottom,
|
|
49070
50021
|
inlineDirection: t$4.LeftToRight
|
|
@@ -49170,7 +50121,7 @@ const l$4 = /var\(/i, creator$24 = (r) => {
|
|
|
49170
50121
|
}
|
|
49171
50122
|
};
|
|
49172
50123
|
};
|
|
49173
|
-
creator$
|
|
50124
|
+
creator$25.postcss = !0;
|
|
49174
50125
|
//#endregion
|
|
49175
50126
|
//#region ../../node_modules/.pnpm/@csstools+postcss-logical-resize@4.0.0_postcss@8.5.15/node_modules/@csstools/postcss-logical-resize/dist/index.mjs
|
|
49176
50127
|
var t$3, e$4, i$1;
|
|
@@ -49209,7 +50160,7 @@ function directionFlowToAxes(o) {
|
|
|
49209
50160
|
}(e$4 || (e$4 = {})), function(o) {
|
|
49210
50161
|
o.Top = "top", o.Right = "right", o.Bottom = "bottom", o.Left = "left";
|
|
49211
50162
|
}(i$1 || (i$1 = {}));
|
|
49212
|
-
const creator$
|
|
50163
|
+
const creator$24 = (o) => {
|
|
49213
50164
|
const t = Object.assign({
|
|
49214
50165
|
blockDirection: e$4.TopToBottom,
|
|
49215
50166
|
inlineDirection: e$4.LeftToRight
|
|
@@ -49243,7 +50194,7 @@ const creator$23 = (o) => {
|
|
|
49243
50194
|
};
|
|
49244
50195
|
var u;
|
|
49245
50196
|
};
|
|
49246
|
-
creator$
|
|
50197
|
+
creator$24.postcss = !0;
|
|
49247
50198
|
//#endregion
|
|
49248
50199
|
//#region ../../node_modules/.pnpm/@csstools+postcss-logical-viewport-units@4.0.0_postcss@8.5.15/node_modules/@csstools/postcss-logical-viewport-units/dist/index.mjs
|
|
49249
50200
|
var s$6;
|
|
@@ -49275,7 +50226,7 @@ const c$3 = /vb|vi/i, u$1 = { test(t) {
|
|
|
49275
50226
|
if ("vb" === e || "vi" === e) return !0;
|
|
49276
50227
|
}
|
|
49277
50228
|
return !1;
|
|
49278
|
-
} }, a$2 = /(?:vi|vb)\b/i, creator$
|
|
50229
|
+
} }, a$2 = /(?:vi|vb)\b/i, creator$23 = (e) => {
|
|
49279
50230
|
const i = Object.assign({
|
|
49280
50231
|
inlineDirection: s$6.LeftToRight,
|
|
49281
50232
|
preserve: !0
|
|
@@ -49312,7 +50263,7 @@ const c$3 = /vb|vi/i, u$1 = { test(t) {
|
|
|
49312
50263
|
}
|
|
49313
50264
|
};
|
|
49314
50265
|
};
|
|
49315
|
-
creator$
|
|
50266
|
+
creator$23.postcss = !0;
|
|
49316
50267
|
//#endregion
|
|
49317
50268
|
//#region ../../node_modules/.pnpm/@csstools+postcss-media-queries-aspect-ratio-number-values@4.0.0_postcss@8.5.15/node_modules/@csstools/postcss-media-queries-aspect-ratio-number-values/dist/index.mjs
|
|
49318
50269
|
const w = 1e5, h$1 = 2147483647;
|
|
@@ -49584,7 +50535,7 @@ function transformMediaQueryList(e, s) {
|
|
|
49584
50535
|
return v === l || c.has(v) ? [l] : s ? [l, v] : [v];
|
|
49585
50536
|
}).join(",");
|
|
49586
50537
|
}
|
|
49587
|
-
const creator$
|
|
50538
|
+
const creator$22 = (e) => {
|
|
49588
50539
|
const t = Object.assign({ preserve: !1 }, e);
|
|
49589
50540
|
return {
|
|
49590
50541
|
postcssPlugin: "postcss-media-queries-aspect-ratio-number-values",
|
|
@@ -49603,7 +50554,7 @@ const creator$21 = (e) => {
|
|
|
49603
50554
|
}
|
|
49604
50555
|
};
|
|
49605
50556
|
};
|
|
49606
|
-
creator$
|
|
50557
|
+
creator$22.postcss = !0;
|
|
49607
50558
|
//#endregion
|
|
49608
50559
|
//#region ../../node_modules/.pnpm/@csstools+postcss-media-minmax@3.0.3_postcss@8.5.15/node_modules/@csstools/postcss-media-minmax/dist/index.mjs
|
|
49609
50560
|
const C = {
|
|
@@ -49960,7 +50911,7 @@ function getMediaConditionInShallowMediaQueryFromAncestry(e, t, r) {
|
|
|
49960
50911
|
const a = i;
|
|
49961
50912
|
return i = r.get(i), isMediaQuery(i) && i === t ? a : void 0;
|
|
49962
50913
|
}
|
|
49963
|
-
const creator$
|
|
50914
|
+
const creator$21 = () => ({
|
|
49964
50915
|
postcssPlugin: "postcss-media-minmax",
|
|
49965
50916
|
AtRule: {
|
|
49966
50917
|
media(e) {
|
|
@@ -49987,7 +50938,7 @@ const creator$20 = () => ({
|
|
|
49987
50938
|
}
|
|
49988
50939
|
}
|
|
49989
50940
|
});
|
|
49990
|
-
creator$
|
|
50941
|
+
creator$21.postcss = !0;
|
|
49991
50942
|
//#endregion
|
|
49992
50943
|
//#region ../../node_modules/.pnpm/@csstools+postcss-mixins@1.0.0_postcss@8.5.15/node_modules/@csstools/postcss-mixins/dist/index.mjs
|
|
49993
50944
|
const o$7 = /^apply$/i;
|
|
@@ -50017,7 +50968,7 @@ function processableMixinRule(s) {
|
|
|
50017
50968
|
"atrule" === e.type && l$3.test(e.name) && (o = !0);
|
|
50018
50969
|
}), !o && n.getName();
|
|
50019
50970
|
}
|
|
50020
|
-
const creator$
|
|
50971
|
+
const creator$20 = (e) => {
|
|
50021
50972
|
const s = Object.assign({ preserve: !1 }, e);
|
|
50022
50973
|
return {
|
|
50023
50974
|
postcssPlugin: "postcss-mixins",
|
|
@@ -50045,11 +50996,11 @@ const creator$19 = (e) => {
|
|
|
50045
50996
|
}
|
|
50046
50997
|
};
|
|
50047
50998
|
};
|
|
50048
|
-
creator$
|
|
50999
|
+
creator$20.postcss = !0;
|
|
50049
51000
|
//#endregion
|
|
50050
51001
|
//#region ../../node_modules/.pnpm/@csstools+postcss-nested-calc@5.0.0_postcss@8.5.15/node_modules/@csstools/postcss-nested-calc/dist/index.mjs
|
|
50051
51002
|
const r$4 = /calc\(/gi;
|
|
50052
|
-
const creator$
|
|
51003
|
+
const creator$19 = (s) => {
|
|
50053
51004
|
const o = Object.assign({ preserve: !0 }, s);
|
|
50054
51005
|
return {
|
|
50055
51006
|
postcssPlugin: "postcss-nested-calc",
|
|
@@ -50076,7 +51027,7 @@ const creator$18 = (s) => {
|
|
|
50076
51027
|
}
|
|
50077
51028
|
};
|
|
50078
51029
|
};
|
|
50079
|
-
creator$
|
|
51030
|
+
creator$19.postcss = !0;
|
|
50080
51031
|
//#endregion
|
|
50081
51032
|
//#region ../../node_modules/.pnpm/@csstools+selector-resolve-nested@4.0.0_postcss-selector-parser@7.1.2/node_modules/@csstools/selector-resolve-nested/dist/index.mjs
|
|
50082
51033
|
function sourceFrom(e) {
|
|
@@ -50544,7 +51495,7 @@ const creator$1$1 = () => ({
|
|
|
50544
51495
|
} }
|
|
50545
51496
|
});
|
|
50546
51497
|
creator$1$1.postcss = !0;
|
|
50547
|
-
const creator$
|
|
51498
|
+
const creator$18 = (e) => {
|
|
50548
51499
|
const t = Object.assign({ edition: "2024-02" }, e);
|
|
50549
51500
|
switch (t.edition) {
|
|
50550
51501
|
case "2021": return creator$2$1(e);
|
|
@@ -50552,13 +51503,13 @@ const creator$17 = (e) => {
|
|
|
50552
51503
|
default: throw new Error(`Invalid edition: ${t.edition}`);
|
|
50553
51504
|
}
|
|
50554
51505
|
};
|
|
50555
|
-
creator$
|
|
51506
|
+
creator$18.postcss = !0;
|
|
50556
51507
|
//#endregion
|
|
50557
51508
|
//#region ../../node_modules/.pnpm/postcss-selector-not@9.0.0_postcss@8.5.15/node_modules/postcss-selector-not/dist/index.mjs
|
|
50558
51509
|
function cleanupWhitespace(e) {
|
|
50559
51510
|
e.spaces && (e.spaces.after = "", e.spaces.before = ""), e.nodes && e.nodes.length > 0 && (e.nodes[0] && e.nodes[0].spaces && (e.nodes[0].spaces.before = ""), e.nodes[e.nodes.length - 1] && e.nodes[e.nodes.length - 1].spaces && (e.nodes[e.nodes.length - 1].spaces.after = ""));
|
|
50560
51511
|
}
|
|
50561
|
-
const creator$
|
|
51512
|
+
const creator$17 = () => ({
|
|
50562
51513
|
postcssPlugin: "postcss-selector-not",
|
|
50563
51514
|
Rule(s, { result: o }) {
|
|
50564
51515
|
if (s.selector && s.selector.toLowerCase().includes(":not(")) try {
|
|
@@ -50583,7 +51534,7 @@ const creator$16 = () => ({
|
|
|
50583
51534
|
}
|
|
50584
51535
|
}
|
|
50585
51536
|
});
|
|
50586
|
-
creator$
|
|
51537
|
+
creator$17.postcss = !0;
|
|
50587
51538
|
//#endregion
|
|
50588
51539
|
//#region ../../node_modules/.pnpm/@csstools+postcss-oklab-function@5.0.4_postcss@8.5.15/node_modules/@csstools/postcss-oklab-function/dist/index.mjs
|
|
50589
51540
|
const g$1 = /\b(?:oklab|oklch)\(/i, f$1 = /^(?:oklab|oklch)$/i, basePlugin$1 = (s) => ({
|
|
@@ -50616,7 +51567,7 @@ const postcssPlugin$2 = (e) => {
|
|
|
50616
51567
|
}, e);
|
|
50617
51568
|
return t.subFeatures = Object.assign({ displayP3: !0 }, t.subFeatures), t.enableProgressiveCustomProperties && (t.preserve || t.subFeatures.displayP3) ? {
|
|
50618
51569
|
postcssPlugin: "postcss-oklab-function",
|
|
50619
|
-
plugins: [creator$
|
|
51570
|
+
plugins: [creator$51(), basePlugin$1(t)]
|
|
50620
51571
|
} : basePlugin$1(t);
|
|
50621
51572
|
};
|
|
50622
51573
|
postcssPlugin$2.postcss = !0;
|
|
@@ -50642,7 +51593,7 @@ var import_postcss_opacity_percentage = /* @__PURE__ */ __toESM((/* @__PURE__ */
|
|
|
50642
51593
|
});
|
|
50643
51594
|
module.exports.postcss = true;
|
|
50644
51595
|
})))(), 1);
|
|
50645
|
-
const creator$
|
|
51596
|
+
const creator$16 = (o) => {
|
|
50646
51597
|
const r = Object.assign({ preserve: !0 }, o);
|
|
50647
51598
|
return {
|
|
50648
51599
|
postcssPlugin: "postcss-overflow-shorthand",
|
|
@@ -50668,7 +51619,7 @@ const creator$15 = (o) => {
|
|
|
50668
51619
|
}
|
|
50669
51620
|
};
|
|
50670
51621
|
};
|
|
50671
|
-
creator$
|
|
51622
|
+
creator$16.postcss = !0;
|
|
50672
51623
|
//#endregion
|
|
50673
51624
|
//#region ../../node_modules/.pnpm/postcss-place@11.0.0_postcss@8.5.15/node_modules/postcss-place/dist/index.mjs
|
|
50674
51625
|
var import_postcss_replace_overflow_wrap = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -50704,7 +51655,7 @@ function onCSSDeclaration(o, r, s) {
|
|
|
50704
51655
|
value: l[1] || l[0]
|
|
50705
51656
|
}), s.preserve || o.remove();
|
|
50706
51657
|
}
|
|
50707
|
-
const t$2 = /^place-(content|items|self)/i, creator$
|
|
51658
|
+
const t$2 = /^place-(content|items|self)/i, creator$15 = (e) => {
|
|
50708
51659
|
const o = Object.assign({ preserve: !0 }, e);
|
|
50709
51660
|
return {
|
|
50710
51661
|
postcssPlugin: "postcss-place",
|
|
@@ -50713,10 +51664,10 @@ const t$2 = /^place-(content|items|self)/i, creator$14 = (e) => {
|
|
|
50713
51664
|
}
|
|
50714
51665
|
};
|
|
50715
51666
|
};
|
|
50716
|
-
creator$
|
|
51667
|
+
creator$15.postcss = !0;
|
|
50717
51668
|
//#endregion
|
|
50718
51669
|
//#region ../../node_modules/.pnpm/@csstools+postcss-position-area-property@2.0.0_postcss@8.5.15/node_modules/@csstools/postcss-position-area-property/dist/index.mjs
|
|
50719
|
-
const o$4 = /^position-area$/i, creator$
|
|
51670
|
+
const o$4 = /^position-area$/i, creator$14 = () => ({
|
|
50720
51671
|
postcssPlugin: "postcss-position-area-property",
|
|
50721
51672
|
Declaration(s) {
|
|
50722
51673
|
o$4.test(s.prop) && s.cloneBefore({
|
|
@@ -50725,10 +51676,10 @@ const o$4 = /^position-area$/i, creator$13 = () => ({
|
|
|
50725
51676
|
});
|
|
50726
51677
|
}
|
|
50727
51678
|
});
|
|
50728
|
-
creator$
|
|
51679
|
+
creator$14.postcss = !0;
|
|
50729
51680
|
//#endregion
|
|
50730
51681
|
//#region ../../node_modules/.pnpm/css-prefers-color-scheme@11.0.0_postcss@8.5.15/node_modules/css-prefers-color-scheme/dist/index.mjs
|
|
50731
|
-
const e$3 = /\(\s*prefers-color-scheme\s*:\s*(dark|light)\s*\)/gi, s$4 = "(color: 48842621)", r$2 = "(color: 70318723)", creator$
|
|
51682
|
+
const e$3 = /\(\s*prefers-color-scheme\s*:\s*(dark|light)\s*\)/gi, s$4 = "(color: 48842621)", r$2 = "(color: 70318723)", creator$13 = (o) => {
|
|
50732
51683
|
const t = Object.assign({ preserve: !0 }, o);
|
|
50733
51684
|
return {
|
|
50734
51685
|
postcssPlugin: "postcss-prefers-color-scheme",
|
|
@@ -50746,10 +51697,10 @@ const e$3 = /\(\s*prefers-color-scheme\s*:\s*(dark|light)\s*\)/gi, s$4 = "(color
|
|
|
50746
51697
|
}
|
|
50747
51698
|
};
|
|
50748
51699
|
};
|
|
50749
|
-
creator$
|
|
51700
|
+
creator$13.postcss = !0;
|
|
50750
51701
|
//#endregion
|
|
50751
51702
|
//#region ../../node_modules/.pnpm/@csstools+postcss-property-rule-prelude-list@2.0.0_postcss@8.5.15/node_modules/@csstools/postcss-property-rule-prelude-list/dist/index.mjs
|
|
50752
|
-
const o$3 = /^property$/i, creator$
|
|
51703
|
+
const o$3 = /^property$/i, creator$12 = () => ({
|
|
50753
51704
|
postcssPlugin: "postcss-property-rule-prelude-list",
|
|
50754
51705
|
AtRule(t) {
|
|
50755
51706
|
if (!o$3.test(t.name)) return;
|
|
@@ -50760,7 +51711,7 @@ const o$3 = /^property$/i, creator$11 = () => ({
|
|
|
50760
51711
|
}), t.remove());
|
|
50761
51712
|
}
|
|
50762
51713
|
});
|
|
50763
|
-
creator$
|
|
51714
|
+
creator$12.postcss = !0;
|
|
50764
51715
|
//#endregion
|
|
50765
51716
|
//#region ../../node_modules/.pnpm/@csstools+postcss-random-function@3.0.3_postcss@8.5.15/node_modules/@csstools/postcss-random-function/dist/index.mjs
|
|
50766
51717
|
const o$2 = String.fromCodePoint(0);
|
|
@@ -50782,7 +51733,7 @@ function randomCacheKeyFromPostcssDeclaration(e) {
|
|
|
50782
51733
|
documentID: e.source?.input.css ?? e.root().toString()
|
|
50783
51734
|
};
|
|
50784
51735
|
}
|
|
50785
|
-
const r$1 = /(?<![-\w])(?:random)\(/i, creator$
|
|
51736
|
+
const r$1 = /(?<![-\w])(?:random)\(/i, creator$11 = (o) => {
|
|
50786
51737
|
const t = Object.assign({ preserve: !1 }, o);
|
|
50787
51738
|
return {
|
|
50788
51739
|
postcssPlugin: "postcss-random-function",
|
|
@@ -50797,10 +51748,10 @@ const r$1 = /(?<![-\w])(?:random)\(/i, creator$10 = (o) => {
|
|
|
50797
51748
|
}
|
|
50798
51749
|
};
|
|
50799
51750
|
};
|
|
50800
|
-
creator$
|
|
51751
|
+
creator$11.postcss = !0;
|
|
50801
51752
|
//#endregion
|
|
50802
51753
|
//#region ../../node_modules/.pnpm/postcss-color-rebeccapurple@11.0.0_postcss@8.5.15/node_modules/postcss-color-rebeccapurple/dist/index.mjs
|
|
50803
|
-
const s$3 = /rebeccapurple/i, t$1 = /^rebeccapurple$/i, creator$
|
|
51754
|
+
const s$3 = /rebeccapurple/i, t$1 = /^rebeccapurple$/i, creator$10 = (o) => {
|
|
50804
51755
|
const c = Object.assign({ preserve: !1 }, o);
|
|
50805
51756
|
return {
|
|
50806
51757
|
postcssPlugin: "postcss-color-rebeccapurple",
|
|
@@ -50816,7 +51767,7 @@ const s$3 = /rebeccapurple/i, t$1 = /^rebeccapurple$/i, creator$9 = (o) => {
|
|
|
50816
51767
|
}
|
|
50817
51768
|
};
|
|
50818
51769
|
};
|
|
50819
|
-
creator$
|
|
51770
|
+
creator$10.postcss = !0;
|
|
50820
51771
|
//#endregion
|
|
50821
51772
|
//#region ../../node_modules/.pnpm/@csstools+postcss-relative-color-syntax@4.0.4_postcss@8.5.15/node_modules/@csstools/postcss-relative-color-syntax/dist/index.mjs
|
|
50822
51773
|
const g = /\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(/i, h = /\b(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)\(\s*from/i, m$1 = /^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklch|oklab|color)$/i, y = /from/i, basePlugin = (s) => ({
|
|
@@ -50849,13 +51800,13 @@ const postcssPlugin$1 = (e) => {
|
|
|
50849
51800
|
}, e);
|
|
50850
51801
|
return r.subFeatures = Object.assign({ displayP3: !0 }, r.subFeatures), r.enableProgressiveCustomProperties && (r.preserve || r.subFeatures.displayP3) ? {
|
|
50851
51802
|
postcssPlugin: "postcss-relative-color-syntax",
|
|
50852
|
-
plugins: [creator$
|
|
51803
|
+
plugins: [creator$51(), basePlugin(r)]
|
|
50853
51804
|
} : basePlugin(r);
|
|
50854
51805
|
};
|
|
50855
51806
|
postcssPlugin$1.postcss = !0;
|
|
50856
51807
|
//#endregion
|
|
50857
51808
|
//#region ../../node_modules/.pnpm/@csstools+postcss-scope-pseudo-class@5.0.0_postcss@8.5.15/node_modules/@csstools/postcss-scope-pseudo-class/dist/index.mjs
|
|
50858
|
-
const creator$
|
|
51809
|
+
const creator$9 = (s) => {
|
|
50859
51810
|
const r = Object.assign({ preserve: !1 }, s);
|
|
50860
51811
|
return {
|
|
50861
51812
|
postcssPlugin: "postcss-scope-pseudo-class",
|
|
@@ -50890,10 +51841,10 @@ const creator$8 = (s) => {
|
|
|
50890
51841
|
}
|
|
50891
51842
|
};
|
|
50892
51843
|
};
|
|
50893
|
-
creator$
|
|
51844
|
+
creator$9.postcss = !0;
|
|
50894
51845
|
//#endregion
|
|
50895
51846
|
//#region ../../node_modules/.pnpm/@csstools+postcss-sign-functions@2.0.3_postcss@8.5.15/node_modules/@csstools/postcss-sign-functions/dist/index.mjs
|
|
50896
|
-
const m = /(?<![-\w])(?:sign|abs)\(/i, f = /(?<![-\w])(?:sign|abs)\(/i, creator$
|
|
51847
|
+
const m = /(?<![-\w])(?:sign|abs)\(/i, f = /(?<![-\w])(?:sign|abs)\(/i, creator$8 = (o) => {
|
|
50897
51848
|
const n = Object.assign({ preserve: !1 }, o);
|
|
50898
51849
|
return {
|
|
50899
51850
|
postcssPlugin: "postcss-sign-functions",
|
|
@@ -51000,10 +51951,10 @@ function replacer(e) {
|
|
|
51000
51951
|
], parseListOfComponentValues(s.flatMap((e) => e.tokens())))
|
|
51001
51952
|
])];
|
|
51002
51953
|
}
|
|
51003
|
-
creator$
|
|
51954
|
+
creator$8.postcss = !0;
|
|
51004
51955
|
//#endregion
|
|
51005
51956
|
//#region ../../node_modules/.pnpm/@csstools+postcss-stepped-value-functions@5.0.3_postcss@8.5.15/node_modules/@csstools/postcss-stepped-value-functions/dist/index.mjs
|
|
51006
|
-
const s$2 = /(?<![-\w])(?:mod|rem|round)\(/i, creator$
|
|
51957
|
+
const s$2 = /(?<![-\w])(?:mod|rem|round)\(/i, creator$7 = (o) => {
|
|
51007
51958
|
const t = Object.assign({ preserve: !1 }, o);
|
|
51008
51959
|
return {
|
|
51009
51960
|
postcssPlugin: "postcss-stepped-value-functions",
|
|
@@ -51017,10 +51968,10 @@ const s$2 = /(?<![-\w])(?:mod|rem|round)\(/i, creator$6 = (o) => {
|
|
|
51017
51968
|
}
|
|
51018
51969
|
};
|
|
51019
51970
|
};
|
|
51020
|
-
creator$
|
|
51971
|
+
creator$7.postcss = !0;
|
|
51021
51972
|
//#endregion
|
|
51022
51973
|
//#region ../../node_modules/.pnpm/@csstools+postcss-syntax-descriptor-syntax-production@2.0.0_postcss@8.5.15/node_modules/@csstools/postcss-syntax-descriptor-syntax-production/dist/index.mjs
|
|
51023
|
-
const o$1 = /^property$/i, n$1 = /^syntax$/i, creator$
|
|
51974
|
+
const o$1 = /^property$/i, n$1 = /^syntax$/i, creator$6 = (i) => {
|
|
51024
51975
|
const p = Object.assign({ preserve: !1 }, i);
|
|
51025
51976
|
return {
|
|
51026
51977
|
postcssPlugin: "postcss-syntax-descriptor-syntax-production",
|
|
@@ -51088,7 +52039,7 @@ const o$1 = /^property$/i, n$1 = /^syntax$/i, creator$5 = (i) => {
|
|
|
51088
52039
|
}
|
|
51089
52040
|
};
|
|
51090
52041
|
};
|
|
51091
|
-
creator$
|
|
52042
|
+
creator$6.postcss = !0;
|
|
51092
52043
|
//#endregion
|
|
51093
52044
|
//#region ../../node_modules/.pnpm/@csstools+postcss-system-ui-font-family@2.0.0_postcss@8.5.15/node_modules/@csstools/postcss-system-ui-font-family/dist/index.mjs
|
|
51094
52045
|
const a = /^font(?:-family)?$/i, c$2 = [
|
|
@@ -51101,7 +52052,7 @@ const a = /^font(?:-family)?$/i, c$2 = [
|
|
|
51101
52052
|
"Noto Sans",
|
|
51102
52053
|
"sans-serif"
|
|
51103
52054
|
];
|
|
51104
|
-
const u = c$2.join(","), creator$
|
|
52055
|
+
const u = c$2.join(","), creator$5 = (p) => {
|
|
51105
52056
|
const f = Object.assign({ preserve: !0 }, p);
|
|
51106
52057
|
return {
|
|
51107
52058
|
postcssPlugin: "postcss-system-ui-font-family",
|
|
@@ -51142,10 +52093,10 @@ const u = c$2.join(","), creator$4 = (p) => {
|
|
|
51142
52093
|
}
|
|
51143
52094
|
};
|
|
51144
52095
|
};
|
|
51145
|
-
creator$
|
|
52096
|
+
creator$5.postcss = !0;
|
|
51146
52097
|
//#endregion
|
|
51147
52098
|
//#region ../../node_modules/.pnpm/@csstools+postcss-text-decoration-shorthand@5.0.3_postcss@8.5.15/node_modules/@csstools/postcss-text-decoration-shorthand/dist/index.mjs
|
|
51148
|
-
const o = /^text-decoration$/i, creator$
|
|
52099
|
+
const o = /^text-decoration$/i, creator$4 = (t) => {
|
|
51149
52100
|
const c = Object.assign({ preserve: !0 }, t);
|
|
51150
52101
|
return {
|
|
51151
52102
|
postcssPlugin: "postcss-text-decoration-shorthand",
|
|
@@ -51309,7 +52260,7 @@ const o = /^text-decoration$/i, creator$3 = (t) => {
|
|
|
51309
52260
|
function nodeIsAColor(e) {
|
|
51310
52261
|
return !("word" !== e.type || !e.value.startsWith("#")) || !("word" !== e.type || !i.includes(e.value.toLowerCase())) || !("function" !== e.type || !c$1.includes(e.value.toLowerCase()));
|
|
51311
52262
|
}
|
|
51312
|
-
creator$
|
|
52263
|
+
creator$4.postcss = !0;
|
|
51313
52264
|
const r = [
|
|
51314
52265
|
"unset",
|
|
51315
52266
|
"inherit",
|
|
@@ -51356,7 +52307,7 @@ function genericNodeParts() {
|
|
|
51356
52307
|
}
|
|
51357
52308
|
//#endregion
|
|
51358
52309
|
//#region ../../node_modules/.pnpm/@csstools+postcss-trigonometric-functions@5.0.3_postcss@8.5.15/node_modules/@csstools/postcss-trigonometric-functions/dist/index.mjs
|
|
51359
|
-
const e$2 = /(?<![-\w])(?:asin|acos|atan|atan2|sin|cos|tan)\(/i, creator$
|
|
52310
|
+
const e$2 = /(?<![-\w])(?:asin|acos|atan|atan2|sin|cos|tan)\(/i, creator$3 = (o) => {
|
|
51360
52311
|
const t = Object.assign({ preserve: !1 }, o);
|
|
51361
52312
|
return {
|
|
51362
52313
|
postcssPlugin: "postcss-trigonometric-functions",
|
|
@@ -51370,7 +52321,7 @@ const e$2 = /(?<![-\w])(?:asin|acos|atan|atan2|sin|cos|tan)\(/i, creator$2 = (o)
|
|
|
51370
52321
|
}
|
|
51371
52322
|
};
|
|
51372
52323
|
};
|
|
51373
|
-
creator$
|
|
52324
|
+
creator$3.postcss = !0;
|
|
51374
52325
|
//#endregion
|
|
51375
52326
|
//#region ../../node_modules/.pnpm/@csstools+postcss-unset-value@5.0.0_postcss@8.5.15/node_modules/@csstools/postcss-unset-value/dist/index.mjs
|
|
51376
52327
|
const e$1 = new Set([
|
|
@@ -51794,7 +52745,7 @@ const e$1 = new Set([
|
|
|
51794
52745
|
"x",
|
|
51795
52746
|
"y",
|
|
51796
52747
|
"z-index"
|
|
51797
|
-
]), creator$
|
|
52748
|
+
]), creator$2 = (o) => {
|
|
51798
52749
|
const i = Object.assign({ preserve: !1 }, o);
|
|
51799
52750
|
return {
|
|
51800
52751
|
postcssPlugin: "postcss-unset-value",
|
|
@@ -51808,7 +52759,7 @@ const e$1 = new Set([
|
|
|
51808
52759
|
}
|
|
51809
52760
|
};
|
|
51810
52761
|
};
|
|
51811
|
-
creator$
|
|
52762
|
+
creator$2.postcss = !0;
|
|
51812
52763
|
//#endregion
|
|
51813
52764
|
//#region ../../node_modules/.pnpm/postcss-preset-env@11.3.0_postcss@8.5.15/node_modules/postcss-preset-env/dist/index.mjs
|
|
51814
52765
|
const ks = {
|
|
@@ -51950,78 +52901,78 @@ function featureIsLess(s, o) {
|
|
|
51950
52901
|
return s.id === o.id ? s[xs] && o[xs] || s[Fs] && o[Fs] ? clamp(-1, s[Os] - o[Os], 1) : s[xs] || o[Fs] ? -1 : s[Fs] || o[xs] ? 1 : 0 : clamp(-1, Cs.indexOf(s.id) - Cs.indexOf(o.id), 1);
|
|
51951
52902
|
}
|
|
51952
52903
|
const $s = new Map([
|
|
51953
|
-
["all-property", creator$
|
|
52904
|
+
["all-property", creator$52],
|
|
51954
52905
|
["alpha-function", postcssPlugin$16],
|
|
51955
|
-
["any-link-pseudo-class", creator$
|
|
51956
|
-
["blank-pseudo-class", creator$
|
|
52906
|
+
["any-link-pseudo-class", creator$50],
|
|
52907
|
+
["blank-pseudo-class", creator$49],
|
|
51957
52908
|
["break-properties", import_postcss_page_break.default],
|
|
51958
|
-
["cascade-layers", creator$
|
|
51959
|
-
["case-insensitive-attributes", creator$
|
|
52909
|
+
["cascade-layers", creator$48],
|
|
52910
|
+
["case-insensitive-attributes", creator$47],
|
|
51960
52911
|
["clamp", import_postcss_clamp.default],
|
|
51961
52912
|
["color-function", postcssPlugin$15],
|
|
51962
52913
|
["color-function-display-p3-linear", postcssPlugin$14],
|
|
51963
52914
|
["color-functional-notation", postcssPlugin$13],
|
|
51964
52915
|
["color-mix", postcssPlugin$12],
|
|
51965
52916
|
["color-mix-variadic-function-arguments", postcssPlugin$11],
|
|
51966
|
-
["container-rule-prelude-list", creator$
|
|
51967
|
-
["content-alt-text", creator$
|
|
52917
|
+
["container-rule-prelude-list", creator$46],
|
|
52918
|
+
["content-alt-text", creator$45],
|
|
51968
52919
|
["contrast-color-function", postcssPlugin$10],
|
|
51969
|
-
["custom-media-queries", creator$
|
|
51970
|
-
["custom-properties", creator$
|
|
51971
|
-
["custom-selectors", creator$
|
|
51972
|
-
["dir-pseudo-class", creator$
|
|
51973
|
-
["display-two-values", creator$
|
|
52920
|
+
["custom-media-queries", creator$44],
|
|
52921
|
+
["custom-properties", creator$43],
|
|
52922
|
+
["custom-selectors", creator$42],
|
|
52923
|
+
["dir-pseudo-class", creator$41],
|
|
52924
|
+
["display-two-values", creator$40],
|
|
51974
52925
|
["double-position-gradients", postcssPlugin$9],
|
|
51975
|
-
["exponential-functions", creator$
|
|
51976
|
-
["float-clear-logical-values", creator$
|
|
51977
|
-
["focus-visible-pseudo-class", creator$
|
|
51978
|
-
["focus-within-pseudo-class", creator$
|
|
51979
|
-
["font-format-keywords", creator$
|
|
52926
|
+
["exponential-functions", creator$39],
|
|
52927
|
+
["float-clear-logical-values", creator$38],
|
|
52928
|
+
["focus-visible-pseudo-class", creator$37],
|
|
52929
|
+
["focus-within-pseudo-class", creator$36],
|
|
52930
|
+
["font-format-keywords", creator$35],
|
|
51980
52931
|
["font-variant-property", import_postcss_font_variant.default],
|
|
51981
|
-
["font-width-property", creator$
|
|
51982
|
-
["gamut-mapping", creator$
|
|
51983
|
-
["gap-properties", creator$
|
|
52932
|
+
["font-width-property", creator$34],
|
|
52933
|
+
["gamut-mapping", creator$33],
|
|
52934
|
+
["gap-properties", creator$32],
|
|
51984
52935
|
["gradients-interpolation-method", postcssPlugin$8],
|
|
51985
|
-
["has-pseudo-class", creator$
|
|
51986
|
-
["hexadecimal-alpha-notation", creator$
|
|
52936
|
+
["has-pseudo-class", creator$31],
|
|
52937
|
+
["hexadecimal-alpha-notation", creator$30],
|
|
51987
52938
|
["hwb-function", postcssPlugin$7],
|
|
51988
52939
|
["ic-unit", postcssPlugin$6],
|
|
51989
52940
|
["image-function", postcssPlugin$5],
|
|
51990
|
-
["image-set-function", creator$
|
|
51991
|
-
["is-pseudo-class", creator$
|
|
52941
|
+
["image-set-function", creator$29],
|
|
52942
|
+
["is-pseudo-class", creator$28],
|
|
51992
52943
|
["lab-function", postcssPlugin$4],
|
|
51993
52944
|
["light-dark-function", postcssPlugin$3],
|
|
51994
|
-
["logical-overflow", creator$
|
|
51995
|
-
["logical-overscroll-behavior", creator$
|
|
51996
|
-
["logical-properties-and-values", creator$
|
|
51997
|
-
["logical-resize", creator$
|
|
51998
|
-
["logical-viewport-units", creator$
|
|
51999
|
-
["media-queries-aspect-ratio-number-values", creator$
|
|
52000
|
-
["media-query-ranges", creator$
|
|
52001
|
-
["mixins", creator$
|
|
52002
|
-
["nested-calc", creator$
|
|
52003
|
-
["nesting-rules", creator$
|
|
52004
|
-
["not-pseudo-class", creator$
|
|
52945
|
+
["logical-overflow", creator$27],
|
|
52946
|
+
["logical-overscroll-behavior", creator$26],
|
|
52947
|
+
["logical-properties-and-values", creator$25],
|
|
52948
|
+
["logical-resize", creator$24],
|
|
52949
|
+
["logical-viewport-units", creator$23],
|
|
52950
|
+
["media-queries-aspect-ratio-number-values", creator$22],
|
|
52951
|
+
["media-query-ranges", creator$21],
|
|
52952
|
+
["mixins", creator$20],
|
|
52953
|
+
["nested-calc", creator$19],
|
|
52954
|
+
["nesting-rules", creator$18],
|
|
52955
|
+
["not-pseudo-class", creator$17],
|
|
52005
52956
|
["oklab-function", postcssPlugin$2],
|
|
52006
52957
|
["opacity-percentage", import_postcss_opacity_percentage.default],
|
|
52007
|
-
["overflow-property", creator$
|
|
52958
|
+
["overflow-property", creator$16],
|
|
52008
52959
|
["overflow-wrap-property", import_postcss_replace_overflow_wrap.default],
|
|
52009
|
-
["place-properties", creator$
|
|
52010
|
-
["position-area-property", creator$
|
|
52011
|
-
["prefers-color-scheme-query", creator$
|
|
52012
|
-
["progressive-custom-properties", creator$
|
|
52013
|
-
["property-rule-prelude-list", creator$
|
|
52014
|
-
["random-function", creator$
|
|
52015
|
-
["rebeccapurple-color", creator$
|
|
52960
|
+
["place-properties", creator$15],
|
|
52961
|
+
["position-area-property", creator$14],
|
|
52962
|
+
["prefers-color-scheme-query", creator$13],
|
|
52963
|
+
["progressive-custom-properties", creator$51],
|
|
52964
|
+
["property-rule-prelude-list", creator$12],
|
|
52965
|
+
["random-function", creator$11],
|
|
52966
|
+
["rebeccapurple-color", creator$10],
|
|
52016
52967
|
["relative-color-syntax", postcssPlugin$1],
|
|
52017
|
-
["scope-pseudo-class", creator$
|
|
52018
|
-
["sign-functions", creator$
|
|
52019
|
-
["stepped-value-functions", creator$
|
|
52020
|
-
["syntax-descriptor-syntax-production", creator$
|
|
52021
|
-
["system-ui-font-family", creator$
|
|
52022
|
-
["text-decoration-shorthand", creator$
|
|
52023
|
-
["trigonometric-functions", creator$
|
|
52024
|
-
["unset-value", creator$
|
|
52968
|
+
["scope-pseudo-class", creator$9],
|
|
52969
|
+
["sign-functions", creator$8],
|
|
52970
|
+
["stepped-value-functions", creator$7],
|
|
52971
|
+
["syntax-descriptor-syntax-production", creator$6],
|
|
52972
|
+
["system-ui-font-family", creator$5],
|
|
52973
|
+
["text-decoration-shorthand", creator$4],
|
|
52974
|
+
["trigonometric-functions", creator$3],
|
|
52975
|
+
["unset-value", creator$2]
|
|
52025
52976
|
]);
|
|
52026
52977
|
function featureIsInsertedOrHasAPlugin(s) {
|
|
52027
52978
|
return !!s[xs] || !!s[Fs] || !!$s.has(s.id);
|
|
@@ -52565,7 +53516,7 @@ function levenshteinDistance(s, o) {
|
|
|
52565
53516
|
}
|
|
52566
53517
|
return e[o.length][s.length];
|
|
52567
53518
|
}
|
|
52568
|
-
const creator = (e) => {
|
|
53519
|
+
const creator$1 = (e) => {
|
|
52569
53520
|
const t = new Logger(), r = Object(e), i = Object.keys(Object(r.features)), a = r.browsers ? void 0 : r.env, c = r.browsers, n = listFeatures(cssdb_default, r, initializeSharedOptions(r), t), l = n.map((s) => s.plugin);
|
|
52570
53521
|
!1 !== r.autoprefixer && l.push(s(Object.assign({
|
|
52571
53522
|
env: a,
|
|
@@ -52582,7 +53533,7 @@ const creator = (e) => {
|
|
|
52582
53533
|
plugins: [...l, internalPlugin()]
|
|
52583
53534
|
};
|
|
52584
53535
|
};
|
|
52585
|
-
creator.postcss = !0;
|
|
53536
|
+
creator$1.postcss = !0;
|
|
52586
53537
|
//#endregion
|
|
52587
53538
|
//#region src/autoprefixer.ts
|
|
52588
53539
|
const WEAPP_AUTOPREFIXER_BROWSERS = [
|
|
@@ -53302,6 +54253,7 @@ const EMPTY_FUNCTIONAL_PSEUDO_CLEANUP_SET = new Set([
|
|
|
53302
54253
|
":-moz-any",
|
|
53303
54254
|
":lang"
|
|
53304
54255
|
]);
|
|
54256
|
+
const EXPANDABLE_FUNCTIONAL_PSEUDO_SET = new Set([":is", ":where"]);
|
|
53305
54257
|
const UNSUPPORTED_PSEUDO_ELEMENT_SELECTOR_SET = new Set([
|
|
53306
54258
|
":after",
|
|
53307
54259
|
":before",
|
|
@@ -53346,14 +54298,100 @@ function stripUnsupportedRtlLanguagePseudo(node) {
|
|
|
53346
54298
|
function shouldRemoveEmptyFunctionalPseudo(node) {
|
|
53347
54299
|
return node.type === "pseudo" && EMPTY_FUNCTIONAL_PSEUDO_CLEANUP_SET.has(node.value) && Array.isArray(node.nodes) && node.nodes.length === 0;
|
|
53348
54300
|
}
|
|
54301
|
+
function replaceSelectorNode(target, index, replacement) {
|
|
54302
|
+
const cloned = target.clone();
|
|
54303
|
+
const targetNode = cloned.nodes[index];
|
|
54304
|
+
if (!targetNode || targetNode.type !== "pseudo" || targetNode.value !== ":where") return;
|
|
54305
|
+
targetNode.replaceWith(...replacement.nodes.map((item) => item.clone()));
|
|
54306
|
+
return cloned;
|
|
54307
|
+
}
|
|
54308
|
+
function getNodePath(root, target) {
|
|
54309
|
+
const path = [];
|
|
54310
|
+
let current = target;
|
|
54311
|
+
while (current && current !== root) {
|
|
54312
|
+
const parent = current.parent;
|
|
54313
|
+
if (!parent || !("nodes" in parent) || !Array.isArray(parent.nodes)) return;
|
|
54314
|
+
const index = parent.nodes.indexOf(current);
|
|
54315
|
+
if (index < 0) return;
|
|
54316
|
+
path.unshift(index);
|
|
54317
|
+
current = parent;
|
|
54318
|
+
}
|
|
54319
|
+
return current === root ? path : void 0;
|
|
54320
|
+
}
|
|
54321
|
+
function getNodeByPath(root, path) {
|
|
54322
|
+
let current = root;
|
|
54323
|
+
for (const index of path) {
|
|
54324
|
+
if (!("nodes" in current) || !Array.isArray(current.nodes)) return;
|
|
54325
|
+
const next = current.nodes[index];
|
|
54326
|
+
if (!next) return;
|
|
54327
|
+
current = next;
|
|
54328
|
+
}
|
|
54329
|
+
return current;
|
|
54330
|
+
}
|
|
54331
|
+
function findExpandableFunctionalPseudo(selector) {
|
|
54332
|
+
let target;
|
|
54333
|
+
selector.walkPseudos((pseudo) => {
|
|
54334
|
+
if (!target && EXPANDABLE_FUNCTIONAL_PSEUDO_SET.has(pseudo.value) && Array.isArray(pseudo.nodes) && pseudo.nodes.some((item) => item.type === "selector")) target = pseudo;
|
|
54335
|
+
});
|
|
54336
|
+
return target;
|
|
54337
|
+
}
|
|
54338
|
+
function expandNestedFunctionalPseudoBranches(selector) {
|
|
54339
|
+
const pending = [selector.clone()];
|
|
54340
|
+
const expanded = [];
|
|
54341
|
+
while (pending.length > 0) {
|
|
54342
|
+
const current = pending.shift();
|
|
54343
|
+
if (!current) continue;
|
|
54344
|
+
const target = findExpandableFunctionalPseudo(current);
|
|
54345
|
+
if (!target) {
|
|
54346
|
+
expanded.push(current);
|
|
54347
|
+
continue;
|
|
54348
|
+
}
|
|
54349
|
+
const path = getNodePath(current, target);
|
|
54350
|
+
const branches = target.nodes.filter((item) => item.type === "selector");
|
|
54351
|
+
if (!path || branches.length === 0) {
|
|
54352
|
+
target.remove();
|
|
54353
|
+
pending.push(current);
|
|
54354
|
+
continue;
|
|
54355
|
+
}
|
|
54356
|
+
for (const branch of branches) {
|
|
54357
|
+
const next = current.clone();
|
|
54358
|
+
const nextTarget = getNodeByPath(next, path);
|
|
54359
|
+
if (nextTarget?.type === "pseudo") {
|
|
54360
|
+
nextTarget.replaceWith(...branch.nodes.map((item) => item.clone()));
|
|
54361
|
+
pending.push(next);
|
|
54362
|
+
}
|
|
54363
|
+
}
|
|
54364
|
+
}
|
|
54365
|
+
return expanded;
|
|
54366
|
+
}
|
|
54367
|
+
function transformExpandedSelectorNodes(selector, context) {
|
|
54368
|
+
selector.walk((node) => {
|
|
54369
|
+
if (node.type === "class") node.value = context.selectorReplacerOptions === void 0 ? internalCssSelectorReplacer(node.value) : internalCssSelectorReplacer(node.value, context.selectorReplacerOptions);
|
|
54370
|
+
else if (node.type === "universal" && context.universalReplacement) node.value = context.universalReplacement;
|
|
54371
|
+
});
|
|
54372
|
+
}
|
|
54373
|
+
function appendExpandedWhereSelectors(parent, index, branches, context) {
|
|
54374
|
+
const root = parent.parent;
|
|
54375
|
+
if (!root) return false;
|
|
54376
|
+
for (const branch of branches) {
|
|
54377
|
+
const expanded = replaceSelectorNode(parent, index, branch);
|
|
54378
|
+
if (expanded) {
|
|
54379
|
+
transformExpandedSelectorNodes(expanded, context);
|
|
54380
|
+
root.insertBefore(parent, expanded);
|
|
54381
|
+
}
|
|
54382
|
+
}
|
|
54383
|
+
parent.remove();
|
|
54384
|
+
return true;
|
|
54385
|
+
}
|
|
53349
54386
|
function flattenWherePseudo(node, context, index, parent) {
|
|
53350
54387
|
if (isUniAppXEnabled(context.options)) node.value = ":is";
|
|
53351
|
-
if (
|
|
53352
|
-
|
|
53353
|
-
|
|
53354
|
-
|
|
53355
|
-
|
|
53356
|
-
|
|
54388
|
+
if (!parent || node.length === 0) return;
|
|
54389
|
+
const branches = node.nodes.filter((item) => item.type === "selector").flatMap(expandNestedFunctionalPseudoBranches);
|
|
54390
|
+
for (const branch of branches) if (transformSpacingSelector(branch.nodes, context.options)) context.requiresSpacingNormalization = true;
|
|
54391
|
+
if (branches.length > 1 && appendExpandedWhereSelectors(parent, index, branches, context)) return;
|
|
54392
|
+
const targetSelector = branches[0];
|
|
54393
|
+
if (targetSelector) node.replaceWith(...targetSelector.nodes.map((item) => item.clone()));
|
|
54394
|
+
if (parent.type === "selector" && parent.length === 0) parent.remove();
|
|
53357
54395
|
}
|
|
53358
54396
|
function shouldRemoveUnsupportedPseudoElementSelector(selector, options) {
|
|
53359
54397
|
if (!isUniAppXEnabled(options)) return selector.nodes.some((node) => node.type === "pseudo" && MINI_PROGRAM_UNSUPPORTED_PSEUDO_ELEMENT_SELECTOR_SET.has(node.value));
|
|
@@ -54433,7 +55471,7 @@ function createPreparedNodes(options, signal) {
|
|
|
54433
55471
|
preparedNodes.push(createPreparedNode(`pre:user-${index}`, "pre", () => plugin));
|
|
54434
55472
|
});
|
|
54435
55473
|
preparedNodes.push(createPreparedNode("pre:core", "pre", () => postcssWeappTailwindcssPrePlugin(options)));
|
|
54436
|
-
if (!signal || signal.hasPresetEnvFeatures) preparedNodes.push(createPreparedNode("normal:preset-env", "normal", () => creator(presetEnvOptions)));
|
|
55474
|
+
if (!signal || signal.hasPresetEnvFeatures) preparedNodes.push(createPreparedNode("normal:preset-env", "normal", () => creator$1(presetEnvOptions)));
|
|
54437
55475
|
if (!signal || signal.hasModernColorFunction) preparedNodes.push(createPreparedNode("normal:color-functional-fallback", "normal", () => createColorFunctionalFallback()));
|
|
54438
55476
|
const unitsToPxPlugin = getUnitsToPxPlugin(options);
|
|
54439
55477
|
if (unitsToPxPlugin) preparedNodes.push(createPreparedNode("normal:units-to-px", "normal", () => unitsToPxPlugin));
|
|
@@ -54604,7 +55642,7 @@ var StyleProcessorCache = class {
|
|
|
54604
55642
|
const compositeKey = this.createCompositeCacheKey(optionsKey, signal);
|
|
54605
55643
|
let processor = this.processorCacheByKey.get(compositeKey);
|
|
54606
55644
|
if (!processor) {
|
|
54607
|
-
processor = postcss(this.getPipeline(options, signal).plugins);
|
|
55645
|
+
processor = postcss$1(this.getPipeline(options, signal).plugins);
|
|
54608
55646
|
this.processorCacheByKey.set(compositeKey, processor);
|
|
54609
55647
|
}
|
|
54610
55648
|
return processor;
|
|
@@ -54672,7 +55710,7 @@ function createStyleHandler(options) {
|
|
|
54672
55710
|
if (restoredCss !== finalResult.css) {
|
|
54673
55711
|
const nextResult = finalResult.root.clone().toResult(finalResult.opts);
|
|
54674
55712
|
nextResult.css = restoredCss;
|
|
54675
|
-
nextResult.root = postcss.parse(restoredCss, finalResult.opts);
|
|
55713
|
+
nextResult.root = postcss$1.parse(restoredCss, finalResult.opts);
|
|
54676
55714
|
nextResult.messages.push(...finalResult.messages);
|
|
54677
55715
|
finalResult = nextResult;
|
|
54678
55716
|
}
|
|
@@ -54688,4 +55726,403 @@ function createStyleHandler(options) {
|
|
|
54688
55726
|
return handler;
|
|
54689
55727
|
}
|
|
54690
55728
|
//#endregion
|
|
54691
|
-
|
|
55729
|
+
//#region src/postcss-config.ts
|
|
55730
|
+
const tailwindPostcssPluginNames = new Set(["tailwindcss", "@tailwindcss/postcss"]);
|
|
55731
|
+
function getPostcssPluginName(plugin) {
|
|
55732
|
+
if (!plugin) return;
|
|
55733
|
+
if (typeof plugin === "function" && "postcss" in plugin) try {
|
|
55734
|
+
return getPostcssPluginName(plugin());
|
|
55735
|
+
} catch {
|
|
55736
|
+
return;
|
|
55737
|
+
}
|
|
55738
|
+
if (typeof plugin !== "object" || !("postcssPlugin" in plugin)) return;
|
|
55739
|
+
const { postcssPlugin } = plugin;
|
|
55740
|
+
return typeof postcssPlugin === "string" ? postcssPlugin : void 0;
|
|
55741
|
+
}
|
|
55742
|
+
function isTailwindPostcssPlugin(plugin) {
|
|
55743
|
+
const name = getPostcssPluginName(plugin);
|
|
55744
|
+
return typeof name === "string" && tailwindPostcssPluginNames.has(name);
|
|
55745
|
+
}
|
|
55746
|
+
function removeTailwindPostcssPlugins(plugins) {
|
|
55747
|
+
let removed = 0;
|
|
55748
|
+
for (let i = plugins.length - 1; i >= 0; i--) if (isTailwindPostcssPlugin(plugins[i])) {
|
|
55749
|
+
plugins.splice(i, 1);
|
|
55750
|
+
removed++;
|
|
55751
|
+
}
|
|
55752
|
+
return removed;
|
|
55753
|
+
}
|
|
55754
|
+
async function resolveFilteredPostcssConfig(root) {
|
|
55755
|
+
try {
|
|
55756
|
+
const loaded = await postcssrc({}, root);
|
|
55757
|
+
const plugins = Array.isArray(loaded.plugins) ? [...loaded.plugins] : [];
|
|
55758
|
+
const removed = removeTailwindPostcssPlugins(plugins);
|
|
55759
|
+
if (removed === 0) return;
|
|
55760
|
+
return {
|
|
55761
|
+
options: loaded.options,
|
|
55762
|
+
plugins,
|
|
55763
|
+
removed
|
|
55764
|
+
};
|
|
55765
|
+
} catch (error) {
|
|
55766
|
+
if ((error instanceof Error ? error.message : String(error)).includes("No PostCSS Config found")) return;
|
|
55767
|
+
throw error;
|
|
55768
|
+
}
|
|
55769
|
+
}
|
|
55770
|
+
//#endregion
|
|
55771
|
+
//#region src/vite-css-rules.ts
|
|
55772
|
+
const MINI_PROGRAM_PREFLIGHT_SELECTOR_KEY = "view,text,::after,::before";
|
|
55773
|
+
const MINI_PROGRAM_PREFLIGHT_SELECTOR_KEYS = new Set([
|
|
55774
|
+
"view",
|
|
55775
|
+
"text",
|
|
55776
|
+
"::after",
|
|
55777
|
+
"::before"
|
|
55778
|
+
]);
|
|
55779
|
+
const MINI_PROGRAM_THEME_SCOPE_SELECTOR_KEY = ":host,page,.tw-root,wx-root-portal-content";
|
|
55780
|
+
const MINI_PROGRAM_THEME_SCOPE_SELECTOR_KEYS = new Set([
|
|
55781
|
+
":host",
|
|
55782
|
+
"page",
|
|
55783
|
+
".tw-root",
|
|
55784
|
+
"wx-root-portal-content"
|
|
55785
|
+
]);
|
|
55786
|
+
function normalizeCssForContainment(css) {
|
|
55787
|
+
return css.replace(/\/\*[\s\S]*?\*\//g, "").replace(/::(before|after)\b/g, ":$1").replace(/\s+/g, " ").replace(/\s*([{}:;,>+~()])\s*/g, "$1").replace(/;\}/g, "}").trim();
|
|
55788
|
+
}
|
|
55789
|
+
function collectNormalizedCssNodes(css) {
|
|
55790
|
+
try {
|
|
55791
|
+
return (postcss.parse(css).nodes ?? []).filter((node) => node.type !== "comment").map((node) => normalizeCssForContainment(node.toString())).filter(Boolean);
|
|
55792
|
+
} catch {
|
|
55793
|
+
const normalizedCss = normalizeCssForContainment(css);
|
|
55794
|
+
return normalizedCss ? [normalizedCss] : [];
|
|
55795
|
+
}
|
|
55796
|
+
}
|
|
55797
|
+
function normalizeCssRuleKeyPart(value) {
|
|
55798
|
+
return value.replace(/::(before|after)\b/g, ":$1").replace(/\s+/g, " ").replace(/\s*([>+~(),])\s*/g, "$1").trim();
|
|
55799
|
+
}
|
|
55800
|
+
function getRuleAtRuleChain(rule) {
|
|
55801
|
+
const chain = [];
|
|
55802
|
+
let parent = rule.parent;
|
|
55803
|
+
while (parent && parent.type !== "root") {
|
|
55804
|
+
if (parent.type === "atrule") chain.unshift(`@${parent.name} ${normalizeCssRuleKeyPart(parent.params)}`);
|
|
55805
|
+
parent = parent.parent;
|
|
55806
|
+
}
|
|
55807
|
+
return chain;
|
|
55808
|
+
}
|
|
55809
|
+
function getCssRuleStructuralKey(rule) {
|
|
55810
|
+
const selector = normalizeCssRuleKeyPart(rule.selector);
|
|
55811
|
+
if (selector.length === 0) return;
|
|
55812
|
+
return [...getRuleAtRuleChain(rule), selector].join("|");
|
|
55813
|
+
}
|
|
55814
|
+
function getCssRuleStructuralKeyWithSelectorKey(rule, selectorKey) {
|
|
55815
|
+
return [...getRuleAtRuleChain(rule), selectorKey].join("|");
|
|
55816
|
+
}
|
|
55817
|
+
function getCssRuleContentKey(rule) {
|
|
55818
|
+
const structuralKey = getCssRuleStructuralKey(rule);
|
|
55819
|
+
if (!structuralKey) return;
|
|
55820
|
+
return [structuralKey, normalizeCssForContainment(rule.toString())].join("|");
|
|
55821
|
+
}
|
|
55822
|
+
function collectCssRuleContentKeys(css) {
|
|
55823
|
+
const keys = /* @__PURE__ */ new Set();
|
|
55824
|
+
try {
|
|
55825
|
+
postcss.parse(css).walkRules((rule) => {
|
|
55826
|
+
const key = getCssRuleContentKey(rule);
|
|
55827
|
+
if (key) keys.add(key);
|
|
55828
|
+
});
|
|
55829
|
+
} catch {}
|
|
55830
|
+
return keys;
|
|
55831
|
+
}
|
|
55832
|
+
function normalizeCssDeclarationKey(decl) {
|
|
55833
|
+
return [
|
|
55834
|
+
decl.prop.trim(),
|
|
55835
|
+
normalizeCssForContainment(decl.value),
|
|
55836
|
+
decl.important ? "!important" : ""
|
|
55837
|
+
].join(":");
|
|
55838
|
+
}
|
|
55839
|
+
function collectCssRuleDeclarationKeys(rule) {
|
|
55840
|
+
const keys = /* @__PURE__ */ new Set();
|
|
55841
|
+
for (const node of rule.nodes ?? []) if (node.type === "decl") keys.add(normalizeCssDeclarationKey(node));
|
|
55842
|
+
return keys;
|
|
55843
|
+
}
|
|
55844
|
+
function collectCssRuleDeclarationProps(rule) {
|
|
55845
|
+
const props = /* @__PURE__ */ new Set();
|
|
55846
|
+
for (const node of rule.nodes ?? []) if (node.type === "decl") props.add(node.prop.trim());
|
|
55847
|
+
return props;
|
|
55848
|
+
}
|
|
55849
|
+
function collectCssRuleDeclarations(rule) {
|
|
55850
|
+
return (rule.nodes ?? []).filter((node) => node.type === "decl");
|
|
55851
|
+
}
|
|
55852
|
+
function collectCssRuleDeclarationKeyMap(css) {
|
|
55853
|
+
const map = /* @__PURE__ */ new Map();
|
|
55854
|
+
try {
|
|
55855
|
+
postcss.parse(css).walkRules((rule) => {
|
|
55856
|
+
const key = getCssRuleStructuralKey(rule);
|
|
55857
|
+
if (!key) return;
|
|
55858
|
+
const declarations = collectCssRuleDeclarationKeys(rule);
|
|
55859
|
+
if (declarations.size === 0) return;
|
|
55860
|
+
let existing = map.get(key);
|
|
55861
|
+
if (!existing) {
|
|
55862
|
+
existing = /* @__PURE__ */ new Set();
|
|
55863
|
+
map.set(key, existing);
|
|
55864
|
+
}
|
|
55865
|
+
for (const declaration of declarations) existing.add(declaration);
|
|
55866
|
+
});
|
|
55867
|
+
} catch {}
|
|
55868
|
+
return map;
|
|
55869
|
+
}
|
|
55870
|
+
function collectCssRuleDeclarationRecords(root, resolveRuleKey = getCssRuleStructuralKey) {
|
|
55871
|
+
const map = /* @__PURE__ */ new Map();
|
|
55872
|
+
root.walkRules((rule) => {
|
|
55873
|
+
const key = resolveRuleKey(rule);
|
|
55874
|
+
if (!key) return;
|
|
55875
|
+
const keys = collectCssRuleDeclarationKeys(rule);
|
|
55876
|
+
if (keys.size === 0) return;
|
|
55877
|
+
const records = map.get(key) ?? [];
|
|
55878
|
+
records.push({
|
|
55879
|
+
rule,
|
|
55880
|
+
keys,
|
|
55881
|
+
props: collectCssRuleDeclarationProps(rule)
|
|
55882
|
+
});
|
|
55883
|
+
map.set(key, records);
|
|
55884
|
+
});
|
|
55885
|
+
return map;
|
|
55886
|
+
}
|
|
55887
|
+
function normalizeSimpleMiniProgramSelectorNode(node) {
|
|
55888
|
+
if (node.type === "tag") {
|
|
55889
|
+
const value = node.value.toLowerCase();
|
|
55890
|
+
if (value === "view" || value === "text" || value === "page" || value === "wx-root-portal-content") return value;
|
|
55891
|
+
return;
|
|
55892
|
+
}
|
|
55893
|
+
if (node.type === "class") return node.value.toLowerCase() === "tw-root" ? ".tw-root" : void 0;
|
|
55894
|
+
if (node.type === "pseudo") {
|
|
55895
|
+
if (node.nodes && node.nodes.length > 0) return;
|
|
55896
|
+
const value = node.value.toLowerCase();
|
|
55897
|
+
if (value === ":before" || value === "::before") return "::before";
|
|
55898
|
+
if (value === ":after" || value === "::after") return "::after";
|
|
55899
|
+
if (value === ":host") return ":host";
|
|
55900
|
+
}
|
|
55901
|
+
}
|
|
55902
|
+
function normalizeSimpleMiniProgramSelector(selector) {
|
|
55903
|
+
if (selector.nodes.length !== 1) return;
|
|
55904
|
+
return normalizeSimpleMiniProgramSelectorNode(selector.nodes[0]);
|
|
55905
|
+
}
|
|
55906
|
+
function collectMiniProgramSelectorSet(selector) {
|
|
55907
|
+
try {
|
|
55908
|
+
const selectorSet = /* @__PURE__ */ new Set();
|
|
55909
|
+
const ast = selectorParser().astSync(selector);
|
|
55910
|
+
for (const child of ast.nodes) {
|
|
55911
|
+
const key = normalizeSimpleMiniProgramSelector(child);
|
|
55912
|
+
if (!key || selectorSet.has(key)) return;
|
|
55913
|
+
selectorSet.add(key);
|
|
55914
|
+
}
|
|
55915
|
+
return selectorSet;
|
|
55916
|
+
} catch {
|
|
55917
|
+
return;
|
|
55918
|
+
}
|
|
55919
|
+
}
|
|
55920
|
+
function isSameSelectorSet(actual, expected) {
|
|
55921
|
+
return actual?.size === expected.size && [...expected].every((key) => actual.has(key));
|
|
55922
|
+
}
|
|
55923
|
+
function getMiniProgramPreflightRuleStructuralKey(rule) {
|
|
55924
|
+
if (!isSameSelectorSet(collectMiniProgramSelectorSet(rule.selector), MINI_PROGRAM_PREFLIGHT_SELECTOR_KEYS)) return;
|
|
55925
|
+
return getCssRuleStructuralKeyWithSelectorKey(rule, MINI_PROGRAM_PREFLIGHT_SELECTOR_KEY);
|
|
55926
|
+
}
|
|
55927
|
+
function getMiniProgramThemeScopeRuleStructuralKey(rule) {
|
|
55928
|
+
if (!isSameSelectorSet(collectMiniProgramSelectorSet(rule.selector), MINI_PROGRAM_THEME_SCOPE_SELECTOR_KEYS)) return;
|
|
55929
|
+
return getCssRuleStructuralKeyWithSelectorKey(rule, MINI_PROGRAM_THEME_SCOPE_SELECTOR_KEY);
|
|
55930
|
+
}
|
|
55931
|
+
function mergeMiniProgramPreflightRuleDeclarations(baseCss, css) {
|
|
55932
|
+
try {
|
|
55933
|
+
const baseRoot = postcss.parse(baseCss);
|
|
55934
|
+
const root = postcss.parse(css);
|
|
55935
|
+
const baseRuleRecords = collectCssRuleDeclarationRecords(baseRoot, getMiniProgramPreflightRuleStructuralKey);
|
|
55936
|
+
let changedBase = false;
|
|
55937
|
+
let changedCss = false;
|
|
55938
|
+
root.walkRules((rule) => {
|
|
55939
|
+
const key = getMiniProgramPreflightRuleStructuralKey(rule);
|
|
55940
|
+
if (!key) return;
|
|
55941
|
+
const records = baseRuleRecords.get(key);
|
|
55942
|
+
const targetRecord = records?.[0];
|
|
55943
|
+
if (!targetRecord) return;
|
|
55944
|
+
const existingProps = new Set(records.flatMap((record) => [...record.props]));
|
|
55945
|
+
for (const decl of collectCssRuleDeclarations(rule)) {
|
|
55946
|
+
const prop = decl.prop.trim();
|
|
55947
|
+
if (existingProps.has(prop)) continue;
|
|
55948
|
+
targetRecord.rule.append(decl.clone());
|
|
55949
|
+
targetRecord.keys.add(normalizeCssDeclarationKey(decl));
|
|
55950
|
+
targetRecord.props.add(prop);
|
|
55951
|
+
existingProps.add(prop);
|
|
55952
|
+
changedBase = true;
|
|
55953
|
+
}
|
|
55954
|
+
rule.remove();
|
|
55955
|
+
changedCss = true;
|
|
55956
|
+
});
|
|
55957
|
+
if (!changedBase && !changedCss) return {
|
|
55958
|
+
baseCss,
|
|
55959
|
+
css,
|
|
55960
|
+
changed: false
|
|
55961
|
+
};
|
|
55962
|
+
removeEmptyAtRules(root);
|
|
55963
|
+
return {
|
|
55964
|
+
baseCss: changedBase ? baseRoot.toString() : baseCss,
|
|
55965
|
+
css: changedCss ? root.toString().trim() : css,
|
|
55966
|
+
changed: true
|
|
55967
|
+
};
|
|
55968
|
+
} catch {
|
|
55969
|
+
return {
|
|
55970
|
+
baseCss,
|
|
55971
|
+
css,
|
|
55972
|
+
changed: false
|
|
55973
|
+
};
|
|
55974
|
+
}
|
|
55975
|
+
}
|
|
55976
|
+
function mergeMiniProgramThemeScopeRuleDeclarations(baseCss, css) {
|
|
55977
|
+
try {
|
|
55978
|
+
const baseRoot = postcss.parse(baseCss);
|
|
55979
|
+
const root = postcss.parse(css);
|
|
55980
|
+
const baseRuleRecords = collectCssRuleDeclarationRecords(baseRoot, getMiniProgramThemeScopeRuleStructuralKey);
|
|
55981
|
+
let changedBase = false;
|
|
55982
|
+
let changedCss = false;
|
|
55983
|
+
root.walkRules((rule) => {
|
|
55984
|
+
const key = getMiniProgramThemeScopeRuleStructuralKey(rule);
|
|
55985
|
+
if (!key) return;
|
|
55986
|
+
const records = baseRuleRecords.get(key);
|
|
55987
|
+
const targetRecord = records?.[0];
|
|
55988
|
+
if (!targetRecord) return;
|
|
55989
|
+
const incomingDeclarations = collectCssRuleDeclarations(rule);
|
|
55990
|
+
if (incomingDeclarations.length === 0) return;
|
|
55991
|
+
const existingKeys = new Set(records.flatMap((record) => [...record.keys]));
|
|
55992
|
+
const existingProps = new Set(records.flatMap((record) => [...record.props]));
|
|
55993
|
+
if (incomingDeclarations.some((decl) => {
|
|
55994
|
+
const prop = decl.prop.trim();
|
|
55995
|
+
return existingProps.has(prop) && !existingKeys.has(normalizeCssDeclarationKey(decl));
|
|
55996
|
+
})) return;
|
|
55997
|
+
for (const decl of incomingDeclarations) {
|
|
55998
|
+
const declarationKey = normalizeCssDeclarationKey(decl);
|
|
55999
|
+
if (existingKeys.has(declarationKey)) continue;
|
|
56000
|
+
targetRecord.rule.append(decl.clone());
|
|
56001
|
+
targetRecord.keys.add(declarationKey);
|
|
56002
|
+
targetRecord.props.add(decl.prop.trim());
|
|
56003
|
+
existingKeys.add(declarationKey);
|
|
56004
|
+
existingProps.add(decl.prop.trim());
|
|
56005
|
+
changedBase = true;
|
|
56006
|
+
}
|
|
56007
|
+
rule.remove();
|
|
56008
|
+
changedCss = true;
|
|
56009
|
+
});
|
|
56010
|
+
if (!changedBase && !changedCss) return {
|
|
56011
|
+
baseCss,
|
|
56012
|
+
css,
|
|
56013
|
+
changed: false
|
|
56014
|
+
};
|
|
56015
|
+
removeEmptyAtRules(root);
|
|
56016
|
+
return {
|
|
56017
|
+
baseCss: changedBase ? baseRoot.toString() : baseCss,
|
|
56018
|
+
css: changedCss ? root.toString().trim() : css,
|
|
56019
|
+
changed: true
|
|
56020
|
+
};
|
|
56021
|
+
} catch {
|
|
56022
|
+
return {
|
|
56023
|
+
baseCss,
|
|
56024
|
+
css,
|
|
56025
|
+
changed: false
|
|
56026
|
+
};
|
|
56027
|
+
}
|
|
56028
|
+
}
|
|
56029
|
+
function isCssRuleCoveredByDeclarations(rule, baseRuleDeclarationKeys) {
|
|
56030
|
+
const key = getCssRuleStructuralKey(rule);
|
|
56031
|
+
if (!key) return false;
|
|
56032
|
+
const baseDeclarations = baseRuleDeclarationKeys.get(key);
|
|
56033
|
+
if (!baseDeclarations) return false;
|
|
56034
|
+
const declarations = collectCssRuleDeclarationKeys(rule);
|
|
56035
|
+
return declarations.size > 0 && [...declarations].every((declaration) => baseDeclarations.has(declaration));
|
|
56036
|
+
}
|
|
56037
|
+
function mergeCoveredCssRuleDeclarations(baseCss, css) {
|
|
56038
|
+
try {
|
|
56039
|
+
const baseRoot = postcss.parse(baseCss);
|
|
56040
|
+
const root = postcss.parse(css);
|
|
56041
|
+
const baseRuleRecords = collectCssRuleDeclarationRecords(baseRoot);
|
|
56042
|
+
let changedBase = false;
|
|
56043
|
+
let changedCss = false;
|
|
56044
|
+
root.walkRules((rule) => {
|
|
56045
|
+
const key = getCssRuleStructuralKey(rule);
|
|
56046
|
+
const records = key ? baseRuleRecords.get(key) : void 0;
|
|
56047
|
+
if (!records || records.length === 0) return;
|
|
56048
|
+
const incomingDeclarations = collectCssRuleDeclarations(rule);
|
|
56049
|
+
if (incomingDeclarations.length === 0) return;
|
|
56050
|
+
const baseKeys = new Set(records.flatMap((record) => [...record.keys]));
|
|
56051
|
+
if (incomingDeclarations.filter((decl) => baseKeys.has(normalizeCssDeclarationKey(decl))).length === 0) return;
|
|
56052
|
+
const missingDeclarations = incomingDeclarations.filter((decl) => !baseKeys.has(normalizeCssDeclarationKey(decl)));
|
|
56053
|
+
if (missingDeclarations.length === 0) {
|
|
56054
|
+
rule.remove();
|
|
56055
|
+
changedCss = true;
|
|
56056
|
+
return;
|
|
56057
|
+
}
|
|
56058
|
+
const baseProps = new Set(records.flatMap((record) => [...record.props]));
|
|
56059
|
+
if (missingDeclarations.filter((decl) => baseProps.has(decl.prop.trim())).length > 0) return;
|
|
56060
|
+
const targetRecord = records[0];
|
|
56061
|
+
if (!targetRecord) return;
|
|
56062
|
+
for (const decl of missingDeclarations) {
|
|
56063
|
+
targetRecord.rule.append(decl.clone());
|
|
56064
|
+
targetRecord.keys.add(normalizeCssDeclarationKey(decl));
|
|
56065
|
+
targetRecord.props.add(decl.prop.trim());
|
|
56066
|
+
}
|
|
56067
|
+
rule.remove();
|
|
56068
|
+
changedBase = true;
|
|
56069
|
+
changedCss = true;
|
|
56070
|
+
});
|
|
56071
|
+
if (!changedBase && !changedCss) return {
|
|
56072
|
+
baseCss,
|
|
56073
|
+
css,
|
|
56074
|
+
changed: false
|
|
56075
|
+
};
|
|
56076
|
+
removeEmptyAtRules(root);
|
|
56077
|
+
return {
|
|
56078
|
+
baseCss: changedBase ? baseRoot.toString() : baseCss,
|
|
56079
|
+
css: changedCss ? root.toString().trim() : css,
|
|
56080
|
+
changed: true
|
|
56081
|
+
};
|
|
56082
|
+
} catch {
|
|
56083
|
+
return {
|
|
56084
|
+
baseCss,
|
|
56085
|
+
css,
|
|
56086
|
+
changed: false
|
|
56087
|
+
};
|
|
56088
|
+
}
|
|
56089
|
+
}
|
|
56090
|
+
function removeEmptyAtRules(root) {
|
|
56091
|
+
root.walkAtRules((atRule) => {
|
|
56092
|
+
if (atRule.nodes && atRule.nodes.every((node) => node.type === "comment")) atRule.remove();
|
|
56093
|
+
});
|
|
56094
|
+
}
|
|
56095
|
+
function filterExistingCssRules(baseCss, css) {
|
|
56096
|
+
const baseRuleKeys = collectCssRuleContentKeys(baseCss);
|
|
56097
|
+
if (baseRuleKeys.size === 0) return css;
|
|
56098
|
+
try {
|
|
56099
|
+
const root = postcss.parse(css);
|
|
56100
|
+
const baseRuleDeclarationKeys = collectCssRuleDeclarationKeyMap(baseCss);
|
|
56101
|
+
let changed = false;
|
|
56102
|
+
root.walkRules((rule) => {
|
|
56103
|
+
const key = getCssRuleContentKey(rule);
|
|
56104
|
+
if (key && baseRuleKeys.has(key) || isCssRuleCoveredByDeclarations(rule, baseRuleDeclarationKeys)) {
|
|
56105
|
+
rule.remove();
|
|
56106
|
+
changed = true;
|
|
56107
|
+
}
|
|
56108
|
+
});
|
|
56109
|
+
if (!changed) return css;
|
|
56110
|
+
removeEmptyAtRules(root);
|
|
56111
|
+
return root.toString().trim();
|
|
56112
|
+
} catch {
|
|
56113
|
+
return css;
|
|
56114
|
+
}
|
|
56115
|
+
}
|
|
56116
|
+
function containsCssAfterMinify(baseCss, css) {
|
|
56117
|
+
if (baseCss.includes(css)) return true;
|
|
56118
|
+
const normalizedBaseCss = normalizeCssForContainment(baseCss);
|
|
56119
|
+
const normalizedCss = normalizeCssForContainment(css);
|
|
56120
|
+
if (normalizedCss.length > 0 && normalizedBaseCss.includes(normalizedCss)) return true;
|
|
56121
|
+
const normalizedNodes = collectNormalizedCssNodes(css);
|
|
56122
|
+
if (normalizedNodes.length > 0 && normalizedNodes.every((node) => normalizedBaseCss.includes(node))) return true;
|
|
56123
|
+
const baseRuleKeys = collectCssRuleContentKeys(baseCss);
|
|
56124
|
+
const ruleKeys = collectCssRuleContentKeys(css);
|
|
56125
|
+
return ruleKeys.size > 0 && [...ruleKeys].every((key) => baseRuleKeys.has(key));
|
|
56126
|
+
}
|
|
56127
|
+
//#endregion
|
|
56128
|
+
export { CSS_MACRO_POSTCSS_PLUGIN_NAME, CSS_MACRO_STYLE_OPTIONS_MARKER, compileCssMacroConditionalComments, containsCssAfterMinify, createFallbackPlaceholderReplacer, createInjectPreflight, createStyleHandler, createStylePipeline, createWeappTailwindcssPostcssPlugin, creator as cssMacroPostcssPlugin, filterExistingCssRules, finalizeMiniProgramCss, getPostcssPluginName, hasCssMacroStyleOptions, hasCssMacroTailwindV4Directive, hoistTailwindPreflightBase, internalCssSelectorReplacer, mergeCoveredCssRuleDeclarations, mergeMiniProgramPreflightRuleDeclarations, mergeMiniProgramThemeScopeRuleDeclarations, normalizeMiniProgramPrefixedDeclaration, normalizeModernColorValue, postcss, postcssHtmlTransform, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, removeTailwindPostcssPlugins, removeUnsupportedAtSupports, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, removeUnsupportedMiniProgramPrefixedAtRule, resolveFilteredPostcssConfig, transformCssMacroCss, unitConversionComposeRules, unitConversionPresets, withCssMacroStyleOptions };
|