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