@floegence/floe-webapp-core 0.36.15 → 0.36.16

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,204 +1,257 @@
1
- import { spread as G, insert as u, createComponent as _, memo as V, effect as K, setAttribute as T, style as q, template as O, use as U, delegateEvents as J } from "solid-js/web";
2
- import { createSignal as H, onCleanup as Q, untrack as x, createMemo as y } from "solid-js";
3
- import { startHotInteraction as A } from "../../utils/hotInteraction.js";
4
- import { GripVertical as Z, X as p } from "../icons/index.js";
5
- import { WORKBENCH_WIDGET_SHELL_ATTR as tt, resolveWorkbenchWidgetEventOwnership as et } from "../ui/localInteractionSurface.js";
6
- import { createWorkbenchWidgetSurfaceMetrics as it } from "./workbenchHelpers.js";
7
- var nt = /* @__PURE__ */ O('<article class=workbench-widget data-floe-dialog-surface-host=true tabindex=0><header class=workbench-widget__header><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title></span></div><button type=button class=workbench-widget__close aria-label="Remove widget"data-floe-canvas-interactive=true></button></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), ot = /* @__PURE__ */ O('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
8
- const at = 220, rt = 160, dt = '[data-floe-canvas-interactive="true"]', lt = '[data-floe-canvas-pan-surface="true"]';
9
- function ft(t) {
10
- const [f, C] = H(null), [v, M] = H(null);
11
- let h, w, b;
12
- Q(() => {
13
- h?.abort(), h = void 0, w?.abort(), w = void 0, x(f)?.stopInteraction(), x(v)?.stopInteraction();
1
+ import { spread as O, mergeProps as tt, insert as c, createComponent as w, memo as et, template as G, use as it, delegateEvents as nt } from "solid-js/web";
2
+ import { createSignal as F, onCleanup as ot, untrack as M, createMemo as m } from "solid-js";
3
+ import { startHotInteraction as N } from "../../utils/hotInteraction.js";
4
+ import { X as j, Minus as B, Maximize as V, GripVertical as at } from "../icons/index.js";
5
+ import { CANVAS_WHEEL_INTERACTIVE_ATTR as rt, WORKBENCH_WIDGET_SHELL_ATTR as dt, resolveWorkbenchWidgetEventOwnership as lt } from "../ui/localInteractionSurface.js";
6
+ import { createWorkbenchWidgetSurfaceMetrics as ct } from "./workbenchHelpers.js";
7
+ var st = /* @__PURE__ */ G('<article class=workbench-widget data-floe-dialog-surface-host=true><header class=workbench-widget__header><span class=workbench-widget__traffic role=group aria-label="Window controls"><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--close"aria-label="Close widget"title="Close widget"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button></span><span class=workbench-widget__badge aria-hidden=true></span><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title-dot aria-hidden=true></span><span class=workbench-widget__title></span></div><span class=workbench-widget__window-controls role=group aria-label="Window controls"><button type=button class="workbench-widget__window-control workbench-widget__window-control--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--close"aria-label="Remove widget"title="Remove widget"data-floe-canvas-interactive=true></button></span></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), wt = /* @__PURE__ */ G('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
8
+ const gt = 220, ht = 160, ut = '[data-floe-canvas-interactive="true"]', bt = '[data-floe-canvas-pan-surface="true"]';
9
+ function kt(t) {
10
+ const [v, y] = F(null), [$, C] = F(null);
11
+ let u, b, _;
12
+ ot(() => {
13
+ u?.abort(), u = void 0, b?.abort(), b = void 0, M(v)?.stopInteraction(), M($)?.stopInteraction();
14
14
  });
15
- const S = () => f() !== null, W = () => v() !== null, $ = (i) => et({
16
- target: i,
17
- widgetRoot: b ?? null,
18
- interactiveSelector: dt,
19
- panSurfaceSelector: lt
20
- }), P = (i) => {
21
- i.button === 0 && (t.onSelect(t.widgetId), t.onCommitFront(t.widgetId), $(i.target) === "widget_shell" && b?.focus({
15
+ const E = () => v() !== null, R = () => $() !== null, z = (e) => lt({
16
+ target: e,
17
+ widgetRoot: _ ?? null,
18
+ interactiveSelector: ut,
19
+ panSurfaceSelector: bt
20
+ }), Z = (e) => {
21
+ e.button === 0 && (t.onSelect(t.widgetId), t.onCommitFront(t.widgetId), z(e.target) === "widget_shell" && _?.focus({
22
22
  preventScroll: !0
23
23
  }));
24
- }, m = y(() => {
25
- const i = f();
26
- return i ? {
27
- x: i.worldX,
28
- y: i.worldY
24
+ }, I = m(() => {
25
+ const e = v();
26
+ return e ? {
27
+ x: e.worldX,
28
+ y: e.worldY
29
29
  } : {
30
30
  x: t.x,
31
31
  y: t.y
32
32
  };
33
- }), I = y(() => {
34
- const i = v();
35
- return i ? {
36
- width: i.width,
37
- height: i.height
33
+ }), k = m(() => {
34
+ const e = $();
35
+ return e ? {
36
+ width: e.width,
37
+ height: e.height
38
38
  } : {
39
39
  width: t.width,
40
40
  height: t.height
41
41
  };
42
- }), k = y(() => {
42
+ }), p = m(() => {
43
43
  if (!(t.layoutMode !== "projected_surface" || !t.projectedViewport))
44
- return it({
44
+ return ct({
45
45
  widgetId: t.widgetId,
46
- worldX: m().x,
47
- worldY: m().y,
48
- worldWidth: I().width,
49
- worldHeight: I().height,
46
+ worldX: I().x,
47
+ worldY: I().y,
48
+ worldWidth: k().width,
49
+ worldHeight: k().height,
50
50
  viewport: t.projectedViewport,
51
51
  ready: t.surfaceReady ?? !0
52
52
  });
53
- }), j = y(() => {
54
- const i = {
55
- width: `${I().width}px`,
56
- height: `${I().height}px`,
57
- "z-index": S() || W() || t.optimisticFront ? `${t.topRenderLayer + 1}` : `${t.renderLayer}`
53
+ }), q = m(() => {
54
+ const e = t.itemSnapshot().z_index, i = Number.isFinite(e) ? Math.max(1, Math.min(99, Math.round(e))) : 1;
55
+ return String(i).padStart(2, "0");
56
+ }), D = (e) => {
57
+ e.preventDefault(), e.stopPropagation(), t.onRequestOverview(t.itemSnapshot());
58
+ }, T = (e) => {
59
+ e.preventDefault(), e.stopPropagation(), t.onRequestFit(t.itemSnapshot());
60
+ }, X = (e) => {
61
+ e.preventDefault(), e.stopPropagation(), t.onRequestDelete(t.widgetId);
62
+ }, K = m(() => {
63
+ const e = {
64
+ width: `${k().width}px`,
65
+ height: `${k().height}px`,
66
+ "z-index": E() || R() || t.optimisticFront ? `${t.topRenderLayer + 1}` : `${t.renderLayer}`
58
67
  };
59
68
  if (t.layoutMode === "projected_surface") {
60
- const n = k()?.rect;
69
+ const i = p()?.rect;
61
70
  return {
62
- ...i,
63
- left: `${n?.screenX ?? 0}px`,
64
- top: `${n?.screenY ?? 0}px`,
65
- "--floe-workbench-projected-scale": `${n?.viewportScale ?? Math.max(t.viewportScale, 1e-3)}`
71
+ ...e,
72
+ left: `${i?.screenX ?? 0}px`,
73
+ top: `${i?.screenY ?? 0}px`,
74
+ "--floe-workbench-projected-scale": `${i?.viewportScale ?? Math.max(t.viewportScale, 1e-3)}`
66
75
  };
67
76
  }
68
77
  return {
69
- ...i,
70
- transform: `translate(${m().x}px, ${m().y}px)`
78
+ ...e,
79
+ transform: `translate(${I().x}px, ${I().y}px)`
71
80
  };
72
- }), E = (i) => {
73
- const n = x(f);
74
- if (!n) return;
75
- const a = {
76
- x: n.worldX,
77
- y: n.worldY
81
+ }), L = (e) => {
82
+ const i = M(v);
83
+ if (!i) return;
84
+ const d = {
85
+ x: i.worldX,
86
+ y: i.worldY
78
87
  }, r = {
79
- x: n.startWorldX,
80
- y: n.startWorldY
81
- }, s = i && (Math.abs(a.x - r.x) > 1 || Math.abs(a.y - r.y) > 1);
82
- t.onCommitFront(t.widgetId), s && t.onCommitMove(t.widgetId, a), n.stopInteraction(), C(null), h?.abort(), h = void 0;
83
- }, N = (i) => {
84
- if (i.button !== 0 || t.locked) return;
85
- i.preventDefault(), i.stopPropagation(), h?.abort(), t.onStartOptimisticFront(t.widgetId);
86
- const n = A({
88
+ x: i.startWorldX,
89
+ y: i.startWorldY
90
+ }, s = e && (Math.abs(d.x - r.x) > 1 || Math.abs(d.y - r.y) > 1);
91
+ t.onCommitFront(t.widgetId), s && t.onCommitMove(t.widgetId, d), i.stopInteraction(), y(null), u?.abort(), u = void 0;
92
+ }, Y = (e) => {
93
+ if (e.button !== 0 || t.locked) return;
94
+ e.preventDefault(), e.stopPropagation(), u?.abort(), t.onSelect(t.widgetId), _?.focus({
95
+ preventScroll: !0
96
+ }), t.onStartOptimisticFront(t.widgetId);
97
+ const i = N({
87
98
  kind: "drag",
88
99
  cursor: "grabbing"
89
- }), a = Math.max(t.viewportScale, 1e-3);
90
- C({
91
- pointerId: i.pointerId,
92
- startClientX: i.clientX,
93
- startClientY: i.clientY,
100
+ }), d = Math.max(t.viewportScale, 1e-3);
101
+ y({
102
+ pointerId: e.pointerId,
103
+ startClientX: e.clientX,
104
+ startClientY: e.clientY,
94
105
  startWorldX: t.x,
95
106
  startWorldY: t.y,
96
107
  worldX: t.x,
97
108
  worldY: t.y,
98
109
  moved: !1,
99
- scale: a,
100
- stopInteraction: n
110
+ scale: d,
111
+ stopInteraction: i
101
112
  });
102
- const r = (o) => {
103
- C((e) => {
104
- if (!e || e.pointerId !== o.pointerId) return e;
105
- const l = e.startWorldX + (o.clientX - e.startClientX) / e.scale, g = e.startWorldY + (o.clientY - e.startClientY) / e.scale;
113
+ const r = (a) => {
114
+ y((n) => {
115
+ if (!n || n.pointerId !== a.pointerId) return n;
116
+ const f = n.startWorldX + (a.clientX - n.startClientX) / n.scale, h = n.startWorldY + (a.clientY - n.startClientY) / n.scale;
106
117
  return {
107
- ...e,
108
- worldX: l,
109
- worldY: g,
110
- moved: e.moved || Math.abs(l - e.startWorldX) > 2 || Math.abs(g - e.startWorldY) > 2
118
+ ...n,
119
+ worldX: f,
120
+ worldY: h,
121
+ moved: n.moved || Math.abs(f - n.startWorldX) > 2 || Math.abs(h - n.startWorldY) > 2
111
122
  };
112
123
  });
113
- }, s = (o) => {
114
- o.pointerId === i.pointerId && E(!0);
115
- }, c = (o) => {
116
- o.pointerId === i.pointerId && E(!1);
117
- }, d = new AbortController();
118
- h = d, window.addEventListener("pointermove", r, {
119
- signal: d.signal
124
+ }, s = (a) => {
125
+ a.pointerId === e.pointerId && L(!0);
126
+ }, g = (a) => {
127
+ a.pointerId === e.pointerId && L(!1);
128
+ }, l = new AbortController();
129
+ u = l, window.addEventListener("pointermove", r, {
130
+ signal: l.signal
120
131
  }), window.addEventListener("pointerup", s, {
121
132
  once: !0,
122
- signal: d.signal
123
- }), window.addEventListener("pointercancel", c, {
133
+ signal: l.signal
134
+ }), window.addEventListener("pointercancel", g, {
124
135
  once: !0,
125
- signal: d.signal
136
+ signal: l.signal
126
137
  });
127
- }, L = (i) => {
128
- const n = x(v);
129
- if (!n) return;
130
- const a = {
131
- width: n.width,
132
- height: n.height
133
- }, r = Math.abs(n.width - n.startWidth) > 1 || Math.abs(n.height - n.startHeight) > 1;
134
- i && r && t.onCommitResize(t.widgetId, a), n.stopInteraction(), M(null), w?.abort(), w = void 0;
135
- }, F = (i) => {
136
- if (i.button !== 0 || t.locked) return;
137
- i.preventDefault(), i.stopPropagation(), w?.abort(), t.onStartOptimisticFront(t.widgetId);
138
- const n = A({
138
+ }, P = (e) => {
139
+ const i = M($);
140
+ if (!i) return;
141
+ const d = {
142
+ width: i.width,
143
+ height: i.height
144
+ }, r = Math.abs(i.width - i.startWidth) > 1 || Math.abs(i.height - i.startHeight) > 1;
145
+ e && r && t.onCommitResize(t.widgetId, d), i.stopInteraction(), C(null), b?.abort(), b = void 0;
146
+ }, U = (e) => {
147
+ if (e.button !== 0 || t.locked) return;
148
+ e.preventDefault(), e.stopPropagation(), b?.abort(), t.onStartOptimisticFront(t.widgetId);
149
+ const i = N({
139
150
  kind: "drag",
140
151
  cursor: "nwse-resize"
141
- }), a = Math.max(t.viewportScale, 1e-3);
142
- M({
143
- pointerId: i.pointerId,
144
- startClientX: i.clientX,
145
- startClientY: i.clientY,
152
+ }), d = Math.max(t.viewportScale, 1e-3);
153
+ C({
154
+ pointerId: e.pointerId,
155
+ startClientX: e.clientX,
156
+ startClientY: e.clientY,
146
157
  startWidth: t.width,
147
158
  startHeight: t.height,
148
159
  width: t.width,
149
160
  height: t.height,
150
- scale: a,
151
- stopInteraction: n
161
+ scale: d,
162
+ stopInteraction: i
152
163
  });
153
- const r = (o) => {
154
- M((e) => {
155
- if (!e || e.pointerId !== o.pointerId) return e;
156
- const l = Math.max(at, e.startWidth + (o.clientX - e.startClientX) / e.scale), g = Math.max(rt, e.startHeight + (o.clientY - e.startClientY) / e.scale);
164
+ const r = (a) => {
165
+ C((n) => {
166
+ if (!n || n.pointerId !== a.pointerId) return n;
167
+ const f = Math.max(gt, n.startWidth + (a.clientX - n.startClientX) / n.scale), h = Math.max(ht, n.startHeight + (a.clientY - n.startClientY) / n.scale);
157
168
  return {
158
- ...e,
159
- width: l,
160
- height: g
169
+ ...n,
170
+ width: f,
171
+ height: h
161
172
  };
162
173
  });
163
- }, s = (o) => {
164
- o.pointerId === i.pointerId && L(!0);
165
- }, c = (o) => {
166
- o.pointerId === i.pointerId && L(!1);
167
- }, d = new AbortController();
168
- w = d, window.addEventListener("pointermove", r, {
169
- signal: d.signal
174
+ }, s = (a) => {
175
+ a.pointerId === e.pointerId && P(!0);
176
+ }, g = (a) => {
177
+ a.pointerId === e.pointerId && P(!1);
178
+ }, l = new AbortController();
179
+ b = l, window.addEventListener("pointermove", r, {
180
+ signal: l.signal
170
181
  }), window.addEventListener("pointerup", s, {
171
182
  once: !0,
172
- signal: d.signal
173
- }), window.addEventListener("pointercancel", c, {
183
+ signal: l.signal
184
+ }), window.addEventListener("pointercancel", g, {
174
185
  once: !0,
175
- signal: d.signal
186
+ signal: l.signal
176
187
  });
177
188
  };
178
189
  return (() => {
179
- var i = nt(), n = i.firstChild, a = n.firstChild, r = a.nextSibling, s = r.firstChild, c = r.nextSibling, d = n.nextSibling;
180
- i.$$contextmenu = (e) => {
181
- $(e.target) === "widget_shell" && (e.preventDefault(), e.stopPropagation(), t.onContextMenu(e, t.itemSnapshot()));
182
- }, i.addEventListener("focus", () => {
183
- t.onSelect(t.widgetId);
184
- }), i.$$pointerdown = P;
185
- var o = b;
186
- return typeof o == "function" ? U(o, i) : b = i, G(n, {
187
- [tt]: "true"
188
- }, !1, !0), a.$$pointerdown = N, u(a, _(Z, {
190
+ var e = st(), i = e.firstChild, d = i.firstChild, r = d.firstChild, s = r.nextSibling, g = s.nextSibling, l = d.nextSibling, a = l.nextSibling, n = a.nextSibling, f = n.firstChild, h = f.nextSibling, J = n.nextSibling, S = J.firstChild, x = S.nextSibling, W = x.nextSibling, Q = i.nextSibling, H = _;
191
+ return typeof H == "function" ? it(H, e) : _ = e, O(e, tt({
192
+ get classList() {
193
+ return {
194
+ "is-selected": t.selected,
195
+ "is-dragging": E(),
196
+ "is-resizing": R(),
197
+ "is-filtered-out": t.filtered,
198
+ "is-projected-surface": t.layoutMode === "projected_surface",
199
+ "is-locked": t.locked
200
+ };
201
+ },
202
+ get "data-floe-workbench-widget-id"() {
203
+ return t.widgetId;
204
+ },
205
+ get "data-workbench-widget-type"() {
206
+ return t.widgetType;
207
+ },
208
+ get "data-floe-workbench-render-mode"() {
209
+ return t.layoutMode ?? "canvas_scaled";
210
+ }
211
+ }, () => ({
212
+ [rt]: t.selected ? "true" : void 0
213
+ }), {
214
+ tabIndex: 0,
215
+ onPointerDown: Z,
216
+ onFocus: () => {
217
+ t.onSelect(t.widgetId);
218
+ },
219
+ onContextMenu: (o) => {
220
+ z(o.target) === "widget_shell" && (o.preventDefault(), o.stopPropagation(), t.onContextMenu(o, t.itemSnapshot()));
221
+ },
222
+ get style() {
223
+ return K();
224
+ }
225
+ }), !1, !0), i.$$pointerdown = Y, O(i, {
226
+ [dt]: "true"
227
+ }, !1, !0), r.$$click = X, r.$$pointerdown = (o) => o.stopPropagation(), c(r, w(j, {
228
+ class: "workbench-widget__traffic-icon",
229
+ "aria-hidden": "true"
230
+ })), s.$$click = D, s.$$pointerdown = (o) => o.stopPropagation(), c(s, w(B, {
231
+ class: "workbench-widget__traffic-icon",
232
+ "aria-hidden": "true"
233
+ })), g.$$click = T, g.$$pointerdown = (o) => o.stopPropagation(), c(g, w(V, {
234
+ class: "workbench-widget__traffic-icon",
235
+ "aria-hidden": "true"
236
+ })), c(l, q), a.$$pointerdown = Y, c(a, w(at, {
189
237
  class: "w-3.5 h-3.5"
190
- })), u(r, () => {
191
- const e = t.definition.icon;
192
- return _(e, {
238
+ })), c(n, () => {
239
+ const o = t.definition.icon;
240
+ return w(o, {
193
241
  class: "w-3.5 h-3.5"
194
242
  });
195
- }, s), u(s, () => t.widgetTitle), c.$$click = (e) => {
196
- e.stopPropagation(), e.preventDefault(), t.onRequestDelete(t.widgetId);
197
- }, c.$$pointerdown = (e) => e.stopPropagation(), u(c, _(p, {
198
- class: "w-3 h-3"
199
- })), u(d, () => {
200
- const e = t.definition.body;
201
- return _(e, {
243
+ }, h), c(h, () => t.widgetTitle), S.$$click = D, S.$$pointerdown = (o) => o.stopPropagation(), c(S, w(B, {
244
+ class: "workbench-widget__window-control-icon",
245
+ "aria-hidden": "true"
246
+ })), x.$$click = T, x.$$pointerdown = (o) => o.stopPropagation(), c(x, w(V, {
247
+ class: "workbench-widget__window-control-icon",
248
+ "aria-hidden": "true"
249
+ })), W.$$click = X, W.$$pointerdown = (o) => o.stopPropagation(), c(W, w(j, {
250
+ class: "workbench-widget__window-control-icon",
251
+ "aria-hidden": "true"
252
+ })), c(Q, () => {
253
+ const o = t.definition.body;
254
+ return w(o, {
202
255
  get widgetId() {
203
256
  return t.widgetId;
204
257
  },
@@ -209,31 +262,19 @@ function ft(t) {
209
262
  return t.widgetType;
210
263
  },
211
264
  get surfaceMetrics() {
212
- return k();
265
+ return p();
213
266
  }
214
267
  });
215
- }), u(i, (() => {
216
- var e = V(() => !!t.locked);
217
- return () => e() ? null : (() => {
218
- var l = ot();
219
- return l.$$pointerdown = F, l;
268
+ }), c(e, (() => {
269
+ var o = et(() => !!t.locked);
270
+ return () => o() ? null : (() => {
271
+ var A = wt();
272
+ return A.$$pointerdown = U, A;
220
273
  })();
221
- })(), null), K((e) => {
222
- var l = !!t.selected, g = !!S(), R = !!W(), X = !!t.filtered, Y = t.layoutMode === "projected_surface", z = t.widgetId, D = t.layoutMode ?? "canvas_scaled", B = j();
223
- return l !== e.e && i.classList.toggle("is-selected", e.e = l), g !== e.t && i.classList.toggle("is-dragging", e.t = g), R !== e.a && i.classList.toggle("is-resizing", e.a = R), X !== e.o && i.classList.toggle("is-filtered-out", e.o = X), Y !== e.i && i.classList.toggle("is-projected-surface", e.i = Y), z !== e.n && T(i, "data-floe-workbench-widget-id", e.n = z), D !== e.s && T(i, "data-floe-workbench-render-mode", e.s = D), e.h = q(i, B, e.h), e;
224
- }, {
225
- e: void 0,
226
- t: void 0,
227
- a: void 0,
228
- o: void 0,
229
- i: void 0,
230
- n: void 0,
231
- s: void 0,
232
- h: void 0
233
- }), i;
274
+ })(), null), e;
234
275
  })();
235
276
  }
236
- J(["pointerdown", "contextmenu", "click"]);
277
+ nt(["pointerdown", "click"]);
237
278
  export {
238
- ft as WorkbenchWidget
279
+ kt as WorkbenchWidget
239
280
  };
@@ -5,3 +5,5 @@ export { useWorkbenchModel, type UseWorkbenchModelOptions } from './useWorkbench
5
5
  export { WIDGET_REGISTRY, createWorkbenchFilterState, getWidgetEntry, isValidWorkbenchWidgetType, resolveWorkbenchWidgetDefinitions, type WidgetRegistryEntry, } from './widgets/widgetRegistry';
6
6
  export * from './types';
7
7
  export { sanitizeWorkbenchState, createDefaultWorkbenchState, createWorkbenchId, createWorkbenchProjectedRect, createWorkbenchRenderLayerMap, createWorkbenchViewportCenteredOnWidget, createWorkbenchViewportFitForWidget, createWorkbenchWidgetSurfaceMetrics, resolveWorkbenchWidgetRenderMode, type WorkbenchRenderLayerMap, } from './workbenchHelpers';
8
+ export { DEFAULT_WORKBENCH_THEME, WORKBENCH_THEME_IDS, WORKBENCH_THEMES, isWorkbenchThemeId, workbenchThemeMeta, type WorkbenchThemeId, type WorkbenchThemeMeta, type WorkbenchThemePreview, } from './workbenchThemes';
9
+ export { WorkbenchThemeSelector, type WorkbenchThemeSelectorProps, } from './WorkbenchThemeSelector';
@@ -1,4 +1,5 @@
1
1
  import type { Component } from 'solid-js';
2
+ import type { WorkbenchThemeId } from './workbenchThemes';
2
3
  export type BuiltinWorkbenchWidgetType = 'terminal' | 'file-browser' | 'system-monitor' | 'log-viewer' | 'code-editor';
3
4
  export type WorkbenchWidgetType = BuiltinWorkbenchWidgetType | (string & {});
4
5
  export declare const WORKBENCH_WIDGET_TYPES: readonly WorkbenchWidgetType[];
@@ -64,6 +65,7 @@ export interface WorkbenchState<TWidgetType extends string = WorkbenchWidgetType
64
65
  locked: boolean;
65
66
  filters: Record<TWidgetType, boolean>;
66
67
  selectedWidgetId: string | null;
68
+ theme: WorkbenchThemeId;
67
69
  }
68
70
  export interface WorkbenchContextMenuState {
69
71
  clientX: number;
@@ -1,5 +1,6 @@
1
1
  import type { InfiniteCanvasContextMenuEvent } from '../../ui';
2
2
  import { type WorkbenchWidgetDefinition, type WorkbenchContextMenuState, type WorkbenchState, type WorkbenchViewport, type WorkbenchWidgetItem, type WorkbenchWidgetType } from './types';
3
+ import type { WorkbenchThemeId } from './workbenchThemes';
3
4
  import type { WorkbenchContextMenuItem } from './WorkbenchContextMenu';
4
5
  export interface UseWorkbenchModelOptions {
5
6
  state: () => WorkbenchState;
@@ -17,6 +18,7 @@ export declare function useWorkbenchModel(options: UseWorkbenchModelOptions): {
17
18
  locked: import("solid-js").Accessor<boolean>;
18
19
  filters: import("solid-js").Accessor<Record<WorkbenchWidgetType, boolean>>;
19
20
  selectedWidgetId: import("solid-js").Accessor<string | null>;
21
+ theme: import("solid-js").Accessor<"terminal" | "default" | "aurora" | "vibrancy" | "mica" | "midnight">;
20
22
  topZIndex: import("solid-js").Accessor<number>;
21
23
  scaleLabel: import("solid-js").Accessor<string>;
22
24
  optimisticFrontWidgetId: import("solid-js").Accessor<string | null>;
@@ -90,5 +92,8 @@ export declare function useWorkbenchModel(options: UseWorkbenchModelOptions): {
90
92
  findWidgetByType: (type: WorkbenchWidgetType) => WorkbenchWidgetItem<WorkbenchWidgetType> | null;
91
93
  findWidgetById: (widgetId: string) => WorkbenchWidgetItem<WorkbenchWidgetType> | null;
92
94
  };
95
+ appearance: {
96
+ setTheme: (next: WorkbenchThemeId) => void;
97
+ };
93
98
  handleCloseRequest: () => void;
94
99
  };