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