@weapp-tailwindcss/postcss 3.3.4 → 3.3.5
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/compat/author-selector.d.ts +2 -0
- package/dist/compat/legacy-css/apply.d.ts +2 -0
- package/dist/compat/legacy-css/dedupe.d.ts +2 -0
- package/dist/compat/legacy-css/index.d.ts +4 -0
- package/dist/compat/legacy-css/selectors.d.ts +7 -0
- package/dist/compat/legacy-css/units.d.ts +1 -0
- package/dist/compat/mini-program-css/class-presence.d.ts +3 -0
- package/dist/compat/mini-program-css/content-init.d.ts +3 -0
- package/dist/compat/mini-program-css/empty-blocks.d.ts +3 -0
- package/dist/compat/mini-program-css/index.d.ts +2 -0
- package/dist/compat/tailwindcss-v4/author-functions.d.ts +7 -0
- package/dist/compat/tailwindcss-v4/theme-source.d.ts +4 -0
- package/dist/compat/tailwindcss-v4.d.ts +1 -0
- package/dist/compat/uni-app-x-author-apply.d.ts +10 -0
- package/dist/compat/uni-app-x-border.d.ts +6 -0
- package/dist/compat/uni-app-x-style-value.d.ts +9 -0
- package/dist/framework-pipeline.d.ts +4 -0
- package/dist/generator-plugin/local-imports.d.ts +6 -1
- package/dist/index.cjs +1229 -95
- package/dist/index.d.ts +12 -2
- package/dist/index.js +1198 -103
- package/dist/plugins/applyConfiguredCssCalc.d.ts +9 -0
- package/dist/postcss-runtime.d.ts +1 -1
- package/dist/selectorParser/utils.d.ts +1 -1
- package/dist/syntax/css-import.d.ts +20 -0
- package/dist/syntax/index.d.ts +2 -0
- package/dist/syntax/parse.d.ts +13 -0
- package/dist/types.d.ts +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IStyleHandlerOptions } from '../types.js';
|
|
2
|
+
export type ApplyConfiguredCssCalcOptions = Pick<IStyleHandlerOptions, 'cssCalc' | 'cssOptions' | 'customPropertyValues'> & {
|
|
3
|
+
/** 额外用于收集自定义属性的 CSS,例如生成器完整产物。 */
|
|
4
|
+
contextCss?: string | undefined;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* 仅按 `cssCalc` 配置预计算 `calc()` / `var()`,不跑小程序选择器替换或单位转换。
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyConfiguredCssCalc(css: string, options?: ApplyConfiguredCssCalcOptions): Promise<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type { AcceptedPlugin, AtRule, Container, Declaration, Document, Helpers, Node, Plugin, PluginCreator, ProcessOptions, Processor, Result, Root, Rule, } from 'postcss';
|
|
1
|
+
export type { AcceptedPlugin, AtRule, ChildNode, Container, Declaration, Document, Helpers, Node, Plugin, PluginCreator, ProcessOptions, Processor, Result, Root, Rule, } from 'postcss';
|
|
2
2
|
export { default as postcss } from 'postcss';
|
|
@@ -8,4 +8,4 @@ export type ParserTransformOptions = Partial<{
|
|
|
8
8
|
export declare function normalizeTransformOptions(options?: ParserTransformOptions): ParserTransformOptions;
|
|
9
9
|
export declare function mklist(node: Node): Node[];
|
|
10
10
|
export declare function composeIsPseudoAst(strs: string | string[]): Node[];
|
|
11
|
-
export declare function getCombinatorSelectorAst(options: IStyleHandlerOptions): (psp.Pseudo | psp.Selector | psp.String | psp.
|
|
11
|
+
export declare function getCombinatorSelectorAst(options: IStyleHandlerOptions): (psp.Pseudo | psp.Selector | psp.String | psp.Comment | psp.Tag | psp.Root | psp.Nesting | psp.Identifier | psp.Combinator | psp.ClassName | psp.Attribute | psp.Universal)[];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface CssImportSpecifier {
|
|
2
|
+
specifier: string;
|
|
3
|
+
raw: string;
|
|
4
|
+
quote: string | undefined;
|
|
5
|
+
}
|
|
6
|
+
export interface CssImportSourceParam {
|
|
7
|
+
none: boolean;
|
|
8
|
+
sourcePath: string | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 解析 `@import` / `@use` / `@forward` 参数中的请求串。
|
|
12
|
+
* 无 escape/注释的引号和 `url("...")` 走快路径;复杂输入才使用 CSS tokenizer。
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseCssImportSpecifier(params: string): CssImportSpecifier | undefined;
|
|
15
|
+
/** 把文件系统路径写成 CSS 请求串;缓存和读文件仍使用原始路径。 */
|
|
16
|
+
export declare function quoteCssImportSpecifier(file: string, quote?: string): string;
|
|
17
|
+
/** 判断 import 参数是否指向 Tailwind CSS 包入口。 */
|
|
18
|
+
export declare function isTailwindCssImport(params: string): boolean;
|
|
19
|
+
/** 解析 `@import "..." source(...)` 中的 source 参数。 */
|
|
20
|
+
export declare function parseImportSourceParam(params: string): CssImportSourceParam | undefined;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { type CssImportSourceParam, type CssImportSpecifier, isTailwindCssImport, parseCssImportSpecifier, parseImportSourceParam, quoteCssImportSpecifier, } from './css-import.js';
|
|
2
|
+
export { isUniAppXStyleSourceEmpty, parseCssSource, parseScssSource, parseUniAppXStyleSource, scss, stringifyScssSource, } from './parse.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Root } from 'postcss';
|
|
2
|
+
export { default as scss } from 'postcss-scss';
|
|
3
|
+
/** 解析标准 CSS;调用方负责处理非法输入。 */
|
|
4
|
+
export declare function parseCssSource(source: string, from?: string): Root;
|
|
5
|
+
/**
|
|
6
|
+
* 解析 SCSS/Sass 风格源码。
|
|
7
|
+
* `postcss.parse` 不读取 syntax 选项,行注释和插值必须走 SCSS parser。
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseScssSource(source: string, from?: string): Root;
|
|
10
|
+
export declare function stringifyScssSource(root: Root): string;
|
|
11
|
+
/** Harmony 在 Sass 预处理前读取局部样式;必须识别行注释,避免将其并入选择器。 */
|
|
12
|
+
export declare function parseUniAppXStyleSource(source: string): Root;
|
|
13
|
+
export declare function isUniAppXStyleSourceEmpty(source: string): boolean;
|
package/dist/types.d.ts
CHANGED
|
@@ -289,6 +289,6 @@ export interface StyleHandler {
|
|
|
289
289
|
/**
|
|
290
290
|
* 处理调用方持有的 CSS AST。输入 Root 不会被原地修改,返回结果也不会与内部缓存共享可变节点。
|
|
291
291
|
*/
|
|
292
|
-
transformRoot: (root: Root, opt?: Partial<IStyleHandlerOptions>) => Promise<PostcssResult
|
|
292
|
+
transformRoot: (root: Root, opt?: Partial<IStyleHandlerOptions>) => Promise<PostcssResult<Root>>;
|
|
293
293
|
getPipeline: (opt?: Partial<IStyleHandlerOptions>) => StyleProcessingPipeline;
|
|
294
294
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weapp-tailwindcss/postcss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.3.
|
|
4
|
+
"version": "3.3.5",
|
|
5
5
|
"description": "PostCSS transforms that bring Tailwind CSS compatibility to every platform. 将 Tailwind CSS 兼容能力带到全端的 PostCSS 转换工具。",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -66,20 +66,20 @@
|
|
|
66
66
|
"node": "^20.19.0 || >=22.12.0"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@csstools/css-color-parser": "^4.2.
|
|
69
|
+
"@csstools/css-color-parser": "^4.2.3",
|
|
70
70
|
"@csstools/css-parser-algorithms": "^4.0.0",
|
|
71
71
|
"@csstools/css-tokenizer": "^4.0.0",
|
|
72
72
|
"@tailwindcss-mangle/engine": "0.2.0",
|
|
73
73
|
"@weapp-core/escape": "~8.0.0",
|
|
74
74
|
"@weapp-tailwindcss/postcss-calc": "1.0.7",
|
|
75
75
|
"@weapp-tailwindcss/shared": "2.0.3",
|
|
76
|
-
"autoprefixer": "^10.
|
|
76
|
+
"autoprefixer": "^10.6.0",
|
|
77
77
|
"es-toolkit": "^1.52.0",
|
|
78
78
|
"lru-cache": "11.5.2",
|
|
79
79
|
"micromatch": "^4.0.8",
|
|
80
80
|
"postcss": "^8.5.28",
|
|
81
81
|
"postcss-load-config": "^6.0.1",
|
|
82
|
-
"postcss-preset-env": "^11.5.
|
|
82
|
+
"postcss-preset-env": "^11.5.3",
|
|
83
83
|
"postcss-pxtrans": "^1.0.4",
|
|
84
84
|
"postcss-rem-to-responsive-pixel": "^7.0.5",
|
|
85
85
|
"postcss-rule-unit-converter": "^0.2.3",
|