weapp-tailwindcss 5.0.11 → 5.0.13
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/{bundle-state-BwtEqxvU.js → bundle-state-CKWeTEhv.js} +2 -40
- package/dist/{bundle-state-CXzPknlT.mjs → bundle-state-zQ2MrDdi.mjs} +2 -34
- package/dist/bundlers/gulp/vinyl-transform.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +7 -2
- package/dist/bundlers/shared/generator-css/source-files.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/config.d.ts +7 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +15 -0
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +12 -0
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +22 -0
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +5 -22
- package/dist/bundlers/shared/generator-css/types.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -0
- package/dist/bundlers/shared/hmr-timing.d.ts +1 -0
- package/dist/bundlers/vite/css-memory.d.ts +27 -0
- package/dist/bundlers/vite/generate-bundle/bundle-file-names.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +9 -7
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +58 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +31 -0
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +77 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +53 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime-linked-css.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +21 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +29 -0
- package/dist/bundlers/vite/generate-bundle/timing.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/vite-css-cache.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +2 -1
- package/dist/bundlers/vite/hot-css-modules.d.ts +5 -0
- package/dist/bundlers/vite/map-cache.d.ts +2 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +16 -0
- package/dist/bundlers/vite/resolve-app-type.d.ts +1 -2
- package/dist/bundlers/vite/source-candidate-scan-signature.d.ts +13 -0
- package/dist/bundlers/vite/source-candidates.d.ts +9 -0
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +1 -0
- package/dist/bundlers/vite/source-scan.d.ts +1 -1
- package/dist/bundlers/vite/weapp-vite-config.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +11 -8
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +2 -0
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +5 -0
- package/dist/cache/index.d.ts +4 -0
- package/dist/cli.js +9 -2
- package/dist/cli.mjs +8 -1
- package/dist/core.d.ts +7 -0
- package/dist/core.js +8 -5
- package/dist/core.mjs +8 -5
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{defaults-DH0ZQRhy.mjs → defaults-Bqx18S1f.mjs} +2 -35
- package/dist/{defaults-Boc26eel.js → defaults-C_J_kBpw.js} +2 -35
- package/dist/defaults.js +1 -1
- package/dist/defaults.mjs +1 -1
- package/dist/framework/index.d.ts +59 -0
- package/dist/framework.d.ts +1 -0
- package/dist/framework.js +198 -0
- package/dist/framework.mjs +180 -0
- package/dist/{generator-ChgOWNOj.js → generator-CzpArpCL.js} +1 -1
- package/dist/{generator-h2XRiJ9-.mjs → generator-ITLd7PTl.mjs} +1 -1
- package/dist/generator.js +2 -2
- package/dist/generator.mjs +2 -2
- package/dist/{gulp-Be88jhoY.mjs → gulp-DfOQERcV.mjs} +137 -23
- package/dist/{gulp-CHtZF-oT.js → gulp-XT8Jc7lH.js} +137 -23
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-BkivBZvN.js → hmr-timing-BMftW7Us.js} +354 -225
- package/dist/{hmr-timing-Ct5w4hdM.mjs → hmr-timing-DQIP_8qP.mjs} +341 -225
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -4
- package/dist/index.mjs +6 -5
- package/dist/postcss.js +9 -10
- package/dist/postcss.mjs +7 -5
- package/dist/{precheck-CY9oaH49.js → precheck-B0Z8yW7E.js} +108 -27
- package/dist/{precheck-BpHxsWRd.mjs → precheck-CRI90iL1.mjs} +109 -28
- package/dist/presets.js +3 -3
- package/dist/presets.mjs +3 -3
- package/dist/tailwindcss/source-scan.d.ts +1 -0
- package/dist/tailwindcss/v3-engine/generator.d.ts +17 -0
- package/dist/tailwindcss/v3-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v3-engine/types.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/generator.d.ts +19 -0
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/{tailwindcss-Bfy2egdX.mjs → tailwindcss-DTq3uYBK.mjs} +2 -2
- package/dist/{tailwindcss-DbbAKAZP.js → tailwindcss-DZEwT3C_.js} +3 -3
- package/dist/{transform-r5evL6Hn.mjs → transform-DfcEjsZF.mjs} +29 -21
- package/dist/{transform-Cd634UZV.js → transform-YmrmxuF3.js} +29 -21
- package/dist/types/user-defined-options/general.d.ts +3 -1
- package/dist/{utils-Dolmt8EO.js → utils-BCa37Wqj.js} +2 -17
- package/dist/{utils-DsaS975I.mjs → utils-DodxWHGz.mjs} +2 -17
- package/dist/{v3-engine-D0yA9ZkF.js → v3-engine-2rrgylhn.js} +194 -34
- package/dist/{v3-engine-CFkP6dWF.mjs → v3-engine-C6eJ0YzK.mjs} +176 -34
- package/dist/{vite-j9cB2Ff1.js → vite-CXHVsHmX.js} +2071 -1160
- package/dist/{vite-Bd8qf9dK.mjs → vite-DjI09vVN.mjs} +2071 -1160
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +476 -217
- package/dist/weapp-tw-runtime-classset-loader.js +25 -0
- package/dist/{webpack-DPdrcC2X.mjs → webpack-BcPpnT90.mjs} +251 -40
- package/dist/{webpack-CJAOcYEO.js → webpack-CfkUkMXG.js} +254 -43
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +10 -5
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,13 +1,29 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_framework = require("./framework.js");
|
|
3
|
+
const require_generator = require("./generator-CzpArpCL.js");
|
|
4
|
+
const require_gulp = require("./gulp-XT8Jc7lH.js");
|
|
4
5
|
const require_postcss = require("./postcss.js");
|
|
5
|
-
const require_vite = require("./vite-
|
|
6
|
-
const require_webpack = require("./webpack-
|
|
6
|
+
const require_vite = require("./vite-CXHVsHmX.js");
|
|
7
|
+
const require_webpack = require("./webpack-CfkUkMXG.js");
|
|
7
8
|
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
8
9
|
exports.WeappTailwindcss = require_vite.WeappTailwindcss;
|
|
9
10
|
exports.createPlugins = require_gulp.createPlugins;
|
|
10
11
|
exports.createWeappTailwindcssGenerator = require_generator.createWeappTailwindcssGenerator;
|
|
12
|
+
exports.detectAppType = require_framework.detectAppType;
|
|
13
|
+
exports.detectAppTypeFromEnv = require_framework.detectAppTypeFromEnv;
|
|
14
|
+
exports.detectAppTypeFromPackageJson = require_framework.detectAppTypeFromPackageJson;
|
|
15
|
+
exports.isMpxPackage = require_framework.isMpxPackage;
|
|
16
|
+
exports.isRunningInHBuilderX = require_framework.isRunningInHBuilderX;
|
|
17
|
+
exports.isTaroPackage = require_framework.isTaroPackage;
|
|
18
|
+
exports.isUniAppPackage = require_framework.isUniAppPackage;
|
|
19
|
+
exports.isUniAppVitePackage = require_framework.isUniAppVitePackage;
|
|
20
|
+
exports.isUniAppXManifest = require_framework.isUniAppXManifest;
|
|
21
|
+
exports.isUniAppXPackage = require_framework.isUniAppXPackage;
|
|
22
|
+
exports.isWeappVitePackage = require_framework.isWeappVitePackage;
|
|
23
|
+
exports.resolveImplicitAppTypeFromViteRoot = require_framework.resolveImplicitAppTypeFromViteRoot;
|
|
24
|
+
exports.resolveUniPlatform = require_framework.resolveUniPlatform;
|
|
25
|
+
exports.resolveUniPlatformsFromEnv = require_framework.resolveUniPlatformsFromEnv;
|
|
26
|
+
exports.resolveUniUtsPlatform = require_framework.resolveUniUtsPlatform;
|
|
11
27
|
Object.defineProperty(exports, "unitConversionComposeRules", {
|
|
12
28
|
enumerable: true,
|
|
13
29
|
get: function() {
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform } from "./framework.mjs";
|
|
2
|
+
import { t as createWeappTailwindcssGenerator } from "./generator-ITLd7PTl.mjs";
|
|
3
|
+
import { t as createPlugins } from "./gulp-DfOQERcV.mjs";
|
|
3
4
|
import weappTailwindcssPostcssPlugin from "./postcss.mjs";
|
|
4
|
-
import { t as WeappTailwindcss } from "./vite-
|
|
5
|
-
import { n as weappTailwindcssPackageDir } from "./webpack-
|
|
5
|
+
import { t as WeappTailwindcss } from "./vite-DjI09vVN.mjs";
|
|
6
|
+
import { n as weappTailwindcssPackageDir } from "./webpack-BcPpnT90.mjs";
|
|
6
7
|
import { unitConversionComposeRules, unitConversionPresets } from "@weapp-tailwindcss/postcss";
|
|
7
|
-
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
|
8
|
+
export { WeappTailwindcss, createPlugins, createWeappTailwindcssGenerator, detectAppType, detectAppTypeFromEnv, detectAppTypeFromPackageJson, isMpxPackage, isRunningInHBuilderX, isTaroPackage, isUniAppPackage, isUniAppVitePackage, isUniAppXManifest, isUniAppXPackage, isWeappVitePackage, resolveImplicitAppTypeFromViteRoot, resolveUniPlatform, resolveUniPlatformsFromEnv, resolveUniUtsPlatform, unitConversionComposeRules, unitConversionPresets, weappTailwindcssPackageDir, weappTailwindcssPostcssPlugin };
|
package/dist/postcss.js
CHANGED
|
@@ -2,17 +2,16 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_v3_engine = require("./v3-engine-
|
|
6
|
-
const require_generator = require("./generator-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
const require_v3_engine = require("./v3-engine-2rrgylhn.js");
|
|
6
|
+
const require_generator = require("./generator-CzpArpCL.js");
|
|
7
|
+
const weappTailwindcssPostcssPlugin = (0, require("@weapp-tailwindcss/postcss").createWeappTailwindcssPostcssPlugin)({
|
|
8
|
+
createGenerator: (source) => {
|
|
9
|
+
return require_generator.createWeappTailwindcssGenerator(source);
|
|
10
|
+
},
|
|
11
11
|
normalizeGeneratorOptions: (options) => require_generator.normalizeWeappTailwindcssGeneratorOptions(options),
|
|
12
|
-
resolveTailwindV3Source: require_v3_engine.resolveTailwindV3Source,
|
|
13
|
-
resolveTailwindV4Source: require_v3_engine.resolveTailwindV4Source
|
|
14
|
-
};
|
|
15
|
-
const weappTailwindcssPostcssPlugin = (0, _weapp_tailwindcss_postcss.createWeappTailwindcssPostcssPlugin)(adapters);
|
|
12
|
+
resolveTailwindV3Source: (options) => require_v3_engine.resolveTailwindV3Source(options),
|
|
13
|
+
resolveTailwindV4Source: (options) => require_v3_engine.resolveTailwindV4Source(options)
|
|
14
|
+
});
|
|
16
15
|
//#endregion
|
|
17
16
|
exports.default = weappTailwindcssPostcssPlugin;
|
|
18
17
|
exports.weappTailwindcssPostcssPlugin = weappTailwindcssPostcssPlugin;
|
package/dist/postcss.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { t as resolveTailwindV3Source,
|
|
2
|
-
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-
|
|
1
|
+
import { t as resolveTailwindV3Source, x as resolveTailwindV4Source } from "./v3-engine-C6eJ0YzK.mjs";
|
|
2
|
+
import { i as normalizeWeappTailwindcssGeneratorOptions, t as createWeappTailwindcssGenerator } from "./generator-ITLd7PTl.mjs";
|
|
3
3
|
import { createWeappTailwindcssPostcssPlugin } from "@weapp-tailwindcss/postcss";
|
|
4
4
|
const weappTailwindcssPostcssPlugin = createWeappTailwindcssPostcssPlugin({
|
|
5
|
-
createGenerator: (source) =>
|
|
5
|
+
createGenerator: (source) => {
|
|
6
|
+
return createWeappTailwindcssGenerator(source);
|
|
7
|
+
},
|
|
6
8
|
normalizeGeneratorOptions: (options) => normalizeWeappTailwindcssGeneratorOptions(options),
|
|
7
|
-
resolveTailwindV3Source,
|
|
8
|
-
resolveTailwindV4Source
|
|
9
|
+
resolveTailwindV3Source: (options) => resolveTailwindV3Source(options),
|
|
10
|
+
resolveTailwindV4Source: (options) => resolveTailwindV4Source(options)
|
|
9
11
|
});
|
|
10
12
|
//#endregion
|
|
11
13
|
export { weappTailwindcssPostcssPlugin as default, weappTailwindcssPostcssPlugin };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
const require_defaults = require("./defaults-
|
|
4
|
-
require("./utils-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
6
|
-
let _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
7
|
-
let tailwindcss_patch = require("tailwindcss-patch");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-2rrgylhn.js");
|
|
3
|
+
const require_defaults = require("./defaults-C_J_kBpw.js");
|
|
4
|
+
require("./utils-BCa37Wqj.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-DZEwT3C_.js");
|
|
8
6
|
let node_path = require("node:path");
|
|
9
7
|
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 _weapp_tailwindcss_postcss = require("@weapp-tailwindcss/postcss");
|
|
11
|
+
let lru_cache = require("lru-cache");
|
|
12
|
+
let tailwindcss_patch = require("tailwindcss-patch");
|
|
12
13
|
let _weapp_tailwindcss_logger = require("@weapp-tailwindcss/logger");
|
|
13
14
|
let node_fs_promises = require("node:fs/promises");
|
|
14
15
|
let node_buffer = require("node:buffer");
|
|
15
|
-
let lru_cache = require("lru-cache");
|
|
16
16
|
let _weapp_tailwindcss_shared_node = require("@weapp-tailwindcss/shared/node");
|
|
17
17
|
let _weapp_core_escape = require("@weapp-core/escape");
|
|
18
18
|
let _babel_traverse = require("@babel/traverse");
|
|
@@ -69,6 +69,16 @@ function createCache(options) {
|
|
|
69
69
|
});
|
|
70
70
|
return cache;
|
|
71
71
|
},
|
|
72
|
+
prune(options) {
|
|
73
|
+
if (options.cacheKeys) {
|
|
74
|
+
const cacheKeys = new Set(options.cacheKeys);
|
|
75
|
+
for (const key of instance.keys()) if (!cacheKeys.has(key)) instance.delete(key);
|
|
76
|
+
}
|
|
77
|
+
if (options.hashKeys) {
|
|
78
|
+
const hashKeys = new Set(options.hashKeys);
|
|
79
|
+
for (const key of hashMap.keys()) if (!hashKeys.has(key)) hashMap.delete(key);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
72
82
|
has(key) {
|
|
73
83
|
return instance.has(key);
|
|
74
84
|
},
|
|
@@ -4542,22 +4552,45 @@ function resolveRuntimePackageReplacements(option) {
|
|
|
4542
4552
|
//#region src/context/style-options.ts
|
|
4543
4553
|
function resolveStyleOptionsFromContext(ctx) {
|
|
4544
4554
|
const resolvedUniAppXOptions = require_tailwindcss.resolveUniAppXOptions(ctx.uniAppX);
|
|
4555
|
+
const hasCssOptions = ctx.cssOptions !== void 0;
|
|
4556
|
+
const cssOptions = {
|
|
4557
|
+
cssPreflight: ctx.cssOptions?.cssPreflight ?? ctx.cssPreflight,
|
|
4558
|
+
cssPreflightRange: ctx.cssOptions?.cssPreflightRange ?? ctx.cssPreflightRange,
|
|
4559
|
+
cssChildCombinatorReplaceValue: ctx.cssOptions?.cssChildCombinatorReplaceValue ?? ctx.cssChildCombinatorReplaceValue,
|
|
4560
|
+
cssSelectorReplacement: ctx.cssOptions?.cssSelectorReplacement ?? ctx.cssSelectorReplacement,
|
|
4561
|
+
rem2rpx: ctx.cssOptions?.rem2rpx ?? ctx.rem2rpx,
|
|
4562
|
+
cssRemoveProperty: ctx.cssOptions?.cssRemoveProperty ?? ctx.cssRemoveProperty,
|
|
4563
|
+
cssRemoveHoverPseudoClass: ctx.cssOptions?.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass,
|
|
4564
|
+
tailwindcssV4GradientFallback: ctx.cssOptions?.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback,
|
|
4565
|
+
cssPresetEnv: ctx.cssOptions?.cssPresetEnv ?? ctx.cssPresetEnv,
|
|
4566
|
+
atRules: ctx.cssOptions?.atRules ?? ctx.atRules,
|
|
4567
|
+
autoprefixer: ctx.cssOptions?.autoprefixer ?? ctx.autoprefixer,
|
|
4568
|
+
cssCalc: ctx.cssOptions?.cssCalc ?? ctx.cssCalc,
|
|
4569
|
+
platform: ctx.cssOptions?.platform ?? ctx.platform,
|
|
4570
|
+
px2rpx: ctx.cssOptions?.px2rpx ?? ctx.px2rpx,
|
|
4571
|
+
unitsToPx: ctx.cssOptions?.unitsToPx ?? ctx.unitsToPx,
|
|
4572
|
+
unitConversion: ctx.cssOptions?.unitConversion ?? ctx.unitConversion,
|
|
4573
|
+
injectAdditionalCssVarScope: ctx.cssOptions?.injectAdditionalCssVarScope ?? ctx.injectAdditionalCssVarScope
|
|
4574
|
+
};
|
|
4545
4575
|
return {
|
|
4546
|
-
cssPreflight:
|
|
4547
|
-
cssPreflightRange:
|
|
4548
|
-
cssChildCombinatorReplaceValue:
|
|
4549
|
-
cssSelectorReplacement:
|
|
4550
|
-
rem2rpx:
|
|
4551
|
-
|
|
4552
|
-
|
|
4553
|
-
|
|
4554
|
-
|
|
4555
|
-
|
|
4576
|
+
cssPreflight: cssOptions.cssPreflight,
|
|
4577
|
+
cssPreflightRange: cssOptions.cssPreflightRange,
|
|
4578
|
+
cssChildCombinatorReplaceValue: cssOptions.cssChildCombinatorReplaceValue,
|
|
4579
|
+
cssSelectorReplacement: cssOptions.cssSelectorReplacement,
|
|
4580
|
+
rem2rpx: cssOptions.rem2rpx,
|
|
4581
|
+
...hasCssOptions ? { cssOptions } : {},
|
|
4582
|
+
cssRemoveProperty: cssOptions.cssRemoveProperty,
|
|
4583
|
+
cssRemoveHoverPseudoClass: cssOptions.cssRemoveHoverPseudoClass,
|
|
4584
|
+
tailwindcssV4GradientFallback: cssOptions.tailwindcssV4GradientFallback,
|
|
4585
|
+
cssPresetEnv: cssOptions.cssPresetEnv,
|
|
4586
|
+
atRules: cssOptions.atRules,
|
|
4587
|
+
autoprefixer: cssOptions.autoprefixer,
|
|
4588
|
+
cssCalc: cssOptions.cssCalc,
|
|
4556
4589
|
uniAppX: resolvedUniAppXOptions.enabled,
|
|
4557
|
-
platform:
|
|
4558
|
-
px2rpx:
|
|
4559
|
-
unitsToPx:
|
|
4560
|
-
unitConversion:
|
|
4590
|
+
platform: cssOptions.platform,
|
|
4591
|
+
px2rpx: cssOptions.px2rpx,
|
|
4592
|
+
unitsToPx: cssOptions.unitsToPx,
|
|
4593
|
+
unitConversion: cssOptions.unitConversion
|
|
4561
4594
|
};
|
|
4562
4595
|
}
|
|
4563
4596
|
//#endregion
|
|
@@ -4566,12 +4599,13 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
4566
4599
|
const { escapeMap, injectAdditionalCssVarScope, postcssOptions, uniAppX, arbitraryValues, jsPreserveClass, jsArbitraryValueFallback, babelParserOptions, ignoreCallExpressionIdentifiers, ignoreTaggedTemplateExpressionIdentifiers, inlineWxs, disabledDefaultTemplateHandler, replaceRuntimePackages } = ctx;
|
|
4567
4600
|
const resolvedUniAppXOptions = require_tailwindcss.resolveUniAppXOptions(uniAppX);
|
|
4568
4601
|
const styleOptions = resolveStyleOptionsFromContext(ctx);
|
|
4602
|
+
const resolvedInjectAdditionalCssVarScope = styleOptions.cssOptions?.injectAdditionalCssVarScope ?? injectAdditionalCssVarScope;
|
|
4569
4603
|
const uniAppXEnabled = styleOptions.uniAppX === true;
|
|
4570
4604
|
const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
|
|
4571
4605
|
const styleHandler = (0, _weapp_tailwindcss_postcss.createStyleHandler)({
|
|
4572
4606
|
...styleOptions,
|
|
4573
4607
|
escapeMap,
|
|
4574
|
-
injectAdditionalCssVarScope,
|
|
4608
|
+
injectAdditionalCssVarScope: resolvedInjectAdditionalCssVarScope,
|
|
4575
4609
|
postcssOptions,
|
|
4576
4610
|
uniAppXUnsupported: resolvedUniAppXOptions.uvueUnsupported,
|
|
4577
4611
|
cssCalc: cssCalcOptions,
|
|
@@ -4616,14 +4650,59 @@ function applyLoggerLevel(logLevel) {
|
|
|
4616
4650
|
//#endregion
|
|
4617
4651
|
//#region src/context/index.ts
|
|
4618
4652
|
function resolveContextCssPreflight(opts, ctx, majorVersion) {
|
|
4619
|
-
const
|
|
4653
|
+
const userCssPreflight = opts?.cssOptions?.cssPreflight ?? opts?.cssPreflight;
|
|
4654
|
+
const cssPreflight = require_defaults.resolveDefaultCssPreflight(userCssPreflight, majorVersion);
|
|
4620
4655
|
if (majorVersion !== 4 || cssPreflight === false || !require_tailwindcss.resolveUniAppXOptions(ctx.uniAppX).enabled) return cssPreflight;
|
|
4621
|
-
const
|
|
4656
|
+
const userCssPreflightObject = userCssPreflight && typeof userCssPreflight === "object" ? userCssPreflight : void 0;
|
|
4622
4657
|
return {
|
|
4623
4658
|
...cssPreflight,
|
|
4624
|
-
"border-width":
|
|
4625
|
-
"border-style":
|
|
4626
|
-
"border":
|
|
4659
|
+
"border-width": userCssPreflightObject && "border-width" in userCssPreflightObject ? cssPreflight["border-width"] ?? false : "0",
|
|
4660
|
+
"border-style": userCssPreflightObject && "border-style" in userCssPreflightObject ? cssPreflight["border-style"] ?? false : false,
|
|
4661
|
+
"border": userCssPreflightObject && "border" in userCssPreflightObject ? cssPreflight["border"] ?? false : false
|
|
4662
|
+
};
|
|
4663
|
+
}
|
|
4664
|
+
function syncCssOptionsToLegacyFields(ctx) {
|
|
4665
|
+
if (!ctx.cssOptions) return;
|
|
4666
|
+
const cssOptions = ctx.cssOptions;
|
|
4667
|
+
ctx.cssPreflight = cssOptions.cssPreflight ?? ctx.cssPreflight;
|
|
4668
|
+
ctx.cssPreflightRange = cssOptions.cssPreflightRange ?? ctx.cssPreflightRange;
|
|
4669
|
+
ctx.cssChildCombinatorReplaceValue = cssOptions.cssChildCombinatorReplaceValue ?? ctx.cssChildCombinatorReplaceValue;
|
|
4670
|
+
ctx.cssSelectorReplacement = cssOptions.cssSelectorReplacement ?? ctx.cssSelectorReplacement;
|
|
4671
|
+
ctx.rem2rpx = cssOptions.rem2rpx ?? ctx.rem2rpx;
|
|
4672
|
+
ctx.cssRemoveProperty = cssOptions.cssRemoveProperty ?? ctx.cssRemoveProperty;
|
|
4673
|
+
ctx.cssRemoveHoverPseudoClass = cssOptions.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass;
|
|
4674
|
+
ctx.tailwindcssV4GradientFallback = cssOptions.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback;
|
|
4675
|
+
ctx.cssPresetEnv = cssOptions.cssPresetEnv ?? ctx.cssPresetEnv;
|
|
4676
|
+
ctx.atRules = cssOptions.atRules ?? ctx.atRules;
|
|
4677
|
+
ctx.autoprefixer = cssOptions.autoprefixer ?? ctx.autoprefixer;
|
|
4678
|
+
ctx.cssCalc = cssOptions.cssCalc ?? ctx.cssCalc;
|
|
4679
|
+
ctx.platform = cssOptions.platform ?? ctx.platform;
|
|
4680
|
+
ctx.px2rpx = cssOptions.px2rpx ?? ctx.px2rpx;
|
|
4681
|
+
ctx.unitsToPx = cssOptions.unitsToPx ?? ctx.unitsToPx;
|
|
4682
|
+
ctx.unitConversion = cssOptions.unitConversion ?? ctx.unitConversion;
|
|
4683
|
+
ctx.injectAdditionalCssVarScope = cssOptions.injectAdditionalCssVarScope ?? ctx.injectAdditionalCssVarScope;
|
|
4684
|
+
}
|
|
4685
|
+
function syncLegacyFieldsToCssOptions(ctx) {
|
|
4686
|
+
if (!ctx.cssOptions) return;
|
|
4687
|
+
ctx.cssOptions = {
|
|
4688
|
+
...ctx.cssOptions ?? {},
|
|
4689
|
+
cssPreflight: ctx.cssPreflight,
|
|
4690
|
+
cssPreflightRange: ctx.cssPreflightRange,
|
|
4691
|
+
cssChildCombinatorReplaceValue: ctx.cssChildCombinatorReplaceValue,
|
|
4692
|
+
cssSelectorReplacement: ctx.cssSelectorReplacement,
|
|
4693
|
+
rem2rpx: ctx.rem2rpx,
|
|
4694
|
+
cssRemoveProperty: ctx.cssRemoveProperty,
|
|
4695
|
+
cssRemoveHoverPseudoClass: ctx.cssRemoveHoverPseudoClass,
|
|
4696
|
+
tailwindcssV4GradientFallback: ctx.tailwindcssV4GradientFallback,
|
|
4697
|
+
cssPresetEnv: ctx.cssPresetEnv,
|
|
4698
|
+
atRules: ctx.atRules,
|
|
4699
|
+
autoprefixer: ctx.autoprefixer,
|
|
4700
|
+
cssCalc: ctx.cssCalc,
|
|
4701
|
+
platform: ctx.platform,
|
|
4702
|
+
px2rpx: ctx.px2rpx,
|
|
4703
|
+
unitsToPx: ctx.unitsToPx,
|
|
4704
|
+
unitConversion: ctx.unitConversion,
|
|
4705
|
+
injectAdditionalCssVarScope: ctx.injectAdditionalCssVarScope
|
|
4627
4706
|
};
|
|
4628
4707
|
}
|
|
4629
4708
|
async function clearTailwindcssPatcherCache(patcher, options) {
|
|
@@ -4658,6 +4737,7 @@ function createInternalCompilerContext(opts) {
|
|
|
4658
4737
|
const ctx = (0, _weapp_tailwindcss_shared.defuOverrideArray)(opts, require_defaults.getDefaultOptions(), {});
|
|
4659
4738
|
ctx.arbitraryValues = resolveUnocssBareArbitraryValues(ctx.arbitraryValues, ctx.unocss);
|
|
4660
4739
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
4740
|
+
syncCssOptionsToLegacyFields(ctx);
|
|
4661
4741
|
applyLoggerLevel(ctx.logLevel);
|
|
4662
4742
|
const twPatcher = require_tailwindcss.createTailwindcssPatcherFromContext(ctx);
|
|
4663
4743
|
logTailwindcssTarget(twPatcher, ctx.tailwindcssBasedir);
|
|
@@ -4666,6 +4746,7 @@ function createInternalCompilerContext(opts) {
|
|
|
4666
4746
|
ctx.cssPreflight = resolveContextCssPreflight(opts, ctx, twPatcher.majorVersion);
|
|
4667
4747
|
const cssCalcOptions = require_tailwindcss.applyV4CssCalcDefaults(ctx.cssCalc, twPatcher);
|
|
4668
4748
|
ctx.cssCalc = cssCalcOptions;
|
|
4749
|
+
syncLegacyFieldsToCssOptions(ctx);
|
|
4669
4750
|
const { styleHandler, jsHandler, templateHandler } = createHandlersFromContext(ctx, toCustomAttributesEntities(ctx.customAttributes), cssCalcOptions, twPatcher.majorVersion);
|
|
4670
4751
|
ctx.styleHandler = styleHandler;
|
|
4671
4752
|
ctx.jsHandler = jsHandler;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
3
|
-
import { i as isMap, n as defuOverrideArray } from "./utils-
|
|
4
|
-
import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-
|
|
5
|
-
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
6
|
-
import { splitCandidateTokens } from "tailwindcss-patch";
|
|
1
|
+
import { C as resolveTailwindV4SourceFromPatcher, J as createTailwindV4Engine$1, c as ensureTailwindcssRuntimePatch, d as getRuntimeClassSetSignatureWithSources, f as invalidateRuntimeClassSet, ft as resolveBooleanObjectOption, gt as omitUndefined, l as getRuntimeClassSetCacheEntry, ot as createDebug } from "./v3-engine-C6eJ0YzK.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-Bqx18S1f.mjs";
|
|
3
|
+
import { i as isMap, n as defuOverrideArray } from "./utils-DodxWHGz.mjs";
|
|
4
|
+
import { i as resolveUniAppXOptions, o as applyV4CssCalcDefaults, s as warnMissingCssEntries, t as createTailwindcssPatcherFromContext } from "./tailwindcss-DTq3uYBK.mjs";
|
|
7
5
|
import path from "node:path";
|
|
8
6
|
import process from "node:process";
|
|
7
|
+
import { createStyleHandler } from "@weapp-tailwindcss/postcss";
|
|
8
|
+
import { LRUCache } from "lru-cache";
|
|
9
|
+
import { splitCandidateTokens } from "tailwindcss-patch";
|
|
9
10
|
import { logger, pc } from "@weapp-tailwindcss/logger";
|
|
10
11
|
import { rm } from "node:fs/promises";
|
|
11
12
|
import { Buffer } from "node:buffer";
|
|
12
|
-
import { LRUCache } from "lru-cache";
|
|
13
13
|
import { md5 as md5Hash } from "@weapp-tailwindcss/shared/node";
|
|
14
14
|
import { MappingChars2String, escape } from "@weapp-core/escape";
|
|
15
15
|
import _babelTraverse from "@babel/traverse";
|
|
@@ -62,6 +62,16 @@ function createCache(options) {
|
|
|
62
62
|
});
|
|
63
63
|
return cache;
|
|
64
64
|
},
|
|
65
|
+
prune(options) {
|
|
66
|
+
if (options.cacheKeys) {
|
|
67
|
+
const cacheKeys = new Set(options.cacheKeys);
|
|
68
|
+
for (const key of instance.keys()) if (!cacheKeys.has(key)) instance.delete(key);
|
|
69
|
+
}
|
|
70
|
+
if (options.hashKeys) {
|
|
71
|
+
const hashKeys = new Set(options.hashKeys);
|
|
72
|
+
for (const key of hashMap.keys()) if (!hashKeys.has(key)) hashMap.delete(key);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
65
75
|
has(key) {
|
|
66
76
|
return instance.has(key);
|
|
67
77
|
},
|
|
@@ -4535,22 +4545,45 @@ function resolveRuntimePackageReplacements(option) {
|
|
|
4535
4545
|
//#region src/context/style-options.ts
|
|
4536
4546
|
function resolveStyleOptionsFromContext(ctx) {
|
|
4537
4547
|
const resolvedUniAppXOptions = resolveUniAppXOptions(ctx.uniAppX);
|
|
4548
|
+
const hasCssOptions = ctx.cssOptions !== void 0;
|
|
4549
|
+
const cssOptions = {
|
|
4550
|
+
cssPreflight: ctx.cssOptions?.cssPreflight ?? ctx.cssPreflight,
|
|
4551
|
+
cssPreflightRange: ctx.cssOptions?.cssPreflightRange ?? ctx.cssPreflightRange,
|
|
4552
|
+
cssChildCombinatorReplaceValue: ctx.cssOptions?.cssChildCombinatorReplaceValue ?? ctx.cssChildCombinatorReplaceValue,
|
|
4553
|
+
cssSelectorReplacement: ctx.cssOptions?.cssSelectorReplacement ?? ctx.cssSelectorReplacement,
|
|
4554
|
+
rem2rpx: ctx.cssOptions?.rem2rpx ?? ctx.rem2rpx,
|
|
4555
|
+
cssRemoveProperty: ctx.cssOptions?.cssRemoveProperty ?? ctx.cssRemoveProperty,
|
|
4556
|
+
cssRemoveHoverPseudoClass: ctx.cssOptions?.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass,
|
|
4557
|
+
tailwindcssV4GradientFallback: ctx.cssOptions?.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback,
|
|
4558
|
+
cssPresetEnv: ctx.cssOptions?.cssPresetEnv ?? ctx.cssPresetEnv,
|
|
4559
|
+
atRules: ctx.cssOptions?.atRules ?? ctx.atRules,
|
|
4560
|
+
autoprefixer: ctx.cssOptions?.autoprefixer ?? ctx.autoprefixer,
|
|
4561
|
+
cssCalc: ctx.cssOptions?.cssCalc ?? ctx.cssCalc,
|
|
4562
|
+
platform: ctx.cssOptions?.platform ?? ctx.platform,
|
|
4563
|
+
px2rpx: ctx.cssOptions?.px2rpx ?? ctx.px2rpx,
|
|
4564
|
+
unitsToPx: ctx.cssOptions?.unitsToPx ?? ctx.unitsToPx,
|
|
4565
|
+
unitConversion: ctx.cssOptions?.unitConversion ?? ctx.unitConversion,
|
|
4566
|
+
injectAdditionalCssVarScope: ctx.cssOptions?.injectAdditionalCssVarScope ?? ctx.injectAdditionalCssVarScope
|
|
4567
|
+
};
|
|
4538
4568
|
return {
|
|
4539
|
-
cssPreflight:
|
|
4540
|
-
cssPreflightRange:
|
|
4541
|
-
cssChildCombinatorReplaceValue:
|
|
4542
|
-
cssSelectorReplacement:
|
|
4543
|
-
rem2rpx:
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4569
|
+
cssPreflight: cssOptions.cssPreflight,
|
|
4570
|
+
cssPreflightRange: cssOptions.cssPreflightRange,
|
|
4571
|
+
cssChildCombinatorReplaceValue: cssOptions.cssChildCombinatorReplaceValue,
|
|
4572
|
+
cssSelectorReplacement: cssOptions.cssSelectorReplacement,
|
|
4573
|
+
rem2rpx: cssOptions.rem2rpx,
|
|
4574
|
+
...hasCssOptions ? { cssOptions } : {},
|
|
4575
|
+
cssRemoveProperty: cssOptions.cssRemoveProperty,
|
|
4576
|
+
cssRemoveHoverPseudoClass: cssOptions.cssRemoveHoverPseudoClass,
|
|
4577
|
+
tailwindcssV4GradientFallback: cssOptions.tailwindcssV4GradientFallback,
|
|
4578
|
+
cssPresetEnv: cssOptions.cssPresetEnv,
|
|
4579
|
+
atRules: cssOptions.atRules,
|
|
4580
|
+
autoprefixer: cssOptions.autoprefixer,
|
|
4581
|
+
cssCalc: cssOptions.cssCalc,
|
|
4549
4582
|
uniAppX: resolvedUniAppXOptions.enabled,
|
|
4550
|
-
platform:
|
|
4551
|
-
px2rpx:
|
|
4552
|
-
unitsToPx:
|
|
4553
|
-
unitConversion:
|
|
4583
|
+
platform: cssOptions.platform,
|
|
4584
|
+
px2rpx: cssOptions.px2rpx,
|
|
4585
|
+
unitsToPx: cssOptions.unitsToPx,
|
|
4586
|
+
unitConversion: cssOptions.unitConversion
|
|
4554
4587
|
};
|
|
4555
4588
|
}
|
|
4556
4589
|
//#endregion
|
|
@@ -4559,12 +4592,13 @@ function createHandlersFromContext(ctx, customAttributesEntities, cssCalcOptions
|
|
|
4559
4592
|
const { escapeMap, injectAdditionalCssVarScope, postcssOptions, uniAppX, arbitraryValues, jsPreserveClass, jsArbitraryValueFallback, babelParserOptions, ignoreCallExpressionIdentifiers, ignoreTaggedTemplateExpressionIdentifiers, inlineWxs, disabledDefaultTemplateHandler, replaceRuntimePackages } = ctx;
|
|
4560
4593
|
const resolvedUniAppXOptions = resolveUniAppXOptions(uniAppX);
|
|
4561
4594
|
const styleOptions = resolveStyleOptionsFromContext(ctx);
|
|
4595
|
+
const resolvedInjectAdditionalCssVarScope = styleOptions.cssOptions?.injectAdditionalCssVarScope ?? injectAdditionalCssVarScope;
|
|
4562
4596
|
const uniAppXEnabled = styleOptions.uniAppX === true;
|
|
4563
4597
|
const moduleSpecifierReplacements = resolveRuntimePackageReplacements(replaceRuntimePackages);
|
|
4564
4598
|
const styleHandler = createStyleHandler({
|
|
4565
4599
|
...styleOptions,
|
|
4566
4600
|
escapeMap,
|
|
4567
|
-
injectAdditionalCssVarScope,
|
|
4601
|
+
injectAdditionalCssVarScope: resolvedInjectAdditionalCssVarScope,
|
|
4568
4602
|
postcssOptions,
|
|
4569
4603
|
uniAppXUnsupported: resolvedUniAppXOptions.uvueUnsupported,
|
|
4570
4604
|
cssCalc: cssCalcOptions,
|
|
@@ -4609,14 +4643,59 @@ function applyLoggerLevel(logLevel) {
|
|
|
4609
4643
|
//#endregion
|
|
4610
4644
|
//#region src/context/index.ts
|
|
4611
4645
|
function resolveContextCssPreflight(opts, ctx, majorVersion) {
|
|
4612
|
-
const
|
|
4646
|
+
const userCssPreflight = opts?.cssOptions?.cssPreflight ?? opts?.cssPreflight;
|
|
4647
|
+
const cssPreflight = resolveDefaultCssPreflight(userCssPreflight, majorVersion);
|
|
4613
4648
|
if (majorVersion !== 4 || cssPreflight === false || !resolveUniAppXOptions(ctx.uniAppX).enabled) return cssPreflight;
|
|
4614
|
-
const
|
|
4649
|
+
const userCssPreflightObject = userCssPreflight && typeof userCssPreflight === "object" ? userCssPreflight : void 0;
|
|
4615
4650
|
return {
|
|
4616
4651
|
...cssPreflight,
|
|
4617
|
-
"border-width":
|
|
4618
|
-
"border-style":
|
|
4619
|
-
"border":
|
|
4652
|
+
"border-width": userCssPreflightObject && "border-width" in userCssPreflightObject ? cssPreflight["border-width"] ?? false : "0",
|
|
4653
|
+
"border-style": userCssPreflightObject && "border-style" in userCssPreflightObject ? cssPreflight["border-style"] ?? false : false,
|
|
4654
|
+
"border": userCssPreflightObject && "border" in userCssPreflightObject ? cssPreflight["border"] ?? false : false
|
|
4655
|
+
};
|
|
4656
|
+
}
|
|
4657
|
+
function syncCssOptionsToLegacyFields(ctx) {
|
|
4658
|
+
if (!ctx.cssOptions) return;
|
|
4659
|
+
const cssOptions = ctx.cssOptions;
|
|
4660
|
+
ctx.cssPreflight = cssOptions.cssPreflight ?? ctx.cssPreflight;
|
|
4661
|
+
ctx.cssPreflightRange = cssOptions.cssPreflightRange ?? ctx.cssPreflightRange;
|
|
4662
|
+
ctx.cssChildCombinatorReplaceValue = cssOptions.cssChildCombinatorReplaceValue ?? ctx.cssChildCombinatorReplaceValue;
|
|
4663
|
+
ctx.cssSelectorReplacement = cssOptions.cssSelectorReplacement ?? ctx.cssSelectorReplacement;
|
|
4664
|
+
ctx.rem2rpx = cssOptions.rem2rpx ?? ctx.rem2rpx;
|
|
4665
|
+
ctx.cssRemoveProperty = cssOptions.cssRemoveProperty ?? ctx.cssRemoveProperty;
|
|
4666
|
+
ctx.cssRemoveHoverPseudoClass = cssOptions.cssRemoveHoverPseudoClass ?? ctx.cssRemoveHoverPseudoClass;
|
|
4667
|
+
ctx.tailwindcssV4GradientFallback = cssOptions.tailwindcssV4GradientFallback ?? ctx.tailwindcssV4GradientFallback;
|
|
4668
|
+
ctx.cssPresetEnv = cssOptions.cssPresetEnv ?? ctx.cssPresetEnv;
|
|
4669
|
+
ctx.atRules = cssOptions.atRules ?? ctx.atRules;
|
|
4670
|
+
ctx.autoprefixer = cssOptions.autoprefixer ?? ctx.autoprefixer;
|
|
4671
|
+
ctx.cssCalc = cssOptions.cssCalc ?? ctx.cssCalc;
|
|
4672
|
+
ctx.platform = cssOptions.platform ?? ctx.platform;
|
|
4673
|
+
ctx.px2rpx = cssOptions.px2rpx ?? ctx.px2rpx;
|
|
4674
|
+
ctx.unitsToPx = cssOptions.unitsToPx ?? ctx.unitsToPx;
|
|
4675
|
+
ctx.unitConversion = cssOptions.unitConversion ?? ctx.unitConversion;
|
|
4676
|
+
ctx.injectAdditionalCssVarScope = cssOptions.injectAdditionalCssVarScope ?? ctx.injectAdditionalCssVarScope;
|
|
4677
|
+
}
|
|
4678
|
+
function syncLegacyFieldsToCssOptions(ctx) {
|
|
4679
|
+
if (!ctx.cssOptions) return;
|
|
4680
|
+
ctx.cssOptions = {
|
|
4681
|
+
...ctx.cssOptions ?? {},
|
|
4682
|
+
cssPreflight: ctx.cssPreflight,
|
|
4683
|
+
cssPreflightRange: ctx.cssPreflightRange,
|
|
4684
|
+
cssChildCombinatorReplaceValue: ctx.cssChildCombinatorReplaceValue,
|
|
4685
|
+
cssSelectorReplacement: ctx.cssSelectorReplacement,
|
|
4686
|
+
rem2rpx: ctx.rem2rpx,
|
|
4687
|
+
cssRemoveProperty: ctx.cssRemoveProperty,
|
|
4688
|
+
cssRemoveHoverPseudoClass: ctx.cssRemoveHoverPseudoClass,
|
|
4689
|
+
tailwindcssV4GradientFallback: ctx.tailwindcssV4GradientFallback,
|
|
4690
|
+
cssPresetEnv: ctx.cssPresetEnv,
|
|
4691
|
+
atRules: ctx.atRules,
|
|
4692
|
+
autoprefixer: ctx.autoprefixer,
|
|
4693
|
+
cssCalc: ctx.cssCalc,
|
|
4694
|
+
platform: ctx.platform,
|
|
4695
|
+
px2rpx: ctx.px2rpx,
|
|
4696
|
+
unitsToPx: ctx.unitsToPx,
|
|
4697
|
+
unitConversion: ctx.unitConversion,
|
|
4698
|
+
injectAdditionalCssVarScope: ctx.injectAdditionalCssVarScope
|
|
4620
4699
|
};
|
|
4621
4700
|
}
|
|
4622
4701
|
async function clearTailwindcssPatcherCache(patcher, options) {
|
|
@@ -4651,6 +4730,7 @@ function createInternalCompilerContext(opts) {
|
|
|
4651
4730
|
const ctx = defuOverrideArray(opts, getDefaultOptions(), {});
|
|
4652
4731
|
ctx.arbitraryValues = resolveUnocssBareArbitraryValues(ctx.arbitraryValues, ctx.unocss);
|
|
4653
4732
|
ctx.escapeMap = ctx.customReplaceDictionary;
|
|
4733
|
+
syncCssOptionsToLegacyFields(ctx);
|
|
4654
4734
|
applyLoggerLevel(ctx.logLevel);
|
|
4655
4735
|
const twPatcher = createTailwindcssPatcherFromContext(ctx);
|
|
4656
4736
|
logTailwindcssTarget(twPatcher, ctx.tailwindcssBasedir);
|
|
@@ -4659,6 +4739,7 @@ function createInternalCompilerContext(opts) {
|
|
|
4659
4739
|
ctx.cssPreflight = resolveContextCssPreflight(opts, ctx, twPatcher.majorVersion);
|
|
4660
4740
|
const cssCalcOptions = applyV4CssCalcDefaults(ctx.cssCalc, twPatcher);
|
|
4661
4741
|
ctx.cssCalc = cssCalcOptions;
|
|
4742
|
+
syncLegacyFieldsToCssOptions(ctx);
|
|
4662
4743
|
const { styleHandler, jsHandler, templateHandler } = createHandlersFromContext(ctx, toCustomAttributesEntities(ctx.customAttributes), cssCalcOptions, twPatcher.majorVersion);
|
|
4663
4744
|
ctx.styleHandler = styleHandler;
|
|
4664
4745
|
ctx.jsHandler = jsHandler;
|
|
@@ -4713,4 +4794,4 @@ function shouldSkipJsTransform(rawSource, options) {
|
|
|
4713
4794
|
return !FAST_JS_TRANSFORM_HINT_RE.test(rawSource);
|
|
4714
4795
|
}
|
|
4715
4796
|
//#endregion
|
|
4716
|
-
export { collectRuntimeClassSet as _, vitePluginName as a, refreshTailwindRuntimeState as b, createAttributeMatcher as c, _defineProperty as d, isClassContextLiteralPath as f, toCustomAttributesEntities as g, traverse as h, pluginName as i, analyzeSource as l, babelParse as m, getCompilerContext as n, Parser as o, replaceWxml as p, resolveStyleOptionsFromContext as r, generateCode as s, shouldSkipJsTransform as t, JsTokenUpdater as u, createTailwindRuntimeReadyPromise as v, ensureRuntimeClassSet as y };
|
|
4797
|
+
export { collectRuntimeClassSet as _, vitePluginName as a, refreshTailwindRuntimeState as b, createAttributeMatcher as c, _defineProperty as d, isClassContextLiteralPath as f, toCustomAttributesEntities as g, traverse as h, pluginName as i, analyzeSource as l, babelParse as m, getCompilerContext as n, Parser as o, replaceWxml as p, resolveStyleOptionsFromContext as r, generateCode as s, shouldSkipJsTransform as t, JsTokenUpdater as u, createTailwindRuntimeReadyPromise as v, md5Hash as x, ensureRuntimeClassSet as y };
|
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-
|
|
4
|
-
const require_utils = require("./utils-
|
|
5
|
-
const require_tailwindcss = require("./tailwindcss-
|
|
3
|
+
const require_v3_engine = require("./v3-engine-2rrgylhn.js");
|
|
4
|
+
const require_utils = require("./utils-BCa37Wqj.js");
|
|
5
|
+
const require_tailwindcss = require("./tailwindcss-DZEwT3C_.js");
|
|
6
6
|
require("./logger-TlKT3xmR.js");
|
|
7
7
|
let node_path = require("node:path");
|
|
8
8
|
node_path = require_chunk.__toESM(node_path);
|
package/dist/presets.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-
|
|
3
|
-
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-
|
|
1
|
+
import { gt as omitUndefined } from "./v3-engine-C6eJ0YzK.mjs";
|
|
2
|
+
import { n as defuOverrideArray, o as resolveUniUtsPlatform } from "./utils-DodxWHGz.mjs";
|
|
3
|
+
import { i as resolveUniAppXOptions, n as resolveTailwindcssBasedir } from "./tailwindcss-DTq3uYBK.mjs";
|
|
4
4
|
import { t as logger } from "./logger-BNzxZbZj.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process from "node:process";
|
|
@@ -1,2 +1,19 @@
|
|
|
1
1
|
import type { TailwindV3Engine, TailwindV3ResolvedSource } from './types';
|
|
2
2
|
export declare function createTailwindV3Engine(source: TailwindV3ResolvedSource): TailwindV3Engine;
|
|
3
|
+
export declare function getTailwindV3IncrementalGenerateCacheStats(): {
|
|
4
|
+
max: number;
|
|
5
|
+
entryCandidatesMax: number;
|
|
6
|
+
entryCssBytesMax: number;
|
|
7
|
+
size: number;
|
|
8
|
+
entries: {
|
|
9
|
+
key: string;
|
|
10
|
+
candidates: number;
|
|
11
|
+
classSet: number;
|
|
12
|
+
cssBytes: number;
|
|
13
|
+
rawCssBytes: number;
|
|
14
|
+
exactResults: number;
|
|
15
|
+
}[];
|
|
16
|
+
keys: string[];
|
|
17
|
+
};
|
|
18
|
+
export declare const getTailwindV3IncrementalGenerateCacheStatsForTest: typeof getTailwindV3IncrementalGenerateCacheStats;
|
|
19
|
+
export declare function clearTailwindV3IncrementalGenerateCacheForTest(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createTailwindV3Engine } from './generator';
|
|
1
|
+
export { clearTailwindV3IncrementalGenerateCacheForTest, createTailwindV3Engine, getTailwindV3IncrementalGenerateCacheStats, getTailwindV3IncrementalGenerateCacheStatsForTest, } from './generator';
|
|
2
2
|
export { transformTailwindV3CssByTarget, transformTailwindV3CssToWeapp } from './miniprogram';
|
|
3
3
|
export { resolveTailwindV3Source, resolveTailwindV3SourceFromPatcher, resolveTailwindV3SourceOptionsFromPatcher, } from './source';
|
|
4
4
|
export type { TailwindV3CandidateSource, TailwindV3Engine, TailwindV3GenerateOptions, TailwindV3GenerateResult, TailwindV3GenerateTarget, TailwindV3ResolvedSource, TailwindV3SourceOptions, } from './types';
|
|
@@ -1,2 +1,21 @@
|
|
|
1
1
|
import type { TailwindV4Engine, TailwindV4ResolvedSource } from './types';
|
|
2
2
|
export declare function createTailwindV4Engine(source: TailwindV4ResolvedSource): TailwindV4Engine;
|
|
3
|
+
export declare function getTailwindV4IncrementalGenerateCacheStats(): {
|
|
4
|
+
max: number;
|
|
5
|
+
entryCandidatesMax: number;
|
|
6
|
+
entryCssBytesMax: number;
|
|
7
|
+
size: number;
|
|
8
|
+
taskMax: number;
|
|
9
|
+
taskSize: number;
|
|
10
|
+
entries: {
|
|
11
|
+
key: string;
|
|
12
|
+
candidates: number;
|
|
13
|
+
classSet: number;
|
|
14
|
+
cssBytes: number;
|
|
15
|
+
rawCssBytes: number;
|
|
16
|
+
}[];
|
|
17
|
+
keys: string[];
|
|
18
|
+
taskKeys: string[];
|
|
19
|
+
};
|
|
20
|
+
export declare const getTailwindV4IncrementalGenerateCacheStatsForTest: typeof getTailwindV4IncrementalGenerateCacheStats;
|
|
21
|
+
export declare function clearTailwindV4IncrementalGenerateCacheForTest(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { loadTailwindV4DesignSystem, resolveValidTailwindV4Candidates, } from './design-system';
|
|
2
|
-
export { createTailwindV4Engine } from './generator';
|
|
2
|
+
export { clearTailwindV4IncrementalGenerateCacheForTest, createTailwindV4Engine, getTailwindV4IncrementalGenerateCacheStats, getTailwindV4IncrementalGenerateCacheStatsForTest, } from './generator';
|
|
3
3
|
export { transformTailwindV4CssByTarget, transformTailwindV4CssToWeapp } from './miniprogram';
|
|
4
4
|
export { resolveTailwindV4Source, resolveTailwindV4SourceFromPatcher, resolveTailwindV4SourceFromPatchOptions, resolveTailwindV4SourceOptionsFromPatcher, } from './source';
|
|
5
5
|
export type { TailwindV4CandidateSource, TailwindV4DesignSystem, TailwindV4Engine, TailwindV4GenerateOptions, TailwindV4GenerateResult, TailwindV4GenerateTarget, TailwindV4ResolvedSource, TailwindV4SourceOptions, } from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as defuOverrideArray } from "./utils-
|
|
1
|
+
import { ct as readInstalledPackageMajorVersion, dt as normalizeStringListOption, gt as omitUndefined, ht as findWorkspaceRoot, mt as findWorkspacePackageDir, p as runtimeSignaturePatchersSymbol, pt as findNearestPackageRoot, st as createTailwindcssPatcher } from "./v3-engine-C6eJ0YzK.mjs";
|
|
2
|
+
import { n as defuOverrideArray } from "./utils-DodxWHGz.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
-
const require_v3_engine = require("./v3-engine-
|
|
3
|
-
require("./utils-
|
|
4
|
-
let node_module = require("node:module");
|
|
2
|
+
const require_v3_engine = require("./v3-engine-2rrgylhn.js");
|
|
3
|
+
require("./utils-BCa37Wqj.js");
|
|
5
4
|
let node_fs = require("node:fs");
|
|
6
5
|
let node_path = require("node:path");
|
|
7
6
|
node_path = require_chunk.__toESM(node_path);
|
|
8
7
|
let node_process = require("node:process");
|
|
9
8
|
node_process = require_chunk.__toESM(node_process);
|
|
9
|
+
let node_module = require("node:module");
|
|
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");
|