@unocss/svelte-scoped 66.7.2-beta.1 → 66.7.3

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,2 +1,2 @@
1
- import { a as TransformDirectivesOptions, i as TransformClassesOptions, n as UnocssSveltePreprocessOptions, r as TransformApplyOptions, t as UnocssSveltePreprocess } from "./preprocess-BlFuH8z9.mjs";
1
+ import { a as TransformDirectivesOptions, i as TransformClassesOptions, n as UnocssSveltePreprocessOptions, r as TransformApplyOptions, t as UnocssSveltePreprocess } from "./preprocess-CsDt4GJJ.mjs";
2
2
  export { type TransformApplyOptions, type TransformClassesOptions, type TransformDirectivesOptions, type UnocssSveltePreprocessOptions, UnocssSveltePreprocess as default };
@@ -1,4 +1,4 @@
1
- import { i as transformClasses, n as transformStyle, r as themeRE, t as checkForApply } from "./transformStyle-C_Qgy-5X.mjs";
1
+ import { i as transformClasses, n as transformStyle, r as themeRE, t as checkForApply } from "./transformStyle-CBL_Mx-C.mjs";
2
2
  import process from "node:process";
3
3
  import { createRecoveryConfigLoader } from "@unocss/config";
4
4
  import { createGenerator, warnOnce } from "@unocss/core";
package/dist/vite.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as UnocssSveltePreprocessOptions } from "./preprocess-BlFuH8z9.mjs";
1
+ import { n as UnocssSveltePreprocessOptions } from "./preprocess-CsDt4GJJ.mjs";
2
2
  import { PluginOptions } from "@unocss/core";
3
3
  import { Plugin } from "vite";
4
4
 
package/dist/vite.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { i as transformClasses, n as transformStyle, r as themeRE, t as checkForApply } from "./transformStyle-C_Qgy-5X.mjs";
1
+ import { i as transformClasses, n as transformStyle, r as themeRE, t as checkForApply } from "./transformStyle-CBL_Mx-C.mjs";
2
2
  import process$1 from "node:process";
3
3
  import { createRecoveryConfigLoader } from "@unocss/config";
4
4
  import { BetterMap, createGenerator, cssIdRE } from "@unocss/core";
@@ -2130,18 +2130,39 @@ function restoreSkipCode(code, map) {
2130
2130
  }
2131
2131
  //#endregion
2132
2132
  //#region ../../virtual-shared/integration/src/transformers.ts
2133
+ const transformerCache = /* @__PURE__ */ new WeakMap();
2134
+ function getTransformers(ctx, enforce) {
2135
+ const configured = ctx.uno.config.transformers;
2136
+ if (!configured?.length) return;
2137
+ let grouped = transformerCache.get(configured);
2138
+ if (!grouped) {
2139
+ grouped = {
2140
+ pre: [],
2141
+ default: [],
2142
+ post: []
2143
+ };
2144
+ for (const transformer of configured) grouped[transformer.enforce || "default"].push(transformer);
2145
+ transformerCache.set(configured, grouped);
2146
+ }
2147
+ return grouped[enforce];
2148
+ }
2133
2149
  async function applyTransformers(ctx, original, id, enforce = "default") {
2134
2150
  if (original.includes("@unocss-ignore")) return;
2135
- const transformers = (ctx.uno.config.transformers || []).filter((i) => (i.enforce || "default") === enforce);
2136
- if (!transformers.length) return;
2137
- const skipMap = /* @__PURE__ */ new Map();
2151
+ const transformers = getTransformers(ctx, enforce);
2152
+ if (!transformers?.length) return;
2138
2153
  let code = original;
2139
- let s = new MagicString(transformSkipCode(code, skipMap, SKIP_COMMENT_RE, "@unocss-skip-placeholder-"));
2154
+ let skipMap;
2155
+ let s;
2140
2156
  const maps = [];
2141
2157
  for (const t of transformers) {
2142
2158
  if (t.idFilter) {
2143
2159
  if (!t.idFilter(id)) continue;
2144
2160
  } else if (!ctx.filter(code, id)) continue;
2161
+ if (t.codeFilter && !t.codeFilter(code, id)) continue;
2162
+ if (!s) {
2163
+ skipMap = /* @__PURE__ */ new Map();
2164
+ s = new MagicString(transformSkipCode(code, skipMap, SKIP_COMMENT_RE, "@unocss-skip-placeholder-"));
2165
+ }
2145
2166
  await t.transform(s, id, ctx);
2146
2167
  if (s.hasChanged()) {
2147
2168
  code = restoreSkipCode(s.toString(), skipMap);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/svelte-scoped",
3
3
  "type": "module",
4
- "version": "66.7.2-beta.1",
4
+ "version": "66.7.3",
5
5
  "description": "Use UnoCSS in a modular fashion with styles being stored only in the Svelte component they are used in: Vite plugin for apps, Svelte preprocessor for component libraries",
6
6
  "author": "Jacob Bowdoin",
7
7
  "license": "MIT",
@@ -43,21 +43,21 @@
43
43
  "dist"
44
44
  ],
45
45
  "dependencies": {
46
- "acorn": "^8.16.0",
46
+ "acorn": "^8.17.0",
47
47
  "css-tree": "^3.2.1",
48
48
  "magic-string": "^0.30.21",
49
49
  "pathe": "^2.0.3",
50
50
  "zimmerframe": "^1.1.4",
51
- "@unocss/preset-uno": "66.7.2-beta.1",
52
- "@unocss/preset-wind3": "66.7.2-beta.1",
53
- "@unocss/reset": "66.7.2-beta.1",
54
- "@unocss/core": "66.7.2-beta.1",
55
- "@unocss/config": "66.7.2-beta.1"
51
+ "@unocss/config": "66.7.3",
52
+ "@unocss/preset-uno": "66.7.3",
53
+ "@unocss/reset": "66.7.3",
54
+ "@unocss/preset-wind3": "66.7.3",
55
+ "@unocss/core": "66.7.3"
56
56
  },
57
57
  "devDependencies": {
58
58
  "prettier-plugin-svelte": "^3.5.2",
59
- "svelte": "^5.55.7",
60
- "vite": "^8.0.13"
59
+ "svelte": "^5.56.4",
60
+ "vite": "^8.1.0"
61
61
  },
62
62
  "inlinedDependencies": {
63
63
  "picomatch": "4.0.4",