weapp-tailwindcss 5.0.6 → 5.0.8

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 (103) hide show
  1. package/dist/{bundle-state-CdNXQl-o.mjs → bundle-state-5FtFktJr.mjs} +2 -1
  2. package/dist/{bundle-state-CFgzVHFP.js → bundle-state-cHwTyrOS.js} +2 -1
  3. package/dist/bundlers/gulp/index.d.ts +3 -4
  4. package/dist/bundlers/gulp/module-graph.d.ts +2 -0
  5. package/dist/bundlers/gulp/runtime-snapshot.d.ts +5 -0
  6. package/dist/bundlers/gulp/vinyl-transform.d.ts +3 -0
  7. package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
  8. package/dist/bundlers/shared/css-source-trace.d.ts +20 -0
  9. package/dist/bundlers/shared/generator-css/directives/fallback.d.ts +11 -0
  10. package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +56 -0
  11. package/dist/bundlers/shared/generator-css/local-imports.d.ts +7 -0
  12. package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -1
  13. package/dist/bundlers/shared/generator-css/types.d.ts +27 -0
  14. package/dist/bundlers/shared/generator-css/user-css.d.ts +26 -0
  15. package/dist/bundlers/shared/generator-css/validate.d.ts +5 -0
  16. package/dist/bundlers/shared/generator-css.d.ts +4 -32
  17. package/dist/bundlers/vite/css-finalizer.d.ts +3 -0
  18. package/dist/bundlers/vite/generate-bundle/css-config-directives.d.ts +2 -0
  19. package/dist/bundlers/vite/generate-bundle/css-output.d.ts +14 -0
  20. package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +11 -0
  21. package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +9 -0
  22. package/dist/bundlers/vite/generate-bundle/style-matching.d.ts +5 -0
  23. package/dist/bundlers/vite/generate-bundle/subpackages.d.ts +7 -0
  24. package/dist/bundlers/vite/generate-bundle/types.d.ts +68 -0
  25. package/dist/bundlers/vite/generate-bundle.d.ts +4 -62
  26. package/dist/bundlers/vite/incremental-runtime-class-set/entries.d.ts +4 -0
  27. package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +2 -0
  28. package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +13 -0
  29. package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +1 -0
  30. package/dist/bundlers/vite/processed-css-assets/css-rules.d.ts +17 -0
  31. package/dist/bundlers/vite/processed-css-assets.d.ts +2 -0
  32. package/dist/bundlers/vite/source-candidates/scan-root.d.ts +10 -0
  33. package/dist/bundlers/vite/source-candidates/script.d.ts +7 -0
  34. package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +1 -0
  35. package/dist/bundlers/vite/source-candidates.d.ts +8 -3
  36. package/dist/bundlers/vite/source-scan/css-entries.d.ts +20 -0
  37. package/dist/bundlers/vite/source-scan/dependencies.d.ts +2 -0
  38. package/dist/bundlers/vite/source-scan.d.ts +2 -12
  39. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -0
  40. package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -20
  41. package/dist/cli.js +71 -69
  42. package/dist/cli.mjs +71 -69
  43. package/dist/core.js +1 -1
  44. package/dist/core.mjs +1 -1
  45. package/dist/{defaults-BPUuNYcD.js → defaults-Boc26eel.js} +1 -0
  46. package/dist/{defaults-8xrgzxFY.mjs → defaults-DH0ZQRhy.mjs} +1 -0
  47. package/dist/defaults.js +1 -1
  48. package/dist/defaults.mjs +1 -1
  49. package/dist/{generator-C56PJYxA.js → generator-C--TrAod.js} +1 -1
  50. package/dist/{generator-Bgn4m8An.mjs → generator-DnwUQOXB.mjs} +1 -1
  51. package/dist/generator.js +2 -2
  52. package/dist/generator.mjs +2 -2
  53. package/dist/gulp-5Tan5bHG.js +473 -0
  54. package/dist/gulp-B22YSGU_.mjs +463 -0
  55. package/dist/gulp.js +4 -414
  56. package/dist/gulp.mjs +1 -406
  57. package/dist/{incremental-runtime-class-set-Bmzdjlk0.js → hmr-timing-CscCNKb9.js} +1205 -449
  58. package/dist/{incremental-runtime-class-set-BEYHQkZc.mjs → hmr-timing-DK-mine6.mjs} +1169 -467
  59. package/dist/index.js +5 -5
  60. package/dist/index.mjs +5 -5
  61. package/dist/{postcss-BgINK7Nm.mjs → postcss-CjWuDZwL.mjs} +4 -4
  62. package/dist/{postcss-B7QNe78h.js → postcss-R5pDVHUy.js} +7 -7
  63. package/dist/postcss.js +1 -1
  64. package/dist/postcss.mjs +1 -1
  65. package/dist/{precheck-CyPbGn38.js → precheck-B8y6tDvG.js} +19 -5
  66. package/dist/{precheck-Copn2SqE.mjs → precheck-CcxTR7E_.mjs} +19 -5
  67. package/dist/presets.js +2 -2
  68. package/dist/presets.mjs +2 -2
  69. package/dist/tailwindcss/source-scan/inline-source.d.ts +7 -0
  70. package/dist/tailwindcss/source-scan.d.ts +2 -7
  71. package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +3 -0
  72. package/dist/tailwindcss/v3-engine/generator/content.d.ts +10 -0
  73. package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +2 -0
  74. package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +2 -0
  75. package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +6 -0
  76. package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +2 -0
  77. package/dist/tailwindcss/v4-engine/types.d.ts +1 -1
  78. package/dist/{tailwindcss-C0Zgo3Es.mjs → tailwindcss-0DaftXcU.mjs} +2 -2
  79. package/dist/{tailwindcss-Tw6CSVHL.js → tailwindcss-DbZ4o4m_.js} +2 -2
  80. package/dist/{transform-DgCFGtQR.mjs → transform-DRyWUN5X.mjs} +11 -2
  81. package/dist/{transform-95ivJthq.js → transform-DiW_u3eD.js} +11 -2
  82. package/dist/types/typedoc-tailwindcss-patch.d.ts +4 -2
  83. package/dist/types/user-defined-options/general.d.ts +5 -0
  84. package/dist/uni-app-x/component-local-style.d.ts +1 -0
  85. package/dist/uni-app-x/harmony.d.ts +1 -0
  86. package/dist/uni-app-x/style-asset/style-value.d.ts +16 -0
  87. package/dist/uni-app-x/style-asset.d.ts +20 -0
  88. package/dist/uni-app-x/transform.d.ts +1 -0
  89. package/dist/uni-app-x/vite.d.ts +1 -0
  90. package/dist/{v3-engine-Ji6AXPh2.mjs → v3-engine-ArQVHEau.mjs} +786 -699
  91. package/dist/{v3-engine-6FVAcrZl.js → v3-engine-DdlvXpID.js} +788 -701
  92. package/dist/{vite-Bw6LOXvf.js → vite-C_IUnDBy.js} +1797 -386
  93. package/dist/{vite-ChZ2cbn4.mjs → vite-_iUhzc4t.mjs} +1779 -369
  94. package/dist/vite.js +1 -1
  95. package/dist/vite.mjs +1 -1
  96. package/dist/weapp-tw-css-import-rewrite-loader.js +1148 -987
  97. package/dist/{webpack-CMJ7iqN7.mjs → webpack-CqnI4Ymw.mjs} +104 -37
  98. package/dist/{webpack-nn3P8_S_.js → webpack-KLoTb5Dr.js} +113 -45
  99. package/dist/webpack.js +1 -1
  100. package/dist/webpack.mjs +1 -1
  101. package/package.json +6 -5
  102. package/dist/source-candidates-BODCmzz5.mjs +0 -355
  103. package/dist/source-candidates-Caf2GDvx.js +0 -374
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_generator = require("./generator-C56PJYxA.js");
3
- const require_gulp = require("./gulp.js");
4
- const require_postcss = require("./postcss-B7QNe78h.js");
5
- const require_vite = require("./vite-Bw6LOXvf.js");
6
- const require_webpack = require("./webpack-nn3P8_S_.js");
2
+ const require_generator = require("./generator-C--TrAod.js");
3
+ const require_gulp = require("./gulp-5Tan5bHG.js");
4
+ const require_postcss = require("./postcss-R5pDVHUy.js");
5
+ const require_vite = require("./vite-C_IUnDBy.js");
6
+ const require_webpack = require("./webpack-KLoTb5Dr.js");
7
7
  let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
