@floegence/floe-webapp-core 0.36.28 → 0.36.30

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,87 +1,92 @@
1
- import { spread as G, mergeProps as kt, insert as l, createComponent as w, memo as $t, template as et, use as yt, delegateEvents as pt } from "solid-js/web";
2
- import { createMemo as g, createSignal as T, onCleanup as K, untrack as f, createEffect as It } from "solid-js";
3
- import { startHotInteraction as xt } from "../../utils/hotInteraction.js";
4
- import { X as U, Minus as J, Maximize as Q, GripVertical as Mt } from "../icons/index.js";
5
- import { CANVAS_WHEEL_INTERACTIVE_ATTR as Ct, WORKBENCH_WIDGET_SHELL_ATTR as Tt, resolveWorkbenchWidgetLocalTypingTarget as Wt, shouldActivateWorkbenchWidgetLocalTarget as Lt } from "../ui/localInteractionSurface.js";
6
- import { startPointerSession as tt } from "../ui/pointerSession.js";
7
- import { createWorkbenchWidgetSurfaceMetrics as Pt } from "./workbenchHelpers.js";
8
- import { resolveWorkbenchInteractionAdapter as zt } from "./workbenchInteractionAdapter.js";
9
- var Et = /* @__PURE__ */ et('<article class=workbench-widget><header class=workbench-widget__header><span class=workbench-widget__traffic role=group aria-label="Window controls"><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--close"aria-label="Close widget"title="Close widget"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button></span><span class=workbench-widget__badge aria-hidden=true></span><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title-dot aria-hidden=true></span><span class=workbench-widget__title></span></div><span class=workbench-widget__window-controls role=group aria-label="Window controls"><button type=button class="workbench-widget__window-control workbench-widget__window-control--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--close"aria-label="Remove widget"title="Remove widget"data-floe-canvas-interactive=true></button></span></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), Rt = /* @__PURE__ */ et('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
10
- const At = 220, Dt = 160;
11
- function Nt(e) {
12
- const s = g(() => zt(e.interactionAdapter)), [k, W] = T(null), [$, L] = T(null), [it, nt] = T(), [P, z] = T(!1);
13
- let m, _, ot = 0, rt = 0, b = null;
14
- const v = /* @__PURE__ */ new Map();
15
- let d;
16
- const D = (t, i) => {
17
- const a = xt({
1
+ import { spread as nt, mergeProps as Wt, insert as l, createComponent as g, memo as Et, effect as Lt, style as zt, template as st, use as Rt, delegateEvents as At } from "solid-js/web";
2
+ import { createMemo as d, createSignal as k, onCleanup as ot, untrack as m, createEffect as rt } from "solid-js";
3
+ import { startHotInteraction as Dt } from "../../utils/hotInteraction.js";
4
+ import { X as at, Minus as ct, Maximize as lt, GripVertical as Xt } from "../icons/index.js";
5
+ import { CANVAS_WHEEL_INTERACTIVE_ATTR as Yt, WORKBENCH_WIDGET_SHELL_ATTR as jt, resolveWorkbenchWidgetLocalTypingTarget as Ft, shouldActivateWorkbenchWidgetLocalTarget as Ht } from "../ui/localInteractionSurface.js";
6
+ import { startPointerSession as dt } from "../ui/pointerSession.js";
7
+ import { createWorkbenchWidgetSurfaceMetrics as Ot, resolveWorkbenchProjectedSurfaceScaleBehavior as qt } from "./workbenchHelpers.js";
8
+ import { resolveWorkbenchInteractionAdapter as Bt } from "./workbenchInteractionAdapter.js";
9
+ var Nt = /* @__PURE__ */ st('<article class=workbench-widget><div class=workbench-widget__surface><header class=workbench-widget__header><span class=workbench-widget__traffic role=group aria-label="Window controls"><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--close"aria-label="Close widget"title="Close widget"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__traffic-dot workbench-widget__traffic-dot--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button></span><span class=workbench-widget__badge aria-hidden=true></span><button type=button class=workbench-widget__drag aria-label="Drag widget"data-floe-canvas-interactive=true></button><div class=workbench-widget__title-area><span class=workbench-widget__title-dot aria-hidden=true></span><span class=workbench-widget__title></span></div><span class=workbench-widget__window-controls role=group aria-label="Window controls"><button type=button class="workbench-widget__window-control workbench-widget__window-control--min"aria-label="Minimize widget to overview"title="Minimize widget to overview"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--max"aria-label="Zoom widget to fit viewport"title="Zoom widget to fit viewport"data-floe-canvas-interactive=true></button><button type=button class="workbench-widget__window-control workbench-widget__window-control--close"aria-label="Remove widget"title="Remove widget"data-floe-canvas-interactive=true></button></span></header><div class=workbench-widget__body data-floe-canvas-interactive=true>'), Vt = /* @__PURE__ */ st('<div class=workbench-widget__resize aria-label="Resize widget"data-floe-canvas-interactive=true><svg class=workbench-widget__resize-glyph viewBox="0 0 12 12"aria-hidden=true><path d="M12 0 L0 12"></path><path d="M12 4 L4 12"></path><path d="M12 8 L8 12">');
10
+ const Zt = 220, Gt = 160, Jt = 160;
11
+ function re(e) {
12
+ const w = d(() => Bt(e.interactionAdapter)), [y, L] = k(null), [x, z] = k(null), [wt, ut] = k(), [R, A] = k(!1), [B, I] = k({
13
+ enabled: !1,
14
+ scale: 1
15
+ });
16
+ let _, b, gt = 0, ht = 0, v = null, S;
17
+ const p = /* @__PURE__ */ new Map();
18
+ let s;
19
+ const M = () => {
20
+ typeof window > "u" || S === void 0 || (window.clearTimeout(S), S = void 0);
21
+ }, N = (t, i) => {
22
+ const n = Dt({
18
23
  kind: t,
19
24
  cursor: i
20
25
  });
21
- let n = !1;
22
- return f(() => e.onLayoutInteractionStart?.()), () => {
23
- n || (n = !0, a(), f(() => e.onLayoutInteractionEnd?.()));
26
+ let r = !1;
27
+ return m(() => e.onLayoutInteractionStart?.()), () => {
28
+ r || (r = !0, n(), m(() => e.onLayoutInteractionEnd?.()));
24
29
  };
25
30
  };
26
- K(() => {
27
- m?.stop({
31
+ ot(() => {
32
+ _?.stop({
28
33
  reason: "manual_stop",
29
34
  commit: !1
30
- }), m = void 0, _?.stop({
35
+ }), _ = void 0, b?.stop({
31
36
  reason: "manual_stop",
32
37
  commit: !1
33
- }), _ = void 0, f(k)?.stopInteraction(), f($)?.stopInteraction();
38
+ }), b = void 0, m(y)?.stopInteraction(), m(x)?.stopInteraction(), M();
34
39
  });
35
- const y = () => {
36
- z(!1), e.onSelect(e.widgetId), e.onCommitFront(e.widgetId);
37
- }, E = () => {
38
- z(!1);
39
- }, S = g(() => e.selected || P()), at = (t, i, a) => {
40
- const n = {
41
- token: ++rt,
40
+ const T = () => {
41
+ A(!1), e.onSelect(e.widgetId), e.onCommitFront(e.widgetId);
42
+ }, D = () => {
43
+ A(!1);
44
+ }, $ = d(() => e.selected || R()), ft = (t, i, n) => {
45
+ const r = {
46
+ token: ++ht,
42
47
  wasSelected: i,
43
- ownership: a
48
+ ownership: n
44
49
  };
45
- v.set(t, n), !i && a === "widget_local" && z(!0), queueMicrotask(() => {
46
- v.get(t)?.token === n.token && v.delete(t);
50
+ p.set(t, r), !i && n === "widget_local" && A(!0), queueMicrotask(() => {
51
+ p.get(t)?.token === r.token && p.delete(t);
47
52
  });
48
- }, ct = (t) => {
49
- const i = v.get(t) ?? null;
50
- return i && v.delete(t), i;
53
+ }, mt = (t) => {
54
+ const i = p.get(t) ?? null;
55
+ return i && p.delete(t), i;
51
56
  };
52
- It(() => {
53
- const t = d;
57
+ rt(() => {
58
+ const t = s;
54
59
  if (!t) return;
55
- const i = (o) => {
56
- o.button === 0 && at(o.pointerId, S(), p(o.target));
57
- }, a = (o) => {
58
- o.button === 0 && P() && p(o.target) === "widget_local" && y();
59
- }, n = () => {
60
+ const i = (a) => {
61
+ a.button === 0 && ft(a.pointerId, $(), C(a.target));
62
+ }, n = (a) => {
63
+ a.button === 0 && R() && C(a.target) === "widget_local" && T();
64
+ }, r = () => {
60
65
  setTimeout(() => {
61
- e.selected || E();
66
+ e.selected || D();
62
67
  }, 0);
63
68
  };
64
- t.addEventListener("pointerdown", i, !0), t.addEventListener("click", a, !0), t.addEventListener("pointerup", n), t.addEventListener("pointercancel", E), K(() => {
65
- t.removeEventListener("pointerdown", i, !0), t.removeEventListener("click", a, !0), t.removeEventListener("pointerup", n), t.removeEventListener("pointercancel", E);
69
+ t.addEventListener("pointerdown", i, !0), t.addEventListener("click", n, !0), t.addEventListener("pointerup", r), t.addEventListener("pointercancel", D), ot(() => {
70
+ t.removeEventListener("pointerdown", i, !0), t.removeEventListener("click", n, !0), t.removeEventListener("pointerup", r), t.removeEventListener("pointercancel", D);
66
71
  });
67
72
  });
68
- const X = () => k() !== null, Y = () => $() !== null, lt = g(() => e.filtered ? "cold" : S() ? "hot" : "warm"), p = (t) => s().resolveWidgetEventOwnership({
73
+ const X = () => y() !== null, Y = () => x() !== null, _t = d(() => e.filtered ? "cold" : $() ? "hot" : "warm"), C = (t) => w().resolveWidgetEventOwnership({
69
74
  target: t,
70
- widgetRoot: d ?? null,
71
- interactiveSelector: s().interactiveSelector,
72
- panSurfaceSelector: s().panSurfaceSelector
73
- }), dt = () => {
74
- y(), d?.focus({
75
+ widgetRoot: s ?? null,
76
+ interactiveSelector: w().interactiveSelector,
77
+ panSurfaceSelector: w().panSurfaceSelector
78
+ }), bt = () => {
79
+ T(), s?.focus({
75
80
  preventScroll: !0
76
81
  });
77
- }, F = (t) => {
78
- nt((i) => ({
82
+ }, V = (t) => {
83
+ ut((i) => ({
79
84
  seq: (i?.seq ?? 0) + 1,
80
85
  source: "local_pointer",
81
86
  pointerType: t
82
87
  }));
83
- }, st = (t) => {
84
- if (!(!d || !t.isConnected || !d.contains(t)))
88
+ }, vt = (t) => {
89
+ if (!(!s || !t.isConnected || !s.contains(t)))
85
90
  try {
86
91
  t.focus({
87
92
  preventScroll: !0
@@ -89,58 +94,58 @@ function Nt(e) {
89
94
  } catch {
90
95
  t.focus();
91
96
  }
92
- }, wt = (t, i) => {
93
- b = {
94
- token: ++ot,
97
+ }, St = (t, i) => {
98
+ v = {
99
+ token: ++gt,
95
100
  pointerId: t,
96
101
  target: i,
97
102
  timestamp: Date.now()
98
103
  };
99
- const a = b;
104
+ const n = v;
100
105
  queueMicrotask(() => {
101
- const n = () => {
102
- !a || b?.token !== a.token || (st(a.target), b = null);
106
+ const r = () => {
107
+ !n || v?.token !== n.token || (vt(n.target), v = null);
103
108
  };
104
109
  if (typeof requestAnimationFrame == "function") {
105
- requestAnimationFrame(() => n());
110
+ requestAnimationFrame(() => r());
106
111
  return;
107
112
  }
108
- n();
113
+ r();
109
114
  });
110
- }, ut = (t) => {
115
+ }, pt = (t) => {
111
116
  if (t.button !== 0) return;
112
- const i = ct(t.pointerId), a = i?.wasSelected ?? e.selected, n = i?.ownership ?? p(t.target), o = n === "widget_local" ? Wt({
117
+ const i = mt(t.pointerId), n = i?.wasSelected ?? e.selected, r = i?.ownership ?? C(t.target), a = r === "widget_local" ? Ft({
113
118
  target: t.target,
114
- widgetRoot: d ?? null,
115
- interactiveSelector: s().interactiveSelector,
116
- panSurfaceSelector: s().panSurfaceSelector
117
- }) : null, r = n === "widget_local" && !o && Lt({
119
+ widgetRoot: s ?? null,
120
+ interactiveSelector: w().interactiveSelector,
121
+ panSurfaceSelector: w().panSurfaceSelector
122
+ }) : null, o = r === "widget_local" && !a && Ht({
118
123
  target: t.target,
119
- widgetRoot: d ?? null,
120
- interactiveSelector: s().interactiveSelector,
121
- panSurfaceSelector: s().panSurfaceSelector
124
+ widgetRoot: s ?? null,
125
+ interactiveSelector: w().interactiveSelector,
126
+ panSurfaceSelector: w().panSurfaceSelector
122
127
  });
123
- if (n === "widget_shell") {
124
- y(), d?.focus({
128
+ if (r === "widget_shell") {
129
+ T(), s?.focus({
125
130
  preventScroll: !0
126
131
  });
127
132
  return;
128
133
  }
129
- if (n === "widget_local") {
130
- if (o) {
131
- a || wt(t.pointerId, o);
134
+ if (r === "widget_local") {
135
+ if (a) {
136
+ n || St(t.pointerId, a);
132
137
  return;
133
138
  }
134
- if (r) {
135
- if (b = null, a) {
136
- F(t.pointerType || void 0);
139
+ if (o) {
140
+ if (v = null, n) {
141
+ V(t.pointerType || void 0);
137
142
  return;
138
143
  }
139
- y(), F(t.pointerType || void 0);
144
+ T(), V(t.pointerType || void 0);
140
145
  }
141
146
  }
142
- }, I = g(() => {
143
- const t = k();
147
+ }, P = d(() => {
148
+ const t = y();
144
149
  return t ? {
145
150
  x: t.worldX,
146
151
  y: t.worldY
@@ -148,8 +153,8 @@ function Nt(e) {
148
153
  x: e.x,
149
154
  y: e.y
150
155
  };
151
- }), x = g(() => {
152
- const t = $();
156
+ }), u = d(() => {
157
+ const t = x();
153
158
  return t ? {
154
159
  width: t.width,
155
160
  height: t.height
@@ -157,64 +162,111 @@ function Nt(e) {
157
162
  width: e.width,
158
163
  height: e.height
159
164
  };
160
- }), H = g(() => {
165
+ }), j = d(() => {
161
166
  if (!(e.layoutMode !== "projected_surface" || !e.projectedViewport))
162
- return Pt({
167
+ return Ot({
163
168
  widgetId: e.widgetId,
164
- worldX: I().x,
165
- worldY: I().y,
166
- worldWidth: x().width,
167
- worldHeight: x().height,
169
+ worldX: P().x,
170
+ worldY: P().y,
171
+ worldWidth: u().width,
172
+ worldHeight: u().height,
168
173
  viewport: e.projectedViewport(),
169
174
  ready: e.surfaceReady ?? !0
170
175
  });
171
- }), gt = g(() => {
176
+ }), F = d(() => j()?.rect.viewportScale ?? Math.max(e.viewportScale, 1e-3)), Z = d(() => e.layoutMode === "projected_surface" && qt(e.definition) === "settle_sharp_zoom"), G = d(() => e.layoutMode === "projected_surface" && Z() && B().enabled && B().scale > 1.001), $t = d(() => {
177
+ if (e.layoutMode !== "projected_surface")
178
+ return;
179
+ const t = F();
180
+ return G() ? {
181
+ width: `${u().width}px`,
182
+ height: `${u().height}px`,
183
+ zoom: `${t}`
184
+ } : {
185
+ width: "100%",
186
+ height: "100%",
187
+ zoom: "1"
188
+ };
189
+ }), kt = d(() => {
172
190
  const t = e.itemSnapshot().z_index, i = Number.isFinite(t) ? Math.max(1, Math.min(99, Math.round(t))) : 1;
173
191
  return String(i).padStart(2, "0");
174
- }), O = (t) => {
192
+ }), J = (t) => {
175
193
  t.preventDefault(), t.stopPropagation(), e.onRequestOverview(e.itemSnapshot());
176
- }, q = (t) => {
194
+ }, K = (t) => {
177
195
  t.preventDefault(), t.stopPropagation(), e.onRequestFit(e.itemSnapshot());
178
- }, j = (t) => {
196
+ }, U = (t) => {
179
197
  t.preventDefault(), t.stopPropagation(), e.onRequestDelete(e.widgetId);
180
- }, ht = g(() => {
198
+ }, yt = d(() => {
181
199
  const t = {
182
- width: `${x().width}px`,
183
- height: `${x().height}px`,
184
200
  "z-index": X() || Y() || e.optimisticFront ? `${e.topRenderLayer + 1}` : `${e.renderLayer}`
185
201
  };
186
202
  if (e.layoutMode === "projected_surface") {
187
- const i = H()?.rect;
203
+ const i = j()?.rect, n = F(), r = G(), a = r ? i?.screenWidth ?? u().width * n : u().width, o = r ? i?.screenHeight ?? u().height * n : u().height;
188
204
  return {
189
205
  ...t,
190
- transform: `translate3d(${i?.screenX ?? 0}px, ${i?.screenY ?? 0}px, 0) scale(${i?.viewportScale ?? Math.max(e.viewportScale, 1e-3)})`
206
+ width: `${a}px`,
207
+ height: `${o}px`,
208
+ transform: r ? `translate(${i?.screenX ?? 0}px, ${i?.screenY ?? 0}px)` : `translate(${i?.screenX ?? 0}px, ${i?.screenY ?? 0}px) scale(${n})`,
209
+ zoom: "1"
191
210
  };
192
211
  }
193
212
  return {
194
213
  ...t,
195
- transform: `translate(${I().x}px, ${I().y}px)`
214
+ width: `${u().width}px`,
215
+ height: `${u().height}px`,
216
+ transform: `translate(${P().x}px, ${P().y}px)`
196
217
  };
197
- }), ft = (t) => {
198
- const i = f(k);
218
+ });
219
+ rt(() => {
220
+ if (!Z()) {
221
+ M(), I({
222
+ enabled: !1,
223
+ scale: 1
224
+ });
225
+ return;
226
+ }
227
+ const t = F();
228
+ if (t <= 1.001 || X() || Y()) {
229
+ M(), I({
230
+ enabled: !1,
231
+ scale: t
232
+ });
233
+ return;
234
+ }
235
+ if (I({
236
+ enabled: !1,
237
+ scale: t
238
+ }), typeof window > "u")
239
+ return;
240
+ M();
241
+ const i = t;
242
+ S = window.setTimeout(() => {
243
+ S = void 0, I((n) => Math.abs(n.scale - i) < 1e-3 ? {
244
+ enabled: !0,
245
+ scale: i
246
+ } : n);
247
+ }, Jt);
248
+ });
249
+ const xt = (t) => {
250
+ const i = m(y);
199
251
  if (!i) return;
200
- const a = {
252
+ const n = {
201
253
  x: i.worldX,
202
254
  y: i.worldY
203
- }, n = {
255
+ }, r = {
204
256
  x: i.startWorldX,
205
257
  y: i.startWorldY
206
- }, o = t && (Math.abs(a.x - n.x) > 1 || Math.abs(a.y - n.y) > 1);
207
- e.onCommitFront(e.widgetId), o && e.onCommitMove(e.widgetId, a), i.stopInteraction(), W(null), m = void 0;
208
- }, B = (t) => {
258
+ }, a = t && (Math.abs(n.x - r.x) > 1 || Math.abs(n.y - r.y) > 1);
259
+ e.onCommitFront(e.widgetId), a && e.onCommitMove(e.widgetId, n), i.stopInteraction(), L(null), _ = void 0;
260
+ }, Q = (t) => {
209
261
  if (t.button !== 0 || e.locked) return;
210
- t.preventDefault(), t.stopPropagation(), m?.stop({
262
+ t.preventDefault(), t.stopPropagation(), _?.stop({
211
263
  reason: "manual_stop",
212
264
  commit: !1
213
- }), e.onSelect(e.widgetId), d?.focus({
265
+ }), e.onSelect(e.widgetId), s?.focus({
214
266
  preventScroll: !0
215
267
  }), e.onStartOptimisticFront(e.widgetId);
216
- const i = D("drag", "grabbing"), a = Math.max(e.viewportScale, 1e-3);
217
- W({
268
+ const i = N("drag", "grabbing"), n = Math.max(e.viewportScale, 1e-3);
269
+ L({
218
270
  pointerId: t.pointerId,
219
271
  startClientX: t.clientX,
220
272
  startClientY: t.clientY,
@@ -223,45 +275,45 @@ function Nt(e) {
223
275
  worldX: e.x,
224
276
  worldY: e.y,
225
277
  moved: !1,
226
- scale: a,
278
+ scale: n,
227
279
  stopInteraction: i
228
280
  });
229
- const n = (o) => {
230
- W((r) => {
231
- if (!r || r.pointerId !== o.pointerId) return r;
232
- const h = r.startWorldX + (o.clientX - r.startClientX) / r.scale, u = r.startWorldY + (o.clientY - r.startClientY) / r.scale;
281
+ const r = (a) => {
282
+ L((o) => {
283
+ if (!o || o.pointerId !== a.pointerId) return o;
284
+ const h = o.startWorldX + (a.clientX - o.startClientX) / o.scale, f = o.startWorldY + (a.clientY - o.startClientY) / o.scale;
233
285
  return {
234
- ...r,
286
+ ...o,
235
287
  worldX: h,
236
- worldY: u,
237
- moved: r.moved || Math.abs(h - r.startWorldX) > 2 || Math.abs(u - r.startWorldY) > 2
288
+ worldY: f,
289
+ moved: o.moved || Math.abs(h - o.startWorldX) > 2 || Math.abs(f - o.startWorldY) > 2
238
290
  };
239
291
  });
240
292
  };
241
- m = tt({
293
+ _ = dt({
242
294
  pointerEvent: t,
243
295
  captureEl: t.currentTarget,
244
- onMove: n,
296
+ onMove: r,
245
297
  onEnd: ({
246
- commit: o
247
- }) => ft(o)
298
+ commit: a
299
+ }) => xt(a)
248
300
  });
249
- }, mt = (t) => {
250
- const i = f($);
301
+ }, It = (t) => {
302
+ const i = m(x);
251
303
  if (!i) return;
252
- const a = {
304
+ const n = {
253
305
  width: i.width,
254
306
  height: i.height
255
- }, n = Math.abs(i.width - i.startWidth) > 1 || Math.abs(i.height - i.startHeight) > 1;
256
- t && n && e.onCommitResize(e.widgetId, a), i.stopInteraction(), L(null), _ = void 0;
257
- }, _t = (t) => {
307
+ }, r = Math.abs(i.width - i.startWidth) > 1 || Math.abs(i.height - i.startHeight) > 1;
308
+ t && r && e.onCommitResize(e.widgetId, n), i.stopInteraction(), z(null), b = void 0;
309
+ }, Mt = (t) => {
258
310
  if (t.button !== 0 || e.locked) return;
259
- t.preventDefault(), t.stopPropagation(), _?.stop({
311
+ t.preventDefault(), t.stopPropagation(), b?.stop({
260
312
  reason: "manual_stop",
261
313
  commit: !1
262
314
  }), e.onStartOptimisticFront(e.widgetId);
263
- const i = D("resize", "nwse-resize"), a = Math.max(e.viewportScale, 1e-3);
264
- L({
315
+ const i = N("resize", "nwse-resize"), n = Math.max(e.viewportScale, 1e-3);
316
+ z({
265
317
  pointerId: t.pointerId,
266
318
  startClientX: t.clientX,
267
319
  startClientY: t.clientY,
@@ -269,35 +321,35 @@ function Nt(e) {
269
321
  startHeight: e.height,
270
322
  width: e.width,
271
323
  height: e.height,
272
- scale: a,
324
+ scale: n,
273
325
  stopInteraction: i
274
326
  });
275
- const n = (o) => {
276
- L((r) => {
277
- if (!r || r.pointerId !== o.pointerId) return r;
278
- const h = Math.max(At, r.startWidth + (o.clientX - r.startClientX) / r.scale), u = Math.max(Dt, r.startHeight + (o.clientY - r.startClientY) / r.scale);
327
+ const r = (a) => {
328
+ z((o) => {
329
+ if (!o || o.pointerId !== a.pointerId) return o;
330
+ const h = Math.max(Zt, o.startWidth + (a.clientX - o.startClientX) / o.scale), f = Math.max(Gt, o.startHeight + (a.clientY - o.startClientY) / o.scale);
279
331
  return {
280
- ...r,
332
+ ...o,
281
333
  width: h,
282
- height: u
334
+ height: f
283
335
  };
284
336
  });
285
337
  };
286
- _ = tt({
338
+ b = dt({
287
339
  pointerEvent: t,
288
340
  captureEl: t.currentTarget,
289
- onMove: n,
341
+ onMove: r,
290
342
  onEnd: ({
291
- commit: o
292
- }) => mt(o)
343
+ commit: a
344
+ }) => It(a)
293
345
  });
294
346
  };
295
347
  return (() => {
296
- var t = Et(), i = t.firstChild, a = i.firstChild, n = a.firstChild, o = n.nextSibling, r = o.nextSibling, h = a.nextSibling, u = h.nextSibling, R = u.nextSibling, bt = R.firstChild, N = bt.nextSibling, vt = R.nextSibling, M = vt.firstChild, C = M.nextSibling, A = C.nextSibling, St = i.nextSibling, V = d;
297
- return typeof V == "function" ? yt(V, t) : d = t, G(t, kt({
348
+ var t = Nt(), i = t.firstChild, n = i.firstChild, r = n.firstChild, a = r.firstChild, o = a.nextSibling, h = o.nextSibling, f = r.nextSibling, H = f.nextSibling, O = H.nextSibling, Tt = O.firstChild, tt = Tt.nextSibling, Ct = O.nextSibling, W = Ct.firstChild, E = W.nextSibling, q = E.nextSibling, Pt = n.nextSibling, et = s;
349
+ return typeof et == "function" ? Rt(et, t) : s = t, nt(t, Wt({
298
350
  get classList() {
299
351
  return {
300
- "is-selected": S(),
352
+ "is-selected": $(),
301
353
  "is-dragging": X(),
302
354
  "is-resizing": Y(),
303
355
  "is-filtered-out": e.filtered,
@@ -306,15 +358,15 @@ function Nt(e) {
306
358
  };
307
359
  }
308
360
  }, () => ({
309
- [s().dialogSurfaceHostAttr]: "true"
361
+ [w().dialogSurfaceHostAttr]: "true"
310
362
  }), {
311
363
  get "data-floe-workbench-widget-id"() {
312
364
  return e.widgetId;
313
365
  }
314
366
  }, () => ({
315
- [s().widgetRootAttr]: "true"
367
+ [w().widgetRootAttr]: "true"
316
368
  }), () => ({
317
- [s().widgetIdAttr]: e.widgetId
369
+ [w().widgetIdAttr]: e.widgetId
318
370
  }), {
319
371
  get "data-workbench-widget-type"() {
320
372
  return e.widgetType;
@@ -323,49 +375,49 @@ function Nt(e) {
323
375
  return e.layoutMode ?? "canvas_scaled";
324
376
  }
325
377
  }, () => ({
326
- [Ct]: S() ? "true" : void 0
378
+ [Yt]: $() ? "true" : void 0
327
379
  }), {
328
380
  tabIndex: 0,
329
- onPointerDown: ut,
381
+ onPointerDown: pt,
330
382
  onFocus: () => {
331
- P() || e.onSelect(e.widgetId);
383
+ R() || e.onSelect(e.widgetId);
332
384
  },
333
385
  onContextMenu: (c) => {
334
- p(c.target) === "widget_shell" && (c.preventDefault(), c.stopPropagation(), e.onContextMenu(c, e.itemSnapshot()));
386
+ C(c.target) === "widget_shell" && (c.preventDefault(), c.stopPropagation(), e.onContextMenu(c, e.itemSnapshot()));
335
387
  },
336
388
  get style() {
337
- return ht();
389
+ return yt();
338
390
  }
339
- }), !1, !0), i.$$pointerdown = B, G(i, {
340
- [Tt]: "true"
341
- }, !1, !0), n.$$click = j, n.$$pointerdown = (c) => c.stopPropagation(), l(n, w(U, {
391
+ }), !1, !0), n.$$pointerdown = Q, nt(n, {
392
+ [jt]: "true"
393
+ }, !1, !0), a.$$click = U, a.$$pointerdown = (c) => c.stopPropagation(), l(a, g(at, {
342
394
  class: "workbench-widget__traffic-icon",
343
395
  "aria-hidden": "true"
344
- })), o.$$click = O, o.$$pointerdown = (c) => c.stopPropagation(), l(o, w(J, {
396
+ })), o.$$click = J, o.$$pointerdown = (c) => c.stopPropagation(), l(o, g(ct, {
345
397
  class: "workbench-widget__traffic-icon",
346
398
  "aria-hidden": "true"
347
- })), r.$$click = q, r.$$pointerdown = (c) => c.stopPropagation(), l(r, w(Q, {
399
+ })), h.$$click = K, h.$$pointerdown = (c) => c.stopPropagation(), l(h, g(lt, {
348
400
  class: "workbench-widget__traffic-icon",
349
401
  "aria-hidden": "true"
350
- })), l(h, gt), u.$$pointerdown = B, l(u, w(Mt, {
402
+ })), l(f, kt), H.$$pointerdown = Q, l(H, g(Xt, {
351
403
  class: "w-3.5 h-3.5"
352
- })), l(R, () => {
404
+ })), l(O, () => {
353
405
  const c = e.definition.icon;
354
- return w(c, {
406
+ return g(c, {
355
407
  class: "w-3.5 h-3.5"
356
408
  });
357
- }, N), l(N, () => e.widgetTitle), M.$$click = O, M.$$pointerdown = (c) => c.stopPropagation(), l(M, w(J, {
409
+ }, tt), l(tt, () => e.widgetTitle), W.$$click = J, W.$$pointerdown = (c) => c.stopPropagation(), l(W, g(ct, {
358
410
  class: "workbench-widget__window-control-icon",
359
411
  "aria-hidden": "true"
360
- })), C.$$click = q, C.$$pointerdown = (c) => c.stopPropagation(), l(C, w(Q, {
412
+ })), E.$$click = K, E.$$pointerdown = (c) => c.stopPropagation(), l(E, g(lt, {
361
413
  class: "workbench-widget__window-control-icon",
362
414
  "aria-hidden": "true"
363
- })), A.$$click = j, A.$$pointerdown = (c) => c.stopPropagation(), l(A, w(U, {
415
+ })), q.$$click = U, q.$$pointerdown = (c) => c.stopPropagation(), l(q, g(at, {
364
416
  class: "workbench-widget__window-control-icon",
365
417
  "aria-hidden": "true"
366
- })), l(St, () => {
418
+ })), l(Pt, () => {
367
419
  const c = e.definition.body;
368
- return w(c, {
420
+ return g(c, {
369
421
  get widgetId() {
370
422
  return e.widgetId;
371
423
  },
@@ -375,31 +427,31 @@ function Nt(e) {
375
427
  get type() {
376
428
  return e.widgetType;
377
429
  },
378
- surfaceMetrics: H,
430
+ surfaceMetrics: j,
379
431
  get activation() {
380
- return it();
432
+ return wt();
381
433
  },
382
434
  get lifecycle() {
383
- return lt();
435
+ return _t();
384
436
  },
385
437
  get selected() {
386
- return S();
438
+ return $();
387
439
  },
388
440
  get filtered() {
389
441
  return e.filtered;
390
442
  },
391
- requestActivate: dt
443
+ requestActivate: bt
392
444
  });
393
- }), l(t, (() => {
394
- var c = $t(() => !!e.locked);
445
+ }), l(i, (() => {
446
+ var c = Et(() => !!e.locked);
395
447
  return () => c() ? null : (() => {
396
- var Z = Rt();
397
- return Z.$$pointerdown = _t, Z;
448
+ var it = Vt();
449
+ return it.$$pointerdown = Mt, it;
398
450
  })();
399
- })(), null), t;
451
+ })(), null), Lt((c) => zt(i, $t(), c)), t;
400
452
  })();
401
453
  }
402
- pt(["pointerdown", "click"]);
454
+ At(["pointerdown", "click"]);
403
455
  export {
404
- Nt as WorkbenchWidget
456
+ re as WorkbenchWidget
405
457
  };
@@ -4,6 +4,6 @@ export { WorkbenchContextMenu, type WorkbenchContextMenuItem, type WorkbenchCont
4
4
  export { useWorkbenchModel, type UseWorkbenchModelOptions } from './useWorkbenchModel';
5
5
  export { WIDGET_REGISTRY, createWorkbenchFilterState, getWidgetEntry, isValidWorkbenchWidgetType, resolveWorkbenchWidgetDefinitions, type WidgetRegistryEntry, } from './widgets/widgetRegistry';
6
6
  export * from './types';
7
- export { sanitizeWorkbenchState, createDefaultWorkbenchState, createWorkbenchId, createWorkbenchProjectedRect, createWorkbenchRenderLayerMap, createWorkbenchViewportCenteredOnWidget, createWorkbenchViewportFitForWidget, createWorkbenchWidgetSurfaceMetrics, resolveWorkbenchWidgetRenderMode, type WorkbenchRenderLayerMap, } from './workbenchHelpers';
7
+ export { sanitizeWorkbenchState, createDefaultWorkbenchState, createWorkbenchId, createWorkbenchProjectedRect, createWorkbenchRenderLayerMap, createWorkbenchViewportCenteredOnWidget, createWorkbenchViewportFitForWidget, createWorkbenchWidgetSurfaceMetrics, resolveWorkbenchProjectedSurfaceScaleBehavior, resolveWorkbenchWidgetRenderMode, type WorkbenchRenderLayerMap, } from './workbenchHelpers';
8
8
  export { DEFAULT_WORKBENCH_THEME, WORKBENCH_THEME_IDS, WORKBENCH_THEMES, isWorkbenchThemeId, workbenchThemeMeta, type WorkbenchThemeId, type WorkbenchThemeMeta, type WorkbenchThemePreview, } from './workbenchThemes';
9
9
  export { WorkbenchThemeSelector, type WorkbenchThemeSelectorProps, } from './WorkbenchThemeSelector';