@csszyx/unplugin 0.10.9 → 0.10.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.
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const cssMangler = require('./css-mangler.cjs');
6
- const unplugin = require('./shared/unplugin.CyZkpgQK.cjs');
6
+ const unplugin = require('./shared/unplugin.Cq_8AIBn.cjs');
7
7
  const types = require('@csszyx/types');
8
8
  require('postcss');
9
9
  require('postcss-selector-parser');
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { createPostCSSPlugin, escapeCSSClassName, mangleCSS, mangleCSSSync, unescapeTailwindClass } from './css-mangler.mjs';
2
- export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as computeSafelistRelPath, f as createGlobalVarAliasValidationOptions, g as createGlobalVarMapAssetSource, h as createGlobalVarScanCacheKey, i as createRSCModuleRecord, j as cssHasContentScope, k as cssImportsTailwind, u as default, l as deleteRSCModuleRecord, m as esbuildPlugin, n as extractGlobalVarAliasesForManifest, o as fileMayContainSafelistableSz, p as findRSCBoundaryViolation, q as findRSCGraphViolation, r as hasInjectableTailwindCandidate, s as hasTokens, t as hasUseClientDirective, v as hasUseServerDirective, w as isCompileSourceOptedIn, x as isHardIgnoredPath, y as isMonorepoPackage, z as isPackagesSkippedSource, A as isRSCServerModule, B as isTailwindReservedGlobalVar, C as mangleCodeClassesSync, D as mangleHybridHazardMessage, E as mergeThemes, F as missingTailwindEntryMessage, G as normalizeGlobalVarAliasesForCache, H as parseThemeBlocks, I as planGlobalVarAliases, J as readGlobalVarScanCache, K as resolveCompileSourceDirs, L as resolveGlobalVarScanCacheDir, M as resolveNativeCacheIdentity, N as rewriteGlobalVarCssAliases, O as rollupPlugin, P as scanGlobalVarCss, Q as shouldEmitWarning, R as shouldWarnMissingTailwindEntry, S as shouldWarnUnscopedMonorepo, T as skippedSzFilesMessage, u as unplugin, U as unscopedMonorepoMessage, V as validateGlobalVarAliasInputs, W as vitePlugin, X as webpackPlugin, Y as writeGlobalVarScanCache } from './shared/unplugin.BAOVOPKJ.mjs';
2
+ export { a as appendTailwindSourceDirective, b as assertNoRSCBoundaryViolation, c as assertNoRSCGraphViolation, d as collectMangleHybridHazards, e as computeSafelistRelPath, f as createGlobalVarAliasValidationOptions, g as createGlobalVarMapAssetSource, h as createGlobalVarScanCacheKey, i as createRSCModuleRecord, j as cssHasContentScope, k as cssImportsTailwind, u as default, l as deleteRSCModuleRecord, m as esbuildPlugin, n as extractGlobalVarAliasesForManifest, o as fileMayContainSafelistableSz, p as findRSCBoundaryViolation, q as findRSCGraphViolation, r as hasInjectableTailwindCandidate, s as hasTokens, t as hasUseClientDirective, v as hasUseServerDirective, w as isCompileSourceOptedIn, x as isHardIgnoredPath, y as isMonorepoPackage, z as isPackagesSkippedSource, A as isRSCServerModule, B as isTailwindReservedGlobalVar, C as mangleCodeClassesSync, D as mangleHybridHazardMessage, E as mergeThemes, F as missingTailwindEntryMessage, G as normalizeGlobalVarAliasesForCache, H as parseThemeBlocks, I as planGlobalVarAliases, J as readGlobalVarScanCache, K as resolveCompileSourceDirs, L as resolveGlobalVarScanCacheDir, M as resolveNativeCacheIdentity, N as rewriteGlobalVarCssAliases, O as rollupPlugin, P as scanGlobalVarCss, Q as shouldEmitWarning, R as shouldWarnMissingTailwindEntry, S as shouldWarnUnscopedMonorepo, T as skippedSzFilesMessage, u as unplugin, U as unscopedMonorepoMessage, V as validateGlobalVarAliasInputs, W as vitePlugin, X as webpackPlugin, Y as writeGlobalVarScanCache } from './shared/unplugin.Ble541_h.mjs';
3
3
  export { CSSZYX_GLOBAL_ALIAS_PREFIX, TAILWIND_RESERVED_PREFIXES } from '@csszyx/types';
4
4
  import 'postcss';
5
5
  import 'postcss-selector-parser';
@@ -1797,7 +1797,7 @@ function isHardIgnoredPath(id, sourceDirs = []) {
1797
1797
  return false;
1798
1798
  }
1799
1799
  function fileMayContainSafelistableSz(content) {
1800
- return content.includes("sz=") || content.includes("sz:") || content.includes("szv(");
1800
+ return content.includes("sz=") || content.includes("szs=") || content.includes("sz:") || content.includes("szv(");
1801
1801
  }
