@jsenv/navi 0.29.71 → 0.29.73

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.
@@ -38824,6 +38824,21 @@ const css$T = /* css */`
38824
38824
  view-transition-name: navi-route-transition;
38825
38825
  }
38826
38826
 
38827
+ /* A named descendant — a row named for a reorder gesture, a thumbnail named
38828
+ for a morph — is a hole in the area's picture and a group of its own at the
38829
+ top of the tree: it stands still and cross-fades on its own clock while the
38830
+ pages move. Nested groups put it back INSIDE the area's picture, so it
38831
+ travels with the pages and is cut at their edge. Said here rather than
38832
+ erasing the name: a name inside the area is legitimate, and "contain" says
38833
+ "these move with the page" where "none" would say "these do not exist". A
38834
+ browser without nested groups is warned instead (see
38835
+ warnAboutNamesEscapingArea). */
38836
+ @supports (view-transition-group: contain) {
38837
+ [data-navi-route-transition-area] {
38838
+ view-transition-group: contain;
38839
+ }
38840
+ }
38841
+
38827
38842
  /* Only while a transition of OURS is playing: everything below changes how
38828
38843
  the document animates, and the document belongs to the application the
38829
38844
  rest of the time. */
@@ -38861,6 +38876,12 @@ const css$T = /* css */`
38861
38876
  overflow on any element of the document can reach them. */
38862
38877
  overflow: clip;
38863
38878
  }
38879
+ /* The nested groups of named descendants, cut at that same edge. On its own
38880
+ rule: a selector a browser cannot parse takes the whole list it is
38881
+ written in down with it, and the pages must be cut everywhere. */
38882
+ &::view-transition-group-children(navi-route-transition) {
38883
+ overflow: clip;
38884
+ }
38864
38885
  &::view-transition-group(navi-route-transition) {
38865
38886
  /* Held still for the whole transition, at the taller of the two states,
38866
38887
  and standing where the area stands (see transition_window.js). Held by
@@ -39645,7 +39666,7 @@ const beginTransition = ({
39645
39666
  // something that has already happened.
39646
39667
  const renderWait = armRouteRenderWait$1();
39647
39668
  // What the browser ACTUALLY captured, read once the pictures exist: it is
39648
- // the only place the two silent misconfigurations show. Both are about the
39669
+ // the only place the silent misconfigurations show. They are all about the
39649
39670
  // same thing — a movement playing on pictures that are not the pages.
39650
39671
  const viewTransitionReady = () => {
39651
39672
  const capturedNames = capturedViewTransitionNames();
@@ -39653,6 +39674,7 @@ const beginTransition = ({
39653
39674
  if (!capturedNames.has(AREA_NAME)) {
39654
39675
  warnOnce("area-not-captured", `The element marked ${TRANSITION_AREA_ATTRIBUTE} was not captured, so the movement plays on nothing. An element is captured only if it generates a box: \`display: contents\` (or an element not rendered) cannot be the area — its rectangle is what gets photographed and clipped.`);
39655
39676
  }
39677
+ warnAboutNamesEscapingArea(areaElement, capturedNames);
39656
39678
  return;
39657
39679
  }
39658
39680
  for (const name of capturedNames) {
@@ -39738,6 +39760,42 @@ const capturedViewTransitionNames = () => {
39738
39760
  return names;
39739
39761
  };
39740
39762
 
39763
+ // Nested groups keep a name written inside the area inside its picture (see
39764
+ // the @supports block in the CSS above). Without them the name escapes to the
39765
+ // top of the ::view-transition tree and the element it belongs to stands still,
39766
+ // fading on its own, while the pages move under it.
39767
+ const NESTED_GROUPS_SUPPORTED = window.CSS.supports("view-transition-group", "contain");
39768
+ const warnAboutNamesEscapingArea = (areaElement, capturedNames) => {
39769
+ if (NESTED_GROUPS_SUPPORTED) {
39770
+ return;
39771
+ }
39772
+ let escapedName = null;
39773
+ for (const name of capturedNames) {
39774
+ if (name === "root" || name === AREA_NAME) {
39775
+ continue;
39776
+ }
39777
+ escapedName = name;
39778
+ break;
39779
+ }
39780
+ // A name captured next to the area is not necessarily inside it — a bar the
39781
+ // application animates on the same clock is named on purpose. The subtree is
39782
+ // walked only once something is there to find, so the common case reads
39783
+ // nothing.
39784
+ if (!escapedName) {
39785
+ return;
39786
+ }
39787
+ for (const descendant of areaElement.querySelectorAll("*")) {
39788
+ const {
39789
+ viewTransitionName
39790
+ } = getComputedStyle(descendant);
39791
+ if (!viewTransitionName || viewTransitionName === "none") {
39792
+ continue;
39793
+ }
39794
+ warnOnce("names-escaping-area", `"${viewTransitionName}" is a view-transition-name written inside the element marked ${TRANSITION_AREA_ATTRIBUTE}, and this browser has no nested groups (view-transition-group: contain): the element it names is lifted out of the area's picture, so it stands still and fades on its own while the pages move. Give that name only for the length of the gesture it serves, or drop it while a route transition plays (:root[${TRANSITION_ATTRIBUTE}] { view-transition-name: none }).`);
39795
+ return;
39796
+ }
39797
+ };
39798
+
39741
39799
  // Said once per kind, whatever the number of navigations: a misconfiguration
39742
39800
  // is one fact about the application, and repeating it every time the user
39743
39801
  // moves would bury it.
@@ -52008,7 +52066,14 @@ const SlideContainer = ({
52008
52066
  // Where the track ends up, always — the animation below only covers the way
52009
52067
  // there, and when it is over this is what holds.
52010
52068
  track.style.setProperty("--slide-container-offset", offset);
52011
- const travels = !noTravel && durationMs > 0 && offsetBefore !== undefined && offsetBefore !== offset;
52069
+ // A travel to this very offset is already playing: left to play. Same
52070
+ // courtesy as the stage above — a re-render in the middle of a travel (a
52071
+ // signal read higher up answering) changes nothing here, and setting off
52072
+ // again from the on-screen position would replay what is left over a full
52073
+ // duration (the ask is zero, so ratioOfOneTravel answers 1), slowing the
52074
+ // travel at every re-render.
52075
+ const sameTravelPlaying = travelInFlight && !offsetDragged && offsetTargetBefore === offset;
52076
+ const travels = !sameTravelPlaying && !noTravel && durationMs > 0 && offsetBefore !== undefined && offsetBefore !== offset;
52012
52077
  if (travels) {
52013
52078
  // The time it takes is the distance it has left to cover: a travel picked
52014
52079
  // up a fifth of the way through goes back in a fifth of the time, so what