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,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as omitUndefined } from "./object-
|
|
3
|
-
import { n as defuOverrideArray$1 } from "./utils-MVwpU07P.
|
|
1
|
+
import { C as findWorkspacePackageDir, Ct as expandTailwindSourceEntries, D as resolveTailwindcssOptions, Dt as resolveCssSourceEntries, E as normalizeTailwindcssRuntimeOptions, Et as parseConfigParam, It as loadTailwindV4DesignSystem, Nt as resolveCssMacroTailwindV4Source, O as normalizeStringListOption, S as findNearestPackageRoot, St as createTailwindSourceEntryMatcher, T as normalizeExtendLengthUnits, Tt as normalizeLegacyContentEntries, b as isTailwindV4CssEntry, d as resolveTailwindV4SourceFromRuntime, h as hasConfiguredTailwindV4CssRoots, i as normalizeWeappTailwindcssGeneratorOptions, kt as resolveTailwindV4CssSourceBase, m as filterTailwindV4CssSourceRoots, p as resolveTailwindV4SourceOptionsFromRuntime, v as groupCssEntriesByBase, w as findWorkspaceRoot, x as normalizeCssEntries, xt as FULL_SOURCE_SCAN_PATTERN, y as guessBasedirFromEntries } from "./generator-CDdzqf1S.js";
|
|
2
|
+
import { t as omitUndefined } from "./object-Bvy6-w9r.js";
|
|
3
|
+
import { n as defuOverrideArray$1 } from "./utils-MVwpU07P.js";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
@@ -9,9 +9,9 @@ import { extractProjectCandidatesWithPositions, resolveValidTailwindV4Candidates
|
|
|
9
9
|
import { postcss } from "@weapp-tailwindcss/postcss";
|
|
10
10
|
import { stat } from "node:fs/promises";
|
|
11
11
|
import { defuOverrideArray } from "@weapp-tailwindcss/shared";
|
|
12
|
-
import { logger } from "@weapp-tailwindcss/logger";
|
|
13
12
|
import fg from "fast-glob";
|
|
14
13
|
import { loadConfig } from "tailwindcss-config";
|
|
14
|
+
import { logger } from "@weapp-tailwindcss/logger";
|
|
15
15
|
import { fileURLToPath } from "node:url";
|
|
16
16
|
//#region src/tailwindcss/source-scan/inline-source.ts
|
|
17
17
|
const NUMERICAL_RANGE_RE = /^(-?\d+)\.\.(-?\d+)(?:\.\.(-?\d+))?$/;
|
|
@@ -177,7 +177,7 @@ function includesTailwindV4PreflightDirective(css) {
|
|
|
177
177
|
}
|
|
178
178
|
}
|
|
179
179
|
//#endregion
|
|
180
|
-
//#region src/bundlers/
|
|
180
|
+
//#region src/bundlers/shared/static-config-content.ts
|
|
181
181
|
function skipWhitespaceAndComments(source, start) {
|
|
182
182
|
let index = start;
|
|
183
183
|
while (index < source.length) {
|
|
@@ -347,9 +347,9 @@ function readStaticConfigContent(configPath) {
|
|
|
347
347
|
return parseStaticContentValue(source, contentProperty.start)?.value;
|
|
348
348
|
}
|
|
349
349
|
//#endregion
|
|
350
|
-
//#region src/bundlers/
|
|
351
|
-
const
|
|
352
|
-
const
|
|
350
|
+
//#region src/bundlers/shared/source-scan/css-entries.ts
|
|
351
|
+
const SOURCE_CANDIDATE_PATTERN = FULL_SOURCE_SCAN_PATTERN;
|
|
352
|
+
const TAILWIND_CSS_ENTRY_PATTERN = "**/*.css";
|
|
353
353
|
const tailwindV4CssEntriesCache = /* @__PURE__ */ new Map();
|
|
354
354
|
function parseImportSourceParam(params) {
|
|
355
355
|
const match = /\bsource\(\s*(none|(['"])(.*?)\2)\s*\)/.exec(params);
|
|
@@ -449,7 +449,7 @@ async function resolveTailwindV4EntriesFromCss(css, base) {
|
|
|
449
449
|
let hasSourceNone = false;
|
|
450
450
|
let hasTailwindCssImport = false;
|
|
451
451
|
let includesPreflight = false;
|
|
452
|
-
const [sourceEntries, configEntries] = await Promise.all([resolveCssSourceEntries(root, base,
|
|
452
|
+
const [sourceEntries, configEntries] = await Promise.all([resolveCssSourceEntries(root, base, SOURCE_CANDIDATE_PATTERN), resolveConfigContentEntries(root, base)]);
|
|
453
453
|
const entries = [...configEntries.entries, ...sourceEntries];
|
|
454
454
|
const hasPositiveEntries = entries.some((entry) => !entry.negated);
|
|
455
455
|
const inlineCandidates = collectCssInlineSourceCandidates(root);
|
|
@@ -468,7 +468,7 @@ async function resolveTailwindV4EntriesFromCss(css, base) {
|
|
|
468
468
|
entries: [{
|
|
469
469
|
base: importSourceBase,
|
|
470
470
|
negated: false,
|
|
471
|
-
pattern:
|
|
471
|
+
pattern: SOURCE_CANDIDATE_PATTERN
|
|
472
472
|
}, ...entries],
|
|
473
473
|
explicit: true,
|
|
474
474
|
includesPreflight,
|
|
@@ -504,7 +504,7 @@ async function resolveTailwindV4EntriesFromCss(css, base) {
|
|
|
504
504
|
dependencies: configEntries.dependencies
|
|
505
505
|
} : void 0;
|
|
506
506
|
}
|
|
507
|
-
async function
|
|
507
|
+
async function resolveTailwindV4CssDependencies(css, base) {
|
|
508
508
|
return (await resolveTailwindV4EntriesFromCss(css, base))?.dependencies ?? [];
|
|
509
509
|
}
|
|
510
510
|
function collectExistingCssEntries(options) {
|
|
@@ -546,7 +546,7 @@ async function discoverTailwindV4CssEntries(root, outDir) {
|
|
|
546
546
|
const relativeOutDir = path.relative(resolvedRoot, resolvedOutDir);
|
|
547
547
|
if (relativeOutDir && !relativeOutDir.startsWith("..") && !path.isAbsolute(relativeOutDir)) ignore.push(`${relativeOutDir.split(path.sep).join("/")}/**`);
|
|
548
548
|
}
|
|
549
|
-
const candidates = await fg(
|
|
549
|
+
const candidates = await fg(TAILWIND_CSS_ENTRY_PATTERN, {
|
|
550
550
|
absolute: true,
|
|
551
551
|
cwd: resolvedRoot,
|
|
552
552
|
ignore,
|
|
@@ -569,7 +569,7 @@ function collectConfiguredCssSources(options) {
|
|
|
569
569
|
return filterTailwindV4CssSourceRoots([...options.tailwindcss?.v4?.cssSources ?? [], ...options.tailwindcssRuntimeOptions?.tailwindcss?.v4?.cssSources ?? []]) ?? [];
|
|
570
570
|
}
|
|
571
571
|
//#endregion
|
|
572
|
-
//#region src/bundlers/
|
|
572
|
+
//#region src/bundlers/shared/source-scan/dependencies.ts
|
|
573
573
|
function addSourceScanDependency(dependencies, file) {
|
|
574
574
|
if (typeof file === "string" && file.length > 0) dependencies.add(path.resolve(file));
|
|
575
575
|
}
|
|
@@ -577,8 +577,8 @@ function addSourceScanDependencies(dependencies, files) {
|
|
|
577
577
|
for (const file of files ?? []) addSourceScanDependency(dependencies, file);
|
|
578
578
|
}
|
|
579
579
|
//#endregion
|
|
580
|
-
//#region src/bundlers/
|
|
581
|
-
function
|
|
580
|
+
//#region src/bundlers/shared/source-scan.ts
|
|
581
|
+
function createResolvedSourceScan(input, dependencies) {
|
|
582
582
|
return {
|
|
583
583
|
...input,
|
|
584
584
|
...dependencies.size > 0 ? { dependencies: [...dependencies].sort() } : {}
|
|
@@ -600,7 +600,7 @@ function createResolvedV4CssScanInput(entries, inlineCandidates, explicit) {
|
|
|
600
600
|
inlineCandidates
|
|
601
601
|
};
|
|
602
602
|
}
|
|
603
|
-
async function
|
|
603
|
+
async function resolveSourceScanEntries(options, runtime, scanOptions = {}) {
|
|
604
604
|
const sourceOptions = resolveTailwindV4SourceOptionsFromRuntime(runtime);
|
|
605
605
|
const cssEntries = collectExistingCssEntries(options);
|
|
606
606
|
if (cssEntries.length === 0 && !sourceOptions.css && !sourceOptions.cssSources?.length) {
|
|
@@ -635,14 +635,14 @@ async function resolveViteSourceScanEntries(options, runtime, scanOptions = {})
|
|
|
635
635
|
}
|
|
636
636
|
const inlineCandidates = mergeTailwindInlineSourceCandidates(cssInlineCandidates);
|
|
637
637
|
const scanEntries = createMergedCssEntrySourceScanEntries(entries, { sourceCount: readableCssEntryCount });
|
|
638
|
-
if (scanEntries.length > 0 || inlineCandidates || explicit || readableCssEntryCount > 0) return
|
|
638
|
+
if (scanEntries.length > 0 || inlineCandidates || explicit || readableCssEntryCount > 0) return createResolvedSourceScan({
|
|
639
639
|
entries: resolveExplicitSourceScanEntries(scanEntries, explicit),
|
|
640
640
|
explicit,
|
|
641
641
|
inlineCandidates
|
|
642
642
|
}, dependencies);
|
|
643
643
|
if (typeof sourceOptions.css === "string" && sourceOptions.css.length > 0) {
|
|
644
644
|
const resolved = await resolveTailwindV4EntriesFromCssCached(sourceOptions.css, sourceOptions.base ?? sourceOptions.projectRoot ?? process.cwd());
|
|
645
|
-
return resolved ?
|
|
645
|
+
return resolved ? createResolvedSourceScan(createResolvedV4CssScanInput(resolved.entries, resolved.inlineCandidates, resolved.explicit), new Set(resolved.dependencies)) : void 0;
|
|
646
646
|
}
|
|
647
647
|
const sourceOptionBase = sourceOptions.base ?? sourceOptions.projectRoot ?? process.cwd();
|
|
648
648
|
const configuredCssSources = collectConfiguredCssSources(options);
|
|
@@ -661,7 +661,7 @@ async function resolveViteSourceScanEntries(options, runtime, scanOptions = {})
|
|
|
661
661
|
const cssSourceInlineCandidates = mergeTailwindInlineSourceCandidates(cssInlineCandidates);
|
|
662
662
|
const cssSourceCount = (sourceOptions.cssSources?.length ?? 0) + configuredCssSources.length;
|
|
663
663
|
const cssSourceScanEntries = createMergedCssEntrySourceScanEntries(entries, { sourceCount: cssSourceCount });
|
|
664
|
-
if (cssSourceScanEntries.length > 0 || cssSourceInlineCandidates || explicit) return
|
|
664
|
+
if (cssSourceScanEntries.length > 0 || cssSourceInlineCandidates || explicit) return createResolvedSourceScan({
|
|
665
665
|
entries: resolveExplicitSourceScanEntries(cssSourceScanEntries, explicit),
|
|
666
666
|
explicit,
|
|
667
667
|
inlineCandidates: cssSourceInlineCandidates
|
|
@@ -671,9 +671,9 @@ async function resolveViteSourceScanEntries(options, runtime, scanOptions = {})
|
|
|
671
671
|
addSourceScanDependency(dependencies, source.file);
|
|
672
672
|
addSourceScanDependencies(dependencies, source.dependencies);
|
|
673
673
|
const resolved = await resolveTailwindV4EntriesFromCssCached(source.css, source.base);
|
|
674
|
-
return resolved ?
|
|
674
|
+
return resolved ? createResolvedSourceScan(createResolvedV4CssScanInput(resolved.entries.length > 0 ? resolved.entries : [], resolved.inlineCandidates, resolved.entries.length > 0 ? resolved.explicit : false), /* @__PURE__ */ new Set([...dependencies, ...resolved.dependencies])) : void 0;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function createSourceScanMatcher(entries) {
|
|
677
677
|
if (entries?.length === 0) return () => false;
|
|
678
678
|
return createTailwindSourceEntryMatcher(entries);
|
|
679
679
|
}
|
|
@@ -892,7 +892,7 @@ function warnMissingCssEntries(ctx, tailwindRuntime) {
|
|
|
892
892
|
logger.warn("[tailwindcss@4] 未检测到 cssEntries 配置。请传入包含 tailwindcss 引用的 CSS 绝对路径,例如 cssEntries: [\"/absolute/path/to/src/app.css\"],否则 tailwindcss 生成的类名不会参与转译。");
|
|
893
893
|
}
|
|
894
894
|
function applyV4CssCalcDefaults(cssCalc, tailwindRuntime) {
|
|
895
|
-
const cssCalcOptions = cssCalc ??
|
|
895
|
+
const cssCalcOptions = cssCalc ?? false;
|
|
896
896
|
if (tailwindRuntime && cssCalcOptions) return ensureDefaultsIncluded(cssCalcOptions);
|
|
897
897
|
return cssCalcOptions;
|
|
898
898
|
}
|
|
@@ -1605,4 +1605,4 @@ function createTailwindcssRuntimeFromContext(ctx) {
|
|
|
1605
1605
|
return createTailwindcssRuntimeForBase(resolvedTailwindcssBasedir, normalizedCssEntries ?? rawCssEntries, runtimeOptions);
|
|
1606
1606
|
}
|
|
1607
1607
|
//#endregion
|
|
1608
|
-
export {
|
|
1608
|
+
export { resolveTailwindV4EntriesFromCssCached as _, findTailwindConfig as a, getRuntimeClassSetCacheEntry as c, invalidateRuntimeClassSet as d, createSourceScanMatcher as f, resolveTailwindV4EntriesFromCss as g, resolveTailwindV4CssDependencies as h, resolveUniAppXOptions as i, getRuntimeClassSetSignature as l, discoverTailwindV4CssEntries as m, resolveTailwindcssBasedir as n, applyV4CssCalcDefaults as o, resolveSourceScanEntries as p, isUniAppXEnabled as r, warnMissingCssEntries as s, createTailwindcssRuntimeFromContext as t, getRuntimeClassSetSignatureWithSources as u, includesTailwindV4PreflightDirective as v, collectCssInlineSourceCandidates as y };
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
const require_object = require("./object-C_Vr6_S5.cjs");
|
|
2
|
+
const require_wxml = require("./wxml-DSMNuUaP.cjs");
|
|
3
|
+
let _tailwindcss_mangle_engine = require("@tailwindcss-mangle/engine");
|
|
4
|
+
let _vue_compiler_dom = require("@vue/compiler-dom");
|
|
5
|
+
//#region src/uni-app-x/component-local-style.ts
|
|
6
|
+
const EXPRESSION_WRAPPER_PREFIX = "(\n";
|
|
7
|
+
const EXPRESSION_WRAPPER_SUFFIX = "\n)";
|
|
8
|
+
const COMPONENT_RE = /(?:^|[/\\])components(?:[/\\].+)?\.(?:uvue|nvue)$/;
|
|
9
|
+
const PAGE_RE = /(?:^|[/\\])pages(?:[/\\].+)?\.(?:uvue|nvue)$/;
|
|
10
|
+
function createStableHash(input) {
|
|
11
|
+
let hash = 2166136261;
|
|
12
|
+
for (let i = 0; i < input.length; i++) {
|
|
13
|
+
hash ^= input.charCodeAt(i);
|
|
14
|
+
hash = Math.imul(hash, 16777619);
|
|
15
|
+
}
|
|
16
|
+
return (hash >>> 0).toString(36);
|
|
17
|
+
}
|
|
18
|
+
function extractLiteralValue(path) {
|
|
19
|
+
if (path.isStringLiteral()) return {
|
|
20
|
+
literal: path.node.value,
|
|
21
|
+
offset: 1
|
|
22
|
+
};
|
|
23
|
+
return {
|
|
24
|
+
literal: typeof path.node.value === "string" ? path.node.value : path.node.value.raw,
|
|
25
|
+
offset: 0
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function createAlias(fileId, utility, index) {
|
|
29
|
+
return `wtu-${createStableHash(`${fileId}:${utility}`)}-${index.toString(36)}`;
|
|
30
|
+
}
|
|
31
|
+
function isRuntimeCandidate(candidate, runtimeSet) {
|
|
32
|
+
if (!runtimeSet || runtimeSet.size === 0) return false;
|
|
33
|
+
return runtimeSet.has(candidate) || runtimeSet.has(require_wxml.replaceWxml(candidate));
|
|
34
|
+
}
|
|
35
|
+
function hasTopLevelVariant(candidate) {
|
|
36
|
+
let bracketDepth = 0;
|
|
37
|
+
let parenthesisDepth = 0;
|
|
38
|
+
let quote = "";
|
|
39
|
+
let escaped = false;
|
|
40
|
+
for (const char of candidate) {
|
|
41
|
+
if (escaped) {
|
|
42
|
+
escaped = false;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (char === "\\") {
|
|
46
|
+
escaped = true;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (quote) {
|
|
50
|
+
if (char === quote) quote = "";
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (char === "\"" || char === "'") {
|
|
54
|
+
quote = char;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (char === "[") {
|
|
58
|
+
bracketDepth += 1;
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
if (char === "]") {
|
|
62
|
+
bracketDepth = Math.max(0, bracketDepth - 1);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (char === "(") {
|
|
66
|
+
parenthesisDepth += 1;
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
if (char === ")") {
|
|
70
|
+
parenthesisDepth = Math.max(0, parenthesisDepth - 1);
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (char === ":" && bracketDepth === 0 && parenthesisDepth === 0) return true;
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
function shouldEnableComponentLocalStyle(id) {
|
|
78
|
+
return COMPONENT_RE.test(id);
|
|
79
|
+
}
|
|
80
|
+
function shouldEnablePageLocalStyle(id) {
|
|
81
|
+
return PAGE_RE.test(id);
|
|
82
|
+
}
|
|
83
|
+
var UniAppXComponentLocalStyleCollector = class {
|
|
84
|
+
constructor(fileId, runtimeSet) {
|
|
85
|
+
this.fileId = fileId;
|
|
86
|
+
this.runtimeSet = runtimeSet;
|
|
87
|
+
require_object._defineProperty(this, "aliasByUtility", /* @__PURE__ */ new Map());
|
|
88
|
+
require_object._defineProperty(this, "aliasByLookup", /* @__PURE__ */ new Map());
|
|
89
|
+
}
|
|
90
|
+
ensureAlias(utility) {
|
|
91
|
+
const cached = this.aliasByUtility.get(utility);
|
|
92
|
+
if (cached) return cached;
|
|
93
|
+
const alias = createAlias(this.fileId, utility, this.aliasByUtility.size);
|
|
94
|
+
this.aliasByUtility.set(utility, alias);
|
|
95
|
+
this.aliasByLookup.set(utility, alias);
|
|
96
|
+
this.aliasByLookup.set(require_wxml.replaceWxml(utility), alias);
|
|
97
|
+
return alias;
|
|
98
|
+
}
|
|
99
|
+
rewriteLiteral(literal) {
|
|
100
|
+
const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
|
|
101
|
+
if (candidates.length === 0) return literal;
|
|
102
|
+
let rewritten = literal;
|
|
103
|
+
for (const candidate of candidates) {
|
|
104
|
+
if (!isRuntimeCandidate(candidate, this.runtimeSet)) continue;
|
|
105
|
+
rewritten = rewritten.replace(candidate, hasTopLevelVariant(candidate) ? require_wxml.replaceWxml(candidate) : this.ensureAlias(candidate));
|
|
106
|
+
}
|
|
107
|
+
return rewritten;
|
|
108
|
+
}
|
|
109
|
+
collectAndRewriteStaticClass(literal) {
|
|
110
|
+
return this.rewriteLiteral(literal);
|
|
111
|
+
}
|
|
112
|
+
collectRuntimeClasses(rawSource, options = {}) {
|
|
113
|
+
const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
|
|
114
|
+
try {
|
|
115
|
+
const analysis = require_wxml.analyzeSource(require_wxml.babelParse(wrapped, {
|
|
116
|
+
plugins: ["typescript"],
|
|
117
|
+
sourceType: options.wrapExpression ? "module" : "unambiguous"
|
|
118
|
+
}), {}, void 0, false);
|
|
119
|
+
for (const path of analysis.targetPaths) {
|
|
120
|
+
const { literal } = extractLiteralValue(path);
|
|
121
|
+
const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
|
|
122
|
+
const classContext = options.wrapExpression || require_wxml.isClassContextLiteralPath(path);
|
|
123
|
+
for (const candidate of candidates) {
|
|
124
|
+
if (!candidate || !classContext && !isRuntimeCandidate(candidate, this.runtimeSet)) continue;
|
|
125
|
+
if (isRuntimeCandidate(candidate, this.runtimeSet) && !hasTopLevelVariant(candidate)) this.ensureAlias(candidate);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
} catch {}
|
|
129
|
+
}
|
|
130
|
+
rewriteTransformedCode(rawSource, options = {}) {
|
|
131
|
+
if (this.aliasByLookup.size === 0) return rawSource;
|
|
132
|
+
const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
|
|
133
|
+
try {
|
|
134
|
+
const analysis = require_wxml.analyzeSource(require_wxml.babelParse(wrapped, {
|
|
135
|
+
plugins: ["typescript"],
|
|
136
|
+
sourceType: options.wrapExpression ? "module" : "unambiguous"
|
|
137
|
+
}), {}, void 0, false);
|
|
138
|
+
if (analysis.targetPaths.length === 0) return rawSource;
|
|
139
|
+
const updater = new require_wxml.JsTokenUpdater();
|
|
140
|
+
for (const path of analysis.targetPaths) {
|
|
141
|
+
const { literal, offset } = extractLiteralValue(path);
|
|
142
|
+
const candidates = (0, _tailwindcss_mangle_engine.splitCandidateTokens)(literal);
|
|
143
|
+
if (candidates.length === 0) continue;
|
|
144
|
+
let rewritten = literal;
|
|
145
|
+
let mutated = false;
|
|
146
|
+
for (const candidate of candidates) {
|
|
147
|
+
const alias = this.aliasByLookup.get(candidate);
|
|
148
|
+
if (!alias) continue;
|
|
149
|
+
const replaced = rewritten.replace(candidate, alias);
|
|
150
|
+
if (replaced !== rewritten) {
|
|
151
|
+
rewritten = replaced;
|
|
152
|
+
mutated = true;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (!mutated || typeof path.node.start !== "number" || typeof path.node.end !== "number") continue;
|
|
156
|
+
updater.addToken({
|
|
157
|
+
start: path.node.start + offset,
|
|
158
|
+
end: path.node.end - offset,
|
|
159
|
+
value: rewritten,
|
|
160
|
+
path
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (updater.length === 0) return rawSource;
|
|
164
|
+
const ms = new require_wxml.MagicString(wrapped);
|
|
165
|
+
updater.updateMagicString(ms);
|
|
166
|
+
if (options.wrapExpression) {
|
|
167
|
+
ms.remove(0, 2);
|
|
168
|
+
ms.remove(wrapped.length - 2, wrapped.length);
|
|
169
|
+
}
|
|
170
|
+
return ms.toString();
|
|
171
|
+
} catch {
|
|
172
|
+
return rawSource;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
hasStyles() {
|
|
176
|
+
return this.aliasByUtility.size > 0;
|
|
177
|
+
}
|
|
178
|
+
toStyleBlock() {
|
|
179
|
+
if (!this.hasStyles()) return "";
|
|
180
|
+
const lines = ["<style scoped>"];
|
|
181
|
+
for (const [utility, alias] of this.aliasByUtility) {
|
|
182
|
+
lines.push(`.${alias} {`);
|
|
183
|
+
lines.push(` @apply ${utility};`);
|
|
184
|
+
lines.push("}");
|
|
185
|
+
}
|
|
186
|
+
lines.push("</style>");
|
|
187
|
+
return `${lines.join("\n")}\n`;
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region src/uni-app-x/transform.ts
|
|
192
|
+
function traverse(node, visitor) {
|
|
193
|
+
visitor(node);
|
|
194
|
+
if (Array.isArray(node.children)) {
|
|
195
|
+
for (const child of node.children) if (child && typeof child === "object" && "type" in child) traverse(child, visitor);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
function updateStaticAttribute(ms, prop, offset, content = prop.value?.content) {
|
|
199
|
+
if (!prop.value) return;
|
|
200
|
+
const start = offset + prop.value.loc.start.offset + 1;
|
|
201
|
+
const end = offset + prop.value.loc.end.offset - 1;
|
|
202
|
+
if (start < end) ms.update(start, end, require_wxml.replaceWxml(content ?? ""));
|
|
203
|
+
}
|
|
204
|
+
function updateStaticAttributeWithLocalStyle(ms, prop, offset, collector, content = prop.value?.content) {
|
|
205
|
+
if (!prop.value) return;
|
|
206
|
+
const start = offset + prop.value.loc.start.offset + 1;
|
|
207
|
+
const end = offset + prop.value.loc.end.offset - 1;
|
|
208
|
+
if (start < end) ms.update(start, end, collector.collectAndRewriteStaticClass(content ?? ""));
|
|
209
|
+
}
|
|
210
|
+
function updateDirectiveExpression(ms, prop, offset, jsHandler, runtimeSet) {
|
|
211
|
+
if (prop.exp?.type !== _vue_compiler_dom.NodeTypes.SIMPLE_EXPRESSION) return;
|
|
212
|
+
const expression = prop.exp.content;
|
|
213
|
+
const start = offset + prop.exp.loc.start.offset;
|
|
214
|
+
const end = offset + prop.exp.loc.end.offset;
|
|
215
|
+
if (start >= end) return;
|
|
216
|
+
const generated = require_wxml.generateCode(expression, {
|
|
217
|
+
jsHandler,
|
|
218
|
+
runtimeSet,
|
|
219
|
+
wrapExpression: true
|
|
220
|
+
});
|
|
221
|
+
ms.update(start, end, generated);
|
|
222
|
+
}
|
|
223
|
+
function updateDirectiveExpressionWithLocalStyle(ms, prop, offset, jsHandler, collector, runtimeSet) {
|
|
224
|
+
if (prop.exp?.type !== _vue_compiler_dom.NodeTypes.SIMPLE_EXPRESSION) return;
|
|
225
|
+
const expression = prop.exp.content;
|
|
226
|
+
const start = offset + prop.exp.loc.start.offset;
|
|
227
|
+
const end = offset + prop.exp.loc.end.offset;
|
|
228
|
+
if (start >= end) return;
|
|
229
|
+
collector.collectRuntimeClasses(expression, { wrapExpression: true });
|
|
230
|
+
const generated = require_wxml.generateCode(expression, {
|
|
231
|
+
jsHandler,
|
|
232
|
+
runtimeSet,
|
|
233
|
+
wrapExpression: true
|
|
234
|
+
});
|
|
235
|
+
ms.update(start, end, collector.rewriteTransformedCode(generated, { wrapExpression: true }));
|
|
236
|
+
}
|
|
237
|
+
function shouldEnableLocalStyle(id, options) {
|
|
238
|
+
if (options.enableComponentLocalStyle && shouldEnableComponentLocalStyle(id)) return true;
|
|
239
|
+
if (options.enablePageLocalStyle && shouldEnablePageLocalStyle(id)) return true;
|
|
240
|
+
return false;
|
|
241
|
+
}
|
|
242
|
+
function shouldHandleAttribute(tag, attrName, disabledDefaultTemplateHandler, matchCustomAttribute) {
|
|
243
|
+
const lowerName = attrName.toLowerCase();
|
|
244
|
+
const shouldHandleDefault = !disabledDefaultTemplateHandler && lowerName === "class";
|
|
245
|
+
const shouldHandleCustom = matchCustomAttribute?.(tag, attrName) ?? false;
|
|
246
|
+
return {
|
|
247
|
+
shouldHandleDefault,
|
|
248
|
+
shouldHandleCustom,
|
|
249
|
+
shouldHandle: shouldHandleDefault || shouldHandleCustom
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const defaultCreateJsHandlerOptions = { babelParserOptions: { plugins: ["typescript"] } };
|
|
253
|
+
const UVUE_NVUE_RE = /\.(?:uvue|nvue)(?:\?.*)?$/;
|
|
254
|
+
const SFC_BLOCK_RE = /<(template|script)\b([^>]*)>([\s\S]*?)<\/\1>/gi;
|
|
255
|
+
const SCRIPT_SETUP_RE = /(?:^|\s)setup(?:\s|=|$)/;
|
|
256
|
+
function parseSfc(code) {
|
|
257
|
+
const descriptor = { errors: [] };
|
|
258
|
+
for (const match of code.matchAll(SFC_BLOCK_RE)) {
|
|
259
|
+
const type = match[1];
|
|
260
|
+
const attrs = match[2] ?? "";
|
|
261
|
+
const content = match[3] ?? "";
|
|
262
|
+
const full = match[0];
|
|
263
|
+
const contentStart = (match.index ?? 0) + full.indexOf(">") + 1;
|
|
264
|
+
const block = {
|
|
265
|
+
content,
|
|
266
|
+
start: contentStart,
|
|
267
|
+
end: contentStart + content.length,
|
|
268
|
+
attrs
|
|
269
|
+
};
|
|
270
|
+
if (type === "template" && !descriptor.template) {
|
|
271
|
+
try {
|
|
272
|
+
descriptor.template = {
|
|
273
|
+
...block,
|
|
274
|
+
ast: (0, _vue_compiler_dom.parse)(content)
|
|
275
|
+
};
|
|
276
|
+
} catch (error) {
|
|
277
|
+
descriptor.errors.push(error);
|
|
278
|
+
descriptor.template = block;
|
|
279
|
+
}
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
if (type === "script") if (SCRIPT_SETUP_RE.test(attrs)) descriptor.scriptSetup ?? (descriptor.scriptSetup = block);
|
|
283
|
+
else descriptor.script ?? (descriptor.script = block);
|
|
284
|
+
}
|
|
285
|
+
return descriptor;
|
|
286
|
+
}
|
|
287
|
+
function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
288
|
+
if (!UVUE_NVUE_RE.test(id)) return;
|
|
289
|
+
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
290
|
+
const matchCustomAttribute = require_wxml.createAttributeMatcher(customAttributesEntities);
|
|
291
|
+
const ms = new require_wxml.MagicString(code);
|
|
292
|
+
const descriptor = parseSfc(code);
|
|
293
|
+
const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
|
|
294
|
+
if (descriptor.errors.length === 0) {
|
|
295
|
+
if (descriptor.template?.ast) {
|
|
296
|
+
const templateOffset = descriptor.template.start;
|
|
297
|
+
traverse(descriptor.template.ast, (node) => {
|
|
298
|
+
if (node.type !== _vue_compiler_dom.NodeTypes.ELEMENT) return;
|
|
299
|
+
const tag = node.tag;
|
|
300
|
+
for (const prop of node.props) if (prop.type === _vue_compiler_dom.NodeTypes.ATTRIBUTE) {
|
|
301
|
+
const { shouldHandle, shouldHandleDefault } = shouldHandleAttribute(tag, prop.name, disabledDefaultTemplateHandler, matchCustomAttribute);
|
|
302
|
+
if (!shouldHandle) continue;
|
|
303
|
+
if (shouldHandleDefault && localStyleCollector) updateStaticAttributeWithLocalStyle(ms, prop, templateOffset, localStyleCollector);
|
|
304
|
+
else updateStaticAttribute(ms, prop, templateOffset);
|
|
305
|
+
if (shouldHandleDefault) continue;
|
|
306
|
+
} else if (prop.type === _vue_compiler_dom.NodeTypes.DIRECTIVE && prop.name === "bind" && prop.arg?.type === _vue_compiler_dom.NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic) {
|
|
307
|
+
const attrName = prop.arg.content;
|
|
308
|
+
const { shouldHandle } = shouldHandleAttribute(tag, attrName, disabledDefaultTemplateHandler, matchCustomAttribute);
|
|
309
|
+
if (!shouldHandle) continue;
|
|
310
|
+
if (attrName.toLowerCase() === "class" && localStyleCollector) updateDirectiveExpressionWithLocalStyle(ms, prop, templateOffset, jsHandler, localStyleCollector, runtimeSet);
|
|
311
|
+
else updateDirectiveExpression(ms, prop, templateOffset, jsHandler, runtimeSet);
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
if (descriptor.script) {
|
|
316
|
+
localStyleCollector?.collectRuntimeClasses(descriptor.script.content);
|
|
317
|
+
const { code } = jsHandler(descriptor.script.content, runtimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
318
|
+
ms.update(descriptor.script.start, descriptor.script.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
319
|
+
}
|
|
320
|
+
if (descriptor.scriptSetup) {
|
|
321
|
+
localStyleCollector?.collectRuntimeClasses(descriptor.scriptSetup.content);
|
|
322
|
+
const { code } = jsHandler(descriptor.scriptSetup.content, runtimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
323
|
+
ms.update(descriptor.scriptSetup.start, descriptor.scriptSetup.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
324
|
+
}
|
|
325
|
+
if (localStyleCollector?.hasStyles()) ms.append(`\n${localStyleCollector.toStyleBlock()}`);
|
|
326
|
+
}
|
|
327
|
+
const result = {
|
|
328
|
+
code: ms.toString(),
|
|
329
|
+
map: null
|
|
330
|
+
};
|
|
331
|
+
Object.defineProperty(result, "map", {
|
|
332
|
+
configurable: true,
|
|
333
|
+
enumerable: true,
|
|
334
|
+
get() {
|
|
335
|
+
return ms.generateMap();
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
return result;
|
|
339
|
+
}
|
|
340
|
+
//#endregion
|
|
341
|
+
exports.transformUVue = transformUVue;
|