weapp-tailwindcss 5.1.15 → 5.2.0
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 +6 -0
- package/README.md +6 -0
- package/bin/{weapp-tailwindcss.js → weapp-tailwindcss.cjs} +1 -1
- package/dist/bundlers/framework-selector.d.ts +2 -2
- package/dist/bundlers/gulp/asset-emission-plan.d.ts +10 -0
- package/dist/bundlers/gulp/frameworks/native/index.d.ts +10 -3
- package/dist/bundlers/gulp/index.d.ts +10 -3
- package/dist/bundlers/gulp/module-graph.d.ts +1 -1
- package/dist/bundlers/gulp/runtime-snapshot.d.ts +4 -2
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/cache-state.d.ts +71 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins/file-transforms.d.ts +45 -0
- package/dist/bundlers/gulp/shared/create-native-framework-plugins.d.ts +9 -2
- package/dist/bundlers/rspack/index.d.ts +2 -2
- package/dist/bundlers/shared/cache.d.ts +1 -1
- package/dist/bundlers/shared/css-imports.d.ts +1 -1
- package/dist/bundlers/shared/css-source-trace.d.ts +2 -2
- package/dist/bundlers/shared/framework-postcss.d.ts +21 -0
- package/dist/bundlers/shared/generator-css/candidates.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/preflight.d.ts +19 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/results.d.ts +25 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/runtime-isolation.d.ts +30 -0
- package/dist/bundlers/shared/generator-css/generation-helpers/source-order.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/generation-helpers.d.ts +4 -72
- package/dist/bundlers/shared/generator-css/legacy-compat.d.ts +5 -3
- package/dist/bundlers/shared/generator-css/pipeline/context.d.ts +58 -0
- package/dist/bundlers/shared/generator-css/pipeline/deferred-output.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/pipeline/execution.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/pipeline/fallback-output.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/pipeline/ordered-output.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/pipeline.d.ts +2 -0
- package/dist/bundlers/shared/generator-css/result-helpers.d.ts +6 -0
- package/dist/bundlers/shared/generator-css/scoped-rules.d.ts +1 -0
- package/dist/bundlers/shared/generator-css/source-resolver/configuration.d.ts +32 -0
- package/dist/bundlers/shared/generator-css/source-resolver/matching.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/metadata.d.ts +13 -5
- package/dist/bundlers/shared/generator-css/source-resolver/postcss-source.d.ts +1 -1
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-source.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/source-resolver/resolve-sources.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/source-resolver/single-source.d.ts +16 -0
- package/dist/bundlers/shared/generator-css/source-resolver/source-entries.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/source-resolver/source-matching.d.ts +5 -0
- package/dist/bundlers/shared/generator-css/source-resolver/types.d.ts +4 -4
- package/dist/bundlers/shared/generator-css/source-resolver.d.ts +7 -9
- package/dist/bundlers/shared/generator-css/types.d.ts +12 -3
- package/dist/bundlers/shared/generator-css/user-css/apply-only.d.ts +9 -0
- package/dist/bundlers/shared/generator-css/user-css/at-rules.d.ts +3 -0
- package/dist/bundlers/shared/generator-css/user-css/generated-cleanup.d.ts +4 -0
- package/dist/bundlers/shared/generator-css/user-css/source-fragments.d.ts +9 -0
- package/dist/bundlers/shared/generator-css/user-css/transform.d.ts +10 -0
- package/dist/bundlers/shared/generator-css/user-css/user-layers.d.ts +15 -0
- package/dist/bundlers/shared/generator-css/user-css.d.ts +5 -33
- package/dist/bundlers/shared/generator-css/validate.d.ts +1 -1
- package/dist/bundlers/shared/generator-css.d.ts +9 -10
- package/dist/bundlers/shared/runtime-class-set/entries.d.ts +4 -0
- package/dist/bundlers/shared/runtime-class-set/escaped-candidates.d.ts +9 -0
- package/dist/bundlers/shared/runtime-class-set.d.ts +30 -0
- package/dist/bundlers/shared/runtime-entry-type.d.ts +8 -0
- package/dist/bundlers/shared/runtime-signatures.d.ts +8 -0
- package/dist/bundlers/shared/source-candidate-scan-signature.d.ts +13 -0
- package/dist/bundlers/shared/source-candidates/collector.d.ts +8 -0
- package/dist/bundlers/shared/source-candidates/scan-root.d.ts +10 -0
- package/dist/bundlers/{vite → shared}/source-candidates/script.d.ts +1 -1
- package/dist/bundlers/shared/source-candidates/store.d.ts +2 -0
- package/dist/bundlers/shared/source-candidates/types-and-cache.d.ts +69 -0
- package/dist/bundlers/shared/source-candidates.d.ts +4 -0
- package/dist/bundlers/shared/source-scan/css-entries.d.ts +18 -0
- package/dist/bundlers/shared/source-scan.d.ts +16 -0
- package/dist/bundlers/shared/static-config-content.d.ts +5 -0
- package/dist/bundlers/shared/v4-generation-core.d.ts +9 -1
- package/dist/bundlers/vite/bundle-entries.d.ts +1 -1
- package/dist/bundlers/vite/bundle-state.d.ts +11 -38
- package/dist/bundlers/vite/css-asset-identity.d.ts +11 -0
- package/dist/bundlers/vite/css-finalizer/options.d.ts +54 -0
- package/dist/bundlers/vite/css-finalizer/plugin.d.ts +3 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +1 -43
- package/dist/bundlers/vite/css-memory.d.ts +1 -2
- package/dist/bundlers/vite/frameworks/generic/index.d.ts +2 -2
- package/dist/bundlers/vite/frameworks/taro/index.d.ts +2 -2
- package/dist/bundlers/vite/frameworks/uni-app/index.d.ts +3 -3
- package/dist/bundlers/vite/frameworks/uni-app-x/index.d.ts +3 -3
- package/dist/bundlers/vite/frameworks/weapp-vite/index.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/asset-emission-plan.d.ts +8 -0
- package/dist/bundlers/vite/generate-bundle/bundle-markup-candidates.d.ts +4 -4
- 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-cache-task.d.ts +34 -0
- package/dist/bundlers/vite/generate-bundle/css-composition-plan.d.ts +58 -0
- package/dist/bundlers/vite/generate-bundle/css-config-directives.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-entry-processing.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/css-handler-options.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-output-helpers.d.ts +21 -2
- package/dist/bundlers/vite/generate-bundle/css-output.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-share-scope.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/css-source-plan.d.ts +19 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-decision-plan.d.ts +61 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-result.d.ts +23 -0
- package/dist/bundlers/vite/generate-bundle/css-transform-task.d.ts +42 -0
- package/dist/bundlers/vite/generate-bundle/final-css-assets.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/finalize/bundle.d.ts +2 -0
- package/dist/bundlers/vite/generate-bundle/finalize/root-import-shell.d.ts +69 -0
- package/dist/bundlers/vite/generate-bundle/finalize.d.ts +2 -70
- package/dist/bundlers/vite/generate-bundle/html-processing.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/js-entries.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/js-handler-options.d.ts +2 -1
- package/dist/bundlers/vite/generate-bundle/js-linking.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/js-processing.d.ts +6 -5
- package/dist/bundlers/vite/generate-bundle/memory-debug.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/process-plan.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/remembered-css-plan.d.ts +35 -0
- package/dist/bundlers/vite/generate-bundle/remembered-css-replay.d.ts +5 -6
- package/dist/bundlers/vite/generate-bundle/remembered-css.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/root-style-output.d.ts +20 -0
- package/dist/bundlers/vite/generate-bundle/runtime-configured-css.d.ts +54 -0
- package/dist/bundlers/vite/generate-bundle/runtime-linked-css.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/runtime-linked-source-memory.d.ts +3 -3
- package/dist/bundlers/vite/generate-bundle/runtime.d.ts +6 -0
- package/dist/bundlers/vite/generate-bundle/scoped-generator.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/sfc-style-source.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/signatures.d.ts +1 -8
- package/dist/bundlers/vite/generate-bundle/source-candidate-scope.d.ts +3 -3
- package/dist/bundlers/vite/generate-bundle/source-candidate-source.d.ts +5 -0
- package/dist/bundlers/vite/generate-bundle/subpackages.d.ts +2 -2
- package/dist/bundlers/vite/generate-bundle/temporary-css-assets.d.ts +14 -1
- package/dist/bundlers/vite/generate-bundle/transform-filter.d.ts +1 -1
- package/dist/bundlers/vite/generate-bundle/transform-scheduling.d.ts +1 -0
- package/dist/bundlers/vite/generate-bundle/types.d.ts +8 -7
- package/dist/bundlers/vite/generate-bundle/uni-app-x-postprocess.d.ts +3 -2
- package/dist/bundlers/vite/generate-bundle/validate-runtime-candidates.d.ts +22 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +7 -7
- package/dist/bundlers/vite/incremental-runtime-class-set/entries.d.ts +1 -4
- package/dist/bundlers/vite/incremental-runtime-class-set/escaped-candidates.d.ts +1 -3
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +2 -30
- package/dist/bundlers/vite/index.d.ts +3 -3
- package/dist/bundlers/vite/js-precheck.d.ts +1 -1
- package/dist/bundlers/vite/processed-css-assets/cleanup.d.ts +13 -0
- package/dist/bundlers/vite/processed-css-assets/collector.d.ts +4 -0
- package/dist/bundlers/vite/processed-css-assets/coverage.d.ts +34 -0
- package/dist/bundlers/vite/processed-css-assets/empty-at-rule.d.ts +1 -0
- package/dist/bundlers/vite/processed-css-assets/injection-plan.d.ts +42 -0
- package/dist/bundlers/vite/processed-css-assets/markers-imports.d.ts +89 -0
- package/dist/bundlers/vite/processed-css-assets/style-files.d.ts +3 -0
- package/dist/bundlers/vite/processed-css-assets.d.ts +4 -71
- package/dist/bundlers/vite/resolve-app-type.d.ts +1 -1
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +3 -1
- package/dist/bundlers/vite/runtime-affecting-signature.d.ts +1 -2
- package/dist/bundlers/vite/runtime-candidate-entry.d.ts +9 -0
- package/dist/bundlers/vite/runtime-class-set.d.ts +4 -4
- package/dist/bundlers/vite/serve-css-generation.d.ts +2 -0
- package/dist/bundlers/vite/serve-js-transform.d.ts +1 -1
- package/dist/bundlers/vite/serve-root-import-shell.d.ts +1 -1
- package/dist/bundlers/vite/shared/create-framework-plugins-runtime.d.ts +2 -0
- package/dist/bundlers/vite/shared/create-framework-plugins.d.ts +8 -8
- package/dist/bundlers/vite/shared/framework-hmr-candidate-state.d.ts +45 -0
- package/dist/bundlers/vite/shared/framework-post-plugin.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-processed-css-registry.d.ts +22 -0
- package/dist/bundlers/vite/shared/framework-runtime-options.d.ts +1 -0
- package/dist/bundlers/vite/shared/framework-source-candidates-plugin.d.ts +2 -0
- package/dist/bundlers/vite/shared/framework-source-scan-session.d.ts +38 -0
- package/dist/bundlers/vite/shared/framework-strategy.d.ts +4 -4
- package/dist/bundlers/vite/source-candidate-scan-signature.d.ts +2 -13
- package/dist/bundlers/vite/source-candidates/scan-root.d.ts +1 -10
- package/dist/bundlers/vite/source-candidates.d.ts +1 -68
- package/dist/bundlers/vite/source-output-relations.d.ts +24 -0
- package/dist/bundlers/vite/source-scan/css-entries.d.ts +2 -18
- package/dist/bundlers/vite/source-scan.d.ts +2 -16
- package/dist/bundlers/vite/static-config-content.d.ts +1 -5
- package/dist/bundlers/vite/uni-app-x-css-options.d.ts +1 -1
- package/dist/bundlers/vite/web-css-compat.d.ts +1 -1
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/asset-emission-plan.d.ts +18 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/css-source-resolvers.d.ts +2 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/finalize-assets.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-result.d.ts +3 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/generated-css-task.d.ts +2 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/helpers.d.ts +11 -41
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/html-js-tasks.d.ts +5 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/js-module-graph.d.ts +4 -10
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/finalize.d.ts +30 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/generated-css.d.ts +8 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/memory-trace.d.ts +78 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/preflight-runtime.d.ts +43 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/resources.d.ts +30 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/runtime-candidates.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/sources.d.ts +28 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css-markers.d.ts +1 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers/user-css.d.ts +21 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/pipeline-helpers.d.ts +9 -219
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/processed-css-task.d.ts +4 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-cache.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets/source-candidate-refresh.d.ts +3 -3
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +2 -2
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +8 -4
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/generic/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/index.d.ts +7 -7
- package/dist/bundlers/webpack/frameworks/mpx/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/taro/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/uni-app/index.d.ts +2 -2
- package/dist/bundlers/webpack/frameworks/weapp-vite/index.d.ts +2 -2
- package/dist/bundlers/webpack/index.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/runtime-registry.d.ts +7 -2
- package/dist/bundlers/webpack/loaders/weapp-tw-css-generation-loader.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +1 -1
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +1 -1
- package/dist/bundlers/webpack/shared/create-framework-plugin/plugin.d.ts +20 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin/watch-output.d.ts +13 -0
- package/dist/bundlers/webpack/shared/create-framework-plugin.d.ts +3 -21
- package/dist/cli/context.d.ts +2 -2
- package/dist/cli/doctor.d.ts +1 -1
- package/dist/cli/helpers/options.d.ts +3 -3
- package/dist/cli/helpers.d.ts +1 -1
- package/dist/cli.cjs +37012 -0
- package/dist/cli.js +145 -176
- package/dist/compiler/artifact.d.ts +14 -0
- package/dist/compiler/candidate-index.d.ts +10 -0
- package/dist/compiler/compilation-change-coordinator.d.ts +28 -0
- package/dist/compiler/compilation-dependency-state.d.ts +16 -0
- package/dist/compiler/compilation-scope-graph.d.ts +31 -0
- package/dist/compiler/compilation-session-pool.d.ts +54 -0
- package/dist/compiler/compiler-owner-state.d.ts +3 -0
- package/dist/compiler/composition.d.ts +8 -0
- package/dist/compiler/emission-plan.d.ts +26 -0
- package/dist/compiler/index.d.ts +23 -0
- package/dist/compiler/invalidation.d.ts +3 -0
- package/dist/compiler/mode.d.ts +3 -0
- package/dist/compiler/owner-lifecycle.d.ts +1 -0
- package/dist/compiler/platform-adapter.d.ts +9 -0
- package/dist/compiler/runtime-affecting-signature.d.ts +2 -0
- package/dist/compiler/runtime-build-state.d.ts +6 -0
- package/dist/compiler/runtime-snapshot.d.ts +53 -0
- package/dist/compiler/scope-planner.d.ts +6 -0
- package/dist/compiler/semantic-css.d.ts +66 -0
- package/dist/compiler/session.d.ts +13 -0
- package/dist/compiler/shadow-gate.d.ts +26 -0
- package/dist/compiler/shadow-report-session.d.ts +37 -0
- package/dist/compiler/shadow-report.d.ts +15 -0
- package/dist/compiler/source-graph.d.ts +32 -0
- package/dist/compiler/tailwind-generation-session-pool.d.ts +22 -0
- package/dist/compiler/types.d.ts +95 -0
- package/dist/constants.d.ts +2 -2
- package/dist/context/compiler-context-cache.d.ts +1 -1
- package/dist/context/custom-attributes.d.ts +1 -1
- package/dist/context/handlers.d.ts +3 -3
- package/dist/context/index.d.ts +1 -1
- package/dist/context/runtime-package-replacements.d.ts +1 -1
- package/dist/context/style-options.d.ts +1 -1
- package/dist/context/tailwindcss.d.ts +3 -3
- package/dist/{context-VeFq_8vW.js → context-PZXBqrAJ.cjs} +32 -94
- package/dist/{context-BgGWVAmN.mjs → context-oTkxC5aZ.js} +23 -12
- package/dist/{core.mjs → core.cjs} +13 -12
- package/dist/core.d.ts +2 -2
- package/dist/core.js +12 -13
- package/dist/css-imports-DfNC3e6a.cjs +43 -0
- package/dist/css-loader-runtime-CSv0lKqV.cjs +11 -0
- package/dist/css-macro/postcss.cjs +19 -0
- package/dist/css-macro/postcss.js +2 -19
- package/dist/{css-macro.mjs → css-macro.cjs} +11 -8
- package/dist/css-macro.d.ts +2 -2
- package/dist/css-macro.js +8 -11
- package/dist/{defaults.mjs → defaults.cjs} +16 -11
- package/dist/defaults.d.ts +1 -1
- package/dist/defaults.js +11 -16
- package/dist/{escape.mjs → escape.cjs} +18 -4
- package/dist/escape.js +4 -18
- package/dist/framework/platform.d.ts +1 -1
- package/dist/{framework.mjs → framework.cjs} +47 -25
- package/dist/framework.d.ts +1 -1
- package/dist/framework.js +25 -47
- package/dist/generator/index.d.ts +6 -6
- package/dist/generator/options.d.ts +3 -3
- package/dist/generator/types.d.ts +2 -2
- package/dist/{generator-CEnUsjed.js → generator-C8D5cnbe.cjs} +730 -468
- package/dist/{generator-CEo920So.mjs → generator-CDdzqf1S.js} +747 -497
- package/dist/generator.cjs +12 -0
- package/dist/generator.d.ts +1 -1
- package/dist/generator.js +2 -12
- package/dist/{gulp-3m1dAiig.js → gulp-Cjcss8T_.cjs} +326 -241
- package/dist/{gulp-DP71z1jG.mjs → gulp-DNXQvDUw.js} +316 -234
- package/dist/gulp.cjs +5 -0
- package/dist/gulp.d.ts +4 -4
- package/dist/gulp.js +2 -5
- package/dist/{hmr-timing-1aS6--U7.mjs → hmr-timing-CuJwQzDc.js} +5230 -3259
- package/dist/hmr-timing-DMLfNfGG.cjs +555 -0
- package/dist/index.cjs +45 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -45
- package/dist/js/JsTokenUpdater.d.ts +1 -1
- package/dist/js/ModuleGraph.d.ts +3 -3
- package/dist/js/NodePathWalker.d.ts +2 -2
- package/dist/js/babel/process.d.ts +2 -2
- package/dist/js/babel.d.ts +8 -8
- package/dist/js/evalTransforms.d.ts +2 -2
- package/dist/js/fast-path/oxc.d.ts +1 -1
- package/dist/js/handlers.d.ts +2 -2
- package/dist/js/index.d.ts +3 -3
- package/dist/js/literal-transform.d.ts +1 -1
- package/dist/js/module-graph/ignored-exports.d.ts +4 -4
- package/dist/js/module-graph/types.d.ts +2 -2
- package/dist/js/node-path-walker/export-handlers.d.ts +1 -1
- package/dist/js/precheck.d.ts +1 -1
- package/dist/js/replacement-cache.d.ts +1 -1
- package/dist/js/sourceAnalysis.d.ts +3 -3
- package/dist/js/taggedTemplateIgnore.d.ts +1 -1
- package/dist/object-Bvy6-w9r.js +47 -0
- package/dist/object-C_Vr6_S5.cjs +58 -0
- package/dist/options-DlvhQwWB.cjs +775 -0
- package/dist/pipeline-helpers-XtUmUlci.cjs +955 -0
- package/dist/postcss-html-transform.cjs +7 -0
- package/dist/postcss-html-transform.js +3 -5
- package/dist/postcss.cjs +15 -0
- package/dist/postcss.js +7 -11
- package/dist/presets/hbuilderx.d.ts +2 -2
- package/dist/presets/index.d.ts +4 -4
- package/dist/presets/shared.d.ts +1 -1
- package/dist/presets/taro.d.ts +2 -2
- package/dist/presets/uni-app-x.d.ts +1 -1
- package/dist/presets/uni-app.d.ts +2 -2
- package/dist/{presets.mjs → presets.cjs} +37 -24
- package/dist/presets.d.ts +1 -1
- package/dist/presets.js +24 -36
- package/dist/reset.cjs +19 -0
- package/dist/reset.d.ts +2 -2
- package/dist/reset.js +2 -19
- package/dist/{rolldown-runtime-emK7D4bc.js → rolldown-runtime-CVvi-lCc.cjs} +15 -0
- package/dist/{rspack.mjs → rspack.cjs} +10 -4
- package/dist/rspack.d.ts +3 -3
- package/dist/rspack.js +4 -10
- package/dist/runtime-branch/create-branch.d.ts +1 -1
- package/dist/runtime-branch/generator-target-env.d.ts +1 -1
- package/dist/runtime-branch/index.d.ts +2 -2
- package/dist/runtime-branch/mini-program.d.ts +1 -1
- package/dist/runtime-branch/native-app.d.ts +1 -1
- package/dist/runtime-branch/platform.d.ts +2 -2
- package/dist/runtime-branch/tailwind-version.d.ts +1 -1
- package/dist/runtime-branch/types.d.ts +2 -2
- package/dist/runtime-branch/web.d.ts +1 -1
- package/dist/runtime-branch.d.ts +1 -1
- package/dist/runtime-registry-Y7NrD2WH.cjs +31 -0
- package/dist/shared/classname-transform.d.ts +1 -1
- package/dist/shared/mpx-plugin-owner.d.ts +2 -0
- package/dist/shared/mpx.d.ts +1 -1
- package/dist/{source-candidate-scan-signature-Cf7259PR.mjs → source-candidate-scan-signature-B0S7f5P7.js} +26 -336
- package/dist/{source-candidate-scan-signature-BAahhiwb.js → source-candidate-scan-signature-BmSuoxR9.cjs} +31 -414
- package/dist/style-injector/internal.d.ts +6 -6
- package/dist/style-options-CEfXwZzX.cjs +75 -0
- package/dist/tailwindcss/candidates.d.ts +2 -2
- package/dist/tailwindcss/index.d.ts +1 -1
- package/dist/tailwindcss/runtime/cache.d.ts +1 -1
- package/dist/tailwindcss/runtime-factory.d.ts +2 -2
- package/dist/tailwindcss/runtime-options.d.ts +1 -1
- package/dist/tailwindcss/runtime-types.d.ts +2 -2
- package/dist/tailwindcss/runtime.d.ts +2 -2
- package/dist/tailwindcss/source-scan.d.ts +2 -2
- package/dist/tailwindcss/targets.d.ts +1 -1
- package/dist/tailwindcss/v4/config.d.ts +1 -1
- package/dist/tailwindcss/v4/css-sources.d.ts +2 -1
- package/dist/tailwindcss/v4/index.d.ts +2 -2
- package/dist/tailwindcss/v4/multi-runtime.d.ts +1 -1
- package/dist/tailwindcss/v4/runtime-factory.d.ts +5 -5
- package/dist/tailwindcss/v4/runtime-options.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/css-macro-source.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/cache-stats.d.ts +26 -0
- package/dist/tailwindcss/v4-engine/generator/css-compat.d.ts +1 -1
- package/dist/tailwindcss/v4-engine/generator/engine.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/generator/incremental-cache.d.ts +51 -0
- package/dist/tailwindcss/v4-engine/generator/native-session.d.ts +17 -0
- package/dist/tailwindcss/v4-engine/generator/scan-sources.d.ts +2 -1
- package/dist/tailwindcss/v4-engine/generator.d.ts +2 -28
- package/dist/tailwindcss/v4-engine/index.d.ts +5 -5
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/source.d.ts +2 -2
- package/dist/tailwindcss/v4-engine/types.d.ts +1 -0
- package/dist/{tailwindcss-KBYPJ2DW.js → tailwindcss-Cs94gJgf.cjs} +10 -770
- package/dist/{tailwindcss-xs704TRw.mjs → tailwindcss-D7TGiZR2.js} +23 -23
- package/dist/transform-BUEyOCT7.cjs +341 -0
- package/dist/transform-BbaPIji9.js +342 -0
- package/dist/typedoc.export.d.ts +4 -4
- package/dist/types/index.d.ts +7 -7
- package/dist/types/shared.d.ts +1 -1
- package/dist/types/typedoc-tailwindcss-runtime.d.ts +3 -3
- package/dist/types/user-defined-options/general.d.ts +5 -5
- package/dist/types/user-defined-options/important.d.ts +2 -2
- package/dist/types/user-defined-options/index.d.ts +9 -9
- package/dist/types/user-defined-options/matcher.d.ts +2 -2
- package/dist/types.cjs +0 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -0
- package/dist/uni-app-x/harmony.d.ts +1 -0
- package/dist/uni-app-x/index.d.ts +2 -2
- package/dist/uni-app-x/options.d.ts +1 -1
- package/dist/uni-app-x/style-asset/harmony-apply.d.ts +1 -0
- package/dist/uni-app-x/style-asset/style-value.d.ts +3 -0
- package/dist/uni-app-x/style-asset.d.ts +5 -4
- package/dist/uni-app-x/transform.d.ts +1 -1
- package/dist/uni-app-x/vite/harmony-apply.d.ts +19 -0
- package/dist/uni-app-x/vite/native-target.d.ts +2 -0
- package/dist/uni-app-x/vite.d.ts +5 -2
- package/dist/unocss/index.d.ts +1 -1
- package/dist/utils/disabled.d.ts +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/{hmr-timing-B8p4f0ca.js → v4-generation-core-D7MuR5ZF.cjs} +4886 -3330
- package/dist/{vite-nXZEiwG0.mjs → vite-BI1TeUPO.js} +6148 -4522
- package/dist/{vite-DUVjMduj.js → vite-CBzmUTu-.cjs} +6267 -4666
- package/dist/vite.cjs +4 -0
- package/dist/vite.d.ts +3 -3
- package/dist/vite.js +2 -4
- package/dist/watch-dependencies-BZGubvuJ.cjs +40 -0
- package/dist/{weapp-tw-css-generation-loader.js → weapp-tw-css-generation-loader.cjs} +3 -2
- package/dist/weapp-tw-css-import-rewrite-loader.cjs +201 -0
- package/dist/{weapp-tw-runtime-classset-loader.js → weapp-tw-runtime-classset-loader.cjs} +19 -15
- package/dist/{webpack-nppysF4B.js → webpack-Dao6bWEj.cjs} +1000 -1473
- package/dist/{webpack-C_UUFRgj.mjs → webpack-dAY9h8r8.js} +1462 -1185
- package/dist/webpack.cjs +5 -0
- package/dist/webpack.d.ts +2 -2
- package/dist/webpack.js +2 -5
- package/dist/wxml/Tokenizer.d.ts +2 -2
- package/dist/wxml/custom-attributes.d.ts +1 -1
- package/dist/wxml/index.d.ts +2 -2
- package/dist/wxml/shared.d.ts +1 -1
- package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +1 -1
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +2 -2
- package/dist/wxml/utils/codegen.d.ts +1 -1
- package/dist/wxml/utils/custom-template.d.ts +2 -2
- package/dist/wxml/utils/fragment-helpers.d.ts +2 -2
- package/dist/wxml/utils/fragment-updater.d.ts +2 -2
- package/dist/wxml/utils/template-fragments.d.ts +2 -2
- package/dist/wxml/utils.d.ts +5 -5
- package/dist/wxml-DSMNuUaP.cjs +38609 -0
- package/dist/{cli.mjs → wxml-IBzZSaQC.js} +237 -718
- package/package.json +59 -54
- package/dist/css-macro/postcss.mjs +0 -2
- package/dist/generator.mjs +0 -2
- package/dist/gulp.mjs +0 -2
- package/dist/index.mjs +0 -9
- package/dist/object-BJSWl-E5.mjs +0 -9
- package/dist/object-COs_Mw6p.js +0 -14
- package/dist/postcss-html-transform.mjs +0 -5
- package/dist/postcss.mjs +0 -11
- package/dist/reset.mjs +0 -2
- package/dist/transform-B_KM9sLX.mjs +0 -14930
- package/dist/transform-CcYptivi.js +0 -14927
- package/dist/types.mjs +0 -1
- package/dist/vite.mjs +0 -2
- package/dist/watch-dependencies-bpG6kmAf.js +0 -80
- package/dist/weapp-tw-css-import-rewrite-loader-DNk0IxAt.js +0 -10198
- package/dist/weapp-tw-css-import-rewrite-loader.js +0 -10
- package/dist/webpack.mjs +0 -2
- package/dist/wxml-Ce10eREX.js +0 -3979
- package/dist/wxml-DdGdeqaH.mjs +0 -3861
- /package/dist/{auto-2dg_uhEJ.mjs → auto-2dg_uhEJ.js} +0 -0
- /package/dist/{auto-DtU6f3X6.js → auto-DtU6f3X6.cjs} +0 -0
- /package/dist/bundlers/{vite → shared}/source-scan/dependencies.d.ts +0 -0
- /package/dist/{cache-options-DavPxrhC.js → cache-options-DavPxrhC.cjs} +0 -0
- /package/dist/{cache-options-DwBtLwQe.mjs → cache-options-DwBtLwQe.js} +0 -0
- /package/dist/{logger-BNzxZbZj.mjs → logger-BNzxZbZj.js} +0 -0
- /package/dist/{logger-TlKT3xmR.js → logger-TlKT3xmR.cjs} +0 -0
- /package/dist/{utils-CuKLf1Zv.js → utils-CuKLf1Zv.cjs} +0 -0
- /package/dist/{utils-MVwpU07P.mjs → utils-MVwpU07P.js} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { resolveUniUtsPlatform as resolveUniUtsPlatform$1 } from "./framework.
|
|
2
|
-
import { c as withCssMacroStyleOptions, i as hasCssMacroTailwindV4Source, o as transformCssMacroCss, s as transformCssMacroTailwindV4Source, t as hasCssMacroStyleOptions } from "./auto-2dg_uhEJ.
|
|
3
|
-
import { t as omitUndefined } from "./object-
|
|
4
|
-
import "./utils-MVwpU07P.
|
|
1
|
+
import { resolveUniUtsPlatform as resolveUniUtsPlatform$1 } from "./framework.js";
|
|
2
|
+
import { c as withCssMacroStyleOptions, i as hasCssMacroTailwindV4Source, o as transformCssMacroCss, s as transformCssMacroTailwindV4Source, t as hasCssMacroStyleOptions } from "./auto-2dg_uhEJ.js";
|
|
3
|
+
import { n as _defineProperty, t as omitUndefined } from "./object-Bvy6-w9r.js";
|
|
4
|
+
import "./utils-MVwpU07P.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import fs, { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import process from "node:process";
|
|
9
|
-
import { createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveValidTailwindV4Candidates as resolveValidTailwindV4Candidates$1 } from "@tailwindcss-mangle/engine";
|
|
9
|
+
import { createTailwindGenerationSession, createTailwindV4Engine, extractRawCandidates, loadTailwindV4DesignSystem, resolveProjectSourceFiles, resolveTailwindV4Source, resolveValidTailwindV4Candidates as resolveValidTailwindV4Candidates$1 } from "@tailwindcss-mangle/engine";
|
|
10
10
|
import { analyzeTailwindCssDirectives, createStyleHandler, filterExistingCssRules, finalizeMiniProgramCss, hasMiniProgramCssSpecificityPlaceholders, isTailwindCssGenerationDirective, isTailwindCssImportAtRule, isTailwindCssPackageJsonImportRequest, normalizeTailwindCssImportRequest, normalizeTailwindcssWebRpxDeclarations, parseTailwindCssConfigRequest, parseTailwindCssDirectiveRequest, postcss, protectDynamicColorMixAlpha, pruneMiniProgramGeneratedCss, pruneMiniProgramGeneratedCss as pruneMiniProgramGeneratedCss$1, removeUnsupportedCascadeLayers, removeUnsupportedMiniProgramAtRules, stripMiniProgramCssSpecificityPlaceholders } from "@weapp-tailwindcss/postcss";
|
|
11
11
|
import { LRUCache } from "lru-cache";
|
|
12
12
|
import { stat } from "node:fs/promises";
|
|
@@ -61,6 +61,216 @@ function filterUnsupportedMiniProgramTailwindV4Candidates(candidates) {
|
|
|
61
61
|
return new Set([...candidates].filter((candidate) => !isUnsupportedMiniProgramTailwindV4Candidate(candidate)));
|
|
62
62
|
}
|
|
63
63
|
//#endregion
|
|
64
|
+
//#region src/tailwindcss/v4-engine/generator/rpx-candidates.ts
|
|
65
|
+
const RPX_LENGTH_UTILITY_PATTERN = String.raw`text|border(?:-[trblxyse])?|bg|outline|ring`;
|
|
66
|
+
const BARE_RPX_LENGTH_CANDIDATE_RE = new RegExp(String.raw`(^|:)(!?)(${RPX_LENGTH_UTILITY_PATTERN})-\[([-+]?(?:\d+|\d*\.\d+)rpx)\](.*)$`, "u");
|
|
67
|
+
const BARE_RPX_LENGTH_HINT_CANDIDATE_RE = new RegExp(String.raw`(?:^|:)!?(${RPX_LENGTH_UTILITY_PATTERN})-\[length:([-+]?(?:\d+|\d*\.\d+)rpx)\].*$`, "u");
|
|
68
|
+
const RPX_LENGTH_SELECTOR_RE = new RegExp(String.raw`(${RPX_LENGTH_UTILITY_PATTERN})-\\\[length\\:((?:\\[.+-]|[+\-.\d])+rpx)\\\]`, "g");
|
|
69
|
+
function normalizeRpxLengthCandidate(candidate) {
|
|
70
|
+
return candidate.replace(BARE_RPX_LENGTH_CANDIDATE_RE, (_match, prefix, important, utility, value, suffix) => {
|
|
71
|
+
return `${prefix}${important}${utility}-[length:${value}]${suffix}`;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
function normalizeRpxLengthCandidates(candidates) {
|
|
75
|
+
const normalized = /* @__PURE__ */ new Set();
|
|
76
|
+
const restoreCandidates = /* @__PURE__ */ new Map();
|
|
77
|
+
for (const candidate of candidates) {
|
|
78
|
+
const normalizedCandidate = normalizeRpxLengthCandidate(candidate);
|
|
79
|
+
normalized.add(normalizedCandidate);
|
|
80
|
+
if (normalizedCandidate !== candidate) restoreCandidates.set(normalizedCandidate, candidate);
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
candidates: normalized,
|
|
84
|
+
restoreCandidates
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
function restoreRpxLengthCandidates(candidates, restoreCandidates) {
|
|
88
|
+
if (restoreCandidates.size === 0) return new Set(candidates);
|
|
89
|
+
return new Set([...candidates].map((candidate) => restoreCandidates.get(candidate) ?? candidate));
|
|
90
|
+
}
|
|
91
|
+
function normalizeCssEscapedRpxSelectorValue(value) {
|
|
92
|
+
return value.replace(/\\([.+-])/g, "$1");
|
|
93
|
+
}
|
|
94
|
+
function restoreRpxLengthCssSelectors(css, restoreCandidates) {
|
|
95
|
+
if (restoreCandidates.size === 0 || !css.includes("\\[length\\:")) return css;
|
|
96
|
+
const restoredUtilities = new Set([...restoreCandidates.keys()].map((candidate) => {
|
|
97
|
+
const match = BARE_RPX_LENGTH_HINT_CANDIDATE_RE.exec(candidate);
|
|
98
|
+
return match ? `${match[1]}:${match[2]}` : void 0;
|
|
99
|
+
}).filter((value) => Boolean(value)));
|
|
100
|
+
return css.replace(RPX_LENGTH_SELECTOR_RE, (match, utility, value) => {
|
|
101
|
+
return restoredUtilities.has(`${utility}:${normalizeCssEscapedRpxSelectorValue(value)}`) ? `${utility}-\\[${value}\\]` : match;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 12e3;
|
|
105
|
+
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX = 2 * 1024 * 1024;
|
|
106
|
+
const incrementalGenerateCache = new LRUCache({ max: 8 });
|
|
107
|
+
const incrementalGenerateTaskCache = new LRUCache({ max: 32 });
|
|
108
|
+
function collectCandidates(candidates) {
|
|
109
|
+
return new Set(candidates ?? []);
|
|
110
|
+
}
|
|
111
|
+
function hasRemovedCandidates(previousCandidates, nextCandidates) {
|
|
112
|
+
for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
function createStableJson(value) {
|
|
116
|
+
if (value === void 0) return "undefined";
|
|
117
|
+
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
118
|
+
if (Array.isArray(value)) return `[${value.map((item) => createStableJson(item)).join(",")}]`;
|
|
119
|
+
return `{${Object.keys(value).sort().map((key) => {
|
|
120
|
+
const record = value;
|
|
121
|
+
return `${JSON.stringify(key)}:${createStableJson(record[key])}`;
|
|
122
|
+
}).join(",")}}`;
|
|
123
|
+
}
|
|
124
|
+
function createDependencyFingerprint(files) {
|
|
125
|
+
return files.map((file) => {
|
|
126
|
+
try {
|
|
127
|
+
const stat = fs.statSync(file);
|
|
128
|
+
return `${file}:${stat.size}:${stat.mtimeMs}`;
|
|
129
|
+
} catch {
|
|
130
|
+
return `${file}:missing`;
|
|
131
|
+
}
|
|
132
|
+
}).join("|");
|
|
133
|
+
}
|
|
134
|
+
function createTailwindV4SourceCacheKey(source) {
|
|
135
|
+
return [
|
|
136
|
+
source.projectRoot,
|
|
137
|
+
source.base,
|
|
138
|
+
createStableJson(source.baseFallbacks),
|
|
139
|
+
source.css,
|
|
140
|
+
createDependencyFingerprint(source.dependencies)
|
|
141
|
+
].join("\0");
|
|
142
|
+
}
|
|
143
|
+
function createIncrementalGenerateCacheKey(source, target, styleOptions) {
|
|
144
|
+
return [
|
|
145
|
+
createTailwindV4SourceCacheKey(source),
|
|
146
|
+
target,
|
|
147
|
+
createStableJson(styleOptions)
|
|
148
|
+
].join("\0");
|
|
149
|
+
}
|
|
150
|
+
function createIncrementalGenerateTaskCacheKey(cacheKey, requestedCandidates, scanSources) {
|
|
151
|
+
return [
|
|
152
|
+
cacheKey,
|
|
153
|
+
scanSources === true ? "scan:1" : "scan:0",
|
|
154
|
+
[...requestedCandidates].sort().join("\n")
|
|
155
|
+
].join("\0");
|
|
156
|
+
}
|
|
157
|
+
function runIncrementalGenerateTask(cacheKey, requestedCandidates, scanSources, task) {
|
|
158
|
+
const taskKey = createIncrementalGenerateTaskCacheKey(cacheKey, requestedCandidates, scanSources);
|
|
159
|
+
const cachedTask = incrementalGenerateTaskCache.get(taskKey);
|
|
160
|
+
if (cachedTask) return cachedTask;
|
|
161
|
+
const promise = task();
|
|
162
|
+
incrementalGenerateTaskCache.set(taskKey, promise);
|
|
163
|
+
promise.finally(() => {
|
|
164
|
+
if (incrementalGenerateTaskCache.get(taskKey) === promise) incrementalGenerateTaskCache.delete(taskKey);
|
|
165
|
+
});
|
|
166
|
+
return promise;
|
|
167
|
+
}
|
|
168
|
+
function createIncrementalDesignSystemPromise(source, cacheKey) {
|
|
169
|
+
const promise = loadTailwindV4DesignSystem(source);
|
|
170
|
+
promise.catch(() => {
|
|
171
|
+
if (incrementalGenerateCache.get(cacheKey)?.designSystemPromise === promise) incrementalGenerateCache.delete(cacheKey);
|
|
172
|
+
});
|
|
173
|
+
return promise;
|
|
174
|
+
}
|
|
175
|
+
function resolveTargetCandidates(candidates, target) {
|
|
176
|
+
const collected = collectCandidates(candidates);
|
|
177
|
+
return target === "weapp" ? filterUnsupportedMiniProgramTailwindV4Candidates(collected) : collected;
|
|
178
|
+
}
|
|
179
|
+
function collectSeenCandidates(generated) {
|
|
180
|
+
return new Set(generated.classSet);
|
|
181
|
+
}
|
|
182
|
+
function createIncrementalStyleOptions(styleOptions) {
|
|
183
|
+
return {
|
|
184
|
+
...styleOptions,
|
|
185
|
+
isMainChunk: false
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function resolveStyleOptions(source, options) {
|
|
189
|
+
return hasCssMacroTailwindV4Source(source.css) ? withCssMacroStyleOptions(options) : options;
|
|
190
|
+
}
|
|
191
|
+
function collectCustomPropertyValues(css) {
|
|
192
|
+
const values = /* @__PURE__ */ new Map();
|
|
193
|
+
try {
|
|
194
|
+
postcss.parse(css).walkDecls((decl) => {
|
|
195
|
+
if (decl.prop.startsWith("--")) values.set(decl.prop, decl.value.trim());
|
|
196
|
+
});
|
|
197
|
+
} catch {}
|
|
198
|
+
return values;
|
|
199
|
+
}
|
|
200
|
+
function mergeCustomPropertyValues(target, css) {
|
|
201
|
+
for (const [prop, value] of collectCustomPropertyValues(css)) target.set(prop, value);
|
|
202
|
+
}
|
|
203
|
+
function createStableTextSignature(input) {
|
|
204
|
+
let hash = 2166136261;
|
|
205
|
+
for (let i = 0; i < input.length; i++) {
|
|
206
|
+
hash ^= input.charCodeAt(i);
|
|
207
|
+
hash = Math.imul(hash, 16777619);
|
|
208
|
+
}
|
|
209
|
+
return (hash >>> 0).toString(36);
|
|
210
|
+
}
|
|
211
|
+
function summarizeIncrementalCacheKey(key) {
|
|
212
|
+
return {
|
|
213
|
+
keyHash: createStableTextSignature(key),
|
|
214
|
+
keyBytes: key.length
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function shouldRebuildIncrementalEntry(cached, requestedCandidates, missingCandidates) {
|
|
218
|
+
return cached.seenCandidates.size + missingCandidates.length > 12e3 || cached.css.length > 2097152 || cached.rawCss.length > 2097152 || requestedCandidates.size > 12e3;
|
|
219
|
+
}
|
|
220
|
+
function shouldAdmitIncrementalEntry(requestedCandidates, generated) {
|
|
221
|
+
return requestedCandidates.size <= 12e3 && generated.css.length <= 2097152 && generated.rawCss.length <= 2097152;
|
|
222
|
+
}
|
|
223
|
+
function seedIncrementalGenerateCache(options) {
|
|
224
|
+
if (!shouldAdmitIncrementalEntry(options.requestedCandidates, options.generated)) return false;
|
|
225
|
+
const cacheKey = createIncrementalGenerateCacheKey(options.compatibleSource, options.target, options.styleOptions);
|
|
226
|
+
const customPropertyValues = collectCustomPropertyValues(options.compatibleSource.css);
|
|
227
|
+
mergeCustomPropertyValues(customPropertyValues, options.generated.css);
|
|
228
|
+
incrementalGenerateCache.set(cacheKey, {
|
|
229
|
+
seenCandidates: collectSeenCandidates(options.generated),
|
|
230
|
+
classSet: new Set(options.generated.classSet),
|
|
231
|
+
css: options.generated.css,
|
|
232
|
+
rawCss: options.generated.rawCss,
|
|
233
|
+
customPropertyValues,
|
|
234
|
+
designSystemPromise: createIncrementalDesignSystemPromise(options.compatibleSource, cacheKey),
|
|
235
|
+
dependencies: options.generated.dependencies,
|
|
236
|
+
sources: options.generated.sources,
|
|
237
|
+
root: options.generated.root,
|
|
238
|
+
target: options.generated.target
|
|
239
|
+
});
|
|
240
|
+
return true;
|
|
241
|
+
}
|
|
242
|
+
function shouldNormalizeRpxLengthCandidatesForTarget(target, styleOptions) {
|
|
243
|
+
if (target !== "web") return true;
|
|
244
|
+
return styleOptions?.appType === "uni-app-vite" || shouldUseWebGeneratorTargetFromEnv();
|
|
245
|
+
}
|
|
246
|
+
function normalizeTargetRpxLengthCandidates(candidates, target, styleOptions) {
|
|
247
|
+
return shouldNormalizeRpxLengthCandidatesForTarget(target, styleOptions) ? normalizeRpxLengthCandidates(candidates) : {
|
|
248
|
+
candidates: new Set(candidates),
|
|
249
|
+
restoreCandidates: /* @__PURE__ */ new Map()
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/tailwindcss/v4-engine/generator/cache-stats.ts
|
|
254
|
+
function getTailwindV4IncrementalGenerateCacheStats() {
|
|
255
|
+
return {
|
|
256
|
+
max: 8,
|
|
257
|
+
entryCandidatesMax: INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX,
|
|
258
|
+
entryCssBytesMax: INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX,
|
|
259
|
+
size: incrementalGenerateCache.size,
|
|
260
|
+
taskMax: 32,
|
|
261
|
+
taskSize: incrementalGenerateTaskCache.size,
|
|
262
|
+
entries: [...incrementalGenerateCache.entries()].map(([key, entry]) => ({
|
|
263
|
+
...summarizeIncrementalCacheKey(key),
|
|
264
|
+
candidates: entry.seenCandidates.size,
|
|
265
|
+
classSet: entry.classSet.size,
|
|
266
|
+
cssBytes: entry.css.length,
|
|
267
|
+
rawCssBytes: entry.rawCss.length
|
|
268
|
+
})),
|
|
269
|
+
keys: [...incrementalGenerateCache.keys()].map(summarizeIncrementalCacheKey),
|
|
270
|
+
taskKeys: [...incrementalGenerateTaskCache.keys()].map(summarizeIncrementalCacheKey)
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
//#endregion
|
|
64
274
|
//#region src/tailwindcss/v4-engine/css-macro-source.ts
|
|
65
275
|
function resolveCssMacroTailwindV4Source(source) {
|
|
66
276
|
const css = transformCssMacroTailwindV4Source(source.css);
|
|
@@ -70,6 +280,59 @@ function resolveCssMacroTailwindV4Source(source) {
|
|
|
70
280
|
};
|
|
71
281
|
}
|
|
72
282
|
//#endregion
|
|
283
|
+
//#region src/tailwindcss/v4-engine/miniprogram.ts
|
|
284
|
+
const defaultStyleHandler = createStyleHandler({
|
|
285
|
+
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
286
|
+
cssRemoveHoverPseudoClass: true,
|
|
287
|
+
isMainChunk: true,
|
|
288
|
+
majorVersion: 4
|
|
289
|
+
});
|
|
290
|
+
const CSS_DECLARATION_URL_RE = /(:\s*)url\(([^\n\r"';[\]{}]*[[\]{}][^\n\r;]*)\)(?=\s*;)/g;
|
|
291
|
+
function normalizeTailwindV4GeneratedUrlValues(css) {
|
|
292
|
+
return css.replace(CSS_DECLARATION_URL_RE, (match, prefix, urlValue) => {
|
|
293
|
+
try {
|
|
294
|
+
return `${prefix}url("${urlValue.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"")}")`;
|
|
295
|
+
} catch {
|
|
296
|
+
return match;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
async function transformTailwindV4CssToWeapp(css, options) {
|
|
301
|
+
const compatibleCss = normalizeTailwindV4GeneratedUrlValues(hasCssMacroStyleOptions(options) ? await transformCssMacroCss(css, options) : css);
|
|
302
|
+
const customPropertyValues = options?.customPropertyValues;
|
|
303
|
+
const protectedCss = protectDynamicColorMixAlpha(compatibleCss, { customPropertyValues });
|
|
304
|
+
const result = await defaultStyleHandler(protectedCss.css, {
|
|
305
|
+
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
306
|
+
cssRemoveHoverPseudoClass: true,
|
|
307
|
+
isMainChunk: true,
|
|
308
|
+
majorVersion: 4,
|
|
309
|
+
...options
|
|
310
|
+
});
|
|
311
|
+
const pruneOptions = {
|
|
312
|
+
preserveContentInit: options?.uniAppX === true && options.uniAppXCssTarget === "uvue" ? false : void 0,
|
|
313
|
+
preservePreflight: true,
|
|
314
|
+
preserveConditionalComments: hasCssMacroStyleOptions(options)
|
|
315
|
+
};
|
|
316
|
+
return pruneMiniProgramGeneratedCss$1(protectedCss.restore(result.css), pruneOptions);
|
|
317
|
+
}
|
|
318
|
+
function transformTailwindV4WebRpxCss(css) {
|
|
319
|
+
if (!css.includes("rpx")) return css;
|
|
320
|
+
try {
|
|
321
|
+
const root = postcss.parse(css);
|
|
322
|
+
return normalizeTailwindcssWebRpxDeclarations(root, { majorVersion: 4 }) ? root.toString() : css;
|
|
323
|
+
} catch {
|
|
324
|
+
return css;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function shouldTransformWebRpxCss(options) {
|
|
328
|
+
return options?.appType === "uni-app-vite" || shouldUseWebGeneratorTargetFromEnv();
|
|
329
|
+
}
|
|
330
|
+
async function transformTailwindV4CssByTarget(css, target, options) {
|
|
331
|
+
if (target === "weapp") return transformTailwindV4CssToWeapp(css, options);
|
|
332
|
+
const resolvedWebCss = await (hasCssMacroStyleOptions(options) ? transformCssMacroCss(css, options) : css);
|
|
333
|
+
return shouldTransformWebRpxCss(options) ? transformTailwindV4WebRpxCss(resolvedWebCss) : resolvedWebCss;
|
|
334
|
+
}
|
|
335
|
+
//#endregion
|
|
73
336
|
//#region src/tailwindcss/v4-engine/tailwind-v4-default-colors.ts
|
|
74
337
|
const TAILWIND_V4_COLOR_STEPS = [
|
|
75
338
|
"50",
|
|
@@ -556,45 +819,53 @@ function createCompatibleSource(source, target) {
|
|
|
556
819
|
};
|
|
557
820
|
}
|
|
558
821
|
//#endregion
|
|
559
|
-
//#region src/tailwindcss/v4-engine/generator/
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
const
|
|
574
|
-
|
|
575
|
-
|
|
822
|
+
//#region src/tailwindcss/v4-engine/generator/native-session.ts
|
|
823
|
+
var TailwindV4NativeSessionPool = class {
|
|
824
|
+
constructor(createSession = createTailwindGenerationSession) {
|
|
825
|
+
this.createSession = createSession;
|
|
826
|
+
_defineProperty(this, "sessions", /* @__PURE__ */ new Map());
|
|
827
|
+
_defineProperty(this, "disposed", false);
|
|
828
|
+
}
|
|
829
|
+
generate(target, sourceKey, source, request) {
|
|
830
|
+
const entry = this.getSession(target, sourceKey, source);
|
|
831
|
+
const generated = entry.pending.then(() => entry.session.generate(request));
|
|
832
|
+
entry.pending = generated.then(() => void 0, () => void 0);
|
|
833
|
+
return generated;
|
|
834
|
+
}
|
|
835
|
+
dispose() {
|
|
836
|
+
for (const entry of this.sessions.values()) this.disposeEntry(entry);
|
|
837
|
+
this.sessions.clear();
|
|
838
|
+
this.disposed = true;
|
|
839
|
+
}
|
|
840
|
+
get size() {
|
|
841
|
+
return this.sessions.size;
|
|
842
|
+
}
|
|
843
|
+
getSession(target, sourceKey, source) {
|
|
844
|
+
if (this.disposed) throw new Error("TailwindV4NativeSessionPool 已释放。");
|
|
845
|
+
const cached = this.sessions.get(target);
|
|
846
|
+
if (cached?.sourceKey === sourceKey) return cached;
|
|
847
|
+
if (cached) this.disposeEntry(cached);
|
|
848
|
+
const session = this.createSession(source);
|
|
849
|
+
const entry = {
|
|
850
|
+
pending: Promise.resolve(),
|
|
851
|
+
session,
|
|
852
|
+
sourceKey
|
|
853
|
+
};
|
|
854
|
+
this.sessions.set(target, entry);
|
|
855
|
+
return entry;
|
|
576
856
|
}
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
}
|
|
586
|
-
function normalizeCssEscapedRpxSelectorValue(value) {
|
|
587
|
-
return value.replace(/\\([.+-])/g, "$1");
|
|
857
|
+
disposeEntry(entry) {
|
|
858
|
+
entry.pending.then(() => entry.session.dispose());
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
function createEngineSourceEntries(sources, sourceId) {
|
|
862
|
+
return sources.map((source, index) => ({
|
|
863
|
+
id: `${sourceId}:candidate-source:${index}`,
|
|
864
|
+
...source
|
|
865
|
+
}));
|
|
588
866
|
}
|
|
589
|
-
function
|
|
590
|
-
|
|
591
|
-
const restoredUtilities = new Set([...restoreCandidates.keys()].map((candidate) => {
|
|
592
|
-
const match = BARE_RPX_LENGTH_HINT_CANDIDATE_RE.exec(candidate);
|
|
593
|
-
return match ? `${match[1]}:${match[2]}` : void 0;
|
|
594
|
-
}).filter((value) => Boolean(value)));
|
|
595
|
-
return css.replace(RPX_LENGTH_SELECTOR_RE, (match, utility, value) => {
|
|
596
|
-
return restoredUtilities.has(`${utility}:${normalizeCssEscapedRpxSelectorValue(value)}`) ? `${utility}-\\[${value}\\]` : match;
|
|
597
|
-
});
|
|
867
|
+
function serializeTailwindGenerationArtifact(artifact) {
|
|
868
|
+
return [...artifact.fragments].sort((left, right) => left.order - right.order).map((fragment) => fragment.root.toString()).join("\n");
|
|
598
869
|
}
|
|
599
870
|
//#endregion
|
|
600
871
|
//#region src/tailwindcss/source-scan.ts
|
|
@@ -953,235 +1224,85 @@ async function resolveCssDefinedScanSources(source) {
|
|
|
953
1224
|
...createDefaultIgnoredScanSources(importSourceBase)
|
|
954
1225
|
];
|
|
955
1226
|
}
|
|
956
|
-
async function resolveScanSources(source, scanSources) {
|
|
957
|
-
if (scanSources !== true) return scanSources;
|
|
958
|
-
return await resolveCssDefinedScanSources(source) ?? false;
|
|
959
|
-
}
|
|
960
|
-
//#endregion
|
|
961
|
-
//#region src/tailwindcss/v4-engine/miniprogram.ts
|
|
962
|
-
const defaultStyleHandler = createStyleHandler({
|
|
963
|
-
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
964
|
-
cssRemoveHoverPseudoClass: true,
|
|
965
|
-
isMainChunk: true,
|
|
966
|
-
majorVersion: 4
|
|
967
|
-
});
|
|
968
|
-
const CSS_DECLARATION_URL_RE = /(:\s*)url\(([^\n\r"';[\]{}]*[[\]{}][^\n\r;]*)\)(?=\s*;)/g;
|
|
969
|
-
function normalizeTailwindV4GeneratedUrlValues(css) {
|
|
970
|
-
return css.replace(CSS_DECLARATION_URL_RE, (match, prefix, urlValue) => {
|
|
971
|
-
try {
|
|
972
|
-
return `${prefix}url("${urlValue.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"")}")`;
|
|
973
|
-
} catch {
|
|
974
|
-
return match;
|
|
975
|
-
}
|
|
976
|
-
});
|
|
977
|
-
}
|
|
978
|
-
async function transformTailwindV4CssToWeapp(css, options) {
|
|
979
|
-
const protectedCss = protectDynamicColorMixAlpha(normalizeTailwindV4GeneratedUrlValues(hasCssMacroStyleOptions(options) ? await transformCssMacroCss(css, options) : css), { customPropertyValues: options && "customPropertyValues" in options ? options.customPropertyValues : void 0 });
|
|
980
|
-
const result = await defaultStyleHandler(protectedCss.css, {
|
|
981
|
-
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
982
|
-
cssRemoveHoverPseudoClass: true,
|
|
983
|
-
isMainChunk: true,
|
|
984
|
-
majorVersion: 4,
|
|
985
|
-
...options
|
|
986
|
-
});
|
|
987
|
-
const pruneOptions = {
|
|
988
|
-
preservePreflight: true,
|
|
989
|
-
preserveConditionalComments: hasCssMacroStyleOptions(options)
|
|
990
|
-
};
|
|
991
|
-
return pruneMiniProgramGeneratedCss$1(protectedCss.restore(result.css), pruneOptions);
|
|
992
|
-
}
|
|
993
|
-
function transformTailwindV4WebRpxCss(css) {
|
|
994
|
-
if (!css.includes("rpx")) return css;
|
|
995
|
-
try {
|
|
996
|
-
const root = postcss.parse(css);
|
|
997
|
-
return normalizeTailwindcssWebRpxDeclarations(root, { majorVersion: 4 }) ? root.toString() : css;
|
|
998
|
-
} catch {
|
|
999
|
-
return css;
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
function shouldTransformWebRpxCss(options) {
|
|
1003
|
-
return options?.appType === "uni-app-vite" || shouldUseWebGeneratorTargetFromEnv();
|
|
1004
|
-
}
|
|
1005
|
-
async function transformTailwindV4CssByTarget(css, target, options) {
|
|
1006
|
-
if (target === "weapp") return transformTailwindV4CssToWeapp(css, options);
|
|
1007
|
-
const resolvedWebCss = await (hasCssMacroStyleOptions(options) ? transformCssMacroCss(css, options) : css);
|
|
1008
|
-
return shouldTransformWebRpxCss(options) ? transformTailwindV4WebRpxCss(resolvedWebCss) : resolvedWebCss;
|
|
1009
|
-
}
|
|
1010
|
-
//#endregion
|
|
1011
|
-
//#region src/tailwindcss/v4-engine/generator.ts
|
|
1012
|
-
const INCREMENTAL_GENERATE_CACHE_MAX = 8;
|
|
1013
|
-
const INCREMENTAL_GENERATE_TASK_CACHE_MAX = 32;
|
|
1014
|
-
const INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX = 12e3;
|
|
1015
|
-
const INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX = 2 * 1024 * 1024;
|
|
1016
|
-
const incrementalGenerateCache = new LRUCache({ max: INCREMENTAL_GENERATE_CACHE_MAX });
|
|
1017
|
-
const incrementalGenerateTaskCache = new LRUCache({ max: INCREMENTAL_GENERATE_TASK_CACHE_MAX });
|
|
1018
|
-
function collectCandidates(candidates) {
|
|
1019
|
-
return new Set(candidates ?? []);
|
|
1020
|
-
}
|
|
1021
|
-
function hasRemovedCandidates(previousCandidates, nextCandidates) {
|
|
1022
|
-
for (const candidate of previousCandidates) if (!nextCandidates.has(candidate)) return true;
|
|
1023
|
-
return false;
|
|
1024
|
-
}
|
|
1025
|
-
function createStableJson(value) {
|
|
1026
|
-
if (value === void 0) return "undefined";
|
|
1027
|
-
if (value === null || typeof value !== "object") return JSON.stringify(value);
|
|
1028
|
-
if (Array.isArray(value)) return `[${value.map((item) => createStableJson(item)).join(",")}]`;
|
|
1029
|
-
return `{${Object.keys(value).sort().map((key) => {
|
|
1030
|
-
const record = value;
|
|
1031
|
-
return `${JSON.stringify(key)}:${createStableJson(record[key])}`;
|
|
1032
|
-
}).join(",")}}`;
|
|
1033
|
-
}
|
|
1034
|
-
function createDependencyFingerprint(files) {
|
|
1035
|
-
return files.map((file) => {
|
|
1036
|
-
try {
|
|
1037
|
-
const stat = fs.statSync(file);
|
|
1038
|
-
return `${file}:${stat.size}:${stat.mtimeMs}`;
|
|
1039
|
-
} catch {
|
|
1040
|
-
return `${file}:missing`;
|
|
1041
|
-
}
|
|
1042
|
-
}).join("|");
|
|
1043
|
-
}
|
|
1044
|
-
function createIncrementalGenerateCacheKey(source, target, styleOptions) {
|
|
1045
|
-
return [
|
|
1046
|
-
source.projectRoot,
|
|
1047
|
-
source.base,
|
|
1048
|
-
createStableJson(source.baseFallbacks),
|
|
1049
|
-
source.css,
|
|
1050
|
-
createDependencyFingerprint(source.dependencies),
|
|
1051
|
-
target,
|
|
1052
|
-
createStableJson(styleOptions)
|
|
1053
|
-
].join("\0");
|
|
1054
|
-
}
|
|
1055
|
-
function createIncrementalGenerateTaskCacheKey(cacheKey, requestedCandidates, scanSources) {
|
|
1056
|
-
return [
|
|
1057
|
-
cacheKey,
|
|
1058
|
-
scanSources === true ? "scan:1" : "scan:0",
|
|
1059
|
-
[...requestedCandidates].sort().join("\n")
|
|
1060
|
-
].join("\0");
|
|
1061
|
-
}
|
|
1062
|
-
function runIncrementalGenerateTask(cacheKey, requestedCandidates, scanSources, task) {
|
|
1063
|
-
const taskKey = createIncrementalGenerateTaskCacheKey(cacheKey, requestedCandidates, scanSources);
|
|
1064
|
-
const cachedTask = incrementalGenerateTaskCache.get(taskKey);
|
|
1065
|
-
if (cachedTask) return cachedTask;
|
|
1066
|
-
const promise = task();
|
|
1067
|
-
incrementalGenerateTaskCache.set(taskKey, promise);
|
|
1068
|
-
promise.finally(() => {
|
|
1069
|
-
if (incrementalGenerateTaskCache.get(taskKey) === promise) incrementalGenerateTaskCache.delete(taskKey);
|
|
1070
|
-
});
|
|
1071
|
-
return promise;
|
|
1072
|
-
}
|
|
1073
|
-
function createIncrementalDesignSystemPromise(source, cacheKey) {
|
|
1074
|
-
const promise = loadTailwindV4DesignSystem(source);
|
|
1075
|
-
promise.catch(() => {
|
|
1076
|
-
if (incrementalGenerateCache.get(cacheKey)?.designSystemPromise === promise) incrementalGenerateCache.delete(cacheKey);
|
|
1077
|
-
});
|
|
1078
|
-
return promise;
|
|
1079
|
-
}
|
|
1080
|
-
function resolveTargetCandidates(candidates, target) {
|
|
1081
|
-
const collected = collectCandidates(candidates);
|
|
1082
|
-
return target === "weapp" ? filterUnsupportedMiniProgramTailwindV4Candidates(collected) : collected;
|
|
1083
|
-
}
|
|
1084
|
-
function collectSeenCandidates(generated) {
|
|
1085
|
-
return new Set(generated.classSet);
|
|
1086
|
-
}
|
|
1087
|
-
function shouldDelegateWebSourceScanToTailwind(target, scanSources) {
|
|
1088
|
-
return target === "web" && scanSources !== false;
|
|
1089
|
-
}
|
|
1090
|
-
function createIncrementalStyleOptions(styleOptions) {
|
|
1091
|
-
return {
|
|
1092
|
-
...styleOptions,
|
|
1093
|
-
isMainChunk: false
|
|
1094
|
-
};
|
|
1095
|
-
}
|
|
1096
|
-
function resolveStyleOptions(source, options) {
|
|
1097
|
-
return hasCssMacroTailwindV4Source(source.css) ? withCssMacroStyleOptions(options) : options;
|
|
1098
|
-
}
|
|
1099
|
-
function collectCustomPropertyValues(css) {
|
|
1100
|
-
const values = /* @__PURE__ */ new Map();
|
|
1101
|
-
try {
|
|
1102
|
-
postcss.parse(css).walkDecls((decl) => {
|
|
1103
|
-
if (decl.prop.startsWith("--")) values.set(decl.prop, decl.value.trim());
|
|
1104
|
-
});
|
|
1105
|
-
} catch {}
|
|
1106
|
-
return values;
|
|
1107
|
-
}
|
|
1108
|
-
function mergeCustomPropertyValues(target, css) {
|
|
1109
|
-
for (const [prop, value] of collectCustomPropertyValues(css)) target.set(prop, value);
|
|
1110
|
-
}
|
|
1111
|
-
function createStableTextSignature(input) {
|
|
1112
|
-
let hash = 2166136261;
|
|
1113
|
-
for (let i = 0; i < input.length; i++) {
|
|
1114
|
-
hash ^= input.charCodeAt(i);
|
|
1115
|
-
hash = Math.imul(hash, 16777619);
|
|
1116
|
-
}
|
|
1117
|
-
return (hash >>> 0).toString(36);
|
|
1118
|
-
}
|
|
1119
|
-
function summarizeIncrementalCacheKey(key) {
|
|
1120
|
-
return {
|
|
1121
|
-
keyHash: createStableTextSignature(key),
|
|
1122
|
-
keyBytes: key.length
|
|
1123
|
-
};
|
|
1124
|
-
}
|
|
1125
|
-
function shouldRebuildIncrementalEntry(cached, requestedCandidates, missingCandidates) {
|
|
1126
|
-
return cached.seenCandidates.size + missingCandidates.length > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX || cached.css.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX || cached.rawCss.length > INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX || requestedCandidates.size > INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX;
|
|
1127
|
-
}
|
|
1128
|
-
function shouldAdmitIncrementalEntry(requestedCandidates, generated) {
|
|
1129
|
-
return requestedCandidates.size <= INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX && generated.css.length <= INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX && generated.rawCss.length <= INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX;
|
|
1130
|
-
}
|
|
1131
|
-
function seedIncrementalGenerateCache(options) {
|
|
1132
|
-
if (!shouldAdmitIncrementalEntry(options.requestedCandidates, options.generated)) return false;
|
|
1133
|
-
const cacheKey = createIncrementalGenerateCacheKey(options.compatibleSource, options.target, options.styleOptions);
|
|
1134
|
-
const customPropertyValues = collectCustomPropertyValues(options.compatibleSource.css);
|
|
1135
|
-
mergeCustomPropertyValues(customPropertyValues, options.generated.css);
|
|
1136
|
-
incrementalGenerateCache.set(cacheKey, {
|
|
1137
|
-
seenCandidates: collectSeenCandidates(options.generated),
|
|
1138
|
-
classSet: new Set(options.generated.classSet),
|
|
1139
|
-
css: options.generated.css,
|
|
1140
|
-
rawCss: options.generated.rawCss,
|
|
1141
|
-
customPropertyValues,
|
|
1142
|
-
designSystemPromise: createIncrementalDesignSystemPromise(options.compatibleSource, cacheKey),
|
|
1143
|
-
dependencies: options.generated.dependencies,
|
|
1144
|
-
sources: options.generated.sources,
|
|
1145
|
-
root: options.generated.root,
|
|
1146
|
-
target: options.generated.target
|
|
1147
|
-
});
|
|
1148
|
-
return true;
|
|
1149
|
-
}
|
|
1150
|
-
function shouldNormalizeRpxLengthCandidatesForTarget(target, styleOptions) {
|
|
1151
|
-
if (target !== "web") return true;
|
|
1152
|
-
return styleOptions?.appType === "uni-app-vite" || shouldUseWebGeneratorTargetFromEnv();
|
|
1227
|
+
async function resolveScanSources(source, scanSources) {
|
|
1228
|
+
if (scanSources !== true) return scanSources;
|
|
1229
|
+
return await resolveCssDefinedScanSources(source) ?? false;
|
|
1153
1230
|
}
|
|
1154
|
-
function
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1231
|
+
function resolveCompiledSourceRoot(source) {
|
|
1232
|
+
let root = null;
|
|
1233
|
+
try {
|
|
1234
|
+
postcss.parse(source.css).walkAtRules("import", (rule) => {
|
|
1235
|
+
if (!isTailwindCssImport(rule.params)) return;
|
|
1236
|
+
const sourceParam = parseImportSourceParam(rule.params);
|
|
1237
|
+
if (sourceParam?.none) {
|
|
1238
|
+
root = "none";
|
|
1239
|
+
return false;
|
|
1240
|
+
}
|
|
1241
|
+
if (sourceParam?.sourcePath) {
|
|
1242
|
+
root = {
|
|
1243
|
+
base: source.base,
|
|
1244
|
+
pattern: sourceParam.sourcePath
|
|
1245
|
+
};
|
|
1246
|
+
return false;
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
} catch {}
|
|
1250
|
+
return root;
|
|
1159
1251
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1252
|
+
//#endregion
|
|
1253
|
+
//#region src/tailwindcss/v4-engine/generator/engine.ts
|
|
1254
|
+
function isCssSyntaxError(error) {
|
|
1255
|
+
return error instanceof Error && error.name === "CssSyntaxError";
|
|
1162
1256
|
}
|
|
1163
1257
|
function createTailwindV4Engine$1(source) {
|
|
1258
|
+
const generationSessions = new TailwindV4NativeSessionPool();
|
|
1259
|
+
const incrementalCacheKeys = /* @__PURE__ */ new Set();
|
|
1260
|
+
const validationEngine = createTailwindV4Engine(source);
|
|
1164
1261
|
async function generateOnce(generateSource, options = {}) {
|
|
1165
1262
|
const { scanSources = true, styleOptions, target = "weapp", ...patchOptions } = options;
|
|
1166
1263
|
const resolvedStyleOptions = resolveStyleOptions(generateSource, styleOptions);
|
|
1167
|
-
const
|
|
1264
|
+
const compatibleSource = createCompatibleSource(resolveCssMacroTailwindV4Source(generateSource), target);
|
|
1168
1265
|
const resolvedScanSources = await resolveScanSources(generateSource, scanSources);
|
|
1169
|
-
const
|
|
1170
|
-
const filesystemCandidates = !delegateSourceScan && Array.isArray(resolvedScanSources) ? new Set(await extractRawCandidates(resolvedScanSources, { ...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues } })) : void 0;
|
|
1266
|
+
const filesystemCandidates = Array.isArray(resolvedScanSources) ? new Set(await extractRawCandidates(resolvedScanSources, { ...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues } })) : void 0;
|
|
1171
1267
|
const normalizedCandidates = normalizeTargetRpxLengthCandidates(resolveTargetCandidates(/* @__PURE__ */ new Set([...collectCandidates(patchOptions.candidates), ...filesystemCandidates ?? []]), target), target, resolvedStyleOptions);
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
...patchOptions,
|
|
1268
|
+
const sourceId = compatibleSource.dependencies[0] ?? compatibleSource.base;
|
|
1269
|
+
const generationRequest = {
|
|
1270
|
+
...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues },
|
|
1271
|
+
...patchOptions.sources === void 0 ? {} : { sourceEntries: createEngineSourceEntries(patchOptions.sources, sourceId) },
|
|
1175
1272
|
candidates: normalizedCandidates.candidates
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
|
|
1273
|
+
};
|
|
1274
|
+
let generatedCss;
|
|
1275
|
+
let classSet;
|
|
1276
|
+
let rawCandidates;
|
|
1277
|
+
let dependencies;
|
|
1278
|
+
try {
|
|
1279
|
+
const artifact = await generationSessions.generate(target, createTailwindV4SourceCacheKey(compatibleSource), compatibleSource, generationRequest);
|
|
1280
|
+
generatedCss = serializeTailwindGenerationArtifact(artifact);
|
|
1281
|
+
classSet = artifact.classSet;
|
|
1282
|
+
rawCandidates = artifact.rawCandidates;
|
|
1283
|
+
dependencies = artifact.dependencies;
|
|
1284
|
+
} catch (error) {
|
|
1285
|
+
if (!isCssSyntaxError(error)) throw error;
|
|
1286
|
+
const legacyResult = await createTailwindV4Engine(compatibleSource).generate({
|
|
1287
|
+
...patchOptions.bareArbitraryValues === void 0 ? {} : { bareArbitraryValues: patchOptions.bareArbitraryValues },
|
|
1288
|
+
...patchOptions.sources === void 0 ? {} : { sources: patchOptions.sources },
|
|
1289
|
+
candidates: normalizedCandidates.candidates,
|
|
1290
|
+
scanSources: false
|
|
1291
|
+
});
|
|
1292
|
+
generatedCss = legacyResult.css;
|
|
1293
|
+
classSet = legacyResult.classSet;
|
|
1294
|
+
rawCandidates = legacyResult.rawCandidates;
|
|
1295
|
+
dependencies = legacyResult.dependencies;
|
|
1296
|
+
}
|
|
1297
|
+
const sources = Array.isArray(resolvedScanSources) ? resolvedScanSources : [];
|
|
1298
|
+
const rawCss = restoreRpxLengthCssSelectors(generatedCss, normalizedCandidates.restoreCandidates);
|
|
1179
1299
|
const css = await transformTailwindV4CssByTarget(rawCss, target, resolvedStyleOptions);
|
|
1180
1300
|
return {
|
|
1181
|
-
|
|
1301
|
+
classSet: restoreRpxLengthCandidates(classSet, normalizedCandidates.restoreCandidates),
|
|
1302
|
+
rawCandidates: restoreRpxLengthCandidates(rawCandidates, normalizedCandidates.restoreCandidates),
|
|
1303
|
+
dependencies,
|
|
1304
|
+
root: resolveCompiledSourceRoot(compatibleSource),
|
|
1182
1305
|
sources,
|
|
1183
|
-
classSet: restoreRpxLengthCandidates(result.classSet, normalizedCandidates.restoreCandidates),
|
|
1184
|
-
rawCandidates: restoreRpxLengthCandidates(result.rawCandidates, normalizedCandidates.restoreCandidates),
|
|
1185
1306
|
css,
|
|
1186
1307
|
rawCss,
|
|
1187
1308
|
target
|
|
@@ -1195,6 +1316,7 @@ function createTailwindV4Engine$1(source) {
|
|
|
1195
1316
|
const styleOptions = resolveStyleOptions(source, options.styleOptions);
|
|
1196
1317
|
if ((options.sources?.length ?? 0) > 0 || options.bareArbitraryValues !== void 0 || Array.isArray(options.scanSources)) return generateOnce(cssMacroSource, options);
|
|
1197
1318
|
const cacheKey = createIncrementalGenerateCacheKey(compatibleSource, target, styleOptions);
|
|
1319
|
+
incrementalCacheKeys.add(cacheKey);
|
|
1198
1320
|
if (options.scanSources === true) return runIncrementalGenerateTask(cacheKey, requestedCandidates, options.scanSources, async () => {
|
|
1199
1321
|
const generated = await generateOnce(cssMacroSource, options);
|
|
1200
1322
|
if (!seedIncrementalGenerateCache({
|
|
@@ -1299,28 +1421,14 @@ function createTailwindV4Engine$1(source) {
|
|
|
1299
1421
|
}
|
|
1300
1422
|
return {
|
|
1301
1423
|
source,
|
|
1302
|
-
loadDesignSystem:
|
|
1303
|
-
validateCandidates:
|
|
1304
|
-
generate
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
entryCandidatesMax: INCREMENTAL_GENERATE_ENTRY_CANDIDATES_MAX,
|
|
1311
|
-
entryCssBytesMax: INCREMENTAL_GENERATE_ENTRY_CSS_BYTES_MAX,
|
|
1312
|
-
size: incrementalGenerateCache.size,
|
|
1313
|
-
taskMax: INCREMENTAL_GENERATE_TASK_CACHE_MAX,
|
|
1314
|
-
taskSize: incrementalGenerateTaskCache.size,
|
|
1315
|
-
entries: [...incrementalGenerateCache.entries()].map(([key, entry]) => ({
|
|
1316
|
-
...summarizeIncrementalCacheKey(key),
|
|
1317
|
-
candidates: entry.seenCandidates.size,
|
|
1318
|
-
classSet: entry.classSet.size,
|
|
1319
|
-
cssBytes: entry.css.length,
|
|
1320
|
-
rawCssBytes: entry.rawCss.length
|
|
1321
|
-
})),
|
|
1322
|
-
keys: [...incrementalGenerateCache.keys()].map(summarizeIncrementalCacheKey),
|
|
1323
|
-
taskKeys: [...incrementalGenerateTaskCache.keys()].map(summarizeIncrementalCacheKey)
|
|
1424
|
+
loadDesignSystem: validationEngine.loadDesignSystem,
|
|
1425
|
+
validateCandidates: validationEngine.validateCandidates,
|
|
1426
|
+
generate,
|
|
1427
|
+
dispose() {
|
|
1428
|
+
generationSessions.dispose();
|
|
1429
|
+
for (const cacheKey of incrementalCacheKeys) incrementalGenerateCache.delete(cacheKey);
|
|
1430
|
+
incrementalCacheKeys.clear();
|
|
1431
|
+
}
|
|
1324
1432
|
};
|
|
1325
1433
|
}
|
|
1326
1434
|
//#endregion
|
|
@@ -1722,66 +1830,347 @@ function hasTailwindApplyDirective(rawSource) {
|
|
|
1722
1830
|
const fallback = extractTailwindSourceForPostcssFallback(rawSource);
|
|
1723
1831
|
return typeof fallback === "string" && /@apply\s[^;{}]+;/.test(fallback);
|
|
1724
1832
|
}
|
|
1725
|
-
function resolveCssEntrySource(rawSource, base, options = {}) {
|
|
1833
|
+
function resolveCssEntrySource(rawSource, base, options = {}) {
|
|
1834
|
+
try {
|
|
1835
|
+
const root = postcss.parse(rawSource);
|
|
1836
|
+
const normalizedImports = normalizeTailwindImportAtRules(root, options);
|
|
1837
|
+
let found = false;
|
|
1838
|
+
let config;
|
|
1839
|
+
let configRequest;
|
|
1840
|
+
let removedConfig = false;
|
|
1841
|
+
const removeConfig = options.removeConfig ?? true;
|
|
1842
|
+
const ignoreLayer = hasGeneratedCssArtifacts(rawSource);
|
|
1843
|
+
root.walk((node) => {
|
|
1844
|
+
if (isTailwindGenerationDirective(node, {
|
|
1845
|
+
...options,
|
|
1846
|
+
ignoreLayer
|
|
1847
|
+
})) found = true;
|
|
1848
|
+
if (node.type === "atrule" && node.name === "config") {
|
|
1849
|
+
const configPath = parseConfigRequest(node.params);
|
|
1850
|
+
if (configPath && !config) {
|
|
1851
|
+
configRequest = configPath;
|
|
1852
|
+
config = resolveConfigPath(base, configPath);
|
|
1853
|
+
}
|
|
1854
|
+
if (removeConfig) {
|
|
1855
|
+
node.remove();
|
|
1856
|
+
removedConfig = true;
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
});
|
|
1860
|
+
if (!found) return;
|
|
1861
|
+
if (hasPreprocessorOnlySyntax(rawSource)) {
|
|
1862
|
+
const css = extractTailwindSourceForPostcssFallback(rawSource, {
|
|
1863
|
+
...options,
|
|
1864
|
+
removeConfig
|
|
1865
|
+
});
|
|
1866
|
+
if (css) return {
|
|
1867
|
+
css,
|
|
1868
|
+
config,
|
|
1869
|
+
configRequest,
|
|
1870
|
+
base
|
|
1871
|
+
};
|
|
1872
|
+
}
|
|
1873
|
+
return {
|
|
1874
|
+
css: removedConfig || normalizedImports ? root.toString() : rawSource,
|
|
1875
|
+
config,
|
|
1876
|
+
configRequest,
|
|
1877
|
+
base
|
|
1878
|
+
};
|
|
1879
|
+
} catch {
|
|
1880
|
+
const css = extractTailwindSourceForPostcssFallback(rawSource, options);
|
|
1881
|
+
const configRequest = extractConfigRequestFromSource(rawSource);
|
|
1882
|
+
const config = configRequest ? resolveConfigPath(base, configRequest) : void 0;
|
|
1883
|
+
return css ? {
|
|
1884
|
+
css,
|
|
1885
|
+
config,
|
|
1886
|
+
configRequest,
|
|
1887
|
+
base
|
|
1888
|
+
} : void 0;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
//#endregion
|
|
1892
|
+
//#region src/bundlers/shared/generator-css/scoped-rules.ts
|
|
1893
|
+
const VUE_SCOPED_SELECTOR_RE = /\.data-v-[\w-]+|\[data-v-[^\]]+\]/g;
|
|
1894
|
+
function normalizeGeneratedSelector$1(selector) {
|
|
1895
|
+
return selector.replace(/:not\(#\\#\)/g, "").trim();
|
|
1896
|
+
}
|
|
1897
|
+
function normalizeVueScopedSelector(selector) {
|
|
1898
|
+
let scoped = false;
|
|
1899
|
+
return {
|
|
1900
|
+
normalized: normalizeGeneratedSelector$1(selector).replace(VUE_SCOPED_SELECTOR_RE, () => {
|
|
1901
|
+
scoped = true;
|
|
1902
|
+
return "";
|
|
1903
|
+
}).trim(),
|
|
1904
|
+
scoped
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
function normalizeCssComparableValue(value) {
|
|
1908
|
+
const normalizeUnquotedSegment = (segment) => segment.replace(/(^|[^\w.-])(-?)0+\.(\d+)/g, "$1$2.$3");
|
|
1909
|
+
let result = "";
|
|
1910
|
+
let segmentStart = 0;
|
|
1911
|
+
let index = 0;
|
|
1912
|
+
while (index < value.length) {
|
|
1913
|
+
const quote = value[index];
|
|
1914
|
+
if (quote !== "\"" && quote !== "'") {
|
|
1915
|
+
index++;
|
|
1916
|
+
continue;
|
|
1917
|
+
}
|
|
1918
|
+
result += normalizeUnquotedSegment(value.slice(segmentStart, index));
|
|
1919
|
+
const stringStart = index;
|
|
1920
|
+
index++;
|
|
1921
|
+
while (index < value.length) {
|
|
1922
|
+
if (value[index] === "\\") {
|
|
1923
|
+
index += 2;
|
|
1924
|
+
continue;
|
|
1925
|
+
}
|
|
1926
|
+
if (value[index] === quote) {
|
|
1927
|
+
index++;
|
|
1928
|
+
break;
|
|
1929
|
+
}
|
|
1930
|
+
index++;
|
|
1931
|
+
}
|
|
1932
|
+
result += value.slice(stringStart, index);
|
|
1933
|
+
segmentStart = index;
|
|
1934
|
+
}
|
|
1935
|
+
return result + normalizeUnquotedSegment(value.slice(segmentStart));
|
|
1936
|
+
}
|
|
1937
|
+
function createCssNodeSignature(node) {
|
|
1938
|
+
if (node.type === "decl") return JSON.stringify([
|
|
1939
|
+
"decl",
|
|
1940
|
+
node.prop,
|
|
1941
|
+
normalizeCssComparableValue(node.value),
|
|
1942
|
+
node.important
|
|
1943
|
+
]);
|
|
1944
|
+
if (node.type === "atrule") return JSON.stringify([
|
|
1945
|
+
"atrule",
|
|
1946
|
+
node.name,
|
|
1947
|
+
normalizeCssComparableValue(node.params),
|
|
1948
|
+
node.nodes?.map(createCssNodeSignature) ?? null
|
|
1949
|
+
]);
|
|
1950
|
+
if (node.type === "rule") return JSON.stringify([
|
|
1951
|
+
"rule",
|
|
1952
|
+
node.selector,
|
|
1953
|
+
node.nodes?.map(createCssNodeSignature) ?? null
|
|
1954
|
+
]);
|
|
1955
|
+
if (node.type === "comment") return JSON.stringify(["comment", node.text]);
|
|
1956
|
+
return node.toString();
|
|
1957
|
+
}
|
|
1958
|
+
function createRuleBodySignature(rule) {
|
|
1959
|
+
return JSON.stringify(rule.nodes?.map(createCssNodeSignature) ?? []);
|
|
1960
|
+
}
|
|
1961
|
+
function createRuleAtRuleContextSignature(rule) {
|
|
1962
|
+
const context = [];
|
|
1963
|
+
let parent = rule.parent;
|
|
1964
|
+
while (parent && parent.type !== "root" && parent.type !== "document") {
|
|
1965
|
+
if (parent.type === "atrule") context.unshift(JSON.stringify([parent.name, parent.params]));
|
|
1966
|
+
parent = parent.parent;
|
|
1967
|
+
}
|
|
1968
|
+
return JSON.stringify(context);
|
|
1969
|
+
}
|
|
1970
|
+
function createScopedRuleCoverageKey(rule, selector) {
|
|
1971
|
+
return JSON.stringify([
|
|
1972
|
+
createRuleAtRuleContextSignature(rule),
|
|
1973
|
+
createRuleBodySignature(rule),
|
|
1974
|
+
selector
|
|
1975
|
+
]);
|
|
1976
|
+
}
|
|
1977
|
+
function removeUnscopedRulesCoveredByScopedRules(root) {
|
|
1978
|
+
const scopedCoverage = /* @__PURE__ */ new Set();
|
|
1979
|
+
root.walkRules((rule) => {
|
|
1980
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
1981
|
+
const normalized = normalizeVueScopedSelector(selector);
|
|
1982
|
+
if (normalized.scoped && normalized.normalized) scopedCoverage.add(createScopedRuleCoverageKey(rule, normalized.normalized));
|
|
1983
|
+
}
|
|
1984
|
+
});
|
|
1985
|
+
if (scopedCoverage.size === 0) return;
|
|
1986
|
+
root.walkRules((rule) => {
|
|
1987
|
+
const normalizedSelectors = (rule.selectors ?? [rule.selector]).map(normalizeVueScopedSelector);
|
|
1988
|
+
if (normalizedSelectors.some((selector) => selector.scoped || !selector.normalized) || !normalizedSelectors.every((selector) => scopedCoverage.has(createScopedRuleCoverageKey(rule, selector.normalized)))) return;
|
|
1989
|
+
rule.remove();
|
|
1990
|
+
});
|
|
1991
|
+
}
|
|
1992
|
+
function preferScopedGeneratedCssRules(css) {
|
|
1993
|
+
if (!css.includes("data-v-")) return css;
|
|
1994
|
+
try {
|
|
1995
|
+
const root = postcss.parse(css);
|
|
1996
|
+
removeUnscopedRulesCoveredByScopedRules(root);
|
|
1997
|
+
root.walkAtRules((rule) => {
|
|
1998
|
+
if (rule.nodes !== void 0 && rule.nodes.length === 0) rule.remove();
|
|
1999
|
+
});
|
|
2000
|
+
return root.toString();
|
|
2001
|
+
} catch {
|
|
2002
|
+
return css;
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
//#endregion
|
|
2006
|
+
//#region src/bundlers/shared/generator-css/user-css/user-layers.ts
|
|
2007
|
+
function splitUserCssLayerBlocks(source) {
|
|
2008
|
+
if (!source.includes("@layer")) return {
|
|
2009
|
+
layer: "",
|
|
2010
|
+
rest: source
|
|
2011
|
+
};
|
|
2012
|
+
try {
|
|
2013
|
+
const root = postcss.parse(source);
|
|
2014
|
+
const layerRoot = postcss.root();
|
|
2015
|
+
const restRoot = postcss.root();
|
|
2016
|
+
for (const node of root.nodes) (node.type === "atrule" && node.name === "layer" && node.nodes?.length ? layerRoot : restRoot).append(node.clone());
|
|
2017
|
+
return {
|
|
2018
|
+
layer: layerRoot.toString(),
|
|
2019
|
+
rest: restRoot.toString()
|
|
2020
|
+
};
|
|
2021
|
+
} catch {
|
|
2022
|
+
return {
|
|
2023
|
+
layer: source,
|
|
2024
|
+
rest: ""
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
function hasUserCssLayerBlocks(source) {
|
|
2029
|
+
if (!source.includes("@layer")) return false;
|
|
2030
|
+
try {
|
|
2031
|
+
let hasLayerBlock = false;
|
|
2032
|
+
postcss.parse(source).walkAtRules("layer", (node) => {
|
|
2033
|
+
if (node.nodes?.length) hasLayerBlock = true;
|
|
2034
|
+
});
|
|
2035
|
+
return hasLayerBlock;
|
|
2036
|
+
} catch {
|
|
2037
|
+
return true;
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
function collectUserLayerSelectors(source) {
|
|
2041
|
+
const selectors = /* @__PURE__ */ new Set();
|
|
2042
|
+
try {
|
|
2043
|
+
postcss.parse(source).walkRules((rule) => {
|
|
2044
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
2045
|
+
const normalized = selector.trim();
|
|
2046
|
+
if (normalized) selectors.add(normalized);
|
|
2047
|
+
}
|
|
2048
|
+
});
|
|
2049
|
+
} catch {}
|
|
2050
|
+
return selectors;
|
|
2051
|
+
}
|
|
2052
|
+
function matchesUserLayerSelector(selector, userLayerSelector) {
|
|
2053
|
+
if (selector === userLayerSelector) return true;
|
|
2054
|
+
if (!selector.startsWith(userLayerSelector)) return false;
|
|
2055
|
+
const next = selector[userLayerSelector.length];
|
|
2056
|
+
return next === ":" || next === "[";
|
|
2057
|
+
}
|
|
2058
|
+
function extractGeneratedCssForUserLayerSelectors(css, userLayerSource) {
|
|
2059
|
+
const selectors = collectUserLayerSelectors(userLayerSource);
|
|
2060
|
+
if (selectors.size === 0) return {
|
|
2061
|
+
layer: "",
|
|
2062
|
+
rest: css
|
|
2063
|
+
};
|
|
2064
|
+
try {
|
|
2065
|
+
const root = postcss.parse(css);
|
|
2066
|
+
const layerRoot = postcss.root();
|
|
2067
|
+
const selectorList = [...selectors];
|
|
2068
|
+
root.walkRules((rule) => {
|
|
2069
|
+
if ((rule.selectors ?? [rule.selector]).some((selector) => selectorList.some((userSelector) => matchesUserLayerSelector(selector.trim(), userSelector)))) {
|
|
2070
|
+
layerRoot.append(rule.clone());
|
|
2071
|
+
rule.remove();
|
|
2072
|
+
}
|
|
2073
|
+
});
|
|
2074
|
+
return {
|
|
2075
|
+
layer: layerRoot.toString(),
|
|
2076
|
+
rest: root.toString()
|
|
2077
|
+
};
|
|
2078
|
+
} catch {
|
|
2079
|
+
return {
|
|
2080
|
+
layer: "",
|
|
2081
|
+
rest: css
|
|
2082
|
+
};
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
function normalizeGeneratedSelector(selector) {
|
|
2086
|
+
return selector.replace(/:not\(#\\#\)/g, "").trim();
|
|
2087
|
+
}
|
|
2088
|
+
function collectApplyOnlySourceSelectors(source) {
|
|
2089
|
+
const selectors = /* @__PURE__ */ new Set();
|
|
2090
|
+
try {
|
|
2091
|
+
postcss.parse(source).walkRules((rule) => {
|
|
2092
|
+
if (!rule.nodes?.some((node) => node.type === "atrule" && node.name === "apply")) return;
|
|
2093
|
+
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
2094
|
+
const normalized = normalizeGeneratedSelector(selector);
|
|
2095
|
+
if (normalized) selectors.add(normalized);
|
|
2096
|
+
}
|
|
2097
|
+
});
|
|
2098
|
+
} catch {}
|
|
2099
|
+
return selectors;
|
|
2100
|
+
}
|
|
2101
|
+
function hasOnlyApplyBackedSourceRules(source) {
|
|
2102
|
+
let hasApplyRule = false;
|
|
2103
|
+
let hasNonApplyRule = false;
|
|
2104
|
+
try {
|
|
2105
|
+
postcss.parse(source).walkRules((rule) => {
|
|
2106
|
+
if (rule.nodes?.some((node) => node.type === "atrule" && node.name === "apply")) hasApplyRule = true;
|
|
2107
|
+
else hasNonApplyRule = true;
|
|
2108
|
+
});
|
|
2109
|
+
} catch {
|
|
2110
|
+
return false;
|
|
2111
|
+
}
|
|
2112
|
+
return hasApplyRule && !hasNonApplyRule;
|
|
2113
|
+
}
|
|
2114
|
+
function removeCssComments(css) {
|
|
2115
|
+
return css.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
2116
|
+
}
|
|
2117
|
+
function isEmptyCustomVariantBlock(rule) {
|
|
2118
|
+
if (rule.name !== "custom-variant") return false;
|
|
2119
|
+
if (!/^[\w-]+$/.test(rule.params.trim())) return false;
|
|
2120
|
+
if (rule.nodes === void 0) return true;
|
|
2121
|
+
return rule.nodes.every((node) => node.type === "comment");
|
|
2122
|
+
}
|
|
2123
|
+
//#endregion
|
|
2124
|
+
//#region src/bundlers/shared/generator-css/user-css/apply-only.ts
|
|
2125
|
+
function normalizeEmptyTailwindCustomVariants(css) {
|
|
2126
|
+
if (!css.includes("@custom-variant")) return css;
|
|
2127
|
+
try {
|
|
2128
|
+
const root = postcss.parse(css);
|
|
2129
|
+
let changed = false;
|
|
2130
|
+
root.walkAtRules("custom-variant", (rule) => {
|
|
2131
|
+
if (!isEmptyCustomVariantBlock(rule)) return;
|
|
2132
|
+
rule.remove();
|
|
2133
|
+
changed = true;
|
|
2134
|
+
});
|
|
2135
|
+
return changed ? root.toString() : css;
|
|
2136
|
+
} catch {
|
|
2137
|
+
return css;
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
function filterApplyOnlyGeneratedCss(css, source, options = {}) {
|
|
2141
|
+
const selectors = collectApplyOnlySourceSelectors(source);
|
|
2142
|
+
if (selectors.size === 0) return css;
|
|
2143
|
+
const selectorList = [...selectors];
|
|
2144
|
+
const preserveVariables = options.preserveVariables !== false;
|
|
1726
2145
|
try {
|
|
1727
|
-
const root = postcss.parse(
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
...options,
|
|
1738
|
-
ignoreLayer
|
|
1739
|
-
})) found = true;
|
|
1740
|
-
if (node.type === "atrule" && node.name === "config") {
|
|
1741
|
-
const configPath = parseConfigRequest(node.params);
|
|
1742
|
-
if (configPath && !config) {
|
|
1743
|
-
configRequest = configPath;
|
|
1744
|
-
config = resolveConfigPath(base, configPath);
|
|
1745
|
-
}
|
|
1746
|
-
if (removeConfig) {
|
|
1747
|
-
node.remove();
|
|
1748
|
-
removedConfig = true;
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
});
|
|
1752
|
-
if (!found) return;
|
|
1753
|
-
if (hasPreprocessorOnlySyntax(rawSource)) {
|
|
1754
|
-
const css = extractTailwindSourceForPostcssFallback(rawSource, {
|
|
1755
|
-
...options,
|
|
1756
|
-
removeConfig
|
|
2146
|
+
const root = postcss.parse(css);
|
|
2147
|
+
root.walkRules((rule) => {
|
|
2148
|
+
const isApplySelector = (rule.selectors ?? [rule.selector]).some((selector) => {
|
|
2149
|
+
const normalized = normalizeGeneratedSelector(selector);
|
|
2150
|
+
return selectorList.some((sourceSelector) => {
|
|
2151
|
+
if (normalized === sourceSelector) return true;
|
|
2152
|
+
if (!normalized.startsWith(sourceSelector)) return false;
|
|
2153
|
+
const next = normalized[sourceSelector.length];
|
|
2154
|
+
return next === ":" || next === "[" || next === ".";
|
|
2155
|
+
});
|
|
1757
2156
|
});
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
return
|
|
1766
|
-
css: removedConfig || normalizedImports ? root.toString() : rawSource,
|
|
1767
|
-
config,
|
|
1768
|
-
configRequest,
|
|
1769
|
-
base
|
|
1770
|
-
};
|
|
2157
|
+
const isVariableRule = rule.nodes?.some((node) => node.type === "decl" && node.prop.startsWith("--"));
|
|
2158
|
+
if (!isApplySelector && (!preserveVariables || !isVariableRule)) rule.remove();
|
|
2159
|
+
});
|
|
2160
|
+
root.walkAtRules((rule) => {
|
|
2161
|
+
if (rule.nodes !== void 0 && rule.nodes.length === 0) rule.remove();
|
|
2162
|
+
});
|
|
2163
|
+
const filteredCss = root.toString();
|
|
2164
|
+
return removeCssComments(options.preferScopedRules ? preferScopedGeneratedCssRules(filteredCss) : filteredCss).trim();
|
|
1771
2165
|
} catch {
|
|
1772
|
-
|
|
1773
|
-
const configRequest = extractConfigRequestFromSource(rawSource);
|
|
1774
|
-
const config = configRequest ? resolveConfigPath(base, configRequest) : void 0;
|
|
1775
|
-
return css ? {
|
|
1776
|
-
css,
|
|
1777
|
-
config,
|
|
1778
|
-
configRequest,
|
|
1779
|
-
base
|
|
1780
|
-
} : void 0;
|
|
2166
|
+
return css;
|
|
1781
2167
|
}
|
|
1782
2168
|
}
|
|
2169
|
+
function shouldFilterApplyOnlyGeneratedCss(_majorVersion, target, source, options) {
|
|
2170
|
+
return (target === "weapp" || target === "web") && hasTailwindApplyDirective(source) && !hasTailwindRootDirectives(source) && !options.hasGeneratedCss && !options.hasGeneratedMarkers && collectApplyOnlySourceSelectors(source).size > 0 && hasOnlyApplyBackedSourceRules(source);
|
|
2171
|
+
}
|
|
1783
2172
|
//#endregion
|
|
1784
|
-
//#region src/bundlers/shared/generator-css/user-css.ts
|
|
2173
|
+
//#region src/bundlers/shared/generator-css/user-css/generated-cleanup.ts
|
|
1785
2174
|
const TAILWIND_V4_GENERATOR_AT_RULES = /* @__PURE__ */ new Set([
|
|
1786
2175
|
"config",
|
|
1787
2176
|
"custom-variant",
|
|
@@ -1885,6 +2274,8 @@ function removeTailwindV4GeneratedUserCssArtifacts(source) {
|
|
|
1885
2274
|
return source;
|
|
1886
2275
|
}
|
|
1887
2276
|
}
|
|
2277
|
+
//#endregion
|
|
2278
|
+
//#region src/bundlers/shared/generator-css/user-css/at-rules.ts
|
|
1888
2279
|
function removeTailwindSourceMediaBlocks(source) {
|
|
1889
2280
|
let next = source;
|
|
1890
2281
|
let changed = false;
|
|
@@ -2041,6 +2432,8 @@ function removeTailwindApplyAtRules(source) {
|
|
|
2041
2432
|
return source;
|
|
2042
2433
|
}
|
|
2043
2434
|
}
|
|
2435
|
+
//#endregion
|
|
2436
|
+
//#region src/bundlers/shared/generator-css/user-css/source-fragments.ts
|
|
2044
2437
|
function removeTailwindV4GeneratorAtRules(source) {
|
|
2045
2438
|
try {
|
|
2046
2439
|
const root = postcss.parse(source);
|
|
@@ -2162,168 +2555,8 @@ function stripUnmatchedTailwindSourceMediaCloseFragments(source) {
|
|
|
2162
2555
|
return stripLeadingTailwindSourceMediaCloseFragment(source).replace(/\s*\}\s*$/, "");
|
|
2163
2556
|
}
|
|
2164
2557
|
}
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
layer: "",
|
|
2168
|
-
rest: source
|
|
2169
|
-
};
|
|
2170
|
-
try {
|
|
2171
|
-
const root = postcss.parse(source);
|
|
2172
|
-
const layerRoot = postcss.root();
|
|
2173
|
-
const restRoot = postcss.root();
|
|
2174
|
-
for (const node of root.nodes) (node.type === "atrule" && node.name === "layer" && node.nodes?.length ? layerRoot : restRoot).append(node.clone());
|
|
2175
|
-
return {
|
|
2176
|
-
layer: layerRoot.toString(),
|
|
2177
|
-
rest: restRoot.toString()
|
|
2178
|
-
};
|
|
2179
|
-
} catch {
|
|
2180
|
-
return {
|
|
2181
|
-
layer: source,
|
|
2182
|
-
rest: ""
|
|
2183
|
-
};
|
|
2184
|
-
}
|
|
2185
|
-
}
|
|
2186
|
-
function hasUserCssLayerBlocks(source) {
|
|
2187
|
-
if (!source.includes("@layer")) return false;
|
|
2188
|
-
try {
|
|
2189
|
-
let hasLayerBlock = false;
|
|
2190
|
-
postcss.parse(source).walkAtRules("layer", (node) => {
|
|
2191
|
-
if (node.nodes?.length) hasLayerBlock = true;
|
|
2192
|
-
});
|
|
2193
|
-
return hasLayerBlock;
|
|
2194
|
-
} catch {
|
|
2195
|
-
return true;
|
|
2196
|
-
}
|
|
2197
|
-
}
|
|
2198
|
-
function collectUserLayerSelectors(source) {
|
|
2199
|
-
const selectors = /* @__PURE__ */ new Set();
|
|
2200
|
-
try {
|
|
2201
|
-
postcss.parse(source).walkRules((rule) => {
|
|
2202
|
-
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
2203
|
-
const normalized = selector.trim();
|
|
2204
|
-
if (normalized) selectors.add(normalized);
|
|
2205
|
-
}
|
|
2206
|
-
});
|
|
2207
|
-
} catch {}
|
|
2208
|
-
return selectors;
|
|
2209
|
-
}
|
|
2210
|
-
function matchesUserLayerSelector(selector, userLayerSelector) {
|
|
2211
|
-
if (selector === userLayerSelector) return true;
|
|
2212
|
-
if (!selector.startsWith(userLayerSelector)) return false;
|
|
2213
|
-
const next = selector[userLayerSelector.length];
|
|
2214
|
-
return next === ":" || next === "[";
|
|
2215
|
-
}
|
|
2216
|
-
function extractGeneratedCssForUserLayerSelectors(css, userLayerSource) {
|
|
2217
|
-
const selectors = collectUserLayerSelectors(userLayerSource);
|
|
2218
|
-
if (selectors.size === 0) return {
|
|
2219
|
-
layer: "",
|
|
2220
|
-
rest: css
|
|
2221
|
-
};
|
|
2222
|
-
try {
|
|
2223
|
-
const root = postcss.parse(css);
|
|
2224
|
-
const layerRoot = postcss.root();
|
|
2225
|
-
const selectorList = [...selectors];
|
|
2226
|
-
root.walkRules((rule) => {
|
|
2227
|
-
if ((rule.selectors ?? [rule.selector]).some((selector) => selectorList.some((userSelector) => matchesUserLayerSelector(selector.trim(), userSelector)))) {
|
|
2228
|
-
layerRoot.append(rule.clone());
|
|
2229
|
-
rule.remove();
|
|
2230
|
-
}
|
|
2231
|
-
});
|
|
2232
|
-
return {
|
|
2233
|
-
layer: layerRoot.toString(),
|
|
2234
|
-
rest: root.toString()
|
|
2235
|
-
};
|
|
2236
|
-
} catch {
|
|
2237
|
-
return {
|
|
2238
|
-
layer: "",
|
|
2239
|
-
rest: css
|
|
2240
|
-
};
|
|
2241
|
-
}
|
|
2242
|
-
}
|
|
2243
|
-
function normalizeGeneratedSelector(selector) {
|
|
2244
|
-
return selector.replace(/:not\(#\\#\)/g, "").trim();
|
|
2245
|
-
}
|
|
2246
|
-
function collectApplyOnlySourceSelectors(source) {
|
|
2247
|
-
const selectors = /* @__PURE__ */ new Set();
|
|
2248
|
-
try {
|
|
2249
|
-
postcss.parse(source).walkRules((rule) => {
|
|
2250
|
-
if (!rule.nodes?.some((node) => node.type === "atrule" && node.name === "apply")) return;
|
|
2251
|
-
for (const selector of rule.selectors ?? [rule.selector]) {
|
|
2252
|
-
const normalized = normalizeGeneratedSelector(selector);
|
|
2253
|
-
if (normalized) selectors.add(normalized);
|
|
2254
|
-
}
|
|
2255
|
-
});
|
|
2256
|
-
} catch {}
|
|
2257
|
-
return selectors;
|
|
2258
|
-
}
|
|
2259
|
-
function hasOnlyApplyBackedSourceRules(source) {
|
|
2260
|
-
let hasApplyRule = false;
|
|
2261
|
-
let hasNonApplyRule = false;
|
|
2262
|
-
try {
|
|
2263
|
-
postcss.parse(source).walkRules((rule) => {
|
|
2264
|
-
if (rule.nodes?.some((node) => node.type === "atrule" && node.name === "apply")) hasApplyRule = true;
|
|
2265
|
-
else hasNonApplyRule = true;
|
|
2266
|
-
});
|
|
2267
|
-
} catch {
|
|
2268
|
-
return false;
|
|
2269
|
-
}
|
|
2270
|
-
return hasApplyRule && !hasNonApplyRule;
|
|
2271
|
-
}
|
|
2272
|
-
function removeCssComments(css) {
|
|
2273
|
-
return css.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
2274
|
-
}
|
|
2275
|
-
function isEmptyCustomVariantBlock(rule) {
|
|
2276
|
-
if (rule.name !== "custom-variant") return false;
|
|
2277
|
-
if (!/^[\w-]+$/.test(rule.params.trim())) return false;
|
|
2278
|
-
if (rule.nodes === void 0) return true;
|
|
2279
|
-
return rule.nodes.every((node) => node.type === "comment");
|
|
2280
|
-
}
|
|
2281
|
-
function normalizeEmptyTailwindCustomVariants(css) {
|
|
2282
|
-
if (!css.includes("@custom-variant")) return css;
|
|
2283
|
-
try {
|
|
2284
|
-
const root = postcss.parse(css);
|
|
2285
|
-
let changed = false;
|
|
2286
|
-
root.walkAtRules("custom-variant", (rule) => {
|
|
2287
|
-
if (!isEmptyCustomVariantBlock(rule)) return;
|
|
2288
|
-
rule.remove();
|
|
2289
|
-
changed = true;
|
|
2290
|
-
});
|
|
2291
|
-
return changed ? root.toString() : css;
|
|
2292
|
-
} catch {
|
|
2293
|
-
return css;
|
|
2294
|
-
}
|
|
2295
|
-
}
|
|
2296
|
-
function filterApplyOnlyGeneratedCss(css, source, options = {}) {
|
|
2297
|
-
const selectors = collectApplyOnlySourceSelectors(source);
|
|
2298
|
-
if (selectors.size === 0) return css;
|
|
2299
|
-
const selectorList = [...selectors];
|
|
2300
|
-
const preserveVariables = options.preserveVariables !== false;
|
|
2301
|
-
try {
|
|
2302
|
-
const root = postcss.parse(css);
|
|
2303
|
-
root.walkRules((rule) => {
|
|
2304
|
-
const isApplySelector = (rule.selectors ?? [rule.selector]).some((selector) => {
|
|
2305
|
-
const normalized = normalizeGeneratedSelector(selector);
|
|
2306
|
-
return selectorList.some((sourceSelector) => {
|
|
2307
|
-
if (normalized === sourceSelector) return true;
|
|
2308
|
-
if (!normalized.startsWith(sourceSelector)) return false;
|
|
2309
|
-
const next = normalized[sourceSelector.length];
|
|
2310
|
-
return next === ":" || next === "[" || next === ".";
|
|
2311
|
-
});
|
|
2312
|
-
});
|
|
2313
|
-
const isVariableRule = rule.nodes?.some((node) => node.type === "decl" && node.prop.startsWith("--"));
|
|
2314
|
-
if (!isApplySelector && (!preserveVariables || !isVariableRule)) rule.remove();
|
|
2315
|
-
});
|
|
2316
|
-
root.walkAtRules((rule) => {
|
|
2317
|
-
if (rule.nodes !== void 0 && rule.nodes.length === 0) rule.remove();
|
|
2318
|
-
});
|
|
2319
|
-
return removeCssComments(root.toString()).trim();
|
|
2320
|
-
} catch {
|
|
2321
|
-
return css;
|
|
2322
|
-
}
|
|
2323
|
-
}
|
|
2324
|
-
function shouldFilterApplyOnlyGeneratedCss(_majorVersion, target, source, options) {
|
|
2325
|
-
return (target === "weapp" || target === "web") && hasTailwindApplyDirective(source) && !hasTailwindRootDirectives(source) && !options.hasGeneratedCss && !options.hasGeneratedMarkers && collectApplyOnlySourceSelectors(source).size > 0 && hasOnlyApplyBackedSourceRules(source);
|
|
2326
|
-
}
|
|
2558
|
+
//#endregion
|
|
2559
|
+
//#region src/bundlers/shared/generator-css/user-css/transform.ts
|
|
2327
2560
|
async function transformGeneratorUserCss(source, options) {
|
|
2328
2561
|
if (source.trim().length === 0) return "";
|
|
2329
2562
|
if (options.processed) return stripUnmatchedTailwindSourceMediaCloseFragments(stripTailwindSourceMediaFragments(removeTailwindV4GeneratorAtRules(options.generatorTarget === "weapp" ? removeTailwindV4GeneratedUserCssArtifacts(unwrapMiniProgramCascadeLayers(removeProcessedMiniProgramUnsupportedCss(source, {
|
|
@@ -2564,6 +2797,23 @@ function upsertTailwindV4CssSource(opts, source) {
|
|
|
2564
2797
|
};
|
|
2565
2798
|
return true;
|
|
2566
2799
|
}
|
|
2800
|
+
function removeTailwindV4CssSource(opts, file) {
|
|
2801
|
+
const tailwindcss = opts.tailwindcss;
|
|
2802
|
+
const v4 = tailwindcss?.v4;
|
|
2803
|
+
const cssSources = v4?.cssSources;
|
|
2804
|
+
if (!cssSources || cssSources.length === 0) return false;
|
|
2805
|
+
const sourceFile = normalizeCssSourceFile(file);
|
|
2806
|
+
const nextCssSources = cssSources.filter((source) => normalizeCssSourceFile(source.file) !== sourceFile);
|
|
2807
|
+
if (nextCssSources.length === cssSources.length) return false;
|
|
2808
|
+
opts.tailwindcss = {
|
|
2809
|
+
...tailwindcss,
|
|
2810
|
+
v4: {
|
|
2811
|
+
...v4,
|
|
2812
|
+
cssSources: nextCssSources
|
|
2813
|
+
}
|
|
2814
|
+
};
|
|
2815
|
+
return true;
|
|
2816
|
+
}
|
|
2567
2817
|
//#endregion
|
|
2568
2818
|
//#region src/tailwindcss/v4-engine/source.ts
|
|
2569
2819
|
const require = createRequire(import.meta.url);
|
|
@@ -2939,4 +3189,4 @@ async function createWeappTailwindcssGeneratorFromRuntime(tailwindRuntime) {
|
|
|
2939
3189
|
return createWeappTailwindcssGenerator(await resolveTailwindSourceFromRuntime(tailwindRuntime));
|
|
2940
3190
|
}
|
|
2941
3191
|
//#endregion
|
|
2942
|
-
export {
|
|
3192
|
+
export { hasTailwindSourceDirectives as $, transformGeneratorUserCss as A, toPosixPath as At, stripMiniProgramCssSpecificityPlaceholders as B, findWorkspacePackageDir as C, expandTailwindSourceEntries as Ct, resolveTailwindcssOptions as D, resolveCssSourceEntries as Dt, normalizeTailwindcssRuntimeOptions as E, parseConfigParam as Et, stripUnmatchedTailwindSourceMediaCloseFragments as F, filterUnsupportedMiniProgramTailwindV4Candidates as Ft, extractGeneratedCssForUserLayerSelectors as G, filterApplyOnlyGeneratedCss as H, finalizeMiniProgramCss as I, loadTailwindV4DesignSystem as It, preferScopedGeneratedCssRules as J, hasUserCssLayerBlocks as K, hasMiniProgramCssSpecificityPlaceholders as L, resolveValidTailwindV4Candidates$1 as Lt, removeMiniProgramHoverSelectors as M, transformTailwindV4CssToWeapp as Mt, removeTailwindV4GeneratorAtRules as N, resolveCssMacroTailwindV4Source as Nt, normalizeStringListOption as O, resolveSourceScanPath as Ot, stripTailwindSourceMediaFragments as P, getTailwindV4IncrementalGenerateCacheStats as Pt, hasTailwindRootDirectives as Q, pruneMiniProgramGeneratedCss as R, findNearestPackageRoot as S, createTailwindSourceEntryMatcher as St, normalizeExtendLengthUnits as T, normalizeLegacyContentEntries as Tt, normalizeEmptyTailwindCustomVariants as U, removeTailwindV4GeneratedUserCssArtifacts as V, shouldFilterApplyOnlyGeneratedCss as W, hasTailwindApplyDirective as X, hasLocalCssImport as Y, hasTailwindNonRootGenerationDirectives as Z, upsertTailwindV4CssSource as _, normalizeConfigDirective as _t, resolveGeneratorRuntimeBranch as a, resolveCssEntrySource as at, isTailwindV4CssEntry as b, FULL_SOURCE_SCAN_EXTENSION_RE as bt, shouldUseNativeAppCssBranch as c, createCssAppend as ct, resolveTailwindV4SourceFromRuntime as d, splitGeneratorPlaceholderCssBySourceOrder as dt, normalizeTailwindConfigDirectives as et, resolveTailwindV4SourceFromRuntimeOptions as f, splitTailwindGeneratedCssByBanner as ft, removeTailwindV4CssSource as g, stripTailwindBanners as gt, hasConfiguredTailwindV4CssRoots as h, stripTailwindBanner as ht, normalizeWeappTailwindcssGeneratorOptions as i, removeTailwindSourceDirectives as it, isCommentOnlyCss as j, transformTailwindV4CssByTarget as jt, resolveBooleanObjectOption as k, resolveTailwindV4CssSourceBase as kt, resolveUniUtsPlatform as l, hasTailwindGeneratedCss as lt, filterTailwindV4CssSourceRoots as m, stripGeneratorPlaceholderMarkers as mt, createWeappTailwindcssGeneratorFromRuntime as n, normalizeTailwindSourceForGenerator as nt, resolveRuntimeBranch as o, GENERATOR_PLACEHOLDER_MARKER_RE as ot, resolveTailwindV4SourceOptionsFromRuntime as p, splitTailwindV4GeneratedCssBySourceOrder as pt, splitUserCssLayerBlocks as q, resolveTailwindSourceFromRuntime as r, parseImportRequest as rt, shouldUseMiniProgramCssBranch as s, VITE_MARKER_RE as st, createWeappTailwindcssGenerator as t, normalizeTailwindSourceDirectives as tt, resolveTailwindV4Source$1 as u, hasTailwindGeneratedCssMarkers as ut, groupCssEntriesByBase as v, prependConfigDirective as vt, findWorkspaceRoot as w, isFileMatchedByTailwindSourceEntries as wt, normalizeCssEntries as x, FULL_SOURCE_SCAN_PATTERN as xt, guessBasedirFromEntries as y, createTailwindV4Engine$1 as yt, removeUnsupportedMiniProgramAtRules as z };
|