@floegence/floe-webapp-core 0.74.0 → 0.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,67 +1,67 @@
1
- import { createComponent as l, Portal as Ge, spread as _e, mergeProps as Se, memo as O, insert as c, effect as f, setAttribute as Qe, addEventListener as b, className as w, template as s, use as Pe, delegateEvents as Ze } from "solid-js/web";
2
- import { createSignal as g, createUniqueId as Je, onCleanup as C, onMount as Ke, createEffect as p, untrack as B, Show as z, batch as ee } from "solid-js";
3
- import { useMediaQuery as et } from "../../hooks/useMediaQuery.js";
4
- import { cn as D } from "../../utils/cn.js";
5
- import { useOptionalLayout as tt } from "../../context/LayoutContext.js";
6
- import { Button as Ie } from "./Button.js";
7
- import { Restore as nt, Maximize as it, X as ot } from "../icons/index.js";
8
- import { startHotInteraction as rt } from "../../utils/hotInteraction.js";
9
- import { startPointerSession as lt } from "./pointerSession.js";
10
- import { resolveFloatingWindowViewport as te, normalizeFloatingWindowRect as at, resolveFloatingWindowRect as st } from "./floatingWindowGeometry.js";
11
- import { observeViewport as dt } from "../../viewport.js";
12
- import { createFloatingPresence as ut } from "./floatingPresence.js";
13
- import { LOCAL_INTERACTION_SURFACE_ATTR as Re } from "./localInteractionSurface.js";
14
- import { resolveFloatingBoundary as ct } from "./surfaceFloatingBoundary.js";
15
- import { SURFACE_PORTAL_LAYER_ATTR as ft, resolveSurfacePortalHost as ht, SURFACE_FLOATING_LAYER_ATTR as wt } from "./dialogSurfaceScope.js";
16
- var gt = /* @__PURE__ */ s("<span hidden>"), mt = /* @__PURE__ */ s('<h2 class="text-xs leading-none font-medium truncate select-none">'), vt = /* @__PURE__ */ s('<div data-floe-floating-window-header-actions=true class="flex shrink-0 cursor-default items-center gap-1"><span aria-hidden=true class="mx-2 h-4 w-px shrink-0 bg-border">'), xt = /* @__PURE__ */ s('<div data-floe-floating-window-footer=true class="flex items-center justify-end gap-2 p-3 border-t border-border">'), yt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), bt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), pt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), zt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), $t = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), _t = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), St = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), Pt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), It = /* @__PURE__ */ s('<div data-floe-geometry-surface=floating-window><div data-floe-dialog-surface-host=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0 px-2"></div><div class="flex h-full shrink-0 items-stretch"></div></div><div data-floe-floating-window-content=true class="min-h-0 flex-1 overflow-auto overscroll-contain p-3">');
17
- function Xt(n) {
18
- const ne = () => n.resizable ?? !0, W = () => n.maximizable ?? !0, ie = () => n.draggable ?? !0, oe = () => n.minSize ?? {
1
+ import { createComponent as l, Portal as Qe, spread as Se, mergeProps as Pe, memo as D, insert as c, effect as f, setAttribute as Ze, addEventListener as b, className as w, template as s, use as Ie, delegateEvents as Je } from "solid-js/web";
2
+ import { createSignal as g, createUniqueId as Ke, onCleanup as F, onMount as et, createEffect as p, untrack as W, Show as z, batch as te } from "solid-js";
3
+ import { useMediaQuery as tt } from "../../hooks/useMediaQuery.js";
4
+ import { cn as q } from "../../utils/cn.js";
5
+ import { useOptionalLayout as nt } from "../../context/LayoutContext.js";
6
+ import { Button as Re } from "./Button.js";
7
+ import { Restore as it, Maximize as ot, X as rt } from "../icons/index.js";
8
+ import { startHotInteraction as lt } from "../../utils/hotInteraction.js";
9
+ import { startPointerSession as at } from "./pointerSession.js";
10
+ import { resolveFloatingWindowViewport as ne, normalizeFloatingWindowRect as st, resolveFloatingWindowRect as dt } from "./floatingWindowGeometry.js";
11
+ import { observeViewport as ut } from "../../viewport.js";
12
+ import { createFloatingPresence as ct } from "./floatingPresence.js";
13
+ import { LOCAL_INTERACTION_SURFACE_ATTR as Ae } from "./localInteractionSurface.js";
14
+ import { resolveFloatingBoundary as ft } from "./surfaceFloatingBoundary.js";
15
+ import { SURFACE_PORTAL_LAYER_ATTR as ht, resolveSurfacePortalHost as wt, SURFACE_FLOATING_LAYER_ATTR as gt } from "./dialogSurfaceScope.js";
16
+ var mt = /* @__PURE__ */ s("<span hidden>"), vt = /* @__PURE__ */ s('<h2 class="text-xs leading-none font-medium truncate select-none">'), xt = /* @__PURE__ */ s('<div data-floe-floating-window-header-actions=true class="flex shrink-0 cursor-default items-center gap-1"><span aria-hidden=true class="mx-2 h-4 w-px shrink-0 bg-border">'), yt = /* @__PURE__ */ s('<div data-floe-floating-window-footer=true class="flex items-center justify-end gap-2 p-3 border-t border-border">'), bt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=n style=touch-action:none>"), pt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=s style=touch-action:none>"), zt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=e style=touch-action:none>"), $t = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=w style=touch-action:none>"), _t = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=ne style=touch-action:none>"), St = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=nw style=touch-action:none>"), Pt = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=se style=touch-action:none>"), It = /* @__PURE__ */ s("<div data-floe-floating-window-resize-handle=sw style=touch-action:none>"), Rt = /* @__PURE__ */ s('<div data-floe-geometry-surface=floating-window><div data-floe-dialog-surface-host=true><div data-floe-floating-window-titlebar=true style=touch-action:none><div class="flex-1 min-w-0 px-2"></div><div class="flex h-full shrink-0 items-stretch"></div></div><div data-floe-floating-window-content=true class="min-h-0 flex-1 overflow-auto overscroll-contain p-3">');
17
+ function Ht(n) {
18
+ const ie = () => n.resizable ?? !0, Y = () => n.maximizable ?? !0, oe = () => n.draggable ?? !0, re = () => n.minSize ?? {
19
19
  width: 200,
20
20
  height: 150
21
- }, re = () => n.maxSize ?? {
21
+ }, le = () => n.maxSize ?? {
22
22
  width: 1 / 0,
23
23
  height: 1 / 0
24
24
  };
25
- let q;
26
- const [Y, Ae] = g(), [R, Ee] = g({
25
+ let N;
26
+ const [k, Ee] = g(), [A, Ce] = g({
27
27
  x: 0,
28
28
  y: 0,
29
29
  width: 0,
30
30
  height: 0
31
31
  }, {
32
32
  equals: (e, t) => e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height
33
- }), [N, Ce] = g(!0), h = () => !!(n.compactBelow && R().width < n.compactBelow), S = () => n.viewportInsets, X = (e) => ({
34
- x: e.x + (Y()?.fixedOffset.left ?? 0),
35
- y: e.y + (Y()?.fixedOffset.top ?? 0)
36
- }), Fe = () => n.zIndex ?? 100, ke = Je(), F = tt()?.isMobile ?? et("(max-width: 767px)"), le = 16, ae = () => `floating-window-${ke}-title`, [H, Le] = g(n.defaultPosition ?? {
33
+ }), [X, Fe] = g(!0), h = () => !!(n.compactBelow && A().width < n.compactBelow), S = () => n.viewportInsets, P = () => k()?.fixedScale ?? 1, H = (e) => ({
34
+ x: (e.x + (k()?.fixedOffset.left ?? 0)) / P(),
35
+ y: (e.y + (k()?.fixedOffset.top ?? 0)) / P()
36
+ }), ke = () => n.zIndex ?? 100, Le = Ke(), L = nt()?.isMobile ?? tt("(max-width: 767px)"), ae = 16, se = () => `floating-window-${Le}-title`, [U, Me] = g(n.defaultPosition ?? {
37
37
  x: 0,
38
38
  y: 0
39
- }), [U, Me] = g(n.defaultSize ?? {
39
+ }), [V, Te] = g(n.defaultSize ?? {
40
40
  width: 400,
41
41
  height: 300
42
- }), [d, se] = g(!1), [k, de] = g(!1), [L, ue] = g(!1), [Te, V] = g(!1), P = ut({
42
+ }), [d, de] = g(!1), [M, ue] = g(!1), [T, ce] = g(!1), [Oe, j] = g(!1), I = ct({
43
43
  open: () => n.open
44
44
  });
45
- let ce = {
45
+ let fe = {
46
46
  x: 0,
47
47
  y: 0
48
- }, fe = {
48
+ }, he = {
49
49
  x: 0,
50
50
  y: 0,
51
51
  width: 0,
52
52
  height: 0
53
- }, he = {
53
+ }, we = {
54
54
  x: 0,
55
55
  y: 0
56
- }, we = {
56
+ }, ge = {
57
57
  x: 0,
58
58
  y: 0,
59
59
  width: 0,
60
60
  height: 0
61
- }, ge = "se", a, u = null, M, m = null, A = {
61
+ }, me = "se", a, u = null, O, m = null, E = {
62
62
  x: 0,
63
63
  y: 0
64
- }, I = null, T = null, j = !1, $ = {
64
+ }, R = null, B = null, G = !1, $ = {
65
65
  x: n.defaultPosition?.x ?? 0,
66
66
  y: n.defaultPosition?.y ?? 0,
67
67
  width: n.defaultSize?.width ?? 400,
@@ -69,16 +69,16 @@ function Xt(n) {
69
69
  }, v = {
70
70
  ...$
71
71
  }, _;
72
- const me = (e) => {
72
+ const ve = (e) => {
73
73
  v = {
74
74
  ...e
75
75
  };
76
- const t = te(R(), S());
76
+ const t = ne(A(), S());
77
77
  _ = {
78
78
  x: t.width > e.width ? (e.x - t.x) / (t.width - e.width) : _?.x ?? 0.5,
79
79
  y: t.height > e.height ? (e.y - t.y) / (t.height - e.height) : _?.y ?? 0.5
80
80
  };
81
- }, Oe = {
81
+ }, Be = {
82
82
  n: "ns-resize",
83
83
  s: "ns-resize",
84
84
  e: "ew-resize",
@@ -87,50 +87,50 @@ function Xt(n) {
87
87
  nw: "nwse-resize",
88
88
  se: "nwse-resize",
89
89
  sw: "nesw-resize"
90
- }, G = (e, t) => {
90
+ }, Q = (e, t) => {
91
91
  if (!e) {
92
- T?.(), T = null;
92
+ B?.(), B = null;
93
93
  return;
94
94
  }
95
- T?.(), T = rt({
95
+ B?.(), B = lt({
96
96
  kind: m === "resize" ? "resize" : "drag",
97
97
  cursor: t,
98
98
  lockUserSelect: !0
99
99
  });
100
- }, ve = (e) => {
100
+ }, xe = (e) => {
101
101
  if ($ = e, !a) return;
102
- const t = X(e);
103
- a.style.transform = `translate3d(${t.x}px, ${t.y}px, 0)`, a.style.width = `${e.width}px`, a.style.height = `${e.height}px`;
104
- }, Be = () => {
105
- const e = H(), t = U();
102
+ const t = H(e);
103
+ a.style.transform = `translate3d(${t.x}px, ${t.y}px, 0)`, a.style.width = `${e.width / P()}px`, a.style.height = `${e.height / P()}px`;
104
+ }, De = () => {
105
+ const e = U(), t = V();
106
106
  return {
107
107
  x: e.x,
108
108
  y: e.y,
109
109
  width: t.width,
110
110
  height: t.height
111
111
  };
112
- }, Q = (e) => {
113
- $ = e, Le((t) => t.x === e.x && t.y === e.y ? t : {
112
+ }, Z = (e) => {
113
+ $ = e, Me((t) => t.x === e.x && t.y === e.y ? t : {
114
114
  x: e.x,
115
115
  y: e.y
116
- }), Me((t) => t.width === e.width && t.height === e.height ? t : {
116
+ }), Te((t) => t.width === e.width && t.height === e.height ? t : {
117
117
  width: e.width,
118
118
  height: e.height
119
119
  });
120
- }, De = () => {
120
+ }, We = () => {
121
121
  try {
122
122
  a?.focus({
123
123
  preventScroll: !0
124
124
  });
125
125
  } catch {
126
126
  }
127
- }, We = (e) => {
127
+ }, qe = (e) => {
128
128
  const t = e instanceof Element ? e : null;
129
129
  return t ? t.closest('button, input, select, textarea, a, [role="button"], [tabindex]:not([tabindex="-1"])') === null : !0;
130
- }, Z = (e) => !!a && e instanceof Node && a.contains(e), qe = (e) => {
131
- const o = (e instanceof Element ? e : null)?.closest('[role="menu"]')?.closest(`[${wt}="true"]`);
130
+ }, J = (e) => !!a && e instanceof Node && a.contains(e), Ye = (e) => {
131
+ const o = (e instanceof Element ? e : null)?.closest('[role="menu"]')?.closest(`[${gt}="true"]`);
132
132
  return !!(o && a?.contains(o));
133
- }, Ye = () => {
133
+ }, Ne = () => {
134
134
  if (!a) return null;
135
135
  const e = a.getBoundingClientRect();
136
136
  return {
@@ -139,83 +139,83 @@ function Xt(n) {
139
139
  width: e.width,
140
140
  height: e.height
141
141
  };
142
- }, xe = () => {
143
- n.open && (u === null || m === null || typeof window > "u" || ve(st({
142
+ }, ye = () => {
143
+ n.open && (u === null || m === null || typeof window > "u" || xe(dt({
144
144
  mode: m,
145
- pointer: A,
146
- dragStartPos: ce,
147
- dragStartRect: fe,
148
- resizeStartPos: he,
149
- resizeStartRect: we,
150
- resizeHandle: ge,
151
- minSize: oe(),
152
- maxSize: re(),
153
- viewport: R(),
145
+ pointer: E,
146
+ dragStartPos: fe,
147
+ dragStartRect: he,
148
+ resizeStartPos: we,
149
+ resizeStartRect: ge,
150
+ resizeHandle: me,
151
+ minSize: re(),
152
+ maxSize: le(),
153
+ viewport: A(),
154
154
  viewportInsets: S(),
155
- mobile: F(),
156
- mobilePadding: le
155
+ mobile: L(),
156
+ mobilePadding: ae
157
157
  })));
158
- }, E = (e) => {
158
+ }, C = (e) => {
159
159
  if (typeof window > "u") return;
160
- const t = R();
160
+ const t = A();
161
161
  if (d() || h()) {
162
- Q(te(t, S()));
162
+ Z(ne(t, S()));
163
163
  return;
164
164
  }
165
- let r = at({
165
+ let r = st({
166
166
  rect: v,
167
- minSize: oe(),
168
- maxSize: re(),
167
+ minSize: re(),
168
+ maxSize: le(),
169
169
  viewport: t,
170
170
  viewportInsets: S(),
171
- mobile: n.boundary === void 0 && F(),
172
- mobilePadding: le,
171
+ mobile: n.boundary === void 0 && L(),
172
+ mobilePadding: ae,
173
173
  center: e?.center ?? !1
174
174
  });
175
175
  if (n.boundary !== void 0 && _ && !e?.center) {
176
- const o = te(t, S());
176
+ const o = ne(t, S());
177
177
  r = {
178
178
  ...r,
179
179
  x: o.x + _.x * Math.max(0, o.width - r.width),
180
180
  y: o.y + _.y * Math.max(0, o.height - r.height)
181
181
  };
182
182
  }
183
- if (Q(r), !_) {
183
+ if (Z(r), !_) {
184
184
  const o = {
185
185
  width: v.width,
186
186
  height: v.height
187
187
  };
188
- me(r), Object.assign(v, o);
188
+ ve(r), Object.assign(v, o);
189
189
  }
190
- }, ye = (e) => {
191
- I !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(I), I = null), e && xe();
192
- const t = e ? Ye() ?? $ : null;
193
- ee(() => {
190
+ }, be = (e) => {
191
+ R !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(R), R = null), e && ye();
192
+ const t = e ? Ne() ?? $ : null;
193
+ te(() => {
194
194
  if (t) {
195
- Q(t);
195
+ Z(t);
196
196
  const r = {
197
197
  width: v.width,
198
198
  height: v.height
199
199
  };
200
- me(t), m === "drag" && Object.assign(v, r);
200
+ ve(t), m === "drag" && Object.assign(v, r);
201
201
  }
202
- u = null, m = null, de(!1), ue(!1);
203
- }), G(!1, ""), M = void 0;
204
- }, J = (e = !1) => {
205
- M ? M.stop({
202
+ u = null, m = null, ue(!1), ce(!1);
203
+ }), Q(!1, ""), O = void 0;
204
+ }, K = (e = !1) => {
205
+ O ? O.stop({
206
206
  commit: e
207
- }) : ye(e);
207
+ }) : be(e);
208
208
  };
209
- C(() => J(!1)), Ke(() => {
209
+ F(() => K(!1)), et(() => {
210
210
  const e = () => {
211
- const t = Y(), r = n.boundary === void 0 ? {
211
+ const t = k(), r = n.boundary === void 0 ? {
212
212
  boundaryHost: null,
213
213
  mode: "global"
214
- } : ht({
215
- owner: q
216
- }), o = ct(r, n.boundary, t?.safeArea);
217
- ee(() => {
218
- Ce(!!(o && o.width > 16 && o.height > 16)), Ee(o ? {
214
+ } : wt({
215
+ owner: N
216
+ }), o = ft(r, n.boundary, t?.safeArea);
217
+ te(() => {
218
+ Fe(!!(o && o.width > 16 && o.height > 16)), Ce(o ? {
219
219
  x: o.left,
220
220
  y: o.top,
221
221
  width: o.width,
@@ -228,27 +228,27 @@ function Xt(n) {
228
228
  });
229
229
  });
230
230
  };
231
- C(dt(window, (t) => {
232
- ee(() => {
233
- Ae(t), B(e);
231
+ F(ut(window, (t) => {
232
+ te(() => {
233
+ Ee(t), W(e);
234
234
  });
235
235
  })), p(() => {
236
236
  if (!n.open || n.boundary === void 0) return;
237
237
  let t = 0;
238
238
  const r = () => {
239
- B(e), t = requestAnimationFrame(r);
239
+ W(e), t = requestAnimationFrame(r);
240
240
  };
241
- r(), C(() => cancelAnimationFrame(t));
242
- }), n.open || E({
241
+ r(), F(() => cancelAnimationFrame(t));
242
+ }), n.open || C({
243
243
  center: !n.defaultPosition
244
244
  });
245
245
  }), p(() => {
246
246
  if (!n.open) return;
247
- F();
248
- const e = !j && !n.defaultPosition, t = () => {
249
- E({
247
+ L();
248
+ const e = !G && !n.defaultPosition, t = () => {
249
+ C({
250
250
  center: e
251
- }), j = !0;
251
+ }), G = !0;
252
252
  };
253
253
  if (typeof requestAnimationFrame > "u") {
254
254
  t();
@@ -256,12 +256,12 @@ function Xt(n) {
256
256
  }
257
257
  requestAnimationFrame(t);
258
258
  }), p(() => {
259
- S(), R(), h(), !(!n.open || !j || u !== null) && B(() => E({
259
+ S(), A(), h(), !(!n.open || !G || u !== null) && W(() => C({
260
260
  center: !1
261
261
  }));
262
262
  }), p(() => {
263
- W() || !d() || B(() => {
264
- se(!1), E({
263
+ Y() || !d() || W(() => {
264
+ de(!1), C({
265
265
  center: !1
266
266
  });
267
267
  });
@@ -270,88 +270,88 @@ function Xt(n) {
270
270
  const e = (t) => {
271
271
  if (t.key !== "Escape") return;
272
272
  const r = typeof document < "u" ? document.activeElement : null;
273
- !Z(t.target) && !Z(r) || qe(t.target) || (t.preventDefault(), typeof t.stopImmediatePropagation == "function" ? t.stopImmediatePropagation() : t.stopPropagation(), n.onOpenChange(!1));
273
+ !J(t.target) && !J(r) || Ye(t.target) || (t.preventDefault(), typeof t.stopImmediatePropagation == "function" ? t.stopImmediatePropagation() : t.stopPropagation(), n.onOpenChange(!1));
274
274
  };
275
- document.addEventListener("keydown", e, !0), C(() => document.removeEventListener("keydown", e, !0));
275
+ document.addEventListener("keydown", e, !0), F(() => document.removeEventListener("keydown", e, !0));
276
276
  }), p(() => {
277
277
  if (!n.open) {
278
- V(!1), J(!1);
278
+ j(!1), K(!1);
279
279
  return;
280
280
  }
281
- V(!0);
281
+ j(!0);
282
282
  }), p(() => {
283
283
  if (!n.open) return;
284
284
  const e = (o) => {
285
- V(Z(o));
285
+ j(J(o));
286
286
  }, t = (o) => {
287
287
  e(o.target);
288
288
  }, r = (o) => {
289
289
  e(o.target);
290
290
  };
291
- document.addEventListener("pointerdown", t), document.addEventListener("focusin", r), C(() => {
291
+ document.addEventListener("pointerdown", t), document.addEventListener("focusin", r), F(() => {
292
292
  document.removeEventListener("pointerdown", t), document.removeEventListener("focusin", r);
293
293
  });
294
294
  }), p(() => {
295
295
  if (!n.open) return;
296
- const e = Be();
297
- u === null ? ve(e) : $ = e;
296
+ const e = De();
297
+ u === null ? xe(e) : $ = e;
298
298
  });
299
- const Ne = (e) => {
300
- !ie() || d() || h() || u !== null || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"], [data-floe-floating-window-header-actions]') || (e.preventDefault(), u = e.pointerId, m = "drag", de(!0), ce = {
299
+ const Xe = (e) => {
300
+ !oe() || d() || h() || u !== null || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"], [data-floe-floating-window-header-actions]') || (e.preventDefault(), u = e.pointerId, m = "drag", ue(!0), fe = {
301
301
  x: e.clientX,
302
302
  y: e.clientY
303
- }, fe = {
303
+ }, he = {
304
304
  ...$
305
- }, A = {
305
+ }, E = {
306
306
  x: e.clientX,
307
307
  y: e.clientY
308
- }, G(!0, "grabbing"), pe(e));
308
+ }, Q(!0, "grabbing"), ze(e));
309
309
  }, x = (e) => (t) => {
310
- !ne() || d() || h() || u !== null || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), t.stopPropagation(), u = t.pointerId, m = "resize", ue(!0), ge = e, he = {
310
+ !ie() || d() || h() || u !== null || t.pointerType === "mouse" && t.button !== 0 || (t.preventDefault(), t.stopPropagation(), u = t.pointerId, m = "resize", ce(!0), me = e, we = {
311
311
  x: t.clientX,
312
312
  y: t.clientY
313
- }, we = {
313
+ }, ge = {
314
314
  ...$
315
- }, A = {
315
+ }, E = {
316
316
  x: t.clientX,
317
317
  y: t.clientY
318
- }, G(!0, Oe[e]), pe(t));
319
- }, be = () => {
320
- I = null, xe();
321
- }, Xe = (e) => {
322
- if (!(u === null || e.pointerId !== u) && m !== null && (A = {
318
+ }, Q(!0, Be[e]), ze(t));
319
+ }, pe = () => {
320
+ R = null, ye();
321
+ }, He = (e) => {
322
+ if (!(u === null || e.pointerId !== u) && m !== null && (E = {
323
323
  x: e.clientX,
324
324
  y: e.clientY
325
- }, I === null)) {
325
+ }, R === null)) {
326
326
  if (typeof requestAnimationFrame > "u") {
327
- be();
327
+ pe();
328
328
  return;
329
329
  }
330
- I = requestAnimationFrame(be);
330
+ R = requestAnimationFrame(pe);
331
331
  }
332
- }, pe = (e) => {
333
- M = lt({
332
+ }, ze = (e) => {
333
+ O = at({
334
334
  pointerEvent: e,
335
335
  captureEl: a,
336
- onMove: Xe,
336
+ onMove: He,
337
337
  onEnd: ({
338
338
  commit: t,
339
339
  reason: r,
340
340
  snapshot: o
341
341
  }) => {
342
- A = {
342
+ E = {
343
343
  x: o.latestClientX,
344
344
  y: o.latestClientY
345
- }, ye(t || r === "pointer_cancel");
345
+ }, be(t || r === "pointer_cancel");
346
346
  }
347
347
  });
348
- }, ze = () => {
349
- !W() || h() || (u !== null && J(!0), se(!d()), E());
350
- }, He = (e) => {
351
- e.target?.closest("button, [data-floe-floating-window-header-actions]") || ze();
348
+ }, $e = () => {
349
+ !Y() || h() || (u !== null && K(!0), de(!d()), C());
352
350
  }, Ue = (e) => {
353
- We(e.target) && De();
354
- }, y = (e) => D("absolute z-10", {
351
+ e.target?.closest("button, [data-floe-floating-window-header-actions]") || $e();
352
+ }, Ve = (e) => {
353
+ qe(e.target) && We();
354
+ }, y = (e) => q("absolute z-10", {
355
355
  n: "cursor-ns-resize top-0 left-2 right-2 h-1",
356
356
  s: "cursor-ns-resize bottom-0 left-2 right-2 h-1",
357
357
  e: "cursor-ew-resize right-0 top-2 bottom-2 w-1",
@@ -362,67 +362,67 @@ function Xt(n) {
362
362
  sw: "cursor-nesw-resize bottom-0 left-0 w-2 h-2"
363
363
  }[e]);
364
364
  return [(() => {
365
- var e = gt(), t = q;
366
- return typeof t == "function" ? Pe(t, e) : q = e, e;
365
+ var e = mt(), t = N;
366
+ return typeof t == "function" ? Ie(t, e) : N = e, e;
367
367
  })(), l(z, {
368
368
  get when() {
369
- return P.mounted();
369
+ return I.mounted();
370
370
  },
371
371
  get children() {
372
- return l(Ge, {
372
+ return l(Qe, {
373
373
  get children() {
374
- var e = It(), t = e.firstChild, r = t.firstChild, o = r.firstChild, K = o.nextSibling, Ve = r.nextSibling, $e = a;
375
- return typeof $e == "function" ? Pe($e, e) : a = e, _e(e, Se({
374
+ var e = Rt(), t = e.firstChild, r = t.firstChild, o = r.firstChild, ee = o.nextSibling, je = r.nextSibling, _e = a;
375
+ return typeof _e == "function" ? Ie(_e, e) : a = e, Se(e, Pe({
376
376
  get "data-floating-presence"() {
377
- return P.state();
377
+ return I.state();
378
378
  },
379
379
  get "aria-hidden"() {
380
- return P.exiting() || !N() ? "true" : void 0;
380
+ return I.exiting() || !X() ? "true" : void 0;
381
381
  },
382
382
  get inert() {
383
- return P.exiting() || !N();
383
+ return I.exiting() || !X();
384
384
  },
385
385
  get "data-floe-floating-window-compact"() {
386
386
  return h() ? "true" : void 0;
387
387
  }
388
388
  }, {
389
- [Re]: "true"
389
+ [Ae]: "true"
390
390
  }, {
391
391
  get class() {
392
- return D("fixed left-0 top-0 z-[100] flex flex-col", (k() || L()) && "select-none", P.exiting() && "pointer-events-none");
392
+ return q("fixed left-0 top-0 z-[100] flex flex-col", (M() || T()) && "select-none", I.exiting() && "pointer-events-none");
393
393
  },
394
394
  get style() {
395
395
  return {
396
- visibility: N() ? void 0 : "hidden",
397
- width: `${U().width}px`,
398
- height: `${U().height}px`,
399
- transform: `translate3d(${X(H()).x}px, ${X(H()).y}px, 0)`,
400
- "z-index": Fe(),
401
- "will-change": k() ? "transform" : L() ? "transform, width, height" : void 0
396
+ visibility: X() ? void 0 : "hidden",
397
+ width: `${V().width / P()}px`,
398
+ height: `${V().height / P()}px`,
399
+ transform: `translate3d(${H(U()).x}px, ${H(U()).y}px, 0)`,
400
+ "z-index": ke(),
401
+ "will-change": M() ? "transform" : T() ? "transform, width, height" : void 0
402
402
  };
403
403
  },
404
404
  role: "dialog",
405
405
  get "aria-labelledby"() {
406
- return O(() => !!n.title)() ? ae() : void 0;
406
+ return D(() => !!n.title)() ? se() : void 0;
407
407
  },
408
408
  tabIndex: -1,
409
- onPointerDown: Ue
410
- }), !1, !0), _e(t, Se({
411
- [ft]: "true"
409
+ onPointerDown: Ve
410
+ }), !1, !0), Se(t, Pe({
411
+ [ht]: "true"
412
412
  }, {
413
413
  "data-floe-floating-window-surface": "true",
414
414
  "data-floe-surface": "floating",
415
415
  get "data-floe-surface-interacting"() {
416
- return k() || L() ? "true" : void 0;
416
+ return M() || T() ? "true" : void 0;
417
417
  },
418
418
  get "data-floe-floating-window-state"() {
419
- return Te() ? "active" : "inactive";
419
+ return Oe() ? "active" : "inactive";
420
420
  }
421
421
  }, {
422
- [Re]: "true"
422
+ [Ae]: "true"
423
423
  }, {
424
424
  get class() {
425
- return D("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "floe-floating-presence floe-floating-window-motion", (k() || L()) && "floe-floating-presence--suspended", d() && "rounded-none", n.class);
425
+ return q("relative flex h-full w-full flex-col overflow-hidden", "text-card-foreground rounded-md", "border", "floe-floating-presence floe-floating-window-motion", (M() || T()) && "floe-floating-presence--suspended", d() && "rounded-none", n.class);
426
426
  },
427
427
  get style() {
428
428
  return {
@@ -430,39 +430,39 @@ function Xt(n) {
430
430
  };
431
431
  },
432
432
  get "data-floating-presence"() {
433
- return P.state();
433
+ return I.state();
434
434
  }
435
- }), !1, !0), r.$$dblclick = He, r.$$pointerdown = Ne, c(o, l(z, {
435
+ }), !1, !0), r.$$dblclick = Ue, r.$$pointerdown = Xe, c(o, l(z, {
436
436
  get when() {
437
437
  return n.title;
438
438
  },
439
439
  get children() {
440
- var i = mt();
441
- return c(i, () => n.title), f(() => Qe(i, "id", ae())), i;
440
+ var i = vt();
441
+ return c(i, () => n.title), f(() => Ze(i, "id", se())), i;
442
442
  }
443
443
  })), c(r, l(z, {
444
444
  get when() {
445
445
  return n.headerActions;
446
446
  },
447
447
  get children() {
448
- var i = vt(), je = i.firstChild;
449
- return c(i, () => n.headerActions, je), i;
448
+ var i = xt(), Ge = i.firstChild;
449
+ return c(i, () => n.headerActions, Ge), i;
450
450
  }
451
- }), K), c(K, l(z, {
451
+ }), ee), c(ee, l(z, {
452
452
  get when() {
453
- return O(() => !!W())() && !h();
453
+ return D(() => !!Y())() && !h();
454
454
  },
455
455
  get children() {
456
- return l(Ie, {
456
+ return l(Re, {
457
457
  variant: "ghost",
458
458
  size: "icon",
459
459
  "data-floe-floating-window-control": "maximize",
460
460
  class: "h-full w-9 shrink-0 rounded-none border-0 px-0 active:scale-100",
461
461
  onClick: (i) => {
462
- i.stopPropagation(), ze();
462
+ i.stopPropagation(), $e();
463
463
  },
464
464
  get "aria-label"() {
465
- return O(() => !!d())() ? n.labels?.restore ?? "Restore" : n.labels?.maximize ?? "Maximize";
465
+ return D(() => !!d())() ? n.labels?.restore ?? "Restore" : n.labels?.maximize ?? "Maximize";
466
466
  },
467
467
  get children() {
468
468
  return l(z, {
@@ -470,12 +470,12 @@ function Xt(n) {
470
470
  return d();
471
471
  },
472
472
  get fallback() {
473
- return l(it, {
473
+ return l(ot, {
474
474
  class: "w-3 h-3"
475
475
  });
476
476
  },
477
477
  get children() {
478
- return l(nt, {
478
+ return l(it, {
479
479
  class: "w-3 h-3"
480
480
  });
481
481
  }
@@ -483,7 +483,7 @@ function Xt(n) {
483
483
  }
484
484
  });
485
485
  }
486
- }), null), c(K, l(Ie, {
486
+ }), null), c(ee, l(Re, {
487
487
  variant: "ghost-destructive",
488
488
  size: "icon",
489
489
  "data-floe-floating-window-control": "close",
@@ -495,63 +495,63 @@ function Xt(n) {
495
495
  return n.labels?.close ?? "Close";
496
496
  },
497
497
  get children() {
498
- return l(ot, {
498
+ return l(rt, {
499
499
  class: "w-3.5 h-3.5"
500
500
  });
501
501
  }
502
- }), null), c(Ve, () => n.children), c(t, l(z, {
502
+ }), null), c(je, () => n.children), c(t, l(z, {
503
503
  get when() {
504
504
  return n.footer;
505
505
  },
506
506
  get children() {
507
- var i = xt();
507
+ var i = yt();
508
508
  return c(i, () => n.footer), i;
509
509
  }
510
510
  }), null), c(t, l(z, {
511
511
  get when() {
512
- return O(() => !!(ne() && !d()))() && !h();
512
+ return D(() => !!(ie() && !d()))() && !h();
513
513
  },
514
514
  get children() {
515
515
  return [(() => {
516
- var i = yt();
516
+ var i = bt();
517
517
  return b(i, "pointerdown", x("n"), !0), f(() => w(i, y("n"))), i;
518
518
  })(), (() => {
519
- var i = bt();
519
+ var i = pt();
520
520
  return b(i, "pointerdown", x("s"), !0), f(() => w(i, y("s"))), i;
521
521
  })(), l(z, {
522
522
  get when() {
523
- return !F();
523
+ return !L();
524
524
  },
525
525
  get children() {
526
526
  return [(() => {
527
- var i = pt();
527
+ var i = zt();
528
528
  return b(i, "pointerdown", x("e"), !0), f(() => w(i, y("e"))), i;
529
529
  })(), (() => {
530
- var i = zt();
530
+ var i = $t();
531
531
  return b(i, "pointerdown", x("w"), !0), f(() => w(i, y("w"))), i;
532
532
  })(), (() => {
533
- var i = $t();
533
+ var i = _t();
534
534
  return b(i, "pointerdown", x("ne"), !0), f(() => w(i, y("ne"))), i;
535
535
  })(), (() => {
536
- var i = _t();
536
+ var i = St();
537
537
  return b(i, "pointerdown", x("nw"), !0), f(() => w(i, y("nw"))), i;
538
538
  })(), (() => {
539
- var i = St();
539
+ var i = Pt();
540
540
  return b(i, "pointerdown", x("se"), !0), f(() => w(i, y("se"))), i;
541
541
  })(), (() => {
542
- var i = Pt();
542
+ var i = It();
543
543
  return b(i, "pointerdown", x("sw"), !0), f(() => w(i, y("sw"))), i;
544
544
  })()];
545
545
  }
546
546
  })];
547
547
  }
548
- }), null), f(() => w(r, D("flex shrink-0 items-center justify-between h-8", "border-b", d() ? "rounded-none" : "rounded-t-md", ie() && !d() && !h() && "cursor-move"))), e;
548
+ }), null), f(() => w(r, q("flex shrink-0 items-center justify-between h-8", "border-b", d() ? "rounded-none" : "rounded-t-md", oe() && !d() && !h() && "cursor-move"))), e;
549
549
  }
550
550
  });
551
551
  }
552
552
  })];
553
553
  }
554
- Ze(["pointerdown", "dblclick"]);
554
+ Je(["pointerdown", "dblclick"]);
555
555
  export {
556
- Xt as FloatingWindow
556
+ Ht as FloatingWindow
557
557
  };