@weapp-tailwindcss/postcss 3.2.8 → 3.2.10

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.
@@ -15,7 +15,7 @@ var __copyProps = (to, from, except, desc) => {
15
15
  }
16
16
  return to;
17
17
  };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
19
  value: mod,
20
20
  enumerable: true
21
21
  }) : target, mod));
@@ -0,0 +1 @@
1
+ export declare function selectorContainsPseudoClass(selector: string, pseudoClasses: readonly string[]): boolean;
@@ -7,6 +7,7 @@ export interface TransformContext {
7
7
  rootReplacement?: string;
8
8
  universalReplacement?: string;
9
9
  selectorReplacerOptions?: InternalCssSelectorReplacerOptions;
10
+ unsupportedPseudoClasses?: ReadonlySet<string>;
10
11
  }
11
12
  export interface CachedSelectorTransformResult {
12
13
  action: 'keep' | 'update' | 'remove';
@@ -0,0 +1,5 @@
1
+ import type { Node } from 'postcss-selector-parser';
2
+ import type { IStyleHandlerOptions } from '../../types.js';
3
+ export declare function getUnsupportedPseudoClassSet(options: IStyleHandlerOptions): ReadonlySet<string>;
4
+ export declare function shouldRemoveUnsupportedPseudoClass(value: string, options: IStyleHandlerOptions): boolean;
5
+ export declare function removeUnsupportedPseudoSelector(node: Node, options: IStyleHandlerOptions, unsupportedPseudoClasses?: ReadonlySet<string>): boolean;
@@ -1,4 +1,5 @@
1
1
  export { isOnlyBeforeAndAfterPseudoElement } from './selectorParser/before-after.js';
2
2
  export { getFallbackRemove } from './selectorParser/fallback.js';
3
+ export { selectorContainsPseudoClass } from './selectorParser/pseudo.js';
3
4
  export { ruleTransformSync } from './selectorParser/rule-transformer.js';
4
5
  export { composeIsPseudoAst, getCombinatorSelectorAst, mklist, } from './selectorParser/utils.js';
package/dist/types.d.ts CHANGED
@@ -129,7 +129,9 @@ export interface CssOptions {
129
129
  unitsToPx?: boolean | UnitsToPxOptions | undefined;
130
130
  unitConversion?: UnitConversionOptions | undefined;
131
131
  platform?: string | undefined;
132
+ cssRemoveActivePseudoClass?: boolean | undefined;
132
133
  cssRemoveHoverPseudoClass?: boolean | undefined;
134
+ cssRemoveFocusPseudoClass?: boolean | undefined;
133
135
  cssRemoveProperty?: boolean | undefined;
134
136
  cssCalc?: boolean | CssCalcOptions | (string | RegExp)[] | undefined;
135
137
  /**
@@ -150,10 +152,16 @@ export type IStyleHandlerOptions = {
150
152
  * @deprecated 请使用 `cssOptions.cssRemoveProperty`。
151
153
  */
152
154
  cssRemoveProperty?: boolean | undefined;
155
+ /**
156
+ * @deprecated 请使用 `cssOptions.cssRemoveActivePseudoClass`。
157
+ */
158
+ cssRemoveActivePseudoClass?: boolean | undefined;
153
159
  /**
154
160
  * @deprecated 请使用 `cssOptions.cssRemoveHoverPseudoClass`。
155
161
  */
156
162
  cssRemoveHoverPseudoClass?: boolean | undefined;
163
+ /** @deprecated 请使用 `cssOptions.cssRemoveFocusPseudoClass`。 */
164
+ cssRemoveFocusPseudoClass?: boolean | undefined;
157
165
  /**
158
166
  * @deprecated 请使用 `cssOptions.tailwindcssV4GradientFallback`。
159
167
  */
@@ -230,6 +238,10 @@ export interface UserDefinedPostcssOptions {
230
238
  */
231
239
  unitConversion?: UnitConversionOptions | undefined;
232
240
  postcssOptions?: LoadedPostcssOptions | undefined;
241
+ /**
242
+ * @deprecated 请使用 `cssOptions.cssRemoveActivePseudoClass`。
243
+ */
244
+ cssRemoveActivePseudoClass?: boolean | undefined;
233
245
  /**
234
246
  * @deprecated 请使用 `cssOptions.cssRemoveHoverPseudoClass`。
235
247
  */
@@ -243,7 +255,7 @@ export interface UserDefinedPostcssOptions {
243
255
  *
244
256
  * `cssPreflight`、`cssPreflightRange`、`cssChildCombinatorReplaceValue`、`cssPresetEnv`、`autoprefixer`、
245
257
  * `atRules`、`injectAdditionalCssVarScope`、`cssSelectorReplacement`、`rem2rpx`、`px2rpx`、`unitsToPx`、
246
- * `unitConversion`、`platform`、`cssRemoveHoverPseudoClass`、`cssRemoveProperty`、`cssCalc`
258
+ * `unitConversion`、`platform`、`cssRemoveActivePseudoClass`、`cssRemoveHoverPseudoClass`、`cssRemoveProperty`、`cssCalc`
247
259
  * 与 `tailwindcssV4GradientFallback` 都推荐放在这里。
248
260
  */
249
261
  cssOptions?: CssOptions | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/postcss",
3
3
  "type": "module",
4
- "version": "3.2.8",
4
+ "version": "3.2.10",
5
5
  "description": "@weapp-tailwindcss/postcss",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -74,17 +74,17 @@
74
74
  "es-toolkit": "^1.50.0",
75
75
  "lru-cache": "11.5.2",
76
76
  "micromatch": "^4.0.8",
77
- "postcss": "^8.5.25",
77
+ "postcss": "^8.5.26",
78
78
  "postcss-load-config": "^6.0.1",
79
79
  "postcss-preset-env": "^11.3.2",
80
80
  "postcss-pxtrans": "^1.0.4",
81
81
  "postcss-rem-to-responsive-pixel": "^7.0.5",
82
82
  "postcss-rule-unit-converter": "^0.2.3",
83
- "postcss-selector-parser": "~7.1.4",
83
+ "postcss-selector-parser": "^7.1.5",
84
84
  "postcss-value-parser": "^4.2.0",
85
85
  "@weapp-tailwindcss/postcss-calc": "^1.0.3",
86
- "tailwindcss-config": "2.0.2",
87
- "@weapp-tailwindcss/shared": "2.0.1"
86
+ "@weapp-tailwindcss/shared": "2.0.1",
87
+ "tailwindcss-config": "2.0.2"
88
88
  },
89
89
  "devDependencies": {
90
90
  "@csstools/postcss-is-pseudo-class": "^6.0.0",