weapp-tailwindcss 5.5.5 → 5.5.6

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.
Files changed (133) hide show
  1. package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +5 -4
  2. package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -2
  3. package/dist/bundlers/shared/framework-css-composition.d.ts +1 -0
  4. package/dist/bundlers/shared/framework-postcss.d.ts +2 -1
  5. package/dist/bundlers/shared/framework-user-css.d.ts +1 -0
  6. package/dist/bundlers/shared/generated-css-marker.d.ts +1 -0
  7. package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +5 -7
  8. package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +4 -1
  9. package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +1 -4
  10. package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -1
  11. package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +4 -2
  12. package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +1 -1
  13. package/dist/bundlers/shared/generator-css/types.d.ts +6 -3
  14. package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +1 -0
  15. package/dist/bundlers/shared/generator-css/user-css/compile-functions.d.ts +4 -0
  16. package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +3 -1
  17. package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +1 -1
  18. package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +3 -0
  19. package/dist/bundlers/shared/style-handler-options.d.ts +7 -0
  20. package/dist/bundlers/shared/v4-generation-core.d.ts +0 -1
  21. package/dist/bundlers/vite/css-finalizer/css-calc.d.ts +3 -0
  22. package/dist/bundlers/vite/css-finalizer/final-assets.d.ts +3 -0
  23. package/dist/bundlers/vite/css-handler-options.d.ts +1 -1
  24. package/dist/bundlers/vite/frameworks/generic/web.d.ts +2 -1
  25. package/dist/bundlers/vite/generate-bundle/css-transform-decision-plan.d.ts +1 -0
  26. package/dist/bundlers/vite/generate-bundle/finalize/sync-processed-css.d.ts +4 -0
  27. package/dist/bundlers/vite/generate-bundle/framework-style-memory.d.ts +4 -0
  28. package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +7 -0
  29. package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -0
  30. package/dist/bundlers/vite/generate-bundle/rollup-assets.d.ts +1 -1
  31. package/dist/bundlers/vite/generate-bundle/runtime.d.ts +3 -1
  32. package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +1 -1
  33. package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +2 -2
  34. package/dist/bundlers/vite/generate-bundle/types.d.ts +1 -1
  35. package/dist/bundlers/vite/generate-bundle/web-css-module.d.ts +1 -0
  36. package/dist/bundlers/vite/plugin-hook.d.ts +3 -0
  37. package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +3 -1
  38. package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +1 -1
  39. package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +1 -1
  40. package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +3 -1
  41. package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +2 -1
  42. package/dist/bundlers/vite/shared/framework-runtime-configuration.d.ts +3 -0
  43. package/dist/bundlers/vite/shared/framework-runtime-options.d.ts +9 -0
  44. package/dist/bundlers/vite/shared/framework-runtime-utils.d.ts +6 -5
  45. package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +3 -3
  46. package/dist/bundlers/vite/shared/framework-strategy.d.ts +3 -1
  47. package/dist/bundlers/vite/shared/hmr-source.d.ts +2 -0
  48. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/processed-css-task.d.ts +2 -1
  49. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +1 -1
  50. package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +1 -1
  51. package/dist/compiler/index.d.ts +2 -0
  52. package/dist/compiler/semantic-css.d.ts +1 -1
  53. package/dist/compiler/types.d.ts +1 -1
  54. package/dist/{compiler-Cc0JXfbw.cjs → compiler-C8FqI-P3.cjs} +17378 -40552
  55. package/dist/{compiler-D_vxtEdw.js → compiler-D3GBwxoa.js} +32 -23
  56. package/dist/core/compiler/transforms.d.ts +1 -1
  57. package/dist/core.cjs +4 -4
  58. package/dist/core.js +4 -4
  59. package/dist/{css-imports-FRZwX4P6.cjs → css-imports-XvtI1zCY.cjs} +2 -3
  60. package/dist/css-macro.cjs +1 -1
  61. package/dist/css-macro.js +1 -1
  62. package/dist/{defaults-CKx-4LcW.js → defaults-AQuvJS-h.js} +4 -2
  63. package/dist/{defaults-CiGsr8Xq.cjs → defaults-CyX5iO9y.cjs} +4 -2
  64. package/dist/defaults.cjs +1 -1
  65. package/dist/defaults.js +1 -1
  66. package/dist/final-css-cleanup-CDTmVAye.cjs +1 -0
  67. package/dist/{final-css-cleanup-B0HUBtiE.js → final-css-cleanup-u_sI2p56.js} +1 -126
  68. package/dist/framework/index.d.ts +1 -1
  69. package/dist/framework/platform.d.ts +2 -2
  70. package/dist/{generator-BdSIvFEO.cjs → generator-Bvr4WmuF.cjs} +135 -149
  71. package/dist/{generator-CAOx1Sqm.js → generator-C0BJjyLM.js} +116 -130
  72. package/dist/generator.cjs +1 -1
  73. package/dist/generator.js +1 -1
  74. package/dist/{gulp-Dnt8VL8D.cjs → gulp-BExe5RBF.cjs} +8 -8
  75. package/dist/{gulp-B1mPTMqw.js → gulp-BhkIIk7J.js} +5 -5
  76. package/dist/gulp.cjs +1 -1
  77. package/dist/gulp.js +1 -1
  78. package/dist/{hmr-timing-wAt0LavM.js → hmr-timing-B9Yt86-U.js} +299 -404
  79. package/dist/{hmr-timing-qpX410qU.cjs → hmr-timing-CoiJIqDu.cjs} +4 -4
  80. package/dist/index.cjs +4 -4
  81. package/dist/index.js +4 -4
  82. package/dist/js/NodePathWalker.d.ts +1 -1
  83. package/dist/js/node-path-walker/export-handlers.d.ts +1 -1
  84. package/dist/js/node-path-walker/import-tokens.d.ts +1 -1
  85. package/dist/{pipeline-helpers-BHagysZY.cjs → pipeline-helpers-BOjTEmMi.cjs} +6 -6
  86. package/dist/postcss.cjs +1 -1
  87. package/dist/postcss.js +1 -1
  88. package/dist/presets.cjs +2 -2
  89. package/dist/presets.js +2 -2
  90. package/dist/rspack.cjs +2 -2
  91. package/dist/rspack.js +2 -2
  92. package/dist/{scoped-generator-BqxVxNp9.js → scoped-generator-B6Y1bxzM.js} +46 -31
  93. package/dist/{scoped-generator-CtetE5rm.cjs → scoped-generator-BUBls_oM.cjs} +46 -31
  94. package/dist/{source-candidate-scan-signature-BDGB9nKZ.cjs → source-candidate-scan-signature-BtJZp28T.cjs} +32 -3
  95. package/dist/{source-candidate-scan-signature-Lm32zKVA.js → source-candidate-scan-signature-DNuGKTqf.js} +21 -4
  96. package/dist/style-injector/internal.d.ts +118 -8
  97. package/dist/style-injector/options.d.ts +5 -1
  98. package/dist/tailwindcss/runtime-options.d.ts +5 -0
  99. package/dist/tailwindcss/v4/preflight.d.ts +0 -1
  100. package/dist/tailwindcss/v4-engine/generator/style-context.d.ts +1 -3
  101. package/dist/{tailwindcss-DTV9MoJT.js → tailwindcss-B_4E52WF.js} +7 -13
  102. package/dist/{tailwindcss-9e6ZuYgS.cjs → tailwindcss-CBYjzRmV.cjs} +4 -10
  103. package/dist/{transform-BbbZvFQq.js → transform-CkEnJYIP.js} +18 -12
  104. package/dist/{transform-D21f8Dm8.cjs → transform-FkqbTBJR.cjs} +17 -11
  105. package/dist/types/index.d.ts +3 -2
  106. package/dist/uni-app-x/border-preflight.d.ts +1 -2
  107. package/dist/uni-app-x/component-local-style.d.ts +2 -1
  108. package/dist/uni-app-x/transform.d.ts +4 -2
  109. package/dist/uni-app-x/vite/author-apply.d.ts +3 -1
  110. package/dist/uni-app-x/vite/native-hmr.d.ts +1 -1
  111. package/dist/uni-app-x/vite/style-result.d.ts +5 -0
  112. package/dist/{v4-generation-core-DJBWZ_D0.cjs → v4-generation-core-Cz1D7wm1.cjs} +313 -418
  113. package/dist/vite/web.cjs +1 -1
  114. package/dist/vite/web.js +1 -1
  115. package/dist/{vite-CaH7WjX6.cjs → vite-DxuKPZlp.cjs} +565 -592
  116. package/dist/{vite-CuYntLZP.js → vite-lP35OguX.js} +558 -578
  117. package/dist/vite-web.d.ts +1 -1
  118. package/dist/vite.cjs +1 -1
  119. package/dist/vite.js +1 -1
  120. package/dist/weapp-tw-css-generation-loader.cjs +2 -2
  121. package/dist/weapp-tw-css-import-rewrite-loader.cjs +7 -7
  122. package/dist/{web-CdXkY_VO.js → web-Dfz_jpNj.js} +144 -107
  123. package/dist/{web-CYs2Kcaa.cjs → web-DhDxhlkq.cjs} +156 -107
  124. package/dist/{webpack-BnCSOUuu.js → webpack-D6jp1o3m.js} +18 -17
  125. package/dist/{webpack-BQNnpQPC.cjs → webpack-R2Sbggiy.cjs} +20 -20
  126. package/dist/webpack.cjs +1 -1
  127. package/dist/webpack.js +1 -1
  128. package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -2
  129. package/dist/wxml/utils/custom-template.d.ts +1 -1
  130. package/package.json +8 -10
  131. package/dist/final-css-cleanup-DSjczga3.cjs +0 -138
  132. package/dist/tailwindcss/v4-engine/css-import.d.ts +0 -14
  133. package/dist/uni-app-x/style-asset/source-parser.d.ts +0 -2
