@floegence/floe-webapp-core 0.36.48 → 0.36.50
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/WorkbenchContextMenu.d.ts +6 -1
- package/dist/components/workbench/WorkbenchContextMenu.js +31 -25
- package/dist/components/workbench/WorkbenchFilterBar.js +146 -141
- package/dist/components/workbench/WorkbenchSurface.js +177 -177
- package/dist/components/workbench/index.d.ts +1 -1
- package/dist/components/workbench/useWorkbenchModel.d.ts +2 -2
- package/dist/components/workbench/useWorkbenchModel.js +247 -220
- package/dist/components/workbench/workbenchHelpers.d.ts +12 -0
- package/dist/components/workbench/workbenchHelpers.js +68 -48
- package/dist/workbench.js +23 -22
- package/package.json +1 -1
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { type Component } from 'solid-js';
|
|
2
|
+
export type WorkbenchContextMenuSelectEvent = Readonly<{
|
|
3
|
+
source: 'pointer' | 'keyboard';
|
|
4
|
+
clientX: number;
|
|
5
|
+
clientY: number;
|
|
6
|
+
}>;
|
|
2
7
|
type WorkbenchContextMenuActionItem = Readonly<{
|
|
3
8
|
id: string;
|
|
4
9
|
kind: 'action';
|
|
@@ -6,7 +11,7 @@ type WorkbenchContextMenuActionItem = Readonly<{
|
|
|
6
11
|
icon: Component<{
|
|
7
12
|
class?: string;
|
|
8
13
|
}>;
|
|
9
|
-
onSelect: () => void;
|
|
14
|
+
onSelect: (event?: WorkbenchContextMenuSelectEvent) => void;
|
|
10
15
|
disabled?: boolean;
|
|
11
16
|
destructive?: boolean;
|
|
12
17
|
}>;
|
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
import { spread as _, mergeProps as b, insert as c, createComponent as u,
|
|
2
|
-
import { For as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { WORKBENCH_CONTEXT_MENU_ATTR as
|
|
5
|
-
var $ = /* @__PURE__ */ a("<div role=menu class=workbench-context-menu data-floe-workbench-boundary=true>"),
|
|
6
|
-
function
|
|
7
|
-
return
|
|
1
|
+
import { spread as _, mergeProps as b, insert as c, createComponent as u, effect as p, className as f, template as a, delegateEvents as h } from "solid-js/web";
|
|
2
|
+
import { For as v } from "solid-js";
|
|
3
|
+
import { cn as x } from "../../utils/cn.js";
|
|
4
|
+
import { WORKBENCH_CONTEXT_MENU_ATTR as k } from "./workbenchContextMenuDismiss.js";
|
|
5
|
+
var $ = /* @__PURE__ */ a("<div role=menu class=workbench-context-menu data-floe-workbench-boundary=true>"), w = /* @__PURE__ */ a("<div role=separator aria-orientation=horizontal class=workbench-context-menu__separator>"), g = /* @__PURE__ */ a("<button type=button role=menuitem><span class=workbench-context-menu__icon aria-hidden=true></span><span class=workbench-context-menu__label>");
|
|
6
|
+
function C(n) {
|
|
7
|
+
return n.kind === "action";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function M(n) {
|
|
10
10
|
return (() => {
|
|
11
11
|
var o = $();
|
|
12
12
|
return _(o, b({
|
|
13
|
-
[
|
|
13
|
+
[k]: "true"
|
|
14
14
|
}, {
|
|
15
15
|
get style() {
|
|
16
16
|
return {
|
|
17
|
-
left: `${
|
|
18
|
-
top: `${
|
|
17
|
+
left: `${n.x}px`,
|
|
18
|
+
top: `${n.y}px`
|
|
19
19
|
};
|
|
20
20
|
},
|
|
21
|
-
onContextMenu: (
|
|
22
|
-
}), !1, !0), c(o, u(
|
|
21
|
+
onContextMenu: (t) => t.preventDefault()
|
|
22
|
+
}), !1, !0), c(o, u(v, {
|
|
23
23
|
get each() {
|
|
24
|
-
return
|
|
24
|
+
return n.items;
|
|
25
25
|
},
|
|
26
|
-
children: (
|
|
27
|
-
if (!
|
|
28
|
-
return
|
|
29
|
-
const m =
|
|
26
|
+
children: (t) => {
|
|
27
|
+
if (!C(t))
|
|
28
|
+
return w();
|
|
29
|
+
const m = t.icon;
|
|
30
30
|
return (() => {
|
|
31
|
-
var
|
|
32
|
-
return
|
|
31
|
+
var r = g(), i = r.firstChild, d = i.nextSibling;
|
|
32
|
+
return r.$$click = (e) => {
|
|
33
|
+
t.onSelect({
|
|
34
|
+
source: e.detail === 0 ? "keyboard" : "pointer",
|
|
35
|
+
clientX: e.clientX,
|
|
36
|
+
clientY: e.clientY
|
|
37
|
+
});
|
|
38
|
+
}, c(i, u(m, {
|
|
33
39
|
class: "workbench-context-menu__icon-svg"
|
|
34
|
-
})), c(d, () =>
|
|
35
|
-
var l =
|
|
36
|
-
return l !==
|
|
40
|
+
})), c(d, () => t.label), p((e) => {
|
|
41
|
+
var l = x("workbench-context-menu__item", t.destructive && "is-destructive"), s = t.disabled;
|
|
42
|
+
return l !== e.e && f(r, e.e = l), s !== e.t && (r.disabled = e.t = s), e;
|
|
37
43
|
}, {
|
|
38
44
|
e: void 0,
|
|
39
45
|
t: void 0
|
|
40
|
-
}),
|
|
46
|
+
}), r;
|
|
41
47
|
})();
|
|
42
48
|
}
|
|
43
49
|
})), o;
|
|
@@ -45,5 +51,5 @@ function A(t) {
|
|
|
45
51
|
}
|
|
46
52
|
h(["click"]);
|
|
47
53
|
export {
|
|
48
|
-
|
|
54
|
+
M as WorkbenchContextMenu
|
|
49
55
|
};
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { insert as h, createComponent as d, effect as A, setAttribute as x, memo as
|
|
2
|
-
import { createSignal as
|
|
1
|
+
import { insert as h, createComponent as d, effect as A, setAttribute as x, memo as se, template as $, Portal as de, setStyleProperty as ue, use as ge, delegateEvents as ve } from "solid-js/web";
|
|
2
|
+
import { createSignal as W, onCleanup as j, createEffect as fe, createMemo as K, Show as V, For as J } from "solid-js";
|
|
3
3
|
import { Motion as X } 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 H, duration as Y } from "../../utils/animations.js";
|
|
5
|
-
import { LayoutDashboard as
|
|
6
|
-
import { startHotInteraction as
|
|
7
|
-
import { startPointerSession as
|
|
8
|
-
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as
|
|
9
|
-
var
|
|
10
|
-
const
|
|
5
|
+
import { LayoutDashboard as me, Layers as ee, Region as he, TextTool as ke, MessageSquare as be, Plus as _e } from "../icons/index.js";
|
|
6
|
+
import { startHotInteraction as we } from "../../utils/hotInteraction.js";
|
|
7
|
+
import { startPointerSession as Ee } from "../ui/pointerSession.js";
|
|
8
|
+
import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as te, createWorkbenchEdgeAutoPanController as Ce, frameFromElement as Se } from "./workbenchEdgeAutoPan.js";
|
|
9
|
+
var Oe = /* @__PURE__ */ $("<button type=button class=workbench-dock__item>"), Le = /* @__PURE__ */ $('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), De = /* @__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>'), Me = /* @__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>"), ye = /* @__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>");
|
|
10
|
+
const Q = 5, Ie = ".workbench-dock", N = [{
|
|
11
11
|
mode: "work",
|
|
12
12
|
label: "Work Mode",
|
|
13
13
|
description: "Operate windows and sticky notes",
|
|
14
|
-
icon:
|
|
14
|
+
icon: me
|
|
15
15
|
}, {
|
|
16
16
|
mode: "background",
|
|
17
17
|
label: "Composition Mode",
|
|
18
18
|
description: "Arrange regions and canvas text",
|
|
19
|
-
icon:
|
|
20
|
-
}],
|
|
19
|
+
icon: ee
|
|
20
|
+
}], $e = [{
|
|
21
21
|
tool: "sticky-note",
|
|
22
22
|
label: "Sticky",
|
|
23
|
-
icon:
|
|
24
|
-
}],
|
|
23
|
+
icon: be
|
|
24
|
+
}], pe = [{
|
|
25
25
|
tool: "background-region",
|
|
26
26
|
label: "Region",
|
|
27
|
-
icon:
|
|
27
|
+
icon: he
|
|
28
28
|
}, {
|
|
29
29
|
tool: "text",
|
|
30
30
|
label: "Text",
|
|
31
|
-
icon:
|
|
31
|
+
icon: ke
|
|
32
32
|
}];
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
return
|
|
33
|
+
function ne() {
|
|
34
|
+
const e = document.querySelector(te);
|
|
35
|
+
return e instanceof HTMLElement ? e.getBoundingClientRect() : null;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function G(e, s, a) {
|
|
38
|
+
return e >= a.left && e <= a.right && s >= a.top && s <= a.bottom;
|
|
39
39
|
}
|
|
40
|
-
function Pe(
|
|
41
|
-
const a =
|
|
42
|
-
return a ?
|
|
40
|
+
function Pe(e, s) {
|
|
41
|
+
const a = ne();
|
|
42
|
+
return a ? G(e, s, a) : !1;
|
|
43
43
|
}
|
|
44
|
-
function Te(
|
|
45
|
-
const o =
|
|
44
|
+
function Te(e, s, a, u) {
|
|
45
|
+
const o = ne();
|
|
46
46
|
if (!o) return !1;
|
|
47
|
-
if (
|
|
47
|
+
if (G(e, s, o) || G(a, u, o))
|
|
48
48
|
return !0;
|
|
49
|
-
const n = a -
|
|
49
|
+
const n = a - e, w = u - s;
|
|
50
50
|
let k = 0, v = 1;
|
|
51
51
|
const g = (f, C) => {
|
|
52
52
|
if (f === 0) return C >= 0;
|
|
53
53
|
const E = C / f;
|
|
54
54
|
return f < 0 ? E > v ? !1 : (E > k && (k = E), !0) : E < k ? !1 : (E < v && (v = E), !0);
|
|
55
55
|
};
|
|
56
|
-
return g(-n,
|
|
56
|
+
return g(-n, e - o.left) && g(n, o.right - e) && g(-w, s - o.top) && g(w, o.bottom - s);
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function Z(e, s) {
|
|
59
59
|
if (typeof document.elementFromPoint != "function") return !1;
|
|
60
|
-
const a = document.elementFromPoint(
|
|
61
|
-
return a instanceof Element && a.closest(
|
|
60
|
+
const a = document.elementFromPoint(e, s);
|
|
61
|
+
return a instanceof Element && a.closest(Ie) !== null;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
const s = () =>
|
|
63
|
+
function Re(e) {
|
|
64
|
+
const s = () => e.hoverOffset === -1 ? {
|
|
65
65
|
scale: 1.26,
|
|
66
66
|
y: -6,
|
|
67
67
|
x: 0
|
|
68
|
-
} :
|
|
68
|
+
} : e.hoverOffset === 1 ? {
|
|
69
69
|
scale: 1.08,
|
|
70
70
|
y: -2,
|
|
71
71
|
x: 5
|
|
72
|
-
} :
|
|
72
|
+
} : e.hoverOffset === -2 ? {
|
|
73
73
|
scale: 1.08,
|
|
74
74
|
y: -2,
|
|
75
75
|
x: -5
|
|
@@ -77,12 +77,12 @@ function $e(t) {
|
|
|
77
77
|
scale: 1,
|
|
78
78
|
y: 0,
|
|
79
79
|
x: 0
|
|
80
|
-
}, a = () =>
|
|
81
|
-
o.button === 0 &&
|
|
80
|
+
}, a = () => e.hoverOffset === -1, u = (o) => {
|
|
81
|
+
o.button === 0 && e.onDragBegin(o, e.kind, e.id, e.label, e.icon);
|
|
82
82
|
};
|
|
83
83
|
return (() => {
|
|
84
|
-
var o =
|
|
85
|
-
return o.$$pointerdown = u, o.addEventListener("pointerleave", () =>
|
|
84
|
+
var o = Oe();
|
|
85
|
+
return o.$$pointerdown = u, o.addEventListener("pointerleave", () => e.onLeave()), o.addEventListener("pointerenter", () => e.onEnter()), h(o, d(X.span, {
|
|
86
86
|
class: "workbench-dock__tile",
|
|
87
87
|
get animate() {
|
|
88
88
|
return s();
|
|
@@ -95,7 +95,7 @@ function $e(t) {
|
|
|
95
95
|
},
|
|
96
96
|
get children() {
|
|
97
97
|
return (() => {
|
|
98
|
-
const n =
|
|
98
|
+
const n = e.icon;
|
|
99
99
|
return d(n, {
|
|
100
100
|
class: "workbench-dock__icon"
|
|
101
101
|
});
|
|
@@ -116,10 +116,10 @@ function $e(t) {
|
|
|
116
116
|
};
|
|
117
117
|
},
|
|
118
118
|
get children() {
|
|
119
|
-
return
|
|
119
|
+
return e.label;
|
|
120
120
|
}
|
|
121
121
|
}), null), A((n) => {
|
|
122
|
-
var w = !!
|
|
122
|
+
var w = !!e.active, k = !!(e.filterable && !e.visible), v = !!a(), g = !!e.isDragging, f = e.filterable ? `${e.label} — click to solo, drag to canvas to create` : `${e.label} — drag to canvas to create`, C = e.active;
|
|
123
123
|
return w !== n.e && o.classList.toggle("is-active", n.e = w), k !== n.t && o.classList.toggle("is-filter-muted", n.t = k), v !== n.a && o.classList.toggle("is-hovered", n.a = v), g !== n.o && o.classList.toggle("is-source-dragging", n.o = g), f !== n.i && x(o, "aria-label", n.i = f), C !== n.n && x(o, "aria-pressed", n.n = C), n;
|
|
124
124
|
}, {
|
|
125
125
|
e: void 0,
|
|
@@ -131,73 +131,73 @@ function $e(t) {
|
|
|
131
131
|
}), o;
|
|
132
132
|
})();
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
const [s, a] =
|
|
134
|
+
function Ne(e) {
|
|
135
|
+
const [s, a] = W(null), [u, o] = W(null), [n, w] = W(!1);
|
|
136
136
|
let k, v, g, f = null;
|
|
137
|
-
|
|
137
|
+
j(() => {
|
|
138
138
|
g?.stop(), v?.stop({
|
|
139
139
|
reason: "manual_stop",
|
|
140
140
|
commit: !1
|
|
141
141
|
}), v = void 0, u()?.stopInteraction();
|
|
142
|
-
}),
|
|
142
|
+
}), fe(() => {
|
|
143
143
|
if (!n() || typeof window > "u") return;
|
|
144
|
-
const
|
|
144
|
+
const t = (l) => {
|
|
145
145
|
k && l.target instanceof Node && k.contains(l.target) || w(!1);
|
|
146
146
|
}, i = (l) => {
|
|
147
147
|
l.key === "Escape" && w(!1);
|
|
148
148
|
};
|
|
149
|
-
window.addEventListener("pointerdown",
|
|
150
|
-
window.removeEventListener("pointerdown",
|
|
149
|
+
window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown", i, !0), j(() => {
|
|
150
|
+
window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown", i, !0);
|
|
151
151
|
});
|
|
152
152
|
});
|
|
153
|
-
const C = (
|
|
153
|
+
const C = (t) => {
|
|
154
154
|
const i = s();
|
|
155
|
-
return i === null ? 0 : i ===
|
|
155
|
+
return i === null ? 0 : i === t ? -1 : i === t + 1 ? -2 : i === t - 1 ? 1 : 0;
|
|
156
156
|
}, E = () => {
|
|
157
157
|
g?.stop(), g = void 0, f = null;
|
|
158
158
|
}, S = () => {
|
|
159
|
-
!
|
|
159
|
+
!e.viewport || !e.onViewportCommit || (f = e.viewport, g?.stop(), g = Ce({
|
|
160
160
|
readFrame: () => {
|
|
161
|
-
const
|
|
162
|
-
return
|
|
161
|
+
const t = document.querySelector(te);
|
|
162
|
+
return t instanceof HTMLElement ? Se(t) : null;
|
|
163
163
|
},
|
|
164
|
-
readViewport: () => f ??
|
|
165
|
-
commitViewport: (
|
|
166
|
-
f =
|
|
164
|
+
readViewport: () => f ?? e.viewport ?? null,
|
|
165
|
+
commitViewport: (t) => {
|
|
166
|
+
f = t, e.onViewportCommit?.(t);
|
|
167
167
|
},
|
|
168
|
-
onPanStart: () =>
|
|
168
|
+
onPanStart: () => e.onViewportInteractionStart?.("pan"),
|
|
169
169
|
shouldPan: () => {
|
|
170
|
-
const
|
|
171
|
-
return !!(
|
|
170
|
+
const t = u();
|
|
171
|
+
return !!(t?.moved && t.hasEnteredCanvas && !Z(t.clientX, t.clientY));
|
|
172
172
|
}
|
|
173
173
|
}));
|
|
174
|
-
},
|
|
174
|
+
}, D = (t) => {
|
|
175
175
|
const i = u();
|
|
176
176
|
if (!i) return;
|
|
177
177
|
const l = !i.moved;
|
|
178
178
|
if (i.stopInteraction(), E(), o(null), v = void 0, l) {
|
|
179
|
-
|
|
179
|
+
L() !== "background" && e.onSoloFilter(String(i.id), q());
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
|
|
183
|
-
},
|
|
184
|
-
|
|
182
|
+
t && i.overCanvas && (i.kind === "widget" ? e.onCreateAt?.(i.id, i.clientX, i.clientY) : e.onCreateToolAt?.(i.id, i.clientX, i.clientY));
|
|
183
|
+
}, p = (t, i, l, P, r) => {
|
|
184
|
+
t.preventDefault(), v?.stop({
|
|
185
185
|
reason: "manual_stop",
|
|
186
186
|
commit: !1
|
|
187
187
|
}), S(), o({
|
|
188
188
|
kind: i,
|
|
189
189
|
id: l,
|
|
190
|
-
label:
|
|
190
|
+
label: P,
|
|
191
191
|
icon: r,
|
|
192
|
-
pointerId:
|
|
193
|
-
startClientX:
|
|
194
|
-
startClientY:
|
|
195
|
-
clientX:
|
|
196
|
-
clientY:
|
|
192
|
+
pointerId: t.pointerId,
|
|
193
|
+
startClientX: t.clientX,
|
|
194
|
+
startClientY: t.clientY,
|
|
195
|
+
clientX: t.clientX,
|
|
196
|
+
clientY: t.clientY,
|
|
197
197
|
moved: !1,
|
|
198
198
|
overCanvas: !1,
|
|
199
199
|
hasEnteredCanvas: !1,
|
|
200
|
-
stopInteraction:
|
|
200
|
+
stopInteraction: we({
|
|
201
201
|
kind: "drag",
|
|
202
202
|
cursor: "grabbing"
|
|
203
203
|
})
|
|
@@ -206,56 +206,58 @@ function Ke(t) {
|
|
|
206
206
|
let m = !1;
|
|
207
207
|
o((_) => {
|
|
208
208
|
if (!_ || _.pointerId !== c.pointerId) return _;
|
|
209
|
-
const B = c.clientX - _.startClientX,
|
|
210
|
-
return m =
|
|
209
|
+
const B = c.clientX - _.startClientX, T = c.clientY - _.startClientY, M = _.moved || Math.abs(B) > Q || Math.abs(T) > Q, O = Z(c.clientX, c.clientY), I = M && Pe(c.clientX, c.clientY) && !O, R = M && !O && Te(_.clientX, _.clientY, c.clientX, c.clientY), z = _.hasEnteredCanvas || I || R;
|
|
210
|
+
return m = M && z && !O, {
|
|
211
211
|
..._,
|
|
212
212
|
clientX: c.clientX,
|
|
213
213
|
clientY: c.clientY,
|
|
214
|
-
moved:
|
|
215
|
-
overCanvas:
|
|
216
|
-
hasEnteredCanvas:
|
|
214
|
+
moved: M,
|
|
215
|
+
overCanvas: I,
|
|
216
|
+
hasEnteredCanvas: z
|
|
217
217
|
};
|
|
218
218
|
}), m && g?.updatePointer(c.clientX, c.clientY);
|
|
219
219
|
};
|
|
220
|
-
v =
|
|
221
|
-
pointerEvent:
|
|
222
|
-
captureEl:
|
|
220
|
+
v = Ee({
|
|
221
|
+
pointerEvent: t,
|
|
222
|
+
captureEl: t.currentTarget,
|
|
223
223
|
onMove: b,
|
|
224
224
|
onEnd: ({
|
|
225
225
|
commit: c
|
|
226
|
-
}) =>
|
|
226
|
+
}) => D(c)
|
|
227
227
|
});
|
|
228
|
-
},
|
|
229
|
-
id:
|
|
228
|
+
}, oe = () => u()?.kind === "widget" ? u().id : null, ie = () => u()?.kind === "tool" ? u().id : null, L = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", re = K(() => N.find((t) => t.mode === L()) ?? N[0]), U = K(() => L() === "background" ? pe.map((t) => ({
|
|
229
|
+
id: t.tool,
|
|
230
230
|
kind: "tool",
|
|
231
|
-
label:
|
|
232
|
-
icon:
|
|
233
|
-
})) : [
|
|
234
|
-
id:
|
|
231
|
+
label: t.label,
|
|
232
|
+
icon: t.icon
|
|
233
|
+
})) : [...$e.map((t) => ({
|
|
234
|
+
id: t.tool,
|
|
235
235
|
kind: "tool",
|
|
236
|
-
label:
|
|
237
|
-
icon:
|
|
238
|
-
})), ...
|
|
239
|
-
id:
|
|
236
|
+
label: t.label,
|
|
237
|
+
icon: t.icon
|
|
238
|
+
})), ...e.widgetDefinitions.map((t) => ({
|
|
239
|
+
id: t.type,
|
|
240
240
|
kind: "widget",
|
|
241
|
-
label:
|
|
242
|
-
icon:
|
|
243
|
-
}))]),
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
241
|
+
label: t.label,
|
|
242
|
+
icon: t.icon
|
|
243
|
+
}))]), q = K(() => U().map((t) => String(t.id))), F = () => L() !== "background", ae = (t) => !F() || e.filters[t] !== !1, ce = (t) => {
|
|
244
|
+
if (!F())
|
|
245
|
+
return !1;
|
|
246
|
+
const i = q();
|
|
247
|
+
return i.length > 1 && i.every((l) => e.filters[l] !== !1 == (l === t));
|
|
248
|
+
}, y = () => s() === 0, le = () => ({
|
|
249
|
+
scale: y() || n() ? 1.26 : 1,
|
|
250
|
+
y: y() || n() ? -6 : 0,
|
|
249
251
|
x: s() === 1 ? -5 : 0
|
|
250
252
|
});
|
|
251
253
|
return [(() => {
|
|
252
|
-
var
|
|
253
|
-
i.nextSibling,
|
|
254
|
-
var
|
|
255
|
-
return typeof
|
|
254
|
+
var t = De(), i = t.firstChild, l = i.firstChild;
|
|
255
|
+
i.nextSibling, t.addEventListener("pointerleave", () => a(null));
|
|
256
|
+
var P = k;
|
|
257
|
+
return typeof P == "function" ? ge(P, t) : k = t, l.$$click = () => w((r) => !r), l.addEventListener("pointerleave", () => a((r) => r === 0 ? null : r)), l.addEventListener("pointerenter", () => a(0)), h(l, d(X.span, {
|
|
256
258
|
class: "workbench-dock__tile",
|
|
257
259
|
get animate() {
|
|
258
|
-
return
|
|
260
|
+
return le();
|
|
259
261
|
},
|
|
260
262
|
get transition() {
|
|
261
263
|
return {
|
|
@@ -264,7 +266,7 @@ function Ke(t) {
|
|
|
264
266
|
};
|
|
265
267
|
},
|
|
266
268
|
get children() {
|
|
267
|
-
return d(
|
|
269
|
+
return d(ee, {
|
|
268
270
|
class: "workbench-dock__icon"
|
|
269
271
|
});
|
|
270
272
|
}
|
|
@@ -272,8 +274,8 @@ function Ke(t) {
|
|
|
272
274
|
class: "workbench-dock__tooltip",
|
|
273
275
|
get animate() {
|
|
274
276
|
return {
|
|
275
|
-
opacity:
|
|
276
|
-
y:
|
|
277
|
+
opacity: y() && !n() ? 1 : 0,
|
|
278
|
+
y: y() && !n() ? -6 : 0
|
|
277
279
|
};
|
|
278
280
|
},
|
|
279
281
|
get transition() {
|
|
@@ -283,27 +285,27 @@ function Ke(t) {
|
|
|
283
285
|
};
|
|
284
286
|
},
|
|
285
287
|
get children() {
|
|
286
|
-
return
|
|
288
|
+
return re().label;
|
|
287
289
|
}
|
|
288
|
-
}), null), h(i, d(
|
|
290
|
+
}), null), h(i, d(V, {
|
|
289
291
|
get when() {
|
|
290
292
|
return n();
|
|
291
293
|
},
|
|
292
294
|
get children() {
|
|
293
|
-
var r =
|
|
294
|
-
return h(r, d(
|
|
295
|
-
each:
|
|
295
|
+
var r = Le();
|
|
296
|
+
return h(r, d(J, {
|
|
297
|
+
each: N,
|
|
296
298
|
children: (b) => {
|
|
297
299
|
const c = b.icon;
|
|
298
300
|
return (() => {
|
|
299
|
-
var m =
|
|
301
|
+
var m = Me(), _ = m.firstChild, B = _.nextSibling, T = B.firstChild, M = T.nextSibling;
|
|
300
302
|
return m.$$click = () => {
|
|
301
|
-
|
|
303
|
+
e.onSelectMode?.(b.mode), w(!1);
|
|
302
304
|
}, h(_, d(c, {
|
|
303
305
|
class: "workbench-dock__mode-icon"
|
|
304
|
-
})), h(
|
|
305
|
-
var
|
|
306
|
-
return
|
|
306
|
+
})), h(T, () => b.label), h(M, () => b.description), A((O) => {
|
|
307
|
+
var I = L() === b.mode, R = L() === b.mode;
|
|
308
|
+
return I !== O.e && m.classList.toggle("is-active", O.e = I), R !== O.t && x(m, "aria-checked", O.t = R), O;
|
|
307
309
|
}, {
|
|
308
310
|
e: void 0,
|
|
309
311
|
t: void 0
|
|
@@ -312,13 +314,13 @@ function Ke(t) {
|
|
|
312
314
|
}
|
|
313
315
|
})), r;
|
|
314
316
|
}
|
|
315
|
-
}), null), h(
|
|
317
|
+
}), null), h(t, d(J, {
|
|
316
318
|
get each() {
|
|
317
|
-
return
|
|
319
|
+
return U();
|
|
318
320
|
},
|
|
319
321
|
children: (r, b) => {
|
|
320
322
|
const c = () => b() + 1;
|
|
321
|
-
return d(
|
|
323
|
+
return d(Re, {
|
|
322
324
|
get id() {
|
|
323
325
|
return String(r.id);
|
|
324
326
|
},
|
|
@@ -332,64 +334,67 @@ function Ke(t) {
|
|
|
332
334
|
return r.icon;
|
|
333
335
|
},
|
|
334
336
|
get active() {
|
|
335
|
-
return
|
|
337
|
+
return ce(String(r.id));
|
|
336
338
|
},
|
|
337
339
|
get visible() {
|
|
338
|
-
return
|
|
340
|
+
return ae(String(r.id));
|
|
341
|
+
},
|
|
342
|
+
get filterable() {
|
|
343
|
+
return F();
|
|
339
344
|
},
|
|
340
345
|
get hoverOffset() {
|
|
341
346
|
return C(c());
|
|
342
347
|
},
|
|
343
348
|
get isDragging() {
|
|
344
|
-
return
|
|
349
|
+
return se(() => r.kind === "widget")() ? oe() === r.id : ie() === r.id;
|
|
345
350
|
},
|
|
346
351
|
onEnter: () => a(c()),
|
|
347
352
|
onLeave: () => a((m) => m === c() ? null : m),
|
|
348
|
-
onDragBegin:
|
|
353
|
+
onDragBegin: p
|
|
349
354
|
});
|
|
350
355
|
}
|
|
351
356
|
}), null), A((r) => {
|
|
352
|
-
var b =
|
|
357
|
+
var b = L() === "background", c = !!(y() || n()), m = n();
|
|
353
358
|
return b !== r.e && l.classList.toggle("is-active", r.e = b), c !== r.t && l.classList.toggle("is-hovered", r.t = c), m !== r.a && x(l, "aria-expanded", r.a = m), r;
|
|
354
359
|
}, {
|
|
355
360
|
e: void 0,
|
|
356
361
|
t: void 0,
|
|
357
362
|
a: void 0
|
|
358
|
-
}),
|
|
359
|
-
})(), d(
|
|
363
|
+
}), t;
|
|
364
|
+
})(), d(V, {
|
|
360
365
|
get when() {
|
|
361
366
|
return u()?.moved ?? !1;
|
|
362
367
|
},
|
|
363
368
|
get children() {
|
|
364
|
-
return d(
|
|
369
|
+
return d(Ae, {
|
|
365
370
|
state: u
|
|
366
371
|
});
|
|
367
372
|
}
|
|
368
373
|
})];
|
|
369
374
|
}
|
|
370
|
-
function
|
|
375
|
+
function Ae(e) {
|
|
371
376
|
const s = () => {
|
|
372
|
-
const n =
|
|
377
|
+
const n = e.state();
|
|
373
378
|
return n ? `translate3d(${n.clientX + 14}px, ${n.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
|
|
374
|
-
}, a = () =>
|
|
375
|
-
return d(
|
|
379
|
+
}, a = () => e.state()?.overCanvas ?? !1, u = () => e.state()?.label ?? "", o = () => e.state()?.icon;
|
|
380
|
+
return d(de, {
|
|
376
381
|
get children() {
|
|
377
|
-
var n =
|
|
378
|
-
return h(v, d(
|
|
382
|
+
var n = ye(), w = n.firstChild, k = w.nextSibling, v = k.firstChild, g = v.nextSibling, f = g.firstChild, C = f.nextSibling, E = C.firstChild;
|
|
383
|
+
return h(v, d(V, {
|
|
379
384
|
get when() {
|
|
380
385
|
return o();
|
|
381
386
|
},
|
|
382
387
|
children: (S) => {
|
|
383
|
-
const
|
|
384
|
-
return d(
|
|
388
|
+
const D = S();
|
|
389
|
+
return d(D, {
|
|
385
390
|
class: "w-4 h-4"
|
|
386
391
|
});
|
|
387
392
|
}
|
|
388
|
-
})), h(f, u), h(C, d(
|
|
393
|
+
})), h(f, u), h(C, d(_e, {
|
|
389
394
|
class: "w-3 h-3"
|
|
390
395
|
}), E), h(E, () => a() ? "Drop to create" : "Drag onto canvas"), A((S) => {
|
|
391
|
-
var
|
|
392
|
-
return
|
|
396
|
+
var D = !!a(), p = s();
|
|
397
|
+
return D !== S.e && n.classList.toggle("is-over-canvas", S.e = D), p !== S.t && ue(n, "transform", S.t = p), S;
|
|
393
398
|
}, {
|
|
394
399
|
e: void 0,
|
|
395
400
|
t: void 0
|
|
@@ -397,7 +402,7 @@ function Re(t) {
|
|
|
397
402
|
}
|
|
398
403
|
});
|
|
399
404
|
}
|
|
400
|
-
|
|
405
|
+
ve(["pointerdown", "click"]);
|
|
401
406
|
export {
|
|
402
|
-
|
|
407
|
+
Ne as WorkbenchDock
|
|
403
408
|
};
|