weapp-tailwindcss 5.1.11 → 5.1.12

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 (54) hide show
  1. package/dist/cache-options-DavPxrhC.js +16 -0
  2. package/dist/cache-options-DwBtLwQe.mjs +5 -0
  3. package/dist/cli.js +10 -6
  4. package/dist/cli.mjs +10 -6
  5. package/dist/context-DRRgW7i2.js +1311 -0
  6. package/dist/context-xSJE588m.mjs +1234 -0
  7. package/dist/core.js +1 -1
  8. package/dist/core.mjs +1 -1
  9. package/dist/css-macro.js +1 -1
  10. package/dist/css-macro.mjs +1 -1
  11. package/dist/defaults.js +119 -5
  12. package/dist/defaults.mjs +114 -1
  13. package/dist/{generator-ROzBodj6.mjs → generator-BvPcmqxU.mjs} +9 -139
  14. package/dist/{generator-Bz94KTkH.js → generator-CS10c9g1.js} +18 -154
  15. package/dist/generator.js +1 -1
  16. package/dist/generator.mjs +1 -1
  17. package/dist/{gulp-BKqMb_Ds.mjs → gulp-BEOzXrbp.mjs} +5 -4
  18. package/dist/{gulp-DfOLvYLs.js → gulp-DNZZvUMq.js} +6 -5
  19. package/dist/gulp.js +1 -1
  20. package/dist/gulp.mjs +1 -1
  21. package/dist/{hmr-timing-DOTdH18A.js → hmr-timing-DW1g3zjl.js} +17 -15
  22. package/dist/{hmr-timing-DwtYJdwb.mjs → hmr-timing-hRhRAjYV.mjs} +5 -3
  23. package/dist/index.js +4 -4
  24. package/dist/index.mjs +4 -4
  25. package/dist/object-BJSWl-E5.mjs +9 -0
  26. package/dist/object-COs_Mw6p.js +14 -0
  27. package/dist/postcss.js +1 -1
  28. package/dist/postcss.mjs +1 -1
  29. package/dist/presets.js +5 -5
  30. package/dist/presets.mjs +3 -3
  31. package/dist/rspack.js +1 -1
  32. package/dist/rspack.mjs +1 -1
  33. package/dist/{source-candidate-scan-signature-BrWuBTjY.js → source-candidate-scan-signature-CMgu5bJk.js} +6 -6
  34. package/dist/{source-candidate-scan-signature-CQ04hiox.mjs → source-candidate-scan-signature-t4XKAQ04.mjs} +3 -3
  35. package/dist/{tailwindcss-hzy_WaC9.mjs → tailwindcss-DZT_pWrd.mjs} +132 -2
  36. package/dist/{tailwindcss-Dn5DVlkI.js → tailwindcss-z9JMF-qU.js} +140 -10
  37. package/dist/{transform-DZQETx51.js → transform-COFRlmDF.js} +13 -13
  38. package/dist/{transform-BgnNYkIG.mjs → transform-D5JUgMpE.mjs} +1 -1
  39. package/dist/{utils-D3h8j7Mk.js → utils-CuKLf1Zv.js} +0 -15
  40. package/dist/{utils-DodxWHGz.mjs → utils-MVwpU07P.mjs} +1 -8
  41. package/dist/{vite-oI2ReOic.mjs → vite-DF1gE6a5.mjs} +35 -23
  42. package/dist/{vite-DODC15Fr.js → vite-VGfkFQkC.js} +50 -38
  43. package/dist/vite.js +1 -1
  44. package/dist/vite.mjs +1 -1
  45. package/dist/weapp-tw-css-import-rewrite-loader.js +6 -2
  46. package/dist/{webpack-CCapGlNg.mjs → webpack-CTYm19zA.mjs} +22 -16
  47. package/dist/{webpack-XxBCIrBp.js → webpack-CzXjfvYS.js} +28 -22
  48. package/dist/webpack.js +1 -1
  49. package/dist/webpack.mjs +1 -1
  50. package/dist/{context-y2BGCok4.js → wxml-Ce10eREX.js} +37 -1286
  51. package/dist/{context-DzkSFEVL.mjs → wxml-DdGdeqaH.mjs} +13 -1235
  52. package/package.json +3 -3
  53. package/dist/defaults-9B6aMyZb.mjs +0 -118
  54. package/dist/defaults-nsf4VNMX.js +0 -154
