@floegence/floe-webapp-core 0.36.48 → 0.36.50
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/components/workbench/WorkbenchContextMenu.d.ts +6 -1
- package/dist/components/workbench/WorkbenchContextMenu.js +31 -25
- package/dist/components/workbench/WorkbenchFilterBar.js +146 -141
- package/dist/components/workbench/WorkbenchSurface.js +177 -177
- package/dist/components/workbench/index.d.ts +1 -1
- package/dist/components/workbench/useWorkbenchModel.d.ts +2 -2
- package/dist/components/workbench/useWorkbenchModel.js +247 -220
- package/dist/components/workbench/workbenchHelpers.d.ts +12 -0
- package/dist/components/workbench/workbenchHelpers.js +68 -48
- package/dist/workbench.js +23 -22
- package/package.json +1 -1
|
@@ -7,11 +7,11 @@ import { WorkbenchDock as j } from "./WorkbenchFilterBar.js";
|
|
|
7
7
|
import { WorkbenchHud as Z } from "./WorkbenchHud.js";
|
|
8
8
|
import { WorkbenchLockButton as G } from "./WorkbenchLockButton.js";
|
|
9
9
|
import { installWorkbenchContextMenuDismissListeners as J } from "./workbenchContextMenuDismiss.js";
|
|
10
|
-
import { createContextMenuPosition as Q, WORKBENCH_CONTEXT_MENU_WIDTH_PX as
|
|
11
|
-
import { useWorkbenchModel as
|
|
12
|
-
import { resolveWorkbenchInteractionAdapter as
|
|
13
|
-
var
|
|
14
|
-
const
|
|
10
|
+
import { createContextMenuPosition as Q, WORKBENCH_CONTEXT_MENU_WIDTH_PX as ee, estimateContextMenuHeight as te } from "./workbenchHelpers.js";
|
|
11
|
+
import { useWorkbenchModel as ne } from "./useWorkbenchModel.js";
|
|
12
|
+
import { resolveWorkbenchInteractionAdapter as oe } from "./workbenchInteractionAdapter.js";
|
|
13
|
+
var re = /* @__PURE__ */ D("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), ie = /* @__PURE__ */ D("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
|
|
14
|
+
const ae = "F1";
|
|
15
15
|
function B(i) {
|
|
16
16
|
if (i)
|
|
17
17
|
try {
|
|
@@ -22,52 +22,52 @@ function B(i) {
|
|
|
22
22
|
i.focus();
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
const
|
|
25
|
+
function Ae(i) {
|
|
26
|
+
const t = ne({
|
|
27
27
|
state: () => i.state(),
|
|
28
|
-
setState: (
|
|
28
|
+
setState: (e) => i.setState(e),
|
|
29
29
|
widgetDefinitions: () => i.widgetDefinitions,
|
|
30
30
|
textAnnotationDefaults: () => i.textAnnotationDefaults,
|
|
31
31
|
backgroundLayerDefaults: () => i.backgroundLayerDefaults,
|
|
32
32
|
onClose: () => {
|
|
33
33
|
}
|
|
34
|
-
}), [u, T] = L(null), d = f(() =>
|
|
35
|
-
const
|
|
36
|
-
return !
|
|
34
|
+
}), [u, T] = L(null), d = f(() => oe(i.interactionAdapter)), [A, l] = L(p(() => d().createInitialInputOwner())), C = f(() => {
|
|
35
|
+
const e = i.launcherWidgetTypes;
|
|
36
|
+
return !e || e.length <= 0 ? null : new Set(e);
|
|
37
37
|
}), N = f(() => {
|
|
38
|
-
const
|
|
39
|
-
return n ?
|
|
38
|
+
const e = t.widgetDefinitions(), n = C();
|
|
39
|
+
return n ? e.filter((o) => n.has(o.type)) : e;
|
|
40
40
|
}), h = f(() => {
|
|
41
|
-
const
|
|
41
|
+
const e = t.contextMenu.state(), n = t.contextMenu.items(), o = C(), r = o ? n.filter((m) => {
|
|
42
42
|
if (m.kind !== "action")
|
|
43
43
|
return !0;
|
|
44
44
|
const M = /^add-(.+)$/.exec(String(m.id ?? ""));
|
|
45
45
|
return M ? o.has(M[1]) : !0;
|
|
46
46
|
}) : n;
|
|
47
|
-
if (!
|
|
47
|
+
if (!e || !i.resolveContextMenuItems)
|
|
48
48
|
return r;
|
|
49
|
-
const a =
|
|
49
|
+
const a = e.target?.kind === "widget" ? e.target.id : !e.target && e.widgetId ? e.widgetId : null, c = a ? t.queries.findWidgetById(a) : null;
|
|
50
50
|
return i.resolveContextMenuItems({
|
|
51
|
-
menu:
|
|
51
|
+
menu: e,
|
|
52
52
|
items: r,
|
|
53
|
-
widgets:
|
|
53
|
+
widgets: t.widgets(),
|
|
54
54
|
widget: c,
|
|
55
|
-
closeMenu:
|
|
55
|
+
closeMenu: t.contextMenu.close
|
|
56
56
|
});
|
|
57
|
-
}),
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
57
|
+
}), W = f(() => {
|
|
58
|
+
const e = t.contextMenu.state();
|
|
59
|
+
if (!e) return;
|
|
60
60
|
const n = h(), o = n.filter((a) => a.kind === "action").length, r = n.filter((a) => a.kind === "separator").length;
|
|
61
61
|
return Q({
|
|
62
|
-
clientX:
|
|
63
|
-
clientY:
|
|
64
|
-
menuWidth:
|
|
65
|
-
menuHeight:
|
|
62
|
+
clientX: e.clientX,
|
|
63
|
+
clientY: e.clientY,
|
|
64
|
+
menuWidth: ee,
|
|
65
|
+
menuHeight: te(o, r)
|
|
66
66
|
});
|
|
67
|
-
}),
|
|
68
|
-
const r = d(), a = r.findWidgetRoot(
|
|
67
|
+
}), S = (e, n, o) => {
|
|
68
|
+
const r = d(), a = r.findWidgetRoot(e), c = r.readWidgetId(a);
|
|
69
69
|
if (c) {
|
|
70
|
-
if (
|
|
70
|
+
if (t.queries.findStickyNoteById(c)) {
|
|
71
71
|
l(r.createCanvasInputOwner(n === "focus" ? "background_focus" : "background_pointer"));
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
@@ -75,10 +75,10 @@ function At(i) {
|
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
const m = u();
|
|
78
|
-
m &&
|
|
79
|
-
}, b = (
|
|
78
|
+
m && e instanceof Node && m.contains(e) && l(r.createCanvasInputOwner(o));
|
|
79
|
+
}, b = (e = "selection_cleared") => {
|
|
80
80
|
const n = d(), o = u();
|
|
81
|
-
|
|
81
|
+
t.selection.clear(), l(n.createCanvasInputOwner(e)), queueMicrotask(() => {
|
|
82
82
|
if (!o || typeof document > "u") return;
|
|
83
83
|
const r = document.activeElement;
|
|
84
84
|
if (!(r instanceof HTMLElement) || !o.contains(r)) {
|
|
@@ -89,62 +89,62 @@ function At(i) {
|
|
|
89
89
|
B(o), a && document.activeElement === r && r.isConnected && r.blur();
|
|
90
90
|
});
|
|
91
91
|
}, k = () => {
|
|
92
|
-
const
|
|
92
|
+
const e = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), n = t.viewport(), o = e?.getBoundingClientRect(), r = o?.width ?? 0, a = o?.height ?? 0;
|
|
93
93
|
return {
|
|
94
94
|
worldX: r > 0 ? (r / 2 - n.x) / n.scale : 240,
|
|
95
95
|
worldY: a > 0 ? (a / 2 - n.y) / n.scale : 180
|
|
96
96
|
};
|
|
97
|
-
}, g = (
|
|
97
|
+
}, g = (e) => {
|
|
98
98
|
const n = p(d), o = p(u);
|
|
99
99
|
queueMicrotask(() => {
|
|
100
|
-
n.focusWidgetElement(o,
|
|
100
|
+
n.focusWidgetElement(o, e), l(n.createWidgetInputOwner(e, "activation"));
|
|
101
101
|
});
|
|
102
|
-
}, R = (
|
|
103
|
-
const n =
|
|
102
|
+
}, R = (e) => {
|
|
103
|
+
const n = t.navigation.fitWidget(e);
|
|
104
104
|
g(n.id);
|
|
105
|
-
}, O = (
|
|
106
|
-
const n =
|
|
105
|
+
}, O = (e) => {
|
|
106
|
+
const n = t.navigation.overviewWidget(e);
|
|
107
107
|
g(n.id);
|
|
108
108
|
};
|
|
109
109
|
v(() => {
|
|
110
110
|
i.onApiReady?.({
|
|
111
|
-
ensureWidget: (
|
|
112
|
-
createWidget: (
|
|
113
|
-
const o = k(), r =
|
|
114
|
-
return r && n?.centerViewport !== !1 &&
|
|
111
|
+
ensureWidget: (e, n) => t.widgetActions.ensureWidget(e, n) ?? null,
|
|
112
|
+
createWidget: (e, n) => {
|
|
113
|
+
const o = k(), r = t.widgetActions.addWidgetAtWorldCenter(e, n?.worldX ?? o.worldX, n?.worldY ?? o.worldY) ?? null;
|
|
114
|
+
return r && n?.centerViewport !== !1 && t.navigation.centerOnWidget(r), r;
|
|
115
115
|
},
|
|
116
|
-
createTextAnnotation: (
|
|
116
|
+
createTextAnnotation: (e) => {
|
|
117
117
|
const n = k();
|
|
118
|
-
return
|
|
118
|
+
return t.widgetActions.addTextAnnotationAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
|
|
119
119
|
},
|
|
120
|
-
createStickyNote: (
|
|
120
|
+
createStickyNote: (e) => {
|
|
121
121
|
const n = k();
|
|
122
|
-
return
|
|
122
|
+
return t.widgetActions.addStickyNoteAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
|
|
123
123
|
},
|
|
124
|
-
createBackgroundLayer: (
|
|
124
|
+
createBackgroundLayer: (e) => {
|
|
125
125
|
const n = k();
|
|
126
|
-
return
|
|
126
|
+
return t.widgetActions.addBackgroundLayerAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
|
|
127
127
|
},
|
|
128
128
|
clearSelection: () => b("selection_cleared"),
|
|
129
|
-
focusWidget: (
|
|
130
|
-
const o =
|
|
129
|
+
focusWidget: (e, n) => {
|
|
130
|
+
const o = t.navigation.focusWidget(e, n);
|
|
131
131
|
return g(o.id), o;
|
|
132
132
|
},
|
|
133
|
-
fitWidget: (
|
|
134
|
-
const n =
|
|
133
|
+
fitWidget: (e) => {
|
|
134
|
+
const n = t.navigation.fitWidget(e);
|
|
135
135
|
return g(n.id), n;
|
|
136
136
|
},
|
|
137
|
-
overviewWidget: (
|
|
138
|
-
const n =
|
|
137
|
+
overviewWidget: (e) => {
|
|
138
|
+
const n = t.navigation.overviewWidget(e);
|
|
139
139
|
return g(n.id), n;
|
|
140
140
|
},
|
|
141
|
-
findWidgetByType: (
|
|
142
|
-
findWidgetById: (
|
|
143
|
-
findStickyNoteById: (
|
|
144
|
-
findAnnotationById: (
|
|
145
|
-
findBackgroundLayerById: (
|
|
146
|
-
updateWidgetTitle: (
|
|
147
|
-
const o = String(
|
|
141
|
+
findWidgetByType: (e) => t.queries.findWidgetByType(e),
|
|
142
|
+
findWidgetById: (e) => t.queries.findWidgetById(e),
|
|
143
|
+
findStickyNoteById: (e) => t.queries.findStickyNoteById(e),
|
|
144
|
+
findAnnotationById: (e) => t.queries.findAnnotationById(e),
|
|
145
|
+
findBackgroundLayerById: (e) => t.queries.findBackgroundLayerById(e),
|
|
146
|
+
updateWidgetTitle: (e, n) => {
|
|
147
|
+
const o = String(e ?? "").trim(), r = String(n ?? "").trim();
|
|
148
148
|
!o || !r || i.setState((a) => ({
|
|
149
149
|
...a,
|
|
150
150
|
widgets: a.widgets.map((c) => c.id === o && c.title !== r ? {
|
|
@@ -153,45 +153,45 @@ function At(i) {
|
|
|
153
153
|
} : c)
|
|
154
154
|
}));
|
|
155
155
|
},
|
|
156
|
-
updateStickyNote: (
|
|
157
|
-
updateTextAnnotation: (
|
|
158
|
-
updateBackgroundLayer: (
|
|
159
|
-
deleteStickyNote: (
|
|
160
|
-
deleteAnnotation: (
|
|
161
|
-
deleteBackgroundLayer: (
|
|
156
|
+
updateStickyNote: (e, n) => t.widgetActions.updateStickyNote(e, n),
|
|
157
|
+
updateTextAnnotation: (e, n) => t.widgetActions.updateTextAnnotation(e, n),
|
|
158
|
+
updateBackgroundLayer: (e, n) => t.widgetActions.updateBackgroundLayer(e, n),
|
|
159
|
+
deleteStickyNote: (e) => t.widgetActions.deleteStickyNote(e),
|
|
160
|
+
deleteAnnotation: (e) => t.widgetActions.deleteAnnotation(e),
|
|
161
|
+
deleteBackgroundLayer: (e) => t.widgetActions.deleteBackgroundLayer(e)
|
|
162
162
|
}), y(() => {
|
|
163
163
|
i.onApiReady?.(null);
|
|
164
164
|
});
|
|
165
165
|
});
|
|
166
|
-
const I = () => i.lockShortcut === void 0 ?
|
|
166
|
+
const I = () => i.lockShortcut === void 0 ? ae : i.lockShortcut;
|
|
167
167
|
v(() => {
|
|
168
|
-
if (typeof window > "u" || !
|
|
169
|
-
const
|
|
168
|
+
if (typeof window > "u" || !t.contextMenu.state()) return;
|
|
169
|
+
const e = J({
|
|
170
170
|
ownerWindow: window,
|
|
171
|
-
onDismiss:
|
|
171
|
+
onDismiss: t.contextMenu.close
|
|
172
172
|
});
|
|
173
|
-
y(() =>
|
|
173
|
+
y(() => e());
|
|
174
174
|
}), v(() => {
|
|
175
|
-
const
|
|
176
|
-
if (
|
|
177
|
-
|
|
175
|
+
const e = A();
|
|
176
|
+
if (e.kind !== "widget") return;
|
|
177
|
+
t.widgets().some((o) => o.id === e.widgetId) || l(d().createCanvasInputOwner("widget_removed"));
|
|
178
178
|
}), v(() => {
|
|
179
|
-
const
|
|
180
|
-
if (!
|
|
179
|
+
const e = u();
|
|
180
|
+
if (!e) return;
|
|
181
181
|
const n = (r) => {
|
|
182
|
-
|
|
182
|
+
S(r.target, "pointer", "background_pointer");
|
|
183
183
|
}, o = (r) => {
|
|
184
|
-
|
|
184
|
+
S(r.target, "focus", "background_focus");
|
|
185
185
|
};
|
|
186
|
-
|
|
187
|
-
|
|
186
|
+
e.addEventListener("pointerdown", n, !0), e.addEventListener("focusin", o), y(() => {
|
|
187
|
+
e.removeEventListener("pointerdown", n, !0), e.removeEventListener("focusin", o);
|
|
188
188
|
});
|
|
189
189
|
}), v(() => {
|
|
190
190
|
if (i.enableKeyboard === !1 || typeof document > "u") return;
|
|
191
|
-
const
|
|
191
|
+
const e = I(), n = (o) => {
|
|
192
192
|
if (!(o.defaultPrevented || o.isComposing)) {
|
|
193
|
-
if (
|
|
194
|
-
o.preventDefault(),
|
|
193
|
+
if (e !== null && o.key === e) {
|
|
194
|
+
o.preventDefault(), t.lock.toggle();
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
197
|
if (!d().shouldBypassGlobalHotkeys({
|
|
@@ -202,56 +202,56 @@ function At(i) {
|
|
|
202
202
|
}))
|
|
203
203
|
switch (o.key) {
|
|
204
204
|
case "ArrowUp":
|
|
205
|
-
o.preventDefault(),
|
|
205
|
+
o.preventDefault(), t.navigation.handleArrowNavigation("up");
|
|
206
206
|
break;
|
|
207
207
|
case "ArrowDown":
|
|
208
|
-
o.preventDefault(),
|
|
208
|
+
o.preventDefault(), t.navigation.handleArrowNavigation("down");
|
|
209
209
|
break;
|
|
210
210
|
case "ArrowLeft":
|
|
211
|
-
o.preventDefault(),
|
|
211
|
+
o.preventDefault(), t.navigation.handleArrowNavigation("left");
|
|
212
212
|
break;
|
|
213
213
|
case "ArrowRight":
|
|
214
|
-
o.preventDefault(),
|
|
214
|
+
o.preventDefault(), t.navigation.handleArrowNavigation("right");
|
|
215
215
|
break;
|
|
216
216
|
case "Delete":
|
|
217
217
|
case "Backspace":
|
|
218
|
-
|
|
218
|
+
t.selectedObject() && (o.preventDefault(), t.widgetActions.deleteSelected());
|
|
219
219
|
break;
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
};
|
|
223
223
|
document.addEventListener("keydown", n, !0), y(() => document.removeEventListener("keydown", n, !0));
|
|
224
224
|
});
|
|
225
|
-
const x = (
|
|
225
|
+
const x = (e, n) => {
|
|
226
226
|
const o = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
|
|
227
227
|
if (!o) return null;
|
|
228
228
|
const r = o.getBoundingClientRect();
|
|
229
|
-
return $(r,
|
|
230
|
-
clientX:
|
|
229
|
+
return $(r, t.viewport(), {
|
|
230
|
+
clientX: e,
|
|
231
231
|
clientY: n
|
|
232
232
|
});
|
|
233
|
-
}, E = (
|
|
233
|
+
}, E = (e, n, o) => {
|
|
234
234
|
const r = x(n, o);
|
|
235
|
-
r &&
|
|
236
|
-
}, F = (
|
|
235
|
+
r && t.widgetActions.addWidgetAtWorldCenter(e, r.worldX, r.worldY);
|
|
236
|
+
}, F = (e, n, o) => {
|
|
237
237
|
const r = x(n, o);
|
|
238
238
|
if (r) {
|
|
239
|
-
if (
|
|
240
|
-
|
|
239
|
+
if (e === "sticky-note") {
|
|
240
|
+
t.widgetActions.addStickyNoteAtCursor(r.worldX, r.worldY);
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
|
-
if (
|
|
244
|
-
|
|
243
|
+
if (e === "text") {
|
|
244
|
+
t.widgetActions.addTextAnnotationAtCursor(r.worldX, r.worldY);
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
|
-
|
|
247
|
+
e === "background-region" && t.widgetActions.addBackgroundLayerAtCursor(r.worldX, r.worldY);
|
|
248
248
|
}
|
|
249
|
-
}, _ = (
|
|
250
|
-
|
|
249
|
+
}, _ = (e) => {
|
|
250
|
+
e.button === 0 && b("background_pointer");
|
|
251
251
|
};
|
|
252
252
|
return (() => {
|
|
253
|
-
var
|
|
254
|
-
return X(T,
|
|
253
|
+
var e = ie(), n = e.firstChild;
|
|
254
|
+
return X(T, e), q(e, Y({
|
|
255
255
|
get class() {
|
|
256
256
|
return `workbench-surface${i.class ? ` ${i.class}` : ""}`;
|
|
257
257
|
}
|
|
@@ -259,150 +259,150 @@ function At(i) {
|
|
|
259
259
|
[d().surfaceRootAttr]: "true"
|
|
260
260
|
}), {
|
|
261
261
|
get "data-workbench-theme"() {
|
|
262
|
-
return
|
|
262
|
+
return t.theme();
|
|
263
263
|
},
|
|
264
264
|
get "data-workbench-mode"() {
|
|
265
|
-
return
|
|
265
|
+
return t.mode();
|
|
266
266
|
},
|
|
267
267
|
tabIndex: -1
|
|
268
268
|
}), !1, !0), w(n, s(U, {
|
|
269
269
|
get widgetDefinitions() {
|
|
270
|
-
return
|
|
270
|
+
return t.widgetDefinitions();
|
|
271
271
|
},
|
|
272
272
|
get widgets() {
|
|
273
|
-
return
|
|
273
|
+
return t.widgets();
|
|
274
274
|
},
|
|
275
275
|
get stickyNotes() {
|
|
276
|
-
return
|
|
276
|
+
return t.stickyNotes();
|
|
277
277
|
},
|
|
278
278
|
get annotations() {
|
|
279
|
-
return
|
|
279
|
+
return t.annotations();
|
|
280
280
|
},
|
|
281
281
|
get backgroundLayers() {
|
|
282
|
-
return
|
|
282
|
+
return t.backgroundLayers();
|
|
283
283
|
},
|
|
284
284
|
get viewport() {
|
|
285
|
-
return
|
|
285
|
+
return t.viewport();
|
|
286
286
|
},
|
|
287
287
|
get canvasFrameSize() {
|
|
288
|
-
return
|
|
288
|
+
return t.canvasFrameSize();
|
|
289
289
|
},
|
|
290
290
|
get selectedWidgetId() {
|
|
291
|
-
return
|
|
291
|
+
return t.selectedWidgetId();
|
|
292
292
|
},
|
|
293
293
|
get selectedObject() {
|
|
294
|
-
return
|
|
294
|
+
return t.selectedObject();
|
|
295
295
|
},
|
|
296
296
|
get mode() {
|
|
297
|
-
return
|
|
297
|
+
return t.mode();
|
|
298
298
|
},
|
|
299
299
|
get optimisticFrontWidgetId() {
|
|
300
|
-
return
|
|
300
|
+
return t.optimisticFrontWidgetId();
|
|
301
301
|
},
|
|
302
302
|
get locked() {
|
|
303
|
-
return
|
|
303
|
+
return t.locked();
|
|
304
304
|
},
|
|
305
305
|
get filters() {
|
|
306
|
-
return
|
|
306
|
+
return t.filters();
|
|
307
307
|
},
|
|
308
308
|
get interactionAdapter() {
|
|
309
309
|
return d();
|
|
310
310
|
},
|
|
311
311
|
get setCanvasFrameRef() {
|
|
312
|
-
return
|
|
312
|
+
return t.setCanvasFrameRef;
|
|
313
313
|
},
|
|
314
314
|
get onViewportCommit() {
|
|
315
|
-
return
|
|
315
|
+
return t.canvas.commitViewport;
|
|
316
316
|
},
|
|
317
317
|
get onViewportInteractionStart() {
|
|
318
|
-
return
|
|
318
|
+
return t.canvas.cancelViewportNavigation;
|
|
319
319
|
},
|
|
320
320
|
get onCanvasContextMenu() {
|
|
321
|
-
return
|
|
321
|
+
return t.canvas.openCanvasContextMenu;
|
|
322
322
|
},
|
|
323
323
|
onCanvasPointerDown: _,
|
|
324
324
|
get onSelectWidget() {
|
|
325
|
-
return
|
|
325
|
+
return t.canvas.selectWidget;
|
|
326
326
|
},
|
|
327
327
|
get onWidgetContextMenu() {
|
|
328
|
-
return
|
|
328
|
+
return t.canvas.openWidgetContextMenu;
|
|
329
329
|
},
|
|
330
330
|
get onStartOptimisticFront() {
|
|
331
|
-
return
|
|
331
|
+
return t.canvas.startOptimisticFront;
|
|
332
332
|
},
|
|
333
333
|
get onCommitFront() {
|
|
334
|
-
return
|
|
334
|
+
return t.canvas.commitFront;
|
|
335
335
|
},
|
|
336
336
|
get onCommitMove() {
|
|
337
|
-
return
|
|
337
|
+
return t.canvas.commitMove;
|
|
338
338
|
},
|
|
339
339
|
get onCommitResize() {
|
|
340
|
-
return
|
|
340
|
+
return t.canvas.commitResize;
|
|
341
341
|
},
|
|
342
342
|
get onSelectStickyNote() {
|
|
343
|
-
return
|
|
343
|
+
return t.canvas.selectStickyNote;
|
|
344
344
|
},
|
|
345
345
|
get onStickyNoteContextMenu() {
|
|
346
|
-
return
|
|
346
|
+
return t.canvas.openStickyNoteContextMenu;
|
|
347
347
|
},
|
|
348
348
|
get onStartStickyOptimisticFront() {
|
|
349
|
-
return
|
|
349
|
+
return t.canvas.startOptimisticFront;
|
|
350
350
|
},
|
|
351
351
|
get onCommitStickyFront() {
|
|
352
|
-
return
|
|
352
|
+
return t.canvas.commitStickyFront;
|
|
353
353
|
},
|
|
354
354
|
get onCommitStickyMove() {
|
|
355
|
-
return
|
|
355
|
+
return t.canvas.commitStickyMove;
|
|
356
356
|
},
|
|
357
357
|
get onCommitStickyResize() {
|
|
358
|
-
return
|
|
358
|
+
return t.canvas.commitStickyResize;
|
|
359
359
|
},
|
|
360
360
|
get onUpdateStickyNote() {
|
|
361
|
-
return
|
|
361
|
+
return t.widgetActions.updateStickyNote;
|
|
362
362
|
},
|
|
363
363
|
get onDeleteStickyNote() {
|
|
364
|
-
return
|
|
364
|
+
return t.widgetActions.deleteStickyNote;
|
|
365
365
|
},
|
|
366
366
|
get onSelectAnnotation() {
|
|
367
|
-
return
|
|
367
|
+
return t.canvas.selectAnnotation;
|
|
368
368
|
},
|
|
369
369
|
get onAnnotationContextMenu() {
|
|
370
|
-
return
|
|
370
|
+
return t.canvas.openAnnotationContextMenu;
|
|
371
371
|
},
|
|
372
372
|
get onCommitAnnotationMove() {
|
|
373
|
-
return
|
|
373
|
+
return t.canvas.commitAnnotationMove;
|
|
374
374
|
},
|
|
375
375
|
get onCommitAnnotationResize() {
|
|
376
|
-
return
|
|
376
|
+
return t.canvas.commitAnnotationResize;
|
|
377
377
|
},
|
|
378
378
|
get onUpdateTextAnnotation() {
|
|
379
|
-
return
|
|
379
|
+
return t.widgetActions.updateTextAnnotation;
|
|
380
380
|
},
|
|
381
381
|
get onDeleteAnnotation() {
|
|
382
|
-
return
|
|
382
|
+
return t.widgetActions.deleteAnnotation;
|
|
383
383
|
},
|
|
384
384
|
get onSelectBackgroundLayer() {
|
|
385
|
-
return
|
|
385
|
+
return t.canvas.selectBackgroundLayer;
|
|
386
386
|
},
|
|
387
387
|
get onBackgroundLayerContextMenu() {
|
|
388
|
-
return
|
|
388
|
+
return t.canvas.openBackgroundLayerContextMenu;
|
|
389
389
|
},
|
|
390
390
|
get onCommitBackgroundMove() {
|
|
391
|
-
return
|
|
391
|
+
return t.canvas.commitBackgroundMove;
|
|
392
392
|
},
|
|
393
393
|
get onCommitBackgroundResize() {
|
|
394
|
-
return
|
|
394
|
+
return t.canvas.commitBackgroundResize;
|
|
395
395
|
},
|
|
396
396
|
get onUpdateBackgroundLayer() {
|
|
397
|
-
return
|
|
397
|
+
return t.widgetActions.updateBackgroundLayer;
|
|
398
398
|
},
|
|
399
399
|
get onDeleteBackgroundLayer() {
|
|
400
|
-
return
|
|
400
|
+
return t.widgetActions.deleteBackgroundLayer;
|
|
401
401
|
},
|
|
402
402
|
onRequestOverview: O,
|
|
403
403
|
onRequestFit: R,
|
|
404
404
|
get onRequestDelete() {
|
|
405
|
-
return i.onRequestDelete ??
|
|
405
|
+
return i.onRequestDelete ?? t.widgetActions.deleteWidget;
|
|
406
406
|
},
|
|
407
407
|
get onLayoutInteractionStart() {
|
|
408
408
|
return i.onLayoutInteractionStart;
|
|
@@ -410,74 +410,74 @@ function At(i) {
|
|
|
410
410
|
get onLayoutInteractionEnd() {
|
|
411
411
|
return i.onLayoutInteractionEnd;
|
|
412
412
|
}
|
|
413
|
-
})), w(
|
|
413
|
+
})), w(e, s(G, {
|
|
414
414
|
get locked() {
|
|
415
|
-
return
|
|
415
|
+
return t.locked();
|
|
416
416
|
},
|
|
417
417
|
get onToggle() {
|
|
418
|
-
return
|
|
418
|
+
return t.lock.toggle;
|
|
419
419
|
},
|
|
420
420
|
get shortcutLabel() {
|
|
421
421
|
return I() ?? void 0;
|
|
422
422
|
}
|
|
423
|
-
}), null), w(
|
|
423
|
+
}), null), w(e, s(j, {
|
|
424
424
|
get widgetDefinitions() {
|
|
425
425
|
return N();
|
|
426
426
|
},
|
|
427
427
|
get widgets() {
|
|
428
|
-
return
|
|
428
|
+
return t.widgets();
|
|
429
429
|
},
|
|
430
430
|
get filters() {
|
|
431
|
-
return
|
|
431
|
+
return t.filters();
|
|
432
432
|
},
|
|
433
433
|
get mode() {
|
|
434
|
-
return
|
|
434
|
+
return t.mode();
|
|
435
435
|
},
|
|
436
436
|
get viewport() {
|
|
437
|
-
return
|
|
437
|
+
return t.viewport();
|
|
438
438
|
},
|
|
439
439
|
get onSoloFilter() {
|
|
440
|
-
return
|
|
440
|
+
return t.filter.solo;
|
|
441
441
|
},
|
|
442
442
|
get onSelectMode() {
|
|
443
|
-
return
|
|
443
|
+
return t.modes.setMode;
|
|
444
444
|
},
|
|
445
445
|
get onViewportCommit() {
|
|
446
|
-
return
|
|
446
|
+
return t.canvas.commitViewport;
|
|
447
447
|
},
|
|
448
|
-
onViewportInteractionStart: () =>
|
|
448
|
+
onViewportInteractionStart: () => t.canvas.cancelViewportNavigation(),
|
|
449
449
|
onCreateAt: E,
|
|
450
450
|
onCreateToolAt: F
|
|
451
|
-
}), null), w(
|
|
451
|
+
}), null), w(e, s(Z, {
|
|
452
452
|
get scaleLabel() {
|
|
453
|
-
return
|
|
453
|
+
return t.scaleLabel();
|
|
454
454
|
},
|
|
455
455
|
get onZoomOut() {
|
|
456
|
-
return
|
|
456
|
+
return t.hud.zoomOut;
|
|
457
457
|
},
|
|
458
458
|
get onZoomIn() {
|
|
459
|
-
return
|
|
459
|
+
return t.hud.zoomIn;
|
|
460
460
|
},
|
|
461
461
|
get activeTheme() {
|
|
462
|
-
return
|
|
462
|
+
return t.theme();
|
|
463
463
|
},
|
|
464
|
-
onSelectTheme: (o) =>
|
|
465
|
-
}), null), w(
|
|
464
|
+
onSelectTheme: (o) => t.appearance.setTheme(o)
|
|
465
|
+
}), null), w(e, s(H, {
|
|
466
466
|
get when() {
|
|
467
|
-
return
|
|
467
|
+
return t.contextMenu.state();
|
|
468
468
|
},
|
|
469
469
|
get children() {
|
|
470
470
|
return s(z, {
|
|
471
471
|
get children() {
|
|
472
472
|
return [(() => {
|
|
473
|
-
var o =
|
|
474
|
-
return V(o, "contextmenu",
|
|
473
|
+
var o = re();
|
|
474
|
+
return V(o, "contextmenu", t.contextMenu.retarget, !0), o;
|
|
475
475
|
})(), s(K, {
|
|
476
476
|
get x() {
|
|
477
|
-
return
|
|
477
|
+
return W()?.left ?? 0;
|
|
478
478
|
},
|
|
479
479
|
get y() {
|
|
480
|
-
return
|
|
480
|
+
return W()?.top ?? 0;
|
|
481
481
|
},
|
|
482
482
|
get items() {
|
|
483
483
|
return h();
|
|
@@ -486,10 +486,10 @@ function At(i) {
|
|
|
486
486
|
}
|
|
487
487
|
});
|
|
488
488
|
}
|
|
489
|
-
}), null),
|
|
489
|
+
}), null), e;
|
|
490
490
|
})();
|
|
491
491
|
}
|
|
492
492
|
P(["contextmenu"]);
|
|
493
493
|
export {
|
|
494
|
-
|
|
494
|
+
Ae as WorkbenchSurface
|
|
495
495
|
};
|
|
@@ -4,7 +4,7 @@ export { WorkbenchContextMenu, type WorkbenchContextMenuItem, type WorkbenchCont
|
|
|
4
4
|
export { useWorkbenchModel, type UseWorkbenchModelOptions } from './useWorkbenchModel';
|
|
5
5
|
export { WIDGET_REGISTRY, createWorkbenchFilterState, getWidgetEntry, isValidWorkbenchWidgetType, resolveWorkbenchWidgetDefinitions, type WidgetRegistryEntry, } from './widgets/widgetRegistry';
|
|
6
6
|
export * from './types';
|
|
7
|
-
export { sanitizeWorkbenchState, createDefaultWorkbenchState, createWorkbenchId, createWorkbenchProjectedRect, createWorkbenchRenderLayerMap, createWorkbenchViewportCenteredOnWidget, createWorkbenchViewportFitForWidget, createWorkbenchWidgetSurfaceMetrics, resolveWorkbenchProjectedSurfaceScaleBehavior, resolveWorkbenchWidgetRenderMode, type WorkbenchRenderLayerMap, } from './workbenchHelpers';
|
|
7
|
+
export { sanitizeWorkbenchState, createDefaultWorkbenchState, createWorkbenchId, createWorkbenchProjectedRect, createWorkbenchRenderLayerMap, createWorkbenchViewportCenteredOnWidget, createWorkbenchViewportFitForWidget, createWorkbenchWidgetFrame, createWorkbenchWidgetSurfaceMetrics, resolveWorkbenchProjectedSurfaceScaleBehavior, resolveWorkbenchWidgetRenderMode, type WorkbenchRenderLayerMap, type WorkbenchWidgetFrame, type WorkbenchWidgetPlacement, } from './workbenchHelpers';
|
|
8
8
|
export { WORKBENCH_BACKGROUND_MATERIALS, WORKBENCH_DEFAULT_BACKGROUND_MATERIAL, WORKBENCH_DEFAULT_REGION_FILL, WORKBENCH_DEFAULT_STICKY_NOTE_COLOR, WORKBENCH_DEFAULT_TEXT_COLOR, WORKBENCH_DEFAULT_TEXT_FONT, WORKBENCH_REGION_FILL_OPTIONS, WORKBENCH_STICKY_NOTE_COLORS, WORKBENCH_TEXT_COLOR_OPTIONS, WORKBENCH_TEXT_EMOJI_OPTIONS, WORKBENCH_TEXT_FONT_OPTIONS, } from './workbenchOptions';
|
|
9
9
|
export { DEFAULT_WORKBENCH_THEME, WORKBENCH_THEME_IDS, WORKBENCH_THEMES, isWorkbenchThemeId, workbenchThemeMeta, type WorkbenchThemeId, type WorkbenchThemeMeta, type WorkbenchThemePreview, } from './workbenchThemes';
|
|
10
10
|
export { WorkbenchThemeSelector, type WorkbenchThemeSelectorProps, } from './WorkbenchThemeSelector';
|