@floegence/floe-webapp-core 0.45.0 → 0.46.0

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