@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.
@@ -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 _, createComponent as g, effect as P, setAttribute as T, memo as se, template as p, Portal as de, setStyleProperty as ue, use as ge, delegateEvents as ve } from "solid-js/web";
2
- import { createSignal as B, onCleanup as z, createEffect as j, createMemo as F, Show as K, For as J } from "solid-js";
3
- import { Motion as R } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.11/node_modules/solid-motionone/dist/index.js";
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 fe } from "../icons/index.js";
6
- import { startHotInteraction as me } from "../../utils/hotInteraction.js";
7
- import { startPointerSession as ke } from "../ui/pointerSession.js";
8
- import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as ee, createWorkbenchEdgeAutoPanController as he, frameFromElement as be } from "./workbenchEdgeAutoPan.js";
9
- import { DockLayoutDashboard as _e, DockLayers as we, DockRegion as Ee, DockText as Ce, DockMessageSquare as Se } from "../icons/DockIcons.js";
10
- var De = /* @__PURE__ */ p("<button type=button class=workbench-dock__item>"), Oe = /* @__PURE__ */ p('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), Le = /* @__PURE__ */ p('<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__ */ p("<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>"), pe = /* @__PURE__ */ p("<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 Q = 5, ye = ".workbench-dock", W = [{
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: _e
15
+ icon: Ee
16
16
  }, {
17
17
  mode: "background",
18
18
  label: "Composition Mode",
19
19
  description: "Arrange regions and canvas text",
20
- icon: we
21
- }], $e = [{
20
+ icon: Ce
21
+ }], Pe = [{
22
22
  tool: "sticky-note",
23
23
  label: "Sticky",
24
- icon: Se
25
- }], Ie = [{
24
+ icon: Oe
25
+ }], Te = [{
26
26
  tool: "background-region",
27
27
  label: "Region",
28
- icon: Ee
28
+ icon: Se
29
29
  }, {
30
30
  tool: "text",
31
31
  label: "Text",
32
- icon: Ce
32
+ icon: De
33
33
  }];
