@jsenv/navi 0.29.512 → 0.29.514
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.
- package/dist/dev/jsenv_navi.js +61 -12
- package/dist/dev/jsenv_navi.js.map +7 -7
- package/dist/jsenv_navi.js +60 -11
- package/dist/jsenv_navi.js.map +7 -7
- package/docs/route_transitions.md +7 -1
- package/package.json +1 -1
package/dist/dev/jsenv_navi.js
CHANGED
|
@@ -38356,6 +38356,12 @@ const releaseTransitionDestination = (owner) => {
|
|
|
38356
38356
|
* inside its rectangle — which is where the hand thinks it pressed. The same
|
|
38357
38357
|
* move route_travel.jsx makes for the box a finger reaches for mid-flight.
|
|
38358
38358
|
*
|
|
38359
|
+
* A `RouteTravel` holds this too, for the bars it leaves live. A control there
|
|
38360
|
+
* gets its click on its own except in the first frames of the travel, when a
|
|
38361
|
+
* press falls to the document root like any other; the part of a bar photographed
|
|
38362
|
+
* for the travel (`data-navi-fixed-bar-overhang`, fixed_bar.jsx) is deaf
|
|
38363
|
+
* throughout.
|
|
38364
|
+
*
|
|
38359
38365
|
* ASKED FOR, never derived, and that is the whole safety of it: only the
|
|
38360
38366
|
* application knows the control does not move. One that travels with the pages
|
|
38361
38367
|
* has a rectangle where it WILL be, not where it is seen, and a press handed to
|
|
@@ -38461,7 +38467,7 @@ const warnAboutPressablesThatMove = (areaElement) => {
|
|
|
38461
38467
|
}
|
|
38462
38468
|
warnOnce$1(
|
|
38463
38469
|
"inside-area",
|
|
38464
|
-
`A control asking to stay pressable during a route transition stands inside the pages (the element marked ${AREA_ATTRIBUTE}), and the pages are what moves: its rectangle says where it will BE, not where it is drawn, so a press aimed at what is on screen would be handed to whatever ends up under the finger. Only the furniture around the pages stands still for the length of a movement.`,
|
|
38470
|
+
`A control asking to stay pressable during a route transition stands inside the pages (the element marked ${AREA_ATTRIBUTE}, or the box of a RouteTravel), and the pages are what moves: its rectangle says where it will BE, not where it is drawn, so a press aimed at what is on screen would be handed to whatever ends up under the finger. Only the furniture around the pages stands still for the length of a movement.`,
|
|
38465
38471
|
);
|
|
38466
38472
|
return;
|
|
38467
38473
|
}
|
|
@@ -39358,6 +39364,21 @@ const placeTransitionWindow = (owner, groupName) => {
|
|
|
39358
39364
|
document.documentElement.setAttribute(WINDOW_PLACED_ATTRIBUTE, "");
|
|
39359
39365
|
};
|
|
39360
39366
|
|
|
39367
|
+
/**
|
|
39368
|
+
* Whether a point of the window lies in a band the furniture keeps: the pictures
|
|
39369
|
+
* are cut at those bands, so what is seen there is never a page, however far the
|
|
39370
|
+
* box runs under it.
|
|
39371
|
+
*/
|
|
39372
|
+
const isPointInTransitionBand = (clientX, clientY) => {
|
|
39373
|
+
const band = readBand();
|
|
39374
|
+
return (
|
|
39375
|
+
clientX < band.left ||
|
|
39376
|
+
clientX > window.innerWidth - band.right ||
|
|
39377
|
+
clientY < band.top ||
|
|
39378
|
+
clientY > window.innerHeight - band.bottom
|
|
39379
|
+
);
|
|
39380
|
+
};
|
|
39381
|
+
|
|
39361
39382
|
// The live layout takes the box back. A discontinuity by construction — the
|
|
39362
39383
|
// window stands at the held height, the box is at its own — and an invisible
|
|
39363
39384
|
// one: the page arriving is fully in place, and the strip below it that the
|
|
@@ -41731,7 +41752,8 @@ const css$16 = /* css */`.navi_route_travel {
|
|
|
41731
41752
|
* root's name is dropped for that time (`view-transition-name: none`), so what
|
|
41732
41753
|
* stands around the box — a tab row beside it — stays live and answers a press
|
|
41733
41754
|
* mid-travel. The application's own rule for the root applies again the moment
|
|
41734
|
-
* the travel is over.
|
|
41755
|
+
* the travel is over. What stands out of a `FixedBar` is the exception, when it
|
|
41756
|
+
* asks to stay over the pages (see `data-navi-fixed-bar-overhang` there).
|
|
41735
41757
|
*/
|
|
41736
41758
|
const RouteTravel = ({
|
|
41737
41759
|
routes: routesProp,
|
|
@@ -41853,6 +41875,10 @@ const RouteTravel = ({
|
|
|
41853
41875
|
// transition_destination.js).
|
|
41854
41876
|
nameForTravel(travel.element);
|
|
41855
41877
|
holdTransitionDestination(travel, page.route.buildUrl(page.params));
|
|
41878
|
+
// The bars stay live, except what one of them has photographed on its own
|
|
41879
|
+
// (see fixed_bar.jsx), which is deaf like any picture and may have asked to
|
|
41880
|
+
// keep answering.
|
|
41881
|
+
holdTransitionPress(travel, travel.element);
|
|
41856
41882
|
document.documentElement.setAttribute(TRAVEL_ATTRIBUTE, direction);
|
|
41857
41883
|
document.documentElement.setAttribute(TRAVEL_AXIS_ATTRIBUTE, axis);
|
|
41858
41884
|
if (scrub) {
|
|
@@ -42275,6 +42301,7 @@ const RouteTravel = ({
|
|
|
42275
42301
|
document.documentElement.removeAttribute(TURNED_ATTRIBUTE);
|
|
42276
42302
|
releaseTransitionWindow(travel);
|
|
42277
42303
|
releaseTransitionDestination(travel);
|
|
42304
|
+
releaseTransitionPress(travel);
|
|
42278
42305
|
}
|
|
42279
42306
|
};
|
|
42280
42307
|
|
|
@@ -42539,11 +42566,16 @@ const RouteTravel = ({
|
|
|
42539
42566
|
gestureRef.current = gesture;
|
|
42540
42567
|
};
|
|
42541
42568
|
|
|
42542
|
-
// A press
|
|
42543
|
-
// the browser's transition covers the page and the press
|
|
42544
|
-
// document root instead, whatever the pictures are told about pointer
|
|
42545
|
-
// So while a travel plays, the press is caught at the document and
|
|
42546
|
-
// the box when it fell
|
|
42569
|
+
// A press aimed at a page while a travel is playing does not always reach the
|
|
42570
|
+
// box: the browser's transition covers the page and the press can be delivered
|
|
42571
|
+
// to the document root instead, whatever the pictures are told about pointer
|
|
42572
|
+
// events. So while a travel plays, the press is caught at the document and
|
|
42573
|
+
// handed to the box when it fell where a page is SEEN, which is where the hand
|
|
42574
|
+
// thinks it pressed.
|
|
42575
|
+
//
|
|
42576
|
+
// Decided by the position and never by the target: in the first frames of a
|
|
42577
|
+
// travel a press on a live bar falls to the root like any other, and what lies
|
|
42578
|
+
// under a picture is not what the hand is aiming at.
|
|
42547
42579
|
pointerDownRef.current = onPointerDown;
|
|
42548
42580
|
useLayoutEffect(() => {
|
|
42549
42581
|
const onDocumentPointerDown = pointerDownEvent => {
|
|
@@ -42568,6 +42600,11 @@ const RouteTravel = ({
|
|
|
42568
42600
|
if (clientX < left || clientX > right || clientY < top || clientY > bottom) {
|
|
42569
42601
|
return;
|
|
42570
42602
|
}
|
|
42603
|
+
// A box scrolled under a bar still has the press in its rectangle, but
|
|
42604
|
+
// the pictures are cut at that bar: the press is aimed at the bar.
|
|
42605
|
+
if (isPointInTransitionBand(clientX, clientY)) {
|
|
42606
|
+
return;
|
|
42607
|
+
}
|
|
42571
42608
|
pointerDownRef.current(pointerDownEvent);
|
|
42572
42609
|
};
|
|
42573
42610
|
document.addEventListener("pointerdown", onDocumentPointerDown, true);
|
|
@@ -58001,7 +58038,9 @@ const LinkPseudoElements = ["::-navi-loader", "::-navi-indicator"];
|
|
|
58001
58038
|
* press on it is aimed at what the reader can see. Say it there, and only
|
|
58002
58039
|
* there: a control that TRAVELS with the pages has a rectangle where it will
|
|
58003
58040
|
* be, not where it is seen, and a press handed to it fires something nobody
|
|
58004
|
-
* aimed at.
|
|
58041
|
+
* aimed at. A `RouteTravel` honours it as well, for a control in a `FixedBar`:
|
|
58042
|
+
* the part it photographs (`data-navi-fixed-bar-overhang`) is deaf for the
|
|
58043
|
+
* whole travel, and the rest for its first frames.
|
|
58005
58044
|
* @param {boolean} [props.replace] - Go to the destination by TAKING THE PLACE
|
|
58006
58045
|
* of the current history entry instead of stacking onto it: the link stays a
|
|
58007
58046
|
* link (an address, a middle click, the keyboard, `aria-current`), only the
|
|
@@ -60628,6 +60667,7 @@ const css$Y = /* css */`@layer navi {
|
|
|
60628
60667
|
}
|
|
60629
60668
|
|
|
60630
60669
|
.navi_fixed_bar_shadow {
|
|
60670
|
+
z-index: -1;
|
|
60631
60671
|
border-radius: inherit;
|
|
60632
60672
|
box-shadow: var(--navi-fixed-bar-shadow);
|
|
60633
60673
|
pointer-events: none;
|
|
@@ -60656,13 +60696,13 @@ const css$Y = /* css */`@layer navi {
|
|
|
60656
60696
|
}
|
|
60657
60697
|
|
|
60658
60698
|
@supports (view-transition-name: match-element) {
|
|
60659
|
-
:root[data-navi-route-travel] .navi_fixed_bar_shadow {
|
|
60699
|
+
:root[data-navi-route-travel] .navi_fixed_bar_shadow, :root[data-navi-route-travel] [data-navi-fixed-bar-overhang] {
|
|
60660
60700
|
view-transition-name: match-element;
|
|
60661
|
-
view-transition-class:
|
|
60701
|
+
view-transition-class: navi_fixed_bar_over_pages;
|
|
60662
60702
|
}
|
|
60663
60703
|
}
|
|
60664
60704
|
|
|
60665
|
-
:root[data-navi-route-travel-turned]::view-transition-group(.
|
|
60705
|
+
:root[data-navi-route-travel-turned]::view-transition-group(.navi_fixed_bar_over_pages) {
|
|
60666
60706
|
display: block;
|
|
60667
60707
|
}
|
|
60668
60708
|
`;
|
|
@@ -60719,6 +60759,13 @@ const FixedBarStyleCSSVars = {
|
|
|
60719
60759
|
* Takes no room. Prefer it to a `boxShadow` or a `filter` on the bar: those
|
|
60720
60760
|
* are covered by the pages while a `RouteTravel` plays, this one stays over
|
|
60721
60761
|
* them.
|
|
60762
|
+
*
|
|
60763
|
+
* A child standing out of the bar's box (a raised button, the notch around it)
|
|
60764
|
+
* wears `data-navi-fixed-bar-overhang`: unmarked, the pages of a `RouteTravel`
|
|
60765
|
+
* cover it wherever they have paint behind it. Marked, it stays over them, and
|
|
60766
|
+
* like anything photographed it is deaf for the length of the travel —
|
|
60767
|
+
* `pressableDuringRouteTransition` on a control inside it keeps that control
|
|
60768
|
+
* answering. The rest of the bar stays live.
|
|
60722
60769
|
*/
|
|
60723
60770
|
const FixedBar = ({
|
|
60724
60771
|
children,
|
|
@@ -63986,7 +64033,9 @@ const COMMAND_DEFAULT_PROPS_FACTORIES = {
|
|
|
63986
64033
|
* button in a bar the two states share, standing exactly where its picture is
|
|
63987
64034
|
* drawn — must still close it. What `<Link pressableDuringRouteTransition>`
|
|
63988
64035
|
* says, for the other half of a toggle. Only for a control that does not
|
|
63989
|
-
* travel with the pages.
|
|
64036
|
+
* travel with the pages. A `RouteTravel` honours it as well, for a control in
|
|
64037
|
+
* a `FixedBar`: the part it photographs (`data-navi-fixed-bar-overhang`) is
|
|
64038
|
+
* deaf for the whole travel, and the rest for its first frames.
|
|
63990
64039
|
* @param {Function} [action] What the press runs: a button holds no value, so
|
|
63991
64040
|
* every press is one call. Inside a `<Form>` or a group it carries the value
|
|
63992
64041
|
* around it, merged over the action's bound params — a value that is not an
|