@floegence/floe-webapp-core 0.36.60 → 0.36.61

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,33 +1,33 @@
1
- import { spread as yt, mergeProps as fe, insert as h, createComponent as m, memo as pe, effect as me, style as _e, template as Ct, use as be, delegateEvents as ve } from "solid-js/web";
2
- import { createMemo as w, createSignal as C, onCleanup as Pt, untrack as $, createEffect as xt } from "solid-js";
3
- import { startHotInteraction as Se } from "../../utils/hotInteraction.js";
4
- import { X as Mt, Minus as Tt, Maximize as Wt, GripVertical as ke } from "../icons/index.js";
5
- import { CANVAS_WHEEL_INTERACTIVE_ATTR as $e, WORKBENCH_WIDGET_SHELL_ATTR as ye, resolveWorkbenchWidgetLocalTypingTarget as Pe, resolveWorkbenchWidgetTextSelectionTarget as xe, shouldActivateWorkbenchWidgetLocalTarget as Me } from "../ui/localInteractionSurface.js";
6
- import { startPointerSession as It } from "../ui/pointerSession.js";
7
- import { createWorkbenchWidgetSurfaceMetrics as Te, resolveWorkbenchProjectedSurfaceScaleBehavior as We } from "./workbenchHelpers.js";
8
- import { createWorkbenchEdgeAutoPanController as Ie, WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Ce, frameFromElement as Ee } from "./workbenchEdgeAutoPan.js";
9
- import { resolveWorkbenchInteractionAdapter as Re } from "./workbenchInteractionAdapter.js";
1
+ import { spread as xt, mergeProps as pe, insert as f, createComponent as m, memo as me, effect as _e, style as be, template as Rt, use as ve, delegateEvents as Se } from "solid-js/web";
2
+ import { createMemo as w, createSignal as C, onCleanup as Wt, untrack as $, createEffect as It } from "solid-js";
3
+ import { startHotInteraction as ke } from "../../utils/hotInteraction.js";
4
+ import { X as Mt, Minus as Tt, Maximize as Ct, GripVertical as $e } from "../icons/index.js";
5
+ import { CANVAS_WHEEL_INTERACTIVE_ATTR as ye, WORKBENCH_WIDGET_SHELL_ATTR as Pe, resolveWorkbenchWidgetLocalTypingTarget as xe, resolveWorkbenchWidgetTextSelectionTarget as We, shouldActivateWorkbenchWidgetLocalTarget as Ie } from "../ui/localInteractionSurface.js";
6
+ import { startPointerSession as Et } from "../ui/pointerSession.js";
7
+ import { createWorkbenchWidgetSurfaceMetrics as Me, resolveWorkbenchProjectedSurfaceScaleBehavior as Te } from "./workbenchHelpers.js";
8
+ import { createWorkbenchEdgeAutoPanController as Ce, WORKBENCH_EDGE_AUTO_PAN_FRAME_SELECTOR as Ee, frameFromElement as Re } from "./workbenchEdgeAutoPan.js";
9
+ import { resolveWorkbenchInteractionAdapter as Le } from "./workbenchInteractionAdapter.js";
10
10
  import { createOwnerSafePropAccessor as a } from "./workbenchOwnerSafeAccessors.js";
