@saar-ai/web-widget 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1365,6 +1365,104 @@ function useCrossFade(line, swapKey, durationMs) {
1365
1365
  }, [outgoing, durationMs]);
1366
1366
  return outgoing;
1367
1367
  }
1368
+ /**
1369
+ * "The browser is not painting this document."
1370
+ *
1371
+ * An absent `document` (SSR, a worker) is NOT hidden: the caller is asking
1372
+ * whether to skip an animation, and there is no animation to skip. Tolerant
1373
+ * of a partial `document` stub, which is what an embedded webview can hand a
1374
+ * widget that has no say in where it is loaded.
1375
+ */
1376
+ function isDocumentHidden(doc) {
1377
+ return (doc ?? (typeof document === "undefined" ? null : document))?.visibilityState === "hidden";
1378
+ }
1379
+ /**
1380
+ * Guarantees that one transition's end state lands, whether or not the
1381
+ * browser ever fires `transitionend` for it.
1382
+ *
1383
+ * @returns a handle whose `finish()`/`cancel()` are both idempotent. Callers
1384
+ * that can be superseded (a swap interrupting a swap) `cancel()` the previous
1385
+ * handle before opening a new one; callers that unmount `cancel()` in their
1386
+ * effect cleanup.
1387
+ */
1388
+ function finaliseTransition(options) {
1389
+ const { el, durationMs, endState, onFinalise } = options;
1390
+ const doc = options.doc ?? el.ownerDocument ?? null;
1391
+ const win = doc?.defaultView ?? null;
1392
+ let settled = false;
1393
+ let timer = null;
1394
+ /** Undoes the inline override written by `applyEndState`; null when none is outstanding. */
1395
+ let release = null;
1396
+ const onTransitionEnd = (event) => {
1397
+ if (event.target === el) finish();
1398
+ };
1399
+ const onVisibilityChange = () => finish();
1400
+ const detach = () => {
1401
+ if (timer !== null) clearTimeout(timer);
1402
+ timer = null;
1403
+ el.removeEventListener("transitionend", onTransitionEnd);
1404
+ doc?.removeEventListener?.("visibilitychange", onVisibilityChange);
1405
+ };
1406
+ /**
1407
+ * Write the end state, behind a `transition: none` that outlives this task.
1408
+ *
1409
+ * The override has to survive at least one frame to cancel a transition the
1410
+ * engine has already started — set and cleared inside one task it is not
1411
+ * observed at all, and the frozen transition keeps running. `requestAnimationFrame`
1412
+ * is the right clock for "one frame from now" and it is also the right one
1413
+ * for a hidden tab: a frame requested while hidden is not dropped, it runs
1414
+ * when the document is painted again, which is exactly when the element
1415
+ * needs to be handed back to the cascade.
1416
+ */
1417
+ const applyEndState = () => {
1418
+ const previousTransition = el.style.transition;
1419
+ el.style.transition = "none";
1420
+ if (endState) for (const property of Object.keys(endState)) el.style.setProperty(property, endState[property]);
1421
+ let released = false;
1422
+ release = () => {
1423
+ if (released) return;
1424
+ released = true;
1425
+ release = null;
1426
+ el.style.transition = previousTransition;
1427
+ if (!endState) return;
1428
+ for (const property of Object.keys(endState)) el.style.removeProperty(property);
1429
+ };
1430
+ const scheduled = release;
1431
+ if (typeof win?.requestAnimationFrame === "function") {
1432
+ win.requestAnimationFrame(() => scheduled());
1433
+ return;
1434
+ }
1435
+ setTimeout(() => scheduled(), 0);
1436
+ };
1437
+ function finish() {
1438
+ if (settled) return;
1439
+ settled = true;
1440
+ detach();
1441
+ applyEndState();
1442
+ onFinalise?.();
1443
+ }
1444
+ function cancel() {
1445
+ release?.();
1446
+ if (settled) return;
1447
+ settled = true;
1448
+ detach();
1449
+ }
1450
+ const handle = {
1451
+ finish,
1452
+ cancel,
1453
+ get settled() {
1454
+ return settled;
1455
+ }
1456
+ };
1457
+ if (options.immediate === true || durationMs <= 0 || isDocumentHidden(doc)) {
1458
+ finish();
1459
+ return handle;
1460
+ }
1461
+ el.addEventListener("transitionend", onTransitionEnd);
1462
+ doc?.addEventListener?.("visibilitychange", onVisibilityChange);
1463
+ timer = setTimeout(finish, durationMs + 100);
1464
+ return handle;
1465
+ }
1368
1466
  var SWAP_EASING = "cubic-bezier(0.2, 0, 0, 1)";
1369
1467
  /** §7.2 — the waveform's per-frame smoothing. */
1370
1468
  var LEVEL_LERP = .25;
@@ -1404,6 +1502,41 @@ function matchesReducedMotion() {
1404
1502
  return safeMatchMedia()?.matches === true;
1405
1503
  }
