@floegence/floe-webapp-core 0.52.10 → 0.52.12

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.
@@ -15,6 +15,10 @@ export interface SurfaceFloatingPanelProps extends Omit<SurfaceFloatingLayerProp
15
15
  snapThreshold?: number;
16
16
  /** Client/CSS viewport pixel gap between the panel and its safe boundary. Defaults to 8px. */
17
17
  snapInset?: number;
18
+ /** Show a quiet marker at the predicted landing edge during dragging. */
19
+ snapPreview?: boolean;
20
+ /** Gentle motion varies from 210–360ms with travel distance. Default: standard (180ms). */
21
+ snapMotion?: 'standard' | 'gentle';
18
22
  /** Called with client/CSS viewport coordinates after a committed position change. */
19
23
  onPositionChange?: (position: SurfaceFloatingPanelPosition) => void;
20
24
  }
@@ -1,18 +1,21 @@
1
- import { memo as X, createComponent as K, mergeProps as L, template as j, use as q } from "solid-js/web";
2
- import { splitProps as N, createSignal as b, createMemo as Y, onMount as O, onCleanup as U } from "solid-js";
3
- import { SurfaceFloatingLayer as V } from "./SurfaceFloatingLayer.js";
4
- import { readSurfaceSafeArea as z, resolveFloatingBoundary as J } from "./surfaceFloatingBoundary.js";
5
- import { startPointerSession as Q } from "./pointerSession.js";
6
- import { resolveSurfaceFloatingPanelBounds as Z, resolveSurfaceFloatingPanelPosition as ee, resolveSurfaceFloatingPanelInset as te, insetSurfaceFloatingPanelGeometry as ne, resolveSurfaceFloatingPanelSnap as oe, resolveSurfaceFloatingPanelSnapThreshold as re } from "./surfaceFloatingPanelGeometry.js";
7
- import { resolveSurfacePortalHost as ae, resolveSurfacePortalScale as ie } from "./dialogSurfaceScope.js";
8
- var se = /* @__PURE__ */ j("<span hidden>");
9
- function he($) {
10
- const [a, E] = N($, ["children", "owner", "boundary", "style", "snapToEdge", "boundaryInsets", "snapThreshold", "snapInset", "onPositionChange"]);
11
- let P, r, f, h = !1, p, c = null;
12
- const B = z(), [G, R] = b(!1), [A, F] = b({
1
+ import { createComponent as D, memo as H, mergeProps as Z, template as ee, use as te } from "solid-js/web";
2
+ import { splitProps as ne, createSignal as f, createMemo as b, onMount as oe, onCleanup as G, Show as re } from "solid-js";
3
+ import { SurfaceFloatingLayer as R } from "./SurfaceFloatingLayer.js";
4
+ import { readSurfaceSafeArea as ae, resolveFloatingBoundary as ie } from "./surfaceFloatingBoundary.js";
5
+ import { startPointerSession as se } from "./pointerSession.js";
6
+ import { resolveSurfaceFloatingPanelBounds as le, resolveSurfaceFloatingPanelPosition as ce, resolveSurfaceFloatingPanelSnap as de, resolveSurfaceFloatingPanelSnapThreshold as pe, resolveSurfaceFloatingPanelInset as ue, insetSurfaceFloatingPanelGeometry as he } from "./surfaceFloatingPanelGeometry.js";
7
+ import { resolveSurfacePortalHost as ge, resolveSurfacePortalScale as fe } from "./dialogSurfaceScope.js";
8
+ var me = /* @__PURE__ */ ee("<span hidden>");
9
+ function Se(_) {
10
+ const [a, k] = ne(_, ["children", "owner", "boundary", "style", "snapToEdge", "boundaryInsets", "snapThreshold", "snapInset", "snapPreview", "snapMotion", "onPositionChange"]);
11
+ let S, u, h, m = !1, p;
12
+ const q = ae(), [F, X] = f(!1), [z, C] = f(!1), [K, Y] = f({
13
+ x: 0,
14
+ y: 0
15
+ }), [O, j] = f(!1), [T, $] = f({
13
16
  x: 1,
14
17
  y: 1
15
- }), [u, W] = b({
18
+ }), [i, N] = f({
16
19
  left: 0,
17
20
  top: 0,
18
21
  width: 0,
@@ -21,83 +24,120 @@ function he($) {
21
24
  panelHeight: 0,
22
25
  scaleX: 1,
23
26
  scaleY: 1
24
- }), x = () => a.owner ?? P, v = () => te(a.snapInset), S = Y(() => Z(u(), v())), k = () => x()?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? 0 : 180, T = () => {
25
- if (!r) return;
26
- const e = ae({
27
- owner: x()
28
- }), t = J(e, a.boundary, B), n = ie(e), i = r.getBoundingClientRect(), o = {
29
- ...ne({
27
+ }), P = () => a.owner ?? S, E = () => ue(a.snapInset), A = b(() => le(i(), E())), U = (e) => P()?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? 0 : a.snapMotion === "gentle" ? Math.round(Math.min(360, Math.max(210, 180 + Math.sqrt(e) * 12))) : 180, I = () => {
28
+ if (!u) return;
29
+ const e = ge({
30
+ owner: P()
31
+ }), t = ie(e, a.boundary, q), n = fe(e), r = u.getBoundingClientRect(), o = {
32
+ ...he({
30
33
  left: t?.left ?? 0,
31
34
  top: t?.top ?? 0,
32
35
  width: t?.width ?? 0,
33
36
  height: t?.height ?? 0,
34
- panelWidth: i.width,
35
- panelHeight: i.height
37
+ panelWidth: r.width,
38
+ panelHeight: r.height
36
39
  }, a.boundaryInsets),
37
40
  scaleX: n.x,
38
41
  scaleY: n.y
39
42
  };
40
- W((m) => Object.keys(o).every((s) => o[s] === m[s]) ? m : o);
41
- }, l = Y(() => ee(S(), A())), y = (e, t) => {
42
- const n = S(), i = (g, o) => o.room > 0 ? Math.max(0, Math.min(1, g / o.room)) : 0;
43
- F({
44
- x: i(e - n.x.min, n.x),
45
- y: i(t - n.y.min, n.y)
43
+ p && (o.width !== i().width || o.height !== i().height || o.scaleX !== i().scaleX || o.scaleY !== i().scaleY) && w(), N((d) => Object.keys(o).every((x) => o[x] === d[x]) ? d : o);
44
+ }, c = b(() => ce(A(), T())), M = (e, t) => {
45
+ const n = A(), r = (s, o) => o.room > 0 ? Math.max(0, Math.min(1, s / o.room)) : 0;
46
+ $({
47
+ x: r(e - n.x.min, n.x),
48
+ y: r(t - n.y.min, n.y)
46
49
  });
47
- }, d = (e = l()) => {
50
+ }, y = (e = c()) => {
48
51
  a.onPositionChange?.(e);
49
- }, M = () => {
50
- p !== void 0 && (clearTimeout(p), p = void 0), r && c !== null && (r.style.transition = c, c = null);
51
- }, C = () => {
52
- const e = p !== void 0 ? r?.getBoundingClientRect() : void 0;
53
- M(), T(), e && y(e.left, e.top);
54
- }, H = () => {
55
- const e = oe(l(), S(), re(a.snapThreshold));
52
+ }, w = () => {
53
+ const e = p;
54
+ p = void 0, e?.cancel(), C(!1);
55
+ }, L = () => {
56
+ const e = p !== void 0 ? u?.getBoundingClientRect() : void 0;
57
+ w(), I(), e && M(e.left, e.top);
58
+ }, W = b(() => de(c(), A(), pe(a.snapThreshold), K())), V = b(() => {
59
+ const e = W();
60
+ if (!a.snapPreview || !a.snapToEdge || !F() || !e) return null;
61
+ const t = i(), n = e.edge === "left" || e.edge === "right";
62
+ return {
63
+ edge: e.edge,
64
+ x: e.position.x + (n ? e.edge === "left" ? -7 : t.panelWidth + 5 : (t.panelWidth - 28) / 2),
65
+ y: e.position.y + (n ? (t.panelHeight - 28) / 2 : e.edge === "top" ? -7 : t.panelHeight + 5),
66
+ width: (n ? 2 : 28) / t.scaleX,
67
+ height: (n ? 28 : 2) / t.scaleY
68
+ };
69
+ }), J = () => {
70
+ const e = W();
56
71
  if (!e) {
57
- d(l());
72
+ y(c());
58
73
  return;
59
74
  }
60
- const t = l();
75
+ const t = c();
61
76
  if (t.x === e.position.x && t.y === e.position.y) {
62
- d(t);
77
+ y(t);
63
78
  return;
64
79
  }
65
- M();
66
- const n = k();
67
- r && (c = r.style.transition, r.style.transition = n ? `left ${n}ms ease-out, top ${n}ms ease-out` : "none"), y(e.position.x, e.position.y), d(e.position), p = setTimeout(() => {
68
- r && c !== null && (r.style.transition = c), c = null, p = void 0;
69
- }, n);
70
- }, _ = {
80
+ w();
81
+ const n = U(Math.hypot(t.x - e.position.x, t.y - e.position.y)), r = a.snapMotion === "gentle" ? "cubic-bezier(.22,.7,.18,1)" : "ease-out";
82
+ if (M(e.position.x, e.position.y), y(e.position), !n || !u?.animate) return;
83
+ const s = i(), o = u.animate([{
84
+ translate: `${(t.x - e.position.x) / s.scaleX}px ${(t.y - e.position.y) / s.scaleY}px`
85
+ }, {
86
+ translate: "0px 0px"
87
+ }], {
88
+ duration: n,
89
+ easing: r
90
+ });
91
+ p = o, C(!0), o.finished.then(() => {
92
+ p === o && (p = void 0, C(!1));
93
+ }).catch(() => {
94
+ });
95
+ }, Q = {
71
96
  style: {
72
97
  "touch-action": "none",
73
98
  "user-select": "none"
74
99
  },
75
100
  onPointerDown: (e) => {
76
- if (e.button !== 0 || f) return;
77
- e.stopPropagation(), C();
78
- const t = A(), n = l(), i = e.clientX, g = e.clientY;
79
- h = !1;
80
- let o = !1;
81
- const m = (s, w) => {
82
- const D = s - i, I = w - g;
83
- o ||= Math.hypot(D, I) >= 4, o && y(n.x + D, n.y + I);
101
+ if (e.button !== 0 || h) return;
102
+ e.stopPropagation(), L();
103
+ const t = T(), n = c(), r = e.clientX, s = e.clientY;
104
+ m = !1, Y({
105
+ x: 0,
106
+ y: 0
107
+ });
108
+ let o = {
109
+ x: r,
110
+ y: s
111
+ }, d = !1;
112
+ const x = (l, g) => {
113
+ const v = l - r, B = g - s;
114
+ d ||= Math.hypot(v, B) >= 4, d && (m = !0, X(!0), (l !== o.x || g !== o.y) && Y({
115
+ x: l - o.x,
116
+ y: g - o.y
117
+ }), o = {
118
+ x: l,
119
+ y: g
120
+ }, M(n.x + v, n.y + B));
84
121
  };
85
- f = Q({
122
+ h = se({
86
123
  pointerEvent: e,
87
124
  captureEl: e.currentTarget,
88
- onMove: (s) => {
89
- s.preventDefault(), m(s.clientX, s.clientY);
125
+ continueOnCaptureLoss: !0,
126
+ interruptionPosition: "last-held",
127
+ onMove: (l) => {
128
+ l.preventDefault(), x(l.clientX, l.clientY);
90
129
  },
91
130
  onEnd: ({
92
- commit: s,
93
- snapshot: w
131
+ commit: l,
132
+ reason: g,
133
+ snapshot: v
94
134
  }) => {
95
- s ? (m(w.latestClientX, w.latestClientY), o && a.snapToEdge ? H() : o && d(l())) : F(t), h = o, f = void 0;
135
+ l || g === "pointer_cancel" ? (x(v.latestClientX, v.latestClientY), d && a.snapToEdge ? J() : d && y(c())) : $(t), m = d, X(!1), h = void 0;
96
136
  }
97
137
  });
98
138
  },
99
139
  "oncapture:click": (e) => {
100
- h && e.detail !== 0 && (e.preventDefault(), e.stopImmediatePropagation()), h = !1;
140
+ m && e.detail !== 0 && (e.preventDefault(), e.stopImmediatePropagation()), m = !1;
101
141
  },
102
142
  onKeyDown: (e) => {
103
143
  const t = {
@@ -107,50 +147,99 @@ function he($) {
107
147
  ArrowDown: [0, 1]
108
148
  }[e.key];
109
149
  if (!t) return;
110
- e.preventDefault(), e.stopPropagation(), C();
111
- const n = l(), i = e.shiftKey ? 40 : 10;
112
- y(n.x + t[0] * i, n.y + t[1] * i), d(l());
150
+ e.preventDefault(), e.stopPropagation(), L();
151
+ const n = c(), r = e.shiftKey ? 40 : 10;
152
+ M(n.x + t[0] * r, n.y + t[1] * r), y(c());
113
153
  }
114
154
  };
115
- return O(() => {
116
- R(!0);
117
- let e = 0;
118
- const t = () => {
119
- T(), e = requestAnimationFrame(t);
155
+ return oe(() => {
156
+ j(!0);
157
+ const e = (o) => {
158
+ o.key !== "Escape" || !h || (o.preventDefault(), o.stopImmediatePropagation(), h.stop());
159
+ };
160
+ document.addEventListener("keydown", e, !0);
161
+ const t = window.matchMedia?.("(prefers-reduced-motion: reduce)"), n = () => {
162
+ t?.matches && w();
120
163
  };
121
- t(), U(() => {
122
- cancelAnimationFrame(e), M(), f?.stop();
164
+ t?.addEventListener?.("change", n), G(() => {
165
+ document.removeEventListener("keydown", e, !0), t?.removeEventListener?.("change", n);
166
+ });
167
+ let r = 0;
168
+ const s = () => {
169
+ I(), r = requestAnimationFrame(s);
170
+ };
171
+ s(), G(() => {
172
+ cancelAnimationFrame(r), w(), h?.stop();
123
173
  });
124
174
  }), [(() => {
125
- var e = se(), t = P;
126
- return typeof t == "function" ? q(t, e) : P = e, e;
127
- })(), X(() => X(() => !!G())() && K(V, L(E, {
175
+ var e = me(), t = S;
176
+ return typeof t == "function" ? te(t, e) : S = e, e;
177
+ })(), D(re, {
178
+ get when() {
179
+ return V();
180
+ },
181
+ children: (e) => D(R, {
182
+ get owner() {
183
+ return P();
184
+ },
185
+ get boundary() {
186
+ return a.boundary;
187
+ },
188
+ get position() {
189
+ return e();
190
+ },
191
+ clamp: !1,
192
+ "aria-hidden": "true",
193
+ get "data-floe-panel-snap-preview"() {
194
+ return e().edge;
195
+ },
196
+ get style() {
197
+ return {
198
+ width: `${e().width}px`,
199
+ height: `${e().height}px`,
200
+ "border-radius": "2px",
201
+ "pointer-events": "none",
202
+ border: "1px solid currentColor",
203
+ "box-sizing": "border-box",
204
+ color: "var(--muted-foreground, CanvasText)",
205
+ opacity: 0.55
206
+ };
207
+ },
208
+ children: null
209
+ })
210
+ }), H(() => H(() => !!O())() && D(R, Z(k, {
211
+ get "data-floe-panel-dragging"() {
212
+ return F() ? "true" : void 0;
213
+ },
214
+ get "data-floe-panel-settling"() {
215
+ return z() ? "true" : void 0;
216
+ },
128
217
  get owner() {
129
- return x();
218
+ return P();
130
219
  },
131
220
  get boundary() {
132
221
  return a.boundary;
133
222
  },
134
223
  get position() {
135
- return l();
224
+ return c();
136
225
  },
137
226
  clamp: !1,
138
227
  layerRef: (e) => {
139
- r = e;
228
+ u = e;
140
229
  },
141
230
  get style() {
142
231
  return {
143
232
  ...a.style,
144
- "max-width": `${Math.max(0, u().width - v() * 2) / Math.max(0.01, u().scaleX)}px`,
145
- "max-height": `${Math.max(0, u().height - v() * 2) / Math.max(0.01, u().scaleY)}px`,
146
- visibility: u().width <= 16 || u().height <= 16 ? "hidden" : void 0
233
+ "max-width": `${Math.max(0, i().width - E() * 2) / Math.max(0.01, i().scaleX)}px`,
234
+ "max-height": `${Math.max(0, i().height - E() * 2) / Math.max(0.01, i().scaleY)}px`,
235
+ visibility: i().width <= 16 || i().height <= 16 ? "hidden" : void 0
147
236
  };
148
237
  },
149
238
  get children() {
150
- return a.children(_);
239
+ return a.children(Q);
151
240
  }
152
241
  })))];
153
242
  }
154
243
  export {
155
- he as SurfaceFloatingPanel
244
+ Se as SurfaceFloatingPanel
156
245
  };
@@ -42,8 +42,8 @@ function N(o) {
42
42
  get children() {
43
43
  var l = k(), f = l.firstChild;
44
44
  return i(l, () => o.content, f), $((r) => {
45
- var u = g("absolute z-50 px-2 py-1", "bg-popover text-popover-foreground text-xs rounded shadow-md", "whitespace-nowrap", "floe-floating-presence floe-floating-tooltip", y[o.placement ?? "top"], o.class), c = n.state(), p = n.exiting() ? "true" : void 0, m = g("absolute w-0 h-0 border-4", w[o.placement ?? "top"]);
46
- return u !== r.e && v(l, r.e = u), c !== r.t && b(l, "data-floating-presence", r.t = c), p !== r.a && b(l, "aria-hidden", r.a = p), m !== r.o && v(f, r.o = m), r;
45
+ var u = g("absolute z-50 px-2 py-1", "bg-popover text-popover-foreground text-[11px] rounded-md shadow-md", "whitespace-nowrap", "floe-floating-presence floe-floating-tooltip", y[o.placement ?? "top"], o.class), p = n.state(), c = n.exiting() ? "true" : void 0, m = g("absolute w-0 h-0 border-4", w[o.placement ?? "top"]);
46
+ return u !== r.e && v(l, r.e = u), p !== r.t && b(l, "data-floating-presence", r.t = p), c !== r.a && b(l, "aria-hidden", r.a = c), m !== r.o && v(f, r.o = m), r;
47
47
  }, {
48
48
  e: void 0,
49
49
  t: void 0,
@@ -1,65 +1,65 @@
1
- const g = "data-floe-dialog-surface-host", b = g, E = "data-floe-surface-portal-layer", P = "data-floe-surface-floating-layer", x = "data-floe-dialog-surface-boundary", T = 1600;
2
- let u = null, r = null;
3
- function w(t) {
1
+ const E = "data-floe-dialog-surface-host", H = E, b = "data-floe-surface-portal-layer", I = "data-floe-surface-floating-layer", B = "data-floe-dialog-surface-boundary", v = 1600;
2
+ let l = null, i = null;
3
+ function A(t) {
4
4
  return typeof Element < "u" && t instanceof Element ? t : typeof Node < "u" && t instanceof Node ? t.parentElement : null;
5
5
  }
6
- function R(t) {
6
+ function L(t) {
7
7
  const e = t?.activeElement;
8
8
  return e instanceof Element ? e : null;
9
9
  }
10
- function c(t) {
10
+ function a(t) {
11
11
  const e = typeof document < "u" ? document : null;
12
- u = {
13
- target: w(t),
14
- activeElement: R(e),
12
+ l = {
13
+ target: A(t),
14
+ activeElement: L(e),
15
15
  recordedAt: Date.now()
16
16
  };
17
17
  }
18
- function a(t) {
19
- c(t.target);
18
+ function p(t) {
19
+ a(t.target);
20
20
  }
21
- function s(t) {
22
- c(t.target);
21
+ function y(t) {
22
+ a(t.target);
23
23
  }
24
- function h(t) {
25
- c(t.target);
24
+ function T(t) {
25
+ a(t.target);
26
26
  }
27
- function p() {
28
- S();
27
+ function R() {
28
+ _();
29
29
  }
30
- function S() {
31
- typeof document > "u" || r !== document && (r && (r.removeEventListener("pointerdown", a, !0), r.removeEventListener("focusin", s, !0), r.removeEventListener("contextmenu", h, !0)), document.addEventListener("pointerdown", a, !0), document.addEventListener("focusin", s, !0), document.addEventListener("contextmenu", h, !0), r = document);
30
+ function _() {
31
+ typeof document > "u" || i !== document && (i && (i.removeEventListener("pointerdown", p, !0), i.removeEventListener("focusin", y, !0), i.removeEventListener("contextmenu", T, !0)), document.addEventListener("pointerdown", p, !0), document.addEventListener("focusin", y, !0), document.addEventListener("contextmenu", T, !0), i = document);
32
32
  }
33
- function A() {
34
- return !u || Date.now() - u.recordedAt > T ? null : u;
33
+ function x() {
34
+ return !l || Date.now() - l.recordedAt > v ? null : l;
35
35
  }
36
- function l(t) {
37
- const e = t?.closest(`[${g}="true"]`);
36
+ function f(t) {
37
+ const e = t?.closest(`[${E}="true"]`);
38
38
  return typeof HTMLElement > "u" ? null : e instanceof HTMLElement ? e : null;
39
39
  }
40
- function v(t) {
40
+ function C(t) {
41
41
  if (!t) return null;
42
- const e = t.closest(`[${E}="true"]`);
42
+ const e = t.closest(`[${b}="true"]`);
43
43
  return typeof HTMLElement > "u" ? null : e instanceof HTMLElement ? e : null;
44
44
  }
45
- function C(t = {}) {
46
- p();
47
- const e = A(), n = t.owner ? l(t.owner) : l(e?.target ?? null) ?? l(e?.activeElement ?? null);
45
+ function O(t = {}) {
46
+ R();
47
+ const e = x(), n = t.owner ? f(t.owner) : f(e?.target ?? null) ?? f(e?.activeElement ?? null);
48
48
  return n ? {
49
49
  host: n,
50
50
  boundaryHost: n,
51
- mountHost: v(n) ?? n,
51
+ mountHost: C(n) ?? n,
52
52
  mode: "surface"
53
53
  } : { host: null, boundaryHost: null, mountHost: null, mode: "global" };
54
54
  }
55
- function i(t) {
55
+ function c(t) {
56
56
  return t.mode === "surface" && !!t.boundaryHost?.isConnected;
57
57
  }
58
- function f(t) {
59
- if (i(t))
58
+ function s(t) {
59
+ if (c(t))
60
60
  return t.mountHost ?? t.boundaryHost ?? void 0;
61
61
  }
62
- function y() {
62
+ function S() {
63
63
  return typeof window > "u" ? {
64
64
  left: 0,
65
65
  top: 0,
@@ -76,9 +76,9 @@ function y() {
76
76
  height: window.innerHeight
77
77
  };
78
78
  }
79
- function F(t) {
80
- if (!i(t) || !t.boundaryHost)
81
- return y();
79
+ function M(t) {
80
+ if (!c(t) || !t.boundaryHost)
81
+ return S();
82
82
  const e = t.boundaryHost.getBoundingClientRect();
83
83
  return {
84
84
  left: e.left,
@@ -89,10 +89,10 @@ function F(t) {
89
89
  height: e.height
90
90
  };
91
91
  }
92
- function L(t) {
93
- const e = f(t);
92
+ function P(t) {
93
+ const e = s(t);
94
94
  if (!e)
95
- return y();
95
+ return S();
96
96
  const n = e.getBoundingClientRect();
97
97
  return {
98
98
  left: n.left,
@@ -103,28 +103,31 @@ function L(t) {
103
103
  height: n.height
104
104
  };
105
105
  }
106
- function _(t) {
107
- const e = f(t);
106
+ function F(t) {
107
+ const e = s(t);
108
108
  if (!e) return { x: 1, y: 1 };
109
- const n = e.getBoundingClientRect();
109
+ const n = e.getBoundingClientRect(), o = getComputedStyle(e), r = (u) => Number.parseFloat(u) || 0, h = (u) => {
110
+ const d = r(o[u]);
111
+ return d ? o.boxSizing === "border-box" ? d : d + (u === "width" ? r(o.paddingLeft) + r(o.paddingRight) + r(o.borderLeftWidth) + r(o.borderRightWidth) : r(o.paddingTop) + r(o.paddingBottom) + r(o.borderTopWidth) + r(o.borderBottomWidth)) : u === "width" ? e.offsetWidth : e.offsetHeight;
112
+ }, m = h("width"), g = h("height");
110
113
  return {
111
- x: e.offsetWidth > 0 && n.width > 0 ? n.width / e.offsetWidth : 1,
112
- y: e.offsetHeight > 0 && n.height > 0 ? n.height / e.offsetHeight : 1
114
+ x: m > 0 && n.width > 0 ? n.width / m : 1,
115
+ y: g > 0 && n.height > 0 ? n.height / g : 1
113
116
  };
114
117
  }
115
- function m(t, e) {
116
- if (!i(e))
118
+ function w(t, e) {
119
+ if (!c(e))
117
120
  return t;
118
- const n = f(e), o = L(e), d = _(e);
121
+ const n = s(e), o = P(e), r = F(e);
119
122
  return {
120
- x: (t.x - o.left) / d.x - n.clientLeft + n.scrollLeft,
121
- y: (t.y - o.top) / d.y - n.clientTop + n.scrollTop
123
+ x: (t.x - o.left) / r.x - n.clientLeft + n.scrollLeft,
124
+ y: (t.y - o.top) / r.y - n.clientTop + n.scrollTop
122
125
  };
123
126
  }
124
- function H(t, e) {
125
- if (!i(e))
127
+ function D(t, e) {
128
+ if (!c(e))
126
129
  return t;
127
- const n = m({ x: t.left, y: t.top }, e), o = m({ x: t.right, y: t.bottom }, e);
130
+ const n = w({ x: t.left, y: t.top }, e), o = w({ x: t.right, y: t.bottom }, e);
128
131
  return {
129
132
  left: n.x,
130
133
  top: n.y,
@@ -134,26 +137,26 @@ function H(t, e) {
134
137
  height: o.y - n.y
135
138
  };
136
139
  }
137
- function I() {
138
- u = null;
140
+ function N() {
141
+ l = null;
139
142
  }
140
- typeof document < "u" && p();
143
+ typeof document < "u" && R();
141
144
  export {
142
- x as DIALOG_SURFACE_BOUNDARY_ATTR,
143
- g as DIALOG_SURFACE_HOST_ATTR,
144
- P as SURFACE_FLOATING_LAYER_ATTR,
145
- b as SURFACE_PORTAL_HOST_ATTR,
146
- E as SURFACE_PORTAL_LAYER_ATTR,
147
- I as __resetSurfacePortalScopeForTests,
148
- p as ensureDialogSurfaceInteractionTracking,
149
- S as ensureSurfacePortalInteractionTracking,
150
- i as isSurfacePortalMode,
151
- m as projectSurfacePortalPosition,
152
- H as projectSurfacePortalRect,
153
- A as readFreshInteractionSnapshot,
154
- F as resolveSurfacePortalBoundaryRect,
155
- C as resolveSurfacePortalHost,
156
- f as resolveSurfacePortalMount,
157
- L as resolveSurfacePortalMountRect,
158
- _ as resolveSurfacePortalScale
145
+ B as DIALOG_SURFACE_BOUNDARY_ATTR,
146
+ E as DIALOG_SURFACE_HOST_ATTR,
147
+ I as SURFACE_FLOATING_LAYER_ATTR,
148
+ H as SURFACE_PORTAL_HOST_ATTR,
149
+ b as SURFACE_PORTAL_LAYER_ATTR,
150
+ N as __resetSurfacePortalScopeForTests,
151
+ R as ensureDialogSurfaceInteractionTracking,
152
+ _ as ensureSurfacePortalInteractionTracking,
153
+ c as isSurfacePortalMode,
154
+ w as projectSurfacePortalPosition,
155
+ D as projectSurfacePortalRect,
156
+ x as readFreshInteractionSnapshot,
157
+ M as resolveSurfacePortalBoundaryRect,
158
+ O as resolveSurfacePortalHost,
159
+ s as resolveSurfacePortalMount,
160
+ P as resolveSurfacePortalMountRect,
161
+ F as resolveSurfacePortalScale
159
162
  };
@@ -19,6 +19,10 @@ export interface StartPointerSessionOptions {
19
19
  ownerDocument?: Document;
20
20
  buttonMask?: number;
21
21
  capturePointer?: boolean;
22
+ /** Keep document ownership when capture is lost before release. */
23
+ continueOnCaptureLoss?: boolean;
24
+ /** Floating launchers settle at the last held point after an interrupted release. */
25
+ interruptionPosition?: 'event' | 'last-held';
22
26
  onMove?: (event: PointerEvent, snapshot: PointerSessionSnapshot) => void;
23
27
  onEnd: (event: PointerSessionEndEvent) => void;
24
28
  }