@@ -6,9 +6,8 @@ import fs, { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs
6
6
  import path from "node:path";
7
7
  import process from "node:process";
8
8
  import { createTailwindGenerationSession, createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveValidTailwindV4Candidates as resolveValidTailwindV4Candidates$1 } from "@tailwindcss-mangle/engine";
9
- import { analyzeTailwindCssDirectives, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss as finalizeMiniProgramCss$1, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, selectorContainsPseudoClass, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
9
+ import { analyzeTailwindCssDirectives, applyConfiguredCssCalc, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss as finalizeMiniProgramCss$1, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImport, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, isTailwindRuntimePropertyRule, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseCssImportSpecifier, parseImportSourceParam, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, quoteCssImportSpecifier, removeTailwindV4PreflightImports, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, removeUnsupportedThemeVendorKeyframes, selectorContainsPseudoClass, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
10
10
  import { LRUCache } from "lru-cache";
11
- import { TokenType, tokenize } from "@csstools/css-tokenizer";
12
11
  import { stat } from "node:fs/promises";
13
12
  import micromatch from "micromatch";
14
13
  //#region src/runtime-branch/generator-target-env.ts
@@ -316,7 +315,7 @@ async function transformTailwindV4CssToWeapp(css, options) {
316
315
  ...options
317
316
  });
318
317
  const pruneOptions = {
319
- preserveContentInit: options?.uniAppX === true && options.uniAppXCssTarget === "uvue" ? false : void 0,
318
+ ...options?.uniAppX === true && options.uniAppXCssTarget === "uvue" ? { preserveContentInit: false } : {},
320
319
  preservePreflight: true,
321
320
  preserveConditionalComments: hasCssMacroStyleOptions(options)
322
321
  };
@@ -334,48 +333,8 @@ function transformTailwindV4WebRpxCss(css) {
334
333
  async function transformTailwindV4CssByTarget(css, target, options) {
335
334
  if (target === "weapp") return transformTailwindV4CssToWeapp(css, options);
336
335
  const resolvedWebCss = await (hasCssMacroStyleOptions(options) ? transformCssMacroCss(css, options) : css);
337
- return shouldUseUniAppWebRpxCompatibility(options?.appType) ? transformTailwindV4WebRpxCss(resolvedWebCss) : resolvedWebCss;
338
- }
339
- //#endregion
340
- //#region src/tailwindcss/v4-engine/css-import.ts
341
- function parseCssImportSpecifier(params) {
342
- const tokens = tokenize({ css: params }).filter((token) => token[0] !== TokenType.Whitespace && token[0] !== TokenType.Comment);
343
- const first = tokens[0];
344
- if (!first) return;
345
- if (first[0] === TokenType.String || first[0] === TokenType.URL) return {
346
- specifier: first[4].value,
347
- raw: first[1],
348
- quote: first[0] === TokenType.String ? first[1][0] : void 0
349
- };
350
- if (first[0] === TokenType.Function && first[4].value.toLowerCase() === "url" && tokens[1]?.[0] === TokenType.String && tokens[2]?.[0] === TokenType.CloseParen) return {
351
- specifier: tokens[1][4].value,
352
- raw: params.slice(first[2], tokens[2][3] + 1),
353
- quote: tokens[1][1][0]
354
- };
355
- }
356
- function quoteCssImportSpecifier(file, quote = "\"") {
357
- return `${quote}${(path.sep === "\\" || /^[a-z]:[\\/]|^\\\\/i.test(file) ? file.replaceAll("\\", "/") : file).replaceAll("\\", "\\\\").replaceAll(quote, `\\${quote}`).replaceAll("\n", "\\a ").replaceAll("\r", "\\d ")}${quote}`;
358
- }
359
- function isTailwindCssImport(params) {
360
- const specifier = parseCssImportSpecifier(params)?.specifier;
361
- if (!specifier) return false;
362
- if (specifier === "tailwindcss" || specifier.startsWith("tailwindcss/")) return true;
363
- const paths = specifier.includes("\\") ? path.win32 : path.posix;
364
- return paths.basename(specifier) === "index.css" && paths.basename(paths.dirname(specifier)) === "tailwindcss";
365
- }
366
- function parseImportSourceParam(params) {
367
- const tokens = tokenize({ css: params }).filter((token) => token[0] !== TokenType.Whitespace && token[0] !== TokenType.Comment);
368
- const index = tokens.findIndex((token) => token[0] === TokenType.Function && token[4].value === "source");
369
- const value = tokens[index + 1];
370
- if (index < 0 || tokens[index + 2]?.[0] !== TokenType.CloseParen) return;
371
- if (value?.[0] === TokenType.Ident && value[4].value === "none") return {
372
- none: true,
373
- sourcePath: void 0
374
- };
375
- return value?.[0] === TokenType.String ? {
376
- none: false,
377
- sourcePath: value[4].value
378
- } : void 0;
336
+ const calculatedWebCss = await applyConfiguredCssCalc(resolvedWebCss, options ?? {});
337
+ return shouldUseUniAppWebRpxCompatibility(options?.appType) ? transformTailwindV4WebRpxCss(calculatedWebCss) : calculatedWebCss;
379
338
  }
380
339
  //#endregion
381
340
  //#region src/tailwindcss/v4-engine/tailwind-v4-default-colors.ts
@@ -799,58 +758,10 @@ function applyMiniProgramTailwindV4DefaultColorCss(css, source) {
799
758
  if (insertionIndex === 0) return `${themeCss}\n${css}`;
800
759
  return `${css.slice(0, insertionIndex)}\n${themeCss}\n${css.slice(insertionIndex)}`;
801
760
  }
802
- function isTailwindCssPreflightImport(params) {
803
- const specifier = parseCssImportSpecifier(params)?.specifier;
804
- return specifier === "tailwindcss/preflight.css" || specifier === "tailwindcss/preflight";
805
- }
806
- function removeTailwindV4PreflightImports(css) {
807
- if (!css.includes("preflight")) return css;
808
- let root;
809
- try {
810
- root = postcss.parse(css);
811
- } catch {
812
- return css;
813
- }
814
- let changed = false;
815
- root.walkAtRules("import", (rule) => {
816
- if (isTailwindCssPreflightImport(rule.params)) {
817
- rule.remove();
818
- changed = true;
819
- }
820
- });
821
- return changed ? root.toString() : css;
822
- }
823
- function hasThemeParent(rule) {
824
- let parent = rule.parent;
825
- while (parent) {
826
- if (parent.type === "atrule" && parent.name === "theme") return true;
827
- parent = parent.parent;
828
- }
829
- return false;
830
- }
831
- function isVendorPrefixedKeyframes(rule) {
832
- return rule.name.startsWith("-") && rule.name.endsWith("keyframes");
833
- }
834
- function removeUnsupportedThemeVendorKeyframes(css) {
835
- if (!css.includes("@theme") || !css.includes("@-")) return css;
836
- let root;
837
- try {
838
- root = postcss.parse(css);
839
- } catch {
840
- return css;
841
- }
842
- let changed = false;
843
- root.walkAtRules((rule) => {
844
- if (isVendorPrefixedKeyframes(rule) && hasThemeParent(rule)) {
845
- rule.remove();
846
- changed = true;
847
- }
848
- });
849
- return changed ? root.toString() : css;
850
- }
851
761
  function createCompatibleSource(source, target) {
852
762
  const filteredSourceCss = target === "weapp" ? removeTailwindV4PreflightImports(source.css) : source.css;
853
- const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss, source) : filteredSourceCss);
763
+ const sourceCss = target === "weapp" ? applyMiniProgramTailwindV4DefaultColorCss(filteredSourceCss, source) : filteredSourceCss;
764
+ const compatibleSourceCss = removeUnsupportedThemeVendorKeyframes(sourceCss);
854
765
  return compatibleSourceCss === source.css ? source : {
855
766
  ...source,
856
767
  css: compatibleSourceCss
@@ -1268,7 +1179,7 @@ async function resolveCssDefinedScanSources(source) {
1268
1179
  const definitions = [{
1269
1180
  css: source.css,
1270
1181
  base: source.base,
1271
- from: source.dependencies[0]
1182
+ ...source.dependencies[0] === void 0 ? {} : { from: source.dependencies[0] }
1272
1183
  }];
1273
1184
  for (const dependency of source.dependencies.slice(1)) {
1274
1185
  if (!existsSync(dependency)) continue;
@@ -1296,20 +1207,14 @@ async function resolveCssDefinedScanSources(source) {
1296
1207
  });
1297
1208
  sourcePatterns.push(...await resolveCssSourceEntries(root, definition.base, "**/*"));
1298
1209
  }
1299
- if (!importSourceBase) {
1300
- if (sourcePatterns.length > 0) return [...normalizeCssDefinedScanSources(source.base, sourcePatterns), ...createDefaultIgnoredScanSources(source.base)];
1301
- if (hasSourceNone) return false;
1302
- if (hasTailwindImport) {
1303
- const defaultBase = resolveDefaultSourceBase(source);
1304
- return [await resolveTailwindSourceEntry(".", defaultBase, false, "**/*"), ...createDefaultIgnoredScanSources(defaultBase)];
1305
- }
1306
- return;
1307
- }
1308
- return [
1309
- await resolveTailwindSourceEntry(".", importSourceBase, false, "**/*"),
1310
- ...sourcePatterns,
1311
- ...createDefaultIgnoredScanSources(importSourceBase)
1312
- ];
1210
+ let entries;
1211
+ if (importSourceBase) entries = [await resolveTailwindSourceEntry(".", importSourceBase, false, "**/*"), ...sourcePatterns];
1212
+ else if (sourcePatterns.length > 0) entries = normalizeCssDefinedScanSources(source.base, sourcePatterns);
1213
+ else if (hasSourceNone) return false;
1214
+ else if (hasTailwindImport) entries = [await resolveTailwindSourceEntry(".", resolveDefaultSourceBase(source), false, "**/*")];
1215
+ else return;
1216
+ const scanBases = /* @__PURE__ */ new Set([importSourceBase ?? (sourcePatterns.length > 0 ? source.base : resolveDefaultSourceBase(source)), ...entries.filter((entry) => !entry.negated).map((entry) => entry.base)]);
1217
+ return [...entries, ...[...scanBases].flatMap((base) => createDefaultIgnoredScanSources(base))];
1313
1218
  }
1314
1219
  async function resolveScanSources(source, scanSources) {
1315
1220
  if (scanSources !== true) return scanSources;
@@ -2063,8 +1968,7 @@ function createCssNodeSignature(node) {
2063
1968
  node.selector,
2064
1969
  node.nodes?.map(createCssNodeSignature) ?? null
2065
1970
  ]);
2066
- if (node.type === "comment") return JSON.stringify(["comment", node.text]);
2067
- return node.toString();
1971
+ return JSON.stringify(["comment", node.text]);
2068
1972
  }
2069
1973
  function createRuleBodySignature(rule) {
2070
1974
  return JSON.stringify(rule.nodes?.map(createCssNodeSignature) ?? []);
@@ -2072,7 +1976,7 @@ function createRuleBodySignature(rule) {
2072
1976
  function createRuleAtRuleContextSignature(rule) {
2073
1977
  const context = [];
2074
1978
  let parent = rule.parent;
2075
- while (parent && parent.type !== "root" && parent.type !== "document") {
1979
+ while (parent && parent.type !== "root") {
2076
1980
  if (parent.type === "atrule") context.unshift(JSON.stringify([parent.name, parent.params]));
2077
1981
  parent = parent.parent;
2078
1982
  }
@@ -2266,6 +2170,7 @@ function filterApplyOnlyGeneratedCss(css, source, options = {}) {
2266
2170
  });
2267
2171
  });
2268
2172
  const isVariableRule = rule.nodes?.some((node) => node.type === "decl" && node.prop.startsWith("--"));
2173
+ if (options.preserveRuntimeProperties && isTailwindRuntimePropertyRule(rule)) return;
2269
2174
  if (!isApplySelector && (!preserveVariables || !isVariableRule)) rule.remove();
2270
2175
  });
