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