@@ -1,5 +1,6 @@
1
- import { C as normalizeExtendLengthUnits, Ct as expandTailwindSourceEntries, Dt as resolveCssSourceEntries, E as normalizeStringListOption, Et as parseConfigParam, Ft as loadTailwindV4DesignSystem, Mt as resolveCssMacroTailwindV4Source, Pt as omitUndefined, S as findWorkspaceRoot, St as createTailwindSourceEntryMatcher, T as resolveTailwindcssOptions, Tt as normalizeLegacyContentEntries, _ as guessBasedirFromEntries, b as findNearestPackageRoot, f as resolveTailwindV4SourceOptionsFromRuntime, g as groupCssEntriesByBase, i as normalizeWeappTailwindcssGeneratorOptions, jt as collectCssInlineSourceCandidates, kt as resolveTailwindV4CssSourceBase, m as hasConfiguredTailwindV4CssRoots, p as filterTailwindV4CssSourceRoots, u as resolveTailwindV4SourceFromRuntime, v as isTailwindV4CssEntry, w as normalizeTailwindcssRuntimeOptions, x as findWorkspacePackageDir, xt as FULL_SOURCE_SCAN_PATTERN, y as normalizeCssEntries } from "./generator-ROzBodj6.mjs";
2
- import { n as defuOverrideArray$1 } from "./utils-DodxWHGz.mjs";
1
+ import { At as resolveTailwindV4CssSourceBase, C as findWorkspaceRoot, Ct as createTailwindSourceEntryMatcher, D as normalizeStringListOption, Dt as parseConfigParam, E as resolveTailwindcssOptions, Et as normalizeLegacyContentEntries, Mt as resolveCssMacroTailwindV4Source, Ot as resolveCssSourceEntries, Pt as loadTailwindV4DesignSystem, S as findWorkspacePackageDir, St as FULL_SOURCE_SCAN_PATTERN, T as normalizeTailwindcssRuntimeOptions, _ as groupCssEntriesByBase, b as normalizeCssEntries, d as resolveTailwindV4SourceFromRuntime, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, m as filterTailwindV4CssSourceRoots, p as resolveTailwindV4SourceOptionsFromRuntime, v as guessBasedirFromEntries, w as normalizeExtendLengthUnits, wt as expandTailwindSourceEntries, x as findNearestPackageRoot, y as isTailwindV4CssEntry } from "./generator-BvPcmqxU.mjs";
2
+ import { t as omitUndefined } from "./object-BJSWl-E5.mjs";
3
+ import { n as defuOverrideArray$1 } from "./utils-MVwpU07P.mjs";
3
4
  import { createRequire } from "node:module";
4
5
  import { existsSync, readFileSync, statSync } from "node:fs";
5
6
  import path from "node:path";
@@ -12,6 +13,135 @@ import { logger } from "@weapp-tailwindcss/logger";
12
13
  import fg from "fast-glob";
13
14
  import { loadConfig } from "tailwindcss-config";
14
15
  import { fileURLToPath } from "node:url";