1802
1802
  function isPackagesSkippedSource(id, sourceDirs = []) {
1803
1803
  const p = normalizeForMatch(id);
@@ -2405,6 +2405,16 @@ function mangleCodeClassesSync(code, mangleMap) {
2405
2405
  }
2406
2406
  return `${sep}${ws}"${mangled.join(" ")}"`;
2407
2407
  });
2408
+ result = result.replace(/\bszs:\s*\{([^{}]*)\}/g, (whole, body) => {
2409
+ const mangledBody = body.replace(
2410
+ /"((?:[^"\\]|\\.)*)"/g,
2411
+ (_m, inner) => `"${mangleClassString(inner)}"`
2412
+ ).replace(
2413
+ /'((?:[^'\\]|\\.)*)'/g,
2414
+ (_m, inner) => `'${mangleClassString(inner)}'`
2415
+ );
2416
+ return whole.replace(body, mangledBody);
2417
+ });
2408
2418
  return result;
2409
2419
  }
2410
2420
  function assertGlobalVarMangleConfig(options) {
@@ -2821,7 +2831,7 @@ function createCsszyxPlugins(options = {}) {
2821
2831
  } catch {
2822
2832
  return;
2823
2833
  }
2824
- if (content.includes("sz=") || content.includes("sz:")) {
2834
+ if (content.includes("sz=") || content.includes("szs=") || content.includes("sz:")) {
2825
2835
  state.skippedSzFiles.add(filePath);
2826
2836
  }
2827
2837
  }
@@ -3140,7 +3150,7 @@ function createCsszyxPlugins(options = {}) {
3140
3150
  let usesColorVar = false;
3141
3151
  let transformed = false;
3142
3152
  let szClasses;
3143
- const hasSzProp = code.includes("sz=") || /\bsz\s*:\s*["'{]/.test(code) || code.includes('sz: "');
3153
+ const hasSzProp = code.includes("sz=") || code.includes("szs=") || /\bsz\s*:\s*["'{]/.test(code) || code.includes('sz: "');
3144
3154
  if (hasSzProp) {
3145
3155
  if (id.endsWith(".vue")) {
3146
3156
  const result = preprocess(code, options);
@@ -3369,7 +3379,7 @@ function createCsszyxPlugins(options = {}) {
3369
3379
  } catch {
3370
3380
  return;
3371
3381
  }
3372
- if (!fileContent.includes("sz=") && !/\bsz\s*:\s*["'{]/.test(fileContent)) {
3382
+ if (!fileContent.includes("sz=") && !fileContent.includes("szs=") && !/\bsz\s*:\s*["'{]/.test(fileContent)) {
3373
3383
  recordGlobalVarSourceFile(state, ctx.file, fileContent);
3374
3384
  recordFileVarMangleEntries(state, ctx.file, []);
3375
3385
  recordFileCSSVariableMetrics(state, ctx.file, null);
@@ -1611,9 +1611,9 @@ let _hasWarnedTransformCacheVersion = false;
1611
1611
  let _hasWarnedNativeFallback = false;
1612
1612
  let _hasLoggedActiveParser = false;
1613
1613
  const _babelFallbackFiles = /* @__PURE__ */ new Set();
1614
- const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CyZkpgQK.cjs', document.baseURI).href)));
1614
+ const requireFromHere = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.Cq_8AIBn.cjs', document.baseURI).href)));
1615
1615
  const PLUGIN_VERSION = findPackageVersionFromFile(
1616
- node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.CyZkpgQK.cjs', document.baseURI).href))),
1616
+ node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('shared/unplugin.Cq_8AIBn.cjs', document.baseURI).href))),
1617
1617
  UNKNOWN_PACKAGE_VERSION
1618
1618
  );
1619
1619
  const COMPILER_VERSION = findPackageVersionFromModule("@csszyx/compiler", UNKNOWN_PACKAGE_VERSION);
@@ -1817,7 +1817,7 @@ function isHardIgnoredPath(id, sourceDirs = []) {
1817
1817
  return false;
1818
1818
  }
1819
1819
  function fileMayContainSafelistableSz(content) {
1820
- return content.includes("sz=") || content.includes("sz:") || content.includes("szv(");
1820
+ return content.includes("sz=") || content.includes("szs=") || content.includes("sz:") || content.includes("szv(");
1821
1821
  }
1822
1822
  function isPackagesSkippedSource(id, sourceDirs = []) {
1823
1823
  const p = normalizeForMatch(id);
@@ -2425,6 +2425,16 @@ function mangleCodeClassesSync(code, mangleMap) {
2425
2425
  }
2426
2426
  return `${sep}${ws}"${mangled.join(" ")}"`;
2427
2427
  });
2428
+ result = result.replace(/\bszs:\s*\{([^{}]*)\}/g, (whole, body) => {
2429
+ const mangledBody = body.replace(
2430
+ /"((?:[^"\\]|\\.)*)"/g,
2431
+ (_m, inner) => `"${mangleClassString(inner)}"`
2432
+ ).replace(
2433
+ /'((?:[^'\\]|\\.)*)'/g,
2434
+ (_m, inner) => `'${mangleClassString(inner)}'`
2435
+ );
2436
+ return whole.replace(body, mangledBody);
2437
+ });
2428
2438
  return result;
