@floegence/floe-webapp-core 0.101.30 → 0.101.33

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,75 +1,75 @@
1
- import { insert as w, createComponent as g, effect as H, setAttribute as T, memo as I, Dynamic as Se, className as Ve, template as Y, use as $e, setStyleProperty as se, Portal as Ue, delegateEvents as qe } from "solid-js/web";
2
- import { createSignal as oe, onCleanup as j, createEffect as q, createMemo as A, Show as X, For as xe, onMount as je } from "solid-js";
1
+ import { insert as h, createComponent as g, effect as H, setAttribute as T, memo as I, Dynamic as $e, className as Ve, template as Y, use as Le, setStyleProperty as se, Portal as Ue, delegateEvents as qe } from "solid-js/web";
2
+ import { createSignal as oe, onCleanup as j, createEffect as q, createMemo as L, Show as X, For as Pe, untrack as je, onMount as Je } from "solid-js";
3
3
  import { Motion as ie } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
4
- import { createBarLayoutMotion as Je, keyboardBarOrder as Qe, barDropPosition as Ze } from "../layout/barReorder.js";
4
+ import { createBarLayoutMotion as Qe, keyboardBarOrder as Ze, barDropPosition as pe } from "../layout/barReorder.js";
5
5
  import { easing as re, duration as ae } from "../../utils/animations.js";
