@floegence/floe-webapp-core 0.36.0 → 0.36.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.
Files changed (29) hide show
  1. package/dist/components/layout/DisplayModePageShell.d.ts +8 -0
  2. package/dist/components/layout/DisplayModePageShell.js +22 -0
  3. package/dist/components/layout/DisplayModeSwitcher.d.ts +7 -0
  4. package/dist/components/layout/DisplayModeSwitcher.js +52 -0
  5. package/dist/components/layout/index.d.ts +2 -0
  6. package/dist/components/workbench/WorkbenchCanvas.d.ts +2 -1
  7. package/dist/components/workbench/WorkbenchCanvas.js +17 -13
  8. package/dist/components/workbench/WorkbenchFilterBar.d.ts +2 -1
  9. package/dist/components/workbench/WorkbenchFilterBar.js +71 -70
  10. package/dist/components/workbench/WorkbenchSurface.d.ts +14 -1
  11. package/dist/components/workbench/WorkbenchSurface.js +73 -56
  12. package/dist/components/workbench/WorkbenchWidget.d.ts +2 -1
  13. package/dist/components/workbench/WorkbenchWidget.js +90 -81
  14. package/dist/components/workbench/index.d.ts +2 -2
  15. package/dist/components/workbench/types.d.ts +28 -11
  16. package/dist/components/workbench/types.js +2 -16
  17. package/dist/components/workbench/useWorkbenchModel.d.ts +19 -6
  18. package/dist/components/workbench/useWorkbenchModel.js +152 -127
  19. package/dist/components/workbench/widgets/widgetRegistry.d.ts +6 -5
  20. package/dist/components/workbench/widgets/widgetRegistry.js +47 -26
  21. package/dist/components/workbench/workbenchHelpers.d.ts +8 -4
  22. package/dist/components/workbench/workbenchHelpers.js +97 -134
  23. package/dist/display-mode.css +70 -0
  24. package/dist/full.js +485 -480
  25. package/dist/layout.js +32 -27
  26. package/dist/styles.css +1 -1
  27. package/dist/tailwind.css +1 -0
  28. package/dist/workbench.js +21 -20
  29. package/package.json +1 -1
