@floegence/floe-webapp-core 0.36.23 → 0.36.25

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