@floegence/floe-webapp-core 0.36.15 → 0.36.17

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.
Files changed (31) hide show
  1. package/dist/components/ui/InfiniteCanvas.d.ts +1 -0
  2. package/dist/components/ui/InfiniteCanvas.js +94 -84
  3. package/dist/components/ui/index.d.ts +1 -0
  4. package/dist/components/ui/pointerSession.d.ts +35 -0
  5. package/dist/components/ui/pointerSession.js +85 -0
  6. package/dist/components/workbench/WorkbenchCanvas.d.ts +3 -0
  7. package/dist/components/workbench/WorkbenchCanvas.js +51 -28
  8. package/dist/components/workbench/WorkbenchCanvasField.d.ts +2 -0
  9. package/dist/components/workbench/WorkbenchCanvasField.js +18 -6
  10. package/dist/components/workbench/WorkbenchFilterBar.js +119 -117
  11. package/dist/components/workbench/WorkbenchHud.d.ts +9 -0
  12. package/dist/components/workbench/WorkbenchHud.js +24 -10
  13. package/dist/components/workbench/WorkbenchSurface.js +68 -49
  14. package/dist/components/workbench/WorkbenchThemeSelector.d.ts +6 -0
  15. package/dist/components/workbench/WorkbenchThemeSelector.js +77 -0
  16. package/dist/components/workbench/WorkbenchWidget.d.ts +2 -0
  17. package/dist/components/workbench/WorkbenchWidget.js +211 -167
  18. package/dist/components/workbench/index.d.ts +2 -0
  19. package/dist/components/workbench/types.d.ts +2 -0
  20. package/dist/components/workbench/useWorkbenchModel.d.ts +5 -0
  21. package/dist/components/workbench/useWorkbenchModel.js +83 -77
  22. package/dist/components/workbench/workbenchHelpers.js +53 -50
  23. package/dist/components/workbench/workbenchThemes.d.ts +32 -0
  24. package/dist/components/workbench/workbenchThemes.js +82 -0
  25. package/dist/full.js +71 -69
  26. package/dist/styles.css +1 -1
  27. package/dist/ui.js +26 -24
  28. package/dist/workbench-themes.css +1106 -0
  29. package/dist/workbench.css +492 -96
  30. package/dist/workbench.js +35 -27
  31. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ import { type WorkbenchThemeId } from './workbenchThemes';
