@unocss/core 0.55.0 → 0.55.2

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
@@ -1,7 +1,5 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  function escapeRegExp(string) {
6
4
  return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
7
5
  }
@@ -21,11 +19,19 @@ function escapeSelector(str) {
21
19
  result += "\\,";
22
20
  continue;
23
21
  }
24
- if (codeUnit >= 1 && codeUnit <= 31 || codeUnit === 127 || index === 0 && codeUnit >= 48 && codeUnit <= 57 || index === 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit === 45) {
22
+ if (
23
+ // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is
24
+ // U+007F, […]
25
+ codeUnit >= 1 && codeUnit <= 31 || codeUnit === 127 || index === 0 && codeUnit >= 48 && codeUnit <= 57 || index === 1 && codeUnit >= 48 && codeUnit <= 57 && firstCodeUnit === 45
26
+ ) {
25
27
  result += `\\${codeUnit.toString(16)} `;
26
28
  continue;
27
29
  }
28
- if (index === 0 && length === 1 && codeUnit === 45) {
30
+ if (
31
+ // If the character is the first character and is a `-` (U+002D), and
32
+ // there is no second character, […]
33
+ index === 0 && length === 1 && codeUnit === 45
34
+ ) {
29
35
  result += `\\${str.charAt(index)}`;
30
36
  continue;
31
37
  }
@@ -158,9 +164,15 @@ function notNull(value) {
158
164
  function noop() {
159
165
  }
160
166
 
167
+ var __defProp$2 = Object.defineProperty;
168
+ var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
169
+ var __publicField$2 = (obj, key, value) => {
170
+ __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
171
+ return value;
172
+ };
161
173
  class TwoKeyMap {
162
174
  constructor() {
163
- this._map = /* @__PURE__ */ new Map();
175
+ __publicField$2(this, "_map", /* @__PURE__ */ new Map());
164
176
  }
165
177
  get(key1, key2) {
166
178
  const m2 = this._map.get(key1);
@@ -213,12 +225,17 @@ class BetterMap extends Map {
213
225
  }
214
226
  }
215
227
 
228
+ var __defProp$1 = Object.defineProperty;
229
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
230
+ var __publicField$1 = (obj, key, value) => {
231
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
232
+ return value;
233
+ };
216
234
  class CountableSet extends Set {
217
235
  constructor(values) {
218
236
  super(values);
237
+ __publicField$1(this, "_map");
219
238
  this._map ?? (this._map = /* @__PURE__ */ new Map());
220
- for (const value of values ?? [])
221
- this.add(value);
222
239
  }
223
240
  add(key) {
224
241
  this._map ?? (this._map = /* @__PURE__ */ new Map());
@@ -327,6 +344,7 @@ function parseVariantGroup(str, separators = ["-", ":"], depth = 5) {
327
344
  prefixes: Array.from(prefixes),
328
345
  hasChanged,
329
346
  groupsByOffset,
347
+ // Computed lazily because MagicString's toString does a lot of work
330
348
  get expanded() {
331
349
  return expanded.toString();
332
350
  }
@@ -599,17 +617,24 @@ function mergeAutocompleteShorthands(shorthands) {
599
617
  );
600
618
  }
601
619
 
602
- const version = "0.55.0";
620
+ const version = "0.55.2";
603
621
 
622
+ var __defProp = Object.defineProperty;
623
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
624
+ var __publicField = (obj, key, value) => {
625
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
626
+ return value;
627
+ };
604
628
  class UnoGenerator {
605
629
  constructor(userConfig = {}, defaults = {}) {
606
630
  this.userConfig = userConfig;
607
631
  this.defaults = defaults;
608
- this.version = version;
609
- this._cache = /* @__PURE__ */ new Map();
610
- this.blocked = /* @__PURE__ */ new Set();
611
- this.parentOrders = /* @__PURE__ */ new Map();
612
- this.events = createNanoEvents();
632
+ __publicField(this, "version", version);
633
+ __publicField(this, "_cache", /* @__PURE__ */ new Map());
634
+ __publicField(this, "config");
635
+ __publicField(this, "blocked", /* @__PURE__ */ new Set());
636
+ __publicField(this, "parentOrders", /* @__PURE__ */ new Map());
637
+ __publicField(this, "events", createNanoEvents());
613
638
  this.config = resolveConfig(userConfig, defaults);
614
639
  this.events.emit("config", this.config);
615
640
  }