8
8
  exports.WeappTailwindcss = require_vite.WeappTailwindcss;
9
9
  exports.createPlugins = require_gulp.createPlugins;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { t as createWeappTailwindcssGenerator } from "./generator-Bgn4m8An.mjs";
2
- import { WeappTailwindcss as createPlugins } from "./gulp.mjs";
3
- import { t as weappTailwindcssPostcssPlugin } from "./postcss-BgINK7Nm.mjs";
4
- import { t as WeappTailwindcss } from "./vite-ChZ2cbn4.mjs";
5
- import { n as weappTailwindcssPackageDir } from "./webpack-CMJ7iqN7.mjs";
1
+ import { t as createWeappTailwindcssGenerator } from "./generator-DnwUQOXB.mjs";
2
+ import { t as createPlugins } from "./gulp-B22YSGU_.mjs";
3
+ import { t as weappTailwindcssPostcssPlugin } from "./postcss-CjWuDZwL.mjs";
4
+ import { t as WeappTailwindcss } from "./vite-_iUhzc4t.mjs";
5
+ import { n as weappTailwindcssPackageDir } from "./webpack-CqnI4Ymw.mjs";
6
6
  import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
7
7
  export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
@@ -1,6 +1,6 @@
1
- import { $ as collectCssInlineSourceCandidates, T as hasTailwindRootDirectives, Z as DEFAULT_SOURCE_SCAN_EXTENSIONS, at as resolveCssSourceEntries, dt as readInstalledPackageMajorVersion, et as createSourceScanPattern, it as parseConfigParam, rt as normalizeLegacyContentEntries, t as resolveTailwindV3Source, tt as expandTailwindSourceEntries, w as hasTailwindApplyDirective, y as resolveTailwindV4Source$1 } from "./v3-engine-Ji6AXPh2.mjs";
2
- import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-Bgn4m8An.mjs";
3
- import postcss$1 from "postcss";
1
+ import { $ as createSourceScanPattern, T as hasTailwindRootDirectives, Z as DEFAULT_SOURCE_SCAN_EXTENSIONS, ct as collectCssInlineSourceCandidates, dt as readInstalledPackageMajorVersion, et as expandTailwindSourceEntries, it as resolveCssSourceEntries, nt as normalizeLegacyContentEntries, rt as parseConfigParam, t as resolveTailwindV3Source, w as hasTailwindApplyDirective, y as resolveTailwindV4Source$1 } from "./v3-engine-ArQVHEau.mjs";
2
+ import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-DnwUQOXB.mjs";
3
+ import postcss from "postcss";
4
4
  import { extractRawCandidatesWithPositions, extractValidCandidates } from "tailwindcss-patch";
