@styleframe/loader 2.0.1 → 2.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @styleframe/loader
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`1ead424`](https://github.com/styleframe-dev/styleframe/commit/1ead424825a6696969294d3127ac79298da03182) Thanks [@alexgrozav](https://github.com/alexgrozav)! - feat: update license package version
8
+
9
+ - [`a08c996`](https://github.com/styleframe-dev/styleframe/commit/a08c996b3b781ead2000b087b3b16906821ba5e3) Thanks [@alexgrozav](https://github.com/alexgrozav)! - fix: update package dependencies
10
+
11
+ - Updated dependencies [[`1ead424`](https://github.com/styleframe-dev/styleframe/commit/1ead424825a6696969294d3127ac79298da03182), [`a08c996`](https://github.com/styleframe-dev/styleframe/commit/a08c996b3b781ead2000b087b3b16906821ba5e3)]:
12
+ - @styleframe/core@2.0.2
13
+ - @styleframe/transpiler@2.0.2
14
+
3
15
  ## 2.0.1
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -5,8 +5,8 @@
5
5
  const N = ["charset", "import", "namespace"], R$1 = ["layer"], D$1 = ({ name: e }) => `[data-theme="${e}"]`, I = ({
6
6
  name: e,
7
7
  value: t,
8
- modifiers: r
9
- }) => `._${[...r, e, t].filter(Boolean).join("\\:")}`, w = ({ name: e }) => e;
8
+ modifiers: n
9
+ }) => `._${[...n, e, t].filter(Boolean).join("\\:")}`, w = ({ name: e }) => e;
10
10
  function L(e, t) {
11
11
  return `@${e}${t ? " " : ""}${t}`;
12
12
  }
@@ -16,34 +16,34 @@
16
16
  return e !== e.toLowerCase();
17
17
  }
18
18
  function U$1(e, t) {
19
- const r = M$1, n = [];
19
+ const n = M$1, r = [];
20
20
  if (!e || typeof e != "string")
21
- return n;
22
- let u = "", a, i;
21
+ return r;
22
+ let c = "", a, i;
23
23
  for (const s of e) {
24
- const o = r.includes(s);
24
+ const o = n.includes(s);
25
25
  if (o === true) {
26
- n.push(u), u = "", a = void 0;
26
+ r.push(c), c = "", a = void 0;
27
27
  continue;
28
28
  }
29
- const c = $$1(s);
29
+ const u = $$1(s);
30
30
  if (i === false) {
31
- if (a === false && c === true) {
32
- n.push(u), u = s, a = c;
31
+ if (a === false && u === true) {
32
+ r.push(c), c = s, a = u;
33
33
  continue;
34
34
  }
35
- if (a === true && c === false && u.length > 1) {
36
- const f = u.at(-1);
37
- n.push(u.slice(0, Math.max(0, u.length - 1))), u = f + s, a = c;
35
+ if (a === true && u === false && c.length > 1) {
36
+ const f = c.at(-1);
37
+ r.push(c.slice(0, Math.max(0, c.length - 1))), c = f + s, a = u;
38
38
  continue;
39
39
  }
40
40
  }
41
- u += s, a = c, i = o;
41
+ c += s, a = u, i = o;
42
42
  }
43
- return n.push(u), n;
43
+ return r.push(c), r;
44
44
  }
45
45
  function _$1(e, t) {
46
- return e ? (Array.isArray(e) ? e : U$1(e)).map((r) => r.toLowerCase()).join("-") : "";
46
+ return e ? (Array.isArray(e) ? e : U$1(e)).map((n) => n.toLowerCase()).join("-") : "";
47
47
  }
48
48
  function k$1(e) {
49
49
  return ` ${e}`;
@@ -80,28 +80,28 @@
80
80
  return `${e} ${q$1(t)}`;
81
81
  }
82
82
  function Q$1(e) {
83
- return function(r, n) {
84
- return Object.entries(r).map(([u, a]) => B$1(u, e(a, n)));
83
+ return function(n, r) {
84
+ return Object.entries(n).map(([c, a]) => B$1(c, e(a, r)));
85
85
  };
86
86
  }
87
87
  function E$1(e) {
88
- return function(r, n) {
89
- const a = (n.variables?.name ?? w)({ name: r.name });
90
- return z$1(a, e(r.value, n));
88
+ return function(n, r) {
89
+ const a = (r.variables?.name ?? w)({ name: n.name });
90
+ return z$1(a, e(n.value, r));
91
91
  };
92
92
  }
93
93
  function S$1(e) {
94
- const t = E$1(e), r = Q$1(e);
95
- return function(u, a, i) {
96
- const { variables: s, declarations: o, children: c } = a, f = u === ":root", l = (s ?? []).map(
94
+ const t = E$1(e), n = Q$1(e);
95
+ return function(c, a, i) {
96
+ const { variables: s, declarations: o, children: u } = a, f = c === ":root", l = (s ?? []).map(
97
97
  (A2) => t(A2, i)
98
- ), m2 = r(
98
+ ), m2 = n(
99
99
  o ?? {},
100
100
  i
101
- ), y = (c ?? []).map(
101
+ ), y = (u ?? []).map(
102
102
  (A2) => e(A2, i)
103
103
  ), d = l.length > 0, h = m2.length > 0, v = y.length > 0;
104
- return f ? `${d || h ? C$1(u, [
104
+ return f ? `${d || h ? C$1(c, [
105
105
  ...l,
106
106
  ...d && h ? [""] : [],
107
107
  ...m2
@@ -109,7 +109,7 @@
109
109
 
110
110
  ` : ""}${y.join(`
111
111
 
112
- `)}` : C$1(u, [
112
+ `)}` : C$1(c, [
113
113
  ...l,
114
114
  ...d && (v || h) ? [""] : [],
115
115
  ...m2,
@@ -122,11 +122,11 @@
122
122
  }
123
123
  function Z(e) {
124
124
  const t = S$1(e);
125
- return function(n, u) {
126
- const a = N.includes(n.identifier), i = R$1.includes(
127
- n.identifier
128
- ), s = Object.keys(n.declarations).length > 0, o = n.variables.length > 0, c = n.children.length > 0, f = L(n.identifier, n.rule);
129
- return a || i && !(s || o || c) ? `${f};` : t(f, n, u);
125
+ return function(r, c) {
126
+ const a = N.includes(r.identifier), i = R$1.includes(
127
+ r.identifier
128
+ ), s = Object.keys(r.declarations).length > 0, o = r.variables.length > 0, u = r.children.length > 0, f = L(r.identifier, r.rule);
129
+ return a || i && !(s || o || u) ? `${f};` : t(f, r, c);
130
130
  };
131
131
  }
132
132
  function W$1(e) {
@@ -171,79 +171,79 @@
171
171
  }
172
172
  function oe(e) {
173
173
  if (e = e || {}, e.circular)
174
- return ce(e);
174
+ return ue$1(e);
175
175
  const t = /* @__PURE__ */ new Map();
176
176
  if (t.set(Date, (i) => new Date(i)), t.set(
177
177
  Map,
178
- (i, s) => new Map(n(Array.from(i), s))
178
+ (i, s) => new Map(r(Array.from(i), s))
179
179
  ), t.set(
180
180
  Set,
181
- (i, s) => new Set(n(Array.from(i), s))
181
+ (i, s) => new Set(r(Array.from(i), s))
182
182
  ), e.constructorHandlers)
183
183
  for (const i of e.constructorHandlers)
184
184
  t.set(i[0], i[1]);
185
- let r;
186
- return e.proto ? a : u;
187
- function n(i, s) {
188
- const o = Object.keys(i), c = Array.from({ length: o.length });
185
+ let n;
186
+ return e.proto ? a : c;
187
+ function r(i, s) {
188
+ const o = Object.keys(i), u = Array.from({ length: o.length });
189
189
  for (let f = 0; f < o.length; f++) {
190
190
  const l = o[f], m2 = i[l];
191
- typeof m2 != "object" || m2 === null ? c[l] = m2 : m2.constructor !== Object && (r = t.get(m2.constructor)) ? c[l] = r(m2, s) : ArrayBuffer.isView(m2) ? c[l] = g$1(m2) : c[l] = s(m2);
191
+ typeof m2 != "object" || m2 === null ? u[l] = m2 : m2.constructor !== Object && (n = t.get(m2.constructor)) ? u[l] = n(m2, s) : ArrayBuffer.isView(m2) ? u[l] = g$1(m2) : u[l] = s(m2);
192
192
  }
193
- return c;
193
+ return u;
194
194
  }
195
- function u(i) {
195
+ function c(i) {
196
196
  if (typeof i != "object" || i === null) return i;
197
- if (Array.isArray(i)) return n(i, u);
198
- if (i.constructor !== Object && (r = t.get(i.constructor)))
199
- return r(i, u);
197
+ if (Array.isArray(i)) return r(i, c);
198
+ if (i.constructor !== Object && (n = t.get(i.constructor)))
199
+ return n(i, c);
200
200
  const s = {};
201
201
  for (const o in i) {
202
202
  if (Object.hasOwnProperty.call(i, o) === false) continue;
203
- const c = i[o];
204
- typeof c != "object" || c === null ? s[o] = c : c.constructor !== Object && (r = t.get(c.constructor)) ? s[o] = r(c, u) : ArrayBuffer.isView(c) ? s[o] = g$1(c) : s[o] = u(c);
203
+ const u = i[o];
204
+ typeof u != "object" || u === null ? s[o] = u : u.constructor !== Object && (n = t.get(u.constructor)) ? s[o] = n(u, c) : ArrayBuffer.isView(u) ? s[o] = g$1(u) : s[o] = c(u);
205
205
  }
206
206
  return s;
207
207
  }
208
208
  function a(i) {
209
209
  if (typeof i != "object" || i === null) return i;
210
- if (Array.isArray(i)) return n(i, a);
211
- if (i.constructor !== Object && (r = t.get(i.constructor)))
212
- return r(i, a);
210
+ if (Array.isArray(i)) return r(i, a);
211
+ if (i.constructor !== Object && (n = t.get(i.constructor)))
212
+ return n(i, a);
213
213
  const s = {};
214
214
  for (const o in i) {
215
- const c = i[o];
216
- typeof c != "object" || c === null ? s[o] = c : c.constructor !== Object && (r = t.get(c.constructor)) ? s[o] = r(c, a) : ArrayBuffer.isView(c) ? s[o] = g$1(c) : s[o] = a(c);
215
+ const u = i[o];
216
+ typeof u != "object" || u === null ? s[o] = u : u.constructor !== Object && (n = t.get(u.constructor)) ? s[o] = n(u, a) : ArrayBuffer.isView(u) ? s[o] = g$1(u) : s[o] = a(u);
217
217
  }
218
218
  return s;
219
219
  }
220
220
  }
221
- function ce(e) {
222
- const t = [], r = [], n = /* @__PURE__ */ new Map();
223
- if (n.set(Date, (o) => new Date(o)), n.set(
221
+ function ue$1(e) {
222
+ const t = [], n = [], r = /* @__PURE__ */ new Map();
223
+ if (r.set(Date, (o) => new Date(o)), r.set(
224
224
  Map,
225
- (o, c) => new Map(a(Array.from(o), c))
226
- ), n.set(
225
+ (o, u) => new Map(a(Array.from(o), u))
226
+ ), r.set(
227
227
  Set,
228
- (o, c) => new Set(a(Array.from(o), c))
228
+ (o, u) => new Set(a(Array.from(o), u))
229
229
  ), e.constructorHandlers)
230
230
  for (const o of e.constructorHandlers)
231
- n.set(o[0], o[1]);
232
- let u;
231
+ r.set(o[0], o[1]);
232
+ let c;
233
233
  return e.proto ? s : i;
234
- function a(o, c) {
234
+ function a(o, u) {
235
235
  const f = Object.keys(o), l = Array.from({ length: f.length });
236
236
  for (let m2 = 0; m2 < f.length; m2++) {
237
237
  const y = f[m2], d = o[y];
238
238
  if (typeof d != "object" || d === null)
239
239
  l[y] = d;
240
- else if (d.constructor !== Object && (u = n.get(d.constructor)))
241
- l[y] = u(d, c);
240
+ else if (d.constructor !== Object && (c = r.get(d.constructor)))
241
+ l[y] = c(d, u);
242
242
  else if (ArrayBuffer.isView(d))
243
243
  l[y] = g$1(d);
244
244
  else {
245
245
  const h = t.indexOf(d);
246
- h !== -1 ? l[y] = r[h] : l[y] = c(d);
246
+ h !== -1 ? l[y] = n[h] : l[y] = u(d);
247
247
  }
248
248
  }
249
249
  return l;
@@ -251,75 +251,75 @@
251
251
  function i(o) {
252
252
  if (typeof o != "object" || o === null) return o;
253
253
  if (Array.isArray(o)) return a(o, i);
254
- if (o.constructor !== Object && (u = n.get(o.constructor)))
255
- return u(o, i);
256
- const c = {};
257
- t.push(o), r.push(c);
254
+ if (o.constructor !== Object && (c = r.get(o.constructor)))
255
+ return c(o, i);
256
+ const u = {};
257
+ t.push(o), n.push(u);
258
258
  for (const f in o) {
259
259
  if (Object.hasOwnProperty.call(o, f) === false) continue;
260
260
  const l = o[f];
261
261
  if (typeof l != "object" || l === null)
262
- c[f] = l;
263
- else if (l.constructor !== Object && (u = n.get(l.constructor)))
264
- c[f] = u(l, i);
262
+ u[f] = l;
263
+ else if (l.constructor !== Object && (c = r.get(l.constructor)))
264
+ u[f] = c(l, i);
265
265
  else if (ArrayBuffer.isView(l))
266
- c[f] = g$1(l);
266
+ u[f] = g$1(l);
267
267
  else {
268
268
  const m2 = t.indexOf(l);
269
- m2 !== -1 ? c[f] = r[m2] : c[f] = i(l);
269
+ m2 !== -1 ? u[f] = n[m2] : u[f] = i(l);
270
270
  }
271
271
  }
272
- return t.pop(), r.pop(), c;
272
+ return t.pop(), n.pop(), u;
273
273
  }
274
274
  function s(o) {
275
275
  if (typeof o != "object" || o === null) return o;
276
276
  if (Array.isArray(o)) return a(o, s);
277
- if (o.constructor !== Object && (u = n.get(o.constructor)))
278
- return u(o, s);
279
- const c = {};
280
- t.push(o), r.push(c);
277
+ if (o.constructor !== Object && (c = r.get(o.constructor)))
278
+ return c(o, s);
279
+ const u = {};
280
+ t.push(o), n.push(u);
281
281
  for (const f in o) {
282
282
  const l = o[f];
283
283
  if (typeof l != "object" || l === null)
284
- c[f] = l;
285
- else if (l.constructor !== Object && (u = n.get(l.constructor)))
286
- c[f] = u(l, s);
284
+ u[f] = l;
285
+ else if (l.constructor !== Object && (c = r.get(l.constructor)))
286
+ u[f] = c(l, s);
287
287
  else if (ArrayBuffer.isView(l))
288
- c[f] = g$1(l);
288
+ u[f] = g$1(l);
289
289
  else {
290
290
  const m2 = t.indexOf(l);
291
- m2 !== -1 ? c[f] = r[m2] : c[f] = s(l);
291
+ m2 !== -1 ? u[f] = n[m2] : u[f] = s(l);
292
292
  }
293
293
  }
294
- return t.pop(), r.pop(), c;
294
+ return t.pop(), n.pop(), u;
295
295
  }
296
296
  }
297
297
  oe();
298
- function ue$1(e) {
299
- return function(r, n) {
300
- return r.value.map((u) => e(u, n)).join("").trim();
298
+ function ce(e) {
299
+ return function(n, r) {
300
+ return n.value.map((c) => e(c, r)).join("").trim();
301
301
  };
302
302
  }
303
303
  function ie(e) {
304
- return function(r, n) {
305
- return r != null ? `${r}` : "";
304
+ return function(n, r) {
305
+ return n != null ? `${n}` : "";
306
306
  };
307
307
  }
308
308
  function se(e) {
309
- return function(r, n) {
310
- const a = (n.variables?.name ?? w)({ name: r.name });
309
+ return function(n, r) {
310
+ const a = (r.variables?.name ?? w)({ name: n.name });
311
311
  return H$1(
312
312
  a,
313
- r.fallback ? e(r.fallback, n) : void 0
313
+ n.fallback ? e(n.fallback, r) : void 0
314
314
  );
315
315
  };
316
316
  }
317
317
  function ae(e) {
318
318
  const t = S$1(e);
319
- return function(n, u) {
320
- return n.themes.reduce(
321
- (a, i) => (a.push(e(i, u)), a),
322
- [t(":root", n, u)]
319
+ return function(r, c) {
320
+ return r.themes.reduce(
321
+ (a, i) => (a.push(e(i, c)), a),
322
+ [t(":root", r, c)]
323
323
  // Default theme (root)
324
324
  ).join(`
325
325
 
@@ -328,41 +328,41 @@
328
328
  }
329
329
  function le(e) {
330
330
  const t = S$1(e);
331
- return function(n, u) {
332
- return t(n.query, n, u);
331
+ return function(r, c) {
332
+ return t(r.query, r, c);
333
333
  };
334
334
  }
335
335
  function fe(e) {
336
336
  const t = S$1(e);
337
- return function(n, u) {
338
- const i = (u.theme?.selector ?? D$1)({ name: n.name });
339
- return t(i, n, u);
337
+ return function(r, c) {
338
+ const i = (c.theme?.selector ?? D$1)({ name: r.name });
339
+ return t(i, r, c);
340
340
  };
341
341
  }
342
342
  function me(e) {
343
343
  const t = S$1(e);
344
- return function(n, u) {
345
- const a = [], s = (u.utilities?.selector ?? I)({
346
- name: n.name,
347
- value: n.value,
348
- modifiers: n.modifiers
344
+ return function(r, c) {
345
+ const a = [], s = (c.utilities?.selector ?? I)({
346
+ name: r.name,
347
+ value: r.value,
348
+ modifiers: r.modifiers
349
349
  });
350
- return a.push(t(s, n, u)), a.join(`
350
+ return a.push(t(s, r, c)), a.join(`
351
351
 
352
352
  `);
353
353
  };
354
354
  }
355
355
  function p$1(e, t) {
356
- const r = ae(p$1), n = le(p$1), u = me(p$1), a = Z(p$1), i = fe(p$1), s = E$1(p$1), o = se(p$1), c = ue$1(p$1), f = ie();
356
+ const n = ae(p$1), r = le(p$1), c = me(p$1), a = Z(p$1), i = fe(p$1), s = E$1(p$1), o = se(p$1), u = ce(p$1), f = ie();
357
357
  switch (true) {
358
358
  case Y$1(e):
359
- return n(e, t);
359
+ return r(e, t);
360
360
  case ee(e):
361
- return u(e, t);
361
+ return c(e, t);
362
362
  case X$1(e):
363
363
  return a(e, t);
364
364
  case re(e):
365
- return r(e, t);
365
+ return n(e, t);
366
366
  case ne(e):
367
367
  return i(e, t);
368
368
  case J$1(e):
@@ -370,7 +370,7 @@
370
370
  case G$1(e):
371
371
  return o(e, t);
372
372
  case te(e):
373
- return c(e, t);
373
+ return u(e, t);
374
374
  default:
375
375
  return f(e, t);
376
376
  }
@@ -378,7 +378,7 @@
378
378
  function T$1(e, t) {
379
379
  switch (true) {
380
380
  case Array.isArray(e):
381
- return e.map((r) => T$1(r)).join(`
381
+ return e.map((n) => T$1(n)).join(`
382
382
  `);
383
383
  // case isRecipe(instance):
384
384
  // return consumeRecipe(instance, options);
@@ -397,10 +397,10 @@ hC7NbH+hPcGc/qIaZSjZfyZeBIZS74qJkrzjEA7/pukROD8UQUrQ512HHZ6XlgMn
397
397
  GwIDAQAB
398
398
  -----END PUBLIC KEY-----`, ye = "__licenseRequired", pe = "__licenseValidated";
399
399
  async function he(e) {
400
- const t = e.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), r = Uint8Array.from(atob(t), (n) => n.charCodeAt(0));
400
+ const t = e.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), n = Uint8Array.from(atob(t), (r) => r.charCodeAt(0));
401
401
  return await crypto.subtle.importKey(
402
402
  "spki",
403
- r,
403
+ n,
404
404
  {
405
405
  name: "RSASSA-PKCS1-v1_5",
406
406
  hash: "SHA-256"
@@ -413,15 +413,15 @@ GwIDAQAB
413
413
  payload: e,
414
414
  signature: t
415
415
  }) {
416
- const r = new TextEncoder().encode(e), n = Uint8Array.from(
416
+ const n = new TextEncoder().encode(e), r = Uint8Array.from(
417
417
  atob(t),
418
418
  (a) => a.charCodeAt(0)
419
- ), u = await he(de);
419
+ ), c = await he(de);
420
420
  if (!await crypto.subtle.verify(
421
421
  { name: "RSASSA-PKCS1-v1_5" },
422
- u,
423
- n,
424
- r
422
+ c,
423
+ r,
424
+ n
425
425
  ))
426
426
  throw new Error(
427
427
  "License validation failed: Invalid signature detected. The license may have been modified or corrupted."
@@ -443,8 +443,8 @@ GwIDAQAB
443
443
  environment: "",
444
444
  valid: false
445
445
  };
446
- const r = t.value;
447
- if (typeof r != "object" || r === null || !("payload" in r) || !("signature" in r) || typeof r.payload != "string" || typeof r.signature != "string")
446
+ const n = t.value;
447
+ if (typeof n != "object" || n === null || !("payload" in n) || !("signature" in n) || typeof n.payload != "string" || typeof n.signature != "string")
448
448
  return {
449
449
  key: "",
450
450
  instanceId: "",
@@ -453,7 +453,7 @@ GwIDAQAB
453
453
  };
454
454
  try {
455
455
  return await be(
456
- r
456
+ n
457
457
  );
458
458
  } catch {
459
459
  return {
@@ -496,23 +496,23 @@ GwIDAQAB
496
496
  }
497
497
  async function Ce(e, {
498
498
  type: t = "all",
499
- consumers: r = { css: p$1, ts: T$1 }
499
+ consumers: n = { css: p$1, ts: T$1 }
500
500
  } = {}) {
501
- const n = { files: [] }, u = e.options;
501
+ const r = { files: [] }, c = e.options;
502
502
  if (Ae(e)) {
503
503
  const s = await ge(e);
504
504
  (!s.valid || s.instanceId !== e.id) && Se(e);
505
505
  }
506
506
  const { recipes: a, ...i } = e.root;
507
507
  if (t === "all" || t === "css") {
508
- const s = j("index.css", r.css(i, u));
509
- n.files.push(s);
508
+ const s = j("index.css", n.css(i, c));
509
+ r.files.push(s);
510
510
  }
511
511
  if (t === "all" || t === "ts") {
512
- const s = j("index.ts", r.ts([], u));
513
- n.files.push(s);
512
+ const s = j("index.ts", n.ts([], c));
513
+ r.files.push(s);
514
514
  }
515
- return console.log(n.files), n;
515
+ return r;
516
516
  }
517
517
  async function directoryExists(path2) {
518
518
  try {
package/dist/index.js CHANGED
@@ -5,8 +5,8 @@ import { loadConfig, watchConfig } from "c12";
5
5
  const N = ["charset", "import", "namespace"], R$1 = ["layer"], D$1 = ({ name: e }) => `[data-theme="${e}"]`, I = ({
6
6
  name: e,
7
7
  value: t,
8
- modifiers: r
9
- }) => `._${[...r, e, t].filter(Boolean).join("\\:")}`, w = ({ name: e }) => e;
8
+ modifiers: n
9
+ }) => `._${[...n, e, t].filter(Boolean).join("\\:")}`, w = ({ name: e }) => e;
10
10
  function L(e, t) {
11
11
  return `@${e}${t ? " " : ""}${t}`;
12
12
  }
@@ -16,34 +16,34 @@ function $$1(e = "") {
16
16
  return e !== e.toLowerCase();
17
17
  }
18
18
  function U$1(e, t) {
19
- const r = M$1, n = [];
19
+ const n = M$1, r = [];
20
20
  if (!e || typeof e != "string")
21
- return n;
22
- let u = "", a, i;
21
+ return r;
22
+ let c = "", a, i;
23
23
  for (const s of e) {
24
- const o = r.includes(s);
24
+ const o = n.includes(s);
25
25
  if (o === true) {
26
- n.push(u), u = "", a = void 0;
26
+ r.push(c), c = "", a = void 0;
27
27
  continue;
28
28
  }
29
- const c = $$1(s);
29
+ const u = $$1(s);
30
30
  if (i === false) {
31
- if (a === false && c === true) {
32
- n.push(u), u = s, a = c;
31
+ if (a === false && u === true) {
32
+ r.push(c), c = s, a = u;
33
33
  continue;
34
34
  }
35
- if (a === true && c === false && u.length > 1) {
36
- const f = u.at(-1);
37
- n.push(u.slice(0, Math.max(0, u.length - 1))), u = f + s, a = c;
35
+ if (a === true && u === false && c.length > 1) {
36
+ const f = c.at(-1);
37
+ r.push(c.slice(0, Math.max(0, c.length - 1))), c = f + s, a = u;
38
38
  continue;
39
39
  }
40
40
  }
41
- u += s, a = c, i = o;
41
+ c += s, a = u, i = o;
42
42
  }
43
- return n.push(u), n;
43
+ return r.push(c), r;
44
44
  }
45
45
  function _$1(e, t) {
46
- return e ? (Array.isArray(e) ? e : U$1(e)).map((r) => r.toLowerCase()).join("-") : "";
46
+ return e ? (Array.isArray(e) ? e : U$1(e)).map((n) => n.toLowerCase()).join("-") : "";
47
47
  }
48
48
  function k$1(e) {
49
49
  return ` ${e}`;
@@ -80,28 +80,28 @@ function C$1(e, t) {
80
80
  return `${e} ${q$1(t)}`;
81
81
  }
82
82
  function Q$1(e) {
83
- return function(r, n) {
84
- return Object.entries(r).map(([u, a]) => B$1(u, e(a, n)));
83
+ return function(n, r) {
84
+ return Object.entries(n).map(([c, a]) => B$1(c, e(a, r)));
85
85
  };
86
86
  }
87
87
  function E$1(e) {
88
- return function(r, n) {
89
- const a = (n.variables?.name ?? w)({ name: r.name });
90
- return z$1(a, e(r.value, n));
88
+ return function(n, r) {
89
+ const a = (r.variables?.name ?? w)({ name: n.name });
90
+ return z$1(a, e(n.value, r));
91
91
  };
92
92
  }
93
93
  function S$1(e) {
94
- const t = E$1(e), r = Q$1(e);
95
- return function(u, a, i) {
96
- const { variables: s, declarations: o, children: c } = a, f = u === ":root", l = (s ?? []).map(
94
+ const t = E$1(e), n = Q$1(e);
95
+ return function(c, a, i) {
96
+ const { variables: s, declarations: o, children: u } = a, f = c === ":root", l = (s ?? []).map(
97
97
  (A2) => t(A2, i)
98
- ), m2 = r(
98
+ ), m2 = n(
99
99
  o ?? {},
100
100
  i
101
- ), y = (c ?? []).map(
101
+ ), y = (u ?? []).map(
102
102
  (A2) => e(A2, i)
103
103
  ), d = l.length > 0, h = m2.length > 0, v = y.length > 0;
104
- return f ? `${d || h ? C$1(u, [
104
+ return f ? `${d || h ? C$1(c, [
105
105
  ...l,
106
106
  ...d && h ? [""] : [],
107
107
  ...m2
@@ -109,7 +109,7 @@ function S$1(e) {
109
109
 
110
110
  ` : ""}${y.join(`
111
111
 
112
- `)}` : C$1(u, [
112
+ `)}` : C$1(c, [
113
113
  ...l,
114
114
  ...d && (v || h) ? [""] : [],
115
115
  ...m2,
@@ -122,11 +122,11 @@ function S$1(e) {
122
122
  }
123
123
  function Z(e) {
124
124
  const t = S$1(e);
125
- return function(n, u) {
126
- const a = N.includes(n.identifier), i = R$1.includes(
127
- n.identifier
128
- ), s = Object.keys(n.declarations).length > 0, o = n.variables.length > 0, c = n.children.length > 0, f = L(n.identifier, n.rule);
129
- return a || i && !(s || o || c) ? `${f};` : t(f, n, u);
125
+ return function(r, c) {
126
+ const a = N.includes(r.identifier), i = R$1.includes(
127
+ r.identifier
128
+ ), s = Object.keys(r.declarations).length > 0, o = r.variables.length > 0, u = r.children.length > 0, f = L(r.identifier, r.rule);
129
+ return a || i && !(s || o || u) ? `${f};` : t(f, r, c);
130
130
  };
131
131
  }
132
132
  function W$1(e) {
@@ -171,79 +171,79 @@ function g$1(e) {
171
171
  }
172
172
  function oe(e) {
173
173
  if (e = e || {}, e.circular)
174
- return ce(e);
174
+ return ue$1(e);
175
175
  const t = /* @__PURE__ */ new Map();
176
176
  if (t.set(Date, (i) => new Date(i)), t.set(
177
177
  Map,
178
- (i, s) => new Map(n(Array.from(i), s))
178
+ (i, s) => new Map(r(Array.from(i), s))
179
179
  ), t.set(
180
180
  Set,
181
- (i, s) => new Set(n(Array.from(i), s))
181
+ (i, s) => new Set(r(Array.from(i), s))
182
182
  ), e.constructorHandlers)
183
183
  for (const i of e.constructorHandlers)
184
184
  t.set(i[0], i[1]);
185
- let r;
186
- return e.proto ? a : u;
187
- function n(i, s) {
188
- const o = Object.keys(i), c = Array.from({ length: o.length });
185
+ let n;
186
+ return e.proto ? a : c;
187
+ function r(i, s) {
188
+ const o = Object.keys(i), u = Array.from({ length: o.length });
189
189
  for (let f = 0; f < o.length; f++) {
190
190
  const l = o[f], m2 = i[l];
191
- typeof m2 != "object" || m2 === null ? c[l] = m2 : m2.constructor !== Object && (r = t.get(m2.constructor)) ? c[l] = r(m2, s) : ArrayBuffer.isView(m2) ? c[l] = g$1(m2) : c[l] = s(m2);
191
+ typeof m2 != "object" || m2 === null ? u[l] = m2 : m2.constructor !== Object && (n = t.get(m2.constructor)) ? u[l] = n(m2, s) : ArrayBuffer.isView(m2) ? u[l] = g$1(m2) : u[l] = s(m2);
192
192
  }
193
- return c;
193
+ return u;
194
194
  }
195
- function u(i) {
195
+ function c(i) {
196
196
  if (typeof i != "object" || i === null) return i;
197
- if (Array.isArray(i)) return n(i, u);
198
- if (i.constructor !== Object && (r = t.get(i.constructor)))
199
- return r(i, u);
197
+ if (Array.isArray(i)) return r(i, c);
198
+ if (i.constructor !== Object && (n = t.get(i.constructor)))
199
+ return n(i, c);
200
200
  const s = {};
201
201
  for (const o in i) {
202
202
  if (Object.hasOwnProperty.call(i, o) === false) continue;
203
- const c = i[o];
204
- typeof c != "object" || c === null ? s[o] = c : c.constructor !== Object && (r = t.get(c.constructor)) ? s[o] = r(c, u) : ArrayBuffer.isView(c) ? s[o] = g$1(c) : s[o] = u(c);
203
+ const u = i[o];
204
+ typeof u != "object" || u === null ? s[o] = u : u.constructor !== Object && (n = t.get(u.constructor)) ? s[o] = n(u, c) : ArrayBuffer.isView(u) ? s[o] = g$1(u) : s[o] = c(u);
205
205
  }
206
206
  return s;
207
207
  }
208
208
  function a(i) {
209
209
  if (typeof i != "object" || i === null) return i;
210
- if (Array.isArray(i)) return n(i, a);
211
- if (i.constructor !== Object && (r = t.get(i.constructor)))
212
- return r(i, a);
210
+ if (Array.isArray(i)) return r(i, a);
211
+ if (i.constructor !== Object && (n = t.get(i.constructor)))
212
+ return n(i, a);
213
213
  const s = {};
214
214
  for (const o in i) {
215
- const c = i[o];
216
- typeof c != "object" || c === null ? s[o] = c : c.constructor !== Object && (r = t.get(c.constructor)) ? s[o] = r(c, a) : ArrayBuffer.isView(c) ? s[o] = g$1(c) : s[o] = a(c);
215
+ const u = i[o];
216
+ typeof u != "object" || u === null ? s[o] = u : u.constructor !== Object && (n = t.get(u.constructor)) ? s[o] = n(u, a) : ArrayBuffer.isView(u) ? s[o] = g$1(u) : s[o] = a(u);
217
217
  }
218
218
  return s;
219
219
  }
220
220
  }
221
- function ce(e) {
222
- const t = [], r = [], n = /* @__PURE__ */ new Map();
223
- if (n.set(Date, (o) => new Date(o)), n.set(
221
+ function ue$1(e) {
222
+ const t = [], n = [], r = /* @__PURE__ */ new Map();
223
+ if (r.set(Date, (o) => new Date(o)), r.set(
224
224
  Map,
225
- (o, c) => new Map(a(Array.from(o), c))
226
- ), n.set(
225
+ (o, u) => new Map(a(Array.from(o), u))
226
+ ), r.set(
227
227
  Set,
228
- (o, c) => new Set(a(Array.from(o), c))
228
+ (o, u) => new Set(a(Array.from(o), u))
229
229
  ), e.constructorHandlers)
230
230
  for (const o of e.constructorHandlers)
231
- n.set(o[0], o[1]);
232
- let u;
231
+ r.set(o[0], o[1]);
232
+ let c;
233
233
  return e.proto ? s : i;
234
- function a(o, c) {
234
+ function a(o, u) {
235
235
  const f = Object.keys(o), l = Array.from({ length: f.length });
236
236
  for (let m2 = 0; m2 < f.length; m2++) {
237
237
  const y = f[m2], d = o[y];
238
238
  if (typeof d != "object" || d === null)
239
239
  l[y] = d;
240
- else if (d.constructor !== Object && (u = n.get(d.constructor)))
241
- l[y] = u(d, c);
240
+ else if (d.constructor !== Object && (c = r.get(d.constructor)))
241
+ l[y] = c(d, u);
242
242
  else if (ArrayBuffer.isView(d))
243
243
  l[y] = g$1(d);
244
244
  else {
245
245
  const h = t.indexOf(d);
246
- h !== -1 ? l[y] = r[h] : l[y] = c(d);
246
+ h !== -1 ? l[y] = n[h] : l[y] = u(d);
247
247
  }
248
248
  }
249
249
  return l;
@@ -251,75 +251,75 @@ function ce(e) {
251
251
  function i(o) {
252
252
  if (typeof o != "object" || o === null) return o;
253
253
  if (Array.isArray(o)) return a(o, i);
254
- if (o.constructor !== Object && (u = n.get(o.constructor)))
255
- return u(o, i);
256
- const c = {};
257
- t.push(o), r.push(c);
254
+ if (o.constructor !== Object && (c = r.get(o.constructor)))
255
+ return c(o, i);
256
+ const u = {};
257
+ t.push(o), n.push(u);
258
258
  for (const f in o) {
259
259
  if (Object.hasOwnProperty.call(o, f) === false) continue;
260
260
  const l = o[f];
261
261
  if (typeof l != "object" || l === null)
262
- c[f] = l;
263
- else if (l.constructor !== Object && (u = n.get(l.constructor)))
264
- c[f] = u(l, i);
262
+ u[f] = l;
263
+ else if (l.constructor !== Object && (c = r.get(l.constructor)))
264
+ u[f] = c(l, i);
265
265
  else if (ArrayBuffer.isView(l))
266
- c[f] = g$1(l);
266
+ u[f] = g$1(l);
267
267
  else {
268
268
  const m2 = t.indexOf(l);
269
- m2 !== -1 ? c[f] = r[m2] : c[f] = i(l);
269
+ m2 !== -1 ? u[f] = n[m2] : u[f] = i(l);
270
270
  }
271
271
  }
272
- return t.pop(), r.pop(), c;
272
+ return t.pop(), n.pop(), u;
273
273
  }
274
274
  function s(o) {
275
275
  if (typeof o != "object" || o === null) return o;
276
276
  if (Array.isArray(o)) return a(o, s);
277
- if (o.constructor !== Object && (u = n.get(o.constructor)))
278
- return u(o, s);
279
- const c = {};
280
- t.push(o), r.push(c);
277
+ if (o.constructor !== Object && (c = r.get(o.constructor)))
278
+ return c(o, s);
279
+ const u = {};
280
+ t.push(o), n.push(u);
281
281
  for (const f in o) {
282
282
  const l = o[f];
283
283
  if (typeof l != "object" || l === null)
284
- c[f] = l;
285
- else if (l.constructor !== Object && (u = n.get(l.constructor)))
286
- c[f] = u(l, s);
284
+ u[f] = l;
285
+ else if (l.constructor !== Object && (c = r.get(l.constructor)))
286
+ u[f] = c(l, s);
287
287
  else if (ArrayBuffer.isView(l))
288
- c[f] = g$1(l);
288
+ u[f] = g$1(l);
289
289
  else {
290
290
  const m2 = t.indexOf(l);
291
- m2 !== -1 ? c[f] = r[m2] : c[f] = s(l);
291
+ m2 !== -1 ? u[f] = n[m2] : u[f] = s(l);
292
292
  }
293
293
  }
294
- return t.pop(), r.pop(), c;
294
+ return t.pop(), n.pop(), u;
295
295
  }
296
296
  }
297
297
  oe();
298
- function ue$1(e) {
299
- return function(r, n) {
300
- return r.value.map((u) => e(u, n)).join("").trim();
298
+ function ce(e) {
299
+ return function(n, r) {
300
+ return n.value.map((c) => e(c, r)).join("").trim();
301
301
  };
302
302
  }
303
303
  function ie(e) {
304
- return function(r, n) {
305
- return r != null ? `${r}` : "";
304
+ return function(n, r) {
305
+ return n != null ? `${n}` : "";
306
306
  };
307
307
  }
308
308
  function se(e) {
309
- return function(r, n) {
310
- const a = (n.variables?.name ?? w)({ name: r.name });
309
+ return function(n, r) {
310
+ const a = (r.variables?.name ?? w)({ name: n.name });
311
311
  return H$1(
312
312
  a,
313
- r.fallback ? e(r.fallback, n) : void 0
313
+ n.fallback ? e(n.fallback, r) : void 0
314
314
  );
315
315
  };
316
316
  }
317
317
  function ae(e) {
318
318
  const t = S$1(e);
319
- return function(n, u) {
320
- return n.themes.reduce(
321
- (a, i) => (a.push(e(i, u)), a),
322
- [t(":root", n, u)]
319
+ return function(r, c) {
320
+ return r.themes.reduce(
321
+ (a, i) => (a.push(e(i, c)), a),
322
+ [t(":root", r, c)]
323
323
  // Default theme (root)
324
324
  ).join(`
325
325
 
@@ -328,41 +328,41 @@ function ae(e) {
328
328
  }
329
329
  function le(e) {
330
330
  const t = S$1(e);
331
- return function(n, u) {
332
- return t(n.query, n, u);
331
+ return function(r, c) {
332
+ return t(r.query, r, c);
333
333
  };
334
334
  }
335
335
  function fe(e) {
336
336
  const t = S$1(e);
337
- return function(n, u) {
338
- const i = (u.theme?.selector ?? D$1)({ name: n.name });
339
- return t(i, n, u);
337
+ return function(r, c) {
338
+ const i = (c.theme?.selector ?? D$1)({ name: r.name });
339
+ return t(i, r, c);
340
340
  };
341
341
  }
342
342
  function me(e) {
343
343
  const t = S$1(e);
344
- return function(n, u) {
345
- const a = [], s = (u.utilities?.selector ?? I)({
346
- name: n.name,
347
- value: n.value,
348
- modifiers: n.modifiers
344
+ return function(r, c) {
345
+ const a = [], s = (c.utilities?.selector ?? I)({
346
+ name: r.name,
347
+ value: r.value,
348
+ modifiers: r.modifiers
349
349
  });
350
- return a.push(t(s, n, u)), a.join(`
350
+ return a.push(t(s, r, c)), a.join(`
351
351
 
352
352
  `);
353
353
  };
354
354
  }
355
355
  function p$1(e, t) {
356
- const r = ae(p$1), n = le(p$1), u = me(p$1), a = Z(p$1), i = fe(p$1), s = E$1(p$1), o = se(p$1), c = ue$1(p$1), f = ie();
356
+ const n = ae(p$1), r = le(p$1), c = me(p$1), a = Z(p$1), i = fe(p$1), s = E$1(p$1), o = se(p$1), u = ce(p$1), f = ie();
357
357
  switch (true) {
358
358
  case Y$1(e):
359
- return n(e, t);
359
+ return r(e, t);
360
360
  case ee(e):
361
- return u(e, t);
361
+ return c(e, t);
362
362
  case X$1(e):
363
363
  return a(e, t);
364
364
  case re(e):
365
- return r(e, t);
365
+ return n(e, t);
366
366
  case ne(e):
367
367
  return i(e, t);
368
368
  case J$1(e):
@@ -370,7 +370,7 @@ function p$1(e, t) {
370
370
  case G$1(e):
371
371
  return o(e, t);
372
372
  case te(e):
373
- return c(e, t);
373
+ return u(e, t);
374
374
  default:
375
375
  return f(e, t);
376
376
  }
@@ -378,7 +378,7 @@ function p$1(e, t) {
378
378
  function T$1(e, t) {
379
379
  switch (true) {
380
380
  case Array.isArray(e):
381
- return e.map((r) => T$1(r)).join(`
381
+ return e.map((n) => T$1(n)).join(`
382
382
  `);
383
383
  // case isRecipe(instance):
384
384
  // return consumeRecipe(instance, options);
@@ -397,10 +397,10 @@ hC7NbH+hPcGc/qIaZSjZfyZeBIZS74qJkrzjEA7/pukROD8UQUrQ512HHZ6XlgMn
397
397
  GwIDAQAB
398
398
  -----END PUBLIC KEY-----`, ye = "__licenseRequired", pe = "__licenseValidated";
399
399
  async function he(e) {
400
- const t = e.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), r = Uint8Array.from(atob(t), (n) => n.charCodeAt(0));
400
+ const t = e.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), n = Uint8Array.from(atob(t), (r) => r.charCodeAt(0));
401
401
  return await crypto.subtle.importKey(
402
402
  "spki",
403
- r,
403
+ n,
404
404
  {
405
405
  name: "RSASSA-PKCS1-v1_5",
406
406
  hash: "SHA-256"
@@ -413,15 +413,15 @@ async function be({
413
413
  payload: e,
414
414
  signature: t
415
415
  }) {
416
- const r = new TextEncoder().encode(e), n = Uint8Array.from(
416
+ const n = new TextEncoder().encode(e), r = Uint8Array.from(
417
417
  atob(t),
418
418
  (a) => a.charCodeAt(0)
419
- ), u = await he(de);
419
+ ), c = await he(de);
420
420
  if (!await crypto.subtle.verify(
421
421
  { name: "RSASSA-PKCS1-v1_5" },
422
- u,
423
- n,
424
- r
422
+ c,
423
+ r,
424
+ n
425
425
  ))
426
426
  throw new Error(
427
427
  "License validation failed: Invalid signature detected. The license may have been modified or corrupted."
@@ -443,8 +443,8 @@ async function ge(e) {
443
443
  environment: "",
444
444
  valid: false
445
445
  };
446
- const r = t.value;
447
- if (typeof r != "object" || r === null || !("payload" in r) || !("signature" in r) || typeof r.payload != "string" || typeof r.signature != "string")
446
+ const n = t.value;
447
+ if (typeof n != "object" || n === null || !("payload" in n) || !("signature" in n) || typeof n.payload != "string" || typeof n.signature != "string")
448
448
  return {
449
449
  key: "",
450
450
  instanceId: "",
@@ -453,7 +453,7 @@ async function ge(e) {
453
453
  };
454
454
  try {
455
455
  return await be(
456
- r
456
+ n
457
457
  );
458
458
  } catch {
459
459
  return {
@@ -496,23 +496,23 @@ function j(e, t = "") {
496
496
  }
497
497
  async function Ce(e, {
498
498
  type: t = "all",
499
- consumers: r = { css: p$1, ts: T$1 }
499
+ consumers: n = { css: p$1, ts: T$1 }
500
500
  } = {}) {
501
- const n = { files: [] }, u = e.options;
501
+ const r = { files: [] }, c = e.options;
502
502
  if (Ae(e)) {
503
503
  const s = await ge(e);
504
504
  (!s.valid || s.instanceId !== e.id) && Se(e);
505
505
  }
506
506
  const { recipes: a, ...i } = e.root;
507
507
  if (t === "all" || t === "css") {
508
- const s = j("index.css", r.css(i, u));
509
- n.files.push(s);
508
+ const s = j("index.css", n.css(i, c));
509
+ r.files.push(s);
510
510
  }
511
511
  if (t === "all" || t === "ts") {
512
- const s = j("index.ts", r.ts([], u));
513
- n.files.push(s);
512
+ const s = j("index.ts", n.ts([], c));
513
+ r.files.push(s);
514
514
  }
515
- return console.log(n.files), n;
515
+ return r;
516
516
  }
517
517
  async function directoryExists(path2) {
518
518
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@styleframe/loader",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "type": "module",
5
5
  "types": "./dist/index.d.ts",
6
6
  "module": "./dist/index.js",
@@ -19,10 +19,10 @@
19
19
  "README.md"
20
20
  ],
21
21
  "dependencies": {
22
- "@styleframe/license": "^1.1.0",
22
+ "@styleframe/license": "^2.0.0",
23
23
  "c12": "^3.1.0",
24
- "@styleframe/transpiler": "^2.0.1",
25
- "@styleframe/core": "^2.0.1"
24
+ "@styleframe/transpiler": "2.0.3",
25
+ "@styleframe/core": "2.0.3"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@vitest/coverage-v8": "^3.2.4",
@@ -32,8 +32,8 @@
32
32
  "vite-plugin-dts": "^4.5.4",
33
33
  "vite-plugin-node": "^7.0.0",
34
34
  "vitest": "^3.2.4",
35
- "@styleframe/config-typescript": "^2.0.1",
36
- "@styleframe/config-vite": "^2.0.1"
35
+ "@styleframe/config-typescript": "2.0.3",
36
+ "@styleframe/config-vite": "2.0.3"
37
37
  },
38
38
  "homepage": "https://github.com/styleframe-dev/styleframe#readme",
39
39
  "bugs": {