@weapp-tailwindcss/postcss 2.0.0 → 2.0.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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as IStyleHandlerOptions, S as StyleHandler, a as InternalCssSelectorReplacerOptions } from './types-SytH0h-o.mjs';
2
- export { C as CssCalcOptions, i as CssPreflightOptions, g as CustomRuleCallback, h as IPropValue, L as LoadedPostcssOptions, P as PipelineNodeContext, b as PipelineNodeCursor, d as PipelineStage, j as RequiredStyleHandlerOptions, R as ResolvedPipelineNode, e as StyleProcessingPipeline, U as UserDefinedPostcssOptions, f as createInjectPreflight, c as createStylePipeline } from './types-SytH0h-o.mjs';
1
+ import { I as IStyleHandlerOptions, S as StyleHandler, a as InternalCssSelectorReplacerOptions } from './types-6NcGD9Zr.mjs';
2
+ export { C as CssCalcOptions, h as CssPreflightOptions, g as IPropValue, L as LoadedPostcssOptions, P as PipelineNodeContext, b as PipelineNodeCursor, d as PipelineStage, i as RequiredStyleHandlerOptions, R as ResolvedPipelineNode, e as StyleProcessingPipeline, U as UserDefinedPostcssOptions, f as createInjectPreflight, c as createStylePipeline } from './types-6NcGD9Zr.mjs';
3
3
  export { pluginOptions as PresetEnvOptions } from 'postcss-preset-env';
4
4
  export { PxtransformOptions as Px2rpxOptions } from 'postcss-pxtransform';
5
5
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as IStyleHandlerOptions, S as StyleHandler, a as InternalCssSelectorReplacerOptions } from './types-SytH0h-o.js';
2
- export { C as CssCalcOptions, i as CssPreflightOptions, g as CustomRuleCallback, h as IPropValue, L as LoadedPostcssOptions, P as PipelineNodeContext, b as PipelineNodeCursor, d as PipelineStage, j as RequiredStyleHandlerOptions, R as ResolvedPipelineNode, e as StyleProcessingPipeline, U as UserDefinedPostcssOptions, f as createInjectPreflight, c as createStylePipeline } from './types-SytH0h-o.js';
1
+ import { I as IStyleHandlerOptions, S as StyleHandler, a as InternalCssSelectorReplacerOptions } from './types-6NcGD9Zr.js';
2
+ export { C as CssCalcOptions, h as CssPreflightOptions, g as IPropValue, L as LoadedPostcssOptions, P as PipelineNodeContext, b as PipelineNodeCursor, d as PipelineStage, i as RequiredStyleHandlerOptions, R as ResolvedPipelineNode, e as StyleProcessingPipeline, U as UserDefinedPostcssOptions, f as createInjectPreflight, c as createStylePipeline } from './types-6NcGD9Zr.js';
3
3
  export { pluginOptions as PresetEnvOptions } from 'postcss-preset-env';
4
4
  export { PxtransformOptions as Px2rpxOptions } from 'postcss-pxtransform';
5
5
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
package/dist/index.js CHANGED
@@ -937,11 +937,6 @@ var postcssWeappTailwindcssPostPlugin = (options) => {
937
937
  _optionalChain([atRule, 'access', _50 => _50.nodes, 'optionalAccess', _51 => _51.length]) === 0 && atRule.remove();
938
938
  };
939
939
  }
940
- if (typeof opts.customRuleCallback === "function") {
941
- p.Rule = (rule) => {
942
- _optionalChain([opts, 'access', _52 => _52.customRuleCallback, 'optionalCall', _53 => _53(rule, opts)]);
943
- };
944
- }
945
940
  return p;
946
941
  };
947
942
  postcssWeappTailwindcssPostPlugin.postcss = true;
