@unocss/svelte-scoped 66.3.2 → 66.4.0
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/preprocess.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { U as default } from './shared/svelte-scoped.
|
|
1
|
+
export { U as default } from './shared/svelte-scoped.CzKGVta9.mjs';
|
|
2
2
|
import 'node:process';
|
|
3
3
|
import '@unocss/config';
|
|
4
4
|
import '@unocss/core';
|
|
5
|
-
import '@unocss/preset-
|
|
5
|
+
import '@unocss/preset-wind3';
|
|
6
6
|
import 'magic-string';
|
|
7
7
|
import 'acorn';
|
|
8
8
|
import 'zimmerframe';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import process from 'node:process';
|
|
2
2
|
import { createRecoveryConfigLoader } from '@unocss/config';
|
|
3
3
|
import { expandVariantGroup, warnOnce, regexScopePlaceholder, toArray, createGenerator } from '@unocss/core';
|
|
4
|
-
import
|
|
4
|
+
import presetWind3 from '@unocss/preset-wind3';
|
|
5
5
|
import MagicString from 'magic-string';
|
|
6
6
|
import * as acorn from 'acorn';
|
|
7
7
|
import { walk } from 'zimmerframe';
|
|
@@ -509,11 +509,21 @@ function UnocssSveltePreprocess(options = {}, unoContextFromVite, isViteBuild) {
|
|
|
509
509
|
if (!options.classPrefix)
|
|
510
510
|
options.classPrefix = "usp-";
|
|
511
511
|
let uno;
|
|
512
|
-
const
|
|
512
|
+
const makeGenerator = async () => {
|
|
513
|
+
if (unoContextFromVite) {
|
|
514
|
+
await unoContextFromVite.ready;
|
|
515
|
+
return unoContextFromVite.uno;
|
|
516
|
+
}
|
|
517
|
+
const defaults = {
|
|
518
|
+
presets: [
|
|
519
|
+
presetWind3()
|
|
520
|
+
]
|
|
521
|
+
};
|
|
522
|
+
return await createGenerator((await createRecoveryConfigLoader()(process.cwd(), options.configOrPath)).config, defaults);
|
|
523
|
+
};
|
|
513
524
|
return {
|
|
514
525
|
markup: async ({ content, filename }) => {
|
|
515
|
-
|
|
516
|
-
uno = await getGenerator((await loadConfig(process.cwd(), options.configOrPath)).config, unoContextFromVite);
|
|
526
|
+
uno ??= await makeGenerator();
|
|
517
527
|
if (isViteBuild && options.combine === void 0)
|
|
518
528
|
options.combine = isViteBuild();
|
|
519
529
|
return await transformClasses({ content, filename: filename || "", uno, options });
|
|
@@ -535,8 +545,7 @@ function UnocssSveltePreprocess(options = {}, unoContextFromVite, isViteBuild) {
|
|
|
535
545
|
const changeNeeded = addPreflights || addSafelist || hasApply || hasThemeFn;
|
|
536
546
|
if (!changeNeeded)
|
|
537
547
|
return;
|
|
538
|
-
|
|
539
|
-
uno = await getGenerator((await loadConfig()).config);
|
|
548
|
+
uno ??= await makeGenerator();
|
|
540
549
|
let preflightsSafelistCss = "";
|
|
541
550
|
if (addPreflights || addSafelist) {
|
|
542
551
|
const { css } = await uno.generate([], { preflights: !!addPreflights, safelist: !!addSafelist, minify: true });
|
|
@@ -557,17 +566,5 @@ function UnocssSveltePreprocess(options = {}, unoContextFromVite, isViteBuild) {
|
|
|
557
566
|
}
|
|
558
567
|
};
|
|
559
568
|
}
|
|
560
|
-
async function getGenerator(config, unoContextFromVite) {
|
|
561
|
-
if (unoContextFromVite) {
|
|
562
|
-
await unoContextFromVite.ready;
|
|
563
|
-
return unoContextFromVite.uno;
|
|
564
|
-
}
|
|
565
|
-
const defaults = {
|
|
566
|
-
presets: [
|
|
567
|
-
presetUno()
|
|
568
|
-
]
|
|
569
|
-
};
|
|
570
|
-
return createGenerator(config, defaults);
|
|
571
|
-
}
|
|
572
569
|
|
|
573
570
|
export { UnocssSveltePreprocess as U };
|
package/dist/vite.mjs
CHANGED
|
@@ -7,7 +7,8 @@ import MagicString from 'magic-string';
|
|
|
7
7
|
import { readFileSync, existsSync, statSync } from 'node:fs';
|
|
8
8
|
import { resolve, dirname } from 'node:path';
|
|
9
9
|
import { fileURLToPath } from 'node:url';
|
|
10
|
-
import { U as UnocssSveltePreprocess } from './shared/svelte-scoped.
|
|
10
|
+
import { U as UnocssSveltePreprocess } from './shared/svelte-scoped.CzKGVta9.mjs';
|
|
11
|
+
import '@unocss/preset-wind3';
|
|
11
12
|
import 'acorn';
|
|
12
13
|
import 'zimmerframe';
|
|
13
14
|
import 'css-tree';
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/svelte-scoped",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.
|
|
4
|
+
"version": "66.4.0",
|
|
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",
|
|
8
8
|
"homepage": "https://unocss.dev",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/unocss/unocss",
|
|
11
|
+
"url": "git+https://github.com/unocss/unocss.git",
|
|
12
12
|
"directory": "packages-integrations/svelte-scoped"
|
|
13
13
|
},
|
|
14
14
|
"bugs": {
|
|
@@ -54,13 +54,13 @@
|
|
|
54
54
|
"css-tree": "^3.1.0",
|
|
55
55
|
"magic-string": "^0.30.17",
|
|
56
56
|
"zimmerframe": "^1.1.2",
|
|
57
|
-
"@unocss/config": "66.
|
|
58
|
-
"@unocss/
|
|
59
|
-
"@unocss/
|
|
57
|
+
"@unocss/config": "66.4.0",
|
|
58
|
+
"@unocss/reset": "66.4.0",
|
|
59
|
+
"@unocss/preset-uno": "66.4.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"prettier-plugin-svelte": "^2.10.1",
|
|
63
|
-
"svelte": "^5.
|
|
63
|
+
"svelte": "^5.37.2"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "unbuild",
|