34
- function te() {
35
- const e = document.querySelector(ee);
36
- return e instanceof HTMLElement ? e.getBoundingClientRect() : null;
34
+ function Fe() {
35
+ const e = document.querySelector(ne);
36
+ return e instanceof HTMLElement ? oe(e) : null;
37
37
  }
38
- function N(e, s, l) {
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 Pe(e, s) {
42
- const l = te();
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 Te(e, s, l, d) {
46
- const n = te();
47
- if (!n) return !1;
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 o = l - e, w = d - s;
48
+ const i = d - s, _ = o - l;
51
49
  let f = 0, m = 1;
52
- const u = (k, C) => {
53
- if (k === 0) return C >= 0;
54
- const E = C / k;
55
- return k < 0 ? E > m ? !1 : (E > f && (f = E), !0) : E < f ? !1 : (E < m && (m = E), !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(-o, e - n.left) && u(o, n.right - e) && u(-w, s - n.top) && u(w, n.bottom - s);
55
+ return u(-i, s - e.left) && u(i, e.right - s) && u(-_, l - e.top) && u(_, e.bottom - l);
58
56
  }
59
- function Z(e, s) {
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(ye) !== null;
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 = (n) => {
82
- n.button === 0 && e.onDragBegin(n, e.kind, e.id, e.label, e.icon);
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 n = De();
86
- return n.$$pointerdown = d, n.addEventListener("pointerleave", () => e.onLeave()), n.addEventListener("pointerenter", () => e.onEnter()), _(n, g(R.span, {
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 o = e.icon;
100
- return g(o, {
97
+ const i = e.icon;
98
+ return g(i, {
101
99
  class: "workbench-dock__icon"
102
100
  });
103
101
  })();
104
102
  }
105
- }), null), _(n, g(R.span, {
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((o) => {
123
- var w = !!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`, C = e.active;
124
- return w !== o.e && n.classList.toggle("is-active", o.e = w), f !== o.t && n.classList.toggle("is-filter-muted", o.t = f), m !== o.a && n.classList.toggle("is-hovered", o.a = m), u !== o.o && n.classList.toggle("is-source-dragging", o.o = u), k !== o.i && T(n, "aria-label", o.i = k), C !== o.n && T(n, "aria-pressed", o.n = C), o;
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
- }), n;
130
+ }), o;
133
131
  })();
134
132
  }
135
- function Ve(e) {
136
- const [s, l] = B(null), [d, n] = B(null), [o, w] = B(!1);
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
- z(() => {
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
- }), j(() => {
141
+ }), Q(() => {
144
142
  e.onDragPreviewChange?.(d()?.preview ?? null);
145
- }), j(() => {
146
- if (!o() || typeof window > "u") return;
143
+ }), Q(() => {
144
+ if (!i() || typeof window > "u") return;
147
145
  const t = (c) => {
148
- f && c.target instanceof Node && f.contains(c.target) || w(!1);
149
- }, i = (c) => {
150
- c.key === "Escape" && w(!1);
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", i, !0), z(() => {
153
- window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown", i, !0);
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 C = (t) => {
157
- const i = s();
158
- return i === null ? 0 : i === t ? -1 : i === t + 1 ? -2 : i === t - 1 ? 1 : 0;
159
- }, E = () => {
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
- }, Y = () => {
162
- !e.viewport || !e.onViewportCommit || (k = e.viewport, u?.stop(), u = he({
159
+ }, R = () => {
160
+ !e.viewport || !e.onViewportCommit || (k = e.viewport, u?.stop(), u = we({
163
161
  readFrame: () => {
164
- const t = document.querySelector(ee);
165
- return t instanceof HTMLElement ? be(t) : null;
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 && !Z(t.clientX, t.clientY));
172
+ return !!(t?.moved && t.hasEnteredCanvas && !te(t.clientX, t.clientY));
175
173
  }
176
174
  }));
177
- }, ne = (t) => {
178
- const i = d();
179
- if (!i) return;
180
- const c = !i.moved;
181
- if (i.stopInteraction(), E(), n(null), m = void 0, c) {
182
- D() !== "background" && e.onSoloFilter(String(i.id), U());
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 && i.overCanvas && (i.kind === "widget" ? e.onCreateAt?.(i.id, i.clientX, i.clientY) : e.onCreateToolAt?.(i.id, i.clientX, i.clientY));
186
- }, oe = (t, i, c, y, r) => {
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
- }), Y(), n({
191
- kind: i,
194
+ }), R();
195
+ const h = Fe();
196
+ o({
197
+ kind: n,
192
198
  id: c,
193
- label: y,
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: me({
211
+ stopInteraction: be({
205
212
  kind: "drag",
206
213
  cursor: "grabbing"
207
214
  })
208
215
  });
209
- const b = (a) => {
210
- let h = !1;
211
- n((v) => {
216
+ const E = (a) => {
217
+ let y = !1;
218
+ o((v) => {
212
219
  if (!v || v.pointerId !== a.pointerId) return v;
213
- const H = a.clientX - v.startClientX, $ = a.clientY - v.startClientY, O = v.moved || Math.abs(H) > Q || Math.abs($) > Q, S = Z(a.clientX, a.clientY), L = O && Pe(a.clientX, a.clientY) && !S, I = O && !S && Te(v.clientX, v.clientY, a.clientX, a.clientY), q = v.hasEnteredCanvas || L || I;
214
- return h = O && q && !S, {
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: O,
219
- overCanvas: L,
220
- hasEnteredCanvas: q,
221
- preview: L ? {
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
- }), h && u?.updatePointer(a.clientX, a.clientY);
238
+ }), y && u?.updatePointer(a.clientX, a.clientY);
230
239
  };
231
- m = ke({
240
+ m = _e({
232
241
  pointerEvent: t,
233
242
  captureEl: t.currentTarget,
234
- onMove: b,
243
+ onMove: E,
235
244
  onEnd: ({
236
245
  commit: a
237
- }) => ne(a)
246
+ }) => ie(a)
238
247
  });
239
- }, ie = () => d()?.kind === "widget" ? d().id : null, re = () => d()?.kind === "tool" ? d().id : null, D = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", V = F(() => W.find((t) => t.mode === D()) ?? W[0]), G = F(() => D() === "background" ? Ie.map((t) => ({
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
- })) : [...$e.map((t) => ({
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
- }))]), U = F(() => G().map((t) => String(t.id))), x = () => D() !== "background", ae = (t) => !x() || e.filters[t] !== !1, le = (t) => {
255
- if (!x())
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 i = U();
258
- return i.length > 1 && i.every((c) => e.filters[c] !== !1 == (c === t));
259
- }, M = () => s() === 0, ce = () => ({
260
- scale: M() || o() ? 1.26 : 1,
261
- y: M() || o() ? -6 : 0,
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 = Le(), i = t.firstChild, c = i.firstChild;
266
- i.nextSibling, t.addEventListener("pointerleave", () => l(null));
267
- var y = f;
268
- return typeof y == "function" ? ge(y, t) : f = t, c.$$click = () => w((r) => !r), c.addEventListener("pointerleave", () => l((r) => r === 0 ? null : r)), c.addEventListener("pointerenter", () => l(0)), _(c, g(R.span, {
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 ce();
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 = V().icon;
290
+ const r = G().icon;
282
291
  return g(r, {
283
292
  class: "workbench-dock__icon"
284
293
  });
285
294
  })();
286
295
  }
287
- }), null), _(c, g(R.span, {
296
+ }), null), b(c, g(F.span, {
288
297
  class: "workbench-dock__tooltip",
289
298
  get animate() {
290
299
  return {
291
- opacity: M() && !o() ? 1 : 0,
292
- y: M() && !o() ? -6 : 0
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 V().label;
311
+ return G().label;
303
312
  }
304
- }), null), _(i, g(K, {
313
+ }), null), b(n, g(N, {
305
314
  get when() {
306
- return o();
315
+ return i();
307
316
  },
308
317
  get children() {
309
- var r = Oe();
310
- return _(r, g(J, {
311
- each: W,
312
- children: (b) => {
313
- const a = b.icon;
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 h = Me(), v = h.firstChild, H = v.nextSibling, $ = H.firstChild, O = $.nextSibling;
316
- return h.$$click = () => {
317
- e.onSelectMode?.(b.mode), w(!1);
318
- }, _(v, g(a, {
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
- })), _($, () => b.label), _(O, () => b.description), P((S) => {
321
- var L = D() === b.mode, I = D() === b.mode;
322
- return L !== S.e && h.classList.toggle("is-active", S.e = L), I !== S.t && T(h, "aria-checked", S.t = I), S;
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
- }), h;
335
+ }), a;
327
336
  })();
328
337
  }
329
338
  })), r;
330
339
  }
331
- }), null), _(t, g(J, {
340
+ }), null), b(t, g(Z, {
332
341
  get each() {
333
- return G();
342
+ return U();
334
343
  },
335
- children: (r, b) => {
336
- const a = () => b() + 1;
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 le(String(r.id));
360
+ return se(String(r.id));
352
361
  },
353
362
  get visible() {
354
- return ae(String(r.id));
363
+ return ce(String(r.id));
355
364
  },
356
365
  get filterable() {
357
- return x();
366
+ return Y();
358
367
  },
359
368
  get hoverOffset() {
360
- return C(a());
369
+ return S(E());
361
370
  },
362
371
  get isDragging() {
363
- return se(() => r.kind === "widget")() ? ie() === r.id : re() === r.id;
372
+ return ge(() => r.kind === "widget")() ? ae() === r.id : le() === r.id;
364
373
  },
365
- onEnter: () => l(a()),
366
- onLeave: () => l((h) => h === a() ? null : h),
367
- onDragBegin: oe
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 b = D() === "background", a = !!(M() || o()), h = o();
372
- return b !== r.e && c.classList.toggle("is-active", r.e = b), a !== r.t && c.classList.toggle("is-hovered", r.t = a), h !== r.a && T(c, "aria-expanded", r.a = h), r;
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(K, {
387
+ })(), g(N, {
379
388
  get when() {
380
- return !!(d()?.moved && !d()?.overCanvas);
389
+ return !!(d()?.moved && !d()?.preview);
381
390
  },
382
391
  get children() {
383
- return g(Ae, {
392
+ return g(Ye, {
384
393
  state: d
385
394
  });
386
395
  }
387
396
  })];
388
397
  }
389
- function Ae(e) {
398
+ function Ye(e) {
390
399
  const s = () => {
391
- const n = e.state();
392
- return n ? `translate3d(${n.clientX + 14}px, ${n.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
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(de, {
403
+ return g(ve, {
395
404
  get children() {
396
- var n = pe(), o = n.firstChild, w = o.nextSibling, f = w.firstChild, m = f.nextSibling, u = m.firstChild, k = u.nextSibling, C = k.firstChild;
397
- return _(f, g(K, {
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: (E) => {
402
- const Y = E();
403
- return g(Y, {
410
+ children: (w) => {
411
+ const R = w();
412
+ return g(R, {
404
413
  class: "w-4 h-4"
405
414
  });
406
415
  }
407
- })), _(u, l), _(k, g(fe, {
416
+ })), b(u, l), b(k, g(he, {
408
417
  class: "w-3 h-3"
409
- }), C), P((E) => ue(n, "transform", s())), n;
418
+ }), S), P((w) => fe(o, "transform", s())), o;
410
419
  }
411
420
  });
412
421
  }
413
- ve(["pointerdown", "click"]);
422
+ ke(["pointerdown", "click"]);
414
423
  export {
415
- Ve as WorkbenchDock
424
+ qe as WorkbenchDock
416
425
  };
@@ -1,35 +1,35 @@
1
- import { createComponent as m, insert as x, effect as u, setStyleProperty as o, template as k } from "solid-js/web";
2
- import { Show as y } from "solid-js";
3
- var b = /* @__PURE__ */ k("<div class=workbench-placement-preview aria-hidden=true><div class=workbench-placement-preview__crosshair></div><div class=workbench-placement-preview__label>");
4
- function P(r) {
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 e = r.preview;
7
- if (!e) return null;
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 + e.x * i,
12
- y: r.viewport.y + e.y * i,
13
- width: e.width * i,
14
- height: e.height * i
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: e.x,
19
- y: e.y,
20
- width: e.width,
21
- height: e.height
18
+ x: t.x,
19
+ y: t.y,
20
+ width: t.width,
21
+ height: t.height
22
22
  };
23
23
  };
24
- return m(y, {
24
+ return x(b, {
25
25
  get when() {
26
26
  return r.preview;
27
27
  },
28
- children: (e) => (() => {
29
- var i = b(), g = i.firstChild, w = g.nextSibling;
30
- return x(w, () => e().label), u((t) => {
31
- var s = e().kind === "widget", l = e().kind === "sticky-note", a = e().kind === "text", c = e().kind === "background-region", d = `translate3d(${n()?.x ?? 0}px, ${n()?.y ?? 0}px, 0)`, v = `${n()?.width ?? 0}px`, h = `${n()?.height ?? 0}px`;
32
- return s !== t.e && i.classList.toggle("is-widget", t.e = s), l !== t.t && i.classList.toggle("is-sticky-note", t.t = l), a !== t.a && i.classList.toggle("is-text", t.a = a), c !== t.o && i.classList.toggle("is-background-region", t.o = c), d !== t.i && o(i, "transform", t.i = d), v !== t.n && o(i, "width", t.n = v), h !== t.s && o(i, "height", t.s = h), t;
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
- P as WorkbenchPlacementPreview
47
+ S as WorkbenchPlacementPreview
47
48
  };