@floegence/floe-webapp-core 0.89.1 → 0.90.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
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";
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 x, template as a, delegateEvents as at } from "solid-js/web";
2
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";
@@ -7,16 +7,16 @@ import { useMediaQuery as ft } from "../../hooks/useMediaQuery.js";
7
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 xt } from "./pointerSession.js";
11
- import { resolveFloatingWindowViewport as ge, normalizeFloatingWindowRect as me, resolveFloatingWindowRect as vt } from "./floatingWindowGeometry.js";
10
+ import { startPointerSession as vt } from "./pointerSession.js";
11
+ import { resolveFloatingWindowViewport as ge, normalizeFloatingWindowRect as me, resolveFloatingWindowRect as xt } from "./floatingWindowGeometry.js";
12
12
  import { observeViewport as yt } from "../../viewport.js";
13
13
  import { createFloatingPresence as bt } from "./floatingPresence.js";
14
14
  import { LOCAL_INTERACTION_SURFACE_ATTR as Be } from "./localInteractionSurface.js";
15
15
  import { resolveFloatingBoundary as zt } from "./surfaceFloatingBoundary.js";
16
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">');
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">'), 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
18
  function nn(i) {
19
- const xe = () => i.resizable ?? !0, K = () => i.maximizable ?? !0, ve = () => i.draggable ?? !0, q = () => i.minSize ?? {
19
+ const ve = () => i.resizable ?? !0, K = () => i.maximizable ?? !0, xe = () => i.draggable ?? !0, q = () => i.minSize ?? {
20
20
  width: 200,
21
21
  height: 150
22
22
  }, H = () => i.maxSize ?? {
@@ -68,11 +68,11 @@ function nn(i) {
68
68
  y: i.defaultPosition?.y ?? 0,
69
69
  width: i.defaultSize?.width ?? 400,
70
70
  height: i.defaultSize?.height ?? 300
71
- }, x = {
71
+ }, v = {
72
72
  ...s
73
73
  }, A;
74
74
  const _e = (e) => {
75
- x = {
75
+ v = {
76
76
  ...e
77
77
  };
78
78
  const t = ge(R(), b());
@@ -151,7 +151,7 @@ function nn(i) {
151
151
  if (f === "drag" && u()) {
152
152
  if (Math.hypot(C.x - z.x, C.y - z.y) < 4) return;
153
153
  const e = me({
154
- rect: x,
154
+ rect: v,
155
155
  minSize: q(),
156
156
  maxSize: H(),
157
157
  viewport: R(),
@@ -165,7 +165,7 @@ function nn(i) {
165
165
  y: z.y - r
166
166
  }, oe(!1);
167
167
  }
168
- j(vt({
168
+ j(xt({
169
169
  mode: f,
170
170
  pointer: C,
171
171
  dragStartPos: z,
@@ -190,7 +190,7 @@ function nn(i) {
190
190
  return;
191
191
  }
192
192
  let r = me({
193
- rect: x,
193
+ rect: v,
194
194
  minSize: q(),
195
195
  maxSize: H(),
196
196
  viewport: t,
@@ -209,10 +209,10 @@ function nn(i) {
209
209
  }
210
210
  if (ue(r), !A) {
211
211
  const o = {
212
- width: x.width,
213
- height: x.height
212
+ width: v.width,
213
+ height: v.height
214
214
  };
215
- _e(r), Object.assign(x, o);
215
+ _e(r), Object.assign(v, o);
216
216
  }
217
217
  }, Ie = (e) => {
218
218
  k !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(k), k = null), e && Pe();
@@ -229,10 +229,10 @@ function nn(i) {
229
229
  if (o) {
230
230
  ue(o);
231
231
  const S = {
232
- width: x.width,
233
- height: x.height
232
+ width: v.width,
233
+ height: v.height
234
234
  };
235
- _e(o), f === "drag" && Object.assign(x, S);
235
+ _e(o), f === "drag" && Object.assign(v, S);
236
236
  }
237
237
  h = null, f = null, ye(!1), be(!1);
238
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)) {
@@ -344,7 +344,7 @@ function nn(i) {
344
344
  T(), O()?.fixedOffset, j(h === null ? e : s);
345
345
  });
346
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 = {
347
+ !xe() || m() || h !== null || e.pointerType === "mouse" && e.button !== 0 || e.target?.closest('button, input, select, textarea, a, [role="button"], [role="tab"], [data-floe-interactive], [data-floe-floating-window-header-actions], [contenteditable="true"]') || (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 = {
@@ -354,7 +354,7 @@ function nn(i) {
354
354
  y: e.clientY
355
355
  }, ce(!0, "grabbing"), Ce(e));
356
356
  }, $ = (e) => (t) => {
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 = {
357
+ !ve() || 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
360
  }, pe = {
@@ -377,7 +377,7 @@ function nn(i) {
377
377
  k = requestAnimationFrame(Re);
378
378
  }
379
379
  }, Ce = (e) => {
380
- N = xt({
380
+ N = vt({
381
381
  pointerEvent: e,
382
382
  // Keep click/double-click targeting on the titlebar while retaining capture.
383
383
  captureEl: f === "drag" ? se : d,
@@ -396,7 +396,7 @@ function nn(i) {
396
396
  }, Ae = () => {
397
397
  !K() || m() || (h !== null && he(!0), oe(!u()), B());
398
398
  }, ot = (e) => {
399
- e.target?.closest("button, [data-floe-floating-window-header-actions], [data-floe-floating-window-title-content]") || Ae();
399
+ e.target?.closest('button, input, select, textarea, a, [role="button"], [role="tab"], [data-floe-interactive], [data-floe-floating-window-header-actions], [contenteditable="true"]') || Ae();
400
400
  }, rt = (e) => {
401
401
  Ke(e.target) && Je();
402
402
  }, _ = (e) => J("absolute z-10", {
@@ -589,15 +589,15 @@ function nn(i) {
589
589
  }
590
590
  }), null), c(e, l(g, {
591
591
  get when() {
592
- return Z(() => !!(xe() && !u()))() && !m();
592
+ return Z(() => !!(ve() && !u()))() && !m();
593
593
  },
594
594
  get children() {
595
595
  return [(() => {
596
596
  var n = Ct();
597
- return P(n, "pointerdown", $("n"), !0), w(() => v(n, _("n"))), n;
597
+ return P(n, "pointerdown", $("n"), !0), w(() => x(n, _("n"))), n;
598
598
  })(), (() => {
599
599
  var n = At();
600
- return P(n, "pointerdown", $("s"), !0), w(() => v(n, _("s"))), n;
600
+ return P(n, "pointerdown", $("s"), !0), w(() => x(n, _("s"))), n;
601
601
  })(), l(g, {
602
602
  get when() {
603
603
  return !E();
@@ -605,27 +605,27 @@ function nn(i) {
605
605
  get children() {
606
606
  return [(() => {
607
607
  var n = Et();
608
- return P(n, "pointerdown", $("e"), !0), w(() => v(n, _("e"))), n;
608
+ return P(n, "pointerdown", $("e"), !0), w(() => x(n, _("e"))), n;
609
609
  })(), (() => {
610
610
  var n = Mt();
611
- return P(n, "pointerdown", $("w"), !0), w(() => v(n, _("w"))), n;
611
+ return P(n, "pointerdown", $("w"), !0), w(() => x(n, _("w"))), n;
612
612
  })(), (() => {
613
613
  var n = Ft();
614
- return P(n, "pointerdown", $("ne"), !0), w(() => v(n, _("ne"))), n;
614
+ return P(n, "pointerdown", $("ne"), !0), w(() => x(n, _("ne"))), n;
615
615
  })(), (() => {
616
616
  var n = kt();
617
- return P(n, "pointerdown", $("nw"), !0), w(() => v(n, _("nw"))), n;
617
+ return P(n, "pointerdown", $("nw"), !0), w(() => x(n, _("nw"))), n;
618
618
  })(), (() => {
619
619
  var n = Ot();
620
- return P(n, "pointerdown", $("se"), !0), w(() => v(n, _("se"))), n;
620
+ return P(n, "pointerdown", $("se"), !0), w(() => x(n, _("se"))), n;
621
621
  })(), (() => {
622
622
  var n = Tt();
623
- return P(n, "pointerdown", $("sw"), !0), w(() => v(n, _("sw"))), n;
623
+ return P(n, "pointerdown", $("sw"), !0), w(() => x(n, _("sw"))), n;
624
624
  })()];
625
625
  }
626
626
  })];
627
627
  }
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;
628
+ }), null), w(() => x(r, J("flex shrink-0 items-center justify-between h-8", "border-b", u() ? "rounded-none" : "rounded-t-panel", xe() && !m() && (L() ? "cursor-grabbing" : "cursor-move")))), e;
629
629
  }
630
630
  });
631
631
  }
@@ -1,120 +1,119 @@
1
- import { createComponent as E, mergeProps as K, memo as N } from "solid-js/web";
2
- import { splitProps as Q, createSignal as l, createEffect as R, onCleanup as O, onMount as U, Show as X } from "solid-js";
3
- import { SurfaceFloatingLayer as Z } from "./SurfaceFloatingLayer.js";
4
- import { resolveFloatingBoundary as _ } from "./surfaceFloatingBoundary.js";
5
- import { observeViewport as ee } from "../../viewport.js";
6
- import { resolveSurfacePortalHost as L } from "./dialogSurfaceScope.js";
7
- function se(C) {
8
- const [o, H] = Q(C, ["anchor", "revision", "topOffset", "reservedSpace", "placement", "gap", "children", "class", "style", "layerRef", "onAnchorDisconnect"]), [P, $] = l(!1), [B, V] = l({
1
+ import { createComponent as F, mergeProps as J, memo as K } from "solid-js/web";
2
+ import { splitProps as N, createSignal as f, createEffect as M, onCleanup as R, onMount as Q, Show as U } from "solid-js";
3
+ import { SurfaceFloatingLayer as X } from "./SurfaceFloatingLayer.js";
4
+ import { resolveFloatingBoundary as Z } from "./surfaceFloatingBoundary.js";
5
+ import { observeViewport as _ } from "../../viewport.js";
6
+ import { resolveSurfacePortalHost as E } from "./dialogSurfaceScope.js";
7
+ function ae(L) {
8
+ const [o, C] = N(L, ["anchor", "revision", "topOffset", "reservedSpace", "placement", "gap", "children", "class", "style", "layerRef", "onAnchorDisconnect"]), [O, H] = f(!1), [$, B] = f({
9
9
  x: 0,
10
10
  y: 0
11
- }), [Y, q] = l("above"), [S, w] = l(!1), [D, W] = l(480), [z, k] = l();
12
- let m, x = !1;
13
- const [A, T] = l({
11
+ }), [V, Y] = f("above"), [P, v] = f(!1), [q, D] = f(480), [S, k] = f();
12
+ let d, w = !1;
13
+ const [z, T] = f({
14
14
  x: 0,
15
15
  y: 0
16
- }), [j, G] = l(0), I = () => {
17
- m = void 0;
18
- const n = o.anchor, h = z();
19
- if (!n || !h) return;
16
+ }), [W, j] = f(0), G = () => {
17
+ d = void 0;
18
+ const n = o.anchor, l = S();
19
+ if (!n || !l) return;
20
20
  if (!n.isConnected) {
21
- w(!1), x || o.onAnchorDisconnect?.(), x = !0;
21
+ v(!1), w || o.onAnchorDisconnect?.(), w = !0;
22
22
  return;
23
23
  }
24
- x = !1;
25
- const t = _(L({
24
+ w = !1;
25
+ const t = Z(E({
26
26
  owner: n
27
27
  }));
28
28
  if (!t) {
29
- w(!1);
29
+ v(!1);
30
30
  return;
31
31
  }
32
- const e = n.getBoundingClientRect(), f = Math.max(120, t.width - 24);
33
- W(f);
34
- const r = h.getBoundingClientRect(), J = (Math.max(t.left, e.left) + Math.min(t.right, e.right)) / 2;
35
- let d = Math.max(t.left + 12, Math.min(J - r.width / 2, t.right - r.width - 12));
36
- const y = e.top - (o.topOffset ?? 0), i = Math.max(0, o.gap ?? 12), g = y - r.height - i, p = o.reservedSpace, u = t.top + (window.matchMedia("(max-width:760px)").matches ? p?.narrowTop ?? p?.top ?? 12 : p?.top ?? 12), M = Math.max(u, t.bottom - (p?.bottom ?? 12) - r.height), b = (v) => Math.max(u, Math.min(v, M));
37
- G(Math.max(0, t.bottom - (p?.bottom ?? 12) - u));
38
- let s = g, a = "above";
32
+ const e = n.getBoundingClientRect(), s = o.reservedSpace, m = t.top + (window.matchMedia("(max-width:760px)").matches ? s?.narrowTop ?? s?.top ?? 12 : s?.top ?? 12);
33
+ D(Math.max(120, t.width - 24)), j(Math.max(0, t.bottom - (s?.bottom ?? 12) - m));
34
+ const r = l.getBoundingClientRect(), I = (Math.max(t.left, e.left) + Math.min(t.right, e.right)) / 2;
35
+ let p = Math.max(t.left + 12, Math.min(I - r.width / 2, t.right - r.width - 12));
36
+ const x = e.top - (o.topOffset ?? 0), i = Math.max(0, o.gap ?? 12), g = x - r.height - i, y = Math.max(m, t.bottom - (s?.bottom ?? 12) - r.height), u = (b) => Math.max(m, Math.min(b, y));
37
+ let c = g, a = "above";
39
38
  if (o.placement === "right" || o.placement === "left") {
40
- const v = e.right + i + r.width <= t.right - 12, F = e.left - i - r.width >= t.left + 12;
41
- a = o.placement, a === "right" && !v && F ? a = "left" : a === "left" && !F && v && (a = "right"), d = Math.max(t.left + 12, Math.min(a === "right" ? e.right + i : e.left - r.width - i, t.right - r.width - 12)), s = b(e.top + e.height / 2 - r.height / 2);
42
- } else g < u ? e.bottom + i <= M ? (s = e.bottom + i, a = "below") : g >= t.top + 12 ? a = "above" : e.bottom + r.height + i <= t.bottom - 12 ? (s = e.bottom + i, a = "below") : e.right + r.width + i + 12 <= t.right ? (d = e.right + i, s = b(y), a = "right") : e.left - r.width - i - 12 >= t.left ? (d = e.left - r.width - i, s = b(y), a = "left") : (s = b(g), a = "edge") : s = Math.min(s, M);
39
+ const b = e.right + i + r.width <= t.right - 12, A = e.left - i - r.width >= t.left + 12;
40
+ a = o.placement, a === "right" && !b && A ? a = "left" : a === "left" && !A && b && (a = "right"), p = Math.max(t.left + 12, Math.min(a === "right" ? e.right + i : e.left - r.width - i, t.right - r.width - 12)), c = u(e.top + e.height / 2 - r.height / 2);
41
+ } else g < m ? e.bottom + i <= y ? (c = e.bottom + i, a = "below") : g >= t.top + 12 ? a = "above" : e.bottom + r.height + i <= t.bottom - 12 ? (c = e.bottom + i, a = "below") : e.right + r.width + i + 12 <= t.right ? (p = e.right + i, c = u(x), a = "right") : e.left - r.width - i - 12 >= t.left ? (p = e.left - r.width - i, c = u(x), a = "left") : (c = u(g), a = "edge") : c = Math.min(c, y);
43
42
  T({
44
- x: Math.max(18, Math.min(e.left + e.width / 2 - d, Math.max(18, r.width - 18))),
45
- y: Math.max(18, Math.min(e.top + e.height / 2 - s, Math.max(18, r.height - 18)))
46
- }), q(a), V({
47
- x: Math.round(d),
48
- y: Math.round(s)
49
- }), w(e.right > t.left && e.left < t.right && e.bottom > t.top && e.top < t.bottom);
50
- }, c = () => {
51
- m === void 0 && typeof requestAnimationFrame == "function" && (m = requestAnimationFrame(I));
43
+ x: Math.max(18, Math.min(e.left + e.width / 2 - p, Math.max(18, r.width - 18))),
44
+ y: Math.max(18, Math.min(e.top + e.height / 2 - c, Math.max(18, r.height - 18)))
45
+ }), Y(a), B({
46
+ x: Math.round(p),
47
+ y: Math.round(c)
48
+ }), v(e.right > t.left && e.left < t.right && e.bottom > t.top && e.top < t.bottom);
49
+ }, h = () => {
50
+ d === void 0 && typeof requestAnimationFrame == "function" && (d = requestAnimationFrame(G));
52
51
  };
53
- return R(() => {
54
- o.anchor, o.revision, o.topOffset, o.reservedSpace, o.placement, o.gap, c();
55
- }), R(() => {
56
- const n = z();
52
+ return M(() => {
53
+ o.anchor, o.revision, o.topOffset, o.reservedSpace, o.placement, o.gap, h();
54
+ }), M(() => {
55
+ const n = S();
57
56
  if (!n || typeof ResizeObserver > "u") return;
58
- const h = new ResizeObserver(c);
59
- h.observe(n), O(() => h.disconnect());
60
- }), U(() => $(!0)), R(() => {
61
- if (!P()) return;
62
- const n = o.anchor, h = typeof ResizeObserver == "function" ? new ResizeObserver(c) : void 0, t = L({
57
+ const l = new ResizeObserver(h);
58
+ l.observe(n), R(() => l.disconnect());
59
+ }), Q(() => H(!0)), M(() => {
60
+ if (!O()) return;
61
+ const n = o.anchor, l = typeof ResizeObserver == "function" ? new ResizeObserver(h) : void 0, t = E({
63
62
  owner: n
64
63
  }).boundaryHost;
65
- t && h?.observe(t), n && h?.observe(n);
66
- const e = new MutationObserver(c);
64
+ t && l?.observe(t), n && l?.observe(n);
65
+ const e = new MutationObserver(h);
67
66
  n && e.observe(n, {
68
67
  attributes: !0,
69
68
  attributeFilter: ["style"]
70
69
  });
71
- let f = n?.parentElement;
72
- for (; f && (e.observe(f, {
70
+ let s = n?.parentElement;
71
+ for (; s && (e.observe(s, {
73
72
  attributes: !0,
74
73
  attributeFilter: ["style"],
75
74
  childList: !0
76
- }), f !== t); )
77
- f = f.parentElement;
78
- const r = ee(window, c);
79
- window.addEventListener("scroll", c, !0), c(), O(() => {
80
- h?.disconnect(), e.disconnect(), r(), window.removeEventListener("scroll", c, !0);
75
+ }), s !== t); )
76
+ s = s.parentElement;
77
+ const m = _(window, h);
78
+ window.addEventListener("scroll", h, !0), h(), R(() => {
79
+ l?.disconnect(), e.disconnect(), m(), window.removeEventListener("scroll", h, !0);
81
80
  });
82
- }), O(() => {
83
- m !== void 0 && cancelAnimationFrame(m);
84
- }), E(X, {
81
+ }), R(() => {
82
+ d !== void 0 && cancelAnimationFrame(d);
83
+ }), F(U, {
85
84
  get when() {
86
- return N(() => !!P())() && o.anchor;
85
+ return K(() => !!O())() && o.anchor;
87
86
  },
88
87
  get children() {
89
- return E(Z, K(H, {
88
+ return F(X, J(C, {
90
89
  get owner() {
91
90
  return o.anchor;
92
91
  },
93
92
  get position() {
94
- return B();
93
+ return $();
95
94
  },
96
95
  get class() {
97
96
  return o.class;
98
97
  },
99
98
  get "data-placement"() {
100
- return Y();
99
+ return V();
101
100
  },
102
101
  get inert() {
103
- return !S();
102
+ return !P();
104
103
  },
105
104
  get style() {
106
105
  return {
107
106
  ...o.style,
108
- "--floe-anchored-layer-anchor-x": `${A().x}px`,
109
- "--floe-anchored-layer-anchor-y": `${A().y}px`,
110
- "--floe-anchored-layer-max-height": `${j()}px`,
111
- visibility: S() ? "visible" : "hidden",
112
- "max-width": `${D()}px`,
107
+ "--floe-anchored-layer-anchor-x": `${z().x}px`,
108
+ "--floe-anchored-layer-anchor-y": `${z().y}px`,
109
+ "--floe-anchored-layer-max-height": `${W()}px`,
110
+ visibility: P() ? "visible" : "hidden",
111
+ "max-width": `${q()}px`,
113
112
  "z-index": o.style?.["z-index"] ?? 60
114
113
  };
115
114
  },
116
115
  layerRef: (n) => {
117
- k(n), o.layerRef?.(n), c();
116
+ k(n), o.layerRef?.(n), h();
118
117
  },
119
118
  get children() {
120
119
  return o.children;
@@ -124,5 +123,5 @@ function se(C) {
124
123
  });
125
124
  }
126
125
  export {
127
- se as SurfaceAnchoredLayer
126
+ ae as SurfaceAnchoredLayer
128
127
  };
@@ -73,6 +73,8 @@ export interface TabsProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'onC
73
73
  onActiveIdChange?: (id: string) => void;
74
74
  /** Callback when tab is closed */
75
75
  onClose?: (id: string) => void;
76
+ /** Enable pointer sorting and Alt+Shift+Left/Right. Receives the complete ordered IDs. */
77
+ onReorder?: (ids: string[]) => void;
76
78
  /** Callback when add button is clicked */
77
79
  onAdd?: () => void;
78
80
  /** Whether to show add button (legacy alias; overridden by features.addButton.enabled when provided) */