@jsenv/navi 0.29.317 → 0.29.318

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.
@@ -64504,20 +64504,33 @@ const PickerCalloutPopup = ({
64504
64504
  onnavi_request_confirm?.(e);
64505
64505
  };
64506
64506
  calloutElement.addEventListener("navi_request_confirm", forwardConfirm);
64507
+ // Said once the content is in the shown callout: what the content defers
64508
+ // until it is displayed (useDisplayedLayoutEffect, watching this attribute)
64509
+ // then measures it where it is drawn. Same call stack as the open, like
64510
+ // Popover's own — see observeAncestorOpenState in @jsenv/dom.
64511
+ dock.setAttribute("aria-expanded", "true");
64507
64512
  return closeEvent => {
64508
64513
  calloutElement.removeEventListener("navi_request_confirm", forwardConfirm);
64509
64514
  calloutManager.removeOpenToken(PICKER_CALLOUT_CONTENT_TOKEN, closeEvent);
64510
64515
  dock.appendChild(host);
64516
+ dock.setAttribute("aria-expanded", "false");
64511
64517
  };
64512
64518
  };
64513
64519
  return (
64514
64520
  // What the picker addresses (aria-controls, the request events it
64515
64521
  // forwards); the callout itself lives where the callout manager puts it.
64522
+ // aria-expanded here, on the dock rather than on the content element: the
64523
+ // openable ancestor the content finds at mount (the only time it looks),
64524
+ // and one that is no ancestor of the content once the callout holds it —
64525
+ // so a --navi-close said in there still resolves to the callout element,
64526
+ // the closest [aria-expanded] from the button. The open effect keeps it
64527
+ // current; preact leaves it alone, the prop never changes.
64516
64528
  jsx(Box, {
64517
64529
  as: "span",
64518
64530
  ref: ref,
64519
64531
  id: id,
64520
64532
  className: "navi_picker_callout_dock",
64533
+ "aria-expanded": "false",
64521
64534
  style: {
64522
64535
  display: "contents"
64523
64536
  },
@@ -67382,27 +67395,39 @@ const useListScrollSync = ({
67382
67395
  });
67383
67396
  const renderWindowRef = useRef(null);
67384
67397
  renderWindowRef.current = renderWindow;
67385
- // A budget that changes (the first paint's giving way to the scrolling one)
67386
- // re-frames the window where it stands, in this very render — the way
67387
- // holdWindow below moves it: nothing else would, the scroll listener only
67388
- // moves a window the user is about to leave.
67389
- const renderBudgetRef = useRef(renderBudget);
67390
- if (renderBudgetRef.current !== renderBudget) {
67391
- renderBudgetRef.current = renderBudget;
67398
+ // The window is as wide as the budget says, whatever the state holds: a
67399
+ // budget that changes (the first paint's giving way to the scrolling one)
67400
+ // re-frames the window where it stands, in the render itself, the way
67401
+ // holdWindow below moves it — nothing else would, the scroll listener only
67402
+ // moves a window the user is about to leave. Derived on every render and
67403
+ // not written once: the state keeps the width it had, and the next render
67404
+ // copies it back into the ref above. The same object is handed out for as
67405
+ // long as the numbers hold, so the rows are not told about a window that
67406
+ // did not move.
67407
+ const framedWindowRef = useRef(null);
67408
+ {
67392
67409
  const {
67393
- start
67410
+ start,
67411
+ end
67394
67412
  } = renderWindowRef.current;
67395
67413
  const total = virtual.totalSignal.peek();
67396
- let newStart = start;
67397
- let newEnd = start + renderBudget;
67398
- if (total > 0 && newEnd > total) {
67399
- newEnd = total;
67400
- newStart = total - renderBudget < 0 ? 0 : total - renderBudget;
67414
+ let framedStart = start;
67415
+ let framedEnd = start + renderBudget;
67416
+ if (total > 0 && framedEnd > total) {
67417
+ framedEnd = total;
67418
+ framedStart = total - renderBudget < 0 ? 0 : total - renderBudget;
67419
+ }
67420
+ if (framedStart !== start || framedEnd !== end) {
67421
+ const framed = framedWindowRef.current;
67422
+ if (framed && framed.start === framedStart && framed.end === framedEnd) {
67423
+ renderWindowRef.current = framed;
67424
+ } else {
67425
+ framedWindowRef.current = renderWindowRef.current = {
67426
+ start: framedStart,
67427
+ end: framedEnd
67428
+ };
67429
+ }
67401
67430
  }
67402
- renderWindowRef.current = {
67403
- start: newStart,
67404
- end: newEnd
67405
- };
67406
67431
  }
67407
67432
  const updateRenderWindow = (newStart, newEnd, reason) => {
67408
67433
  const {