@@ -0,0 +1,8 @@
1
+ import { type Component, type JSX } from 'solid-js';
2
+ export interface DisplayModePageShellProps {
3
+ logo?: JSX.Element;
4
+ actions?: JSX.Element;
5
+ title?: string;
6
+ children: JSX.Element;
7
+ }
8
+ export declare const DisplayModePageShell: Component<DisplayModePageShellProps>;
@@ -0,0 +1,22 @@
1
+ import { insert as r, createComponent as a, template as o } from "solid-js/web";
2
+ import "solid-js";
3
+ import { TopBar as i } from "./TopBar.js";
4
+ var n = /* @__PURE__ */ o("<div class=display-mode-page-shell><main class=display-mode-page-shell__body>");
5
+ const p = (e) => (() => {
6
+ var t = n(), l = t.firstChild;
7
+ return r(t, a(i, {
8
+ get logo() {
9
+ return e.logo;
10
+ },
11
+ get title() {
12
+ return e.title;
13
+ },
14
+ get actions() {
15
+ return e.actions;
16
+ },
17
+ ariaLabel: "Display mode top bar"
18
+ }), l), r(l, () => e.children), t;
19
+ })();
20
+ export {
21
+ p as DisplayModePageShell
22
+ };
@@ -0,0 +1,7 @@
1
+ export type DisplayMode = 'activity' | 'deck' | 'workbench';
2
+ export declare function sanitizeDisplayMode(value: unknown, fallback?: DisplayMode): DisplayMode;
3
+ export interface DisplayModeSwitcherProps {
4
+ mode: DisplayMode;
5
+ onChange: (mode: DisplayMode) => void;
6
+ }
7
+ export declare function DisplayModeSwitcher(props: DisplayModeSwitcherProps): import("solid-js").JSX.Element;
@@ -0,0 +1,52 @@
1
+ import { insert as a, createComponent as m, memo as h, effect as v, setAttribute as y, template as o, delegateEvents as p } from "solid-js/web";
2
+ import { For as _ } from "solid-js";
3
+ import { Bookmark as u, LayoutDashboard as k, Grid3x3 as f } from "../icons/index.js";
4
+ var w = /* @__PURE__ */ o('<div class=display-mode-switcher role=tablist aria-label="Display mode">'), D = /* @__PURE__ */ o("<button type=button class=display-mode-switcher__pill role=tab><span class=display-mode-switcher__label>"), $ = /* @__PURE__ */ o("<span class=display-mode-switcher__pill-bg>");
5
+ const g = /* @__PURE__ */ new Set(["activity", "deck", "workbench"]);
6
+ function E(i, r = "activity") {
7
+ return typeof i == "string" && g.has(i) ? i : r;
8
+ }
9
+ const A = [{
10
+ id: "activity",
11
+ label: "Activity",
12
+ icon: u
13
+ }, {
14
+ id: "deck",
15
+ label: "Deck",
16
+ icon: k
17
+ }, {
18
+ id: "workbench",
19
+ label: "Workbench",
20
+ icon: f
21
+ }];
22
+ function L(i) {
23
+ return (() => {
24
+ var r = w();
25
+ return a(r, m(_, {
26
+ each: A,
27
+ children: (l) => {
28
+ const b = l.icon, c = () => i.mode === l.id;
29
+ return (() => {
30
+ var e = D(), s = e.firstChild;
31
+ return e.$$click = () => i.onChange(l.id), a(e, (() => {
32
+ var t = h(() => !!c());
33
+ return () => t() ? $() : null;
34
+ })(), s), a(e, m(b, {
35
+ class: "display-mode-switcher__icon"
36
+ }), s), a(s, () => l.label), v((t) => {
37
+ var n = !!c(), d = c();
38
+ return n !== t.e && e.classList.toggle("is-active", t.e = n), d !== t.t && y(e, "aria-selected", t.t = d), t;
39
+ }, {
40
+ e: void 0,
41
+ t: void 0
42
+ }), e;
43
+ })();
44
+ }
45
+ })), r;
46
+ })();
47
+ }
48
+ p(["click"]);
49
+ export {
50
+ L as DisplayModeSwitcher,
51
+ E as sanitizeDisplayMode
52
+ };
@@ -9,3 +9,5 @@ export { ResizeHandle, type ResizeHandleProps } from './ResizeHandle';
9
9
  export { SidebarPane, type SidebarPaneProps } from './SidebarPane';
10
10
  export { Panel, PanelHeader, PanelContent, type PanelProps, type PanelHeaderProps, type PanelContentProps } from './Panel';
11
11
  export { KeepAliveStack, type KeepAliveStackProps, type KeepAliveView } from './KeepAliveStack';
12
+ export { DisplayModeSwitcher, sanitizeDisplayMode, type DisplayMode, type DisplayModeSwitcherProps, } from './DisplayModeSwitcher';
13
+ export { DisplayModePageShell, type DisplayModePageShellProps } from './DisplayModePageShell';
@@ -1,6 +1,7 @@
1
1
  import { type InfiniteCanvasContextMenuEvent } from '../../ui';
