@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
@@ -1,122 +1,126 @@
1
- import { createSignal as k, createMemo as d } from "solid-js";
2
- import { ArrowUp as st, Copy as dt, Trash as lt } from "../icons/index.js";
3
- import { DEFAULT_WIDGET_DIMENSIONS as R, DEFAULT_FILTERS as at } from "./types.js";
4
- import { getTopZIndex as rt, createContextMenuPosition as gt, createWorkbenchId as ht, findNearestWidget as ut, clampScale as mt, WORKBENCH_CANVAS_ZOOM_STEP as z, WORKBENCH_CONTEXT_MENU_WIDTH_PX as ft, estimateContextMenuHeight as wt } from "./workbenchHelpers.js";
5
- import { WIDGET_REGISTRY as Wt, getWidgetEntry as xt } from "./widgets/widgetRegistry.js";
6
- function Yt(c) {
7
- const [u, m] = k(null), [H, M] = k(null), [X, L] = k({ width: 0, height: 0 }), r = c.state, g = d(() => r().widgets), h = d(() => r().viewport), P = d(() => r().locked), T = d(() => r().filters), w = d(() => r().selectedWidgetId), W = d(() => rt(g())), q = d(() => `${Math.round(h().scale * 100)}%`), U = (t) => {
8
- t && L({ width: t.clientWidth, height: t.clientHeight });
9
- }, V = (t) => {
10
- m({
1
+ import { createSignal as _, createMemo as s } from "solid-js";
2
+ import { ArrowUp as gt, Copy as ut, Trash as ht } from "../icons/index.js";
3
+ import { getTopZIndex as ft, createContextMenuPosition as wt, createWorkbenchId as mt, findNearestWidget as Wt, clampScale as xt, WORKBENCH_CANVAS_ZOOM_STEP as R, WORKBENCH_CONTEXT_MENU_WIDTH_PX as St, estimateContextMenuHeight as pt } from "./workbenchHelpers.js";
4
+ import { resolveWorkbenchWidgetDefinitions as Ct, getWidgetEntry as q, createWorkbenchFilterState as kt } from "./widgets/widgetRegistry.js";
5
+ function At(c) {
6
+ const [f, w] = _(null), [B, A] = _(null), [S, P] = _({ width: 0, height: 0 }), l = c.state, u = s(() => l().widgets), a = s(() => l().viewport), v = s(() => l().locked), D = s(() => l().filters), p = s(() => l().selectedWidgetId), C = s(() => ft(u())), Z = s(() => `${Math.round(a().scale * 100)}%`), $ = () => typeof c.widgetDefinitions == "function" ? c.widgetDefinitions() : c.widgetDefinitions, h = s(
7
+ () => Ct($())
8
+ ), j = (t) => {
9
+ t && P({ width: t.clientWidth, height: t.clientHeight });
10
+ }, K = (t) => {
11
+ w({
11
12
  clientX: t.clientX,
12
13
  clientY: t.clientY,
13
14
  worldX: t.worldX,
14
15
  worldY: t.worldY
15
16
  });
16
- }, Z = (t, e) => {
17
- f(e.id), m({
17
+ }, L = (t, e) => {
18
+ m(e.id), w({
18
19
  clientX: t.clientX,
19
20
  clientY: t.clientY,
20
21
  worldX: e.x,
21
22
  worldY: e.y,
22
23
  widgetId: e.id
23
24
  });
24
- }, a = () => m(null), Y = d(() => {
25
- const t = u();
25
+ }, g = () => w(null), U = (t) => l().widgets.find((e) => e.id === t) ?? null, k = (t) => l().widgets.find((e) => e.type === t) ?? null, T = s(() => {
26
+ const t = f();
26
27
  if (!t) return [];
27
28
  if (t.widgetId) {
28
- const e = g().find((i) => i.id === t.widgetId), n = [];
29
+ const e = u().find((i) => i.id === t.widgetId), n = [];
29
30
  return e && (n.push({
30
31
  id: "bring-to-front",
31
32
  kind: "action",
32
33
  label: "Bring to Front",
33
- icon: st,
34
+ icon: gt,
34
35
  onSelect: () => {
35
- f(e.id), a();
36
+ m(e.id), g();
36
37
  }
37
38
  }), n.push({
38
39
  id: "duplicate",
39
40
  kind: "action",
40
41
  label: "Duplicate",
41
- icon: dt,
42
+ icon: ut,
42
43
  onSelect: () => {
43
- F(e.type, e.x + 32, e.y + 32), a();
44
+ z(e.type, e.x + 32, e.y + 32), g();
44
45
  }
45
46
  })), n.push({ id: "separator-delete", kind: "separator" }), n.push({
46
47
  id: "delete",
47
48
  kind: "action",
48
49
  label: "Delete",
49
- icon: lt,
50
+ icon: ht,
50
51
  destructive: !0,
51
52
  onSelect: () => {
52
- t.widgetId && S(t.widgetId), a();
53
+ t.widgetId && Y(t.widgetId), g();
53
54
  }
54
55
  }), n;
55
56
  }
56
- return Wt.map((e) => ({
57
+ return h().map((e) => ({
57
58
  id: `add-${e.type}`,
58
59
  kind: "action",
59
60
  label: `Add ${e.label}`,
60
61
  icon: e.icon,
61
62
  onSelect: () => {
62
- _(e.type, t.worldX, t.worldY), a();
63
+ M(e.type, t.worldX, t.worldY), g();
63
64
  }
64
65
  }));
65
- }), B = d(() => {
66
- const t = u();
66
+ }), G = s(() => {
67
+ const t = f();
67
68
  if (!t) return;
68
- const e = Y(), n = e.filter((o) => o.kind === "action").length, i = e.filter((o) => o.kind === "separator").length;
69
- return gt({
69
+ const e = T(), n = e.filter((o) => o.kind === "action").length, i = e.filter((o) => o.kind === "separator").length;
70
+ return wt({
70
71
  clientX: t.clientX,
71
72
  clientY: t.clientY,
72
- menuWidth: ft,
73
- menuHeight: wt(n, i)
73
+ menuWidth: St,
74
+ menuHeight: pt(n, i)
74
75
  });
75
- }), x = (t, e, n) => {
76
- const i = xt(t), o = R[t], s = {
77
- id: ht(),
76
+ }), X = (t, e, n) => {
77
+ const i = q(t, h()), o = i.singleton ? k(t) : null;
78
+ if (o)
79
+ return W(o, { centerViewport: !0 });
80
+ const d = i.defaultSize, r = {
81
+ id: mt(),
78
82
  type: t,
79
83
  title: i.defaultTitle,
80
84
  x: e,
81
85
  y: n,
82
- width: o.width,
83
- height: o.height,
84
- z_index: W() + 1,
86
+ width: d.width,
87
+ height: d.height,
88
+ z_index: C() + 1,
85
89
  created_at_unix_ms: Date.now()
86
90
  };
87
- return c.setState((l) => ({
88
- ...l,
89
- widgets: [...l.widgets, s],
90
- selectedWidgetId: s.id
91
- })), s;
92
- }, _ = (t, e, n) => {
93
- const i = R[t];
94
- return x(t, e - i.width / 2, n - i.height / 2);
95
- }, F = (t, e, n) => x(t, e, n), S = (t) => {
91
+ return c.setState((x) => ({
92
+ ...x,
93
+ widgets: [...x.widgets, r],
94
+ selectedWidgetId: r.id
95
+ })), r;
96
+ }, M = (t, e, n) => {
97
+ const i = q(t, h()).defaultSize;
98
+ return X(t, e - i.width / 2, n - i.height / 2);
99
+ }, z = (t, e, n) => X(t, e, n), Y = (t) => {
96
100
  c.setState((e) => ({
97
101
  ...e,
98
102
  widgets: e.widgets.filter((n) => n.id !== t),
99
103
  selectedWidgetId: e.selectedWidgetId === t ? null : e.selectedWidgetId
100
104
  }));
101
- }, G = (t) => {
102
- M(t);
103
- }, f = (t) => {
104
- M(t);
105
- const e = W(), n = g().find((i) => i.id === t);
105
+ }, J = (t) => {
106
+ A(t);
107
+ }, m = (t) => {
108
+ A(t);
109
+ const e = C(), n = u().find((i) => i.id === t);
106
110
  n && n.z_index < e && c.setState((i) => ({
107
111
  ...i,
108
112
  widgets: i.widgets.map(
109
113
  (o) => o.id === t ? { ...o, z_index: e + 1 } : o
110
114
  )
111
115
  }));
112
- }, $ = (t, e) => {
116
+ }, Q = (t, e) => {
113
117
  c.setState((n) => ({
114
118
  ...n,
115
119
  widgets: n.widgets.map(
116
120
  (i) => i.id === t ? { ...i, x: e.x, y: e.y } : i
117
121
  )
118
122
  }));
119
- }, j = (t, e) => {
123
+ }, tt = (t, e) => {
120
124
  c.setState((n) => ({
121
125
  ...n,
122
126
  widgets: n.widgets.map(
@@ -125,74 +129,80 @@ function Yt(c) {
125
129
  }));
126
130
  }, I = (t) => {
127
131
  c.setState((e) => ({ ...e, viewport: t }));
128
- }, A = (t) => {
129
- const e = h(), n = X(), i = (n.width / 2 - e.x) / e.scale, o = (n.height / 2 - e.y) / e.scale, s = mt(
130
- t === "in" ? e.scale * z : e.scale / z
131
- ), l = {
132
- x: n.width / 2 - i * s,
133
- y: n.height / 2 - o * s,
134
- scale: s
132
+ }, O = (t) => {
133
+ const e = a(), n = S(), i = (n.width / 2 - e.x) / e.scale, o = (n.height / 2 - e.y) / e.scale, d = xt(
134
+ t === "in" ? e.scale * R : e.scale / R
135
+ ), r = {
136
+ x: n.width / 2 - i * d,
137
+ y: n.height / 2 - o * d,
138
+ scale: d
135
139
  };
136
- I(l);
137
- }, v = () => {
140
+ I(r);
141
+ }, et = () => {
138
142
  c.setState((t) => ({ ...t, locked: !t.locked }));
139
- }, K = (t) => {
143
+ }, nt = (t) => {
140
144
  c.setState((e) => ({
141
145
  ...e,
142
146
  filters: { ...e.filters, [t]: !e.filters[t] }
143
147
  }));
144
- }, J = (t) => {
148
+ }, it = (t) => {
145
149
  c.setState((e) => {
146
150
  const n = { ...e.filters };
147
151
  for (const i of Object.keys(n))
148
152
  n[i] = i === t;
149
153
  return { ...e, filters: n };
150
154
  });
151
- }, Q = () => {
152
- c.setState((t) => ({
153
- ...t,
154
- filters: { ...at }
155
+ }, ot = () => {
156
+ const t = kt(h());
157
+ c.setState((e) => ({
158
+ ...e,
159
+ filters: t
155
160
  }));
156
- }, E = (t) => {
161
+ }, V = (t) => {
157
162
  c.setState((e) => ({ ...e, selectedWidgetId: t }));
163
+ }, ct = () => {
164
+ const t = S(), e = a();
165
+ return {
166
+ worldX: t.width > 0 ? (t.width / 2 - e.x) / e.scale : 240,
167
+ worldY: t.height > 0 ? (t.height / 2 - e.y) / e.scale : 180
168
+ };
158
169
  };
159
- let O = 0;
160
- const tt = (t, e, n) => {
161
- const i = h(), o = i.x, s = i.y, l = i.scale, et = performance.now(), nt = 360, it = ++O, ot = (p) => 1 - Math.pow(1 - p, 3), D = (p) => {
162
- if (it !== O) return;
163
- const ct = p - et, N = Math.min(Math.max(ct / nt, 0), 1), C = ot(N);
170
+ let N = 0;
171
+ const st = (t, e, n) => {
172
+ const i = a(), o = i.x, d = i.y, r = i.scale, x = performance.now(), dt = 360, rt = ++N, lt = (F) => 1 - Math.pow(1 - F, 3), E = (F) => {
173
+ if (rt !== N) return;
174
+ const at = F - x, H = Math.min(Math.max(at / dt, 0), 1), b = lt(H);
164
175
  I({
165
- x: o + (t - o) * C,
166
- y: s + (e - s) * C,
167
- scale: l + (n - l) * C
168
- }), N < 1 && requestAnimationFrame(D);
176
+ x: o + (t - o) * b,
177
+ y: d + (e - d) * b,
178
+ scale: r + (n - r) * b
179
+ }), H < 1 && requestAnimationFrame(E);
169
180
  };
170
- requestAnimationFrame(D);
171
- }, b = (t) => {
172
- const e = X();
173
- if (e.width === 0 || e.height === 0) return;
174
- const n = h(), i = e.width / 2 - (t.x + t.width / 2) * n.scale, o = e.height / 2 - (t.y + t.height / 2) * n.scale;
175
- tt(i, o, n.scale);
181
+ requestAnimationFrame(E);
176
182
  }, y = (t) => {
177
- E(t.id), f(t.id), b(t);
178
- };
183
+ const e = S();
184
+ if (e.width === 0 || e.height === 0) return;
185
+ const n = a(), i = e.width / 2 - (t.x + t.width / 2) * n.scale, o = e.height / 2 - (t.y + t.height / 2) * n.scale;
186
+ st(i, o, n.scale);
187
+ }, W = (t, e = {}) => (V(t.id), m(t.id), e.centerViewport !== !1 && y(t), t);
179
188
  return {
180
- widgets: g,
181
- viewport: h,
182
- locked: P,
183
- filters: T,
184
- selectedWidgetId: w,
185
- topZIndex: W,
186
- scaleLabel: q,
187
- optimisticFrontWidgetId: H,
188
- setCanvasFrameRef: U,
189
+ widgets: u,
190
+ viewport: a,
191
+ locked: v,
192
+ filters: D,
193
+ selectedWidgetId: p,
194
+ topZIndex: C,
195
+ scaleLabel: Z,
196
+ optimisticFrontWidgetId: B,
197
+ widgetDefinitions: h,
198
+ setCanvasFrameRef: j,
189
199
  contextMenu: {
190
- state: u,
191
- items: Y,
192
- position: B,
193
- close: a,
200
+ state: f,
201
+ items: T,
202
+ position: G,
203
+ close: g,
194
204
  retarget: (t) => {
195
- t.preventDefault(), t.stopPropagation(), m({
205
+ t.preventDefault(), t.stopPropagation(), w({
196
206
  clientX: t.clientX,
197
207
  clientY: t.clientY,
198
208
  worldX: 0,
@@ -201,53 +211,68 @@ function Yt(c) {
201
211
  }
202
212
  },
203
213
  canvas: {
204
- openCanvasContextMenu: V,
205
- openWidgetContextMenu: Z,
206
- selectWidget: E,
207
- startOptimisticFront: G,
208
- commitFront: f,
209
- commitMove: $,
210
- commitResize: j,
214
+ openCanvasContextMenu: K,
215
+ openWidgetContextMenu: L,
216
+ selectWidget: V,
217
+ startOptimisticFront: J,
218
+ commitFront: m,
219
+ commitMove: Q,
220
+ commitResize: tt,
211
221
  commitViewport: I
212
222
  },
213
223
  hud: {
214
- zoomIn: () => A("in"),
215
- zoomOut: () => A("out")
224
+ zoomIn: () => O("in"),
225
+ zoomOut: () => O("out")
216
226
  },
217
227
  lock: {
218
- toggle: v
228
+ toggle: et
219
229
  },
220
230
  filter: {
221
- toggle: K,
222
- solo: J,
223
- showAll: Q
231
+ toggle: nt,
232
+ solo: it,
233
+ showAll: ot
224
234
  },
225
235
  navigation: {
226
236
  handleArrowNavigation: (t) => {
227
- const e = ut(
228
- g(),
229
- w(),
237
+ const e = Wt(
238
+ u(),
239
+ p(),
230
240
  t,
231
- T()
241
+ D()
232
242
  );
233
- e && y(e);
243
+ e && W(e);
234
244
  },
235
- centerOnWidget: b,
236
- focusWidget: y
245
+ centerOnWidget: y,
246
+ focusWidget: W
237
247
  },
238
248
  widgetActions: {
239
249
  deleteSelected: () => {
240
- const t = w();
241
- t && S(t);
250
+ const t = p();
251
+ t && Y(t);
242
252
  },
243
- deleteWidget: S,
244
- addWidget: x,
245
- addWidgetAtCursor: _,
246
- addWidgetCentered: F
253
+ deleteWidget: Y,
254
+ addWidget: X,
255
+ addWidgetAtCursor: M,
256
+ addWidgetCentered: z,
257
+ ensureWidget: (t, e) => {
258
+ const n = k(t);
259
+ if (n)
260
+ return W(n, { centerViewport: e?.centerViewport ?? !0 });
261
+ const i = ct(), o = M(
262
+ t,
263
+ e?.worldX ?? i.worldX,
264
+ e?.worldY ?? i.worldY
265
+ );
266
+ return (e?.centerViewport ?? !0) && o && y(o), o;
267
+ }
268
+ },
269
+ queries: {
270
+ findWidgetByType: k,
271
+ findWidgetById: U
247
272
  },
248
273
  handleCloseRequest: () => {
249
- if (u()) {
250
- a();
274
+ if (f()) {
275
+ g();
251
276
  return;
252
277
  }
253
278
  c.onClose();
@@ -255,5 +280,5 @@ function Yt(c) {
255
280
  };
256
281
  }
257
282
  export {
258
- Yt as useWorkbenchModel
283
+ At as useWorkbenchModel
259
284
  };
@@ -1,13 +1,14 @@
1
1
  import type { Component } from 'solid-js';
2
- import type { WorkbenchWidgetType } from '../types';
3
- export interface WidgetRegistryEntry {
4
- type: WorkbenchWidgetType;
2
+ import type { WorkbenchWidgetDefinition, WorkbenchWidgetType } from '../types';
3
+ export interface WidgetRegistryEntry extends WorkbenchWidgetDefinition {
5
4
  label: string;
6
5
  icon: Component<{
7
6
  class?: string;
8
7
  }>;
9
- body: Component;
10
8
  defaultTitle: string;
11
9
  }
12
10
  export declare const WIDGET_REGISTRY: readonly WidgetRegistryEntry[];
13
- export declare function getWidgetEntry(type: WorkbenchWidgetType): WidgetRegistryEntry;
11
+ export declare function resolveWorkbenchWidgetDefinitions(widgetDefinitions?: readonly WorkbenchWidgetDefinition[]): readonly WorkbenchWidgetDefinition[];
12
+ export declare function createWorkbenchFilterState(widgetDefinitions?: readonly WorkbenchWidgetDefinition[], filters?: Partial<Record<WorkbenchWidgetType, boolean>>): Record<WorkbenchWidgetType, boolean>;
13
+ export declare function isValidWorkbenchWidgetType(type: unknown, widgetDefinitions?: readonly WorkbenchWidgetDefinition[]): type is WorkbenchWidgetType;
14
+ export declare function getWidgetEntry(type: WorkbenchWidgetType, widgetDefinitions?: readonly WorkbenchWidgetDefinition[]): WorkbenchWidgetDefinition;
@@ -1,50 +1,71 @@
1
- import { Terminal as i, Folder as r, Cpu as l, Activity as d, FileCode as m } from "../../icons/index.js";
2
- import { TerminalWidget as n } from "./TerminalWidget.js";
3
- import { FileBrowserWidget as y } from "./FileBrowserWidget.js";
4
- import { SystemMonitorWidget as a } from "./SystemMonitorWidget.js";
5
- import { LogViewerWidget as f } from "./LogViewerWidget.js";
6
- import { CodeEditorWidget as p } from "./CodeEditorWidget.js";
7
- const e = [
1
+ import { Terminal as d, Folder as n, Cpu as a, Activity as f, FileCode as y } from "../../icons/index.js";
2
+ import { TerminalWidget as m } from "./TerminalWidget.js";
3
+ import { FileBrowserWidget as c } from "./FileBrowserWidget.js";
4
+ import { SystemMonitorWidget as p } from "./SystemMonitorWidget.js";
5
+ import { LogViewerWidget as u } from "./LogViewerWidget.js";
6
+ import { CodeEditorWidget as h } from "./CodeEditorWidget.js";
7
+ const g = [
8
8
  {
9
9
  type: "terminal",
10
10
  label: "Terminal",
11
- icon: i,
12
- body: n,
13
- defaultTitle: "Terminal"
11
+ icon: d,
12
+ body: m,
13
+ defaultTitle: "Terminal",
14
+ defaultSize: { width: 480, height: 320 }
14
15
  },
15
16
  {
16
17
  type: "file-browser",
17
18
  label: "File Browser",
18
- icon: r,
19
- body: y,
20
- defaultTitle: "File Browser"
19
+ icon: n,
20
+ body: c,
21
+ defaultTitle: "File Browser",
22
+ defaultSize: { width: 360, height: 400 }
21
23
  },
22
24
  {
23
25
  type: "system-monitor",
24
26
  label: "System Monitor",
25
- icon: l,
26
- body: a,
27
- defaultTitle: "System Monitor"
27
+ icon: a,
28
+ body: p,
29
+ defaultTitle: "System Monitor",
30
+ defaultSize: { width: 340, height: 280 }
28
31
  },
29
32
  {
30
33
  type: "log-viewer",
31
34
  label: "Log Viewer",
32
- icon: d,
33
- body: f,
34
- defaultTitle: "Log Viewer"
35
+ icon: f,
36
+ body: u,
37
+ defaultTitle: "Log Viewer",
38
+ defaultSize: { width: 500, height: 300 }
35
39
  },
36
40
  {
37
41
  type: "code-editor",
38
42
  label: "Code Editor",
39
- icon: m,
40
- body: p,
41
- defaultTitle: "Code Editor"
43
+ icon: y,
44
+ body: h,
45
+ defaultTitle: "Code Editor",
46
+ defaultSize: { width: 520, height: 380 }
42
47
  }
43
48
  ];
44
- function w(o) {
45
- return e.find((t) => t.type === o) ?? e[0];
49
+ function l(e) {
50
+ return e && e.length > 0 ? e : g;
51
+ }
52
+ function E(e, t) {
53
+ const o = l(e), i = {};
54
+ for (const r of o)
55
+ i[r.type] = typeof t?.[r.type] == "boolean" ? !!t[r.type] : !0;
56
+ return i;
57
+ }
58
+ function F(e, t) {
59
+ return typeof e == "string" && l(t).some((o) => o.type === e);
60
+ }
61
+ function v(e, t) {
62
+ const o = l(t);
63
+ return o.find((i) => i.type === e) ?? o[0];
46
64
  }
47
65
  export {
48
- e as WIDGET_REGISTRY,
49
- w as getWidgetEntry
66
+ g as WIDGET_REGISTRY,
67
+ E as createWorkbenchFilterState,
68
+ v as getWidgetEntry,
69
+ F as isValidWorkbenchWidgetType,
70
+ l as resolveWorkbenchWidgetDefinitions
50
71
  };
@@ -1,9 +1,13 @@
1
- import { type WorkbenchState, type WorkbenchViewport, type WorkbenchWidgetItem, type WorkbenchWidgetType } from './types';
1
+ import { type WorkbenchState, type WorkbenchViewport, type WorkbenchWidgetDefinition, type WorkbenchWidgetItem, type WorkbenchWidgetType } from './types';
2
2
  export declare function createWorkbenchId(): string;
3
3
  export declare function sanitizeViewport(viewport: Partial<WorkbenchViewport> | undefined): WorkbenchViewport;
4
- export declare function sanitizeFilters(filters: Partial<Record<WorkbenchWidgetType, boolean>> | undefined): Record<WorkbenchWidgetType, boolean>;
5
- export declare function sanitizeWorkbenchState(input: unknown): WorkbenchState;
6
- export declare function createDefaultWorkbenchState(): WorkbenchState;
4
+ export declare function sanitizeFilters(filters: Partial<Record<WorkbenchWidgetType, boolean>> | undefined, widgetDefinitions?: readonly WorkbenchWidgetDefinition[]): Record<WorkbenchWidgetType, boolean>;
5
+ export interface SanitizeWorkbenchStateOptions {
6
+ widgetDefinitions?: readonly WorkbenchWidgetDefinition[];
7
+ createFallbackState?: () => WorkbenchState;
8
+ }
9
+ export declare function sanitizeWorkbenchState(input: unknown, options?: SanitizeWorkbenchStateOptions): WorkbenchState;
10
+ export declare function createDefaultWorkbenchState(widgetDefinitions?: readonly WorkbenchWidgetDefinition[]): WorkbenchState;
7
11
  export declare const WORKBENCH_CANVAS_ZOOM_STEP = 1.18;
8
12
  export declare const WORKBENCH_CONTEXT_MENU_WIDTH_PX = 200;
9
13
  export declare function createContextMenuPosition(options: {