@floegence/floe-webapp-core 0.74.0 → 0.74.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,5 +1,5 @@
1
- import { createComponent as o, use as G, setAttribute as f, style as ne, Portal as ae, spread as I, mergeProps as M, memo as C, insert as i, effect as D, className as q, template as m } from "solid-js/web";
2
- import { createSignal as P, onMount as ie, onCleanup as E, createUniqueId as le, createEffect as K, createMemo as U, Show as g, untrack as V } from "solid-js";
1
+ import { createComponent as o, use as G, setAttribute as f, style as ne, Portal as ae, spread as I, mergeProps as M, memo as C, insert as l, effect as S, className as q, template as m } from "solid-js/web";
2
+ import { createSignal as D, onMount as ie, onCleanup as E, createUniqueId as le, createEffect as K, createMemo as U, Show as g, untrack as V } from "solid-js";
3
3
  import { cn as y } from "../../utils/cn.js";
4
4
  import { Button as j } from "./Button.js";
5
5
  import { X as de } from "../icons/index.js";
@@ -11,11 +11,11 @@ import { createFloatingPresence as we } from "./floatingPresence.js";
11
11
  import { useDialogPlacement as ye } from "./DialogPlacementContext.js";
12
12
  import { observeViewport as xe, viewportStyle as pe } from "../../viewport.js";
13
13
  import { resolveFloatingBoundary as $e } from "./surfaceFloatingBoundary.js";
