@floegence/floe-webapp-core 0.36.60 → 0.36.62

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