@floegence/floe-webapp-core 0.102.0 → 0.102.1

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.
@@ -1,7 +1,7 @@
1
1
  import { type JSX } from 'solid-js';
2
2
  import { type FloeThemePreset, type PortableShellTheme } from '../../themes';
3
3
  import { type ThemeFieldLabel } from './ThemeFields';
4
- export type ThemeStudioLabel = ThemeFieldLabel | 'compare' | 'create' | 'edit' | 'import' | 'export' | 'generate' | 'name' | 'colors' | 'advanced' | 'save' | 'cancel' | 'invalid' | 'failed' | 'background' | 'foreground' | 'primary' | 'card' | 'sidebar' | 'border';
4
+ export type ThemeStudioLabel = ThemeFieldLabel | 'blank' | 'light' | 'dark' | 'compare' | 'create' | 'edit' | 'import' | 'export' | 'generate' | 'name' | 'colors' | 'advanced' | 'save' | 'cancel' | 'invalid' | 'failed' | 'background' | 'foreground' | 'primary' | 'card' | 'sidebar' | 'border';
5
5
  export interface ThemeStudioProps {
6
6
  active: boolean;
7
7
  current: PortableShellTheme;
@@ -1,115 +1,118 @@
1
- import { insert as n, createComponent as r, memo as R, setStyleProperty as m, effect as q, template as w, use as _e, delegateEvents as $e } from "solid-js/web";
2
- import { createSignal as u, createEffect as te, onCleanup as we, createMemo as j, Show as $, For as re } from "solid-js";
3
- import { Plus as ye, Pencil as ke, Upload as Ce, Download as Se, Sparkles as xe, ChevronLeft as Te, ChevronRight as Ee, Eye as Oe, Check as Le } from "../icons/index.js";
4
- import { Button as d } from "./Button.js";
5
- import { Input as Ie, Textarea as ze } from "./Input.js";
6
- import { Dialog as Ne } from "./Dialog.js";
7
- import { readPortableShellTheme as ne, resolvePortableShellTheme as Pe, portableContrastIssue as Je, PORTABLE_THEME_LIMIT as Re } from "../../styles/themes/portableTheme.js";
8
- import { ThemeFields as je } from "./ThemeFields.js";
9
- var Fe = /* @__PURE__ */ w("<div class=floe-theme-studio__actions><input hidden type=file accept=.json,application/json>"), le = /* @__PURE__ */ w("<p role=alert class=floe-theme-picker__error>"), Ue = /* @__PURE__ */ w("<div class=floe-theme-studio__body><label></label><fieldset><legend></legend><div class=floe-theme-studio__swatches></div></fieldset><div class=floe-theme-studio__actions></div><details><summary>"), Be = /* @__PURE__ */ w("<div class=floe-theme-studio__sample aria-hidden=true><aside><i></i><i></i><i></i></aside><div><strong>Aa</strong><span></span><section>"), De = /* @__PURE__ */ w("<i>"), Me = /* @__PURE__ */ w("<label><input type=color>");
10
- function Xe(e) {
11
- const [F, y] = u(!1), [s, G] = u(!1), [f, T] = u(""), [Q, ie] = u(), [E, k] = u(""), [ae, U] = u(""), [ce, oe] = u(), [B, V] = u(!1), [ue, W] = u();
12
- let D, v = 0;
13
- const [C, O] = u([]), [L, I] = u([]), z = (t) => {
14
- t !== f() && (O([...C().slice(-39), f()]), I([]), T(t));
15
- }, se = () => {
16
- const t = C().at(-1);
17
- t !== void 0 && (I([...L(), f()]), O(C().slice(0, -1)), T(t));
18
- }, de = () => {
19
- const t = L().at(-1);
20
- t !== void 0 && (O([...C(), f()]), I(L().slice(0, -1)), T(t));
1
+ import { insert as l, createComponent as n, memo as B, effect as O, setAttribute as $e, setStyleProperty as w, template as $, use as we, delegateEvents as ye } from "solid-js/web";
2
+ import { createSignal as f, createEffect as le, onCleanup as Ce, createMemo as U, Show as k, For as W } from "solid-js";
3
+ import { Plus as Se, Pencil as Te, Upload as xe, Download as Ee, Sparkles as ie, ChevronLeft as Oe, ChevronRight as Le, Eye as ze, Check as Ne } from "../icons/index.js";
4
+ import { Button as v } from "./Button.js";
5
+ import { Input as Ie, Textarea as Je } from "./Input.js";
6
+ import { Dialog as Pe } from "./Dialog.js";
7
+ import { readPortableShellTheme as ae, resolvePortableShellTheme as Re, portableContrastIssue as je, PORTABLE_THEME_LIMIT as Fe, createBlankShellTheme as Be } from "../../styles/themes/portableTheme.js";
8
+ import { ThemeFields as Ue } from "./ThemeFields.js";
9
+ var Ae = /* @__PURE__ */ $("<div class=floe-theme-studio__actions><input hidden type=file accept=.json,application/json>"), ce = /* @__PURE__ */ $("<p role=alert class=floe-theme-picker__error>"), De = /* @__PURE__ */ $("<div class=floe-theme-studio__actions><select>"), Me = /* @__PURE__ */ $("<div class=floe-theme-studio__body><label></label><fieldset><legend></legend><div class=floe-theme-studio__swatches></div></fieldset><div class=floe-theme-studio__actions></div><details><summary>"), He = /* @__PURE__ */ $("<option>"), Ke = /* @__PURE__ */ $("<div class=floe-theme-studio__sample aria-hidden=true><aside><i></i><i></i><i></i></aside><div><strong>Aa</strong><span></span><section>"), qe = /* @__PURE__ */ $("<i>"), Ge = /* @__PURE__ */ $("<label><input type=color>");
10
+ function tt(e) {
11
+ const [L, C] = f(!1), [u, X] = f(!1), [m, z] = f(""), [A, oe] = f(), [N, S] = f(""), [D, M] = f(""), [de, ue] = f(), [H, Y] = f(!1), [se, Z] = f();
12
+ let K, _ = 0;
13
+ const [T, I] = f([]), [J, P] = f([]), y = (t) => {
14
+ t !== m() && (I([...T().slice(-39), m()]), P([]), z(t));
15
+ }, ge = () => {
16
+ const t = T().at(-1);
17
+ t !== void 0 && (P([...J(), m()]), I(T().slice(0, -1)), z(t));
18
+ }, ve = () => {
19
+ const t = J().at(-1);
20
+ t !== void 0 && (I([...T(), m()]), P(J().slice(0, -1)), z(t));
21
21
  };
22
- te(() => {
23
- e.active || (v++, y(!1), k(""));
24
- }), we(() => {
25
- v++;
22
+ le(() => {
23
+ e.active || (_++, C(!1), S(""));
24
+ }), Ce(() => {
25
+ _++;
26
26
  });
27
- const b = j(() => {
27
+ const g = U(() => {
28
28
  try {
29
29
  return {
30
- doc: ne(f())
30
+ doc: ae(m())
31
31
  };
32
32
  } catch (t) {
33
33
  return {
34
34
  issue: t instanceof SyntaxError ? "JSON" : t.message
35
35
  };
36
36
  }
37
- }), g = j(() => {
38
- const t = B() ? ce() : b().doc;
39
- return t && Pe("draft", t);
37
+ }), h = U(() => {
38
+ const t = H() ? de() : g().doc;
39
+ return t && Re("draft", t);
40
40
  });
41
- te(() => {
42
- f(), U("");
41
+ le(() => {
42
+ m(), M("");
43
43
  });
44
- const N = j(() => {
45
- const t = b().doc;
46
- return ae() || (t ? Je(t) : b().issue);
47
- }), P = j(() => {
44
+ const R = U(() => {
45
+ const t = g().doc;
46
+ return D() || (t ? je(t) : g().issue);
47
+ }), j = U(() => {
48
48
  try {
49
- return JSON.parse(f());
49
+ return JSON.parse(m());
50
50
  } catch {
51
51
  return null;
52
52
  }
53
- }), M = (t, i) => {
54
- O([]), I([]), U(""), oe(t), V(!1), W(void 0), ie(i), T(JSON.stringify(t, null, 2)), k(""), y(!0);
55
- }, ge = async (t) => {
53
+ }), q = (t, i) => {
54
+ I([]), P([]), M(""), ue(t), Y(!1), Z(void 0), oe(i), z(JSON.stringify(t, null, 2)), S(""), C(!0);
55
+ }, be = async (t) => {
56
56
  if (!t || !e.active) return;
57
- const i = ++v;
57
+ const i = ++_;
58
58
  try {
59
- if (t.size > Re) throw new Error("128 KiB");
60
- const a = ne(await t.text());
61
- i === v && e.active && M(a);
62
- } catch (a) {
63
- i === v && k(`${e.label("invalid")}: ${a instanceof SyntaxError ? "JSON" : a.message}`);
59
+ if (t.size > Fe) throw new Error("128 KiB");
60
+ const o = ae(await t.text());
61
+ i === _ && e.active && q(o);
62
+ } catch (o) {
63
+ i === _ && S(`${e.label("invalid")}: ${o instanceof SyntaxError ? "JSON" : o.message}`);
64
64
  }
65
65
  }, fe = () => {
66
66
  const t = e.current, i = URL.createObjectURL(new Blob([JSON.stringify(t, null, 2) + `
67
67
  `], {
68
68
  type: "application/json"
69
- })), a = document.createElement("a");
70
- a.download = `${t.name.replace(/[^\p{L}\p{N}_-]+/gu, "-").slice(0, 64)}.floe-theme.json`, a.href = i, a.click(), setTimeout(() => URL.revokeObjectURL(i), 1e3);
71
- }, ve = async () => {
72
- const t = b().doc;
73
- if (!t || N() || !F() || !e.active || s()) return;
74
- G(!0), k("");
75
- const i = v;
69
+ })), o = document.createElement("a");
70
+ o.download = `${t.name.replace(/[^\p{L}\p{N}_-]+/gu, "-").slice(0, 64)}.floe-theme.json`, o.href = i, o.click(), setTimeout(() => URL.revokeObjectURL(i), 1e3);
71
+ }, he = async () => {
72
+ const t = g().doc;
73
+ if (!t || R() || !L() || !e.active || u()) return;
74
+ X(!0), S("");
75
+ const i = _;
76
76
  try {
77
- await e.save(t, Q()), i === v && y(!1);
77
+ await e.save(t, A()), i === _ && C(!1);
78
78
  } catch {
79
- i === v && k(e.label("failed"));
79
+ i === _ && S(e.label("failed"));
80
80
  } finally {
81
- G(!1);
81
+ X(!1);
82
82
  }
83
- }, be = ["background", "card", "sidebar", "foreground", "primary", "border"];
83
+ }, me = ["background", "card", "sidebar", "foreground", "primary", "border"], G = (t) => {
84
+ const i = g().doc;
85
+ e.active && L() && !u() && i && !D() && t(i);
86
+ };
84
87
  return [(() => {
85
- var t = Fe(), i = t.firstChild;
86
- i.addEventListener("change", (S) => {
87
- const A = S.currentTarget.files?.[0];
88
- S.currentTarget.value = "", ge(A);
88
+ var t = Ae(), i = t.firstChild;
89
+ i.addEventListener("change", (x) => {
90
+ const Q = x.currentTarget.files?.[0];
91
+ x.currentTarget.value = "", be(Q);
89
92
  });
90
- var a = D;
91
- return typeof a == "function" ? _e(a, i) : D = i, n(t, r(d, {
93
+ var o = K;
94
+ return typeof o == "function" ? we(o, i) : K = i, l(t, n(v, {
92
95
  size: "sm",
93
- icon: ye,
96
+ icon: Se,
94
97
  variant: "outline",
95
98
  get disabled() {
96
99
  return !e.active;
97
100
  },
98
- onClick: () => M({
101
+ onClick: () => q({
99
102
  ...e.current,
100
103
  name: e.label("create")
101
104
  }),
102
105
  get children() {
103
106
  return e.label("create");
104
107
  }
105
- }), null), n(t, r($, {
108
+ }), null), l(t, n(k, {
106
109
  get when() {
107
110
  return e.currentID;
108
111
  },
109
112
  get children() {
110
- return r(d, {
113
+ return n(v, {
111
114
  size: "icon",
112
- icon: ke,
115
+ icon: Te,
113
116
  get disabled() {
114
117
  return !e.active;
115
118
  },
@@ -120,12 +123,12 @@ function Xe(e) {
120
123
  get title() {
121
124
  return e.label("edit");
122
125
  },
123
- onClick: () => M(e.current, e.currentID)
126
+ onClick: () => q(e.current, e.currentID)
124
127
  });
125
128
  }
126
- }), null), n(t, r(d, {
129
+ }), null), l(t, n(v, {
127
130
  size: "icon",
128
- icon: Ce,
131
+ icon: xe,
129
132
  get disabled() {
130
133
  return !e.active;
131
134
  },
@@ -136,10 +139,10 @@ function Xe(e) {
136
139
  get title() {
137
140
  return e.label("import");
138
141
  },
139
- onClick: () => D.click()
140
- }), null), n(t, r(d, {
142
+ onClick: () => K.click()
143
+ }), null), l(t, n(v, {
141
144
  size: "icon",
142
- icon: Se,
145
+ icon: Ee,
143
146
  get disabled() {
144
147
  return !e.active;
145
148
  },
@@ -151,14 +154,14 @@ function Xe(e) {
151
154
  return e.label("export");
152
155
  },
153
156
  onClick: fe
154
- }), null), n(t, r($, {
157
+ }), null), l(t, n(k, {
155
158
  get when() {
156
159
  return e.generate;
157
160
  },
158
161
  get children() {
159
- return r(d, {
162
+ return n(v, {
160
163
  size: "sm",
161
- icon: xe,
164
+ icon: ie,
162
165
  get disabled() {
163
166
  return !e.active;
164
167
  },
@@ -170,48 +173,48 @@ function Xe(e) {
170
173
  });
171
174
  }
172
175
  }), null), t;
173
- })(), r($, {
176
+ })(), n(k, {
174
177
  get when() {
175
- return R(() => !!E())() && !F();
178
+ return B(() => !!N())() && !L();
176
179
  },
177
180
  get children() {
178
- var t = le();
179
- return n(t, E), t;
181
+ var t = ce();
182
+ return l(t, N), t;
180
183
  }
181
- }), r(Ne, {
184
+ }), n(Pe, {
182
185
  class: "floe-theme-studio",
183
186
  get open() {
184
- return R(() => !!e.active)() && F();
187
+ return B(() => !!e.active)() && L();
185
188
  },
186
189
  get title() {
187
- return e.label(Q() ? "edit" : "create");
190
+ return e.label(A() ? "edit" : "create");
188
191
  },
189
192
  get closeLabel() {
190
193
  return e.label("cancel");
191
194
  },
192
195
  onOpenChange: (t) => {
193
- s() || y(t);
196
+ u() || C(t);
194
197
  },
195
198
  get footer() {
196
- return [r(d, {
199
+ return [n(v, {
197
200
  variant: "ghost",
198
201
  get disabled() {
199
- return s();
202
+ return u();
200
203
  },
201
- onClick: () => y(!1),
204
+ onClick: () => C(!1),
202
205
  get children() {
203
206
  return e.label("cancel");
204
207
  }
205
- }), r(d, {
206
- icon: Le,
208
+ }), n(v, {
209
+ icon: Ne,
207
210
  get loading() {
208
- return s();
211
+ return u();
209
212
  },
210
213
  get disabled() {
211
- return !!N();
214
+ return !!R();
212
215
  },
213
216
  onClick: () => {
214
- ve();
217
+ he();
215
218
  },
216
219
  get children() {
217
220
  return e.label("save");
@@ -219,40 +222,76 @@ function Xe(e) {
219
222
  })];
220
223
  },
221
224
  get children() {
222
- var t = Ue(), i = t.firstChild, a = i.nextSibling, S = a.firstChild, A = S.nextSibling, J = a.nextSibling, H = J.nextSibling, he = H.firstChild;
223
- return n(i, () => e.label("name"), null), n(i, r(Ie, {
225
+ var t = Me(), i = t.firstChild, o = i.nextSibling, x = o.firstChild, Q = x.nextSibling, F = o.nextSibling, V = F.nextSibling, _e = V.firstChild;
226
+ return l(i, () => e.label("name"), null), l(i, n(Ie, {
224
227
  maxLength: 80,
225
228
  get value() {
226
- return R(() => typeof P()?.name == "string")() ? P().name : "";
229
+ return B(() => typeof j()?.name == "string")() ? j().name : "";
227
230
  },
228
231
  get disabled() {
229
- return s() || !P();
232
+ return u() || !j();
230
233
  },
231
- onInput: (l) => {
232
- const o = P();
233
- o && z(JSON.stringify({
234
- ...o,
235
- name: l.currentTarget.value
234
+ onInput: (r) => {
235
+ const c = j();
236
+ c && y(JSON.stringify({
237
+ ...c,
238
+ name: r.currentTarget.value
236
239
  }, null, 2));
237
240
  }
238
- }), null), n(t, r($, {
241
+ }), null), l(t, n(k, {
242
+ get when() {
243
+ return !A();
244
+ },
245
+ get children() {
246
+ var r = De(), c = r.firstChild;
247
+ return c.addEventListener("change", (a) => {
248
+ const s = a.currentTarget.value;
249
+ (s === "light" || s === "dark") && G((b) => y(JSON.stringify({
250
+ ...b,
251
+ mode: s
252
+ }, null, 2)));
253
+ }), l(c, n(W, {
254
+ each: ["light", "dark"],
255
+ children: (a) => (() => {
256
+ var s = He();
257
+ return s.value = a, l(s, () => e.label(a)), s;
258
+ })()
259
+ })), l(r, n(v, {
260
+ size: "sm",
261
+ variant: "ghost",
262
+ get disabled() {
263
+ return u() || !g().doc;
264
+ },
265
+ onClick: () => G((a) => y(JSON.stringify(Be(a.mode, a.name), null, 2))),
266
+ get children() {
267
+ return e.label("blank");
268
+ }
269
+ }), null), O((a) => {
270
+ var s = e.label("settings"), b = u() || !g().doc;
271
+ return s !== a.e && $e(c, "aria-label", a.e = s), b !== a.t && (c.disabled = a.t = b), a;
272
+ }, {
273
+ e: void 0,
274
+ t: void 0
275
+ }), O(() => c.value = g().doc?.mode), r;
276
+ }
277
+ }), o), l(t, n(k, {
239
278
  get when() {
240
- return R(() => !!e.renderPreview)() && g();
279
+ return B(() => !!e.renderPreview)() && h();
241
280
  },
242
281
  get fallback() {
243
282
  return (() => {
244
- var l = Be(), o = l.firstChild, h = o.nextSibling, K = h.firstChild, _ = K.nextSibling, me = _.nextSibling;
245
- return n(me, r(re, {
283
+ var r = Ke(), c = r.firstChild, a = c.nextSibling, s = a.firstChild, b = s.nextSibling, ke = b.nextSibling;
284
+ return l(ke, n(W, {
246
285
  get each() {
247
- return g()?.preview?.colors;
286
+ return h()?.preview?.colors;
248
287
  },
249
- children: (c) => (() => {
250
- var x = De();
251
- return m(x, "background", c), x;
288
+ children: (d) => (() => {
289
+ var E = qe();
290
+ return w(E, "background", d), E;
252
291
  })()
253
- })), q((c) => {
254
- var x = g()?.preview?.background, X = g()?.semanticTokens?.["--foreground"], Y = g()?.preview?.border, Z = g()?.preview?.sidebar, p = g()?.preview?.surface, ee = g()?.preview?.primary;
255
- return x !== c.e && m(l, "background", c.e = x), X !== c.t && m(l, "color", c.t = X), Y !== c.a && m(l, "border-color", c.a = Y), Z !== c.o && m(o, "background", c.o = Z), p !== c.i && m(h, "background", c.i = p), ee !== c.n && m(_, "background", c.n = ee), c;
292
+ })), O((d) => {
293
+ var E = h()?.preview?.background, p = h()?.semanticTokens?.["--foreground"], ee = h()?.preview?.border, te = h()?.preview?.sidebar, ne = h()?.preview?.surface, re = h()?.preview?.primary;
294
+ return E !== d.e && w(r, "background", d.e = E), p !== d.t && w(r, "color", d.t = p), ee !== d.a && w(r, "border-color", d.a = ee), te !== d.o && w(c, "background", d.o = te), ne !== d.i && w(a, "background", d.i = ne), re !== d.n && w(b, "background", d.n = re), d;
256
295
  }, {
257
296
  e: void 0,
258
297
  t: void 0,
@@ -260,31 +299,31 @@ function Xe(e) {
260
299
  o: void 0,
261
300
  i: void 0,
262
301
  n: void 0
263
- }), l;
302
+ }), r;
264
303
  })();
265
304
  },
266
- children: (l) => e.renderPreview(l(), (o, h) => W({
267
- group: o,
268
- role: h
305
+ children: (r) => e.renderPreview(r(), (c, a) => Z({
306
+ group: c,
307
+ role: a
269
308
  }))
270
- }), a), n(S, () => e.label("colors")), n(A, r(re, {
271
- each: be,
272
- children: (l) => (() => {
273
- var o = Me(), h = o.firstChild;
274
- return h.$$input = (K) => {
275
- const _ = b().doc;
276
- _ && z(JSON.stringify({
277
- ..._,
309
+ }), o), l(x, () => e.label("colors")), l(Q, n(W, {
310
+ each: me,
311
+ children: (r) => (() => {
312
+ var c = Ge(), a = c.firstChild;
313
+ return a.$$input = (s) => {
314
+ const b = g().doc;
315
+ b && y(JSON.stringify({
316
+ ...b,
278
317
  colors: {
279
- ..._.colors,
280
- [`--${l}`]: K.currentTarget.value
318
+ ...b.colors,
319
+ [`--${r}`]: s.currentTarget.value
281
320
  }
282
321
  }, null, 2));
283
- }, n(o, () => e.label(l), null), q(() => h.value = g()?.semanticTokens?.[`--${l}`]?.slice(0, 7)), o;
322
+ }, l(c, () => e.label(r), null), O(() => a.value = h()?.semanticTokens?.[`--${r}`]?.slice(0, 7)), c;
284
323
  })()
285
- })), n(J, r(d, {
324
+ })), l(F, n(v, {
286
325
  size: "icon",
287
- icon: Te,
326
+ icon: Oe,
288
327
  variant: "ghost",
289
328
  get title() {
290
329
  return e.label("undo");
@@ -293,12 +332,12 @@ function Xe(e) {
293
332
  return e.label("undo");
294
333
  },
295
334
  get disabled() {
296
- return s() || !C().length;
335
+ return u() || !T().length;
297
336
  },
298
- onClick: se
299
- }), null), n(J, r(d, {
337
+ onClick: ge
338
+ }), null), l(F, n(v, {
300
339
  size: "icon",
301
- icon: Ee,
340
+ icon: Le,
302
341
  variant: "ghost",
303
342
  get title() {
304
343
  return e.label("redo");
@@ -307,12 +346,12 @@ function Xe(e) {
307
346
  return e.label("redo");
308
347
  },
309
348
  get disabled() {
310
- return s() || !L().length;
349
+ return u() || !J().length;
311
350
  },
312
- onClick: de
313
- }), null), n(J, r(d, {
351
+ onClick: ve
352
+ }), null), l(F, n(v, {
314
353
  size: "icon",
315
- icon: Oe,
354
+ icon: ze,
316
355
  variant: "ghost",
317
356
  get "aria-label"() {
318
357
  return e.label("compare");
@@ -321,16 +360,16 @@ function Xe(e) {
321
360
  return e.label("compare");
322
361
  },
323
362
  get "aria-pressed"() {
324
- return B();
363
+ return H();
325
364
  },
326
- onClick: () => V(!B())
327
- }), null), n(t, r($, {
365
+ onClick: () => Y(!H())
366
+ }), null), l(t, n(k, {
328
367
  get when() {
329
- return b().doc;
368
+ return g().doc;
330
369
  },
331
- children: (l) => r(je, {
370
+ children: (r) => n(Ue, {
332
371
  get document() {
333
- return l();
372
+ return r();
334
373
  },
335
374
  get parts() {
336
375
  return e.parts;
@@ -339,43 +378,61 @@ function Xe(e) {
339
378
  return e.features;
340
379
  },
341
380
  get inspect() {
342
- return ue();
381
+ return se();
343
382
  },
344
383
  get disabled() {
345
- return s();
384
+ return u();
346
385
  },
347
386
  get label() {
348
387
  return e.label;
349
388
  },
350
- invalid: U,
351
- update: (o) => z(JSON.stringify(o, null, 2))
389
+ invalid: M,
390
+ update: (c) => y(JSON.stringify(c, null, 2))
352
391
  })
353
- }), H), n(he, () => e.label("advanced")), n(H, r(ze, {
392
+ }), V), l(_e, () => e.label("advanced")), l(V, n(Je, {
354
393
  get "aria-label"() {
355
394
  return e.label("advanced");
356
395
  },
357
396
  get value() {
358
- return f();
397
+ return m();
359
398
  },
360
399
  rows: 9,
361
400
  spellcheck: !1,
362
401
  get disabled() {
363
- return s();
402
+ return u();
364
403
  },
365
- onInput: (l) => z(l.currentTarget.value)
366
- }), null), n(t, r($, {
404
+ onInput: (r) => y(r.currentTarget.value)
405
+ }), null), l(t, n(k, {
406
+ get when() {
407
+ return e.generate;
408
+ },
409
+ get children() {
410
+ return n(v, {
411
+ icon: ie,
412
+ size: "sm",
413
+ variant: "ghost",
414
+ get disabled() {
415
+ return !g().doc || !!D() || u();
416
+ },
417
+ onClick: () => G((r) => e.generate?.(r)),
418
+ get children() {
419
+ return e.label("generate");
420
+ }
421
+ });
422
+ }
423
+ }), null), l(t, n(k, {
367
424
  get when() {
368
- return E() || N();
425
+ return N() || R();
369
426
  },
370
427
  get children() {
371
- var l = le();
372
- return n(l, () => E() || `${e.label("invalid")}: ${N()}`), l;
428
+ var r = ce();
429
+ return l(r, () => N() || `${e.label("invalid")}: ${R()}`), r;
373
430
  }
374
- }), null), q(() => a.disabled = s() || !b().doc), t;
431
+ }), null), O(() => o.disabled = u() || !g().doc), t;
375
432
  }
376
433
  })];
377
434
  }
378
- $e(["input"]);
435
+ ye(["input"]);
379
436
  export {
380
- Xe as ThemeStudio
437
+ tt as ThemeStudio
381
438
  };
@@ -27,4 +27,5 @@ export declare function exportShellTheme(preset: FloeThemePreset): PortableShell
27
27
  export declare function readPortableShellTheme(source: unknown): PortableShellTheme;
28
28
  export declare function portableContrastIssue(doc: PortableShellTheme): string | undefined;
29
29
  export declare function resolvePortableShellTheme(id: string, input: PortableShellTheme): FloeThemePreset;
30
+ export declare function createBlankShellTheme(mode: 'light' | 'dark', name: string): PortableShellTheme;
30
31
  export {};
@@ -1,10 +1,10 @@
1
- import { builtInShellThemePresets as z, REQUIRED_SHELL_THEME_TOKENS as N } from "./presets.js";
2
- import { resolveFloeThemeDocument as v, readFloeThemeDocument as M } from "./themeDocument.js";
3
- const x = 128 * 1024, h = "--floe-window-shadow", C = [
1
+ import { builtInShellThemePresets as z, REQUIRED_SHELL_THEME_TOKENS as M } from "./presets.js";
2
+ import { resolveFloeThemeDocument as C, readFloeThemeDocument as F } from "./themeDocument.js";
3
+ const O = 128 * 1024, h = "--floe-window-shadow", B = [
4
4
  ...new Set(
5
5
  z.flatMap((t) => Object.keys(t.semanticTokens ?? {}))
6
6
  )
7
- ].filter((t) => t !== h).sort(), j = new Set(C), T = [
7
+ ].filter((t) => t !== h).sort(), T = new Set(B), A = [
8
8
  "background",
9
9
  "foreground",
10
10
  "cursor",
@@ -15,7 +15,7 @@ const x = 128 * 1024, h = "--floe-window-shadow", C = [
15
15
  t,
16
16
  `bright${t[0].toUpperCase()}${t.slice(1)}`
17
17
  ])
18
- ], F = /* @__PURE__ */ new Set([
18
+ ], I = /* @__PURE__ */ new Set([
19
19
  "--background",
20
20
  "--foreground",
21
21
  "--primary",
@@ -31,39 +31,42 @@ const x = 128 * 1024, h = "--floe-window-shadow", C = [
31
31
  "--warning",
32
32
  "--error",
33
33
  "--info"
34
- ]), I = N.filter((t) => t !== h), R = /^(?:100(?:\.0+)?|\d{1,2}(?:\.\d+)?)%$/, A = /^#[a-f\d]{6}(?:[a-f\d]{2})?$/i, E = /^rgb\((?:\d{1,3} ){2}\d{1,3}(?: \/ (?:100|\d{1,2})%)?\)$/, B = /^(?:hsl\(\d{1,3} \d{1,3}% \d{1,3}%\)|oklch\((?:0(?:\.\d+)?|1) 0(?:\.\d+)? \d{1,3}\))$/, L = /^var\((--[a-z0-9-]+)\)$/, _ = /^color-mix\(in srgb, (var\(--[a-z0-9-]+\)|#[a-fA-F0-9]{6}) (\d{1,3}%), (var\(--[a-z0-9-]+\)|white|#[a-fA-F0-9]{6})\)$/, a = (t) => {
34
+ ]), R = M.filter((t) => t !== h), L = /^(?:100(?:\.0+)?|\d{1,2}(?:\.\d+)?)%$/, S = /^#[a-f\d]{6}(?:[a-f\d]{2})?$/i, E = /^rgb\((?:\d{1,3} ){2}\d{1,3}(?: \/ (?:100|\d{1,2})%)?\)$/, W = /^(?:hsl\(\d{1,3} \d{1,3}% \d{1,3}%\)|oklch\((?:0(?:\.\d+)?|1) 0(?:\.\d+)? \d{1,3}\))$/, _ = /^var\((--[a-z0-9-]+)\)$/, K = /^color-mix\(in srgb, (var\(--[a-z0-9-]+\)|#[a-fA-F0-9]{6}) (\d{1,3}%), (var\(--[a-z0-9-]+\)|white|#[a-fA-F0-9]{6})\)$/, c = (t) => {
35
35
  throw new Error(t);
36
- }, w = (t) => !!t && typeof t == "object" && !Array.isArray(t), O = (t, r, n) => {
37
- for (const s of Object.keys(t))
38
- r.includes(s) || a(`${n}.${s.slice(0, 80)}`);
36
+ }, w = (t) => !!t && typeof t == "object" && !Array.isArray(t), x = (t, r, o) => {
37
+ for (const n of Object.keys(t))
38
+ r.includes(n) || c(`${o}.${n.slice(0, 80)}`);
39
39
  }, $ = (t) => t === 0 ? "0" : `${t}px`;
40
- function K(t) {
40
+ function P(t) {
41
41
  return t === "none" ? [] : t.split(", ").map((r) => {
42
- const n = /^(-?\d+)(?:px)? (-?\d+)(?:px)? (\d+)(?:px)?(?: (-?\d+)(?:px)?)? (.+)$/.exec(
42
+ const o = /^(-?\d+)(?:px)? (-?\d+)(?:px)? (\d+)(?:px)?(?: (-?\d+)(?:px)?)? (.+)$/.exec(
43
43
  r
44
44
  );
45
- return n ? {
46
- x: +n[1],
47
- y: +n[2],
48
- blur: +n[3],
49
- spread: Number(n[4] ?? 0),
50
- color: n[5]
51
- } : a(h);
45
+ return o ? {
46
+ x: +o[1],
47
+ y: +o[2],
48
+ blur: +o[3],
49
+ spread: Number(o[4] ?? 0),
50
+ color: o[5]
51
+ } : c(h);
52
52
  });
53
53
  }
54
- function P(t) {
55
- const r = t.mode;
56
- if (r !== "light" && r !== "dark") return a("mode");
57
- const n = t.monaco?.[r];
58
- if (!n) return a("editor");
59
- const s = Object.fromEntries(
54
+ const N = /* @__PURE__ */ new WeakMap();
55
+ function v(t) {
56
+ const r = N.get(t);
57
+ if (r) return structuredClone(r);
58
+ const o = t.mode;
59
+ if (o !== "light" && o !== "dark") return c("mode");
60
+ const n = t.monaco?.[o];
61
+ if (!n) return c("editor");
62
+ const a = Object.fromEntries(
60
63
  Object.entries(t.semanticTokens ?? {}).filter(
61
- (i) => typeof i[1] == "string"
64
+ (f) => typeof f[1] == "string"
62
65
  )
63
- ), d = K(s[h] ?? "none");
64
- delete s[h];
65
- const c = { ...n.colors };
66
- for (const [i, f] of Object.entries({
66
+ ), d = P(a[h] ?? "none");
67
+ delete a[h];
68
+ const i = { ...n.colors };
69
+ for (const [f, u] of Object.entries({
67
70
  "editor.background": "background",
68
71
  "editorGutter.background": "background",
69
72
  "editor.foreground": "foreground",
@@ -71,86 +74,86 @@ function P(t) {
71
74
  "editor.selectionBackground": "selection-bg",
72
75
  "editor.selectionForeground": "selection-fg"
73
76
  }))
74
- c[i] === s[`--${f}`] && (c[i] = `@${f}`);
77
+ i[f] === a[`--${u}`] && (i[f] = `@${u}`);
75
78
  return {
76
79
  version: 2,
77
80
  name: t.displayName,
78
- mode: r,
81
+ mode: o,
79
82
  features: [...t.features ?? []],
80
83
  palette: {},
81
- colors: s,
84
+ colors: a,
82
85
  shadow: d,
83
- editor: c,
84
- syntax: n.rules.map((i) => ({ ...i }))
86
+ editor: i,
87
+ syntax: n.rules.map((f) => ({ ...f }))
85
88
  };
86
89
  }
87
- function b(t, r, n, s) {
88
- return !w(t) || Object.keys(t).length > s ? a(r) : Object.fromEntries(
89
- Object.entries(t).map(([d, c]) => !n(d) || typeof c != "string" || c.length > 256 ? a(`${r}.${d.slice(0, 80)}`) : [d, c])
90
+ function b(t, r, o, n) {
91
+ return !w(t) || Object.keys(t).length > n ? c(r) : Object.fromEntries(
92
+ Object.entries(t).map(([a, d]) => !o(a) || typeof d != "string" || d.length > 256 ? c(`${r}.${a.slice(0, 80)}`) : [a, d])
90
93
  );
91
94
  }
92
- function S(t) {
93
- const r = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), s = (e, o) => {
95
+ function j(t) {
96
+ const r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), n = (e, s) => {
94
97
  if (!e.startsWith("$") && !e.startsWith("@")) return e;
95
98
  const m = r.get(e);
96
99
  if (m !== void 0) return m;
97
100
  const l = e.startsWith("$") ? t.palette : t.colors, y = (e.startsWith("@") ? "--" : "") + e.slice(1);
98
- if (!Object.hasOwn(l, y) || n.has(e)) return a(`${o}: ${e}`);
99
- n.add(e);
100
- const p = s(l[y], o);
101
- return n.delete(e), r.set(e, p), p;
102
- }, d = (e, o, m) => {
103
- const l = s(e, o);
104
- return A.test(l) || m && (E.test(l) || B.test(l) || L.test(l) || _.test(l)) ? l : a(o);
101
+ if (!Object.hasOwn(l, y) || o.has(e)) return c(`${s}: ${e}`);
102
+ o.add(e);
103
+ const p = n(l[y], s);
104
+ return o.delete(e), r.set(e, p), p;
105
+ }, a = (e, s, m) => {
106
+ const l = n(e, s);
107
+ return S.test(l) || m && (E.test(l) || W.test(l) || _.test(l) || K.test(l)) ? l : c(s);
105
108
  };
106
- for (const [e, o] of Object.entries(t.palette)) d(o, `palette.${e}`, !1);
107
- const c = Object.fromEntries(
108
- Object.entries(t.colors).map(([e, o]) => [
109
+ for (const [e, s] of Object.entries(t.palette)) a(s, `palette.${e}`, !1);
110
+ const d = Object.fromEntries(
111
+ Object.entries(t.colors).map(([e, s]) => [
109
112
  e,
110
- e === "--floe-progress-primary-white-mix" ? R.test(o) ? o : a(e) : d(o, `colors.${e}`, !F.has(e))
113
+ e === "--floe-progress-primary-white-mix" ? L.test(s) ? s : c(e) : a(s, `colors.${e}`, !I.has(e))
111
114
  ])
112
115
  );
113
- for (const [e, o] of Object.entries(t.terminal ?? {}))
114
- c[`--terminal-${e.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)}`] = d(
115
- o,
116
+ for (const [e, s] of Object.entries(t.terminal ?? {}))
117
+ d[`--terminal-${e.replace(/[A-Z]/g, (m) => `-${m.toLowerCase()}`)}`] = a(
118
+ s,
116
119
  `terminal.${e}`,
117
120
  !1
118
121
  );
119
- for (const [e, o] of Object.entries(t.parts ?? {}))
120
- c[`--theme-part-${e}`] = d(o, `parts.${e}`, !1);
122
+ for (const [e, s] of Object.entries(t.parts ?? {}))
123
+ d[`--theme-part-${e}`] = a(s, `parts.${e}`, !1);
121
124
  const i = /* @__PURE__ */ new Set(), f = (e) => {
122
125
  if (!i.has(e)) {
123
- (n.has(e) || !Object.hasOwn(c, e)) && a(`colors.${e}`), n.add(e);
124
- for (const o of c[e].matchAll(/var\((--[a-z0-9-]+)\)/g)) f(o[1]);
125
- n.delete(e), i.add(e);
126
+ (o.has(e) || !Object.hasOwn(d, e)) && c(`colors.${e}`), o.add(e);
127
+ for (const s of d[e].matchAll(/var\((--[a-z0-9-]+)\)/g)) f(s[1]);
128
+ o.delete(e), i.add(e);
126
129
  }
127
130
  };
128
- for (const e of Object.keys(c)) f(e);
129
- c[h] = t.shadow.map(({ x: e, y: o, blur: m, spread: l, color: y }, p) => {
130
- const k = s(y, `shadow.${p}.color`);
131
- return !A.test(k) && !E.test(k) && a(`shadow.${p}.color`), [
131
+ for (const e of Object.keys(d)) f(e);
132
+ d[h] = t.shadow.map(({ x: e, y: s, blur: m, spread: l, color: y }, p) => {
133
+ const k = n(y, `shadow.${p}.color`);
134
+ return !S.test(k) && !E.test(k) && c(`shadow.${p}.color`), [
132
135
  $(e),
133
- $(o),
136
+ $(s),
134
137
  $(m),
135
138
  ...l ? [$(l)] : [],
136
139
  k
137
140
  ].join(" ");
138
141
  }).join(", ") || "none";
139
142
  const u = Object.fromEntries(
140
- Object.entries(t.editor).map(([e, o]) => [e, d(o, `editor.${e}`, !1)])
141
- ), g = t.syntax.map((e, o) => {
142
- const m = d(e.foreground, `syntax.${o}.foreground`, !1);
143
- return m.length !== 7 && a(`syntax.${o}.foreground`), { ...e, foreground: m };
143
+ Object.entries(t.editor).map(([e, s]) => [e, a(s, `editor.${e}`, !1)])
144
+ ), g = t.syntax.map((e, s) => {
145
+ const m = a(e.foreground, `syntax.${s}.foreground`, !1);
146
+ return m.length !== 7 && c(`syntax.${s}.foreground`), { ...e, foreground: m };
144
147
  });
145
- return { tokens: c, editor: u, syntax: g };
148
+ return { tokens: d, editor: u, syntax: g };
146
149
  }
147
- function W(t) {
148
- typeof t == "string" && (t.length > x || new TextEncoder().encode(t).length > x) && a("128 KiB");
150
+ function D(t) {
151
+ typeof t == "string" && (t.length > O || new TextEncoder().encode(t).length > O) && c("128 KiB");
149
152
  const r = typeof t == "string" ? JSON.parse(t) : t;
150
- if (!w(r)) return a("theme");
153
+ if (!w(r)) return c("theme");
151
154
  if (r.version === 1)
152
- return P(v("migration", M(r)));
153
- if (O(
155
+ return v(C("migration", F(r)));
156
+ if (x(
154
157
  r,
155
158
  [
156
159
  "version",
@@ -166,37 +169,37 @@ function W(t) {
166
169
  "parts"
167
170
  ],
168
171
  "theme"
169
- ), r.version !== 2) return a("version");
172
+ ), r.version !== 2) return c("version");
170
173
  if (typeof r.name != "string" || !r.name.trim() || r.name.length > 80 || /[\p{Cc}\p{Cf}]/u.test(r.name))
171
- return a("name");
172
- if (r.mode !== "light" && r.mode !== "dark") return a("mode");
174
+ return c("name");
175
+ if (r.mode !== "light" && r.mode !== "dark") return c("mode");
173
176
  if (!Array.isArray(r.features) || r.features.length > 32 || r.features.some(
174
177
  (e) => typeof e != "string" || !/^[a-z][a-z0-9-]{0,63}$/.test(e)
175
178
  ) || new Set(r.features).size !== r.features.length)
176
- return a("features");
177
- const n = b(
179
+ return c("features");
180
+ const o = b(
178
181
  r.palette,
179
182
  "palette",
180
183
  (e) => /^[a-z][a-z0-9-]{0,63}$/.test(e),
181
184
  256
182
- ), s = b(r.colors, "colors", (e) => j.has(e), j.size);
183
- for (const e of I) Object.hasOwn(s, e) || a(`colors.${e}`);
184
- if (!Array.isArray(r.shadow) || r.shadow.length > 8) return a("shadow");
185
- const d = r.shadow.map((e, o) => {
186
- if (!w(e)) return a(`shadow.${o}`);
187
- O(e, ["x", "y", "blur", "spread", "color"], `shadow.${o}`);
185
+ ), n = b(r.colors, "colors", (e) => T.has(e), T.size);
186
+ for (const e of R) Object.hasOwn(n, e) || c(`colors.${e}`);
187
+ if (!Array.isArray(r.shadow) || r.shadow.length > 8) return c("shadow");
188
+ const a = r.shadow.map((e, s) => {
189
+ if (!w(e)) return c(`shadow.${s}`);
190
+ x(e, ["x", "y", "blur", "spread", "color"], `shadow.${s}`);
188
191
  for (const m of ["x", "y", "blur", "spread"]) {
189
192
  const l = e[m];
190
- (typeof l != "number" || !Number.isFinite(l) || Math.abs(l) > 256 || m === "blur" && l < 0) && a(`shadow.${o}.${m}`);
193
+ (typeof l != "number" || !Number.isFinite(l) || Math.abs(l) > 256 || m === "blur" && l < 0) && c(`shadow.${s}.${m}`);
191
194
  }
192
- return typeof e.color != "string" || e.color.length > 100 ? a(`shadow.${o}.color`) : {
195
+ return typeof e.color != "string" || e.color.length > 100 ? c(`shadow.${s}.color`) : {
193
196
  x: Number(e.x),
194
197
  y: Number(e.y),
195
198
  blur: Number(e.blur),
196
199
  spread: Number(e.spread),
197
200
  color: e.color
198
201
  };
199
- }), c = b(
202
+ }), d = b(
200
203
  r.editor,
201
204
  "editor",
202
205
  (e) => /^[a-zA-Z][\w-]{0,79}(?:\.[\w-]{1,80}){1,5}$/.test(e),
@@ -204,11 +207,11 @@ function W(t) {
204
207
  ), i = r.terminal === void 0 ? void 0 : b(
205
208
  r.terminal,
206
209
  "terminal",
207
- (e) => T.includes(e),
208
- T.length
210
+ (e) => A.includes(e),
211
+ A.length
209
212
  ), f = r.parts === void 0 ? void 0 : b(r.parts, "parts", (e) => /^[a-z][a-z0-9-]{0,79}$/.test(e), 256);
210
- if (!Array.isArray(r.syntax) || r.syntax.length > 512) return a("syntax");
211
- const u = r.syntax.map((e, o) => !w(e) || typeof e.token != "string" || !/^[\w.-]{0,128}$/.test(e.token) || typeof e.foreground != "string" || e.foreground.length > 128 ? a(`syntax.${o}`) : (O(e, ["token", "foreground", "fontStyle"], `syntax.${o}`), e.fontStyle !== void 0 && (typeof e.fontStyle != "string" || !/^(?:(?:bold|italic|underline|strikethrough)(?: |$)){0,4}$/.test(e.fontStyle)) ? a(`syntax.${o}.fontStyle`) : {
213
+ if (!Array.isArray(r.syntax) || r.syntax.length > 512) return c("syntax");
214
+ const u = r.syntax.map((e, s) => !w(e) || typeof e.token != "string" || !/^[\w.-]{0,128}$/.test(e.token) || typeof e.foreground != "string" || e.foreground.length > 128 ? c(`syntax.${s}`) : (x(e, ["token", "foreground", "fontStyle"], `syntax.${s}`), e.fontStyle !== void 0 && (typeof e.fontStyle != "string" || !/^(?:(?:bold|italic|underline|strikethrough)(?: |$)){0,4}$/.test(e.fontStyle)) ? c(`syntax.${s}.fontStyle`) : {
212
215
  token: e.token,
213
216
  foreground: e.foreground,
214
217
  ...typeof e.fontStyle == "string" ? { fontStyle: e.fontStyle } : {}
@@ -217,73 +220,84 @@ function W(t) {
217
220
  name: r.name.trim(),
218
221
  mode: r.mode,
219
222
  features: [...r.features],
220
- palette: n,
221
- colors: s,
222
- shadow: d,
223
- editor: c,
223
+ palette: o,
224
+ colors: n,
225
+ shadow: a,
226
+ editor: d,
224
227
  syntax: u,
225
228
  ...i && { terminal: i },
226
229
  ...f && { parts: f }
227
230
  };
228
231
  return new TextEncoder().encode(JSON.stringify(g, null, 2) + `
229
- `).length > x && a("128 KiB"), S(g), g;
232
+ `).length > O && c("128 KiB"), j(g), g;
230
233
  }
231
- function J(t) {
232
- const { tokens: r } = S(t), n = (i) => [1, 3, 5, 7].map(
234
+ function U(t) {
235
+ const { tokens: r } = j(t), o = (i) => [1, 3, 5, 7].map(
233
236
  (f, u) => u === 3 && i.length === 7 ? 1 : parseInt(i.slice(f, f + 2), 16) / 255
234
- ), s = (i, f) => i.slice(0, 3).map((u, g) => u * i[3] + f[g] * (1 - i[3])), d = (i) => i.reduce(
237
+ ), n = (i, f) => i.slice(0, 3).map((u, g) => u * i[3] + f[g] * (1 - i[3])), a = (i) => i.reduce(
235
238
  (f, u, g) => f + [0.2126, 0.7152, 0.0722][g] * (u <= 0.04045 ? u / 12.92 : ((u + 0.055) / 1.055) ** 2.4),
236
239
  0
237
- ), c = s(n(r["--background"]), Array(3).fill(t.mode === "light" ? 1 : 0));
240
+ ), d = n(o(r["--background"]), Array(3).fill(t.mode === "light" ? 1 : 0));
238
241
  for (const [i, f] of [
239
242
  ["--background", "--foreground"],
240
243
  ["--card", "--card-foreground"],
241
244
  ["--primary", "--primary-foreground"],
242
245
  ["--sidebar", "--sidebar-foreground"]
243
246
  ]) {
244
- const u = i === "--background" ? c : s(n(r[i]), c), g = d(u), e = d(s(n(r[f]), u)), o = (Math.max(g, e) + 0.05) / (Math.min(g, e) + 0.05);
245
- if (o < 4.5) return `${f} / ${i}: ${o.toFixed(2)}:1 < 4.5:1`;
247
+ const u = i === "--background" ? d : n(o(r[i]), d), g = a(u), e = a(n(o(r[f]), u)), s = (Math.max(g, e) + 0.05) / (Math.min(g, e) + 0.05);
248
+ if (s < 4.5) return `${f} / ${i}: ${s.toFixed(2)}:1 < 4.5:1`;
246
249
  }
247
250
  }
248
- function U(t, r) {
249
- const n = W(r), { tokens: s, editor: d, syntax: c } = S(n);
250
- return {
251
+ function Z(t, r) {
252
+ const o = D(r), { tokens: n, editor: a, syntax: d } = j(o), i = {
251
253
  name: t,
252
- displayName: n.name,
253
- mode: n.mode,
254
- features: n.features,
255
- semanticTokens: s,
256
- tokens: { [n.mode]: s },
254
+ displayName: o.name,
255
+ mode: o.mode,
256
+ features: o.features,
257
+ semanticTokens: n,
258
+ tokens: { [o.mode]: n },
257
259
  preview: {
258
- background: s["--background"],
259
- surface: s["--card"],
260
- sidebar: s["--sidebar"],
261
- primary: s["--primary"],
262
- border: s["--border"],
260
+ background: n["--background"],
261
+ surface: n["--card"],
262
+ sidebar: n["--sidebar"],
263
+ primary: n["--primary"],
264
+ border: n["--border"],
263
265
  colors: [
264
- s["--chart-1"],
265
- s["--chart-2"],
266
- s["--chart-3"],
267
- s["--chart-4"],
268
- s["--chart-5"]
266
+ n["--chart-1"],
267
+ n["--chart-2"],
268
+ n["--chart-3"],
269
+ n["--chart-4"],
270
+ n["--chart-5"]
269
271
  ]
270
272
  },
271
273
  monaco: {
272
- [n.mode]: {
273
- base: n.mode === "light" ? "vs" : "vs-dark",
274
+ [o.mode]: {
275
+ base: o.mode === "light" ? "vs" : "vs-dark",
274
276
  inherit: !0,
275
- colors: d,
276
- rules: c
277
+ colors: a,
278
+ rules: d
277
279
  }
278
280
  }
279
281
  };
282
+ return N.set(i, o), i;
283
+ }
284
+ function q(t, r) {
285
+ const o = z.find((a) => a.mode === t && a.inheritsBaseTokens), n = v(o);
286
+ n.name = r;
287
+ for (const [a, d] of Object.entries(n.colors)) {
288
+ if (!S.test(d)) continue;
289
+ const i = a.slice(2);
290
+ n.palette[i] = d, n.colors[a] = `$${i}`;
291
+ }
292
+ return n;
280
293
  }
281
294
  export {
282
- x as PORTABLE_THEME_LIMIT,
283
- P as exportShellTheme,
284
- J as portableContrastIssue,
285
- W as readPortableShellTheme,
286
- U as resolvePortableShellTheme,
287
- C as shellColorRoles,
288
- T as terminalThemeRoles
295
+ O as PORTABLE_THEME_LIMIT,
296
+ q as createBlankShellTheme,
297
+ v as exportShellTheme,
298
+ U as portableContrastIssue,
299
+ D as readPortableShellTheme,
300
+ Z as resolvePortableShellTheme,
301
+ B as shellColorRoles,
302
+ A as terminalThemeRoles
289
303
  };
package/dist/themes.js CHANGED
@@ -1,24 +1,25 @@
1
1
  import { FLOE_THEME_FILE_LIMIT as o, floeThemeContrastIssue as r, readFloeThemeDocument as t, resolveFloeThemeDocument as s } from "./styles/themes/themeDocument.js";
2
- import { PORTABLE_THEME_LIMIT as m, exportShellTheme as h, portableContrastIssue as E, readPortableShellTheme as S, resolvePortableShellTheme as a, shellColorRoles as _, terminalThemeRoles as I } from "./styles/themes/portableTheme.js";
3
- import { BUILT_IN_SHELL_THEME_DEFAULTS as n, REQUIRED_SHELL_THEME_TOKENS as p, assertUniqueThemePresetNames as M, builtInShellThemePresets as u, getShellThemePresetsForMode as P, normalizeShellThemeSelection as F, presetSupportsMode as H, resolveShellThemePresetName as i } from "./styles/themes/presets.js";
2
+ import { PORTABLE_THEME_LIMIT as h, createBlankShellTheme as m, exportShellTheme as E, portableContrastIssue as a, readPortableShellTheme as S, resolvePortableShellTheme as _, shellColorRoles as I, terminalThemeRoles as L } from "./styles/themes/portableTheme.js";
3
+ import { BUILT_IN_SHELL_THEME_DEFAULTS as p, REQUIRED_SHELL_THEME_TOKENS as M, assertUniqueThemePresetNames as u, builtInShellThemePresets as P, getShellThemePresetsForMode as F, normalizeShellThemeSelection as H, presetSupportsMode as i, resolveShellThemePresetName as R } from "./styles/themes/presets.js";
4
4
  export {
5
- n as BUILT_IN_SHELL_THEME_DEFAULTS,
5
+ p as BUILT_IN_SHELL_THEME_DEFAULTS,
6
6
  o as FLOE_THEME_FILE_LIMIT,
7
- m as PORTABLE_THEME_LIMIT,
8
- p as REQUIRED_SHELL_THEME_TOKENS,
9
- M as assertUniqueThemePresetNames,
10
- u as builtInShellThemePresets,
11
- h as exportShellTheme,
7
+ h as PORTABLE_THEME_LIMIT,
8
+ M as REQUIRED_SHELL_THEME_TOKENS,
9
+ u as assertUniqueThemePresetNames,
10
+ P as builtInShellThemePresets,
11
+ m as createBlankShellTheme,
12
+ E as exportShellTheme,
12
13
  r as floeThemeContrastIssue,
13
- P as getShellThemePresetsForMode,
14
- F as normalizeShellThemeSelection,
15
- E as portableContrastIssue,
16
- H as presetSupportsMode,
14
+ F as getShellThemePresetsForMode,
15
+ H as normalizeShellThemeSelection,
16
+ a as portableContrastIssue,
17
+ i as presetSupportsMode,
17
18
  t as readFloeThemeDocument,
18
19
  S as readPortableShellTheme,
19
20
  s as resolveFloeThemeDocument,
20
- a as resolvePortableShellTheme,
21
- i as resolveShellThemePresetName,
22
- _ as shellColorRoles,
23
- I as terminalThemeRoles
21
+ _ as resolvePortableShellTheme,
22
+ R as resolveShellThemePresetName,
23
+ I as shellColorRoles,
24
+ L as terminalThemeRoles
24
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.102.0",
3
+ "version": "0.102.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",