@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/dev/jsenv_navi.js
CHANGED
|
@@ -49998,6 +49998,7 @@ const css$R = /* css */`.navi_expandable {
|
|
|
49998
49998
|
flex: 1;
|
|
49999
49999
|
align-items: center;
|
|
50000
50000
|
gap: .2em;
|
|
50001
|
+
min-width: 0;
|
|
50001
50002
|
display: flex;
|
|
50002
50003
|
}
|
|
50003
50004
|
}
|
|
@@ -50036,6 +50037,7 @@ const css$R = /* css */`.navi_expandable {
|
|
|
50036
50037
|
|
|
50037
50038
|
& > .navi_expandable_ui_label {
|
|
50038
50039
|
flex-direction: column;
|
|
50040
|
+
min-height: 0;
|
|
50039
50041
|
}
|
|
50040
50042
|
}
|
|
50041
50043
|
|
|
@@ -61281,6 +61283,10 @@ const ROOT_ATTRIBUTE = "data-navi-popup-lift";
|
|
|
61281
61283
|
// What the two boxes are to each other (Dialog's `lift`: "box" | "scene"),
|
|
61282
61284
|
// worn by the root too — it decides how each picture sits in the moving box.
|
|
61283
61285
|
const KIND_ATTRIBUTE = "data-navi-popup-lift-kind";
|
|
61286
|
+
// Worn by the root when the two pictures fit the moving box the whole way
|
|
61287
|
+
// (see picturesFitTheBox): the box's edge then has nothing to cut but the
|
|
61288
|
+
// pictures' own ink — a halo, a shadow — and the CSS lets it through.
|
|
61289
|
+
const FIT_ATTRIBUTE = "data-navi-popup-lift-fit";
|
|
61284
61290
|
// The one node that IS the anchor once in front: the popup itself, or a node
|
|
61285
61291
|
// inside it.
|
|
61286
61292
|
const TARGET_SELECTOR = "[data-lift]";
|
|
@@ -61400,6 +61406,7 @@ const liftPopupFromAnchor = (
|
|
|
61400
61406
|
giveBackNameArriving?.();
|
|
61401
61407
|
root.removeAttribute(ROOT_ATTRIBUTE);
|
|
61402
61408
|
root.removeAttribute(KIND_ATTRIBUTE);
|
|
61409
|
+
root.removeAttribute(FIT_ATTRIBUTE);
|
|
61403
61410
|
root.style.removeProperty(DURATION_PROPERTY);
|
|
61404
61411
|
root.style.removeProperty(BORDER_RADIUS_PROPERTY);
|
|
61405
61412
|
root.style.removeProperty(BACKGROUND_COLOR_PROPERTY);
|
|
@@ -61411,7 +61418,7 @@ const liftPopupFromAnchor = (
|
|
|
61411
61418
|
releaseScrollHold?.();
|
|
61412
61419
|
releaseScrollHold = trapScrollInside(popupEl, { backdrop: true });
|
|
61413
61420
|
const room = measureRoomBetweenBars();
|
|
61414
|
-
const boxLeaving =
|
|
61421
|
+
const boxLeaving = elementLeaving.getBoundingClientRect();
|
|
61415
61422
|
let boxArriving = null;
|
|
61416
61423
|
let cornersArriving = null;
|
|
61417
61424
|
const viewTransition = startViewTransition(async () => {
|
|
@@ -61429,8 +61436,9 @@ const liftPopupFromAnchor = (
|
|
|
61429
61436
|
if (elementArriving) {
|
|
61430
61437
|
giveBackNameArriving = wearLiftName(elementArriving);
|
|
61431
61438
|
cornersArriving = readCorners(elementArriving);
|
|
61432
|
-
|
|
61433
|
-
|
|
61439
|
+
boxArriving = elementArriving.getBoundingClientRect();
|
|
61440
|
+
if (picturesFitTheBox(lift, boxLeaving, boxArriving)) {
|
|
61441
|
+
root.setAttribute(FIT_ATTRIBUTE, "");
|
|
61434
61442
|
}
|
|
61435
61443
|
}
|
|
61436
61444
|
});
|
|
@@ -61734,6 +61742,30 @@ const animateMovingBox = ({ cornersFrom, cornersTo, room, boxFrom, boxTo }) => {
|
|
|
61734
61742
|
});
|
|
61735
61743
|
};
|
|
61736
61744
|
|
|
61745
|
+
// Whether both pictures fit the moving box from one end to the other. The
|
|
61746
|
+
// box's clip (dialog.jsx) is its edge for a picture larger than the box: what
|
|
61747
|
+
// a card gaining room uncovers, what a scene shows past the band cut from it.
|
|
61748
|
+
// Under "box" each picture keeps its own size, so both fit only when the two
|
|
61749
|
+
// boxes are the same size; under "scene" both are drawn as wide as the box
|
|
61750
|
+
// and centred, so they fit when the two boxes have the same aspect ratio —
|
|
61751
|
+
// each picture, drawn at the other box's width, is then that box's height.
|
|
61752
|
+
// A picture's ink past its own box (a halo, a shadow) is not content the clip
|
|
61753
|
+
// is there to cut, so when they fit, the clip is lifted.
|
|
61754
|
+
const picturesFitTheBox = (lift, boxFrom, boxTo) => {
|
|
61755
|
+
if (lift === "scene") {
|
|
61756
|
+
const heightFromAtWidthTo = (boxTo.width * boxFrom.height) / boxFrom.width;
|
|
61757
|
+
const heightToAtWidthFrom = (boxFrom.width * boxTo.height) / boxTo.width;
|
|
61758
|
+
return (
|
|
61759
|
+
Math.abs(heightFromAtWidthTo - boxTo.height) < 1 &&
|
|
61760
|
+
Math.abs(heightToAtWidthFrom - boxFrom.height) < 1
|
|
61761
|
+
);
|
|
61762
|
+
}
|
|
61763
|
+
return (
|
|
61764
|
+
Math.abs(boxFrom.width - boxTo.width) < 1 &&
|
|
61765
|
+
Math.abs(boxFrom.height - boxTo.height) < 1
|
|
61766
|
+
);
|
|
61767
|
+
};
|
|
61768
|
+
|
|
61737
61769
|
const insetToRoom = (room, box) =>
|
|
61738
61770
|
`inset(${room.top - box.top}px ${box.right - room.right}px ${box.bottom - room.bottom}px ${room.left - box.left}px)`;
|
|
61739
61771
|
|
|
@@ -62382,6 +62414,12 @@ const css$E = /* css */`
|
|
|
62382
62414
|
the box, and a change of width would read as the same card zooming
|
|
62383
62415
|
then swapping.
|
|
62384
62416
|
|
|
62417
|
+
A picture holds the element's ink past its own box too — a halo, a
|
|
62418
|
+
shadow — and the clip cuts that along with the content, at the box's
|
|
62419
|
+
corners. When both pictures fit the box the whole way (popup_lift.js,
|
|
62420
|
+
picturesFitTheBox) there is no content to uncover, only ink to lose:
|
|
62421
|
+
the clip is lifted and the box carries its ink along.
|
|
62422
|
+
|
|
62385
62423
|
The box paints what the lifted card paints behind its content
|
|
62386
62424
|
(published by popup_lift.js): where it has grown past the picture it
|
|
62387
62425
|
carries, it is the card that has grown. Its corners are those of the
|
|
@@ -62399,6 +62437,9 @@ const css$E = /* css */`
|
|
|
62399
62437
|
block-size: auto;
|
|
62400
62438
|
inline-size: auto;
|
|
62401
62439
|
}
|
|
62440
|
+
&[data-navi-popup-lift-fit]::view-transition-image-pair(navi-popup-lift) {
|
|
62441
|
+
overflow: visible;
|
|
62442
|
+
}
|
|
62402
62443
|
|
|
62403
62444
|
/* The card leaves as itself and arrives as what it became: the picture
|
|
62404
62445
|
being left stays whole for most of the way, the arriving one only shows
|