@floegence/floe-webapp-core 0.88.0 → 0.89.2

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