@floegence/floe-webapp-core 0.36.74 → 0.36.76
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.
- package/dist/app/ActivityAppsMain.d.ts +2 -0
- package/dist/app/ActivityAppsMain.js +15 -12
- package/dist/components/layout/ActivityBar.js +1 -1
- package/dist/components/layout/KeepAliveStack.d.ts +2 -0
- package/dist/components/layout/KeepAliveStack.js +109 -96
- package/dist/components/layout/Shell.d.ts +2 -0
- package/dist/components/layout/Shell.js +167 -139
- package/dist/components/ui/Tabs.js +102 -103
- package/dist/components/workbench/WorkbenchCanvas.d.ts +1 -0
- package/dist/components/workbench/WorkbenchCanvas.js +34 -25
- package/dist/components/workbench/WorkbenchCanvasField.d.ts +1 -0
- package/dist/components/workbench/WorkbenchCanvasField.js +18 -12
- package/dist/components/workbench/WorkbenchSurface.d.ts +6 -0
- package/dist/components/workbench/WorkbenchSurface.js +198 -161
- package/dist/components/workbench/WorkbenchWidget.d.ts +1 -0
- package/dist/components/workbench/WorkbenchWidget.js +183 -176
- package/dist/full.js +59 -57
- package/dist/index.js +58 -56
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/uiFirstSelection.d.ts +31 -0
- package/dist/utils/uiFirstSelection.js +70 -0
- package/package.json +1 -1
|
@@ -1,143 +1,181 @@
|
|
|
1
|
-
import { use as
|
|
2
|
-
import { createSignal as p, createMemo as
|
|
3
|
-
import { clientToCanvasWorld as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
20
|
+
i.focus({
|
|
20
21
|
preventScroll: !0
|
|
21
22
|
});
|
|
22
23
|
} catch {
|
|
23
|
-
|
|
24
|
+
i.focus();
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
const t =
|
|
28
|
-
state: () =>
|
|
29
|
-
setState: (e) =>
|
|
30
|
-
widgetDefinitions: () =>
|
|
31
|
-
textAnnotationDefaults: () =>
|
|
32
|
-
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
|
-
}),
|
|
36
|
-
|
|
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
|
-
}),
|
|
39
|
-
const e = t.widgetDefinitions(), n =
|
|
76
|
+
}), Y = w(() => {
|
|
77
|
+
const e = t.widgetDefinitions(), n = S();
|
|
40
78
|
return n ? e.filter((o) => n.has(o.type)) : e;
|
|
41
|
-
}),
|
|
42
|
-
const e = t.contextMenu.state(), n = t.contextMenu.items(), o =
|
|
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
|
|
46
|
-
return
|
|
83
|
+
const L = /^add-(.+)$/.exec(String(m.id ?? ""));
|
|
84
|
+
return L ? o.has(L[1]) : !0;
|
|
47
85
|
}) : n;
|
|
48
|
-
if (!e || !
|
|
86
|
+
if (!e || !i.resolveContextMenuItems)
|
|
49
87
|
return r;
|
|
50
|
-
const
|
|
51
|
-
return
|
|
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:
|
|
93
|
+
widget: d,
|
|
56
94
|
closeMenu: t.contextMenu.close
|
|
57
95
|
});
|
|
58
|
-
}),
|
|
96
|
+
}), M = w(() => {
|
|
59
97
|
const e = t.contextMenu.state();
|
|
60
98
|
if (!e) return;
|
|
61
|
-
const n =
|
|
62
|
-
return
|
|
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:
|
|
66
|
-
menuHeight:
|
|
103
|
+
menuWidth: ue,
|
|
104
|
+
menuHeight: se(o, r)
|
|
67
105
|
});
|
|
68
|
-
}),
|
|
69
|
-
const r =
|
|
70
|
-
if (
|
|
71
|
-
if (t.queries.findStickyNoteById(
|
|
72
|
-
|
|
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
|
-
|
|
113
|
+
g(r.createWidgetInputOwner(d, n));
|
|
76
114
|
return;
|
|
77
115
|
}
|
|
78
|
-
const m =
|
|
79
|
-
m && e instanceof Node && m.contains(e) &&
|
|
80
|
-
},
|
|
81
|
-
const n =
|
|
82
|
-
t.selection.clear(),
|
|
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
|
-
|
|
124
|
+
T(o);
|
|
87
125
|
return;
|
|
88
126
|
}
|
|
89
|
-
const
|
|
90
|
-
|
|
127
|
+
const a = n.findWidgetRoot(r);
|
|
128
|
+
T(o), a && document.activeElement === r && r.isConnected && r.blur();
|
|
91
129
|
});
|
|
92
|
-
},
|
|
93
|
-
const e =
|
|
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:
|
|
134
|
+
worldY: a > 0 ? (a / 2 - n.y) / n.scale : 180
|
|
97
135
|
};
|
|
98
|
-
},
|
|
99
|
-
const n = C(
|
|
136
|
+
}, f = (e) => {
|
|
137
|
+
const n = C(c), o = C(s);
|
|
100
138
|
queueMicrotask(() => {
|
|
101
|
-
n.focusWidgetElement(o, e),
|
|
139
|
+
n.focusWidgetElement(o, e), g(n.createWidgetInputOwner(e, "activation"));
|
|
102
140
|
});
|
|
103
|
-
},
|
|
141
|
+
}, P = (e) => {
|
|
104
142
|
const n = t.navigation.fitWidget(e);
|
|
105
|
-
|
|
106
|
-
},
|
|
143
|
+
f(n.id);
|
|
144
|
+
}, V = (e) => {
|
|
107
145
|
const n = t.navigation.overviewWidget(e);
|
|
108
|
-
|
|
146
|
+
f(n.id);
|
|
109
147
|
};
|
|
110
|
-
|
|
111
|
-
|
|
148
|
+
k(() => {
|
|
149
|
+
i.onApiReady?.({
|
|
112
150
|
ensureWidget: (e, n) => t.widgetActions.ensureWidget(e, n) ?? null,
|
|
113
151
|
createWidget: (e, n) => {
|
|
114
|
-
const o =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
164
|
+
const n = y();
|
|
127
165
|
return t.widgetActions.addBackgroundLayerAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
|
|
128
166
|
},
|
|
129
|
-
clearSelection: () =>
|
|
167
|
+
clearSelection: () => I("selection_cleared"),
|
|
130
168
|
focusWidget: (e, n) => {
|
|
131
169
|
const o = t.navigation.focusWidget(e, n);
|
|
132
|
-
return
|
|
170
|
+
return f(o.id), o;
|
|
133
171
|
},
|
|
134
172
|
fitWidget: (e) => {
|
|
135
173
|
const n = t.navigation.fitWidget(e);
|
|
136
|
-
return
|
|
174
|
+
return f(n.id), n;
|
|
137
175
|
},
|
|
138
176
|
overviewWidget: (e) => {
|
|
139
177
|
const n = t.navigation.overviewWidget(e);
|
|
140
|
-
return
|
|
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 ||
|
|
150
|
-
...
|
|
151
|
-
widgets:
|
|
152
|
-
...
|
|
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
|
-
} :
|
|
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
|
-
}),
|
|
164
|
-
|
|
201
|
+
}), A(() => {
|
|
202
|
+
i.onApiReady?.(null);
|
|
165
203
|
});
|
|
166
204
|
});
|
|
167
|
-
const
|
|
168
|
-
|
|
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 =
|
|
208
|
+
const e = ce({
|
|
171
209
|
ownerWindow: window,
|
|
172
210
|
onDismiss: t.contextMenu.close
|
|
173
211
|
});
|
|
174
|
-
|
|
175
|
-
}),
|
|
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) ||
|
|
179
|
-
}),
|
|
180
|
-
const e =
|
|
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
|
-
|
|
221
|
+
x(r.target, "pointer", "background_pointer");
|
|
184
222
|
}, o = (r) => {
|
|
185
|
-
|
|
223
|
+
x(r.target, "focus", "background_focus");
|
|
186
224
|
};
|
|
187
|
-
e.addEventListener("pointerdown", n, !0), e.addEventListener("focusin", o),
|
|
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
|
-
}),
|
|
191
|
-
if (
|
|
192
|
-
const e =
|
|
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 (!
|
|
199
|
-
root:
|
|
236
|
+
if (!c().shouldBypassGlobalHotkeys({
|
|
237
|
+
root: s(),
|
|
200
238
|
target: o.target,
|
|
201
239
|
owner: h(),
|
|
202
|
-
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),
|
|
262
|
+
document.addEventListener("keydown", n, !0), A(() => document.removeEventListener("keydown", n, !0));
|
|
225
263
|
});
|
|
226
|
-
const
|
|
264
|
+
const W = (e, n, o) => {
|
|
227
265
|
if (o?.canvasFrame)
|
|
228
|
-
return
|
|
266
|
+
return B(o.canvasFrame, t.viewport(), {
|
|
229
267
|
clientX: e,
|
|
230
268
|
clientY: n
|
|
231
269
|
});
|
|
232
|
-
const r =
|
|
270
|
+
const r = s()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
|
|
233
271
|
if (!r) return null;
|
|
234
|
-
const
|
|
235
|
-
return
|
|
272
|
+
const a = r.getBoundingClientRect();
|
|
273
|
+
return B(a, t.viewport(), {
|
|
236
274
|
clientX: e,
|
|
237
275
|
clientY: n
|
|
238
276
|
});
|
|
239
|
-
},
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
},
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
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(
|
|
284
|
+
t.widgetActions.addStickyNoteAtCursor(a.worldX, a.worldY);
|
|
247
285
|
return;
|
|
248
286
|
}
|
|
249
287
|
if (e === "text") {
|
|
250
|
-
t.widgetActions.addTextAnnotationAtCursor(
|
|
288
|
+
t.widgetActions.addTextAnnotationAtCursor(a.worldX, a.worldY);
|
|
251
289
|
return;
|
|
252
290
|
}
|
|
253
|
-
e === "background-region" && t.widgetActions.addBackgroundLayerAtCursor(
|
|
291
|
+
e === "background-region" && t.widgetActions.addBackgroundLayerAtCursor(a.worldX, a.worldY);
|
|
254
292
|
}
|
|
255
|
-
},
|
|
256
|
-
e.button === 0 &&
|
|
257
|
-
},
|
|
258
|
-
const e =
|
|
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 =
|
|
261
|
-
return n ? e.kind === "widget" ?
|
|
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
|
-
}) :
|
|
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:
|
|
274
|
-
backgroundDefaults:
|
|
311
|
+
textDefaults: i.textAnnotationDefaults,
|
|
312
|
+
backgroundDefaults: i.backgroundLayerDefaults
|
|
275
313
|
}) : null;
|
|
276
314
|
});
|
|
277
315
|
return (() => {
|
|
278
|
-
var e =
|
|
279
|
-
return
|
|
316
|
+
var e = ve(), n = e.firstChild;
|
|
317
|
+
return j(X, e), K(e, Z({
|
|
280
318
|
get class() {
|
|
281
|
-
return `workbench-surface${
|
|
319
|
+
return `workbench-surface${i.class ? ` ${i.class}` : ""}`;
|
|
282
320
|
}
|
|
283
321
|
}, () => ({
|
|
284
|
-
[
|
|
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),
|
|
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
|
|
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
|
|
357
|
+
return F();
|
|
320
358
|
},
|
|
321
359
|
get selectedObject() {
|
|
322
|
-
return
|
|
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
|
|
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:
|
|
352
|
-
|
|
353
|
-
|
|
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:
|
|
431
|
-
onRequestFit:
|
|
467
|
+
onRequestOverview: V,
|
|
468
|
+
onRequestFit: P,
|
|
432
469
|
get onRequestDelete() {
|
|
433
|
-
return
|
|
470
|
+
return i.onRequestDelete ?? t.widgetActions.deleteWidget;
|
|
434
471
|
},
|
|
435
472
|
get onLayoutInteractionStart() {
|
|
436
|
-
return
|
|
473
|
+
return i.onLayoutInteractionStart;
|
|
437
474
|
},
|
|
438
475
|
get onLayoutInteractionEnd() {
|
|
439
|
-
return
|
|
476
|
+
return i.onLayoutInteractionEnd;
|
|
440
477
|
}
|
|
441
|
-
})),
|
|
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
|
|
486
|
+
return D() ?? void 0;
|
|
450
487
|
}
|
|
451
|
-
}), null),
|
|
488
|
+
}), null), v(e, l(re, {
|
|
452
489
|
get widgetDefinitions() {
|
|
453
|
-
return
|
|
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:
|
|
479
|
-
onDragPreviewChange:
|
|
480
|
-
}), null),
|
|
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),
|
|
531
|
+
}), null), v(e, l(ee, {
|
|
495
532
|
get when() {
|
|
496
533
|
return t.contextMenu.state();
|
|
497
534
|
},
|
|
498
535
|
get children() {
|
|
499
|
-
return
|
|
536
|
+
return l(G, {
|
|
500
537
|
get children() {
|
|
501
538
|
return [(() => {
|
|
502
|
-
var o =
|
|
503
|
-
return
|
|
504
|
-
})(),
|
|
539
|
+
var o = me();
|
|
540
|
+
return J(o, "contextmenu", t.contextMenu.retarget, !0), o;
|
|
541
|
+
})(), l(oe, {
|
|
505
542
|
get x() {
|
|
506
|
-
return
|
|
543
|
+
return M()?.left ?? 0;
|
|
507
544
|
},
|
|
508
545
|
get y() {
|
|
509
|
-
return
|
|
546
|
+
return M()?.top ?? 0;
|
|
510
547
|
},
|
|
511
548
|
get items() {
|
|
512
|
-
return
|
|
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
|
-
|
|
558
|
+
Q(["contextmenu"]);
|
|
522
559
|
export {
|
|
523
|
-
|
|
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;
|