@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/jsenv_navi.js
CHANGED
|
@@ -37105,6 +37105,12 @@ const releaseTransitionDestination = (owner) => {
|
|
|
37105
37105
|
* inside its rectangle — which is where the hand thinks it pressed. The same
|
|
37106
37106
|
* move route_travel.jsx makes for the box a finger reaches for mid-flight.
|
|
37107
37107
|
*
|
|
37108
|
+
* A `RouteTravel` holds this too, for the bars it leaves live. A control there
|
|
37109
|
+
* gets its click on its own except in the first frames of the travel, when a
|
|
37110
|
+
* press falls to the document root like any other; the part of a bar photographed
|
|
37111
|
+
* for the travel (`data-navi-fixed-bar-overhang`, fixed_bar.jsx) is deaf
|
|
37112
|
+
* throughout.
|
|
37113
|
+
*
|
|
37108
37114
|
* ASKED FOR, never derived, and that is the whole safety of it: only the
|
|
37109
37115
|
* application knows the control does not move. One that travels with the pages
|
|
37110
37116
|
* has a rectangle where it WILL be, not where it is seen, and a press handed to
|
|
@@ -38067,6 +38073,21 @@ const placeTransitionWindow = (owner, groupName) => {
|
|
|
38067
38073
|
document.documentElement.setAttribute(WINDOW_PLACED_ATTRIBUTE, "");
|
|
38068
38074
|
};
|
|
38069
38075
|
|
|
38076
|
+
/**
|
|
38077
|
+
* Whether a point of the window lies in a band the furniture keeps: the pictures
|
|
38078
|
+
* are cut at those bands, so what is seen there is never a page, however far the
|
|
38079
|
+
* box runs under it.
|
|
38080
|
+
*/
|
|
38081
|
+
const isPointInTransitionBand = (clientX, clientY) => {
|
|
38082
|
+
const band = readBand();
|
|
38083
|
+
return (
|
|
38084
|
+
clientX < band.left ||
|
|
38085
|
+
clientX > window.innerWidth - band.right ||
|
|
38086
|
+
clientY < band.top ||
|
|
38087
|
+
clientY > window.innerHeight - band.bottom
|
|
38088
|
+
);
|
|
38089
|
+
};
|
|
38090
|
+
|
|
38070
38091
|
// The live layout takes the box back. A discontinuity by construction — the
|
|
38071
38092
|
// window stands at the held height, the box is at its own — and an invisible
|
|
38072
38093
|
// one: the page arriving is fully in place, and the strip below it that the
|
|
@@ -40440,7 +40461,8 @@ const css$16 = /* css */`.navi_route_travel {
|
|
|
40440
40461
|
* root's name is dropped for that time (`view-transition-name: none`), so what
|
|
40441
40462
|
* stands around the box — a tab row beside it — stays live and answers a press
|
|
40442
40463
|
* mid-travel. The application's own rule for the root applies again the moment
|
|
40443
|
-
* the travel is over.
|
|
40464
|
+
* the travel is over. What stands out of a `FixedBar` is the exception, when it
|
|
40465
|
+
* asks to stay over the pages (see `data-navi-fixed-bar-overhang` there).
|
|
40444
40466
|
*/
|
|
40445
40467
|
const RouteTravel = ({
|
|
40446
40468
|
routes: routesProp,
|
|
@@ -40562,6 +40584,10 @@ const RouteTravel = ({
|
|
|
40562
40584
|
// transition_destination.js).
|
|
40563
40585
|
nameForTravel(travel.element);
|
|
40564
40586
|
holdTransitionDestination(travel, page.route.buildUrl(page.params));
|
|
40587
|
+
// The bars stay live, except what one of them has photographed on its own
|
|
40588
|
+
// (see fixed_bar.jsx), which is deaf like any picture and may have asked to
|
|
40589
|
+
// keep answering.
|
|
40590
|
+
holdTransitionPress(travel, travel.element);
|
|
40565
40591
|
document.documentElement.setAttribute(TRAVEL_ATTRIBUTE, direction);
|
|
40566
40592
|
document.documentElement.setAttribute(TRAVEL_AXIS_ATTRIBUTE, axis);
|
|
40567
40593
|
if (scrub) {
|
|
@@ -40981,6 +41007,7 @@ const RouteTravel = ({
|
|
|
40981
41007
|
document.documentElement.removeAttribute(TURNED_ATTRIBUTE);
|
|
40982
41008
|
releaseTransitionWindow(travel);
|
|
40983
41009
|
releaseTransitionDestination(travel);
|
|
41010
|
+
releaseTransitionPress(travel);
|
|
40984
41011
|
}
|
|
40985
41012
|
};
|
|
40986
41013
|
|
|
@@ -41245,11 +41272,16 @@ const RouteTravel = ({
|
|
|
41245
41272
|
gestureRef.current = gesture;
|
|
41246
41273
|
};
|
|
41247
41274
|
|
|
41248
|
-
// A press
|
|
41249
|
-
// the browser's transition covers the page and the press
|
|
41250
|
-
// document root instead, whatever the pictures are told about pointer
|
|
41251
|
-
// So while a travel plays, the press is caught at the document and
|
|
41252
|
-
// the box when it fell
|
|
41275
|
+
// A press aimed at a page while a travel is playing does not always reach the
|
|
41276
|
+
// box: the browser's transition covers the page and the press can be delivered
|
|
41277
|
+
// to the document root instead, whatever the pictures are told about pointer
|
|
41278
|
+
// events. So while a travel plays, the press is caught at the document and
|
|
41279
|
+
// handed to the box when it fell where a page is SEEN, which is where the hand
|
|
41280
|
+
// thinks it pressed.
|
|
41281
|
+
//
|
|
41282
|
+
// Decided by the position and never by the target: in the first frames of a
|
|
41283
|
+
// travel a press on a live bar falls to the root like any other, and what lies
|
|
41284
|
+
// under a picture is not what the hand is aiming at.
|
|
41253
41285
|
pointerDownRef.current = onPointerDown;
|
|
41254
41286
|
useLayoutEffect(() => {
|
|
41255
41287
|
const onDocumentPointerDown = pointerDownEvent => {
|
|
@@ -41274,6 +41306,11 @@ const RouteTravel = ({
|
|
|
41274
41306
|
if (clientX < left || clientX > right || clientY < top || clientY > bottom) {
|
|
41275
41307
|
return;
|
|
41276
41308
|
}
|
|
41309
|
+
// A box scrolled under a bar still has the press in its rectangle, but
|
|
41310
|
+
// the pictures are cut at that bar: the press is aimed at the bar.
|
|
41311
|
+
if (isPointInTransitionBand(clientX, clientY)) {
|
|
41312
|
+
return;
|
|
41313
|
+
}
|
|
41277
41314
|
pointerDownRef.current(pointerDownEvent);
|
|
41278
41315
|
};
|
|
41279
41316
|
document.addEventListener("pointerdown", onDocumentPointerDown, true);
|
|
@@ -56457,7 +56494,9 @@ const LinkPseudoElements = ["::-navi-loader", "::-navi-indicator"];
|
|
|
56457
56494
|
* press on it is aimed at what the reader can see. Say it there, and only
|
|
56458
56495
|
* there: a control that TRAVELS with the pages has a rectangle where it will
|
|
56459
56496
|
* be, not where it is seen, and a press handed to it fires something nobody
|
|
56460
|
-
* aimed at.
|
|
56497
|
+
* aimed at. A `RouteTravel` honours it as well, for a control in a `FixedBar`:
|
|
56498
|
+
* the part it photographs (`data-navi-fixed-bar-overhang`) is deaf for the
|
|
56499
|
+
* whole travel, and the rest for its first frames.
|
|
56461
56500
|
* @param {boolean} [props.replace] - Go to the destination by TAKING THE PLACE
|
|
56462
56501
|
* of the current history entry instead of stacking onto it: the link stays a
|
|
56463
56502
|
* link (an address, a middle click, the keyboard, `aria-current`), only the
|
|
@@ -59068,6 +59107,7 @@ const css$Y = /* css */`@layer navi {
|
|
|
59068
59107
|
}
|
|
59069
59108
|
|
|
59070
59109
|
.navi_fixed_bar_shadow {
|
|
59110
|
+
z-index: -1;
|
|
59071
59111
|
border-radius: inherit;
|
|
59072
59112
|
box-shadow: var(--navi-fixed-bar-shadow);
|
|
59073
59113
|
pointer-events: none;
|
|
@@ -59096,13 +59136,13 @@ const css$Y = /* css */`@layer navi {
|
|
|
59096
59136
|
}
|
|
59097
59137
|
|
|
59098
59138
|
@supports (view-transition-name: match-element) {
|
|
59099
|
-
:root[data-navi-route-travel] .navi_fixed_bar_shadow {
|
|
59139
|
+
:root[data-navi-route-travel] .navi_fixed_bar_shadow, :root[data-navi-route-travel] [data-navi-fixed-bar-overhang] {
|
|
59100
59140
|
view-transition-name: match-element;
|
|
59101
|
-
view-transition-class:
|
|
59141
|
+
view-transition-class: navi_fixed_bar_over_pages;
|
|
59102
59142
|
}
|
|
59103
59143
|
}
|
|
59104
59144
|
|
|
59105
|
-
:root[data-navi-route-travel-turned]::view-transition-group(.
|
|
59145
|
+
:root[data-navi-route-travel-turned]::view-transition-group(.navi_fixed_bar_over_pages) {
|
|
59106
59146
|
display: block;
|
|
59107
59147
|
}
|
|
59108
59148
|
`;
|
|
@@ -59159,6 +59199,13 @@ const FixedBarStyleCSSVars = {
|
|
|
59159
59199
|
* Takes no room. Prefer it to a `boxShadow` or a `filter` on the bar: those
|
|
59160
59200
|
* are covered by the pages while a `RouteTravel` plays, this one stays over
|
|
59161
59201
|
* them.
|
|
59202
|
+
*
|
|
59203
|
+
* A child standing out of the bar's box (a raised button, the notch around it)
|
|
59204
|
+
* wears `data-navi-fixed-bar-overhang`: unmarked, the pages of a `RouteTravel`
|
|
59205
|
+
* cover it wherever they have paint behind it. Marked, it stays over them, and
|
|
59206
|
+
* like anything photographed it is deaf for the length of the travel —
|
|
59207
|
+
* `pressableDuringRouteTransition` on a control inside it keeps that control
|
|
59208
|
+
* answering. The rest of the bar stays live.
|
|
59162
59209
|
*/
|
|
59163
59210
|
const FixedBar = ({
|
|
59164
59211
|
children,
|
|
@@ -62412,7 +62459,9 @@ const COMMAND_DEFAULT_PROPS_FACTORIES = {
|
|
|
62412
62459
|
* button in a bar the two states share, standing exactly where its picture is
|
|
62413
62460
|
* drawn — must still close it. What `<Link pressableDuringRouteTransition>`
|
|
62414
62461
|
* says, for the other half of a toggle. Only for a control that does not
|
|
62415
|
-
* travel with the pages.
|
|
62462
|
+
* travel with the pages. A `RouteTravel` honours it as well, for a control in
|
|
62463
|
+
* a `FixedBar`: the part it photographs (`data-navi-fixed-bar-overhang`) is
|
|
62464
|
+
* deaf for the whole travel, and the rest for its first frames.
|
|
62416
62465
|
* @param {Function} [action] What the press runs: a button holds no value, so
|
|
62417
62466
|
* every press is one call. Inside a `<Form>` or a group it carries the value
|
|
62418
62467
|
* around it, merged over the action's bound params — a value that is not an
|