@floegence/floe-webapp-core 0.36.58 → 0.36.60

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