@jsenv/navi 0.29.137 → 0.29.138

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.
@@ -27070,10 +27070,10 @@ const releaseTransitionDestination = (owner) => {
27070
27070
  };
27071
27071
 
27072
27072
  /**
27073
- * The furniture around the pages — the fixed bars — photographed with them for
27074
- * the length of a route transition, so that a piece of it belonging to ONE of
27075
- * the two states takes part in the movement instead of appearing or vanishing
27076
- * in a frame.
27073
+ * The furniture around the pages — the fixed bars, and the popups standing
27074
+ * over them in the top layer — photographed with them for the length of a
27075
+ * route transition, so that a piece of it belonging to ONE of the two states
27076
+ * takes part in the movement instead of appearing or vanishing in a frame.
27077
27077
  *
27078
27078
  * Whether a bar is the frame or part of what changes is a fact about the PAIR
27079
27079
  * of states, never about the bar: the top bar of a list is the frame while one
@@ -27088,7 +27088,15 @@ const releaseTransitionDestination = (owner) => {
27088
27088
  * that has it, so it travels with that page — leaving by the keyframes the
27089
27089
  * page being left leaves by, arriving by the ones the page arriving arrives
27090
27090
  * by — instead of going out with the render. Under the pages, so a page
27091
- * coming over it covers it (see the z-order in route_transition.jsx).
27091
+ * coming over it covers it — a popup over them instead, standing where it
27092
+ * stands in the document (see the z-order in route_transition.jsx).
27093
+ *
27094
+ * A popup shown in the top layer is furniture of the same kind, and its case
27095
+ * is the sharper one: it is a DOM descendant of the area, yet painted outside
27096
+ * the area's picture, so being captured on its own is the only way it is on
27097
+ * screen at all for those few hundred milliseconds (layout/popup_css.js). One
27098
+ * the two states share holds where it stands, one only a single state has
27099
+ * travels with that state's page — the same two outcomes, derived the same way.
27092
27100
  *
27093
27101
  * Which keyframes those are is published by the movement itself
27094
27102
  * (--navi-route-transition-leave / -enter, see route_transition.jsx): a
@@ -27110,11 +27118,15 @@ const releaseTransitionDestination = (owner) => {
27110
27118
  * both pages are pictures for those few hundred milliseconds anyway.
27111
27119
  */
27112
27120
 
27121
+ // The browser's top layer: painted above everything the document paints, so
27122
+ // outside the area's picture whatever the DOM says.
27123
+ const TOP_LAYER_SELECTOR = ":modal, :popover-open";
27113
27124
  // What counts as furniture: what is pinned to an edge of the window and gives
27114
- // its room back to the content (layout/fixed_bar/fixed_bar.jsx). A sticky row
27115
- // inside the pages needs none of this — it lives in the area, so it is already
27116
- // part of the pages' own picture.
27117
- const FURNITURE_SELECTOR = ".navi_fixed_bar";
27125
+ // its room back to the content (layout/fixed_bar/fixed_bar.jsx), and what
27126
+ // stands over the pages in the top layer. A sticky row inside the pages needs
27127
+ // none of this — it lives in the area, so it is already part of the pages' own
27128
+ // picture, and so is a popup rendered with layer="local".
27129
+ const FURNITURE_SELECTOR = `.navi_fixed_bar, .navi_popover:is(${TOP_LAYER_SELECTOR}), .navi_dialog:is(${TOP_LAYER_SELECTOR})`;
27118
27130
  // Worn by the root for the length of a route transition (route_transition.jsx
27119
27131
  // owns it). Written out rather than imported: importing the module that owns
27120
27132
  // it back into this one would close a cycle.
@@ -27183,8 +27195,10 @@ const nameFurnitureAround = (areaElement) => {
27183
27195
  continue;
27184
27196
  }
27185
27197
  // Inside the area it is not furniture, it is the page: naming it would