16
+ //#region src/tailwindcss/source-scan/inline-source.ts
17
+ const NUMERICAL_RANGE_RE = /^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;
18
+ function segmentTopLevel(input, separator, options = {}) {
19
+ const parts = [];
20
+ const stack = [];
21
+ let lastPos = 0;
22
+ let quote;
23
+ for (let index = 0; index < input.length; index++) {
24
+ const char = input[index];
25
+ if (char === "\\") {
26
+ index += 1;
27
+ continue;
28
+ }
29
+ if (quote) {
30
+ if (char === quote) quote = void 0;
31
+ continue;
32
+ }
33
+ if (char === "\"" || char === "'") {
34
+ quote = char;
35
+ continue;
36
+ }
37
+ if (char === "(") {
38
+ stack.push(")");
39
+ continue;
40
+ }
41
+ if (char === "[") {
42
+ stack.push("]");
43
+ continue;
44
+ }
45
+ if (char === "{") {
46
+ stack.push("}");
47
+ continue;
48
+ }
49
+ if (stack.length > 0 && char === stack[stack.length - 1]) {
50
+ stack.pop();
51
+ continue;
52
+ }
53
+ if (stack.length === 0 && char === separator) {
54
+ const part = input.slice(lastPos, index);
55
+ if (part || options.keepEmpty) parts.push(part);
56
+ lastPos = index + 1;
57
+ }
58
+ }
59
+ const part = input.slice(lastPos);
60
+ if (part || options.keepEmpty) parts.push(part);
61
+ return parts;
62
+ }
63
+ function isSequence(value) {
64
+ return NUMERICAL_RANGE_RE.test(value);
65
+ }
66
+ function expandSequence(value) {
67
+ const match = value.match(NUMERICAL_RANGE_RE);
68
+ if (!match) return [value];
69
+ const [, start, end, stepValue] = match;
70
+ if (start === void 0 || end === void 0) return [value];
71
+ let step = stepValue ? Number.parseInt(stepValue, 10) : void 0;
72
+ const startNumber = Number.parseInt(start, 10);
73
+ const endNumber = Number.parseInt(end, 10);
74
+ const increasing = startNumber < endNumber;
75
+ if (step === void 0) step = increasing ? 1 : -1;
76
+ if (step === 0) return [];
77
+ if (increasing && step < 0) step = -step;
78
+ if (!increasing && step > 0) step = -step;
79
+ const result = [];
80
+ for (let value = startNumber; increasing ? value <= endNumber : value >= endNumber; value += step) result.push(String(value));
81
+ return result;
82
+ }
83
+ function expandInlineSourceCandidatePattern(pattern) {
84
+ const index = pattern.indexOf("{");
85
+ if (index === -1) return [pattern];
86
+ const prefix = pattern.slice(0, index);
87
+ const rest = pattern.slice(index);
88
+ let depth = 0;
89
+ let endIndex = -1;
90
+ for (let index = 0; index < rest.length; index++) {
91
+ const char = rest[index];
92
+ if (char === "{") depth += 1;
93
+ else if (char === "}") {
94
+ depth -= 1;
95
+ if (depth === 0) {
96
+ endIndex = index;
97
+ break;
98
+ }
99
+ }
100
+ }
101
+ if (endIndex === -1) return [pattern];
102
+ const inner = rest.slice(1, endIndex);
103
+ const suffix = rest.slice(endIndex + 1);
104
+ const parts = (isSequence(inner) ? expandSequence(inner) : segmentTopLevel(inner, ",", { keepEmpty: true })).flatMap((part) => expandInlineSourceCandidatePattern(part));
105
+ return expandInlineSourceCandidatePattern(suffix).flatMap((suffix) => parts.map((part) => `${prefix}${part}${suffix}`));
106
+ }
107
+ function parseSourceInlineParam(params) {
108
+ let value = params.trim();
109
+ const negated = value.startsWith("not ");
110
+ if (negated) value = value.slice(4).trim();
111
+ if (!value.startsWith("inline(") || !value.endsWith(")")) return;
112
+ const inlineValue = value.slice(7, -1).trim();
113
+ const match = /^(['"])([\s\S]*)\1$/.exec(inlineValue);
114
+ if (!match) return;
115
+ const source = match[2];
116
+ if (source === void 0) return;
117
+ return {
118
+ negated,
119
+ source
120
+ };
121
+ }
122
+ function collectCssInlineSourceCandidates(root) {
123
+ const included = /* @__PURE__ */ new Set();
124
+ const excluded = /* @__PURE__ */ new Set();
125
+ root.walkAtRules("source", (rule) => {
126
+ const parsed = parseSourceInlineParam(rule.params);
127
+ if (!parsed) return;
128
+ const target = parsed.negated ? excluded : included;
129
+ for (const source of segmentTopLevel(parsed.source, " ")) {
130
+ const trimmed = source.trim();
131
+ if (!trimmed) continue;
132
+ for (const candidate of expandInlineSourceCandidatePattern(trimmed)) {
133
+ const normalized = candidate.trim();
134
+ if (normalized) target.add(normalized);
135
+ }
136
+ }
137
+ });
138
+ for (const candidate of excluded) included.delete(candidate);
139
+ return {
140
+ included,
141
+ excluded
142
+ };
143
+ }
144
+ //#endregion
15
145
  //#region src/tailwindcss/v4/preflight.ts
16
146
  function parseCssImportSpecifier(params) {
17
147
  const value = params.trim();
@@ -1,6 +1,7 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
2
- const require_generator = require("./generator-Bz94KTkH.js");
3
- require("./utils-D3h8j7Mk.js");
2
+ const require_generator = require("./generator-CS10c9g1.js");
3
+ const require_object = require("./object-COs_Mw6p.js");
4
+ require("./utils-CuKLf1Zv.js");
4
5
  let node_fs = require("node:fs");
5
6
  let node_path = require("node:path");
6
7
  node_path = require_rolldown_runtime.__toESM(node_path);
@@ -16,6 +17,135 @@ let fast_glob = require("fast-glob");
16
17
  fast_glob = require_rolldown_runtime.__toESM(fast_glob);
17
18
  let tailwindcss_config = require("tailwindcss-config");
18
19
  let node_url = require("node:url");
20
+ //#region src/tailwindcss/source-scan/inline-source.ts
21
+ const NUMERICAL_RANGE_RE = /^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;
22
+ function segmentTopLevel(input, separator, options = {}) {
23
+ const parts = [];
24
+ const stack = [];
25
+ let lastPos = 0;
26
+ let quote;
27
+ for (let index = 0; index < input.length; index++) {
28
+ const char = input[index];
29
+ if (char === "\\") {
30
+ index += 1;
31
+ continue;
32
+ }
33
+ if (quote) {
34
+ if (char === quote) quote = void 0;
35
+ continue;
36
+ }
37
+ if (char === "\"" || char === "'") {
38
+ quote = char;
39
+ continue;
40
+ }
41
+ if (char === "(") {
42
+ stack.push(")");
43
+ continue;
44
+ }
45
+ if (char === "[") {
46
+ stack.push("]");
47
+ continue;
48
+ }
49
+ if (char === "{") {
50
+ stack.push("}");
51
+ continue;
52
+ }
53
+ if (stack.length > 0 && char === stack[stack.length - 1]) {
54
+ stack.pop();
55
+ continue;
56
+ }
57
+ if (stack.length === 0 && char === separator) {
58
+ const part = input.slice(lastPos, index);
59
+ if (part || options.keepEmpty) parts.push(part);
60
+ lastPos = index + 1;
61
+ }
62
+ }
63
+ const part = input.slice(lastPos);
64
+ if (part || options.keepEmpty) parts.push(part);
65
+ return parts;
66
+ }
67
+ function isSequence(value) {
68
+ return NUMERICAL_RANGE_RE.test(value);
69
+ }
70
+ function expandSequence(value) {
71
+ const match = value.match(NUMERICAL_RANGE_RE);
72
+ if (!match) return [value];
73
+ const [, start, end, stepValue] = match;
74
+ if (start === void 0 || end === void 0) return [value];
75
+ let step = stepValue ? Number.parseInt(stepValue, 10) : void 0;
76
+ const startNumber = Number.parseInt(start, 10);
77
+ const endNumber = Number.parseInt(end, 10);
78
+ const increasing = startNumber < endNumber;
79
+ if (step === void 0) step = increasing ? 1 : -1;
80
+ if (step === 0) return [];
81
+ if (increasing && step < 0) step = -step;
82
+ if (!increasing && step > 0) step = -step;
83
+ const result = [];
84
+ for (let value = startNumber; increasing ? value <= endNumber : value >= endNumber; value += step) result.push(String(value));
85
+ return result;
86
+ }
87
+ function expandInlineSourceCandidatePattern(pattern) {
88
+ const index = pattern.indexOf("{");
89
+ if (index === -1) return [pattern];
90
+ const prefix = pattern.slice(0, index);
91
+ const rest = pattern.slice(index);
92
+ let depth = 0;
93
+ let endIndex = -1;
94
+ for (let index = 0; index < rest.length; index++) {
95
+ const char = rest[index];
96
+ if (char === "{") depth += 1;
97
+ else if (char === "}") {
98
+ depth -= 1;
99
+ if (depth === 0) {
100
+ endIndex = index;
101
+ break;
102
+ }
103
+ }
104
+ }
105
+ if (endIndex === -1) return [pattern];
106
+ const inner = rest.slice(1, endIndex);
107
+ const suffix = rest.slice(endIndex + 1);
108
+ const parts = (isSequence(inner) ? expandSequence(inner) : segmentTopLevel(inner, ",", { keepEmpty: true })).flatMap((part) => expandInlineSourceCandidatePattern(part));
109
+ return expandInlineSourceCandidatePattern(suffix).flatMap((suffix) => parts.map((part) => `${prefix}${part}${suffix}`));
110
+ }
111
+ function parseSourceInlineParam(params) {
112
+ let value = params.trim();
113
+ const negated = value.startsWith("not ");
114
+ if (negated) value = value.slice(4).trim();
115
+ if (!value.startsWith("inline(") || !value.endsWith(")")) return;
116
+ const inlineValue = value.slice(7, -1).trim();
117
+ const match = /^(['"])([\s\S]*)\1$/.exec(inlineValue);
118
+ if (!match) return;
119
+ const source = match[2];
120
+ if (source === void 0) return;
121
+ return {
122
+ negated,
123
+ source
124
+ };
125
+ }
126
+ function collectCssInlineSourceCandidates(root) {
127
+ const included = /* @__PURE__ */ new Set();
128
+ const excluded = /* @__PURE__ */ new Set();
129
+ root.walkAtRules("source", (rule) => {
130
+ const parsed = parseSourceInlineParam(rule.params);
131
+ if (!parsed) return;
132
+ const target = parsed.negated ? excluded : included;
133
+ for (const source of segmentTopLevel(parsed.source, " ")) {
134
+ const trimmed = source.trim();
135
+ if (!trimmed) continue;
136
+ for (const candidate of expandInlineSourceCandidatePattern(trimmed)) {
137
+ const normalized = candidate.trim();
138
+ if (normalized) target.add(normalized);
139
+ }
140
+ }
141
+ });
142
+ for (const candidate of excluded) included.delete(candidate);
143
+ return {
144
+ included,
145
+ excluded
146
+ };
147
+ }
148
+ //#endregion
19
149
  //#region src/tailwindcss/v4/preflight.ts
20
150
  function parseCssImportSpecifier(params) {
21
151
  const value = params.trim();
@@ -326,7 +456,7 @@ async function resolveTailwindV4EntriesFromCss(css, base) {
326
456
  const [sourceEntries, configEntries] = await Promise.all([require_generator.resolveCssSourceEntries(root, base, VITE_SOURCE_CANDIDATE_PATTERN), resolveConfigContentEntries(root, base)]);
327
457
  const entries = [...configEntries.entries, ...sourceEntries];
328
458
  const hasPositiveEntries = entries.some((entry) => !entry.negated);
329
- const inlineCandidates = require_generator.collectCssInlineSourceCandidates(root);
459
+ const inlineCandidates = collectCssInlineSourceCandidates(root);
330
460
  root.walkAtRules("import", (rule) => {
331
461
  if (!isTailwindV4CssImportParam(rule.params)) return;
332
462
  hasTailwindCssImport = true;
@@ -1082,7 +1212,7 @@ function createTailwindcssRuntime(options) {
1082
1212
  const resolvePaths = createDefaultResolvePaths(cache.cwd ?? normalizedBasedir ?? node_process.default.cwd());
1083
1213
  const normalizedUserOptions = require_generator.normalizeTailwindcssRuntimeOptions(tailwindcssRuntimeOptions);
1084
1214
  const extendLengthUnits = require_generator.normalizeExtendLengthUnits(supportCustomLengthUnits ?? true);
1085
- const baseTailwindOptions = (0, _weapp_tailwindcss_shared.defuOverrideArray)(tailwindcss ?? {}, require_generator.omitUndefined({
1215
+ const baseTailwindOptions = (0, _weapp_tailwindcss_shared.defuOverrideArray)(tailwindcss ?? {}, require_object.omitUndefined({
1086
1216
  cwd: normalizedBasedir,
1087
1217
  resolve: { paths: resolvePaths }
1088
1218
  }));
@@ -1092,11 +1222,11 @@ function createTailwindcssRuntime(options) {
1092
1222
  const resolvedPlugin = resolveModuleFromPaths(baseTailwindOptions.postcssPlugin, resolvePaths);
1093
1223
  if (resolvedPlugin) baseTailwindOptions.postcssPlugin = resolvedPlugin;
1094
1224
  }
1095
- const baseOptions = require_generator.omitUndefined({
1225
+ const baseOptions = require_object.omitUndefined({
1096
1226
  projectRoot: normalizedBasedir,
1097
1227
  cache,
1098
1228
  tailwindcss: baseTailwindOptions,
1099
- apply: require_generator.omitUndefined({
1229
+ apply: require_object.omitUndefined({
1100
1230
  exposeContext: true,
1101
1231
  extendLengthUnits
1102
1232
  })
@@ -1186,7 +1316,7 @@ function createMultiTailwindcssRuntime(runtimes) {
1186
1316
  }
1187
1317
  if (result.classSet) for (const className of result.classSet) aggregatedSet.add(className);
1188
1318
  }
1189
- return require_generator.omitUndefined({
1319
+ return require_object.omitUndefined({
1190
1320
  classList: aggregatedList,
1191
1321
  classSet: aggregatedSet,
1192
1322
  filename
@@ -1250,7 +1380,7 @@ function createTailwindcssRuntimeForBase(baseDir, cssEntries, options) {
1250
1380
  const hasCssEntries = Boolean(cssEntries?.length);
1251
1381
  const defaultTailwindcssConfig = {
1252
1382
  cwd: baseDir,
1253
- v4: hasCssEntries ? require_generator.omitUndefined({ cssEntries }) : require_generator.omitUndefined({
1383
+ v4: hasCssEntries ? require_object.omitUndefined({ cssEntries }) : require_object.omitUndefined({
1254
1384
  base: baseDir,
1255
1385
  cssEntries
1256
1386
  })
@@ -1278,7 +1408,7 @@ function createTailwindcssRuntimeForBase(baseDir, cssEntries, options) {
1278
1408
  packageName: configuredPackageName ?? mergedTailwindOptions.packageName ?? readPackageNameFromBaseDir(baseDir) ?? "tailwindcss"
1279
1409
  };
1280
1410
  if (supportedResolvedTailwindVersion) tailwindOptionsForPackage.version = supportedResolvedTailwindVersion;
1281
- return createTailwindcssRuntime(require_generator.omitUndefined({
1411
+ return createTailwindcssRuntime(require_object.omitUndefined({
1282
1412
  basedir: baseDir,
1283
1413
  supportCustomLengthUnits: supportCustomLengthUnits ?? true,
1284
1414
  tailwindcss: tailwindOptionsForPackage,
@@ -1463,7 +1593,7 @@ function createTailwindcssRuntimeFromContext(ctx) {
1463
1593
  bareArbitraryValues: arbitraryValues?.bareArbitraryValues
1464
1594
  };
1465
1595
  const workspaceRoot = require_generator.findWorkspaceRoot(resolvedTailwindcssBasedir) ?? (absoluteCssEntryBasedir ? require_generator.findWorkspaceRoot(absoluteCssEntryBasedir) : void 0);
1466
- const groupedCssEntries = normalizedCssEntries ? require_generator.groupCssEntriesByBase(normalizedCssEntries, require_generator.omitUndefined({
1596
+ const groupedCssEntries = normalizedCssEntries ? require_generator.groupCssEntriesByBase(normalizedCssEntries, require_object.omitUndefined({
1467
1597
  preferredBaseDir: resolvedTailwindcssBasedir,
1468
1598
  workspaceRoot
1469
1599
  })) : void 0;
@@ -1,5 +1,5 @@
1
1
  const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
2
- const require_context = require("./context-y2BGCok4.js");
2
+ const require_wxml = require("./wxml-Ce10eREX.js");
3
3
  let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
4
4
  let magic_string = require("magic-string");
5
5
  magic_string = require_rolldown_runtime.__toESM(magic_string);
@@ -14616,7 +14616,7 @@ function createAlias(fileId, utility, index) {
14616
14616
  }
14617
14617
  function isRuntimeCandidate(candidate, runtimeSet) {
14618
14618
  if (!runtimeSet || runtimeSet.size === 0) return false;
14619
- return runtimeSet.has(candidate) || runtimeSet.has(require_context.replaceWxml(candidate));
14619
+ return runtimeSet.has(candidate) || runtimeSet.has(require_wxml.replaceWxml(candidate));
14620
14620
  }
14621
14621
  function shouldEnableComponentLocalStyle(id) {
14622
14622
  return COMPONENT_RE.test(id);
@@ -14628,8 +14628,8 @@ var UniAppXComponentLocalStyleCollector = class {
14628
14628
  constructor(fileId, runtimeSet) {
14629
14629
  this.fileId = fileId;
14630
14630
  this.runtimeSet = runtimeSet;
14631
- require_context._defineProperty(this, "aliasByUtility", /* @__PURE__ */ new Map());
14632
- require_context._defineProperty(this, "aliasByLookup", /* @__PURE__ */ new Map());
14631
+ require_wxml._defineProperty(this, "aliasByUtility", /* @__PURE__ */ new Map());
14632
+ require_wxml._defineProperty(this, "aliasByLookup", /* @__PURE__ */ new Map());
14633
14633
  }
14634
14634
  ensureAlias(utility) {
14635
14635
  const cached = this.aliasByUtility.get(utility);
@@ -14637,7 +14637,7 @@ var UniAppXComponentLocalStyleCollector = class {
14637
14637
  const alias = createAlias(this.fileId, utility, this.aliasByUtility.size);
14638
14638
  this.aliasByUtility.set(utility, alias);
14639
14639
  this.aliasByLookup.set(utility, alias);
14640
- this.aliasByLookup.set(require_context.replaceWxml(utility), alias);
14640
+ this.aliasByLookup.set(require_wxml.replaceWxml(utility), alias);
14641
14641
  return alias;
14642
14642
  }
14643
14643
  rewriteLiteral(literal, shouldInclude) {
@@ -14656,14 +14656,14 @@ var UniAppXComponentLocalStyleCollector = class {
14656
14656
  collectRuntimeClasses(rawSource, options = {}) {
14657
14657
  const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
14658
14658
  try {
14659
- const analysis = require_context.analyzeSource(require_context.babelParse(wrapped, {
14659
+ const analysis = require_wxml.analyzeSource(require_wxml.babelParse(wrapped, {
14660
14660
  plugins: ["typescript"],
14661
14661
  sourceType: options.wrapExpression ? "module" : "unambiguous"
14662
14662
  }), {}, void 0, false);
14663
14663
  for (const path of analysis.targetPaths) {
14664
14664
  const { literal } = extractLiteralValue(path);
14665
14665
  const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
14666
- const classContext = options.wrapExpression || require_context.isClassContextLiteralPath(path);
14666
+ const classContext = options.wrapExpression || require_wxml.isClassContextLiteralPath(path);
14667
14667
  for (const candidate of candidates) {
14668
14668
  if (!candidate || !classContext && !isRuntimeCandidate(candidate, this.runtimeSet)) continue;
14669
14669
  if (isRuntimeCandidate(candidate, this.runtimeSet)) this.ensureAlias(candidate);
@@ -14675,12 +14675,12 @@ var UniAppXComponentLocalStyleCollector = class {
14675
14675
  if (this.aliasByLookup.size === 0) return rawSource;
14676
14676
  const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
14677
14677
  try {
14678
- const analysis = require_context.analyzeSource(require_context.babelParse(wrapped, {
14678
+ const analysis = require_wxml.analyzeSource(require_wxml.babelParse(wrapped, {
14679
14679
  plugins: ["typescript"],
14680
14680
  sourceType: options.wrapExpression ? "module" : "unambiguous"
14681
14681
  }), {}, void 0, false);
14682
14682
  if (analysis.targetPaths.length === 0) return rawSource;
14683
- const updater = new require_context.JsTokenUpdater();
14683
+ const updater = new require_wxml.JsTokenUpdater();
14684
14684
  for (const path of analysis.targetPaths) {
14685
14685
  const { literal, offset } = extractLiteralValue(path);
14686
14686
  const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
@@ -14743,7 +14743,7 @@ function updateStaticAttribute(ms, prop, offset, content = prop.value?.content)
14743
14743
  if (!prop.value) return;
14744
14744
  const start = offset + prop.value.loc.start.offset + 1;
14745
14745
  const end = offset + prop.value.loc.end.offset - 1;
14746
- if (start < end) ms.update(start, end, require_context.replaceWxml(content ?? ""));
14746
+ if (start < end) ms.update(start, end, require_wxml.replaceWxml(content ?? ""));
14747
14747
  }
14748
14748
  function updateStaticAttributeWithLocalStyle(ms, prop, offset, collector, content = prop.value?.content) {
14749
14749
  if (!prop.value) return;
@@ -14757,7 +14757,7 @@ function updateDirectiveExpression(ms, prop, offset, jsHandler, runtimeSet) {
14757
14757
  const start = offset + prop.exp.loc.start.offset;
14758
14758
  const end = offset + prop.exp.loc.end.offset;
14759
14759
  if (start >= end) return;
14760
- const generated = require_context.generateCode(expression, {
14760
+ const generated = require_wxml.generateCode(expression, {
14761
14761
  jsHandler,
14762
14762
  runtimeSet,
14763
14763
  wrapExpression: true
@@ -14771,7 +14771,7 @@ function updateDirectiveExpressionWithLocalStyle(ms, prop, offset, jsHandler, co
14771
14771
  const end = offset + prop.exp.loc.end.offset;
14772
14772
  if (start >= end) return;
14773
14773
  collector.collectRuntimeClasses(expression, { wrapExpression: true });
14774
- const generated = require_context.generateCode(expression, {
14774
+ const generated = require_wxml.generateCode(expression, {
14775
14775
  jsHandler,
14776
14776
  runtimeSet,
14777
14777
  wrapExpression: true
@@ -14831,7 +14831,7 @@ function parseSfc(code) {
14831
14831
  function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
14832
14832
  if (!UVUE_NVUE_RE.test(id)) return;
14833
14833
  const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
14834
- const matchCustomAttribute = require_context.createAttributeMatcher(customAttributesEntities);
14834
+ const matchCustomAttribute = require_wxml.createAttributeMatcher(customAttributesEntities);
14835
14835
  const ms = new magic_string.default(code);
14836
14836
  const descriptor = parseSfc(code);
14837
14837
  const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
@@ -1,4 +1,4 @@
1
- import { c as createAttributeMatcher, d as JsTokenUpdater, f as _defineProperty, h as babelParse, m as replaceWxml, p as isClassContextLiteralPath, s as generateCode, u as analyzeSource } from "./context-DzkSFEVL.mjs";
1
+ import { _ as babelParse, a as analyzeSource, c as _defineProperty, f as isClassContextLiteralPath, g as replaceWxml, i as createAttributeMatcher, r as generateCode, s as JsTokenUpdater } from "./wxml-DdGdeqaH.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
4
4
  import MagicString from "magic-string";
@@ -1,13 +1,4 @@
1
- const require_rolldown_runtime = require("./rolldown-runtime-emK7D4bc.js");
2
- const require_framework = require("./framework.js");
3
- let node_process = require("node:process");
4
- node_process = require_rolldown_runtime.__toESM(node_process);
5
1
  require("@weapp-tailwindcss/shared");
6
- //#region src/utils/uni-platform.ts
7
- function resolveUniUtsPlatform(value = node_process.default.env["UNI_UTS_PLATFORM"]) {
8
- return require_framework.resolveUniUtsPlatform(value);
9
- }
10
- //#endregion
11
2
  //#region src/utils/index.ts
12
3
  function classifyEntry(filename, options) {
13
4
  if (options.cssMatcher(filename)) return "css";
@@ -38,9 +29,3 @@ Object.defineProperty(exports, "getGroupedEntries", {
38
29
  return getGroupedEntries;
39
30
  }
40
31
  });
41
- Object.defineProperty(exports, "resolveUniUtsPlatform", {
42
- enumerable: true,
43
- get: function() {
44
- return resolveUniUtsPlatform;
45
- }
46
- });
@@ -1,11 +1,4 @@
1
- import { resolveUniUtsPlatform as resolveUniUtsPlatform$1 } from "./framework.mjs";
2
- import process from "node:process";
3
1
  import { defu, defuOverrideArray as defuOverrideArray$1, isMap, noop } from "@weapp-tailwindcss/shared";
4
- //#region src/utils/uni-platform.ts
5
- function resolveUniUtsPlatform(value = process.env["UNI_UTS_PLATFORM"]) {
6
- return resolveUniUtsPlatform$1(value);
7
- }
8
- //#endregion
9
2
  //#region src/utils/index.ts
10
3
  function classifyEntry(filename, options) {
11
4
  if (options.cssMatcher(filename)) return "css";
@@ -30,4 +23,4 @@ function getGroupedEntries(entries, options) {
30
23
  return groups;
31
24
  }
32
25
  //#endregion
33
- export { noop as a, isMap as i, defuOverrideArray$1 as n, resolveUniUtsPlatform as o, getGroupedEntries as r, defu as t };
26
+ export { noop as a, isMap as i, defuOverrideArray$1 as n, getGroupedEntries as r, defu as t };