@jsenv/navi 0.29.326 → 0.29.328

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.
@@ -7071,6 +7071,16 @@ const positionCallout = (
7071
7071
  }
7072
7072
  return;
7073
7073
  }
7074
+ if (!calloutElement.isConnected) {
7075
+ // The callout is drawn inside the anchor's subtree (calloutContainer),
7076
+ // so it leaves the document with it — a Suspense boundary parking
7077
+ // the screen while an action re-runs keeps the subtree mounted, refs
7078
+ // intact, but detached. showPopover() throws on a detached element,
7079
+ // and leaving the document already took it out of the top layer, so
7080
+ // there is nothing to hide either: same as ancestorClosed, wait for
7081
+ // the next check, which shows it again once the subtree is back.
7082
+ return;
7083
+ }
7074
7084
  if (!calloutElement.matches(":popover-open")) {
7075
7085
  if (debug) {
7076
7086
  debug(event, "showing callout because anchor is visible again");
@@ -10908,9 +10918,11 @@ const swipeTypeOf = (axis, pulled) => {
10908
10918
  * copy is captured where it lands rather than where it was let go of.
10909
10919
  *
10910
10920
  * And the promise matters in both cases: the gesture holds its copy until the
10911
- * answer settles. Returning the transition is what makes a landing continuous; a
10912
- * `toss` that rejects brings the copy back, because the thing still exists and the
10913
- * screen has to say so.
10921
+ * answer settles. Returning the transition is what makes a landing continuous;
10922
+ * rejecting brings the copy back over the original, because the thing still
10923
+ * exists and the screen has to say so. That holds for every outcome that carries
10924
+ * a copy — `land` and `reorder` as much as `toss` and `leave` — so a place can be
10925
+ * asked about rather than taken: refuse, and the board is as it was.
10914
10926
  *
10915
10927
  * Starting a document transition is the application's call and not navi's: a
10916
10928
  * `view-transition-name` must be unique per document, so only the application can
@@ -26436,20 +26448,28 @@ const setupBrowserIntegrationViaHistory = ({
26436
26448
  // traversal to another document is a full page load, which no press on a
26437
26449
  // link asked for — the entries that are ours are recorded as they are
26438
26450
  // created, starting with the one this document was loaded into.
26451
+ //
26452
+ // The presence of window.navigation says nothing about the entry: the spec
26453
+ // makes currentEntry null in a document that is not fully active, and iOS
26454
+ // Safari answers null in a document that plainly is (a booted app, minutes
26455
+ // into a session). Nothing can be done about it; an entry that cannot be
26456
+ // read is treated as a browser without the API, which only costs the
26457
+ // adjacency.
26439
26458
  const sameDocumentEntryKeys = new Set();
26440
26459
  const rememberEntryIsOfThisDocument = () => {
26441
- if (window.navigation) {
26442
- sameDocumentEntryKeys.add(window.navigation.currentEntry.key);
26460
+ const currentEntry = window.navigation?.currentEntry;
26461
+ if (currentEntry) {
26462
+ sameDocumentEntryKeys.add(currentEntry.key);
26443
26463
  }
26444
26464
  };
26445
26465
  rememberEntryIsOfThisDocument();
26446
26466
  const adjacentEntryDelta = (url) => {
26447
- const { navigation } = window;
26448
- if (!navigation) {
26467
+ const currentEntry = window.navigation?.currentEntry;
26468
+ if (!currentEntry) {
26449
26469
  return 0;
26450
26470
  }
26451
- const entries = navigation.entries();
26452
- const index = navigation.currentEntry.index;
26471
+ const entries = window.navigation.entries();
26472
+ const index = currentEntry.index;
26453
26473
  // Behind first: when the same page stands on both sides (A, B, A and one
26454
26474
  // is on B), a link to it reads as going back.
26455
26475
  for (const delta of [-1, 1]) {