14
- var Ae = /* @__PURE__ */ m("<span aria-hidden=true>"), Ce = /* @__PURE__ */ m('<h2 class="text-sm font-semibold">'), _e = /* @__PURE__ */ m('<div data-floe-dialog-header class="flex shrink-0 items-start justify-between p-3 border-b border-border"><div>'), ke = /* @__PURE__ */ m('<p class="mb-3 shrink-0 text-sm text-muted-foreground last:mb-0">'), Oe = /* @__PURE__ */ m('<div data-floe-dialog-footer class="flex shrink-0 items-center justify-end gap-2 p-3 border-t border-border">'), Re = /* @__PURE__ */ m("<div><div></div><div><div data-floe-surface=floating><div data-floe-dialog-body>"), De = /* @__PURE__ */ m("<h2 class=sr-only>");
15
- const Pe = {
14
+ var Ae = /* @__PURE__ */ m("<span aria-hidden=true>"), Ce = /* @__PURE__ */ m('<h2 class="text-sm font-semibold">'), _e = /* @__PURE__ */ m('<div data-floe-dialog-header class="flex shrink-0 items-start justify-between p-3 border-b border-border"><div>'), ke = /* @__PURE__ */ m('<p class="mb-3 shrink-0 text-sm text-muted-foreground last:mb-0">'), Oe = /* @__PURE__ */ m('<div data-floe-dialog-footer class="flex shrink-0 items-center justify-end gap-2 p-3 border-t border-border">'), Re = /* @__PURE__ */ m("<div><div></div><div><div data-floe-surface=floating><div data-floe-dialog-body>"), Se = /* @__PURE__ */ m("<h2 class=sr-only>");
15
+ const De = {
16
16
  display: "none"
17
17
  };
18
- function Se(e) {
18
+ function Pe(e) {
19
19
  if (typeof queueMicrotask == "function") {
20
20
  queueMicrotask(e);
21
21
  return;
@@ -36,11 +36,11 @@ function Be(e) {
36
36
  window.clearTimeout(e);
37
37
  }
38
38
  function Fe(e) {
39
- const x = ye(), [d, W] = P();
39
+ const x = ye(), [n, W] = D();
40
40
  ie(() => E(xe(window, W)));
41
- const c = le(), S = () => `dialog-${c}-title`, H = () => `dialog-${c}-description`;
41
+ const c = le(), P = () => `dialog-${c}-title`, H = () => `dialog-${c}-description`;
42
42
  let T;
43
- const [k, Y] = P(null), [L, X] = P(0), [J, Q] = P(0), B = () => e.presentation === "side-drawer", u = () => e.presentation === "bottom-drawer", s = we({
43
+ const [k, Y] = D(null), [L, X] = D(0), [J, Q] = D(0), B = () => e.presentation === "side-drawer", u = () => e.presentation === "bottom-drawer", s = we({
44
44
  open: () => e.open && !!k() && L() > 0,
45
45
  get exitDurationMs() {
46
46
  return u() ? 180 : 160;
@@ -48,8 +48,8 @@ function Fe(e) {
48
48
  }), p = () => s.mounted() && !!k() && L() > 0;
49
49
  K(() => e.onPresenceChange?.(p())), E(() => e.onPresenceChange?.(!1));
50
50
  const ee = (t) => {
51
- Y(t), Se(() => {
52
- V(k) === t && X((l) => l + 1);
51
+ Y(t), Pe(() => {
52
+ V(k) === t && X((d) => d + 1);
53
53
  });
54
54
  }, O = U(() => p() ? ue({
55
55
  owner: k()
@@ -58,42 +58,42 @@ function Fe(e) {
58
58
  boundaryHost: null,
59
59
  mountHost: null,
60
60
  mode: "global"
61
- }), $ = () => `dialog-boundary-${c}`, n = () => x.mode() === "auto" && z(O()), te = () => n() ? be(O()) : void 0, N = () => e.globalZIndex ?? x.globalZIndex(), F = (t) => me($e(t, void 0, V(d)?.safeArea) ?? he(t), t), re = () => F(O()), R = U(() => (J(), d(), re())), oe = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${_}="${$()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${_}="${$()}"]`) : !1;
61
+ }), $ = () => `dialog-boundary-${c}`, a = () => x.mode() === "auto" && z(O()), te = () => a() ? be(O()) : void 0, N = () => e.globalZIndex ?? x.globalZIndex(), F = (t) => me($e(t, void 0, V(n)?.safeArea) ?? he(t), t), re = () => F(O()), R = U(() => (J(), n(), re())), oe = (t) => typeof Element < "u" && t instanceof Element ? !!t.closest(`[${_}="${$()}"]`) : typeof Node < "u" && t instanceof Node ? !!t.parentElement?.closest(`[${_}="${$()}"]`) : !1;
62
62
  return K(() => {
63
63
  const t = O();
64
- if (!p() || !n() || typeof window > "u")
64
+ if (!p() || !a() || typeof window > "u")
65
65
  return;
66
- let l = !1, h = null, a = Z(F(t));
66
+ let d = !1, h = null, i = Z(F(t));
67
67
  const b = () => {
68
- if (l || !z(t))
68
+ if (d || !z(t))
69
69
  return;
70
70
  const r = Z(F(t));
71
- r !== a && (a = r, Q((v) => v + 1));
71
+ r !== i && (i = r, Q((v) => v + 1));
72
72
  }, A = () => {
73
- l || (h = Te(() => {
73
+ d || (h = Te(() => {
74
74
  b(), A();
75
75
  }));
76
76
  };
77
77
  A(), E(() => {
78
- l = !0, h !== null && Be(h);
78
+ d = !0, h !== null && Be(h);
79
79
  });
80
80
  }), ce({
81
81
  open: p,
82
82
  root: () => T,
83
83
  containsTarget: oe,
84
84
  onClose: () => e.onOpenChange(!1),
85
- lockBodyScroll: () => !n(),
85
+ lockBodyScroll: () => !a(),
86
86
  trapFocus: !0,
87
- closeOnEscape: () => n() ? "inside" : !0,
87
+ closeOnEscape: () => a() ? "inside" : !0,
88
88
  escapeKeyPhase: () => e.escapeKeyPhase ?? "capture",
89
89
  blockHotkeys: !0,
90
90
  // Block scroll bleed outside the dialog while keeping the dialog content scrollable.
91
- blockWheel: () => n() ? "none" : "outside",
92
- blockTouchMove: () => n() ? "none" : "outside",
91
+ blockWheel: () => a() ? "none" : "outside",
92
+ blockTouchMove: () => a() ? "none" : "outside",
93
93
  restoreFocus: !0
94
94
  }), [(() => {
95
95
  var t = Ae();
96
- return G(ee, t), f(t, "data-floe-dialog-owner-anchor", c), ne(t, Pe), t;
96
+ return G(ee, t), f(t, "data-floe-dialog-owner-anchor", c), ne(t, De), t;
97
97
  })(), o(g, {
98
98
  get when() {
99
99
  return p();
@@ -104,10 +104,10 @@ function Fe(e) {
104
104
  return te();
105
105
  },
106
106
  get children() {
107
- var t = Re(), l = t.firstChild, h = l.nextSibling, a = h.firstChild, b = a.firstChild;
107
+ var t = Re(), d = t.firstChild, h = d.nextSibling, i = h.firstChild, b = i.firstChild;
108
108
  f(t, "data-floe-dialog-overlay-root", c), I(t, M({
109
109
  get "data-floe-dialog-mode"() {
110
- return n() ? "surface" : "global";
110
+ return a() ? "surface" : "global";
111
111
  },
112
112
  get "data-floe-dialog-presentation"() {
113
113
  return e.presentation ?? "dialog";
@@ -125,22 +125,22 @@ function Fe(e) {
125
125
  [_]: $()
126
126
  }), {
127
127
  get class() {
128
- return y(n() ? "absolute z-20 box-border p-3" : y("fixed box-border p-4", N() === void 0 && "z-50"), u() && "floe-bottom-drawer-overlay", B() && "floe-side-drawer-overlay", s.exiting() && !u() && "pointer-events-none");
128
+ return y(a() ? "absolute z-20 box-border p-3" : y("fixed box-border p-4", N() === void 0 && "z-50"), u() && "floe-bottom-drawer-overlay", B() && "floe-side-drawer-overlay", s.exiting() && !u() && "pointer-events-none");
129
129
  },
130
130
  get style() {
131
- return C(() => !!n())() ? {
131
+ return C(() => !!a())() ? {
132
132
  left: `${R().left}px`,
133
133
  top: `${R().top}px`,
134
134
  width: `${R().width}px`,
135
135
  height: `${R().height}px`
136
136
  } : {
137
- ...d() ? pe(d()) : {
137
+ ...n() ? pe(n()) : {
138
138
  inset: "0"
139
139
  },
140
- "--floe-dialog-safe-top": `${d()?.safeArea.top ?? 0}px`,
141
- "--floe-dialog-safe-right": `${d()?.safeArea.right ?? 0}px`,
142
- "--floe-dialog-safe-bottom": `${d()?.safeArea.bottom ?? 0}px`,
143
- "--floe-dialog-safe-left": `${d()?.safeArea.left ?? 0}px`,
140
+ "--floe-dialog-safe-top": `${(n()?.safeArea.top ?? 0) / (n()?.fixedScale ?? 1)}px`,
141
+ "--floe-dialog-safe-right": `${(n()?.safeArea.right ?? 0) / (n()?.fixedScale ?? 1)}px`,
142
+ "--floe-dialog-safe-bottom": `${(n()?.safeArea.bottom ?? 0) / (n()?.fixedScale ?? 1)}px`,
143
+ "--floe-dialog-safe-left": `${(n()?.safeArea.left ?? 0) / (n()?.fixedScale ?? 1)}px`,
144
144
  "padding-top": "max(var(--floe-dialog-gap-y, 1rem), var(--floe-dialog-safe-top))",
145
145
  "padding-right": "max(var(--floe-dialog-gap-x, 1rem), var(--floe-dialog-safe-right))",
146
146
  "padding-bottom": "max(var(--floe-dialog-gap-y, 1rem), var(--floe-dialog-safe-bottom))",
@@ -148,26 +148,26 @@ function Fe(e) {
148
148
  "z-index": N()
149
149
  };
150
150
  }
151
- }), !1, !0), f(l, "data-floe-dialog-backdrop", c), I(l, M(() => ({
151
+ }), !1, !0), f(d, "data-floe-dialog-backdrop", c), I(d, M(() => ({
152
152
  [_]: $()
153
153
  }), {
154
154
  get "data-floating-presence"() {
155
155
  return s.state();
156
156
  },
157
157
  get class() {
158
- return y("absolute inset-0 floe-floating-presence floe-floating-backdrop", e.closeOnBackdropClick === !1 ? "cursor-default" : "cursor-pointer", u() ? "floe-bottom-drawer-backdrop" : n() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
158
+ return y("absolute inset-0 floe-floating-presence floe-floating-backdrop", e.closeOnBackdropClick === !1 ? "cursor-default" : "cursor-pointer", u() ? "floe-bottom-drawer-backdrop" : a() ? "bg-background/72 backdrop-blur-[2px]" : "bg-background/80 backdrop-blur-sm");
159
159
  },
160
160
  onClick: () => {
161
161
  !s.exiting() && e.closeOnBackdropClick !== !1 && e.onOpenChange(!1);
162
162
  }
163
163
  }), !1, !1);
164
164
  var A = T;
165
- return typeof A == "function" ? G(A, a) : T = a, f(a, "data-floe-dialog-panel", c), I(a, M(() => ({
165
+ return typeof A == "function" ? G(A, i) : T = i, f(i, "data-floe-dialog-panel", c), I(i, M(() => ({
166
166
  [_]: $(),
167
167
  [ge]: "true"
168
168
  }), {
169
169
  get class() {
170
- return y(n() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "floe-floating-presence", u() ? "floe-bottom-drawer-panel" : B() ? "floe-side-drawer-panel" : "floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
170
+ return y(a() ? "flex max-h-[calc(100%-1rem)] w-[min(32rem,calc(100%-1rem))] max-w-[calc(100%-1rem)] flex-col" : "w-full max-w-md", "bg-card text-card-foreground rounded-md shadow-lg", "border border-border", "floe-floating-presence", u() ? "floe-bottom-drawer-panel" : B() ? "floe-side-drawer-panel" : "floe-floating-dialog-panel", "pointer-events-auto flex flex-col", e.class);
171
171
  },
172
172
  style: {
173
173
  "max-height": "100%",
@@ -182,17 +182,17 @@ function Fe(e) {
182
182
  },
183
183
  role: "dialog",
184
184
  get "aria-modal"() {
185
- return n() ? void 0 : "true";
185
+ return a() ? void 0 : "true";
186
186
  },
187
187
  get "aria-labelledby"() {
188
- return C(() => !!e.title)() ? S() : void 0;
188
+ return C(() => !!e.title)() ? P() : void 0;
189
189
  },
190
190
  get "aria-describedby"() {
191
191
  return C(() => !!e.bodyDescription)() ? H() : void 0;
192
192
  },
193
193
  onKeyDown: (r) => e.onKeyDown?.(r),
194
194
  tabIndex: -1
195
- }), !1, !0), i(a, o(g, {
195
+ }), !1, !0), l(i, o(g, {
196
196
  get when() {
197
197
  return e.header === void 0;
198
198
  },
@@ -202,8 +202,8 @@ function Fe(e) {
202
202
  return e.title;
203
203
  },
204
204
  get children() {
205
- var r = De();
206
- return i(r, () => e.title), D(() => f(r, "id", S())), r;
205
+ var r = Se();
206
+ return l(r, () => e.title), S(() => f(r, "id", P())), r;
207
207
  }
208
208
  }), C(() => e.header)];
209
209
  },
@@ -214,15 +214,15 @@ function Fe(e) {
214
214
  },
215
215
  get children() {
216
216
  var r = _e(), v = r.firstChild;
217
- return i(v, o(g, {
217
+ return l(v, o(g, {
218
218
  get when() {
219
219
  return e.title;
220
220
  },
221
221
  get children() {
222
222
  var w = Ce();
223
- return i(w, () => e.title), D(() => f(w, "id", S())), w;
223
+ return l(w, () => e.title), S(() => f(w, "id", P())), w;
224
224
  }
225
- })), i(r, o(j, {
225
+ })), l(r, o(j, {
226
226
  variant: "ghost-destructive",
227
227
  size: "icon",
228
228
  class: "-my-2 -mr-2 h-[46px] w-[46px] shrink-0 sm:my-0 sm:-mr-1 sm:h-6 sm:w-6",
@@ -239,23 +239,23 @@ function Fe(e) {
239
239
  }
240
240
  });
241
241
  }
242
- }), b), i(b, o(g, {
242
+ }), b), l(b, o(g, {
243
243
  get when() {
244
244
  return e.bodyDescription;
245
245
  },
246
246
  get children() {
247
247
  var r = ke();
248
- return i(r, () => e.bodyDescription), D(() => f(r, "id", H())), r;
248
+ return l(r, () => e.bodyDescription), S(() => f(r, "id", H())), r;
249
249
  }
250
- }), null), i(b, () => e.children, null), i(a, o(g, {
250
+ }), null), l(b, () => e.children, null), l(i, o(g, {
251
251
  get when() {
252
252
  return e.footer;
253
253
  },
254
254
  get children() {
255
255
  var r = Oe();
256
- return i(r, () => e.footer), r;
256
+ return l(r, () => e.footer), r;
257
257
  }
258
- }), null), D((r) => {
258
+ }), null), S((r) => {
259
259
  var v = y("pointer-events-none relative z-[1] flex h-full w-full", B() ? "items-stretch justify-end" : u() ? "items-end justify-center" : "items-center justify-center"), w = y("min-h-0 flex-1 overflow-auto overscroll-contain p-3", e.contentClass);
260
260
  return v !== r.e && q(h, r.e = v), w !== r.t && q(b, r.t = w), r;
261
261
  }, {
@@ -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
  };
@@ -22,11 +22,13 @@ export interface ViewportSnapshot {
22
22
  };
23
23
  safeArea: ViewportInsets;
24
24
  keyboardOpen: boolean;
25
- /** Add to client coordinates when positioning a document-level fixed element. */
25
+ /** Add to client coordinates before dividing by fixedScale for document-level fixed CSS. */
26
26
  fixedOffset: {
27
27
  left: number;
28
28
  top: number;
29
29
  };
30
+ /** Effective CSS zoom inherited by a document-body portal. Client bounds stay unscaled. */
31
+ fixedScale: number;
30
32
  }
31
33
  export interface ViewportSource {
32
34
  width: number;
@@ -35,6 +37,7 @@ export interface ViewportSource {
35
37
  left: number;
36
38
  top: number;
37
39
  };
40
+ fixedScale?: number;
38
41
  visualViewport?: {
39
42
  width: number;
40
43
  height: number;
package/dist/viewport.js CHANGED
@@ -1,90 +1,95 @@
1
- const u = (t, e) => Number.isFinite(t) && Number(t) > 0 ? Number(t) : Math.max(0, e);
1
+ const p = (t, e) => Number.isFinite(t) && Number(t) > 0 ? Number(t) : Math.max(0, e);
2
2
  function g(t) {
3
- const e = t.visualViewport, n = u(e?.width, t.width), i = u(e?.height, t.height), o = t.fixedOrigin ?? { left: 0, top: 0 }, s = Math.max(0, e?.offsetLeft || 0) + o.left, a = Math.max(0, e?.offsetTop || 0) + o.top, r = t.touch && t.editing && Math.abs((e?.scale ?? 1) - 1) < 0.01 && t.height - i > 100;
3
+ const e = t.visualViewport, o = p(e?.width, t.width), s = p(e?.height, t.height), n = t.fixedOrigin ?? { left: 0, top: 0 }, r = Math.max(0, e?.offsetLeft || 0) + n.left, a = Math.max(0, e?.offsetTop || 0) + n.top, i = t.touch && t.editing && Math.abs((e?.scale ?? 1) - 1) < 0.01 && t.height - s > 100;
4
4
  return {
5
- visible: { left: s, top: a, width: n, height: i, right: s + n, bottom: a + i },
5
+ visible: { left: r, top: a, width: o, height: s, right: r + o, bottom: a + s },
6
6
  layout: { width: t.width, height: t.height },
7
- safeArea: { ...t.safeArea, bottom: r ? 0 : t.safeArea.bottom },
8
- keyboardOpen: r,
9
- fixedOffset: { left: -o.left, top: -o.top }
7
+ safeArea: { ...t.safeArea, bottom: i ? 0 : t.safeArea.bottom },
8
+ keyboardOpen: i,
9
+ fixedOffset: { left: -n.left, top: -n.top },
10
+ fixedScale: p(t.fixedScale, 1)
10
11
  };
11
12
  }
12
- function b(t) {
13
+ function x(t) {
13
14
  let e = t.activeElement;
14
15
  for (; e?.shadowRoot?.activeElement; ) e = e.shadowRoot.activeElement;
15
16
  return !e || e.matches('[disabled], [readonly], [inputmode="none"]') ? !1 : e.matches('textarea, input:not([type]), input[type="text"], input[type="search"], input[type="email"], input[type="url"], input[type="tel"], input[type="password"], input[type="number"], [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]');
16
17
  }
17
- function m(t) {
18
+ function b(t) {
18
19
  const e = t.document.createElement("div");
19
20
  return e.setAttribute("aria-hidden", "true"), e.style.cssText = "position:fixed;top:0;left:0;width:100%;height:100dvh;visibility:hidden;pointer-events:none;box-sizing:border-box;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)", t.document.documentElement.append(e), e;
20
21
  }
21
- function l(t, e) {
22
- const n = e.getBoundingClientRect(), i = t.getComputedStyle(e), o = (s) => Math.max(0, Number.parseFloat(s) || 0);
22
+ function u(t, e) {
23
+ const o = e.getBoundingClientRect(), s = t.getComputedStyle(e), n = (i) => Math.max(0, Number.parseFloat(i) || 0), r = (i) => i ? p(Number.parseFloat(t.getComputedStyle(i).zoom), 1) : 1, a = r(t.document.documentElement);
23
24
  return g({
24
- width: n.width || t.innerWidth,
25
- height: n.height || t.innerHeight,
25
+ width: o.width || t.innerWidth,
26
+ height: o.height / a || t.innerHeight,
26
27
  visualViewport: t.visualViewport,
27
- fixedOrigin: { left: n.left, top: n.top },
28
- safeArea: { top: o(i.paddingTop), right: o(i.paddingRight), bottom: o(i.paddingBottom), left: o(i.paddingLeft) },
29
- editing: b(t.document),
28
+ fixedOrigin: { left: o.left, top: o.top },
29
+ fixedScale: a * r(t.document.body),
30
+ safeArea: { top: n(s.paddingTop), right: n(s.paddingRight), bottom: n(s.paddingBottom), left: n(s.paddingLeft) },
31
+ editing: x(t.document),
30
32
  touch: t.matchMedia?.("(any-pointer: coarse)").matches ?? !1
31
33
  });
32
34
  }
33
- const d = /* @__PURE__ */ new WeakMap();
34
- function x(t) {
35
- const e = d.get(t);
35
+ const c = /* @__PURE__ */ new WeakMap();
36
+ function y(t) {
37
+ const e = c.get(t);
36
38
  if (e) return e.snapshot;
37
- const n = m(t);
39
+ const o = b(t);
38
40
  try {
39
- return l(t, n);
41
+ return u(t, o);
40
42
  } finally {
41
- n.remove();
43
+ o.remove();
42
44
  }
43
45
  }
44
- function y(t, e) {
45
- let n = d.get(t);
46
- if (!n) {
47
- const o = m(t);
48
- let s = 0;
49
- const a = /* @__PURE__ */ new Set(), r = { snapshot: l(t, o), listeners: a, dispose: () => {
50
- } }, c = () => {
51
- s || (s = t.requestAnimationFrame(() => {
52
- s = 0, r.snapshot = l(t, o);
53
- for (const p of a) p(r.snapshot);
46
+ function S(t, e) {
47
+ let o = c.get(t);
48
+ if (!o) {
49
+ const n = b(t);
50
+ let r = 0;
51
+ const a = /* @__PURE__ */ new Set(), i = { snapshot: u(t, n), listeners: a, dispose: () => {
52
+ } }, f = () => {
53
+ r || (r = t.requestAnimationFrame(() => {
54
+ r = 0, i.snapshot = u(t, n);
55
+ for (const d of a) d(i.snapshot);
54
56
  }));
55
- }, f = [
57
+ }, l = [
56
58
  [t, "resize"],
57
59
  [t, "scroll"],
58
60
  [t, "orientationchange"],
59
61
  [t.document, "focusin"],
60
62
  [t.document, "focusout"]
61
63
  ];
62
- t.visualViewport && f.push([t.visualViewport, "resize"], [t.visualViewport, "scroll"]);
63
- for (const [p, h] of f) p.addEventListener(h, c);
64
- r.dispose = () => {
65
- for (const [p, h] of f) p.removeEventListener(h, c);
66
- s && t.cancelAnimationFrame(s), o.remove(), d.delete(t);
67
- }, d.set(t, r), n = r;
64
+ t.visualViewport && l.push([t.visualViewport, "resize"], [t.visualViewport, "scroll"]);
65
+ for (const [d, h] of l) d.addEventListener(h, f);
66
+ const m = new MutationObserver(f);
67
+ for (const d of [t.document.documentElement, t.document.body])
68
+ d && m.observe(d, { attributes: !0, attributeFilter: ["class", "style"] });
69
+ i.dispose = () => {
70
+ for (const [d, h] of l) d.removeEventListener(h, f);
71
+ m.disconnect(), r && t.cancelAnimationFrame(r), n.remove(), c.delete(t);
72
+ }, c.set(t, i), o = i;
68
73
  }
69
- n.listeners.add(e), e(n.snapshot);
70
- const i = n;
74
+ o.listeners.add(e), e(o.snapshot);
75
+ const s = o;
71
76
  return () => {
72
- i.listeners.delete(e), i.listeners.size === 0 && i.dispose();
77
+ s.listeners.delete(e), s.listeners.size === 0 && s.dispose();
73
78
  };
74
79
  }
75
- function V(t) {
76
- const { visible: e } = t;
80
+ function E(t) {
81
+ const { visible: e, fixedScale: o } = t;
77
82
  return {
78
83
  position: "fixed",
79
- left: `${e.left + t.fixedOffset.left}px`,
80
- top: `${e.top + t.fixedOffset.top}px`,
81
- width: `${e.width}px`,
82
- height: `${e.height}px`
84
+ left: `${(e.left + t.fixedOffset.left) / o}px`,
85
+ top: `${(e.top + t.fixedOffset.top) / o}px`,
86
+ width: `${e.width / o}px`,
87
+ height: `${e.height / o}px`
83
88
  };
84
89
  }
85
90
  export {
86
- y as observeViewport,
87
- x as readViewportSnapshot,
91
+ S as observeViewport,
92
+ y as readViewportSnapshot,
88
93
  g as resolveViewportSnapshot,
89
- V as viewportStyle
94
+ E as viewportStyle
90
95
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.74.0",
3
+ "version": "0.74.2",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",