@floegence/floe-webapp-core 0.86.24 → 0.86.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Floegence, Inc.
3
+ Copyright (c) 2026 Floegence Inc
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -12,6 +12,8 @@ export interface WorkbenchFilterBarProps {
12
12
  modeIcons?: WorkbenchDockModeIcons;
13
13
  /** Changes built-in Dock clicks without affecting drag-to-create behavior. */
14
14
  activationMode?: WorkbenchDockItemActivationMode;
15
+ /** Orders work-mode widgets and tools by id; unlisted entries retain their relative order at the end. */
16
+ componentOrder?: readonly (WorkbenchWidgetType | WorkbenchDockToolId)[];
15
17
  /** Solo a single dock component in the supplied mode scope; soloing it again shows the full scope. */
16
18
  onSoloFilter: (id: string, scope: readonly string[]) => void;
17
19
  onSelectMode?: (mode: WorkbenchInteractionMode) => void;
@@ -56,6 +58,8 @@ export type WorkbenchDockAction = Readonly<{
56
58
  class?: string;
57
59
  }>;
58
60
  active?: boolean;
61
+ /** Places the action before or after components, always before host items in that group. */
62
+ dockPlacement?: WorkbenchDockItemPlacement;
59
63
  onActivate: (trigger: HTMLButtonElement) => void;
60
64
  }>;
