@floegence/floe-webapp-core 0.36.58 → 0.36.60
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/WorkbenchFilterBar.d.ts +9 -2
- package/dist/components/workbench/WorkbenchFilterBar.js +192 -178
- package/dist/components/workbench/WorkbenchPlacementPreview.js +23 -22
- package/dist/components/workbench/WorkbenchSurface.js +88 -81
- package/dist/components/workbench/workbenchPlacement.d.ts +3 -0
- package/dist/components/workbench/workbenchPlacement.js +35 -30
- package/dist/styles.css +1 -1
- package/dist/workbench.css +10 -0
- package/package.json +1 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { Show as
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
import { createComponent as x, insert as u, effect as k, setStyleProperty as o, template as y } from "solid-js/web";
|
|
2
|
+
import { Show as b } from "solid-js";
|
|
3
|
+
var f = /* @__PURE__ */ y("<div class=workbench-placement-preview aria-hidden=true><div class=workbench-placement-preview__crosshair></div><div class=workbench-placement-preview__label>");
|
|
4
|
+
function S(r) {
|
|
5
5
|
const n = () => {
|
|
6
|
-
const
|
|
7
|
-
if (!
|
|
6
|
+
const t = r.preview;
|
|
7
|
+
if (!t) return null;
|
|
8
8
|
if (r.projection === "screen") {
|
|
9
9
|
const i = Number.isFinite(r.viewport.scale) && r.viewport.scale > 0 ? r.viewport.scale : 1;
|
|
10
10
|
return {
|
|
11
|
-
x: r.viewport.x +
|
|
12
|
-
y: r.viewport.y +
|
|
13
|
-
width:
|
|
14
|
-
height:
|
|
11
|
+
x: r.viewport.x + t.x * i,
|
|
12
|
+
y: r.viewport.y + t.y * i,
|
|
13
|
+
width: t.width * i,
|
|
14
|
+
height: t.height * i
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
return {
|
|
18
|
-
x:
|
|
19
|
-
y:
|
|
20
|
-
width:
|
|
21
|
-
height:
|
|
18
|
+
x: t.x,
|
|
19
|
+
y: t.y,
|
|
20
|
+
width: t.width,
|
|
21
|
+
height: t.height
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
return
|
|
24
|
+
return x(b, {
|
|
25
25
|
get when() {
|
|
26
26
|
return r.preview;
|
|
27
27
|
},
|
|
28
|
-
children: (
|
|
29
|
-
var i =
|
|
30
|
-
return
|
|
31
|
-
var s =
|
|
32
|
-
return s !==
|
|
28
|
+
children: (t) => (() => {
|
|
29
|
+
var i = f(), w = i.firstChild, m = w.nextSibling;
|
|
30
|
+
return u(m, () => t().label), k((e) => {
|
|
31
|
+
var s = t().kind === "widget", l = t().kind === "sticky-note", a = t().kind === "text", d = t().kind === "background-region", c = t().dropAllowed !== !1, h = `translate3d(${n()?.x ?? 0}px, ${n()?.y ?? 0}px, 0)`, v = `${n()?.width ?? 0}px`, g = `${n()?.height ?? 0}px`;
|
|
32
|
+
return s !== e.e && i.classList.toggle("is-widget", e.e = s), l !== e.t && i.classList.toggle("is-sticky-note", e.t = l), a !== e.a && i.classList.toggle("is-text", e.a = a), d !== e.o && i.classList.toggle("is-background-region", e.o = d), c !== e.i && i.classList.toggle("is-drop-armed", e.i = c), h !== e.n && o(i, "transform", e.n = h), v !== e.s && o(i, "width", e.s = v), g !== e.h && o(i, "height", e.h = g), e;
|
|
33
33
|
}, {
|
|
34
34
|
e: void 0,
|
|
35
35
|
t: void 0,
|
|
@@ -37,11 +37,12 @@ function P(r) {
|
|
|
37
37
|
o: void 0,
|
|
38
38
|
i: void 0,
|
|
39
39
|
n: void 0,
|
|
40
|
-
s: void 0
|
|
40
|
+
s: void 0,
|
|
41
|
+
h: void 0
|
|
41
42
|
}), i;
|
|
42
43
|
})()
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
S as WorkbenchPlacementPreview
|
|
47
48
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { use as
|
|
2
|
-
import { createSignal as A, createMemo as g, untrack as h, createEffect as v, onCleanup as y, Show as
|
|
3
|
-
import { clientToCanvasWorld as
|
|
1
|
+
import { use as z, spread as V, 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 A, createMemo as g, untrack as h, createEffect as v, onCleanup as y, Show as j } from "solid-js";
|
|
3
|
+
import { clientToCanvasWorld as L } from "../ui/canvasGeometry.js";
|
|
4
4
|
import { WorkbenchCanvas as Z } from "./WorkbenchCanvas.js";
|
|
5
5
|
import { WorkbenchContextMenu as G } from "./WorkbenchContextMenu.js";
|
|
6
6
|
import { WorkbenchDock as J } from "./WorkbenchFilterBar.js";
|
|
@@ -11,31 +11,31 @@ import { createContextMenuPosition as ne, WORKBENCH_CONTEXT_MENU_WIDTH_PX as oe,
|
|
|
11
11
|
import { resolveWorkbenchWidgetPlacementPreview as ie, resolveWorkbenchToolPlacementPreview as ae } from "./workbenchPlacement.js";
|
|
12
12
|
import { useWorkbenchModel as ce } from "./useWorkbenchModel.js";
|
|
13
13
|
import { resolveWorkbenchInteractionAdapter as de } from "./workbenchInteractionAdapter.js";
|
|
14
|
-
var ue = /* @__PURE__ */
|
|
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
15
|
const le = "F1";
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
16
|
+
function B(a) {
|
|
17
|
+
if (a)
|
|
18
18
|
try {
|
|
19
|
-
|
|
19
|
+
a.focus({
|
|
20
20
|
preventScroll: !0
|
|
21
21
|
});
|
|
22
22
|
} catch {
|
|
23
|
-
|
|
23
|
+
a.focus();
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function Ie(a) {
|
|
27
27
|
const t = ce({
|
|
28
|
-
state: () =>
|
|
29
|
-
setState: (e) =>
|
|
30
|
-
widgetDefinitions: () =>
|
|
31
|
-
textAnnotationDefaults: () =>
|
|
32
|
-
backgroundLayerDefaults: () =>
|
|
28
|
+
state: () => a.state(),
|
|
29
|
+
setState: (e) => a.setState(e),
|
|
30
|
+
widgetDefinitions: () => a.widgetDefinitions,
|
|
31
|
+
textAnnotationDefaults: () => a.textAnnotationDefaults,
|
|
32
|
+
backgroundLayerDefaults: () => a.backgroundLayerDefaults,
|
|
33
33
|
onClose: () => {
|
|
34
34
|
}
|
|
35
|
-
}), [u,
|
|
36
|
-
const e =
|
|
35
|
+
}), [u, N] = A(null), [R, O] = A(null), d = g(() => de(a.interactionAdapter)), [C, l] = A(h(() => d().createInitialInputOwner())), W = g(() => {
|
|
36
|
+
const e = a.launcherWidgetTypes;
|
|
37
37
|
return !e || e.length <= 0 ? null : new Set(e);
|
|
38
|
-
}),
|
|
38
|
+
}), E = g(() => {
|
|
39
39
|
const e = t.widgetDefinitions(), n = W();
|
|
40
40
|
return n ? e.filter((o) => n.has(o.type)) : e;
|
|
41
41
|
}), S = g(() => {
|
|
@@ -45,10 +45,10 @@ function xe(i) {
|
|
|
45
45
|
const D = /^add-(.+)$/.exec(String(m.id ?? ""));
|
|
46
46
|
return D ? o.has(D[1]) : !0;
|
|
47
47
|
}) : n;
|
|
48
|
-
if (!e || !
|
|
48
|
+
if (!e || !a.resolveContextMenuItems)
|
|
49
49
|
return r;
|
|
50
|
-
const
|
|
51
|
-
return
|
|
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({
|
|
52
52
|
menu: e,
|
|
53
53
|
items: r,
|
|
54
54
|
widgets: t.widgets(),
|
|
@@ -58,15 +58,15 @@ function xe(i) {
|
|
|
58
58
|
}), b = g(() => {
|
|
59
59
|
const e = t.contextMenu.state();
|
|
60
60
|
if (!e) return;
|
|
61
|
-
const n = S(), o = n.filter((
|
|
61
|
+
const n = S(), o = n.filter((i) => i.kind === "action").length, r = n.filter((i) => i.kind === "separator").length;
|
|
62
62
|
return ne({
|
|
63
63
|
clientX: e.clientX,
|
|
64
64
|
clientY: e.clientY,
|
|
65
65
|
menuWidth: oe,
|
|
66
66
|
menuHeight: re(o, r)
|
|
67
67
|
});
|
|
68
|
-
}),
|
|
69
|
-
const r = d(),
|
|
68
|
+
}), I = (e, n, o) => {
|
|
69
|
+
const r = d(), i = r.findWidgetRoot(e), c = r.readWidgetId(i);
|
|
70
70
|
if (c) {
|
|
71
71
|
if (t.queries.findStickyNoteById(c)) {
|
|
72
72
|
l(r.createCanvasInputOwner(n === "focus" ? "background_focus" : "background_pointer"));
|
|
@@ -77,38 +77,38 @@ function xe(i) {
|
|
|
77
77
|
}
|
|
78
78
|
const m = u();
|
|
79
79
|
m && e instanceof Node && m.contains(e) && l(r.createCanvasInputOwner(o));
|
|
80
|
-
},
|
|
80
|
+
}, x = (e = "selection_cleared") => {
|
|
81
81
|
const n = d(), o = u();
|
|
82
82
|
t.selection.clear(), l(n.createCanvasInputOwner(e)), queueMicrotask(() => {
|
|
83
83
|
if (!o || typeof document > "u") return;
|
|
84
84
|
const r = document.activeElement;
|
|
85
85
|
if (!(r instanceof HTMLElement) || !o.contains(r)) {
|
|
86
|
-
|
|
86
|
+
B(o);
|
|
87
87
|
return;
|
|
88
88
|
}
|
|
89
|
-
const
|
|
90
|
-
|
|
89
|
+
const i = n.findWidgetRoot(r);
|
|
90
|
+
B(o), i && document.activeElement === r && r.isConnected && r.blur();
|
|
91
91
|
});
|
|
92
92
|
}, k = () => {
|
|
93
|
-
const e = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]'), n = t.viewport(), o = e?.getBoundingClientRect(), r = o?.width ?? 0,
|
|
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;
|
|
94
94
|
return {
|
|
95
95
|
worldX: r > 0 ? (r / 2 - n.x) / n.scale : 240,
|
|
96
|
-
worldY:
|
|
96
|
+
worldY: i > 0 ? (i / 2 - n.y) / n.scale : 180
|
|
97
97
|
};
|
|
98
98
|
}, w = (e) => {
|
|
99
99
|
const n = h(d), o = h(u);
|
|
100
100
|
queueMicrotask(() => {
|
|
101
101
|
n.focusWidgetElement(o, e), l(n.createWidgetInputOwner(e, "activation"));
|
|
102
102
|
});
|
|
103
|
-
},
|
|
103
|
+
}, F = (e) => {
|
|
104
104
|
const n = t.navigation.fitWidget(e);
|
|
105
105
|
w(n.id);
|
|
106
|
-
},
|
|
106
|
+
}, X = (e) => {
|
|
107
107
|
const n = t.navigation.overviewWidget(e);
|
|
108
108
|
w(n.id);
|
|
109
109
|
};
|
|
110
110
|
v(() => {
|
|
111
|
-
|
|
111
|
+
a.onApiReady?.({
|
|
112
112
|
ensureWidget: (e, n) => t.widgetActions.ensureWidget(e, n) ?? null,
|
|
113
113
|
createWidget: (e, n) => {
|
|
114
114
|
const o = k(), r = t.widgetActions.addWidgetAtWorldCenter(e, n?.worldX ?? o.worldX, n?.worldY ?? o.worldY) ?? null;
|
|
@@ -126,7 +126,7 @@ function xe(i) {
|
|
|
126
126
|
const n = k();
|
|
127
127
|
return t.widgetActions.addBackgroundLayerAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
|
|
128
128
|
},
|
|
129
|
-
clearSelection: () =>
|
|
129
|
+
clearSelection: () => x("selection_cleared"),
|
|
130
130
|
focusWidget: (e, n) => {
|
|
131
131
|
const o = t.navigation.focusWidget(e, n);
|
|
132
132
|
return w(o.id), o;
|
|
@@ -146,9 +146,9 @@ function xe(i) {
|
|
|
146
146
|
findBackgroundLayerById: (e) => t.queries.findBackgroundLayerById(e),
|
|
147
147
|
updateWidgetTitle: (e, n) => {
|
|
148
148
|
const o = String(e ?? "").trim(), r = String(n ?? "").trim();
|
|
149
|
-
!o || !r ||
|
|
150
|
-
...
|
|
151
|
-
widgets:
|
|
149
|
+
!o || !r || a.setState((i) => ({
|
|
150
|
+
...i,
|
|
151
|
+
widgets: i.widgets.map((c) => c.id === o && c.title !== r ? {
|
|
152
152
|
...c,
|
|
153
153
|
title: r
|
|
154
154
|
} : c)
|
|
@@ -161,10 +161,10 @@ function xe(i) {
|
|
|
161
161
|
deleteAnnotation: (e) => t.widgetActions.deleteAnnotation(e),
|
|
162
162
|
deleteBackgroundLayer: (e) => t.widgetActions.deleteBackgroundLayer(e)
|
|
163
163
|
}), y(() => {
|
|
164
|
-
|
|
164
|
+
a.onApiReady?.(null);
|
|
165
165
|
});
|
|
166
166
|
});
|
|
167
|
-
const M = () =>
|
|
167
|
+
const M = () => a.lockShortcut === void 0 ? le : a.lockShortcut;
|
|
168
168
|
v(() => {
|
|
169
169
|
if (typeof window > "u" || !t.contextMenu.state()) return;
|
|
170
170
|
const e = te({
|
|
@@ -180,15 +180,15 @@ function xe(i) {
|
|
|
180
180
|
const e = u();
|
|
181
181
|
if (!e) return;
|
|
182
182
|
const n = (r) => {
|
|
183
|
-
|
|
183
|
+
I(r.target, "pointer", "background_pointer");
|
|
184
184
|
}, o = (r) => {
|
|
185
|
-
|
|
185
|
+
I(r.target, "focus", "background_focus");
|
|
186
186
|
};
|
|
187
187
|
e.addEventListener("pointerdown", n, !0), e.addEventListener("focusin", o), y(() => {
|
|
188
188
|
e.removeEventListener("pointerdown", n, !0), e.removeEventListener("focusin", o);
|
|
189
189
|
});
|
|
190
190
|
}), v(() => {
|
|
191
|
-
if (
|
|
191
|
+
if (a.enableKeyboard === !1 || typeof document > "u") return;
|
|
192
192
|
const e = M(), n = (o) => {
|
|
193
193
|
if (!(o.defaultPrevented || o.isComposing)) {
|
|
194
194
|
if (e !== null && o.key === e) {
|
|
@@ -223,55 +223,62 @@ function xe(i) {
|
|
|
223
223
|
};
|
|
224
224
|
document.addEventListener("keydown", n, !0), y(() => document.removeEventListener("keydown", n, !0));
|
|
225
225
|
});
|
|
226
|
-
const p = (e, n) => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
226
|
+
const p = (e, n, o) => {
|
|
227
|
+
if (o?.canvasFrame)
|
|
228
|
+
return L(o.canvasFrame, t.viewport(), {
|
|
229
|
+
clientX: e,
|
|
230
|
+
clientY: n
|
|
231
|
+
});
|
|
232
|
+
const r = u()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
|
|
233
|
+
if (!r) return null;
|
|
234
|
+
const i = r.getBoundingClientRect();
|
|
235
|
+
return L(i, t.viewport(), {
|
|
231
236
|
clientX: e,
|
|
232
237
|
clientY: n
|
|
233
238
|
});
|
|
234
|
-
},
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
},
|
|
238
|
-
const
|
|
239
|
-
if (
|
|
239
|
+
}, _ = (e, n, o, r) => {
|
|
240
|
+
const i = p(n, o, r);
|
|
241
|
+
i && t.widgetActions.addWidgetAtWorldCenter(e, i.worldX, i.worldY);
|
|
242
|
+
}, Y = (e, n, o, r) => {
|
|
243
|
+
const i = p(n, o, r);
|
|
244
|
+
if (i) {
|
|
240
245
|
if (e === "sticky-note") {
|
|
241
|
-
t.widgetActions.addStickyNoteAtCursor(
|
|
246
|
+
t.widgetActions.addStickyNoteAtCursor(i.worldX, i.worldY);
|
|
242
247
|
return;
|
|
243
248
|
}
|
|
244
249
|
if (e === "text") {
|
|
245
|
-
t.widgetActions.addTextAnnotationAtCursor(
|
|
250
|
+
t.widgetActions.addTextAnnotationAtCursor(i.worldX, i.worldY);
|
|
246
251
|
return;
|
|
247
252
|
}
|
|
248
|
-
e === "background-region" && t.widgetActions.addBackgroundLayerAtCursor(
|
|
253
|
+
e === "background-region" && t.widgetActions.addBackgroundLayerAtCursor(i.worldX, i.worldY);
|
|
249
254
|
}
|
|
250
|
-
},
|
|
251
|
-
e.button === 0 &&
|
|
252
|
-
},
|
|
253
|
-
const e =
|
|
255
|
+
}, P = (e) => {
|
|
256
|
+
e.button === 0 && x("background_pointer");
|
|
257
|
+
}, q = g(() => {
|
|
258
|
+
const e = R();
|
|
254
259
|
if (!e) return null;
|
|
255
|
-
const n = p(e.clientX, e.clientY);
|
|
260
|
+
const n = p(e.clientX, e.clientY, e);
|
|
256
261
|
return n ? e.kind === "widget" ? ie({
|
|
257
262
|
type: e.id,
|
|
258
263
|
widgetDefinitions: t.widgetDefinitions(),
|
|
259
264
|
worldX: n.worldX,
|
|
260
|
-
worldY: n.worldY
|
|
265
|
+
worldY: n.worldY,
|
|
266
|
+
dropAllowed: e.dropAllowed
|
|
261
267
|
}) : ae({
|
|
262
268
|
tool: e.id,
|
|
263
269
|
label: e.label,
|
|
264
270
|
worldX: n.worldX,
|
|
265
271
|
worldY: n.worldY,
|
|
266
|
-
|
|
267
|
-
|
|
272
|
+
dropAllowed: e.dropAllowed,
|
|
273
|
+
textDefaults: a.textAnnotationDefaults,
|
|
274
|
+
backgroundDefaults: a.backgroundLayerDefaults
|
|
268
275
|
}) : null;
|
|
269
276
|
});
|
|
270
277
|
return (() => {
|
|
271
278
|
var e = se(), n = e.firstChild;
|
|
272
|
-
return
|
|
279
|
+
return z(N, e), V(e, H({
|
|
273
280
|
get class() {
|
|
274
|
-
return `workbench-surface${
|
|
281
|
+
return `workbench-surface${a.class ? ` ${a.class}` : ""}`;
|
|
275
282
|
}
|
|
276
283
|
}, () => ({
|
|
277
284
|
[d().surfaceRootAttr]: "true"
|
|
@@ -300,7 +307,7 @@ function xe(i) {
|
|
|
300
307
|
return t.backgroundLayers();
|
|
301
308
|
},
|
|
302
309
|
get placementPreview() {
|
|
303
|
-
return
|
|
310
|
+
return q();
|
|
304
311
|
},
|
|
305
312
|
get viewport() {
|
|
306
313
|
return t.viewport();
|
|
@@ -341,7 +348,7 @@ function xe(i) {
|
|
|
341
348
|
get onCanvasContextMenu() {
|
|
342
349
|
return t.canvas.openCanvasContextMenu;
|
|
343
350
|
},
|
|
344
|
-
onCanvasPointerDown:
|
|
351
|
+
onCanvasPointerDown: P,
|
|
345
352
|
get onSelectWidget() {
|
|
346
353
|
return t.canvas.selectWidget;
|
|
347
354
|
},
|
|
@@ -420,16 +427,16 @@ function xe(i) {
|
|
|
420
427
|
get onDeleteBackgroundLayer() {
|
|
421
428
|
return t.widgetActions.deleteBackgroundLayer;
|
|
422
429
|
},
|
|
423
|
-
onRequestOverview:
|
|
424
|
-
onRequestFit:
|
|
430
|
+
onRequestOverview: X,
|
|
431
|
+
onRequestFit: F,
|
|
425
432
|
get onRequestDelete() {
|
|
426
|
-
return
|
|
433
|
+
return a.onRequestDelete ?? t.widgetActions.deleteWidget;
|
|
427
434
|
},
|
|
428
435
|
get onLayoutInteractionStart() {
|
|
429
|
-
return
|
|
436
|
+
return a.onLayoutInteractionStart;
|
|
430
437
|
},
|
|
431
438
|
get onLayoutInteractionEnd() {
|
|
432
|
-
return
|
|
439
|
+
return a.onLayoutInteractionEnd;
|
|
433
440
|
}
|
|
434
441
|
})), f(e, s(ee, {
|
|
435
442
|
get locked() {
|
|
@@ -443,7 +450,7 @@ function xe(i) {
|
|
|
443
450
|
}
|
|
444
451
|
}), null), f(e, s(J, {
|
|
445
452
|
get widgetDefinitions() {
|
|
446
|
-
return
|
|
453
|
+
return E();
|
|
447
454
|
},
|
|
448
455
|
get widgets() {
|
|
449
456
|
return t.widgets();
|
|
@@ -467,9 +474,9 @@ function xe(i) {
|
|
|
467
474
|
return t.canvas.commitViewport;
|
|
468
475
|
},
|
|
469
476
|
onViewportInteractionStart: () => t.canvas.cancelViewportNavigation(),
|
|
470
|
-
onCreateAt:
|
|
471
|
-
onCreateToolAt:
|
|
472
|
-
onDragPreviewChange:
|
|
477
|
+
onCreateAt: _,
|
|
478
|
+
onCreateToolAt: Y,
|
|
479
|
+
onDragPreviewChange: O
|
|
473
480
|
}), null), f(e, s(Q, {
|
|
474
481
|
get scaleLabel() {
|
|
475
482
|
return t.scaleLabel();
|
|
@@ -484,16 +491,16 @@ function xe(i) {
|
|
|
484
491
|
return t.theme();
|
|
485
492
|
},
|
|
486
493
|
onSelectTheme: (o) => t.appearance.setTheme(o)
|
|
487
|
-
}), null), f(e, s(
|
|
494
|
+
}), null), f(e, s(j, {
|
|
488
495
|
get when() {
|
|
489
496
|
return t.contextMenu.state();
|
|
490
497
|
},
|
|
491
498
|
get children() {
|
|
492
|
-
return s(
|
|
499
|
+
return s($, {
|
|
493
500
|
get children() {
|
|
494
501
|
return [(() => {
|
|
495
502
|
var o = ue();
|
|
496
|
-
return
|
|
503
|
+
return U(o, "contextmenu", t.contextMenu.retarget, !0), o;
|
|
497
504
|
})(), s(G, {
|
|
498
505
|
get x() {
|
|
499
506
|
return b()?.left ?? 0;
|
|
@@ -511,7 +518,7 @@ function xe(i) {
|
|
|
511
518
|
}), null), e;
|
|
512
519
|
})();
|
|
513
520
|
}
|
|
514
|
-
|
|
521
|
+
K(["contextmenu"]);
|
|
515
522
|
export {
|
|
516
|
-
|
|
523
|
+
Ie as WorkbenchSurface
|
|
517
524
|
};
|
|
@@ -7,6 +7,7 @@ export type WorkbenchPlacementPreviewFrame = Readonly<{
|
|
|
7
7
|
y: number;
|
|
8
8
|
width: number;
|
|
9
9
|
height: number;
|
|
10
|
+
dropAllowed?: boolean;
|
|
10
11
|
}>;
|
|
11
12
|
export declare function positiveFinite(value: number | undefined, fallback: number): number;
|
|
12
13
|
export declare function resolveStickyNoteDefaultSize(): Readonly<{
|
|
@@ -26,12 +27,14 @@ export declare function resolveWorkbenchWidgetPlacementPreview(input: {
|
|
|
26
27
|
widgetDefinitions: readonly WorkbenchWidgetDefinition[];
|
|
27
28
|
worldX: number;
|
|
28
29
|
worldY: number;
|
|
30
|
+
dropAllowed?: boolean;
|
|
29
31
|
}): WorkbenchPlacementPreviewFrame;
|
|
30
32
|
export declare function resolveWorkbenchToolPlacementPreview(input: {
|
|
31
33
|
tool: WorkbenchDockToolId;
|
|
32
34
|
label: string;
|
|
33
35
|
worldX: number;
|
|
34
36
|
worldY: number;
|
|
37
|
+
dropAllowed?: boolean;
|
|
35
38
|
textDefaults?: WorkbenchTextAnnotationDefaults;
|
|
36
39
|
backgroundDefaults?: WorkbenchBackgroundLayerDefaults;
|
|
37
40
|
}): WorkbenchPlacementPreviewFrame;
|
|
@@ -1,82 +1,87 @@
|
|
|
1
|
-
import { createWorkbenchWidgetFrame as
|
|
2
|
-
import { getWidgetEntry as
|
|
3
|
-
function
|
|
4
|
-
return Number.isFinite(e) && e > 0 ? e :
|
|
1
|
+
import { createWorkbenchWidgetFrame as t } from "./workbenchHelpers.js";
|
|
2
|
+
import { getWidgetEntry as w } from "./widgets/widgetRegistry.js";
|
|
3
|
+
function l(e, r) {
|
|
4
|
+
return Number.isFinite(e) && e > 0 ? e : r;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function i() {
|
|
7
7
|
return { width: 260, height: 184 };
|
|
8
8
|
}
|
|
9
9
|
function h(e) {
|
|
10
10
|
return {
|
|
11
|
-
width:
|
|
12
|
-
height:
|
|
11
|
+
width: l(e?.width, 360),
|
|
12
|
+
height: l(e?.height, 96)
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function n(e) {
|
|
16
16
|
return {
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
17
|
+
width: l(e?.width, 560),
|
|
18
|
+
height: l(e?.height, 360)
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function d(e) {
|
|
22
22
|
return {
|
|
23
23
|
kind: e.kind,
|
|
24
24
|
label: e.label,
|
|
25
25
|
x: e.worldX - e.width / 2,
|
|
26
26
|
y: e.worldY - e.height / 2,
|
|
27
27
|
width: e.width,
|
|
28
|
-
height: e.height
|
|
28
|
+
height: e.height,
|
|
29
|
+
dropAllowed: e.dropAllowed
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
function g(e) {
|
|
32
|
-
const
|
|
33
|
+
const r = w(e.type, e.widgetDefinitions), o = t(r, {
|
|
33
34
|
anchor: "center",
|
|
34
35
|
worldX: e.worldX,
|
|
35
36
|
worldY: e.worldY
|
|
36
37
|
});
|
|
37
38
|
return {
|
|
38
39
|
kind: "widget",
|
|
39
|
-
label:
|
|
40
|
-
x:
|
|
41
|
-
y:
|
|
42
|
-
width:
|
|
43
|
-
height:
|
|
40
|
+
label: r.label,
|
|
41
|
+
x: o.x,
|
|
42
|
+
y: o.y,
|
|
43
|
+
width: o.width,
|
|
44
|
+
height: o.height,
|
|
45
|
+
dropAllowed: e.dropAllowed
|
|
44
46
|
};
|
|
45
47
|
}
|
|
46
48
|
function s(e) {
|
|
47
49
|
if (e.tool === "sticky-note") {
|
|
48
|
-
const
|
|
49
|
-
return
|
|
50
|
+
const o = i();
|
|
51
|
+
return d({
|
|
50
52
|
kind: "sticky-note",
|
|
51
53
|
label: e.label,
|
|
52
54
|
worldX: e.worldX,
|
|
53
55
|
worldY: e.worldY,
|
|
54
|
-
|
|
56
|
+
dropAllowed: e.dropAllowed,
|
|
57
|
+
...o
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
60
|
if (e.tool === "text") {
|
|
58
|
-
const
|
|
59
|
-
return
|
|
61
|
+
const o = h(e.textDefaults);
|
|
62
|
+
return d({
|
|
60
63
|
kind: "text",
|
|
61
64
|
label: e.label,
|
|
62
65
|
worldX: e.worldX,
|
|
63
66
|
worldY: e.worldY,
|
|
64
|
-
|
|
67
|
+
dropAllowed: e.dropAllowed,
|
|
68
|
+
...o
|
|
65
69
|
});
|
|
66
70
|
}
|
|
67
|
-
const
|
|
68
|
-
return
|
|
71
|
+
const r = n(e.backgroundDefaults);
|
|
72
|
+
return d({
|
|
69
73
|
kind: "background-region",
|
|
70
74
|
label: e.label,
|
|
71
75
|
worldX: e.worldX,
|
|
72
76
|
worldY: e.worldY,
|
|
73
|
-
|
|
77
|
+
dropAllowed: e.dropAllowed,
|
|
78
|
+
...r
|
|
74
79
|
});
|
|
75
80
|
}
|
|
76
81
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
l as positiveFinite,
|
|
83
|
+
n as resolveBackgroundLayerDefaultSize,
|
|
84
|
+
i as resolveStickyNoteDefaultSize,
|
|
80
85
|
h as resolveTextAnnotationDefaultSize,
|
|
81
86
|
s as resolveWorkbenchToolPlacementPreview,
|
|
82
87
|
g as resolveWorkbenchWidgetPlacementPreview
|