1406
1504
  /**
1505
+ * §7.1 rule 12 — `document.visibilityState`, as a subscription.
1506
+ *
1507
+ * A one-shot read at mount would be the wrong answer for the whole of the
1508
+ * rest of the visit, and the visit is where this matters: the shopper taps
1509
+ * the pill and then locks the phone. Both edges are reported, because both
1510
+ * change what the dock is allowed to do — hidden means "apply the end state,
1511
+ * animate nothing", visible means "a stalled transition, if there is one, has
1512
+ * to be finalised now".
1513
+ */
1514
+ function useDocumentHidden() {
1515
+ const [hidden, setHidden] = useState(() => isDocumentHidden());
1516
+ useEffect(() => {
1517
+ if (typeof document === "undefined") return;
1518
+ const onChange = () => setHidden(isDocumentHidden());
1519
+ onChange();
1520
+ document.addEventListener("visibilitychange", onChange);
1521
+ return () => document.removeEventListener("visibilitychange", onChange);
1522
+ }, []);
1523
+ return hidden;
1524
+ }
1525
+ /**
1526
+ * "Motion is off." §7.1 rule 10 and rule 12 in ONE read, because a surface
1527
+ * that has to remember two of them will eventually remember one.
1528
+ *
1529
+ * `prefers-reduced-motion` is a preference and a hidden tab is a fact, but
1530
+ * they ask the dock for the same thing: skip the animation, apply the end
1531
+ * state now. Every duration in {@link useDockDurations} collapses to 0, the
1532
+ * FLIP does not start, and the caption swaps in place.
1533
+ */
1534
+ function useMotionOff() {
1535
+ const reduced = usePrefersReducedMotion();
1536
+ const hidden = useDocumentHidden();
1537
+ return reduced || hidden;
1538
+ }
1539
+ /**
1407
1540
  * §7.1 rule 5 — a per-frame custom-property writer.
1408
1541
  *
1409
1542
  * Returns `set(name, value)`. Calls COALESCE: whatever the last value for a
@@ -1466,33 +1599,55 @@ function useCssVars(ref) {
1466
1599
  * the timer left the listener attached and `will-change` set on a node that
1467
1600
  * no longer renders, so the layer survived the component and the closure
1468
1601
  * survived with it.
1602
+ *
1603
+ * ## Why the promotion is not the only thing this arms (§7.1 rule 12)
1604
+ *
1605
+ * The `transitionend` this waits for never arrives in a hidden tab, and a
1606
+ * sheet whose reveal was interrupted by a lock screen is not merely a layer
1607
+ * left promoted — it is a `visibility: hidden` box that the shopper cannot
1608
+ * see or reach. `arm(endState)` therefore hands the whole finalisation to
1609
+ * `motion-gate.ts`: the fallback timer, the `visibilitychange` edge, and the
1610
+ * explicit end state the surface passes in. Armed while the tab is already
1611
+ * hidden (or with a zeroed duration), it promotes nothing at all and applies
1612
+ * that end state synchronously — there is no animation to give a layer to.
1469
1613
  */
