@styleframe/loader 2.0.2 → 2.1.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/CHANGELOG.md +12 -0
- package/dist/index.cjs +131 -131
- package/dist/index.js +131 -131
- package/package.json +12 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @styleframe/loader
|
|
2
2
|
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#55](https://github.com/styleframe-dev/styleframe/pull/55) [`1fd348e`](https://github.com/styleframe-dev/styleframe/commit/1fd348e5f379318f76d68055efacd370618f00d6) Thanks [@alexgrozav](https://github.com/alexgrozav)! - refactor: have all styleframe packages as peerDependencies
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`1fd348e`](https://github.com/styleframe-dev/styleframe/commit/1fd348e5f379318f76d68055efacd370618f00d6)]:
|
|
12
|
+
- @styleframe/transpiler@2.1.0
|
|
13
|
+
- @styleframe/core@2.1.0
|
|
14
|
+
|
|
3
15
|
## 2.0.2
|
|
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:
|
|
9
|
-
}) => `._${[...
|
|
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
|
|
19
|
+
const n = M$1, r = [];
|
|
20
20
|
if (!e || typeof e != "string")
|
|
21
|
-
return
|
|
22
|
-
let
|
|
21
|
+
return r;
|
|
22
|
+
let c = "", a, i;
|
|
23
23
|
for (const s of e) {
|
|
24
|
-
const o =
|
|
24
|
+
const o = n.includes(s);
|
|
25
25
|
if (o === true) {
|
|
26
|
-
|
|
26
|
+
r.push(c), c = "", a = void 0;
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const u = $$1(s);
|
|
30
30
|
if (i === false) {
|
|
31
|
-
if (a === false &&
|
|
32
|
-
|
|
31
|
+
if (a === false && u === true) {
|
|
32
|
+
r.push(c), c = s, a = u;
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
if (a === true &&
|
|
36
|
-
const f =
|
|
37
|
-
|
|
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
|
-
|
|
41
|
+
c += s, a = u, i = o;
|
|
42
42
|
}
|
|
43
|
-
return
|
|
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((
|
|
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(
|
|
84
|
-
return Object.entries(
|
|
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(
|
|
89
|
-
const a = (
|
|
90
|
-
return z$1(a, e(
|
|
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),
|
|
95
|
-
return function(
|
|
96
|
-
const { variables: s, declarations: o, children:
|
|
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 =
|
|
98
|
+
), m2 = n(
|
|
99
99
|
o ?? {},
|
|
100
100
|
i
|
|
101
|
-
), y = (
|
|
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(
|
|
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(
|
|
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(
|
|
126
|
-
const a = N.includes(
|
|
127
|
-
|
|
128
|
-
), s = Object.keys(
|
|
129
|
-
return a || i && !(s || o ||
|
|
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
|
|
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(
|
|
178
|
+
(i, s) => new Map(r(Array.from(i), s))
|
|
179
179
|
), t.set(
|
|
180
180
|
Set,
|
|
181
|
-
(i, s) => new Set(
|
|
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
|
|
186
|
-
return e.proto ? a :
|
|
187
|
-
function
|
|
188
|
-
const o = Object.keys(i),
|
|
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 ?
|
|
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
|
|
193
|
+
return u;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function c(i) {
|
|
196
196
|
if (typeof i != "object" || i === null) return i;
|
|
197
|
-
if (Array.isArray(i)) return
|
|
198
|
-
if (i.constructor !== Object && (
|
|
199
|
-
return
|
|
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
|
|
204
|
-
typeof
|
|
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
|
|
211
|
-
if (i.constructor !== Object && (
|
|
212
|
-
return
|
|
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
|
|
216
|
-
typeof
|
|
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
|
|
222
|
-
const t = [],
|
|
223
|
-
if (
|
|
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,
|
|
226
|
-
),
|
|
225
|
+
(o, u) => new Map(a(Array.from(o), u))
|
|
226
|
+
), r.set(
|
|
227
227
|
Set,
|
|
228
|
-
(o,
|
|
228
|
+
(o, u) => new Set(a(Array.from(o), u))
|
|
229
229
|
), e.constructorHandlers)
|
|
230
230
|
for (const o of e.constructorHandlers)
|
|
231
|
-
|
|
232
|
-
let
|
|
231
|
+
r.set(o[0], o[1]);
|
|
232
|
+
let c;
|
|
233
233
|
return e.proto ? s : i;
|
|
234
|
-
function a(o,
|
|
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 && (
|
|
241
|
-
l[y] =
|
|
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] =
|
|
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 && (
|
|
255
|
-
return
|
|
256
|
-
const
|
|
257
|
-
t.push(o),
|
|
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
|
-
|
|
263
|
-
else if (l.constructor !== Object && (
|
|
264
|
-
|
|
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
|
-
|
|
266
|
+
u[f] = g$1(l);
|
|
267
267
|
else {
|
|
268
268
|
const m2 = t.indexOf(l);
|
|
269
|
-
m2 !== -1 ?
|
|
269
|
+
m2 !== -1 ? u[f] = n[m2] : u[f] = i(l);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
return t.pop(),
|
|
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 && (
|
|
278
|
-
return
|
|
279
|
-
const
|
|
280
|
-
t.push(o),
|
|
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
|
-
|
|
285
|
-
else if (l.constructor !== Object && (
|
|
286
|
-
|
|
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
|
-
|
|
288
|
+
u[f] = g$1(l);
|
|
289
289
|
else {
|
|
290
290
|
const m2 = t.indexOf(l);
|
|
291
|
-
m2 !== -1 ?
|
|
291
|
+
m2 !== -1 ? u[f] = n[m2] : u[f] = s(l);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
return t.pop(),
|
|
294
|
+
return t.pop(), n.pop(), u;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
oe();
|
|
298
|
-
function
|
|
299
|
-
return function(
|
|
300
|
-
return
|
|
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(
|
|
305
|
-
return
|
|
304
|
+
return function(n, r) {
|
|
305
|
+
return n != null ? `${n}` : "";
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
function se(e) {
|
|
309
|
-
return function(
|
|
310
|
-
const a = (
|
|
309
|
+
return function(n, r) {
|
|
310
|
+
const a = (r.variables?.name ?? w)({ name: n.name });
|
|
311
311
|
return H$1(
|
|
312
312
|
a,
|
|
313
|
-
|
|
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(
|
|
320
|
-
return
|
|
321
|
-
(a, i) => (a.push(e(i,
|
|
322
|
-
[t(":root",
|
|
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(
|
|
332
|
-
return t(
|
|
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(
|
|
338
|
-
const i = (
|
|
339
|
-
return t(i,
|
|
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(
|
|
345
|
-
const a = [], s = (
|
|
346
|
-
name:
|
|
347
|
-
value:
|
|
348
|
-
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,
|
|
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
|
|
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
|
|
359
|
+
return r(e, t);
|
|
360
360
|
case ee(e):
|
|
361
|
-
return
|
|
361
|
+
return c(e, t);
|
|
362
362
|
case X$1(e):
|
|
363
363
|
return a(e, t);
|
|
364
364
|
case re(e):
|
|
365
|
-
return
|
|
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
|
|
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((
|
|
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, ""),
|
|
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
|
-
|
|
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
|
|
416
|
+
const n = new TextEncoder().encode(e), r = Uint8Array.from(
|
|
417
417
|
atob(t),
|
|
418
418
|
(a) => a.charCodeAt(0)
|
|
419
|
-
),
|
|
419
|
+
), c = await he(de);
|
|
420
420
|
if (!await crypto.subtle.verify(
|
|
421
421
|
{ name: "RSASSA-PKCS1-v1_5" },
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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
|
|
447
|
-
if (typeof
|
|
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
|
-
|
|
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:
|
|
499
|
+
consumers: n = { css: p$1, ts: T$1 }
|
|
500
500
|
} = {}) {
|
|
501
|
-
const
|
|
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",
|
|
509
|
-
|
|
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",
|
|
513
|
-
|
|
512
|
+
const s = j("index.ts", n.ts([], c));
|
|
513
|
+
r.files.push(s);
|
|
514
514
|
}
|
|
515
|
-
return
|
|
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:
|
|
9
|
-
}) => `._${[...
|
|
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
|
|
19
|
+
const n = M$1, r = [];
|
|
20
20
|
if (!e || typeof e != "string")
|
|
21
|
-
return
|
|
22
|
-
let
|
|
21
|
+
return r;
|
|
22
|
+
let c = "", a, i;
|
|
23
23
|
for (const s of e) {
|
|
24
|
-
const o =
|
|
24
|
+
const o = n.includes(s);
|
|
25
25
|
if (o === true) {
|
|
26
|
-
|
|
26
|
+
r.push(c), c = "", a = void 0;
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const u = $$1(s);
|
|
30
30
|
if (i === false) {
|
|
31
|
-
if (a === false &&
|
|
32
|
-
|
|
31
|
+
if (a === false && u === true) {
|
|
32
|
+
r.push(c), c = s, a = u;
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
if (a === true &&
|
|
36
|
-
const f =
|
|
37
|
-
|
|
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
|
-
|
|
41
|
+
c += s, a = u, i = o;
|
|
42
42
|
}
|
|
43
|
-
return
|
|
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((
|
|
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(
|
|
84
|
-
return Object.entries(
|
|
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(
|
|
89
|
-
const a = (
|
|
90
|
-
return z$1(a, e(
|
|
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),
|
|
95
|
-
return function(
|
|
96
|
-
const { variables: s, declarations: o, children:
|
|
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 =
|
|
98
|
+
), m2 = n(
|
|
99
99
|
o ?? {},
|
|
100
100
|
i
|
|
101
|
-
), y = (
|
|
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(
|
|
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(
|
|
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(
|
|
126
|
-
const a = N.includes(
|
|
127
|
-
|
|
128
|
-
), s = Object.keys(
|
|
129
|
-
return a || i && !(s || o ||
|
|
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
|
|
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(
|
|
178
|
+
(i, s) => new Map(r(Array.from(i), s))
|
|
179
179
|
), t.set(
|
|
180
180
|
Set,
|
|
181
|
-
(i, s) => new Set(
|
|
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
|
|
186
|
-
return e.proto ? a :
|
|
187
|
-
function
|
|
188
|
-
const o = Object.keys(i),
|
|
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 ?
|
|
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
|
|
193
|
+
return u;
|
|
194
194
|
}
|
|
195
|
-
function
|
|
195
|
+
function c(i) {
|
|
196
196
|
if (typeof i != "object" || i === null) return i;
|
|
197
|
-
if (Array.isArray(i)) return
|
|
198
|
-
if (i.constructor !== Object && (
|
|
199
|
-
return
|
|
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
|
|
204
|
-
typeof
|
|
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
|
|
211
|
-
if (i.constructor !== Object && (
|
|
212
|
-
return
|
|
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
|
|
216
|
-
typeof
|
|
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
|
|
222
|
-
const t = [],
|
|
223
|
-
if (
|
|
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,
|
|
226
|
-
),
|
|
225
|
+
(o, u) => new Map(a(Array.from(o), u))
|
|
226
|
+
), r.set(
|
|
227
227
|
Set,
|
|
228
|
-
(o,
|
|
228
|
+
(o, u) => new Set(a(Array.from(o), u))
|
|
229
229
|
), e.constructorHandlers)
|
|
230
230
|
for (const o of e.constructorHandlers)
|
|
231
|
-
|
|
232
|
-
let
|
|
231
|
+
r.set(o[0], o[1]);
|
|
232
|
+
let c;
|
|
233
233
|
return e.proto ? s : i;
|
|
234
|
-
function a(o,
|
|
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 && (
|
|
241
|
-
l[y] =
|
|
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] =
|
|
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 && (
|
|
255
|
-
return
|
|
256
|
-
const
|
|
257
|
-
t.push(o),
|
|
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
|
-
|
|
263
|
-
else if (l.constructor !== Object && (
|
|
264
|
-
|
|
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
|
-
|
|
266
|
+
u[f] = g$1(l);
|
|
267
267
|
else {
|
|
268
268
|
const m2 = t.indexOf(l);
|
|
269
|
-
m2 !== -1 ?
|
|
269
|
+
m2 !== -1 ? u[f] = n[m2] : u[f] = i(l);
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
|
-
return t.pop(),
|
|
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 && (
|
|
278
|
-
return
|
|
279
|
-
const
|
|
280
|
-
t.push(o),
|
|
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
|
-
|
|
285
|
-
else if (l.constructor !== Object && (
|
|
286
|
-
|
|
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
|
-
|
|
288
|
+
u[f] = g$1(l);
|
|
289
289
|
else {
|
|
290
290
|
const m2 = t.indexOf(l);
|
|
291
|
-
m2 !== -1 ?
|
|
291
|
+
m2 !== -1 ? u[f] = n[m2] : u[f] = s(l);
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
return t.pop(),
|
|
294
|
+
return t.pop(), n.pop(), u;
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
oe();
|
|
298
|
-
function
|
|
299
|
-
return function(
|
|
300
|
-
return
|
|
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(
|
|
305
|
-
return
|
|
304
|
+
return function(n, r) {
|
|
305
|
+
return n != null ? `${n}` : "";
|
|
306
306
|
};
|
|
307
307
|
}
|
|
308
308
|
function se(e) {
|
|
309
|
-
return function(
|
|
310
|
-
const a = (
|
|
309
|
+
return function(n, r) {
|
|
310
|
+
const a = (r.variables?.name ?? w)({ name: n.name });
|
|
311
311
|
return H$1(
|
|
312
312
|
a,
|
|
313
|
-
|
|
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(
|
|
320
|
-
return
|
|
321
|
-
(a, i) => (a.push(e(i,
|
|
322
|
-
[t(":root",
|
|
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(
|
|
332
|
-
return t(
|
|
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(
|
|
338
|
-
const i = (
|
|
339
|
-
return t(i,
|
|
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(
|
|
345
|
-
const a = [], s = (
|
|
346
|
-
name:
|
|
347
|
-
value:
|
|
348
|
-
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,
|
|
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
|
|
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
|
|
359
|
+
return r(e, t);
|
|
360
360
|
case ee(e):
|
|
361
|
-
return
|
|
361
|
+
return c(e, t);
|
|
362
362
|
case X$1(e):
|
|
363
363
|
return a(e, t);
|
|
364
364
|
case re(e):
|
|
365
|
-
return
|
|
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
|
|
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((
|
|
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, ""),
|
|
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
|
-
|
|
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
|
|
416
|
+
const n = new TextEncoder().encode(e), r = Uint8Array.from(
|
|
417
417
|
atob(t),
|
|
418
418
|
(a) => a.charCodeAt(0)
|
|
419
|
-
),
|
|
419
|
+
), c = await he(de);
|
|
420
420
|
if (!await crypto.subtle.verify(
|
|
421
421
|
{ name: "RSASSA-PKCS1-v1_5" },
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
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
|
|
447
|
-
if (typeof
|
|
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
|
-
|
|
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:
|
|
499
|
+
consumers: n = { css: p$1, ts: T$1 }
|
|
500
500
|
} = {}) {
|
|
501
|
-
const
|
|
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",
|
|
509
|
-
|
|
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",
|
|
513
|
-
|
|
512
|
+
const s = j("index.ts", n.ts([], c));
|
|
513
|
+
r.files.push(s);
|
|
514
514
|
}
|
|
515
|
-
return
|
|
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
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -19,21 +19,26 @@
|
|
|
19
19
|
"README.md"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
+
"c12": "^3.1.0"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"@styleframe/core": "^2.1.0",
|
|
22
26
|
"@styleframe/license": "^2.0.0",
|
|
23
|
-
"
|
|
24
|
-
"@styleframe/transpiler": "2.0.2",
|
|
25
|
-
"@styleframe/core": "2.0.2"
|
|
27
|
+
"@styleframe/transpiler": "^2.1.0"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
30
|
+
"@styleframe/config-typescript": "^1",
|
|
31
|
+
"@styleframe/config-vite": "^1",
|
|
32
|
+
"@styleframe/core": "^2.1.0",
|
|
33
|
+
"@styleframe/license": "^2.0.0",
|
|
34
|
+
"@styleframe/transpiler": "^2.1.0",
|
|
28
35
|
"@vitest/coverage-v8": "^3.2.4",
|
|
29
36
|
"tsx": "^4.20.6",
|
|
30
37
|
"typescript": "^5.8.3",
|
|
31
38
|
"vite": "^7.0.6",
|
|
32
39
|
"vite-plugin-dts": "^4.5.4",
|
|
33
40
|
"vite-plugin-node": "^7.0.0",
|
|
34
|
-
"vitest": "^3.2.4"
|
|
35
|
-
"@styleframe/config-typescript": "2.0.2",
|
|
36
|
-
"@styleframe/config-vite": "2.0.2"
|
|
41
|
+
"vitest": "^3.2.4"
|
|
37
42
|
},
|
|
38
43
|
"homepage": "https://github.com/styleframe-dev/styleframe#readme",
|
|
39
44
|
"bugs": {
|