@unocss/svelte-scoped 0.53.5 → 0.53.6

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,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./shared/svelte-scoped.a06bf383.cjs');
3
+ const index = require('./shared/svelte-scoped.6b434367.cjs');
4
4
  require('@unocss/core');
5
5
  require('@unocss/preset-uno');
6
6
  require('@unocss/config');
@@ -1,4 +1,4 @@
1
- export { U as default } from './shared/svelte-scoped.90e5653a.mjs';
1
+ export { U as default } from './shared/svelte-scoped.90d314b5.mjs';
2
2
  import '@unocss/core';
3
3
  import '@unocss/preset-uno';
4
4
  import '@unocss/config';
@@ -422,13 +422,13 @@ async function transformStyle({ content, uno, prepend, filename, applyVariables,
422
422
 
423
423
  function UnocssSveltePreprocess(options = {}, unoContextFromVite, isViteBuild) {
424
424
  if (!options.classPrefix)
425
- options.classPrefix = "spu-";
425
+ options.classPrefix = "usp-";
426
426
  let uno;
427
427
  return {
428
428
  markup: async ({ content, filename }) => {
429
429
  if (!uno)
430
430
  uno = await getGenerator(options.configOrPath, unoContextFromVite);
431
- if (isViteBuild && !options.combine)
431
+ if (isViteBuild && options.combine === void 0)
432
432
  options.combine = isViteBuild();
433
433
  return await transformClasses({ content, filename: filename || "", uno, options });
434
434
  },
@@ -415,13 +415,13 @@ async function transformStyle({ content, uno, prepend, filename, applyVariables,
415
415
 
416
416
  function UnocssSveltePreprocess(options = {}, unoContextFromVite, isViteBuild) {
417
417
  if (!options.classPrefix)
418
- options.classPrefix = "spu-";
418
+ options.classPrefix = "usp-";
419
419
  let uno;
420
420
  return {
421
421
  markup: async ({ content, filename }) => {
422
422
  if (!uno)
423
423
  uno = await getGenerator(options.configOrPath, unoContextFromVite);
424
- if (isViteBuild && !options.combine)
424
+ if (isViteBuild && options.combine === void 0)
425
425
  options.combine = isViteBuild();
426
426
  return await transformClasses({ content, filename: filename || "", uno, options });
427
427
  },
package/dist/vite.cjs CHANGED
@@ -2,18 +2,19 @@
2
2
 
3
3
  const core = require('@unocss/core');
4
4
  const config = require('@unocss/config');
5
- const index = require('./shared/svelte-scoped.a06bf383.cjs');
5
+ const presetUno = require('@unocss/preset-uno');
6
+ const index = require('./shared/svelte-scoped.6b434367.cjs');
6
7
  const node_fs = require('node:fs');
7
8
  const node_path = require('node:path');
8
9
  const node_url = require('node:url');
9
10
  const MagicString = require('magic-string');
10
11
  const remapping = require('@ampproject/remapping');
11
12
  require('node:crypto');
12
- require('@unocss/preset-uno');
13
13
  require('css-tree');
14
14
 
15
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e["default"] : e; }
16
16
 
17
+ const presetUno__default = /*#__PURE__*/_interopDefaultLegacy(presetUno);
17
18
  const MagicString__default = /*#__PURE__*/_interopDefaultLegacy(MagicString);
18
19
  const remapping__default = /*#__PURE__*/_interopDefaultLegacy(remapping);
19
20
 
@@ -238,6 +239,8 @@ function UnocssSvelteScopedVite(options = {}) {
238
239
  const context = createSvelteScopedContext(options.configOrPath);
239
240
  if (context.uno.config.transformers)
240
241
  throw new Error('Due to the differences in normal UnoCSS global usage and Svelte Scoped usage, "config.transformers" will be ignored. You can still use transformers in CSS files with the "cssFileTransformers" option.');
242
+ if (!options.classPrefix)
243
+ options.classPrefix = "uno-";
241
244
  const plugins = [
242
245
  GlobalStylesPlugin(context, options.injectReset)
243
246
  ];
@@ -247,12 +250,17 @@ function UnocssSvelteScopedVite(options = {}) {
247
250
  plugins.push(...createCssTransformerPlugins(context, options.cssFileTransformers));
248
251
  return plugins;
249
252
  }
253
+ const defaults = {
254
+ presets: [
255
+ presetUno__default()
256
+ ]
257
+ };
250
258
  function createSvelteScopedContext(configOrPath) {
251
259
  const uno = core.createGenerator();
252
260
  const ready = reloadConfig();
253
261
  async function reloadConfig() {
254
262
  const { config: config$1 } = await config.loadConfig(process.cwd(), configOrPath);
255
- uno.setConfig(config$1);
263
+ uno.setConfig(config$1, defaults);
256
264
  return config$1;
257
265
  }
258
266
  return {
package/dist/vite.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import { cssIdRE, createGenerator } from '@unocss/core';
2
2
  import { loadConfig } from '@unocss/config';
3
- import { U as UnocssSveltePreprocess } from './shared/svelte-scoped.90e5653a.mjs';
3
+ import presetUno from '@unocss/preset-uno';
4
+ import { U as UnocssSveltePreprocess } from './shared/svelte-scoped.90d314b5.mjs';
4
5
  import { readFileSync, existsSync, statSync } from 'node:fs';
5
6
  import { dirname, resolve } from 'node:path';
6
7
  import { fileURLToPath } from 'node:url';
7
8
  import MagicString from 'magic-string';
8
9
  import remapping from '@ampproject/remapping';
9
10
  import 'node:crypto';
10
- import '@unocss/preset-uno';
11
11
  import 'css-tree';
12
12
 
13
13
  function PassPreprocessToSveltePlugin(options = {}, ctx) {
@@ -231,6 +231,8 @@ function UnocssSvelteScopedVite(options = {}) {
231
231
  const context = createSvelteScopedContext(options.configOrPath);
232
232
  if (context.uno.config.transformers)
233
233
  throw new Error('Due to the differences in normal UnoCSS global usage and Svelte Scoped usage, "config.transformers" will be ignored. You can still use transformers in CSS files with the "cssFileTransformers" option.');
234
+ if (!options.classPrefix)
235
+ options.classPrefix = "uno-";
234
236
  const plugins = [
235
237
  GlobalStylesPlugin(context, options.injectReset)
236
238
  ];
@@ -240,12 +242,17 @@ function UnocssSvelteScopedVite(options = {}) {
240
242
  plugins.push(...createCssTransformerPlugins(context, options.cssFileTransformers));
241
243
  return plugins;
242
244
  }
245
+ const defaults = {
246
+ presets: [
247
+ presetUno()
248
+ ]
249
+ };
243
250
  function createSvelteScopedContext(configOrPath) {
244
251
  const uno = createGenerator();
245
252
  const ready = reloadConfig();
246
253
  async function reloadConfig() {
247
254
  const { config } = await loadConfig(process.cwd(), configOrPath);
248
- uno.setConfig(config);
255
+ uno.setConfig(config, defaults);
249
256
  return config;
250
257
  }
251
258
  return {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/svelte-scoped",
3
3
  "type": "module",
4
- "version": "0.53.5",
4
+ "version": "0.53.6",
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, preprocessor for component libraries",
6
6
  "author": "Jacob Bowdoin",
7
7
  "license": "MIT",
@@ -54,8 +54,8 @@
54
54
  "dependencies": {
55
55
  "css-tree": "^2.3.1",
56
56
  "magic-string": "^0.30.1",
57
- "@unocss/config": "0.53.5",
58
- "@unocss/reset": "0.53.5"
57
+ "@unocss/config": "0.53.6",
58
+ "@unocss/reset": "0.53.6"
59
59
  },
60
60
  "devDependencies": {
61
61
  "prettier-plugin-svelte": "^2.10.1",