2429
2439
  }
2430
2440
  function assertGlobalVarMangleConfig(options) {
@@ -2841,7 +2851,7 @@ function createCsszyxPlugins(options = {}) {
2841
2851
  } catch {
2842
2852
  return;
2843
2853
  }
2844
- if (content.includes("sz=") || content.includes("sz:")) {
2854
+ if (content.includes("sz=") || content.includes("szs=") || content.includes("sz:")) {
2845
2855
  state.skippedSzFiles.add(filePath);
2846
2856
  }
2847
2857
  }
@@ -3160,7 +3170,7 @@ function createCsszyxPlugins(options = {}) {
3160
3170
  let usesColorVar = false;
3161
3171
  let transformed = false;
3162
3172
  let szClasses;
3163
- const hasSzProp = code.includes("sz=") || /\bsz\s*:\s*["'{]/.test(code) || code.includes('sz: "');
3173
+ const hasSzProp = code.includes("sz=") || code.includes("szs=") || /\bsz\s*:\s*["'{]/.test(code) || code.includes('sz: "');
3164
3174
  if (hasSzProp) {
3165
3175
  if (id.endsWith(".vue")) {
3166
3176
  const result = vueAdapter.preprocess(code, options);
@@ -3389,7 +3399,7 @@ function createCsszyxPlugins(options = {}) {
3389
3399
  } catch {
3390
3400
  return;
3391
3401
  }
3392
- if (!fileContent.includes("sz=") && !/\bsz\s*:\s*["'{]/.test(fileContent)) {
3402
+ if (!fileContent.includes("sz=") && !fileContent.includes("szs=") && !/\bsz\s*:\s*["'{]/.test(fileContent)) {
3393
3403
  recordGlobalVarSourceFile(state, ctx.file, fileContent);
3394
3404
  recordFileVarMangleEntries(state, ctx.file, []);
3395
3405
  recordFileCSSVariableMetrics(state, ctx.file, null);
package/dist/vite.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CyZkpgQK.cjs');
5
+ const unplugin = require('./shared/unplugin.Cq_8AIBn.cjs');
6
6
  require('node:fs');
7
7
  require('node:module');
8
8
  require('node:path');
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { W as vitePlugin } from './shared/unplugin.BAOVOPKJ.mjs';
1
+ import { W as vitePlugin } from './shared/unplugin.Ble541_h.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:module';
4
4
  import 'node:path';
package/dist/webpack.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const unplugin = require('./shared/unplugin.CyZkpgQK.cjs');
5
+ const unplugin = require('./shared/unplugin.Cq_8AIBn.cjs');
6
6
  require('node:fs');
7
7
  require('node:module');
8
8
  require('node:path');
package/dist/webpack.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { X as webpackPlugin } from './shared/unplugin.BAOVOPKJ.mjs';
1
+ import { X as webpackPlugin } from './shared/unplugin.Ble541_h.mjs';
2
2
  import 'node:fs';
3
3
  import 'node:module';
4
4
  import 'node:path';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csszyx/unplugin",
3
- "version": "0.10.9",
3
+ "version": "0.10.10",
4
4
  "description": "Vite and Webpack integration for csszyx",
5
5
  "keywords": [
6
6
  "csszyx",
@@ -117,14 +117,14 @@
117
117
  "postcss-value-parser": "^4.2.0",
118
118
  "proper-lockfile": "^4.1.2",
119
119
  "unplugin": "^1.10.1",
120
- "@csszyx/compiler": "0.10.9",
121
- "@csszyx/core": "0.10.9",
122
- "@csszyx/svelte-adapter": "0.10.9",
123
- "@csszyx/vue-adapter": "0.10.9",
124
- "@csszyx/types": "0.10.9"
120
+ "@csszyx/compiler": "0.10.10",
121
+ "@csszyx/svelte-adapter": "0.10.10",
122
+ "@csszyx/types": "0.10.10",
123
+ "@csszyx/core": "0.10.10",
124
+ "@csszyx/vue-adapter": "0.10.10"
125
125
  },
126
126
  "peerDependencies": {
127
- "@csszyx/runtime": "^0.10.9"
127
+ "@csszyx/runtime": "^0.10.10"
128
128
  },
129
129
  "devDependencies": {
130
130
  "@types/node": "^20.11.0",