1470
1614
  function useTransientWillChange(ref, properties = "transform, opacity", ms = 240) {
1471
- const timer = useRef(null);
1472
- /** Undoes whatever arming is currently live — null when nothing is armed. */
1473
- const disarm = useRef(null);
1615
+ /** The finalisation currently in flight — null when nothing is armed. */
1616
+ const pending = useRef(null);
1617
+ /**
1618
+ * The element the promotion was written on, held separately from `ref`.
1619
+ *
1620
+ * Unmount is the third way out and it used to be the leaky one. React may
1621
+ * have detached `ref` by the time this effect's cleanup runs, and a
1622
+ * `will-change` left on a detached node keeps its layer alive for as long
1623
+ * as anything still points at the node — which is precisely what rule 4
1624
+ * forbids.
1625
+ */
1626
+ const armed = useRef(null);
1474
1627
  useEffect(() => () => {
1475
- disarm.current?.();
1476
- if (timer.current !== null) clearTimeout(timer.current);
1477
- timer.current = null;
1628
+ pending.current?.cancel();
1629
+ pending.current = null;
1630
+ if (armed.current) armed.current.style.willChange = "";
1631
+ armed.current = null;
1478
1632
  }, []);
1479
- return useCallback(() => {
1633
+ return useCallback((endState) => {
1480
1634
  const el = ref.current;
1481
1635
  if (!el) return;
1482
- disarm.current?.();
1483
- el.style.willChange = properties;
1484
- const clear = (event) => {
1485
- if (event && event.target !== el) return;
1486
- el.style.willChange = "";
1487
- el.removeEventListener("transitionend", clear);
1488
- if (timer.current !== null) clearTimeout(timer.current);
1489
- timer.current = null;
1490
- disarm.current = null;
1491
- };
1492
- disarm.current = () => clear();
1493
- el.addEventListener("transitionend", clear);
1494
- if (timer.current !== null) clearTimeout(timer.current);
1495
- timer.current = setTimeout(clear, ms + 60);
1636
+ pending.current?.cancel();
1637
+ pending.current = null;
1638
+ if (ms > 0 && !isDocumentHidden(el.ownerDocument)) {
1639
+ el.style.willChange = properties;
1640
+ armed.current = el;
1641
+ }
1642
+ pending.current = finaliseTransition({
1643
+ el,
1644
+ durationMs: ms,
1645
+ endState,
1646
+ onFinalise: () => {
1647
+ el.style.willChange = "";
1648
+ armed.current = null;
1649
+ }
1650
+ });
1496
1651
  }, [
1497
1652
  ref,
1498
1653
  properties,
@@ -1530,6 +1685,63 @@ function lerp(current, target, factor = LEVEL_LERP) {
1530
1685
  return current + (target - current) * factor;
1531
1686
  }
1532
1687
  /**
1688
+ * §7.2's two forms at rest, as the inline properties a §7.1 rule 12
1689
+ * finalisation writes.
1690
+ *
1691
+ * These MIRROR `.wgt-row[data-form='pill']` and `.wgt-pill[data-form='row']`
1692
+ * in `styles/concierge.css` — the cascade is still what draws the dock, and
1693
+ * this table is only ever written for the one frame in which a stalled
1694
+ * transition is being cancelled. `dock-motion.test.ts` reads the stylesheet
1695
+ * and asserts the two agree, because a divergence here is invisible until a
1696
+ * shopper locks their phone mid-swap and comes back to a dock in the wrong
1697
+ * shape.
1698
+ */
1699
+ var FORM_END_STATE = {
1700
+ /** Either form, showing. The base rule for both boxes. */
1701
+ shown: {
1702
+ visibility: "visible",
1703
+ opacity: "1",
1704
+ transform: "none"
1705
+ },
1706
+ /** `.wgt-pill[data-form='row']`. */
1707
+ pillHidden: {
1708
+ visibility: "hidden",
1709
+ opacity: "0",
1710
+ transform: "scale(0.92)"
1711
+ },
1712
+ /** `.wgt-row[data-form='pill']`. */
1713
+ rowHidden: {
1714
+ visibility: "hidden",
1715
+ opacity: "0",
1716
+ transform: "scale(0.98)"
1717
+ }
1718
+ };
1719
+ /**
1720
+ * §3.3's sheet at each end of its reveal, as the inline properties a §7.1
1721
+ * rule 12 finalisation writes.
1722
+ *
1723
+ * Mirrors `.wgt-sheet` and `.wgt-sheet[data-snap='closed']` in
1724
+ * `styles/concierge.css`, and `dock-motion.test.ts` asserts they agree. The
1725
+ * open state keeps `transform` expressed through `--wgt-sheet-y` rather than
1726
+ * as a resolved `translateY(0px)`: the drag writes that custom property once
1727
+ * per frame (§7.1 rule 5), and a finaliser that resolved it would pin the
1728
+ * sheet to wherever the last gesture left it.
1729
+ */
1730
+ var SHEET_END_STATE = {
1731
+ open: {
1732
+ visibility: "visible",
1733
+ opacity: "1",
1734
+ "clip-path": "inset(0 0 0 0)",
1735
+ transform: "translateY(var(--wgt-sheet-y, 0px))"
1736
+ },
1737
+ closed: {
1738
+ visibility: "hidden",
1739
+ opacity: "0",
1740
+ "clip-path": "inset(100% 0 0 0)",
1741
+ transform: "translateY(8px)"
1742
+ }
1743
+ };
1744
+ /**
1533
1745
  * The pill ↔ row swap (§7.2), driven by whichever box is showing.
1534
1746
  *
1535
1747
  * Both boxes exist at all times — the swap is a VISIBILITY change, never a
@@ -1538,42 +1750,114 @@ function lerp(current, target, factor = LEVEL_LERP) {
1538
1750
  * the change puts the incoming one back where the outgoing one was and
1539
1751
  * releases it. One layout read, one style write, no host reflow.
1540
1752
  *
1541
- * Under reduced motion it does nothing at all: §7.1 rule 10, and the state is
1542
- * always also in text (the live region), so nothing is lost.
1753
+ * Under reduced motion, or in a hidden tab, it does nothing at all but write
1754
+ * both end states: §7.1 rules 10 and 12, and the state is always also in text
1755
+ * (the live region), so nothing is lost. `motionOff` is the caller's single
1756
+ * read of both (see {@link useMotionOff}).
1757
+ *
1758
+ * ## The FLIP is not the only thing being finalised here
1759
+ *
1760
+ * The WAAPI animation below is the cross-fade's TRAVEL. The cross-fade
1761
+ * itself — `opacity`, `transform`, and the `visibility` that takes the
1762
+ * outgoing form out of the tab order — is a CSS transition on both elements,
1763
+ * driven by `data-form`, and it is the one that froze on production: a hidden
1764
+ * tab left `.wgt-row` at `opacity: 0.6`, `visibility: hidden` with the pill
1765
+ * hidden too, so there was nothing on screen to tap. Each form therefore gets
1766
+ * its own finaliser, with its own end state, on every swap.
1543
1767
  */
1544
- function useFormFlip(pillRef, rowRef, form, reducedMotion, durationMs = 240) {
1768
+ function useFormFlip(pillRef, rowRef, form, motionOff, durationMs = 240) {
1545
1769
  const previous = useRef(form);
1770
+ /**
1771
+ * The swap currently being finalised, held across effect runs rather than
1772
+ * torn down by each one.
1773
+ *
1774
+ * This hook's dependencies change on the very `visibilitychange` that
1775
+ * finalises the swap — `useMotionOff` is subscribed to that event and every
1776
+ * duration in {@link useDockDurations} collapses with it — so an effect
1777
+ * cleanup that cancelled the finalisers would take the end state back off
1778
+ * in the SAME TASK it was written in. The one-frame `transition: none` is
1779
+ * the whole mechanism (it is what cancels a transition the engine has
1780
+ * frozen), and an override set and cleared inside one task is never
1781
+ * observed at all. So: a NEW swap supersedes the old one, a dependency
1782
+ * change with no swap behind it finalises rather than discards, and only an
1783
+ * unmount cancels.
1784
+ */
1785
+ const inFlight = useRef([]);
1786
+ const running = useRef(void 0);
1787
+ useEffect(() => () => {
1788
+ running.current?.cancel();
1789
+ running.current = void 0;
1790
+ for (const finaliser of inFlight.current) finaliser.cancel();
1791
+ inFlight.current = [];
1792
+ }, []);
1546
1793
  useEffect(() => {
1547
1794
  const was = previous.current;
1548
1795
  previous.current = form;
1549
- if (was === form || reducedMotion || durationMs <= 0) return;
1550
- const outgoing = was === "pill" ? pillRef.current : rowRef.current;
1551
- const incoming = form === "pill" ? pillRef.current : rowRef.current;
1552
- if (!outgoing || !incoming || typeof incoming.getBoundingClientRect !== "function") return;
1553
- const transform = flipTransform(outgoing.getBoundingClientRect(), incoming.getBoundingClientRect());
1554
- if (transform === "none") return;
1555
- const animation = incoming.animate?.([{
1556
- transform,
1557
- opacity: .6
1558
- }, {
1559
- transform: "none",
1560
- opacity: 1
1561
- }], {
1562
- duration: durationMs,
1563
- easing: SWAP_EASING,
1564
- fill: "none"
1565
- });
1566
- return () => animation?.cancel();
1796
+ if (was === form) {
1797
+ if (motionOff || durationMs <= 0) for (const finaliser of inFlight.current) finaliser.finish();
1798
+ return;
1799
+ }
1800
+ running.current?.cancel();
1801
+ running.current = void 0;
1802
+ for (const finaliser of inFlight.current) finaliser.cancel();
1803
+ inFlight.current = [];
1804
+ const pill = pillRef.current;
1805
+ const row = rowRef.current;
1806
+ const outgoing = was === "pill" ? pill : row;
1807
+ const incoming = form === "pill" ? pill : row;
1808
+ const immediate = motionOff || durationMs <= 0 || isDocumentHidden((pill ?? row)?.ownerDocument);
1809
+ let animation;
1810
+ const finishAnimation = () => {
1811
+ try {
1812
+ animation?.finish();
1813
+ } catch {}
1814
+ };
1815
+ const finalisers = [];
1816
+ if (pill) finalisers.push(finaliseTransition({
1817
+ el: pill,
1818
+ durationMs,
1819
+ immediate,
1820
+ onFinalise: finishAnimation,
1821
+ endState: form === "pill" ? FORM_END_STATE.shown : FORM_END_STATE.pillHidden
1822
+ }));
1823
+ if (row) finalisers.push(finaliseTransition({
1824
+ el: row,
1825
+ durationMs,
1826
+ immediate,
1827
+ onFinalise: finishAnimation,
1828
+ endState: form === "row" ? FORM_END_STATE.shown : FORM_END_STATE.rowHidden
1829
+ }));
1830
+ if (!immediate && outgoing && incoming && typeof incoming.getBoundingClientRect === "function") {
1831
+ const transform = flipTransform(outgoing.getBoundingClientRect(), incoming.getBoundingClientRect());
1832
+ if (transform !== "none") animation = incoming.animate?.([{
1833
+ transform,
1834
+ opacity: .6
1835
+ }, {
1836
+ transform: "none",
1837
+ opacity: 1
1838
+ }], {
1839
+ duration: durationMs,
1840
+ easing: SWAP_EASING,
1841
+ fill: "none"
1842
+ });
1843
+ }
1844
+ inFlight.current = finalisers;
1845
+ running.current = animation;
1567
1846
  }, [
1568
1847
  form,
1569
- reducedMotion,
1848
+ motionOff,
1570
1849
  pillRef,
1571
1850
  rowRef,
1572
1851
  durationMs
1573
1852
  ]);
1574
1853
  }
1575
- function useDockDurations(reducedMotion) {
1576
- return useMemo(() => reducedMotion ? {
1854
+ /**
1855
+ * @param motionOff §7.1 rule 10 (`prefers-reduced-motion`) OR rule 12 (the
1856
+ * tab is hidden and the browser will not advance a transition in it). See
1857
+ * {@link useMotionOff}, which is how every caller reads both at once.
1858
+ */
1859
+ function useDockDurations(motionOff) {
1860
+ return useMemo(() => motionOff ? {
1577
1861
  swap: 0,
1578
1862
  recede: 0,
1579
1863
  sheetOpen: 0,
@@ -1591,7 +1875,7 @@ function useDockDurations(reducedMotion) {
1591
1875
  caption: 160,
1592
1876
  border: 160,
1593
1877
  control: 120
1594
- }, [reducedMotion]);
1878
+ }, [motionOff]);
1595
1879
  }
1596
1880
  //#endregion
1597
1881
  //#region src/dock/dock-row.tsx
@@ -2033,13 +2317,17 @@ function DockSheet({ snap, onSnapChange, label, peekOnly, header, children, onDi
2033
2317
  });
2034
2318
  return () => cancelAnimationFrame(raf);
2035
2319
  }, [followKey, snap]);
2320
+ const lastSnap = useRef(snap);
2036
2321
  const firstSnap = useRef(true);
2037
2322
  useEffect(() => {
2038
2323
  if (firstSnap.current) {
2039
2324
  firstSnap.current = false;
2325
+ lastSnap.current = snap;
2040
2326
  return;
2041
2327
  }
2042
- armWillChange();
2328
+ if (lastSnap.current === snap) return;
2329
+ lastSnap.current = snap;
2330
+ armWillChange(snap === "closed" ? SHEET_END_STATE.closed : SHEET_END_STATE.open);
2043
2331
  }, [snap, armWillChange]);
2044
2332
  /**
2045
2333
  * A drag that can never END.
@@ -2862,8 +3150,8 @@ function Dock(props) {
2862
3150
  const pillRef = useRef(null);
2863
3151
  const inputRef = useRef(null);
2864
3152
  const setVar = useCssVars(rootRef);
2865
- const reducedMotion = usePrefersReducedMotion();
2866
- const durations = useDockDurations(reducedMotion);
3153
+ const motionOff = useMotionOff();
3154
+ const durations = useDockDurations(motionOff);
2867
3155
  const { isDesktop, shortViewport } = useViewport(rootRef);
2868
3156
  const msg = useCallback((key, vars) => formatMessage(messages[key] ?? defaultWidgetMessages[key], vars), [messages]);
2869
3157
  const name = identity.name?.trim() || "Concierge";
@@ -3440,11 +3728,11 @@ function Dock(props) {
3440
3728
  useEffect(() => {
3441
3729
  recedeRef.current?.setForm(form);
3442
3730
  }, [form]);
3443
- useFormFlip(pillRef, rowRef, form, reducedMotion, durations.swap);
3731
+ useFormFlip(pillRef, rowRef, form, motionOff, durations.swap);
3444
3732
  const levelRef = voice?.levelRef;
3445
3733
  const waveform = view.activity === "waveform";
3446
3734
  useEffect(() => {
3447
- if (!waveform || reducedMotion || typeof requestAnimationFrame !== "function") return;
3735
+ if (!waveform || motionOff || typeof requestAnimationFrame !== "function") return;
3448
3736
  let frame = 0;
3449
3737
  const smoothed = [
3450
3738
  .15,
@@ -3465,7 +3753,7 @@ function Dock(props) {
3465
3753
  return () => cancelAnimationFrame(raf);
3466
3754
  }, [
3467
3755
  waveform,
3468
- reducedMotion,
3756
+ motionOff,
3469
3757
  setVar,
3470
3758
  levelRef
3471
3759
  ]);
@@ -1,10 +1,10 @@
1
1
  /**
2
- * THE DOCK'S MOTION — docs/DOCK_SPEC.md §7, as the four primitives every
3
- * surface under `dock/` shares.
2
+ * THE DOCK'S MOTION — docs/DOCK_SPEC.md §7, as the primitives every surface
3
+ * under `dock/` shares.
4
4
  *
5
5
  * §7.1 is a gate, not guidance, and `tools/check-widget-motion.mjs` enforces
6
- * rule 1 (compositor only) over this whole package. The other four rules the
7
- * dock cannot get right by writing CSS alone live here:
6
+ * rule 1 (compositor only) over this whole package. The rules the dock cannot
7
+ * get right by writing CSS alone live here:
8
8
  *
9
9
  * - **rule 4 — `will-change` is transient.** Set by the animation's start,
10
10
  * removed on `transitionend`. A permanent `will-change: transform` on a
@@ -22,6 +22,14 @@
22
22
  * - **rule 10 — reduced motion wins.** Every duration below collapses to 0
23
23
  * and the FLIP is skipped entirely. {@link usePrefersReducedMotion} is the
24
24
  * single read, so no surface can forget it.
25
+ * - **rule 12 — transitions finalise without `transitionend`.** A hidden tab
26
+ * does not advance a CSS transition, so a dock that waits for the event
27
+ * waits forever and strands itself mid-swap with both forms
28
+ * `visibility: hidden`. {@link useMotionOff} folds "the tab is hidden"
29
+ * into rule 10's single read, and `motion-gate.ts` owns the fallback
30
+ * timer, the explicit end state and the `visibilitychange` finalisation —
31
+ * it is React-free because the core dock (`cdn/dock-dom.ts`) has the same
32
+ * hazard and cannot afford a framework.
25
33
  * - **§7.2's pill ↔ row FLIP.** Measure both boxes, animate the difference
26
34
  * on `transform` alone. Never `width`/`height`/`left` — see the guard.
27
35
  *
@@ -30,6 +38,7 @@
30
38
  * without a layout engine jsdom does not have.
31
39
  */
32
40
  import { type RefObject } from 'react';
41
+ import { type MotionEndState } from './motion-gate.js';
33
42
  /** §7.2 — the pill ↔ row swap, and the recede/expand that reuses it. */
34
43
  export declare const SWAP_MS = 240;
35
44
  export declare const RECEDE_MS = 200;
@@ -59,6 +68,27 @@ export declare const SHEET_DISMISS_FRACTION = 0.4;
59
68
  * static dock is always correct, an animated one is not.
60
69
  */
61
70
  export declare function usePrefersReducedMotion(): boolean;
71
+ /**
72
+ * §7.1 rule 12 — `document.visibilityState`, as a subscription.
73
+ *
74
+ * A one-shot read at mount would be the wrong answer for the whole of the
75
+ * rest of the visit, and the visit is where this matters: the shopper taps
76
+ * the pill and then locks the phone. Both edges are reported, because both
77
+ * change what the dock is allowed to do — hidden means "apply the end state,
78
+ * animate nothing", visible means "a stalled transition, if there is one, has
79
+ * to be finalised now".
80
+ */
81
+ export declare function useDocumentHidden(): boolean;
82
+ /**
83
+ * "Motion is off." §7.1 rule 10 and rule 12 in ONE read, because a surface
84
+ * that has to remember two of them will eventually remember one.
85
+ *
86
+ * `prefers-reduced-motion` is a preference and a hidden tab is a fact, but
87
+ * they ask the dock for the same thing: skip the animation, apply the end
88
+ * state now. Every duration in {@link useDockDurations} collapses to 0, the
89
+ * FLIP does not start, and the caption swaps in place.
90
+ */
91
+ export declare function useMotionOff(): boolean;
62
92
  /**
63
93
  * §7.1 rule 5 — a per-frame custom-property writer.
64
94
  *
@@ -98,8 +128,19 @@ export declare function useCssVars(ref: RefObject<HTMLElement | null>): (name: s
98
128
  * the timer left the listener attached and `will-change` set on a node that
99
129
  * no longer renders, so the layer survived the component and the closure
100
130
  * survived with it.
131
+ *
132
+ * ## Why the promotion is not the only thing this arms (§7.1 rule 12)
133
+ *
134
+ * The `transitionend` this waits for never arrives in a hidden tab, and a
135
+ * sheet whose reveal was interrupted by a lock screen is not merely a layer
136
+ * left promoted — it is a `visibility: hidden` box that the shopper cannot
137
+ * see or reach. `arm(endState)` therefore hands the whole finalisation to
138
+ * `motion-gate.ts`: the fallback timer, the `visibilitychange` edge, and the
139
+ * explicit end state the surface passes in. Armed while the tab is already
140
+ * hidden (or with a zeroed duration), it promotes nothing at all and applies
141
+ * that end state synchronously — there is no animation to give a layer to.
101
142
  */
102
- export declare function useTransientWillChange(ref: RefObject<HTMLElement | null>, properties?: string, ms?: number): () => void;
143
+ export declare function useTransientWillChange(ref: RefObject<HTMLElement | null>, properties?: string, ms?: number): (endState?: MotionEndState) => void;
103
144
  /** A box, as the FLIP needs it. Deliberately not a `DOMRect` — the arithmetic is testable without one. */
104
145
  export interface FlipBox {
105
146
  readonly x: number;
@@ -123,6 +164,63 @@ export interface FlipBox {
123
164
  export declare function flipTransform(from: FlipBox, to: FlipBox): string;
124
165
  /** §7.2's waveform smoothing — the same 0.25 lerp the analyser feeds. */
125
166
  export declare function lerp(current: number, target: number, factor?: number): number;
167
+ /**
168
+ * §7.2's two forms at rest, as the inline properties a §7.1 rule 12
169
+ * finalisation writes.
170
+ *
171
+ * These MIRROR `.wgt-row[data-form='pill']` and `.wgt-pill[data-form='row']`
172
+ * in `styles/concierge.css` — the cascade is still what draws the dock, and
173
+ * this table is only ever written for the one frame in which a stalled
174
+ * transition is being cancelled. `dock-motion.test.ts` reads the stylesheet
175
+ * and asserts the two agree, because a divergence here is invisible until a
176
+ * shopper locks their phone mid-swap and comes back to a dock in the wrong
177
+ * shape.
178
+ */
179
+ export declare const FORM_END_STATE: {
180
+ /** Either form, showing. The base rule for both boxes. */
181
+ readonly shown: {
182
+ readonly visibility: 'visible';
183
+ readonly opacity: '1';
184
+ readonly transform: 'none';
185
+ };
186
+ /** `.wgt-pill[data-form='row']`. */
187
+ readonly pillHidden: {
188
+ readonly visibility: 'hidden';
189
+ readonly opacity: '0';
190
+ readonly transform: 'scale(0.92)';
191
+ };
192
+ /** `.wgt-row[data-form='pill']`. */
193
+ readonly rowHidden: {
194
+ readonly visibility: 'hidden';
195
+ readonly opacity: '0';
196
+ readonly transform: 'scale(0.98)';
197
+ };
198
+ };
199
+ /**
200
+ * §3.3's sheet at each end of its reveal, as the inline properties a §7.1
201
+ * rule 12 finalisation writes.
202
+ *
203
+ * Mirrors `.wgt-sheet` and `.wgt-sheet[data-snap='closed']` in
204
+ * `styles/concierge.css`, and `dock-motion.test.ts` asserts they agree. The
205
+ * open state keeps `transform` expressed through `--wgt-sheet-y` rather than
206
+ * as a resolved `translateY(0px)`: the drag writes that custom property once
207
+ * per frame (§7.1 rule 5), and a finaliser that resolved it would pin the
208
+ * sheet to wherever the last gesture left it.
209
+ */
210
+ export declare const SHEET_END_STATE: {
211
+ readonly open: {
212
+ readonly visibility: 'visible';
213
+ readonly opacity: '1';
214
+ readonly 'clip-path': 'inset(0 0 0 0)';
215
+ readonly transform: 'translateY(var(--wgt-sheet-y, 0px))';
216
+ };
217
+ readonly closed: {
218
+ readonly visibility: 'hidden';
219
+ readonly opacity: '0';
220
+ readonly 'clip-path': 'inset(100% 0 0 0)';
221
+ readonly transform: 'translateY(8px)';
222
+ };
223
+ };
126
224
  /**
127
225
  * The pill ↔ row swap (§7.2), driven by whichever box is showing.
128
226
  *
@@ -132,14 +230,26 @@ export declare function lerp(current: number, target: number, factor?: number):
132
230
  * the change puts the incoming one back where the outgoing one was and
133
231
  * releases it. One layout read, one style write, no host reflow.
134
232
  *
135
- * Under reduced motion it does nothing at all: §7.1 rule 10, and the state is
136
- * always also in text (the live region), so nothing is lost.
233
+ * Under reduced motion, or in a hidden tab, it does nothing at all but write
234
+ * both end states: §7.1 rules 10 and 12, and the state is always also in text
235
+ * (the live region), so nothing is lost. `motionOff` is the caller's single
236
+ * read of both (see {@link useMotionOff}).
237
+ *
238
+ * ## The FLIP is not the only thing being finalised here
239
+ *
240
+ * The WAAPI animation below is the cross-fade's TRAVEL. The cross-fade
241
+ * itself — `opacity`, `transform`, and the `visibility` that takes the
242
+ * outgoing form out of the tab order — is a CSS transition on both elements,
243
+ * driven by `data-form`, and it is the one that froze on production: a hidden
244
+ * tab left `.wgt-row` at `opacity: 0.6`, `visibility: hidden` with the pill
245
+ * hidden too, so there was nothing on screen to tap. Each form therefore gets
246
+ * its own finaliser, with its own end state, on every swap.
137
247
  */
138
- export declare function useFormFlip(pillRef: RefObject<HTMLElement | null>, rowRef: RefObject<HTMLElement | null>, form: 'pill' | 'row', reducedMotion: boolean, durationMs?: number): void;
248
+ export declare function useFormFlip(pillRef: RefObject<HTMLElement | null>, rowRef: RefObject<HTMLElement | null>, form: 'pill' | 'row', motionOff: boolean, durationMs?: number): void;
139
249
  /**
140
- * The durations every dock surface reads, already collapsed for reduced
141
- * motion. One object so a component never writes `reduced ? 0 : 240` itself
142
- * and never forgets the `reduced` half.
250
+ * The durations every dock surface reads, already collapsed for the two cases
251
+ * where there is no animation. One object so a component never writes
252
+ * `off ? 0 : 240` itself and never forgets the `off` half.
143
253
  */
144
254
  export interface DockDurations {
145
255
  readonly swap: number;
@@ -151,5 +261,10 @@ export interface DockDurations {
151
261
  readonly border: number;
152
262
  readonly control: number;
153
263
  }
154
- export declare function useDockDurations(reducedMotion: boolean): DockDurations;
264
+ /**
265
+ * @param motionOff §7.1 rule 10 (`prefers-reduced-motion`) OR rule 12 (the
266
+ * tab is hidden and the browser will not advance a transition in it). See
267
+ * {@link useMotionOff}, which is how every caller reads both at once.
268
+ */
269
+ export declare function useDockDurations(motionOff: boolean): DockDurations;
155
270
  //# sourceMappingURL=dock-motion.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dock-motion.d.ts","sourceRoot":"","sources":["../../src/dock/dock-motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAqD,K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Q,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,6EAA6E;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,0FAA0F;IAC1F,QAAQ,CAAC,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAEzC,4EAA4E;IAC5E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,QAAQ,CAAC,YAAY,CAAC,EAAE,UAAU,GAAG,KAAK,GAAG,IAAI,CAAC;IAClD,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,MAAM,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;IACrD,QAAQ,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACxD,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,OAAO,EAAE,YAAY,CAAA;KAAE,CAAC;IAC3C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAUD,qEAAqE;AACrE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AACvC,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AAEpE,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,+BA+xCpC;AAqJD,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -0,0 +1,123 @@
1
+ /**
2
+ * TRANSITIONS THAT FINALISE WITHOUT `transitionend` — docs/DOCK_SPEC.md §7.1
3
+ * rule 12.
4
+ *
5
+ * ## The defect this module exists for
6
+ *
7
+ * Observed on production (widget 0.6.0, a tenant's demo storefront): a
8
+ * shopper taps the pill, the pill → row swap starts, and the shopper switches
9
+ * apps or locks the screen a frame later. The tab becomes
10
+ * `document.visibilityState === 'hidden'`, and a hidden tab does not advance
11
+ * CSS transitions — so `transitionend` never fires, and every piece of
12
+ * bookkeeping gated on it never runs. The dock was found frozen mid-swap:
13
+ * `.wgt-row` at `transform: matrix(0.339, 0, 0, 0.935, …)`, `opacity: 0.6`,
14
+ * `visibility: hidden`, and `.wgt-pill` `visibility: hidden` too. Nothing was
15
+ * visible, and nothing was tappable, until the tab was rendered again.
16
+ *
17
+ * `visibility` is what turns a stalled animation into a dead widget. It rides
18
+ * in the dock's transition lists on purpose (see `styles/concierge.css` and
19
+ * "The two paint properties the motion guard allows" in
20
+ * `packages/web-widget/AGENTS.md`), and a transition frozen between its two
21
+ * ends can leave BOTH forms hidden. Browsers usually complete a transition
22
+ * when the tab comes back; "usually" is not a guarantee a storefront can be
23
+ * shipped on, and the core dock (plain DOM, `cdn/dock-dom.ts`) carries the
24
+ * same hazard.
25
+ *
26
+ * ## The three rules, and why each one is needed on its own
27
+ *
28
+ * 1. **A fallback timer.** Every transition-gated finalisation also runs from
29
+ * a `setTimeout` of `duration + {@link TRANSITION_FALLBACK_MS}`. Whichever
30
+ * of `transitionend` and the timer arrives first wins; the other is a
31
+ * no-op. A timer in a throttled tab is late, not absent, which is exactly
32
+ * the difference that matters.
33
+ * 2. **Do not start what cannot run.** A transition that would START while
34
+ * the tab is hidden (or under `prefers-reduced-motion`) is skipped and its
35
+ * end state applied synchronously. §7.1 rule 10 already collapses every
36
+ * duration to 0 for reduced motion; a hidden tab takes the same road.
37
+ * 3. **Finalise on `visibilitychange`.** Belt and braces for a browser that
38
+ * neither advances the transition while hidden nor completes it on
39
+ * resume — the finaliser runs the moment the visibility flips, before the
40
+ * shopper has looked at the result.
41
+ *
42
+ * ## The end state is WRITTEN, never inferred from the transition
43
+ *
44
+ * {@link finaliseTransition} writes `visibility`, `transform`, `opacity` (and
45
+ * the sheet's `clip-path`) as inline properties, behind a one-frame
46
+ * `transition: none`, and then takes the override back off. The `none` is
47
+ * what CANCELS a transition the engine has frozen mid-flight — dropping a
48
+ * property out of `transition-property` ends its running transition — and
49
+ * removing the inline values a frame later hands the element back to the
50
+ * cascade, so the NEXT swap animates normally. Writing the value without the
51
+ * `none` would leave the frozen interpolation running on top of it, which is
52
+ * the bug rather than the fix.
53
+ *
54
+ * Nothing here imports React, and nothing here is React-shaped: `core` is
55
+ * downloaded by every visitor to every merchant page and cannot afford a
56
+ * framework, and both renderers have to agree about when motion is off.
57
+ */
58
+ /**
59
+ * How long after a transition's stated duration its fallback finaliser fires.
60
+ *
61
+ * Long enough that a transition which is merely LATE — a loaded main thread,
62
+ * a throttled timer queue — still gets to end itself and fire the event,
63
+ * short enough that a shopper returning to a stalled dock does not wait for
64
+ * it. The finaliser is idempotent, so the cost of firing it after a
65
+ * transition that already ended is one no-op call.
66
+ */
67
+ export declare const TRANSITION_FALLBACK_MS = 100;
68
+ /**
69
+ * "The browser is not painting this document."
70
+ *
71
+ * An absent `document` (SSR, a worker) is NOT hidden: the caller is asking
72
+ * whether to skip an animation, and there is no animation to skip. Tolerant
73
+ * of a partial `document` stub, which is what an embedded webview can hand a
74
+ * widget that has no say in where it is loaded.
75
+ */
76
+ export declare function isDocumentHidden(doc?: Document | null): boolean;
77
+ /**
78
+ * The inline properties a finaliser writes, as CSS property names — so
79
+ * `clip-path`, not `clipPath`. Written through `style.setProperty`, which
80
+ * takes the CSS spelling and also accepts custom properties.
81
+ */
82
+ export type MotionEndState = Readonly<Record<string, string>>;
83
+ export interface TransitionFinaliser {
84
+ /**
85
+ * Run the finalisation now, if it has not run already. Idempotent: the
86
+ * first of `transitionend`, the fallback timer, a `visibilitychange` and an
87
+ * explicit call wins, and every later one is a no-op.
88
+ */
89
+ finish(): void;
90
+ /**
91
+ * Stop waiting WITHOUT finalising — an unmount, or a swap that supersedes
92
+ * this one. Any inline override still outstanding is released synchronously
93
+ * so nothing is left pinned on an element this finaliser no longer owns.
94
+ */
95
+ cancel(): void;
96
+ /** `true` once `finish()` or `cancel()` has run. */
97
+ readonly settled: boolean;
98
+ }
99
+ export interface FinaliseTransitionOptions {
100
+ /** The element whose OWN transition this is. A descendant's is ignored. */
101
+ readonly el: HTMLElement;
102
+ /** The transition's stated duration. `0` (reduced motion) finalises at once. */
103
+ readonly durationMs: number;
104
+ /** What the element must look like when the transition is over. */
105
+ readonly endState?: MotionEndState;
106
+ /** Surface-specific work: clearing `will-change`, finishing a WAAPI animation. */
107
+ readonly onFinalise?: () => void;
108
+ /** Defaults to the element's own document. */
109
+ readonly doc?: Document | null;
110
+ /** Skip the wait outright — the caller already knows the animation cannot run. */
111
+ readonly immediate?: boolean;
112
+ }
113
+ /**
114
+ * Guarantees that one transition's end state lands, whether or not the
115
+ * browser ever fires `transitionend` for it.
116
+ *
117
+ * @returns a handle whose `finish()`/`cancel()` are both idempotent. Callers
118
+ * that can be superseded (a swap interrupting a swap) `cancel()` the previous
119
+ * handle before opening a new one; callers that unmount `cancel()` in their
120
+ * effect cleanup.
121
+ */
122
+ export declare function finaliseTransition(options: FinaliseTransitionOptions): TransitionFinaliser;
123
+ //# sourceMappingURL=motion-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion-gate.d.ts","sourceRoot":"","sources":["../../src/dock/motion-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,IAAI,GAAG,OAAO,CAG/D;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,MAAM,IAAI,IAAI,CAAC;IACf;;;;OAIG;IACH,MAAM,IAAI,IAAI,CAAC;IACf,oDAAoD;IACpD,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,yBAAyB;IACxC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,QAAQ,CAAC,QAAQ,CAAC,EAAE,cAAc,CAAC;IACnC,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC,8CAA8C;IAC9C,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,mBAAmB,CA4G1F"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as SHEET_PEEK_MAX, A as Dock, At as srgbToLinear, B as DESKTOP_GUTTER, C as IDLE_SNAPSHOT, Ct as oklabToLinearRgb, D as SessionLog, Dt as parseHex, E as SESSION_EVENTS, Et as oklchToOklab, F as ACTIVITY_W, Ft as widgetMessagesFromCopy, G as PILL_H, H as DOCK_MINIMISED_STORAGE_KEY, I as BOTTOM_FLOOR, J as RADII, K as PILL_MARK, L as CONTROL, M as deriveDockState, Mt as defaultWidgetMessages, N as idleDockInput, Nt as formatMessage, O as formatMs, Ot as relativeLuminance, P as formatMoney, Pt as resolveWidgetMessages, Q as SHEET_GAP, R as DESKTOP_BOTTOM, S as parseBlocks, St as oklabToHex, T as SseFrameParser, Tt as oklchToHex, U as MARK, V as DESKTOP_WIDTHS, W as MOBILE_MARGIN, X as SHEET_EXPANDED_DESKTOP_MAX, Y as ROW_H, Z as SHEET_EXPANDED_VH, _ as readsAsCheckoutIntent, _t as hexToOklab, a as mergeAddedCartLine, at as pillAnchor, b as WidgetCardList, bt as linearToSrgb, c as toChatCart, ct as CARD_RADIUS_MAX_PX, d as useVoiceSession, dt as WIDGET_THEME_TOKENS, et as SHEET_TOP_CLEARANCE, f as useChatSession, ft as deriveTheme, g as readsAsCartViewIntent, gt as formatHex, h as basketIntentFromTurns, ht as contrastRatio, i as deriveCallPhase, it as geometryVars, j as DOCK_STATES, jt as withAlpha, k as latencyBetween, kt as rotateHue, l as ROOM_EVENTS, lt as SHEET_RADIUS_MAX_PX, m as VoiceWidget, mt as themeToInlineStyle, n as MAX_REPORTED_CART_LINES, nt as Z_INDEX, o as resolveAddToCartHandler, ot as rowWidthLen, pt as themeToCss, q as PROACTIVE_NUDGE_MS, r as cartLinesFromSnapshot, rt as bottomLen, s as resolveCheckoutUrl, st as sheetMaxHeightLen, t as ConciergeWidget, tt as SHORT_VIEWPORT, u as createWidgetVoiceTokenFetcher, ut as SYSTEM_FONT_STACK, v as textDirectionFor, vt as hexToOklch, w as botStateFor, wt as oklabToOklch, x as WidgetMarkdown, xt as mixToward, y as WidgetCartSummary, yt as linearRgbToOklab, z as DESKTOP_BREAKPOINT } from "./chunks/host-widget-C0XT9lHX.js";
1
+ import { $ as SHEET_PEEK_MAX, A as Dock, At as srgbToLinear, B as DESKTOP_GUTTER, C as IDLE_SNAPSHOT, Ct as oklabToLinearRgb, D as SessionLog, Dt as parseHex, E as SESSION_EVENTS, Et as oklchToOklab, F as ACTIVITY_W, Ft as widgetMessagesFromCopy, G as PILL_H, H as DOCK_MINIMISED_STORAGE_KEY, I as BOTTOM_FLOOR, J as RADII, K as PILL_MARK, L as CONTROL, M as deriveDockState, Mt as defaultWidgetMessages, N as idleDockInput, Nt as formatMessage, O as formatMs, Ot as relativeLuminance, P as formatMoney, Pt as resolveWidgetMessages, Q as SHEET_GAP, R as DESKTOP_BOTTOM, S as parseBlocks, St as oklabToHex, T as SseFrameParser, Tt as oklchToHex, U as MARK, V as DESKTOP_WIDTHS, W as MOBILE_MARGIN, X as SHEET_EXPANDED_DESKTOP_MAX, Y as ROW_H, Z as SHEET_EXPANDED_VH, _ as readsAsCheckoutIntent, _t as hexToOklab, a as mergeAddedCartLine, at as pillAnchor, b as WidgetCardList, bt as linearToSrgb, c as toChatCart, ct as CARD_RADIUS_MAX_PX, d as useVoiceSession, dt as WIDGET_THEME_TOKENS, et as SHEET_TOP_CLEARANCE, f as useChatSession, ft as deriveTheme, g as readsAsCartViewIntent, gt as formatHex, h as basketIntentFromTurns, ht as contrastRatio, i as deriveCallPhase, it as geometryVars, j as DOCK_STATES, jt as withAlpha, k as latencyBetween, kt as rotateHue, l as ROOM_EVENTS, lt as SHEET_RADIUS_MAX_PX, m as VoiceWidget, mt as themeToInlineStyle, n as MAX_REPORTED_CART_LINES, nt as Z_INDEX, o as resolveAddToCartHandler, ot as rowWidthLen, pt as themeToCss, q as PROACTIVE_NUDGE_MS, r as cartLinesFromSnapshot, rt as bottomLen, s as resolveCheckoutUrl, st as sheetMaxHeightLen, t as ConciergeWidget, tt as SHORT_VIEWPORT, u as createWidgetVoiceTokenFetcher, ut as SYSTEM_FONT_STACK, v as textDirectionFor, vt as hexToOklch, w as botStateFor, wt as oklabToOklch, x as WidgetMarkdown, xt as mixToward, y as WidgetCartSummary, yt as linearRgbToOklab, z as DESKTOP_BREAKPOINT } from "./chunks/host-widget-CAPud_Jz.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Component, createElement, useEffect, useId, useRef, useState } from "react";
4
4
  import { createRoot } from "react-dom/client";
@@ -1,4 +1,4 @@
1
- import { p as detectPage, t as ConciergeWidget } from "../chunks/host-widget-C0XT9lHX.js";
1
+ import { p as detectPage, t as ConciergeWidget } from "../chunks/host-widget-CAPud_Jz.js";
2
2
  import { useCallback, useEffect, useMemo, useRef } from "react";
3
3
  import { usePathname, useRouter } from "next/navigation";
4
4
  //#region src/next/use-next-bridge.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saar-ai/web-widget",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "saar:distribution": "publishable",
5
5
  "description": "The concierge widget's React UI — ConciergeShell chrome plus the full end-user conversation (VoiceWidget, useChatSession, useVoiceSession) — de-Nexted for the merchant-site embed (docs/WIDGET_EMBED_PLAN.md §4 Phase 3). Publishes PUBLICLY to npmjs (docs/WIDGET_EMBED_PLAN.md §5.1) — every workspace and third-party runtime dependency is bundled into dist/ at build time, so \"dependencies\" is empty. React and react-dom are peer dependencies only; next is an optional peer, needed only by the ./next subpath (Phase 5).",
6
6
  "type": "module",