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