6
- import { Plus as pe } from "../icons/index.js";
7
- import { startHotInteraction as et } from "../../utils/hotInteraction.js";
8
- import { startPointerSession as tt } from "../ui/pointerSession.js";
9
- import { clientToCanvasWorld as nt } from "../ui/canvasGeometry.js";
10
- import { isBarItemContextMenuKey as ot, keyboardBarItemContextMenuRequest as it } from "../layout/barItemContextMenu.js";
11
- import { createWorkbenchWidgetFrame as rt } from "./workbenchHelpers.js";
12
- import { getWidgetEntry as at } from "./widgets/widgetRegistry.js";
13
- import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Le, frameFromElement as Oe, createWorkbenchEdgeAutoPanController as ct } from "./workbenchEdgeAutoPan.js";
14
- import { DockLayoutDashboard as lt, DockLayers as dt, DockRegion as st, DockText as ut, DockMessageSquare as vt } from "../icons/DockIcons.js";
15
- var gt = /* @__PURE__ */ Y("<span aria-hidden=true style=position:absolute;top:8px;bottom:8px;width:2px;background:var(--ring);border-radius:2px>"), ft = /* @__PURE__ */ Y("<button type=button class=workbench-dock__item style=touch-action:none>"), kt = /* @__PURE__ */ Y("<span class=workbench-dock__external-placeholder aria-hidden=true>"), mt = /* @__PURE__ */ Y('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), wt = /* @__PURE__ */ Y('<div 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>'), ht = /* @__PURE__ */ Y("<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>"), bt = /* @__PURE__ */ Y("<span class=workbench-dock__divider aria-hidden=true>"), _t = /* @__PURE__ */ Y("<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>");
16
- const Pe = 5, Et = 1e3, Ct = ".workbench-dock", yt = [{
6
+ import { Plus as et } from "../icons/index.js";
7
+ import { startHotInteraction as tt } from "../../utils/hotInteraction.js";
8
+ import { startPointerSession as nt } from "../ui/pointerSession.js";
9
+ import { clientToCanvasWorld as ot } from "../ui/canvasGeometry.js";
10
+ import { isBarItemContextMenuKey as it, keyboardBarItemContextMenuRequest as rt } from "../layout/barItemContextMenu.js";
11
+ import { createWorkbenchWidgetFrame as at } from "./workbenchHelpers.js";
12
+ import { getWidgetEntry as ct } from "./widgets/widgetRegistry.js";
13
+ import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Oe, frameFromElement as Ae, createWorkbenchEdgeAutoPanController as lt } from "./workbenchEdgeAutoPan.js";
14
+ import { DockLayoutDashboard as dt, DockLayers as st, DockRegion as ut, DockText as vt, DockMessageSquare as gt } from "../icons/DockIcons.js";
15
+ var ft = /* @__PURE__ */ Y("<span aria-hidden=true style=position:absolute;top:8px;bottom:8px;width:2px;background:var(--ring);border-radius:2px>"), kt = /* @__PURE__ */ Y("<button type=button class=workbench-dock__item style=touch-action:none>"), mt = /* @__PURE__ */ Y("<span class=workbench-dock__external-placeholder aria-hidden=true>"), wt = /* @__PURE__ */ Y('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), ht = /* @__PURE__ */ Y('<div 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>'), bt = /* @__PURE__ */ Y("<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>"), _t = /* @__PURE__ */ Y("<span class=workbench-dock__divider aria-hidden=true>"), Et = /* @__PURE__ */ Y("<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>");
16
+ const Me = 5, Ct = 1e3, yt = ".workbench-dock", Dt = [{
17
17
  mode: "work",
18
18
  label: "Work Mode",
19
19
  description: "Operate windows and sticky notes",
20
- icon: lt
20
+ icon: dt
21
21
  }, {
22
22
  mode: "background",
23
23
  label: "Composition Mode",
24
24
  description: "Arrange regions and canvas text",
25
- icon: dt
26
- }], Dt = [{
25
+ icon: st
26
+ }], xt = [{
27
27
  tool: "sticky-note",
28
28
  label: "Sticky",
29
- icon: vt
30
- }], xt = [{
29
+ icon: gt
30
+ }], Pt = [{
31
31
  tool: "background-region",
32
32
  label: "Region",
33
- icon: st
33
+ icon: ut
34
34
  }, {
35
35
  tool: "text",
36
36
  label: "Text",
37
- icon: ut
37
+ icon: vt
38
38
  }];
39
- function Pt(e) {
40
- const s = e?.closest(".workbench-surface")?.querySelector(Le);
41
- return s instanceof HTMLElement ? Oe(s) : null;
39
+ function Mt(e) {
40
+ const s = e?.closest(".workbench-surface")?.querySelector(Oe);
41
+ return s instanceof HTMLElement ? Ae(s) : null;
42
42
  }
43
43
  function ue(e, m, s) {
44
44
  return e >= s.left && e <= s.right && m >= s.top && m <= s.bottom;
45
45
  }
46
- function Mt(e, m, s) {
46
+ function It(e, m, s) {
47
47
  return s ? ue(e, m, s) : !1;
48
48
  }
49
- function Me(e, m, s) {
49
+ function Ie(e, m, s) {
50
50
  return Math.min(s, Math.max(m, e));
51
51
  }
52
- function It(e, m, s, u, _) {
52
+ function St(e, m, s, u, _) {
53
53
  if (!e) return !1;
54
54
  if (ue(m, s, e) || ue(u, _, e))
55
55
  return !0;
56
56
  const C = u - m, S = _ - s;
57
57
  let $ = 0, D = 1;
58
- const i = (h, r) => {
59
- if (h === 0) return r >= 0;
60
- const l = r / h;
61
- return h < 0 ? l > D ? !1 : (l > $ && ($ = l), !0) : l < $ ? !1 : (l < D && (D = l), !0);
58
+ const i = (b, r) => {
59
+ if (b === 0) return r >= 0;
60
+ const l = r / b;
61
+ return b < 0 ? l > D ? !1 : (l > $ && ($ = l), !0) : l < $ ? !1 : (l < D && (D = l), !0);
62
62
  };
63
63
  return i(-C, m - e.left) && i(C, e.right - m) && i(-S, s - e.top) && i(S, e.bottom - s);
64
64
  }
65
- function Ie(e, m, s) {
65
+ function Se(e, m, s) {
66
66
  if (!s || typeof document.elementFromPoint != "function") return !1;
67
67
  const u = document.elementFromPoint(e, m);
68
- return u instanceof Element && u.closest(Ct) === s;
68
+ return u instanceof Element && u.closest(yt) === s;
69
69
  }
70
- function St(e) {
70
+ function $t(e) {
71
71
  let m;
72
- je(() => e.buttonRef?.(m ?? null)), j(() => e.buttonRef?.(null));
72
+ Je(() => e.buttonRef?.(m ?? null)), j(() => e.buttonRef?.(null));
73
73
  const s = () => e.kind === "action" ? {
74
74
  scale: 1,
75
75
  y: 0,
@@ -100,7 +100,7 @@ function St(e) {
100
100
  source: "pointer"
101
101
  }));
102
102
  }, S = (i) => {
103
- e.onReorderKey?.(i), !(i.defaultPrevented || !e.onContextMenu || !ot(i)) && (i.preventDefault(), i.stopPropagation(), e.onContextMenu(it(i.currentTarget)));
103
+ e.onReorderKey?.(i), !(i.defaultPrevented || !e.onContextMenu || !it(i)) && (i.preventDefault(), i.stopPropagation(), e.onContextMenu(rt(i.currentTarget)));
104
104
  }, $ = (i) => {
105
105
  i.detail !== 0 && !(e.kind === "action" && !e.reorderable) || e.onKeyboardActivate(i.currentTarget);
106
106
  }, D = () => {
@@ -108,15 +108,15 @@ function St(e) {
108
108
  return i ? i.count === 0 ? `${e.label} +` : i.active && i.currentIndex !== null ? `${e.label} ${i.currentIndex + 1}/${i.count}` : i.count > 1 ? `${e.label} ${i.count}` : e.label : e.label;
109
109
  };
110
110
  return (() => {
111
- var i = ft();
111
+ var i = kt();
112
112
  i.$$keydown = S, i.$$contextmenu = C, i.$$click = $, i.$$pointerdown = _, i.addEventListener("pointerleave", () => e.onLeave()), i.addEventListener("pointerenter", () => e.onEnter()), i.addEventListener("dragstart", (r) => r.preventDefault());
113
- var h = m;
114
- return typeof h == "function" ? $e(h, i) : m = i, w(i, g(X, {
113
+ var b = m;
114
+ return typeof b == "function" ? Le(b, i) : m = i, h(i, g(X, {
115
115
  get when() {
116
116
  return e.dropEdge;
117
117
  },
118
118
  get children() {
119
- var r = gt();
119
+ var r = ft();
120
120
  return H((l) => {
121
121
  var E = e.dropEdge === "before" ? "-3px" : void 0, P = e.dropEdge === "after" ? "-3px" : void 0;
122
122
  return E !== l.e && se(r, "left", l.e = E), P !== l.t && se(r, "right", l.t = P), l;
@@ -125,7 +125,7 @@ function St(e) {
125
125
  t: void 0
126
126
  }), r;
127
127
  }
128
- }), null), w(i, g(ie.span, {
128
+ }), null), h(i, g(ie.span, {
129
129
  class: "workbench-dock__tile",
130
130
  get animate() {
131
131
  return s();
@@ -137,14 +137,14 @@ function St(e) {
137
137
  };
138
138
  },
139
139
  get children() {
140
- return g(Se, {
140
+ return g($e, {
141
141
  get component() {
142
142
  return e.icon;
143
143
  },
144
144
  class: "workbench-dock__icon"
145
145
  });
146
146
  }
147
- }), null), w(i, g(ie.span, {
147
+ }), null), h(i, g(ie.span, {
148
148
  class: "workbench-dock__tooltip",
149
149
  get animate() {
150
150
  return {
@@ -181,9 +181,9 @@ function St(e) {
181
181
  }), i;
182
182
  })();
183
183
  }
184
- function Gt(e) {
184
+ function Vt(e) {
185
185
  const [m, s] = oe(null), [u, _] = oe(null), C = /* @__PURE__ */ new Map(), [S, $] = oe(), [D, i] = oe(!1);
186
- let h, r, l, E, P = null;
186
+ let b, r, l, E, P = null;
187
187
  const R = () => e.activationMode === "focus-cycle" ? "focus-cycle" : "solo-filter";
188
188
  j(() => {
189
189
  E?.stop(), r?.stop({
@@ -203,7 +203,7 @@ function Gt(e) {
203
203
  }), q(() => {
204
204
  if (!D() || typeof window > "u") return;
205
205
  const t = (o) => {
206
- h && o.target instanceof Node && h.contains(o.target) || i(!1);
206
+ b && o.target instanceof Node && b.contains(o.target) || i(!1);
207
207
  }, n = (o) => {
208
208
  o.key === "Escape" && i(!1);
209
209
  };
@@ -217,10 +217,10 @@ function Gt(e) {
217
217
  }, Q = () => {
218
218
  E?.stop(), E = void 0, P = null;
219
219
  }, Z = () => {
220
- !e.viewport || !e.onViewportCommit || (P = e.viewport, E?.stop(), E = ct({
220
+ !e.viewport || !e.onViewportCommit || (P = e.viewport, E?.stop(), E = lt({
221
221
  readFrame: () => {
222
- const n = h?.closest(".workbench-surface")?.querySelector(Le);
223
- return n instanceof HTMLElement ? Oe(n) : null;
222
+ const n = b?.closest(".workbench-surface")?.querySelector(Oe);
223
+ return n instanceof HTMLElement ? Ae(n) : null;
224
224
  },
225
225
  readViewport: () => P ?? e.viewport ?? null,
226
226
  commitViewport: (t) => {
@@ -229,7 +229,7 @@ function Gt(e) {
229
229
  onPanStart: () => e.onViewportInteractionStart?.("pan"),
230
230
  shouldPan: () => {
231
231
  const t = u();
232
- return !!(t?.moved && t.hasEnteredCanvas && !Ie(t.clientX, t.clientY, h));
232
+ return !!(t?.moved && t.hasEnteredCanvas && !Se(t.clientX, t.clientY, b));
233
233
  }
234
234
  }));
235
235
  }, B = (t, n, o, d) => {
@@ -256,7 +256,7 @@ function Gt(e) {
256
256
  e.onFocusCycleItem?.(c);
257
257
  return;
258
258
  }
259
- y() !== "background" && e.onSoloFilter(String(n), me());
259
+ y() !== "background" && e.onSoloFilter(String(n), we());
260
260
  }
261
261
  }, p = (t) => {
262
262
  const n = u();
@@ -281,7 +281,7 @@ function Gt(e) {
281
281
  return;
282
282
  }
283
283
  if (t && n.overCanvas && n.canvasPlacement) {
284
- const v = n.canvasFrame && d ? nt(n.canvasFrame, d, {
284
+ const v = n.canvasFrame && d ? ot(n.canvasFrame, d, {
285
285
  clientX: n.clientX,
286
286
  clientY: n.clientY
287
287
  }) : null, a = n.canvasFrame ? {
@@ -294,12 +294,12 @@ function Gt(e) {
294
294
  n.canvasPlacement.onDrop(n.clientX, n.clientY, a);
295
295
  }
296
296
  }
297
- }, W = (t, n, o, d, c, v, a, M, L = "before-components") => {
297
+ }, W = (t, n, o, d, c, v, a, M, O = "before-components") => {
298
298
  t.preventDefault(), r?.stop({
299
299
  reason: "manual_stop",
300
300
  commit: !1
301
301
  }), Z();
302
- const V = Pt(h);
302
+ const V = Mt(b);
303
303
  _({
304
304
  kind: n,
305
305
  id: o,
@@ -317,67 +317,67 @@ function Gt(e) {
317
317
  preview: null,
318
318
  canvasPlacement: a,
319
319
  dockDrop: M,
320
- dockPlacement: L,
321
- stopInteraction: et({
320
+ dockPlacement: O,
321
+ stopInteraction: tt({
322
322
  kind: "drag",
323
323
  cursor: "grabbing"
324
324
  }),
325
325
  trigger: v,
326
326
  overDock: !1
327
327
  });
328
- const b = (f) => {
328
+ const w = (f) => {
329
329
  let x = !1;
330
330
  _((k) => {
331
331
  if (!k || k.pointerId !== f.pointerId) return k;
332
- const ne = f.clientX - k.startClientX, Ke = f.clientY - k.startClientY, z = k.moved || Math.abs(ne) > Pe || Math.abs(Ke) > Pe;
332
+ const ne = f.clientX - k.startClientX, Ke = f.clientY - k.startClientY, z = k.moved || Math.abs(ne) > Me || Math.abs(Ke) > Me;
333
333
  if (k.kind === "external" && z && !k.moved) {
334
334
  let K;
335
335
  const U = () => {
336
- K !== void 0 && window.clearTimeout(K), k.trigger.removeEventListener("click", Ce, !0), window.removeEventListener("pointerdown", ye, !0), l?.clear === U && (l = void 0);
337
- }, Ce = (De) => {
338
- De.preventDefault(), De.stopImmediatePropagation(), U();
339
- }, ye = () => U(), Ge = () => {
340
- K !== void 0 && window.clearTimeout(K), K = window.setTimeout(U, Et);
336
+ K !== void 0 && window.clearTimeout(K), k.trigger.removeEventListener("click", ye, !0), window.removeEventListener("pointerdown", De, !0), l?.clear === U && (l = void 0);
337
+ }, ye = (xe) => {
338
+ xe.preventDefault(), xe.stopImmediatePropagation(), U();
339
+ }, De = () => U(), Ge = () => {
340
+ K !== void 0 && window.clearTimeout(K), K = window.setTimeout(U, Ct);
341
341
  };
342
- k.trigger.addEventListener("click", Ce, !0), window.addEventListener("pointerdown", ye, !0), l = {
342
+ k.trigger.addEventListener("click", ye, !0), window.addEventListener("pointerdown", De, !0), l = {
343
343
  clear: U,
344
344
  expire: Ge
345
345
  };
346
346
  }
347
- const N = Ie(f.clientX, f.clientY, h);
348
- $(z && N && k.kind !== "external" && e.customization?.onOrderChange ? Ze(F().map((K) => K.key), `${k.kind}:${k.id}`, C, "x", f.clientX) : void 0);
349
- const O = k.canvasFrame, be = z && Mt(f.clientX, f.clientY, O), _e = be && !N, Ne = z && !N && It(O, k.clientX, k.clientY, f.clientX, f.clientY), Ee = k.hasEnteredCanvas || be || Ne;
350
- x = z && Ee && !N;
351
- const He = O ? Me(f.clientX, O.left, O.right) : f.clientX, We = O ? Me(f.clientY, O.top, O.bottom) : f.clientY;
347
+ const N = Se(f.clientX, f.clientY, b);
348
+ $(z && N && k.kind !== "external" && e.customization?.onOrderChange ? pe(F().map((K) => K.key), `${k.kind}:${k.id}`, C, "x", f.clientX) : void 0);
349
+ const A = k.canvasFrame, _e = z && It(f.clientX, f.clientY, A), Ee = _e && !N, Ne = z && !N && St(A, k.clientX, k.clientY, f.clientX, f.clientY), Ce = k.hasEnteredCanvas || _e || Ne;
350
+ x = z && Ce && !N;
351
+ const He = A ? Ie(f.clientX, A.left, A.right) : f.clientX, We = A ? Ie(f.clientY, A.top, A.bottom) : f.clientY;
352
352
  return {
353
353
  ...k,
354
354
  clientX: f.clientX,
355
355
  clientY: f.clientY,
356
356
  moved: z,
357
357
  overDock: N,
358
- overCanvas: _e,
359
- hasEnteredCanvas: Ee,
360
- preview: z && (!N || !e.customization?.onOrderChange) && O && k.canvasPlacement?.preview ? {
358
+ overCanvas: Ee,
359
+ hasEnteredCanvas: Ce,
360
+ preview: z && (!N || !e.customization?.onOrderChange) && A && k.canvasPlacement?.preview ? {
361
361
  kind: k.canvasPlacement.preview.kind,
362
362
  id: k.canvasPlacement.preview.id,
363
363
  label: k.label,
364
364
  clientX: He,
365
365
  clientY: We,
366
- dropAllowed: _e,
367
- canvasFrame: O
366
+ dropAllowed: Ee,
367
+ canvasFrame: A
368
368
  } : null
369
369
  };
370
370
  }), x && E?.updatePointer(f.clientX, f.clientY);
371
371
  };
372
- r = tt({
372
+ r = nt({
373
373
  pointerEvent: t,
374
374
  captureEl: t.currentTarget,
375
- onMove: b,
375
+ onMove: w,
376
376
  onEnd: ({
377
377
  commit: f,
378
378
  snapshot: x
379
379
  }) => {
380
- b({
380
+ w({
381
381
  pointerId: x.pointerId,
382
382
  clientX: x.latestClientX,
383
383
  clientY: x.latestClientY
@@ -391,11 +391,11 @@ function Gt(e) {
391
391
  },
392
392
  onDrop: (n, o, d) => {
393
393
  if (!d?.worldPoint) return;
394
- const c = at(t.widgetType, e.widgetDefinitions);
394
+ const c = ct(t.widgetType, e.widgetDefinitions);
395
395
  t.onDrop({
396
396
  widgetType: t.widgetType,
397
397
  centerWorld: d.worldPoint,
398
- frame: rt(c, {
398
+ frame: at(c, {
399
399
  anchor: "center",
400
400
  worldX: d.worldPoint.worldX,
401
401
  worldY: d.worldPoint.worldY
@@ -410,18 +410,18 @@ function Gt(e) {
410
410
  begin: ee
411
411
  }), j(() => e.registerExternalDockDragController?.(null));
412
412
  });
413
- const te = () => u()?.kind === "external" ? u()?.icon : void 0, y = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", ce = A(() => yt.map((t) => ({
413
+ const te = () => u()?.kind === "external" ? u()?.icon : void 0, y = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", ce = L(() => Dt.map((t) => ({
414
414
  ...t,
415
415
  icon: e.modeIcons?.[t.mode] ?? t.icon
416
- }))), ve = A(() => ce().find((t) => t.mode === y()) ?? ce()[0]), ge = A(() => {
416
+ }))), ve = L(() => ce().find((t) => t.mode === y()) ?? ce()[0]), ge = L(() => {
417
417
  if (y() === "background")
418
- return xt.map((o) => ({
418
+ return Pt.map((o) => ({
419
419
  id: o.tool,
420
420
  kind: "tool",
421
421
  label: o.label,
422
422
  icon: o.icon
423
423
  }));
424
- const t = [...Dt.map((o) => ({
424
+ const t = [...xt.map((o) => ({
425
425
  id: o.tool,
426
426
  kind: "tool",
427
427
  label: o.label,
@@ -433,8 +433,8 @@ function Gt(e) {
433
433
  icon: o.icon
434
434
  }))], n = new Map(e.componentOrder?.map((o, d) => [o, d]));
435
435
  return t.sort((o, d) => (n.get(o.id) ?? Number.MAX_SAFE_INTEGER) - (n.get(d.id) ?? Number.MAX_SAFE_INTEGER));
436
- }), Ae = A(() => y() === "background" ? [] : [...e.dockItems ?? []]), Te = A(() => y() === "background" ? [] : [...e.dockActions ?? []]), fe = A(() => {
437
- const t = [...Te().map((o) => ({
436
+ }), Te = L(() => y() === "background" ? [] : [...e.dockItems ?? []]), Xe = L(() => y() === "background" ? [] : [...e.dockActions ?? []]), fe = L(() => {
437
+ const t = [...Xe().map((o) => ({
438
438
  ...o,
439
439
  action: o,
440
440
  kind: "action",
@@ -444,7 +444,7 @@ function Gt(e) {
444
444
  preventScroll: !0
445
445
  }),
446
446
  activate: (d) => B("action", o.id, o.label, d)
447
- })), ...Ae().map((o) => ({
447
+ })), ...Te().map((o) => ({
448
448
  ...o,
449
449
  host: o,
450
450
  kind: "host",
@@ -469,16 +469,16 @@ function Gt(e) {
469
469
  const c = n.indexOf(o.key), v = n.indexOf(d.key);
470
470
  return (c < 0 ? 1 / 0 : c) - (v < 0 ? 1 / 0 : v);
471
471
  }), t;
472
- }), ke = A(() => y() === "work" && e.customization?.overflow ? fe().filter((t) => e.customization?.hidden?.includes(t.key)) : []), F = A(() => fe().filter((t) => !ke().includes(t)));
473
- Je({
472
+ }), ke = L(() => y() === "work" && e.customization?.overflow ? fe().filter((t) => e.customization?.hidden?.includes(t.key)) : []), F = L(() => fe().filter((t) => !ke().includes(t)));
473
+ Qe({
474
474
  keys: () => F().map((t) => t.key),
475
475
  elements: C,
476
476
  preview: () => S()?.order,
477
477
  axis: "x"
478
478
  });
479
- const Xe = A(() => new Map(F().map((t) => [t.key, t]))), Re = (t, n) => {
479
+ const me = L(() => new Map(F().map((t) => [t.key, t]))), Re = (t, n) => {
480
480
  if (y() !== "work" || !e.customization?.onOrderChange) return;
481
- const o = Qe(F().map((d) => d.key), t, n, "x");
481
+ const o = Ze(F().map((d) => d.key), t, n, "x");
482
482
  o && (e.customization.onOrderChange(o), C.get(t)?.focus({
483
483
  preventScroll: !0
484
484
  }));
@@ -488,10 +488,10 @@ function Gt(e) {
488
488
  commit: !1
489
489
  });
490
490
  });
491
- const me = A(() => ge().map((t) => String(t.id))), le = () => y() !== "background", Fe = (t) => !le() || e.filters[t] !== !1, Ye = (t) => {
491
+ const we = L(() => ge().map((t) => String(t.id))), le = () => y() !== "background", Fe = (t) => !le() || e.filters[t] !== !1, Ye = (t) => {
492
492
  if (!le())
493
493
  return !1;
494
- const n = me();
494
+ const n = we();
495
495
  return n.length > 1 && n.every((o) => e.filters[o] !== !1 == (o === t));
496
496
  }, Be = (t, n) => R() === "focus-cycle" ? e.resolveItemPresentation?.({
497
497
  kind: t,
@@ -500,12 +500,12 @@ function Gt(e) {
500
500
  scale: 1,
501
501
  y: 0,
502
502
  x: 0
503
- }), we = (t) => {
503
+ }), he = (t) => {
504
504
  const n = u();
505
505
  return !!(n?.kind === "external" && n.moved && n.dockPlacement === t);
506
- }, he = () => (() => {
507
- var t = kt();
508
- return w(t, g(X, {
506
+ }, be = () => (() => {
507
+ var t = mt();
508
+ return h(t, g(X, {
509
509
  get when() {
510
510
  return te();
511
511
  },
@@ -518,15 +518,15 @@ function Gt(e) {
518
518
  })), H(() => t.classList.toggle("is-drop-allowed", !!u()?.overDock)), t;
519
519
  })();
520
520
  return [(() => {
521
- var t = wt(), n = t.firstChild, o = n.firstChild;
521
+ var t = ht(), n = t.firstChild, o = n.firstChild;
522
522
  t.addEventListener("pointerleave", () => s(null));
523
- var d = h;
524
- return typeof d == "function" ? $e(d, t) : h = t, o.$$click = () => {
523
+ var d = b;
524
+ return typeof d == "function" ? Le(d, t) : b = t, o.$$click = () => {
525
525
  e.onDockActivation?.({
526
526
  kind: "mode",
527
527
  id: y()
528
528
  }), i((c) => !c);
529
- }, o.addEventListener("pointerleave", () => s((c) => c === 0 ? null : c)), o.addEventListener("pointerenter", () => s(0)), w(o, g(ie.span, {
529
+ }, o.addEventListener("pointerleave", () => s((c) => c === 0 ? null : c)), o.addEventListener("pointerenter", () => s(0)), h(o, g(ie.span, {
530
530
  class: "workbench-dock__tile",
531
531
  get animate() {
532
532
  return ze();
@@ -545,7 +545,7 @@ function Gt(e) {
545
545
  });
546
546
  })();
547
547
  }
548
- }), null), w(o, g(ie.span, {
548
+ }), null), h(o, g(ie.span, {
549
549
  class: "workbench-dock__tooltip",
550
550
  get animate() {
551
551
  return {
@@ -562,28 +562,28 @@ function Gt(e) {
562
562
  get children() {
563
563
  return ve().label;
564
564
  }
565
- }), null), w(n, g(X, {
565
+ }), null), h(n, g(X, {
566
566
  get when() {
567
567
  return D();
568
568
  },
569
569
  get children() {
570
- var c = mt();
571
- return w(c, g(xe, {
570
+ var c = wt();
571
+ return h(c, g(Pe, {
572
572
  get each() {
573
573
  return ce();
574
574
  },
575
575
  children: (v) => {
576
576
  const a = v.icon;
577
577
  return (() => {
578
- var M = ht(), L = M.firstChild, V = L.nextSibling, b = V.firstChild, f = b.nextSibling;
578
+ var M = bt(), O = M.firstChild, V = O.nextSibling, w = V.firstChild, f = w.nextSibling;
579
579
  return M.$$click = () => {
580
580
  e.onDockActivation?.({
581
581
  kind: "mode",
582
582
  id: v.mode
583
583
  }), e.onSelectMode?.(v.mode), i(!1);
584
- }, w(L, g(a, {
584
+ }, h(O, g(a, {
585
585
  class: "workbench-dock__mode-icon"
586
- })), w(b, () => v.label), w(f, () => v.description), H((x) => {
586
+ })), h(w, () => v.label), h(f, () => v.description), H((x) => {
587
587
  var k = y() === v.mode, ne = y() === v.mode;
588
588
  return k !== x.e && M.classList.toggle("is-active", x.e = k), ne !== x.t && T(M, "aria-checked", x.t = ne), x;
589
589
  }, {
@@ -594,27 +594,27 @@ function Gt(e) {
594
594
  }
595
595
  })), c;
596
596
  }
597
- }), null), w(t, g(X, {
597
+ }), null), h(t, g(X, {
598
598
  get when() {
599
- return we("before-components");
599
+ return he("before-components");
600
600
  },
601
601
  get children() {
602
- return g(he, {});
602
+ return g(be, {});
603
603
  }
604
- }), null), w(t, g(xe, {
604
+ }), null), h(t, g(Pe, {
605
605
  get each() {
606
606
  return F().map((c) => c.key);
607
607
  },
608
608
  children: (c, v) => {
609
- const a = () => Xe().get(c), M = a().action?.buttonRef, L = () => a().kind === "widget" || a().kind === "tool" ? Be(a().kind, a().id) : void 0, V = () => a().host?.onContextMenu ?? a().action?.onContextMenu ?? (e.customization?.onContextMenu && y() === "work" ? (b) => e.customization?.onContextMenu?.(a(), b) : void 0);
609
+ const a = L((w) => me().get(c) ?? w, je(() => me().get(c))), M = a().action?.buttonRef, O = () => a().kind === "widget" || a().kind === "tool" ? Be(a().kind, a().id) : void 0, V = () => a().host?.onContextMenu ?? a().action?.onContextMenu ?? (e.customization?.onContextMenu && y() === "work" ? (w) => e.customization?.onContextMenu?.(a(), w) : void 0);
610
610
  return [g(X, {
611
611
  get when() {
612
612
  return I(() => !!e.customization)() ? v() === 0 : I(() => a().group === 2 || a().group === 4)() && F()[v() - 1]?.group !== a().group;
613
613
  },
614
614
  get children() {
615
- return bt();
615
+ return _t();
616
616
  }
617
- }), g(St, {
617
+ }), g($t, {
618
618
  get id() {
619
619
  return a().id;
620
620
  },
@@ -628,7 +628,7 @@ function Gt(e) {
628
628
  return a().icon;
629
629
  },
630
630
  get active() {
631
- return I(() => !!a().action)() ? !!a().action.active : I(() => !!a().host)() ? !!a().host.active : L()?.active ?? Ye(a().id);
631
+ return I(() => !!a().action)() ? !!a().action.active : I(() => !!a().host)() ? !!a().host.active : O()?.active ?? Ye(a().id);
632
632
  },
633
633
  get visible() {
634
634
  return a().group !== 2 || R() === "focus-cycle" || Fe(a().id);
@@ -640,7 +640,7 @@ function Gt(e) {
640
640
  return R();
641
641
  },
642
642
  get presentation() {
643
- return L();
643
+ return O();
644
644
  },
645
645
  get hoverOffset() {
646
646
  return J(v() + 1);
@@ -654,20 +654,20 @@ function Gt(e) {
654
654
  kind: a().kind,
655
655
  id: a().id
656
656
  },
657
- onDrop: (b, f, x) => a().kind === "widget" ? e.onCreateAt?.(a().id, b, f, x) : e.onCreateToolAt?.(a().id, b, f, x)
657
+ onDrop: (w, f, x) => a().kind === "widget" ? e.onCreateAt?.(a().id, w, f, x) : e.onCreateToolAt?.(a().id, w, f, x)
658
658
  };
659
659
  },
660
- buttonRef: (b) => {
661
- b ? C.set(c, b) : C.delete(c), M?.(b);
660
+ buttonRef: (w) => {
661
+ w ? C.set(c, w) : C.delete(c), M?.(w);
662
662
  },
663
663
  get onContextMenu() {
664
664
  return V();
665
665
  },
666
- onKeyboardActivate: (b) => a().activate(b),
666
+ onKeyboardActivate: (w) => a().activate(w),
667
667
  onEnter: () => s(v() + 1),
668
668
  onLeave: () => s(null),
669
669
  onDragBegin: W,
670
- onReorderKey: (b) => Re(c, b),
670
+ onReorderKey: (w) => Re(c, w),
671
671
  get reorderable() {
672
672
  return I(() => y() === "work")() && !!e.customization?.onOrderChange;
673
673
  },
@@ -676,19 +676,19 @@ function Gt(e) {
676
676
  }
677
677
  })];
678
678
  }
679
- }), null), w(t, g(X, {
679
+ }), null), h(t, g(X, {
680
680
  get when() {
681
- return we("after-components");
681
+ return he("after-components");
682
682
  },
683
683
  get children() {
684
- return g(he, {});
684
+ return g(be, {});
685
685
  }
686
- }), null), w(t, g(X, {
686
+ }), null), h(t, g(X, {
687
687
  get when() {
688
688
  return I(() => y() === "work")() && e.customization?.overflow;
689
689
  },
690
690
  get children() {
691
- return g(Se, {
691
+ return g($e, {
692
692
  get component() {
693
693
  return e.customization?.overflow;
694
694
  },
@@ -698,8 +698,8 @@ function Gt(e) {
698
698
  });
699
699
  }
700
700
  }), null), H((c) => {
701
- var v = `workbench-dock workbench-dock-material${u()?.kind === "external" && u()?.moved ? " is-external-drop-target" : ""}${u()?.kind === "external" && u()?.overDock ? " is-external-drop-allowed" : ""}`, a = y() === "background", M = !!(de() || D()), L = D();
702
- return v !== c.e && Ve(t, c.e = v), a !== c.t && o.classList.toggle("is-active", c.t = a), M !== c.a && o.classList.toggle("is-hovered", c.a = M), L !== c.o && T(o, "aria-expanded", c.o = L), c;
701
+ var v = `workbench-dock workbench-dock-material${u()?.kind === "external" && u()?.moved ? " is-external-drop-target" : ""}${u()?.kind === "external" && u()?.overDock ? " is-external-drop-allowed" : ""}`, a = y() === "background", M = !!(de() || D()), O = D();
702
+ return v !== c.e && Ve(t, c.e = v), a !== c.t && o.classList.toggle("is-active", c.t = a), M !== c.a && o.classList.toggle("is-hovered", c.a = M), O !== c.o && T(o, "aria-expanded", c.o = O), c;
703
703
  }, {
704
704
  e: void 0,
705
705
  t: void 0,
@@ -711,21 +711,21 @@ function Gt(e) {
711
711
  return !!(u()?.moved && !u()?.preview);
712
712
  },
713
713
  get children() {
714
- return g($t, {
714
+ return g(Lt, {
715
715
  state: u
716
716
  });
717
717
  }
718
718
  })];
719
719
  }
720
- function $t(e) {
720
+ function Lt(e) {
721
721
  const m = () => {
722
722
  const _ = e.state();
723
723
  return _ ? `translate3d(${_.clientX + 14}px, ${_.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
724
724
  }, s = () => e.state()?.label ?? "", u = () => e.state()?.icon;
725
725
  return g(Ue, {
726
726
  get children() {
727
- var _ = _t(), C = _.firstChild, S = C.nextSibling, $ = S.firstChild, D = $.nextSibling, i = D.firstChild, h = i.nextSibling, r = h.firstChild;
728
- return w($, g(X, {
727
+ var _ = Et(), C = _.firstChild, S = C.nextSibling, $ = S.firstChild, D = $.nextSibling, i = D.firstChild, b = i.nextSibling, r = b.firstChild;
728
+ return h($, g(X, {
729
729
  get when() {
730
730
  return u();
731
731
  },
@@ -735,9 +735,9 @@ function $t(e) {
735
735
  class: "w-4 h-4"
736
736
  });
737
737
  }
738
- })), w(i, s), w(h, g(pe, {
738
+ })), h(i, s), h(b, g(et, {
739
739
  class: "w-3 h-3"
740
- }), r), w(r, () => e.state()?.kind === "external" ? "Pin to Dock" : "Drag onto canvas"), H((l) => {
740
+ }), r), h(r, () => e.state()?.kind === "external" ? "Pin to Dock" : "Drag onto canvas"), H((l) => {
741
741
  var E = !!(e.state()?.kind === "external" && e.state()?.overDock), P = m();
742
742
  return E !== l.e && _.classList.toggle("is-over-dock", l.e = E), P !== l.t && se(_, "transform", l.t = P), l;
743
743
  }, {
@@ -749,5 +749,5 @@ function $t(e) {
749
749
  }
750
750
  qe(["pointerdown", "click", "contextmenu", "keydown"]);
751
751
  export {
752
- Gt as WorkbenchDock
752
+ Vt as WorkbenchDock
753
753
  };