5
5
  import process from "node:process";
6
6
  import path from "node:path";
@@ -38,7 +38,7 @@ function resolvePostcssProjectRoot(result, options) {
38
38
  function replaceRootCss(root, css, result) {
39
39
  root.removeAll();
40
40
  try {
41
- const nextRoot = postcss$1.parse(css, { from: resolveInputFile(result) });
41
+ const nextRoot = postcss.parse(css, { from: resolveInputFile(result) });
42
42
  root.append(nextRoot.nodes);
43
43
  } catch {
44
44
  root.raws = { after: css };
@@ -1,8 +1,8 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_v3_engine = require("./v3-engine-6FVAcrZl.js");
3
- const require_generator = require("./generator-C56PJYxA.js");
4
- let postcss$1 = require("postcss");
5
- postcss$1 = require_chunk.__toESM(postcss$1);
2
+ const require_v3_engine = require("./v3-engine-DdlvXpID.js");
3
+ const require_generator = require("./generator-C--TrAod.js");
4
+ let postcss = require("postcss");
5
+ postcss = require_chunk.__toESM(postcss);
6
6
  let tailwindcss_patch = require("tailwindcss-patch");
7
7
  let node_process = require("node:process");
8
8
  node_process = require_chunk.__toESM(node_process);
@@ -42,7 +42,7 @@ function resolvePostcssProjectRoot(result, options) {
42
42
  function replaceRootCss(root, css, result) {
43
43
  root.removeAll();
44
44
  try {
45
- const nextRoot = postcss$1.default.parse(css, { from: resolveInputFile(result) });
45
+ const nextRoot = postcss.default.parse(css, { from: resolveInputFile(result) });
46
46
  root.append(nextRoot.nodes);
47
47
  } catch {
48
48
  root.raws = { after: css };
@@ -195,7 +195,7 @@ function normalizeSelector(selector) {
195
195
  function collectApplyOnlyCssSelectors(css) {
196
196
  const selectors = /* @__PURE__ */ new Set();
197
197
  try {
198
- postcss.parse(css).walkRules((rule) => {
198
+ postcss.default.parse(css).walkRules((rule) => {
199
199
  if (!rule.nodes?.some((node) => node.type === "atrule" && node.name === "apply")) return;
200
200
  for (const selector of rule.selectors ?? [rule.selector]) {
201
201
  const normalized = normalizeSelector(selector);
@@ -212,7 +212,7 @@ function filterApplyOnlyGeneratedCss(css, rawCss) {
212
212
  const selectors = collectApplyOnlyCssSelectors(rawCss);
213
213
  if (selectors.size === 0) return css;
214
214
  try {
215
- const root = postcss.parse(css);
215
+ const root = postcss.default.parse(css);
216
216
  root.walkRules((rule) => {
217
217
  if (!ruleMatchesApplyOnlySelector(rule, selectors) && !rule.nodes?.some((node) => node.type === "decl" && node.prop.startsWith("--"))) rule.remove();
218
218
  });
package/dist/postcss.js CHANGED
@@ -2,6 +2,6 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_postcss = require("./postcss-B7QNe78h.js");
5
+ const require_postcss = require("./postcss-R5pDVHUy.js");
6
6
  exports.default = require_postcss.weappTailwindcssPostcssPlugin;
7
7
  exports.weappTailwindcssPostcssPlugin = require_postcss.weappTailwindcssPostcssPlugin;
package/dist/postcss.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { t as weappTailwindcssPostcssPlugin } from "./postcss-BgINK7Nm.mjs";
1
+ import { t as weappTailwindcssPostcssPlugin } from "./postcss-CjWuDZwL.mjs";
2
2
  export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
@@ -1,8 +1,8 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_v3_engine = require("./v3-engine-6FVAcrZl.js");
3
- const require_defaults = require("./defaults-BPUuNYcD.js");
2
+ const require_v3_engine = require("./v3-engine-DdlvXpID.js");
3
+ const require_defaults = require("./defaults-Boc26eel.js");
4
4
  require("./utils-Dolmt8EO.js");
5
- const require_tailwindcss = require("./tailwindcss-Tw6CSVHL.js");
5
+ const require_tailwindcss = require("./tailwindcss-DbZ4o4m_.js");
6
6
  let tailwindcss_patch = require("tailwindcss-patch");
7
7
  let node_process = require("node:process");
8
8
  node_process = require_chunk.__toESM(node_process);
@@ -219,6 +219,15 @@ async function collectTailwindV4GeneratorClassSet(twPatcher) {
219
219
  return;
220
220
  }
221
221
  }
222
+ async function mergeTailwindV4GeneratorClassSet(twPatcher, classSet) {
223
+ if (twPatcher.majorVersion !== 4) return classSet;
224
+ const generatorClassSet = await collectTailwindV4GeneratorClassSet(twPatcher);
225
+ if (!generatorClassSet || generatorClassSet.size === 0) return classSet;
226
+ return new Set([...classSet, ...generatorClassSet]);
227
+ }
228
+ function canReturnExtractClassSetImmediately(twPatcher) {
229
+ return twPatcher.majorVersion !== 4;
230
+ }
222
231
  async function collectRuntimeClassSet(twPatcher, options = {}) {
223
232
  let activePatcher = twPatcher;
224
233
  if (options.force && !options.skipRefresh) {
@@ -245,8 +254,13 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
245
254
  const result = await activePatcher.extract({ write: false });
246
255
  if (result?.classSet) {
247
256
  if (result.classSet.size > 0) {
248
- debug$1("runtime class set resolved via extract(), size=%d", result.classSet.size);
249
- return result.classSet;
257
+ if (canReturnExtractClassSetImmediately(activePatcher)) {
258
+ debug$1("runtime class set resolved via extract(), size=%d", result.classSet.size);
259
+ return result.classSet;
260
+ }
261
+ const merged = await mergeTailwindV4GeneratorClassSet(activePatcher, result.classSet);
262
+ debug$1("runtime class set resolved via extract() + tailwindcss v4 source scan, extract=%d merged=%d", result.classSet.size, merged.size);
263
+ return merged;
250
264
  }
251
265
  if (preferExtract && activePatcher.majorVersion !== 4) {
252
266
  debug$1("runtime class set resolved via empty extract() on force collect, size=0");
@@ -1,7 +1,7 @@
1
- import { K as createTailwindV4Engine$1, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, gt as omitUndefined, ht as resolveBooleanObjectOption, lt as createDebug, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-Ji6AXPh2.mjs";
2
- import { a as resolveDefaultCssPreflight, i as getDefaultOptions, o as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, s as HARD_PARSE_CACHE_MAX_ENTRIES } from "./defaults-8xrgzxFY.mjs";
1
+ import { K as createTailwindV4Engine$1, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, ht as resolveBooleanObjectOption, lt as createDebug, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher, yt as omitUndefined } from "./v3-engine-ArQVHEau.mjs";
2
+ import { a as resolveDefaultCssPreflight, i as getDefaultOptions, o as DEFAULT_PARSE_CACHE_MAX_SOURCE_LENGTH, s as HARD_PARSE_CACHE_MAX_ENTRIES } from "./defaults-DH0ZQRhy.mjs";
3
3
  import { i as isMap, n as defuOverrideArray } from "./utils-DsaS975I.mjs";
4
- import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-C0Zgo3Es.mjs";
4
+ import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-0DaftXcU.mjs";
5
5
  import { splitCandidateTokens } from "tailwindcss-patch";
6
6
  import process from "node:process";
7
7
  import path from "node:path";
@@ -212,6 +212,15 @@ async function collectTailwindV4GeneratorClassSet(twPatcher) {
212
212
  return;
213
213
  }
214
214
  }
215
+ async function mergeTailwindV4GeneratorClassSet(twPatcher, classSet) {
216
+ if (twPatcher.majorVersion !== 4) return classSet;
217
+ const generatorClassSet = await collectTailwindV4GeneratorClassSet(twPatcher);
218
+ if (!generatorClassSet || generatorClassSet.size === 0) return classSet;
219
+ return new Set([...classSet, ...generatorClassSet]);
220
+ }
221
+ function canReturnExtractClassSetImmediately(twPatcher) {
222
+ return twPatcher.majorVersion !== 4;
223
+ }
215
224
  async function collectRuntimeClassSet(twPatcher, options = {}) {
216
225
  let activePatcher = twPatcher;
217
226
  if (options.force && !options.skipRefresh) {
@@ -238,8 +247,13 @@ async function collectRuntimeClassSet(twPatcher, options = {}) {
238
247
  const result = await activePatcher.extract({ write: false });
239
248
  if (result?.classSet) {
240
249
  if (result.classSet.size > 0) {
241
- debug$1("runtime class set resolved via extract(), size=%d", result.classSet.size);
242
- return result.classSet;
250
+ if (canReturnExtractClassSetImmediately(activePatcher)) {
251
+ debug$1("runtime class set resolved via extract(), size=%d", result.classSet.size);
252
+ return result.classSet;
253
+ }
254
+ const merged = await mergeTailwindV4GeneratorClassSet(activePatcher, result.classSet);
255
+ debug$1("runtime class set resolved via extract() + tailwindcss v4 source scan, extract=%d merged=%d", result.classSet.size, merged.size);
256
+ return merged;
243
257
  }
244
258
  if (preferExtract && activePatcher.majorVersion !== 4) {
245
259
  debug$1("runtime class set resolved via empty extract() on force collect, size=0");
package/dist/presets.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-emK7D4bc.js");
3
- const require_v3_engine = require("./v3-engine-6FVAcrZl.js");
3
+ const require_v3_engine = require("./v3-engine-DdlvXpID.js");
4
4
  const require_utils = require("./utils-Dolmt8EO.js");
5
- const require_tailwindcss = require("./tailwindcss-Tw6CSVHL.js");
5
+ const require_tailwindcss = require("./tailwindcss-DbZ4o4m_.js");
6
6
  require("./logger-TlKT3xmR.js");
7
7
  let node_process = require("node:process");
8
8
  node_process = require_chunk.__toESM(node_process);
package/dist/presets.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { gt as omitUndefined } from "./v3-engine-Ji6AXPh2.mjs";
1
+ import { yt as omitUndefined } from "./v3-engine-ArQVHEau.mjs";
2
2
  import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
3
- import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-C0Zgo3Es.mjs";
3
+ import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-0DaftXcU.mjs";
4
4
  import { t as logger } from "./logger-BNzxZbZj.mjs";
5
5
  import process from "node:process";
6
6
  import path from "node:path";
@@ -0,0 +1,7 @@
1
+ import type { Root } from 'postcss';
2
+ export interface TailwindInlineSourceCandidates {
3
+ included: Set<string>;
4
+ excluded: Set<string>;
5
+ }
6
+ export declare function expandInlineSourceCandidatePattern(pattern: string): string[];
7
+ export declare function collectCssInlineSourceCandidates(root: Root): TailwindInlineSourceCandidates;
@@ -1,14 +1,11 @@
1
- import type { Root } from 'postcss';
2
1
  import type { TailwindV4CssSource } from 'tailwindcss-patch';
3
2
  export interface TailwindSourceEntry {
4
3
  base: string;
5
4
  pattern: string;
6
5
  negated: boolean;
7
6
  }
8
- export interface TailwindInlineSourceCandidates {
9
- included: Set<string>;
10
- excluded: Set<string>;
11
- }
7
+ export type { TailwindInlineSourceCandidates } from './source-scan/inline-source';
8
+ export { collectCssInlineSourceCandidates, expandInlineSourceCandidatePattern } from './source-scan/inline-source';
12
9
  export declare const DEFAULT_SOURCE_SCAN_EXTENSIONS: string[];
13
10
  export declare const FULL_SOURCE_SCAN_EXTENSIONS: string[];
14
11
  export declare function createSourceScanPattern(extensions?: string[]): string;
@@ -21,8 +18,6 @@ export declare function isFileMatchedByTailwindSourceEntries(file: string, entri
21
18
  export declare function createTailwindSourceEntryMatcher(entries: TailwindSourceEntry[] | undefined): ((file: string) => boolean) | undefined;
22
19
  export declare function resolveTailwindV4CssSourceBase(source: Pick<TailwindV4CssSource, 'base' | 'file'>, fallbackBase: string): string;
23
20
  export declare function parseConfigParam(params: string): string | undefined;
24
- export declare function expandInlineSourceCandidatePattern(pattern: string): string[];
25
- export declare function collectCssInlineSourceCandidates(root: Root): TailwindInlineSourceCandidates;
26
21
  export declare function normalizeLegacyContentEntries(content: unknown, base: string, options?: {
27
22
  relativeBase?: string | undefined;
28
23
  }): TailwindSourceEntry[];
@@ -0,0 +1,3 @@
1
+ import type { IStyleHandlerOptions } from '@weapp-tailwindcss/postcss/types';
2
+ import type { TailwindV3GenerateOptions, TailwindV3GenerateTarget, TailwindV3ResolvedSource } from '../types';
3
+ export declare function createIncrementalGenerateCacheKey(source: TailwindV3ResolvedSource, target: TailwindV3GenerateTarget, styleOptions: Partial<IStyleHandlerOptions> | undefined, bareArbitraryValues: TailwindV3GenerateOptions['bareArbitraryValues']): string;
@@ -0,0 +1,10 @@
1
+ import type { Config } from 'tailwindcss';
2
+ import type { TailwindV3CandidateSource, TailwindV3GenerateOptions, TailwindV3ResolvedSource } from '../types';
3
+ export declare function createChangedContentEntries(candidates: Iterable<string>, sources: TailwindV3CandidateSource[]): {
4
+ content: string;
5
+ extension: string;
6
+ }[];
7
+ export declare function collectCandidates(candidates: Iterable<string> | undefined): Set<string>;
8
+ export declare function mergeGenerateCandidates(source: TailwindV3ResolvedSource, options: TailwindV3GenerateOptions): Set<string>;
9
+ export declare function normalizeConfigObject(config: Config | undefined): import("tailwindcss/types/config").Config | undefined;
10
+ export declare function createTailwindConfig(source: TailwindV3ResolvedSource, options: TailwindV3GenerateOptions): import("tailwindcss/types/config").Config;
@@ -0,0 +1,2 @@
1
+ import type { TailwindV3ResolvedSource } from '../types';
2
+ export declare function createRuntimeReadyPromise(source: TailwindV3ResolvedSource): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { TailwindV4GenerateTarget, TailwindV4ResolvedSource } from '../types';
2
+ export declare function createCompatibleSource(source: TailwindV4ResolvedSource, target: TailwindV4GenerateTarget, tailwindcssV3Compatibility: boolean | undefined): TailwindV4ResolvedSource;
@@ -0,0 +1,6 @@
1
+ export declare function normalizeRpxTextCandidates(candidates: Iterable<string>): {
2
+ candidates: Set<string>;
3
+ restoreCandidates: Map<string, string>;
4
+ };
5
+ export declare function restoreRpxTextCandidates(candidates: Iterable<string>, restoreCandidates: ReadonlyMap<string, string>): Set<string>;
6
+ export declare function restoreRpxTextCssSelectors(css: string, restoreCandidates: ReadonlyMap<string, string>): string;
@@ -0,0 +1,2 @@
1
+ import type { TailwindV4GenerateOptions, TailwindV4ResolvedSource } from '../types';
2
+ export declare function resolveScanSources(source: TailwindV4ResolvedSource, scanSources: TailwindV4GenerateOptions['scanSources']): Promise<boolean | import("tailwindcss-patch").TailwindV4SourcePattern[] | undefined>;
@@ -6,7 +6,7 @@ export interface TailwindV4SourcePattern {
6
6
  pattern: string;
7
7
  negated: boolean;
8
8
  }
9
- type TailwindV4PatchGenerateOptions = Omit<PatchTailwindV4GenerateOptions, 'target' | 'styleOptions' | 'tailwindcssV3Compatibility' | 'scanSources'>;
9
+ type TailwindV4PatchGenerateOptions = Omit<PatchTailwindV4GenerateOptions, 'target' | 'styleOptions' | 'tailwindcssV3Compatibility' | 'scanSources' | 'bareArbitraryValues'>;
10
10
  export interface TailwindV4GenerateOptions extends TailwindV4PatchGenerateOptions {
11
11
  incrementalCache?: boolean | undefined;
12
12
  bareArbitraryValues?: PatchTailwindV4GenerateOptions['bareArbitraryValues'] | undefined;
@@ -1,8 +1,8 @@
1
- import { _t as findNearestPackageRoot, dt as readInstalledPackageMajorVersion, f as runtimeSignaturePatchersSymbol, gt as omitUndefined, mt as normalizeStringListOption, ut as createTailwindcssPatcher, vt as findWorkspacePackageDir, yt as findWorkspaceRoot } from "./v3-engine-Ji6AXPh2.mjs";
1
+ import { _t as findWorkspacePackageDir, dt as readInstalledPackageMajorVersion, f as runtimeSignaturePatchersSymbol, gt as findNearestPackageRoot, mt as normalizeStringListOption, ut as createTailwindcssPatcher, vt as findWorkspaceRoot, yt as omitUndefined } from "./v3-engine-ArQVHEau.mjs";
2
2
  import { n as defuOverrideArray } from "./utils-DsaS975I.mjs";
3
3
  import { createRequire } from "node:module";
4
- import { existsSync, readFileSync } from "node:fs";
5
4
  import process from "node:process";
5
+ import { existsSync, readFileSync } from "node:fs";
6
6
  import path from "node:path";
7
7
  import { logger } from "@weapp-tailwindcss/logger";
8
8
  import { fileURLToPath } from "node:url";
@@ -1,10 +1,10 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_v3_engine = require("./v3-engine-6FVAcrZl.js");
2
+ const require_v3_engine = require("./v3-engine-DdlvXpID.js");
3
3
  require("./utils-Dolmt8EO.js");
4
- let node_fs = require("node:fs");
5
4
  let node_module = require("node:module");
6
5
  let node_process = require("node:process");
7
6
  node_process = require_chunk.__toESM(node_process);
7
+ let node_fs = require("node:fs");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
10
10
  let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
@@ -1,4 +1,4 @@
1
- import { c as createAttributeMatcher, d as _defineProperty, f as isClassContextLiteralPath, l as analyzeSource, m as babelParse, p as replaceWxml, s as generateCode, u as JsTokenUpdater } from "./precheck-Copn2SqE.mjs";
1
+ import { c as createAttributeMatcher, d as _defineProperty, f as isClassContextLiteralPath, l as analyzeSource, m as babelParse, p as replaceWxml, s as generateCode, u as JsTokenUpdater } from "./precheck-CcxTR7E_.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { splitCandidateTokens } from "tailwindcss-patch";
4
4
  import MagicString from "magic-string";
@@ -14587,6 +14587,7 @@ var import_compiler_dom = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
14587
14587
  const EXPRESSION_WRAPPER_PREFIX = "(\n";
14588
14588
  const EXPRESSION_WRAPPER_SUFFIX = "\n)";
14589
14589
  const COMPONENT_RE = /(?:^|[/\\])components(?:[/\\].+)?\.(?:uvue|nvue)$/;
14590
+ const PAGE_RE = /(?:^|[/\\])pages(?:[/\\].+)?\.(?:uvue|nvue)$/;
14590
14591
  function createStableHash(input) {
14591
14592
  let hash = 2166136261;
14592
14593
  for (let i = 0; i < input.length; i++) {
@@ -14615,6 +14616,9 @@ function isRuntimeCandidate(candidate, runtimeSet) {
14615
14616
  function shouldEnableComponentLocalStyle(id) {
14616
14617
  return COMPONENT_RE.test(id);
14617
14618
  }
14619
+ function shouldEnablePageLocalStyle(id) {
14620
+ return PAGE_RE.test(id);
14621
+ }
14618
14622
  var UniAppXComponentLocalStyleCollector = class {
14619
14623
  constructor(fileId, runtimeSet) {
14620
14624
  this.fileId = fileId;
@@ -14769,6 +14773,11 @@ function updateDirectiveExpressionWithLocalStyle(ms, prop, offset, jsHandler, co
14769
14773
  });
14770
14774
  ms.update(start, end, collector.rewriteTransformedCode(generated, { wrapExpression: true }));
14771
14775
  }
14776
+ function shouldEnableLocalStyle(id, options) {
14777
+ if (options.enableComponentLocalStyle && shouldEnableComponentLocalStyle(id)) return true;
14778
+ if (options.enablePageLocalStyle && shouldEnablePageLocalStyle(id)) return true;
14779
+ return false;
14780
+ }
14772
14781
  function shouldHandleAttribute(tag, attrName, disabledDefaultTemplateHandler, matchCustomAttribute) {
14773
14782
  const lowerName = attrName.toLowerCase();
14774
14783
  const shouldHandleDefault = !disabledDefaultTemplateHandler && lowerName === "class";
@@ -14820,7 +14829,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
14820
14829
  const matchCustomAttribute = createAttributeMatcher(customAttributesEntities);
14821
14830
  const ms = new MagicString(code);
14822
14831
  const descriptor = parseSfc(code);
14823
- const localStyleCollector = options.enableComponentLocalStyle && shouldEnableComponentLocalStyle(id) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
14832
+ const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
14824
14833
  if (descriptor.errors.length === 0) {
14825
14834
  if (descriptor.template?.ast) {
14826
14835
  const templateOffset = descriptor.template.start;
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-emK7D4bc.js");
2
- const require_precheck = require("./precheck-CyPbGn38.js");
2
+ const require_precheck = require("./precheck-B8y6tDvG.js");
3
3
  let tailwindcss_patch = require("tailwindcss-patch");
4
4
  let magic_string = require("magic-string");
5
5
  magic_string = require_chunk.__toESM(magic_string);
@@ -14584,6 +14584,7 @@ var import_compiler_dom = (/* @__PURE__ */ require_chunk.__commonJSMin(((exports
14584
14584
  const EXPRESSION_WRAPPER_PREFIX = "(\n";
14585
14585
  const EXPRESSION_WRAPPER_SUFFIX = "\n)";
14586
14586
  const COMPONENT_RE = /(?:^|[/\\])components(?:[/\\].+)?\.(?:uvue|nvue)$/;
14587
+ const PAGE_RE = /(?:^|[/\\])pages(?:[/\\].+)?\.(?:uvue|nvue)$/;
14587
14588
  function createStableHash(input) {
14588
14589
  let hash = 2166136261;
14589
14590
  for (let i = 0; i < input.length; i++) {
@@ -14612,6 +14613,9 @@ function isRuntimeCandidate(candidate, runtimeSet) {
14612
14613
  function shouldEnableComponentLocalStyle(id) {
14613
14614
  return COMPONENT_RE.test(id);
14614
14615
  }
14616
+ function shouldEnablePageLocalStyle(id) {
14617
+ return PAGE_RE.test(id);
14618
+ }
14615
14619
  var UniAppXComponentLocalStyleCollector = class {
14616
14620
  constructor(fileId, runtimeSet) {
14617
14621
  this.fileId = fileId;
@@ -14766,6 +14770,11 @@ function updateDirectiveExpressionWithLocalStyle(ms, prop, offset, jsHandler, co
14766
14770
  });
14767
14771
  ms.update(start, end, collector.rewriteTransformedCode(generated, { wrapExpression: true }));
14768
14772
  }
14773
+ function shouldEnableLocalStyle(id, options) {
14774
+ if (options.enableComponentLocalStyle && shouldEnableComponentLocalStyle(id)) return true;
14775
+ if (options.enablePageLocalStyle && shouldEnablePageLocalStyle(id)) return true;
14776
+ return false;
14777
+ }
14769
14778
  function shouldHandleAttribute(tag, attrName, disabledDefaultTemplateHandler, matchCustomAttribute) {
14770
14779
  const lowerName = attrName.toLowerCase();
14771
14780
  const shouldHandleDefault = !disabledDefaultTemplateHandler && lowerName === "class";
@@ -14817,7 +14826,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
14817
14826
  const matchCustomAttribute = require_precheck.createAttributeMatcher(customAttributesEntities);
14818
14827
  const ms = new magic_string.default(code);
14819
14828
  const descriptor = parseSfc(code);
14820
- const localStyleCollector = options.enableComponentLocalStyle && shouldEnableComponentLocalStyle(id) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
14829
+ const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
14821
14830
  if (descriptor.errors.length === 0) {
14822
14831
  if (descriptor.template?.ast) {
14823
14832
  const templateOffset = descriptor.template.start;
@@ -1,7 +1,8 @@
1
- import type { SourceEntry } from '@tailwindcss/oxide';
2
1
  import type { PackageResolvingOptions } from 'local-pkg';
3
2
  import type { ILengthUnitsPatchOptions } from 'tailwindcss-patch';
4
- import type { TailwindV4CssSource } from '../tailwindcss/v4-engine';
3
+ import type { TailwindSourceEntry as SourceEntry } from '../tailwindcss/source-scan';
4
+ import type { TailwindV4SourceOptions } from '../tailwindcss/v4-engine';
5
+ type TailwindV4CssSource = NonNullable<TailwindV4SourceOptions['cssSources']>[number];
5
6
  export type CacheStrategy = 'merge' | 'overwrite';
6
7
  export type CacheDriver = 'file' | 'memory' | 'noop';
7
8
  export interface CacheOptions {
@@ -65,3 +66,4 @@ export interface TailwindCssPatchOptions {
65
66
  filter?: (className: string) => boolean;
66
67
  cache?: boolean | CacheOptions;
67
68
  }
69
+ export {};
@@ -4,6 +4,10 @@ import type { ILengthUnitsPatchOptions, TailwindCssPatchOptions } from 'tailwind
4
4
  import type { ICreateCacheReturnType } from '../../cache';
5
5
  import type { WeappTailwindcssGeneratorUserOptions } from '../../generator';
6
6
  import type { AppType, IArbitraryValues, IUnocssCompatibilityOptions } from '../shared';
7
+ export interface CssSourceTraceOptions {
8
+ root?: string | undefined;
9
+ }
10
+ export type CssSourceTraceUserOptions = boolean | CssSourceTraceOptions;
7
11
  export interface UserDefinedOptionsGeneralPart {
8
12
  supportCustomLengthUnitsPatch?: ILengthUnitsPatchOptions | boolean | undefined;
9
13
  appType?: AppType | undefined;
@@ -13,6 +17,7 @@ export interface UserDefinedOptionsGeneralPart {
13
17
  jsArbitraryValueFallback?: boolean | 'auto' | undefined;
14
18
  replaceRuntimePackages?: boolean | Record<string, string> | undefined;
15
19
  generator?: WeappTailwindcssGeneratorUserOptions | undefined;
20
+ cssSourceTrace?: CssSourceTraceUserOptions | undefined;
16
21
  disabledDefaultTemplateHandler?: boolean | undefined;
17
22
  runtimeLoaderPath?: string | undefined;
18
23
  tailwindcssBasedir?: string | undefined;
@@ -2,6 +2,7 @@ interface RewriteCodeOptions {
2
2
  wrapExpression?: boolean;
3
3
  }
4
4
  export declare function shouldEnableComponentLocalStyle(id: string): boolean;
5
+ export declare function shouldEnablePageLocalStyle(id: string): boolean;
5
6
  export declare class UniAppXComponentLocalStyleCollector {
6
7
  private readonly fileId;
7
8
  private readonly runtimeSet?;
@@ -0,0 +1 @@
1
+ export declare function isUniAppXHarmonyOutDir(outDir: string | undefined): boolean;
@@ -0,0 +1,16 @@
1
+ import type { OutputChunk } from 'rollup';
2
+ type StyleDeclarations = Record<string, string | number>;
3
+ export type StyleValue = Record<string, Record<string, StyleDeclarations>>;
4
+ export declare function parseStyleExport(source: string): StyleValue | undefined;
5
+ export declare function parseStyleObject(source: string): StyleValue | undefined;
6
+ export declare function parseSourceMapSourcesContent(source: string): string[];
7
+ export declare function collectChunkMapSourcesContent(chunk: OutputChunk): string[];
8
+ export declare function styleExportToUtsMap(styleExport: StyleValue): string;
9
+ export declare function createUtsStyleArrayFromAppStyles(code: string, appSource?: string): string | undefined;
10
+ export declare function cssSourceToStyleValue(source: string): StyleValue | undefined;
11
+ export declare function mergeStyleValues(...items: Array<StyleValue | undefined>): StyleValue | undefined;
12
+ export declare function createStyleValueFromApplySources(sources: string[], utilityStyles: StyleValue | undefined): StyleValue | undefined;
13
+ export declare function collectUniAppXHarmonyApplyStyleSourcesFromSource(source: string): string[];
14
+ export declare function collectUniAppXHarmonyApplyUtilitiesFromSources(sources: Iterable<string>): Set<string>;
15
+ export declare function createMergedStyleValue(code: string, localStyle: StyleValue | undefined, appStyle: StyleValue): StyleValue | undefined;
16
+ export {};
@@ -0,0 +1,20 @@
1
+ import type { OutputAsset, OutputChunk } from 'rollup';
2
+ import { collectUniAppXHarmonyApplyStyleSourcesFromSource, collectUniAppXHarmonyApplyUtilitiesFromSources } from './style-asset/style-value';
3
+ export declare const UNI_APP_X_STYLE_PLACEHOLDER_VERSION = "uni-app-x-style-placeholder-v2";
4
+ type BundleItem = {
5
+ type: string;
6
+ } | OutputAsset | OutputChunk;
7
+ interface HarmonyStyleInjectOptions {
8
+ cssSources?: Iterable<string | undefined> | undefined;
9
+ excludeComponents?: boolean | undefined;
10
+ mapSources?: Iterable<string | undefined> | undefined;
11
+ }
12
+ export { collectUniAppXHarmonyApplyStyleSourcesFromSource, collectUniAppXHarmonyApplyUtilitiesFromSources, };
13
+ export declare function createUniAppXHarmonyApplyGeneratorSource(applyStyleSources: string[], _applyUtilities: Iterable<string>): string;
14
+ export declare function collectUniAppXHarmonyApplyUtilities(bundle: Record<string, BundleItem>): Set<string>;
15
+ export declare function collectUniAppXHarmonyApplyStyleSources(bundle: Record<string, BundleItem>): string[];
16
+ export declare function injectUniAppXStylePlaceholder(file: string, code: string, getAssetSource?: (file: string) => string | undefined): string;
17
+ export declare function injectUniAppXHarmonyGlobalStyles(file: string, code: string, getBundleSource?: (file: string) => string | undefined, options?: HarmonyStyleInjectOptions): string;
18
+ export declare function injectUniAppXHarmonyBundleStyles(bundle: Record<string, BundleItem>, options?: HarmonyStyleInjectOptions): boolean;
19
+ export declare function isUniAppXHarmonyBundle(bundle: Record<string, BundleItem>): boolean;
20
+ export declare function createUniAppXBundleAssetSourceGetter(bundle: Record<string, BundleItem>): (file: string) => string | undefined;
@@ -4,6 +4,7 @@ interface TransformUVueOptions {
4
4
  customAttributesEntities?: ICustomAttributesEntities;
5
5
  disabledDefaultTemplateHandler?: boolean;
6
6
  enableComponentLocalStyle?: boolean;
7
+ enablePageLocalStyle?: boolean;
7
8
  }
8
9
  export declare function transformUVue(code: string, id: string, jsHandler: JsHandler, runtimeSet?: Set<string>, options?: TransformUVueOptions): undefined | TransformResult;
9
10
  export {};
@@ -34,6 +34,7 @@ interface CreateUniAppXAssetTaskOptions {
34
34
  runtimeSet: Set<string>;
35
35
  applyLinkedResults: ApplyLinkedResults;
36
36
  uniAppX?: InternalUserDefinedOptions['uniAppX'];
37
+ getAssetSource?: (file: string) => string | undefined;
37
38
  }
38
39
  export declare function createUniAppXAssetTask(file: string, originalSource: OutputAsset, outDir: string, options: CreateUniAppXAssetTaskOptions): () => Promise<void>;
39
40
  export {};