@floegence/floe-webapp-core 0.86.23 → 0.86.25
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/LICENSE +1 -1
- package/dist/components/layout/BottomBarCompanion.d.ts +2 -1
- package/dist/components/layout/Shell.d.ts +2 -0
- package/dist/components/layout/Shell.js +69 -68
- package/dist/components/workbench/WorkbenchFilterBar.d.ts +4 -0
- package/dist/components/workbench/WorkbenchFilterBar.js +326 -307
- package/dist/components/workbench/WorkbenchSurface.d.ts +3 -1
- package/dist/components/workbench/WorkbenchSurface.js +12 -9
- package/package.json +1 -1
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { Motion as
|
|
4
|
-
import { easing as
|
|
5
|
-
import { Plus as
|
|
6
|
-
import { startHotInteraction as
|
|
7
|
-
import { startPointerSession as
|
|
8
|
-
import { clientToCanvasWorld as
|
|
9
|
-
import { isBarItemContextMenuKey as
|
|
10
|
-
import { createWorkbenchWidgetFrame as
|
|
11
|
-
import { getWidgetEntry as
|
|
12
|
-
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as
|
|
13
|
-
import { DockLayoutDashboard as
|
|
14
|
-
var
|
|
15
|
-
const
|
|
1
|
+
import { insert as k, createComponent as s, effect as K, setAttribute as L, memo as B, className as qe, template as $, Portal as ze, setStyleProperty as je, Dynamic as Je, use as Qe, delegateEvents as Ze } from "solid-js/web";
|
|
2
|
+
import { createSignal as se, onCleanup as p, createEffect as ee, createMemo as A, Show as R, For as te, Index as ye } from "solid-js";
|
|
3
|
+
import { Motion as N } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
|
|
4
|
+
import { easing as W, duration as G } from "../../utils/animations.js";
|
|
5
|
+
import { Plus as pe } from "../icons/index.js";
|
|
6
|
+
import { startHotInteraction as et } from "../../utils/hotInteraction.js";
|
|
7
|
+
import { startPointerSession as tt } from "../ui/pointerSession.js";
|
|
8
|
+
import { clientToCanvasWorld as nt } from "../ui/canvasGeometry.js";
|
|
9
|
+
import { isBarItemContextMenuKey as ot, keyboardBarItemContextMenuRequest as rt } from "../layout/barItemContextMenu.js";
|
|
10
|
+
import { createWorkbenchWidgetFrame as it } from "./workbenchHelpers.js";
|
|
11
|
+
import { getWidgetEntry as at } from "./widgets/widgetRegistry.js";
|
|
12
|
+
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Te, frameFromElement as $e, createWorkbenchEdgeAutoPanController as ct } from "./workbenchEdgeAutoPan.js";
|
|
13
|
+
import { DockLayoutDashboard as lt, DockLayers as st, DockRegion as dt, DockText as ut, DockMessageSquare as gt } from "../icons/DockIcons.js";
|
|
14
|
+
var vt = /* @__PURE__ */ $("<button type=button class=workbench-dock__item>"), ft = /* @__PURE__ */ $('<button type=button class="workbench-dock__item workbench-dock__action">'), kt = /* @__PURE__ */ $("<span class=workbench-dock__external-placeholder aria-hidden=true>"), mt = /* @__PURE__ */ $('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), ht = /* @__PURE__ */ $("<span class=workbench-dock__divider aria-hidden=true>"), bt = /* @__PURE__ */ $('<div 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>'), wt = /* @__PURE__ */ $("<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>"), _t = /* @__PURE__ */ $("<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>");
|
|
15
|
+
const Se = 5, Et = 1e3, Dt = ".workbench-dock", Ct = [{
|
|
16
16
|
mode: "work",
|
|
17
17
|
label: "Work Mode",
|
|
18
18
|
description: "Operate windows and sticky notes",
|
|
19
|
-
icon:
|
|
19
|
+
icon: lt
|
|
20
20
|
}, {
|
|
21
21
|
mode: "background",
|
|
22
22
|
label: "Composition Mode",
|
|
23
23
|
description: "Arrange regions and canvas text",
|
|
24
|
-
icon:
|
|
25
|
-
}],
|
|
24
|
+
icon: st
|
|
25
|
+
}], Pt = [{
|
|
26
26
|
tool: "sticky-note",
|
|
27
27
|
label: "Sticky",
|
|
28
|
-
icon:
|
|
29
|
-
}],
|
|
28
|
+
icon: gt
|
|
29
|
+
}], Mt = [{
|
|
30
30
|
tool: "background-region",
|
|
31
31
|
label: "Region",
|
|
32
|
-
icon:
|
|
32
|
+
icon: dt
|
|
33
33
|
}, {
|
|
34
34
|
tool: "text",
|
|
35
35
|
label: "Text",
|
|
36
|
-
icon:
|
|
36
|
+
icon: ut
|
|
37
37
|
}];
|
|
38
|
-
function
|
|
39
|
-
const
|
|
40
|
-
return
|
|
38
|
+
function xt(e) {
|
|
39
|
+
const l = e?.closest(".workbench-surface")?.querySelector(Te);
|
|
40
|
+
return l instanceof HTMLElement ? $e(l) : null;
|
|
41
41
|
}
|
|
42
|
-
function ue(e, g,
|
|
43
|
-
return e >=
|
|
42
|
+
function ue(e, g, l) {
|
|
43
|
+
return e >= l.left && e <= l.right && g >= l.top && g <= l.bottom;
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
45
|
+
function It(e, g, l) {
|
|
46
|
+
return l ? ue(e, g, l) : !1;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return Math.min(
|
|
48
|
+
function Ae(e, g, l) {
|
|
49
|
+
return Math.min(l, Math.max(g, e));
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function Lt(e, g, l, i, d) {
|
|
52
52
|
if (!e) return !1;
|
|
53
|
-
if (ue(g,
|
|
53
|
+
if (ue(g, l, e) || ue(i, d, e))
|
|
54
54
|
return !0;
|
|
55
|
-
const
|
|
56
|
-
let
|
|
57
|
-
const a = (D,
|
|
58
|
-
if (D === 0) return
|
|
59
|
-
const v =
|
|
60
|
-
return D < 0 ? v > r ? !1 : (v >
|
|
55
|
+
const E = i - g, P = d - l;
|
|
56
|
+
let b = 0, r = 1;
|
|
57
|
+
const a = (D, M) => {
|
|
58
|
+
if (D === 0) return M >= 0;
|
|
59
|
+
const v = M / D;
|
|
60
|
+
return D < 0 ? v > r ? !1 : (v > b && (b = v), !0) : v < b ? !1 : (v < r && (r = v), !0);
|
|
61
61
|
};
|
|
62
|
-
return a(-
|
|
62
|
+
return a(-E, g - e.left) && a(E, e.right - g) && a(-P, l - e.top) && a(P, e.bottom - l);
|
|
63
63
|
}
|
|
64
|
-
function
|
|
65
|
-
if (!
|
|
64
|
+
function Oe(e, g, l) {
|
|
65
|
+
if (!l || typeof document.elementFromPoint != "function") return !1;
|
|
66
66
|
const i = document.elementFromPoint(e, g);
|
|
67
|
-
return i instanceof Element && i.closest(
|
|
67
|
+
return i instanceof Element && i.closest(Dt) === l;
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function de(e) {
|
|
70
70
|
const g = () => e.hoverOffset === -1 ? {
|
|
71
71
|
scale: 1.26,
|
|
72
72
|
y: -6,
|
|
@@ -83,64 +83,64 @@ function se(e) {
|
|
|
83
83
|
scale: 1,
|
|
84
84
|
y: 0,
|
|
85
85
|
x: 0
|
|
86
|
-
},
|
|
86
|
+
}, l = () => e.hoverOffset === -1, i = (r) => {
|
|
87
87
|
r.button === 0 && e.onDragBegin(r, e.kind, e.id, e.label, e.icon, r.currentTarget, e.canvasPlacement, null);
|
|
88
|
-
},
|
|
88
|
+
}, d = (r) => {
|
|
89
89
|
e.onContextMenu && (r.preventDefault(), r.stopPropagation(), e.onContextMenu({
|
|
90
90
|
trigger: r.currentTarget,
|
|
91
91
|
clientX: r.clientX,
|
|
92
92
|
clientY: r.clientY,
|
|
93
93
|
source: "pointer"
|
|
94
94
|
}));
|
|
95
|
-
},
|
|
96
|
-
!e.onContextMenu || !
|
|
95
|
+
}, E = (r) => {
|
|
96
|
+
!e.onContextMenu || !ot(r) || (r.preventDefault(), r.stopPropagation(), e.onContextMenu(rt(r.currentTarget)));
|
|
97
97
|
}, P = (r) => {
|
|
98
98
|
r.detail === 0 && e.onKeyboardActivate(r.currentTarget);
|
|
99
|
-
},
|
|
99
|
+
}, b = () => {
|
|
100
100
|
const r = e.presentation;
|
|
101
101
|
return r ? r.count === 0 ? `${e.label} +` : r.active && r.currentIndex !== null ? `${e.label} ${r.currentIndex + 1}/${r.count}` : r.count > 1 ? `${e.label} ${r.count}` : e.label : e.label;
|
|
102
102
|
};
|
|
103
103
|
return (() => {
|
|
104
|
-
var r =
|
|
105
|
-
return r.$$keydown =
|
|
104
|
+
var r = vt();
|
|
105
|
+
return r.$$keydown = E, r.$$contextmenu = d, r.$$click = P, r.$$pointerdown = i, r.addEventListener("pointerleave", () => e.onLeave()), r.addEventListener("pointerenter", () => e.onEnter()), k(r, s(N.span, {
|
|
106
106
|
class: "workbench-dock__tile",
|
|
107
107
|
get animate() {
|
|
108
108
|
return g();
|
|
109
109
|
},
|
|
110
110
|
get transition() {
|
|
111
111
|
return {
|
|
112
|
-
duration:
|
|
113
|
-
easing:
|
|
112
|
+
duration: G.fast,
|
|
113
|
+
easing: W.easeOut
|
|
114
114
|
};
|
|
115
115
|
},
|
|
116
116
|
get children() {
|
|
117
117
|
return (() => {
|
|
118
118
|
const a = e.icon;
|
|
119
|
-
return
|
|
119
|
+
return s(a, {
|
|
120
120
|
class: "workbench-dock__icon"
|
|
121
121
|
});
|
|
122
122
|
})();
|
|
123
123
|
}
|
|
124
|
-
}), null),
|
|
124
|
+
}), null), k(r, s(N.span, {
|
|
125
125
|
class: "workbench-dock__tooltip",
|
|
126
126
|
get animate() {
|
|
127
127
|
return {
|
|
128
|
-
opacity:
|
|
129
|
-
y:
|
|
128
|
+
opacity: l() ? 1 : 0,
|
|
129
|
+
y: l() ? -6 : 0
|
|
130
130
|
};
|
|
131
131
|
},
|
|
132
132
|
get transition() {
|
|
133
133
|
return {
|
|
134
|
-
duration:
|
|
135
|
-
easing:
|
|
134
|
+
duration: G.fast,
|
|
135
|
+
easing: W.easeOut
|
|
136
136
|
};
|
|
137
137
|
},
|
|
138
138
|
get children() {
|
|
139
|
-
return B(() => e.activationMode === "focus-cycle")() ?
|
|
139
|
+
return B(() => e.activationMode === "focus-cycle")() ? b() : e.label;
|
|
140
140
|
}
|
|
141
141
|
}), null), K((a) => {
|
|
142
|
-
var D = e.kind === "host" ? e.id : void 0,
|
|
143
|
-
return D !== a.e &&
|
|
142
|
+
var D = e.kind === "host" ? e.id : void 0, M = e.kind === "widget" || e.kind === "tool" ? e.id : void 0, v = !!e.active, x = !!(e.filterable && !e.visible), X = !!l(), q = !!e.isDragging, F = e.activationMode === "focus-cycle" && e.presentation ? b() : e.filterable ? `${e.label} — click to solo, drag to canvas to create` : `${e.label} — drag to canvas to create`, z = e.activationMode === "focus-cycle" ? e.presentation?.active : e.active, Y = e.onContextMenu ? "menu" : void 0;
|
|
143
|
+
return D !== a.e && L(r, "data-workbench-dock-item", a.e = D), M !== a.t && L(r, "data-workbench-dock-component", a.t = M), v !== a.a && r.classList.toggle("is-active", a.a = v), x !== a.o && r.classList.toggle("is-filter-muted", a.o = x), X !== a.i && r.classList.toggle("is-hovered", a.i = X), q !== a.n && r.classList.toggle("is-source-dragging", a.n = q), F !== a.s && L(r, "aria-label", a.s = F), z !== a.h && L(r, "aria-pressed", a.h = z), Y !== a.r && L(r, "aria-haspopup", a.r = Y), a;
|
|
144
144
|
}, {
|
|
145
145
|
e: void 0,
|
|
146
146
|
t: void 0,
|
|
@@ -154,34 +154,34 @@ function se(e) {
|
|
|
154
154
|
}), r;
|
|
155
155
|
})();
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
const g = () => e.hoverOffset === -1,
|
|
157
|
+
function yt(e) {
|
|
158
|
+
const g = () => e.hoverOffset === -1, l = () => ({
|
|
159
159
|
scale: 1,
|
|
160
160
|
y: 0,
|
|
161
161
|
x: 0
|
|
162
162
|
});
|
|
163
163
|
return (() => {
|
|
164
|
-
var i =
|
|
165
|
-
return i.$$click = (
|
|
164
|
+
var i = ft();
|
|
165
|
+
return i.$$click = (d) => e.onActivate(d.currentTarget), i.addEventListener("dragstart", (d) => d.preventDefault()), i.addEventListener("pointerleave", () => e.onLeave()), i.addEventListener("pointerenter", () => e.onEnter()), L(i, "draggable", !1), k(i, s(N.span, {
|
|
166
166
|
class: "workbench-dock__tile",
|
|
167
167
|
get animate() {
|
|
168
|
-
return
|
|
168
|
+
return l();
|
|
169
169
|
},
|
|
170
170
|
get transition() {
|
|
171
171
|
return {
|
|
172
|
-
duration:
|
|
173
|
-
easing:
|
|
172
|
+
duration: G.fast,
|
|
173
|
+
easing: W.easeOut
|
|
174
174
|
};
|
|
175
175
|
},
|
|
176
176
|
get children() {
|
|
177
|
-
return
|
|
177
|
+
return s(Je, {
|
|
178
178
|
get component() {
|
|
179
179
|
return e.action.icon;
|
|
180
180
|
},
|
|
181
181
|
class: "workbench-dock__icon"
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
}), null),
|
|
184
|
+
}), null), k(i, s(N.span, {
|
|
185
185
|
class: "workbench-dock__tooltip",
|
|
186
186
|
get animate() {
|
|
187
187
|
return {
|
|
@@ -191,16 +191,16 @@ function Ct(e) {
|
|
|
191
191
|
},
|
|
192
192
|
get transition() {
|
|
193
193
|
return {
|
|
194
|
-
duration:
|
|
195
|
-
easing:
|
|
194
|
+
duration: G.fast,
|
|
195
|
+
easing: W.easeOut
|
|
196
196
|
};
|
|
197
197
|
},
|
|
198
198
|
get children() {
|
|
199
199
|
return e.action.label;
|
|
200
200
|
}
|
|
201
|
-
}), null), K((
|
|
202
|
-
var
|
|
203
|
-
return
|
|
201
|
+
}), null), K((d) => {
|
|
202
|
+
var E = e.action.id, P = !!e.action.active, b = !!g(), r = e.action.label, a = e.action.active;
|
|
203
|
+
return E !== d.e && L(i, "data-workbench-dock-action", d.e = E), P !== d.t && i.classList.toggle("is-active", d.t = P), b !== d.a && i.classList.toggle("is-hovered", d.a = b), r !== d.o && L(i, "aria-label", d.o = r), a !== d.i && L(i, "aria-pressed", d.i = a), d;
|
|
204
204
|
}, {
|
|
205
205
|
e: void 0,
|
|
206
206
|
t: void 0,
|
|
@@ -210,9 +210,9 @@ function Ct(e) {
|
|
|
210
210
|
}), i;
|
|
211
211
|
})();
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
const [g,
|
|
215
|
-
let
|
|
213
|
+
function Gt(e) {
|
|
214
|
+
const [g, l] = se(null), [i, d] = se(null), [E, P] = se(!1);
|
|
215
|
+
let b, r, a, D, M = null;
|
|
216
216
|
const v = () => e.activationMode === "focus-cycle" ? "focus-cycle" : "solo-filter";
|
|
217
217
|
p(() => {
|
|
218
218
|
D?.stop(), r?.stop({
|
|
@@ -230,66 +230,66 @@ function Bt(e) {
|
|
|
230
230
|
};
|
|
231
231
|
window.addEventListener("keydown", t, !0), p(() => window.removeEventListener("keydown", t, !0));
|
|
232
232
|
}), ee(() => {
|
|
233
|
-
if (!
|
|
234
|
-
const t = (
|
|
235
|
-
|
|
236
|
-
}, n = (
|
|
237
|
-
|
|
233
|
+
if (!E() || typeof window > "u") return;
|
|
234
|
+
const t = (c) => {
|
|
235
|
+
b && c.target instanceof Node && b.contains(c.target) || P(!1);
|
|
236
|
+
}, n = (c) => {
|
|
237
|
+
c.key === "Escape" && P(!1);
|
|
238
238
|
};
|
|
239
239
|
window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown", n, !0), p(() => {
|
|
240
240
|
window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown", n, !0);
|
|
241
241
|
});
|
|
242
242
|
});
|
|
243
|
-
const
|
|
243
|
+
const x = (t) => {
|
|
244
244
|
const n = g();
|
|
245
|
-
return n === null || n <=
|
|
245
|
+
return n === null || n <= j().length || n >= ie() && n < we() ? 0 : n === t ? -1 : n === t + 1 ? -2 : n === t - 1 ? 1 : 0;
|
|
246
246
|
}, X = () => {
|
|
247
|
-
D?.stop(), D = void 0,
|
|
248
|
-
},
|
|
249
|
-
!e.viewport || !e.onViewportCommit || (
|
|
247
|
+
D?.stop(), D = void 0, M = null;
|
|
248
|
+
}, q = () => {
|
|
249
|
+
!e.viewport || !e.onViewportCommit || (M = e.viewport, D?.stop(), D = ct({
|
|
250
250
|
readFrame: () => {
|
|
251
|
-
const n =
|
|
252
|
-
return n instanceof HTMLElement ?
|
|
251
|
+
const n = b?.closest(".workbench-surface")?.querySelector(Te);
|
|
252
|
+
return n instanceof HTMLElement ? $e(n) : null;
|
|
253
253
|
},
|
|
254
|
-
readViewport: () =>
|
|
254
|
+
readViewport: () => M ?? e.viewport ?? null,
|
|
255
255
|
commitViewport: (t) => {
|
|
256
|
-
|
|
256
|
+
M = t, e.onViewportCommit?.(t);
|
|
257
257
|
},
|
|
258
258
|
onPanStart: () => e.onViewportInteractionStart?.("pan"),
|
|
259
259
|
shouldPan: () => {
|
|
260
260
|
const t = i();
|
|
261
|
-
return !!(t?.moved && t.hasEnteredCanvas && !
|
|
261
|
+
return !!(t?.moved && t.hasEnteredCanvas && !Oe(t.clientX, t.clientY, b));
|
|
262
262
|
}
|
|
263
263
|
}));
|
|
264
|
-
},
|
|
264
|
+
}, F = (t, n, c, w) => {
|
|
265
265
|
if (e.onDockActivation?.({
|
|
266
266
|
kind: t,
|
|
267
267
|
id: String(n)
|
|
268
268
|
}), t === "external") return;
|
|
269
269
|
if (t === "host") {
|
|
270
|
-
e.dockItems?.find((o) => o.id === n)?.onActivate?.(
|
|
270
|
+
e.dockItems?.find((o) => o.id === n)?.onActivate?.(w);
|
|
271
271
|
return;
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const I = {
|
|
274
274
|
kind: t,
|
|
275
275
|
id: n,
|
|
276
|
-
label:
|
|
277
|
-
trigger:
|
|
276
|
+
label: c,
|
|
277
|
+
trigger: w
|
|
278
278
|
};
|
|
279
|
-
if (!e.onItemClick?.(
|
|
279
|
+
if (!e.onItemClick?.(I)) {
|
|
280
280
|
if (v() === "focus-cycle") {
|
|
281
|
-
e.onFocusCycleItem?.(
|
|
281
|
+
e.onFocusCycleItem?.(I);
|
|
282
282
|
return;
|
|
283
283
|
}
|
|
284
|
-
y() !== "background" && e.onSoloFilter(String(n),
|
|
284
|
+
y() !== "background" && e.onSoloFilter(String(n), Ee());
|
|
285
285
|
}
|
|
286
|
-
},
|
|
286
|
+
}, z = (t) => {
|
|
287
287
|
const n = i();
|
|
288
288
|
if (!n) return;
|
|
289
|
-
const
|
|
290
|
-
if (n.stopInteraction(), X(),
|
|
289
|
+
const c = !n.moved, w = M ?? e.viewport;
|
|
290
|
+
if (n.stopInteraction(), X(), d(null), r = void 0, n.kind === "external" && n.moved && a?.expire(), c) {
|
|
291
291
|
if (n.kind === "external" || !(n.trigger instanceof HTMLButtonElement)) return;
|
|
292
|
-
|
|
292
|
+
F(n.kind, n.id, n.label, n.trigger);
|
|
293
293
|
return;
|
|
294
294
|
}
|
|
295
295
|
if (t && n.overDock && n.dockDrop) {
|
|
@@ -297,29 +297,29 @@ function Bt(e) {
|
|
|
297
297
|
return;
|
|
298
298
|
}
|
|
299
299
|
if (t && n.overCanvas && n.canvasPlacement) {
|
|
300
|
-
const
|
|
300
|
+
const I = n.canvasFrame && w ? nt(n.canvasFrame, w, {
|
|
301
301
|
clientX: n.clientX,
|
|
302
302
|
clientY: n.clientY
|
|
303
303
|
}) : null, o = n.canvasFrame ? {
|
|
304
304
|
dropAllowed: n.overCanvas,
|
|
305
305
|
canvasFrame: n.canvasFrame,
|
|
306
|
-
...
|
|
307
|
-
worldPoint:
|
|
306
|
+
...I ? {
|
|
307
|
+
worldPoint: I
|
|
308
308
|
} : {}
|
|
309
309
|
} : void 0;
|
|
310
310
|
n.canvasPlacement.onDrop(n.clientX, n.clientY, o);
|
|
311
311
|
}
|
|
312
|
-
},
|
|
312
|
+
}, Y = (t, n, c, w, I, o, h, _, m = "before-components") => {
|
|
313
313
|
t.preventDefault(), r?.stop({
|
|
314
314
|
reason: "manual_stop",
|
|
315
315
|
commit: !1
|
|
316
|
-
}),
|
|
317
|
-
const C =
|
|
318
|
-
|
|
316
|
+
}), q();
|
|
317
|
+
const C = xt(b);
|
|
318
|
+
d({
|
|
319
319
|
kind: n,
|
|
320
|
-
id:
|
|
321
|
-
label:
|
|
322
|
-
icon:
|
|
320
|
+
id: c,
|
|
321
|
+
label: w,
|
|
322
|
+
icon: I,
|
|
323
323
|
pointerId: t.pointerId,
|
|
324
324
|
startClientX: t.clientX,
|
|
325
325
|
startClientY: t.clientY,
|
|
@@ -330,71 +330,71 @@ function Bt(e) {
|
|
|
330
330
|
hasEnteredCanvas: !1,
|
|
331
331
|
canvasFrame: C,
|
|
332
332
|
preview: null,
|
|
333
|
-
canvasPlacement:
|
|
334
|
-
dockDrop:
|
|
335
|
-
dockPlacement:
|
|
336
|
-
stopInteraction:
|
|
333
|
+
canvasPlacement: h,
|
|
334
|
+
dockDrop: _,
|
|
335
|
+
dockPlacement: m,
|
|
336
|
+
stopInteraction: et({
|
|
337
337
|
kind: "drag",
|
|
338
338
|
cursor: "grabbing"
|
|
339
339
|
}),
|
|
340
340
|
trigger: o,
|
|
341
341
|
overDock: !1
|
|
342
342
|
});
|
|
343
|
-
const
|
|
344
|
-
let
|
|
345
|
-
|
|
346
|
-
if (!
|
|
347
|
-
const J = u.clientX -
|
|
348
|
-
if (
|
|
349
|
-
let
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
},
|
|
355
|
-
|
|
343
|
+
const O = (u) => {
|
|
344
|
+
let T = !1;
|
|
345
|
+
d((f) => {
|
|
346
|
+
if (!f || f.pointerId !== u.pointerId) return f;
|
|
347
|
+
const J = u.clientX - f.startClientX, Q = u.clientY - f.startClientY, H = f.moved || Math.abs(J) > Se || Math.abs(Q) > Se;
|
|
348
|
+
if (f.kind === "external" && H && !f.moved) {
|
|
349
|
+
let V;
|
|
350
|
+
const U = () => {
|
|
351
|
+
V !== void 0 && window.clearTimeout(V), f.trigger.removeEventListener("click", xe, !0), window.removeEventListener("pointerdown", Ie, !0), a?.clear === U && (a = void 0);
|
|
352
|
+
}, xe = (Le) => {
|
|
353
|
+
Le.preventDefault(), Le.stopImmediatePropagation(), U();
|
|
354
|
+
}, Ie = () => U(), Ue = () => {
|
|
355
|
+
V !== void 0 && window.clearTimeout(V), V = window.setTimeout(U, Et);
|
|
356
356
|
};
|
|
357
|
-
|
|
358
|
-
clear:
|
|
359
|
-
expire:
|
|
357
|
+
f.trigger.addEventListener("click", xe, !0), window.addEventListener("pointerdown", Ie, !0), a = {
|
|
358
|
+
clear: U,
|
|
359
|
+
expire: Ue
|
|
360
360
|
};
|
|
361
361
|
}
|
|
362
|
-
const Z =
|
|
363
|
-
|
|
364
|
-
const
|
|
362
|
+
const Z = Oe(u.clientX, u.clientY, b), S = f.canvasFrame, Ce = H && It(u.clientX, u.clientY, S), Pe = Ce && !Z, We = H && !Z && Lt(S, f.clientX, f.clientY, u.clientX, u.clientY), Me = f.hasEnteredCanvas || Ce || We;
|
|
363
|
+
T = H && Me && !Z;
|
|
364
|
+
const Ge = S ? Ae(u.clientX, S.left, S.right) : u.clientX, Ve = S ? Ae(u.clientY, S.top, S.bottom) : u.clientY;
|
|
365
365
|
return {
|
|
366
|
-
...
|
|
366
|
+
...f,
|
|
367
367
|
clientX: u.clientX,
|
|
368
368
|
clientY: u.clientY,
|
|
369
369
|
moved: H,
|
|
370
370
|
overDock: Z,
|
|
371
|
-
overCanvas:
|
|
372
|
-
hasEnteredCanvas:
|
|
373
|
-
preview: H && S &&
|
|
374
|
-
kind:
|
|
375
|
-
id:
|
|
376
|
-
label:
|
|
377
|
-
clientX:
|
|
378
|
-
clientY:
|
|
379
|
-
dropAllowed:
|
|
371
|
+
overCanvas: Pe,
|
|
372
|
+
hasEnteredCanvas: Me,
|
|
373
|
+
preview: H && S && f.canvasPlacement?.preview ? {
|
|
374
|
+
kind: f.canvasPlacement.preview.kind,
|
|
375
|
+
id: f.canvasPlacement.preview.id,
|
|
376
|
+
label: f.label,
|
|
377
|
+
clientX: Ge,
|
|
378
|
+
clientY: Ve,
|
|
379
|
+
dropAllowed: Pe,
|
|
380
380
|
canvasFrame: S
|
|
381
381
|
} : null
|
|
382
382
|
};
|
|
383
|
-
}),
|
|
383
|
+
}), T && D?.updatePointer(u.clientX, u.clientY);
|
|
384
384
|
};
|
|
385
|
-
r =
|
|
385
|
+
r = tt({
|
|
386
386
|
pointerEvent: t,
|
|
387
387
|
captureEl: t.currentTarget,
|
|
388
|
-
onMove:
|
|
388
|
+
onMove: O,
|
|
389
389
|
onEnd: ({
|
|
390
390
|
commit: u,
|
|
391
|
-
snapshot:
|
|
391
|
+
snapshot: T
|
|
392
392
|
}) => {
|
|
393
|
-
|
|
394
|
-
pointerId:
|
|
395
|
-
clientX:
|
|
396
|
-
clientY:
|
|
397
|
-
}),
|
|
393
|
+
O({
|
|
394
|
+
pointerId: T.pointerId,
|
|
395
|
+
clientX: T.latestClientX,
|
|
396
|
+
clientY: T.latestClientY
|
|
397
|
+
}), z(u);
|
|
398
398
|
}
|
|
399
399
|
});
|
|
400
400
|
}, ne = (t) => t ? {
|
|
@@ -402,188 +402,195 @@ function Bt(e) {
|
|
|
402
402
|
kind: "widget",
|
|
403
403
|
id: t.widgetType
|
|
404
404
|
},
|
|
405
|
-
onDrop: (n,
|
|
406
|
-
if (!
|
|
407
|
-
const
|
|
405
|
+
onDrop: (n, c, w) => {
|
|
406
|
+
if (!w?.worldPoint) return;
|
|
407
|
+
const I = at(t.widgetType, e.widgetDefinitions);
|
|
408
408
|
t.onDrop({
|
|
409
409
|
widgetType: t.widgetType,
|
|
410
|
-
centerWorld:
|
|
411
|
-
frame:
|
|
410
|
+
centerWorld: w.worldPoint,
|
|
411
|
+
frame: it(I, {
|
|
412
412
|
anchor: "center",
|
|
413
|
-
worldX:
|
|
414
|
-
worldY:
|
|
413
|
+
worldX: w.worldPoint.worldX,
|
|
414
|
+
worldY: w.worldPoint.worldY
|
|
415
415
|
})
|
|
416
416
|
});
|
|
417
417
|
}
|
|
418
|
-
} : null,
|
|
419
|
-
t.button !== 0 || !(t.currentTarget instanceof HTMLElement) || (a?.clear(), a = void 0,
|
|
418
|
+
} : null, Xe = (t, n) => {
|
|
419
|
+
t.button !== 0 || !(t.currentTarget instanceof HTMLElement) || (a?.clear(), a = void 0, Y(t, "external", n.id, n.label, n.icon, t.currentTarget, ne(n.canvasPlacement), n.onDropToDock ?? null, n.dockPlacement ?? "before-components"));
|
|
420
420
|
};
|
|
421
421
|
ee(() => {
|
|
422
422
|
e.registerExternalDockDragController?.({
|
|
423
|
-
begin:
|
|
423
|
+
begin: Xe
|
|
424
424
|
}), p(() => e.registerExternalDockDragController?.(null));
|
|
425
425
|
});
|
|
426
|
-
const
|
|
426
|
+
const Fe = () => i()?.kind === "widget" ? i().id : null, Ye = () => i()?.kind === "tool" ? i().id : null, Be = () => i()?.kind === "external" ? i()?.icon : void 0, y = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", oe = A(() => Ct.map((t) => ({
|
|
427
427
|
...t,
|
|
428
428
|
icon: e.modeIcons?.[t.mode] ?? t.icon
|
|
429
|
-
}))), ge = A(() => oe().find((t) => t.mode === y()) ?? oe()[0]), re = A(() =>
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
429
|
+
}))), ge = A(() => oe().find((t) => t.mode === y()) ?? oe()[0]), re = A(() => {
|
|
430
|
+
if (y() === "background")
|
|
431
|
+
return Mt.map((c) => ({
|
|
432
|
+
id: c.tool,
|
|
433
|
+
kind: "tool",
|
|
434
|
+
label: c.label,
|
|
435
|
+
icon: c.icon
|
|
436
|
+
}));
|
|
437
|
+
const t = [...Pt.map((c) => ({
|
|
438
|
+
id: c.tool,
|
|
439
|
+
kind: "tool",
|
|
440
|
+
label: c.label,
|
|
441
|
+
icon: c.icon
|
|
442
|
+
})), ...e.widgetDefinitions.map((c) => ({
|
|
443
|
+
id: c.type,
|
|
444
|
+
kind: "widget",
|
|
445
|
+
label: c.label,
|
|
446
|
+
icon: c.icon
|
|
447
|
+
}))], n = new Map(e.componentOrder?.map((c, w) => [c, w]));
|
|
448
|
+
return t.sort((c, w) => (n.get(c.id) ?? Number.MAX_SAFE_INTEGER) - (n.get(w.id) ?? Number.MAX_SAFE_INTEGER));
|
|
449
|
+
}), ve = A(() => y() === "background" ? [] : [...e.dockItems ?? []]), fe = A(() => ve().filter((t) => t.dockPlacement !== "after-components")), ke = A(() => ve().filter((t) => t.dockPlacement === "after-components")), me = A(() => y() === "background" ? [] : [...e.dockActions ?? []]), j = A(() => me().filter((t) => t.dockPlacement !== "after-components")), he = A(() => me().filter((t) => t.dockPlacement === "after-components")), be = () => j().length + fe().length + 1, ie = () => be() + re().length, we = () => ie() + he().length, _e = (t) => s(yt, {
|
|
450
|
+
get action() {
|
|
451
|
+
return t.action;
|
|
452
|
+
},
|
|
453
|
+
get hoverOffset() {
|
|
454
|
+
return x(t.slot);
|
|
455
|
+
},
|
|
456
|
+
onEnter: () => l(t.slot),
|
|
457
|
+
onLeave: () => l((n) => n === t.slot ? null : n),
|
|
458
|
+
onActivate: (n) => {
|
|
459
|
+
e.onDockActivation?.({
|
|
460
|
+
kind: "action",
|
|
461
|
+
id: t.action.id
|
|
462
|
+
}), t.action.onActivate(n);
|
|
463
|
+
}
|
|
464
|
+
}), Ee = A(() => re().map((t) => String(t.id))), ae = () => y() !== "background", Re = (t) => !ae() || e.filters[t] !== !1, He = (t) => {
|
|
445
465
|
if (!ae())
|
|
446
466
|
return !1;
|
|
447
|
-
const n =
|
|
448
|
-
return n.length > 1 && n.every((
|
|
449
|
-
},
|
|
467
|
+
const n = Ee();
|
|
468
|
+
return n.length > 1 && n.every((c) => e.filters[c] !== !1 == (c === t));
|
|
469
|
+
}, Ke = (t, n) => v() === "focus-cycle" ? e.resolveItemPresentation?.({
|
|
450
470
|
kind: t,
|
|
451
471
|
id: n
|
|
452
|
-
}) : void 0, ce = () => g() === 0,
|
|
472
|
+
}) : void 0, ce = () => g() === 0, Ne = () => ({
|
|
453
473
|
scale: 1,
|
|
454
474
|
y: 0,
|
|
455
475
|
x: 0
|
|
456
476
|
}), le = (t) => {
|
|
457
477
|
const n = i();
|
|
458
478
|
return !!(n?.kind === "external" && n.moved && n.dockPlacement === t);
|
|
459
|
-
},
|
|
460
|
-
var t =
|
|
461
|
-
return
|
|
479
|
+
}, De = () => (() => {
|
|
480
|
+
var t = kt();
|
|
481
|
+
return k(t, s(R, {
|
|
462
482
|
get when() {
|
|
463
|
-
return
|
|
483
|
+
return Be();
|
|
464
484
|
},
|
|
465
485
|
children: (n) => {
|
|
466
|
-
const
|
|
467
|
-
return
|
|
486
|
+
const c = n();
|
|
487
|
+
return s(c, {
|
|
468
488
|
class: "workbench-dock__icon"
|
|
469
489
|
});
|
|
470
490
|
}
|
|
471
491
|
})), K(() => t.classList.toggle("is-drop-allowed", !!i()?.overDock)), t;
|
|
472
492
|
})();
|
|
473
493
|
return [(() => {
|
|
474
|
-
var t =
|
|
475
|
-
t.addEventListener("pointerleave", () =>
|
|
476
|
-
var
|
|
477
|
-
return typeof
|
|
494
|
+
var t = bt(), n = t.firstChild, c = n.firstChild, w = n.nextSibling;
|
|
495
|
+
t.addEventListener("pointerleave", () => l(null));
|
|
496
|
+
var I = b;
|
|
497
|
+
return typeof I == "function" ? Qe(I, t) : b = t, c.$$click = () => {
|
|
478
498
|
e.onDockActivation?.({
|
|
479
499
|
kind: "mode",
|
|
480
500
|
id: y()
|
|
481
501
|
}), P((o) => !o);
|
|
482
|
-
},
|
|
502
|
+
}, c.addEventListener("pointerleave", () => l((o) => o === 0 ? null : o)), c.addEventListener("pointerenter", () => l(0)), k(c, s(N.span, {
|
|
483
503
|
class: "workbench-dock__tile",
|
|
484
504
|
get animate() {
|
|
485
|
-
return
|
|
505
|
+
return Ne();
|
|
486
506
|
},
|
|
487
507
|
get transition() {
|
|
488
508
|
return {
|
|
489
|
-
duration:
|
|
490
|
-
easing:
|
|
509
|
+
duration: G.fast,
|
|
510
|
+
easing: W.easeOut
|
|
491
511
|
};
|
|
492
512
|
},
|
|
493
513
|
get children() {
|
|
494
514
|
return (() => {
|
|
495
515
|
const o = ge().icon;
|
|
496
|
-
return
|
|
516
|
+
return s(o, {
|
|
497
517
|
class: "workbench-dock__icon"
|
|
498
518
|
});
|
|
499
519
|
})();
|
|
500
520
|
}
|
|
501
|
-
}), null),
|
|
521
|
+
}), null), k(c, s(N.span, {
|
|
502
522
|
class: "workbench-dock__tooltip",
|
|
503
523
|
get animate() {
|
|
504
524
|
return {
|
|
505
|
-
opacity: ce() && !
|
|
506
|
-
y: ce() && !
|
|
525
|
+
opacity: ce() && !E() ? 1 : 0,
|
|
526
|
+
y: ce() && !E() ? -6 : 0
|
|
507
527
|
};
|
|
508
528
|
},
|
|
509
529
|
get transition() {
|
|
510
530
|
return {
|
|
511
|
-
duration:
|
|
512
|
-
easing:
|
|
531
|
+
duration: G.fast,
|
|
532
|
+
easing: W.easeOut
|
|
513
533
|
};
|
|
514
534
|
},
|
|
515
535
|
get children() {
|
|
516
536
|
return ge().label;
|
|
517
537
|
}
|
|
518
|
-
}), null),
|
|
538
|
+
}), null), k(n, s(R, {
|
|
519
539
|
get when() {
|
|
520
|
-
return
|
|
540
|
+
return E();
|
|
521
541
|
},
|
|
522
542
|
get children() {
|
|
523
|
-
var o =
|
|
524
|
-
return
|
|
543
|
+
var o = mt();
|
|
544
|
+
return k(o, s(te, {
|
|
525
545
|
get each() {
|
|
526
546
|
return oe();
|
|
527
547
|
},
|
|
528
|
-
children: (
|
|
529
|
-
const
|
|
548
|
+
children: (h) => {
|
|
549
|
+
const _ = h.icon;
|
|
530
550
|
return (() => {
|
|
531
|
-
var
|
|
532
|
-
return
|
|
551
|
+
var m = wt(), C = m.firstChild, O = C.nextSibling, u = O.firstChild, T = u.nextSibling;
|
|
552
|
+
return m.$$click = () => {
|
|
533
553
|
e.onDockActivation?.({
|
|
534
554
|
kind: "mode",
|
|
535
|
-
id:
|
|
536
|
-
}), e.onSelectMode?.(
|
|
537
|
-
},
|
|
555
|
+
id: h.mode
|
|
556
|
+
}), e.onSelectMode?.(h.mode), P(!1);
|
|
557
|
+
}, k(C, s(_, {
|
|
538
558
|
class: "workbench-dock__mode-icon"
|
|
539
|
-
})),
|
|
540
|
-
var J = y() ===
|
|
541
|
-
return J !==
|
|
559
|
+
})), k(u, () => h.label), k(T, () => h.description), K((f) => {
|
|
560
|
+
var J = y() === h.mode, Q = y() === h.mode;
|
|
561
|
+
return J !== f.e && m.classList.toggle("is-active", f.e = J), Q !== f.t && L(m, "aria-checked", f.t = Q), f;
|
|
542
562
|
}, {
|
|
543
563
|
e: void 0,
|
|
544
564
|
t: void 0
|
|
545
|
-
}),
|
|
565
|
+
}), m;
|
|
546
566
|
})();
|
|
547
567
|
}
|
|
548
568
|
})), o;
|
|
549
569
|
}
|
|
550
|
-
}), null),
|
|
570
|
+
}), null), k(t, s(ye, {
|
|
551
571
|
get each() {
|
|
552
|
-
return
|
|
572
|
+
return j();
|
|
553
573
|
},
|
|
554
|
-
children: (o,
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
return M(h());
|
|
562
|
-
},
|
|
563
|
-
onEnter: () => c(h()),
|
|
564
|
-
onLeave: () => c((s) => s === h() ? null : s),
|
|
565
|
-
onActivate: (s) => {
|
|
566
|
-
e.onDockActivation?.({
|
|
567
|
-
kind: "action",
|
|
568
|
-
id: o().id
|
|
569
|
-
}), o().onActivate(s);
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
}), E), m(t, d(R, {
|
|
574
|
+
children: (o, h) => s(_e, {
|
|
575
|
+
get action() {
|
|
576
|
+
return o();
|
|
577
|
+
},
|
|
578
|
+
slot: h + 1
|
|
579
|
+
})
|
|
580
|
+
}), w), k(t, s(R, {
|
|
574
581
|
get when() {
|
|
575
582
|
return le("before-components");
|
|
576
583
|
},
|
|
577
584
|
get children() {
|
|
578
|
-
return
|
|
585
|
+
return s(De, {});
|
|
579
586
|
}
|
|
580
|
-
}),
|
|
587
|
+
}), w), k(t, s(te, {
|
|
581
588
|
get each() {
|
|
582
|
-
return
|
|
589
|
+
return fe();
|
|
583
590
|
},
|
|
584
|
-
children: (o,
|
|
585
|
-
const
|
|
586
|
-
return
|
|
591
|
+
children: (o, h) => {
|
|
592
|
+
const _ = () => h() + j().length + 1;
|
|
593
|
+
return s(de, {
|
|
587
594
|
get id() {
|
|
588
595
|
return o.id;
|
|
589
596
|
},
|
|
@@ -603,7 +610,7 @@ function Bt(e) {
|
|
|
603
610
|
return v();
|
|
604
611
|
},
|
|
605
612
|
get hoverOffset() {
|
|
606
|
-
return
|
|
613
|
+
return x(_());
|
|
607
614
|
},
|
|
608
615
|
get isDragging() {
|
|
609
616
|
return B(() => i()?.kind === "host")() && i()?.id === o.id;
|
|
@@ -614,19 +621,19 @@ function Bt(e) {
|
|
|
614
621
|
get onContextMenu() {
|
|
615
622
|
return o.onContextMenu;
|
|
616
623
|
},
|
|
617
|
-
onKeyboardActivate: (
|
|
618
|
-
onEnter: () =>
|
|
619
|
-
onLeave: () =>
|
|
620
|
-
onDragBegin:
|
|
624
|
+
onKeyboardActivate: (m) => F("host", o.id, o.label, m),
|
|
625
|
+
onEnter: () => l(_()),
|
|
626
|
+
onLeave: () => l((m) => m === _() ? null : m),
|
|
627
|
+
onDragBegin: Y
|
|
621
628
|
});
|
|
622
629
|
}
|
|
623
|
-
}),
|
|
630
|
+
}), w), k(t, s(te, {
|
|
624
631
|
get each() {
|
|
625
632
|
return re();
|
|
626
633
|
},
|
|
627
|
-
children: (o,
|
|
628
|
-
const
|
|
629
|
-
return
|
|
634
|
+
children: (o, h) => {
|
|
635
|
+
const _ = () => h() + be(), m = () => Ke(o.kind, o.id);
|
|
636
|
+
return s(de, {
|
|
630
637
|
get id() {
|
|
631
638
|
return String(o.id);
|
|
632
639
|
},
|
|
@@ -640,10 +647,10 @@ function Bt(e) {
|
|
|
640
647
|
return o.icon;
|
|
641
648
|
},
|
|
642
649
|
get active() {
|
|
643
|
-
return
|
|
650
|
+
return m()?.active ?? He(String(o.id));
|
|
644
651
|
},
|
|
645
652
|
get visible() {
|
|
646
|
-
return B(() => v() === "focus-cycle")() ? !0 :
|
|
653
|
+
return B(() => v() === "focus-cycle")() ? !0 : Re(String(o.id));
|
|
647
654
|
},
|
|
648
655
|
get filterable() {
|
|
649
656
|
return B(() => v() === "solo-filter")() && ae();
|
|
@@ -652,13 +659,13 @@ function Bt(e) {
|
|
|
652
659
|
return v();
|
|
653
660
|
},
|
|
654
661
|
get presentation() {
|
|
655
|
-
return
|
|
662
|
+
return m();
|
|
656
663
|
},
|
|
657
664
|
get hoverOffset() {
|
|
658
|
-
return
|
|
665
|
+
return x(_());
|
|
659
666
|
},
|
|
660
667
|
get isDragging() {
|
|
661
|
-
return B(() => o.kind === "widget")() ?
|
|
668
|
+
return B(() => o.kind === "widget")() ? Fe() === o.id : Ye() === o.id;
|
|
662
669
|
},
|
|
663
670
|
get canvasPlacement() {
|
|
664
671
|
return B(() => o.kind === "widget")() ? {
|
|
@@ -666,35 +673,47 @@ function Bt(e) {
|
|
|
666
673
|
kind: "widget",
|
|
667
674
|
id: o.id
|
|
668
675
|
},
|
|
669
|
-
onDrop: (C,
|
|
676
|
+
onDrop: (C, O, u) => e.onCreateAt?.(o.id, C, O, u)
|
|
670
677
|
} : {
|
|
671
678
|
preview: {
|
|
672
679
|
kind: "tool",
|
|
673
680
|
id: o.id
|
|
674
681
|
},
|
|
675
|
-
onDrop: (C,
|
|
682
|
+
onDrop: (C, O, u) => e.onCreateToolAt?.(o.id, C, O, u)
|
|
676
683
|
};
|
|
677
684
|
},
|
|
678
|
-
onEnter: () =>
|
|
679
|
-
onLeave: () =>
|
|
680
|
-
onKeyboardActivate: (C) =>
|
|
681
|
-
onDragBegin:
|
|
685
|
+
onEnter: () => l(_()),
|
|
686
|
+
onLeave: () => l((C) => C === _() ? null : C),
|
|
687
|
+
onKeyboardActivate: (C) => F(o.kind, o.id, o.label, C),
|
|
688
|
+
onDragBegin: Y
|
|
682
689
|
});
|
|
683
690
|
}
|
|
684
|
-
}), null),
|
|
691
|
+
}), null), k(t, s(ye, {
|
|
692
|
+
get each() {
|
|
693
|
+
return he();
|
|
694
|
+
},
|
|
695
|
+
children: (o, h) => s(_e, {
|
|
696
|
+
get action() {
|
|
697
|
+
return o();
|
|
698
|
+
},
|
|
699
|
+
get slot() {
|
|
700
|
+
return h + ie();
|
|
701
|
+
}
|
|
702
|
+
})
|
|
703
|
+
}), null), k(t, s(R, {
|
|
685
704
|
get when() {
|
|
686
|
-
return
|
|
705
|
+
return ke().length > 0 || le("after-components");
|
|
687
706
|
},
|
|
688
707
|
get children() {
|
|
689
|
-
return
|
|
708
|
+
return ht();
|
|
690
709
|
}
|
|
691
|
-
}), null),
|
|
710
|
+
}), null), k(t, s(te, {
|
|
692
711
|
get each() {
|
|
693
|
-
return
|
|
712
|
+
return ke();
|
|
694
713
|
},
|
|
695
|
-
children: (o,
|
|
696
|
-
const
|
|
697
|
-
return
|
|
714
|
+
children: (o, h) => {
|
|
715
|
+
const _ = () => h() + we();
|
|
716
|
+
return s(de, {
|
|
698
717
|
get id() {
|
|
699
718
|
return o.id;
|
|
700
719
|
},
|
|
@@ -714,7 +733,7 @@ function Bt(e) {
|
|
|
714
733
|
return v();
|
|
715
734
|
},
|
|
716
735
|
get hoverOffset() {
|
|
717
|
-
return
|
|
736
|
+
return x(_());
|
|
718
737
|
},
|
|
719
738
|
get isDragging() {
|
|
720
739
|
return B(() => i()?.kind === "host")() && i()?.id === o.id;
|
|
@@ -725,70 +744,70 @@ function Bt(e) {
|
|
|
725
744
|
get onContextMenu() {
|
|
726
745
|
return o.onContextMenu;
|
|
727
746
|
},
|
|
728
|
-
onKeyboardActivate: (
|
|
729
|
-
onEnter: () =>
|
|
730
|
-
onLeave: () =>
|
|
731
|
-
onDragBegin:
|
|
747
|
+
onKeyboardActivate: (m) => F("host", o.id, o.label, m),
|
|
748
|
+
onEnter: () => l(_()),
|
|
749
|
+
onLeave: () => l((m) => m === _() ? null : m),
|
|
750
|
+
onDragBegin: Y
|
|
732
751
|
});
|
|
733
752
|
}
|
|
734
|
-
}), null),
|
|
753
|
+
}), null), k(t, s(R, {
|
|
735
754
|
get when() {
|
|
736
755
|
return le("after-components");
|
|
737
756
|
},
|
|
738
757
|
get children() {
|
|
739
|
-
return
|
|
758
|
+
return s(De, {});
|
|
740
759
|
}
|
|
741
760
|
}), null), K((o) => {
|
|
742
|
-
var
|
|
743
|
-
return
|
|
761
|
+
var h = `workbench-dock workbench-dock-material${i()?.kind === "external" && i()?.moved ? " is-external-drop-target" : ""}${i()?.kind === "external" && i()?.overDock ? " is-external-drop-allowed" : ""}`, _ = y() === "background", m = !!(ce() || E()), C = E();
|
|
762
|
+
return h !== o.e && qe(t, o.e = h), _ !== o.t && c.classList.toggle("is-active", o.t = _), m !== o.a && c.classList.toggle("is-hovered", o.a = m), C !== o.o && L(c, "aria-expanded", o.o = C), o;
|
|
744
763
|
}, {
|
|
745
764
|
e: void 0,
|
|
746
765
|
t: void 0,
|
|
747
766
|
a: void 0,
|
|
748
767
|
o: void 0
|
|
749
768
|
}), t;
|
|
750
|
-
})(),
|
|
769
|
+
})(), s(R, {
|
|
751
770
|
get when() {
|
|
752
771
|
return !!(i()?.moved && !i()?.preview);
|
|
753
772
|
},
|
|
754
773
|
get children() {
|
|
755
|
-
return
|
|
774
|
+
return s(St, {
|
|
756
775
|
state: i
|
|
757
776
|
});
|
|
758
777
|
}
|
|
759
778
|
})];
|
|
760
779
|
}
|
|
761
|
-
function
|
|
780
|
+
function St(e) {
|
|
762
781
|
const g = () => {
|
|
763
|
-
const
|
|
764
|
-
return
|
|
765
|
-
},
|
|
766
|
-
return
|
|
782
|
+
const d = e.state();
|
|
783
|
+
return d ? `translate3d(${d.clientX + 14}px, ${d.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
|
|
784
|
+
}, l = () => e.state()?.label ?? "", i = () => e.state()?.icon;
|
|
785
|
+
return s(ze, {
|
|
767
786
|
get children() {
|
|
768
|
-
var
|
|
769
|
-
return
|
|
787
|
+
var d = _t(), E = d.firstChild, P = E.nextSibling, b = P.firstChild, r = b.nextSibling, a = r.firstChild, D = a.nextSibling, M = D.firstChild;
|
|
788
|
+
return k(b, s(R, {
|
|
770
789
|
get when() {
|
|
771
790
|
return i();
|
|
772
791
|
},
|
|
773
792
|
children: (v) => {
|
|
774
|
-
const
|
|
775
|
-
return
|
|
793
|
+
const x = v();
|
|
794
|
+
return s(x, {
|
|
776
795
|
class: "w-4 h-4"
|
|
777
796
|
});
|
|
778
797
|
}
|
|
779
|
-
})),
|
|
798
|
+
})), k(a, l), k(D, s(pe, {
|
|
780
799
|
class: "w-3 h-3"
|
|
781
|
-
}),
|
|
782
|
-
var
|
|
783
|
-
return
|
|
800
|
+
}), M), k(M, () => e.state()?.kind === "external" ? "Pin to Dock" : "Drag onto canvas"), K((v) => {
|
|
801
|
+
var x = !!(e.state()?.kind === "external" && e.state()?.overDock), X = g();
|
|
802
|
+
return x !== v.e && d.classList.toggle("is-over-dock", v.e = x), X !== v.t && je(d, "transform", v.t = X), v;
|
|
784
803
|
}, {
|
|
785
804
|
e: void 0,
|
|
786
805
|
t: void 0
|
|
787
|
-
}),
|
|
806
|
+
}), d;
|
|
788
807
|
}
|
|
789
808
|
});
|
|
790
809
|
}
|
|
791
|
-
|
|
810
|
+
Ze(["pointerdown", "click", "contextmenu", "keydown"]);
|
|
792
811
|
export {
|
|
793
|
-
|
|
812
|
+
Gt as WorkbenchDock
|
|
794
813
|
};
|