2271
2176
  root.walkAtRules((rule) => {
@@ -2348,9 +2253,38 @@ function isTailwindGeneratedThemeScopeSelector(selector) {
2348
2253
  if (!selectors.every((item) => TAILWIND_GENERATED_THEME_SCOPE_SELECTORS.has(item))) return false;
2349
2254
  return selectorSet.size === 2 && selectorSet.has(":root") && selectorSet.has(":host") || selectorSet.size === 4 && selectorSet.has(":host") && selectorSet.has("page") && selectorSet.has(".tw-root") && selectorSet.has("wx-root-portal-content");
2350
2255
  }
2351
- function isTailwindGeneratedThemeRule(selector, node) {
2352
- if (!isTailwindGeneratedThemeScopeSelector(selector)) return false;
2353
- return node.nodes?.some((child) => child.type === "decl" && /^--(?:color|spacing|text|font|default|radius|tw-)/.test(child.prop)) ?? false;
2256
+ function themeDeclarationContext(declaration) {
2257
+ const context = [];
2258
+ let parent = declaration.parent?.parent;
2259
+ while (parent && parent.type !== "root") {
2260
+ if (parent.type === "atrule" && parent.name !== "layer") context.unshift(`@${parent.name} ${parent.params}`);
2261
+ parent = parent.parent;
2262
+ }
2263
+ return context;
2264
+ }
2265
+ function themeDeclarationKey(declaration) {
2266
+ const value = declaration.value.trim().replace(/^(-?)0\.(\d+(?:[a-z]+|%)?)$/i, "$1.$2");
2267
+ return JSON.stringify([
2268
+ themeDeclarationContext(declaration),
2269
+ declaration.prop,
2270
+ value,
2271
+ Boolean(declaration.important)
2272
+ ]);
2273
+ }
2274
+ function collectGeneratedThemeDeclarations(source) {
2275
+ const declarations = /* @__PURE__ */ new Set();
2276
+ try {
2277
+ postcss.parse(source).walkRules((rule) => {
2278
+ if (!isTailwindGeneratedThemeScopeSelector(rule.selector.replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").trim())) return;
2279
+ for (const child of rule.nodes ?? []) if (child.type === "decl") declarations.add(themeDeclarationKey(child));
2280
+ });
2281
+ } catch {}
2282
+ return declarations;
2283
+ }
2284
+ /** 同一轮框架恢复共享声明索引;只有遇到根变量时才解析生成产物。 */
2285
+ function createGeneratedThemeDeclarationResolver(source) {
2286
+ let declarations;
2287
+ return () => declarations ?? (declarations = collectGeneratedThemeDeclarations(source));
2354
2288
  }
2355
2289
  function isTailwindGeneratedPreflightRule(selector, node) {
2356
2290
  if (selector === "view,text,::after,::before" || selector === "view, text, ::after, ::before" || selector === "*" || selector === "::after" || selector === "::before" || selector === "::backdrop" || selector === ":host" || selector === "[hidden]:not([hidden=\"until-found\"])" || selector === "[hidden]:not([hidden='until-found'])" || selector === "button,input[type=\"button\"],input[type=\"reset\"],input[type=\"submit\"]" || selector === "button, input[type=\"button\"], input[type=\"reset\"], input[type=\"submit\"]" || selector === "button,input[type='button'],input[type='reset'],input[type='submit']" || selector === "button, input[type='button'], input[type='reset'], input[type='submit']") return true;
@@ -2358,7 +2292,7 @@ function isTailwindGeneratedPreflightRule(selector, node) {
2358
2292
  if (selector === ":host") return node.nodes?.some((child) => child.type === "decl" && child.value?.includes("--theme(")) ?? false;
2359
2293
  return false;
2360
2294
  }
2361
- function removeTailwindV4GeneratedUserCssArtifacts(source) {
2295
+ function removeTailwindV4GeneratedUserCssArtifacts(source, generatedSource) {
2362
2296
  try {
2363
2297
  const root = postcss.parse(source);
2364
2298
  let changed = false;
@@ -2367,9 +2301,27 @@ function removeTailwindV4GeneratedUserCssArtifacts(source) {
2367
2301
  comment.remove();
2368
2302
  changed = true;
2369
2303
  });
2304
+ let generatedDeclarations;
2305
+ const overriddenProperties = /* @__PURE__ */ new Set();
2370
2306
  root.walkRules((rule) => {
2371
- const selector = rule.selector.replace(/\s+/g, " ").trim();
2372
- if (isTailwindGeneratedThemeRule(selector, rule) || isTailwindGeneratedPreflightRule(selector, rule)) {
2307
+ const selector = rule.selector.replace(/\s+/g, " ").replace(/\s*,\s*/g, ",").trim();
2308
+ if (isTailwindGeneratedThemeScopeSelector(selector) || TAILWIND_GENERATED_THEME_SCOPE_SELECTORS.has(selector) && rule.nodes.some((child) => child.type === "decl" && child.prop.startsWith("--"))) {
2309
+ generatedDeclarations ?? (generatedDeclarations = typeof generatedSource === "function" ? generatedSource() : generatedSource ? collectGeneratedThemeDeclarations(generatedSource) : /* @__PURE__ */ new Set());
2310
+ for (const child of [...rule.nodes]) {
2311
+ if (child.type !== "decl") continue;
2312
+ const propertyKey = JSON.stringify([themeDeclarationContext(child), child.prop]);
2313
+ if (generatedDeclarations?.has(themeDeclarationKey(child)) && !overriddenProperties.has(propertyKey)) {
2314
+ child.remove();
2315
+ changed = true;
2316
+ } else overriddenProperties.add(propertyKey);
2317
+ }
2318
+ if (rule.nodes.length === 0) {
2319
+ rule.remove();
2320
+ changed = true;
2321
+ }
2322
+ return;
2323
+ }
2324
+ if (isTailwindGeneratedPreflightRule(selector, rule)) {
2373
2325
  rule.remove();
2374
2326
  changed = true;
2375
2327
  }
@@ -2633,16 +2585,37 @@ function unwrapMiniProgramCascadeLayers(source) {
2633
2585
  function hasClassSelector(selector) {
2634
2586
  return /(?:^|[^\w-])\.[_a-z\u00A0-\uFFFF\\-]/i.test(selector);
2635
2587
  }
2636
- function collectBareSelectorUserCss(source) {
2588
+ function collectBareSelectorUserCss(source, transformedCss) {
2637
2589
  try {
2638
2590
  const root = postcss.parse(source);
2591
+ const representedSelectors = /* @__PURE__ */ new Set();
2592
+ const rootSelectors = /* @__PURE__ */ new Set([
2593
+ ":root",
2594
+ ":host",
2595
+ "page",
2596
+ ".tw-root",
2597
+ "wx-root-portal-content"
2598
+ ]);
2599
+ const selectorKey = (rule, selector) => {
2600
+ const context = [];
2601
+ let parent = rule.parent;
2602
+ while (parent && parent.type !== "root") {
2603
+ if (parent.type === "atrule") context.unshift(`@${parent.name} ${parent.params}`);
2604
+ parent = parent.parent;
2605
+ }
2606
+ return JSON.stringify([...context, rootSelectors.has(selector.trim()) ? ":root" : selector.trim()]);
2607
+ };
2608
+ if (transformedCss !== void 0) postcss.parse(transformedCss).walkRules((rule) => {
2609
+ for (const selector of rule.selectors) representedSelectors.add(selectorKey(rule, selector));
2610
+ });
2639
2611
  let changed = false;
2640
2612
  root.walkAtRules("import", (rule) => {
2641
2613
  rule.remove();
2642
2614
  changed = true;
2643
2615
  });
2644
2616
  root.walkRules((rule) => {
2645
- if ((rule.selectors?.length ? rule.selectors : [rule.selector]).some((selector) => hasClassSelector(selector))) {
2617
+ const selectors = rule.selectors?.length ? rule.selectors : [rule.selector];
2618
+ if (selectors.some((selector) => hasClassSelector(selector)) || selectors.every((selector) => representedSelectors.has(selectorKey(rule, selector)))) {
2646
2619
  rule.remove();
2647
2620
  changed = true;
2648
2621
  }
@@ -2688,22 +2661,30 @@ function stripUnmatchedTailwindSourceMediaCloseFragments(source) {
2688
2661
  //#region src/bundlers/shared/generator-css/user-css/transform.ts
2689
2662
  async function transformGeneratorUserCss(source, options) {
2690
2663
  if (source.trim().length === 0) return "";
2691
- if (options.processed) return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(unwrapMiniProgramCascadeLayers(removeProcessedMiniProgramUnsupportedCss(source, {
2692
- ...options.generatorStyleOptions,
2693
- ...options.cssUserHandlerOptions
2694
- }))) : source)));
2664
+ if (options.processed) {
2665
+ const compiledSource = await options.compileAuthorCssFunctions?.(source) ?? source;
2666
+ return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(unwrapMiniProgramCascadeLayers(removeProcessedMiniProgramUnsupportedCss(compiledSource, {
2667
+ ...options.generatorStyleOptions,
2668
+ ...options.cssUserHandlerOptions
2669
+ })), options.generatedSource) : compiledSource)));
2670
+ }
2695
2671
  const cleanedSource = removeTailwindSourceDirectives(removeTailwindV4GeneratorAtRules(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(source))), { importFallback: options.importFallback });
2696
2672
  if (cleanedSource.trim().length === 0) return "";
2697
- const userSource = stripUnmatchedTailwindSourceMediaCloseFragments(removeTailwindApplyAtRules(removeTailwindSourceDirectives(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(removeUnsupportedMiniProgramAtRules(unwrapMiniProgramCascadeLayers(cleanedSource))) : cleanedSource)), { importFallback: options.importFallback })));
2673
+ const authorSource = stripUnmatchedTailwindSourceMediaCloseFragments(removeTailwindApplyAtRules(removeTailwindSourceDirectives(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(removeUnsupportedMiniProgramAtRules(unwrapMiniProgramCascadeLayers(stripTailwindBanners(cleanedSource))), options.generatedSource) : cleanedSource)), { importFallback: options.importFallback })));
2674
+ const userSource = await options.compileAuthorCssFunctions?.(authorSource) ?? authorSource;
2698
2675
  if (userSource.trim().length === 0) return "";
2699
2676
  if (isCommentOnlyCss(userSource)) return userSource;
2700
- if (options.generatorTarget !== "weapp") return userSource;
2677
+ if (options.generatorTarget !== "weapp") return applyConfiguredCssCalc(userSource, {
2678
+ cssCalc: options.generatorStyleOptions.cssOptions?.cssCalc ?? options.generatorStyleOptions.cssCalc ?? options.cssUserHandlerOptions.cssOptions?.cssCalc ?? options.cssUserHandlerOptions.cssCalc,
2679
+ customPropertyValues: options.generatorStyleOptions.customPropertyValues ?? options.cssUserHandlerOptions.customPropertyValues,
2680
+ contextCss: typeof options.generatedSource === "string" ? options.generatedSource : void 0
2681
+ });
2701
2682
  const { css } = await options.styleHandler(userSource, {
2702
2683
  ...options.generatorStyleOptions,
2703
2684
  ...options.cssUserHandlerOptions
2704
2685
  });
2705
- const transformedCss = removeTailwindV4GeneratedUserCssArtifacts(removeUnsupportedMiniProgramAtRules(css));
2706
- const bareSelectorUserCss = collectBareSelectorUserCss(userSource);
2686
+ const transformedCss = removeTailwindV4GeneratedUserCssArtifacts(removeUnsupportedMiniProgramAtRules(stripTailwindBanners(css)), options.generatedSource);
2687
+ const bareSelectorUserCss = collectBareSelectorUserCss(userSource, transformedCss);
2707
2688
  const missingBareSelectorUserCss = bareSelectorUserCss.trim().length > 0 ? filterExistingCssRules(transformedCss, bareSelectorUserCss) : "";
2708
2689
  return missingBareSelectorUserCss.trim().length > 0 ? `${transformedCss}\n${missingBareSelectorUserCss}` : transformedCss;
2709
2690
  }
@@ -2737,6 +2718,11 @@ function normalizeExtendLengthUnits(value) {
2737
2718
  function normalizeTailwindcssRuntimeOptions(options) {
2738
2719
  return options;
2739
2720
  }
2721
+ /** 清除可选字段中的 undefined,再交给引擎候选校验与生成契约。 */
2722
+ function resolveRuntimeBareArbitraryValues(options) {
2723
+ const value = resolveTailwindcssOptions(options)?.v4?.bareArbitraryValues;
2724
+ return value && typeof value === "object" ? value.units === void 0 ? {} : { units: value.units } : value;
2725
+ }
2740
2726
  //#endregion
2741
2727
  //#region src/utils/object.ts
2742
2728
  function definedEntries(value) {
@@ -3354,4 +3340,4 @@ async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
3354
3340
  return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
3355
3341
  }
3356
3342
  //#endregion
3357
- export { hasTailwindRootDirectives as $, resolveBooleanObjectOption as A, resolveTailwindV4CssSourceBase as At, removeUnsupportedMiniProgramAtRules as B, shouldUseUniAppWebRpxCompatibility as Bt, findWorkspacePackageDir as C, expandTailwindSourceEntries as Ct, normalizeTailwindcssRuntimeOptions as D, parseConfigParam as Dt, normalizeExtendLengthUnits as E, normalizeLegacyContentEntries as Et, stripTailwindSourceMediaFragments as F, transformTailwindV4CssByTarget as Ft, shouldFilterApplyOnlyGeneratedCss as G, removeTailwindV4GeneratedUserCssArtifacts as H, resolveValidTailwindV4Candidates$1 as Ht, stripUnmatchedTailwindSourceMediaCloseFragments as I, transformTailwindV4CssToWeapp as It, splitUserCssLayerBlocks as J, extractGeneratedCssForUserLayerSelectors as K, finalizeMiniProgramCss$1 as L, resolveCssMacroTailwindV4Source as Lt, isCommentOnlyCss as M, _defineProperty as Mt, removeMiniProgramInteractiveSelectors as N, parseCssImportSpecifier as Nt, resolveTailwindcssOptions as O, resolveCssSourceEntries as Ot, removeTailwindV4GeneratorAtRules as P, quoteCssImportSpecifier as Pt, hasTailwindNonRootGenerationDirectives as Q, hasMiniProgramCssSpecificityPlaceholders as R, getTailwindV4IncrementalGenerateCacheStats as Rt, findNearestPackageRoot as S, FULL_SOURCE_SCAN_PATTERN as St, omitUndefined as T, isFileMatchedByTailwindSourceEntries as Tt, filterApplyOnlyGeneratedCss as U, stripMiniProgramCssSpecificityPlaceholders as V, loadTailwindV4DesignSystem as Vt, normalizeEmptyTailwindCustomVariants as W, hasLocalCssImport as X, preferScopedGeneratedCssRules as Y, hasTailwindApplyDirective as Z, upsertTailwindV4CssSource as _, stripTailwindBanners as _t, resolveGeneratorRuntimeBranch as a, removeTailwindSourceDirectives as at, isTailwindV4CssEntry as b, createTailwindV4Engine$1 as bt, shouldUseNativeAppCssBranch as c, VITE_MARKER_RE as ct, resolveTailwindV4SourceFromRuntime as d, hasTailwindGeneratedCssMarkers as dt, hasTailwindSourceDirectives as et, resolveTailwindV4SourceFromRuntimeOptions as f, splitGeneratorPlaceholderCssBySourceOrder as ft, removeTailwindV4CssSource as g, stripTailwindBanner as gt, hasConfiguredTailwindV4CssRoots as h, stripGeneratorPlaceholderMarkers as ht, normalizeWeappTailwindcssGeneratorOptions as i, parseImportRequest as it, transformGeneratorUserCss as j, toPosixPath as jt, normalizeStringListOption as k, resolveSourceScanPath as kt, resolveUniUtsPlatform as l, createCssAppend as lt, filterTailwindV4CssSourceRoots as m, splitTailwindV4GeneratedCssBySourceOrder as mt, createWeappTailwindcssGeneratorFromRuntime as n, normalizeTailwindSourceDirectives as nt, resolveRuntimeBranch as o, resolveCssEntrySource as ot, resolveTailwindV4SourceOptionsFromRuntime as p, splitTailwindGeneratedCssByBanner as pt, hasUserCssLayerBlocks as q, resolveTailwindSourceFromRuntime as r, normalizeTailwindSourceForGenerator as rt, shouldUseMiniProgramCssBranch as s, GENERATOR_PLACEHOLDER_MARKER_RE as st, createWeappTailwindcssGenerator as t, normalizeTailwindConfigDirectives as tt, resolveTailwindV4Source$1 as u, hasTailwindGeneratedCss as ut, groupCssEntriesByBase as v, normalizeConfigDirective as vt, findWorkspaceRoot as w, isFileExcludedByTailwindSourceEntries as wt, normalizeCssEntries as x, FULL_SOURCE_SCAN_EXTENSION_RE as xt, guessBasedirFromEntries as y, prependConfigDirective as yt, pruneMiniProgramGeneratedCss as z, filterUnsupportedMiniProgramTailwindV4Candidates as zt };
3343
+ export { hasTailwindApplyDirective as $, normalizeStringListOption as A, resolveCssSourceEntries as At, pruneMiniProgramGeneratedCss as B, shouldUseUniAppWebRpxCompatibility as Bt, findWorkspacePackageDir as C, FULL_SOURCE_SCAN_EXTENSION_RE as Ct, normalizeTailwindcssRuntimeOptions as D, isFileMatchedByTailwindSourceEntries as Dt, normalizeExtendLengthUnits as E, isFileExcludedByTailwindSourceEntries as Et, removeTailwindV4GeneratorAtRules as F, transformTailwindV4CssByTarget as Ft, filterApplyOnlyGeneratedCss as G, stripMiniProgramCssSpecificityPlaceholders as H, resolveValidTailwindV4Candidates$1 as Ht, stripTailwindSourceMediaFragments as I, transformTailwindV4CssToWeapp as It, extractGeneratedCssForUserLayerSelectors as J, normalizeEmptyTailwindCustomVariants as K, stripUnmatchedTailwindSourceMediaCloseFragments as L, resolveCssMacroTailwindV4Source as Lt, transformGeneratorUserCss as M, resolveTailwindV4CssSourceBase as Mt, isCommentOnlyCss as N, toPosixPath as Nt, resolveRuntimeBareArbitraryValues as O, normalizeLegacyContentEntries as Ot, removeMiniProgramInteractiveSelectors as P, _defineProperty as Pt, hasLocalCssImport as Q, finalizeMiniProgramCss$1 as R, getTailwindV4IncrementalGenerateCacheStats as Rt, findNearestPackageRoot as S, createTailwindV4Engine$1 as St, omitUndefined as T, expandTailwindSourceEntries as Tt, createGeneratedThemeDeclarationResolver as U, removeUnsupportedMiniProgramAtRules as V, loadTailwindV4DesignSystem as Vt, removeTailwindV4GeneratedUserCssArtifacts as W, splitUserCssLayerBlocks as X, hasUserCssLayerBlocks as Y, preferScopedGeneratedCssRules as Z, upsertTailwindV4CssSource as _, stripGeneratorPlaceholderMarkers as _t, resolveGeneratorRuntimeBranch as a, normalizeTailwindSourceForGenerator as at, isTailwindV4CssEntry as b, normalizeConfigDirective as bt, shouldUseNativeAppCssBranch as c, resolveCssEntrySource as ct, resolveTailwindV4SourceFromRuntime as d, createCssAppend as dt, hasTailwindNonRootGenerationDirectives as et, resolveTailwindV4SourceFromRuntimeOptions as f, hasTailwindGeneratedCss as ft, removeTailwindV4CssSource as g, splitTailwindV4GeneratedCssBySourceOrder as gt, hasConfiguredTailwindV4CssRoots as h, splitTailwindGeneratedCssByBanner as ht, normalizeWeappTailwindcssGeneratorOptions as i, normalizeTailwindSourceDirectives as it, resolveBooleanObjectOption as j, resolveSourceScanPath as jt, resolveTailwindcssOptions as k, parseConfigParam as kt, resolveUniUtsPlatform as l, GENERATOR_PLACEHOLDER_MARKER_RE as lt, filterTailwindV4CssSourceRoots as m, splitGeneratorPlaceholderCssBySourceOrder as mt, createWeappTailwindcssGeneratorFromRuntime as n, hasTailwindSourceDirectives as nt, resolveRuntimeBranch as o, parseImportRequest as ot, resolveTailwindV4SourceOptionsFromRuntime as p, hasTailwindGeneratedCssMarkers as pt, shouldFilterApplyOnlyGeneratedCss as q, resolveTailwindSourceFromRuntime as r, normalizeTailwindConfigDirectives as rt, shouldUseMiniProgramCssBranch as s, removeTailwindSourceDirectives as st, createWeappTailwindcssGenerator as t, hasTailwindRootDirectives as tt, resolveTailwindV4Source$1 as u, VITE_MARKER_RE as ut, groupCssEntriesByBase as v, stripTailwindBanner as vt, findWorkspaceRoot as w, FULL_SOURCE_SCAN_PATTERN as wt, normalizeCssEntries as x, prependConfigDirective as xt, guessBasedirFromEntries as y, stripTailwindBanners as yt, hasMiniProgramCssSpecificityPlaceholders as z, filterUnsupportedMiniProgramTailwindV4Candidates as zt };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_generator = require("./generator-BdSIvFEO.cjs");
2
+ const require_generator = require("./generator-Bvr4WmuF.cjs");
3
3
  let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
4
4
  exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
5
5
  exports.createWeappTailwindcssGeneratorFromRuntime = require_generator.createWeappTailwindcssGeneratorFromRuntime;
package/dist/generator.js CHANGED
@@ -1,2 +1,2 @@
1
- import { Ft as transformTailwindV4CssByTarget, It as transformTailwindV4CssToWeapp, Vt as loadTailwindV4DesignSystem, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-CAOx1Sqm.js";
1
+ import { Ft as transformTailwindV4CssByTarget, It as transformTailwindV4CssToWeapp, Vt as loadTailwindV4DesignSystem, d as resolveTailwindV4SourceFromRuntime, f as resolveTailwindV4SourceFromRuntimeOptions, i as normalizeWeappTailwindcssGeneratorOptions, n as createWeappTailwindcssGeneratorFromRuntime, p as resolveTailwindV4SourceOptionsFromRuntime, r as resolveTailwindSourceFromRuntime, t as createWeappTailwindcssGenerator, u as resolveTailwindV4Source } from "./generator-C0BJjyLM.js";
2
2
  export { createWeappTailwindcssGenerator, createWeappTailwindcssGeneratorFromRuntime, loadTailwindV4DesignSystem, normalizeWeappTailwindcssGeneratorOptions, resolveTailwindSourceFromRuntime, resolveTailwindV4Source, resolveTailwindV4SourceFromRuntime, resolveTailwindV4SourceFromRuntimeOptions, resolveTailwindV4SourceOptionsFromRuntime, transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp };
@@ -1,12 +1,12 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-Ctb5zv51.cjs");
2
- const require_generator = require("./generator-BdSIvFEO.cjs");
3
- const require_tailwindcss = require("./tailwindcss-9e6ZuYgS.cjs");
4
- const require_v4_generation_core = require("./v4-generation-core-DJBWZ_D0.cjs");
5
- const require_compiler = require("./compiler-Cc0JXfbw.cjs");
2
+ const require_generator = require("./generator-Bvr4WmuF.cjs");
3
+ const require_tailwindcss = require("./tailwindcss-CBYjzRmV.cjs");
4
+ const require_v4_generation_core = require("./v4-generation-core-Cz1D7wm1.cjs");
5
+ const require_compiler = require("./compiler-C8FqI-P3.cjs");
6
6
  const require_runtime_state = require("./runtime-state-XYSycuGu.cjs");
7
7
  const require_cache = require("./cache-CBJFB1HN.cjs");
8
- const require_hmr_timing = require("./hmr-timing-qpX410qU.cjs");
9
- const require_final_css_cleanup = require("./final-css-cleanup-DSjczga3.cjs");
8
+ const require_hmr_timing = require("./hmr-timing-CoiJIqDu.cjs");
9
+ require("./final-css-cleanup-CDTmVAye.cjs");
10
10
  let node_fs = require("node:fs");
11
11
  node_fs = require_rolldown_runtime.__toESM(node_fs, 1);
12
12
  let node_path = require("node:path");
@@ -262,7 +262,7 @@ function createGulpFileTransforms(context) {
262
262
  const generatedCss = stage === "generate" && generated ? `${require_v4_generation_core.createBundlerGeneratedCssMarker("gulp", file.path)}\n${css}` : css;
263
263
  const outputCss = stage === "generate" ? generatedCss : (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(generatedCss, { styleOutputExtension });
264
264
  debug("css handle: %s", file.path);
265
- return { result: stage === "transform" ? require_final_css_cleanup.finalizeMiniProgramCssStructure(outputCss) : outputCss };
265
+ return { result: stage === "transform" ? (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCssStructure)(outputCss) : outputCss };
266
266
  }
267
267
  });
268
268
  rememberGulpProcessCacheKey(gulpProcessCacheKeys, file.path);
@@ -286,7 +286,7 @@ function createGulpFileTransforms(context) {
286
286
  styleOptions: cssHandlerOptions
287
287
  }) : handled.css;
288
288
  const outputCss = (0, _weapp_tailwindcss_postcss.rewriteLocalCssImportRequestsForOutput)(finalized, { styleOutputExtension });
289
- writeGulpFileAsset(file, require_final_css_cleanup.finalizeMiniProgramCssStructure(outputCss));
289
+ writeGulpFileAsset(file, (0, _weapp_tailwindcss_postcss.finalizeMiniProgramCssStructure)(outputCss));
290
290
  debug("css adapt: %s", file.path);
291
291
  }, () => resolveGulpTransformTimingDetails("css:adapt"));
292
292
  const transformJs = (options = {}) => createVinylTransform("js", async (file) => {
@@ -1,8 +1,8 @@
1
- import { $ as hasTailwindRootDirectives, Rt as getTailwindV4IncrementalGenerateCacheStats, _ as upsertTailwindV4CssSource, g as removeTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, rt as normalizeTailwindSourceForGenerator, tt as normalizeTailwindConfigDirectives, yt as prependConfigDirective } from "./generator-CAOx1Sqm.js";
2
- import { f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-DTV9MoJT.js";
3
- import { A as createCssSourceTraceCacheSignature, B as createSourceCandidateCollector, E as hasBundlerGeneratedCssMarker, L as rewriteLocalCssImportRequestsForOutput, N as createRuntimeClassSetManager, O as stripBundlerGeneratedCssMarkers, R as splitLocalCssImports, T as createBundlerGeneratedCssMarker, b as finalizeMiniProgramGeneratorCss, j as createCssTokenSourceMap, k as annotateCssSourceTrace, n as emitHmrTiming, r as generateTailwindV4Css, z as finalizeCompilerShadowRun } from "./hmr-timing-wAt0LavM.js";
4
- import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, M as invalidateCompilationScope, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, a as beginCompilerShadowRun, c as getCompilerShadowRunSnapshot, f as getCompilerContext, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-D_vxtEdw.js";
5
- import { i as buildRuntimeCompilationSnapshot, l as updateRuntimeCompilationBuildState, o as createRuntimeCompilationBuildState, r as processCachedTask, s as removeRuntimeCompilationBuildStateFiles, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-B0HUBtiE.js";
1
+ import { Rt as getTailwindV4IncrementalGenerateCacheStats, _ as upsertTailwindV4CssSource, at as normalizeTailwindSourceForGenerator, g as removeTailwindV4CssSource, h as hasConfiguredTailwindV4CssRoots, rt as normalizeTailwindConfigDirectives, tt as hasTailwindRootDirectives, xt as prependConfigDirective } from "./generator-C0BJjyLM.js";
2
+ import { f as resolveSourceScanEntries, l as getRuntimeClassSetSignature } from "./tailwindcss-B_4E52WF.js";
3
+ import { A as annotateCssSourceTrace, B as finalizeCompilerShadowRun, D as hasBundlerGeneratedCssMarker, E as createBundlerGeneratedCssMarker, M as createCssTokenSourceMap, P as createRuntimeClassSetManager, R as rewriteLocalCssImportRequestsForOutput, V as createSourceCandidateCollector, b as finalizeMiniProgramGeneratorCss, j as createCssSourceTraceCacheSignature, k as stripBundlerGeneratedCssMarkers, n as emitHmrTiming, r as generateTailwindV4Css, z as splitLocalCssImports } from "./hmr-timing-B9Yt86-U.js";
4
+ import { C as createTailwindRuntimeReadyPromise, K as createDebug, L as createCompilationDependencyChanges, M as invalidateCompilationScope, N as recordCompilationDependencyChanges, O as AssetEmissionPlan, a as beginCompilerShadowRun, c as getCompilerShadowRunSnapshot, f as getCompilerContext, i as disposeCompilerOwner, j as getCompilationScopeDependencyRevision, n as createRuntimeAffectingSourceSignature, p as normalizeStyleHandlerMajorVersion, t as createCompilerRuntimeState, v as shouldSkipJsTransform, w as ensureRuntimeClassSet } from "./compiler-D3GBwxoa.js";
5
+ import { i as buildRuntimeCompilationSnapshot, l as updateRuntimeCompilationBuildState, o as createRuntimeCompilationBuildState, r as processCachedTask, s as removeRuntimeCompilationBuildStateFiles, t as finalizeMiniProgramCssStructure } from "./final-css-cleanup-u_sI2p56.js";
6
6
  import fs from "node:fs";
7
7
  import path from "node:path";
8
8
  import process from "node:process";
package/dist/gulp.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_gulp = require("./gulp-Dnt8VL8D.cjs");
2
+ const require_gulp = require("./gulp-BExe5RBF.cjs");
3
3
  exports.WeappTailwindcss = require_gulp.createPlugins;
4
4
  exports.createPlugins = require_gulp.createPlugins;
5
5
  exports.weappTailwindcss = require_gulp.createPlugins;
package/dist/gulp.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as createPlugins } from "./gulp-B1mPTMqw.js";
1
+ import { t as createPlugins } from "./gulp-BhkIIk7J.js";
2
2
  export { createPlugins as WeappTailwindcss, createPlugins, createPlugins as weappTailwindcss };