@@ -1380,7 +1375,7 @@ function remakeCssVarSelector(selectors, options) {
1380
1375
  function commonChunkPreflight(node, options) {
1381
1376
  const { ctx, cssInjectPreflight, injectAdditionalCssVarScope } = options;
1382
1377
  if (testIfVariablesScope(node)) {
1383
- _optionalChain([ctx, 'optionalAccess', _54 => _54.markVariablesScope, 'call', _55 => _55(node)]);
1378
+ _optionalChain([ctx, 'optionalAccess', _52 => _52.markVariablesScope, 'call', _53 => _53(node)]);
1384
1379
  node.selectors = remakeCssVarSelector(node.selectors, options);
1385
1380
  node.before(makePseudoVarRule());
1386
1381
  if (typeof cssInjectPreflight === "function") {
@@ -1445,9 +1440,9 @@ var postcssWeappTailwindcssPrePlugin = (options) => {
1445
1440
  root.walkAtRules((atRule) => {
1446
1441
  if (atRule.name === "layer") {
1447
1442
  if (atRule.params === "properties") {
1448
- if (atRule.nodes === void 0 || _optionalChain([atRule, 'access', _56 => _56.nodes, 'optionalAccess', _57 => _57.length]) === 0) {
1443
+ if (atRule.nodes === void 0 || _optionalChain([atRule, 'access', _54 => _54.nodes, 'optionalAccess', _55 => _55.length]) === 0) {
1449
1444
  layerProperties = atRule;
1450
- } else if (_optionalChain([atRule, 'access', _58 => _58.first, 'optionalAccess', _59 => _59.type]) === "atrule" && isTailwindcssV4ModernCheck(atRule.first)) {
1445
+ } else if (_optionalChain([atRule, 'access', _56 => _56.first, 'optionalAccess', _57 => _57.type]) === "atrule" && isTailwindcssV4ModernCheck(atRule.first)) {
1451
1446
  if (layerProperties) {
1452
1447
  layerProperties.replaceWith(atRule.first.nodes);
1453
1448
  atRule.remove();
@@ -1459,7 +1454,7 @@ var postcssWeappTailwindcssPrePlugin = (options) => {
1459
1454
  atRule.replaceWith(atRule.nodes);
1460
1455
  }
1461
1456
  } else if (isTailwindcssV4ModernCheck(atRule)) {
1462
- if (_optionalChain([atRule, 'access', _60 => _60.first, 'optionalAccess', _61 => _61.type]) === "atrule" && atRule.first.name === "layer") {
1457
+ if (_optionalChain([atRule, 'access', _58 => _58.first, 'optionalAccess', _59 => _59.type]) === "atrule" && atRule.first.name === "layer") {
1463
1458
  atRule.replaceWith(atRule.first.nodes);
1464
1459
  }
1465
1460
  }
@@ -1504,7 +1499,7 @@ function createPipelineDefinitions(options) {
1504
1499
  normal: [],
1505
1500
  post: []
1506
1501
  };
1507
- const userPlugins = normalizeUserPlugins(_optionalChain([options, 'access', _62 => _62.postcssOptions, 'optionalAccess', _63 => _63.plugins]));
1502
+ const userPlugins = normalizeUserPlugins(_optionalChain([options, 'access', _60 => _60.postcssOptions, 'optionalAccess', _61 => _61.plugins]));
1508
1503
  userPlugins.forEach((plugin, index) => {
1509
1504
  stages.pre.push(createStaticDefinition(`pre:user-${index}`, "pre", plugin));
1510
1505
  });
@@ -1655,7 +1650,7 @@ function createInjectPreflight(options) {
1655
1650
  function createProcessOptions(options) {
1656
1651
  return {
1657
1652
  from: void 0,
1658
- ..._nullishCoalesce(_optionalChain([options, 'access', _64 => _64.postcssOptions, 'optionalAccess', _65 => _65.options]), () => ( {}))
1653
+ ..._nullishCoalesce(_optionalChain([options, 'access', _62 => _62.postcssOptions, 'optionalAccess', _63 => _63.options]), () => ( {}))
1659
1654
  };
1660
1655
  }
1661
1656
  var pipelineCache = /* @__PURE__ */ new WeakMap();
@@ -1670,7 +1665,7 @@ function getCachedPipeline(options) {
1670
1665
  return pipeline;
1671
1666
  }
1672
1667
  function getCachedProcessOptions(options) {
1673
- const source = _optionalChain([options, 'access', _66 => _66.postcssOptions, 'optionalAccess', _67 => _67.options]);
1668
+ const source = _optionalChain([options, 'access', _64 => _64.postcssOptions, 'optionalAccess', _65 => _65.options]);
1674
1669
  let cached = processOptionsCache.get(options);
1675
1670
  const cachedSource = processOptionsSourceCache.get(options);
1676
1671
  if (!cached || cachedSource !== source) {
package/dist/index.mjs CHANGED
@@ -937,11 +937,6 @@ var postcssWeappTailwindcssPostPlugin = (options) => {
937
937
  atRule.nodes?.length === 0 && atRule.remove();
938
938
  };
939
939
  }
940
- if (typeof opts.customRuleCallback === "function") {
941
- p.Rule = (rule) => {
942
- opts.customRuleCallback?.(rule, opts);
943
- };
944
- }
945
940
  return p;
946
941
  };
947
942
  postcssWeappTailwindcssPostPlugin.postcss = true;
@@ -1,5 +1,5 @@
1
1
  import { PostCssCalcOptions } from '@weapp-tailwindcss/postcss-calc';
2
- import { AcceptedPlugin, Rule, Result as Result$1 } from 'postcss';
2
+ import { AcceptedPlugin, Result as Result$1 } from 'postcss';
3
3
  import { Result } from 'postcss-load-config';
4
4
  import { pluginOptions } from 'postcss-preset-env';
5
5
  import { PxtransformOptions } from 'postcss-pxtransform';
@@ -58,7 +58,6 @@ type InjectPreflight = () => IPropValue[];
58
58
  declare function createInjectPreflight(options?: CssPreflightOptions): InjectPreflight;
59
59
 
60
60
  type LoadedPostcssOptions = Partial<Omit<Result, 'file'>>;
61
- type CustomRuleCallback = (node: Rule, options: Readonly<UserDefinedPostcssOptions>) => void;
62
61
  interface IPropValue {
63
62
  prop: string;
64
63
  value: string;
@@ -82,7 +81,6 @@ interface CssCalcOptions extends PostCssCalcOptions {
82
81
  includeCustomProperties?: (string | RegExp)[];
83
82
  }
84
83
  type IStyleHandlerOptions = {
85
- customRuleCallback?: CustomRuleCallback;
86
84
  ctx?: IContext;
87
85
  postcssOptions?: LoadedPostcssOptions;
88
86
  cssRemoveProperty?: boolean;
@@ -112,7 +110,6 @@ interface UserDefinedPostcssOptions {
112
110
  postcssOptions?: LoadedPostcssOptions;
113
111
  cssRemoveHoverPseudoClass?: boolean;
114
112
  cssRemoveProperty?: boolean;
115
- customRuleCallback?: CustomRuleCallback;
116
113
  uniAppX?: boolean;
117
114
  }
118
115
 
@@ -121,4 +118,4 @@ interface StyleHandler {
121
118
  getPipeline: (opt?: Partial<IStyleHandlerOptions>) => StyleProcessingPipeline;
122
119
  }
123
120
 
124
- export { type CssCalcOptions as C, type IStyleHandlerOptions as I, type LoadedPostcssOptions as L, type PipelineNodeContext as P, type ResolvedPipelineNode as R, type StyleHandler as S, type UserDefinedPostcssOptions as U, type InternalCssSelectorReplacerOptions as a, type PipelineNodeCursor as b, createStylePipeline as c, type PipelineStage as d, type StyleProcessingPipeline as e, createInjectPreflight as f, type CustomRuleCallback as g, type IPropValue as h, type CssPreflightOptions as i, type RequiredStyleHandlerOptions as j };
121
+ export { type CssCalcOptions as C, type IStyleHandlerOptions as I, type LoadedPostcssOptions as L, type PipelineNodeContext as P, type ResolvedPipelineNode as R, type StyleHandler as S, type UserDefinedPostcssOptions as U, type InternalCssSelectorReplacerOptions as a, type PipelineNodeCursor as b, createStylePipeline as c, type PipelineStage as d, type StyleProcessingPipeline as e, createInjectPreflight as f, type IPropValue as g, type CssPreflightOptions as h, type RequiredStyleHandlerOptions as i };
@@ -1,5 +1,5 @@
1
1
  import { PostCssCalcOptions } from '@weapp-tailwindcss/postcss-calc';
2
- import { AcceptedPlugin, Rule, Result as Result$1 } from 'postcss';
2
+ import { AcceptedPlugin, Result as Result$1 } from 'postcss';
3
3
  import { Result } from 'postcss-load-config';
4
4
  import { pluginOptions } from 'postcss-preset-env';
5
5
  import { PxtransformOptions } from 'postcss-pxtransform';
@@ -58,7 +58,6 @@ type InjectPreflight = () => IPropValue[];
58
58
  declare function createInjectPreflight(options?: CssPreflightOptions): InjectPreflight;
59
59
 
60
60
  type LoadedPostcssOptions = Partial<Omit<Result, 'file'>>;
61
- type CustomRuleCallback = (node: Rule, options: Readonly<UserDefinedPostcssOptions>) => void;
62
61
  interface IPropValue {
63
62
  prop: string;
64
63
  value: string;
@@ -82,7 +81,6 @@ interface CssCalcOptions extends PostCssCalcOptions {
82
81
  includeCustomProperties?: (string | RegExp)[];
83
82
  }
84
83
  type IStyleHandlerOptions = {
85
- customRuleCallback?: CustomRuleCallback;
86
84
  ctx?: IContext;
87
85
  postcssOptions?: LoadedPostcssOptions;
88
86
  cssRemoveProperty?: boolean;
@@ -112,7 +110,6 @@ interface UserDefinedPostcssOptions {
112
110
  postcssOptions?: LoadedPostcssOptions;
113
111
  cssRemoveHoverPseudoClass?: boolean;
114
112
  cssRemoveProperty?: boolean;
115
- customRuleCallback?: CustomRuleCallback;
116
113
  uniAppX?: boolean;
117
114
  }
118
115
 
@@ -121,4 +118,4 @@ interface StyleHandler {
121
118
  getPipeline: (opt?: Partial<IStyleHandlerOptions>) => StyleProcessingPipeline;
122
119
  }
123
120
 
124
- export { type CssCalcOptions as C, type IStyleHandlerOptions as I, type LoadedPostcssOptions as L, type PipelineNodeContext as P, type ResolvedPipelineNode as R, type StyleHandler as S, type UserDefinedPostcssOptions as U, type InternalCssSelectorReplacerOptions as a, type PipelineNodeCursor as b, createStylePipeline as c, type PipelineStage as d, type StyleProcessingPipeline as e, createInjectPreflight as f, type CustomRuleCallback as g, type IPropValue as h, type CssPreflightOptions as i, type RequiredStyleHandlerOptions as j };
121
+ export { type CssCalcOptions as C, type IStyleHandlerOptions as I, type LoadedPostcssOptions as L, type PipelineNodeContext as P, type ResolvedPipelineNode as R, type StyleHandler as S, type UserDefinedPostcssOptions as U, type InternalCssSelectorReplacerOptions as a, type PipelineNodeCursor as b, createStylePipeline as c, type PipelineStage as d, type StyleProcessingPipeline as e, createInjectPreflight as f, type IPropValue as g, type CssPreflightOptions as h, type RequiredStyleHandlerOptions as i };
package/dist/types.d.mts CHANGED
@@ -4,4 +4,4 @@ import 'postcss-load-config';
4
4
  export { pluginOptions as PresetEnvOptions } from 'postcss-preset-env';
5
5
  export { PxtransformOptions as Px2rpxOptions } from 'postcss-pxtransform';
6
6
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
7
- export { C as CssCalcOptions, i as CssPreflightOptions, g as CustomRuleCallback, h as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, j as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-SytH0h-o.mjs';
7
+ export { C as CssCalcOptions, h as CssPreflightOptions, g as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, i as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-6NcGD9Zr.mjs';
package/dist/types.d.ts CHANGED
@@ -4,4 +4,4 @@ import 'postcss-load-config';
4
4
  export { pluginOptions as PresetEnvOptions } from 'postcss-preset-env';
5
5
  export { PxtransformOptions as Px2rpxOptions } from 'postcss-pxtransform';
6
6
  export { UserDefinedOptions as Rem2rpxOptions } from 'postcss-rem-to-responsive-pixel';
7
- export { C as CssCalcOptions, i as CssPreflightOptions, g as CustomRuleCallback, h as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, j as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-SytH0h-o.js';
7
+ export { C as CssCalcOptions, h as CssPreflightOptions, g as IPropValue, I as IStyleHandlerOptions, a as InternalCssSelectorReplacerOptions, L as LoadedPostcssOptions, i as RequiredStyleHandlerOptions, S as StyleHandler, U as UserDefinedPostcssOptions } from './types-6NcGD9Zr.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@weapp-tailwindcss/postcss",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "@weapp-tailwindcss/postcss",
5
5
  "author": "ice breaker <1324318532@qq.com>",
6
6
  "license": "MIT",
@@ -39,7 +39,7 @@
39
39
  "dist"
40
40
  ],
41
41
  "dependencies": {
42
- "@weapp-core/escape": "~4.0.1",
42
+ "@weapp-core/escape": "~5.0.1",
43
43
  "@weapp-tailwindcss/postcss-calc": "^1.0.0",
44
44
  "postcss": "~8.5.6",
45
45
  "postcss-preset-env": "^10.4.0",