@floegence/floe-webapp-core 0.40.15 → 0.40.16
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 +11 -0
- package/dist/components/workbench/WorkbenchFilterBar.js +285 -236
- package/dist/components/workbench/WorkbenchSurface.d.ts +2 -1
- package/dist/components/workbench/WorkbenchSurface.js +9 -6
- package/dist/components/workbench/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export interface WorkbenchFilterBarProps {
|
|
|
10
10
|
onSoloFilter: (id: string, scope: readonly string[]) => void;
|
|
11
11
|
onSelectMode?: (mode: WorkbenchInteractionMode) => void;
|
|
12
12
|
dockActions?: readonly WorkbenchDockAction[];
|
|
13
|
+
dockItems?: readonly WorkbenchHostDockItem[];
|
|
13
14
|
registerExternalDockDragController?: (controller: WorkbenchExternalDockDragController | null) => void;
|
|
14
15
|
onExternalDockDrop?: (item: WorkbenchExternalDockDragItem) => void;
|
|
15
16
|
/**
|
|
@@ -37,6 +38,16 @@ export type WorkbenchDockAction = Readonly<{
|
|
|
37
38
|
active?: boolean;
|
|
38
39
|
onActivate: (trigger: HTMLButtonElement) => void;
|
|
39
40
|
}>;
|
|
41
|
+
export type WorkbenchHostDockItem = Readonly<{
|
|
42
|
+
id: string;
|
|
43
|
+
label: string;
|
|
44
|
+
icon: Component<{
|
|
45
|
+
class?: string;
|
|
46
|
+
}>;
|
|
47
|
+
active?: boolean;
|
|
48
|
+
onActivate?: (trigger: HTMLButtonElement) => void;
|
|
49
|
+
onDropToCanvas?: (clientX: number, clientY: number, context?: WorkbenchDockDropContext) => void;
|
|
50
|
+
}>;
|
|
40
51
|
export type WorkbenchDockItemActivation = Readonly<{
|
|
41
52
|
kind: 'widget' | 'tool';
|
|
42
53
|
id: WorkbenchWidgetType | WorkbenchDockToolId;
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { insert as b, createComponent as s, effect as P, setAttribute as y, memo as ce, template as x, addEventListener as se, Portal as Se, setStyleProperty as Oe, use as Me, delegateEvents as ye } from "solid-js/web";
|
|
2
|
+
import { createSignal as z, onCleanup as K, createEffect as p, createMemo as $, Show as B, For as N } from "solid-js";
|
|
3
3
|
import { Motion as Y } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
|
|
4
|
-
import { easing as
|
|
5
|
-
import { Plus as
|
|
6
|
-
import { startHotInteraction as
|
|
7
|
-
import { startPointerSession as
|
|
8
|
-
import { createWorkbenchEdgeAutoPanController as
|
|
9
|
-
import { DockLayoutDashboard as
|
|
10
|
-
var $e = /* @__PURE__ */ x("<button type=button class=workbench-dock__item>"),
|
|
11
|
-
const
|
|
4
|
+
import { easing as F, duration as A } from "../../utils/animations.js";
|
|
5
|
+
import { Plus as xe } from "../icons/index.js";
|
|
6
|
+
import { startHotInteraction as de } from "../../utils/hotInteraction.js";
|
|
7
|
+
import { startPointerSession as ue } from "../ui/pointerSession.js";
|
|
8
|
+
import { createWorkbenchEdgeAutoPanController as Te, WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as ke, frameFromElement as fe } from "./workbenchEdgeAutoPan.js";
|
|
9
|
+
import { DockLayoutDashboard as Xe, DockLayers as Pe, DockRegion as Ye, DockText as Fe, DockMessageSquare as Ae } from "../icons/DockIcons.js";
|
|
10
|
+
var $e = /* @__PURE__ */ x("<button type=button class=workbench-dock__item>"), Be = /* @__PURE__ */ x('<button type=button class="workbench-dock__item workbench-dock__action">'), He = /* @__PURE__ */ x('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), Re = /* @__PURE__ */ x("<span class=workbench-dock__external-placeholder aria-hidden=true>"), We = /* @__PURE__ */ x('<div class=workbench-dock data-floe-canvas-interactive=true><div class=workbench-dock__mode-switcher><button type=button class="workbench-dock__item workbench-dock__mode-trigger"aria-label="Switch canvas mode"aria-haspopup=menu></button></div><span class=workbench-dock__divider aria-hidden=true>'), Ke = /* @__PURE__ */ x("<button type=button class=workbench-dock__mode-option role=menuitemradio><span class=workbench-dock__mode-option-icon></span><span class=workbench-dock__mode-option-copy><span class=workbench-dock__mode-option-label></span><span class=workbench-dock__mode-option-description>"), pe = /* @__PURE__ */ x("<div class=workbench-dock-ghost aria-hidden=true><div class=workbench-dock-ghost__halo></div><div class=workbench-dock-ghost__card><div class=workbench-dock-ghost__icon></div><div class=workbench-dock-ghost__copy><div class=workbench-dock-ghost__title></div><div class=workbench-dock-ghost__hint><span>");
|
|
11
|
+
const V = 5, Ne = ".workbench-dock", j = [{
|
|
12
12
|
mode: "work",
|
|
13
13
|
label: "Work Mode",
|
|
14
14
|
description: "Operate windows and sticky notes",
|
|
15
|
-
icon:
|
|
15
|
+
icon: Xe
|
|
16
16
|
}, {
|
|
17
17
|
mode: "background",
|
|
18
18
|
label: "Composition Mode",
|
|
19
19
|
description: "Arrange regions and canvas text",
|
|
20
|
-
icon:
|
|
21
|
-
}],
|
|
20
|
+
icon: Pe
|
|
21
|
+
}], Ve = [{
|
|
22
22
|
tool: "sticky-note",
|
|
23
23
|
label: "Sticky",
|
|
24
|
-
icon:
|
|
25
|
-
}],
|
|
24
|
+
icon: Ae
|
|
25
|
+
}], Ge = [{
|
|
26
26
|
tool: "background-region",
|
|
27
27
|
label: "Region",
|
|
28
|
-
icon:
|
|
28
|
+
icon: Ye
|
|
29
29
|
}, {
|
|
30
30
|
tool: "text",
|
|
31
31
|
label: "Text",
|
|
32
|
-
icon:
|
|
32
|
+
icon: Fe
|
|
33
33
|
}];
|
|
34
|
-
function
|
|
35
|
-
const e = document.querySelector(
|
|
36
|
-
return e instanceof HTMLElement ?
|
|
34
|
+
function Ue() {
|
|
35
|
+
const e = document.querySelector(ke);
|
|
36
|
+
return e instanceof HTMLElement ? fe(e) : null;
|
|
37
37
|
}
|
|
38
38
|
function Q(e, u, l) {
|
|
39
39
|
return e >= l.left && e <= l.right && u >= l.top && u <= l.bottom;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function qe(e, u, l) {
|
|
42
42
|
return l ? Q(e, u, l) : !1;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function ge(e, u, l) {
|
|
45
45
|
return Math.min(l, Math.max(u, e));
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ze(e, u, l, c, i) {
|
|
48
48
|
if (!e) return !1;
|
|
49
|
-
if (Q(u, l, e) || Q(c,
|
|
49
|
+
if (Q(u, l, e) || Q(c, i, e))
|
|
50
50
|
return !0;
|
|
51
|
-
const
|
|
52
|
-
let
|
|
53
|
-
const g = (
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
return
|
|
51
|
+
const r = c - u, C = i - l;
|
|
52
|
+
let D = 0, h = 1;
|
|
53
|
+
const g = (w, L) => {
|
|
54
|
+
if (w === 0) return L >= 0;
|
|
55
|
+
const f = L / w;
|
|
56
|
+
return w < 0 ? f > h ? !1 : (f > D && (D = f), !0) : f < D ? !1 : (f < h && (h = f), !0);
|
|
57
57
|
};
|
|
58
|
-
return g(-
|
|
58
|
+
return g(-r, u - e.left) && g(r, e.right - u) && g(-C, l - e.top) && g(C, e.bottom - l);
|
|
59
59
|
}
|
|
60
60
|
function J(e, u) {
|
|
61
61
|
if (typeof document.elementFromPoint != "function") return !1;
|
|
62
62
|
const l = document.elementFromPoint(e, u);
|
|
63
|
-
return l instanceof Element && l.closest(
|
|
63
|
+
return l instanceof Element && l.closest(Ne) !== null;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function ve(e) {
|
|
66
66
|
const u = () => e.hoverOffset === -1 ? {
|
|
67
67
|
scale: 1.26,
|
|
68
68
|
y: -6,
|
|
@@ -79,12 +79,12 @@ function qe(e) {
|
|
|
79
79
|
scale: 1,
|
|
80
80
|
y: 0,
|
|
81
81
|
x: 0
|
|
82
|
-
}, l = () => e.hoverOffset === -1, c = (
|
|
83
|
-
|
|
82
|
+
}, l = () => e.hoverOffset === -1, c = (i) => {
|
|
83
|
+
i.button === 0 && e.onDragBegin(i, e.kind, e.id, e.label, e.icon, i.currentTarget);
|
|
84
84
|
};
|
|
85
85
|
return (() => {
|
|
86
|
-
var
|
|
87
|
-
return
|
|
86
|
+
var i = $e();
|
|
87
|
+
return i.$$pointerdown = c, i.addEventListener("pointerleave", () => e.onLeave()), i.addEventListener("pointerenter", () => e.onEnter()), b(i, s(Y.span, {
|
|
88
88
|
class: "workbench-dock__tile",
|
|
89
89
|
get animate() {
|
|
90
90
|
return u();
|
|
@@ -92,18 +92,18 @@ function qe(e) {
|
|
|
92
92
|
get transition() {
|
|
93
93
|
return {
|
|
94
94
|
duration: A.fast,
|
|
95
|
-
easing:
|
|
95
|
+
easing: F.easeOut
|
|
96
96
|
};
|
|
97
97
|
},
|
|
98
98
|
get children() {
|
|
99
99
|
return (() => {
|
|
100
|
-
const
|
|
101
|
-
return
|
|
100
|
+
const r = e.icon;
|
|
101
|
+
return s(r, {
|
|
102
102
|
class: "workbench-dock__icon"
|
|
103
103
|
});
|
|
104
104
|
})();
|
|
105
105
|
}
|
|
106
|
-
}), null),
|
|
106
|
+
}), null), b(i, s(Y.span, {
|
|
107
107
|
class: "workbench-dock__tooltip",
|
|
108
108
|
get animate() {
|
|
109
109
|
return {
|
|
@@ -114,34 +114,35 @@ function qe(e) {
|
|
|
114
114
|
get transition() {
|
|
115
115
|
return {
|
|
116
116
|
duration: A.fast,
|
|
117
|
-
easing:
|
|
117
|
+
easing: F.easeOut
|
|
118
118
|
};
|
|
119
119
|
},
|
|
120
120
|
get children() {
|
|
121
121
|
return e.label;
|
|
122
122
|
}
|
|
123
|
-
}), null),
|
|
124
|
-
var D = !!e.active,
|
|
125
|
-
return
|
|
123
|
+
}), null), P((r) => {
|
|
124
|
+
var C = e.kind === "host" ? e.id : void 0, D = !!e.active, h = !!(e.filterable && !e.visible), g = !!l(), w = !!e.isDragging, L = e.filterable ? `${e.label} — click to solo, drag to canvas to create` : `${e.label} — drag to canvas to create`, f = e.active;
|
|
125
|
+
return C !== r.e && y(i, "data-workbench-dock-item", r.e = C), D !== r.t && i.classList.toggle("is-active", r.t = D), h !== r.a && i.classList.toggle("is-filter-muted", r.a = h), g !== r.o && i.classList.toggle("is-hovered", r.o = g), w !== r.i && i.classList.toggle("is-source-dragging", r.i = w), L !== r.n && y(i, "aria-label", r.n = L), f !== r.s && y(i, "aria-pressed", r.s = f), r;
|
|
126
126
|
}, {
|
|
127
127
|
e: void 0,
|
|
128
128
|
t: void 0,
|
|
129
129
|
a: void 0,
|
|
130
130
|
o: void 0,
|
|
131
131
|
i: void 0,
|
|
132
|
-
n: void 0
|
|
133
|
-
|
|
132
|
+
n: void 0,
|
|
133
|
+
s: void 0
|
|
134
|
+
}), i;
|
|
134
135
|
})();
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function je(e) {
|
|
137
138
|
const u = () => e.hoverOffset === -1, l = () => ({
|
|
138
139
|
scale: 1,
|
|
139
140
|
y: 0,
|
|
140
141
|
x: 0
|
|
141
142
|
}), c = e.action.icon;
|
|
142
143
|
return (() => {
|
|
143
|
-
var
|
|
144
|
-
return
|
|
144
|
+
var i = Be();
|
|
145
|
+
return i.$$click = (r) => e.action.onActivate(r.currentTarget), i.addEventListener("dragstart", (r) => r.preventDefault()), se(i, "pointerleave", e.onLeave), se(i, "pointerenter", e.onEnter), y(i, "draggable", !1), b(i, s(Y.span, {
|
|
145
146
|
class: "workbench-dock__tile",
|
|
146
147
|
get animate() {
|
|
147
148
|
return l();
|
|
@@ -149,15 +150,15 @@ function ze(e) {
|
|
|
149
150
|
get transition() {
|
|
150
151
|
return {
|
|
151
152
|
duration: A.fast,
|
|
152
|
-
easing:
|
|
153
|
+
easing: F.easeOut
|
|
153
154
|
};
|
|
154
155
|
},
|
|
155
156
|
get children() {
|
|
156
|
-
return
|
|
157
|
+
return s(c, {
|
|
157
158
|
class: "workbench-dock__icon"
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
|
-
}), null),
|
|
161
|
+
}), null), b(i, s(Y.span, {
|
|
161
162
|
class: "workbench-dock__tooltip",
|
|
162
163
|
get animate() {
|
|
163
164
|
return {
|
|
@@ -168,63 +169,63 @@ function ze(e) {
|
|
|
168
169
|
get transition() {
|
|
169
170
|
return {
|
|
170
171
|
duration: A.fast,
|
|
171
|
-
easing:
|
|
172
|
+
easing: F.easeOut
|
|
172
173
|
};
|
|
173
174
|
},
|
|
174
175
|
get children() {
|
|
175
176
|
return e.action.label;
|
|
176
177
|
}
|
|
177
|
-
}), null),
|
|
178
|
-
var
|
|
179
|
-
return
|
|
178
|
+
}), null), P((r) => {
|
|
179
|
+
var C = e.action.id, D = !!e.action.active, h = !!u(), g = e.action.label, w = e.action.active;
|
|
180
|
+
return C !== r.e && y(i, "data-workbench-dock-action", r.e = C), D !== r.t && i.classList.toggle("is-active", r.t = D), h !== r.a && i.classList.toggle("is-hovered", r.a = h), g !== r.o && y(i, "aria-label", r.o = g), w !== r.i && y(i, "aria-pressed", r.i = w), r;
|
|
180
181
|
}, {
|
|
181
182
|
e: void 0,
|
|
182
183
|
t: void 0,
|
|
183
184
|
a: void 0,
|
|
184
185
|
o: void 0,
|
|
185
186
|
i: void 0
|
|
186
|
-
}),
|
|
187
|
+
}), i;
|
|
187
188
|
})();
|
|
188
189
|
}
|
|
189
|
-
function
|
|
190
|
-
const [u, l] =
|
|
191
|
-
let
|
|
192
|
-
|
|
193
|
-
|
|
190
|
+
function lt(e) {
|
|
191
|
+
const [u, l] = z(null), [c, i] = z(null), [r, C] = z(!1);
|
|
192
|
+
let D, h, g, w, L = null;
|
|
193
|
+
K(() => {
|
|
194
|
+
w?.stop(), h?.stop({
|
|
194
195
|
reason: "manual_stop",
|
|
195
196
|
commit: !1
|
|
196
|
-
}),
|
|
197
|
-
}),
|
|
197
|
+
}), h = void 0, g?.(), g = void 0, c()?.stopInteraction(), e.onDragPreviewChange?.(null), e.registerExternalDockDragController?.(null);
|
|
198
|
+
}), p(() => {
|
|
198
199
|
e.onDragPreviewChange?.(c()?.preview ?? null);
|
|
199
|
-
}),
|
|
200
|
+
}), p(() => {
|
|
200
201
|
const t = (n) => {
|
|
201
|
-
n.key !== "Escape" || !c() || (n.preventDefault(),
|
|
202
|
+
n.key !== "Escape" || !c() || (n.preventDefault(), h?.stop({
|
|
202
203
|
reason: "manual_stop",
|
|
203
204
|
commit: !1
|
|
204
205
|
}));
|
|
205
206
|
};
|
|
206
|
-
window.addEventListener("keydown", t, !0),
|
|
207
|
-
}),
|
|
208
|
-
if (!
|
|
209
|
-
const t = (
|
|
210
|
-
|
|
211
|
-
}, n = (
|
|
212
|
-
|
|
207
|
+
window.addEventListener("keydown", t, !0), K(() => window.removeEventListener("keydown", t, !0));
|
|
208
|
+
}), p(() => {
|
|
209
|
+
if (!r() || typeof window > "u") return;
|
|
210
|
+
const t = (d) => {
|
|
211
|
+
D && d.target instanceof Node && D.contains(d.target) || C(!1);
|
|
212
|
+
}, n = (d) => {
|
|
213
|
+
d.key === "Escape" && C(!1);
|
|
213
214
|
};
|
|
214
|
-
window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown", n, !0),
|
|
215
|
+
window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown", n, !0), K(() => {
|
|
215
216
|
window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown", n, !0);
|
|
216
217
|
});
|
|
217
218
|
});
|
|
218
|
-
const
|
|
219
|
+
const f = (t) => {
|
|
219
220
|
const n = u();
|
|
220
|
-
return n === null || n <=
|
|
221
|
+
return n === null || n <= R().length ? 0 : n === t ? -1 : n === t + 1 ? -2 : n === t - 1 ? 1 : 0;
|
|
221
222
|
}, T = () => {
|
|
222
|
-
|
|
223
|
-
},
|
|
224
|
-
!e.viewport || !e.onViewportCommit || (L = e.viewport,
|
|
223
|
+
w?.stop(), w = void 0, L = null;
|
|
224
|
+
}, H = () => {
|
|
225
|
+
!e.viewport || !e.onViewportCommit || (L = e.viewport, w?.stop(), w = Te({
|
|
225
226
|
readFrame: () => {
|
|
226
|
-
const t = document.querySelector(
|
|
227
|
-
return t instanceof HTMLElement ?
|
|
227
|
+
const t = document.querySelector(ke);
|
|
228
|
+
return t instanceof HTMLElement ? fe(t) : null;
|
|
228
229
|
},
|
|
229
230
|
readViewport: () => L ?? e.viewport ?? null,
|
|
230
231
|
commitViewport: (t) => {
|
|
@@ -239,15 +240,20 @@ function at(e) {
|
|
|
239
240
|
}, Z = (t) => {
|
|
240
241
|
const n = c();
|
|
241
242
|
if (!n) return;
|
|
242
|
-
const
|
|
243
|
-
if (n.stopInteraction(), T(),
|
|
244
|
-
if (n.kind === "external"
|
|
243
|
+
const d = !n.moved;
|
|
244
|
+
if (n.stopInteraction(), T(), i(null), h = void 0, d) {
|
|
245
|
+
if (n.kind === "external") return;
|
|
246
|
+
if (n.kind === "host") {
|
|
247
|
+
e.dockItems?.find((E) => E.id === n.id)?.onActivate?.(n.trigger);
|
|
248
|
+
return;
|
|
249
|
+
}
|
|
250
|
+
if (e.onItemClick?.({
|
|
245
251
|
kind: n.kind,
|
|
246
252
|
id: n.id,
|
|
247
253
|
label: n.label,
|
|
248
254
|
trigger: n.trigger
|
|
249
255
|
})) return;
|
|
250
|
-
|
|
256
|
+
M() !== "background" && e.onSoloFilter(String(n.id), ie());
|
|
251
257
|
return;
|
|
252
258
|
}
|
|
253
259
|
if (t && n.kind === "external" && n.overDock) {
|
|
@@ -259,23 +265,33 @@ function at(e) {
|
|
|
259
265
|
return;
|
|
260
266
|
}
|
|
261
267
|
if (t && n.overCanvas) {
|
|
262
|
-
const
|
|
268
|
+
const _ = n.canvasFrame ? {
|
|
263
269
|
dropAllowed: n.overCanvas,
|
|
264
270
|
canvasFrame: n.canvasFrame
|
|
265
271
|
} : void 0;
|
|
266
|
-
n.kind === "widget"
|
|
272
|
+
if (n.kind === "widget")
|
|
273
|
+
e.onCreateAt?.(n.id, n.clientX, n.clientY, _);
|
|
274
|
+
else if (n.kind === "tool")
|
|
275
|
+
e.onCreateToolAt?.(n.id, n.clientX, n.clientY, _);
|
|
276
|
+
else {
|
|
277
|
+
const E = n.canvasFrame ? {
|
|
278
|
+
dropAllowed: n.overCanvas,
|
|
279
|
+
canvasFrame: n.canvasFrame
|
|
280
|
+
} : void 0;
|
|
281
|
+
e.dockItems?.find((o) => o.id === n.id)?.onDropToCanvas?.(n.clientX, n.clientY, E);
|
|
282
|
+
}
|
|
267
283
|
}
|
|
268
|
-
},
|
|
269
|
-
t.preventDefault(),
|
|
284
|
+
}, ee = (t, n, d, _, E, o) => {
|
|
285
|
+
t.preventDefault(), h?.stop({
|
|
270
286
|
reason: "manual_stop",
|
|
271
287
|
commit: !1
|
|
272
|
-
}),
|
|
273
|
-
const
|
|
274
|
-
|
|
288
|
+
}), H();
|
|
289
|
+
const v = Ue();
|
|
290
|
+
i({
|
|
275
291
|
kind: n,
|
|
276
|
-
id:
|
|
277
|
-
label:
|
|
278
|
-
icon:
|
|
292
|
+
id: d,
|
|
293
|
+
label: _,
|
|
294
|
+
icon: E,
|
|
279
295
|
pointerId: t.pointerId,
|
|
280
296
|
startClientX: t.clientX,
|
|
281
297
|
startClientY: t.clientY,
|
|
@@ -284,57 +300,57 @@ function at(e) {
|
|
|
284
300
|
moved: !1,
|
|
285
301
|
overCanvas: !1,
|
|
286
302
|
hasEnteredCanvas: !1,
|
|
287
|
-
canvasFrame:
|
|
303
|
+
canvasFrame: v,
|
|
288
304
|
preview: null,
|
|
289
|
-
stopInteraction:
|
|
305
|
+
stopInteraction: de({
|
|
290
306
|
kind: "drag",
|
|
291
307
|
cursor: "grabbing"
|
|
292
308
|
}),
|
|
293
|
-
trigger:
|
|
309
|
+
trigger: o,
|
|
294
310
|
overDock: !1
|
|
295
311
|
});
|
|
296
|
-
const
|
|
297
|
-
let
|
|
298
|
-
|
|
299
|
-
if (!
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
-
const
|
|
312
|
+
const k = (a) => {
|
|
313
|
+
let S = !1;
|
|
314
|
+
i((m) => {
|
|
315
|
+
if (!m || m.pointerId !== a.pointerId) return m;
|
|
316
|
+
const W = a.clientX - m.startClientX, q = a.clientY - m.startClientY, O = m.moved || Math.abs(W) > V || Math.abs(q) > V, X = J(a.clientX, a.clientY), I = m.canvasFrame, re = O && qe(a.clientX, a.clientY, I), ae = re && !X, Ce = O && !X && ze(I, m.clientX, m.clientY, a.clientX, a.clientY), le = m.hasEnteredCanvas || re || Ce;
|
|
317
|
+
S = O && le && !X;
|
|
318
|
+
const Le = I ? ge(a.clientX, I.left, I.right) : a.clientX, Ie = I ? ge(a.clientY, I.top, I.bottom) : a.clientY;
|
|
303
319
|
return {
|
|
304
|
-
...
|
|
320
|
+
...m,
|
|
305
321
|
clientX: a.clientX,
|
|
306
322
|
clientY: a.clientY,
|
|
307
|
-
moved:
|
|
308
|
-
overCanvas:
|
|
309
|
-
hasEnteredCanvas:
|
|
310
|
-
preview:
|
|
311
|
-
kind:
|
|
312
|
-
id:
|
|
313
|
-
label:
|
|
314
|
-
clientX:
|
|
315
|
-
clientY:
|
|
316
|
-
dropAllowed:
|
|
317
|
-
canvasFrame:
|
|
323
|
+
moved: O,
|
|
324
|
+
overCanvas: ae,
|
|
325
|
+
hasEnteredCanvas: le,
|
|
326
|
+
preview: O && I && (m.kind === "widget" || m.kind === "tool") ? {
|
|
327
|
+
kind: m.kind,
|
|
328
|
+
id: m.id,
|
|
329
|
+
label: m.label,
|
|
330
|
+
clientX: Le,
|
|
331
|
+
clientY: Ie,
|
|
332
|
+
dropAllowed: ae,
|
|
333
|
+
canvasFrame: I
|
|
318
334
|
} : null
|
|
319
335
|
};
|
|
320
|
-
}),
|
|
336
|
+
}), S && w?.updatePointer(a.clientX, a.clientY);
|
|
321
337
|
};
|
|
322
|
-
|
|
338
|
+
h = ue({
|
|
323
339
|
pointerEvent: t,
|
|
324
340
|
captureEl: t.currentTarget,
|
|
325
|
-
onMove:
|
|
341
|
+
onMove: k,
|
|
326
342
|
onEnd: ({
|
|
327
343
|
commit: a
|
|
328
344
|
}) => Z(a)
|
|
329
345
|
});
|
|
330
|
-
},
|
|
346
|
+
}, me = (t, n) => {
|
|
331
347
|
if (t.button !== 0 || !(t.currentTarget instanceof HTMLElement)) return;
|
|
332
|
-
t.preventDefault(),
|
|
348
|
+
t.preventDefault(), h?.stop({
|
|
333
349
|
reason: "manual_stop",
|
|
334
350
|
commit: !1
|
|
335
351
|
}), g?.(), g = void 0;
|
|
336
|
-
const
|
|
337
|
-
|
|
352
|
+
const d = t.currentTarget;
|
|
353
|
+
i({
|
|
338
354
|
kind: "external",
|
|
339
355
|
id: n.id,
|
|
340
356
|
label: n.label,
|
|
@@ -350,56 +366,56 @@ function at(e) {
|
|
|
350
366
|
hasEnteredCanvas: !1,
|
|
351
367
|
canvasFrame: null,
|
|
352
368
|
preview: null,
|
|
353
|
-
stopInteraction:
|
|
369
|
+
stopInteraction: de({
|
|
354
370
|
kind: "drag",
|
|
355
371
|
cursor: "grabbing"
|
|
356
372
|
}),
|
|
357
|
-
trigger:
|
|
358
|
-
}),
|
|
373
|
+
trigger: d
|
|
374
|
+
}), h = ue({
|
|
359
375
|
pointerEvent: t,
|
|
360
|
-
captureEl:
|
|
361
|
-
onMove: (
|
|
362
|
-
|
|
363
|
-
if (!
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
},
|
|
376
|
+
captureEl: d,
|
|
377
|
+
onMove: (_) => {
|
|
378
|
+
i((E) => {
|
|
379
|
+
if (!E || E.kind !== "external" || E.pointerId !== _.pointerId) return E;
|
|
380
|
+
const o = E.moved || Math.abs(_.clientX - E.startClientX) > V || Math.abs(_.clientY - E.startClientY) > V;
|
|
381
|
+
if (o && !E.moved) {
|
|
382
|
+
const v = (S) => {
|
|
383
|
+
S.preventDefault(), S.stopImmediatePropagation(), g?.();
|
|
384
|
+
}, k = window.setTimeout(() => {
|
|
369
385
|
g === a && a();
|
|
370
386
|
}, 0), a = () => {
|
|
371
|
-
window.clearTimeout(
|
|
387
|
+
window.clearTimeout(k), d.removeEventListener("click", v, !0), g === a && (g = void 0);
|
|
372
388
|
};
|
|
373
|
-
|
|
389
|
+
d.addEventListener("click", v, {
|
|
374
390
|
capture: !0,
|
|
375
391
|
once: !0
|
|
376
392
|
}), g = a;
|
|
377
393
|
}
|
|
378
394
|
return {
|
|
379
|
-
...
|
|
380
|
-
clientX:
|
|
381
|
-
clientY:
|
|
382
|
-
moved:
|
|
383
|
-
overDock:
|
|
395
|
+
...E,
|
|
396
|
+
clientX: _.clientX,
|
|
397
|
+
clientY: _.clientY,
|
|
398
|
+
moved: o,
|
|
399
|
+
overDock: o && J(_.clientX, _.clientY)
|
|
384
400
|
};
|
|
385
401
|
});
|
|
386
402
|
},
|
|
387
403
|
onEnd: ({
|
|
388
|
-
commit:
|
|
389
|
-
}) => Z(
|
|
404
|
+
commit: _
|
|
405
|
+
}) => Z(_)
|
|
390
406
|
});
|
|
391
407
|
};
|
|
392
|
-
|
|
408
|
+
p(() => {
|
|
393
409
|
e.registerExternalDockDragController?.({
|
|
394
|
-
begin:
|
|
395
|
-
}),
|
|
410
|
+
begin: me
|
|
411
|
+
}), K(() => e.registerExternalDockDragController?.(null));
|
|
396
412
|
});
|
|
397
|
-
const
|
|
413
|
+
const he = () => c()?.kind === "widget" ? c().id : null, be = () => c()?.kind === "tool" ? c().id : null, we = () => c()?.kind === "external" ? c()?.icon : void 0, M = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", te = $(() => j.find((t) => t.mode === M()) ?? j[0]), ne = $(() => M() === "background" ? Ge.map((t) => ({
|
|
398
414
|
id: t.tool,
|
|
399
415
|
kind: "tool",
|
|
400
416
|
label: t.label,
|
|
401
417
|
icon: t.icon
|
|
402
|
-
})) : [...
|
|
418
|
+
})) : [...Ve.map((t) => ({
|
|
403
419
|
id: t.tool,
|
|
404
420
|
kind: "tool",
|
|
405
421
|
label: t.label,
|
|
@@ -409,158 +425,191 @@ function at(e) {
|
|
|
409
425
|
kind: "widget",
|
|
410
426
|
label: t.label,
|
|
411
427
|
icon: t.icon
|
|
412
|
-
}))]),
|
|
413
|
-
if (!
|
|
428
|
+
}))]), oe = $(() => M() === "background" ? [] : [...e.dockItems ?? []]), R = $(() => M() === "background" ? [] : [...e.dockActions ?? []]), ie = $(() => ne().map((t) => String(t.id))), G = () => M() !== "background", _e = (t) => !G() || e.filters[t] !== !1, Ee = (t) => {
|
|
429
|
+
if (!G())
|
|
414
430
|
return !1;
|
|
415
|
-
const n =
|
|
416
|
-
return n.length > 1 && n.every((
|
|
417
|
-
},
|
|
431
|
+
const n = ie();
|
|
432
|
+
return n.length > 1 && n.every((d) => e.filters[d] !== !1 == (d === t));
|
|
433
|
+
}, U = () => u() === 0, De = () => ({
|
|
418
434
|
scale: 1,
|
|
419
435
|
y: 0,
|
|
420
436
|
x: 0
|
|
421
437
|
});
|
|
422
438
|
return [(() => {
|
|
423
|
-
var t =
|
|
439
|
+
var t = We(), n = t.firstChild, d = n.firstChild, _ = n.nextSibling;
|
|
424
440
|
t.addEventListener("pointerleave", () => l(null));
|
|
425
|
-
var
|
|
426
|
-
return typeof
|
|
441
|
+
var E = D;
|
|
442
|
+
return typeof E == "function" ? Me(E, t) : D = t, d.$$click = () => C((o) => !o), d.addEventListener("pointerleave", () => l((o) => o === 0 ? null : o)), d.addEventListener("pointerenter", () => l(0)), b(d, s(Y.span, {
|
|
427
443
|
class: "workbench-dock__tile",
|
|
428
444
|
get animate() {
|
|
429
|
-
return
|
|
445
|
+
return De();
|
|
430
446
|
},
|
|
431
447
|
get transition() {
|
|
432
448
|
return {
|
|
433
449
|
duration: A.fast,
|
|
434
|
-
easing:
|
|
450
|
+
easing: F.easeOut
|
|
435
451
|
};
|
|
436
452
|
},
|
|
437
453
|
get children() {
|
|
438
454
|
return (() => {
|
|
439
|
-
const
|
|
440
|
-
return
|
|
455
|
+
const o = te().icon;
|
|
456
|
+
return s(o, {
|
|
441
457
|
class: "workbench-dock__icon"
|
|
442
458
|
});
|
|
443
459
|
})();
|
|
444
460
|
}
|
|
445
|
-
}), null),
|
|
461
|
+
}), null), b(d, s(Y.span, {
|
|
446
462
|
class: "workbench-dock__tooltip",
|
|
447
463
|
get animate() {
|
|
448
464
|
return {
|
|
449
|
-
opacity:
|
|
450
|
-
y:
|
|
465
|
+
opacity: U() && !r() ? 1 : 0,
|
|
466
|
+
y: U() && !r() ? -6 : 0
|
|
451
467
|
};
|
|
452
468
|
},
|
|
453
469
|
get transition() {
|
|
454
470
|
return {
|
|
455
471
|
duration: A.fast,
|
|
456
|
-
easing:
|
|
472
|
+
easing: F.easeOut
|
|
457
473
|
};
|
|
458
474
|
},
|
|
459
475
|
get children() {
|
|
460
|
-
return
|
|
476
|
+
return te().label;
|
|
461
477
|
}
|
|
462
|
-
}), null),
|
|
478
|
+
}), null), b(n, s(B, {
|
|
463
479
|
get when() {
|
|
464
|
-
return
|
|
480
|
+
return r();
|
|
465
481
|
},
|
|
466
482
|
get children() {
|
|
467
|
-
var
|
|
468
|
-
return
|
|
483
|
+
var o = He();
|
|
484
|
+
return b(o, s(N, {
|
|
469
485
|
each: j,
|
|
470
|
-
children: (
|
|
471
|
-
const
|
|
486
|
+
children: (v) => {
|
|
487
|
+
const k = v.icon;
|
|
472
488
|
return (() => {
|
|
473
|
-
var a =
|
|
489
|
+
var a = Ke(), S = a.firstChild, m = S.nextSibling, W = m.firstChild, q = W.nextSibling;
|
|
474
490
|
return a.$$click = () => {
|
|
475
|
-
e.onSelectMode?.(
|
|
476
|
-
},
|
|
491
|
+
e.onSelectMode?.(v.mode), C(!1);
|
|
492
|
+
}, b(S, s(k, {
|
|
477
493
|
class: "workbench-dock__mode-icon"
|
|
478
|
-
})),
|
|
479
|
-
var
|
|
480
|
-
return
|
|
494
|
+
})), b(W, () => v.label), b(q, () => v.description), P((O) => {
|
|
495
|
+
var X = M() === v.mode, I = M() === v.mode;
|
|
496
|
+
return X !== O.e && a.classList.toggle("is-active", O.e = X), I !== O.t && y(a, "aria-checked", O.t = I), O;
|
|
481
497
|
}, {
|
|
482
498
|
e: void 0,
|
|
483
499
|
t: void 0
|
|
484
500
|
}), a;
|
|
485
501
|
})();
|
|
486
502
|
}
|
|
487
|
-
})),
|
|
503
|
+
})), o;
|
|
488
504
|
}
|
|
489
|
-
}), null),
|
|
505
|
+
}), null), b(t, s(N, {
|
|
490
506
|
get each() {
|
|
491
|
-
return
|
|
507
|
+
return R();
|
|
492
508
|
},
|
|
493
|
-
children: (
|
|
494
|
-
const
|
|
495
|
-
return
|
|
496
|
-
action:
|
|
509
|
+
children: (o, v) => {
|
|
510
|
+
const k = () => v() + 1;
|
|
511
|
+
return s(je, {
|
|
512
|
+
action: o,
|
|
497
513
|
get hoverOffset() {
|
|
498
|
-
return
|
|
514
|
+
return f(k());
|
|
499
515
|
},
|
|
500
|
-
onEnter: () => l(
|
|
501
|
-
onLeave: () => l((a) => a ===
|
|
516
|
+
onEnter: () => l(k()),
|
|
517
|
+
onLeave: () => l((a) => a === k() ? null : a)
|
|
502
518
|
});
|
|
503
519
|
}
|
|
504
|
-
}),
|
|
520
|
+
}), _), b(t, s(B, {
|
|
505
521
|
get when() {
|
|
506
522
|
return !!(c()?.kind === "external" && c()?.moved);
|
|
507
523
|
},
|
|
508
524
|
get children() {
|
|
509
|
-
var
|
|
510
|
-
return
|
|
525
|
+
var o = Re();
|
|
526
|
+
return b(o, s(B, {
|
|
511
527
|
get when() {
|
|
512
|
-
return
|
|
528
|
+
return we();
|
|
513
529
|
},
|
|
514
|
-
children: (
|
|
515
|
-
const
|
|
516
|
-
return
|
|
530
|
+
children: (v) => {
|
|
531
|
+
const k = v();
|
|
532
|
+
return s(k, {
|
|
517
533
|
class: "workbench-dock__icon"
|
|
518
534
|
});
|
|
519
535
|
}
|
|
520
|
-
})),
|
|
536
|
+
})), P(() => o.classList.toggle("is-drop-allowed", !!c()?.overDock)), o;
|
|
537
|
+
}
|
|
538
|
+
}), _), b(t, s(N, {
|
|
539
|
+
get each() {
|
|
540
|
+
return oe();
|
|
541
|
+
},
|
|
542
|
+
children: (o, v) => {
|
|
543
|
+
const k = () => v() + R().length + 1;
|
|
544
|
+
return s(ve, {
|
|
545
|
+
get id() {
|
|
546
|
+
return o.id;
|
|
547
|
+
},
|
|
548
|
+
kind: "host",
|
|
549
|
+
get label() {
|
|
550
|
+
return o.label;
|
|
551
|
+
},
|
|
552
|
+
get icon() {
|
|
553
|
+
return o.icon;
|
|
554
|
+
},
|
|
555
|
+
get active() {
|
|
556
|
+
return !!o.active;
|
|
557
|
+
},
|
|
558
|
+
visible: !0,
|
|
559
|
+
filterable: !1,
|
|
560
|
+
get hoverOffset() {
|
|
561
|
+
return f(k());
|
|
562
|
+
},
|
|
563
|
+
get isDragging() {
|
|
564
|
+
return ce(() => c()?.kind === "host")() && c()?.id === o.id;
|
|
565
|
+
},
|
|
566
|
+
onEnter: () => l(k()),
|
|
567
|
+
onLeave: () => l((a) => a === k() ? null : a),
|
|
568
|
+
onDragBegin: ee
|
|
569
|
+
});
|
|
521
570
|
}
|
|
522
|
-
}),
|
|
571
|
+
}), _), b(t, s(N, {
|
|
523
572
|
get each() {
|
|
524
|
-
return
|
|
573
|
+
return ne();
|
|
525
574
|
},
|
|
526
|
-
children: (
|
|
527
|
-
const
|
|
528
|
-
return
|
|
575
|
+
children: (o, v) => {
|
|
576
|
+
const k = () => v() + R().length + oe().length + 1;
|
|
577
|
+
return s(ve, {
|
|
529
578
|
get id() {
|
|
530
|
-
return String(
|
|
579
|
+
return String(o.id);
|
|
531
580
|
},
|
|
532
581
|
get kind() {
|
|
533
|
-
return
|
|
582
|
+
return o.kind;
|
|
534
583
|
},
|
|
535
584
|
get label() {
|
|
536
|
-
return
|
|
585
|
+
return o.label;
|
|
537
586
|
},
|
|
538
587
|
get icon() {
|
|
539
|
-
return
|
|
588
|
+
return o.icon;
|
|
540
589
|
},
|
|
541
590
|
get active() {
|
|
542
|
-
return
|
|
591
|
+
return Ee(String(o.id));
|
|
543
592
|
},
|
|
544
593
|
get visible() {
|
|
545
|
-
return
|
|
594
|
+
return _e(String(o.id));
|
|
546
595
|
},
|
|
547
596
|
get filterable() {
|
|
548
|
-
return
|
|
597
|
+
return G();
|
|
549
598
|
},
|
|
550
599
|
get hoverOffset() {
|
|
551
|
-
return
|
|
600
|
+
return f(k());
|
|
552
601
|
},
|
|
553
602
|
get isDragging() {
|
|
554
|
-
return
|
|
603
|
+
return ce(() => o.kind === "widget")() ? he() === o.id : be() === o.id;
|
|
555
604
|
},
|
|
556
|
-
onEnter: () => l(
|
|
557
|
-
onLeave: () => l((a) => a ===
|
|
558
|
-
onDragBegin:
|
|
605
|
+
onEnter: () => l(k()),
|
|
606
|
+
onLeave: () => l((a) => a === k() ? null : a),
|
|
607
|
+
onDragBegin: ee
|
|
559
608
|
});
|
|
560
609
|
}
|
|
561
|
-
}), null),
|
|
562
|
-
var
|
|
563
|
-
return
|
|
610
|
+
}), null), P((o) => {
|
|
611
|
+
var v = !!(c()?.kind === "external" && c()?.moved), k = !!(c()?.kind === "external" && c()?.overDock), a = M() === "background", S = !!(U() || r()), m = r();
|
|
612
|
+
return v !== o.e && t.classList.toggle("is-external-drop-target", o.e = v), k !== o.t && t.classList.toggle("is-external-drop-allowed", o.t = k), a !== o.a && d.classList.toggle("is-active", o.a = a), S !== o.o && d.classList.toggle("is-hovered", o.o = S), m !== o.i && y(d, "aria-expanded", o.i = m), o;
|
|
564
613
|
}, {
|
|
565
614
|
e: void 0,
|
|
566
615
|
t: void 0,
|
|
@@ -568,48 +617,48 @@ function at(e) {
|
|
|
568
617
|
o: void 0,
|
|
569
618
|
i: void 0
|
|
570
619
|
}), t;
|
|
571
|
-
})(),
|
|
620
|
+
})(), s(B, {
|
|
572
621
|
get when() {
|
|
573
622
|
return !!(c()?.moved && !c()?.preview);
|
|
574
623
|
},
|
|
575
624
|
get children() {
|
|
576
|
-
return
|
|
625
|
+
return s(Je, {
|
|
577
626
|
state: c
|
|
578
627
|
});
|
|
579
628
|
}
|
|
580
629
|
})];
|
|
581
630
|
}
|
|
582
|
-
function
|
|
631
|
+
function Je(e) {
|
|
583
632
|
const u = () => {
|
|
584
|
-
const
|
|
585
|
-
return
|
|
633
|
+
const i = e.state();
|
|
634
|
+
return i ? `translate3d(${i.clientX + 14}px, ${i.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
|
|
586
635
|
}, l = () => e.state()?.label ?? "", c = () => e.state()?.icon;
|
|
587
|
-
return
|
|
636
|
+
return s(Se, {
|
|
588
637
|
get children() {
|
|
589
|
-
var
|
|
590
|
-
return
|
|
638
|
+
var i = pe(), r = i.firstChild, C = r.nextSibling, D = C.firstChild, h = D.nextSibling, g = h.firstChild, w = g.nextSibling, L = w.firstChild;
|
|
639
|
+
return b(D, s(B, {
|
|
591
640
|
get when() {
|
|
592
641
|
return c();
|
|
593
642
|
},
|
|
594
|
-
children: (
|
|
595
|
-
const T =
|
|
596
|
-
return
|
|
643
|
+
children: (f) => {
|
|
644
|
+
const T = f();
|
|
645
|
+
return s(T, {
|
|
597
646
|
class: "w-4 h-4"
|
|
598
647
|
});
|
|
599
648
|
}
|
|
600
|
-
})),
|
|
649
|
+
})), b(g, l), b(w, s(xe, {
|
|
601
650
|
class: "w-3 h-3"
|
|
602
|
-
}), L),
|
|
603
|
-
var T = !!(e.state()?.kind === "external" && e.state()?.overDock),
|
|
604
|
-
return T !==
|
|
651
|
+
}), L), b(L, () => e.state()?.kind === "external" ? "Pin to Dock" : "Drag onto canvas"), P((f) => {
|
|
652
|
+
var T = !!(e.state()?.kind === "external" && e.state()?.overDock), H = u();
|
|
653
|
+
return T !== f.e && i.classList.toggle("is-over-dock", f.e = T), H !== f.t && Oe(i, "transform", f.t = H), f;
|
|
605
654
|
}, {
|
|
606
655
|
e: void 0,
|
|
607
656
|
t: void 0
|
|
608
|
-
}),
|
|
657
|
+
}), i;
|
|
609
658
|
}
|
|
610
659
|
});
|
|
611
660
|
}
|
|
612
|
-
|
|
661
|
+
ye(["pointerdown", "click"]);
|
|
613
662
|
export {
|
|
614
|
-
|
|
663
|
+
lt as WorkbenchDock
|
|
615
664
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type UIFirstSelectionEvent } from '../../utils/uiFirstSelection';
|
|
2
2
|
import { type WorkbenchContextMenuItem } from './WorkbenchContextMenu';
|
|
3
|
-
import { type WorkbenchDockItemActivation, type WorkbenchDockAction, type WorkbenchExternalDockDragController, type WorkbenchExternalDockDragItem } from './WorkbenchFilterBar';
|
|
3
|
+
import { type WorkbenchDockItemActivation, type WorkbenchDockAction, type WorkbenchExternalDockDragController, type WorkbenchExternalDockDragItem, type WorkbenchHostDockItem } from './WorkbenchFilterBar';
|
|
4
4
|
import type { WorkbenchState, WorkbenchAnnotationItem, WorkbenchBackgroundLayer, WorkbenchBackgroundLayerDefaults, WorkbenchBackgroundLayerPatch, WorkbenchContextMenuState, WorkbenchInteractionAdapter, WorkbenchStickyNoteItem, WorkbenchStickyNotePatch, WorkbenchTextAnnotationDefaults, WorkbenchTextAnnotationPatch, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
|
|
5
5
|
export interface WorkbenchCreateAtOptions {
|
|
6
6
|
worldX?: number;
|
|
@@ -69,6 +69,7 @@ export interface WorkbenchSurfaceProps {
|
|
|
69
69
|
onRequestDelete?: (widgetId: string) => void;
|
|
70
70
|
onDockItemClick?: (item: WorkbenchDockItemActivation) => boolean | void;
|
|
71
71
|
dockActions?: readonly WorkbenchDockAction[];
|
|
72
|
+
dockItems?: readonly WorkbenchHostDockItem[];
|
|
72
73
|
registerExternalDockDragController?: (controller: WorkbenchExternalDockDragController | null) => void;
|
|
73
74
|
onExternalDockDrop?: (item: WorkbenchExternalDockDragItem) => void;
|
|
74
75
|
onLayoutInteractionStart?: () => void;
|
|
@@ -115,7 +115,7 @@ function Ee(i) {
|
|
|
115
115
|
}
|
|
116
116
|
const f = s();
|
|
117
117
|
f && e instanceof Node && f.contains(e) && g(r.createCanvasInputOwner(o));
|
|
118
|
-
},
|
|
118
|
+
}, I = (e = "selection_cleared") => {
|
|
119
119
|
const n = c(), o = s();
|
|
120
120
|
t.selection.clear(), g(n.createCanvasInputOwner(e)), queueMicrotask(() => {
|
|
121
121
|
if (!o || typeof document > "u") return;
|
|
@@ -164,7 +164,7 @@ function Ee(i) {
|
|
|
164
164
|
const n = y();
|
|
165
165
|
return t.widgetActions.addBackgroundLayerAtCursor(e?.worldX ?? n.worldX, e?.worldY ?? n.worldY) ?? null;
|
|
166
166
|
},
|
|
167
|
-
clearSelection: () =>
|
|
167
|
+
clearSelection: () => I("selection_cleared"),
|
|
168
168
|
focusWidget: (e, n) => {
|
|
169
169
|
const o = t.navigation.focusWidget(e, n);
|
|
170
170
|
return m(o.id), o;
|
|
@@ -202,7 +202,7 @@ function Ee(i) {
|
|
|
202
202
|
i.onApiReady?.(null);
|
|
203
203
|
});
|
|
204
204
|
});
|
|
205
|
-
const
|
|
205
|
+
const M = () => i.lockShortcut === void 0 ? ke : i.lockShortcut;
|
|
206
206
|
k(() => {
|
|
207
207
|
if (typeof window > "u" || !t.contextMenu.state()) return;
|
|
208
208
|
const e = ce({
|
|
@@ -227,7 +227,7 @@ function Ee(i) {
|
|
|
227
227
|
});
|
|
228
228
|
}), k(() => {
|
|
229
229
|
if (i.enableKeyboard === !1 || typeof document > "u") return;
|
|
230
|
-
const e =
|
|
230
|
+
const e = M(), n = (o) => {
|
|
231
231
|
if (!(o.defaultPrevented || o.isComposing)) {
|
|
232
232
|
if (e !== null && o.key === e) {
|
|
233
233
|
o.preventDefault(), t.lock.toggle();
|
|
@@ -291,7 +291,7 @@ function Ee(i) {
|
|
|
291
291
|
e === "background-region" && t.widgetActions.addBackgroundLayerAtCursor(a.worldX, a.worldY);
|
|
292
292
|
}
|
|
293
293
|
}, U = (e) => {
|
|
294
|
-
e.button === 0 && (c().findWidgetRoot(e.target) ||
|
|
294
|
+
e.button === 0 && (c().findWidgetRoot(e.target) || I("background_pointer"));
|
|
295
295
|
}, $ = w(() => {
|
|
296
296
|
const e = _();
|
|
297
297
|
if (!e) return null;
|
|
@@ -483,7 +483,7 @@ function Ee(i) {
|
|
|
483
483
|
return t.lock.toggle;
|
|
484
484
|
},
|
|
485
485
|
get shortcutLabel() {
|
|
486
|
-
return
|
|
486
|
+
return M() ?? void 0;
|
|
487
487
|
}
|
|
488
488
|
}), null), v(e, l(re, {
|
|
489
489
|
get widgetDefinitions() {
|
|
@@ -519,6 +519,9 @@ function Ee(i) {
|
|
|
519
519
|
get dockActions() {
|
|
520
520
|
return i.dockActions;
|
|
521
521
|
},
|
|
522
|
+
get dockItems() {
|
|
523
|
+
return i.dockItems;
|
|
524
|
+
},
|
|
522
525
|
get registerExternalDockDragController() {
|
|
523
526
|
return i.registerExternalDockDragController;
|
|
524
527
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { WorkbenchOverlay, type WorkbenchOverlayProps, } from './WorkbenchOverlay';
|
|
2
2
|
export { WorkbenchSurface, type WorkbenchSurfaceApi, type WorkbenchCreateAtOptions, type WorkbenchCreateWidgetOptions, type WorkbenchContextMenuItemsResolver, type WorkbenchSurfaceProps, } from './WorkbenchSurface';
|
|
3
|
-
export type { WorkbenchDockAction, WorkbenchDockItemActivation, WorkbenchExternalDockDragController, WorkbenchExternalDockDragItem, } from './WorkbenchFilterBar';
|
|
3
|
+
export type { WorkbenchDockAction, WorkbenchDockItemActivation, WorkbenchExternalDockDragController, WorkbenchExternalDockDragItem, WorkbenchHostDockItem, } from './WorkbenchFilterBar';
|
|
4
4
|
export { WorkbenchContextMenu, type WorkbenchContextMenuItem, type WorkbenchContextMenuProps, } from './WorkbenchContextMenu';
|
|
5
5
|
export { useWorkbenchModel, type UseWorkbenchModelOptions } from './useWorkbenchModel';
|
|
6
6
|
export { WIDGET_REGISTRY, createWorkbenchFilterState, getWidgetEntry, isValidWorkbenchWidgetType, resolveWorkbenchWidgetDefinitions, type WidgetRegistryEntry, } from './widgets/widgetRegistry';
|