weapp-tailwindcss 5.0.13 → 5.1.1
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/README.en.md +1 -1
- package/README.md +1 -1
- package/dist/auto-Ba6hDrse.mjs +13 -0
- package/dist/auto-DtU6f3X6.js +18 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/class-selectors.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/directives.d.ts +2 -1
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +10 -6
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +0 -1
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +3 -3
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +2 -2
- package/dist/bundlers/shared/generator-css/types.d.ts +13 -1
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -1
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -0
- package/dist/bundlers/shared/run-tasks.d.ts +1 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -1
- package/dist/bundlers/vite/css-memory.d.ts +16 -0
- package/dist/bundlers/vite/generate-bundle/candidates.d.ts +0 -1
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-assets.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +39 -0
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/env-flags.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +13 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +7 -0
- package/dist/bundlers/vite/generate-bundle/html-processing.d.ts +26 -0
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +4 -0
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +21 -18
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/runtime-linked-source-memory.d.ts +25 -0
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +3 -1
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/tailwind-v4-css-source.d.ts +9 -0
- package/dist/bundlers/vite/generate-bundle/transform-filter.d.ts +15 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/vite-css-cache.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle.d.ts +2 -1
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +3 -3
- package/dist/bundlers/vite/plugin-cache.d.ts +15 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +1 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +5 -4
- package/dist/bundlers/vite/source-candidates/script.d.ts +1 -7
- package/dist/bundlers/vite/source-candidates.d.ts +9 -2
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +2 -6
- package/dist/bundlers/vite/source-scan.d.ts +2 -2
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/utils.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +26 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +34 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +48 -11
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/js-module-graph.d.ts +37 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +199 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-refresh.d.ts +11 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +4 -2
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +10 -1
- package/dist/bundlers/webpack/shared/css-loader-runtime.d.ts +1 -0
- package/dist/cache/index.d.ts +1 -0
- package/dist/cli/mount-options.d.ts +2 -2
- package/dist/cli.js +138 -444
- package/dist/cli.mjs +134 -440
- package/dist/context/index.d.ts +3 -3
- package/dist/context/style-options.d.ts +5 -1
- package/dist/context/tailwindcss.d.ts +1 -1
- package/dist/{precheck-B0Z8yW7E.js → context-B6hVF7dr.js} +405 -156
- package/dist/{precheck-CRI90iL1.mjs → context-DlpKD7aN.mjs} +377 -141
- package/dist/core.js +15 -12
- package/dist/core.mjs +10 -7
- package/dist/css-macro/index.d.ts +3 -7
- package/dist/css-macro.js +1 -1
- package/dist/css-macro.mjs +1 -1
- package/dist/{defaults-Bqx18S1f.mjs → defaults-BhE26nSw.mjs} +12 -13
- package/dist/{defaults-C_J_kBpw.js → defaults-CmFBmxsr.js} +11 -18
- package/dist/defaults.d.ts +2 -8
- package/dist/defaults.js +1 -2
- package/dist/defaults.mjs +2 -2
- package/dist/generator/index.d.ts +6 -7
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +9 -10
- package/dist/generator-6oMJtTDO.js +170 -0
- package/dist/generator-CjzBK7h-.mjs +123 -0
- package/dist/generator.js +10 -16
- package/dist/generator.mjs +3 -3
- package/dist/{gulp-XT8Jc7lH.js → gulp-BtGq6LP9.js} +49 -87
- package/dist/{gulp-DfOQERcV.mjs → gulp-DNU10Vtc.mjs} +42 -80
- package/dist/gulp.js +1 -1
- package/dist/gulp.mjs +1 -1
- package/dist/{hmr-timing-DQIP_8qP.mjs → hmr-timing-B0KuWDjV.mjs} +1197 -858
- package/dist/{hmr-timing-BMftW7Us.js → hmr-timing-CegXR9O4.js} +1356 -927
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/dist/js/fast-path/oxc.d.ts +4 -0
- package/dist/js/precheck.d.ts +1 -0
- package/dist/postcss.js +3 -4
- package/dist/postcss.mjs +2 -3
- package/dist/presets.js +9 -19
- package/dist/presets.mjs +8 -18
- package/dist/runtime-branch/create-branch.d.ts +2 -0
- package/dist/runtime-branch/generator-target-env.d.ts +4 -0
- package/dist/runtime-branch/index.d.ts +6 -0
- package/dist/runtime-branch/mini-program.d.ts +2 -0
- package/dist/runtime-branch/native-app.d.ts +2 -0
- package/dist/runtime-branch/platform.d.ts +6 -0
- package/dist/runtime-branch/tailwind-version.d.ts +2 -0
- package/dist/runtime-branch/types.d.ts +37 -0
- package/dist/runtime-branch/web.d.ts +2 -0
- package/dist/runtime-branch.d.ts +1 -0
- package/dist/{bundle-state-zQ2MrDdi.mjs → source-candidate-scan-signature-B5af2Ahe.mjs} +187 -17
- package/dist/{bundle-state-CKWeTEhv.js → source-candidate-scan-signature-BKYb9jxa.js} +261 -19
- package/dist/tailwindcss/candidates.d.ts +7 -0
- package/dist/tailwindcss/index.d.ts +2 -2
- package/dist/tailwindcss/runtime/cache.d.ts +6 -6
- package/dist/tailwindcss/runtime-factory.d.ts +12 -0
- package/dist/tailwindcss/runtime-options.d.ts +8 -0
- package/dist/tailwindcss/runtime-types.d.ts +87 -0
- package/dist/tailwindcss/runtime.d.ts +6 -6
- package/dist/tailwindcss/source-scan.d.ts +1 -1
- package/dist/tailwindcss/targets.d.ts +2 -2
- package/dist/tailwindcss/v4/config.d.ts +3 -3
- package/dist/tailwindcss/v4/css-entries.d.ts +1 -0
- package/dist/tailwindcss/v4/css-sources.d.ts +4 -2
- package/dist/tailwindcss/v4/index.d.ts +1 -1
- package/dist/tailwindcss/v4/multi-runtime.d.ts +2 -0
- package/dist/tailwindcss/v4/runtime-factory.d.ts +15 -0
- package/dist/tailwindcss/v4/runtime-options.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +3 -3
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +10 -3
- package/dist/tailwindcss/v4-engine/index.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +7 -1
- package/dist/tailwindcss/v4-engine/source.d.ts +15 -7
- package/dist/tailwindcss/v4-engine/types.d.ts +17 -10
- package/dist/tailwindcss/version.d.ts +1 -1
- package/dist/tailwindcss-B5mRo0-M.mjs +1423 -0
- package/dist/tailwindcss-dbrbY4cd.js +1528 -0
- package/dist/{transform-DfcEjsZF.mjs → transform-fRBeuuK-.mjs} +2 -2
- package/dist/{transform-YmrmxuF3.js → transform-vLwZpiTE.js} +17 -17
- package/dist/typedoc.export.d.ts +1 -1
- package/dist/types/index.d.ts +16 -17
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/{typedoc-tailwindcss-patch.d.ts → typedoc-tailwindcss-runtime.d.ts} +4 -10
- package/dist/types/user-defined-options/general.d.ts +5 -3
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/types/user-defined-options/matcher.d.ts +7 -0
- package/dist/uni-app-x/style-asset.d.ts +1 -0
- package/dist/v4-engine-C3qSwQ-e.mjs +2376 -0
- package/dist/v4-engine-ON_oSLfO.js +2752 -0
- package/dist/{vite-DjI09vVN.mjs → vite-CWRooooa.mjs} +1417 -540
- package/dist/{vite-CXHVsHmX.js → vite-w-RkgaTY.js} +1575 -698
- package/dist/vite.js +1 -1
- package/dist/vite.mjs +1 -1
- package/dist/weapp-tw-css-import-rewrite-loader.js +5665 -4443
- package/dist/weapp-tw-runtime-classset-loader.js +15 -4
- package/dist/webpack-8PaV1gG3.mjs +2334 -0
- package/dist/webpack-CGgBOx9l.js +2346 -0
- package/dist/webpack.js +1 -1
- package/dist/webpack.mjs +1 -1
- package/package.json +6 -7
- package/dist/auto-CTp6wE5a.js +0 -33
- package/dist/auto-Cl8_hsG6.mjs +0 -22
- package/dist/bundlers/vite/incremental-runtime-class-set/v3-candidates.d.ts +0 -13
- package/dist/bundlers/vite/source-candidates/tailwind-v3-default-extractor.d.ts +0 -1
- package/dist/context/tailwindcss/rax.d.ts +0 -2
- package/dist/generator-CzpArpCL.js +0 -92
- package/dist/generator-ITLd7PTl.mjs +0 -67
- package/dist/tailwindcss/patcher-options.d.ts +0 -8
- package/dist/tailwindcss/patcher.d.ts +0 -12
- package/dist/tailwindcss/runtime-patch.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/generator/cache-key.d.ts +0 -3
- package/dist/tailwindcss/v3-engine/generator/content.d.ts +0 -10
- package/dist/tailwindcss/v3-engine/generator/runtime-ready.d.ts +0 -2
- package/dist/tailwindcss/v3-engine/generator.d.ts +0 -19
- package/dist/tailwindcss/v3-engine/index.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +0 -4
- package/dist/tailwindcss/v3-engine/source.d.ts +0 -5
- package/dist/tailwindcss/v3-engine/types.d.ts +0 -61
- package/dist/tailwindcss/v4/multi-patcher.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher-options.d.ts +0 -2
- package/dist/tailwindcss/v4/patcher.d.ts +0 -15
- package/dist/tailwindcss/v4-engine/tailwind-v3-compatibility.d.ts +0 -1
- package/dist/tailwindcss/v4-engine/tailwind-v3-default-colors.d.ts +0 -1
- package/dist/tailwindcss-DTq3uYBK.mjs +0 -556
- package/dist/tailwindcss-DZEwT3C_.js +0 -613
- package/dist/v3-engine-2rrgylhn.js +0 -4686
- package/dist/v3-engine-C6eJ0YzK.mjs +0 -4272
- package/dist/webpack-BcPpnT90.mjs +0 -1184
- package/dist/webpack-CfkUkMXG.js +0 -1196
- /package/dist/tailwindcss/{patcher-resolve.d.ts → runtime-resolve.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createAttributeMatcher, d as
|
|
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-DlpKD7aN.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
|
-
import { splitCandidateTokens } from "tailwindcss-
|
|
3
|
+
import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
4
4
|
import MagicString from "magic-string";
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
6
6
|
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-emK7D4bc.js");
|
|
2
|
-
const
|
|
3
|
-
let
|
|
2
|
+
const require_context = require("./context-B6hVF7dr.js");
|
|
3
|
+
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
4
4
|
let magic_string = require("magic-string");
|
|
5
5
|
magic_string = require_chunk.__toESM(magic_string);
|
|
6
6
|
//#region ../../node_modules/.pnpm/@vue+shared@3.5.38/node_modules/@vue/shared/dist/shared.cjs.prod.js
|
|
@@ -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(
|
|
14619
|
+
return runtimeSet.has(candidate) || runtimeSet.has(require_context.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
|
-
|
|
14632
|
-
|
|
14631
|
+
require_context._defineProperty(this, "aliasByUtility", /* @__PURE__ */ new Map());
|
|
14632
|
+
require_context._defineProperty(this, "aliasByLookup", /* @__PURE__ */ new Map());
|
|
14633
14633
|
}
|
|
14634
14634
|
ensureAlias(utility) {
|
|
14635
14635
|
const cached = this.aliasByUtility.get(utility);
|
|
@@ -14637,11 +14637,11 @@ 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(
|
|
14640
|
+
this.aliasByLookup.set(require_context.replaceWxml(utility), alias);
|
|
14641
14641
|
return alias;
|
|
14642
14642
|
}
|
|
14643
14643
|
rewriteLiteral(literal, shouldInclude) {
|
|
14644
|
-
const candidates = (0,
|
|
14644
|
+
const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
|
|
14645
14645
|
if (candidates.length === 0) return literal;
|
|
14646
14646
|
let rewritten = literal;
|
|
14647
14647
|
for (const candidate of candidates) {
|
|
@@ -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 =
|
|
14659
|
+
const analysis = require_context.analyzeSource(require_context.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
|
-
const candidates = (0,
|
|
14666
|
-
const classContext = options.wrapExpression ||
|
|
14665
|
+
const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
|
|
14666
|
+
const classContext = options.wrapExpression || require_context.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,15 +14675,15 @@ 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 =
|
|
14678
|
+
const analysis = require_context.analyzeSource(require_context.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
|
|
14683
|
+
const updater = new require_context.JsTokenUpdater();
|
|
14684
14684
|
for (const path of analysis.targetPaths) {
|
|
14685
14685
|
const { literal, offset } = extractLiteralValue(path);
|
|
14686
|
-
const candidates = (0,
|
|
14686
|
+
const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
|
|
14687
14687
|
if (candidates.length === 0) continue;
|
|
14688
14688
|
let rewritten = literal;
|
|
14689
14689
|
let mutated = false;
|
|
@@ -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,
|
|
14746
|
+
if (start < end) ms.update(start, end, require_context.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 =
|
|
14760
|
+
const generated = require_context.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 =
|
|
14774
|
+
const generated = require_context.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 =
|
|
14834
|
+
const matchCustomAttribute = require_context.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;
|
package/dist/typedoc.export.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { WeappTailwindcssGenerateOptions, WeappTailwindcssGenerateResult, WeappTailwindcssGenerator, WeappTailwindcssGeneratorTarget, WeappTailwindcssPostcssPluginOptions, } from './index';
|
|
2
|
-
export type { ApplyOptions, CacheOptions, ExtractOptions, TailwindCssOptions,
|
|
2
|
+
export type { ApplyOptions, CacheOptions, ExtractOptions, TailwindCssOptions, TailwindCssRuntimeOptions, TailwindV4Options, } from './types/typedoc-tailwindcss-runtime';
|
|
3
3
|
export type { UserDefinedOptions } from './types/user-defined-options';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { ParseError, ParserOptions } from '@babel/parser';
|
|
2
2
|
import type { CssPreflightOptions, Document, IStyleHandlerOptions, Result as PostcssResult, Root } from '@weapp-tailwindcss/postcss';
|
|
3
3
|
import type { SourceMap } from 'magic-string';
|
|
4
|
-
import type { ILengthUnitsPatchOptions, TailwindcssPatcher } from 'tailwindcss-patch';
|
|
5
4
|
import type { ICreateCacheReturnType } from '../cache';
|
|
6
5
|
import type { ItemOrItemArray } from './base';
|
|
7
6
|
import type { AppType, IArbitraryValues, ICustomAttributesEntities } from './shared';
|
|
8
7
|
import type { UniAppXComponentLocalStylesOptions, UniAppXOptions as UniAppXUserDefinedOptions, UserDefinedOptions } from './user-defined-options';
|
|
9
|
-
type
|
|
10
|
-
export type { UniAppXComponentLocalStylesOptions, UniAppXUserDefinedOptions, UserDefinedOptions, };
|
|
8
|
+
import type { LengthUnitsRuntimeOptions, TailwindContentTokenReport, TailwindcssExtractOptions, TailwindcssExtractResult, TailwindCssOptions, TailwindCssRuntimeOptions, TailwindPackageInfo } from '../tailwindcss/runtime-types';
|
|
9
|
+
export type { TailwindCssOptions, TailwindCssRuntimeOptions, UniAppXComponentLocalStylesOptions, UniAppXUserDefinedOptions, UserDefinedOptions, };
|
|
11
10
|
export type { CssPreflightOptions, IStyleHandlerOptions, ItemOrItemArray };
|
|
12
11
|
export type { AppType, IArbitraryValues, ICustomAttributes, ICustomAttributesEntities, IUnocssCompatibilityOptions } from './shared';
|
|
13
12
|
export type RequiredDefined<T> = {
|
|
14
13
|
[K in keyof T]-?: Exclude<T[K], undefined>;
|
|
15
14
|
};
|
|
16
|
-
type InternalUserDefinedOptionsBase = RequiredDefined<Omit<UserDefinedOptions, '
|
|
15
|
+
type InternalUserDefinedOptionsBase = RequiredDefined<Omit<UserDefinedOptions, 'supportCustomLengthUnits' | 'customReplaceDictionary' | 'cache' | 'templateHandler' | 'styleHandler' | 'jsHandler'>>;
|
|
17
16
|
export interface LinkedJsModuleResult {
|
|
18
17
|
code: string;
|
|
19
18
|
}
|
|
@@ -23,15 +22,14 @@ export interface JsHandlerResult {
|
|
|
23
22
|
error?: ParseError;
|
|
24
23
|
linked?: Record<string, LinkedJsModuleResult>;
|
|
25
24
|
}
|
|
26
|
-
export interface
|
|
27
|
-
packageInfo:
|
|
28
|
-
majorVersion?:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
options?: TailwindcssPatcher['options'] | undefined;
|
|
25
|
+
export interface TailwindcssRuntimeLike {
|
|
26
|
+
packageInfo: TailwindPackageInfo;
|
|
27
|
+
majorVersion?: number | undefined;
|
|
28
|
+
getClassSet: () => Promise<Set<string>> | Set<string>;
|
|
29
|
+
getClassSetSync?: (() => Set<string>) | undefined;
|
|
30
|
+
extract: (options?: TailwindcssExtractOptions) => Promise<TailwindcssExtractResult> | TailwindcssExtractResult;
|
|
31
|
+
collectContentTokens?: (() => Promise<TailwindContentTokenReport> | TailwindContentTokenReport) | undefined;
|
|
32
|
+
options?: TailwindCssRuntimeOptions | undefined;
|
|
35
33
|
}
|
|
36
34
|
export type BabelParserOptions = ParserOptions & {
|
|
37
35
|
cache?: boolean | undefined;
|
|
@@ -39,7 +37,7 @@ export type BabelParserOptions = ParserOptions & {
|
|
|
39
37
|
cacheMaxEntries?: number | undefined;
|
|
40
38
|
cacheMaxSourceLength?: number | undefined;
|
|
41
39
|
};
|
|
42
|
-
export interface
|
|
40
|
+
export interface RefreshTailwindcssRuntimeOptions {
|
|
43
41
|
clearCache?: boolean | undefined;
|
|
44
42
|
}
|
|
45
43
|
export interface IJsHandlerOptions {
|
|
@@ -54,6 +52,7 @@ export interface IJsHandlerOptions {
|
|
|
54
52
|
alwaysEscape?: boolean | undefined;
|
|
55
53
|
unescapeUnicode?: boolean | undefined;
|
|
56
54
|
babelParserOptions?: BabelParserOptions | undefined;
|
|
55
|
+
experimentalJsFastPath?: boolean | 'oxc' | undefined;
|
|
57
56
|
ignoreTaggedTemplateExpressionIdentifiers?: (string | RegExp)[] | undefined;
|
|
58
57
|
ignoreCallExpressionIdentifiers?: (string | RegExp)[] | undefined;
|
|
59
58
|
uniAppX?: boolean | undefined;
|
|
@@ -81,15 +80,15 @@ export interface ITemplateHandlerOptions extends ICommonReplaceOptions {
|
|
|
81
80
|
wrapExpression?: boolean | undefined;
|
|
82
81
|
}
|
|
83
82
|
export interface InternalUserDefinedOptions extends InternalUserDefinedOptionsBase {
|
|
84
|
-
|
|
83
|
+
supportCustomLengthUnits: LengthUnitsRuntimeOptions | boolean;
|
|
85
84
|
templateHandler: (rawSource: string, options?: ITemplateHandlerOptions) => Promise<string>;
|
|
86
85
|
styleHandler: (rawSource: string, options?: IStyleHandlerOptions) => Promise<PostcssResult<Root | Document>>;
|
|
87
86
|
jsHandler: JsHandler;
|
|
88
87
|
escapeMap: Record<string, string>;
|
|
89
88
|
customReplaceDictionary: Record<string, string>;
|
|
90
89
|
cache: ICreateCacheReturnType;
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
tailwindRuntime: TailwindcssRuntimeLike;
|
|
91
|
+
refreshTailwindcssRuntime: (options?: RefreshTailwindcssRuntimeOptions) => Promise<TailwindcssRuntimeLike>;
|
|
93
92
|
}
|
|
94
93
|
export type InternalPostcssOptions = Pick<UserDefinedOptions, 'cssMatcher' | 'mainCssChunkMatcher' | 'cssPreflight' | 'cssPreflightRange' | 'disabled'>;
|
|
95
94
|
export interface IBaseWebpackPlugin {
|
package/dist/types/shared.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ItemOrItemArray } from './base';
|
|
2
|
-
export type AppType = 'uni-app' | 'uni-app-vite' | 'uni-app-x' | 'taro' | 'remax' | '
|
|
2
|
+
export type AppType = 'uni-app' | 'uni-app-vite' | 'uni-app-x' | 'taro' | 'remax' | 'native' | 'kbone' | 'mpx' | 'weapp-vite';
|
|
3
3
|
export type ICustomAttributes = Record<string, ItemOrItemArray<string | RegExp>> | Map<string | RegExp, ItemOrItemArray<string | RegExp>>;
|
|
4
4
|
export type ICustomAttributesEntities = [string | RegExp, ItemOrItemArray<string | RegExp>][];
|
|
5
5
|
export interface IArbitraryValues {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PackageResolvingOptions } from 'local-pkg';
|
|
2
|
-
import type { ILengthUnitsPatchOptions } from 'tailwindcss-patch';
|
|
3
2
|
import type { TailwindSourceEntry as SourceEntry } from '../tailwindcss/source-scan';
|
|
4
3
|
import type { TailwindV4SourceOptions } from '../tailwindcss/v4-engine';
|
|
4
|
+
import type { LengthUnitsRuntimeOptions } from '../tailwindcss/runtime-types';
|
|
5
5
|
type TailwindV4CssSource = NonNullable<TailwindV4SourceOptions['cssSources']>[number];
|
|
6
6
|
export type CacheStrategy = 'merge' | 'overwrite';
|
|
7
7
|
export type CacheDriver = 'file' | 'memory' | 'noop';
|
|
@@ -23,7 +23,7 @@ export interface ExtractOptions {
|
|
|
23
23
|
export interface ExposeContextOptions {
|
|
24
24
|
refProperty?: string;
|
|
25
25
|
}
|
|
26
|
-
export interface ExtendLengthUnitsOptions extends Partial<
|
|
26
|
+
export interface ExtendLengthUnitsOptions extends Partial<LengthUnitsRuntimeOptions> {
|
|
27
27
|
enabled?: boolean;
|
|
28
28
|
}
|
|
29
29
|
export interface ApplyOptions {
|
|
@@ -36,10 +36,6 @@ export interface TailwindRuntimeOptionsBase {
|
|
|
36
36
|
cwd?: string;
|
|
37
37
|
postcssPlugin?: string;
|
|
38
38
|
}
|
|
39
|
-
export interface TailwindV2Options extends TailwindRuntimeOptionsBase {
|
|
40
|
-
}
|
|
41
|
-
export interface TailwindV3Options extends TailwindRuntimeOptionsBase {
|
|
42
|
-
}
|
|
43
39
|
export interface TailwindV4Options {
|
|
44
40
|
base?: string;
|
|
45
41
|
css?: string;
|
|
@@ -51,14 +47,12 @@ export interface TailwindV4Options {
|
|
|
51
47
|
} | undefined;
|
|
52
48
|
}
|
|
53
49
|
export interface TailwindCssOptions extends TailwindRuntimeOptionsBase {
|
|
54
|
-
version?:
|
|
50
|
+
version?: 4;
|
|
55
51
|
packageName?: string;
|
|
56
52
|
resolve?: PackageResolvingOptions;
|
|
57
|
-
v2?: TailwindV2Options;
|
|
58
|
-
v3?: TailwindV3Options;
|
|
59
53
|
v4?: TailwindV4Options;
|
|
60
54
|
}
|
|
61
|
-
export interface
|
|
55
|
+
export interface TailwindCssRuntimeOptions {
|
|
62
56
|
projectRoot?: string;
|
|
63
57
|
tailwindcss?: TailwindCssOptions;
|
|
64
58
|
apply?: ApplyOptions;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import type { ParserOptions } from '@babel/parser';
|
|
2
2
|
import type { CssOptions, LoadedPostcssOptions } from '@weapp-tailwindcss/postcss/types';
|
|
3
|
-
import type { ILengthUnitsPatchOptions, TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
4
3
|
import type { ICreateCacheReturnType } from '../../cache';
|
|
5
4
|
import type { WeappTailwindcssGeneratorUserOptions } from '../../generator';
|
|
6
5
|
import type { AppType, IArbitraryValues, IUnocssCompatibilityOptions } from '../shared';
|
|
6
|
+
import type { LengthUnitsRuntimeOptions, TailwindCssRuntimeOptions } from '../../tailwindcss/runtime-types';
|
|
7
7
|
export interface CssSourceTraceOptions {
|
|
8
8
|
root?: string | undefined;
|
|
9
9
|
}
|
|
10
10
|
export type CssSourceTraceUserOptions = boolean | CssSourceTraceOptions;
|
|
11
11
|
export interface UserDefinedOptionsGeneralPart {
|
|
12
|
-
|
|
12
|
+
supportCustomLengthUnits?: LengthUnitsRuntimeOptions | boolean | undefined;
|
|
13
13
|
appType?: AppType | undefined;
|
|
14
14
|
arbitraryValues?: IArbitraryValues | undefined;
|
|
15
15
|
unocss?: boolean | IUnocssCompatibilityOptions | undefined;
|
|
16
16
|
jsPreserveClass?: ((keyword: string) => boolean | undefined) | undefined;
|
|
17
17
|
jsArbitraryValueFallback?: boolean | 'auto' | undefined;
|
|
18
18
|
replaceRuntimePackages?: boolean | Record<string, string> | undefined;
|
|
19
|
+
rewriteCssImports?: boolean | undefined;
|
|
19
20
|
generator?: WeappTailwindcssGeneratorUserOptions | undefined;
|
|
20
21
|
cssSourceTrace?: CssSourceTraceUserOptions | undefined;
|
|
21
22
|
disabledDefaultTemplateHandler?: boolean | undefined;
|
|
@@ -28,12 +29,13 @@ export interface UserDefinedOptionsGeneralPart {
|
|
|
28
29
|
cacheMaxEntries?: number | undefined;
|
|
29
30
|
cacheMaxSourceLength?: number | undefined;
|
|
30
31
|
}) | undefined;
|
|
32
|
+
experimentalJsFastPath?: boolean | 'oxc' | undefined;
|
|
31
33
|
cssChildCombinatorReplaceValue?: string | string[] | undefined;
|
|
32
34
|
postcssOptions?: LoadedPostcssOptions | undefined;
|
|
33
35
|
cssOptions?: CssOptions | undefined;
|
|
34
36
|
cssRemoveHoverPseudoClass?: boolean | undefined;
|
|
35
37
|
cssRemoveProperty?: boolean | undefined;
|
|
36
38
|
tailwindcssV4GradientFallback?: boolean | undefined;
|
|
37
|
-
|
|
39
|
+
tailwindcssRuntimeOptions?: TailwindCssRuntimeOptions | undefined;
|
|
38
40
|
logLevel?: 'info' | 'warn' | 'error' | 'silent' | undefined;
|
|
39
41
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CssCalcOptions, CssPreflightOptions, IStyleHandlerOptions, PresetEnvOptions, Px2rpxOptions, Rem2rpxOptions, UniAppXUnsupportedMode, UnitConversionOptions, UnitsToPxOptions, WeappAutoprefixerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
-
import type { TailwindCssPatchOptions } from 'tailwindcss-patch';
|
|
3
2
|
import type { ICustomAttributes } from '../shared';
|
|
3
|
+
import type { TailwindCssRuntimeOptions } from '../../tailwindcss/runtime-types';
|
|
4
4
|
export interface UniAppXComponentLocalStylesOptions {
|
|
5
5
|
enabled?: boolean | undefined;
|
|
6
6
|
onlyWhenStyleIsolationVersion2?: boolean | undefined;
|
|
@@ -34,7 +34,7 @@ export interface UserDefinedOptionsImportantPart {
|
|
|
34
34
|
cssPresetEnv?: PresetEnvOptions | undefined;
|
|
35
35
|
atRules?: IStyleHandlerOptions['atRules'] | undefined;
|
|
36
36
|
autoprefixer?: WeappAutoprefixerOptions | undefined;
|
|
37
|
-
tailwindcss?:
|
|
37
|
+
tailwindcss?: TailwindCssRuntimeOptions['tailwindcss'] | undefined;
|
|
38
38
|
cssEntries?: string[] | undefined;
|
|
39
39
|
uniAppX?: boolean | UniAppXOptions | undefined;
|
|
40
40
|
uniAppXCssTarget?: IStyleHandlerOptions['uniAppXCssTarget'] | undefined;
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
import type { ItemOrItemArray } from '../base';
|
|
1
2
|
import type { AppType } from '../shared';
|
|
3
|
+
export type TransformRule = string | RegExp | ((id: string) => boolean);
|
|
4
|
+
export interface TransformOptions {
|
|
5
|
+
include?: ItemOrItemArray<TransformRule> | undefined;
|
|
6
|
+
exclude?: ItemOrItemArray<TransformRule> | undefined;
|
|
7
|
+
}
|
|
2
8
|
export interface UserDefinedOptionsMatcherPart {
|
|
3
9
|
htmlMatcher?: ((name: string) => boolean) | undefined;
|
|
4
10
|
cssMatcher?: ((name: string) => boolean) | undefined;
|
|
5
11
|
jsMatcher?: ((name: string) => boolean) | undefined;
|
|
12
|
+
transform?: TransformOptions | undefined;
|
|
6
13
|
mainCssChunkMatcher?: ((name: string, appType?: AppType) => boolean) | undefined;
|
|
7
14
|
wxsMatcher?: ((name: string) => boolean) | undefined;
|
|
8
15
|
inlineWxs?: boolean | undefined;
|
|
@@ -6,6 +6,7 @@ type BundleItem = {
|
|
|
6
6
|
} | OutputAsset | OutputChunk;
|
|
7
7
|
interface HarmonyStyleInjectOptions {
|
|
8
8
|
cssSources?: Iterable<string | undefined> | undefined;
|
|
9
|
+
styleAssetFiles?: Iterable<string | undefined> | ((file: string) => Iterable<string | undefined>) | undefined;
|
|
9
10
|
excludeComponents?: boolean | undefined;
|
|
10
11
|
mapSources?: Iterable<string | undefined> | undefined;
|
|
11
12
|
}
|