@jsenv/navi 0.29.511 → 0.29.513
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 +110 -13
- package/dist/dev/jsenv_navi.js.map +6 -6
- package/dist/jsenv_navi.js +95 -12
- package/dist/jsenv_navi.js.map +6 -6
- package/docs/route_transitions.md +6 -1
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -37105,6 +37105,10 @@ 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. It leaves the bars live, so a control there
|
|
37109
|
+
* gets its click on its own; what this serves is a control in the part of a bar
|
|
37110
|
+
* photographed for the travel (`data-navi-fixed-bar-overhang`, fixed_bar.jsx).
|
|
37111
|
+
*
|
|
37108
37112
|
* ASKED FOR, never derived, and that is the whole safety of it: only the
|
|
37109
37113
|
* application knows the control does not move. One that travels with the pages
|
|
37110
37114
|
* has a rectangle where it WILL be, not where it is seen, and a press handed to
|
|
@@ -40440,7 +40444,8 @@ const css$16 = /* css */`.navi_route_travel {
|
|
|
40440
40444
|
* root's name is dropped for that time (`view-transition-name: none`), so what
|
|
40441
40445
|
* stands around the box — a tab row beside it — stays live and answers a press
|
|
40442
40446
|
* mid-travel. The application's own rule for the root applies again the moment
|
|
40443
|
-
* the travel is over.
|
|
40447
|
+
* the travel is over. What stands out of a `FixedBar` is the exception, when it
|
|
40448
|
+
* asks to stay over the pages (see `data-navi-fixed-bar-overhang` there).
|
|
40444
40449
|
*/
|
|
40445
40450
|
const RouteTravel = ({
|
|
40446
40451
|
routes: routesProp,
|
|
@@ -40523,7 +40528,11 @@ const RouteTravel = ({
|
|
|
40523
40528
|
// by CSS until then, so an empty hand here costs nothing: there is
|
|
40524
40529
|
// nothing to stop, only nowhere to put them yet.
|
|
40525
40530
|
animations: null,
|
|
40526
|
-
ended: false
|
|
40531
|
+
ended: false,
|
|
40532
|
+
// The box as it set off, kept rather than read from the ref: the
|
|
40533
|
+
// navigation a travel asks for can take the box down (see the update
|
|
40534
|
+
// callback), and the name it wears is still given back to it.
|
|
40535
|
+
element: elementRef.current
|
|
40527
40536
|
};
|
|
40528
40537
|
travelRef.current = travel;
|
|
40529
40538
|
// A press landing on a playing travel lands on the document root: the box
|
|
@@ -40539,7 +40548,7 @@ const RouteTravel = ({
|
|
|
40539
40548
|
});
|
|
40540
40549
|
// Whether the document's offset is this row's business at all (see
|
|
40541
40550
|
// pagesScrollTheDocument), asked once and before anything is swapped.
|
|
40542
|
-
travel.scrollsDocument = pagesScrollTheDocument(
|
|
40551
|
+
travel.scrollsDocument = pagesScrollTheDocument(travel.element);
|
|
40543
40552
|
if (travel.scrollsDocument) {
|
|
40544
40553
|
// One of the tabs is about to be swapped out from under that scrollport,
|
|
40545
40554
|
// and whatever the browser does with the offset meanwhile — clamping it
|
|
@@ -40556,8 +40565,12 @@ const RouteTravel = ({
|
|
|
40556
40565
|
// at the same moment and for the same reason: whoever names something for
|
|
40557
40566
|
// a movement between two pages decides on it now (see
|
|
40558
40567
|
// transition_destination.js).
|
|
40559
|
-
nameForTravel(
|
|
40568
|
+
nameForTravel(travel.element);
|
|
40560
40569
|
holdTransitionDestination(travel, page.route.buildUrl(page.params));
|
|
40570
|
+
// The bars stay live, except what one of them has photographed on its own
|
|
40571
|
+
// (see fixed_bar.jsx), which is deaf like any picture and may have asked to
|
|
40572
|
+
// keep answering.
|
|
40573
|
+
holdTransitionPress(travel, travel.element);
|
|
40561
40574
|
document.documentElement.setAttribute(TRAVEL_ATTRIBUTE, direction);
|
|
40562
40575
|
document.documentElement.setAttribute(TRAVEL_AXIS_ATTRIBUTE, axis);
|
|
40563
40576
|
if (scrub) {
|
|
@@ -40568,7 +40581,7 @@ const RouteTravel = ({
|
|
|
40568
40581
|
// The box as it stands before anything moves, and the band the furniture
|
|
40569
40582
|
// around it leaves free: rendering is held, so both are still the page
|
|
40570
40583
|
// being left (see transition_window.js).
|
|
40571
|
-
const stateBefore = measureTransitionWindowState(
|
|
40584
|
+
const stateBefore = measureTransitionWindowState(travel.element);
|
|
40572
40585
|
// The hold a navigation already took, if this travel is the answer to one:
|
|
40573
40586
|
// taking another would be taking a hold on a page that is holding still.
|
|
40574
40587
|
const releaseRendering = takeoverRoutingRenderingHold();
|
|
@@ -40606,6 +40619,16 @@ const RouteTravel = ({
|
|
|
40606
40619
|
} = travel.page;
|
|
40607
40620
|
arriveAtScrollPosition(route.buildUrl(params));
|
|
40608
40621
|
}
|
|
40622
|
+
// The box itself may be gone: rendered inside one of the pages of its
|
|
40623
|
+
// row rather than around them, it went down with the page being left,
|
|
40624
|
+
// and there is no box left for the page arriving to be photographed in.
|
|
40625
|
+
// The navigation stands — it is what was asked for — and the movement
|
|
40626
|
+
// is dropped.
|
|
40627
|
+
if (!travel.element.isConnected) {
|
|
40628
|
+
travel.viewTransition.skipTransition();
|
|
40629
|
+
endTravel(travel);
|
|
40630
|
+
return;
|
|
40631
|
+
}
|
|
40609
40632
|
// The page arriving is in the DOM and the transition has not started
|
|
40610
40633
|
// playing: the one moment both boxes can be known. After the scroll,
|
|
40611
40634
|
// which is what the box is measured through: the two states are at the
|
|
@@ -40613,7 +40636,7 @@ const RouteTravel = ({
|
|
|
40613
40636
|
// (see transition_window.js).
|
|
40614
40637
|
// The bars stay live under the pictures for a travel: only the box is
|
|
40615
40638
|
// photographed (see the TRAVEL_ATTRIBUTE css).
|
|
40616
|
-
holdTransitionWindow(travel,
|
|
40639
|
+
holdTransitionWindow(travel, travel.element, stateBefore, {
|
|
40617
40640
|
furnitureLive: true
|
|
40618
40641
|
});
|
|
40619
40642
|
});
|
|
@@ -40960,13 +40983,14 @@ const RouteTravel = ({
|
|
|
40960
40983
|
// Given back, so another box may wear it: kept, two of them on a page
|
|
40961
40984
|
// would both answer to it and the browser refuses the whole transition
|
|
40962
40985
|
// rather than pick.
|
|
40963
|
-
unnameAfterTravel(
|
|
40986
|
+
unnameAfterTravel(travel.element);
|
|
40964
40987
|
document.documentElement.removeAttribute(TRAVEL_ATTRIBUTE);
|
|
40965
40988
|
document.documentElement.removeAttribute(TRAVEL_AXIS_ATTRIBUTE);
|
|
40966
40989
|
document.documentElement.removeAttribute(DRAGGED_ATTRIBUTE);
|
|
40967
40990
|
document.documentElement.removeAttribute(TURNED_ATTRIBUTE);
|
|
40968
40991
|
releaseTransitionWindow(travel);
|
|
40969
40992
|
releaseTransitionDestination(travel);
|
|
40993
|
+
releaseTransitionPress(travel);
|
|
40970
40994
|
}
|
|
40971
40995
|
};
|
|
40972
40996
|
|
|
@@ -56443,7 +56467,8 @@ const LinkPseudoElements = ["::-navi-loader", "::-navi-indicator"];
|
|
|
56443
56467
|
* press on it is aimed at what the reader can see. Say it there, and only
|
|
56444
56468
|
* there: a control that TRAVELS with the pages has a rectangle where it will
|
|
56445
56469
|
* be, not where it is seen, and a press handed to it fires something nobody
|
|
56446
|
-
* aimed at.
|
|
56470
|
+
* aimed at. A `RouteTravel` honours it as well, for a control in the part of
|
|
56471
|
+
* a `FixedBar` it photographs (`data-navi-fixed-bar-overhang`).
|
|
56447
56472
|
* @param {boolean} [props.replace] - Go to the destination by TAKING THE PLACE
|
|
56448
56473
|
* of the current history entry instead of stacking onto it: the link stays a
|
|
56449
56474
|
* link (an address, a middle click, the keyboard, `aria-current`), only the
|
|
@@ -58987,6 +59012,7 @@ const css$Y = /* css */`@layer navi {
|
|
|
58987
59012
|
--navi-fixed-bar-border-width: 1px;
|
|
58988
59013
|
--navi-fixed-bar-border-color: var(--navi-separator-color-default);
|
|
58989
59014
|
--navi-fixed-bar-padding: 0px;
|
|
59015
|
+
--navi-fixed-bar-shadow: none;
|
|
58990
59016
|
}
|
|
58991
59017
|
}
|
|
58992
59018
|
|
|
@@ -59051,6 +59077,46 @@ const css$Y = /* css */`@layer navi {
|
|
|
59051
59077
|
var(--navi-fixed-bar-border-color);
|
|
59052
59078
|
}
|
|
59053
59079
|
}
|
|
59080
|
+
|
|
59081
|
+
.navi_fixed_bar_shadow {
|
|
59082
|
+
z-index: -1;
|
|
59083
|
+
border-radius: inherit;
|
|
59084
|
+
box-shadow: var(--navi-fixed-bar-shadow);
|
|
59085
|
+
pointer-events: none;
|
|
59086
|
+
position: absolute;
|
|
59087
|
+
inset: 0;
|
|
59088
|
+
}
|
|
59089
|
+
|
|
59090
|
+
.navi_fixed_bar[data-area="top"] > .navi_fixed_bar_shadow {
|
|
59091
|
+
bottom: calc(-1 * var(--navi-fixed-bar-border-width));
|
|
59092
|
+
clip-path: inset(0 0 -100vh);
|
|
59093
|
+
}
|
|
59094
|
+
|
|
59095
|
+
.navi_fixed_bar[data-area="bottom"] > .navi_fixed_bar_shadow {
|
|
59096
|
+
top: calc(-1 * var(--navi-fixed-bar-border-width));
|
|
59097
|
+
clip-path: inset(-100vh 0 0);
|
|
59098
|
+
}
|
|
59099
|
+
|
|
59100
|
+
.navi_fixed_bar[data-area="left"] > .navi_fixed_bar_shadow {
|
|
59101
|
+
right: calc(-1 * var(--navi-fixed-bar-border-width));
|
|
59102
|
+
clip-path: inset(0 -100vw 0 0);
|
|
59103
|
+
}
|
|
59104
|
+
|
|
59105
|
+
.navi_fixed_bar[data-area="right"] > .navi_fixed_bar_shadow {
|
|
59106
|
+
left: calc(-1 * var(--navi-fixed-bar-border-width));
|
|
59107
|
+
clip-path: inset(0 0 0 -100vw);
|
|
59108
|
+
}
|
|
59109
|
+
|
|
59110
|
+
@supports (view-transition-name: match-element) {
|
|
59111
|
+
:root[data-navi-route-travel] .navi_fixed_bar_shadow, :root[data-navi-route-travel] [data-navi-fixed-bar-overhang] {
|
|
59112
|
+
view-transition-name: match-element;
|
|
59113
|
+
view-transition-class: navi_fixed_bar_over_pages;
|
|
59114
|
+
}
|
|
59115
|
+
}
|
|
59116
|
+
|
|
59117
|
+
:root[data-navi-route-travel-turned]::view-transition-group(.navi_fixed_bar_over_pages) {
|
|
59118
|
+
display: block;
|
|
59119
|
+
}
|
|
59054
59120
|
`;
|
|
59055
59121
|
const FixedBarStyleCSSVars = {
|
|
59056
59122
|
// width/height go through the vars the size calc reads: written as plain
|
|
@@ -59062,7 +59128,8 @@ const FixedBarStyleCSSVars = {
|
|
|
59062
59128
|
padding: "--navi-fixed-bar-padding",
|
|
59063
59129
|
background: "--navi-fixed-bar-background",
|
|
59064
59130
|
borderWidth: "--navi-fixed-bar-border-width",
|
|
59065
|
-
borderColor: "--navi-fixed-bar-border-color"
|
|
59131
|
+
borderColor: "--navi-fixed-bar-border-color",
|
|
59132
|
+
shadow: ["--navi-fixed-bar-shadow", "boxShadow"]
|
|
59066
59133
|
};
|
|
59067
59134
|
|
|
59068
59135
|
/**
|
|
@@ -59076,6 +59143,7 @@ const FixedBarStyleCSSVars = {
|
|
|
59076
59143
|
* border?: boolean,
|
|
59077
59144
|
* borderWidth?: string|number,
|
|
59078
59145
|
* borderColor?: string,
|
|
59146
|
+
* shadow?: string,
|
|
59079
59147
|
* }>}
|
|
59080
59148
|
* @param {"top"|"bottom"|"left"|"right"} [props.area="top"] - Which edge of
|
|
59081
59149
|
* the window it is pinned to. One bar per edge: a second one does not stack
|
|
@@ -59098,6 +59166,18 @@ const FixedBarStyleCSSVars = {
|
|
|
59098
59166
|
* @param {string|number} [props.padding=0] - Along the bar only: left/right on
|
|
59099
59167
|
* a top or bottom bar, top/bottom on a side one. Across it, the size is
|
|
59100
59168
|
* `height`/`width`.
|
|
59169
|
+
* @param {string} [props.shadow] - What the bar casts over the content, in
|
|
59170
|
+
* `box-shadow` syntax, cut at the bar's box on every side but the content's.
|
|
59171
|
+
* Takes no room. Prefer it to a `boxShadow` or a `filter` on the bar: those
|
|
59172
|
+
* are covered by the pages while a `RouteTravel` plays, this one stays over
|
|
59173
|
+
* them.
|
|
59174
|
+
*
|
|
59175
|
+
* A child standing out of the bar's box (a raised button, the notch around it)
|
|
59176
|
+
* wears `data-navi-fixed-bar-overhang`: unmarked, the pages of a `RouteTravel`
|
|
59177
|
+
* cover it wherever they have paint behind it. Marked, it stays over them, and
|
|
59178
|
+
* like anything photographed it is deaf for the length of the travel —
|
|
59179
|
+
* `pressableDuringRouteTransition` on a control inside it keeps that control
|
|
59180
|
+
* answering. The rest of the bar stays live.
|
|
59101
59181
|
*/
|
|
59102
59182
|
const FixedBar = ({
|
|
59103
59183
|
children,
|
|
@@ -59161,12 +59241,14 @@ const FixedBar = ({
|
|
|
59161
59241
|
setFixedBarSpace(area, barElement, null);
|
|
59162
59242
|
};
|
|
59163
59243
|
}, [area, vertical]);
|
|
59164
|
-
return
|
|
59244
|
+
return jsxs(Box, {
|
|
59165
59245
|
baseClassName: "navi_fixed_bar",
|
|
59166
59246
|
"data-area": area,
|
|
59167
59247
|
...props,
|
|
59168
59248
|
styleCSSVars: FixedBarStyleCSSVars,
|
|
59169
|
-
children: children
|
|
59249
|
+
children: [children, jsx("span", {
|
|
59250
|
+
className: "navi_fixed_bar_shadow"
|
|
59251
|
+
})]
|
|
59170
59252
|
});
|
|
59171
59253
|
};
|
|
59172
59254
|
|
|
@@ -62349,7 +62431,8 @@ const COMMAND_DEFAULT_PROPS_FACTORIES = {
|
|
|
62349
62431
|
* button in a bar the two states share, standing exactly where its picture is
|
|
62350
62432
|
* drawn — must still close it. What `<Link pressableDuringRouteTransition>`
|
|
62351
62433
|
* says, for the other half of a toggle. Only for a control that does not
|
|
62352
|
-
* travel with the pages.
|
|
62434
|
+
* travel with the pages. A `RouteTravel` honours it as well, for a control in
|
|
62435
|
+
* the part of a `FixedBar` it photographs (`data-navi-fixed-bar-overhang`).
|
|
62353
62436
|
* @param {Function} [action] What the press runs: a button holds no value, so
|
|
62354
62437
|
* every press is one call. Inside a `<Form>` or a group it carries the value
|
|
62355
62438
|
* around it, merged over the action's bound params — a value that is not an
|