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
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import { n as _defineProperty } from "./object-Bvy6-w9r.js";
|
|
2
|
+
import { g as babelParse, i as analyzeSource, m as replaceWxml, n as generateCode, o as JsTokenUpdater, r as createAttributeMatcher, u as isClassContextLiteralPath } from "./wxml-IBzZSaQC.js";
|
|
3
|
+
import { splitCandidateTokens } from "@tailwindcss-mangle/engine";
|
|
4
|
+
import MagicString from "magic-string";
|
|
5
|
+
import { NodeTypes, parse } from "@vue/compiler-dom";
|
|
6
|
+
//#region src/uni-app-x/component-local-style.ts
|
|
7
|
+
const EXPRESSION_WRAPPER_PREFIX = "(\n";
|
|
8
|
+
const EXPRESSION_WRAPPER_SUFFIX = "\n)";
|
|
9
|
+
const COMPONENT_RE = /(?:^|[/\\])components(?:[/\\].+)?\.(?:uvue|nvue)$/;
|
|
10
|
+
const PAGE_RE = /(?:^|[/\\])pages(?:[/\\].+)?\.(?:uvue|nvue)$/;
|
|
11
|
+
function createStableHash(input) {
|
|
12
|
+
let hash = 2166136261;
|
|
13
|
+
for (let i = 0; i < input.length; i++) {
|
|
14
|
+
hash ^= input.charCodeAt(i);
|
|
15
|
+
hash = Math.imul(hash, 16777619);
|
|
16
|
+
}
|
|
17
|
+
return (hash >>> 0).toString(36);
|
|
18
|
+
}
|
|
19
|
+
function extractLiteralValue(path) {
|
|
20
|
+
if (path.isStringLiteral()) return {
|
|
21
|
+
literal: path.node.value,
|
|
22
|
+
offset: 1
|
|
23
|
+
};
|
|
24
|
+
return {
|
|
25
|
+
literal: typeof path.node.value === "string" ? path.node.value : path.node.value.raw,
|
|
26
|
+
offset: 0
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function createAlias(fileId, utility, index) {
|
|
30
|
+
return `wtu-${createStableHash(`${fileId}:${utility}`)}-${index.toString(36)}`;
|
|
31
|
+
}
|
|
32
|
+
function isRuntimeCandidate(candidate, runtimeSet) {
|
|
33
|
+
if (!runtimeSet || runtimeSet.size === 0) return false;
|
|
34
|
+
return runtimeSet.has(candidate) || runtimeSet.has(replaceWxml(candidate));
|
|
35
|
+
}
|
|
36
|
+
function hasTopLevelVariant(candidate) {
|
|
37
|
+
let bracketDepth = 0;
|
|
38
|
+
let parenthesisDepth = 0;
|
|
39
|
+
let quote = "";
|
|
40
|
+
let escaped = false;
|
|
41
|
+
for (const char of candidate) {
|
|
42
|
+
if (escaped) {
|
|
43
|
+
escaped = false;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (char === "\\") {
|
|
47
|
+
escaped = true;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (quote) {
|
|
51
|
+
if (char === quote) quote = "";
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (char === "\"" || char === "'") {
|
|
55
|
+
quote = char;
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
if (char === "[") {
|
|
59
|
+
bracketDepth += 1;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (char === "]") {
|
|
63
|
+
bracketDepth = Math.max(0, bracketDepth - 1);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
if (char === "(") {
|
|
67
|
+
parenthesisDepth += 1;
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (char === ")") {
|
|
71
|
+
parenthesisDepth = Math.max(0, parenthesisDepth - 1);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (char === ":" && bracketDepth === 0 && parenthesisDepth === 0) return true;
|
|
75
|
+
}
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
78
|
+
function shouldEnableComponentLocalStyle(id) {
|
|
79
|
+
return COMPONENT_RE.test(id);
|
|
80
|
+
}
|
|
81
|
+
function shouldEnablePageLocalStyle(id) {
|
|
82
|
+
return PAGE_RE.test(id);
|
|
83
|
+
}
|
|
84
|
+
var UniAppXComponentLocalStyleCollector = class {
|
|
85
|
+
constructor(fileId, runtimeSet) {
|
|
86
|
+
this.fileId = fileId;
|
|
87
|
+
this.runtimeSet = runtimeSet;
|
|
88
|
+
_defineProperty(this, "aliasByUtility", /* @__PURE__ */ new Map());
|
|
89
|
+
_defineProperty(this, "aliasByLookup", /* @__PURE__ */ new Map());
|
|
90
|
+
}
|
|
91
|
+
ensureAlias(utility) {
|
|
92
|
+
const cached = this.aliasByUtility.get(utility);
|
|
93
|
+
if (cached) return cached;
|
|
94
|
+
const alias = createAlias(this.fileId, utility, this.aliasByUtility.size);
|
|
95
|
+
this.aliasByUtility.set(utility, alias);
|
|
96
|
+
this.aliasByLookup.set(utility, alias);
|
|
97
|
+
this.aliasByLookup.set(replaceWxml(utility), alias);
|
|
98
|
+
return alias;
|
|
99
|
+
}
|
|
100
|
+
rewriteLiteral(literal) {
|
|
101
|
+
const candidates = splitCandidateTokens(literal);
|
|
102
|
+
if (candidates.length === 0) return literal;
|
|
103
|
+
let rewritten = literal;
|
|
104
|
+
for (const candidate of candidates) {
|
|
105
|
+
if (!isRuntimeCandidate(candidate, this.runtimeSet)) continue;
|
|
106
|
+
rewritten = rewritten.replace(candidate, hasTopLevelVariant(candidate) ? replaceWxml(candidate) : this.ensureAlias(candidate));
|
|
107
|
+
}
|
|
108
|
+
return rewritten;
|
|
109
|
+
}
|
|
110
|
+
collectAndRewriteStaticClass(literal) {
|
|
111
|
+
return this.rewriteLiteral(literal);
|
|
112
|
+
}
|
|
113
|
+
collectRuntimeClasses(rawSource, options = {}) {
|
|
114
|
+
const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
|
|
115
|
+
try {
|
|
116
|
+
const analysis = analyzeSource(babelParse(wrapped, {
|
|
117
|
+
plugins: ["typescript"],
|
|
118
|
+
sourceType: options.wrapExpression ? "module" : "unambiguous"
|
|
119
|
+
}), {}, void 0, false);
|
|
120
|
+
for (const path of analysis.targetPaths) {
|
|
121
|
+
const { literal } = extractLiteralValue(path);
|
|
122
|
+
const candidates = splitCandidateTokens(literal);
|
|
123
|
+
const classContext = options.wrapExpression || isClassContextLiteralPath(path);
|
|
124
|
+
for (const candidate of candidates) {
|
|
125
|
+
if (!candidate || !classContext && !isRuntimeCandidate(candidate, this.runtimeSet)) continue;
|
|
126
|
+
if (isRuntimeCandidate(candidate, this.runtimeSet) && !hasTopLevelVariant(candidate)) this.ensureAlias(candidate);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
} catch {}
|
|
130
|
+
}
|
|
131
|
+
rewriteTransformedCode(rawSource, options = {}) {
|
|
132
|
+
if (this.aliasByLookup.size === 0) return rawSource;
|
|
133
|
+
const wrapped = options.wrapExpression ? `${EXPRESSION_WRAPPER_PREFIX}${rawSource}${EXPRESSION_WRAPPER_SUFFIX}` : rawSource;
|
|
134
|
+
try {
|
|
135
|
+
const analysis = analyzeSource(babelParse(wrapped, {
|
|
136
|
+
plugins: ["typescript"],
|
|
137
|
+
sourceType: options.wrapExpression ? "module" : "unambiguous"
|
|
138
|
+
}), {}, void 0, false);
|
|
139
|
+
if (analysis.targetPaths.length === 0) return rawSource;
|
|
140
|
+
const updater = new JsTokenUpdater();
|
|
141
|
+
for (const path of analysis.targetPaths) {
|
|
142
|
+
const { literal, offset } = extractLiteralValue(path);
|
|
143
|
+
const candidates = splitCandidateTokens(literal);
|
|
144
|
+
if (candidates.length === 0) continue;
|
|
145
|
+
let rewritten = literal;
|
|
146
|
+
let mutated = false;
|
|
147
|
+
for (const candidate of candidates) {
|
|
148
|
+
const alias = this.aliasByLookup.get(candidate);
|
|
149
|
+
if (!alias) continue;
|
|
150
|
+
const replaced = rewritten.replace(candidate, alias);
|
|
151
|
+
if (replaced !== rewritten) {
|
|
152
|
+
rewritten = replaced;
|
|
153
|
+
mutated = true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (!mutated || typeof path.node.start !== "number" || typeof path.node.end !== "number") continue;
|
|
157
|
+
updater.addToken({
|
|
158
|
+
start: path.node.start + offset,
|
|
159
|
+
end: path.node.end - offset,
|
|
160
|
+
value: rewritten,
|
|
161
|
+
path
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (updater.length === 0) return rawSource;
|
|
165
|
+
const ms = new MagicString(wrapped);
|
|
166
|
+
updater.updateMagicString(ms);
|
|
167
|
+
if (options.wrapExpression) {
|
|
168
|
+
ms.remove(0, 2);
|
|
169
|
+
ms.remove(wrapped.length - 2, wrapped.length);
|
|
170
|
+
}
|
|
171
|
+
return ms.toString();
|
|
172
|
+
} catch {
|
|
173
|
+
return rawSource;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
hasStyles() {
|
|
177
|
+
return this.aliasByUtility.size > 0;
|
|
178
|
+
}
|
|
179
|
+
toStyleBlock() {
|
|
180
|
+
if (!this.hasStyles()) return "";
|
|
181
|
+
const lines = ["<style scoped>"];
|
|
182
|
+
for (const [utility, alias] of this.aliasByUtility) {
|
|
183
|
+
lines.push(`.${alias} {`);
|
|
184
|
+
lines.push(` @apply ${utility};`);
|
|
185
|
+
lines.push("}");
|
|
186
|
+
}
|
|
187
|
+
lines.push("</style>");
|
|
188
|
+
return `${lines.join("\n")}\n`;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/uni-app-x/transform.ts
|
|
193
|
+
function traverse(node, visitor) {
|
|
194
|
+
visitor(node);
|
|
195
|
+
if (Array.isArray(node.children)) {
|
|
196
|
+
for (const child of node.children) if (child && typeof child === "object" && "type" in child) traverse(child, visitor);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
function updateStaticAttribute(ms, prop, offset, content = prop.value?.content) {
|
|
200
|
+
if (!prop.value) return;
|
|
201
|
+
const start = offset + prop.value.loc.start.offset + 1;
|
|
202
|
+
const end = offset + prop.value.loc.end.offset - 1;
|
|
203
|
+
if (start < end) ms.update(start, end, replaceWxml(content ?? ""));
|
|
204
|
+
}
|
|
205
|
+
function updateStaticAttributeWithLocalStyle(ms, prop, offset, collector, content = prop.value?.content) {
|
|
206
|
+
if (!prop.value) return;
|
|
207
|
+
const start = offset + prop.value.loc.start.offset + 1;
|
|
208
|
+
const end = offset + prop.value.loc.end.offset - 1;
|
|
209
|
+
if (start < end) ms.update(start, end, collector.collectAndRewriteStaticClass(content ?? ""));
|
|
210
|
+
}
|
|
211
|
+
function updateDirectiveExpression(ms, prop, offset, jsHandler, runtimeSet) {
|
|
212
|
+
if (prop.exp?.type !== NodeTypes.SIMPLE_EXPRESSION) return;
|
|
213
|
+
const expression = prop.exp.content;
|
|
214
|
+
const start = offset + prop.exp.loc.start.offset;
|
|
215
|
+
const end = offset + prop.exp.loc.end.offset;
|
|
216
|
+
if (start >= end) return;
|
|
217
|
+
const generated = generateCode(expression, {
|
|
218
|
+
jsHandler,
|
|
219
|
+
runtimeSet,
|
|
220
|
+
wrapExpression: true
|
|
221
|
+
});
|
|
222
|
+
ms.update(start, end, generated);
|
|
223
|
+
}
|
|
224
|
+
function updateDirectiveExpressionWithLocalStyle(ms, prop, offset, jsHandler, collector, runtimeSet) {
|
|
225
|
+
if (prop.exp?.type !== NodeTypes.SIMPLE_EXPRESSION) return;
|
|
226
|
+
const expression = prop.exp.content;
|
|
227
|
+
const start = offset + prop.exp.loc.start.offset;
|
|
228
|
+
const end = offset + prop.exp.loc.end.offset;
|
|
229
|
+
if (start >= end) return;
|
|
230
|
+
collector.collectRuntimeClasses(expression, { wrapExpression: true });
|
|
231
|
+
const generated = generateCode(expression, {
|
|
232
|
+
jsHandler,
|
|
233
|
+
runtimeSet,
|
|
234
|
+
wrapExpression: true
|
|
235
|
+
});
|
|
236
|
+
ms.update(start, end, collector.rewriteTransformedCode(generated, { wrapExpression: true }));
|
|
237
|
+
}
|
|
238
|
+
function shouldEnableLocalStyle(id, options) {
|
|
239
|
+
if (options.enableComponentLocalStyle && shouldEnableComponentLocalStyle(id)) return true;
|
|
240
|
+
if (options.enablePageLocalStyle && shouldEnablePageLocalStyle(id)) return true;
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
function shouldHandleAttribute(tag, attrName, disabledDefaultTemplateHandler, matchCustomAttribute) {
|
|
244
|
+
const lowerName = attrName.toLowerCase();
|
|
245
|
+
const shouldHandleDefault = !disabledDefaultTemplateHandler && lowerName === "class";
|
|
246
|
+
const shouldHandleCustom = matchCustomAttribute?.(tag, attrName) ?? false;
|
|
247
|
+
return {
|
|
248
|
+
shouldHandleDefault,
|
|
249
|
+
shouldHandleCustom,
|
|
250
|
+
shouldHandle: shouldHandleDefault || shouldHandleCustom
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
const defaultCreateJsHandlerOptions = { babelParserOptions: { plugins: ["typescript"] } };
|
|
254
|
+
const UVUE_NVUE_RE = /\.(?:uvue|nvue)(?:\?.*)?$/;
|
|
255
|
+
const SFC_BLOCK_RE = /<(template|script)\b([^>]*)>([\s\S]*?)<\/\1>/gi;
|
|
256
|
+
const SCRIPT_SETUP_RE = /(?:^|\s)setup(?:\s|=|$)/;
|
|
257
|
+
function parseSfc(code) {
|
|
258
|
+
const descriptor = { errors: [] };
|
|
259
|
+
for (const match of code.matchAll(SFC_BLOCK_RE)) {
|
|
260
|
+
const type = match[1];
|
|
261
|
+
const attrs = match[2] ?? "";
|
|
262
|
+
const content = match[3] ?? "";
|
|
263
|
+
const full = match[0];
|
|
264
|
+
const contentStart = (match.index ?? 0) + full.indexOf(">") + 1;
|
|
265
|
+
const block = {
|
|
266
|
+
content,
|
|
267
|
+
start: contentStart,
|
|
268
|
+
end: contentStart + content.length,
|
|
269
|
+
attrs
|
|
270
|
+
};
|
|
271
|
+
if (type === "template" && !descriptor.template) {
|
|
272
|
+
try {
|
|
273
|
+
descriptor.template = {
|
|
274
|
+
...block,
|
|
275
|
+
ast: parse(content)
|
|
276
|
+
};
|
|
277
|
+
} catch (error) {
|
|
278
|
+
descriptor.errors.push(error);
|
|
279
|
+
descriptor.template = block;
|
|
280
|
+
}
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
if (type === "script") if (SCRIPT_SETUP_RE.test(attrs)) descriptor.scriptSetup ?? (descriptor.scriptSetup = block);
|
|
284
|
+
else descriptor.script ?? (descriptor.script = block);
|
|
285
|
+
}
|
|
286
|
+
return descriptor;
|
|
287
|
+
}
|
|
288
|
+
function transformUVue(code, id, jsHandler, runtimeSet, options = {}) {
|
|
289
|
+
if (!UVUE_NVUE_RE.test(id)) return;
|
|
290
|
+
const { customAttributesEntities, disabledDefaultTemplateHandler = false } = options;
|
|
291
|
+
const matchCustomAttribute = createAttributeMatcher(customAttributesEntities);
|
|
292
|
+
const ms = new MagicString(code);
|
|
293
|
+
const descriptor = parseSfc(code);
|
|
294
|
+
const localStyleCollector = shouldEnableLocalStyle(id, options) ? new UniAppXComponentLocalStyleCollector(id, runtimeSet) : void 0;
|
|
295
|
+
if (descriptor.errors.length === 0) {
|
|
296
|
+
if (descriptor.template?.ast) {
|
|
297
|
+
const templateOffset = descriptor.template.start;
|
|
298
|
+
traverse(descriptor.template.ast, (node) => {
|
|
299
|
+
if (node.type !== NodeTypes.ELEMENT) return;
|
|
300
|
+
const tag = node.tag;
|
|
301
|
+
for (const prop of node.props) if (prop.type === NodeTypes.ATTRIBUTE) {
|
|
302
|
+
const { shouldHandle, shouldHandleDefault } = shouldHandleAttribute(tag, prop.name, disabledDefaultTemplateHandler, matchCustomAttribute);
|
|
303
|
+
if (!shouldHandle) continue;
|
|
304
|
+
if (shouldHandleDefault && localStyleCollector) updateStaticAttributeWithLocalStyle(ms, prop, templateOffset, localStyleCollector);
|
|
305
|
+
else updateStaticAttribute(ms, prop, templateOffset);
|
|
306
|
+
if (shouldHandleDefault) continue;
|
|
307
|
+
} else if (prop.type === NodeTypes.DIRECTIVE && prop.name === "bind" && prop.arg?.type === NodeTypes.SIMPLE_EXPRESSION && prop.arg.isStatic) {
|
|
308
|
+
const attrName = prop.arg.content;
|
|
309
|
+
const { shouldHandle } = shouldHandleAttribute(tag, attrName, disabledDefaultTemplateHandler, matchCustomAttribute);
|
|
310
|
+
if (!shouldHandle) continue;
|
|
311
|
+
if (attrName.toLowerCase() === "class" && localStyleCollector) updateDirectiveExpressionWithLocalStyle(ms, prop, templateOffset, jsHandler, localStyleCollector, runtimeSet);
|
|
312
|
+
else updateDirectiveExpression(ms, prop, templateOffset, jsHandler, runtimeSet);
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
if (descriptor.script) {
|
|
317
|
+
localStyleCollector?.collectRuntimeClasses(descriptor.script.content);
|
|
318
|
+
const { code } = jsHandler(descriptor.script.content, runtimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
319
|
+
ms.update(descriptor.script.start, descriptor.script.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
320
|
+
}
|
|
321
|
+
if (descriptor.scriptSetup) {
|
|
322
|
+
localStyleCollector?.collectRuntimeClasses(descriptor.scriptSetup.content);
|
|
323
|
+
const { code } = jsHandler(descriptor.scriptSetup.content, runtimeSet ?? /* @__PURE__ */ new Set(), defaultCreateJsHandlerOptions);
|
|
324
|
+
ms.update(descriptor.scriptSetup.start, descriptor.scriptSetup.end, localStyleCollector ? localStyleCollector.rewriteTransformedCode(code) : code);
|
|
325
|
+
}
|
|
326
|
+
if (localStyleCollector?.hasStyles()) ms.append(`\n${localStyleCollector.toStyleBlock()}`);
|
|
327
|
+
}
|
|
328
|
+
const result = {
|
|
329
|
+
code: ms.toString(),
|
|
330
|
+
map: null
|
|
331
|
+
};
|
|
332
|
+
Object.defineProperty(result, "map", {
|
|
333
|
+
configurable: true,
|
|
334
|
+
enumerable: true,
|
|
335
|
+
get() {
|
|
336
|
+
return ms.generateMap();
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
return result;
|
|
340
|
+
}
|
|
341
|
+
//#endregion
|
|
342
|
+
export { transformUVue };
|
package/dist/typedoc.export.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { WeappTailwindcssGenerateOptions, WeappTailwindcssGenerateResult, WeappTailwindcssGenerator, WeappTailwindcssGeneratorTarget, WeappTailwindcssPostcssPluginOptions, } from './index';
|
|
2
|
-
export type { WeappTailwindcssStyleInjectorOptions } from './types';
|
|
3
|
-
export type { ApplyOptions, CacheOptions, ExtractOptions, TailwindCssOptions, TailwindCssRuntimeOptions, TailwindV4Options, } from './types/typedoc-tailwindcss-runtime';
|
|
4
|
-
export type { UserDefinedOptions } from './types/user-defined-options';
|
|
1
|
+
export type { WeappTailwindcssGenerateOptions, WeappTailwindcssGenerateResult, WeappTailwindcssGenerator, WeappTailwindcssGeneratorTarget, WeappTailwindcssPostcssPluginOptions, } from './index.js';
|
|
2
|
+
export type { WeappTailwindcssStyleInjectorOptions } from './types/index.js';
|
|
3
|
+
export type { ApplyOptions, CacheOptions, ExtractOptions, TailwindCssOptions, TailwindCssRuntimeOptions, TailwindV4Options, } from './types/typedoc-tailwindcss-runtime.js';
|
|
4
|
+
export type { UserDefinedOptions } from './types/user-defined-options/index.js';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { ParseError, ParserOptions } from '@babel/parser';
|
|
2
2
|
import type { CssPreflightOptions, Document, IStyleHandlerOptions, Result as PostcssResult, Root } from '@weapp-tailwindcss/postcss';
|
|
3
3
|
import type { SourceMap } from 'magic-string';
|
|
4
|
-
import type { ICreateCacheReturnType } from '../cache';
|
|
5
|
-
import type { ItemOrItemArray } from './base';
|
|
6
|
-
import type { AppType, IArbitraryValues, ICustomAttributesEntities } from './shared';
|
|
7
|
-
import type { UniAppXComponentLocalStylesOptions, UniAppXOptions as UniAppXUserDefinedOptions, UserDefinedOptions } from './user-defined-options';
|
|
8
|
-
import type { LengthUnitsRuntimeOptions, TailwindContentTokenReport, TailwindcssExtractOptions, TailwindcssExtractResult, TailwindCssOptions, TailwindCssRuntimeOptions, TailwindPackageInfo } from '../tailwindcss/runtime-types';
|
|
4
|
+
import type { ICreateCacheReturnType } from '../cache/index.js';
|
|
5
|
+
import type { ItemOrItemArray } from './base.js';
|
|
6
|
+
import type { AppType, IArbitraryValues, ICustomAttributesEntities } from './shared.js';
|
|
7
|
+
import type { UniAppXComponentLocalStylesOptions, UniAppXOptions as UniAppXUserDefinedOptions, UserDefinedOptions } from './user-defined-options/index.js';
|
|
8
|
+
import type { LengthUnitsRuntimeOptions, TailwindContentTokenReport, TailwindcssExtractOptions, TailwindcssExtractResult, TailwindCssOptions, TailwindCssRuntimeOptions, TailwindPackageInfo } from '../tailwindcss/runtime-types.js';
|
|
9
9
|
export type { TailwindCssOptions, TailwindCssRuntimeOptions, UniAppXComponentLocalStylesOptions, UniAppXUserDefinedOptions, UserDefinedOptions, };
|
|
10
|
-
export type { AppType, IArbitraryValues, ICustomAttributes, ICustomAttributesEntities, IUnocssCompatibilityOptions } from './shared';
|
|
10
|
+
export type { AppType, IArbitraryValues, ICustomAttributes, ICustomAttributesEntities, IUnocssCompatibilityOptions } from './shared.js';
|
|
11
11
|
export type { CssPreflightOptions, IStyleHandlerOptions, ItemOrItemArray };
|
|
12
|
-
export type { WeappTailwindcssStyleInjectorOptions } from '../style-injector/internal';
|
|
12
|
+
export type { WeappTailwindcssStyleInjectorOptions } from '../style-injector/internal.js';
|
|
13
13
|
export type RequiredDefined<T> = {
|
|
14
14
|
[K in keyof T]-?: Exclude<T[K], undefined>;
|
|
15
15
|
};
|
package/dist/types/shared.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ItemOrItemArray } from './base';
|
|
1
|
+
import type { ItemOrItemArray } from './base.js';
|
|
2
2
|
export type AppType = 'uni-app' | 'uni-app-vite' | 'uni-app-x' | 'taro' | 'remax' | 'native' | 'kbone' | 'mpx' | 'weapp-vite';
|
|
3
3
|
export type ICustomAttributes = Record<string, ItemOrItemArray<string | RegExp>> | Map<string | RegExp, ItemOrItemArray<string | RegExp>>;
|
|
4
4
|
export type ICustomAttributesEntities = [string | RegExp, ItemOrItemArray<string | RegExp>][];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PackageResolvingOptions } from 'local-pkg';
|
|
2
|
-
import type { TailwindSourceEntry as SourceEntry } from '../tailwindcss/source-scan';
|
|
3
|
-
import type { TailwindV4SourceOptions } from '../tailwindcss/v4-engine';
|
|
4
|
-
import type { LengthUnitsRuntimeOptions } from '../tailwindcss/runtime-types';
|
|
2
|
+
import type { TailwindSourceEntry as SourceEntry } from '../tailwindcss/source-scan.js';
|
|
3
|
+
import type { TailwindV4SourceOptions } from '../tailwindcss/v4-engine/index.js';
|
|
4
|
+
import type { LengthUnitsRuntimeOptions } from '../tailwindcss/runtime-types.js';
|
|
5
5
|
type TailwindV4CssSource = NonNullable<TailwindV4SourceOptions['cssSources']>[number];
|
|
6
6
|
export type CacheStrategy = 'merge' | 'overwrite';
|
|
7
7
|
export type CacheDriver = 'file' | 'memory' | 'noop';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ParserOptions } from '@babel/parser';
|
|
2
2
|
import type { CssOptions, LoadedPostcssOptions } from '@weapp-tailwindcss/postcss/types';
|
|
3
|
-
import type { ICreateCacheReturnType } from '../../cache';
|
|
4
|
-
import type { WeappTailwindcssGeneratorUserOptions } from '../../generator';
|
|
5
|
-
import type { WeappTailwindcssStyleInjectorUserOptions } from '../../style-injector/internal';
|
|
6
|
-
import type { AppType, IArbitraryValues, IUnocssCompatibilityOptions } from '../shared';
|
|
7
|
-
import type { LengthUnitsRuntimeOptions, TailwindCssRuntimeOptions } from '../../tailwindcss/runtime-types';
|
|
3
|
+
import type { ICreateCacheReturnType } from '../../cache/index.js';
|
|
4
|
+
import type { WeappTailwindcssGeneratorUserOptions } from '../../generator/index.js';
|
|
5
|
+
import type { WeappTailwindcssStyleInjectorUserOptions } from '../../style-injector/internal.js';
|
|
6
|
+
import type { AppType, IArbitraryValues, IUnocssCompatibilityOptions } from '../shared.js';
|
|
7
|
+
import type { LengthUnitsRuntimeOptions, TailwindCssRuntimeOptions } from '../../tailwindcss/runtime-types.js';
|
|
8
8
|
export interface CssSourceTraceOptions {
|
|
9
9
|
root?: string | undefined;
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CssCalcOptions, CssPreflightOptions, IStyleHandlerOptions, PresetEnvOptions, Px2rpxOptions, Rem2rpxOptions, UniAppXUnsupportedMode, UnitConversionOptions, UnitsToPxOptions, WeappAutoprefixerOptions } from '@weapp-tailwindcss/postcss/types';
|
|
2
|
-
import type { ICustomAttributes } from '../shared';
|
|
3
|
-
import type { TailwindCssRuntimeOptions } from '../../tailwindcss/runtime-types';
|
|
2
|
+
import type { ICustomAttributes } from '../shared.js';
|
|
3
|
+
import type { TailwindCssRuntimeOptions } from '../../tailwindcss/runtime-types.js';
|
|
4
4
|
export interface UniAppXComponentLocalStylesOptions {
|
|
5
5
|
enabled?: boolean | undefined;
|
|
6
6
|
onlyWhenStyleIsolationVersion2?: boolean | undefined;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { UserDefinedOptionsGeneralPart } from './general';
|
|
2
|
-
import type { UserDefinedOptionsImportantPart } from './important';
|
|
3
|
-
import type { UserDefinedOptionsLifecyclePart } from './lifecycle';
|
|
4
|
-
import type { UserDefinedOptionsMatcherPart } from './matcher';
|
|
5
|
-
export type { UserDefinedOptionsGeneralPart, } from './general';
|
|
6
|
-
export type { UniAppXComponentLocalStylesOptions, UniAppXOptions, } from './important';
|
|
7
|
-
export type { UserDefinedOptionsImportantPart, } from './important';
|
|
8
|
-
export type { UserDefinedOptionsLifecyclePart, } from './lifecycle';
|
|
9
|
-
export type { UserDefinedOptionsMatcherPart, } from './matcher';
|
|
1
|
+
import type { UserDefinedOptionsGeneralPart } from './general.js';
|
|
2
|
+
import type { UserDefinedOptionsImportantPart } from './important.js';
|
|
3
|
+
import type { UserDefinedOptionsLifecyclePart } from './lifecycle.js';
|
|
4
|
+
import type { UserDefinedOptionsMatcherPart } from './matcher.js';
|
|
5
|
+
export type { UserDefinedOptionsGeneralPart, } from './general.js';
|
|
6
|
+
export type { UniAppXComponentLocalStylesOptions, UniAppXOptions, } from './important.js';
|
|
7
|
+
export type { UserDefinedOptionsImportantPart, } from './important.js';
|
|
8
|
+
export type { UserDefinedOptionsLifecyclePart, } from './lifecycle.js';
|
|
9
|
+
export type { UserDefinedOptionsMatcherPart, } from './matcher.js';
|
|
10
10
|
export interface UserDefinedOptions extends UserDefinedOptionsGeneralPart, UserDefinedOptionsImportantPart, UserDefinedOptionsLifecyclePart, UserDefinedOptionsMatcherPart {
|
|
11
11
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ItemOrItemArray } from '../base';
|
|
2
|
-
import type { AppType } from '../shared';
|
|
1
|
+
import type { ItemOrItemArray } from '../base.js';
|
|
2
|
+
import type { AppType } from '../shared.js';
|
|
3
3
|
export type TransformRule = string | RegExp | ((id: string) => boolean);
|
|
4
4
|
export interface TransformOptions {
|
|
5
5
|
include?: ItemOrItemArray<TransformRule> | undefined;
|
package/dist/types.cjs
ADDED
|
File without changes
|
package/dist/types.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './types/index'
|
|
1
|
+
export * from './types/index.js'
|
package/dist/types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { transformUVue } from './transform';
|
|
2
|
-
export { createUniAppXAssetTask, createUniAppXPlugins } from './vite';
|
|
1
|
+
export { transformUVue } from './transform.js';
|
|
2
|
+
export { createUniAppXAssetTask, createUniAppXPlugins } from './vite.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function expandUniAppXHarmonyApplyStyles(source: string, generatedCss: string): string;
|
|
@@ -13,4 +13,7 @@ export declare function createStyleValueFromApplySources(sources: string[], util
|
|
|
13
13
|
export declare function collectUniAppXHarmonyApplyStyleSourcesFromSource(source: string, sourceId?: string): string[];
|
|
14
14
|
export declare function collectUniAppXHarmonyApplyUtilitiesFromSources(sources: Iterable<string>): Set<string>;
|
|
15
15
|
export declare function createMergedStyleValue(code: string, localStyle: StyleValue | undefined, appStyle: StyleValue): StyleValue | undefined;
|
|
16
|
+
export declare function createMergedStyleValues(code: string, localStyles: StyleValue[], appStyle: StyleValue): {
|
|
17
|
+
[x: string]: Record<string, StyleDeclarations>;
|
|
18
|
+
}[] | undefined;
|
|
16
19
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { OutputAsset, OutputChunk } from 'rollup';
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { expandUniAppXHarmonyApplyStyles } from './style-asset/harmony-apply.js';
|
|
3
|
+
import { collectUniAppXHarmonyApplyStyleSourcesFromSource, collectUniAppXHarmonyApplyUtilitiesFromSources } from './style-asset/style-value.js';
|
|
4
|
+
export declare const UNI_APP_X_STYLE_PLACEHOLDER_VERSION = "uni-app-x-style-placeholder-v3";
|
|
4
5
|
type BundleItem = {
|
|
5
6
|
type: string;
|
|
6
7
|
} | OutputAsset | OutputChunk;
|
|
@@ -10,11 +11,11 @@ interface HarmonyStyleInjectOptions {
|
|
|
10
11
|
excludeComponents?: boolean | undefined;
|
|
11
12
|
mapSources?: Iterable<string | undefined> | undefined;
|
|
12
13
|
}
|
|
13
|
-
export { collectUniAppXHarmonyApplyStyleSourcesFromSource, collectUniAppXHarmonyApplyUtilitiesFromSources, };
|
|
14
|
+
export { collectUniAppXHarmonyApplyStyleSourcesFromSource, collectUniAppXHarmonyApplyUtilitiesFromSources, expandUniAppXHarmonyApplyStyles, };
|
|
14
15
|
export declare function createUniAppXHarmonyApplyGeneratorSource(applyStyleSources: string[], _applyUtilities: Iterable<string>): string;
|
|
15
16
|
export declare function collectUniAppXHarmonyApplyUtilities(bundle: Record<string, BundleItem>): Set<string>;
|
|
16
17
|
export declare function collectUniAppXHarmonyApplyStyleSources(bundle: Record<string, BundleItem>): string[];
|
|
17
|
-
export declare function injectUniAppXStylePlaceholder(file: string, code: string, getAssetSource?: (file: string) => string | undefined): string;
|
|
18
|
+
export declare function injectUniAppXStylePlaceholder(file: string, code: string, getAssetSource?: (file: string) => string | undefined, cssSources?: Iterable<string | undefined>): string;
|
|
18
19
|
export declare function injectUniAppXHarmonyGlobalStyles(file: string, code: string, getBundleSource?: (file: string) => string | undefined, options?: HarmonyStyleInjectOptions): string;
|
|
19
20
|
export declare function injectUniAppXHarmonyBundleStyles(bundle: Record<string, BundleItem>, options?: HarmonyStyleInjectOptions): boolean;
|
|
20
21
|
export declare function isUniAppXHarmonyBundle(bundle: Record<string, BundleItem>): boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TransformResult } from 'vite';
|
|
2
|
-
import type { ICustomAttributesEntities, JsHandler } from '../types';
|
|
2
|
+
import type { ICustomAttributesEntities, JsHandler } from '../types/index.js';
|
|
3
3
|
interface TransformUVueOptions {
|
|
4
4
|
customAttributesEntities?: ICustomAttributesEntities;
|
|
5
5
|
disabledDefaultTemplateHandler?: boolean;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ResolvedConfig } from 'vite';
|
|
2
|
+
interface HarmonyApplyHookContext {
|
|
3
|
+
addWatchFile?: (id: string) => void;
|
|
4
|
+
}
|
|
5
|
+
interface CreateUniAppXHarmonyApplyExpanderOptions {
|
|
6
|
+
generateCss?: ((id: string, code: string, hookContext?: HarmonyApplyHookContext & {
|
|
7
|
+
transient?: boolean;
|
|
8
|
+
}) => Promise<string | undefined> | string | undefined) | undefined;
|
|
9
|
+
getResolvedConfig: () => ResolvedConfig | undefined;
|
|
10
|
+
isHarmonyBuildTarget: () => boolean;
|
|
11
|
+
transformCss: (css: string, id: string) => Promise<string>;
|
|
12
|
+
}
|
|
13
|
+
export declare function createUniAppXHarmonyApplyExpander(options: CreateUniAppXHarmonyApplyExpanderOptions): {
|
|
14
|
+
expandStyles: (code: string, id: string, hookContext: HarmonyApplyHookContext) => Promise<string>;
|
|
15
|
+
rememberSource: (code: string, id: string) => void;
|
|
16
|
+
styleSources: Set<string>;
|
|
17
|
+
utilities: Set<string>;
|
|
18
|
+
};
|
|
19
|
+
export {};
|
package/dist/uni-app-x/vite.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OutputAsset } from 'rollup';
|
|
2
2
|
import type { Plugin, ResolvedConfig } from 'vite';
|
|
3
|
-
import type { ICreateCacheReturnType } from '../cache';
|
|
4
|
-
import type { AppType, CreateJsHandlerOptions, ICustomAttributesEntities, InternalUserDefinedOptions, JsHandler, LinkedJsModuleResult } from '../types';
|
|
3
|
+
import type { ICreateCacheReturnType } from '../cache/index.js';
|
|
4
|
+
import type { AppType, CreateJsHandlerOptions, ICustomAttributesEntities, InternalUserDefinedOptions, JsHandler, LinkedJsModuleResult } from '../types/index.js';
|
|
5
5
|
interface UniAppXRuntimeState {
|
|
6
6
|
readyPromise: Promise<unknown>;
|
|
7
7
|
}
|
|
@@ -14,6 +14,7 @@ interface CreateUniAppXPluginsOptions {
|
|
|
14
14
|
styleHandler: InternalUserDefinedOptions['styleHandler'];
|
|
15
15
|
generateCss?: ((id: string, code: string, hookContext?: {
|
|
16
16
|
addWatchFile?: (id: string) => void;
|
|
17
|
+
transient?: boolean;
|
|
17
18
|
}) => Promise<string | undefined> | string | undefined) | undefined;
|
|
18
19
|
jsHandler: JsHandler;
|
|
19
20
|
ensureRuntimeClassSet: (force?: boolean) => Promise<Set<string>>;
|
|
@@ -36,6 +37,8 @@ interface CreateUniAppXAssetTaskOptions {
|
|
|
36
37
|
applyLinkedResults: ApplyLinkedResults;
|
|
37
38
|
uniAppX?: InternalUserDefinedOptions['uniAppX'];
|
|
38
39
|
getAssetSource?: (file: string) => string | undefined;
|
|
40
|
+
getCssSources?: () => Iterable<string | undefined>;
|
|
41
|
+
injectStylePlaceholder?: boolean;
|
|
39
42
|
}
|
|
40
43
|
export declare function createUniAppXAssetTask(file: string, originalSource: OutputAsset, outDir: string, options: CreateUniAppXAssetTaskOptions): () => Promise<void>;
|
|
41
44
|
export {};
|
package/dist/unocss/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IArbitraryValues, UserDefinedOptions } from '../types';
|
|
1
|
+
import type { IArbitraryValues, UserDefinedOptions } from '../types/index.js';
|
|
2
2
|
export declare function resolveUnocssBareArbitraryValues(arbitraryValues: IArbitraryValues | undefined, unocss: UserDefinedOptions['unocss']): IArbitraryValues;
|
package/dist/utils/disabled.d.ts
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { InternalUserDefinedOptions } from '../types';
|
|
1
|
+
import type { InternalUserDefinedOptions } from '../types/index.js';
|
|
2
2
|
import { defu, defuOverrideArray, groupBy, isMap, isRegexp, noop, regExpTest, removeExt } from '@weapp-tailwindcss/shared';
|
|
3
|
-
export * from './hbuilderx';
|
|
4
|
-
export * from './uni-platform';
|
|
3
|
+
export * from './hbuilderx.js';
|
|
4
|
+
export * from './uni-platform.js';
|
|
5
5
|
export { defu, defuOverrideArray, groupBy, isMap, isRegexp, noop, regExpTest, removeExt, };
|
|
6
6
|
export type EntryGroup = 'css' | 'html' | 'js' | 'other';
|
|
7
7
|
export declare function getGroupedEntries<T>(entries: [string, T][], options: InternalUserDefinedOptions): Record<EntryGroup, [string, T][]>;
|