27186
- // punch a hole in the picture the movement is played on.
27187
- if (areaElement.contains(element)) {
27198
+ // punch a hole in the picture the movement is played on. Standing in the
27199
+ // top layer takes it out of that picture though, so there is no hole to
27200
+ // punch — which is exactly the case of a modal dialog rendered by a page.
27201
+ if (areaElement.contains(element) && !element.matches(TOP_LAYER_SELECTOR)) {
27188
27202
  continue;
27189
27203
  }
27190
27204
  let name = nameByElement.get(element);
@@ -27640,24 +27654,118 @@ const css$10 = /* css */`
27640
27654
  &[data-navi-route-transition-target="area"] {
27641
27655
  view-transition-name: none;
27642
27656
 
27657
+ /* Where the pages are cut, and how far they travel — said on the root so
27658
+ that EVERY picture of the movement inherits them, not just the pages':
27659
+ a fixed bar or a popup travelling with the page it belongs to
27660
+ (transition_furniture.js) crosses the same window's worth of distance
27661
+ the pages do, whatever its own size. The pages are then cut with what
27662
+ is written here, on their group below.
27663
+
27664
+ The cut: the area's own box, and on top of it whatever covers the area.
27665
+ The pictures are drawn in the top layer, so they cover a fixed bar as
27666
+ easily as anything else — and the area runs UNDER the bars by design:
27667
+ that is what a fixed bar is for, and what the room it gives back is
27668
+ for. An area taller than the screen therefore ends below the bottom
27669
+ bar, and a scrolled one starts above the top bar, so the movement would
27670
+ be watched painting over them for its whole length.
27671
+
27672
+ Two bands are left free, and they answer for two different things: the
27673
+ app's own safe area (layout/safe_area.js), everything pinned to the
27674
+ WINDOW's edges, and --navi-transition-cover-* (transition_window.js),
27675
+ what covers the area from inside the document — a sticky header above
27676
+ the pages covers the top of the area exactly as a fixed bar covers the
27677
+ top of the screen. Both are read rather than asked for, so one that
27678
+ grows, shrinks or unmounts mid-transition is followed without anything
27679
+ being told.
27680
+
27681
+ Read live, though, they describe the state ARRIVING and nothing else,
27682
+ so the cut is taken at the smaller of that and the band the state
27683
+ being left kept free (--navi-transition-old-band-*, photographed while
27684
+ both still existed). Furniture standing in BOTH states is the frame:
27685
+ the pages move behind it and are cut at it. Furniture standing in one
27686
+ of them is part of what changes, and cutting the page being left at a
27687
+ bar it never had shows its own header being sliced instead of
27688
+ leaving. */
27689
+ --navi-route-transition-clip-top: max(
27690
+ 0px,
27691
+ min(
27692
+ var(--navi-safe-area-inset-top) + var(--navi-transition-cover-top),
27693
+ var(--navi-transition-old-band-top)
27694
+ ) - var(--navi-transition-window-top)
27695
+ );
27696
+ --navi-route-transition-clip-left: max(
27697
+ 0px,
27698
+ min(
27699
+ var(--navi-safe-area-inset-left) + var(--navi-transition-cover-left),
27700
+ var(--navi-transition-old-band-left)
27701
+ ) - var(--navi-transition-window-left)
27702
+ );
27703
+ --navi-route-transition-clip-bottom: max(
27704
+ 0px,
27705
+ var(--navi-transition-window-top) +
27706
+ var(--navi-transition-window-height) +
27707
+ min(
27708
+ var(--navi-safe-area-inset-bottom) +
27709
+ var(--navi-transition-cover-bottom),
27710
+ var(--navi-transition-old-band-bottom)
27711
+ ) -
27712
+ 100dvh
27713
+ );
27714
+ --navi-route-transition-clip-right: max(
27715
+ 0px,
27716
+ var(--navi-transition-window-left) +
27717
+ var(--navi-transition-window-width) +
27718
+ min(
27719
+ var(--navi-safe-area-inset-right) +
27720
+ var(--navi-transition-cover-right),
27721
+ var(--navi-transition-old-band-right)
27722
+ ) -
27723
+ 100dvw
27724
+ );
27725
+
27726
+ /* How far a page travels: the WINDOW it is seen through, not its own
27727
+ size. A page is as tall as its content — several screens of it — and a
27728
+ movement measured on the picture would send it thousands of pixels
27729
+ away, off screen for most of the transition and flying past at the
27730
+ end. What one page crossing another means is one window's worth of
27731
+ movement, whatever the pages are made of (see the keyframes). */
27732
+ --navi-route-transition-travel-x: calc(
27733
+ var(--navi-transition-window-width) - var(
27734
+ --navi-route-transition-clip-left
27735
+ ) - var(--navi-route-transition-clip-right)
27736
+ );
27737
+ --navi-route-transition-travel-y: calc(
27738
+ var(--navi-transition-window-height) - var(
27739
+ --navi-route-transition-clip-top
27740
+ ) - var(--navi-route-transition-clip-bottom)
27741
+ );
27742
+
27643
27743
  /* The pages travel OVER the furniture. Everything else captured while an
27644
- area is marked is a fixed bar wearing a name of navi's own for the
27645
- length of the movement (transition_furniture.js): a bar the two states
27646
- share is one group the browser holds where it stands, and a bar only
27647
- one of them has stands there too, with no counterpart to move to. Both
27648
- belong under the pages — that is what lets a page come over a bar that
27649
- is going away, and a page leaving uncover the bar arriving behind it.
27744
+ area is marked wears a name of navi's own for the length of the
27745
+ movement (transition_furniture.js): a bar the two states share is one
27746
+ group the browser holds where it stands, and a bar only one of them
27747
+ has stands there too, with no counterpart to move to. Both belong
27748
+ under the pages — that is what lets a page come over a bar that is
27749
+ going away, and a page leaving uncover the bar arriving behind it.
27750
+
27751
+ An open popup is the one piece that goes the other way: it stands in
27752
+ the top layer, over everything the document paints, so its picture
27753
+ stands over the pages rather than under them — a page sliding under a
27754
+ dialog, not over it (the class comes from layout/popup_css.js).
27650
27755
 
27651
27756
  Ordered here rather than left to the DOM, which decides it otherwise:
27652
27757
  where an application puts its bars relative to the area is its own
27653
- business. A name and \`*\` weigh the same, so the two rules are read in
27654
- the order they are written. */
27758
+ business. A name, a class and \`*\` weigh the same, so the rules are
27759
+ read in the order they are written. */
27655
27760
  &::view-transition-group(*) {
27656
27761
  z-index: 0;
27657
27762
  }
27658
27763
  &::view-transition-group(navi-route-transition) {
27659
27764
  z-index: 1;
27660
27765
  }
27766
+ &::view-transition-group(.navi_popup) {
27767
+ z-index: 2;
27768
+ }
27661
27769
 
27662
27770
  /* And on the transition's own clock, whatever was captured. How long the
27663
27771
  movement lasts is a fact about the movement, not about the pages: a bar
@@ -27713,93 +27821,15 @@ const css$10 = /* css */`
27713
27821
  );
