@styleframe/loader 2.1.0 → 2.3.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 +24 -0
- package/dist/index.cjs +680 -468
- package/dist/index.d.ts +2 -2
- package/dist/index.js +680 -468
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -2,164 +2,193 @@
|
|
|
2
2
|
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("node:fs/promises"), require("node:path"), require("@styleframe/license"), require("c12")) : typeof define === "function" && define.amd ? define(["exports", "node:fs/promises", "node:path", "@styleframe/license", "c12"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.loader = {}, global.promises, global.path, global.license, global.c12));
|
|
3
3
|
})(this, (function(exports2, promises, path, license, c12) {
|
|
4
4
|
"use strict";
|
|
5
|
-
const N = ["charset", "import", "namespace"],
|
|
5
|
+
const N = ["charset", "import", "namespace"], L$1 = ["layer"], D = ({ name: e }) => `[data-theme="${e}"]`, I$1 = ({
|
|
6
6
|
name: e,
|
|
7
7
|
value: t,
|
|
8
|
-
modifiers:
|
|
9
|
-
}) => `._${[...
|
|
10
|
-
function
|
|
8
|
+
modifiers: r
|
|
9
|
+
}) => `._${[...r, e, ...t === "default" ? [] : [t]].filter(Boolean).join("\\:").replace(/[[\].#()%,]/g, "\\$&")}`, w = ({ name: e }) => e.replace(/^\.+|\.+$/g, "").replace(/\.+/g, "--");
|
|
10
|
+
function U(e, t) {
|
|
11
11
|
return `@${e}${t ? " " : ""}${t}`;
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
if (!
|
|
13
|
+
const _$1 = /\d/, P$1 = ["-", "_", "/", "."];
|
|
14
|
+
function M(e = "") {
|
|
15
|
+
if (!_$1.test(e))
|
|
16
16
|
return e !== e.toLowerCase();
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
const
|
|
18
|
+
function $$1(e, t) {
|
|
19
|
+
const r = P$1, n = [];
|
|
20
20
|
if (!e || typeof e != "string")
|
|
21
|
-
return
|
|
22
|
-
let
|
|
23
|
-
for (const
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
|
|
21
|
+
return n;
|
|
22
|
+
let o = "", s, i;
|
|
23
|
+
for (const a of e) {
|
|
24
|
+
const c = r.includes(a);
|
|
25
|
+
if (c === true) {
|
|
26
|
+
n.push(o), o = "", s = void 0;
|
|
27
27
|
continue;
|
|
28
28
|
}
|
|
29
|
-
const u =
|
|
29
|
+
const u = M(a);
|
|
30
30
|
if (i === false) {
|
|
31
|
-
if (
|
|
32
|
-
|
|
31
|
+
if (s === false && u === true) {
|
|
32
|
+
n.push(o), o = a, s = u;
|
|
33
33
|
continue;
|
|
34
34
|
}
|
|
35
|
-
if (
|
|
36
|
-
const f =
|
|
37
|
-
|
|
35
|
+
if (s === true && u === false && o.length > 1) {
|
|
36
|
+
const f = o.at(-1);
|
|
37
|
+
n.push(o.slice(0, Math.max(0, o.length - 1))), o = f + a, s = u;
|
|
38
38
|
continue;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
o += a, s = u, i = c;
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return n.push(o), n;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return e ?
|
|
45
|
+
function k(e) {
|
|
46
|
+
return e ? e[0].toUpperCase() + e.slice(1) : "";
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function x$1(e) {
|
|
49
|
+
return e ? e[0].toLowerCase() + e.slice(1) : "";
|
|
50
|
+
}
|
|
51
|
+
function V$1(e, t) {
|
|
52
|
+
return e ? (Array.isArray(e) ? e : $$1(e)).map((r) => k(r)).join("") : "";
|
|
53
|
+
}
|
|
54
|
+
function K(e, t) {
|
|
55
|
+
return x$1(V$1(e || ""));
|
|
56
|
+
}
|
|
57
|
+
function q$1(e, t) {
|
|
58
|
+
return e ? (Array.isArray(e) ? e : $$1(e)).map((r) => r.toLowerCase()).join("-") : "";
|
|
59
|
+
}
|
|
60
|
+
function z$1(e) {
|
|
49
61
|
return ` ${e}`;
|
|
50
62
|
}
|
|
51
|
-
function
|
|
63
|
+
function H(e) {
|
|
52
64
|
return e.split(`
|
|
53
|
-
`).map((t) =>
|
|
65
|
+
`).map((t) => z$1(t)).join(`
|
|
54
66
|
`);
|
|
55
67
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
68
|
+
function Q$1(e) {
|
|
69
|
+
return e === e.toUpperCase();
|
|
70
|
+
}
|
|
71
|
+
function Z$1(e) {
|
|
72
|
+
return K(e);
|
|
58
73
|
}
|
|
59
|
-
function
|
|
60
|
-
return
|
|
74
|
+
function J$1(e) {
|
|
75
|
+
return q$1(e);
|
|
61
76
|
}
|
|
62
|
-
function
|
|
63
|
-
return
|
|
77
|
+
function W$1(e) {
|
|
78
|
+
return J$1(e);
|
|
64
79
|
}
|
|
65
|
-
function
|
|
80
|
+
function O(e, t) {
|
|
81
|
+
return `${e.startsWith("--") ? e : W$1(e)}: ${t};`;
|
|
82
|
+
}
|
|
83
|
+
function G$1(e) {
|
|
66
84
|
return `{${e.length > 0 ? `
|
|
67
|
-
` : ""}${e.map((t) => `${
|
|
85
|
+
` : ""}${e.map((t) => `${H(`${t}`)}
|
|
68
86
|
`).join("")}}`;
|
|
69
87
|
}
|
|
70
|
-
function
|
|
88
|
+
function B(e) {
|
|
71
89
|
return `--${(e.startsWith("--") ? e.slice(2) : e).replace(/[^a-zA-Z0-9_\-\u0080-\uFFFF]/g, "-") || "unknown-variable"}`;
|
|
72
90
|
}
|
|
73
|
-
function
|
|
74
|
-
return B
|
|
91
|
+
function Y$1(e, t) {
|
|
92
|
+
return O(B(e), t);
|
|
75
93
|
}
|
|
76
|
-
function
|
|
77
|
-
return `var(${
|
|
94
|
+
function X$1(e, t) {
|
|
95
|
+
return `var(${B(e)}${t ? `, ${t}` : ""})`;
|
|
78
96
|
}
|
|
79
|
-
function
|
|
80
|
-
return `${e} ${
|
|
97
|
+
function v$1(e, t) {
|
|
98
|
+
return `${e} ${G$1(t)}`;
|
|
81
99
|
}
|
|
82
|
-
function
|
|
83
|
-
return function(
|
|
84
|
-
return Object.entries(
|
|
100
|
+
function ee$1(e) {
|
|
101
|
+
return function(r, n) {
|
|
102
|
+
return Object.entries(r).map(([o, s]) => O(o, e(s, n)));
|
|
85
103
|
};
|
|
86
104
|
}
|
|
87
105
|
function E$1(e) {
|
|
88
|
-
return function(
|
|
89
|
-
const
|
|
90
|
-
return
|
|
106
|
+
return function(r, n) {
|
|
107
|
+
const s = (n.variables?.name ?? w)({ name: r.name });
|
|
108
|
+
return Y$1(s, e(r.value, n));
|
|
91
109
|
};
|
|
92
110
|
}
|
|
93
|
-
function
|
|
94
|
-
const t = E$1(e),
|
|
95
|
-
return function(
|
|
96
|
-
const { variables:
|
|
111
|
+
function C$1(e) {
|
|
112
|
+
const t = E$1(e), r = ee$1(e);
|
|
113
|
+
return function(o, s, i) {
|
|
114
|
+
const { variables: a, declarations: c, children: u } = s, f = o === ":root", l = (a ?? []).map(
|
|
97
115
|
(A2) => t(A2, i)
|
|
98
|
-
),
|
|
99
|
-
|
|
116
|
+
), m = r(
|
|
117
|
+
c ?? {},
|
|
100
118
|
i
|
|
101
119
|
), y = (u ?? []).map(
|
|
102
120
|
(A2) => e(A2, i)
|
|
103
|
-
),
|
|
104
|
-
return f ? `${
|
|
121
|
+
), p2 = l.length > 0, b = m.length > 0, S2 = y.length > 0;
|
|
122
|
+
return f ? `${p2 || b ? v$1(o, [
|
|
105
123
|
...l,
|
|
106
|
-
...
|
|
107
|
-
...
|
|
108
|
-
]) : ""}${
|
|
124
|
+
...p2 && b ? [""] : [],
|
|
125
|
+
...m
|
|
126
|
+
]) : ""}${S2 && (p2 || b) ? `
|
|
109
127
|
|
|
110
128
|
` : ""}${y.join(`
|
|
111
129
|
|
|
112
|
-
`)}` :
|
|
130
|
+
`)}` : v$1(o, [
|
|
113
131
|
...l,
|
|
114
|
-
...
|
|
115
|
-
...
|
|
116
|
-
...
|
|
132
|
+
...p2 && (S2 || b) ? [""] : [],
|
|
133
|
+
...m,
|
|
134
|
+
...b && S2 ? [""] : [],
|
|
117
135
|
...y.flatMap(
|
|
118
136
|
(A2, F2) => F2 === y.length - 1 ? [A2] : [A2, ""]
|
|
119
137
|
)
|
|
120
138
|
]);
|
|
121
139
|
};
|
|
122
140
|
}
|
|
123
|
-
function
|
|
124
|
-
const t =
|
|
125
|
-
return function(
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
),
|
|
129
|
-
return
|
|
141
|
+
function te$1(e) {
|
|
142
|
+
const t = C$1(e);
|
|
143
|
+
return function(n, o) {
|
|
144
|
+
const s = N.includes(n.identifier), i = L$1.includes(
|
|
145
|
+
n.identifier
|
|
146
|
+
), a = Object.keys(n.declarations).length > 0, c = n.variables.length > 0, u = n.children.length > 0, f = U(n.identifier, n.rule);
|
|
147
|
+
return s || i && !(a || c || u) ? `${f};` : t(f, n, o);
|
|
130
148
|
};
|
|
131
149
|
}
|
|
132
|
-
function
|
|
150
|
+
function re$1(e) {
|
|
151
|
+
return function(r, n) {
|
|
152
|
+
return r.value.map((o) => e(o, n)).join("").trim();
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function ne$1(e) {
|
|
133
156
|
return typeof e == "object" && e !== null;
|
|
134
157
|
}
|
|
135
|
-
function
|
|
136
|
-
return
|
|
158
|
+
function h(e, t) {
|
|
159
|
+
return ne$1(e) && "type" in e && e.type === t;
|
|
137
160
|
}
|
|
138
|
-
function
|
|
139
|
-
return
|
|
161
|
+
function oe(e) {
|
|
162
|
+
return h(e, "variable");
|
|
140
163
|
}
|
|
141
|
-
function
|
|
142
|
-
return
|
|
164
|
+
function ce$1(e) {
|
|
165
|
+
return h(e, "reference");
|
|
143
166
|
}
|
|
144
|
-
function
|
|
145
|
-
return
|
|
167
|
+
function ue$1(e) {
|
|
168
|
+
return h(e, "selector");
|
|
146
169
|
}
|
|
147
|
-
function
|
|
148
|
-
return
|
|
170
|
+
function ie(e) {
|
|
171
|
+
return h(e, "at-rule");
|
|
149
172
|
}
|
|
150
|
-
function
|
|
151
|
-
return
|
|
173
|
+
function se(e) {
|
|
174
|
+
return h(e, "utility");
|
|
152
175
|
}
|
|
153
|
-
function
|
|
154
|
-
return
|
|
176
|
+
function ae$1(e) {
|
|
177
|
+
return h(e, "css");
|
|
178
|
+
}
|
|
179
|
+
function le$1(e) {
|
|
180
|
+
return h(e, "theme");
|
|
155
181
|
}
|
|
156
|
-
function
|
|
157
|
-
return
|
|
182
|
+
function T$1(e) {
|
|
183
|
+
return h(e, "root");
|
|
158
184
|
}
|
|
159
|
-
function
|
|
160
|
-
return
|
|
185
|
+
function fe$1(e) {
|
|
186
|
+
return h(e, "recipe");
|
|
161
187
|
}
|
|
162
|
-
function
|
|
188
|
+
function me$1(e) {
|
|
189
|
+
return e.charAt(0).toUpperCase() + e.slice(1);
|
|
190
|
+
}
|
|
191
|
+
function g(e) {
|
|
163
192
|
if (e instanceof Buffer)
|
|
164
193
|
return Buffer.from(e);
|
|
165
194
|
const t = e.constructor;
|
|
@@ -169,225 +198,245 @@
|
|
|
169
198
|
e.byteLength / e.BYTES_PER_ELEMENT || 1
|
|
170
199
|
);
|
|
171
200
|
}
|
|
172
|
-
function
|
|
201
|
+
function pe$1(e) {
|
|
173
202
|
if (e = e || {}, e.circular)
|
|
174
|
-
return
|
|
203
|
+
return ye$1(e);
|
|
175
204
|
const t = /* @__PURE__ */ new Map();
|
|
176
205
|
if (t.set(Date, (i) => new Date(i)), t.set(
|
|
177
206
|
Map,
|
|
178
|
-
(i,
|
|
207
|
+
(i, a) => new Map(n(Array.from(i), a))
|
|
179
208
|
), t.set(
|
|
180
209
|
Set,
|
|
181
|
-
(i,
|
|
210
|
+
(i, a) => new Set(n(Array.from(i), a))
|
|
182
211
|
), e.constructorHandlers)
|
|
183
212
|
for (const i of e.constructorHandlers)
|
|
184
213
|
t.set(i[0], i[1]);
|
|
185
|
-
let
|
|
186
|
-
return e.proto ?
|
|
187
|
-
function
|
|
188
|
-
const
|
|
189
|
-
for (let f = 0; f <
|
|
190
|
-
const l =
|
|
191
|
-
typeof
|
|
214
|
+
let r;
|
|
215
|
+
return e.proto ? s : o;
|
|
216
|
+
function n(i, a) {
|
|
217
|
+
const c = Object.keys(i), u = Array.from({ length: c.length });
|
|
218
|
+
for (let f = 0; f < c.length; f++) {
|
|
219
|
+
const l = c[f], m = i[l];
|
|
220
|
+
typeof m != "object" || m === null ? u[l] = m : m.constructor !== Object && (r = t.get(m.constructor)) ? u[l] = r(m, a) : ArrayBuffer.isView(m) ? u[l] = g(m) : u[l] = a(m);
|
|
192
221
|
}
|
|
193
222
|
return u;
|
|
194
223
|
}
|
|
195
|
-
function
|
|
224
|
+
function o(i) {
|
|
196
225
|
if (typeof i != "object" || i === null) return i;
|
|
197
|
-
if (Array.isArray(i)) return
|
|
198
|
-
if (i.constructor !== Object && (
|
|
199
|
-
return
|
|
200
|
-
const
|
|
201
|
-
for (const
|
|
202
|
-
if (Object.hasOwnProperty.call(i,
|
|
203
|
-
const u = i[
|
|
204
|
-
typeof u != "object" || u === null ?
|
|
226
|
+
if (Array.isArray(i)) return n(i, o);
|
|
227
|
+
if (i.constructor !== Object && (r = t.get(i.constructor)))
|
|
228
|
+
return r(i, o);
|
|
229
|
+
const a = {};
|
|
230
|
+
for (const c in i) {
|
|
231
|
+
if (Object.hasOwnProperty.call(i, c) === false) continue;
|
|
232
|
+
const u = i[c];
|
|
233
|
+
typeof u != "object" || u === null ? a[c] = u : u.constructor !== Object && (r = t.get(u.constructor)) ? a[c] = r(u, o) : ArrayBuffer.isView(u) ? a[c] = g(u) : a[c] = o(u);
|
|
205
234
|
}
|
|
206
|
-
return
|
|
235
|
+
return a;
|
|
207
236
|
}
|
|
208
|
-
function
|
|
237
|
+
function s(i) {
|
|
209
238
|
if (typeof i != "object" || i === null) return i;
|
|
210
|
-
if (Array.isArray(i)) return
|
|
211
|
-
if (i.constructor !== Object && (
|
|
212
|
-
return
|
|
213
|
-
const
|
|
214
|
-
for (const
|
|
215
|
-
const u = i[
|
|
216
|
-
typeof u != "object" || u === null ?
|
|
239
|
+
if (Array.isArray(i)) return n(i, s);
|
|
240
|
+
if (i.constructor !== Object && (r = t.get(i.constructor)))
|
|
241
|
+
return r(i, s);
|
|
242
|
+
const a = {};
|
|
243
|
+
for (const c in i) {
|
|
244
|
+
const u = i[c];
|
|
245
|
+
typeof u != "object" || u === null ? a[c] = u : u.constructor !== Object && (r = t.get(u.constructor)) ? a[c] = r(u, s) : ArrayBuffer.isView(u) ? a[c] = g(u) : a[c] = s(u);
|
|
217
246
|
}
|
|
218
|
-
return
|
|
247
|
+
return a;
|
|
219
248
|
}
|
|
220
249
|
}
|
|
221
|
-
function
|
|
222
|
-
const t = [],
|
|
223
|
-
if (
|
|
250
|
+
function ye$1(e) {
|
|
251
|
+
const t = [], r = [], n = /* @__PURE__ */ new Map();
|
|
252
|
+
if (n.set(Date, (c) => new Date(c)), n.set(
|
|
224
253
|
Map,
|
|
225
|
-
(
|
|
226
|
-
),
|
|
254
|
+
(c, u) => new Map(s(Array.from(c), u))
|
|
255
|
+
), n.set(
|
|
227
256
|
Set,
|
|
228
|
-
(
|
|
257
|
+
(c, u) => new Set(s(Array.from(c), u))
|
|
229
258
|
), e.constructorHandlers)
|
|
230
|
-
for (const
|
|
231
|
-
|
|
232
|
-
let
|
|
233
|
-
return e.proto ?
|
|
234
|
-
function
|
|
235
|
-
const f = Object.keys(
|
|
236
|
-
for (let
|
|
237
|
-
const y = f[
|
|
238
|
-
if (typeof
|
|
239
|
-
l[y] =
|
|
240
|
-
else if (
|
|
241
|
-
l[y] =
|
|
242
|
-
else if (ArrayBuffer.isView(
|
|
243
|
-
l[y] = g
|
|
259
|
+
for (const c of e.constructorHandlers)
|
|
260
|
+
n.set(c[0], c[1]);
|
|
261
|
+
let o;
|
|
262
|
+
return e.proto ? a : i;
|
|
263
|
+
function s(c, u) {
|
|
264
|
+
const f = Object.keys(c), l = Array.from({ length: f.length });
|
|
265
|
+
for (let m = 0; m < f.length; m++) {
|
|
266
|
+
const y = f[m], p2 = c[y];
|
|
267
|
+
if (typeof p2 != "object" || p2 === null)
|
|
268
|
+
l[y] = p2;
|
|
269
|
+
else if (p2.constructor !== Object && (o = n.get(p2.constructor)))
|
|
270
|
+
l[y] = o(p2, u);
|
|
271
|
+
else if (ArrayBuffer.isView(p2))
|
|
272
|
+
l[y] = g(p2);
|
|
244
273
|
else {
|
|
245
|
-
const
|
|
246
|
-
|
|
274
|
+
const b = t.indexOf(p2);
|
|
275
|
+
b !== -1 ? l[y] = r[b] : l[y] = u(p2);
|
|
247
276
|
}
|
|
248
277
|
}
|
|
249
278
|
return l;
|
|
250
279
|
}
|
|
251
|
-
function i(
|
|
252
|
-
if (typeof
|
|
253
|
-
if (Array.isArray(
|
|
254
|
-
if (
|
|
255
|
-
return c
|
|
280
|
+
function i(c) {
|
|
281
|
+
if (typeof c != "object" || c === null) return c;
|
|
282
|
+
if (Array.isArray(c)) return s(c, i);
|
|
283
|
+
if (c.constructor !== Object && (o = n.get(c.constructor)))
|
|
284
|
+
return o(c, i);
|
|
256
285
|
const u = {};
|
|
257
|
-
t.push(
|
|
258
|
-
for (const f in
|
|
259
|
-
if (Object.hasOwnProperty.call(
|
|
260
|
-
const l =
|
|
286
|
+
t.push(c), r.push(u);
|
|
287
|
+
for (const f in c) {
|
|
288
|
+
if (Object.hasOwnProperty.call(c, f) === false) continue;
|
|
289
|
+
const l = c[f];
|
|
261
290
|
if (typeof l != "object" || l === null)
|
|
262
291
|
u[f] = l;
|
|
263
|
-
else if (l.constructor !== Object && (
|
|
264
|
-
u[f] =
|
|
292
|
+
else if (l.constructor !== Object && (o = n.get(l.constructor)))
|
|
293
|
+
u[f] = o(l, i);
|
|
265
294
|
else if (ArrayBuffer.isView(l))
|
|
266
|
-
u[f] = g
|
|
295
|
+
u[f] = g(l);
|
|
267
296
|
else {
|
|
268
|
-
const
|
|
269
|
-
|
|
297
|
+
const m = t.indexOf(l);
|
|
298
|
+
m !== -1 ? u[f] = r[m] : u[f] = i(l);
|
|
270
299
|
}
|
|
271
300
|
}
|
|
272
|
-
return t.pop(),
|
|
301
|
+
return t.pop(), r.pop(), u;
|
|
273
302
|
}
|
|
274
|
-
function
|
|
275
|
-
if (typeof
|
|
276
|
-
if (Array.isArray(
|
|
277
|
-
if (
|
|
278
|
-
return c
|
|
303
|
+
function a(c) {
|
|
304
|
+
if (typeof c != "object" || c === null) return c;
|
|
305
|
+
if (Array.isArray(c)) return s(c, a);
|
|
306
|
+
if (c.constructor !== Object && (o = n.get(c.constructor)))
|
|
307
|
+
return o(c, a);
|
|
279
308
|
const u = {};
|
|
280
|
-
t.push(
|
|
281
|
-
for (const f in
|
|
282
|
-
const l =
|
|
309
|
+
t.push(c), r.push(u);
|
|
310
|
+
for (const f in c) {
|
|
311
|
+
const l = c[f];
|
|
283
312
|
if (typeof l != "object" || l === null)
|
|
284
313
|
u[f] = l;
|
|
285
|
-
else if (l.constructor !== Object && (
|
|
286
|
-
u[f] =
|
|
314
|
+
else if (l.constructor !== Object && (o = n.get(l.constructor)))
|
|
315
|
+
u[f] = o(l, a);
|
|
287
316
|
else if (ArrayBuffer.isView(l))
|
|
288
|
-
u[f] = g
|
|
317
|
+
u[f] = g(l);
|
|
289
318
|
else {
|
|
290
|
-
const
|
|
291
|
-
|
|
319
|
+
const m = t.indexOf(l);
|
|
320
|
+
m !== -1 ? u[f] = r[m] : u[f] = a(l);
|
|
292
321
|
}
|
|
293
322
|
}
|
|
294
|
-
return t.pop(),
|
|
323
|
+
return t.pop(), r.pop(), u;
|
|
295
324
|
}
|
|
296
325
|
}
|
|
297
|
-
|
|
298
|
-
function
|
|
299
|
-
return function(
|
|
300
|
-
return
|
|
301
|
-
};
|
|
302
|
-
}
|
|
303
|
-
function ie(e) {
|
|
304
|
-
return function(n, r) {
|
|
305
|
-
return n != null ? `${n}` : "";
|
|
326
|
+
pe$1();
|
|
327
|
+
function de$1(e) {
|
|
328
|
+
return function(r, n) {
|
|
329
|
+
return r != null ? `${r}` : "";
|
|
306
330
|
};
|
|
307
331
|
}
|
|
308
|
-
function
|
|
309
|
-
return function(
|
|
310
|
-
const
|
|
311
|
-
return
|
|
312
|
-
|
|
313
|
-
|
|
332
|
+
function he(e) {
|
|
333
|
+
return function(r, n) {
|
|
334
|
+
const s = (n.variables?.name ?? w)({ name: r.name });
|
|
335
|
+
return X$1(
|
|
336
|
+
s,
|
|
337
|
+
r.fallback ? e(r.fallback, n) : void 0
|
|
314
338
|
);
|
|
315
339
|
};
|
|
316
340
|
}
|
|
317
|
-
function
|
|
318
|
-
const t =
|
|
319
|
-
return function(
|
|
320
|
-
return
|
|
321
|
-
(
|
|
322
|
-
[t(":root",
|
|
341
|
+
function be(e) {
|
|
342
|
+
const t = C$1(e);
|
|
343
|
+
return function(n, o) {
|
|
344
|
+
return n.themes.reduce(
|
|
345
|
+
(s, i) => (s.push(e(i, o)), s),
|
|
346
|
+
[t(":root", n, o)]
|
|
323
347
|
// Default theme (root)
|
|
324
348
|
).join(`
|
|
325
349
|
|
|
326
350
|
`);
|
|
327
351
|
};
|
|
328
352
|
}
|
|
329
|
-
function
|
|
330
|
-
const t =
|
|
331
|
-
return function(
|
|
332
|
-
return t(
|
|
353
|
+
function Ae(e) {
|
|
354
|
+
const t = C$1(e);
|
|
355
|
+
return function(n, o) {
|
|
356
|
+
return t(n.query, n, o);
|
|
333
357
|
};
|
|
334
358
|
}
|
|
335
|
-
function
|
|
336
|
-
const t =
|
|
337
|
-
return function(
|
|
338
|
-
const i = (
|
|
339
|
-
return t(i,
|
|
359
|
+
function ge(e) {
|
|
360
|
+
const t = C$1(e);
|
|
361
|
+
return function(n, o) {
|
|
362
|
+
const i = (o.themes?.selector ?? D)({ name: n.name });
|
|
363
|
+
return t(i, n, o);
|
|
340
364
|
};
|
|
341
365
|
}
|
|
342
|
-
function
|
|
343
|
-
const t =
|
|
344
|
-
return function(
|
|
345
|
-
const
|
|
346
|
-
name:
|
|
347
|
-
value:
|
|
348
|
-
modifiers:
|
|
366
|
+
function Ce(e) {
|
|
367
|
+
const t = C$1(e);
|
|
368
|
+
return function(n, o) {
|
|
369
|
+
const s = [], a = (o.utilities?.selector ?? I$1)({
|
|
370
|
+
name: n.name,
|
|
371
|
+
value: n.value,
|
|
372
|
+
modifiers: n.modifiers
|
|
349
373
|
});
|
|
350
|
-
return
|
|
374
|
+
return s.push(t(a, n, o)), s.join(`
|
|
351
375
|
|
|
352
376
|
`);
|
|
353
377
|
};
|
|
354
378
|
}
|
|
355
|
-
function
|
|
356
|
-
const
|
|
379
|
+
function d(e, t) {
|
|
380
|
+
const r = be(d), n = Ae(d), o = Ce(d), s = te$1(d), i = ge(d), a = E$1(d), c = he(d), u = re$1(d), f = de$1();
|
|
357
381
|
switch (true) {
|
|
358
|
-
case
|
|
359
|
-
return r(e, t);
|
|
360
|
-
case ee(e):
|
|
361
|
-
return c(e, t);
|
|
362
|
-
case X$1(e):
|
|
363
|
-
return a(e, t);
|
|
364
|
-
case re(e):
|
|
382
|
+
case ue$1(e):
|
|
365
383
|
return n(e, t);
|
|
366
|
-
case
|
|
367
|
-
return i(e, t);
|
|
368
|
-
case J$1(e):
|
|
369
|
-
return s(e, t);
|
|
370
|
-
case G$1(e):
|
|
384
|
+
case se(e):
|
|
371
385
|
return o(e, t);
|
|
372
|
-
case
|
|
386
|
+
case ie(e):
|
|
387
|
+
return s(e, t);
|
|
388
|
+
case T$1(e):
|
|
389
|
+
return r(e, t);
|
|
390
|
+
case le$1(e):
|
|
391
|
+
return i(e, t);
|
|
392
|
+
case oe(e):
|
|
393
|
+
return a(e, t);
|
|
394
|
+
case ce$1(e):
|
|
395
|
+
return c(e, t);
|
|
396
|
+
case ae$1(e):
|
|
373
397
|
return u(e, t);
|
|
374
398
|
default:
|
|
375
399
|
return f(e, t);
|
|
376
400
|
}
|
|
377
401
|
}
|
|
378
|
-
function
|
|
402
|
+
function Se(e) {
|
|
403
|
+
return function(r, n) {
|
|
404
|
+
let o = Z$1(r.name);
|
|
405
|
+
r.name[0] && Q$1(r.name[0]) && (o = me$1(o));
|
|
406
|
+
const s = `${o}Recipe`, i = r._runtime ?? {};
|
|
407
|
+
return `const ${s} = ${JSON.stringify(
|
|
408
|
+
i,
|
|
409
|
+
null,
|
|
410
|
+
4
|
|
411
|
+
)} as const satisfies RecipeRuntime;
|
|
412
|
+
|
|
413
|
+
export const ${o} = createRecipe("${r.name}", ${s});
|
|
414
|
+
`;
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
function je(e) {
|
|
418
|
+
return function(r, n) {
|
|
419
|
+
return r.recipes.length > 0 ? `import { createRecipe } from '@styleframe/runtime';
|
|
420
|
+
import type { RecipeRuntime } from '@styleframe/runtime';
|
|
421
|
+
|
|
422
|
+
${e(r.recipes, n)}` : "";
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
function j$1(e, t) {
|
|
426
|
+
const r = je(j$1), n = Se();
|
|
379
427
|
switch (true) {
|
|
380
428
|
case Array.isArray(e):
|
|
381
|
-
return e.map((
|
|
429
|
+
return e.map((o) => j$1(o, t)).join(`
|
|
382
430
|
`);
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
431
|
+
case T$1(e):
|
|
432
|
+
return r(e, t);
|
|
433
|
+
case fe$1(e):
|
|
434
|
+
return n(e, t);
|
|
386
435
|
default:
|
|
387
436
|
return "";
|
|
388
437
|
}
|
|
389
438
|
}
|
|
390
|
-
const
|
|
439
|
+
const ve = `-----BEGIN PUBLIC KEY-----
|
|
391
440
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs7zAFssgxOMPeo80iig4
|
|
392
441
|
qSSshgNOLnW1gd4tPUrsezndaUrAKlsAys6XD8kuF+bBEIR0uFNSgKlqINLjWM1n
|
|
393
442
|
BiTUzCctodyRaq6/tyFSoPLD35iblkwtfxKPM42lAJZsyTu9qoBr8MJyXmhDLuqA
|
|
@@ -395,12 +444,12 @@ dQ8di7mQHz+mCy96jQR4lFSDfHMgl27qaAh5VboTBRxgZliN8D5Fl590QkS94wAj
|
|
|
395
444
|
hC7NbH+hPcGc/qIaZSjZfyZeBIZS74qJkrzjEA7/pukROD8UQUrQ512HHZ6XlgMn
|
|
396
445
|
4bWT2K9CpWbbhsKFTecCHuxlmPkFJNMuvAb/LdP08BSnpntlyAJcQeBrna2qBen+
|
|
397
446
|
GwIDAQAB
|
|
398
|
-
-----END PUBLIC KEY-----`,
|
|
399
|
-
async function
|
|
400
|
-
const t = e.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""),
|
|
447
|
+
-----END PUBLIC KEY-----`, Re$1 = "__licenseRequired", we = "__licenseValidated";
|
|
448
|
+
async function $e(e) {
|
|
449
|
+
const t = e.replace(/-----BEGIN PUBLIC KEY-----/, "").replace(/-----END PUBLIC KEY-----/, "").replace(/\s/g, ""), r = Uint8Array.from(atob(t), (n) => n.charCodeAt(0));
|
|
401
450
|
return await crypto.subtle.importKey(
|
|
402
451
|
"spki",
|
|
403
|
-
|
|
452
|
+
r,
|
|
404
453
|
{
|
|
405
454
|
name: "RSASSA-PKCS1-v1_5",
|
|
406
455
|
hash: "SHA-256"
|
|
@@ -409,32 +458,32 @@ GwIDAQAB
|
|
|
409
458
|
["verify"]
|
|
410
459
|
);
|
|
411
460
|
}
|
|
412
|
-
async function
|
|
461
|
+
async function Oe({
|
|
413
462
|
payload: e,
|
|
414
463
|
signature: t
|
|
415
464
|
}) {
|
|
416
|
-
const
|
|
465
|
+
const r = new TextEncoder().encode(e), n = Uint8Array.from(
|
|
417
466
|
atob(t),
|
|
418
|
-
(
|
|
419
|
-
),
|
|
467
|
+
(s) => s.charCodeAt(0)
|
|
468
|
+
), o = await $e(ve);
|
|
420
469
|
if (!await crypto.subtle.verify(
|
|
421
470
|
{ name: "RSASSA-PKCS1-v1_5" },
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
471
|
+
o,
|
|
472
|
+
n,
|
|
473
|
+
r
|
|
425
474
|
))
|
|
426
475
|
throw new Error(
|
|
427
476
|
"License validation failed: Invalid signature detected. The license may have been modified or corrupted."
|
|
428
477
|
);
|
|
429
478
|
return JSON.parse(e);
|
|
430
479
|
}
|
|
431
|
-
function
|
|
432
|
-
return Object.prototype.hasOwnProperty.call(e,
|
|
480
|
+
function Be(e) {
|
|
481
|
+
return Object.prototype.hasOwnProperty.call(e, Re$1);
|
|
433
482
|
}
|
|
434
|
-
async function
|
|
483
|
+
async function Ee(e) {
|
|
435
484
|
const t = Object.getOwnPropertyDescriptor(
|
|
436
485
|
e,
|
|
437
|
-
|
|
486
|
+
we
|
|
438
487
|
);
|
|
439
488
|
if (!t?.value)
|
|
440
489
|
return {
|
|
@@ -443,8 +492,8 @@ GwIDAQAB
|
|
|
443
492
|
environment: "",
|
|
444
493
|
valid: false
|
|
445
494
|
};
|
|
446
|
-
const
|
|
447
|
-
if (typeof
|
|
495
|
+
const r = t.value;
|
|
496
|
+
if (typeof r != "object" || r === null || !("payload" in r) || !("signature" in r) || typeof r.payload != "string" || typeof r.signature != "string")
|
|
448
497
|
return {
|
|
449
498
|
key: "",
|
|
450
499
|
instanceId: "",
|
|
@@ -452,8 +501,8 @@ GwIDAQAB
|
|
|
452
501
|
valid: false
|
|
453
502
|
};
|
|
454
503
|
try {
|
|
455
|
-
return await
|
|
456
|
-
|
|
504
|
+
return await Oe(
|
|
505
|
+
r
|
|
457
506
|
);
|
|
458
507
|
} catch {
|
|
459
508
|
return {
|
|
@@ -464,7 +513,7 @@ GwIDAQAB
|
|
|
464
513
|
};
|
|
465
514
|
}
|
|
466
515
|
}
|
|
467
|
-
function
|
|
516
|
+
function Te(e) {
|
|
468
517
|
const t = Math.floor(Math.random() * 100);
|
|
469
518
|
e.root.children.push({
|
|
470
519
|
type: "selector",
|
|
@@ -488,31 +537,36 @@ GwIDAQAB
|
|
|
488
537
|
}
|
|
489
538
|
});
|
|
490
539
|
}
|
|
491
|
-
function
|
|
540
|
+
function R$1(e, t = "") {
|
|
492
541
|
return {
|
|
493
542
|
name: e,
|
|
494
543
|
content: t
|
|
495
544
|
};
|
|
496
545
|
}
|
|
497
|
-
async function
|
|
546
|
+
async function Ne(e, {
|
|
498
547
|
type: t = "all",
|
|
499
|
-
consumers:
|
|
548
|
+
consumers: r = { css: d, ts: j$1 }
|
|
500
549
|
} = {}) {
|
|
501
|
-
const
|
|
502
|
-
if (
|
|
503
|
-
const s = await
|
|
504
|
-
(!s.valid || s.instanceId !== e.id) &&
|
|
550
|
+
const n = { files: [] }, o = e.options;
|
|
551
|
+
if (Be(e)) {
|
|
552
|
+
const s = await Ee(e);
|
|
553
|
+
(!s.valid || s.instanceId !== e.id) && Te(e);
|
|
505
554
|
}
|
|
506
|
-
const { recipes: a, ...i } = e.root;
|
|
507
555
|
if (t === "all" || t === "css") {
|
|
508
|
-
const s =
|
|
509
|
-
|
|
556
|
+
const s = R$1(
|
|
557
|
+
"index.css",
|
|
558
|
+
r.css(e.root, o)
|
|
559
|
+
);
|
|
560
|
+
n.files.push(s);
|
|
510
561
|
}
|
|
511
562
|
if (t === "all" || t === "ts") {
|
|
512
|
-
const s =
|
|
513
|
-
|
|
563
|
+
const s = R$1(
|
|
564
|
+
"index.ts",
|
|
565
|
+
r.ts(e.root, o)
|
|
566
|
+
);
|
|
567
|
+
n.files.push(s);
|
|
514
568
|
}
|
|
515
|
-
return
|
|
569
|
+
return n;
|
|
516
570
|
}
|
|
517
571
|
async function directoryExists(path2) {
|
|
518
572
|
try {
|
|
@@ -528,7 +582,7 @@ GwIDAQAB
|
|
|
528
582
|
environment: process.env.NODE_ENV || "development",
|
|
529
583
|
isBuild: true
|
|
530
584
|
});
|
|
531
|
-
const output = await
|
|
585
|
+
const output = await Ne(instance, transpiler);
|
|
532
586
|
const outputDirExists = await directoryExists(outputDir);
|
|
533
587
|
if (clean && outputDirExists) {
|
|
534
588
|
await promises.rm(outputDir, { recursive: true });
|
|
@@ -543,40 +597,58 @@ GwIDAQAB
|
|
|
543
597
|
await promises.writeFile(filePath, file.content);
|
|
544
598
|
}
|
|
545
599
|
}
|
|
546
|
-
function
|
|
547
|
-
return function(t, ...i) {
|
|
548
|
-
return {
|
|
549
|
-
type: "css",
|
|
550
|
-
value: t.reduce((o, u, c) => (o.push(u), c < i.length && o.push(i[c]), o), [])
|
|
551
|
-
};
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
function M(e) {
|
|
600
|
+
function S(e) {
|
|
555
601
|
return typeof e == "object" && e !== null;
|
|
556
602
|
}
|
|
557
603
|
function p(e, r) {
|
|
558
|
-
return
|
|
604
|
+
return S(e) && "type" in e && e.type === r;
|
|
559
605
|
}
|
|
560
|
-
function
|
|
606
|
+
function L(e) {
|
|
561
607
|
return p(e, "variable");
|
|
562
608
|
}
|
|
563
|
-
function
|
|
609
|
+
function A(e) {
|
|
564
610
|
return p(e, "reference");
|
|
565
611
|
}
|
|
566
|
-
function
|
|
612
|
+
function q(e) {
|
|
613
|
+
return p(e, "modifier");
|
|
614
|
+
}
|
|
615
|
+
function E(e) {
|
|
567
616
|
return p(e, "css");
|
|
568
617
|
}
|
|
569
|
-
function
|
|
618
|
+
function G(e) {
|
|
570
619
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
|
|
571
620
|
}
|
|
572
|
-
function
|
|
573
|
-
return
|
|
621
|
+
function $(e) {
|
|
622
|
+
return G(e) || A(e) || E(e) || Array.isArray(e) && e.every($);
|
|
623
|
+
}
|
|
624
|
+
function I(e) {
|
|
625
|
+
return S(e) && "children" in e && "declarations" in e && "variables" in e;
|
|
626
|
+
}
|
|
627
|
+
function z(e = (r) => r) {
|
|
628
|
+
return (r) => {
|
|
629
|
+
let n = r, t;
|
|
630
|
+
if (typeof n == "string" && n[0] === "@") {
|
|
631
|
+
const i = n.slice(1);
|
|
632
|
+
t = e(i), n = {
|
|
633
|
+
type: "reference",
|
|
634
|
+
name: i
|
|
635
|
+
};
|
|
636
|
+
} else A(n) ? t = e(n.name) : t = `[${r}]`;
|
|
637
|
+
return {
|
|
638
|
+
[t]: n
|
|
639
|
+
};
|
|
640
|
+
};
|
|
574
641
|
}
|
|
575
|
-
function
|
|
576
|
-
return
|
|
642
|
+
function W(e, r) {
|
|
643
|
+
return function(t, ...i) {
|
|
644
|
+
return {
|
|
645
|
+
type: "css",
|
|
646
|
+
value: t.reduce((o, u, s) => (o.push(u), s < i.length && o.push(i[s]), o), [])
|
|
647
|
+
};
|
|
648
|
+
};
|
|
577
649
|
}
|
|
578
|
-
function
|
|
579
|
-
return function(t, i,
|
|
650
|
+
function C(e, r) {
|
|
651
|
+
return function(t, i, c) {
|
|
580
652
|
const o = {
|
|
581
653
|
type: "at-rule",
|
|
582
654
|
identifier: t,
|
|
@@ -584,25 +656,25 @@ GwIDAQAB
|
|
|
584
656
|
declarations: {},
|
|
585
657
|
variables: [],
|
|
586
658
|
children: []
|
|
587
|
-
}, u =
|
|
588
|
-
return typeof
|
|
659
|
+
}, u = v(o, r);
|
|
660
|
+
return typeof c == "function" ? o.declarations = c(u) ?? {} : c && (o.declarations = c), V(o.declarations, u), e.children.push(o), o;
|
|
589
661
|
};
|
|
590
662
|
}
|
|
591
|
-
function
|
|
592
|
-
const n =
|
|
593
|
-
return function(i,
|
|
594
|
-
return n("media", i,
|
|
663
|
+
function Y(e, r) {
|
|
664
|
+
const n = C(e, r);
|
|
665
|
+
return function(i, c) {
|
|
666
|
+
return n("media", i, c);
|
|
595
667
|
};
|
|
596
668
|
}
|
|
597
|
-
function
|
|
598
|
-
const n =
|
|
599
|
-
return function(i,
|
|
600
|
-
return n("keyframes", i,
|
|
669
|
+
function Z(e, r) {
|
|
670
|
+
const n = C(e, r);
|
|
671
|
+
return function(i, c) {
|
|
672
|
+
return n("keyframes", i, c);
|
|
601
673
|
};
|
|
602
674
|
}
|
|
603
|
-
function
|
|
675
|
+
function J(e, r) {
|
|
604
676
|
return function(t, i) {
|
|
605
|
-
return
|
|
677
|
+
return L(t) ? {
|
|
606
678
|
type: "reference",
|
|
607
679
|
name: t.name,
|
|
608
680
|
fallback: i
|
|
@@ -613,56 +685,56 @@ GwIDAQAB
|
|
|
613
685
|
};
|
|
614
686
|
};
|
|
615
687
|
}
|
|
616
|
-
function
|
|
688
|
+
function Q(e, r) {
|
|
617
689
|
return function(t, i) {
|
|
618
|
-
const
|
|
690
|
+
const c = {
|
|
619
691
|
type: "selector",
|
|
620
692
|
query: t,
|
|
621
693
|
declarations: {},
|
|
622
694
|
variables: [],
|
|
623
695
|
children: []
|
|
624
|
-
}, o =
|
|
625
|
-
return typeof i == "function" ?
|
|
696
|
+
}, o = v(c, r);
|
|
697
|
+
return typeof i == "function" ? c.declarations = i(o) ?? {} : I(i) ? (c.variables = i.variables, c.declarations = i.declarations, c.children = i.children) : c.declarations = i, V(c.declarations, o), e.children.push(c), c;
|
|
626
698
|
};
|
|
627
699
|
}
|
|
628
|
-
function
|
|
629
|
-
return function(t, i,
|
|
700
|
+
function X(e, r) {
|
|
701
|
+
return function(t, i, c = {
|
|
630
702
|
default: false
|
|
631
703
|
}) {
|
|
632
704
|
const o = typeof t == "string" ? t : t.name, u = e.variables.find(
|
|
633
705
|
(f) => f.name === o
|
|
634
706
|
);
|
|
635
|
-
if (
|
|
707
|
+
if (c.default && u)
|
|
636
708
|
return u;
|
|
637
709
|
if (u)
|
|
638
710
|
return u.value = i, u;
|
|
639
|
-
const
|
|
711
|
+
const s = {
|
|
640
712
|
type: "variable",
|
|
641
713
|
name: o,
|
|
642
714
|
value: i
|
|
643
715
|
};
|
|
644
|
-
return e.variables.push(
|
|
716
|
+
return e.variables.push(s), s;
|
|
645
717
|
};
|
|
646
718
|
}
|
|
647
|
-
function
|
|
648
|
-
const n =
|
|
719
|
+
function v(e, r) {
|
|
720
|
+
const n = X(e), t = Q(e, r), i = C(e, r), c = Z(r, r), o = Y(e, r), u = J(), s = W();
|
|
649
721
|
return {
|
|
650
722
|
variable: n,
|
|
651
723
|
selector: t,
|
|
652
|
-
keyframes:
|
|
724
|
+
keyframes: c,
|
|
653
725
|
atRule: i,
|
|
654
726
|
media: o,
|
|
655
727
|
ref: u,
|
|
656
|
-
css:
|
|
728
|
+
css: s
|
|
657
729
|
};
|
|
658
730
|
}
|
|
659
|
-
function
|
|
731
|
+
function V(e, r) {
|
|
660
732
|
for (const n in e)
|
|
661
733
|
if (n.startsWith("@")) {
|
|
662
734
|
const t = e[n];
|
|
663
|
-
if (typeof t == "object" && t !== null &&
|
|
664
|
-
const i = n.replace(/^@(\w+).*/, "$1"),
|
|
665
|
-
r.atRule(i,
|
|
735
|
+
if (typeof t == "object" && t !== null && !$(t)) {
|
|
736
|
+
const i = n.replace(/^@(\w+).*/, "$1"), c = n.replace(`@${i}`, "").trim();
|
|
737
|
+
r.atRule(i, c, t), delete e[n];
|
|
666
738
|
}
|
|
667
739
|
} else if (/^[.&:]/.test(n)) {
|
|
668
740
|
const t = e[n];
|
|
@@ -670,7 +742,7 @@ GwIDAQAB
|
|
|
670
742
|
}
|
|
671
743
|
return e;
|
|
672
744
|
}
|
|
673
|
-
function
|
|
745
|
+
function j(e) {
|
|
674
746
|
if (e instanceof Buffer)
|
|
675
747
|
return Buffer.from(e);
|
|
676
748
|
const r = e.constructor;
|
|
@@ -680,9 +752,9 @@ GwIDAQAB
|
|
|
680
752
|
e.byteLength / e.BYTES_PER_ELEMENT || 1
|
|
681
753
|
);
|
|
682
754
|
}
|
|
683
|
-
function
|
|
755
|
+
function ee(e) {
|
|
684
756
|
if (e = e || {}, e.circular)
|
|
685
|
-
return
|
|
757
|
+
return te(e);
|
|
686
758
|
const r = /* @__PURE__ */ new Map();
|
|
687
759
|
if (r.set(Date, (o) => new Date(o)), r.set(
|
|
688
760
|
Map,
|
|
@@ -694,12 +766,12 @@ GwIDAQAB
|
|
|
694
766
|
for (const o of e.constructorHandlers)
|
|
695
767
|
r.set(o[0], o[1]);
|
|
696
768
|
let n;
|
|
697
|
-
return e.proto ?
|
|
769
|
+
return e.proto ? c : i;
|
|
698
770
|
function t(o, u) {
|
|
699
|
-
const
|
|
700
|
-
for (let
|
|
701
|
-
const
|
|
702
|
-
typeof y != "object" || y === null ? f[
|
|
771
|
+
const s = Object.keys(o), f = Array.from({ length: s.length });
|
|
772
|
+
for (let l = 0; l < s.length; l++) {
|
|
773
|
+
const a = s[l], y = o[a];
|
|
774
|
+
typeof y != "object" || y === null ? f[a] = y : y.constructor !== Object && (n = r.get(y.constructor)) ? f[a] = n(y, u) : ArrayBuffer.isView(y) ? f[a] = j(y) : f[a] = u(y);
|
|
703
775
|
}
|
|
704
776
|
return f;
|
|
705
777
|
}
|
|
@@ -709,153 +781,161 @@ GwIDAQAB
|
|
|
709
781
|
if (o.constructor !== Object && (n = r.get(o.constructor)))
|
|
710
782
|
return n(o, i);
|
|
711
783
|
const u = {};
|
|
712
|
-
for (const
|
|
713
|
-
if (Object.hasOwnProperty.call(o,
|
|
714
|
-
const f = o[
|
|
715
|
-
typeof f != "object" || f === null ? u[
|
|
784
|
+
for (const s in o) {
|
|
785
|
+
if (Object.hasOwnProperty.call(o, s) === false) continue;
|
|
786
|
+
const f = o[s];
|
|
787
|
+
typeof f != "object" || f === null ? u[s] = f : f.constructor !== Object && (n = r.get(f.constructor)) ? u[s] = n(f, i) : ArrayBuffer.isView(f) ? u[s] = j(f) : u[s] = i(f);
|
|
716
788
|
}
|
|
717
789
|
return u;
|
|
718
790
|
}
|
|
719
|
-
function
|
|
791
|
+
function c(o) {
|
|
720
792
|
if (typeof o != "object" || o === null) return o;
|
|
721
|
-
if (Array.isArray(o)) return t(o,
|
|
793
|
+
if (Array.isArray(o)) return t(o, c);
|
|
722
794
|
if (o.constructor !== Object && (n = r.get(o.constructor)))
|
|
723
|
-
return n(o,
|
|
795
|
+
return n(o, c);
|
|
724
796
|
const u = {};
|
|
725
|
-
for (const
|
|
726
|
-
const f = o[
|
|
727
|
-
typeof f != "object" || f === null ? u[
|
|
797
|
+
for (const s in o) {
|
|
798
|
+
const f = o[s];
|
|
799
|
+
typeof f != "object" || f === null ? u[s] = f : f.constructor !== Object && (n = r.get(f.constructor)) ? u[s] = n(f, c) : ArrayBuffer.isView(f) ? u[s] = j(f) : u[s] = c(f);
|
|
728
800
|
}
|
|
729
801
|
return u;
|
|
730
802
|
}
|
|
731
803
|
}
|
|
732
|
-
function
|
|
804
|
+
function te(e) {
|
|
733
805
|
const r = [], n = [], t = /* @__PURE__ */ new Map();
|
|
734
|
-
if (t.set(Date, (
|
|
806
|
+
if (t.set(Date, (s) => new Date(s)), t.set(
|
|
735
807
|
Map,
|
|
736
|
-
(
|
|
808
|
+
(s, f) => new Map(c(Array.from(s), f))
|
|
737
809
|
), t.set(
|
|
738
810
|
Set,
|
|
739
|
-
(
|
|
811
|
+
(s, f) => new Set(c(Array.from(s), f))
|
|
740
812
|
), e.constructorHandlers)
|
|
741
|
-
for (const
|
|
742
|
-
t.set(
|
|
813
|
+
for (const s of e.constructorHandlers)
|
|
814
|
+
t.set(s[0], s[1]);
|
|
743
815
|
let i;
|
|
744
816
|
return e.proto ? u : o;
|
|
745
|
-
function s
|
|
746
|
-
const
|
|
747
|
-
for (let y = 0; y <
|
|
748
|
-
const
|
|
749
|
-
if (typeof
|
|
750
|
-
|
|
751
|
-
else if (
|
|
752
|
-
|
|
753
|
-
else if (ArrayBuffer.isView(
|
|
754
|
-
|
|
817
|
+
function c(s, f) {
|
|
818
|
+
const l = Object.keys(s), a = Array.from({ length: l.length });
|
|
819
|
+
for (let y = 0; y < l.length; y++) {
|
|
820
|
+
const m = l[y], d2 = s[m];
|
|
821
|
+
if (typeof d2 != "object" || d2 === null)
|
|
822
|
+
a[m] = d2;
|
|
823
|
+
else if (d2.constructor !== Object && (i = t.get(d2.constructor)))
|
|
824
|
+
a[m] = i(d2, f);
|
|
825
|
+
else if (ArrayBuffer.isView(d2))
|
|
826
|
+
a[m] = j(d2);
|
|
755
827
|
else {
|
|
756
|
-
const
|
|
757
|
-
|
|
828
|
+
const h2 = r.indexOf(d2);
|
|
829
|
+
h2 !== -1 ? a[m] = n[h2] : a[m] = f(d2);
|
|
758
830
|
}
|
|
759
831
|
}
|
|
760
|
-
return
|
|
832
|
+
return a;
|
|
761
833
|
}
|
|
762
|
-
function o(
|
|
763
|
-
if (typeof
|
|
764
|
-
if (Array.isArray(
|
|
765
|
-
if (
|
|
766
|
-
return i(
|
|
834
|
+
function o(s) {
|
|
835
|
+
if (typeof s != "object" || s === null) return s;
|
|
836
|
+
if (Array.isArray(s)) return c(s, o);
|
|
837
|
+
if (s.constructor !== Object && (i = t.get(s.constructor)))
|
|
838
|
+
return i(s, o);
|
|
767
839
|
const f = {};
|
|
768
|
-
r.push(
|
|
769
|
-
for (const
|
|
770
|
-
if (Object.hasOwnProperty.call(
|
|
771
|
-
const
|
|
772
|
-
if (typeof
|
|
773
|
-
f[
|
|
774
|
-
else if (
|
|
775
|
-
f[
|
|
776
|
-
else if (ArrayBuffer.isView(
|
|
777
|
-
f[
|
|
840
|
+
r.push(s), n.push(f);
|
|
841
|
+
for (const l in s) {
|
|
842
|
+
if (Object.hasOwnProperty.call(s, l) === false) continue;
|
|
843
|
+
const a = s[l];
|
|
844
|
+
if (typeof a != "object" || a === null)
|
|
845
|
+
f[l] = a;
|
|
846
|
+
else if (a.constructor !== Object && (i = t.get(a.constructor)))
|
|
847
|
+
f[l] = i(a, o);
|
|
848
|
+
else if (ArrayBuffer.isView(a))
|
|
849
|
+
f[l] = j(a);
|
|
778
850
|
else {
|
|
779
|
-
const y = r.indexOf(
|
|
780
|
-
y !== -1 ? f[
|
|
851
|
+
const y = r.indexOf(a);
|
|
852
|
+
y !== -1 ? f[l] = n[y] : f[l] = o(a);
|
|
781
853
|
}
|
|
782
854
|
}
|
|
783
855
|
return r.pop(), n.pop(), f;
|
|
784
856
|
}
|
|
785
|
-
function u(
|
|
786
|
-
if (typeof
|
|
787
|
-
if (Array.isArray(
|
|
788
|
-
if (
|
|
789
|
-
return i(
|
|
857
|
+
function u(s) {
|
|
858
|
+
if (typeof s != "object" || s === null) return s;
|
|
859
|
+
if (Array.isArray(s)) return c(s, u);
|
|
860
|
+
if (s.constructor !== Object && (i = t.get(s.constructor)))
|
|
861
|
+
return i(s, u);
|
|
790
862
|
const f = {};
|
|
791
|
-
r.push(
|
|
792
|
-
for (const
|
|
793
|
-
const
|
|
794
|
-
if (typeof
|
|
795
|
-
f[
|
|
796
|
-
else if (
|
|
797
|
-
f[
|
|
798
|
-
else if (ArrayBuffer.isView(
|
|
799
|
-
f[
|
|
863
|
+
r.push(s), n.push(f);
|
|
864
|
+
for (const l in s) {
|
|
865
|
+
const a = s[l];
|
|
866
|
+
if (typeof a != "object" || a === null)
|
|
867
|
+
f[l] = a;
|
|
868
|
+
else if (a.constructor !== Object && (i = t.get(a.constructor)))
|
|
869
|
+
f[l] = i(a, u);
|
|
870
|
+
else if (ArrayBuffer.isView(a))
|
|
871
|
+
f[l] = j(a);
|
|
800
872
|
else {
|
|
801
|
-
const y = r.indexOf(
|
|
802
|
-
y !== -1 ? f[
|
|
873
|
+
const y = r.indexOf(a);
|
|
874
|
+
y !== -1 ? f[l] = n[y] : f[l] = u(a);
|
|
803
875
|
}
|
|
804
876
|
}
|
|
805
877
|
return r.pop(), n.pop(), f;
|
|
806
878
|
}
|
|
807
879
|
}
|
|
808
|
-
const
|
|
809
|
-
function
|
|
880
|
+
const R = ee();
|
|
881
|
+
function ne(e, r = 8) {
|
|
810
882
|
const n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
811
883
|
let t = "";
|
|
812
884
|
for (let i = 0; i < r; i++) {
|
|
813
|
-
const
|
|
814
|
-
t += n[
|
|
885
|
+
const c = Math.floor(Math.random() * n.length);
|
|
886
|
+
t += n[c];
|
|
815
887
|
}
|
|
816
888
|
return e ? `${e}${t}` : t;
|
|
817
889
|
}
|
|
818
|
-
function
|
|
890
|
+
function re(e, r) {
|
|
891
|
+
const n = e.modifiers.find(
|
|
892
|
+
(t) => t.key.includes(r)
|
|
893
|
+
);
|
|
894
|
+
if (!n)
|
|
895
|
+
throw new Error(`Modifier "${r}" not found`);
|
|
896
|
+
return n;
|
|
897
|
+
}
|
|
898
|
+
function ce(e) {
|
|
819
899
|
const r = [];
|
|
820
900
|
function n(t, i) {
|
|
821
901
|
i.length > 0 && r.push([...i].sort());
|
|
822
|
-
for (let
|
|
823
|
-
const o = e[
|
|
902
|
+
for (let c = t; c < e.length; c++) {
|
|
903
|
+
const o = e[c];
|
|
824
904
|
if (o)
|
|
825
905
|
if (o.length === 1 && o[0])
|
|
826
|
-
n(
|
|
906
|
+
n(c + 1, [...i, o[0]]);
|
|
827
907
|
else
|
|
828
908
|
for (const u of o)
|
|
829
|
-
n(
|
|
909
|
+
n(c + 1, [...i, u]);
|
|
830
910
|
}
|
|
831
911
|
}
|
|
832
912
|
return n(0, []), r.sort((t, i) => t.length !== i.length ? t.length - i.length : t.join(",").localeCompare(i.join(",")));
|
|
833
913
|
}
|
|
834
|
-
function
|
|
914
|
+
function fe(e, r, n) {
|
|
835
915
|
const t = {
|
|
836
916
|
...e,
|
|
837
917
|
modifiers: [...n.keys()]
|
|
838
|
-
}, i =
|
|
839
|
-
for (const
|
|
840
|
-
|
|
918
|
+
}, i = v(t, r);
|
|
919
|
+
for (const c of n.values())
|
|
920
|
+
c.factory({
|
|
841
921
|
...i,
|
|
842
|
-
declarations:
|
|
843
|
-
variables:
|
|
844
|
-
children:
|
|
845
|
-
}),
|
|
922
|
+
declarations: R(t.declarations),
|
|
923
|
+
variables: R(t.variables),
|
|
924
|
+
children: R(t.children)
|
|
925
|
+
}), V(t.declarations, i);
|
|
846
926
|
return t;
|
|
847
927
|
}
|
|
848
|
-
function
|
|
928
|
+
function ue(e, r) {
|
|
849
929
|
return function(t, i) {
|
|
850
|
-
const
|
|
930
|
+
const c = {
|
|
851
931
|
type: "modifier",
|
|
852
932
|
key: Array.isArray(t) ? t : [t],
|
|
853
933
|
factory: i
|
|
854
934
|
};
|
|
855
|
-
return r.modifiers.push(
|
|
935
|
+
return r.modifiers.push(c), c;
|
|
856
936
|
};
|
|
857
937
|
}
|
|
858
|
-
function
|
|
938
|
+
function ae() {
|
|
859
939
|
return {
|
|
860
940
|
type: "root",
|
|
861
941
|
declarations: {},
|
|
@@ -867,111 +947,243 @@ GwIDAQAB
|
|
|
867
947
|
themes: []
|
|
868
948
|
};
|
|
869
949
|
}
|
|
870
|
-
function
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
const o = /* @__PURE__ */ new Map();
|
|
874
|
-
for (const u of s) {
|
|
875
|
-
const c = r.find(
|
|
876
|
-
(f) => f.key.includes(u)
|
|
877
|
-
);
|
|
878
|
-
c && o.set(u, c);
|
|
879
|
-
}
|
|
880
|
-
return z(e, n, o);
|
|
881
|
-
});
|
|
882
|
-
}
|
|
883
|
-
function J(e, r) {
|
|
884
|
-
return function(t, i) {
|
|
885
|
-
const s = {
|
|
950
|
+
function le(e, r) {
|
|
951
|
+
return function(t, i, c = {}) {
|
|
952
|
+
const o = {
|
|
886
953
|
type: "utility",
|
|
887
954
|
name: t,
|
|
888
|
-
factory: i
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
)
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
955
|
+
factory: i,
|
|
956
|
+
values: [],
|
|
957
|
+
autogenerate: c.autogenerate ?? z(),
|
|
958
|
+
create: (u, s = []) => {
|
|
959
|
+
let f = u;
|
|
960
|
+
if (Array.isArray(u)) {
|
|
961
|
+
f = {};
|
|
962
|
+
for (const l of u) {
|
|
963
|
+
const a = o.autogenerate(l);
|
|
964
|
+
f = {
|
|
965
|
+
...f,
|
|
966
|
+
...a
|
|
967
|
+
};
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
for (const [l, a] of Object.entries(f)) {
|
|
971
|
+
const y = o.values.find(
|
|
972
|
+
(h2) => h2.key === l && h2.modifiers.length === 0
|
|
973
|
+
), m = {
|
|
974
|
+
type: "utility",
|
|
975
|
+
name: t,
|
|
976
|
+
value: l,
|
|
977
|
+
declarations: {},
|
|
978
|
+
variables: [],
|
|
979
|
+
children: [],
|
|
980
|
+
modifiers: []
|
|
981
|
+
}, d2 = v(
|
|
982
|
+
m,
|
|
983
|
+
r
|
|
984
|
+
);
|
|
985
|
+
if (m.declarations = i({
|
|
986
|
+
...d2,
|
|
987
|
+
value: a
|
|
988
|
+
}) ?? {}, V(m.declarations, d2), y || (o.values.push({
|
|
989
|
+
key: l,
|
|
990
|
+
value: a,
|
|
991
|
+
modifiers: []
|
|
992
|
+
}), e.children.push(m)), s && s.length > 0) {
|
|
993
|
+
const h2 = s.map((b) => b.key), H2 = ce(h2).filter((b) => !o.values.find(
|
|
994
|
+
(g2) => g2.key === l && g2.modifiers.length === b.length && g2.modifiers.every((w2) => b.includes(w2))
|
|
995
|
+
)).reduce((b, g2) => {
|
|
996
|
+
const w2 = /* @__PURE__ */ new Map();
|
|
997
|
+
for (const K2 of g2) {
|
|
998
|
+
const k2 = s.find(
|
|
999
|
+
(N2) => N2.key.includes(K2)
|
|
1000
|
+
);
|
|
1001
|
+
k2 && q(k2) && w2.set(K2, k2);
|
|
1002
|
+
}
|
|
1003
|
+
return o.values.push({
|
|
1004
|
+
key: l,
|
|
1005
|
+
value: a,
|
|
1006
|
+
modifiers: g2
|
|
1007
|
+
}), b.push(fe(m, r, w2)), b;
|
|
1008
|
+
}, []);
|
|
1009
|
+
e.children.push(...H2);
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
910
1012
|
}
|
|
911
1013
|
};
|
|
1014
|
+
return r.utilities.push(o), o.create;
|
|
912
1015
|
};
|
|
913
1016
|
}
|
|
914
|
-
function
|
|
1017
|
+
function ye(e, r) {
|
|
915
1018
|
return function(t, i) {
|
|
916
|
-
const
|
|
1019
|
+
const c = r.themes.find((s) => s.name === t), o = c ?? {
|
|
917
1020
|
type: "theme",
|
|
918
1021
|
name: t,
|
|
919
1022
|
declarations: {},
|
|
920
1023
|
variables: [],
|
|
921
1024
|
children: []
|
|
922
1025
|
};
|
|
923
|
-
|
|
924
|
-
const u =
|
|
1026
|
+
c || r.themes.push(o);
|
|
1027
|
+
const u = v(o, r);
|
|
925
1028
|
return i && i(u), o;
|
|
926
1029
|
};
|
|
927
1030
|
}
|
|
928
|
-
function
|
|
929
|
-
return function(t
|
|
930
|
-
const
|
|
1031
|
+
function de(e, r) {
|
|
1032
|
+
return function(t) {
|
|
1033
|
+
const i = {
|
|
931
1034
|
type: "recipe",
|
|
932
|
-
|
|
933
|
-
defaults: i,
|
|
934
|
-
variants: s,
|
|
935
|
-
...o
|
|
1035
|
+
...t
|
|
936
1036
|
};
|
|
937
|
-
return r.recipes.push(
|
|
1037
|
+
return i._runtime = me(i, r), pe(i, r), r.recipes.push(i), i;
|
|
1038
|
+
};
|
|
1039
|
+
}
|
|
1040
|
+
function _(e, r) {
|
|
1041
|
+
const n = e.autogenerate(r);
|
|
1042
|
+
return Object.keys(n)[0] ?? "default";
|
|
1043
|
+
}
|
|
1044
|
+
function F(e, r) {
|
|
1045
|
+
const n = {};
|
|
1046
|
+
for (const [t, i] of Object.entries(e))
|
|
1047
|
+
if (P(i)) {
|
|
1048
|
+
const c = {};
|
|
1049
|
+
for (const [o, u] of Object.entries(i)) {
|
|
1050
|
+
const s = T(r, o);
|
|
1051
|
+
s && (c[o] = _(
|
|
1052
|
+
s,
|
|
1053
|
+
u
|
|
1054
|
+
));
|
|
1055
|
+
}
|
|
1056
|
+
n[t] = c;
|
|
1057
|
+
} else if (typeof i == "boolean")
|
|
1058
|
+
n[t] = i;
|
|
1059
|
+
else {
|
|
1060
|
+
const c = T(r, t);
|
|
1061
|
+
c && (n[t] = _(c, i));
|
|
1062
|
+
}
|
|
1063
|
+
return n;
|
|
1064
|
+
}
|
|
1065
|
+
function me(e, r) {
|
|
1066
|
+
const n = {};
|
|
1067
|
+
if (e.base && (n.base = F(e.base, r)), e.variants) {
|
|
1068
|
+
const t = {};
|
|
1069
|
+
for (const [i, c] of Object.entries(e.variants)) {
|
|
1070
|
+
const o = {};
|
|
1071
|
+
for (const [u, s] of Object.entries(
|
|
1072
|
+
c
|
|
1073
|
+
))
|
|
1074
|
+
s == null ? o[u] = null : o[u] = F(
|
|
1075
|
+
s,
|
|
1076
|
+
r
|
|
1077
|
+
);
|
|
1078
|
+
t[i] = o;
|
|
1079
|
+
}
|
|
1080
|
+
n.variants = t;
|
|
1081
|
+
}
|
|
1082
|
+
return e.defaultVariants && (n.defaultVariants = { ...e.defaultVariants }), e.compoundVariants && (n.compoundVariants = e.compoundVariants.map((t) => ({
|
|
1083
|
+
match: { ...t.match },
|
|
1084
|
+
css: F(t.css, r)
|
|
1085
|
+
}))), n;
|
|
1086
|
+
}
|
|
1087
|
+
function P(e) {
|
|
1088
|
+
return !A(e) && typeof e == "object" && e !== null;
|
|
1089
|
+
}
|
|
1090
|
+
function x(e, r) {
|
|
1091
|
+
const n = (t, i, c) => {
|
|
1092
|
+
let o = r.get(t);
|
|
1093
|
+
o || (o = [], r.set(t, o)), o.push({ value: i, modifiers: c });
|
|
938
1094
|
};
|
|
1095
|
+
for (const [t, i] of Object.entries(e))
|
|
1096
|
+
if (P(i)) {
|
|
1097
|
+
const c = t.split(":");
|
|
1098
|
+
for (const [o, u] of Object.entries(i))
|
|
1099
|
+
n(o, u, c);
|
|
1100
|
+
} else
|
|
1101
|
+
n(t, i, []);
|
|
1102
|
+
}
|
|
1103
|
+
function T(e, r) {
|
|
1104
|
+
const n = e.utilities.find((i) => i.name === r);
|
|
1105
|
+
if (n)
|
|
1106
|
+
return n;
|
|
1107
|
+
const t = r.replace(/[A-Z]/g, (i) => `-${i.toLowerCase()}`);
|
|
1108
|
+
return e.utilities.find((i) => i.name === t);
|
|
1109
|
+
}
|
|
1110
|
+
function pe(e, r) {
|
|
1111
|
+
const n = /* @__PURE__ */ new Map();
|
|
1112
|
+
if (e.base && x(e.base, n), e.variants)
|
|
1113
|
+
for (const i of Object.values(e.variants))
|
|
1114
|
+
for (const c of Object.values(i))
|
|
1115
|
+
x(
|
|
1116
|
+
c,
|
|
1117
|
+
n
|
|
1118
|
+
);
|
|
1119
|
+
if (e.compoundVariants)
|
|
1120
|
+
for (const i of e.compoundVariants)
|
|
1121
|
+
i.css && x(i.css, n);
|
|
1122
|
+
const t = /* @__PURE__ */ new Map();
|
|
1123
|
+
for (const [i, c] of n) {
|
|
1124
|
+
const o = T(r, i);
|
|
1125
|
+
if (!o) {
|
|
1126
|
+
console.warn(
|
|
1127
|
+
`[styleframe] Utility "${i}" not found in registry. Skipping.`
|
|
1128
|
+
);
|
|
1129
|
+
continue;
|
|
1130
|
+
}
|
|
1131
|
+
for (const u of c) {
|
|
1132
|
+
const s = [];
|
|
1133
|
+
for (const f of u.modifiers) {
|
|
1134
|
+
if (!t.has(f))
|
|
1135
|
+
try {
|
|
1136
|
+
t.set(f, re(r, f));
|
|
1137
|
+
} catch {
|
|
1138
|
+
console.warn(
|
|
1139
|
+
`[styleframe] Modifier "${f}" not found in registry. Skipping modifier for utility "${i}".`
|
|
1140
|
+
), t.set(f, null);
|
|
1141
|
+
}
|
|
1142
|
+
const l = t.get(f);
|
|
1143
|
+
l && s.push(l);
|
|
1144
|
+
}
|
|
1145
|
+
o.create(
|
|
1146
|
+
[u.value],
|
|
1147
|
+
s.length > 0 ? s : void 0
|
|
1148
|
+
);
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
939
1151
|
}
|
|
940
|
-
function
|
|
941
|
-
const r =
|
|
1152
|
+
function Re(e) {
|
|
1153
|
+
const r = ne("sf-"), n = ae(), t = { ...e }, i = le(n, n), c = ue(n, n), o = de(n, n), u = ye(n, n), { variable: s, selector: f, atRule: l, keyframes: a, media: y, ref: m, css: d2 } = v(n, n);
|
|
942
1154
|
return {
|
|
943
1155
|
id: r,
|
|
944
1156
|
root: n,
|
|
945
|
-
variable:
|
|
1157
|
+
variable: s,
|
|
946
1158
|
selector: f,
|
|
947
1159
|
utility: i,
|
|
948
|
-
modifier:
|
|
1160
|
+
modifier: c,
|
|
949
1161
|
recipe: o,
|
|
950
1162
|
theme: u,
|
|
951
|
-
atRule:
|
|
952
|
-
keyframes:
|
|
1163
|
+
atRule: l,
|
|
1164
|
+
keyframes: a,
|
|
953
1165
|
media: y,
|
|
954
|
-
ref:
|
|
955
|
-
css:
|
|
1166
|
+
ref: m,
|
|
1167
|
+
css: d2,
|
|
956
1168
|
options: t
|
|
957
1169
|
};
|
|
958
1170
|
}
|
|
959
1171
|
async function loadConfiguration({
|
|
960
1172
|
cwd = process.cwd(),
|
|
961
|
-
|
|
1173
|
+
configFile = "styleframe.config"
|
|
962
1174
|
} = {}) {
|
|
963
1175
|
const { config } = await c12.loadConfig({
|
|
964
1176
|
cwd,
|
|
965
|
-
|
|
966
|
-
defaults:
|
|
1177
|
+
configFile,
|
|
1178
|
+
defaults: Re()
|
|
967
1179
|
});
|
|
968
1180
|
return config;
|
|
969
1181
|
}
|
|
970
1182
|
async function loadConfigurationFromPath(entry) {
|
|
971
1183
|
const entryPath = path.resolve(entry);
|
|
972
1184
|
const cwd = path.dirname(entryPath);
|
|
973
|
-
const
|
|
974
|
-
return await loadConfiguration({ cwd,
|
|
1185
|
+
const configFile = path.basename(entryPath).replace(/(\.ts)?$/, "");
|
|
1186
|
+
return await loadConfiguration({ cwd, configFile });
|
|
975
1187
|
}
|
|
976
1188
|
async function watchConfiguration({
|
|
977
1189
|
cwd = process.cwd()
|