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