@floegence/floe-webapp-core 0.36.75 → 0.36.77

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,143 +1,181 @@
1
- import { use as V, spread as z, mergeProps as H, insert as f, createComponent as s, Portal as $, addEventListener as U, template as T, delegateEvents as K } from "solid-js/web";
2
- import { createSignal as p, createMemo as g, untrack as C, createEffect as v, onCleanup as y, Show as j } from "solid-js";
3
- import { clientToCanvasWorld as L } from "../ui/canvasGeometry.js";
4
- import { WorkbenchCanvas as Z } from "./WorkbenchCanvas.js";
5
- import { WorkbenchContextMenu as G } from "./WorkbenchContextMenu.js";
6
- import { WorkbenchDock as J } from "./WorkbenchFilterBar.js";
7
- import { WorkbenchHud as Q } from "./WorkbenchHud.js";
8
- import { WorkbenchLockButton as ee } from "./WorkbenchLockButton.js";
9
- import { installWorkbenchContextMenuDismissListeners as te } from "./workbenchContextMenuDismiss.js";
10
- import { createContextMenuPosition as ne, WORKBENCH_CONTEXT_MENU_WIDTH_PX as oe, estimateContextMenuHeight as re } from "./workbenchHelpers.js";
11
- import { resolveWorkbenchWidgetPlacementPreview as ie, resolveWorkbenchToolPlacementPreview as ae } from "./workbenchPlacement.js";
12
- import { useWorkbenchModel as ce } from "./useWorkbenchModel.js";
13
- import { resolveWorkbenchInteractionAdapter as de } from "./workbenchInteractionAdapter.js";
14
- var ue = /* @__PURE__ */ T("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), se = /* @__PURE__ */ T("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
15
- const le = "F1";
16
- function B(a) {
17
- if (a)
1
+ import { use as j, spread as K, mergeProps as Z, insert as v, createComponent as l, Portal as G, addEventListener as J, template as R, delegateEvents as Q } from "solid-js/web";
2
+ import { createSignal as p, createMemo as w, untrack as C, createEffect as k, onCleanup as A, Show as ee } from "solid-js";
3
+ import { clientToCanvasWorld as B } from "../ui/canvasGeometry.js";
4
+ import { createUIFirstSelection as te } from "../../utils/uiFirstSelection.js";
5
+ import { WorkbenchCanvas as ne } from "./WorkbenchCanvas.js";
6
+ import { WorkbenchContextMenu as oe } from "./WorkbenchContextMenu.js";
7
+ import { WorkbenchDock as re } from "./WorkbenchFilterBar.js";
8
+ import { WorkbenchHud as ie } from "./WorkbenchHud.js";
9
+ import { WorkbenchLockButton as ae } from "./WorkbenchLockButton.js";
10
+ import { installWorkbenchContextMenuDismissListeners as ce } from "./workbenchContextMenuDismiss.js";
11
+ import { createContextMenuPosition as de, WORKBENCH_CONTEXT_MENU_WIDTH_PX as ue, estimateContextMenuHeight as se } from "./workbenchHelpers.js";
12
+ import { resolveWorkbenchWidgetPlacementPreview as le, resolveWorkbenchToolPlacementPreview as ge } from "./workbenchPlacement.js";
13
+ import { useWorkbenchModel as we } from "./useWorkbenchModel.js";
14
+ import { resolveWorkbenchInteractionAdapter as fe } from "./workbenchInteractionAdapter.js";
15
+ var me = /* @__PURE__ */ R("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), ve = /* @__PURE__ */ R("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
16
+ const ke = "F1";
17
+ function T(i) {
18
+ if (i)
18
19
  try {
19
- a.focus({
20
+ i.focus({
20
21
  preventScroll: !0
21
22
  });
22
23
  } catch {
23
- a.focus();
24
+ i.focus();
24
25
  }
25
26
  }
26
- function Ie(a) {
27
- const t = ce({
28
- state: () => a.state(),
29
- setState: (e) => a.setState(e),
30
- widgetDefinitions: () => a.widgetDefinitions,
31
- textAnnotationDefaults: () => a.textAnnotationDefaults,
32
- backgroundLayerDefaults: () => a.backgroundLayerDefaults,
27
+ function Re(i) {
28
+ const t = we({
29
+ state: () => i.state(),
30
+ setState: (e) => i.setState(e),
31
+ widgetDefinitions: () => i.widgetDefinitions,
32
+ textAnnotationDefaults: () => i.textAnnotationDefaults,
33
+ backgroundLayerDefaults: () => i.backgroundLayerDefaults,
33
34
  onClose: () => {
34
35
  }
35
- }), [u, N] = p(null), [O, R] = p(null), d = g(() => de(a.interactionAdapter)), [h, l] = p(C(() => d().createInitialInputOwner())), W = g(() => {
36
- const e = a.launcherWidgetTypes;
36
+ }), u = te({
37
+ committed: t.selectedWidgetId,
38
+ commitEqualRequests: !0,
39
+ commit: (e, n) => {
40
+ if (!e) {
41
+ t.canvas.clearSelection();
42
+ return;
43
+ }
44
+ t.canvas.selectWidget(e), n?.bringToFront && t.canvas.commitFront(e);
45
+ },
46
+ onEvent: (e) => i.onWidgetActivationEvent?.(e)
47
+ }), F = () => i.widgetActivationMode === "after-paint" ? u.visual() : t.selectedWidgetId(), N = () => {
48
+ if (i.widgetActivationMode !== "after-paint" || !u.pending())
49
+ return t.selectedObject();
50
+ const e = u.visual();
51
+ return e ? {
52
+ kind: "widget",
53
+ id: e
54
+ } : null;
55
+ }, O = (e) => {
56
+ if (i.widgetActivationMode === "after-paint") {
57
+ if (u.pending() && u.visual() === e) return;
58
+ u.request(e, {
59
+ bringToFront: !1
60
+ });
61
+ return;
62
+ }
63
+ t.canvas.selectWidget(e);
64
+ }, E = (e) => {
65
+ if (i.widgetActivationMode === "after-paint") {
66
+ if (u.pending() && u.visual() === e) return;
67
+ u.request(e, {
68
+ bringToFront: !0
69
+ });
70
+ return;
71
+ }
72
+ t.canvas.selectWidget(e), t.canvas.commitFront(e);
73
+ }, [s, X] = p(null), [_, q] = p(null), c = w(() => fe(i.interactionAdapter)), [h, g] = p(C(() => c().createInitialInputOwner())), S = w(() => {
74
+ const e = i.launcherWidgetTypes;
37
75
  return !e || e.length <= 0 ? null : new Set(e);
38
- }), E = g(() => {
39
- const e = t.widgetDefinitions(), n = W();
76
+ }), Y = w(() => {
77
+ const e = t.widgetDefinitions(), n = S();
40
78
  return n ? e.filter((o) => n.has(o.type)) : e;
41
- }), S = g(() => {
42
- const e = t.contextMenu.state(), n = t.contextMenu.items(), o = W(), r = o ? n.filter((m) => {
79
+ }), b = w(() => {
80
+ const e = t.contextMenu.state(), n = t.contextMenu.items(), o = S(), r = o ? n.filter((m) => {
43
81
  if (m.kind !== "action")
44
82
  return !0;
45
- const D = /^add-(.+)$/.exec(String(m.id ?? ""));
46
- return D ? o.has(D[1]) : !0;
83
+ const L = /^add-(.+)$/.exec(String(m.id ?? ""));
84
+ return L ? o.has(L[1]) : !0;
47
85
  }) : n;
48
- if (!e || !a.resolveContextMenuItems)
86
+ if (!e || !i.resolveContextMenuItems)
49
87
  return r;
50
- const i = e.target?.kind === "widget" ? e.target.id : !e.target && e.widgetId ? e.widgetId : null, c = i ? t.queries.findWidgetById(i) : null;
51
- return a.resolveContextMenuItems({
88
+ const a = e.target?.kind === "widget" ? e.target.id : !e.target && e.widgetId ? e.widgetId : null, d = a ? t.queries.findWidgetById(a) : null;
89
+ return i.resolveContextMenuItems({
52
90
  menu: e,
53
91
  items: r,
54
92
  widgets: t.widgets(),
55
- widget: c,
93
+ widget: d,
56
94
  closeMenu: t.contextMenu.close
57
95
  });
58
- }), b = g(() => {
96
+ }), M = w(() => {
59
97
  const e = t.contextMenu.state();
60
98
  if (!e) return;
61
- const n = S(), o = n.filter((i) => i.kind === "action").length, r = n.filter((i) => i.kind === "separator").length;
62
- return ne({
99
+ const n = b(), o = n.filter((a) => a.kind === "action").length, r = n.filter((a) => a.kind === "separator").length;
100
+ return de({
63
101
  clientX: e.clientX,
64
102
  clientY: e.clientY,
65
- menuWidth: oe,
66
- menuHeight: re(o, r)
103
+ menuWidth: ue,
104
+ menuHeight: se(o, r)
67
105
  });
68
- }), I = (e, n, o) => {
69
- const r = d(), i = r.findWidgetRoot(e), c = r.readWidgetId(i);
70
- if (c) {
71
- if (t.queries.findStickyNoteById(c)) {
72
- l(r.createCanvasInputOwner(n === "focus" ? "background_focus" : "background_pointer"));
106
+ }), x = (e, n, o) => {
107
+ const r = c(), a = r.findWidgetRoot(e), d = r.readWidgetId(a);
108
+ if (d) {
109
+ if (t.queries.findStickyNoteById(d)) {
110
+ g(r.createCanvasInputOwner(n === "focus" ? "background_focus" : "background_pointer"));
73
111
  return;
74
112
  }
75
- l(r.createWidgetInputOwner(c, n));
113
+ g(r.createWidgetInputOwner(d, n));
76
114
  return;
77
115
  }
78
- const m = u();
79
- m && e instanceof Node && m.contains(e) && l(r.createCanvasInputOwner(o));
80
- }, x = (e = "selection_cleared") => {
81
- const n = d(), o = u();
82
- t.selection.clear(), l(n.createCanvasInputOwner(e)), queueMicrotask(() => {
116
+ const m = s();
117
+ m && e instanceof Node && m.contains(e) && g(r.createCanvasInputOwner(o));
118
+ }, I = (e = "selection_cleared") => {
119
+ const n = c(), o = s();
120
+ t.selection.clear(), g(n.createCanvasInputOwner(e)), queueMicrotask(() => {
83
121
  if (!o || typeof document > "u") return;
84
122
  const r = document.activeElement;
85
123
  if (!(r instanceof HTMLElement) || !o.contains(r)) {
86
- B(o);
124
+ T(o);
87
125
  return;
88
126
  }
89
- const i = n.findWidgetRoot(r);
90
- B(o), i && document.activeElement === r && r.isConnected && r.blur();
127
+ const a = n.findWidgetRoot(r);
128
+ T(o), a && document.activeElement === r && r.isConnected && r.blur();
91
129
  });
92
- }, k = () => {
93
- const e = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), n = t.viewport(), o = e?.getBoundingClientRect(), r = o?.width ?? 0, i = o?.height ?? 0;
130
+ }, y = () => {
131
+ const e = s()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), n = t.viewport(), o = e?.getBoundingClientRect(), r = o?.width ?? 0, a = o?.height ?? 0;
94
132
  return {
95
133
  worldX: r > 0 ? (r / 2 - n.x) / n.scale : 240,
96
- worldY: i > 0 ? (i / 2 - n.y) / n.scale : 180
134
+ worldY: a > 0 ? (a / 2 - n.y) / n.scale : 180
97
135
  };
98
- }, w = (e) => {
99
- const n = C(d), o = C(u);
136
+ }, f = (e) => {
137
+ const n = C(c), o = C(s);
100
138
  queueMicrotask(() => {
101
- n.focusWidgetElement(o, e), l(n.createWidgetInputOwner(e, "activation"));
139
+ n.focusWidgetElement(o, e), g(n.createWidgetInputOwner(e, "activation"));
102
140
  });
103
- }, F = (e) => {
141
+ }, P = (e) => {
104
142
  const n = t.navigation.fitWidget(e);
105
- w(n.id);
106
- }, X = (e) => {
143
+ f(n.id);
144
+ }, V = (e) => {
107
145
  const n = t.navigation.overviewWidget(e);
108
- w(n.id);
146
+ f(n.id);
109
147
  };
110
- v(() => {
111
- a.onApiReady?.({
148
+ k(() => {
149
+ i.onApiReady?.({
112
150
  ensureWidget: (e, n) => t.widgetActions.ensureWidget(e, n) ?? null,
113
151
  createWidget: (e, n) => {
114
- const o = k(), r = t.widgetActions.addWidgetAtWorldCenter(e, n?.worldX ?? o.worldX, n?.worldY ?? o.worldY) ?? null;
152
+ const o = y(), r = t.widgetActions.addWidgetAtWorldCenter(e, n?.worldX ?? o.worldX, n?.worldY ?? o.worldY) ?? null;
115
153
  return r && n?.centerViewport !== !1 && t.navigation.centerOnWidget(r), r;
116
154
  },
117
155
  createTextAnnotation: (e) => {
118
- const n = k();
156
+ const n = y();
119
157
  return t.widgetActions.addTextAnnotationAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
120
158
  },
121
159
  createStickyNote: (e) => {
122
- const n = k();
160
+ const n = y();
123
161
  return t.widgetActions.addStickyNoteAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
124
162
  },
125
163
  createBackgroundLayer: (e) => {
126
- const n = k();
164
+ const n = y();
127
165
  return t.widgetActions.addBackgroundLayerAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
128
166
  },
129
- clearSelection: () => x("selection_cleared"),
167
+ clearSelection: () => I("selection_cleared"),
130
168
  focusWidget: (e, n) => {
131
169
  const o = t.navigation.focusWidget(e, n);
132
- return w(o.id), o;
170
+ return f(o.id), o;
133
171
  },
134
172
  fitWidget: (e) => {
135
173
  const n = t.navigation.fitWidget(e);
136
- return w(n.id), n;
174
+ return f(n.id), n;
137
175
  },
138
176
  overviewWidget: (e) => {
139
177
  const n = t.navigation.overviewWidget(e);
140
- return w(n.id), n;
178
+ return f(n.id), n;
141
179
  },
142
180
  findWidgetByType: (e) => t.queries.findWidgetByType(e),
143
181
  findWidgetById: (e) => t.queries.findWidgetById(e),
@@ -146,12 +184,12 @@ function Ie(a) {
146
184
  findBackgroundLayerById: (e) => t.queries.findBackgroundLayerById(e),
147
185
  updateWidgetTitle: (e, n) => {
148
186
  const o = String(e ?? "").trim(), r = String(n ?? "").trim();
149
- !o || !r || a.setState((i) => ({
150
- ...i,
151
- widgets: i.widgets.map((c) => c.id === o && c.title !== r ? {
152
- ...c,
187
+ !o || !r || i.setState((a) => ({
188
+ ...a,
189
+ widgets: a.widgets.map((d) => d.id === o && d.title !== r ? {
190
+ ...d,
153
191
  title: r
154
- } : c)
192
+ } : d)
155
193
  }));
156
194
  },
157
195
  updateStickyNote: (e, n) => t.widgetActions.updateStickyNote(e, n),
@@ -160,46 +198,46 @@ function Ie(a) {
160
198
  deleteStickyNote: (e) => t.widgetActions.deleteStickyNote(e),
161
199
  deleteAnnotation: (e) => t.widgetActions.deleteAnnotation(e),
162
200
  deleteBackgroundLayer: (e) => t.widgetActions.deleteBackgroundLayer(e)
163
- }), y(() => {
164
- a.onApiReady?.(null);
201
+ }), A(() => {
202
+ i.onApiReady?.(null);
165
203
  });
166
204
  });
167
- const M = () => a.lockShortcut === void 0 ? le : a.lockShortcut;
168
- v(() => {
205
+ const D = () => i.lockShortcut === void 0 ? ke : i.lockShortcut;
206
+ k(() => {
169
207
  if (typeof window > "u" || !t.contextMenu.state()) return;
170
- const e = te({
208
+ const e = ce({
171
209
  ownerWindow: window,
172
210
  onDismiss: t.contextMenu.close
173
211
  });
174
- y(() => e());
175
- }), v(() => {
212
+ A(() => e());
213
+ }), k(() => {
176
214
  const e = h();
177
215
  if (e.kind !== "widget") return;
178
- t.widgets().some((o) => o.id === e.widgetId) || l(d().createCanvasInputOwner("widget_removed"));
179
- }), v(() => {
180
- const e = u();
216
+ t.widgets().some((o) => o.id === e.widgetId) || g(c().createCanvasInputOwner("widget_removed"));
217
+ }), k(() => {
218
+ const e = s();
181
219
  if (!e) return;
182
220
  const n = (r) => {
183
- I(r.target, "pointer", "background_pointer");
221
+ x(r.target, "pointer", "background_pointer");
184
222
  }, o = (r) => {
185
- I(r.target, "focus", "background_focus");
223
+ x(r.target, "focus", "background_focus");
186
224
  };
187
- e.addEventListener("pointerdown", n, !0), e.addEventListener("focusin", o), y(() => {
225
+ e.addEventListener("pointerdown", n, !0), e.addEventListener("focusin", o), A(() => {
188
226
  e.removeEventListener("pointerdown", n, !0), e.removeEventListener("focusin", o);
189
227
  });
190
- }), v(() => {
191
- if (a.enableKeyboard === !1 || typeof document > "u") return;
192
- const e = M(), n = (o) => {
228
+ }), k(() => {
229
+ if (i.enableKeyboard === !1 || typeof document > "u") return;
230
+ const e = D(), n = (o) => {
193
231
  if (!(o.defaultPrevented || o.isComposing)) {
194
232
  if (e !== null && o.key === e) {
195
233
  o.preventDefault(), t.lock.toggle();
196
234
  return;
197
235
  }
198
- if (!d().shouldBypassGlobalHotkeys({
199
- root: u(),
236
+ if (!c().shouldBypassGlobalHotkeys({
237
+ root: s(),
200
238
  target: o.target,
201
239
  owner: h(),
202
- interactiveSelector: d().interactiveSelector
240
+ interactiveSelector: c().interactiveSelector
203
241
  }))
204
242
  switch (o.key) {
205
243
  case "ArrowUp":
@@ -221,67 +259,67 @@ function Ie(a) {
221
259
  }
222
260
  }
223
261
  };
224
- document.addEventListener("keydown", n, !0), y(() => document.removeEventListener("keydown", n, !0));
262
+ document.addEventListener("keydown", n, !0), A(() => document.removeEventListener("keydown", n, !0));
225
263
  });
226
- const A = (e, n, o) => {
264
+ const W = (e, n, o) => {
227
265
  if (o?.canvasFrame)
228
- return L(o.canvasFrame, t.viewport(), {
266
+ return B(o.canvasFrame, t.viewport(), {
229
267
  clientX: e,
230
268
  clientY: n
231
269
  });
232
- const r = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
270
+ const r = s()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
233
271
  if (!r) return null;
234
- const i = r.getBoundingClientRect();
235
- return L(i, t.viewport(), {
272
+ const a = r.getBoundingClientRect();
273
+ return B(a, t.viewport(), {
236
274
  clientX: e,
237
275
  clientY: n
238
276
  });
239
- }, _ = (e, n, o, r) => {
240
- const i = A(n, o, r);
241
- i && t.widgetActions.addWidgetAtWorldCenter(e, i.worldX, i.worldY);
242
- }, Y = (e, n, o, r) => {
243
- const i = A(n, o, r);
244
- if (i) {
277
+ }, z = (e, n, o, r) => {
278
+ const a = W(n, o, r);
279
+ a && t.widgetActions.addWidgetAtWorldCenter(e, a.worldX, a.worldY);
280
+ }, H = (e, n, o, r) => {
281
+ const a = W(n, o, r);
282
+ if (a) {
245
283
  if (e === "sticky-note") {
246
- t.widgetActions.addStickyNoteAtCursor(i.worldX, i.worldY);
284
+ t.widgetActions.addStickyNoteAtCursor(a.worldX, a.worldY);
247
285
  return;
248
286
  }
249
287
  if (e === "text") {
250
- t.widgetActions.addTextAnnotationAtCursor(i.worldX, i.worldY);
288
+ t.widgetActions.addTextAnnotationAtCursor(a.worldX, a.worldY);
251
289
  return;
252
290
  }
253
- e === "background-region" && t.widgetActions.addBackgroundLayerAtCursor(i.worldX, i.worldY);
291
+ e === "background-region" && t.widgetActions.addBackgroundLayerAtCursor(a.worldX, a.worldY);
254
292
  }
255
- }, P = (e) => {
256
- e.button === 0 && x("background_pointer");
257
- }, q = g(() => {
258
- const e = O();
293
+ }, U = (e) => {
294
+ e.button === 0 && (c().findWidgetRoot(e.target) || I("background_pointer"));
295
+ }, $ = w(() => {
296
+ const e = _();
259
297
  if (!e) return null;
260
- const n = A(e.clientX, e.clientY, e);
261
- return n ? e.kind === "widget" ? ie({
298
+ const n = W(e.clientX, e.clientY, e);
299
+ return n ? e.kind === "widget" ? le({
262
300
  type: e.id,
263
301
  widgetDefinitions: t.widgetDefinitions(),
264
302
  worldX: n.worldX,
265
303
  worldY: n.worldY,
266
304
  dropAllowed: e.dropAllowed
267
- }) : ae({
305
+ }) : ge({
268
306
  tool: e.id,
269
307
  label: e.label,
270
308
  worldX: n.worldX,
271
309
  worldY: n.worldY,
272
310
  dropAllowed: e.dropAllowed,
273
- textDefaults: a.textAnnotationDefaults,
274
- backgroundDefaults: a.backgroundLayerDefaults
311
+ textDefaults: i.textAnnotationDefaults,
312
+ backgroundDefaults: i.backgroundLayerDefaults
275
313
  }) : null;
276
314
  });
277
315
  return (() => {
278
- var e = se(), n = e.firstChild;
279
- return V(N, e), z(e, H({
316
+ var e = ve(), n = e.firstChild;
317
+ return j(X, e), K(e, Z({
280
318
  get class() {
281
- return `workbench-surface${a.class ? ` ${a.class}` : ""}`;
319
+ return `workbench-surface${i.class ? ` ${i.class}` : ""}`;
282
320
  }
283
321
  }, () => ({
284
- [d().surfaceRootAttr]: "true"
322
+ [c().surfaceRootAttr]: "true"
285
323
  }), {
286
324
  get "data-workbench-theme"() {
287
325
  return t.theme();
@@ -290,7 +328,7 @@ function Ie(a) {
290
328
  return t.mode();
291
329
  },
292
330
  tabIndex: -1
293
- }), !1, !0), f(n, s(Z, {
331
+ }), !1, !0), v(n, l(ne, {
294
332
  get widgetDefinitions() {
295
333
  return t.widgetDefinitions();
296
334
  },
@@ -307,7 +345,7 @@ function Ie(a) {
307
345
  return t.backgroundLayers();
308
346
  },
309
347
  get placementPreview() {
310
- return q();
348
+ return $();
311
349
  },
312
350
  get viewport() {
313
351
  return t.viewport();
@@ -316,10 +354,10 @@ function Ie(a) {
316
354
  return t.canvasFrameSize();
317
355
  },
318
356
  get selectedWidgetId() {
319
- return t.selectedWidgetId();
357
+ return F();
320
358
  },
321
359
  get selectedObject() {
322
- return t.selectedObject();
360
+ return N();
323
361
  },
324
362
  get mode() {
325
363
  return t.mode();
@@ -334,7 +372,7 @@ function Ie(a) {
334
372
  return t.filters();
335
373
  },
336
374
  get interactionAdapter() {
337
- return d();
375
+ return c();
338
376
  },
339
377
  get setCanvasFrameRef() {
340
378
  return t.setCanvasFrameRef;
@@ -348,10 +386,9 @@ function Ie(a) {
348
386
  get onCanvasContextMenu() {
349
387
  return t.canvas.openCanvasContextMenu;
350
388
  },
351
- onCanvasPointerDown: P,
352
- get onSelectWidget() {
353
- return t.canvas.selectWidget;
354
- },
389
+ onCanvasPointerDown: U,
390
+ onSelectWidget: O,
391
+ onActivateWidget: E,
355
392
  get onWidgetContextMenu() {
356
393
  return t.canvas.openWidgetContextMenu;
357
394
  },
@@ -427,18 +464,18 @@ function Ie(a) {
427
464
  get onDeleteBackgroundLayer() {
428
465
  return t.widgetActions.deleteBackgroundLayer;
429
466
  },
430
- onRequestOverview: X,
431
- onRequestFit: F,
467
+ onRequestOverview: V,
468
+ onRequestFit: P,
432
469
  get onRequestDelete() {
433
- return a.onRequestDelete ?? t.widgetActions.deleteWidget;
470
+ return i.onRequestDelete ?? t.widgetActions.deleteWidget;
434
471
  },
435
472
  get onLayoutInteractionStart() {
436
- return a.onLayoutInteractionStart;
473
+ return i.onLayoutInteractionStart;
437
474
  },
438
475
  get onLayoutInteractionEnd() {
439
- return a.onLayoutInteractionEnd;
476
+ return i.onLayoutInteractionEnd;
440
477
  }
441
- })), f(e, s(ee, {
478
+ })), v(e, l(ae, {
442
479
  get locked() {
443
480
  return t.locked();
444
481
  },
@@ -446,11 +483,11 @@ function Ie(a) {
446
483
  return t.lock.toggle;
447
484
  },
448
485
  get shortcutLabel() {
449
- return M() ?? void 0;
486
+ return D() ?? void 0;
450
487
  }
451
- }), null), f(e, s(J, {
488
+ }), null), v(e, l(re, {
452
489
  get widgetDefinitions() {
453
- return E();
490
+ return Y();
454
491
  },
455
492
  get widgets() {
456
493
  return t.widgets();
@@ -474,10 +511,10 @@ function Ie(a) {
474
511
  return t.canvas.commitViewport;
475
512
  },
476
513
  onViewportInteractionStart: () => t.canvas.cancelViewportNavigation(),
477
- onCreateAt: _,
478
- onCreateToolAt: Y,
479
- onDragPreviewChange: R
480
- }), null), f(e, s(Q, {
514
+ onCreateAt: z,
515
+ onCreateToolAt: H,
516
+ onDragPreviewChange: q
517
+ }), null), v(e, l(ie, {
481
518
  get scaleLabel() {
482
519
  return t.scaleLabel();
483
520
  },
@@ -491,25 +528,25 @@ function Ie(a) {
491
528
  return t.theme();
492
529
  },
493
530
  onSelectTheme: (o) => t.appearance.setTheme(o)
494
- }), null), f(e, s(j, {
531
+ }), null), v(e, l(ee, {
495
532
  get when() {
496
533
  return t.contextMenu.state();
497
534
  },
498
535
  get children() {
499
- return s($, {
536
+ return l(G, {
500
537
  get children() {
501
538
  return [(() => {
502
- var o = ue();
503
- return U(o, "contextmenu", t.contextMenu.retarget, !0), o;
504
- })(), s(G, {
539
+ var o = me();
540
+ return J(o, "contextmenu", t.contextMenu.retarget, !0), o;
541
+ })(), l(oe, {
505
542
  get x() {
506
- return b()?.left ?? 0;
543
+ return M()?.left ?? 0;
507
544
  },
508
545
  get y() {
509
- return b()?.top ?? 0;
546
+ return M()?.top ?? 0;
510
547
  },
511
548
  get items() {
512
- return S();
549
+ return b();
513
550
  }
514
551
  })];
515
552
  }
@@ -518,7 +555,7 @@ function Ie(a) {
518
555
  }), null), e;
519
556
  })();
520
557
  }
521
- K(["contextmenu"]);
558
+ Q(["contextmenu"]);
522
559
  export {
523
- Ie as WorkbenchSurface
560
+ Re as WorkbenchSurface
524
561
  };
@@ -25,6 +25,7 @@ export interface WorkbenchWidgetProps {
25
25
  interactionAdapter?: WorkbenchInteractionAdapter | ResolvedWorkbenchInteractionAdapter;
26
26
  viewport?: WorkbenchViewport;
27
27
  onSelect: (widgetId: string) => void;
28
+ onActivate?: (widgetId: string) => void;
28
29
  onContextMenu: (event: MouseEvent, item: WorkbenchWidgetItem) => void;
29
30
  onClaimVisualFrontOwner: (widgetId: string) => void;
30
31
  onCommitFront: (widgetId: string) => void;