2
+ export interface WorkbenchThemeSelectorProps {
3
+ activeTheme: WorkbenchThemeId;
4
+ onSelect: (id: WorkbenchThemeId) => void;
5
+ }
6
+ export declare function WorkbenchThemeSelector(props: WorkbenchThemeSelectorProps): import("solid-js").JSX.Element;
@@ -0,0 +1,77 @@
1
+ import { createComponent as l, insert as c, template as o, effect as $, setAttribute as k, setStyleProperty as h, delegateEvents as S } from "solid-js/web";
2
+ import { createMemo as u, For as T } from "solid-js";
3
+ import { Sparkles as C } from "../icons/index.js";
4
+ import { Dropdown as x } from "../ui/Dropdown.js";
5
+ import { workbenchThemeMeta as W, WORKBENCH_THEMES as E } from "./workbenchThemes.js";
6
+ var y = /* @__PURE__ */ o("<div class=workbench-theme-selector data-floe-canvas-interactive=true>"), L = /* @__PURE__ */ o("<span class=workbench-theme-selector__trigger-inner>"), M = /* @__PURE__ */ o('<div class=workbench-theme-grid role=radiogroup aria-label="Workbench theme"><div class=workbench-theme-grid__header>Workbench theme</div><div class=workbench-theme-grid__items>'), p = /* @__PURE__ */ o("<button type=button class=workbench-theme-tile role=radio><span class=workbench-theme-tile__canvas aria-hidden=true><span class=workbench-theme-tile__widget></span><span class=workbench-theme-tile__dot></span></span><span class=workbench-theme-tile__meta><span class=workbench-theme-tile__label></span><span class=workbench-theme-tile__description>");
7
+ function K(e) {
8
+ const r = u(() => W(e.activeTheme).label), a = u(() => [{
9
+ id: "theme-grid",
10
+ label: "Theme",
11
+ keepOpen: !0,
12
+ content: () => l(A, {
13
+ get activeTheme() {
14
+ return e.activeTheme;
15
+ },
16
+ onSelect: (i) => e.onSelect(i)
17
+ })
18
+ }]);
19
+ return (() => {
20
+ var i = y();
21
+ return c(i, l(x, {
22
+ get trigger() {
23
+ return (() => {
24
+ var n = L();
25
+ return c(n, l(C, {
26
+ class: "w-3.5 h-3.5"
27
+ })), n;
28
+ })();
29
+ },
30
+ get triggerAriaLabel() {
31
+ return `Workbench theme · ${r()}`;
32
+ },
33
+ triggerClass: "workbench-theme-selector__trigger",
34
+ get items() {
35
+ return a();
36
+ },
37
+ onSelect: () => {
38
+ },
39
+ align: "end"
40
+ })), i;
41
+ })();
42
+ }
43
+ function A(e) {
44
+ return (() => {
45
+ var r = M(), a = r.firstChild, i = a.nextSibling;
46
+ return c(i, l(T, {
47
+ each: E,
48
+ children: (n) => l(H, {
49
+ theme: n,
50
+ get active() {
51
+ return n.id === e.activeTheme;
52
+ },
53
+ onClick: () => e.onSelect(n.id)
54
+ })
55
+ })), r;
56
+ })();
57
+ }
58
+ function H(e) {
59
+ return (() => {
60
+ var r = p(), a = r.firstChild, i = a.firstChild, n = i.nextSibling, w = a.nextSibling, s = w.firstChild, f = s.nextSibling;
61
+ return r.$$click = () => e.onClick(), c(s, () => e.theme.label), c(f, () => e.theme.description), $((t) => {
62
+ var m = !!e.active, d = e.active, v = e.active, b = e.theme.preview.canvas, g = e.theme.preview.widget, _ = e.theme.preview.accent;
63
+ return m !== t.e && r.classList.toggle("is-active", t.e = m), d !== t.t && k(r, "aria-pressed", t.t = d), v !== t.a && k(r, "aria-checked", t.a = v), b !== t.o && h(a, "background", t.o = b), g !== t.i && h(i, "background", t.i = g), _ !== t.n && h(n, "background", t.n = _), t;
64
+ }, {
65
+ e: void 0,
66
+ t: void 0,
67
+ a: void 0,
68
+ o: void 0,
69
+ i: void 0,
70
+ n: void 0
71
+ }), r;
72
+ })();
73
+ }
74
+ S(["click"]);
75
+ export {
76
+ K as WorkbenchThemeSelector
77
+ };
@@ -32,6 +32,8 @@ export interface WorkbenchWidgetProps {
32
32
  width: number;
33
33
  height: number;
34
34
  }) => void;
35
+ onRequestOverview: (item: WorkbenchWidgetItem) => void;
36
+ onRequestFit: (item: WorkbenchWidgetItem) => void;
35
37
  onRequestDelete: (widgetId: string) => void;
36
38
  }
37
39
  export declare function WorkbenchWidget(props: WorkbenchWidgetProps): JSX.Element;
