@unocss/core 0.14.3 → 0.15.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/index.cjs +15 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +15 -15
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -153,7 +153,7 @@ function notNull(value) {
|
|
|
153
153
|
|
|
154
154
|
class TwoKeyMap {
|
|
155
155
|
constructor() {
|
|
156
|
-
this._map = new Map();
|
|
156
|
+
this._map = /* @__PURE__ */ new Map();
|
|
157
157
|
}
|
|
158
158
|
get(key1, key2) {
|
|
159
159
|
const m2 = this._map.get(key1);
|
|
@@ -163,7 +163,7 @@ class TwoKeyMap {
|
|
|
163
163
|
getFallback(key1, key2, fallback) {
|
|
164
164
|
let m2 = this._map.get(key1);
|
|
165
165
|
if (!m2) {
|
|
166
|
-
m2 = new Map();
|
|
166
|
+
m2 = /* @__PURE__ */ new Map();
|
|
167
167
|
this._map.set(key1, m2);
|
|
168
168
|
}
|
|
169
169
|
if (!m2.has(key2))
|
|
@@ -173,7 +173,7 @@ class TwoKeyMap {
|
|
|
173
173
|
set(key1, key2, value) {
|
|
174
174
|
let m2 = this._map.get(key1);
|
|
175
175
|
if (!m2) {
|
|
176
|
-
m2 = new Map();
|
|
176
|
+
m2 = /* @__PURE__ */ new Map();
|
|
177
177
|
this._map.set(key1, m2);
|
|
178
178
|
}
|
|
179
179
|
m2.set(key2, value);
|
|
@@ -232,7 +232,7 @@ function expandVariantGroup(str) {
|
|
|
232
232
|
return result;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
const warned = new Set();
|
|
235
|
+
const warned = /* @__PURE__ */ new Set();
|
|
236
236
|
function warnOnce(msg) {
|
|
237
237
|
if (warned.has(msg))
|
|
238
238
|
return;
|
|
@@ -261,7 +261,7 @@ const defaultLayers = {
|
|
|
261
261
|
};
|
|
262
262
|
function resolveConfig(userConfig = {}, defaults = {}) {
|
|
263
263
|
const config = Object.assign({}, defaults, userConfig);
|
|
264
|
-
const rawPresets = config.presets || [];
|
|
264
|
+
const rawPresets = (config.presets || []).flatMap(toArray);
|
|
265
265
|
const sortedPresets = [
|
|
266
266
|
...rawPresets.filter((p) => p.enforce === "pre"),
|
|
267
267
|
...rawPresets.filter((p) => !p.enforce),
|
|
@@ -296,9 +296,9 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
296
296
|
warn: true,
|
|
297
297
|
blocklist: [],
|
|
298
298
|
safelist: [],
|
|
299
|
-
presets: [],
|
|
300
299
|
sortLayers: (layers2) => layers2,
|
|
301
300
|
...config,
|
|
301
|
+
presets: sortedPresets,
|
|
302
302
|
envMode: config.envMode || "build",
|
|
303
303
|
shortcutsLayer: config.shortcutsLayer || "shortcuts",
|
|
304
304
|
layers,
|
|
@@ -313,16 +313,16 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
|
|
316
|
-
const version = "0.
|
|
316
|
+
const version = "0.15.0";
|
|
317
317
|
|
|
318
318
|
class UnoGenerator {
|
|
319
319
|
constructor(userConfig = {}, defaults = {}) {
|
|
320
320
|
this.userConfig = userConfig;
|
|
321
321
|
this.defaults = defaults;
|
|
322
322
|
this.version = version;
|
|
323
|
-
this._cache = new Map();
|
|
324
|
-
this.blocked = new Set();
|
|
325
|
-
this.parentOrders = new Map();
|
|
323
|
+
this._cache = /* @__PURE__ */ new Map();
|
|
324
|
+
this.blocked = /* @__PURE__ */ new Set();
|
|
325
|
+
this.parentOrders = /* @__PURE__ */ new Map();
|
|
326
326
|
this.config = resolveConfig(userConfig, defaults);
|
|
327
327
|
}
|
|
328
328
|
setConfig(userConfig, defaults) {
|
|
@@ -336,7 +336,7 @@ class UnoGenerator {
|
|
|
336
336
|
this.parentOrders.clear();
|
|
337
337
|
this._cache.clear();
|
|
338
338
|
}
|
|
339
|
-
async applyExtractors(code, id, set = new Set()) {
|
|
339
|
+
async applyExtractors(code, id, set = /* @__PURE__ */ new Set()) {
|
|
340
340
|
const context = {
|
|
341
341
|
get original() {
|
|
342
342
|
return code;
|
|
@@ -361,9 +361,9 @@ class UnoGenerator {
|
|
|
361
361
|
if (safelist)
|
|
362
362
|
this.config.safelist.forEach((s) => tokens.add(s));
|
|
363
363
|
const nl = minify ? "" : "\n";
|
|
364
|
-
const layerSet = new Set(["default"]);
|
|
365
|
-
const matched = new Set();
|
|
366
|
-
const sheet = new Map();
|
|
364
|
+
const layerSet = /* @__PURE__ */ new Set(["default"]);
|
|
365
|
+
const matched = /* @__PURE__ */ new Set();
|
|
366
|
+
const sheet = /* @__PURE__ */ new Map();
|
|
367
367
|
const hit = (raw, payload) => {
|
|
368
368
|
this._cache.set(raw, payload);
|
|
369
369
|
matched.add(raw);
|
|
@@ -469,7 +469,7 @@ class UnoGenerator {
|
|
|
469
469
|
};
|
|
470
470
|
}
|
|
471
471
|
matchVariants(raw, current) {
|
|
472
|
-
const usedVariants = new Set();
|
|
472
|
+
const usedVariants = /* @__PURE__ */ new Set();
|
|
473
473
|
const handlers = [];
|
|
474
474
|
let processed = current || raw;
|
|
475
475
|
let applied = false;
|
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -149,7 +149,7 @@ function notNull(value) {
|
|
|
149
149
|
|
|
150
150
|
class TwoKeyMap {
|
|
151
151
|
constructor() {
|
|
152
|
-
this._map = new Map();
|
|
152
|
+
this._map = /* @__PURE__ */ new Map();
|
|
153
153
|
}
|
|
154
154
|
get(key1, key2) {
|
|
155
155
|
const m2 = this._map.get(key1);
|
|
@@ -159,7 +159,7 @@ class TwoKeyMap {
|
|
|
159
159
|
getFallback(key1, key2, fallback) {
|
|
160
160
|
let m2 = this._map.get(key1);
|
|
161
161
|
if (!m2) {
|
|
162
|
-
m2 = new Map();
|
|
162
|
+
m2 = /* @__PURE__ */ new Map();
|
|
163
163
|
this._map.set(key1, m2);
|
|
164
164
|
}
|
|
165
165
|
if (!m2.has(key2))
|
|
@@ -169,7 +169,7 @@ class TwoKeyMap {
|
|
|
169
169
|
set(key1, key2, value) {
|
|
170
170
|
let m2 = this._map.get(key1);
|
|
171
171
|
if (!m2) {
|
|
172
|
-
m2 = new Map();
|
|
172
|
+
m2 = /* @__PURE__ */ new Map();
|
|
173
173
|
this._map.set(key1, m2);
|
|
174
174
|
}
|
|
175
175
|
m2.set(key2, value);
|
|
@@ -228,7 +228,7 @@ function expandVariantGroup(str) {
|
|
|
228
228
|
return result;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
const warned = new Set();
|
|
231
|
+
const warned = /* @__PURE__ */ new Set();
|
|
232
232
|
function warnOnce(msg) {
|
|
233
233
|
if (warned.has(msg))
|
|
234
234
|
return;
|
|
@@ -257,7 +257,7 @@ const defaultLayers = {
|
|
|
257
257
|
};
|
|
258
258
|
function resolveConfig(userConfig = {}, defaults = {}) {
|
|
259
259
|
const config = Object.assign({}, defaults, userConfig);
|
|
260
|
-
const rawPresets = config.presets || [];
|
|
260
|
+
const rawPresets = (config.presets || []).flatMap(toArray);
|
|
261
261
|
const sortedPresets = [
|
|
262
262
|
...rawPresets.filter((p) => p.enforce === "pre"),
|
|
263
263
|
...rawPresets.filter((p) => !p.enforce),
|
|
@@ -292,9 +292,9 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
292
292
|
warn: true,
|
|
293
293
|
blocklist: [],
|
|
294
294
|
safelist: [],
|
|
295
|
-
presets: [],
|
|
296
295
|
sortLayers: (layers2) => layers2,
|
|
297
296
|
...config,
|
|
297
|
+
presets: sortedPresets,
|
|
298
298
|
envMode: config.envMode || "build",
|
|
299
299
|
shortcutsLayer: config.shortcutsLayer || "shortcuts",
|
|
300
300
|
layers,
|
|
@@ -309,16 +309,16 @@ function resolveConfig(userConfig = {}, defaults = {}) {
|
|
|
309
309
|
};
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
const version = "0.
|
|
312
|
+
const version = "0.15.0";
|
|
313
313
|
|
|
314
314
|
class UnoGenerator {
|
|
315
315
|
constructor(userConfig = {}, defaults = {}) {
|
|
316
316
|
this.userConfig = userConfig;
|
|
317
317
|
this.defaults = defaults;
|
|
318
318
|
this.version = version;
|
|
319
|
-
this._cache = new Map();
|
|
320
|
-
this.blocked = new Set();
|
|
321
|
-
this.parentOrders = new Map();
|
|
319
|
+
this._cache = /* @__PURE__ */ new Map();
|
|
320
|
+
this.blocked = /* @__PURE__ */ new Set();
|
|
321
|
+
this.parentOrders = /* @__PURE__ */ new Map();
|
|
322
322
|
this.config = resolveConfig(userConfig, defaults);
|
|
323
323
|
}
|
|
324
324
|
setConfig(userConfig, defaults) {
|
|
@@ -332,7 +332,7 @@ class UnoGenerator {
|
|
|
332
332
|
this.parentOrders.clear();
|
|
333
333
|
this._cache.clear();
|
|
334
334
|
}
|
|
335
|
-
async applyExtractors(code, id, set = new Set()) {
|
|
335
|
+
async applyExtractors(code, id, set = /* @__PURE__ */ new Set()) {
|
|
336
336
|
const context = {
|
|
337
337
|
get original() {
|
|
338
338
|
return code;
|
|
@@ -357,9 +357,9 @@ class UnoGenerator {
|
|
|
357
357
|
if (safelist)
|
|
358
358
|
this.config.safelist.forEach((s) => tokens.add(s));
|
|
359
359
|
const nl = minify ? "" : "\n";
|
|
360
|
-
const layerSet = new Set(["default"]);
|
|
361
|
-
const matched = new Set();
|
|
362
|
-
const sheet = new Map();
|
|
360
|
+
const layerSet = /* @__PURE__ */ new Set(["default"]);
|
|
361
|
+
const matched = /* @__PURE__ */ new Set();
|
|
362
|
+
const sheet = /* @__PURE__ */ new Map();
|
|
363
363
|
const hit = (raw, payload) => {
|
|
364
364
|
this._cache.set(raw, payload);
|
|
365
365
|
matched.add(raw);
|
|
@@ -465,7 +465,7 @@ class UnoGenerator {
|
|
|
465
465
|
};
|
|
466
466
|
}
|
|
467
467
|
matchVariants(raw, current) {
|
|
468
|
-
const usedVariants = new Set();
|
|
468
|
+
const usedVariants = /* @__PURE__ */ new Set();
|
|
469
469
|
const handlers = [];
|
|
470
470
|
let processed = current || raw;
|
|
471
471
|
let applied = false;
|