@floegence/floe-webapp-core 0.85.1 → 0.86.1

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