11
- var Le = /* @__PURE__ */ Ct('<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>'), Ae = /* @__PURE__ */ Ct('<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">');
12
- const ze = 220, Xe = 160, Ye = 160;
13
- function Ze(i) {
14
- const H = a(() => i.definition), f = a(() => i.widgetId), nt = a(() => i.widgetTitle), it = a(() => i.widgetType), E = a(() => i.itemSnapshot), Et = a(() => i.renderLayer), Rt = a(() => i.optimisticFront), rt = a(() => i.motion ?? null), Lt = a(() => i.topRenderLayer), At = a(() => i.viewport), V = a(() => i.onSelect), zt = a(() => i.onContextMenu), at = a(() => i.onStartOptimisticFront), ct = a(() => i.onCommitFront), Xt = a(() => i.onCommitMove), Yt = a(() => i.onCommitResize), Dt = a(() => i.onViewportCommit), Ft = a(() => i.onViewportInteractionStart), jt = a(() => i.onRequestOverview), Ot = a(() => i.onRequestFit), Ht = a(() => i.onRequestDelete), Vt = a(() => i.onLayoutInteractionStart), qt = a(() => i.onLayoutInteractionEnd), g = w(() => Re(i.interactionAdapter)), q = a(() => i.selected), v = a(() => i.locked), B = a(() => i.filtered), b = a(() => i.layoutMode ?? "canvas_scaled"), Bt = a(() => i.projectedViewport), Nt = a(() => i.surfaceReady ?? !0), lt = a(() => ({
11
+ var Ae = /* @__PURE__ */ Rt('<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>'), ze = /* @__PURE__ */ Rt('<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">');
12
+ const Xe = 220, Ye = 160, De = 160;
13
+ function Ke(i) {
14
+ const V = a(() => i.definition), g = a(() => i.widgetId), it = a(() => i.widgetTitle), rt = a(() => i.widgetType), E = a(() => i.itemSnapshot), at = a(() => i.renderLayer), Lt = a(() => i.optimisticFront), ct = a(() => i.motion ?? null), lt = a(() => i.topRenderLayer), At = a(() => i.viewport), q = a(() => i.onSelect), zt = a(() => i.onContextMenu), st = a(() => i.onStartOptimisticFront), B = a(() => i.onCommitFront), Xt = a(() => i.onCommitMove), Yt = a(() => i.onCommitResize), Dt = a(() => i.onViewportCommit), Ft = a(() => i.onViewportInteractionStart), jt = a(() => i.onRequestOverview), Ot = a(() => i.onRequestFit), Ht = a(() => i.onRequestDelete), Vt = a(() => i.onLayoutInteractionStart), qt = a(() => i.onLayoutInteractionEnd), h = w(() => Le(i.interactionAdapter)), R = a(() => i.selected), v = a(() => i.locked), N = a(() => i.filtered), b = a(() => i.layoutMode ?? "canvas_scaled"), Bt = a(() => i.projectedViewport), Nt = a(() => i.surfaceReady ?? !0), dt = a(() => ({
15
15
  x: i.x,
16
16
  y: i.y
17
- })), st = a(() => ({
17
+ })), ut = a(() => ({
18
18
  width: i.width,
19
19
  height: i.height
20
- })), N = a(() => Math.max(i.viewportScale, 1e-3)), [y, R] = C(null), [L, G] = C(null), [Gt, Zt] = C(), [Z, K] = C(!1), [dt, A] = C({
20
+ })), G = a(() => Math.max(i.viewportScale, 1e-3)), [y, L] = C(null), [A, Z] = C(null), [Gt, Zt] = C(), [K, U] = C(!1), [wt, z] = C({
21
21
  enabled: !1,
22
22
  scale: 1
23
23
  });
24
- let P, x, M, z = null, Kt = 0, Ut = 0, S = null, T;
25
- const W = /* @__PURE__ */ new Map();
24
+ let P, x, W, X = null, Kt = 0, Ut = 0, S = null, I;
25
+ const M = /* @__PURE__ */ new Map();
26
26
  let u;
27
- const X = () => {
28
- typeof window > "u" || T === void 0 || (window.clearTimeout(T), T = void 0);
29
- }, ut = (t, e) => {
30
- const n = Se({
27
+ const Y = () => {
28
+ typeof window > "u" || I === void 0 || (window.clearTimeout(I), I = void 0);
29
+ }, gt = (t, e) => {
30
+ const n = ke({
31
31
  kind: t,
32
32
  cursor: e
33
33
  });
@@ -35,22 +35,22 @@ function Ze(i) {
35
35
  return $(() => Vt()?.()), () => {
36
36
  o || (o = !0, n(), $(() => qt()?.()));
37
37
  };
38
- }, wt = () => {
39
- M?.stop(), M = void 0, z = null;
38
+ }, ht = () => {
39
+ W?.stop(), W = void 0, X = null;
40
40
  }, Jt = () => {
41
41
  const t = At(), e = Dt(), n = Ft();
42
- !t || !e || (z = t, M?.stop(), M = Ie({
42
+ !t || !e || (X = t, W?.stop(), W = Ce({
43
43
  readFrame: () => {
44
- const o = u?.closest(Ce);
45
- return o instanceof HTMLElement ? Ee(o) : null;
44
+ const o = u?.closest(Ee);
45
+ return o instanceof HTMLElement ? Re(o) : null;
46
46
  },
47
- readViewport: () => z ?? t,
47
+ readViewport: () => X ?? t,
48
48
  commitViewport: (o) => {
49
- z = o, e(o);
49
+ X = o, e(o);
50
50
  },
51
51
  onPanStart: () => n?.("pan"),
52
52
  onPan: (o) => {
53
- R((r) => r && {
53
+ L((r) => r && {
54
54
  ...r,
55
55
  autoPanWorldX: r.autoPanWorldX + o.worldDeltaX,
56
56
  autoPanWorldY: r.autoPanWorldY + o.worldDeltaY,
@@ -62,66 +62,74 @@ function Ze(i) {
62
62
  shouldPan: () => y() !== null
63
63
  }));
64
64
  };
65
- Pt(() => {
66
- wt(), P?.stop({
65
+ Wt(() => {
66
+ ht(), P?.stop({
67
67
  reason: "manual_stop",
68
68
  commit: !1
69
69
  }), P = void 0, x?.stop({
70
70
  reason: "manual_stop",
71
71
  commit: !1
72
- }), x = void 0, $(y)?.stopInteraction(), $(L)?.stopInteraction(), X();
72
+ }), x = void 0, $(y)?.stopInteraction(), $(A)?.stopInteraction(), Y();
73
73
  });
74
- const Y = () => {
75
- K(!1);
76
- const t = f();
77
- V()(t), ct()(t);
78
- }, U = () => {
79
- K(!1);
80
- }, I = w(() => q() || Z()), Qt = (t, e, n) => {
74
+ const D = () => {
75
+ U(!1);
76
+ const t = g();
77
+ q()(t), B()(t);
78
+ }, Qt = () => {
79
+ at() >= lt() || B()(g());
80
+ }, J = () => {
81
+ U(!1);
82
+ }, T = w(() => R() || K()), te = (t, e, n) => {
81
83
  const o = {
82
84
  token: ++Ut,
83
85
  wasSelected: e,
84
86
  ownership: n
85
87
  };
86
- W.set(t, o), !e && n === "widget_local" && K(!0), queueMicrotask(() => {
87
- W.get(t)?.token === o.token && W.delete(t);
88
+ M.set(t, o), !e && n === "widget_local" && U(!0), queueMicrotask(() => {
89
+ M.get(t)?.token === o.token && M.delete(t);
88
90
  });
89
- }, te = (t) => {
90
- const e = W.get(t) ?? null;
91
- return e && W.delete(t), e;
91
+ }, ee = (t) => {
92
+ const e = M.get(t) ?? null;
93
+ return e && M.delete(t), e;
92
94
  };
93
- xt(() => {
95
+ It(() => {
94
96
  const t = u;
95
97
  if (!t) return;
96
98
  const e = (r) => {
97
- r.button === 0 && Qt(r.pointerId, I(), D(r.target));
99
+ r.button === 0 && te(r.pointerId, T(), F(r.target));
98
100
  }, n = (r) => {
99
- r.button === 0 && Z() && D(r.target) === "widget_local" && Y();
101
+ if (r.button === 0 && F(r.target) === "widget_local") {
102
+ if (K()) {
103
+ D();
104
+ return;
105
+ }
106
+ R() && Qt();
107
+ }
100
108
  }, o = () => {
101
109
  setTimeout(() => {
102
- q() || U();
110
+ R() || J();
103
111
  }, 0);
104
112
  };
105
- t.addEventListener("pointerdown", e, !0), t.addEventListener("click", n, !0), t.addEventListener("pointerup", o), t.addEventListener("pointercancel", U), Pt(() => {
106
- t.removeEventListener("pointerdown", e, !0), t.removeEventListener("click", n, !0), t.removeEventListener("pointerup", o), t.removeEventListener("pointercancel", U);
113
+ t.addEventListener("pointerdown", e, !0), t.addEventListener("click", n, !0), t.addEventListener("pointerup", o), t.addEventListener("pointercancel", J), Wt(() => {
114
+ t.removeEventListener("pointerdown", e, !0), t.removeEventListener("click", n, !0), t.removeEventListener("pointerup", o), t.removeEventListener("pointercancel", J);
107
115
  });
108
116
  });
109
- const J = () => y() !== null, Q = () => L() !== null, ee = w(() => B() || v() ? "cold" : I() ? "hot" : "warm"), D = (t) => g().resolveWidgetEventOwnership({
117
+ const Q = () => y() !== null, tt = () => A() !== null, oe = w(() => N() || v() ? "cold" : T() ? "hot" : "warm"), F = (t) => h().resolveWidgetEventOwnership({
110
118
  target: t,
111
119
  widgetRoot: u ?? null,
112
- interactiveSelector: g().interactiveSelector,
113
- panSurfaceSelector: g().panSurfaceSelector
114
- }), oe = () => {
115
- Y(), u?.focus({
120
+ interactiveSelector: h().interactiveSelector,
121
+ panSurfaceSelector: h().panSurfaceSelector
122
+ }), ne = () => {
123
+ D(), u?.focus({
116
124
  preventScroll: !0
117
125
  });
118
- }, gt = (t) => {
126
+ }, ft = (t) => {
119
127
  Zt((e) => ({
120
128
  seq: (e?.seq ?? 0) + 1,
121
129
  source: "local_pointer",
122
130
  pointerType: t
123
131
  }));
124
- }, ne = (t) => {
132
+ }, ie = (t) => {
125
133
  if (!(!u || !t.isConnected || !u.contains(t)))
126
134
  try {
127
135
  t.focus({
@@ -130,7 +138,7 @@ function Ze(i) {
130
138
  } catch {
131
139
  t.focus();
132
140
  }
133
- }, ie = (t, e) => {
141
+ }, re = (t, e) => {
134
142
  S = {
135
143
  token: ++Kt,
136
144
  pointerId: t,
@@ -140,7 +148,7 @@ function Ze(i) {
140
148
  const n = S;
141
149
  queueMicrotask(() => {
142
150
  const o = () => {
143
- !n || S?.token !== n.token || (ne(n.target), S = null);
151
+ !n || S?.token !== n.token || (ie(n.target), S = null);
144
152
  };
145
153
  if (typeof requestAnimationFrame == "function") {
146
154
  requestAnimationFrame(() => o());
@@ -148,33 +156,33 @@ function Ze(i) {
148
156
  }
149
157
  o();
150
158
  });
151
- }, re = (t) => {
159
+ }, ae = (t) => {
152
160
  if (t.button !== 0 || v()) return;
153
- const e = te(t.pointerId), n = e?.wasSelected ?? q(), o = e?.ownership ?? D(t.target), r = o === "widget_local" ? Pe({
161
+ const e = ee(t.pointerId), n = e?.wasSelected ?? R(), o = e?.ownership ?? F(t.target), r = o === "widget_local" ? xe({
154
162
  target: t.target,
155
163
  widgetRoot: u ?? null,
156
- interactiveSelector: g().interactiveSelector,
157
- panSurfaceSelector: g().panSurfaceSelector
158
- }) : null, s = o === "widget_local" ? xe({
164
+ interactiveSelector: h().interactiveSelector,
165
+ panSurfaceSelector: h().panSurfaceSelector
166
+ }) : null, s = o === "widget_local" ? We({
159
167
  target: t.target,
160
168
  widgetRoot: u ?? null,
161
- interactiveSelector: g().interactiveSelector,
162
- panSurfaceSelector: g().panSurfaceSelector
163
- }) : null, c = o === "widget_local" && !r && !s && Me({
169
+ interactiveSelector: h().interactiveSelector,
170
+ panSurfaceSelector: h().panSurfaceSelector
171
+ }) : null, c = o === "widget_local" && !r && !s && Ie({
164
172
  target: t.target,
165
173
  widgetRoot: u ?? null,
166
- interactiveSelector: g().interactiveSelector,
167
- panSurfaceSelector: g().panSurfaceSelector
174
+ interactiveSelector: h().interactiveSelector,
175
+ panSurfaceSelector: h().panSurfaceSelector
168
176
  });
169
177
  if (o === "widget_shell") {
170
- Y(), u?.focus({
178
+ D(), u?.focus({
171
179
  preventScroll: !0
172
180
  });
173
181
  return;
174
182
  }
175
183
  if (o === "widget_local") {
176
184
  if (r) {
177
- n || ie(t.pointerId, r);
185
+ n || re(t.pointerId, r);
178
186
  return;
179
187
  }
180
188
  if (s) {
@@ -183,41 +191,41 @@ function Ze(i) {
183
191
  }
184
192
  if (c) {
185
193
  if (S = null, n) {
186
- gt(t.pointerType || void 0);
194
+ ft(t.pointerType || void 0);
187
195
  return;
188
196
  }
189
- Y(), gt(t.pointerType || void 0);
197
+ D(), ft(t.pointerType || void 0);
190
198
  }
191
199
  }
192
- }, F = w(() => {
200
+ }, j = w(() => {
193
201
  const t = y();
194
202
  return t ? {
195
203
  x: t.worldX,
196
204
  y: t.worldY
197
- } : lt();
205
+ } : dt();
198
206
  }), p = w(() => {
199
- const t = L();
207
+ const t = A();
200
208
  return t ? {
201
209
  width: t.width,
202
210
  height: t.height
203
- } : st();
204
- }), tt = w(() => {
211
+ } : ut();
212
+ }), et = w(() => {
205
213
  const t = Bt();
206
214
  if (!(b() !== "projected_surface" || !t))
207
- return Te({
208
- widgetId: f(),
209
- worldX: F().x,
210
- worldY: F().y,
215
+ return Me({
216
+ widgetId: g(),
217
+ worldX: j().x,
218
+ worldY: j().y,
211
219
  worldWidth: p().width,
212
220
  worldHeight: p().height,
213
221
  viewport: t(),
214
222
  ready: Nt()
215
223
  });
216
- }), et = w(() => tt()?.rect.viewportScale ?? N()), ht = w(() => b() === "projected_surface" && We(H()) === "settle_sharp_zoom"), ft = w(() => b() === "projected_surface" && ht() && dt().enabled && dt().scale > 1.001), ae = w(() => {
224
+ }), ot = w(() => et()?.rect.viewportScale ?? G()), pt = w(() => b() === "projected_surface" && Te(V()) === "settle_sharp_zoom"), mt = w(() => b() === "projected_surface" && pt() && wt().enabled && wt().scale > 1.001), ce = w(() => {
217
225
  if (b() !== "projected_surface")
218
226
  return;
219
- const t = et();
220
- return ft() ? {
227
+ const t = ot();
228
+ return mt() ? {
221
229
  width: `${p().width}px`,
222
230
  height: `${p().height}px`,
223
231
  zoom: `${t}`
@@ -226,21 +234,21 @@ function Ze(i) {
226
234
  height: "100%",
227
235
  zoom: "1"
228
236
  };
229
- }), ce = w(() => {
237
+ }), le = w(() => {
230
238
  const t = E()().z_index, e = Number.isFinite(t) ? Math.max(1, Math.min(99, Math.round(t))) : 1;
231
239
  return String(e).padStart(2, "0");
232
- }), pt = (t) => {
240
+ }), _t = (t) => {
233
241
  t.preventDefault(), t.stopPropagation(), jt()(E()());
234
- }, mt = (t) => {
242
+ }, bt = (t) => {
235
243
  t.preventDefault(), t.stopPropagation(), Ot()(E()());
236
- }, _t = (t) => {
237
- t.preventDefault(), t.stopPropagation(), Ht()(f());
238
- }, le = w(() => {
244
+ }, vt = (t) => {
245
+ t.preventDefault(), t.stopPropagation(), Ht()(g());
246
+ }, se = w(() => {
239
247
  const t = {
240
- "z-index": J() || Q() || Rt() ? `${Lt() + 1}` : `${Et()}`
248
+ "z-index": Q() || tt() || Lt() ? `${lt() + 1}` : `${at()}`
241
249
  };
242
250
  if (b() === "projected_surface") {
243
- const e = tt()?.rect, n = et(), o = ft(), r = o ? e?.screenWidth ?? p().width * n : p().width, s = o ? e?.screenHeight ?? p().height * n : p().height;
251
+ const e = et()?.rect, n = ot(), o = mt(), r = o ? e?.screenWidth ?? p().width * n : p().width, s = o ? e?.screenHeight ?? p().height * n : p().height;
244
252
  return {
245
253
  ...t,
246
254
  width: `${r}px`,
@@ -253,40 +261,40 @@ function Ze(i) {
253
261
  ...t,
254
262
  width: `${p().width}px`,
255
263
  height: `${p().height}px`,
256
- transform: `translate(${F().x}px, ${F().y}px)`
264
+ transform: `translate(${j().x}px, ${j().y}px)`
257
265
  };
258
- }), bt = w(() => rt()?.phase === "enter");
259
- xt(() => {
260
- if (!ht()) {
261
- X(), A({
266
+ }), St = w(() => ct()?.phase === "enter");
267
+ It(() => {
268
+ if (!pt()) {
269
+ Y(), z({
262
270
  enabled: !1,
263
271
  scale: 1
264
272
  });
265
273
  return;
266
274
  }
267
- const t = et();
268
- if (t <= 1.001 || J() || Q()) {
269
- X(), A({
275
+ const t = ot();
276
+ if (t <= 1.001 || Q() || tt()) {
277
+ Y(), z({
270
278
  enabled: !1,
271
279
  scale: t
272
280
  });
273
281
  return;
274
282
  }
275
- if (A({
283
+ if (z({
276
284
  enabled: !1,
277
285
  scale: t
278
286
  }), typeof window > "u")
279
287
  return;
280
- X();
288
+ Y();
281
289
  const e = t;
282
- T = window.setTimeout(() => {
283
- T = void 0, A((n) => Math.abs(n.scale - e) < 1e-3 ? {
290
+ I = window.setTimeout(() => {
291
+ I = void 0, z((n) => Math.abs(n.scale - e) < 1e-3 ? {
284
292
  enabled: !0,
285
293
  scale: e
286
294
  } : n);
287
- }, Ye);
295
+ }, De);
288
296
  });
289
- const se = (t) => {
297
+ const de = (t) => {
290
298
  const e = $(y);
291
299
  if (!e) return;
292
300
  const n = {
@@ -295,20 +303,20 @@ function Ze(i) {
295
303
  }, o = {
296
304
  x: e.startWorldX,
297
305
  y: e.startWorldY
298
- }, r = t && (Math.abs(n.x - o.x) > 1 || Math.abs(n.y - o.y) > 1), s = f();
299
- ct()(s), r && Xt()(s, n), e.stopInteraction(), wt(), R(null), P = void 0;
300
- }, vt = (t) => {
306
+ }, r = t && (Math.abs(n.x - o.x) > 1 || Math.abs(n.y - o.y) > 1), s = g();
307
+ B()(s), r && Xt()(s, n), e.stopInteraction(), ht(), L(null), P = void 0;
308
+ }, kt = (t) => {
301
309
  if (t.button !== 0 || v()) return;
302
310
  t.preventDefault(), t.stopPropagation(), P?.stop({
303
311
  reason: "manual_stop",
304
312
  commit: !1
305
313
  });
306
- const e = f();
307
- V()(e), u?.focus({
314
+ const e = g();
315
+ q()(e), u?.focus({
308
316
  preventScroll: !0
309
- }), at()(e);
310
- const n = ut("drag", "grabbing"), o = N(), r = lt();
311
- R({
317
+ }), st()(e);
318
+ const n = gt("drag", "grabbing"), o = G(), r = dt();
319
+ L({
312
320
  pointerId: t.pointerId,
313
321
  startClientX: t.clientX,
314
322
  startClientY: t.clientY,
@@ -323,7 +331,7 @@ function Ze(i) {
323
331
  stopInteraction: n
324
332
  }), Jt();
325
333
  const s = (c) => {
326
- M?.updatePointer(c.clientX, c.clientY), R((d) => {
334
+ W?.updatePointer(c.clientX, c.clientY), L((d) => {
327
335
  if (!d || d.pointerId !== c.pointerId) return d;
328
336
  const _ = d.startWorldX + (c.clientX - d.startClientX) / d.scale + d.autoPanWorldX, k = d.startWorldY + (c.clientY - d.startClientY) / d.scale + d.autoPanWorldY;
329
337
  return {
@@ -334,30 +342,30 @@ function Ze(i) {
334
342
  };
335
343
  });
336
344
  };
337
- P = It({
345
+ P = Et({
338
346
  pointerEvent: t,
339
347
  captureEl: t.currentTarget,
340
348
  onMove: s,
341
349
  onEnd: ({
342
350
  commit: c
343
- }) => se(c)
351
+ }) => de(c)
344
352
  });
345
- }, de = (t) => {
346
- const e = $(L);
353
+ }, ue = (t) => {
354
+ const e = $(A);
347
355
  if (!e) return;
348
356
  const n = {
349
357
  width: e.width,
350
358
  height: e.height
351
359
  }, o = Math.abs(e.width - e.startWidth) > 1 || Math.abs(e.height - e.startHeight) > 1;
352
- t && o && Yt()(f(), n), e.stopInteraction(), G(null), x = void 0;
353
- }, ue = (t) => {
360
+ t && o && Yt()(g(), n), e.stopInteraction(), Z(null), x = void 0;
361
+ }, we = (t) => {
354
362
  if (t.button !== 0 || v()) return;
355
363
  t.preventDefault(), t.stopPropagation(), x?.stop({
356
364
  reason: "manual_stop",
357
365
  commit: !1
358
- }), at()(f());
359
- const e = ut("resize", "nwse-resize"), n = N(), o = st();
360
- G({
366
+ }), st()(g());
367
+ const e = gt("resize", "nwse-resize"), n = G(), o = ut();
368
+ Z({
361
369
  pointerId: t.pointerId,
362
370
  startClientX: t.clientX,
363
371
  startClientY: t.clientY,
@@ -369,9 +377,9 @@ function Ze(i) {
369
377
  stopInteraction: e
370
378
  });
371
379
  const r = (s) => {
372
- G((c) => {
380
+ Z((c) => {
373
381
  if (!c || c.pointerId !== s.pointerId) return c;
374
- const d = Math.max(ze, c.startWidth + (s.clientX - c.startClientX) / c.scale), _ = Math.max(Xe, c.startHeight + (s.clientY - c.startClientY) / c.scale);
382
+ const d = Math.max(Xe, c.startWidth + (s.clientX - c.startClientX) / c.scale), _ = Math.max(Ye, c.startHeight + (s.clientY - c.startClientY) / c.scale);
375
383
  return {
376
384
  ...c,
377
385
  width: d,
@@ -379,130 +387,130 @@ function Ze(i) {
379
387
  };
380
388
  });
381
389
  };
382
- x = It({
390
+ x = Et({
383
391
  pointerEvent: t,
384
392
  captureEl: t.currentTarget,
385
393
  onMove: r,
386
394
  onEnd: ({
387
395
  commit: s
388
- }) => de(s)
396
+ }) => ue(s)
389
397
  });
390
398
  };
391
399
  return (() => {
392
- var t = Le(), e = t.firstChild, n = e.firstChild, o = n.firstChild, r = o.firstChild, s = r.nextSibling, c = s.nextSibling, d = o.nextSibling, _ = d.nextSibling, k = _.nextSibling, we = k.firstChild, St = we.nextSibling, ge = k.nextSibling, j = ge.firstChild, O = j.nextSibling, ot = O.nextSibling, he = n.nextSibling, kt = u;
393
- return typeof kt == "function" ? be(kt, t) : u = t, yt(t, fe({
400
+ var t = Ae(), e = t.firstChild, n = e.firstChild, o = n.firstChild, r = o.firstChild, s = r.nextSibling, c = s.nextSibling, d = o.nextSibling, _ = d.nextSibling, k = _.nextSibling, ge = k.firstChild, $t = ge.nextSibling, he = k.nextSibling, O = he.firstChild, H = O.nextSibling, nt = H.nextSibling, fe = n.nextSibling, yt = u;
401
+ return typeof yt == "function" ? ve(yt, t) : u = t, xt(t, pe({
394
402
  get classList() {
395
403
  return {
396
- "is-selected": I(),
397
- "is-dragging": J(),
398
- "is-resizing": Q(),
399
- "is-filtered-out": B(),
404
+ "is-selected": T(),
405
+ "is-dragging": Q(),
406
+ "is-resizing": tt(),
407
+ "is-filtered-out": N(),
400
408
  "is-projected-surface": b() === "projected_surface",
401
409
  "is-locked": v(),
402
- "is-entering": bt()
410
+ "is-entering": St()
403
411
  };
404
412
  }
405
413
  }, () => ({
406
- [g().dialogSurfaceHostAttr]: "true"
414
+ [h().dialogSurfaceHostAttr]: "true"
407
415
  }), {
408
416
  get "data-floe-workbench-widget-id"() {
409
- return f();
417
+ return g();
410
418
  }
411
419
  }, () => ({
412
- [g().widgetRootAttr]: "true"
420
+ [h().widgetRootAttr]: "true"
413
421
  }), () => ({
414
- [g().widgetIdAttr]: f()
422
+ [h().widgetIdAttr]: g()
415
423
  }), {
416
424
  get "data-workbench-widget-type"() {
417
- return it();
425
+ return rt();
418
426
  },
419
427
  get "data-floe-workbench-render-mode"() {
420
428
  return b();
421
429
  },
422
430
  get "data-workbench-widget-motion"() {
423
- return bt() ? "enter" : void 0;
431
+ return St() ? "enter" : void 0;
424
432
  }
425
433
  }, () => ({
426
- [$e]: I() ? "true" : void 0
434
+ [ye]: T() ? "true" : void 0
427
435
  }), {
428
436
  tabIndex: 0,
429
- onPointerDown: re,
437
+ onPointerDown: ae,
430
438
  onFocus: () => {
431
- Z() || V()(f());
439
+ K() || q()(g());
432
440
  },
433
441
  onContextMenu: (l) => {
434
- D(l.target) === "widget_shell" && (l.preventDefault(), l.stopPropagation(), zt()(l, E()()));
442
+ F(l.target) === "widget_shell" && (l.preventDefault(), l.stopPropagation(), zt()(l, E()()));
435
443
  },
436
444
  get style() {
437
- return le();
445
+ return se();
438
446
  }
439
- }), !1, !0), n.$$pointerdown = vt, yt(n, {
440
- [ye]: "true"
441
- }, !1, !0), r.$$click = _t, r.$$pointerdown = (l) => l.stopPropagation(), h(r, m(Mt, {
447
+ }), !1, !0), n.$$pointerdown = kt, xt(n, {
448
+ [Pe]: "true"
449
+ }, !1, !0), r.$$click = vt, r.$$pointerdown = (l) => l.stopPropagation(), f(r, m(Mt, {
442
450
  class: "workbench-widget__traffic-icon",
443
451
  "aria-hidden": "true"
444
- })), s.$$click = pt, s.$$pointerdown = (l) => l.stopPropagation(), h(s, m(Tt, {
452
+ })), s.$$click = _t, s.$$pointerdown = (l) => l.stopPropagation(), f(s, m(Tt, {
445
453
  class: "workbench-widget__traffic-icon",
446
454
  "aria-hidden": "true"
447
- })), c.$$click = mt, c.$$pointerdown = (l) => l.stopPropagation(), h(c, m(Wt, {
455
+ })), c.$$click = bt, c.$$pointerdown = (l) => l.stopPropagation(), f(c, m(Ct, {
448
456
  class: "workbench-widget__traffic-icon",
449
457
  "aria-hidden": "true"
450
- })), h(d, ce), _.$$pointerdown = vt, h(_, m(ke, {
458
+ })), f(d, le), _.$$pointerdown = kt, f(_, m($e, {
451
459
  class: "w-3.5 h-3.5"
452
- })), h(k, () => {
453
- const l = H().icon;
460
+ })), f(k, () => {
461
+ const l = V().icon;
454
462
  return m(l, {
455
463
  class: "w-3.5 h-3.5"
456
464
  });
457
- }, St), h(St, nt), j.$$click = pt, j.$$pointerdown = (l) => l.stopPropagation(), h(j, m(Tt, {
465
+ }, $t), f($t, it), O.$$click = _t, O.$$pointerdown = (l) => l.stopPropagation(), f(O, m(Tt, {
458
466
  class: "workbench-widget__window-control-icon",
459
467
  "aria-hidden": "true"
460
- })), O.$$click = mt, O.$$pointerdown = (l) => l.stopPropagation(), h(O, m(Wt, {
468
+ })), H.$$click = bt, H.$$pointerdown = (l) => l.stopPropagation(), f(H, m(Ct, {
461
469
  class: "workbench-widget__window-control-icon",
462
470
  "aria-hidden": "true"
463
- })), ot.$$click = _t, ot.$$pointerdown = (l) => l.stopPropagation(), h(ot, m(Mt, {
471
+ })), nt.$$click = vt, nt.$$pointerdown = (l) => l.stopPropagation(), f(nt, m(Mt, {
464
472
  class: "workbench-widget__window-control-icon",
465
473
  "aria-hidden": "true"
466
- })), h(he, () => {
467
- const l = H().body;
474
+ })), f(fe, () => {
475
+ const l = V().body;
468
476
  return m(l, {
469
477
  get widgetId() {
470
- return f();
478
+ return g();
471
479
  },
472
480
  get title() {
473
- return nt();
481
+ return it();
474
482
  },
475
483
  get type() {
476
- return it();
484
+ return rt();
477
485
  },
478
- surfaceMetrics: tt,
486
+ surfaceMetrics: et,
479
487
  get activation() {
480
488
  return Gt();
481
489
  },
482
490
  get lifecycle() {
483
- return ee();
491
+ return oe();
484
492
  },
485
493
  get motion() {
486
- return rt();
494
+ return ct();
487
495
  },
488
496
  get selected() {
489
- return I();
497
+ return T();
490
498
  },
491
499
  get filtered() {
492
- return B();
500
+ return N();
493
501
  },
494
- requestActivate: oe
502
+ requestActivate: ne
495
503
  });
496
- }), h(e, (() => {
497
- var l = pe(() => !!v());
504
+ }), f(e, (() => {
505
+ var l = me(() => !!v());
498
506
  return () => l() ? null : (() => {
499
- var $t = Ae();
500
- return $t.$$pointerdown = ue, $t;
507
+ var Pt = ze();
508
+ return Pt.$$pointerdown = we, Pt;
501
509
  })();
502
- })(), null), me((l) => _e(e, ae(), l)), t;
510
+ })(), null), _e((l) => be(e, ce(), l)), t;
503
511
  })();
504
512
  }
505
- ve(["pointerdown", "click"]);
513
+ Se(["pointerdown", "click"]);
506
514
  export {
507
- Ze as WorkbenchWidget
515
+ Ke as WorkbenchWidget
508
516
  };