weapp-tailwindcss 5.5.6 → 5.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{auto-DtU6f3X6.cjs → auto-B1OyRrE8.cjs} +1 -1
- package/dist/{auto-2dg_uhEJ.js → auto-ENr4xzzw.js} +1 -1
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +1 -1
- package/dist/bundlers/shared/css-cleanup/at-rules.d.ts +1 -1
- package/dist/bundlers/shared/css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/css-source-trace.d.ts +2 -5
- package/dist/bundlers/shared/final-css-cleanup.d.ts +1 -1
- package/dist/bundlers/shared/framework-css-composition.d.ts +1 -1
- package/dist/bundlers/shared/framework-postcss.d.ts +1 -25
- package/dist/bundlers/shared/framework-user-css.d.ts +1 -4
- package/dist/bundlers/shared/generated-css-marker.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/candidates.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/class-selectors.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/config-directive.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/directives/fallback.d.ts +1 -11
- package/dist/bundlers/shared/generator-css/directives.d.ts +1 -25
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +1 -19
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +1 -23
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +1 -30
- package/dist/bundlers/shared/generator-css/generation-helpers/source-order.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +1 -12
- package/dist/bundlers/shared/generator-css/legacy-selectors.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/legacy-units.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/local-imports.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/markers.d.ts +1 -28
- package/dist/bundlers/shared/generator-css/output-import-shell.d.ts +1 -8
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +1 -60
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +1 -2
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +1 -6
- package/dist/bundlers/shared/generator-css/scoped-rules.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-files.d.ts +1 -21
- package/dist/bundlers/shared/generator-css/source-resolver/apply-reference.d.ts +1 -13
- package/dist/bundlers/shared/generator-css/source-resolver/config.d.ts +1 -7
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +1 -33
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +1 -28
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +1 -14
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +1 -16
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +1 -22
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +1 -7
- package/dist/bundlers/shared/generator-css/types.d.ts +1 -64
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/user-css/at-rules.d.ts +1 -3
- package/dist/bundlers/shared/generator-css/user-css/compile-functions.d.ts +1 -4
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +1 -6
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +1 -15
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +1 -13
- package/dist/bundlers/shared/generator-css/user-css/user-layers.d.ts +1 -15
- package/dist/bundlers/shared/generator-css/user-css.d.ts +1 -5
- package/dist/bundlers/shared/generator-css/user-layer-order.d.ts +1 -10
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -7
- package/dist/bundlers/shared/generator-css.d.ts +1 -9
- package/dist/bundlers/shared/run-tasks.d.ts +1 -3
- package/dist/bundlers/shared/runtime-class-set.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/collector.d.ts +1 -8
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +1 -12
- package/dist/bundlers/shared/source-candidates/script.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/snapshot.d.ts +1 -19
- package/dist/bundlers/shared/source-candidates/source-priority.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/store.d.ts +1 -2
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +1 -75
- package/dist/bundlers/shared/source-candidates/views.d.ts +1 -12
- package/dist/bundlers/shared/source-candidates.d.ts +1 -4
- package/dist/bundlers/shared/source-scan/css-entries.d.ts +1 -18
- package/dist/bundlers/shared/source-scan/dependencies.d.ts +1 -2
- package/dist/bundlers/shared/source-scan.d.ts +1 -16
- package/dist/bundlers/shared/static-config-content.d.ts +1 -5
- package/dist/bundlers/shared/style-handler-options.d.ts +1 -7
- package/dist/bundlers/shared/style-requests.d.ts +1 -5
- package/dist/bundlers/shared/v4-generation-core.d.ts +1 -20
- package/dist/bundlers/vite/generate-bundle/configured-css-sources.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-transform-task.d.ts +2 -2
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +1 -12
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +1 -4
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +4 -7
- package/dist/bundlers/vite/processed-css-assets/scoped-tailwind-noise.d.ts +1 -13
- package/dist/bundlers/vite/shared/framework-module-candidates.d.ts +2 -2
- package/dist/bundlers/vite/source-candidates/scan-root.d.ts +1 -1
- package/dist/bundlers/vite/source-candidates.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.d.ts +2 -7
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +4 -8
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +2 -7
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/watch-dependencies.d.ts +6 -0
- package/dist/cache/index.d.ts +4 -4
- package/dist/cache/source.d.ts +29 -0
- package/dist/{cache-CBJFB1HN.cjs → cache-CzvIGfwS.cjs} +1 -0
- package/dist/compiler/composition.d.ts +1 -1
- package/dist/compiler/runtime-affecting-signature/js.d.ts +1 -0
- package/dist/compiler/semantic-css.d.ts +1 -1
- package/dist/compiler/types.d.ts +1 -1
- package/dist/{compiler-D3GBwxoa.js → compiler-CThodfGH.js} +3098 -3067
- package/dist/{compiler-C8FqI-P3.cjs → compiler-DbwS3329.cjs} +20979 -20870
- package/dist/core/compiler/generation-cache.d.ts +4 -2
- package/dist/core/compiler/types.d.ts +1 -1
- package/dist/core.cjs +7 -7
- package/dist/core.d.ts +2 -2
- package/dist/core.js +2 -2
- package/dist/css-cleanup-B6FUJC3z.cjs +1 -0
- package/dist/{css-imports-XvtI1zCY.cjs → css-imports-R_RDMjPz.cjs} +7 -21
- package/dist/css-macro/auto.d.ts +1 -1
- package/dist/css-macro/postcss.cjs +1 -1
- package/dist/css-macro.cjs +2 -2
- package/dist/css-macro.js +1 -1
- package/dist/final-css-cleanup-B6FUJC3z.cjs +1 -0
- package/dist/{final-css-cleanup-u_sI2p56.js → final-css-cleanup-BOzhuhGz.js} +3 -2
- package/dist/framework.cjs +1 -1
- package/dist/{v4-generation-core-Cz1D7wm1.cjs → generated-css-marker-B0RyziOH.cjs} +638 -1546
- package/dist/generation/candidates.d.ts +1 -0
- package/dist/generation/class-selectors.d.ts +4 -0
- package/dist/generation/config-directive.d.ts +1 -0
- package/dist/generation/directives/fallback.d.ts +1 -0
- package/dist/generation/directives.d.ts +1 -0
- package/dist/generation/framework-css-composition.d.ts +1 -0
- package/dist/generation/framework-postcss.d.ts +25 -0
- package/dist/generation/framework-user-css.d.ts +5 -0
- package/dist/generation/generation-helpers/preflight.d.ts +19 -0
- package/dist/generation/generation-helpers/results.d.ts +23 -0
- package/dist/generation/generation-helpers/runtime-isolation.d.ts +30 -0
- package/dist/generation/generation-helpers/source-order.d.ts +1 -0
- package/dist/generation/generation-helpers.d.ts +4 -0
- package/dist/generation/index.d.ts +9 -0
- package/dist/generation/legacy-compat.d.ts +12 -0
- package/dist/generation/legacy-selectors.d.ts +1 -0
- package/dist/generation/legacy-units.d.ts +1 -0
- package/dist/generation/local-imports.d.ts +1 -0
- package/dist/generation/markers.d.ts +1 -0
- package/dist/generation/output-import-shell.d.ts +1 -0
- package/dist/generation/pipeline/context.d.ts +60 -0
- package/dist/generation/pipeline/deferred-output.d.ts +3 -0
- package/dist/generation/pipeline/execution.d.ts +3 -0
- package/dist/generation/pipeline/fallback-output.d.ts +3 -0
- package/dist/generation/pipeline/ordered-output.d.ts +3 -0
- package/dist/generation/pipeline/preparation.d.ts +19 -0
- package/dist/generation/pipeline.d.ts +2 -0
- package/dist/generation/result-helpers.d.ts +6 -0
- package/dist/generation/scoped-rules.d.ts +1 -0
- package/dist/generation/service.d.ts +20 -0
- package/dist/generation/source-files.d.ts +21 -0
- package/dist/generation/source-resolver/apply-reference.d.ts +10 -0
- package/dist/generation/source-resolver/config.d.ts +7 -0
- package/dist/generation/source-resolver/configuration.d.ts +33 -0
- package/dist/generation/source-resolver/matching.d.ts +3 -0
- package/dist/generation/source-resolver/metadata.d.ts +28 -0
- package/dist/generation/source-resolver/postcss-source.d.ts +14 -0
- package/dist/generation/source-resolver/resolve-source.d.ts +4 -0
- package/dist/generation/source-resolver/resolve-sources.d.ts +5 -0
- package/dist/generation/source-resolver/single-source.d.ts +16 -0
- package/dist/generation/source-resolver/source-entries.d.ts +3 -0
- package/dist/generation/source-resolver/source-matching.d.ts +5 -0
- package/dist/generation/source-resolver/types.d.ts +22 -0
- package/dist/generation/source-resolver.d.ts +7 -0
- package/dist/generation/style-options.d.ts +8 -0
- package/dist/generation/style-requests.d.ts +5 -0
- package/dist/generation/types.d.ts +65 -0
- package/dist/generation/user-css/apply-only.d.ts +5 -0
- package/dist/generation/user-css/at-rules.d.ts +1 -0
- package/dist/generation/user-css/compile-functions.d.ts +3 -0
- package/dist/generation/user-css/generated-cleanup.d.ts +1 -0
- package/dist/generation/user-css/source-fragments.d.ts +1 -0
- package/dist/generation/user-css/transform.d.ts +1 -0
- package/dist/generation/user-css/user-layers.d.ts +1 -0
- package/dist/generation/user-css.d.ts +5 -0
- package/dist/generation/user-layer-order.d.ts +1 -0
- package/dist/generation/validate.d.ts +7 -0
- package/dist/generator-CxauQbx3.cjs +1868 -0
- package/dist/generator-oKZ5mCJ5.js +1637 -0
- package/dist/generator.cjs +10 -4
- package/dist/generator.js +1 -1
- package/dist/{gulp-BExe5RBF.cjs → gulp-CngHA9cU.cjs} +27 -26
- package/dist/{gulp-BhkIIk7J.js → gulp-DhddVxGA.js} +6 -5
- package/dist/gulp.cjs +1 -1
- package/dist/gulp.js +1 -1
- package/dist/{hmr-timing-CoiJIqDu.cjs → hmr-timing-Dc4c1VRg.cjs} +13 -13
- package/dist/{hmr-timing-B9Yt86-U.js → hmr-timing-xPpat-km.js} +518 -1360
- package/dist/index.cjs +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/js/ModuleGraph.d.ts +3 -1
- package/dist/js/babel/analyze.d.ts +6 -0
- package/dist/js/babel.d.ts +1 -2
- package/dist/js/fast-path/analysis.d.ts +14 -0
- package/dist/js/fast-path/oxc.d.ts +1 -1
- package/dist/js/oxc-parser.d.ts +4 -0
- package/dist/pipeline-helpers-EUud9R2K.cjs +516 -0
- package/dist/postcss-html-transform.cjs +1 -1
- package/dist/postcss.cjs +3 -2
- package/dist/postcss.d.ts +1 -1
- package/dist/postcss.js +3 -2
- package/dist/presets.cjs +3 -3
- package/dist/presets.js +2 -2
- package/dist/project-sources/candidates/collector.d.ts +8 -0
- package/dist/project-sources/candidates/scan-root.d.ts +12 -0
- package/dist/project-sources/candidates/script.d.ts +1 -0
- package/dist/project-sources/candidates/snapshot.d.ts +19 -0
- package/dist/project-sources/candidates/source-priority.d.ts +1 -0
- package/dist/project-sources/candidates/store.d.ts +2 -0
- package/dist/project-sources/candidates/types-and-cache.d.ts +75 -0
- package/dist/project-sources/candidates/views.d.ts +12 -0
- package/dist/project-sources/candidates.d.ts +4 -0
- package/dist/project-sources/css-entries.d.ts +18 -0
- package/dist/project-sources/dependencies.d.ts +2 -0
- package/dist/project-sources/index.d.ts +16 -0
- package/dist/project-sources/static-config-content.d.ts +5 -0
- package/dist/reset.cjs +1 -1
- package/dist/{rolldown-runtime-Ctb5zv51.cjs → rolldown-runtime-fg3euq-1.cjs} +7 -0
- package/dist/rspack.cjs +4 -4
- package/dist/rspack.js +2 -2
- package/dist/{runtime-state-XYSycuGu.cjs → runtime-state-BOzuVoKl.cjs} +1 -1
- package/dist/{scoped-generator-B6Y1bxzM.js → scoped-generator-DlQrVbuC.js} +7 -6
- package/dist/{scoped-generator-BUBls_oM.cjs → scoped-generator-lbTwL6mD.cjs} +9 -9
- package/dist/{source-candidate-scan-signature-DNuGKTqf.js → source-candidate-scan-signature-BjVQYL-C.js} +3 -3
- package/dist/{source-candidate-scan-signature-BtJZp28T.cjs → source-candidate-scan-signature-nG-rg809.cjs} +4 -4
- package/dist/style-injector/internal.d.ts +35 -35
- package/dist/style-injector/options.d.ts +1 -1
- package/dist/tailwindcss/miniprogram.d.ts +1 -1
- package/dist/tailwindcss/remove-unsupported-css.d.ts +1 -1
- package/dist/tailwindcss/source-scan/inline-source.d.ts +1 -7
- package/dist/tailwindcss/source-scan.d.ts +3 -32
- package/dist/tailwindcss/v4/css-sources.d.ts +1 -1
- package/dist/tailwindcss/v4/preflight.d.ts +1 -3
- package/dist/tailwindcss/v4/rpx-theme-warning.d.ts +4 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +2 -3
- package/dist/tailwindcss/v4-engine/generator/native-session.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/rpx-candidates.d.ts +1 -6
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +5 -2
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +3 -7
- package/dist/tailwindcss/v4-engine/source.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/types.d.ts +3 -1
- package/dist/{tailwindcss-CBYjzRmV.cjs → tailwindcss-U3KIUegn.cjs} +65 -264
- package/dist/{tailwindcss-B_4E52WF.js → tailwindcss-kSd0ykiX.js} +71 -243
- package/dist/{transform-CkEnJYIP.js → transform-BAon9ykq.js} +25 -16
- package/dist/{transform-FkqbTBJR.cjs → transform-DVg4q8hh.cjs} +32 -23
- package/dist/types/index.d.ts +2 -2
- package/dist/types/user-defined-options/general.d.ts +1 -1
- package/dist/uni-app-x/border-preflight.d.ts +1 -1
- package/dist/uni-app-x/component-local-style.d.ts +3 -1
- package/dist/uni-app-x/vite/style-result.d.ts +1 -1
- package/dist/utils/run-tasks.d.ts +3 -0
- package/dist/vite/web.cjs +1 -1
- package/dist/vite/web.js +1 -1
- package/dist/{vite-lP35OguX.js → vite-D-RGkmOE.js} +62 -674
- package/dist/{vite-DxuKPZlp.cjs → vite-IX83wh_L.cjs} +217 -828
- package/dist/vite.cjs +1 -1
- package/dist/vite.js +1 -1
- package/dist/{watch-dependencies-GbC14Rlt.cjs → watch-dependencies-C1so1whD.cjs} +14 -1
- package/dist/weapp-tw-css-generation-loader.cjs +4 -3
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +33 -28
- package/dist/weapp-tw-runtime-classset-loader.cjs +5 -18
- package/dist/{web-Dfz_jpNj.js → web--kA4HUTm.js} +16 -115
- package/dist/{web-DhDxhlkq.cjs → web-DHfZ_KC9.cjs} +83 -192
- package/dist/{webpack-R2Sbggiy.cjs → webpack-BetjemzT.cjs} +87 -87
- package/dist/{webpack-D6jp1o3m.js → webpack-Bhkd27Rs.js} +28 -441
- package/dist/webpack.cjs +1 -1
- package/dist/webpack.js +1 -1
- package/package.json +12 -7
- package/dist/final-css-cleanup-CDTmVAye.cjs +0 -1
- package/dist/generator-Bvr4WmuF.cjs +0 -3891
- package/dist/generator-C0BJjyLM.js +0 -3343
- package/dist/pipeline-helpers-BOjTEmMi.cjs +0 -971
|
@@ -1,175 +1,63 @@
|
|
|
1
|
-
import { A as normalizeStringListOption,
|
|
1
|
+
import { A as normalizeStringListOption, B as loadTailwindV4DesignSystem, C as findWorkspacePackageDir, D as normalizeTailwindcssRuntimeOptions, E as normalizeExtendLengthUnits, I as resolveCssMacroTailwindV4Source, O as resolveRuntimeBareArbitraryValues, S as findNearestPackageRoot, T as omitUndefined, b as isTailwindV4CssEntry, d as resolveTailwindV4SourceFromRuntime, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, k as resolveTailwindcssOptions, m as filterTailwindV4CssSourceRoots, p as resolveTailwindV4SourceOptionsFromRuntime, v as groupCssEntriesByBase, w as findWorkspaceRoot, x as normalizeCssEntries, y as guessBasedirFromEntries } from "./generator-oKZ5mCJ5.js";
|
|
2
2
|
import { n as defuOverrideArray$1 } from "./utils-MVwpU07P.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import process from "node:process";
|
|
7
|
-
import { extractProjectCandidatesWithPositions, resolveValidTailwindV4Candidates } from "@tailwindcss
|
|
8
|
-
import {
|
|
9
|
-
import { stat } from "node:fs/promises";
|
|
7
|
+
import { extractProjectCandidatesWithPositions, resolveValidTailwindV4Candidates } from "@weapp-tailwindcss/engine";
|
|
8
|
+
import { analyzeTailwindV4EntrySource, collectRuntimeApplyCandidates } from "@weapp-tailwindcss/postcss/transform";
|
|
10
9
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
10
|
+
import { collectCssInlineSourceCandidates, expandInlineSourceCandidatePattern, expandTailwindSourceEntries, parseConfigParam, parseSourceFileParam, resolveCssSourceEntries } from "@weapp-tailwindcss/postcss/syntax";
|
|
11
|
+
import { stat } from "node:fs/promises";
|
|
12
|
+
import { logger } from "@weapp-tailwindcss/logger";
|
|
11
13
|
import fg from "fast-glob";
|
|
12
14
|
import { loadConfig } from "tailwindcss-config";
|
|
13
|
-
import { logger } from "@weapp-tailwindcss/logger";
|
|
14
15
|
import { fileURLToPath } from "node:url";
|
|
15
|
-
//#region
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
for (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
index += 1;
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
if (quote) {
|
|
29
|
-
if (char === quote) quote = void 0;
|
|
30
|
-
continue;
|
|
31
|
-
}
|
|
32
|
-
if (char === "\"" || char === "'") {
|
|
33
|
-
quote = char;
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
if (char === "(") {
|
|
37
|
-
stack.push(")");
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
if (char === "[") {
|
|
41
|
-
stack.push("]");
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
if (char === "{") {
|
|
45
|
-
stack.push("}");
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
if (stack.length > 0 && char === stack[stack.length - 1]) {
|
|
49
|
-
stack.pop();
|
|
50
|
-
continue;
|
|
51
|
-
}
|
|
52
|
-
if (stack.length === 0 && char === separator) {
|
|
53
|
-
const part = input.slice(lastPos, index);
|
|
54
|
-
if (part || options.keepEmpty) parts.push(part);
|
|
55
|
-
lastPos = index + 1;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const part = input.slice(lastPos);
|
|
59
|
-
if (part || options.keepEmpty) parts.push(part);
|
|
60
|
-
return parts;
|
|
61
|
-
}
|
|
62
|
-
function isSequence(value) {
|
|
63
|
-
return NUMERICAL_RANGE_RE.test(value);
|
|
64
|
-
}
|
|
65
|
-
function expandSequence(value) {
|
|
66
|
-
const match = value.match(NUMERICAL_RANGE_RE);
|
|
67
|
-
if (!match) return [value];
|
|
68
|
-
const [, start, end, stepValue] = match;
|
|
69
|
-
if (start === void 0 || end === void 0) return [value];
|
|
70
|
-
let step = stepValue ? Number.parseInt(stepValue, 10) : void 0;
|
|
71
|
-
const startNumber = Number.parseInt(start, 10);
|
|
72
|
-
const endNumber = Number.parseInt(end, 10);
|
|
73
|
-
const increasing = startNumber < endNumber;
|
|
74
|
-
if (step === void 0) step = increasing ? 1 : -1;
|
|
75
|
-
if (step === 0) return [];
|
|
76
|
-
if (increasing && step < 0) step = -step;
|
|
77
|
-
if (!increasing && step > 0) step = -step;
|
|
78
|
-
const result = [];
|
|
79
|
-
for (let value = startNumber; increasing ? value <= endNumber : value >= endNumber; value += step) result.push(String(value));
|
|
80
|
-
return result;
|
|
81
|
-
}
|
|
82
|
-
function expandInlineSourceCandidatePattern(pattern) {
|
|
83
|
-
const index = pattern.indexOf("{");
|
|
84
|
-
if (index === -1) return [pattern];
|
|
85
|
-
const prefix = pattern.slice(0, index);
|
|
86
|
-
const rest = pattern.slice(index);
|
|
87
|
-
let depth = 0;
|
|
88
|
-
let endIndex = -1;
|
|
89
|
-
for (let index = 0; index < rest.length; index++) {
|
|
90
|
-
const char = rest[index];
|
|
91
|
-
if (char === "{") depth += 1;
|
|
92
|
-
else if (char === "}") {
|
|
93
|
-
depth -= 1;
|
|
94
|
-
if (depth === 0) {
|
|
95
|
-
endIndex = index;
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (endIndex === -1) return [pattern];
|
|
101
|
-
const inner = rest.slice(1, endIndex);
|
|
102
|
-
const suffix = rest.slice(endIndex + 1);
|
|
103
|
-
const parts = (isSequence(inner) ? expandSequence(inner) : segmentTopLevel(inner, ",", { keepEmpty: true })).flatMap((part) => expandInlineSourceCandidatePattern(part));
|
|
104
|
-
return expandInlineSourceCandidatePattern(suffix).flatMap((suffix) => parts.map((part) => `${prefix}${part}${suffix}`));
|
|
105
|
-
}
|
|
106
|
-
function parseSourceInlineParam(params) {
|
|
107
|
-
let value = params.trim();
|
|
108
|
-
const negated = value.startsWith("not ");
|
|
109
|
-
if (negated) value = value.slice(4).trim();
|
|
110
|
-
if (!value.startsWith("inline(") || !value.endsWith(")")) return;
|
|
111
|
-
const inlineValue = value.slice(7, -1).trim();
|
|
112
|
-
const match = /^(['"])([\s\S]*)\1$/.exec(inlineValue);
|
|
113
|
-
if (!match) return;
|
|
114
|
-
const source = match[2];
|
|
115
|
-
if (source === void 0) return;
|
|
116
|
-
return {
|
|
117
|
-
negated,
|
|
118
|
-
source
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function collectCssInlineSourceCandidates(root) {
|
|
122
|
-
const included = /* @__PURE__ */ new Set();
|
|
123
|
-
const excluded = /* @__PURE__ */ new Set();
|
|
124
|
-
root.walkAtRules("source", (rule) => {
|
|
125
|
-
const parsed = parseSourceInlineParam(rule.params);
|
|
126
|
-
if (!parsed) return;
|
|
127
|
-
const target = parsed.negated ? excluded : included;
|
|
128
|
-
for (const source of segmentTopLevel(parsed.source, " ")) {
|
|
129
|
-
const trimmed = source.trim();
|
|
130
|
-
if (!trimmed) continue;
|
|
131
|
-
for (const candidate of expandInlineSourceCandidatePattern(trimmed)) {
|
|
132
|
-
const normalized = candidate.trim();
|
|
133
|
-
if (normalized) target.add(normalized);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
16
|
+
//#region \0rolldown/runtime.js
|
|
17
|
+
var __defProp = Object.defineProperty;
|
|
18
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
19
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
20
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
21
|
+
var __exportAll = (all, no_symbols) => {
|
|
22
|
+
let target = {};
|
|
23
|
+
for (var name in all) __defProp(target, name, {
|
|
24
|
+
get: all[name],
|
|
25
|
+
enumerable: true
|
|
136
26
|
});
|
|
137
|
-
|
|
138
|
-
return
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return parseCssImportSpecifier(params)?.specifier.replaceAll("\\", "/");
|
|
147
|
-
}
|
|
148
|
-
function isTailwindV4CssImportParam(params) {
|
|
149
|
-
const specifier = normalizeTailwindImportSpecifier(params);
|
|
150
|
-
return specifier === "tailwindcss" || specifier === "tailwindcss4" || specifier?.startsWith("tailwindcss/") === true || specifier?.startsWith("tailwindcss4/") === true || specifier?.endsWith("/tailwindcss/index.css") === true;
|
|
151
|
-
}
|
|
152
|
-
function isTailwindV4PreflightImportParam(params) {
|
|
153
|
-
const specifier = normalizeTailwindImportSpecifier(params);
|
|
154
|
-
return specifier === "tailwindcss" || specifier === "tailwindcss4" || specifier === "tailwindcss/preflight" || specifier === "tailwindcss/preflight.css" || specifier === "tailwindcss4/preflight" || specifier === "tailwindcss4/preflight.css" || specifier?.endsWith("/tailwindcss/index.css") === true || specifier?.endsWith("/tailwindcss/preflight.css") === true;
|
|
155
|
-
}
|
|
156
|
-
function includesTailwindV4PreflightDirective(css) {
|
|
157
|
-
try {
|
|
158
|
-
const root = postcss.parse(css);
|
|
159
|
-
let includesPreflight = false;
|
|
160
|
-
root.walkAtRules("import", (rule) => {
|
|
161
|
-
includesPreflight || (includesPreflight = isTailwindV4PreflightImportParam(rule.params));
|
|
162
|
-
});
|
|
163
|
-
root.walkAtRules("tailwind", (rule) => {
|
|
164
|
-
includesPreflight || (includesPreflight = rule.params.trim() === "base");
|
|
27
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
28
|
+
return target;
|
|
29
|
+
};
|
|
30
|
+
var __copyProps = (to, from, except, desc) => {
|
|
31
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
32
|
+
key = keys[i];
|
|
33
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
34
|
+
get: ((k) => from[k]).bind(null, key),
|
|
35
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
165
36
|
});
|
|
166
|
-
return includesPreflight;
|
|
167
|
-
} catch {
|
|
168
|
-
return /@import\s+(?:url\(\s*)?["']?tailwindcss4?(?:\/(?:preflight(?:\.css)?|index\.css))?["')\s;]/.test(css) || /@tailwind\s+base\b/.test(css);
|
|
169
37
|
}
|
|
38
|
+
return to;
|
|
39
|
+
};
|
|
40
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/tailwindcss/source-scan.ts
|
|
43
|
+
var source_scan_exports = /* @__PURE__ */ __exportAll({
|
|
44
|
+
collectCssInlineSourceCandidates: () => collectCssInlineSourceCandidates,
|
|
45
|
+
expandInlineSourceCandidatePattern: () => expandInlineSourceCandidatePattern,
|
|
46
|
+
expandTailwindSourceEntries: () => expandTailwindSourceEntries,
|
|
47
|
+
parseConfigParam: () => parseConfigParam,
|
|
48
|
+
parseSourceFileParam: () => parseSourceFileParam,
|
|
49
|
+
resolveCssSourceEntries: () => resolveCssSourceEntries,
|
|
50
|
+
resolveTailwindV4CssSourceBase: () => resolveTailwindV4CssSourceBase
|
|
51
|
+
});
|
|
52
|
+
import * as import__weapp_tailwindcss_source_scan from "@weapp-tailwindcss/source-scan";
|
|
53
|
+
__reExport(source_scan_exports, import__weapp_tailwindcss_source_scan);
|
|
54
|
+
function resolveTailwindV4CssSourceBase(source, fallbackBase) {
|
|
55
|
+
if (typeof source.base === "string" && source.base.length > 0) return source.base;
|
|
56
|
+
if (typeof source.file === "string" && source.file.length > 0) return path.dirname(source.file);
|
|
57
|
+
return fallbackBase;
|
|
170
58
|
}
|
|
171
59
|
//#endregion
|
|
172
|
-
//#region src/
|
|
60
|
+
//#region src/project-sources/static-config-content.ts
|
|
173
61
|
function skipWhitespaceAndComments(source, start) {
|
|
174
62
|
let index = start;
|
|
175
63
|
while (index < source.length) {
|
|
@@ -339,18 +227,10 @@ function readStaticConfigContent(configPath) {
|
|
|
339
227
|
return parseStaticContentValue(source, contentProperty.start)?.value;
|
|
340
228
|
}
|
|
341
229
|
//#endregion
|
|
342
|
-
//#region src/
|
|
343
|
-
const SOURCE_CANDIDATE_PATTERN = FULL_SOURCE_SCAN_PATTERN;
|
|
230
|
+
//#region src/project-sources/css-entries.ts
|
|
231
|
+
const SOURCE_CANDIDATE_PATTERN = source_scan_exports.FULL_SOURCE_SCAN_PATTERN;
|
|
344
232
|
const TAILWIND_CSS_ENTRY_PATTERN = "**/*.css";
|
|
345
233
|
const tailwindV4CssEntriesCache = /* @__PURE__ */ new Map();
|
|
346
|
-
function parseImportSourceParam$1(params) {
|
|
347
|
-
const match = /\bsource\(\s*(none|(['"])(.*?)\2)\s*\)/.exec(params);
|
|
348
|
-
if (!match) return;
|
|
349
|
-
return {
|
|
350
|
-
none: match[1] === "none",
|
|
351
|
-
sourcePath: match[3]
|
|
352
|
-
};
|
|
353
|
-
}
|
|
354
234
|
function resolveSourceBase(base, sourcePath) {
|
|
355
235
|
return path.isAbsolute(sourcePath) ? sourcePath : path.resolve(base, sourcePath);
|
|
356
236
|
}
|
|
@@ -365,9 +245,9 @@ function createCssEntriesCacheKey(css, base, dependencies) {
|
|
|
365
245
|
dependencies
|
|
366
246
|
});
|
|
367
247
|
}
|
|
368
|
-
|
|
248
|
+
function statConfigDependency(file) {
|
|
369
249
|
try {
|
|
370
|
-
const stats =
|
|
250
|
+
const stats = statSync(file);
|
|
371
251
|
return {
|
|
372
252
|
file,
|
|
373
253
|
mtimeMs: stats.mtimeMs,
|
|
@@ -381,13 +261,8 @@ async function statConfigDependency(file) {
|
|
|
381
261
|
};
|
|
382
262
|
}
|
|
383
263
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
root.walkAtRules("config", (rule) => {
|
|
387
|
-
const configPath = parseConfigParam(rule.params);
|
|
388
|
-
if (configPath) configPaths.add(resolveConfigPath(base, configPath));
|
|
389
|
-
});
|
|
390
|
-
return Promise.all([...configPaths].sort().map(statConfigDependency));
|
|
264
|
+
function collectConfigDependencySignatures(requests, base) {
|
|
265
|
+
return [...new Set(requests.map((request) => resolveConfigPath(base, request)))].sort().map(statConfigDependency);
|
|
391
266
|
}
|
|
392
267
|
function mergeTailwindInlineSourceCandidates(allInlineCandidates) {
|
|
393
268
|
const merged = {
|
|
@@ -404,17 +279,13 @@ function mergeTailwindInlineSourceCandidates(allInlineCandidates) {
|
|
|
404
279
|
}
|
|
405
280
|
return merged.included.size > 0 || merged.excluded.size > 0 ? merged : void 0;
|
|
406
281
|
}
|
|
407
|
-
async function resolveConfigContentEntries(
|
|
408
|
-
const configPaths =
|
|
409
|
-
root.walkAtRules("config", (rule) => {
|
|
410
|
-
const configPath = parseConfigParam(rule.params);
|
|
411
|
-
if (configPath) configPaths.add(resolveConfigPath(base, configPath));
|
|
412
|
-
});
|
|
282
|
+
async function resolveConfigContentEntries(requests, base) {
|
|
283
|
+
const configPaths = new Set(requests.map((request) => resolveConfigPath(base, request)));
|
|
413
284
|
const entries = [];
|
|
414
285
|
for (const configPath of configPaths) {
|
|
415
286
|
const staticContent = readStaticConfigContent(configPath);
|
|
416
287
|
if (staticContent !== void 0) {
|
|
417
|
-
entries.push(...normalizeLegacyContentEntries(staticContent, path.dirname(configPath), { relativeBase: path.dirname(configPath) }));
|
|
288
|
+
entries.push(...(0, source_scan_exports.normalizeLegacyContentEntries)(staticContent, path.dirname(configPath), { relativeBase: path.dirname(configPath) }));
|
|
418
289
|
continue;
|
|
419
290
|
}
|
|
420
291
|
try {
|
|
@@ -422,7 +293,7 @@ async function resolveConfigContentEntries(root, base) {
|
|
|
422
293
|
config: configPath,
|
|
423
294
|
cwd: path.dirname(configPath)
|
|
424
295
|
});
|
|
425
|
-
entries.push(...normalizeLegacyContentEntries(loaded?.config.content, path.dirname(configPath), { relativeBase: path.dirname(configPath) }));
|
|
296
|
+
entries.push(...(0, source_scan_exports.normalizeLegacyContentEntries)(loaded?.config.content, path.dirname(configPath), { relativeBase: path.dirname(configPath) }));
|
|
426
297
|
} catch {}
|
|
427
298
|
}
|
|
428
299
|
return {
|
|
@@ -431,31 +302,15 @@ async function resolveConfigContentEntries(root, base) {
|
|
|
431
302
|
};
|
|
432
303
|
}
|
|
433
304
|
async function resolveTailwindV4EntriesFromCss(css, base) {
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
let hasSourceNone = false;
|
|
442
|
-
let hasTailwindCssImport = false;
|
|
443
|
-
let includesPreflight = false;
|
|
444
|
-
const [sourceEntries, configEntries] = await Promise.all([resolveCssSourceEntries(root, base, SOURCE_CANDIDATE_PATTERN), resolveConfigContentEntries(root, base)]);
|
|
305
|
+
const analysis = analyzeTailwindV4EntrySource(css);
|
|
306
|
+
return analysis ? resolveTailwindV4EntriesFromAnalysis(analysis, base) : void 0;
|
|
307
|
+
}
|
|
308
|
+
async function resolveTailwindV4EntriesFromAnalysis(analysis, base) {
|
|
309
|
+
const { hasSourceNone, hasTailwindCssImport, includesPreflight, inlineCandidates, sourceRequests, importSourcePath } = analysis.getSourceDirectives();
|
|
310
|
+
const importSourceBase = importSourcePath ? resolveSourceBase(base, importSourcePath) : void 0;
|
|
311
|
+
const [sourceEntries, configEntries] = await Promise.all([Promise.all(sourceRequests.map((request) => (0, source_scan_exports.resolveTailwindSourceEntry)(request.sourcePath, base, request.negated, SOURCE_CANDIDATE_PATTERN))), resolveConfigContentEntries(analysis.configRequests, base)]);
|
|
445
312
|
const entries = [...configEntries.entries, ...sourceEntries];
|
|
446
313
|
const hasPositiveEntries = entries.some((entry) => !entry.negated);
|
|
447
|
-
const inlineCandidates = collectCssInlineSourceCandidates(root);
|
|
448
|
-
root.walkAtRules("import", (rule) => {
|
|
449
|
-
if (!isTailwindV4CssImportParam(rule.params)) return;
|
|
450
|
-
hasTailwindCssImport = true;
|
|
451
|
-
includesPreflight || (includesPreflight = isTailwindV4PreflightImportParam(rule.params));
|
|
452
|
-
const sourceParam = parseImportSourceParam$1(rule.params);
|
|
453
|
-
if (sourceParam?.none) hasSourceNone = true;
|
|
454
|
-
if (sourceParam?.sourcePath) importSourceBase = resolveSourceBase(base, sourceParam.sourcePath);
|
|
455
|
-
});
|
|
456
|
-
root.walkAtRules("tailwind", (rule) => {
|
|
457
|
-
includesPreflight || (includesPreflight = rule.params.trim() === "base");
|
|
458
|
-
});
|
|
459
314
|
if (importSourceBase) return {
|
|
460
315
|
entries: [{
|
|
461
316
|
base: importSourceBase,
|
|
@@ -514,16 +369,12 @@ async function pathExistsAsFile(file) {
|
|
|
514
369
|
}
|
|
515
370
|
}
|
|
516
371
|
async function resolveTailwindV4EntriesFromCssCached(css, base) {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
} catch {
|
|
521
|
-
return;
|
|
522
|
-
}
|
|
523
|
-
const cacheKey = createCssEntriesCacheKey(css, base, await collectConfigDependencySignatures(root, base));
|
|
372
|
+
const analysis = analyzeTailwindV4EntrySource(css);
|
|
373
|
+
if (!analysis) return;
|
|
374
|
+
const cacheKey = createCssEntriesCacheKey(css, base, collectConfigDependencySignatures(analysis.configRequests, base));
|
|
524
375
|
const cached = tailwindV4CssEntriesCache.get(cacheKey);
|
|
525
376
|
if (cached) return cached;
|
|
526
|
-
const task =
|
|
377
|
+
const task = resolveTailwindV4EntriesFromAnalysis(analysis, base).catch((error) => {
|
|
527
378
|
tailwindV4CssEntriesCache.delete(cacheKey);
|
|
528
379
|
throw error;
|
|
529
380
|
});
|
|
@@ -561,7 +412,7 @@ function collectConfiguredCssSources(options) {
|
|
|
561
412
|
return filterTailwindV4CssSourceRoots([...options.tailwindcss?.v4?.cssSources ?? [], ...options.tailwindcssRuntimeOptions?.tailwindcss?.v4?.cssSources ?? []]) ?? [];
|
|
562
413
|
}
|
|
563
414
|
//#endregion
|
|
564
|
-
//#region src/
|
|
415
|
+
//#region src/project-sources/dependencies.ts
|
|
565
416
|
function addSourceScanDependency(dependencies, file) {
|
|
566
417
|
if (typeof file === "string" && file.length > 0) dependencies.add(path.resolve(file));
|
|
567
418
|
}
|
|
@@ -569,7 +420,7 @@ function addSourceScanDependencies(dependencies, files) {
|
|
|
569
420
|
for (const file of files ?? []) addSourceScanDependency(dependencies, file);
|
|
570
421
|
}
|
|
571
422
|
//#endregion
|
|
572
|
-
//#region src/
|
|
423
|
+
//#region src/project-sources/index.ts
|
|
573
424
|
function createResolvedSourceScan(input, dependencies) {
|
|
574
425
|
return {
|
|
575
426
|
...input,
|
|
@@ -1097,19 +948,6 @@ function createEngineTailwindcssRuntime(options) {
|
|
|
1097
948
|
if (typeof options.filter !== "function") return classSet;
|
|
1098
949
|
return new Set([...classSet].filter((className) => options.filter?.(className) !== false));
|
|
1099
950
|
}
|
|
1100
|
-
function hasTailwindV4ApplyContext(css) {
|
|
1101
|
-
if (!css.includes("@apply")) return false;
|
|
1102
|
-
try {
|
|
1103
|
-
const root = postcss.parse(css);
|
|
1104
|
-
let hasContext = false;
|
|
1105
|
-
root.walkAtRules((rule) => {
|
|
1106
|
-
if (rule.name === "reference" || rule.name === "import" || rule.name === "tailwind" && rule.params.trim() === "utilities") hasContext = true;
|
|
1107
|
-
});
|
|
1108
|
-
return hasContext;
|
|
1109
|
-
} catch {
|
|
1110
|
-
return false;
|
|
1111
|
-
}
|
|
1112
|
-
}
|
|
1113
951
|
async function collectClassSet() {
|
|
1114
952
|
const report = await collectContentTokens();
|
|
1115
953
|
const rawCandidates = new Set(report.entries.map((entry) => {
|
|
@@ -1125,17 +963,7 @@ function createEngineTailwindcssRuntime(options) {
|
|
|
1125
963
|
async function collectTailwindV4CssCandidates(candidates) {
|
|
1126
964
|
const source = resolveCssMacroTailwindV4Source(await resolveTailwindV4SourceFromRuntime(runtime));
|
|
1127
965
|
const cssList = [source.css, ...(source.cssSources ?? []).map((cssSource) => cssSource.css).filter((css) => typeof css === "string")];
|
|
1128
|
-
for (const css of cssList)
|
|
1129
|
-
if (!hasTailwindV4ApplyContext(css)) continue;
|
|
1130
|
-
try {
|
|
1131
|
-
postcss.parse(css).walkAtRules("apply", (rule) => {
|
|
1132
|
-
for (const candidate of rule.params.split(/\s+/)) {
|
|
1133
|
-
const normalized = candidate.replace(/!important$/, "").trim();
|
|
1134
|
-
if (normalized) candidates.add(normalized);
|
|
1135
|
-
}
|
|
1136
|
-
});
|
|
1137
|
-
} catch {}
|
|
1138
|
-
}
|
|
966
|
+
for (const css of cssList) for (const candidate of collectRuntimeApplyCandidates(css)) candidates.add(candidate);
|
|
1139
967
|
}
|
|
1140
968
|
async function collectContentTokens() {
|
|
1141
969
|
const source = resolveCssMacroTailwindV4Source(await resolveTailwindV4SourceFromRuntime(runtime));
|
|
@@ -1600,4 +1428,4 @@ function createTailwindcssRuntimeFromContext(ctx) {
|
|
|
1600
1428
|
return createTailwindcssRuntimeForBase(resolvedTailwindcssBasedir, normalizedCssEntries ?? rawCssEntries, runtimeOptions);
|
|
1601
1429
|
}
|
|
1602
1430
|
//#endregion
|
|
1603
|
-
export {
|
|
1431
|
+
export { resolveTailwindV4CssSourceBase as _, findTailwindConfig as a, getRuntimeClassSetCacheEntry as c, invalidateRuntimeClassSet as d, resolveSourceScanEntries as f, resolveTailwindV4EntriesFromCssCached as g, resolveTailwindV4EntriesFromCss as h, resolveUniAppXOptions as i, getRuntimeClassSetSignature as l, resolveTailwindV4CssDependencies as m, resolveTailwindcssBasedir as n, applyV4CssCalcDefaults as o, discoverTailwindV4CssEntries as p, isUniAppXEnabled as r, warnMissingCssEntries as s, createTailwindcssRuntimeFromContext as t, getRuntimeClassSetSignatureWithSources as u, source_scan_exports as v };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as shouldEnablePageLocalStyle, i as shouldEnableComponentLocalStyle, n as injectBorderPreflightClass, r as shouldInjectBorderPreflight } from "./vite-
|
|
4
|
-
import { splitCandidateTokens } from "@tailwindcss
|
|
5
|
-
import { UNI_APP_X_IMPORTANT_APPLY_MARKER, isUniAppXStyleSourceEmpty, normalizeUniAppXImportantApplyForSass } from "@weapp-tailwindcss/postcss";
|
|
1
|
+
import { N as _defineProperty } from "./generator-oKZ5mCJ5.js";
|
|
2
|
+
import { C as babelParse, S as replaceWxml, T as traverse$1, _ as generateCode, b as analyzeSource, v as createAttributeMatcher, w as JsTokenUpdater, x as isClassContextLiteralPath } from "./compiler-CThodfGH.js";
|
|
3
|
+
import { a as shouldEnablePageLocalStyle, i as shouldEnableComponentLocalStyle, n as injectBorderPreflightClass, r as shouldInjectBorderPreflight } from "./vite-D-RGkmOE.js";
|
|
4
|
+
import { splitCandidateTokens } from "@weapp-tailwindcss/engine";
|
|
5
|
+
import { UNI_APP_X_IMPORTANT_APPLY_MARKER, isUniAppXStyleSourceEmpty, normalizeUniAppXImportantApplyForSass } from "@weapp-tailwindcss/postcss/transform";
|
|
6
6
|
import MagicString from "magic-string";
|
|
7
7
|
import { NodeTypes, parse } from "@vue/compiler-dom";
|
|
8
8
|
//#region src/uni-app-x/component-local-style-binding.ts
|
|
@@ -174,21 +174,25 @@ function hasTopLevelVariant(candidate) {
|
|
|
174
174
|
return false;
|
|
175
175
|
}
|
|
176
176
|
var UniAppXComponentLocalStyleCollector = class {
|
|
177
|
-
constructor(fileId, runtimeSet, includeVariants = false) {
|
|
177
|
+
constructor(fileId, runtimeSet, includeVariants = false, preserveClassNames = false) {
|
|
178
178
|
this.fileId = fileId;
|
|
179
179
|
this.runtimeSet = runtimeSet;
|
|
180
180
|
this.includeVariants = includeVariants;
|
|
181
|
+
this.preserveClassNames = preserveClassNames;
|
|
181
182
|
_defineProperty(this, "aliasByUtility", /* @__PURE__ */ new Map());
|
|
182
183
|
_defineProperty(this, "aliasByLookup", /* @__PURE__ */ new Map());
|
|
183
184
|
_defineProperty(this, "classBindingNames", /* @__PURE__ */ new Set());
|
|
184
185
|
_defineProperty(this, "deepUtilities", /* @__PURE__ */ new Set());
|
|
185
186
|
}
|
|
187
|
+
runtimeClassName(utility) {
|
|
188
|
+
return this.preserveClassNames ? utility : replaceWxml(utility);
|
|
189
|
+
}
|
|
186
190
|
ensureAlias(utility) {
|
|
187
191
|
const cached = this.aliasByUtility.get(utility);
|
|
188
192
|
if (cached) return cached;
|
|
189
193
|
const alias = createAlias(this.fileId, utility, this.aliasByUtility.size);
|
|
190
194
|
this.aliasByUtility.set(utility, alias);
|
|
191
|
-
const replacement = hasTopLevelVariant(utility) ? `${
|
|
195
|
+
const replacement = hasTopLevelVariant(utility) ? `${this.runtimeClassName(utility)} ${alias}` : alias;
|
|
192
196
|
this.aliasByLookup.set(utility, replacement);
|
|
193
197
|
this.aliasByLookup.set(replaceWxml(utility), replacement);
|
|
194
198
|
return alias;
|
|
@@ -199,7 +203,7 @@ var UniAppXComponentLocalStyleCollector = class {
|
|
|
199
203
|
let rewritten = literal;
|
|
200
204
|
for (const candidate of candidates) {
|
|
201
205
|
if (!isRuntimeCandidate(candidate, this.runtimeSet)) continue;
|
|
202
|
-
if (!this.includeVariants && hasTopLevelVariant(candidate)) rewritten = rewritten.replace(candidate,
|
|
206
|
+
if (!this.includeVariants && hasTopLevelVariant(candidate)) rewritten = rewritten.replace(candidate, this.runtimeClassName(candidate));
|
|
203
207
|
else {
|
|
204
208
|
this.ensureAlias(candidate);
|
|
205
209
|
rewritten = rewritten.replace(candidate, this.aliasByLookup.get(candidate));
|
|
@@ -314,11 +318,14 @@ function traverse(node, visitor) {
|
|
|
314
318
|
for (const child of node.children) if (child && typeof child === "object" && "type" in child) traverse(child, visitor);
|
|
315
319
|
}
|
|
316
320
|
}
|
|
317
|
-
function updateStaticAttribute(ms, prop, offset,
|
|
321
|
+
function updateStaticAttribute(ms, prop, offset, preserveClassNames) {
|
|
318
322
|
if (!prop.value) return;
|
|
319
323
|
const start = offset + prop.value.loc.start.offset + 1;
|
|
320
324
|
const end = offset + prop.value.loc.end.offset - 1;
|
|
321
|
-
if (start < end)
|
|
325
|
+
if (start < end) {
|
|
326
|
+
const content = prop.value.content;
|
|
327
|
+
ms.update(start, end, preserveClassNames ? content : replaceWxml(content));
|
|
328
|
+
}
|
|
322
329
|
}
|
|
323
330
|
function updateStaticAttributeWithLocalStyle(ms, prop, offset, collector, deep, content = prop.value?.content) {
|
|
324
331
|
if (!prop.value) return;
|
|
@@ -445,6 +452,8 @@ function parseSfc(code) {
|
|
|
445
452
|
function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
446
453
|
if (!UVUE_NVUE_RE.test(id)) return;
|
|
447
454
|
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
455
|
+
const isWeb = Boolean(options.onWebLocalStyleRules);
|
|
456
|
+
const jsRuntimeSet = isWeb ? /* @__PURE__ */ new Set() : runtimeSet;
|
|
448
457
|
const matchCustomAttribute = createAttributeMatcher(customAttributesEntities);
|
|
449
458
|
const ms = new MagicString(code);
|
|
450
459
|
const descriptor = parseSfc(code);
|
|
@@ -452,7 +461,7 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
452
461
|
const normalized = normalizeUniAppXImportantApplyForSass(style.content);
|
|
453
462
|
if (normalized !== style.content) ms.update(style.start, style.end, normalized);
|
|
454
463
|
}
|
|
455
|
-
const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet, options.localStyleVariants) : void 0;
|
|
464
|
+
const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet, options.localStyleVariants, isWeb) : void 0;
|
|
456
465
|
if (descriptor.errors.length === 0) {
|
|
457
466
|
if (descriptor.template?.ast) {
|
|
458
467
|
const templateOffset = descriptor.template.start;
|
|
@@ -463,14 +472,14 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
463
472
|
const { shouldHandle, shouldHandleCustom, shouldHandleDefault } = shouldHandleAttribute(tag, prop.name, disabledDefaultTemplateHandler, matchCustomAttribute);
|
|
464
473
|
if (!shouldHandle) continue;
|
|
465
474
|
if (localStyleCollector) updateStaticAttributeWithLocalStyle(ms, prop, templateOffset, localStyleCollector, options.webCustomAttributeDeep === true && shouldHandleCustom);
|
|
466
|
-
else updateStaticAttribute(ms, prop, templateOffset);
|
|
475
|
+
else updateStaticAttribute(ms, prop, templateOffset, isWeb);
|
|
467
476
|
if (shouldHandleDefault) continue;
|
|
468
477
|
} else if (prop.type === NodeTypes.DIRECTIVE && prop.name === "bind" && prop.arg?.type === NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic) {
|
|
469
478
|
const attrName = prop.arg.content;
|
|
470
479
|
const { shouldHandle, shouldHandleCustom } = shouldHandleAttribute(tag, attrName, disabledDefaultTemplateHandler, matchCustomAttribute);
|
|
471
480
|
if (!shouldHandle) continue;
|
|
472
|
-
if (localStyleCollector) updateDirectiveExpressionWithLocalStyle(ms, prop, templateOffset, jsHandler, localStyleCollector, options.webCustomAttributeDeep === true && shouldHandleCustom,
|
|
473
|
-
else updateDirectiveExpression(ms, prop, templateOffset, jsHandler,
|
|
481
|
+
if (localStyleCollector) updateDirectiveExpressionWithLocalStyle(ms, prop, templateOffset, jsHandler, localStyleCollector, options.webCustomAttributeDeep === true && shouldHandleCustom, jsRuntimeSet);
|
|
482
|
+
else updateDirectiveExpression(ms, prop, templateOffset, jsHandler, jsRuntimeSet);
|
|
474
483
|
}
|
|
475
484
|
if (options.borderPreflight && shouldInjectBorderPreflight(node, options.borderPreflightRange)) injectBorderPreflightClass(ms, node, templateOffset);
|
|
476
485
|
});
|
|
@@ -478,12 +487,12 @@ function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
|
478
487
|
}
|
|
479
488
|
if (descriptor.script && descriptor.script.start < descriptor.script.end) {
|
|
480
489
|
localStyleCollector?.collectRuntimeClasses(descriptor.script.content);
|
|
481
|
-
const { code } = jsHandler(descriptor.script.content,
|
|
490
|
+
const { code } = jsHandler(descriptor.script.content, jsRuntimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
482
491
|
ms.update(descriptor.script.start, descriptor.script.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
483
492
|
}
|
|
484
493
|
if (descriptor.scriptSetup && descriptor.scriptSetup.start < descriptor.scriptSetup.end) {
|
|
485
494
|
localStyleCollector?.collectRuntimeClasses(descriptor.scriptSetup.content);
|
|
486
|
-
const { code } = jsHandler(descriptor.scriptSetup.content,
|
|
495
|
+
const { code } = jsHandler(descriptor.scriptSetup.content, jsRuntimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
487
496
|
ms.update(descriptor.scriptSetup.start, descriptor.scriptSetup.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
488
497
|
}
|
|
489
498
|
const scopedStyle = [...descriptor.styles].reverse().find((style) => STYLE_SCOPED_RE.test(style.attrs) && (!options.onWebLocalStyleRules || !isUniAppXStyleSourceEmpty(style.content)));
|