2
- import type { WorkbenchViewport, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
2
+ import type { WorkbenchViewport, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
3
3
  export interface WorkbenchCanvasProps {
4
+ widgetDefinitions: readonly WorkbenchWidgetDefinition[];
4
5
  widgets: readonly WorkbenchWidgetItem[];
5
6
  viewport: WorkbenchViewport;
6
7
  selectedWidgetId: string | null;
@@ -1,12 +1,13 @@
1
- import { use as l, insert as a, createComponent as i, effect as u, template as c } from "solid-js/web";
2
- import { For as d } from "solid-js";
3
- import { WorkbenchWidget as m } from "./WorkbenchWidget.js";
4
- import { InfiniteCanvas as g } from "../ui/InfiniteCanvas.js";
5
- var v = /* @__PURE__ */ c("<div class=workbench-canvas__field><div class=workbench-canvas__grid aria-hidden=true>"), s = /* @__PURE__ */ c("<div class=workbench-canvas>");
6
- function w(e) {
1
+ import { use as d, insert as a, createComponent as i, effect as l, template as c } from "solid-js/web";
2
+ import { For as g } from "solid-js";
3
+ import { WorkbenchWidget as u } from "./WorkbenchWidget.js";
4
+ import { getWidgetEntry as m } from "./widgets/widgetRegistry.js";
5
+ import { InfiniteCanvas as v } from "../ui/InfiniteCanvas.js";
6
+ var s = /* @__PURE__ */ c("<div class=workbench-canvas__field><div class=workbench-canvas__grid aria-hidden=true>"), f = /* @__PURE__ */ c("<div class=workbench-canvas>");
7
+ function b(e) {
7
8
  return (() => {
8
- var t = s(), o = e.setCanvasFrameRef;
9
- return typeof o == "function" ? l(o, t) : e.setCanvasFrameRef = t, a(t, i(g, {
9
+ var t = f(), o = e.setCanvasFrameRef;
10
+ return typeof o == "function" ? d(o, t) : e.setCanvasFrameRef = t, a(t, i(v, {
10
11
  ariaLabel: "Workbench canvas",
11
12
  class: "workbench-canvas__infinite",
12
13
  get viewport() {
@@ -22,12 +23,15 @@ function w(e) {
22
23
  return e.locked;
23
24
  },
24
25
  get children() {
25
- var r = v();
26
- return r.firstChild, a(r, i(d, {
26
+ var r = s();
27
+ return r.firstChild, a(r, i(g, {
27
28
  get each() {
28
29
  return e.widgets;
29
30
  },
30
- children: (n) => i(m, {
31
+ children: (n) => i(u, {
32
+ get definition() {
33
+ return m(n.type, e.widgetDefinitions);
34
+ },
31
35
  item: n,
32
36
  get selected() {
33
37
  return e.selectedWidgetId === n.id;
@@ -71,9 +75,9 @@ function w(e) {
71
75
  })
72
76
  }), null), r;
73
77
  }
74
- })), u(() => t.classList.toggle("is-locked", !!e.locked)), t;
78
+ })), l(() => t.classList.toggle("is-locked", !!e.locked)), t;
75
79
  })();
76
80
  }
77
81
  export {
78
- w as WorkbenchCanvas
82
+ b as WorkbenchCanvas
79
83
  };
@@ -1,6 +1,7 @@
1
1
  import { type JSX } from 'solid-js';
2
- import type { WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
2
+ import type { WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
3
3
  export interface WorkbenchFilterBarProps {
4
+ widgetDefinitions: readonly WorkbenchWidgetDefinition[];
4
5
  widgets: readonly WorkbenchWidgetItem[];
5
6
  filters: Record<WorkbenchWidgetType, boolean>;
6
7
  /** Solo a single widget type — only this type remains visible. */
@@ -1,19 +1,18 @@
1
- import { insert as g, createComponent as d, effect as I, setAttribute as S, template as E, Portal as F, setStyleProperty as H, delegateEvents as T } from "solid-js/web";
2
- import { createSignal as O, onCleanup as p, createMemo as G, For as P, Show as Y } from "solid-js";
1
+ import { insert as v, createComponent as d, effect as D, setAttribute as S, template as I, Portal as F, setStyleProperty as H, delegateEvents as P } from "solid-js/web";
2
+ import { createSignal as O, onCleanup as R, createMemo as B, For as T, Show as X } from "solid-js";
3
3
  import { Motion as C } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
4
4
  import { easing as y, duration as L } from "../../utils/animations.js";
5
- import { Layers as B, Plus as W } from "../icons/index.js";
6
- import { startHotInteraction as q } from "../../utils/hotInteraction.js";
7
- import { WIDGET_REGISTRY as x } from "./widgets/widgetRegistry.js";
8
- var z = /* @__PURE__ */ E("<button type=button class=workbench-dock__item>"), N = /* @__PURE__ */ E('<div class=workbench-dock data-floe-canvas-interactive=true><button type=button class=workbench-dock__item aria-label="Show all widgets"></button><span class=workbench-dock__divider aria-hidden=true>'), U = /* @__PURE__ */ E("<div class=workbench-dock-ghost aria-hidden=true><div class=workbench-dock-ghost__halo></div><div class=workbench-dock-ghost__card><div class=workbench-dock-ghost__icon></div><div class=workbench-dock-ghost__copy><div class=workbench-dock-ghost__title></div><div class=workbench-dock-ghost__hint><span>");
9
- const X = 5, V = '[data-floe-workbench-canvas-frame="true"]';
5
+ import { Layers as G, Plus as q } from "../icons/index.js";
6
+ import { startHotInteraction as z } from "../../utils/hotInteraction.js";
7
+ var N = /* @__PURE__ */ I("<button type=button class=workbench-dock__item>"), U = /* @__PURE__ */ I('<div class=workbench-dock data-floe-canvas-interactive=true><button type=button class=workbench-dock__item aria-label="Show all widgets"></button><span class=workbench-dock__divider aria-hidden=true>'), V = /* @__PURE__ */ I("<div class=workbench-dock-ghost aria-hidden=true><div class=workbench-dock-ghost__halo></div><div class=workbench-dock-ghost__card><div class=workbench-dock-ghost__icon></div><div class=workbench-dock-ghost__copy><div class=workbench-dock-ghost__title></div><div class=workbench-dock-ghost__hint><span>");
8
+ const x = 5, W = '[data-floe-workbench-canvas-frame="true"]';
10
9
  function j(e, l) {
11
- const a = document.querySelector(V);
10
+ const a = document.querySelector(W);
12
11
  if (!(a instanceof HTMLElement)) return !1;
13
12
  const s = a.getBoundingClientRect();
14
13
  return e >= s.left && e <= s.right && l >= s.top && l <= s.bottom;
15
14
  }
16
- function J(e) {
15
+ function p(e) {
17
16
  const l = () => e.hoverOffset === -1 ? {
18
17
  scale: 1.26,
19
18
  y: -6,
@@ -30,12 +29,12 @@ function J(e) {
30
29
  scale: 1,
31
30
  y: 0,
32
31
  x: 0
33
- }, a = () => e.hoverOffset === -1, s = (i) => {
34
- i.button === 0 && e.onDragBegin(i, e.type, e.label, e.icon);
32
+ }, a = () => e.hoverOffset === -1, s = (o) => {
33
+ o.button === 0 && e.onDragBegin(o, e.type, e.label, e.icon);
35
34
  };
36
35
  return (() => {
37
- var i = z();
38
- return i.$$pointerdown = s, i.addEventListener("pointerleave", () => e.onLeave()), i.addEventListener("pointerenter", () => e.onEnter()), g(i, d(C.span, {
36
+ var o = N();
37
+ return o.$$pointerdown = s, o.addEventListener("pointerleave", () => e.onLeave()), o.addEventListener("pointerenter", () => e.onEnter()), v(o, d(C.span, {
39
38
  class: "workbench-dock__tile",
40
39
  get animate() {
41
40
  return l();
@@ -54,7 +53,7 @@ function J(e) {
54
53
  });
55
54
  })();
56
55
  }
57
- }), null), g(i, d(C.span, {
56
+ }), null), v(o, d(C.span, {
58
57
  class: "workbench-dock__tooltip",
59
58
  get animate() {
60
59
  return {
@@ -71,71 +70,71 @@ function J(e) {
71
70
  get children() {
72
71
  return e.label;
73
72
  }
74
- }), null), I((t) => {
75
- var f = !!e.active, _ = !!a(), h = !!e.isDragging, w = `${e.label} — click to solo, drag to canvas to create`, b = e.active;
76
- return f !== t.e && i.classList.toggle("is-active", t.e = f), _ !== t.t && i.classList.toggle("is-hovered", t.t = _), h !== t.a && i.classList.toggle("is-source-dragging", t.a = h), w !== t.o && S(i, "aria-label", t.o = w), b !== t.i && S(i, "aria-pressed", t.i = b), t;
73
+ }), null), D((t) => {
74
+ var h = !!e.active, m = !!a(), f = !!e.isDragging, _ = `${e.label} — click to solo, drag to canvas to create`, b = e.active;
75
+ return h !== t.e && o.classList.toggle("is-active", t.e = h), m !== t.t && o.classList.toggle("is-hovered", t.t = m), f !== t.a && o.classList.toggle("is-source-dragging", t.a = f), _ !== t.o && S(o, "aria-label", t.o = _), b !== t.i && S(o, "aria-pressed", t.i = b), t;
77
76
  }, {
78
77
  e: void 0,
79
78
  t: void 0,
80
79
  a: void 0,
81
80
  o: void 0,
82
81
  i: void 0
83
- }), i;
82
+ }), o;
84
83
  })();
85
84
  }
86
- function ie(e) {
87
- const [l, a] = O(null), [s, i] = O(null);
85
+ function re(e) {
86
+ const [l, a] = O(null), [s, o] = O(null);
88
87
  let t;
89
- p(() => {
88
+ R(() => {
90
89
  t?.abort(), t = void 0, s()?.stopInteraction();
91
90
  });
92
- const f = G(() => x.every((o) => e.filters[o.type])), _ = (o) => {
91
+ const h = B(() => e.widgetDefinitions.every((i) => e.filters[i.type])), m = (i) => {
93
92
  const r = l();
94
- return r === null ? 0 : r === o ? -1 : r === o + 1 ? -2 : r === o - 1 ? 1 : 0;
95
- }, h = (o) => {
93
+ return r === null ? 0 : r === i ? -1 : r === i + 1 ? -2 : r === i - 1 ? 1 : 0;
94
+ }, f = (i) => {
96
95
  const r = s();
97
96
  if (!r) return;
98
97
  const n = !r.moved;
99
- if (r.stopInteraction(), i(null), t?.abort(), t = void 0, n) {
98
+ if (r.stopInteraction(), o(null), t?.abort(), t = void 0, n) {
100
99
  e.onSoloFilter(r.type);
101
100
  return;
102
101
  }
103
- o && r.overCanvas && e.onCreateAt?.(r.type, r.clientX, r.clientY);
104
- }, w = (o, r, n, u) => {
105
- o.preventDefault(), t?.abort(), i({
102
+ i && r.overCanvas && e.onCreateAt?.(r.type, r.clientX, r.clientY);
103
+ }, _ = (i, r, n, u) => {
104
+ i.preventDefault(), t?.abort(), o({
106
105
  type: r,
107
106
  label: n,
108
107
  icon: u,
109
- pointerId: o.pointerId,
110
- startClientX: o.clientX,
111
- startClientY: o.clientY,
112
- clientX: o.clientX,
113
- clientY: o.clientY,
108
+ pointerId: i.pointerId,
109
+ startClientX: i.clientX,
110
+ startClientY: i.clientY,
111
+ clientX: i.clientX,
112
+ clientY: i.clientY,
114
113
  moved: !1,
115
114
  overCanvas: !1,
116
- stopInteraction: q({
115
+ stopInteraction: z({
117
116
  kind: "drag",
118
117
  cursor: "grabbing"
119
118
  })
120
119
  });
121
120
  const c = new AbortController();
122
121
  t = c;
123
- const k = (v) => {
124
- i((m) => {
125
- if (!m || m.pointerId !== v.pointerId) return m;
126
- const M = v.clientX - m.startClientX, R = v.clientY - m.startClientY, D = m.moved || Math.abs(M) > X || Math.abs(R) > X;
122
+ const k = (g) => {
123
+ o((w) => {
124
+ if (!w || w.pointerId !== g.pointerId) return w;
125
+ const Y = g.clientX - w.startClientX, M = g.clientY - w.startClientY, E = w.moved || Math.abs(Y) > x || Math.abs(M) > x;
127
126
  return {
128
- ...m,
129
- clientX: v.clientX,
130
- clientY: v.clientY,
131
- moved: D,
132
- overCanvas: D && j(v.clientX, v.clientY)
127
+ ...w,
128
+ clientX: g.clientX,
129
+ clientY: g.clientY,
130
+ moved: E,
131
+ overCanvas: E && j(g.clientX, g.clientY)
133
132
  };
134
133
  });
135
- }, $ = (v) => {
136
- v.pointerId === o.pointerId && h(!0);
137
- }, A = (v) => {
138
- v.pointerId === o.pointerId && h(!1);
134
+ }, $ = (g) => {
135
+ g.pointerId === i.pointerId && f(!0);
136
+ }, A = (g) => {
137
+ g.pointerId === i.pointerId && f(!1);
139
138
  };
140
139
  window.addEventListener("pointermove", k, {
141
140
  signal: c.signal
@@ -146,8 +145,8 @@ function ie(e) {
146
145
  });
147
146
  }, b = () => s()?.type ?? null;
148
147
  return [(() => {
149
- var o = N(), r = o.firstChild;
150
- return r.nextSibling, o.addEventListener("pointerleave", () => a(null)), r.$$click = () => e.onShowAll(), r.addEventListener("pointerleave", () => a((n) => n === 0 ? null : n)), r.addEventListener("pointerenter", () => a(0)), g(r, d(C.span, {
148
+ var i = U(), r = i.firstChild;
149
+ return r.nextSibling, i.addEventListener("pointerleave", () => a(null)), r.$$click = () => e.onShowAll(), r.addEventListener("pointerleave", () => a((n) => n === 0 ? null : n)), r.addEventListener("pointerenter", () => a(0)), v(r, d(C.span, {
151
150
  class: "workbench-dock__tile",
152
151
  get animate() {
153
152
  return {
@@ -163,11 +162,11 @@ function ie(e) {
163
162
  };
164
163
  },
165
164
  get children() {
166
- return d(B, {
165
+ return d(G, {
167
166
  class: "workbench-dock__icon"
168
167
  });
169
168
  }
170
- }), null), g(r, d(C.span, {
169
+ }), null), v(r, d(C.span, {
171
170
  class: "workbench-dock__tooltip",
172
171
  get animate() {
173
172
  return {
@@ -182,11 +181,13 @@ function ie(e) {
182
181
  };
183
182
  },
184
183
  children: "Show all widgets"
185
- }), null), g(o, d(P, {
186
- each: x,
184
+ }), null), v(i, d(T, {
185
+ get each() {
186
+ return e.widgetDefinitions;
187
+ },
187
188
  children: (n, u) => {
188
189
  const c = () => u() + 1;
189
- return d(J, {
190
+ return d(p, {
190
191
  get type() {
191
192
  return n.type;
192
193
  },
@@ -200,7 +201,7 @@ function ie(e) {
200
201
  return e.filters[n.type];
201
202
  },
202
203
  get hoverOffset() {
203
- return _(c());
204
+ return m(c());
204
205
  },
205
206
  get isDragging() {
206
207
  return b() === n.type;
@@ -208,39 +209,39 @@ function ie(e) {
208
209
  onEnter: () => a(c()),
209
210
  onLeave: () => a((k) => k === c() ? null : k),
210
211
  onSolo: () => e.onSoloFilter(n.type),
211
- onDragBegin: w
212
+ onDragBegin: _
212
213
  });
213
214
  }
214
- }), null), I((n) => {
215
- var u = !!f(), c = l() === 0, k = f();
215
+ }), null), D((n) => {
216
+ var u = !!h(), c = l() === 0, k = h();
216
217
  return u !== n.e && r.classList.toggle("is-active", n.e = u), c !== n.t && r.classList.toggle("is-hovered", n.t = c), k !== n.a && S(r, "aria-pressed", n.a = k), n;
217
218
  }, {
218
219
  e: void 0,
219
220
  t: void 0,
220
221
  a: void 0
221
- }), o;
222
- })(), d(Y, {
222
+ }), i;
223
+ })(), d(X, {
223
224
  get when() {
224
225
  return s()?.moved ?? !1;
225
226
  },
226
227
  get children() {
227
- return d(K, {
228
+ return d(J, {
228
229
  state: s
229
230
  });
230
231
  }
231
232
  })];
232
233
  }
233
- function K(e) {
234
+ function J(e) {
234
235
  const l = () => {
235
236
  const t = e.state();
236
237
  return t ? `translate3d(${t.clientX + 14}px, ${t.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
237
- }, a = () => e.state()?.overCanvas ?? !1, s = () => e.state()?.label ?? "", i = () => e.state()?.icon;
238
+ }, a = () => e.state()?.overCanvas ?? !1, s = () => e.state()?.label ?? "", o = () => e.state()?.icon;
238
239
  return d(F, {
239
240
  get children() {
240
- var t = U(), f = t.firstChild, _ = f.nextSibling, h = _.firstChild, w = h.nextSibling, b = w.firstChild, o = b.nextSibling, r = o.firstChild;
241
- return g(h, d(Y, {
241
+ var t = V(), h = t.firstChild, m = h.nextSibling, f = m.firstChild, _ = f.nextSibling, b = _.firstChild, i = b.nextSibling, r = i.firstChild;
242
+ return v(f, d(X, {
242
243
  get when() {
243
- return i();
244
+ return o();
244
245
  },
245
246
  children: (n) => {
246
247
  const u = n();
@@ -248,9 +249,9 @@ function K(e) {
248
249
  class: "w-4 h-4"
249
250
  });
250
251
  }
251
- })), g(b, s), g(o, d(W, {
252
+ })), v(b, s), v(i, d(q, {
252
253
  class: "w-3 h-3"
253
- }), r), g(r, () => a() ? "Drop to create" : "Drag onto canvas"), I((n) => {
254
+ }), r), v(r, () => a() ? "Drop to create" : "Drag onto canvas"), D((n) => {
254
255
  var u = !!a(), c = l();
255
256
  return u !== n.e && t.classList.toggle("is-over-canvas", n.e = u), c !== n.t && H(t, "transform", n.t = c), n;
256
257
  }, {
@@ -260,7 +261,7 @@ function K(e) {
260
261
  }
261
262
  });
262
263
  }
263
- T(["pointerdown", "click"]);
264
+ P(["pointerdown", "click"]);
264
265
  export {
265
- ie as WorkbenchFilterBar
266
+ re as WorkbenchFilterBar
266
267
  };
@@ -1,4 +1,15 @@
1
- import type { WorkbenchState } from './types';
1
+ import type { WorkbenchState, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
2
+ export interface WorkbenchSurfaceApi {
3
+ ensureWidget: (type: WorkbenchWidgetType, options?: {
4
+ centerViewport?: boolean;
5
+ worldX?: number;
6
+ worldY?: number;
7
+ }) => WorkbenchWidgetItem | null;
8
+ focusWidget: (widget: WorkbenchWidgetItem, options?: {
9
+ centerViewport?: boolean;
10
+ }) => WorkbenchWidgetItem;
11
+ findWidgetByType: (type: WorkbenchWidgetType) => WorkbenchWidgetItem | null;
12
+ }
2
13
  export interface WorkbenchSurfaceProps {
3
14
  state: () => WorkbenchState;
4
15
  setState: (updater: (prev: WorkbenchState) => WorkbenchState) => void;
@@ -17,5 +28,7 @@ export interface WorkbenchSurfaceProps {
17
28
  * Optional class added to the surface root for layout integration.
18
29
  */
19
30
  class?: string;
31
+ widgetDefinitions?: readonly WorkbenchWidgetDefinition[];
32
+ onApiReady?: (api: WorkbenchSurfaceApi | null) => void;
20
33
  }
21
34
  export declare function WorkbenchSurface(props: WorkbenchSurfaceProps): import("solid-js").JSX.Element;