@weapp-tailwindcss/postcss 3.1.6 → 3.1.7

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.
@@ -1,6 +1,7 @@
1
1
  import type { AcceptedPlugin } from 'postcss';
2
2
  import type { FeatureSignal } from './content-probe';
3
3
  import type { IStyleHandlerOptions } from './types';
4
+ import { resolvePostcssFrameworkProfile } from './frameworks';
4
5
  export type PipelineStage = 'pre' | 'normal' | 'post';
5
6
  export interface PipelineNodeCursor {
6
7
  id: string;
@@ -38,6 +39,9 @@ export interface ResolvedPipelineNode extends PipelineNodeCursor {
38
39
  context: PipelineNodeContext;
39
40
  }
40
41
  export interface StyleProcessingPipeline {
42
+ framework: ReturnType<typeof resolvePostcssFrameworkProfile>['framework'];
43
+ target: ReturnType<typeof resolvePostcssFrameworkProfile>['target'];
44
+ branch: ReturnType<typeof resolvePostcssFrameworkProfile>['branch'];
41
45
  nodes: ResolvedPipelineNode[];
42
46
  plugins: AcceptedPlugin[];
43
47
  }
@@ -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.Root | psp.Tag | psp.Nesting | psp.Identifier | psp.Comment | psp.Combinator | psp.ClassName | psp.Attribute | psp.Universal)[];
11
+ export declare function getCombinatorSelectorAst(options: IStyleHandlerOptions): (psp.Pseudo | psp.Selector | psp.String | psp.Tag | psp.Root | psp.Nesting | psp.Identifier | psp.Comment | psp.Combinator | psp.ClassName | psp.Attribute | psp.Universal)[];
@@ -0,0 +1 @@
1
+ export { createPostcssStyleTargetProfile, type PostcssStyleTarget, type PostcssStyleTargetProfile, } from './style';
@@ -0,0 +1,8 @@
1
+ import type { Result } from 'postcss';
2
+ import type { IStyleHandlerOptions } from '../types';
3
+ export type PostcssStyleTarget = 'generic' | 'mini-program' | 'uni-app-x-css-uvue' | 'uni-app-x-css-webview' | 'web';
4
+ export interface PostcssStyleTargetProfile {
5
+ target: PostcssStyleTarget;
6
+ postprocess: (result: Result, options: IStyleHandlerOptions) => Result;
7
+ }
8
+ export declare function createPostcssStyleTargetProfile(target: PostcssStyleTarget): PostcssStyleTargetProfile;
package/dist/types.d.ts CHANGED
@@ -5,6 +5,7 @@ import type pxtrans from 'postcss-pxtrans';
5
5
  import type { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
6
6
  import type { GlobalUnitTransform, UserDefinedOptions as UnitConverterOptions, UnitMap } from 'postcss-rule-unit-converter';
7
7
  import type { WeappAutoprefixerOptions } from './autoprefixer';
8
+ import type { PostcssAppType } from './branches';
8
9
  import type { StyleProcessingPipeline } from './pipeline';
9
10
  import type { IContext as PostcssContext } from './plugins/ctx';
10
11
  import type { InjectPreflight } from './preflight';
@@ -137,6 +138,7 @@ export interface CssOptions {
137
138
  tailwindcssV4GradientFallback?: boolean | undefined;
138
139
  }
139
140
  export type IStyleHandlerOptions = {
141
+ appType?: PostcssAppType | undefined;
140
142
  ctx?: PostcssContext | undefined;
141
143
  /**
142
144
  * @deprecated 请使用 `cssOptions.platform`。
@@ -173,6 +175,7 @@ export type IStyleHandlerOptions = {
173
175
  */
174
176
  cssCalc?: boolean | CssCalcOptions | (string | RegExp)[] | undefined;
175
177
  uniAppX?: boolean | undefined;
178
+ /** uni-app x 的 CSS 输出目标;`uvue` 表示原生 uvue/nvue 样式链路,未设置时按 WebView CSS 处理。 */
176
179
  uniAppXCssTarget?: UniAppXCssTarget | undefined;
177
180
  uniAppXUnsupported?: UniAppXUnsupportedMode | undefined;
178
181
  majorVersion?: 4 | undefined;
@@ -247,6 +250,7 @@ export interface UserDefinedPostcssOptions {
247
250
  */
248
251
  tailwindcssV4GradientFallback?: boolean | undefined;
249
252
  uniAppX?: boolean | undefined;
253
+ /** uni-app x 的 CSS 输出目标;`uvue` 表示原生 uvue/nvue 样式链路,未设置时按 WebView CSS 处理。 */
250
254
  uniAppXCssTarget?: UniAppXCssTarget | undefined;
251
255
  uniAppXUnsupported?: UniAppXUnsupportedMode | undefined;
252
256
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/postcss",
3
- "version": "3.1.6",
3
+ "version": "3.1.7",
4
4
  "description": "@weapp-tailwindcss/postcss",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -76,9 +76,9 @@
76
76
  "postcss-rule-unit-converter": "^0.2.2",
77
77
  "postcss-selector-parser": "~7.1.4",
78
78
  "postcss-value-parser": "^4.2.0",
79
- "tailwindcss-config": "2.0.1",
80
79
  "@weapp-tailwindcss/postcss-calc": "^1.0.2",
81
- "@weapp-tailwindcss/shared": "2.0.0"
80
+ "@weapp-tailwindcss/shared": "2.0.0",
81
+ "tailwindcss-config": "2.0.1"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@csstools/css-color-parser": "^4.1.9",