61
65
  export type WorkbenchHostDockItem = Readonly<{
@@ -1,72 +1,72 @@
1
- import { insert as m, createComponent as d, effect as K, setAttribute as I, memo as B, className as He, template as $, Dynamic as Ke, Portal as We, setStyleProperty as Ne, use as Ve, delegateEvents as Ge } from "solid-js/web";
2
- import { createSignal as de, onCleanup as p, createEffect as ee, createMemo as A, Show as R, For as te, Index as Ue } from "solid-js";
3
- import { Motion as W } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
4
- import { easing as N, duration as V } from "../../utils/animations.js";
5
- import { Plus as qe } from "../icons/index.js";
6
- import { startHotInteraction as ze } from "../../utils/hotInteraction.js";
7
- import { startPointerSession as je } from "../ui/pointerSession.js";
8
- import { clientToCanvasWorld as Je } from "../ui/canvasGeometry.js";
9
- import { isBarItemContextMenuKey as Qe, keyboardBarItemContextMenuRequest as Ze } from "../layout/barItemContextMenu.js";
10
- import { createWorkbenchWidgetFrame as pe } from "./workbenchHelpers.js";
11
- import { getWidgetEntry as et } from "./widgets/widgetRegistry.js";
12
- import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Me, frameFromElement as Le, createWorkbenchEdgeAutoPanController as tt } from "./workbenchEdgeAutoPan.js";
13
- import { DockLayoutDashboard as nt, DockLayers as ot, DockRegion as rt, DockText as it, DockMessageSquare as at } from "../icons/DockIcons.js";
14
- var ct = /* @__PURE__ */ $("<button type=button class=workbench-dock__item>"), lt = /* @__PURE__ */ $('<button type=button class="workbench-dock__item workbench-dock__action">'), dt = /* @__PURE__ */ $("<span class=workbench-dock__external-placeholder aria-hidden=true>"), st = /* @__PURE__ */ $('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), ut = /* @__PURE__ */ $("<span class=workbench-dock__divider aria-hidden=true>"), gt = /* @__PURE__ */ $('<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></button></div><span class=workbench-dock__divider aria-hidden=true>'), vt = /* @__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>"), ft = /* @__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>");
15
- const Ce = 5, kt = 1e3, mt = ".workbench-dock", ht = [{
1
+ import { insert as k, createComponent as s, effect as K, setAttribute as L, memo as B, className as qe, template as $, Portal as ze, setStyleProperty as je, Dynamic as Je, use as Qe, delegateEvents as Ze } from "solid-js/web";
2
+ import { createSignal as se, onCleanup as p, createEffect as ee, createMemo as A, Show as R, For as te, Index as ye } from "solid-js";
3
+ import { Motion as N } from "../../node_modules/.pnpm/solid-motionone@1.0.4_solid-js@1.9.17/node_modules/solid-motionone/dist/index.js";
4
+ import { easing as W, duration as G } from "../../utils/animations.js";
5
+ import { Plus as pe } from "../icons/index.js";
6
+ import { startHotInteraction as et } from "../../utils/hotInteraction.js";
7
+ import { startPointerSession as tt } from "../ui/pointerSession.js";
8
+ import { clientToCanvasWorld as nt } from "../ui/canvasGeometry.js";
9
+ import { isBarItemContextMenuKey as ot, keyboardBarItemContextMenuRequest as rt } from "../layout/barItemContextMenu.js";
10
+ import { createWorkbenchWidgetFrame as it } from "./workbenchHelpers.js";
11
+ import { getWidgetEntry as at } from "./widgets/widgetRegistry.js";
12
+ import { WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Te, frameFromElement as $e, createWorkbenchEdgeAutoPanController as ct } from "./workbenchEdgeAutoPan.js";
13
+ import { DockLayoutDashboard as lt, DockLayers as st, DockRegion as dt, DockText as ut, DockMessageSquare as gt } from "../icons/DockIcons.js";
14
+ var vt = /* @__PURE__ */ $("<button type=button class=workbench-dock__item>"), ft = /* @__PURE__ */ $('<button type=button class="workbench-dock__item workbench-dock__action">'), kt = /* @__PURE__ */ $("<span class=workbench-dock__external-placeholder aria-hidden=true>"), mt = /* @__PURE__ */ $('<div class=workbench-dock__mode-popover role=menu aria-label="Canvas mode">'), ht = /* @__PURE__ */ $("<span class=workbench-dock__divider aria-hidden=true>"), bt = /* @__PURE__ */ $('<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></button></div><span class=workbench-dock__divider aria-hidden=true>'), wt = /* @__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>"), _t = /* @__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>");
15
+ const Se = 5, Et = 1e3, Dt = ".workbench-dock", Ct = [{
16
16
  mode: "work",
17
17
  label: "Work Mode",
18
18
  description: "Operate windows and sticky notes",
19
- icon: nt
19
+ icon: lt
20
20
  }, {
21
21
  mode: "background",
22
22
  label: "Composition Mode",
23
23
  description: "Arrange regions and canvas text",
24
- icon: ot
25
- }], wt = [{
24
+ icon: st
25
+ }], Pt = [{
26
26
  tool: "sticky-note",
27
27
  label: "Sticky",
28
- icon: at
29
- }], bt = [{
28
+ icon: gt
29
+ }], Mt = [{
30
30
  tool: "background-region",
31
31
  label: "Region",
32
- icon: rt
32
+ icon: dt
33
33
  }, {
34
34
  tool: "text",
35
35
  label: "Text",
36
- icon: it
36
+ icon: ut
37
37
  }];
38
- function _t(e) {
39
- const c = e?.closest(".workbench-surface")?.querySelector(Me);
40
- return c instanceof HTMLElement ? Le(c) : null;
38
+ function xt(e) {
39
+ const l = e?.closest(".workbench-surface")?.querySelector(Te);
40
+ return l instanceof HTMLElement ? $e(l) : null;
41
41
  }
42
- function ue(e, g, c) {
43
- return e >= c.left && e <= c.right && g >= c.top && g <= c.bottom;
42
+ function ue(e, g, l) {
43
+ return e >= l.left && e <= l.right && g >= l.top && g <= l.bottom;
44
44
  }
45
- function Dt(e, g, c) {
46
- return c ? ue(e, g, c) : !1;
45
+ function It(e, g, l) {
46
+ return l ? ue(e, g, l) : !1;
47
47
  }
48
- function Pe(e, g, c) {
49
- return Math.min(c, Math.max(g, e));
48
+ function Ae(e, g, l) {
49
+ return Math.min(l, Math.max(g, e));
50
50
  }
51
- function Et(e, g, c, i, l) {
51
+ function Lt(e, g, l, i, d) {
52
52
  if (!e) return !1;
53
- if (ue(g, c, e) || ue(i, l, e))
53
+ if (ue(g, l, e) || ue(i, d, e))
54
54
  return !0;
55
- const _ = i - g, P = l - c;
56
- let w = 0, r = 1;
57
- const a = (D, x) => {
58
- if (D === 0) return x >= 0;
59
- const v = x / D;
60
- return D < 0 ? v > r ? !1 : (v > w && (w = v), !0) : v < w ? !1 : (v < r && (r = v), !0);
55
+ const E = i - g, P = d - l;
56
+ let b = 0, r = 1;
57
+ const a = (D, M) => {
58
+ if (D === 0) return M >= 0;
59
+ const v = M / D;
60
+ return D < 0 ? v > r ? !1 : (v > b && (b = v), !0) : v < b ? !1 : (v < r && (r = v), !0);
61
61
  };
62
- return a(-_, g - e.left) && a(_, e.right - g) && a(-P, c - e.top) && a(P, e.bottom - c);
62
+ return a(-E, g - e.left) && a(E, e.right - g) && a(-P, l - e.top) && a(P, e.bottom - l);
63
63
  }
64
- function xe(e, g, c) {
65
- if (!c || typeof document.elementFromPoint != "function") return !1;
64
+ function Oe(e, g, l) {
65
+ if (!l || typeof document.elementFromPoint != "function") return !1;
66
66
  const i = document.elementFromPoint(e, g);
67
- return i instanceof Element && i.closest(mt) === c;
67
+ return i instanceof Element && i.closest(Dt) === l;
68
68
  }
69
- function se(e) {
69
+ function de(e) {
70
70
  const g = () => e.hoverOffset === -1 ? {
71
71
  scale: 1.26,
72
72
  y: -6,
@@ -83,64 +83,64 @@ function se(e) {
83
83
  scale: 1,
84
84
  y: 0,
85
85
  x: 0
86
- }, c = () => e.hoverOffset === -1, i = (r) => {
86
+ }, l = () => e.hoverOffset === -1, i = (r) => {
87
87
  r.button === 0 && e.onDragBegin(r, e.kind, e.id, e.label, e.icon, r.currentTarget, e.canvasPlacement, null);
88
- }, l = (r) => {
88
+ }, d = (r) => {
89
89
  e.onContextMenu && (r.preventDefault(), r.stopPropagation(), e.onContextMenu({
90
90
  trigger: r.currentTarget,
91
91
  clientX: r.clientX,
92
92
  clientY: r.clientY,
93
93
  source: "pointer"
94
94
  }));
95
- }, _ = (r) => {
96
- !e.onContextMenu || !Qe(r) || (r.preventDefault(), r.stopPropagation(), e.onContextMenu(Ze(r.currentTarget)));
95
+ }, E = (r) => {
96
+ !e.onContextMenu || !ot(r) || (r.preventDefault(), r.stopPropagation(), e.onContextMenu(rt(r.currentTarget)));
97
97
  }, P = (r) => {
98
98
  r.detail === 0 && e.onKeyboardActivate(r.currentTarget);
99
- }, w = () => {
99
+ }, b = () => {
100
100
  const r = e.presentation;
101
101
  return r ? r.count === 0 ? `${e.label} +` : r.active && r.currentIndex !== null ? `${e.label} ${r.currentIndex + 1}/${r.count}` : r.count > 1 ? `${e.label} ${r.count}` : e.label : e.label;
102
102
  };
103
103
  return (() => {
104
- var r = ct();
105
- return r.$$keydown = _, r.$$contextmenu = l, r.$$click = P, r.$$pointerdown = i, r.addEventListener("pointerleave", () => e.onLeave()), r.addEventListener("pointerenter", () => e.onEnter()), m(r, d(W.span, {
104
+ var r = vt();
105
+ return r.$$keydown = E, r.$$contextmenu = d, r.$$click = P, r.$$pointerdown = i, r.addEventListener("pointerleave", () => e.onLeave()), r.addEventListener("pointerenter", () => e.onEnter()), k(r, s(N.span, {
106
106
  class: "workbench-dock__tile",
107
107
  get animate() {
108
108
  return g();
109
109
  },
110
110
  get transition() {
111
111
  return {
112
- duration: V.fast,
113
- easing: N.easeOut
112
+ duration: G.fast,
113
+ easing: W.easeOut
114
114
  };
115
115
  },
116
116
  get children() {
117
117
  return (() => {
118
118
  const a = e.icon;
119
- return d(a, {
119
+ return s(a, {
120
120
  class: "workbench-dock__icon"
121
121
  });
122
122
  })();
123
123
  }
124
- }), null), m(r, d(W.span, {
124
+ }), null), k(r, s(N.span, {
125
125
  class: "workbench-dock__tooltip",
126
126
  get animate() {
127
127
  return {
128
- opacity: c() ? 1 : 0,
129
- y: c() ? -6 : 0
128
+ opacity: l() ? 1 : 0,
129
+ y: l() ? -6 : 0
130
130
  };
131
131
  },
132
132
  get transition() {
133
133
  return {
134
- duration: V.fast,
135
- easing: N.easeOut
134
+ duration: G.fast,
135
+ easing: W.easeOut
136
136
  };
137
137
  },
138
138
  get children() {
139
- return B(() => e.activationMode === "focus-cycle")() ? w() : e.label;
139
+ return B(() => e.activationMode === "focus-cycle")() ? b() : e.label;
140
140
  }
141
141
  }), null), K((a) => {
142
- var D = e.kind === "host" ? e.id : void 0, x = e.kind === "widget" || e.kind === "tool" ? e.id : void 0, v = !!e.active, M = !!(e.filterable && !e.visible), X = !!c(), z = !!e.isDragging, Y = e.activationMode === "focus-cycle" && e.presentation ? w() : e.filterable ? `${e.label} — click to solo, drag to canvas to create` : `${e.label} — drag to canvas to create`, j = e.activationMode === "focus-cycle" ? e.presentation?.active : e.active, F = e.onContextMenu ? "menu" : void 0;
143
- return D !== a.e && I(r, "data-workbench-dock-item", a.e = D), x !== a.t && I(r, "data-workbench-dock-component", a.t = x), v !== a.a && r.classList.toggle("is-active", a.a = v), M !== a.o && r.classList.toggle("is-filter-muted", a.o = M), X !== a.i && r.classList.toggle("is-hovered", a.i = X), z !== a.n && r.classList.toggle("is-source-dragging", a.n = z), Y !== a.s && I(r, "aria-label", a.s = Y), j !== a.h && I(r, "aria-pressed", a.h = j), F !== a.r && I(r, "aria-haspopup", a.r = F), a;
142
+ var D = e.kind === "host" ? e.id : void 0, M = e.kind === "widget" || e.kind === "tool" ? e.id : void 0, v = !!e.active, x = !!(e.filterable && !e.visible), X = !!l(), q = !!e.isDragging, F = e.activationMode === "focus-cycle" && e.presentation ? b() : e.filterable ? `${e.label} — click to solo, drag to canvas to create` : `${e.label} — drag to canvas to create`, z = e.activationMode === "focus-cycle" ? e.presentation?.active : e.active, Y = e.onContextMenu ? "menu" : void 0;
143
+ return D !== a.e && L(r, "data-workbench-dock-item", a.e = D), M !== a.t && L(r, "data-workbench-dock-component", a.t = M), v !== a.a && r.classList.toggle("is-active", a.a = v), x !== a.o && r.classList.toggle("is-filter-muted", a.o = x), X !== a.i && r.classList.toggle("is-hovered", a.i = X), q !== a.n && r.classList.toggle("is-source-dragging", a.n = q), F !== a.s && L(r, "aria-label", a.s = F), z !== a.h && L(r, "aria-pressed", a.h = z), Y !== a.r && L(r, "aria-haspopup", a.r = Y), a;
144
144
  }, {
145
145
  e: void 0,
146
146
  t: void 0,
@@ -154,34 +154,34 @@ function se(e) {
154
154
  }), r;
155
155
  })();
156
156
  }
157
- function Ct(e) {
158
- const g = () => e.hoverOffset === -1, c = () => ({
157
+ function yt(e) {
158
+ const g = () => e.hoverOffset === -1, l = () => ({
159
159
  scale: 1,
160
160
  y: 0,
161
161
  x: 0
162
162
  });
163
163
  return (() => {
164
- var i = lt();
165
- return i.$$click = (l) => e.onActivate(l.currentTarget), i.addEventListener("dragstart", (l) => l.preventDefault()), i.addEventListener("pointerleave", () => e.onLeave()), i.addEventListener("pointerenter", () => e.onEnter()), I(i, "draggable", !1), m(i, d(W.span, {
164
+ var i = ft();
165
+ return i.$$click = (d) => e.onActivate(d.currentTarget), i.addEventListener("dragstart", (d) => d.preventDefault()), i.addEventListener("pointerleave", () => e.onLeave()), i.addEventListener("pointerenter", () => e.onEnter()), L(i, "draggable", !1), k(i, s(N.span, {
166
166
  class: "workbench-dock__tile",
167
167
  get animate() {
168
- return c();
168
+ return l();
169
169
  },
170
170
  get transition() {
171
171
  return {
172
- duration: V.fast,
173
- easing: N.easeOut
172
+ duration: G.fast,
173
+ easing: W.easeOut
174
174
  };
175
175
  },
176
176
  get children() {
177
- return d(Ke, {
177
+ return s(Je, {
178
178
  get component() {
179
179
  return e.action.icon;
180
180
  },
181
181
  class: "workbench-dock__icon"
182
182
  });
183
183
  }
184
- }), null), m(i, d(W.span, {
184
+ }), null), k(i, s(N.span, {
185
185
  class: "workbench-dock__tooltip",
186
186
  get animate() {
187
187
  return {
@@ -191,16 +191,16 @@ function Ct(e) {
191
191
  },
192
192
  get transition() {
193
193
  return {
194
- duration: V.fast,
195
- easing: N.easeOut
194
+ duration: G.fast,
195
+ easing: W.easeOut
196
196
  };
197
197
  },
198
198
  get children() {
199
199
  return e.action.label;
200
200
  }
201
- }), null), K((l) => {
202
- var _ = e.action.id, P = !!e.action.active, w = !!g(), r = e.action.label, a = e.action.active;
203
- return _ !== l.e && I(i, "data-workbench-dock-action", l.e = _), P !== l.t && i.classList.toggle("is-active", l.t = P), w !== l.a && i.classList.toggle("is-hovered", l.a = w), r !== l.o && I(i, "aria-label", l.o = r), a !== l.i && I(i, "aria-pressed", l.i = a), l;
201
+ }), null), K((d) => {
202
+ var E = e.action.id, P = !!e.action.active, b = !!g(), r = e.action.label, a = e.action.active;
203
+ return E !== d.e && L(i, "data-workbench-dock-action", d.e = E), P !== d.t && i.classList.toggle("is-active", d.t = P), b !== d.a && i.classList.toggle("is-hovered", d.a = b), r !== d.o && L(i, "aria-label", d.o = r), a !== d.i && L(i, "aria-pressed", d.i = a), d;
204
204
  }, {
205
205
  e: void 0,
206
206
  t: void 0,
@@ -210,9 +210,9 @@ function Ct(e) {
210
210
  }), i;
211
211
  })();
212
212
  }
213
- function Bt(e) {
214
- const [g, c] = de(null), [i, l] = de(null), [_, P] = de(!1);
215
- let w, r, a, D, x = null;
213
+ function Gt(e) {
214
+ const [g, l] = se(null), [i, d] = se(null), [E, P] = se(!1);
215
+ let b, r, a, D, M = null;
216
216
  const v = () => e.activationMode === "focus-cycle" ? "focus-cycle" : "solo-filter";
217
217
  p(() => {
218
218
  D?.stop(), r?.stop({
@@ -230,66 +230,66 @@ function Bt(e) {
230
230
  };
231
231
  window.addEventListener("keydown", t, !0), p(() => window.removeEventListener("keydown", t, !0));
232
232
  }), ee(() => {
233
- if (!_() || typeof window > "u") return;
234
- const t = (f) => {
235
- w && f.target instanceof Node && w.contains(f.target) || P(!1);
236
- }, n = (f) => {
237
- f.key === "Escape" && P(!1);
233
+ if (!E() || typeof window > "u") return;
234
+ const t = (c) => {
235
+ b && c.target instanceof Node && b.contains(c.target) || P(!1);
236
+ }, n = (c) => {
237
+ c.key === "Escape" && P(!1);
238
238
  };
239
239
  window.addEventListener("pointerdown", t, !0), window.addEventListener("keydown", n, !0), p(() => {
240
240
  window.removeEventListener("pointerdown", t, !0), window.removeEventListener("keydown", n, !0);
241
241
  });
242
242
  });
243
- const M = (t) => {
243
+ const x = (t) => {
244
244
  const n = g();
245
- return n === null || n <= G().length ? 0 : n === t ? -1 : n === t + 1 ? -2 : n === t - 1 ? 1 : 0;
245
+ return n === null || n <= j().length || n >= ie() && n < we() ? 0 : n === t ? -1 : n === t + 1 ? -2 : n === t - 1 ? 1 : 0;
246
246
  }, X = () => {
247
- D?.stop(), D = void 0, x = null;
248
- }, z = () => {
249
- !e.viewport || !e.onViewportCommit || (x = e.viewport, D?.stop(), D = tt({
247
+ D?.stop(), D = void 0, M = null;
248
+ }, q = () => {
249
+ !e.viewport || !e.onViewportCommit || (M = e.viewport, D?.stop(), D = ct({
250
250
  readFrame: () => {
251
- const n = w?.closest(".workbench-surface")?.querySelector(Me);
252
- return n instanceof HTMLElement ? Le(n) : null;
251
+ const n = b?.closest(".workbench-surface")?.querySelector(Te);
252
+ return n instanceof HTMLElement ? $e(n) : null;
253
253
  },
254
- readViewport: () => x ?? e.viewport ?? null,
254
+ readViewport: () => M ?? e.viewport ?? null,
255
255
  commitViewport: (t) => {
256
- x = t, e.onViewportCommit?.(t);
256
+ M = t, e.onViewportCommit?.(t);
257
257
  },
258
258
  onPanStart: () => e.onViewportInteractionStart?.("pan"),
259
259
  shouldPan: () => {
260
260
  const t = i();
261
- return !!(t?.moved && t.hasEnteredCanvas && !xe(t.clientX, t.clientY, w));
261
+ return !!(t?.moved && t.hasEnteredCanvas && !Oe(t.clientX, t.clientY, b));
262
262
  }
263
263
  }));
264
- }, Y = (t, n, f, E) => {
264
+ }, F = (t, n, c, w) => {
265
265
  if (e.onDockActivation?.({
266
266
  kind: t,
267
267
  id: String(n)
268
268
  }), t === "external") return;
269
269
  if (t === "host") {
270
- e.dockItems?.find((o) => o.id === n)?.onActivate?.(E);
270
+ e.dockItems?.find((o) => o.id === n)?.onActivate?.(w);
271
271
  return;
272
272
  }
273
- const L = {
273
+ const I = {
274
274
  kind: t,
275
275
  id: n,
276
- label: f,
277
- trigger: E
276
+ label: c,
277
+ trigger: w
278
278
  };
279
- if (!e.onItemClick?.(L)) {
279
+ if (!e.onItemClick?.(I)) {
280
280
  if (v() === "focus-cycle") {
281
- e.onFocusCycleItem?.(L);
281
+ e.onFocusCycleItem?.(I);
282
282
  return;
283
283
  }
284
- y() !== "background" && e.onSoloFilter(String(n), ke());
284
+ y() !== "background" && e.onSoloFilter(String(n), Ee());
285
285
  }
286
- }, j = (t) => {
286
+ }, z = (t) => {
287
287
  const n = i();
288
288
  if (!n) return;
289
- const f = !n.moved, E = x ?? e.viewport;
290
- if (n.stopInteraction(), X(), l(null), r = void 0, n.kind === "external" && n.moved && a?.expire(), f) {
289
+ const c = !n.moved, w = M ?? e.viewport;
290
+ if (n.stopInteraction(), X(), d(null), r = void 0, n.kind === "external" && n.moved && a?.expire(), c) {
291
291
  if (n.kind === "external" || !(n.trigger instanceof HTMLButtonElement)) return;
292
- Y(n.kind, n.id, n.label, n.trigger);
292
+ F(n.kind, n.id, n.label, n.trigger);
293
293
  return;
294
294
  }
295
295
  if (t && n.overDock && n.dockDrop) {
@@ -297,29 +297,29 @@ function Bt(e) {
297
297
  return;
298
298
  }
299
299
  if (t && n.overCanvas && n.canvasPlacement) {
300
- const L = n.canvasFrame && E ? Je(n.canvasFrame, E, {
300
+ const I = n.canvasFrame && w ? nt(n.canvasFrame, w, {
301
301
  clientX: n.clientX,
302
302
  clientY: n.clientY
303
303
  }) : null, o = n.canvasFrame ? {
304
304
  dropAllowed: n.overCanvas,
305
305
  canvasFrame: n.canvasFrame,
306
- ...L ? {
307
- worldPoint: L
306
+ ...I ? {
307
+ worldPoint: I
308
308
  } : {}
309
309
  } : void 0;
310
310
  n.canvasPlacement.onDrop(n.clientX, n.clientY, o);
311
311
  }
312
- }, F = (t, n, f, E, L, o, b, h, s = "before-components") => {
312
+ }, Y = (t, n, c, w, I, o, h, _, m = "before-components") => {
313
313
  t.preventDefault(), r?.stop({
314
314
  reason: "manual_stop",
315
315
  commit: !1
316
- }), z();
317
- const C = _t(w);
318
- l({
316
+ }), q();
317
+ const C = xt(b);
318
+ d({
319
319
  kind: n,
320
- id: f,
321
- label: E,
322
- icon: L,
320
+ id: c,
321
+ label: w,
322
+ icon: I,
323
323
  pointerId: t.pointerId,
324
324
  startClientX: t.clientX,
325
325
  startClientY: t.clientY,
@@ -330,71 +330,71 @@ function Bt(e) {
330
330
  hasEnteredCanvas: !1,
331
331
  canvasFrame: C,
332
332
  preview: null,
333
- canvasPlacement: b,
334
- dockDrop: h,
335
- dockPlacement: s,
336
- stopInteraction: ze({
333
+ canvasPlacement: h,
334
+ dockDrop: _,
335
+ dockPlacement: m,
336
+ stopInteraction: et({
337
337
  kind: "drag",
338
338
  cursor: "grabbing"
339
339
  }),
340
340
  trigger: o,
341
341
  overDock: !1
342
342
  });
343
- const T = (u) => {
344
- let O = !1;
345
- l((k) => {
346
- if (!k || k.pointerId !== u.pointerId) return k;
347
- const J = u.clientX - k.startClientX, Q = u.clientY - k.startClientY, H = k.moved || Math.abs(J) > Ce || Math.abs(Q) > Ce;
348
- if (k.kind === "external" && H && !k.moved) {
349
- let U;
350
- const q = () => {
351
- U !== void 0 && window.clearTimeout(U), k.trigger.removeEventListener("click", _e, !0), window.removeEventListener("pointerdown", De, !0), a?.clear === q && (a = void 0);
352
- }, _e = (Ee) => {
353
- Ee.preventDefault(), Ee.stopImmediatePropagation(), q();
354
- }, De = () => q(), Re = () => {
355
- U !== void 0 && window.clearTimeout(U), U = window.setTimeout(q, kt);
343
+ const O = (u) => {
344
+ let T = !1;
345
+ d((f) => {
346
+ if (!f || f.pointerId !== u.pointerId) return f;
347
+ const J = u.clientX - f.startClientX, Q = u.clientY - f.startClientY, H = f.moved || Math.abs(J) > Se || Math.abs(Q) > Se;
348
+ if (f.kind === "external" && H && !f.moved) {
349
+ let V;
350
+ const U = () => {
351
+ V !== void 0 && window.clearTimeout(V), f.trigger.removeEventListener("click", xe, !0), window.removeEventListener("pointerdown", Ie, !0), a?.clear === U && (a = void 0);
352
+ }, xe = (Le) => {
353
+ Le.preventDefault(), Le.stopImmediatePropagation(), U();
354
+ }, Ie = () => U(), Ue = () => {
355
+ V !== void 0 && window.clearTimeout(V), V = window.setTimeout(U, Et);
356
356
  };
357
- k.trigger.addEventListener("click", _e, !0), window.addEventListener("pointerdown", De, !0), a = {
358
- clear: q,
359
- expire: Re
357
+ f.trigger.addEventListener("click", xe, !0), window.addEventListener("pointerdown", Ie, !0), a = {
358
+ clear: U,
359
+ expire: Ue
360
360
  };
361
361
  }
362
- const Z = xe(u.clientX, u.clientY, w), S = k.canvasFrame, he = H && Dt(u.clientX, u.clientY, S), we = he && !Z, Ye = H && !Z && Et(S, k.clientX, k.clientY, u.clientX, u.clientY), be = k.hasEnteredCanvas || he || Ye;
363
- O = H && be && !Z;
364
- const Fe = S ? Pe(u.clientX, S.left, S.right) : u.clientX, Be = S ? Pe(u.clientY, S.top, S.bottom) : u.clientY;
362
+ const Z = Oe(u.clientX, u.clientY, b), S = f.canvasFrame, Ce = H && It(u.clientX, u.clientY, S), Pe = Ce && !Z, We = H && !Z && Lt(S, f.clientX, f.clientY, u.clientX, u.clientY), Me = f.hasEnteredCanvas || Ce || We;
363
+ T = H && Me && !Z;
364
+ const Ge = S ? Ae(u.clientX, S.left, S.right) : u.clientX, Ve = S ? Ae(u.clientY, S.top, S.bottom) : u.clientY;
365
365
  return {
366
- ...k,
366
+ ...f,
367
367
  clientX: u.clientX,
368
368
  clientY: u.clientY,
369
369
  moved: H,
370
370
  overDock: Z,
371
- overCanvas: we,
372
- hasEnteredCanvas: be,
373
- preview: H && S && k.canvasPlacement?.preview ? {
374
- kind: k.canvasPlacement.preview.kind,
375
- id: k.canvasPlacement.preview.id,
376
- label: k.label,
377
- clientX: Fe,
378
- clientY: Be,
379
- dropAllowed: we,
371
+ overCanvas: Pe,
372
+ hasEnteredCanvas: Me,
373
+ preview: H && S && f.canvasPlacement?.preview ? {
374
+ kind: f.canvasPlacement.preview.kind,
375
+ id: f.canvasPlacement.preview.id,
376
+ label: f.label,
377
+ clientX: Ge,
378
+ clientY: Ve,
379
+ dropAllowed: Pe,
380
380
  canvasFrame: S
381
381
  } : null
382
382
  };
383
- }), O && D?.updatePointer(u.clientX, u.clientY);
383
+ }), T && D?.updatePointer(u.clientX, u.clientY);
384
384
  };
385
- r = je({
385
+ r = tt({
386
386
  pointerEvent: t,
387
387
  captureEl: t.currentTarget,
388
- onMove: T,
388
+ onMove: O,
389
389
  onEnd: ({
390
390
  commit: u,
391
- snapshot: O
391
+ snapshot: T
392
392
  }) => {
393
- T({
394
- pointerId: O.pointerId,
395
- clientX: O.latestClientX,
396
- clientY: O.latestClientY
397
- }), j(u);
393
+ O({
394
+ pointerId: T.pointerId,
395
+ clientX: T.latestClientX,
396
+ clientY: T.latestClientY
397
+ }), z(u);
398
398
  }
399
399
  });
400
400
  }, ne = (t) => t ? {
@@ -402,188 +402,195 @@ function Bt(e) {
402
402
  kind: "widget",
403
403
  id: t.widgetType
404
404
  },
405
- onDrop: (n, f, E) => {
406
- if (!E?.worldPoint) return;
407
- const L = et(t.widgetType, e.widgetDefinitions);
405
+ onDrop: (n, c, w) => {
406
+ if (!w?.worldPoint) return;
407
+ const I = at(t.widgetType, e.widgetDefinitions);
408
408
  t.onDrop({
409
409
  widgetType: t.widgetType,
410
- centerWorld: E.worldPoint,
411
- frame: pe(L, {
410
+ centerWorld: w.worldPoint,
411
+ frame: it(I, {
412
412
  anchor: "center",
413
- worldX: E.worldPoint.worldX,
414
- worldY: E.worldPoint.worldY
413
+ worldX: w.worldPoint.worldX,
414
+ worldY: w.worldPoint.worldY
415
415
  })
416
416
  });
417
417
  }
418
- } : null, Ie = (t, n) => {
419
- t.button !== 0 || !(t.currentTarget instanceof HTMLElement) || (a?.clear(), a = void 0, F(t, "external", n.id, n.label, n.icon, t.currentTarget, ne(n.canvasPlacement), n.onDropToDock ?? null, n.dockPlacement ?? "before-components"));
418
+ } : null, Xe = (t, n) => {
419
+ t.button !== 0 || !(t.currentTarget instanceof HTMLElement) || (a?.clear(), a = void 0, Y(t, "external", n.id, n.label, n.icon, t.currentTarget, ne(n.canvasPlacement), n.onDropToDock ?? null, n.dockPlacement ?? "before-components"));
420
420
  };
421
421
  ee(() => {
422
422
  e.registerExternalDockDragController?.({
423
- begin: Ie
423
+ begin: Xe
424
424
  }), p(() => e.registerExternalDockDragController?.(null));
425
425
  });
426
- const ye = () => i()?.kind === "widget" ? i().id : null, Se = () => i()?.kind === "tool" ? i().id : null, Te = () => i()?.kind === "external" ? i()?.icon : void 0, y = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", oe = A(() => ht.map((t) => ({
426
+ const Fe = () => i()?.kind === "widget" ? i().id : null, Ye = () => i()?.kind === "tool" ? i().id : null, Be = () => i()?.kind === "external" ? i()?.icon : void 0, y = () => e.mode === "background" || e.mode === "annotation" ? "background" : "work", oe = A(() => Ct.map((t) => ({
427
427
  ...t,
428
428
  icon: e.modeIcons?.[t.mode] ?? t.icon
429
- }))), ge = A(() => oe().find((t) => t.mode === y()) ?? oe()[0]), re = A(() => y() === "background" ? bt.map((t) => ({
430
- id: t.tool,
431
- kind: "tool",
432
- label: t.label,
433
- icon: t.icon
434
- })) : [...wt.map((t) => ({
435
- id: t.tool,
436
- kind: "tool",
437
- label: t.label,
438
- icon: t.icon
439
- })), ...e.widgetDefinitions.map((t) => ({
440
- id: t.type,
441
- kind: "widget",
442
- label: t.label,
443
- icon: t.icon
444
- }))]), ve = A(() => y() === "background" ? [] : [...e.dockItems ?? []]), ie = A(() => ve().filter((t) => t.dockPlacement !== "after-components")), fe = A(() => ve().filter((t) => t.dockPlacement === "after-components")), G = A(() => y() === "background" ? [] : [...e.dockActions ?? []]), ke = A(() => re().map((t) => String(t.id))), ae = () => y() !== "background", Oe = (t) => !ae() || e.filters[t] !== !1, Ae = (t) => {
429
+ }))), ge = A(() => oe().find((t) => t.mode === y()) ?? oe()[0]), re = A(() => {
430
+ if (y() === "background")
431
+ return Mt.map((c) => ({
432
+ id: c.tool,
433
+ kind: "tool",
434
+ label: c.label,
435
+ icon: c.icon
436
+ }));
437
+ const t = [...Pt.map((c) => ({
438
+ id: c.tool,
439
+ kind: "tool",
440
+ label: c.label,
441
+ icon: c.icon
442
+ })), ...e.widgetDefinitions.map((c) => ({
443
+ id: c.type,
444
+ kind: "widget",
445
+ label: c.label,
446
+ icon: c.icon
447
+ }))], n = new Map(e.componentOrder?.map((c, w) => [c, w]));
448
+ return t.sort((c, w) => (n.get(c.id) ?? Number.MAX_SAFE_INTEGER) - (n.get(w.id) ?? Number.MAX_SAFE_INTEGER));
449
+ }), ve = A(() => y() === "background" ? [] : [...e.dockItems ?? []]), fe = A(() => ve().filter((t) => t.dockPlacement !== "after-components")), ke = A(() => ve().filter((t) => t.dockPlacement === "after-components")), me = A(() => y() === "background" ? [] : [...e.dockActions ?? []]), j = A(() => me().filter((t) => t.dockPlacement !== "after-components")), he = A(() => me().filter((t) => t.dockPlacement === "after-components")), be = () => j().length + fe().length + 1, ie = () => be() + re().length, we = () => ie() + he().length, _e = (t) => s(yt, {
450
+ get action() {
451
+ return t.action;
452
+ },
453
+ get hoverOffset() {
454
+ return x(t.slot);
455
+ },
456
+ onEnter: () => l(t.slot),
457
+ onLeave: () => l((n) => n === t.slot ? null : n),
458
+ onActivate: (n) => {
459
+ e.onDockActivation?.({
460
+ kind: "action",
461
+ id: t.action.id
462
+ }), t.action.onActivate(n);
463
+ }
464
+ }), Ee = A(() => re().map((t) => String(t.id))), ae = () => y() !== "background", Re = (t) => !ae() || e.filters[t] !== !1, He = (t) => {
445
465
  if (!ae())
446
466
  return !1;
447
- const n = ke();
448
- return n.length > 1 && n.every((f) => e.filters[f] !== !1 == (f === t));
449
- }, $e = (t, n) => v() === "focus-cycle" ? e.resolveItemPresentation?.({
467
+ const n = Ee();
468
+ return n.length > 1 && n.every((c) => e.filters[c] !== !1 == (c === t));
469
+ }, Ke = (t, n) => v() === "focus-cycle" ? e.resolveItemPresentation?.({
450
470
  kind: t,
451
471
  id: n
452
- }) : void 0, ce = () => g() === 0, Xe = () => ({
472
+ }) : void 0, ce = () => g() === 0, Ne = () => ({
453
473
  scale: 1,
454
474
  y: 0,
455
475
  x: 0
456
476
  }), le = (t) => {
457
477
  const n = i();
458
478
  return !!(n?.kind === "external" && n.moved && n.dockPlacement === t);
459
- }, me = () => (() => {
460
- var t = dt();
461
- return m(t, d(R, {
479
+ }, De = () => (() => {
480
+ var t = kt();
481
+ return k(t, s(R, {
462
482
  get when() {
463
- return Te();
483
+ return Be();
464
484
  },
465
485
  children: (n) => {
466
- const f = n();
467
- return d(f, {
486
+ const c = n();
487
+ return s(c, {
468
488
  class: "workbench-dock__icon"
469
489
  });
470
490
  }
471
491
  })), K(() => t.classList.toggle("is-drop-allowed", !!i()?.overDock)), t;
472
492
  })();
473
493
  return [(() => {
474
- var t = gt(), n = t.firstChild, f = n.firstChild, E = n.nextSibling;
475
- t.addEventListener("pointerleave", () => c(null));
476
- var L = w;
477
- return typeof L == "function" ? Ve(L, t) : w = t, f.$$click = () => {
494
+ var t = bt(), n = t.firstChild, c = n.firstChild, w = n.nextSibling;
495
+ t.addEventListener("pointerleave", () => l(null));
496
+ var I = b;
497
+ return typeof I == "function" ? Qe(I, t) : b = t, c.$$click = () => {
478
498
  e.onDockActivation?.({
479
499
  kind: "mode",
480
500
  id: y()
481
501
  }), P((o) => !o);
482
- }, f.addEventListener("pointerleave", () => c((o) => o === 0 ? null : o)), f.addEventListener("pointerenter", () => c(0)), m(f, d(W.span, {
502
+ }, c.addEventListener("pointerleave", () => l((o) => o === 0 ? null : o)), c.addEventListener("pointerenter", () => l(0)), k(c, s(N.span, {
483
503
  class: "workbench-dock__tile",
484
504
  get animate() {
485
- return Xe();
505
+ return Ne();
486
506
  },
487
507
  get transition() {
488
508
  return {
489
- duration: V.fast,
490
- easing: N.easeOut
509
+ duration: G.fast,
510
+ easing: W.easeOut
491
511
  };
492
512
  },
493
513
  get children() {
494
514
  return (() => {
495
515
  const o = ge().icon;
496
- return d(o, {
516
+ return s(o, {
497
517
  class: "workbench-dock__icon"
498
518
  });
499
519
  })();
500
520
  }
501
- }), null), m(f, d(W.span, {
521
+ }), null), k(c, s(N.span, {
502
522
  class: "workbench-dock__tooltip",
503
523
  get animate() {
504
524
  return {
505
- opacity: ce() && !_() ? 1 : 0,
506
- y: ce() && !_() ? -6 : 0
525
+ opacity: ce() && !E() ? 1 : 0,
526
+ y: ce() && !E() ? -6 : 0
507
527
  };
508
528
  },
509
529
  get transition() {
510
530
  return {
511
- duration: V.fast,
512
- easing: N.easeOut
531
+ duration: G.fast,
532
+ easing: W.easeOut
513
533
  };
514
534
  },
515
535
  get children() {
516
536
  return ge().label;
517
537
  }
518
- }), null), m(n, d(R, {
538
+ }), null), k(n, s(R, {
519
539
  get when() {
520
- return _();
540
+ return E();
521
541
  },
522
542
  get children() {
523
- var o = st();
524
- return m(o, d(te, {
543
+ var o = mt();
544
+ return k(o, s(te, {
525
545
  get each() {
526
546
  return oe();
527
547
  },
528
- children: (b) => {
529
- const h = b.icon;
548
+ children: (h) => {
549
+ const _ = h.icon;
530
550
  return (() => {
531
- var s = vt(), C = s.firstChild, T = C.nextSibling, u = T.firstChild, O = u.nextSibling;
532
- return s.$$click = () => {
551
+ var m = wt(), C = m.firstChild, O = C.nextSibling, u = O.firstChild, T = u.nextSibling;
552
+ return m.$$click = () => {
533
553
  e.onDockActivation?.({
534
554
  kind: "mode",
535
- id: b.mode
536
- }), e.onSelectMode?.(b.mode), P(!1);
537
- }, m(C, d(h, {
555
+ id: h.mode
556
+ }), e.onSelectMode?.(h.mode), P(!1);
557
+ }, k(C, s(_, {
538
558
  class: "workbench-dock__mode-icon"
539
- })), m(u, () => b.label), m(O, () => b.description), K((k) => {
540
- var J = y() === b.mode, Q = y() === b.mode;
541
- return J !== k.e && s.classList.toggle("is-active", k.e = J), Q !== k.t && I(s, "aria-checked", k.t = Q), k;
559
+ })), k(u, () => h.label), k(T, () => h.description), K((f) => {
560
+ var J = y() === h.mode, Q = y() === h.mode;
561
+ return J !== f.e && m.classList.toggle("is-active", f.e = J), Q !== f.t && L(m, "aria-checked", f.t = Q), f;
542
562
  }, {
543
563
  e: void 0,
544
564
  t: void 0
545
- }), s;
565
+ }), m;
546
566
  })();
547
567
  }
548
568
  })), o;
549
569
  }
550
- }), null), m(t, d(Ue, {
570
+ }), null), k(t, s(ye, {
551
571
  get each() {
552
- return G();
572
+ return j();
553
573
  },
554
- children: (o, b) => {
555
- const h = () => b + 1;
556
- return d(Ct, {
557
- get action() {
558
- return o();
559
- },
560
- get hoverOffset() {
561
- return M(h());
562
- },
563
- onEnter: () => c(h()),
564
- onLeave: () => c((s) => s === h() ? null : s),
565
- onActivate: (s) => {
566
- e.onDockActivation?.({
567
- kind: "action",
568
- id: o().id
569
- }), o().onActivate(s);
570
- }
571
- });
572
- }
573
- }), E), m(t, d(R, {
574
+ children: (o, h) => s(_e, {
575
+ get action() {
576
+ return o();
577
+ },
578
+ slot: h + 1
579
+ })
580
+ }), w), k(t, s(R, {
574
581
  get when() {
575
582
  return le("before-components");
576
583
  },
577
584
  get children() {
578
- return d(me, {});
585
+ return s(De, {});
579
586
  }
580
- }), E), m(t, d(te, {
587
+ }), w), k(t, s(te, {
581
588
  get each() {
582
- return ie();
589
+ return fe();
583
590
  },
584
- children: (o, b) => {
585
- const h = () => b() + G().length + 1;
586
- return d(se, {
591
+ children: (o, h) => {
592
+ const _ = () => h() + j().length + 1;
593
+ return s(de, {
587
594
  get id() {
588
595
  return o.id;
589
596
  },
@@ -603,7 +610,7 @@ function Bt(e) {
603
610
  return v();
604
611
  },
605
612
  get hoverOffset() {
606
- return M(h());
613
+ return x(_());
607
614
  },
608
615
  get isDragging() {
609
616
  return B(() => i()?.kind === "host")() && i()?.id === o.id;
@@ -614,19 +621,19 @@ function Bt(e) {
614
621
  get onContextMenu() {
615
622
  return o.onContextMenu;
616
623
  },
617
- onKeyboardActivate: (s) => Y("host", o.id, o.label, s),
618
- onEnter: () => c(h()),
619
- onLeave: () => c((s) => s === h() ? null : s),
620
- onDragBegin: F
624
+ onKeyboardActivate: (m) => F("host", o.id, o.label, m),
625
+ onEnter: () => l(_()),
626
+ onLeave: () => l((m) => m === _() ? null : m),
627
+ onDragBegin: Y
621
628
  });
622
629
  }
623
- }), E), m(t, d(te, {
630
+ }), w), k(t, s(te, {
624
631
  get each() {
625
632
  return re();
626
633
  },
627
- children: (o, b) => {
628
- const h = () => b() + G().length + ie().length + 1, s = () => $e(o.kind, o.id);
629
- return d(se, {
634
+ children: (o, h) => {
635
+ const _ = () => h() + be(), m = () => Ke(o.kind, o.id);
636
+ return s(de, {
630
637
  get id() {
631
638
  return String(o.id);
632
639
  },
@@ -640,10 +647,10 @@ function Bt(e) {
640
647
  return o.icon;
641
648
  },
642
649
  get active() {
643
- return s()?.active ?? Ae(String(o.id));
650
+ return m()?.active ?? He(String(o.id));
644
651
  },
645
652
  get visible() {
646
- return B(() => v() === "focus-cycle")() ? !0 : Oe(String(o.id));
653
+ return B(() => v() === "focus-cycle")() ? !0 : Re(String(o.id));
647
654
  },
648
655
  get filterable() {
649
656
  return B(() => v() === "solo-filter")() && ae();
@@ -652,13 +659,13 @@ function Bt(e) {
652
659
  return v();
653
660
  },
654
661
  get presentation() {
655
- return s();
662
+ return m();
656
663
  },
657
664
  get hoverOffset() {
658
- return M(h());
665
+ return x(_());
659
666
  },
660
667
  get isDragging() {
661
- return B(() => o.kind === "widget")() ? ye() === o.id : Se() === o.id;
668
+ return B(() => o.kind === "widget")() ? Fe() === o.id : Ye() === o.id;
662
669
  },
663
670
  get canvasPlacement() {
664
671
  return B(() => o.kind === "widget")() ? {
@@ -666,35 +673,47 @@ function Bt(e) {
666
673
  kind: "widget",
667
674
  id: o.id
668
675
  },
669
- onDrop: (C, T, u) => e.onCreateAt?.(o.id, C, T, u)
676
+ onDrop: (C, O, u) => e.onCreateAt?.(o.id, C, O, u)
670
677
  } : {
671
678
  preview: {
672
679
  kind: "tool",
673
680
  id: o.id
674
681
  },
675
- onDrop: (C, T, u) => e.onCreateToolAt?.(o.id, C, T, u)
682
+ onDrop: (C, O, u) => e.onCreateToolAt?.(o.id, C, O, u)
676
683
  };
677
684
  },
678
- onEnter: () => c(h()),
679
- onLeave: () => c((C) => C === h() ? null : C),
680
- onKeyboardActivate: (C) => Y(o.kind, o.id, o.label, C),
681
- onDragBegin: F
685
+ onEnter: () => l(_()),
686
+ onLeave: () => l((C) => C === _() ? null : C),
687
+ onKeyboardActivate: (C) => F(o.kind, o.id, o.label, C),
688
+ onDragBegin: Y
682
689
  });
683
690
  }
684
- }), null), m(t, d(R, {
691
+ }), null), k(t, s(ye, {
692
+ get each() {
693
+ return he();
694
+ },
695
+ children: (o, h) => s(_e, {
696
+ get action() {
697
+ return o();
698
+ },
699
+ get slot() {
700
+ return h + ie();
701
+ }
702
+ })
703
+ }), null), k(t, s(R, {
685
704
  get when() {
686
- return fe().length > 0 || le("after-components");
705
+ return ke().length > 0 || le("after-components");
687
706
  },
688
707
  get children() {
689
- return ut();
708
+ return ht();
690
709
  }
691
- }), null), m(t, d(te, {
710
+ }), null), k(t, s(te, {
692
711
  get each() {
693
- return fe();
712
+ return ke();
694
713
  },
695
- children: (o, b) => {
696
- const h = () => b() + G().length + ie().length + re().length + 1;
697
- return d(se, {
714
+ children: (o, h) => {
715
+ const _ = () => h() + we();
716
+ return s(de, {
698
717
  get id() {
699
718
  return o.id;
700
719
  },
@@ -714,7 +733,7 @@ function Bt(e) {
714
733
  return v();
715
734
  },
716
735
  get hoverOffset() {
717
- return M(h());
736
+ return x(_());
718
737
  },
719
738
  get isDragging() {
720
739
  return B(() => i()?.kind === "host")() && i()?.id === o.id;
@@ -725,70 +744,70 @@ function Bt(e) {
725
744
  get onContextMenu() {
726
745
  return o.onContextMenu;
727
746
  },
728
- onKeyboardActivate: (s) => Y("host", o.id, o.label, s),
729
- onEnter: () => c(h()),
730
- onLeave: () => c((s) => s === h() ? null : s),
731
- onDragBegin: F
747
+ onKeyboardActivate: (m) => F("host", o.id, o.label, m),
748
+ onEnter: () => l(_()),
749
+ onLeave: () => l((m) => m === _() ? null : m),
750
+ onDragBegin: Y
732
751
  });
733
752
  }
734
- }), null), m(t, d(R, {
753
+ }), null), k(t, s(R, {
735
754
  get when() {
736
755
  return le("after-components");
737
756
  },
738
757
  get children() {
739
- return d(me, {});
758
+ return s(De, {});
740
759
  }
741
760
  }), null), K((o) => {
742
- var b = `workbench-dock workbench-dock-material${i()?.kind === "external" && i()?.moved ? " is-external-drop-target" : ""}${i()?.kind === "external" && i()?.overDock ? " is-external-drop-allowed" : ""}`, h = y() === "background", s = !!(ce() || _()), C = _();
743
- return b !== o.e && He(t, o.e = b), h !== o.t && f.classList.toggle("is-active", o.t = h), s !== o.a && f.classList.toggle("is-hovered", o.a = s), C !== o.o && I(f, "aria-expanded", o.o = C), o;
761
+ var h = `workbench-dock workbench-dock-material${i()?.kind === "external" && i()?.moved ? " is-external-drop-target" : ""}${i()?.kind === "external" && i()?.overDock ? " is-external-drop-allowed" : ""}`, _ = y() === "background", m = !!(ce() || E()), C = E();
762
+ return h !== o.e && qe(t, o.e = h), _ !== o.t && c.classList.toggle("is-active", o.t = _), m !== o.a && c.classList.toggle("is-hovered", o.a = m), C !== o.o && L(c, "aria-expanded", o.o = C), o;
744
763
  }, {
745
764
  e: void 0,
746
765
  t: void 0,
747
766
  a: void 0,
748
767
  o: void 0
749
768
  }), t;
750
- })(), d(R, {
769
+ })(), s(R, {
751
770
  get when() {
752
771
  return !!(i()?.moved && !i()?.preview);
753
772
  },
754
773
  get children() {
755
- return d(Pt, {
774
+ return s(St, {
756
775
  state: i
757
776
  });
758
777
  }
759
778
  })];
760
779
  }
761
- function Pt(e) {
780
+ function St(e) {
762
781
  const g = () => {
763
- const l = e.state();
764
- return l ? `translate3d(${l.clientX + 14}px, ${l.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
765
- }, c = () => e.state()?.label ?? "", i = () => e.state()?.icon;
766
- return d(We, {
782
+ const d = e.state();
783
+ return d ? `translate3d(${d.clientX + 14}px, ${d.clientY - 56}px, 0)` : "translate3d(0px, 0px, 0)";
784
+ }, l = () => e.state()?.label ?? "", i = () => e.state()?.icon;
785
+ return s(ze, {
767
786
  get children() {
768
- var l = ft(), _ = l.firstChild, P = _.nextSibling, w = P.firstChild, r = w.nextSibling, a = r.firstChild, D = a.nextSibling, x = D.firstChild;
769
- return m(w, d(R, {
787
+ var d = _t(), E = d.firstChild, P = E.nextSibling, b = P.firstChild, r = b.nextSibling, a = r.firstChild, D = a.nextSibling, M = D.firstChild;
788
+ return k(b, s(R, {
770
789
  get when() {
771
790
  return i();
772
791
  },
773
792
  children: (v) => {
774
- const M = v();
775
- return d(M, {
793
+ const x = v();
794
+ return s(x, {
776
795
  class: "w-4 h-4"
777
796
  });
778
797
  }
779
- })), m(a, c), m(D, d(qe, {
798
+ })), k(a, l), k(D, s(pe, {
780
799
  class: "w-3 h-3"
781
- }), x), m(x, () => e.state()?.kind === "external" ? "Pin to Dock" : "Drag onto canvas"), K((v) => {
782
- var M = !!(e.state()?.kind === "external" && e.state()?.overDock), X = g();
783
- return M !== v.e && l.classList.toggle("is-over-dock", v.e = M), X !== v.t && Ne(l, "transform", v.t = X), v;
800
+ }), M), k(M, () => e.state()?.kind === "external" ? "Pin to Dock" : "Drag onto canvas"), K((v) => {
801
+ var x = !!(e.state()?.kind === "external" && e.state()?.overDock), X = g();
802
+ return x !== v.e && d.classList.toggle("is-over-dock", v.e = x), X !== v.t && je(d, "transform", v.t = X), v;
784
803
  }, {
785
804
  e: void 0,
786
805
  t: void 0
787
- }), l;
806
+ }), d;
788
807
  }
789
808
  });
790
809
  }
791
- Ge(["pointerdown", "click", "contextmenu", "keydown"]);
810
+ Ze(["pointerdown", "click", "contextmenu", "keydown"]);
792
811
  export {
793
- Bt as WorkbenchDock
812
+ Gt as WorkbenchDock
794
813
  };
@@ -2,7 +2,7 @@ import { type WorkbenchCompositionMessages } from './workbenchCompositionMessage
2
2
  import { type UIFirstSelectionEvent } from '../../utils/uiFirstSelection';
3
3
  import { type WorkbenchContextMenuItem } from './WorkbenchContextMenu';
4
4
  import { type WorkbenchDockItemActivation, type WorkbenchDockItemActivationMode, type WorkbenchDockAction, type WorkbenchDockModeIcons, type WorkbenchExternalDockDragController, type WorkbenchHostDockItem } from './WorkbenchFilterBar';
5
- import type { WorkbenchState, WorkbenchAnnotationItem, WorkbenchBackgroundLayer, WorkbenchBackgroundLayerDefaults, WorkbenchBackgroundLayerPatch, WorkbenchContextMenuState, WorkbenchInteractionAdapter, WorkbenchStickyNoteItem, WorkbenchStickyNotePatch, WorkbenchTextAnnotationDefaults, WorkbenchTextAnnotationPatch, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
5
+ import type { WorkbenchState, WorkbenchAnnotationItem, WorkbenchBackgroundLayer, WorkbenchBackgroundLayerDefaults, WorkbenchBackgroundLayerPatch, WorkbenchContextMenuState, WorkbenchDockToolId, WorkbenchInteractionAdapter, WorkbenchStickyNoteItem, WorkbenchStickyNotePatch, WorkbenchTextAnnotationDefaults, WorkbenchTextAnnotationPatch, WorkbenchWidgetDefinition, WorkbenchWidgetItem, WorkbenchWidgetType } from './types';
6
6
  export interface WorkbenchCreateAtOptions {
7
7
  worldX?: number;
8
8
  worldY?: number;
@@ -74,6 +74,8 @@ export interface WorkbenchSurfaceProps {
74
74
  * backward compatibility. Drag-to-create and host Dock items are unchanged.
75
75
  */
76
76
  dockItemActivationMode?: WorkbenchDockItemActivationMode;
77
+ /** Orders work-mode Dock widgets and tools; unlisted entries follow in their existing order. */
78
+ dockComponentOrder?: readonly (WorkbenchWidgetType | WorkbenchDockToolId)[];
77
79
  onDockItemClick?: (item: WorkbenchDockItemActivation) => boolean | void;
78
80
  /** Host artwork for the Dock mode trigger and its menu. */
79
81
  dockModeIcons?: WorkbenchDockModeIcons;
@@ -1,7 +1,7 @@
1
1
  import { createComponent as l, use as at, spread as dt, mergeProps as st, insert as C, Portal as ut, addEventListener as lt, template as P, delegateEvents as gt } from "solid-js/web";
2
2
  import { WorkbenchCompositionActionsContext as ft, WorkbenchCompositionMessagesContext as wt } from "./workbenchCompositionMessages.js";
3
3
  import { createMemo as k, createSignal as I, untrack as h, createEffect as b, onCleanup as W, Show as kt } from "solid-js";
4
- import { clientToCanvasWorld as O } from "../ui/canvasGeometry.js";
4
+ import { clientToCanvasWorld as E } from "../ui/canvasGeometry.js";
5
5
  import { createUIFirstSelection as mt } from "../../utils/uiFirstSelection.js";
6
6
  import { WorkbenchCanvas as vt } from "./WorkbenchCanvas.js";
7
7
  import { WorkbenchContextMenu as yt } from "./WorkbenchContextMenu.js";
@@ -15,8 +15,8 @@ import { useWorkbenchModel as Dt } from "./useWorkbenchModel.js";
15
15
  import { sortWorkbenchDockFocusCandidates as Mt, workbenchDockFocusCandidateKey as R, resolveWorkbenchDockFocusCycle as Lt } from "./workbenchDockFocusCycle.js";
16
16
  import { resolveWorkbenchInteractionAdapter as Ft } from "./workbenchInteractionAdapter.js";
17
17
  import { SURFACE_PORTAL_LAYER_ATTR as Tt, DIALOG_SURFACE_HOST_ATTR as Bt } from "../ui/dialogSurfaceScope.js";
18
- var _t = /* @__PURE__ */ P("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), Et = /* @__PURE__ */ P("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
19
- const Ot = "F1";
18
+ var _t = /* @__PURE__ */ P("<div class=workbench-menu-backdrop data-floe-workbench-boundary=true>"), Ot = /* @__PURE__ */ P("<div><div class=workbench-surface__body data-floe-workbench-canvas-frame=true>");
19
+ const Et = "F1";
20
20
  function N(c) {
21
21
  if (c)
22
22
  try {
@@ -290,7 +290,7 @@ function ee(c) {
290
290
  c.onApiReady?.(null);
291
291
  });
292
292
  });
293
- const E = () => c.lockShortcut === void 0 ? Ot : c.lockShortcut;
293
+ const O = () => c.lockShortcut === void 0 ? Et : c.lockShortcut;
294
294
  b(() => {
295
295
  if (typeof window > "u" || !e.contextMenu.state()) return;
296
296
  const t = bt({
@@ -315,7 +315,7 @@ function ee(c) {
315
315
  });
316
316
  }), b(() => {
317
317
  if (c.enableKeyboard === !1 || typeof document > "u") return;
318
- const t = E(), n = (o) => {
318
+ const t = O(), n = (o) => {
319
319
  if (!(o.defaultPrevented || o.isComposing)) {
320
320
  if (t !== null && o.key === t) {
321
321
  o.preventDefault(), e.lock.toggle();
@@ -353,14 +353,14 @@ function ee(c) {
353
353
  if (o?.worldPoint)
354
354
  return o.worldPoint;
355
355
  if (o?.canvasFrame)
356
- return O(o.canvasFrame, e.viewport(), {
356
+ return E(o.canvasFrame, e.viewport(), {
357
357
  clientX: t,
358
358
  clientY: n
359
359
  });
360
360
  const r = g()?.querySelector('[data-floe-workbench-canvas-frame="true"]');
361
361
  if (!r) return null;
362
362
  const i = r.getBoundingClientRect();
363
- return O(i, e.viewport(), {
363
+ return E(i, e.viewport(), {
364
364
  clientX: t,
365
365
  clientY: n
366
366
  });
@@ -423,7 +423,7 @@ function ee(c) {
423
423
  return l(wt.Provider, {
424
424
  value: X,
425
425
  get children() {
426
- var t = Et(), n = t.firstChild;
426
+ var t = Ot(), n = t.firstChild;
427
427
  return at(z, t), dt(t, st({
428
428
  get class() {
429
429
  return `workbench-surface${c.class ? ` ${c.class}` : ""}`;
@@ -596,7 +596,7 @@ function ee(c) {
596
596
  return e.lock.toggle;
597
597
  },
598
598
  get shortcutLabel() {
599
- return E() ?? void 0;
599
+ return O() ?? void 0;
600
600
  }
601
601
  }), null), C(t, l(At, {
602
602
  get widgetDefinitions() {
@@ -641,6 +641,9 @@ function ee(c) {
641
641
  get dockActions() {
642
642
  return c.dockActions;
643
643
  },
644
+ get componentOrder() {
645
+ return c.dockComponentOrder;
646
+ },
644
647
  get dockItems() {
645
648
  return c.dockItems;
646
649
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.86.24",
3
+ "version": "0.86.25",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",