27714
27822
  width: var(--navi-transition-window-width);
27715
27823
  height: var(--navi-transition-window-height);
27716
- animation-name: none;
27717
-
27718
- /* Cut at what covers the area, on top of being cut at the area's own
27719
- box. The pictures are drawn in the top layer, so they cover a fixed bar
27720
- as easily as anything else — and the area runs UNDER the bars by
27721
- design: that is what a fixed bar is for, and what the room it gives
27722
- back is for. An area taller than the screen therefore ends below the
27723
- bottom bar, and a scrolled one starts above the top bar, so the
27724
- movement would be watched painting over them for its whole length.
27725
-
27726
- Two bands are left free, and they answer for two different things: the
27727
- app's own safe area (layout/safe_area.js), everything pinned to the
27728
- WINDOW's edges, and --navi-transition-cover-* (transition_window.js),
27729
- what covers the area from inside the document — a sticky header above
27730
- the pages covers the top of the area exactly as a fixed bar covers the
27731
- top of the screen. Both are read rather than asked for, so one that
27732
- grows, shrinks or unmounts mid-transition is followed without anything
27733
- being told.
27734
-
27735
- Read live, though, they describe the state ARRIVING and nothing else,
27736
- so the cut is taken at the smaller of that and the band the state
27737
- being left kept free (--navi-transition-old-band-*, photographed while
27738
- both still existed). Furniture standing in BOTH states is the frame:
27739
- the pages move behind it and are cut at it. Furniture standing in one
27740
- of them is part of what changes, and cutting the page being left at a
27741
- bar it never had shows its own header being sliced instead of
27742
- leaving. */
27743
- --navi-route-transition-clip-top: max(
27744
- 0px,
27745
- min(
27746
- var(--navi-safe-area-inset-top) + var(--navi-transition-cover-top),
27747
- var(--navi-transition-old-band-top)
27748
- ) - var(--navi-transition-window-top)
27749
- );
27750
- --navi-route-transition-clip-left: max(
27751
- 0px,
27752
- min(
27753
- var(--navi-safe-area-inset-left) + var(--navi-transition-cover-left),
27754
- var(--navi-transition-old-band-left)
27755
- ) - var(--navi-transition-window-left)
27756
- );
27757
- --navi-route-transition-clip-bottom: max(
27758
- 0px,
27759
- var(--navi-transition-window-top) +
27760
- var(--navi-transition-window-height) +
27761
- min(
27762
- var(--navi-safe-area-inset-bottom) +
27763
- var(--navi-transition-cover-bottom),
27764
- var(--navi-transition-old-band-bottom)
27765
- ) -
27766
- 100dvh
27767
- );
27768
- --navi-route-transition-clip-right: max(
27769
- 0px,
27770
- var(--navi-transition-window-left) +
27771
- var(--navi-transition-window-width) +
27772
- min(
27773
- var(--navi-safe-area-inset-right) +
27774
- var(--navi-transition-cover-right),
27775
- var(--navi-transition-old-band-right)
27776
- ) -
27777
- 100dvw
27778
- );
27824
+ /* And cut at what covers the area, on top of that (the band is worked
27825
+ out on the root above). */
27779
27826
  clip-path: inset(
27780
27827
  var(--navi-route-transition-clip-top)
27781
27828
  var(--navi-route-transition-clip-right)
27782
27829
  var(--navi-route-transition-clip-bottom)
27783
27830
  var(--navi-route-transition-clip-left)
27784
27831
  );
