@floegence/floe-webapp-core 0.36.58 → 0.36.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/workbench/WorkbenchFilterBar.d.ts +9 -2
- package/dist/components/workbench/WorkbenchFilterBar.js +192 -178
- package/dist/components/workbench/WorkbenchPlacementPreview.js +23 -22
- package/dist/components/workbench/WorkbenchSurface.js +88 -81
- package/dist/components/workbench/workbenchPlacement.d.ts +3 -0
- package/dist/components/workbench/workbenchPlacement.js +35 -30
- package/dist/styles.css +1 -1
- package/dist/workbench.css +10 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type JSX } from 'solid-js';
|
|
2
|
+
import { type WorkbenchEdgeAutoPanFrame } from './workbenchEdgeAutoPan';
|
|
2
3
|
import type { WorkbenchDockToolId, WorkbenchInteractionMode, WorkbenchViewport, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
|
|
3
4
|
export interface WorkbenchFilterBarProps {
|
|
4
5
|
widgetDefinitions: readonly WorkbenchWidgetDefinition[];
|
|
@@ -12,8 +13,8 @@ export interface WorkbenchFilterBarProps {
|
|
|
12
13
|
* Called when the user drags a widget pill onto the canvas to create a
|
|
13
14
|
* new widget of that type. Coordinates are in client space (clientX/Y).
|
|
14
15
|
*/
|
|
15
|
-
onCreateAt?: (type: WorkbenchWidgetType, clientX: number, clientY: number) => void;
|
|
16
|
-
onCreateToolAt?: (tool: WorkbenchDockToolId, clientX: number, clientY: number) => void;
|
|
16
|
+
onCreateAt?: (type: WorkbenchWidgetType, clientX: number, clientY: number, context?: WorkbenchDockDropContext) => void;
|
|
17
|
+
onCreateToolAt?: (tool: WorkbenchDockToolId, clientX: number, clientY: number, context?: WorkbenchDockDropContext) => void;
|
|
17
18
|
onDragPreviewChange?: (preview: WorkbenchDockDragPreview | null) => void;
|
|
18
19
|
viewport?: WorkbenchViewport;
|
|
19
20
|
onViewportCommit?: (viewport: WorkbenchViewport) => void;
|
|
@@ -25,6 +26,12 @@ export type WorkbenchDockDragPreview = Readonly<{
|
|
|
25
26
|
label: string;
|
|
26
27
|
clientX: number;
|
|
27
28
|
clientY: number;
|
|
29
|
+
dropAllowed: boolean;
|
|
30
|
+
canvasFrame: WorkbenchEdgeAutoPanFrame;
|
|
31
|
+
}>;
|
|
32
|
+
export type WorkbenchDockDropContext = Readonly<{
|
|
33
|
+
dropAllowed: boolean;
|
|
34
|
+
canvasFrame: WorkbenchEdgeAutoPanFrame;
|
|
28
35
|
}>;
|
|
29
36
|
export declare function WorkbenchDock(props: WorkbenchFilterBarProps): JSX.Element;
|
|
30
37
|
export declare const WorkbenchFilterBar: typeof WorkbenchDock;
|
|
@@ -1,68 +1,69 @@
|
|
|
1
|
-
import { insert as
|
|
2
|
-
import { createSignal as
|
|
3
|
-
import { Motion as
|
|
1
|
+
import { insert as w, createComponent as g, effect as P, setAttribute as T, memo as me, template as $, Portal as he, setStyleProperty as ke, use as be, delegateEvents as we } from "solid-js/web";
|
|
2
|
+
import { createSignal as H, onCleanup as J, createEffect as Q, createMemo as B, Show as K, For as Z } 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
4
|
import { easing as A, duration as X } from "../../utils/animations.js";
|
|
5
|
-
import { Plus as
|
|
6
|
-
import { startHotInteraction as
|
|
7
|
-
import { startPointerSession as
|
|
8
|
-
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as
|
|
9
|
-
import { DockLayoutDashboard as
|
|
10
|
-
var
|
|
11
|
-
const
|
|
5
|
+
import { Plus as _e } from "../icons/index.js";
|
|
6
|
+
import { startHotInteraction as Ee } from "../../utils/hotInteraction.js";
|
|
7
|
+
import { startPointerSession as Ce } from "../ui/pointerSession.js";
|
|
8
|
+
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as oe, frameFromElement as ie, createWorkbenchEdgeAutoPanController as Se } from "./workbenchEdgeAutoPan.js";
|
|
9
|
+
import { DockLayoutDashboard as pe, DockLayers as De, DockRegion as Oe, DockText as Me, DockMessageSquare as Le } from "../icons/DockIcons.js";
|
|
10
|
+
var ye = /* @__PURE__ */ $("<button type=button class=workbench-dock__item>"), $e = /* @__PURE__ */ $('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), Ie = /* @__PURE__ */ $('<div class=workbench-dock data-floe-canvas-interactive=true><div class=workbench-dock__mode-switcher><button type=button class="workbench-dock__item workbench-dock__mode-trigger"aria-label="Switch canvas mode"aria-haspopup=menu></button></div><span class=workbench-dock__divider aria-hidden=true>'), Pe = /* @__PURE__ */ $("<button type=button class=workbench-dock__mode-option role=menuitemradio><span class=workbench-dock__mode-option-icon></span><span class=workbench-dock__mode-option-copy><span class=workbench-dock__mode-option-label></span><span class=workbench-dock__mode-option-description>"), Te = /* @__PURE__ */ $("<div class=workbench-dock-ghost aria-hidden=true><div class=workbench-dock-ghost__halo></div><div class=workbench-dock-ghost__card><div class=workbench-dock-ghost__icon></div><div class=workbench-dock-ghost__copy><div class=workbench-dock-ghost__title></div><div class=workbench-dock-ghost__hint><span>Drag onto canvas");
|
|
11
|
+
const ee = 5, Fe = ".workbench-dock", W = [{
|
|
12
12
|
mode: "work",
|
|
13
13
|
label: "Work Mode",
|
|
14
14
|
description: "Operate windows and sticky notes",
|
|
15
|
-
icon:
|
|
15
|
+
icon: pe
|
|
16
16
|
}, {
|
|
17
17
|
mode: "background",
|
|
18
18
|
label: "Composition Mode",
|
|
19
19
|
description: "Arrange regions and canvas text",
|
|
20
|
-
icon:
|
|
21
|
-
}],
|
|
20
|
+
icon: De
|
|
21
|
+
}], Ae = [{
|
|
22
22
|
tool: "sticky-note",
|
|
23
23
|
label: "Sticky",
|
|
24
|
-
icon:
|
|
25
|
-
}],
|
|
24
|
+
icon: Le
|
|
25
|
+
}], Xe = [{
|
|
26
26
|
tool: "background-region",
|
|
27
27
|
label: "Region",
|
|
28
|
-
icon:
|
|
28
|
+
icon: Oe
|
|
29
29
|
}, {
|
|
30
30
|
tool: "text",
|
|
31
31
|
label: "Text",
|
|
32
|
-
icon:
|
|
32
|
+
icon: Me
|
|
33
33
|
}];
|
|
34
|
-
function
|
|
35
|
-
const e = document.querySelector(
|
|
36
|
-
return e instanceof HTMLElement ? e
|
|
34
|
+
function Ye() {
|
|
35
|
+
const e = document.querySelector(oe);
|
|
36
|
+
return e instanceof HTMLElement ? ie(e) : null;
|
|
37
37
|
}
|
|
38
|
-
function N(e,
|
|
39
|
-
return e >=
|
|
38
|
+
function N(e, c, r) {
|
|
39
|
+
return e >= r.left && e <= r.right && c >= r.top && c <= r.bottom;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
return l ? N(e, s, l) : !1;
|
|
41
|
+
function Re(e, c, r) {
|
|
42
|
+
return r ? N(e, c, r) : !1;
|
|
44
43
|
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
function te(e, c, r) {
|
|
45
|
+
return Math.min(r, Math.max(c, e));
|
|
46
|
+
}
|
|
47
|
+
function xe(e, c, r, d, i) {
|
|
48
|
+
if (!e) return !1;
|
|
49
|
+
if (N(c, r, e) || N(d, i, e))
|
|
49
50
|
return !0;
|
|
50
|
-
const
|
|
51
|
+
const a = d - c, _ = i - r;
|
|
51
52
|
let f = 0, m = 1;
|
|
52
|
-
const u = (
|
|
53
|
-
if (
|
|
54
|
-
const E =
|
|
55
|
-
return
|
|
53
|
+
const u = (h, p) => {
|
|
54
|
+
if (h === 0) return p >= 0;
|
|
55
|
+
const E = p / h;
|
|
56
|
+
return h < 0 ? E > m ? !1 : (E > f && (f = E), !0) : E < f ? !1 : (E < m && (m = E), !0);
|
|
56
57
|
};
|
|
57
|
-
return u(-
|
|
58
|
+
return u(-a, c - e.left) && u(a, e.right - c) && u(-_, r - e.top) && u(_, e.bottom - r);
|
|
58
59
|
}
|
|
59
|
-
function
|
|
60
|
+
function ne(e, c) {
|
|
60
61
|
if (typeof document.elementFromPoint != "function") return !1;
|
|
61
|
-
const
|
|
62
|
-
return
|
|
62
|
+
const r = document.elementFromPoint(e, c);
|
|
63
|
+
return r instanceof Element && r.closest(Fe) !== null;
|
|
63
64
|
}
|
|
64
|
-
function
|
|
65
|
-
const
|
|
65
|
+
function He(e) {
|
|
66
|
+
const c = () => e.hoverOffset === -1 ? {
|
|
66
67
|
scale: 1.26,
|
|
67
68
|
y: -6,
|
|
68
69
|
x: 0
|
|
@@ -78,15 +79,15 @@ function Re(e) {
|
|
|
78
79
|
scale: 1,
|
|
79
80
|
y: 0,
|
|
80
81
|
x: 0
|
|
81
|
-
},
|
|
82
|
-
|
|
82
|
+
}, r = () => e.hoverOffset === -1, d = (i) => {
|
|
83
|
+
i.button === 0 && e.onDragBegin(i, e.kind, e.id, e.label, e.icon);
|
|
83
84
|
};
|
|
84
85
|
return (() => {
|
|
85
|
-
var
|
|
86
|
-
return
|
|
86
|
+
var i = ye();
|
|
87
|
+
return i.$$pointerdown = d, i.addEventListener("pointerleave", () => e.onLeave()), i.addEventListener("pointerenter", () => e.onEnter()), w(i, g(F.span, {
|
|
87
88
|
class: "workbench-dock__tile",
|
|
88
89
|
get animate() {
|
|
89
|
-
return
|
|
90
|
+
return c();
|
|
90
91
|
},
|
|
91
92
|
get transition() {
|
|
92
93
|
return {
|
|
@@ -96,18 +97,18 @@ function Re(e) {
|
|
|
96
97
|
},
|
|
97
98
|
get children() {
|
|
98
99
|
return (() => {
|
|
99
|
-
const
|
|
100
|
-
return g(
|
|
100
|
+
const a = e.icon;
|
|
101
|
+
return g(a, {
|
|
101
102
|
class: "workbench-dock__icon"
|
|
102
103
|
});
|
|
103
104
|
})();
|
|
104
105
|
}
|
|
105
|
-
}), null),
|
|
106
|
+
}), null), w(i, g(F.span, {
|
|
106
107
|
class: "workbench-dock__tooltip",
|
|
107
108
|
get animate() {
|
|
108
109
|
return {
|
|
109
|
-
opacity:
|
|
110
|
-
y:
|
|
110
|
+
opacity: r() ? 1 : 0,
|
|
111
|
+
y: r() ? -6 : 0
|
|
111
112
|
};
|
|
112
113
|
},
|
|
113
114
|
get transition() {
|
|
@@ -119,9 +120,9 @@ function Re(e) {
|
|
|
119
120
|
get children() {
|
|
120
121
|
return e.label;
|
|
121
122
|
}
|
|
122
|
-
}), null), P((
|
|
123
|
-
var
|
|
124
|
-
return
|
|
123
|
+
}), null), P((a) => {
|
|
124
|
+
var _ = !!e.active, f = !!(e.filterable && !e.visible), m = !!r(), u = !!e.isDragging, h = e.filterable ? `${e.label} — click to solo, drag to canvas to create` : `${e.label} — drag to canvas to create`, p = e.active;
|
|
125
|
+
return _ !== a.e && i.classList.toggle("is-active", a.e = _), f !== a.t && i.classList.toggle("is-filter-muted", a.t = f), m !== a.a && i.classList.toggle("is-hovered", a.a = m), u !== a.o && i.classList.toggle("is-source-dragging", a.o = u), h !== a.i && T(i, "aria-label", a.i = h), p !== a.n && T(i, "aria-pressed", a.n = p), a;
|
|
125
126
|
}, {
|
|
126
127
|
e: void 0,
|
|
127
128
|
t: void 0,
|
|
@@ -129,69 +130,77 @@ function Re(e) {
|
|
|
129
130
|
o: void 0,
|
|
130
131
|
i: void 0,
|
|
131
132
|
n: void 0
|
|
132
|
-
}),
|
|
133
|
+
}), i;
|
|
133
134
|
})();
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
const [
|
|
137
|
-
let f, m, u,
|
|
138
|
-
|
|
136
|
+
function Je(e) {
|
|
137
|
+
const [c, r] = H(null), [d, i] = H(null), [a, _] = H(!1);
|
|
138
|
+
let f, m, u, h = null;
|
|
139
|
+
J(() => {
|
|
139
140
|
u?.stop(), m?.stop({
|
|
140
141
|
reason: "manual_stop",
|
|
141
142
|
commit: !1
|
|
142
143
|
}), m = void 0, d()?.stopInteraction(), e.onDragPreviewChange?.(null);
|
|
143
|
-
}),
|
|
144
|
+
}), Q(() => {
|
|
144
145
|
e.onDragPreviewChange?.(d()?.preview ?? null);
|
|
145
|
-
}),
|
|
146
|
-
if (!
|
|
147
|
-
const t = (
|
|
148
|
-
f &&
|
|
149
|
-
},
|
|
150
|
-
|
|
146
|
+
}), Q(() => {
|
|
147
|
+
if (!a() || typeof window > "u") return;
|
|
148
|
+
const t = (s) => {
|
|
149
|
+
f && s.target instanceof Node && f.contains(s.target) || _(!1);
|
|
150
|
+
}, n = (s) => {
|
|
151
|
+
s.key === "Escape" && _(!1);
|
|
151
152
|
};
|
|
152
|
-
window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown",
|
|
153
|
-
window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown",
|
|
153
|
+
window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown", n, !0), J(() => {
|
|
154
|
+
window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown", n, !0);
|
|
154
155
|
});
|
|
155
156
|
});
|
|
156
|
-
const
|
|
157
|
-
const
|
|
158
|
-
return
|
|
157
|
+
const p = (t) => {
|
|
158
|
+
const n = c();
|
|
159
|
+
return n === null ? 0 : n === t ? -1 : n === t + 1 ? -2 : n === t - 1 ? 1 : 0;
|
|
159
160
|
}, E = () => {
|
|
160
|
-
u?.stop(), u = void 0,
|
|
161
|
+
u?.stop(), u = void 0, h = null;
|
|
161
162
|
}, Y = () => {
|
|
162
|
-
!e.viewport || !e.onViewportCommit || (
|
|
163
|
+
!e.viewport || !e.onViewportCommit || (h = e.viewport, u?.stop(), u = Se({
|
|
163
164
|
readFrame: () => {
|
|
164
|
-
const t = document.querySelector(
|
|
165
|
-
return t instanceof HTMLElement ?
|
|
165
|
+
const t = document.querySelector(oe);
|
|
166
|
+
return t instanceof HTMLElement ? ie(t) : null;
|
|
166
167
|
},
|
|
167
|
-
readViewport: () =>
|
|
168
|
+
readViewport: () => h ?? e.viewport ?? null,
|
|
168
169
|
commitViewport: (t) => {
|
|
169
|
-
|
|
170
|
+
h = t, e.onViewportCommit?.(t);
|
|
170
171
|
},
|
|
171
172
|
onPanStart: () => e.onViewportInteractionStart?.("pan"),
|
|
172
173
|
shouldPan: () => {
|
|
173
174
|
const t = d();
|
|
174
|
-
return !!(t?.moved && t.hasEnteredCanvas && !
|
|
175
|
+
return !!(t?.moved && t.hasEnteredCanvas && !ne(t.clientX, t.clientY));
|
|
175
176
|
}
|
|
176
177
|
}));
|
|
177
|
-
},
|
|
178
|
-
const
|
|
179
|
-
if (!
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
D() !== "background" && e.onSoloFilter(String(
|
|
178
|
+
}, re = (t) => {
|
|
179
|
+
const n = d();
|
|
180
|
+
if (!n) return;
|
|
181
|
+
const s = !n.moved;
|
|
182
|
+
if (n.stopInteraction(), E(), i(null), m = void 0, s) {
|
|
183
|
+
D() !== "background" && e.onSoloFilter(String(n.id), U());
|
|
183
184
|
return;
|
|
184
185
|
}
|
|
185
|
-
t &&
|
|
186
|
-
|
|
186
|
+
if (t && n.overCanvas) {
|
|
187
|
+
const O = n.canvasFrame ? {
|
|
188
|
+
dropAllowed: n.overCanvas,
|
|
189
|
+
canvasFrame: n.canvasFrame
|
|
190
|
+
} : void 0;
|
|
191
|
+
n.kind === "widget" ? e.onCreateAt?.(n.id, n.clientX, n.clientY, O) : e.onCreateToolAt?.(n.id, n.clientX, n.clientY, O);
|
|
192
|
+
}
|
|
193
|
+
}, ae = (t, n, s, O, l) => {
|
|
187
194
|
t.preventDefault(), m?.stop({
|
|
188
195
|
reason: "manual_stop",
|
|
189
196
|
commit: !1
|
|
190
|
-
}), Y()
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
197
|
+
}), Y();
|
|
198
|
+
const k = Ye();
|
|
199
|
+
i({
|
|
200
|
+
kind: n,
|
|
201
|
+
id: s,
|
|
202
|
+
label: O,
|
|
203
|
+
icon: l,
|
|
195
204
|
pointerId: t.pointerId,
|
|
196
205
|
startClientX: t.clientX,
|
|
197
206
|
startClientY: t.clientY,
|
|
@@ -200,48 +209,53 @@ function Ve(e) {
|
|
|
200
209
|
moved: !1,
|
|
201
210
|
overCanvas: !1,
|
|
202
211
|
hasEnteredCanvas: !1,
|
|
212
|
+
canvasFrame: k,
|
|
203
213
|
preview: null,
|
|
204
|
-
stopInteraction:
|
|
214
|
+
stopInteraction: Ee({
|
|
205
215
|
kind: "drag",
|
|
206
216
|
cursor: "grabbing"
|
|
207
217
|
})
|
|
208
218
|
});
|
|
209
|
-
const
|
|
210
|
-
let
|
|
211
|
-
|
|
212
|
-
if (!v || v.pointerId !==
|
|
213
|
-
const
|
|
214
|
-
|
|
219
|
+
const S = (o) => {
|
|
220
|
+
let y = !1;
|
|
221
|
+
i((v) => {
|
|
222
|
+
if (!v || v.pointerId !== o.pointerId) return v;
|
|
223
|
+
const I = o.clientX - v.startClientX, x = o.clientY - v.startClientY, C = v.moved || Math.abs(I) > ee || Math.abs(x) > ee, M = ne(o.clientX, o.clientY), b = v.canvasFrame, q = C && Re(o.clientX, o.clientY, b), z = q && !M, ge = C && !M && xe(b, v.clientX, v.clientY, o.clientX, o.clientY), j = v.hasEnteredCanvas || q || ge;
|
|
224
|
+
y = C && j && !M;
|
|
225
|
+
const ve = b ? te(o.clientX, b.left, b.right) : o.clientX, fe = b ? te(o.clientY, b.top, b.bottom) : o.clientY;
|
|
226
|
+
return {
|
|
215
227
|
...v,
|
|
216
|
-
clientX:
|
|
217
|
-
clientY:
|
|
218
|
-
moved:
|
|
219
|
-
overCanvas:
|
|
220
|
-
hasEnteredCanvas:
|
|
221
|
-
preview:
|
|
228
|
+
clientX: o.clientX,
|
|
229
|
+
clientY: o.clientY,
|
|
230
|
+
moved: C,
|
|
231
|
+
overCanvas: z,
|
|
232
|
+
hasEnteredCanvas: j,
|
|
233
|
+
preview: C && b ? {
|
|
222
234
|
kind: v.kind,
|
|
223
235
|
id: v.id,
|
|
224
236
|
label: v.label,
|
|
225
|
-
clientX:
|
|
226
|
-
clientY:
|
|
237
|
+
clientX: ve,
|
|
238
|
+
clientY: fe,
|
|
239
|
+
dropAllowed: z,
|
|
240
|
+
canvasFrame: b
|
|
227
241
|
} : null
|
|
228
242
|
};
|
|
229
|
-
}),
|
|
243
|
+
}), y && u?.updatePointer(o.clientX, o.clientY);
|
|
230
244
|
};
|
|
231
|
-
m =
|
|
245
|
+
m = Ce({
|
|
232
246
|
pointerEvent: t,
|
|
233
247
|
captureEl: t.currentTarget,
|
|
234
|
-
onMove:
|
|
248
|
+
onMove: S,
|
|
235
249
|
onEnd: ({
|
|
236
|
-
commit:
|
|
237
|
-
}) =>
|
|
250
|
+
commit: o
|
|
251
|
+
}) => re(o)
|
|
238
252
|
});
|
|
239
|
-
},
|
|
253
|
+
}, le = () => d()?.kind === "widget" ? d().id : null, ce = () => d()?.kind === "tool" ? d().id : null, D = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", V = B(() => W.find((t) => t.mode === D()) ?? W[0]), G = B(() => D() === "background" ? Xe.map((t) => ({
|
|
240
254
|
id: t.tool,
|
|
241
255
|
kind: "tool",
|
|
242
256
|
label: t.label,
|
|
243
257
|
icon: t.icon
|
|
244
|
-
})) : [
|
|
258
|
+
})) : [...Ae.map((t) => ({
|
|
245
259
|
id: t.tool,
|
|
246
260
|
kind: "tool",
|
|
247
261
|
label: t.label,
|
|
@@ -251,24 +265,24 @@ function Ve(e) {
|
|
|
251
265
|
kind: "widget",
|
|
252
266
|
label: t.label,
|
|
253
267
|
icon: t.icon
|
|
254
|
-
}))]), U =
|
|
255
|
-
if (!
|
|
268
|
+
}))]), U = B(() => G().map((t) => String(t.id))), R = () => D() !== "background", se = (t) => !R() || e.filters[t] !== !1, de = (t) => {
|
|
269
|
+
if (!R())
|
|
256
270
|
return !1;
|
|
257
|
-
const
|
|
258
|
-
return
|
|
259
|
-
},
|
|
260
|
-
scale:
|
|
261
|
-
y:
|
|
262
|
-
x:
|
|
271
|
+
const n = U();
|
|
272
|
+
return n.length > 1 && n.every((s) => e.filters[s] !== !1 == (s === t));
|
|
273
|
+
}, L = () => c() === 0, ue = () => ({
|
|
274
|
+
scale: L() || a() ? 1.26 : 1,
|
|
275
|
+
y: L() || a() ? -6 : 0,
|
|
276
|
+
x: c() === 1 ? -5 : 0
|
|
263
277
|
});
|
|
264
278
|
return [(() => {
|
|
265
|
-
var t =
|
|
266
|
-
|
|
267
|
-
var
|
|
268
|
-
return typeof
|
|
279
|
+
var t = Ie(), n = t.firstChild, s = n.firstChild;
|
|
280
|
+
n.nextSibling, t.addEventListener("pointerleave", () => r(null));
|
|
281
|
+
var O = f;
|
|
282
|
+
return typeof O == "function" ? be(O, t) : f = t, s.$$click = () => _((l) => !l), s.addEventListener("pointerleave", () => r((l) => l === 0 ? null : l)), s.addEventListener("pointerenter", () => r(0)), w(s, g(F.span, {
|
|
269
283
|
class: "workbench-dock__tile",
|
|
270
284
|
get animate() {
|
|
271
|
-
return
|
|
285
|
+
return ue();
|
|
272
286
|
},
|
|
273
287
|
get transition() {
|
|
274
288
|
return {
|
|
@@ -278,18 +292,18 @@ function Ve(e) {
|
|
|
278
292
|
},
|
|
279
293
|
get children() {
|
|
280
294
|
return (() => {
|
|
281
|
-
const
|
|
282
|
-
return g(
|
|
295
|
+
const l = V().icon;
|
|
296
|
+
return g(l, {
|
|
283
297
|
class: "workbench-dock__icon"
|
|
284
298
|
});
|
|
285
299
|
})();
|
|
286
300
|
}
|
|
287
|
-
}), null),
|
|
301
|
+
}), null), w(s, g(F.span, {
|
|
288
302
|
class: "workbench-dock__tooltip",
|
|
289
303
|
get animate() {
|
|
290
304
|
return {
|
|
291
|
-
opacity:
|
|
292
|
-
y:
|
|
305
|
+
opacity: L() && !a() ? 1 : 0,
|
|
306
|
+
y: L() && !a() ? -6 : 0
|
|
293
307
|
};
|
|
294
308
|
},
|
|
295
309
|
get transition() {
|
|
@@ -301,75 +315,75 @@ function Ve(e) {
|
|
|
301
315
|
get children() {
|
|
302
316
|
return V().label;
|
|
303
317
|
}
|
|
304
|
-
}), null),
|
|
318
|
+
}), null), w(n, g(K, {
|
|
305
319
|
get when() {
|
|
306
|
-
return
|
|
320
|
+
return a();
|
|
307
321
|
},
|
|
308
322
|
get children() {
|
|
309
|
-
var
|
|
310
|
-
return
|
|
323
|
+
var l = $e();
|
|
324
|
+
return w(l, g(Z, {
|
|
311
325
|
each: W,
|
|
312
|
-
children: (
|
|
313
|
-
const
|
|
326
|
+
children: (k) => {
|
|
327
|
+
const S = k.icon;
|
|
314
328
|
return (() => {
|
|
315
|
-
var
|
|
316
|
-
return
|
|
317
|
-
e.onSelectMode?.(
|
|
318
|
-
},
|
|
329
|
+
var o = Pe(), y = o.firstChild, v = y.nextSibling, I = v.firstChild, x = I.nextSibling;
|
|
330
|
+
return o.$$click = () => {
|
|
331
|
+
e.onSelectMode?.(k.mode), _(!1);
|
|
332
|
+
}, w(y, g(S, {
|
|
319
333
|
class: "workbench-dock__mode-icon"
|
|
320
|
-
})),
|
|
321
|
-
var
|
|
322
|
-
return
|
|
334
|
+
})), w(I, () => k.label), w(x, () => k.description), P((C) => {
|
|
335
|
+
var M = D() === k.mode, b = D() === k.mode;
|
|
336
|
+
return M !== C.e && o.classList.toggle("is-active", C.e = M), b !== C.t && T(o, "aria-checked", C.t = b), C;
|
|
323
337
|
}, {
|
|
324
338
|
e: void 0,
|
|
325
339
|
t: void 0
|
|
326
|
-
}),
|
|
340
|
+
}), o;
|
|
327
341
|
})();
|
|
328
342
|
}
|
|
329
|
-
})),
|
|
343
|
+
})), l;
|
|
330
344
|
}
|
|
331
|
-
}), null),
|
|
345
|
+
}), null), w(t, g(Z, {
|
|
332
346
|
get each() {
|
|
333
347
|
return G();
|
|
334
348
|
},
|
|
335
|
-
children: (
|
|
336
|
-
const
|
|
337
|
-
return g(
|
|
349
|
+
children: (l, k) => {
|
|
350
|
+
const S = () => k() + 1;
|
|
351
|
+
return g(He, {
|
|
338
352
|
get id() {
|
|
339
|
-
return String(
|
|
353
|
+
return String(l.id);
|
|
340
354
|
},
|
|
341
355
|
get kind() {
|
|
342
|
-
return
|
|
356
|
+
return l.kind;
|
|
343
357
|
},
|
|
344
358
|
get label() {
|
|
345
|
-
return
|
|
359
|
+
return l.label;
|
|
346
360
|
},
|
|
347
361
|
get icon() {
|
|
348
|
-
return
|
|
362
|
+
return l.icon;
|
|
349
363
|
},
|
|
350
364
|
get active() {
|
|
351
|
-
return
|
|
365
|
+
return de(String(l.id));
|
|
352
366
|
},
|
|
353
367
|
get visible() {
|
|
354
|
-
return
|
|
368
|
+
return se(String(l.id));
|
|
355
369
|
},
|
|
356
370
|
get filterable() {
|
|
357
|
-
return
|
|
371
|
+
return R();
|
|
358
372
|
},
|
|
359
373
|
get hoverOffset() {
|
|
360
|
-
return
|
|
374
|
+
return p(S());
|
|
361
375
|
},
|
|
362
376
|
get isDragging() {
|
|
363
|
-
return
|
|
377
|
+
return me(() => l.kind === "widget")() ? le() === l.id : ce() === l.id;
|
|
364
378
|
},
|
|
365
|
-
onEnter: () =>
|
|
366
|
-
onLeave: () =>
|
|
367
|
-
onDragBegin:
|
|
379
|
+
onEnter: () => r(S()),
|
|
380
|
+
onLeave: () => r((o) => o === S() ? null : o),
|
|
381
|
+
onDragBegin: ae
|
|
368
382
|
});
|
|
369
383
|
}
|
|
370
|
-
}), null), P((
|
|
371
|
-
var
|
|
372
|
-
return
|
|
384
|
+
}), null), P((l) => {
|
|
385
|
+
var k = D() === "background", S = !!(L() || a()), o = a();
|
|
386
|
+
return k !== l.e && s.classList.toggle("is-active", l.e = k), S !== l.t && s.classList.toggle("is-hovered", l.t = S), o !== l.a && T(s, "aria-expanded", l.a = o), l;
|
|
373
387
|
}, {
|
|
374
388
|
e: void 0,
|
|
375
389
|
t: void 0,
|
|
@@ -377,24 +391,24 @@ function Ve(e) {
|
|
|
377
391
|
}), t;
|
|
378
392
|
})(), g(K, {
|
|
379
393
|
get when() {
|
|
380
|
-
return !!(d()?.moved && !d()?.
|
|
394
|
+
return !!(d()?.moved && !d()?.preview);
|
|
381
395
|
},
|
|
382
396
|
get children() {
|
|
383
|
-
return g(
|
|
397
|
+
return g(Be, {
|
|
384
398
|
state: d
|
|
385
399
|
});
|
|
386
400
|
}
|
|
387
401
|
})];
|
|
388
402
|
}
|
|
389
|
-
function
|
|
390
|
-
const
|
|
391
|
-
const
|
|
392
|
-
return
|
|
393
|
-
},
|
|
394
|
-
return g(
|
|
403
|
+
function Be(e) {
|
|
404
|
+
const c = () => {
|
|
405
|
+
const i = e.state();
|
|
406
|
+
return i ? `translate3d(${i.clientX + 14}px, ${i.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
|
|
407
|
+
}, r = () => e.state()?.label ?? "", d = () => e.state()?.icon;
|
|
408
|
+
return g(he, {
|
|
395
409
|
get children() {
|
|
396
|
-
var
|
|
397
|
-
return
|
|
410
|
+
var i = Te(), a = i.firstChild, _ = a.nextSibling, f = _.firstChild, m = f.nextSibling, u = m.firstChild, h = u.nextSibling, p = h.firstChild;
|
|
411
|
+
return w(f, g(K, {
|
|
398
412
|
get when() {
|
|
399
413
|
return d();
|
|
400
414
|
},
|
|
@@ -404,13 +418,13 @@ function Ae(e) {
|
|
|
404
418
|
class: "w-4 h-4"
|
|
405
419
|
});
|
|
406
420
|
}
|
|
407
|
-
})),
|
|
421
|
+
})), w(u, r), w(h, g(_e, {
|
|
408
422
|
class: "w-3 h-3"
|
|
409
|
-
}),
|
|
423
|
+
}), p), P((E) => ke(i, "transform", c())), i;
|
|
410
424
|
}
|
|
411
425
|
});
|
|
412
426
|
}
|
|
413
|
-
|
|
427
|
+
we(["pointerdown", "click"]);
|
|
414
428
|
export {
|
|
415
|
-
|
|
429
|
+
Je as WorkbenchDock
|
|
416
430
|
};
|