weapp-tailwindcss 4.12.0 → 5.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/babel/index.d.ts +3 -0
- package/dist/bundlers/gulp/index.d.ts +7 -0
- package/dist/bundlers/shared/cache.d.ts +16 -0
- package/dist/bundlers/shared/css-cleanup.d.ts +4 -0
- package/dist/bundlers/shared/css-imports.d.ts +8 -0
- package/dist/bundlers/shared/generator-candidates.d.ts +5 -0
- package/dist/bundlers/shared/generator-css.d.ts +41 -0
- package/dist/bundlers/shared/module-graph.d.ts +5 -0
- package/dist/bundlers/shared/run-tasks.d.ts +2 -0
- package/dist/bundlers/vite/bundle-entries.d.ts +14 -0
- package/dist/bundlers/vite/bundle-state.d.ts +43 -0
- package/dist/bundlers/vite/css-finalizer.d.ts +19 -0
- package/dist/bundlers/vite/generate-bundle.d.ts +20 -0
- package/dist/bundlers/vite/incremental-runtime-class-set.d.ts +21 -0
- package/dist/bundlers/vite/index.d.ts +3 -0
- package/dist/bundlers/vite/js-precheck.d.ts +1 -0
- package/dist/bundlers/vite/query.d.ts +15 -0
- package/dist/bundlers/vite/resolve-app-type.d.ts +2 -0
- package/dist/bundlers/vite/rewrite-css-imports.d.ts +11 -0
- package/dist/bundlers/vite/runtime-affecting-signature.d.ts +2 -0
- package/dist/bundlers/vite/utils.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/shared.d.ts +20 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-assets.d.ts +14 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4-loaders.d.ts +15 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v4.d.ts +9 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-assets.d.ts +17 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5-loaders.d.ts +19 -0
- package/dist/bundlers/webpack/BaseUnifiedPlugin/v5.d.ts +9 -0
- package/dist/bundlers/webpack/index.d.ts +1 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-css-import-rewrite-loader.d.ts +12 -0
- package/dist/bundlers/webpack/loaders/weapp-tw-runtime-classset-loader.d.ts +11 -0
- package/dist/bundlers/webpack/shared/css-imports.d.ts +6 -0
- package/dist/bundlers/webpack/shared/loader-anchors.d.ts +8 -0
- package/dist/cache/index.d.ts +38 -0
- package/dist/cache/md5.d.ts +1 -0
- package/dist/chunk-8l464Juk.js +28 -0
- package/dist/cli/config.d.ts +5 -0
- package/dist/cli/context.d.ts +16 -0
- package/dist/cli/doctor/constants.d.ts +7 -0
- package/dist/cli/doctor/types.d.ts +31 -0
- package/dist/cli/doctor.d.ts +4 -0
- package/dist/cli/helpers/options/format.d.ts +2 -0
- package/dist/cli/helpers/options/parse.d.ts +3 -0
- package/dist/cli/helpers/options/resolve.d.ts +1 -0
- package/dist/cli/helpers/options.d.ts +3 -0
- package/dist/cli/helpers/patch-cwd.d.ts +1 -0
- package/dist/cli/helpers.d.ts +5 -0
- package/dist/cli/mount-options/patch-status.d.ts +2 -0
- package/dist/cli/mount-options.d.ts +2 -0
- package/dist/cli/patch-options.d.ts +6 -0
- package/dist/cli/tokens.d.ts +4 -0
- package/dist/cli/types.d.ts +17 -0
- package/dist/cli/vscode-entry.d.ts +14 -0
- package/dist/cli/workspace/package-dirs.d.ts +3 -0
- package/dist/cli/workspace/patch-package.d.ts +3 -0
- package/dist/cli/workspace/patch-utils.d.ts +3 -0
- package/dist/cli/workspace/types.d.ts +11 -0
- package/dist/cli/workspace/workspace-globs.d.ts +2 -0
- package/dist/cli/workspace/workspace-io.d.ts +1 -0
- package/dist/cli/workspace/workspace-lock.d.ts +1 -0
- package/dist/cli/workspace.d.ts +2 -0
- package/dist/cli.d.ts +1 -2
- package/dist/cli.js +2425 -3524
- package/dist/cli.mjs +2402 -3505
- package/dist/constants-B-_T5UnW.mjs +44 -0
- package/dist/constants-p1dyh1x1.js +73 -0
- package/dist/constants.d.ts +13 -0
- package/dist/context/compiler-context-cache.d.ts +3 -0
- package/dist/context/custom-attributes.d.ts +2 -0
- package/dist/context/handlers.d.ts +6 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/logger.d.ts +4 -0
- package/dist/context/tailwindcss/basedir.d.ts +1 -0
- package/dist/context/tailwindcss/rax.d.ts +2 -0
- package/dist/context/tailwindcss.d.ts +4 -0
- package/dist/context/workspace.d.ts +3 -0
- package/dist/core.d.ts +5 -21
- package/dist/core.js +138 -180
- package/dist/core.mjs +135 -180
- package/dist/css-imports-BbrbluP9.js +177 -0
- package/dist/css-imports-CSdPq_Sc.mjs +128 -0
- package/dist/css-macro/constants.d.ts +14 -0
- package/dist/css-macro/index.d.ts +15 -0
- package/dist/css-macro/postcss.d.ts +3 -7
- package/dist/css-macro/postcss.js +44 -58
- package/dist/css-macro/postcss.mjs +44 -56
- package/dist/css-macro.d.ts +1 -20
- package/dist/css-macro.js +37 -50
- package/dist/css-macro.mjs +33 -47
- package/dist/debug/index.d.ts +5 -0
- package/dist/defaults.d.ts +2 -11
- package/dist/defaults.js +132 -8
- package/dist/defaults.mjs +128 -7
- package/dist/escape.js +31 -54
- package/dist/escape.mjs +18 -25
- package/dist/experimental/index.d.ts +2 -0
- package/dist/experimental/oxc/ast-utils.d.ts +30 -0
- package/dist/experimental/oxc/index.d.ts +2 -0
- package/dist/experimental/oxc/module-specifiers.d.ts +2 -0
- package/dist/experimental/shared/cache.d.ts +3 -0
- package/dist/experimental/shared/transform.d.ts +3 -0
- package/dist/experimental/shared.d.ts +8 -0
- package/dist/experimental/swc/ast-utils.d.ts +30 -0
- package/dist/experimental/swc/index.d.ts +2 -0
- package/dist/experimental/swc/module-specifiers.d.ts +2 -0
- package/dist/generator/index.d.ts +11 -0
- package/dist/generator/options.d.ts +15 -0
- package/dist/generator/types.d.ts +19 -0
- package/dist/generator-CZ-JXw6T.js +492 -0
- package/dist/generator-Dwxgra97.mjs +399 -0
- package/dist/generator-css-CnYjiMrD.js +1084 -0
- package/dist/generator-css-DhPFjSzK.mjs +1057 -0
- package/dist/generator.d.ts +1 -0
- package/dist/generator.js +19 -0
- package/dist/generator.mjs +2 -0
- package/dist/gulp.d.ts +4 -24
- package/dist/gulp.js +271 -13
- package/dist/gulp.mjs +263 -13
- package/dist/index.d.ts +8 -15
- package/dist/index.js +12 -24
- package/dist/index.mjs +6 -24
- package/dist/js/JsTokenUpdater.d.ts +14 -0
- package/dist/js/ModuleGraph.d.ts +18 -0
- package/dist/js/NodePathWalker.d.ts +33 -0
- package/dist/js/babel/parse.d.ts +9 -0
- package/dist/js/babel/process.d.ts +4 -0
- package/dist/js/babel.d.ts +13 -0
- package/dist/js/class-context.d.ts +3 -0
- package/dist/js/evalTransforms.d.ts +7 -0
- package/dist/js/handlers.d.ts +5 -0
- package/dist/js/index.d.ts +4 -0
- package/dist/js/module-graph/ignored-exports.d.ts +18 -0
- package/dist/js/module-graph/types.d.ts +17 -0
- package/dist/js/node-path-walker/export-handlers.d.ts +12 -0
- package/dist/js/node-path-walker/import-tokens.d.ts +24 -0
- package/dist/js/precheck.d.ts +2 -0
- package/dist/js/sourceAnalysis.d.ts +17 -0
- package/dist/js/syntax.d.ts +10 -0
- package/dist/js/taggedTemplateIgnore.d.ts +13 -0
- package/dist/js/types.d.ts +11 -0
- package/dist/lightningcss/index.d.ts +8 -0
- package/dist/lightningcss/style-handler/options.d.ts +3 -0
- package/dist/lightningcss/style-handler/selector-transform.d.ts +10 -0
- package/dist/lightningcss/style-handler/selector-utils.d.ts +10 -0
- package/dist/lightningcss/style-handler.d.ts +17 -0
- package/dist/loader-anchors-DvwgIYdA.mjs +205 -0
- package/dist/loader-anchors-cprm4Klq.js +273 -0
- package/dist/logger/index.d.ts +2 -0
- package/dist/logger-BZ45DZJT.js +1003 -0
- package/dist/logger-BoVx1Dbt.mjs +935 -0
- package/dist/patcher-options-6gJN2EXy.js +115 -0
- package/dist/patcher-options-DQfR5xxT.mjs +92 -0
- package/dist/postcss-html-transform.d.ts +3 -3
- package/dist/postcss-html-transform.js +7 -10
- package/dist/postcss-html-transform.mjs +3 -6
- package/dist/postcss.d.ts +15 -0
- package/dist/postcss.js +278 -0
- package/dist/postcss.mjs +268 -0
- package/dist/presets/hbuilderx.d.ts +4 -0
- package/dist/presets/index.d.ts +3 -0
- package/dist/presets/shared.d.ts +10 -0
- package/dist/presets/taro.d.ts +4 -0
- package/dist/presets/uni-app-x.d.ts +16 -0
- package/dist/presets/uni-app.d.ts +4 -0
- package/dist/presets.d.ts +1 -76
- package/dist/presets.js +115 -163
- package/dist/presets.mjs +107 -163
- package/dist/recorder-B_XyZ576.mjs +2763 -0
- package/dist/recorder-rn_2v_nd.js +2878 -0
- package/dist/reset/index.d.ts +2 -0
- package/dist/reset.d.ts +1 -4
- package/dist/reset.js +19 -8
- package/dist/reset.mjs +2 -8
- package/dist/shared/classname-transform.d.ts +14 -0
- package/dist/shared/mpx.d.ts +7 -0
- package/dist/shared/tailwindcss-css-redirect.d.ts +1 -0
- package/dist/tailwindcss/index.d.ts +11 -0
- package/dist/tailwindcss/miniprogram.d.ts +1 -0
- package/dist/tailwindcss/patcher-options.d.ts +56 -0
- package/dist/tailwindcss/patcher-resolve.d.ts +4 -0
- package/dist/tailwindcss/patcher.d.ts +13 -0
- package/dist/tailwindcss/recorder.d.ts +13 -0
- package/dist/tailwindcss/remove-unsupported-css.d.ts +2 -0
- package/dist/tailwindcss/runtime/cache.d.ts +11 -0
- package/dist/tailwindcss/runtime-logs.d.ts +3 -0
- package/dist/tailwindcss/runtime.d.ts +29 -0
- package/dist/tailwindcss/targets/paths.d.ts +13 -0
- package/dist/tailwindcss/targets/record-io.d.ts +5 -0
- package/dist/tailwindcss/targets/recorder.d.ts +3 -0
- package/dist/tailwindcss/targets/types.d.ts +35 -0
- package/dist/tailwindcss/targets.d.ts +6 -0
- package/dist/tailwindcss/v3-engine/generator.d.ts +2 -0
- package/dist/tailwindcss/v3-engine/index.d.ts +4 -0
- package/dist/tailwindcss/v3-engine/miniprogram.d.ts +4 -0
- package/dist/tailwindcss/v3-engine/source.d.ts +5 -0
- package/dist/tailwindcss/v3-engine/types.d.ts +55 -0
- package/dist/tailwindcss/v4/config.d.ts +5 -0
- package/dist/tailwindcss/v4/css-entries.d.ts +7 -0
- package/dist/tailwindcss/v4/index.d.ts +2 -0
- package/dist/tailwindcss/v4/multi-patcher.d.ts +2 -0
- package/dist/tailwindcss/v4/patcher-options.d.ts +24 -0
- package/dist/tailwindcss/v4/patcher.d.ts +14 -0
- package/dist/tailwindcss/v4-engine/design-system.d.ts +1 -0
- package/dist/tailwindcss/v4-engine/generator.d.ts +2 -0
- package/dist/tailwindcss/v4-engine/index.d.ts +5 -0
- package/dist/tailwindcss/v4-engine/miniprogram.d.ts +4 -0
- package/dist/tailwindcss/v4-engine/source.d.ts +7 -0
- package/dist/tailwindcss/v4-engine/types.d.ts +17 -0
- package/dist/typedoc.export.d.ts +5 -0
- package/dist/types/base.d.ts +1 -0
- package/dist/types/disabled-options.d.ts +4 -0
- package/dist/types/index.d.ts +104 -0
- package/dist/types/shared.d.ts +7 -0
- package/dist/types/user-defined-options/general.d.ts +31 -0
- package/dist/types/user-defined-options/important.d.ts +37 -0
- package/dist/types/user-defined-options/index.d.ts +11 -0
- package/dist/types/user-defined-options/lifecycle.d.ts +6 -0
- package/dist/types/user-defined-options/matcher.d.ts +9 -0
- package/dist/types.d.ts +1 -150
- package/dist/types.js +0 -1
- package/dist/types.mjs +1 -1
- package/dist/uni-app-x/component-local-style.d.ts +19 -0
- package/dist/uni-app-x/index.d.ts +2 -0
- package/dist/uni-app-x/options.d.ts +12 -0
- package/dist/uni-app-x/style-isolation.d.ts +2 -0
- package/dist/uni-app-x/transform.d.ts +9 -0
- package/dist/uni-app-x/vite.d.ts +36 -0
- package/dist/utils/decode.d.ts +2 -0
- package/dist/utils/disabled.d.ts +6 -0
- package/dist/utils/hbuilderx.d.ts +5 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/nameMatcher.d.ts +4 -0
- package/dist/utils/resolve-package.d.ts +1 -0
- package/dist/utils/uni-platform.d.ts +11 -0
- package/dist/utils-7DUGTFED.mjs +48 -0
- package/dist/utils-DmC9_In3.js +61 -0
- package/dist/vite-BHpAqldo.js +1952 -0
- package/dist/vite-C8JlHiyR.mjs +1940 -0
- package/dist/vite.d.ts +4 -17
- package/dist/vite.js +5 -14
- package/dist/vite.mjs +2 -14
- package/dist/weapp-tw-css-import-rewrite-loader.js +59 -92
- package/dist/weapp-tw-runtime-classset-loader.js +31 -50
- package/dist/webpack-CABjKGGQ.mjs +441 -0
- package/dist/webpack-DNIJ0ysE.js +456 -0
- package/dist/webpack.d.ts +4 -25
- package/dist/webpack.js +6 -17
- package/dist/webpack.mjs +2 -17
- package/dist/webpack4.d.ts +4 -26
- package/dist/webpack4.js +375 -481
- package/dist/webpack4.mjs +366 -482
- package/dist/wxml/Tokenizer.d.ts +15 -0
- package/dist/wxml/custom-attributes.d.ts +4 -0
- package/dist/wxml/index.d.ts +2 -0
- package/dist/wxml/shared.d.ts +2 -0
- package/dist/wxml/tokenizer/types.d.ts +18 -0
- package/dist/wxml/utils/codegen/legacy-rewriter.d.ts +2 -0
- package/dist/wxml/utils/codegen/legacy-visitor.d.ts +8 -0
- package/dist/wxml/utils/codegen.d.ts +2 -0
- package/dist/wxml/utils/custom-template.d.ts +3 -0
- package/dist/wxml/utils/fragment-helpers.d.ts +6 -0
- package/dist/wxml/utils/fragment-updater.d.ts +4 -0
- package/dist/wxml/utils/template-fragments.d.ts +3 -0
- package/dist/wxml/utils.d.ts +8 -0
- package/dist/wxml/whitespace.d.ts +2 -0
- package/generator-placeholder.css +1 -0
- package/package.json +19 -5
- package/dist/chunk-24AGZQVR.js +0 -183
- package/dist/chunk-3VQKDHGP.mjs +0 -179
- package/dist/chunk-4AFQP74Z.js +0 -24
- package/dist/chunk-57SOQCAU.mjs +0 -582
- package/dist/chunk-5ZYHNDEK.mjs +0 -2439
- package/dist/chunk-76S2EME4.mjs +0 -34
- package/dist/chunk-A5PB4KZT.js +0 -138
- package/dist/chunk-DUHYLR2R.js +0 -276
- package/dist/chunk-DYLQ6UOI.js +0 -71
- package/dist/chunk-E7I5TW5K.js +0 -52
- package/dist/chunk-FS2NOOEB.js +0 -292
- package/dist/chunk-HVNGIKLS.js +0 -3930
- package/dist/chunk-JZQBZHN5.js +0 -579
- package/dist/chunk-KGTVD4EP.mjs +0 -3930
- package/dist/chunk-NNOQDMUP.mjs +0 -10
- package/dist/chunk-OF6MFURR.js +0 -34
- package/dist/chunk-OFB2KBRP.js +0 -2442
- package/dist/chunk-OOHJLO5M.mjs +0 -71
- package/dist/chunk-PCDYXXSK.mjs +0 -1515
- package/dist/chunk-RKISS72P.js +0 -7
- package/dist/chunk-RRQZL7FQ.mjs +0 -292
- package/dist/chunk-XAKAD2CR.mjs +0 -138
- package/dist/chunk-XZP3MREK.mjs +0 -276
- package/dist/chunk-ZAA5ZG3D.js +0 -1518
- package/dist/chunk-ZCH4YINE.mjs +0 -52
- package/dist/cli.d.mts +0 -2
- package/dist/core.d.mts +0 -26
- package/dist/css-macro/postcss.d.mts +0 -7
- package/dist/css-macro.d.mts +0 -18
- package/dist/defaults.d.mts +0 -11
- package/dist/gulp.d.mts +0 -24
- package/dist/index-BXrmQelt.d.mts +0 -672
- package/dist/index-BXrmQelt.d.ts +0 -672
- package/dist/index.d.mts +0 -15
- package/dist/postcss-html-transform.d.mts +0 -2
- package/dist/presets.d.mts +0 -76
- package/dist/reset.d.mts +0 -1
- package/dist/types.d.mts +0 -150
- package/dist/vite.d.mts +0 -17
- package/dist/webpack.d.mts +0 -25
- package/dist/webpack4.d.mts +0 -26
|
@@ -1,60 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
CommentExit(comment) {
|
|
45
|
-
if (IFDEF_ENDIF_RE.test(comment.text)) {
|
|
46
|
-
comment.raws.left = " ";
|
|
47
|
-
comment.raws.right = " ";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
};
|
|
1
|
+
const require_constants = require("../constants-p1dyh1x1.js");
|
|
2
|
+
//#region src/css-macro/postcss.ts
|
|
3
|
+
const IFDEF_ENDIF_RE = /#(?:ifn?def|endif)/;
|
|
4
|
+
const creator = () => {
|
|
5
|
+
return {
|
|
6
|
+
postcssPlugin: "postcss-weapp-tw-css-macro-plugin",
|
|
7
|
+
prepare() {
|
|
8
|
+
return {
|
|
9
|
+
AtRule(atRule, helper) {
|
|
10
|
+
if (atRule.name === "media") {
|
|
11
|
+
const values = [];
|
|
12
|
+
require_constants.matchCustomPropertyFromValue(atRule.params, (arr) => {
|
|
13
|
+
values.push(arr[1]);
|
|
14
|
+
});
|
|
15
|
+
if (values.length > 0) {
|
|
16
|
+
const isNegative = atRule.params.includes("not");
|
|
17
|
+
const text = values.join(" ");
|
|
18
|
+
const comment = isNegative ? require_constants.ifndef(text) : require_constants.ifdef(text);
|
|
19
|
+
const nextNodes = [
|
|
20
|
+
helper.comment({
|
|
21
|
+
raws: { before: "\n" },
|
|
22
|
+
text: comment.start
|
|
23
|
+
}),
|
|
24
|
+
...(atRule.nodes ?? []).map((node) => node.clone()),
|
|
25
|
+
helper.comment({
|
|
26
|
+
raws: { before: "\n" },
|
|
27
|
+
text: comment.end
|
|
28
|
+
})
|
|
29
|
+
];
|
|
30
|
+
atRule.replaceWith(nextNodes);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
CommentExit(comment) {
|
|
35
|
+
if (IFDEF_ENDIF_RE.test(comment.text)) {
|
|
36
|
+
comment.raws.left = " ";
|
|
37
|
+
comment.raws.right = " ";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
53
43
|
};
|
|
54
44
|
creator.postcss = true;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
exports.default = postcss_default;
|
|
59
|
-
|
|
60
|
-
module.exports = exports.default;
|
|
45
|
+
//#endregion
|
|
46
|
+
module.exports = creator;
|
|
@@ -1,58 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
44
|
-
CommentExit(comment) {
|
|
45
|
-
if (IFDEF_ENDIF_RE.test(comment.text)) {
|
|
46
|
-
comment.raws.left = " ";
|
|
47
|
-
comment.raws.right = " ";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
};
|
|
1
|
+
import { a as matchCustomPropertyFromValue, i as ifndef, r as ifdef } from "../constants-B-_T5UnW.mjs";
|
|
2
|
+
//#region src/css-macro/postcss.ts
|
|
3
|
+
const IFDEF_ENDIF_RE = /#(?:ifn?def|endif)/;
|
|
4
|
+
const creator = () => {
|
|
5
|
+
return {
|
|
6
|
+
postcssPlugin: "postcss-weapp-tw-css-macro-plugin",
|
|
7
|
+
prepare() {
|
|
8
|
+
return {
|
|
9
|
+
AtRule(atRule, helper) {
|
|
10
|
+
if (atRule.name === "media") {
|
|
11
|
+
const values = [];
|
|
12
|
+
matchCustomPropertyFromValue(atRule.params, (arr) => {
|
|
13
|
+
values.push(arr[1]);
|
|
14
|
+
});
|
|
15
|
+
if (values.length > 0) {
|
|
16
|
+
const isNegative = atRule.params.includes("not");
|
|
17
|
+
const text = values.join(" ");
|
|
18
|
+
const comment = isNegative ? ifndef(text) : ifdef(text);
|
|
19
|
+
const nextNodes = [
|
|
20
|
+
helper.comment({
|
|
21
|
+
raws: { before: "\n" },
|
|
22
|
+
text: comment.start
|
|
23
|
+
}),
|
|
24
|
+
...(atRule.nodes ?? []).map((node) => node.clone()),
|
|
25
|
+
helper.comment({
|
|
26
|
+
raws: { before: "\n" },
|
|
27
|
+
text: comment.end
|
|
28
|
+
})
|
|
29
|
+
];
|
|
30
|
+
atRule.replaceWith(nextNodes);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
CommentExit(comment) {
|
|
35
|
+
if (IFDEF_ENDIF_RE.test(comment.text)) {
|
|
36
|
+
comment.raws.left = " ";
|
|
37
|
+
comment.raws.right = " ";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
53
43
|
};
|
|
54
44
|
creator.postcss = true;
|
|
55
|
-
|
|
56
|
-
export {
|
|
57
|
-
postcss_default as default
|
|
58
|
-
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { creator as default };
|
package/dist/css-macro.d.ts
CHANGED
|
@@ -1,20 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
interface Options {
|
|
4
|
-
variantsMap?: Record<string, string | {
|
|
5
|
-
value: string;
|
|
6
|
-
negative?: boolean;
|
|
7
|
-
}>;
|
|
8
|
-
dynamic?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const cssMacro: {
|
|
11
|
-
(options: Options | undefined): {
|
|
12
|
-
handler: tailwindcss_types_config.PluginCreator;
|
|
13
|
-
config?: Partial<tailwindcss_types_config.Config>;
|
|
14
|
-
};
|
|
15
|
-
__isOptionsFunction: true;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
// @ts-ignore
|
|
19
|
-
export = cssMacro;
|
|
20
|
-
export type { Options };
|
|
1
|
+
export * from './css-macro/index'
|
package/dist/css-macro.js
CHANGED
|
@@ -1,52 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _plugin = require('tailwindcss/plugin'); var _plugin2 = _interopRequireDefault(_plugin);
|
|
12
|
-
var defaultOptions = {
|
|
13
|
-
dynamic: true,
|
|
14
|
-
variantsMap: {}
|
|
1
|
+
const require_chunk = require("./chunk-8l464Juk.js");
|
|
2
|
+
require("./utils-DmC9_In3.js");
|
|
3
|
+
const require_constants = require("./constants-p1dyh1x1.js");
|
|
4
|
+
let tailwindcss_plugin = require("tailwindcss/plugin");
|
|
5
|
+
tailwindcss_plugin = require_chunk.__toESM(tailwindcss_plugin);
|
|
6
|
+
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
7
|
+
//#region src/css-macro/index.ts
|
|
8
|
+
const defaultOptions = {
|
|
9
|
+
dynamic: true,
|
|
10
|
+
variantsMap: {}
|
|
15
11
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const query = variant.negative ? _chunkE7I5TW5Kjs.createNegativeMediaQuery.call(void 0, variant.value) : _chunkE7I5TW5Kjs.createMediaQuery.call(void 0, variant.value);
|
|
42
|
-
addVariant(variant.name, query);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
12
|
+
const cssMacro = tailwindcss_plugin.default.withOptions((options) => {
|
|
13
|
+
const { dynamic, variantsMap } = (0, _weapp_tailwindcss_shared.defu)(options ?? {}, defaultOptions);
|
|
14
|
+
const staticVariants = Object.entries(variantsMap).map(([name, config]) => {
|
|
15
|
+
if (typeof config === "string") return {
|
|
16
|
+
name,
|
|
17
|
+
negative: false,
|
|
18
|
+
value: config
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
name,
|
|
22
|
+
negative: Boolean(config.negative),
|
|
23
|
+
value: config.value
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
return (api) => {
|
|
27
|
+
const { matchVariant, addVariant } = api;
|
|
28
|
+
if (dynamic && typeof matchVariant === "function") {
|
|
29
|
+
matchVariant("ifdef", (value) => require_constants.createMediaQuery(value));
|
|
30
|
+
matchVariant("ifndef", (value) => require_constants.createNegativeMediaQuery(value));
|
|
31
|
+
}
|
|
32
|
+
if (typeof addVariant === "function") for (const variant of staticVariants) {
|
|
33
|
+
const query = variant.negative ? require_constants.createNegativeMediaQuery(variant.value) : require_constants.createMediaQuery(variant.value);
|
|
34
|
+
addVariant(variant.name, query);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
46
37
|
});
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
exports.default = css_macro_default;
|
|
51
|
-
|
|
52
|
-
module.exports = exports.default;
|
|
38
|
+
//#endregion
|
|
39
|
+
module.exports = cssMacro;
|
package/dist/css-macro.mjs
CHANGED
|
@@ -1,50 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./chunk-OOHJLO5M.mjs";
|
|
4
|
-
import {
|
|
5
|
-
createMediaQuery,
|
|
6
|
-
createNegativeMediaQuery
|
|
7
|
-
} from "./chunk-ZCH4YINE.mjs";
|
|
8
|
-
import "./chunk-NNOQDMUP.mjs";
|
|
9
|
-
|
|
10
|
-
// src/css-macro/index.ts
|
|
1
|
+
import { t as defu } from "./utils-7DUGTFED.mjs";
|
|
2
|
+
import { n as createNegativeMediaQuery, t as createMediaQuery } from "./constants-B-_T5UnW.mjs";
|
|
11
3
|
import plugin from "tailwindcss/plugin";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
//#region src/css-macro/index.ts
|
|
5
|
+
const defaultOptions = {
|
|
6
|
+
dynamic: true,
|
|
7
|
+
variantsMap: {}
|
|
15
8
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
const query = variant.negative ? createNegativeMediaQuery(variant.value) : createMediaQuery(variant.value);
|
|
42
|
-
addVariant(variant.name, query);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
};
|
|
9
|
+
const cssMacro = plugin.withOptions((options) => {
|
|
10
|
+
const { dynamic, variantsMap } = defu(options ?? {}, defaultOptions);
|
|
11
|
+
const staticVariants = Object.entries(variantsMap).map(([name, config]) => {
|
|
12
|
+
if (typeof config === "string") return {
|
|
13
|
+
name,
|
|
14
|
+
negative: false,
|
|
15
|
+
value: config
|
|
16
|
+
};
|
|
17
|
+
return {
|
|
18
|
+
name,
|
|
19
|
+
negative: Boolean(config.negative),
|
|
20
|
+
value: config.value
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
return (api) => {
|
|
24
|
+
const { matchVariant, addVariant } = api;
|
|
25
|
+
if (dynamic && typeof matchVariant === "function") {
|
|
26
|
+
matchVariant("ifdef", (value) => createMediaQuery(value));
|
|
27
|
+
matchVariant("ifndef", (value) => createNegativeMediaQuery(value));
|
|
28
|
+
}
|
|
29
|
+
if (typeof addVariant === "function") for (const variant of staticVariants) {
|
|
30
|
+
const query = variant.negative ? createNegativeMediaQuery(variant.value) : createMediaQuery(variant.value);
|
|
31
|
+
addVariant(variant.name, query);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
46
34
|
});
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
css_macro_default as default
|
|
50
|
-
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { cssMacro as default };
|
package/dist/defaults.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import '@weapp-tailwindcss/postcss/types';
|
|
4
|
-
import 'tailwindcss-patch';
|
|
5
|
-
import 'node:buffer';
|
|
6
|
-
import 'webpack';
|
|
7
|
-
import 'lru-cache';
|
|
8
|
-
|
|
9
|
-
declare function getDefaultOptions(): UserDefinedOptions;
|
|
10
|
-
|
|
11
|
-
export { getDefaultOptions };
|
|
1
|
+
import type { UserDefinedOptions } from './types';
|
|
2
|
+
export declare function getDefaultOptions(): UserDefinedOptions;
|
package/dist/defaults.js
CHANGED
|
@@ -1,8 +1,132 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
require(
|
|
5
|
-
require(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./chunk-8l464Juk.js");
|
|
3
|
+
require("./utils-DmC9_In3.js");
|
|
4
|
+
let _weapp_core_escape = require("@weapp-core/escape");
|
|
5
|
+
let _weapp_tailwindcss_shared = require("@weapp-tailwindcss/shared");
|
|
6
|
+
//#region src/defaults.ts
|
|
7
|
+
const CSS_FILE_PATTERN = /.+\.(?:wx|ac|jx|tt|q|c|ty)ss$/;
|
|
8
|
+
const HTML_FILE_PATTERN = /.+\.(?:(?:wx|ax|jx|ks|tt|q|ty|xhs)ml|swan)$/;
|
|
9
|
+
const JS_FILE_PATTERN = /.+\.[cm]?js?$/;
|
|
10
|
+
const BACKSLASH_RE = /\\/g;
|
|
11
|
+
function normalizePath(p) {
|
|
12
|
+
return p.replace(BACKSLASH_RE, "/");
|
|
13
|
+
}
|
|
14
|
+
const MPX_STYLES_DIR_PATTERN = /(?:^|\/)styles\/.*\.(?:wx|ac|jx|tt|q|c|ty)ss$/i;
|
|
15
|
+
const KBONE_MAIN_CSS_RE = /^(?:common\/)?miniprogram-app/;
|
|
16
|
+
const IMPLICIT_MAIN_CSS_RE = /^(?:app|common\/main|bundle)(?:\.|\/|$)/;
|
|
17
|
+
const MAIN_CSS_CHUNK_MATCHERS = {
|
|
18
|
+
"uni-app": (file) => file.startsWith("common/main") || file.startsWith("app"),
|
|
19
|
+
"uni-app-vite": (file) => file.startsWith("app") || file.startsWith("common/main"),
|
|
20
|
+
"uni-app-x": (file) => file.startsWith("app") || file.startsWith("common/main"),
|
|
21
|
+
"mpx": (file) => {
|
|
22
|
+
const normalized = normalizePath(file);
|
|
23
|
+
if (normalized.startsWith("app")) return true;
|
|
24
|
+
return MPX_STYLES_DIR_PATTERN.test(normalized);
|
|
25
|
+
},
|
|
26
|
+
"taro": (file) => file.startsWith("app"),
|
|
27
|
+
"remax": (file) => file.startsWith("app"),
|
|
28
|
+
"rax": (file) => file.startsWith("bundle"),
|
|
29
|
+
"native": (file) => file.startsWith("app"),
|
|
30
|
+
"weapp-vite": (file) => file.startsWith("app"),
|
|
31
|
+
"kbone": (file) => KBONE_MAIN_CSS_RE.test(file)
|
|
32
|
+
};
|
|
33
|
+
const alwaysFalse = () => false;
|
|
34
|
+
function createMainCssChunkMatcher() {
|
|
35
|
+
return (file, appType) => {
|
|
36
|
+
if (!appType) {
|
|
37
|
+
const normalized = normalizePath(file);
|
|
38
|
+
return IMPLICIT_MAIN_CSS_RE.test(normalized) || MPX_STYLES_DIR_PATTERN.test(normalized) || KBONE_MAIN_CSS_RE.test(normalized);
|
|
39
|
+
}
|
|
40
|
+
const matcher = MAIN_CSS_CHUNK_MATCHERS[appType];
|
|
41
|
+
return matcher ? matcher(file) : true;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function getDefaultOptions() {
|
|
45
|
+
return {
|
|
46
|
+
/**
|
|
47
|
+
* wxss 微信小程序
|
|
48
|
+
* acss 支付宝小程序
|
|
49
|
+
* jxss 京东小程序
|
|
50
|
+
* ttss 头条小程序
|
|
51
|
+
* qss QQ小程序
|
|
52
|
+
* css 最正常的样式文件
|
|
53
|
+
* tyss 涂鸦小程序
|
|
54
|
+
*/
|
|
55
|
+
cssMatcher: (file) => CSS_FILE_PATTERN.test(file),
|
|
56
|
+
/**
|
|
57
|
+
* wxml 微信小程序
|
|
58
|
+
* axml 支付宝小程序
|
|
59
|
+
* jxml 京东小程序
|
|
60
|
+
* ksml 快手小程序
|
|
61
|
+
* ttml 头条小程序
|
|
62
|
+
* qml QQ小程序
|
|
63
|
+
* tyml 涂鸦小程序
|
|
64
|
+
* xhsml 小红书小程序
|
|
65
|
+
* swan 百度小程序
|
|
66
|
+
*/
|
|
67
|
+
htmlMatcher: (file) => HTML_FILE_PATTERN.test(file),
|
|
68
|
+
jsMatcher: (file) => {
|
|
69
|
+
if (file.includes("node_modules")) return false;
|
|
70
|
+
return JS_FILE_PATTERN.test(file);
|
|
71
|
+
},
|
|
72
|
+
mainCssChunkMatcher: createMainCssChunkMatcher(),
|
|
73
|
+
wxsMatcher: alwaysFalse,
|
|
74
|
+
cssPreflight: {
|
|
75
|
+
"box-sizing": "border-box",
|
|
76
|
+
"border-width": "0",
|
|
77
|
+
"border-style": "solid",
|
|
78
|
+
"border-color": "currentColor"
|
|
79
|
+
},
|
|
80
|
+
disabled: false,
|
|
81
|
+
onLoad: _weapp_tailwindcss_shared.noop,
|
|
82
|
+
onStart: _weapp_tailwindcss_shared.noop,
|
|
83
|
+
onEnd: _weapp_tailwindcss_shared.noop,
|
|
84
|
+
onUpdate: _weapp_tailwindcss_shared.noop,
|
|
85
|
+
customAttributes: {},
|
|
86
|
+
customReplaceDictionary: _weapp_core_escape.MappingChars2String,
|
|
87
|
+
appType: void 0,
|
|
88
|
+
arbitraryValues: { allowDoubleQuotes: false },
|
|
89
|
+
cssChildCombinatorReplaceValue: ["view", "text"],
|
|
90
|
+
inlineWxs: false,
|
|
91
|
+
injectAdditionalCssVarScope: false,
|
|
92
|
+
rewriteCssImports: true,
|
|
93
|
+
jsPreserveClass: (keyword) => {
|
|
94
|
+
/**
|
|
95
|
+
* 默认保留 keyword
|
|
96
|
+
*/
|
|
97
|
+
if (keyword === "*") return true;
|
|
98
|
+
return false;
|
|
99
|
+
},
|
|
100
|
+
staleClassNameFallback: void 0,
|
|
101
|
+
disabledDefaultTemplateHandler: false,
|
|
102
|
+
cssSelectorReplacement: {
|
|
103
|
+
root: [
|
|
104
|
+
"page",
|
|
105
|
+
".tw-root",
|
|
106
|
+
"wx-root-portal-content"
|
|
107
|
+
],
|
|
108
|
+
universal: ["view", "text"]
|
|
109
|
+
},
|
|
110
|
+
babelParserOptions: {
|
|
111
|
+
sourceType: "unambiguous",
|
|
112
|
+
cache: true,
|
|
113
|
+
cacheKey: "st:unambiguous"
|
|
114
|
+
},
|
|
115
|
+
postcssOptions: {},
|
|
116
|
+
cssRemoveProperty: true,
|
|
117
|
+
cssRemoveHoverPseudoClass: true,
|
|
118
|
+
ignoreCallExpressionIdentifiers: [],
|
|
119
|
+
ignoreTaggedTemplateExpressionIdentifiers: ["weappTwIgnore"],
|
|
120
|
+
replaceRuntimePackages: false,
|
|
121
|
+
generator: {
|
|
122
|
+
mode: "auto",
|
|
123
|
+
target: "weapp"
|
|
124
|
+
},
|
|
125
|
+
tailwindcssPatcherOptions: { filter(className) {
|
|
126
|
+
return !(0, _weapp_core_escape.isAllowedClassName)(className);
|
|
127
|
+
} },
|
|
128
|
+
logLevel: "info"
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
//#endregion
|
|
132
|
+
exports.getDefaultOptions = getDefaultOptions;
|