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