27785
-
27786
- /* How far a page travels: the WINDOW it is seen through, not its own
27787
- size. A page is as tall as its content — several screens of it — and a
27788
- movement measured on the picture would send it thousands of pixels
27789
- away, off screen for most of the transition and flying past at the
27790
- end. What one page crossing another means is one window's worth of
27791
- movement, whatever the pages are made of. Inherited by the pictures,
27792
- which is where it is used (see the keyframes). */
27793
- --navi-route-transition-travel-x: calc(
27794
- var(--navi-transition-window-width) - var(
27795
- --navi-route-transition-clip-left
27796
- ) - var(--navi-route-transition-clip-right)
27797
- );
27798
- --navi-route-transition-travel-y: calc(
27799
- var(--navi-transition-window-height) - var(
27800
- --navi-route-transition-clip-top
27801
- ) - var(--navi-route-transition-clip-bottom)
27802
- );
27832
+ animation-name: none;
27803
27833
  }
27804
27834
  /* Each picture at the corner its own state stood at, which is not the
27805
27835
  window's: the window contains both states, and a state that is scrolled
@@ -55471,21 +55501,41 @@ const popupCss = /* css */ `
55471
55501
  popup lives in the top layer too: uncaptured, it is simply covered for the
55472
55502
  length of the movement, so it disappears the instant its page starts to
55473
55503
  leave and lands abruptly when the arriving one settles. Captured, it is a
55474
- group beside the pages, painted over them where it stands, and the browser
55475
- fades it out with the page it belonged to or in with the page it comes
55476
- with.
55504
+ group beside the pages, painted over them where it stands.
55505
+
55506
+ The class is how navi reaches that picture afterwards: its clock below,
55507
+ and its place above the pages (the z-order in nav/route_transition.jsx). */
55508
+ :root[data-navi-route-transition] .navi_popover[aria-expanded="true"],
55509
+ :root[data-navi-route-transition] .navi_dialog[aria-expanded="true"],
55510
+ :root[data-navi-route-travel] .navi_popover[aria-expanded="true"],
55511
+ :root[data-navi-route-travel] .navi_dialog[aria-expanded="true"] {
55512
+ view-transition-class: navi_popup;
55513
+ }
55514
+
55515
+ /* The name, wherever nobody writes a better one. A movement played on an
55516
+ area names the popups standing over it itself, per element and in JS
55517
+ (nav/transition_furniture.js): only a real name tells the popup the two
55518
+ states SHARE — one element, one name, one group held where it stands —
55519
+ from the one a single state has, which belongs to that state's page and
55520
+ travels with it. A movement played on the whole document runs no such
55521
+ pass, so the popup takes an identity of its own and the browser fades it.
55477
55522
 
55478
55523
  An identity of its own (match-element), never a shared name: two popups on
55479
55524
  either side of a navigation are two different popups, and what is wanted is
55480
55525
  precisely that one goes and the other comes. A browser with no
55481
55526
  match-element takes no name and the pictures cover the popup. */
55482
55527
  @supports (view-transition-name: match-element) {
55483
- :root[data-navi-route-transition] .navi_popover[aria-expanded="true"],
55484
- :root[data-navi-route-transition] .navi_dialog[aria-expanded="true"],
55528
+ :root[data-navi-route-transition]:not(
55529
+ [data-navi-route-transition-target="area"]
55530
+ )
55531
+ .navi_popover[aria-expanded="true"],
55532
+ :root[data-navi-route-transition]:not(
55533
+ [data-navi-route-transition-target="area"]
55534
+ )
55535
+ .navi_dialog[aria-expanded="true"],
55485
55536
  :root[data-navi-route-travel] .navi_popover[aria-expanded="true"],
55486
55537
  :root[data-navi-route-travel] .navi_dialog[aria-expanded="true"] {
55487
55538
  view-transition-name: match-element;
55488
- view-transition-class: navi_popup;
55489
55539
  }
55490
55540
  }
55491
55541