@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.
@@ -1,64 +1,63 @@
1
- import { insert as _, createComponent as g, effect as P, setAttribute as T, memo as de, template as p, Portal as ue, setStyleProperty as ge, use as ve, delegateEvents as fe } from "solid-js/web";
2
- import { createSignal as B, onCleanup as q, createEffect as z, 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 { LayoutDashboard as me, Layers as Z, Region as he, TextTool as ke, MessageSquare as be, Plus as _e } from "../icons/index.js";
6
- import { startHotInteraction as we } from "../../utils/hotInteraction.js";
7
- import { startPointerSession as Ee } from "../ui/pointerSession.js";
8
- import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as ee, createWorkbenchEdgeAutoPanController as Ce, frameFromElement as Se } from "./workbenchEdgeAutoPan.js";
9
- var Oe = /* @__PURE__ */ p("<button type=button class=workbench-dock__item>"), De = /* @__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");
10
- const J = 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 = [{
11
12
  mode: "work",
12
13
  label: "Work Mode",
13
14
  description: "Operate windows and sticky notes",
14
- icon: me
15
+ icon: Ee
15
16
  }, {
16
17
  mode: "background",
17
18
  label: "Composition Mode",
18
19
  description: "Arrange regions and canvas text",
19
- icon: Z
20
- }], $e = [{
20
+ icon: Ce
21
+ }], Pe = [{
21
22
  tool: "sticky-note",
22
23
  label: "Sticky",
23
- icon: be
24
- }], Ie = [{
24
+ icon: Oe
25
+ }], Te = [{
25
26
  tool: "background-region",
26
27
  label: "Region",
27
- icon: he
28
+ icon: Se
28
29
  }, {
29
30
  tool: "text",
30
31
  label: "Text",
31
- icon: ke
32
+ icon: De
32
33
  }];
33
- function te() {
34
- const e = document.querySelector(ee);
35
- return e instanceof HTMLElement ? e.getBoundingClientRect() : null;
34
+ function Fe() {
35
+ const e = document.querySelector(ne);
36
+ return e instanceof HTMLElement ? oe(e) : null;
36
37
  }
37
- function N(e, s, l) {
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 Pe(e, s) {
41
- const l = te();
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 Te(e, s, l, d) {
45
- const n = te();
46
- if (!n) return !1;
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 o = l - e, w = d - s;
48
+ const i = d - s, _ = o - l;
50
49
  let f = 0, m = 1;
51
- const u = (h, C) => {
52
- if (h === 0) return C >= 0;
53
- const E = C / h;
54
- return h < 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);
55
54
  };
56
- 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);
57
56
  }
58
- function Q(e, s) {
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(ye) !== null;
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 = (n) => {
81
- 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);
82
81
  };
83
82
  return (() => {
84
- var n = Oe();
85
- 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, {
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 o = e.icon;
99
- return g(o, {
97
+ const i = e.icon;
98
+ return g(i, {
100
99
  class: "workbench-dock__icon"
101
100
  });
102
101
  })();
103
102
  }
104
- }), null), _(n, g(R.span, {
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((o) => {
122
- var w = !!e.active, f = !!(e.filterable && !e.visible), m = !!l(), u = !!e.isDragging, h = e.filterable ? `${e.label} — click to solo, drag to canvas to create` : `${e.label} — drag to canvas to create`, C = e.active;
123
- 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), h !== o.i && T(n, "aria-label", o.i = h), 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;
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
- }), n;
130
+ }), o;
132
131
  })();
133
132
  }
134
- function Ne(e) {
135
- const [s, l] = B(null), [d, n] = B(null), [o, w] = B(!1);
136
- let f, m, u, h = null;
137
- q(() => {
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
- }), z(() => {
141
+ }), Q(() => {
143
142
  e.onDragPreviewChange?.(d()?.preview ?? null);
144
- }), z(() => {
145
- if (!o() || typeof window > "u") return;
143
+ }), Q(() => {
144
+ if (!i() || typeof window > "u") return;
146
145
  const t = (c) => {
147
- f && c.target instanceof Node && f.contains(c.target) || w(!1);
148
- }, i = (c) => {
149
- c.key === "Escape" && w(!1);
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", i, !0), q(() => {
152
- 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);
153
152
  });
154
153
  });
155
- const C = (t) => {
156
- const i = s();
157
- return i === null ? 0 : i === t ? -1 : i === t + 1 ? -2 : i === t - 1 ? 1 : 0;
158
- }, E = () => {
159
- u?.stop(), u = void 0, h = null;
160
- }, Y = () => {
161
- !e.viewport || !e.onViewportCommit || (h = e.viewport, u?.stop(), u = Ce({
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(ee);
164
- return t instanceof HTMLElement ? Se(t) : null;
162
+ const t = document.querySelector(ne);
163
+ return t instanceof HTMLElement ? oe(t) : null;
165
164
  },
166
- readViewport: () => h ?? e.viewport ?? null,
165
+ readViewport: () => k ?? e.viewport ?? null,
167
166
  commitViewport: (t) => {
168
- h = t, e.onViewportCommit?.(t);
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 && !Q(t.clientX, t.clientY));
172
+ return !!(t?.moved && t.hasEnteredCanvas && !te(t.clientX, t.clientY));
174
173
  }
175
174
  }));
176
- }, ne = (t) => {
177
- const i = d();
178
- if (!i) return;
179
- const c = !i.moved;
180
- if (i.stopInteraction(), E(), n(null), m = void 0, c) {
181
- O() !== "background" && e.onSoloFilter(String(i.id), G());
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 && i.overCanvas && (i.kind === "widget" ? e.onCreateAt?.(i.id, i.clientX, i.clientY) : e.onCreateToolAt?.(i.id, i.clientX, i.clientY));
185
- }, 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) => {
186
191
  t.preventDefault(), m?.stop({
187
192
  reason: "manual_stop",
188
193
  commit: !1
189
- }), Y(), n({
190
- kind: i,
194
+ }), R();
195
+ const h = Fe();
196
+ o({
197
+ kind: n,
191
198
  id: c,
192
- label: y,
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: we({
211
+ stopInteraction: be({
204
212
  kind: "drag",
205
213
  cursor: "grabbing"
206
214
  })
207
215
  });
208
- const b = (a) => {
209
- let k = !1;
210
- n((v) => {
216
+ const E = (a) => {
217
+ let y = !1;
218
+ o((v) => {
211
219
  if (!v || v.pointerId !== a.pointerId) return v;
212
- const H = a.clientX - v.startClientX, $ = a.clientY - v.startClientY, D = v.moved || Math.abs(H) > J || Math.abs($) > J, S = Q(a.clientX, a.clientY), L = D && Pe(a.clientX, a.clientY) && !S, I = D && !S && Te(v.clientX, v.clientY, a.clientX, a.clientY), U = v.hasEnteredCanvas || L || I;
213
- return k = D && U && !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, {
214
222
  ...v,
215
223
  clientX: a.clientX,
216
224
  clientY: a.clientY,
217
- moved: D,
218
- overCanvas: L,
219
- hasEnteredCanvas: U,
220
- preview: L ? {
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
- }), k && u?.updatePointer(a.clientX, a.clientY);
238
+ }), y && u?.updatePointer(a.clientX, a.clientY);
229
239
  };
230
- m = Ee({
240
+ m = _e({
231
241
  pointerEvent: t,
232
242
  captureEl: t.currentTarget,
233
- onMove: b,
243
+ onMove: E,
234
244
  onEnd: ({
235
245
  commit: a
236
- }) => ne(a)
246
+ }) => ie(a)
237
247
  });
238
- }, ie = () => d()?.kind === "widget" ? d().id : null, re = () => d()?.kind === "tool" ? d().id : null, O = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", ae = F(() => W.find((t) => t.mode === O()) ?? W[0]), V = F(() => O() === "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) => ({
239
249
  id: t.tool,
240
250
  kind: "tool",
241
251
  label: t.label,
242
252
  icon: t.icon
243
- })) : [...$e.map((t) => ({
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
- }))]), G = F(() => V().map((t) => String(t.id))), x = () => O() !== "background", le = (t) => !x() || e.filters[t] !== !1, ce = (t) => {
254
- 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())
255
265
  return !1;
256
- const i = G();
257
- return i.length > 1 && i.every((c) => e.filters[c] !== !1 == (c === t));
258
- }, M = () => s() === 0, se = () => ({
259
- scale: M() || o() ? 1.26 : 1,
260
- 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,
261
271
  x: s() === 1 ? -5 : 0
262
272
  });
263
273
  return [(() => {
264
- var t = Le(), i = t.firstChild, c = i.firstChild;
265
- i.nextSibling, t.addEventListener("pointerleave", () => l(null));
266
- var y = f;
267
- return typeof y == "function" ? ve(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, {
268
278
  class: "workbench-dock__tile",
269
279
  get animate() {
270
- return se();
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 g(Z, {
280
- class: "workbench-dock__icon"
281
- });
289
+ return (() => {
290
+ const r = G().icon;
291
+ return g(r, {
292
+ class: "workbench-dock__icon"
293
+ });
294
+ })();
282
295
  }
283
- }), null), _(c, g(R.span, {
296
+ }), null), b(c, g(F.span, {
284
297
  class: "workbench-dock__tooltip",
285
298
  get animate() {
286
299
  return {
287
- opacity: M() && !o() ? 1 : 0,
288
- y: M() && !o() ? -6 : 0
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 ae().label;
311
+ return G().label;
299
312
  }
300
- }), null), _(i, g(K, {
313
+ }), null), b(n, g(N, {
301
314
  get when() {
302
- return o();
315
+ return i();
303
316
  },
304
317
  get children() {
305
- var r = De();
306
- return _(r, g(j, {
307
- each: W,
308
- children: (b) => {
309
- 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;
310
323
  return (() => {
311
- var k = Me(), v = k.firstChild, H = v.nextSibling, $ = H.firstChild, D = $.nextSibling;
312
- return k.$$click = () => {
313
- e.onSelectMode?.(b.mode), w(!1);
314
- }, _(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, {
315
328
  class: "workbench-dock__mode-icon"
316
- })), _($, () => b.label), _(D, () => b.description), P((S) => {
317
- var L = O() === b.mode, I = O() === b.mode;
318
- return L !== S.e && k.classList.toggle("is-active", S.e = L), I !== S.t && T(k, "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;
319
332
  }, {
320
333
  e: void 0,
321
334
  t: void 0
322
- }), k;
335
+ }), a;
323
336
  })();
324
337
  }
325
338
  })), r;
326
339
  }
327
- }), null), _(t, g(j, {
340
+ }), null), b(t, g(Z, {
328
341
  get each() {
329
- return V();
342
+ return U();
330
343
  },
331
- children: (r, b) => {
332
- const a = () => b() + 1;
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 ce(String(r.id));
360
+ return se(String(r.id));
348
361
  },
349
362
  get visible() {
350
- return le(String(r.id));
363
+ return ce(String(r.id));
351
364
  },
352
365
  get filterable() {
353
- return x();
366
+ return Y();
354
367
  },
355
368
  get hoverOffset() {
356
- return C(a());
369
+ return S(E());
357
370
  },
358
371
  get isDragging() {
359
- return de(() => r.kind === "widget")() ? ie() === r.id : re() === r.id;
372
+ return ge(() => r.kind === "widget")() ? ae() === r.id : le() === r.id;
360
373
  },
361
- onEnter: () => l(a()),
362
- onLeave: () => l((k) => k === a() ? null : k),
363
- onDragBegin: oe
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 b = O() === "background", a = !!(M() || o()), k = o();
368
- return b !== r.e && c.classList.toggle("is-active", r.e = b), a !== r.t && c.classList.toggle("is-hovered", r.t = a), k !== r.a && T(c, "aria-expanded", r.a = k), 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;
369
382
  }, {
370
383
  e: void 0,
371
384
  t: void 0,
372
385
  a: void 0
373
386
  }), t;
374
- })(), g(K, {
387
+ })(), g(N, {
375
388
  get when() {
376
- return !!(d()?.moved && !d()?.overCanvas);
389
+ return !!(d()?.moved && !d()?.preview);
377
390
  },
378
391
  get children() {
379
- return g(Ae, {
392
+ return g(Ye, {
380
393
  state: d
381
394
  });
382
395
  }
383
396
  })];
384
397
  }
385
- function Ae(e) {
398
+ function Ye(e) {
386
399
  const s = () => {
387
- const n = e.state();
388
- 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)";
389
402
  }, l = () => e.state()?.label ?? "", d = () => e.state()?.icon;
390
- return g(ue, {
403
+ return g(ve, {
391
404
  get children() {
392
- var n = pe(), o = n.firstChild, w = o.nextSibling, f = w.firstChild, m = f.nextSibling, u = m.firstChild, h = u.nextSibling, C = h.firstChild;
393
- 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, {
394
407
  get when() {
395
408
  return d();
396
409
  },
397
- children: (E) => {
398
- const Y = E();
399
- return g(Y, {
410
+ children: (w) => {
411
+ const R = w();
412
+ return g(R, {
400
413
  class: "w-4 h-4"
401
414
  });
402
415
  }
403
- })), _(u, l), _(h, g(_e, {
416
+ })), b(u, l), b(k, g(he, {
404
417
  class: "w-3 h-3"
405
- }), C), P((E) => ge(n, "transform", s())), n;
418
+ }), S), P((w) => fe(o, "transform", s())), o;
406
419
  }
407
420
  });
408
421
  }
409
- fe(["pointerdown", "click"]);
422
+ ke(["pointerdown", "click"]);
410
423
  export {
411
- Ne as WorkbenchDock
424
+ qe as WorkbenchDock
412
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
  };