@jsenv/navi 0.29.378 → 0.29.380
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 +44 -3
- package/dist/dev/jsenv_navi.js.map +4 -4
- package/dist/jsenv_navi.js +44 -3
- package/dist/jsenv_navi.js.map +4 -4
- package/docs/popup_lift.md +5 -1
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -48868,6 +48868,7 @@ const css$R = /* css */`.navi_expandable {
|
|
|
48868
48868
|
flex: 1;
|
|
48869
48869
|
align-items: center;
|
|
48870
48870
|
gap: .2em;
|
|
48871
|
+
min-width: 0;
|
|
48871
48872
|
display: flex;
|
|
48872
48873
|
}
|
|
48873
48874
|
}
|
|
@@ -48906,6 +48907,7 @@ const css$R = /* css */`.navi_expandable {
|
|
|
48906
48907
|
|
|
48907
48908
|
& > .navi_expandable_ui_label {
|
|
48908
48909
|
flex-direction: column;
|
|
48910
|
+
min-height: 0;
|
|
48909
48911
|
}
|
|
48910
48912
|
}
|
|
48911
48913
|
|
|
@@ -60068,6 +60070,10 @@ const ROOT_ATTRIBUTE = "data-navi-popup-lift";
|
|
|
60068
60070
|
// What the two boxes are to each other (Dialog's `lift`: "box" | "scene"),
|
|
60069
60071
|
// worn by the root too — it decides how each picture sits in the moving box.
|
|
60070
60072
|
const KIND_ATTRIBUTE = "data-navi-popup-lift-kind";
|
|
60073
|
+
// Worn by the root when the two pictures fit the moving box the whole way
|
|
60074
|
+
// (see picturesFitTheBox): the box's edge then has nothing to cut but the
|
|
60075
|
+
// pictures' own ink — a halo, a shadow — and the CSS lets it through.
|
|
60076
|
+
const FIT_ATTRIBUTE = "data-navi-popup-lift-fit";
|
|
60071
60077
|
// The one node that IS the anchor once in front: the popup itself, or a node
|
|
60072
60078
|
// inside it.
|
|
60073
60079
|
const TARGET_SELECTOR = "[data-lift]";
|
|
@@ -60187,6 +60193,7 @@ const liftPopupFromAnchor = (
|
|
|
60187
60193
|
giveBackNameArriving?.();
|
|
60188
60194
|
root.removeAttribute(ROOT_ATTRIBUTE);
|
|
60189
60195
|
root.removeAttribute(KIND_ATTRIBUTE);
|
|
60196
|
+
root.removeAttribute(FIT_ATTRIBUTE);
|
|
60190
60197
|
root.style.removeProperty(DURATION_PROPERTY);
|
|
60191
60198
|
root.style.removeProperty(BORDER_RADIUS_PROPERTY);
|
|
60192
60199
|
root.style.removeProperty(BACKGROUND_COLOR_PROPERTY);
|
|
@@ -60198,7 +60205,7 @@ const liftPopupFromAnchor = (
|
|
|
60198
60205
|
releaseScrollHold?.();
|
|
60199
60206
|
releaseScrollHold = trapScrollInside(popupEl, { backdrop: true });
|
|
60200
60207
|
const room = measureRoomBetweenBars();
|
|
60201
|
-
const boxLeaving =
|
|
60208
|
+
const boxLeaving = elementLeaving.getBoundingClientRect();
|
|
60202
60209
|
let boxArriving = null;
|
|
60203
60210
|
let cornersArriving = null;
|
|
60204
60211
|
const viewTransition = startViewTransition(async () => {
|
|
@@ -60216,8 +60223,9 @@ const liftPopupFromAnchor = (
|
|
|
60216
60223
|
if (elementArriving) {
|
|
60217
60224
|
giveBackNameArriving = wearLiftName(elementArriving);
|
|
60218
60225
|
cornersArriving = readCorners(elementArriving);
|
|
60219
|
-
|
|
60220
|
-
|
|
60226
|
+
boxArriving = elementArriving.getBoundingClientRect();
|
|
60227
|
+
if (picturesFitTheBox(lift, boxLeaving, boxArriving)) {
|
|
60228
|
+
root.setAttribute(FIT_ATTRIBUTE, "");
|
|
60221
60229
|
}
|
|
60222
60230
|
}
|
|
60223
60231
|
});
|
|
@@ -60486,6 +60494,30 @@ const animateMovingBox = ({ cornersFrom, cornersTo, room, boxFrom, boxTo }) => {
|
|
|
60486
60494
|
});
|
|
60487
60495
|
};
|
|
60488
60496
|
|
|
60497
|
+
// Whether both pictures fit the moving box from one end to the other. The
|
|
60498
|
+
// box's clip (dialog.jsx) is its edge for a picture larger than the box: what
|
|
60499
|
+
// a card gaining room uncovers, what a scene shows past the band cut from it.
|
|
60500
|
+
// Under "box" each picture keeps its own size, so both fit only when the two
|
|
60501
|
+
// boxes are the same size; under "scene" both are drawn as wide as the box
|
|
60502
|
+
// and centred, so they fit when the two boxes have the same aspect ratio —
|
|
60503
|
+
// each picture, drawn at the other box's width, is then that box's height.
|
|
60504
|
+
// A picture's ink past its own box (a halo, a shadow) is not content the clip
|
|
60505
|
+
// is there to cut, so when they fit, the clip is lifted.
|
|
60506
|
+
const picturesFitTheBox = (lift, boxFrom, boxTo) => {
|
|
60507
|
+
if (lift === "scene") {
|
|
60508
|
+
const heightFromAtWidthTo = (boxTo.width * boxFrom.height) / boxFrom.width;
|
|
60509
|
+
const heightToAtWidthFrom = (boxFrom.width * boxTo.height) / boxTo.width;
|
|
60510
|
+
return (
|
|
60511
|
+
Math.abs(heightFromAtWidthTo - boxTo.height) < 1 &&
|
|
60512
|
+
Math.abs(heightToAtWidthFrom - boxFrom.height) < 1
|
|
60513
|
+
);
|
|
60514
|
+
}
|
|
60515
|
+
return (
|
|
60516
|
+
Math.abs(boxFrom.width - boxTo.width) < 1 &&
|
|
60517
|
+
Math.abs(boxFrom.height - boxTo.height) < 1
|
|
60518
|
+
);
|
|
60519
|
+
};
|
|
60520
|
+
|
|
60489
60521
|
const insetToRoom = (room, box) =>
|
|
60490
60522
|
`inset(${room.top - box.top}px ${box.right - room.right}px ${box.bottom - room.bottom}px ${room.left - box.left}px)`;
|
|
60491
60523
|
|
|
@@ -61134,6 +61166,12 @@ const css$E = /* css */`
|
|
|
61134
61166
|
the box, and a change of width would read as the same card zooming
|
|
61135
61167
|
then swapping.
|
|
61136
61168
|
|
|
61169
|
+
A picture holds the element's ink past its own box too — a halo, a
|
|
61170
|
+
shadow — and the clip cuts that along with the content, at the box's
|
|
61171
|
+
corners. When both pictures fit the box the whole way (popup_lift.js,
|
|
61172
|
+
picturesFitTheBox) there is no content to uncover, only ink to lose:
|
|
61173
|
+
the clip is lifted and the box carries its ink along.
|
|
61174
|
+
|
|
61137
61175
|
The box paints what the lifted card paints behind its content
|
|
61138
61176
|
(published by popup_lift.js): where it has grown past the picture it
|
|
61139
61177
|
carries, it is the card that has grown. Its corners are those of the
|
|
@@ -61151,6 +61189,9 @@ const css$E = /* css */`
|
|
|
61151
61189
|
block-size: auto;
|
|
61152
61190
|
inline-size: auto;
|
|
61153
61191
|
}
|
|
61192
|
+
&[data-navi-popup-lift-fit]::view-transition-image-pair(navi-popup-lift) {
|
|
61193
|
+
overflow: visible;
|
|
61194
|
+
}
|
|
61154
61195
|
|
|
61155
61196
|
/* The card leaves as itself and arrives as what it became: the picture
|
|
61156
61197
|
being left stays whole for most of the way, the arriving one only shows
|