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