weapp-tailwindcss 5.0.0-next.30 → 5.0.0-next.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-DEHRmEAx.mjs +200 -0
- package/dist/auto-dPpsm6FB.js +238 -0
- package/dist/{bundle-state-Bi-cQua6.mjs → bundle-state-BIsgsoNW.mjs} +2 -2
- package/dist/{bundle-state-Ct_8GcSR.js → bundle-state-C4ib5xPG.js} +3 -3
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +10 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css-macro/auto.d.ts +2 -1
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{generator-CrU-Ghc1.js → generator-BEXaaUzP.js} +1 -1
- package/dist/{generator-Qw-tZ0Z2.mjs → generator-CpsHA4Wd.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/gulp.js +7 -7
- package/dist/gulp.mjs +6 -6
- package/dist/{incremental-runtime-class-set-BxvZONkv.js → incremental-runtime-class-set-CLP1Qv8F.js} +266 -11
- package/dist/{incremental-runtime-class-set-BdZHkoTs.mjs → incremental-runtime-class-set-D2fsgk5t.mjs} +260 -11
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/{postcss-C6zOQqlL.mjs → postcss-BvkdIZr8.mjs} +3 -3
- package/dist/{postcss-DAWf9D3C.js → postcss-DN7IQzYb.js} +4 -4
- package/dist/postcss.js +1 -1
- package/dist/postcss.mjs +1 -1
- package/dist/{precheck-D7gJSmJz.js → precheck-CQeqnfo5.js} +4 -4
- package/dist/{precheck-D7K12zeX.mjs → precheck-nITnYBDn.mjs} +3 -3
- package/dist/presets.js +4 -4
- package/dist/presets.mjs +3 -3
- package/dist/{source-candidates-DNM8iwXW.js → source-candidates-7Q-kTOSb.js} +1 -1
- package/dist/{source-candidates-CX2ozpKM.mjs → source-candidates-_x8bq0Mz.mjs} +1 -1
- package/dist/{tailwindcss-B-e2RiXr.js → tailwindcss-Cl7hUlYV.js} +3 -3
- package/dist/{tailwindcss-C7dJHZ0G.mjs → tailwindcss-udhXxMX9.mjs} +2 -2
- package/dist/{v3-engine-DcvCCHfs.mjs → v3-engine-C_KeUQG3.mjs} +6 -6
- package/dist/{v3-engine-CHItlVq5.js → v3-engine-DwY4Fixu.js} +7 -7
- package/dist/{vite-rmL1rsA_.mjs → vite-BAHjBu8j.mjs} +17 -10
- package/dist/{vite-C65DdWEj.js → vite-CYkkJZ3Q.js} +18 -11
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +328 -12
- package/dist/{webpack-CqGvjvSQ.js → webpack-CPwDaKy3.js} +8 -8
- package/dist/{webpack-BU2Er4qg.mjs → webpack-xxmiRxcy.mjs} +7 -7
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +4 -4
- package/dist/auto-TH1jG2UW.js +0 -115
- package/dist/auto-XyKTOP7B.mjs +0 -78
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { m as replaceWxml, r as resolveStyleOptionsFromContext } from "./precheck-
|
|
2
|
-
import { B as createDebug, D as loadTailwindV4DesignSystem, E as filterUnsupportedMiniProgramTailwindV4Candidates, R as resolveTailwindV4CssSourceBase, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, q as omitUndefined, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-
|
|
3
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { m as replaceWxml, r as resolveStyleOptionsFromContext } from "./precheck-nITnYBDn.mjs";
|
|
2
|
+
import { B as createDebug, D as loadTailwindV4DesignSystem, E as filterUnsupportedMiniProgramTailwindV4Candidates, R as resolveTailwindV4CssSourceBase, S as resolveTailwindV4SourceOptionsFromPatcher, h as resolveTailwindV4EntriesFromCss, l as getRuntimeClassSetSignature, n as resolveTailwindV3SourceFromPatcher, q as omitUndefined, r as resolveTailwindV3SourceOptionsFromPatcher, t as resolveTailwindV3Source, x as resolveTailwindV4SourceFromPatcher, y as resolveTailwindV4Source$1 } from "./v3-engine-C_KeUQG3.mjs";
|
|
3
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-CpsHA4Wd.mjs";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import postcss from "postcss";
|
|
6
|
-
import path from "node:path";
|
|
7
6
|
import process from "node:process";
|
|
7
|
+
import path from "node:path";
|
|
8
8
|
import { extractRawCandidatesWithPositions, extractSourceCandidates, extractValidCandidates } from "tailwindcss-patch";
|
|
9
9
|
import { finalizeMiniProgramCss, removeUnsupportedMiniProgramAtRules } from "@weapp-tailwindcss/postcss";
|
|
10
10
|
//#region src/bundlers/shared/generator-css/markers.ts
|
|
@@ -104,6 +104,11 @@ const TAILWIND_ROOT_DIRECTIVE_RE = /@(?:import\s+(?:url\(\s*)?["']?tailwindcss4?
|
|
|
104
104
|
const TAILWIND_EXTRACTABLE_DIRECTIVE_RE = /^\s*@(?:import|use|forward|tailwind|config|source|reference|plugin)\b[\s\S]*?(?:;|$)/;
|
|
105
105
|
const TAILWIND_EXTRACTABLE_LAYER_STATEMENT_RE = /^\s*@layer\s[^;{]+;\s*$/;
|
|
106
106
|
const TAILWIND_EXTRACTABLE_BLOCK_START_RE = /^\s*@(?:layer|theme|utility|variant|custom-variant)\b[\s\S]*\{/;
|
|
107
|
+
const TAILWIND_V3_SUBPATH_IMPORT_LAYERS = new Map([
|
|
108
|
+
["tailwindcss/base", "base"],
|
|
109
|
+
["tailwindcss/components", "components"],
|
|
110
|
+
["tailwindcss/utilities", "utilities"]
|
|
111
|
+
]);
|
|
107
112
|
function parseImportRequest(params) {
|
|
108
113
|
return /^(?:url\(\s*)?(["']?)([^"')\s]+)\1\s*\)?/.exec(params.trim())?.[2];
|
|
109
114
|
}
|
|
@@ -283,6 +288,24 @@ function hasPreprocessorOnlySyntax(rawSource) {
|
|
|
283
288
|
function normalizeTailwindSourceForGenerator(rawSource, options = {}) {
|
|
284
289
|
return hasPreprocessorOnlySyntax(rawSource) ? extractTailwindSourceForPostcssFallback(rawSource, options) ?? rawSource : rawSource;
|
|
285
290
|
}
|
|
291
|
+
function normalizeTailwindV3CssEntrySource(rawSource) {
|
|
292
|
+
try {
|
|
293
|
+
const root = postcss.parse(rawSource);
|
|
294
|
+
let changed = false;
|
|
295
|
+
root.walkAtRules("import", (node) => {
|
|
296
|
+
const layer = TAILWIND_V3_SUBPATH_IMPORT_LAYERS.get(parseImportRequest(node.params) ?? "");
|
|
297
|
+
if (!layer) return;
|
|
298
|
+
node.replaceWith(postcss.atRule({
|
|
299
|
+
name: "tailwind",
|
|
300
|
+
params: layer
|
|
301
|
+
}));
|
|
302
|
+
changed = true;
|
|
303
|
+
});
|
|
304
|
+
return changed ? root.toString() : rawSource;
|
|
305
|
+
} catch {
|
|
306
|
+
return rawSource;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
286
309
|
function normalizeTailwindSourceDirectives(rawSource, options = {}) {
|
|
287
310
|
if (!options.importFallback) return rawSource;
|
|
288
311
|
try {
|
|
@@ -1018,14 +1041,14 @@ async function resolveGeneratorSource(majorVersion, runtimeState, rawSource, fil
|
|
|
1018
1041
|
css: rawSource
|
|
1019
1042
|
} : void 0;
|
|
1020
1043
|
const sourceSideEntrySource = canResolveSourceSideCssEntry(file, cssHandlerOptions) ? resolveSourceSideCssEntrySource(file, mergedSourceOptions, { removeConfig: true }) : void 0;
|
|
1021
|
-
const resolvedEntrySource = shouldResolveSourceSideCssEntry(rawSource) ?
|
|
1044
|
+
const resolvedEntrySource = shouldResolveSourceSideCssEntry(rawSource) ? cssEntrySource ?? applyEntrySource ?? sourceSideEntrySource : shouldPreferTailwindV3SourceSideEntry(rawSource, sourceSideEntrySource) ? sourceSideEntrySource ?? cssEntrySource : cssEntrySource ?? applyEntrySource ?? sourceSideEntrySource;
|
|
1022
1045
|
if (!resolvedEntrySource) return generatorOptions?.config ? resolveTailwindV3Source(mergedSourceOptions) : resolveTailwindV3SourceFromPatcher(runtimeState.twPatcher);
|
|
1023
1046
|
if (cssEntrySource && !sourceSideEntrySource && !applyEntrySource && !hasTailwindRootDirectives(rawSource, { importFallback: true })) return generatorOptions?.config ? resolveTailwindV3Source(mergedSourceOptions) : resolveTailwindV3SourceFromPatcher(runtimeState.twPatcher);
|
|
1024
1047
|
const config = resolveExistingConfigPath(resolvedEntrySource.config, resolvedEntrySource.configRequest, file, omitUndefined(mergedSourceOptions));
|
|
1025
1048
|
return resolveTailwindV3Source({
|
|
1026
1049
|
...mergedSourceOptions,
|
|
1027
1050
|
base: resolvedEntrySource.base,
|
|
1028
|
-
css: resolvedEntrySource.css,
|
|
1051
|
+
css: normalizeTailwindV3CssEntrySource(resolvedEntrySource.css),
|
|
1029
1052
|
...config ? { config } : {}
|
|
1030
1053
|
});
|
|
1031
1054
|
}
|
|
@@ -1372,6 +1395,125 @@ function inheritLegacyUnitConvertedDeclarations(css, legacyCss) {
|
|
|
1372
1395
|
}
|
|
1373
1396
|
}
|
|
1374
1397
|
//#endregion
|
|
1398
|
+
//#region src/bundlers/shared/generator-css/user-layer-order.ts
|
|
1399
|
+
const USER_LAYER_COMPONENTS_START = "/*! weapp-tailwindcss layer components start */";
|
|
1400
|
+
const USER_LAYER_COMPONENTS_END = "/*! weapp-tailwindcss layer components end */";
|
|
1401
|
+
const UTILITY_LAYER_INSERTION_RES = [
|
|
1402
|
+
/(^|\n)\.(?:fixed|absolute|relative|sticky|static)\s*\{/,
|
|
1403
|
+
/(^|\n)\.(?:block|inline-block|inline|flex|inline-flex|grid|hidden)\s*\{/,
|
|
1404
|
+
/(^|\n)\.(?:m|mx|my|mt|mr|mb|ml|p|px|py|pt|pr|pb|pl)-/,
|
|
1405
|
+
/(^|\n)\.(?:w|h|min-w|min-h|max-w|max-h)-/,
|
|
1406
|
+
/(^|\n)\.(?:bg|text|border|rounded|shadow|opacity|transition|transform|translate|scale|rotate|gap|items|justify|content)-/
|
|
1407
|
+
];
|
|
1408
|
+
function appendCss(base, extra) {
|
|
1409
|
+
if (!base) return extra;
|
|
1410
|
+
if (!extra) return base;
|
|
1411
|
+
if (/\s$/.test(base) || /^\s/.test(extra)) return `${base}${extra}`;
|
|
1412
|
+
return `${base}\n${extra}`;
|
|
1413
|
+
}
|
|
1414
|
+
function removeFirstCssOccurrence(css, chunk) {
|
|
1415
|
+
const trimmed = chunk.trim();
|
|
1416
|
+
if (!trimmed) return css;
|
|
1417
|
+
const index = css.indexOf(trimmed);
|
|
1418
|
+
if (index === -1) return css;
|
|
1419
|
+
return appendCss(css.slice(0, index).trimEnd(), css.slice(index + trimmed.length).trimStart());
|
|
1420
|
+
}
|
|
1421
|
+
function collectSelectorsFromCss(css) {
|
|
1422
|
+
const selectors = /* @__PURE__ */ new Set();
|
|
1423
|
+
try {
|
|
1424
|
+
postcss.parse(css).walkRules((rule) => {
|
|
1425
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
1426
|
+
const normalized = selector.trim();
|
|
1427
|
+
if (normalized) selectors.add(normalized);
|
|
1428
|
+
}
|
|
1429
|
+
});
|
|
1430
|
+
} catch {}
|
|
1431
|
+
return selectors;
|
|
1432
|
+
}
|
|
1433
|
+
function matchesLayerSelector(selector, layerSelector) {
|
|
1434
|
+
if (selector === layerSelector) return true;
|
|
1435
|
+
if (!selector.startsWith(layerSelector)) return false;
|
|
1436
|
+
const next = selector[layerSelector.length];
|
|
1437
|
+
return next === ":" || next === "[";
|
|
1438
|
+
}
|
|
1439
|
+
function removeCssRulesForSelectors(css, layerCss) {
|
|
1440
|
+
const selectors = [...collectSelectorsFromCss(layerCss)];
|
|
1441
|
+
if (selectors.length === 0) return css;
|
|
1442
|
+
try {
|
|
1443
|
+
const root = postcss.parse(css);
|
|
1444
|
+
root.walkRules((rule) => {
|
|
1445
|
+
if ((rule.selectors ?? [rule.selector]).some((selector) => selectors.some((layerSelector) => matchesLayerSelector(selector.trim(), layerSelector)))) rule.remove();
|
|
1446
|
+
});
|
|
1447
|
+
return root.toString();
|
|
1448
|
+
} catch {
|
|
1449
|
+
return removeFirstCssOccurrence(css, layerCss);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
function wrapUserLayerComponentsCss(css) {
|
|
1453
|
+
return css.trim().length > 0 ? `${USER_LAYER_COMPONENTS_START}\n${css}\n${USER_LAYER_COMPONENTS_END}` : css;
|
|
1454
|
+
}
|
|
1455
|
+
function extractMarkedUserLayerComponentsCss(css) {
|
|
1456
|
+
const layers = [];
|
|
1457
|
+
let rest = "";
|
|
1458
|
+
let cursor = 0;
|
|
1459
|
+
while (cursor < css.length) {
|
|
1460
|
+
const startIndex = css.indexOf(USER_LAYER_COMPONENTS_START, cursor);
|
|
1461
|
+
if (startIndex === -1) {
|
|
1462
|
+
rest += css.slice(cursor);
|
|
1463
|
+
break;
|
|
1464
|
+
}
|
|
1465
|
+
rest += css.slice(cursor, startIndex);
|
|
1466
|
+
const contentStart = startIndex + 47;
|
|
1467
|
+
const endIndex = css.indexOf(USER_LAYER_COMPONENTS_END, contentStart);
|
|
1468
|
+
if (endIndex === -1) {
|
|
1469
|
+
rest += css.slice(startIndex);
|
|
1470
|
+
break;
|
|
1471
|
+
}
|
|
1472
|
+
const layerCss = css.slice(contentStart, endIndex).trim();
|
|
1473
|
+
if (layerCss) layers.push(layerCss);
|
|
1474
|
+
cursor = endIndex + 45;
|
|
1475
|
+
}
|
|
1476
|
+
return {
|
|
1477
|
+
layers,
|
|
1478
|
+
rest
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
function findUtilityLayerInsertionIndex(css) {
|
|
1482
|
+
let index = -1;
|
|
1483
|
+
for (const pattern of UTILITY_LAYER_INSERTION_RES) {
|
|
1484
|
+
const match = pattern.exec(css);
|
|
1485
|
+
if (!match) continue;
|
|
1486
|
+
const nextIndex = match.index + (match[1]?.length ?? 0);
|
|
1487
|
+
index = index === -1 ? nextIndex : Math.min(index, nextIndex);
|
|
1488
|
+
}
|
|
1489
|
+
return index;
|
|
1490
|
+
}
|
|
1491
|
+
function reorderMarkedUserLayerComponentsCss(css) {
|
|
1492
|
+
if (!css.includes(USER_LAYER_COMPONENTS_START)) return css;
|
|
1493
|
+
const { layers, rest } = extractMarkedUserLayerComponentsCss(css);
|
|
1494
|
+
if (layers.length === 0) return rest;
|
|
1495
|
+
const layerCss = layers.join("\n");
|
|
1496
|
+
const insertionIndex = findUtilityLayerInsertionIndex(rest);
|
|
1497
|
+
if (insertionIndex === -1) return appendCss(rest, layerCss);
|
|
1498
|
+
return appendCss(appendCss(rest.slice(0, insertionIndex), layerCss), rest.slice(insertionIndex));
|
|
1499
|
+
}
|
|
1500
|
+
function mergeMarkedUserLayerComponentsCss(baseCss, markedCss) {
|
|
1501
|
+
if (!markedCss.includes(USER_LAYER_COMPONENTS_START)) return {
|
|
1502
|
+
css: baseCss,
|
|
1503
|
+
merged: false
|
|
1504
|
+
};
|
|
1505
|
+
const { layers } = extractMarkedUserLayerComponentsCss(markedCss);
|
|
1506
|
+
if (layers.length === 0) return {
|
|
1507
|
+
css: baseCss,
|
|
1508
|
+
merged: false
|
|
1509
|
+
};
|
|
1510
|
+
const layerCss = layers.join("\n");
|
|
1511
|
+
return {
|
|
1512
|
+
css: reorderMarkedUserLayerComponentsCss(appendCss(removeCssRulesForSelectors(baseCss, layerCss), wrapUserLayerComponentsCss(layerCss))),
|
|
1513
|
+
merged: true
|
|
1514
|
+
};
|
|
1515
|
+
}
|
|
1516
|
+
//#endregion
|
|
1375
1517
|
//#region src/bundlers/shared/generator-css.ts
|
|
1376
1518
|
const SUPPORTED_GENERATOR_MAJOR_VERSIONS = new Set([3, 4]);
|
|
1377
1519
|
const REMOTE_IMPORT_RE = /^(?:https?:)?\/\//i;
|
|
@@ -1445,6 +1587,9 @@ function createCssSourceOrderAppend(base, extra) {
|
|
|
1445
1587
|
if (/\s$/.test(base) || /^\s/.test(extra)) return `${base}${extra}`;
|
|
1446
1588
|
return `${base}\n${extra}`;
|
|
1447
1589
|
}
|
|
1590
|
+
function shouldFinalizeMarkedUserLayerComponentsCss(file) {
|
|
1591
|
+
return !/\.(?:vue|svelte|astro|scss|sass|less|styl)(?:[?#].*)?$/i.test(file);
|
|
1592
|
+
}
|
|
1448
1593
|
function splitRawSourceByGeneratedCssOrder(rawSource, rawTailwindCss) {
|
|
1449
1594
|
const placeholderParts = splitGeneratorPlaceholderCssBySourceOrder(rawSource, rawTailwindCss);
|
|
1450
1595
|
if (placeholderParts) return placeholderParts;
|
|
@@ -1452,6 +1597,84 @@ function splitRawSourceByGeneratedCssOrder(rawSource, rawTailwindCss) {
|
|
|
1452
1597
|
if (exactParts) return exactParts;
|
|
1453
1598
|
return splitTailwindGeneratedCssByBanner(rawSource);
|
|
1454
1599
|
}
|
|
1600
|
+
function splitUserCssLayerBlocks(source) {
|
|
1601
|
+
if (!source.includes("@layer")) return {
|
|
1602
|
+
layer: "",
|
|
1603
|
+
rest: source
|
|
1604
|
+
};
|
|
1605
|
+
try {
|
|
1606
|
+
const root = postcss.parse(source);
|
|
1607
|
+
const layerRoot = postcss.root();
|
|
1608
|
+
const restRoot = postcss.root();
|
|
1609
|
+
for (const node of root.nodes) (node.type === "atrule" && node.name === "layer" && node.nodes?.length ? layerRoot : restRoot).append(node.clone());
|
|
1610
|
+
return {
|
|
1611
|
+
layer: layerRoot.toString(),
|
|
1612
|
+
rest: restRoot.toString()
|
|
1613
|
+
};
|
|
1614
|
+
} catch {
|
|
1615
|
+
return {
|
|
1616
|
+
layer: source,
|
|
1617
|
+
rest: ""
|
|
1618
|
+
};
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
function hasUserCssLayerBlocks(source) {
|
|
1622
|
+
if (!source.includes("@layer")) return false;
|
|
1623
|
+
try {
|
|
1624
|
+
let hasLayerBlock = false;
|
|
1625
|
+
postcss.parse(source).walkAtRules("layer", (node) => {
|
|
1626
|
+
if (node.nodes?.length) hasLayerBlock = true;
|
|
1627
|
+
});
|
|
1628
|
+
return hasLayerBlock;
|
|
1629
|
+
} catch {
|
|
1630
|
+
return true;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
function collectUserLayerSelectors(source) {
|
|
1634
|
+
const selectors = /* @__PURE__ */ new Set();
|
|
1635
|
+
try {
|
|
1636
|
+
postcss.parse(source).walkRules((rule) => {
|
|
1637
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
1638
|
+
const normalized = selector.trim();
|
|
1639
|
+
if (normalized) selectors.add(normalized);
|
|
1640
|
+
}
|
|
1641
|
+
});
|
|
1642
|
+
} catch {}
|
|
1643
|
+
return selectors;
|
|
1644
|
+
}
|
|
1645
|
+
function matchesUserLayerSelector(selector, userLayerSelector) {
|
|
1646
|
+
if (selector === userLayerSelector) return true;
|
|
1647
|
+
if (!selector.startsWith(userLayerSelector)) return false;
|
|
1648
|
+
const next = selector[userLayerSelector.length];
|
|
1649
|
+
return next === ":" || next === "[";
|
|
1650
|
+
}
|
|
1651
|
+
function extractGeneratedCssForUserLayerSelectors(css, userLayerSource) {
|
|
1652
|
+
const selectors = collectUserLayerSelectors(userLayerSource);
|
|
1653
|
+
if (selectors.size === 0) return {
|
|
1654
|
+
layer: "",
|
|
1655
|
+
rest: css
|
|
1656
|
+
};
|
|
1657
|
+
try {
|
|
1658
|
+
const root = postcss.parse(css);
|
|
1659
|
+
const layerRoot = postcss.root();
|
|
1660
|
+
const selectorList = [...selectors];
|
|
1661
|
+
root.walkRules((rule) => {
|
|
1662
|
+
if ((rule.selectors ?? [rule.selector]).some((selector) => selectorList.some((userSelector) => matchesUserLayerSelector(selector.trim(), userSelector)))) {
|
|
1663
|
+
layerRoot.append(rule.clone());
|
|
1664
|
+
rule.remove();
|
|
1665
|
+
}
|
|
1666
|
+
});
|
|
1667
|
+
return {
|
|
1668
|
+
layer: layerRoot.toString(),
|
|
1669
|
+
rest: root.toString()
|
|
1670
|
+
};
|
|
1671
|
+
} catch {
|
|
1672
|
+
return {
|
|
1673
|
+
layer: "",
|
|
1674
|
+
rest: css
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1455
1678
|
async function transformGeneratorUserCss(source, options) {
|
|
1456
1679
|
if (source.trim().length === 0) return "";
|
|
1457
1680
|
const cleanedSource = removeTailwindSourceDirectives(stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(source)), { importFallback: options.importFallback });
|
|
@@ -1580,7 +1803,7 @@ async function generateCssByGenerator(options) {
|
|
|
1580
1803
|
sources: generatedResults.flatMap((item) => item.sources)
|
|
1581
1804
|
};
|
|
1582
1805
|
debug("tailwind generator result: %s rawBytes=%d cssBytes=%d candidates=%d", file, generated.rawCss.length, generated.css.length, generated.classSet.size);
|
|
1583
|
-
if (typeof options.previousCss === "string" && typeof generated.incrementalCss === "string") {
|
|
1806
|
+
if ((generated.target !== "weapp" || !hasUserCssLayerBlocks(effectiveRawSource)) && typeof options.previousCss === "string" && typeof generated.incrementalCss === "string") {
|
|
1584
1807
|
const incrementalCss = stripTailwindBanner(generated.incrementalCss);
|
|
1585
1808
|
return {
|
|
1586
1809
|
css: incrementalCss.trim().length > 0 ? createCssAppend(options.previousCss, finalizeMiniProgramGeneratorCss(incrementalCss, generated.target, majorVersion, opts.cssPreflight, { injectPreflight: false })) : options.previousCss,
|
|
@@ -1602,9 +1825,14 @@ async function generateCssByGenerator(options) {
|
|
|
1602
1825
|
styleHandler,
|
|
1603
1826
|
importFallback: generatorOptions.importFallback
|
|
1604
1827
|
};
|
|
1828
|
+
const afterLayerParts = generated.target === "weapp" ? splitUserCssLayerBlocks(orderedExtraCss.after) : {
|
|
1829
|
+
layer: "",
|
|
1830
|
+
rest: orderedExtraCss.after
|
|
1831
|
+
};
|
|
1605
1832
|
const beforeUserCss = await transformGeneratorUserCss(orderedExtraCss.before, userCssOptions);
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1833
|
+
const afterLayerUserCss = await transformGeneratorUserCss(afterLayerParts.layer, userCssOptions);
|
|
1834
|
+
const afterUserCss = await transformGeneratorUserCss(afterLayerParts.rest, userCssOptions);
|
|
1835
|
+
css = createCssSourceOrderAppend(createCssSourceOrderAppend(createCssSourceOrderAppend(beforeUserCss, generated.target === "weapp" ? wrapUserLayerComponentsCss(afterLayerUserCss) : afterLayerUserCss), css), afterUserCss);
|
|
1608
1836
|
if (isEmptyCssSourceOrderParts(orderedExtraCss) && shouldAppendWebBundleCssFallback(generated.target, {
|
|
1609
1837
|
hasSourceDirectives,
|
|
1610
1838
|
hasMatchedCssSourceFile
|
|
@@ -1613,6 +1841,7 @@ async function generateCssByGenerator(options) {
|
|
|
1613
1841
|
css = createCssSourceOrderAppend(css, userCss);
|
|
1614
1842
|
}
|
|
1615
1843
|
if (generated.target === "weapp") {
|
|
1844
|
+
if (shouldFinalizeMarkedUserLayerComponentsCss(file)) css = reorderMarkedUserLayerComponentsCss(css);
|
|
1616
1845
|
css = await appendLegacyCompatCss(css, effectiveRawSource, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1617
1846
|
css = await appendLegacyContainerCompatCss(css, effectiveRawSource, file, runtime, configuredContainerCompat, generated.target, styleHandler, cssHandlerOptions, generatorStyleOptions);
|
|
1618
1847
|
}
|
|
@@ -1625,7 +1854,27 @@ async function generateCssByGenerator(options) {
|
|
|
1625
1854
|
}
|
|
1626
1855
|
debug("tailwind direct css generation prefix mismatch, append transformed bundle css %s", file);
|
|
1627
1856
|
let css = stripTailwindBanner(generated.css);
|
|
1628
|
-
if (generated.target === "weapp")
|
|
1857
|
+
if (generated.target === "weapp") {
|
|
1858
|
+
css = inheritLegacyUnitConvertedDeclarations(css, effectiveRawSource);
|
|
1859
|
+
if (hasUserCssLayerBlocks(effectiveRawSource)) {
|
|
1860
|
+
const layerParts = splitUserCssLayerBlocks(effectiveRawSource);
|
|
1861
|
+
const layerUserCss = await transformGeneratorUserCss(layerParts.layer, {
|
|
1862
|
+
generatorTarget: generated.target,
|
|
1863
|
+
generatorStyleOptions,
|
|
1864
|
+
cssUserHandlerOptions,
|
|
1865
|
+
styleHandler,
|
|
1866
|
+
importFallback: generatorOptions.importFallback
|
|
1867
|
+
});
|
|
1868
|
+
const layerCss = layerUserCss.trim().length > 0 && !hasTailwindApplyDirective(layerUserCss) ? {
|
|
1869
|
+
layer: layerUserCss,
|
|
1870
|
+
rest: css
|
|
1871
|
+
} : extractGeneratedCssForUserLayerSelectors(css, layerParts.layer);
|
|
1872
|
+
if (layerCss.layer.trim().length > 0) {
|
|
1873
|
+
css = createCssSourceOrderAppend(wrapUserLayerComponentsCss(layerCss.layer), layerCss.rest);
|
|
1874
|
+
if (shouldFinalizeMarkedUserLayerComponentsCss(file)) css = reorderMarkedUserLayerComponentsCss(css);
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
}
|
|
1629
1878
|
if (hasMatchedCssSourceFile || generated.target === "web") {
|
|
1630
1879
|
if (shouldAppendWebBundleCssFallback(generated.target, {
|
|
1631
1880
|
hasSourceDirectives,
|
|
@@ -1972,4 +2221,4 @@ function createBundleRuntimeClassSetManager(options = {}) {
|
|
|
1972
2221
|
};
|
|
1973
2222
|
}
|
|
1974
2223
|
//#endregion
|
|
1975
|
-
export { validateCandidatesByGenerator as a,
|
|
2224
|
+
export { validateCandidatesByGenerator as a, hasTailwindRootDirectives as c, hasTailwindGeneratedCssMarkers as d, generateCssByGenerator as i, hasTailwindSourceDirectives as l, createHmrTimingRecorder as n, mergeMarkedUserLayerComponentsCss as o, emitHmrTiming as r, processCachedTask as s, createBundleRuntimeClassSetManager as t, normalizeTailwindSourceForGenerator as u };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_generator = require("./generator-BEXaaUzP.js");
|
|
3
3
|
const require_gulp = require("./gulp.js");
|
|
4
|
-
const require_postcss = require("./postcss-
|
|
5
|
-
const require_vite = require("./vite-
|
|
6
|
-
const require_webpack = require("./webpack-
|
|
4
|
+
const require_postcss = require("./postcss-DN7IQzYb.js");
|
|
5
|
+
const require_vite = require("./vite-CYkkJZ3Q.js");
|
|
6
|
+
const require_webpack = require("./webpack-CPwDaKy3.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-
|
|
1
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-CpsHA4Wd.mjs";
|
|
2
2
|
import { WeappTailwindcss as createPlugins } from "./gulp.mjs";
|
|
3
|
-
import { t as weappTailwindcssPostcssPlugin } from "./postcss-
|
|
4
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
5
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
3
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-BvkdIZr8.mjs";
|
|
4
|
+
import { t as WeappTailwindcss } from "./vite-BAHjBu8j.mjs";
|
|
5
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-xxmiRxcy.mjs";
|
|
6
6
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
7
7
|
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as collectCssInlineSourceCandidates, F as parseConfigParam, H as readInstalledPackageMajorVersion, I as resolveCssSourceEntries, M as expandTailwindSourceEntries, O as DEFAULT_SOURCE_SCAN_EXTENSIONS, P as normalizeLegacyContentEntries, j as createSourceScanPattern, t as resolveTailwindV3Source, y as resolveTailwindV4Source$1 } from "./v3-engine-
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { A as collectCssInlineSourceCandidates, F as parseConfigParam, H as readInstalledPackageMajorVersion, I as resolveCssSourceEntries, M as expandTailwindSourceEntries, O as DEFAULT_SOURCE_SCAN_EXTENSIONS, P as normalizeLegacyContentEntries, j as createSourceScanPattern, t as resolveTailwindV3Source, y as resolveTailwindV4Source$1 } from "./v3-engine-C_KeUQG3.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-CpsHA4Wd.mjs";
|
|
3
3
|
import postcss from "postcss";
|
|
4
|
-
import path from "node:path";
|
|
5
4
|
import process from "node:process";
|
|
5
|
+
import path from "node:path";
|
|
6
6
|
import { extractRawCandidatesWithPositions, extractValidCandidates } from "tailwindcss-patch";
|
|
7
7
|
import { readFile } from "node:fs/promises";
|
|
8
8
|
import { loadConfig } from "tailwindcss-config";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_generator = require("./generator-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
|
|
3
|
+
const require_generator = require("./generator-BEXaaUzP.js");
|
|
4
4
|
let postcss = require("postcss");
|
|
5
5
|
postcss = require_chunk.__toESM(postcss);
|
|
6
|
-
let node_path = require("node:path");
|
|
7
|
-
node_path = require_chunk.__toESM(node_path);
|
|
8
6
|
let node_process = require("node:process");
|
|
9
7
|
node_process = require_chunk.__toESM(node_process);
|
|
8
|
+
let node_path = require("node:path");
|
|
9
|
+
node_path = require_chunk.__toESM(node_path);
|
|
10
10
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
11
11
|
let node_fs_promises = require("node:fs/promises");
|
|
12
12
|
let tailwindcss_config = require("tailwindcss-config");
|
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-
|
|
5
|
+
const require_postcss = require("./postcss-DN7IQzYb.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-
|
|
1
|
+
import { t as weappTailwindcssPostcssPlugin } from "./postcss-BvkdIZr8.mjs";
|
|
2
2
|
export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
|
|
3
3
|
const require_defaults = require("./defaults-zKUH2mDe.js");
|
|
4
4
|
require("./utils-D7Ygohep.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
6
|
-
let node_path = require("node:path");
|
|
7
|
-
node_path = require_chunk.__toESM(node_path);
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-Cl7hUlYV.js");
|
|
8
6
|
let node_process = require("node:process");
|
|
9
7
|
node_process = require_chunk.__toESM(node_process);
|
|
8
|
+
let node_path = require("node:path");
|
|
9
|
+
node_path = require_chunk.__toESM(node_path);
|
|
10
10
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
11
11
|
let node_fs_promises = require("node:fs/promises");
|
|
12
12
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { B as createDebug, C as createTailwindV4Engine, K as resolveBooleanObjectOption, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, q as omitUndefined, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-
|
|
1
|
+
import { B as createDebug, C as createTailwindV4Engine, K as resolveBooleanObjectOption, c as getRuntimeClassSetCacheEntry, d as invalidateRuntimeClassSet, q as omitUndefined, s as ensureTailwindcssRuntimePatch, u as getRuntimeClassSetSignatureWithSources, x as resolveTailwindV4SourceFromPatcher } from "./v3-engine-C_KeUQG3.mjs";
|
|
2
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";
|
|
3
3
|
import { i as isMap, n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
4
|
-
import { a as applyV4CssCalcDefaults, i as resolveUniAppXOptions, o as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-
|
|
4
|
+
import { a as applyV4CssCalcDefaults, i as resolveUniAppXOptions, o as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-udhXxMX9.mjs";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
|
-
import path from "node:path";
|
|
7
6
|
import process from "node:process";
|
|
7
|
+
import path from "node:path";
|
|
8
8
|
import { logger, pc } from "@weapp-tailwindcss/logger";
|
|
9
9
|
import { rm } from "node:fs/promises";
|
|
10
10
|
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
package/dist/presets.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
3
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
|
|
4
4
|
const require_utils = require("./utils-D7Ygohep.js");
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-Cl7hUlYV.js");
|
|
6
6
|
require("./logger-TlKT3xmR.js");
|
|
7
|
-
let node_path = require("node:path");
|
|
8
|
-
node_path = require_chunk.__toESM(node_path);
|
|
9
7
|
let node_process = require("node:process");
|
|
10
8
|
node_process = require_chunk.__toESM(node_process);
|
|
9
|
+
let node_path = require("node:path");
|
|
10
|
+
node_path = require_chunk.__toESM(node_path);
|
|
11
11
|
let local_pkg = require("local-pkg");
|
|
12
12
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
13
13
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
package/dist/presets.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { q as omitUndefined } from "./v3-engine-
|
|
1
|
+
import { q as omitUndefined } from "./v3-engine-C_KeUQG3.mjs";
|
|
2
2
|
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DsaS975I.mjs";
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-udhXxMX9.mjs";
|
|
4
4
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
|
-
import path from "node:path";
|
|
6
5
|
import process from "node:process";
|
|
6
|
+
import path from "node:path";
|
|
7
7
|
import { getPackageInfoSync } from "local-pkg";
|
|
8
8
|
//#region src/presets/shared.ts
|
|
9
9
|
function normalizeCssEntries(entries) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_chunk.__toESM(node_path);
|
|
5
5
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as resolveSourceScanPath, N as isFileMatchedByTailwindSourceEntries, k as FULL_SOURCE_SCAN_EXTENSION_RE, z as toPosixPath } from "./v3-engine-
|
|
1
|
+
import { L as resolveSourceScanPath, N as isFileMatchedByTailwindSourceEntries, k as FULL_SOURCE_SCAN_EXTENSION_RE, z as toPosixPath } from "./v3-engine-C_KeUQG3.mjs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { extractSourceCandidates, resolveProjectSourceFiles } from "tailwindcss-patch";
|
|
4
4
|
import { readFile } from "node:fs/promises";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
2
|
+
const require_v3_engine = require("./v3-engine-DwY4Fixu.js");
|
|
3
3
|
require("./utils-D7Ygohep.js");
|
|
4
4
|
let node_fs = require("node:fs");
|
|
5
5
|
let node_module = require("node:module");
|
|
6
|
-
let node_path = require("node:path");
|
|
7
|
-
node_path = require_chunk.__toESM(node_path);
|
|
8
6
|
let node_process = require("node:process");
|
|
9
7
|
node_process = require_chunk.__toESM(node_process);
|
|
8
|
+
let node_path = require("node:path");
|
|
9
|
+
node_path = require_chunk.__toESM(node_path);
|
|
10
10
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
11
11
|
let node_url = require("node:url");
|
|
12
12
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { G as normalizeStringListOption, H as readInstalledPackageMajorVersion, J as findNearestPackageRoot, V as createTailwindcssPatcher, X as findWorkspaceRoot, Y as findWorkspacePackageDir, f as runtimeSignaturePatchersSymbol, q as omitUndefined } from "./v3-engine-
|
|
1
|
+
import { G as normalizeStringListOption, H as readInstalledPackageMajorVersion, J as findNearestPackageRoot, V as createTailwindcssPatcher, X as findWorkspaceRoot, Y as findWorkspacePackageDir, f as runtimeSignaturePatchersSymbol, q as omitUndefined } from "./v3-engine-C_KeUQG3.mjs";
|
|
2
2
|
import { n as defuOverrideArray } from "./utils-DsaS975I.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
|
-
import path from "node:path";
|
|
6
5
|
import process from "node:process";
|
|
6
|
+
import path from "node:path";
|
|
7
7
|
import { logger } from "@weapp-tailwindcss/logger";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
//#region src/tailwindcss/v4/css-sources.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as transformCssMacroCss, n as hasCssMacroTailwindPlugin, o as withCssMacroStyleOptions, r as hasCssMacroTailwindV4Directive, t as hasCssMacroStyleOptions } from "./auto-
|
|
1
|
+
import { a as transformCssMacroCss, n as hasCssMacroTailwindPlugin, o as withCssMacroStyleOptions, r as hasCssMacroTailwindV4Directive, t as hasCssMacroStyleOptions } from "./auto-DEHRmEAx.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import fs, { existsSync, readFileSync, readdirSync, realpathSync, statSync } from "node:fs";
|
|
4
4
|
import postcss from "postcss";
|
|
5
|
-
import path from "node:path";
|
|
6
5
|
import process from "node:process";
|
|
6
|
+
import path from "node:path";
|
|
7
7
|
import { logger } from "@weapp-tailwindcss/logger";
|
|
8
8
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
9
9
|
import { TailwindcssPatcher, createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveTailwindV4SourceFromPatchOptions } from "tailwindcss-patch";
|
|
@@ -747,7 +747,7 @@ function normalizeTailwindV4GeneratedUrlValues(css) {
|
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
749
|
async function transformTailwindV4CssToWeapp(css, options) {
|
|
750
|
-
const protectedCss = protectDynamicColorMixAlpha(normalizeTailwindV4GeneratedUrlValues(css), { customPropertyValues: options && "customPropertyValues" in options ? options.customPropertyValues : void 0 });
|
|
750
|
+
const protectedCss = protectDynamicColorMixAlpha(normalizeTailwindV4GeneratedUrlValues(hasCssMacroStyleOptions(options) ? await transformCssMacroCss(css, options) : css), { customPropertyValues: options && "customPropertyValues" in options ? options.customPropertyValues : void 0 });
|
|
751
751
|
const result = await defaultStyleHandler$1(protectedCss.css, {
|
|
752
752
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
753
753
|
cssRemoveHoverPseudoClass: true,
|
|
@@ -760,7 +760,7 @@ async function transformTailwindV4CssToWeapp(css, options) {
|
|
|
760
760
|
}
|
|
761
761
|
async function transformTailwindV4CssByTarget(css, target, options) {
|
|
762
762
|
if (target === "weapp") return transformTailwindV4CssToWeapp(css, options);
|
|
763
|
-
return hasCssMacroStyleOptions(options) ? transformCssMacroCss(css) : css;
|
|
763
|
+
return hasCssMacroStyleOptions(options) ? transformCssMacroCss(css, options) : css;
|
|
764
764
|
}
|
|
765
765
|
//#endregion
|
|
766
766
|
//#region src/tailwindcss/v4-engine/tailwind-v3-default-colors.ts
|
|
@@ -2824,7 +2824,7 @@ function ensureMiniProgramV3PreflightReset(css, cssPreflight) {
|
|
|
2824
2824
|
}
|
|
2825
2825
|
}
|
|
2826
2826
|
async function transformTailwindV3CssToWeapp(css, options) {
|
|
2827
|
-
const result = await defaultStyleHandler(css, {
|
|
2827
|
+
const result = await defaultStyleHandler(hasCssMacroStyleOptions(options) ? await transformCssMacroCss(css, options) : css, {
|
|
2828
2828
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
2829
2829
|
cssRemoveHoverPseudoClass: true,
|
|
2830
2830
|
isMainChunk: true,
|
|
@@ -2839,7 +2839,7 @@ async function transformTailwindV3CssToWeapp(css, options) {
|
|
|
2839
2839
|
}
|
|
2840
2840
|
async function transformTailwindV3CssByTarget(css, target, options) {
|
|
2841
2841
|
if (target === "weapp") return transformTailwindV3CssToWeapp(css, options);
|
|
2842
|
-
return hasCssMacroStyleOptions(options) ? transformCssMacroCss(css) : css;
|
|
2842
|
+
return hasCssMacroStyleOptions(options) ? transformCssMacroCss(css, options) : css;
|
|
2843
2843
|
}
|
|
2844
2844
|
//#endregion
|
|
2845
2845
|
//#region src/tailwindcss/v3-engine/generator.ts
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-C5U5_Hdc.js");
|
|
2
|
-
const require_auto = require("./auto-
|
|
2
|
+
const require_auto = require("./auto-dPpsm6FB.js");
|
|
3
3
|
let node_fs = require("node:fs");
|
|
4
4
|
node_fs = require_chunk.__toESM(node_fs);
|
|
5
5
|
let node_module = require("node:module");
|
|
6
6
|
let postcss = require("postcss");
|
|
7
7
|
postcss = require_chunk.__toESM(postcss);
|
|
8
|
-
let node_path = require("node:path");
|
|
9
|
-
node_path = require_chunk.__toESM(node_path);
|
|
10
8
|
let node_process = require("node:process");
|
|
11
9
|
node_process = require_chunk.__toESM(node_process);
|
|
10
|
+
let node_path = require("node:path");
|
|
11
|
+
node_path = require_chunk.__toESM(node_path);
|
|
12
12
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
13
13
|
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
14
14
|
let tailwindcss_patch = require("tailwindcss-patch");
|
|
@@ -755,7 +755,7 @@ function normalizeTailwindV4GeneratedUrlValues(css) {
|
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
757
|
async function transformTailwindV4CssToWeapp(css, options) {
|
|
758
|
-
const protectedCss = (0, _weapp_tailwindcss_postcss.protectDynamicColorMixAlpha)(normalizeTailwindV4GeneratedUrlValues(css), { customPropertyValues: options && "customPropertyValues" in options ? options.customPropertyValues : void 0 });
|
|
758
|
+
const protectedCss = (0, _weapp_tailwindcss_postcss.protectDynamicColorMixAlpha)(normalizeTailwindV4GeneratedUrlValues(require_auto.hasCssMacroStyleOptions(options) ? await require_auto.transformCssMacroCss(css, options) : css), { customPropertyValues: options && "customPropertyValues" in options ? options.customPropertyValues : void 0 });
|
|
759
759
|
const result = await defaultStyleHandler$1(protectedCss.css, {
|
|
760
760
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
761
761
|
cssRemoveHoverPseudoClass: true,
|
|
@@ -768,7 +768,7 @@ async function transformTailwindV4CssToWeapp(css, options) {
|
|
|
768
768
|
}
|
|
769
769
|
async function transformTailwindV4CssByTarget(css, target, options) {
|
|
770
770
|
if (target === "weapp") return transformTailwindV4CssToWeapp(css, options);
|
|
771
|
-
return require_auto.hasCssMacroStyleOptions(options) ? require_auto.transformCssMacroCss(css) : css;
|
|
771
|
+
return require_auto.hasCssMacroStyleOptions(options) ? require_auto.transformCssMacroCss(css, options) : css;
|
|
772
772
|
}
|
|
773
773
|
//#endregion
|
|
774
774
|
//#region src/tailwindcss/v4-engine/tailwind-v3-default-colors.ts
|
|
@@ -2832,7 +2832,7 @@ function ensureMiniProgramV3PreflightReset(css, cssPreflight) {
|
|
|
2832
2832
|
}
|
|
2833
2833
|
}
|
|
2834
2834
|
async function transformTailwindV3CssToWeapp(css, options) {
|
|
2835
|
-
const result = await defaultStyleHandler(css, {
|
|
2835
|
+
const result = await defaultStyleHandler(require_auto.hasCssMacroStyleOptions(options) ? await require_auto.transformCssMacroCss(css, options) : css, {
|
|
2836
2836
|
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
2837
2837
|
cssRemoveHoverPseudoClass: true,
|
|
2838
2838
|
isMainChunk: true,
|
|
@@ -2847,7 +2847,7 @@ async function transformTailwindV3CssToWeapp(css, options) {
|
|
|
2847
2847
|
}
|
|
2848
2848
|
async function transformTailwindV3CssByTarget(css, target, options) {
|
|
2849
2849
|
if (target === "weapp") return transformTailwindV3CssToWeapp(css, options);
|
|
2850
|
-
return require_auto.hasCssMacroStyleOptions(options) ? require_auto.transformCssMacroCss(css) : css;
|
|
2850
|
+
return require_auto.hasCssMacroStyleOptions(options) ? require_auto.transformCssMacroCss(css, options) : css;
|
|
2851
2851
|
}
|
|
2852
2852
|
//#endregion
|
|
2853
2853
|
//#region src/tailwindcss/v3-engine/generator.ts
|