@@ -1,204 +1,260 @@
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 H, mergeProps as et, insert as l, createComponent as c, memo as it, template as B, use as nt, delegateEvents as ot } from "solid-js/web";
2
+ import { createSignal as L, onCleanup as at, untrack as S, createMemo as _ } from "solid-js";
3
+ import { startHotInteraction as O } from "../../utils/hotInteraction.js";
4
+ import { X as F, Minus as N, Maximize as A, GripVertical as rt } from "../icons/index.js";
5
+ import { CANVAS_WHEEL_INTERACTIVE_ATTR as dt, WORKBENCH_WIDGET_SHELL_ATTR as lt, resolveWorkbenchWidgetEventOwnership as ct } from "../ui/localInteractionSurface.js";
6
+ import { startPointerSession as j } from "../ui/pointerSession.js";
7
+ import { createWorkbenchWidgetSurfaceMetrics as st } from "./workbenchHelpers.js";
8
+ var wt = /* @__PURE__ */ B('<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>'), gt = /* @__PURE__ */ B('<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">');
9
+ const ht = 220, ut = 160, _t = '[data-floe-canvas-interactive="true"]', ft = '[data-floe-canvas-pan-surface="true"]';
10
+ function xt(t) {
11
+ const [f, I] = L(null), [b, x] = L(null);
12
+ let g, h, u;
13
+ at(() => {
14
+ g?.stop({
15
+ reason: "manual_stop",
16
+ commit: !1
17
+ }), g = void 0, h?.stop({
18
+ reason: "manual_stop",
19
+ commit: !1
20
+ }), h = void 0, S(f)?.stopInteraction(), S(b)?.stopInteraction();
14
21
  });
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({
22
+ const C = () => f() !== null, W = () => b() !== null, E = (e) => ct({
23
+ target: e,
24
+ widgetRoot: u ?? null,
25
+ interactiveSelector: _t,
26
+ panSurfaceSelector: ft
27
+ }), V = (e) => {
28
+ e.button === 0 && (t.onSelect(t.widgetId), t.onCommitFront(t.widgetId), E(e.target) === "widget_shell" && u?.focus({
22
29
  preventScroll: !0
23
30
  }));
24
- }, m = y(() => {
25
- const i = f();
26
- return i ? {
27
- x: i.worldX,
28
- y: i.worldY
31
+ }, m = _(() => {
32
+ const e = f();
33
+ return e ? {
34
+ x: e.worldX,
35
+ y: e.worldY
29
36
  } : {
30
37
  x: t.x,
31
38
  y: t.y
32
39
  };
33
- }), I = y(() => {
34
- const i = v();
35
- return i ? {
36
- width: i.width,
37
- height: i.height
40
+ }), v = _(() => {
41
+ const e = b();
42
+ return e ? {
43
+ width: e.width,
44
+ height: e.height
38
45
  } : {
39
46
  width: t.width,
40
47
  height: t.height
41
48
  };
42
- }), k = y(() => {
49
+ }), R = _(() => {
43
50
  if (!(t.layoutMode !== "projected_surface" || !t.projectedViewport))
44
- return it({
51
+ return st({
45
52
  widgetId: t.widgetId,
46
53
  worldX: m().x,
47
54
  worldY: m().y,
48
- worldWidth: I().width,
49
- worldHeight: I().height,
55
+ worldWidth: v().width,
56
+ worldHeight: v().height,
50
57
  viewport: t.projectedViewport,
51
58
  ready: t.surfaceReady ?? !0
52
59
  });
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}`
60
+ }), G = _(() => {
61
+ const e = t.itemSnapshot().z_index, i = Number.isFinite(e) ? Math.max(1, Math.min(99, Math.round(e))) : 1;
62
+ return String(i).padStart(2, "0");
63
+ }), z = (e) => {
64
+ e.preventDefault(), e.stopPropagation(), t.onRequestOverview(t.itemSnapshot());
65
+ }, T = (e) => {
66
+ e.preventDefault(), e.stopPropagation(), t.onRequestFit(t.itemSnapshot());
67
+ }, D = (e) => {
68
+ e.preventDefault(), e.stopPropagation(), t.onRequestDelete(t.widgetId);
69
+ }, Z = _(() => {
70
+ const e = {
71
+ width: `${v().width}px`,
72
+ height: `${v().height}px`,
73
+ "z-index": C() || W() || t.optimisticFront ? `${t.topRenderLayer + 1}` : `${t.renderLayer}`
58
74
  };
59
75
  if (t.layoutMode === "projected_surface") {
60
- const n = k()?.rect;
76
+ const i = R()?.rect;
61
77
  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)}`
78
+ ...e,
79
+ left: `${i?.screenX ?? 0}px`,
80
+ top: `${i?.screenY ?? 0}px`,
81
+ "--floe-workbench-projected-scale": `${i?.viewportScale ?? Math.max(t.viewportScale, 1e-3)}`
66
82
  };
67
83
  }
68
84
  return {
69
- ...i,
85
+ ...e,
70
86
  transform: `translate(${m().x}px, ${m().y}px)`
71
87
  };
72
- }), E = (i) => {
73
- const n = x(f);
74
- if (!n) return;
75
- const a = {
76
- x: n.worldX,
77
- y: n.worldY
88
+ }), q = (e) => {
89
+ const i = S(f);
90
+ if (!i) return;
91
+ const d = {
92
+ x: i.worldX,
93
+ y: i.worldY
78
94
  }, 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({
95
+ x: i.startWorldX,
96
+ y: i.startWorldY
97
+ }, a = e && (Math.abs(d.x - r.x) > 1 || Math.abs(d.y - r.y) > 1);
98
+ t.onCommitFront(t.widgetId), a && t.onCommitMove(t.widgetId, d), i.stopInteraction(), I(null), g = void 0;
99
+ }, X = (e) => {
100
+ if (e.button !== 0 || t.locked) return;
101
+ e.preventDefault(), e.stopPropagation(), g?.stop({
102
+ reason: "manual_stop",
103
+ commit: !1
104
+ }), t.onSelect(t.widgetId), u?.focus({
105
+ preventScroll: !0
106
+ }), t.onStartOptimisticFront(t.widgetId);
107
+ const i = O({
87
108
  kind: "drag",
88
109
  cursor: "grabbing"
89
- }), a = Math.max(t.viewportScale, 1e-3);
90
- C({
91
- pointerId: i.pointerId,
92
- startClientX: i.clientX,
93
- startClientY: i.clientY,
110
+ }), d = Math.max(t.viewportScale, 1e-3);
111
+ I({
112
+ pointerId: e.pointerId,
113
+ startClientX: e.clientX,
114
+ startClientY: e.clientY,
94
115
  startWorldX: t.x,
95
116
  startWorldY: t.y,
96
117
  worldX: t.x,
97
118
  worldY: t.y,
98
119
  moved: !1,
99
- scale: a,
100
- stopInteraction: n
120
+ scale: d,
121
+ stopInteraction: i
101
122
  });
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;
123
+ const r = (a) => {
124
+ I((n) => {
125
+ if (!n || n.pointerId !== a.pointerId) return n;
126
+ const w = n.startWorldX + (a.clientX - n.startClientX) / n.scale, s = n.startWorldY + (a.clientY - n.startClientY) / n.scale;
106
127
  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
128
+ ...n,
129
+ worldX: w,
130
+ worldY: s,
131
+ moved: n.moved || Math.abs(w - n.startWorldX) > 2 || Math.abs(s - n.startWorldY) > 2
111
132
  };
112
133
  });
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
120
- }), window.addEventListener("pointerup", s, {
121
- once: !0,
122
- signal: d.signal
123
- }), window.addEventListener("pointercancel", c, {
124
- once: !0,
125
- signal: d.signal
134
+ };
135
+ g = j({
136
+ pointerEvent: e,
137
+ captureEl: e.currentTarget,
138
+ onMove: r,
139
+ onEnd: ({
140
+ commit: a
141
+ }) => q(a)
126
142
  });
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({
143
+ }, K = (e) => {
144
+ const i = S(b);
145
+ if (!i) return;
146
+ const d = {
147
+ width: i.width,
148
+ height: i.height
149
+ }, r = Math.abs(i.width - i.startWidth) > 1 || Math.abs(i.height - i.startHeight) > 1;
150
+ e && r && t.onCommitResize(t.widgetId, d), i.stopInteraction(), x(null), h = void 0;
151
+ }, U = (e) => {
152
+ if (e.button !== 0 || t.locked) return;
153
+ e.preventDefault(), e.stopPropagation(), h?.stop({
154
+ reason: "manual_stop",
155
+ commit: !1
156
+ }), t.onStartOptimisticFront(t.widgetId);
157
+ const i = O({
139
158
  kind: "drag",
140
159
  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,
160
+ }), d = Math.max(t.viewportScale, 1e-3);
161
+ x({
162
+ pointerId: e.pointerId,
163
+ startClientX: e.clientX,
164
+ startClientY: e.clientY,
146
165
  startWidth: t.width,
147
166
  startHeight: t.height,
148
167
  width: t.width,
149
168
  height: t.height,
150
- scale: a,
151
- stopInteraction: n
169
+ scale: d,
170
+ stopInteraction: i
152
171
  });
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);
172
+ const r = (a) => {
173
+ x((n) => {
174
+ if (!n || n.pointerId !== a.pointerId) return n;
175
+ const w = Math.max(ht, n.startWidth + (a.clientX - n.startClientX) / n.scale), s = Math.max(ut, n.startHeight + (a.clientY - n.startClientY) / n.scale);
157
176
  return {
158
- ...e,
159
- width: l,
160
- height: g
177
+ ...n,
178
+ width: w,
179
+ height: s
161
180
  };
162
181
  });
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
170
- }), window.addEventListener("pointerup", s, {
171
- once: !0,
172
- signal: d.signal
173
- }), window.addEventListener("pointercancel", c, {
174
- once: !0,
175
- signal: d.signal
182
+ };
183
+ h = j({
184
+ pointerEvent: e,
185
+ captureEl: e.currentTarget,
186
+ onMove: r,
187
+ onEnd: ({
188
+ commit: a
189
+ }) => K(a)
176
190
  });
177
191
  };
178
192
  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, {
193
+ var e = wt(), i = e.firstChild, d = i.firstChild, r = d.firstChild, a = r.nextSibling, n = a.nextSibling, w = d.nextSibling, s = w.nextSibling, M = s.nextSibling, J = M.firstChild, p = J.nextSibling, Q = M.nextSibling, $ = Q.firstChild, k = $.nextSibling, y = k.nextSibling, tt = i.nextSibling, P = u;
194
+ return typeof P == "function" ? nt(P, e) : u = e, H(e, et({
195
+ get classList() {
196
+ return {
197
+ "is-selected": t.selected,
198
+ "is-dragging": C(),
199
+ "is-resizing": W(),
200
+ "is-filtered-out": t.filtered,
201
+ "is-projected-surface": t.layoutMode === "projected_surface",
202
+ "is-locked": t.locked
203
+ };
204
+ },
205
+ get "data-floe-workbench-widget-id"() {
206
+ return t.widgetId;
207
+ },
208
+ get "data-workbench-widget-type"() {
209
+ return t.widgetType;
210
+ },
211
+ get "data-floe-workbench-render-mode"() {
212
+ return t.layoutMode ?? "canvas_scaled";
213
+ }
214
+ }, () => ({
215
+ [dt]: t.selected ? "true" : void 0
216
+ }), {
217
+ tabIndex: 0,
218
+ onPointerDown: V,
219
+ onFocus: () => {
220
+ t.onSelect(t.widgetId);
221
+ },
222
+ onContextMenu: (o) => {
223
+ E(o.target) === "widget_shell" && (o.preventDefault(), o.stopPropagation(), t.onContextMenu(o, t.itemSnapshot()));
224
+ },
225
+ get style() {
226
+ return Z();
227
+ }
228
+ }), !1, !0), i.$$pointerdown = X, H(i, {
229
+ [lt]: "true"
230
+ }, !1, !0), r.$$click = D, r.$$pointerdown = (o) => o.stopPropagation(), l(r, c(F, {
231
+ class: "workbench-widget__traffic-icon",
232
+ "aria-hidden": "true"
233
+ })), a.$$click = z, a.$$pointerdown = (o) => o.stopPropagation(), l(a, c(N, {
234
+ class: "workbench-widget__traffic-icon",
235
+ "aria-hidden": "true"
236
+ })), n.$$click = T, n.$$pointerdown = (o) => o.stopPropagation(), l(n, c(A, {
237
+ class: "workbench-widget__traffic-icon",
238
+ "aria-hidden": "true"
239
+ })), l(w, G), s.$$pointerdown = X, l(s, c(rt, {
189
240
  class: "w-3.5 h-3.5"
190
- })), u(r, () => {
191
- const e = t.definition.icon;
192
- return _(e, {
241
+ })), l(M, () => {
242
+ const o = t.definition.icon;
243
+ return c(o, {
193
244
  class: "w-3.5 h-3.5"
194
245
  });
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, {
246
+ }, p), l(p, () => t.widgetTitle), $.$$click = z, $.$$pointerdown = (o) => o.stopPropagation(), l($, c(N, {
247
+ class: "workbench-widget__window-control-icon",
248
+ "aria-hidden": "true"
249
+ })), k.$$click = T, k.$$pointerdown = (o) => o.stopPropagation(), l(k, c(A, {
250
+ class: "workbench-widget__window-control-icon",
251
+ "aria-hidden": "true"
252
+ })), y.$$click = D, y.$$pointerdown = (o) => o.stopPropagation(), l(y, c(F, {
253
+ class: "workbench-widget__window-control-icon",
254
+ "aria-hidden": "true"
255
+ })), l(tt, () => {
256
+ const o = t.definition.body;
257
+ return c(o, {
202
258
  get widgetId() {
203
259
  return t.widgetId;
204
260
  },
@@ -209,31 +265,19 @@ function ft(t) {
209
265
  return t.widgetType;
210
266
  },
211
267
  get surfaceMetrics() {
212
- return k();
268
+ return R();
213
269
  }
214
270
  });
215
- }), u(i, (() => {
216
- var e = V(() => !!t.locked);
217
- return () => e() ? null : (() => {
218
- var l = ot();
219
- return l.$$pointerdown = F, l;
271
+ }), l(e, (() => {
272
+ var o = it(() => !!t.locked);
273
+ return () => o() ? null : (() => {
274
+ var Y = gt();
275
+ return Y.$$pointerdown = U, Y;
220
276
  })();
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;
277
+ })(), null), e;
234
278
  })();
235
279
  }
236
- J(["pointerdown", "contextmenu", "click"]);
280
+ ot(["pointerdown", "click"]);
237
281
  export {
238
- ft as WorkbenchWidget
282
+ xt as WorkbenchWidget
239
283
  };
@@ -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
  };