@jsenv/navi 0.29.61 → 0.29.62
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/jsenv_navi.js +37 -5
- package/dist/jsenv_navi.js.map +4 -3
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -30335,8 +30335,40 @@ const useDialogProps = props => {
|
|
|
30335
30335
|
// argument at all) docks it against the viewport (layer="top"/isModal)
|
|
30336
30336
|
// or its own positioned ancestor (layer="local", the same
|
|
30337
30337
|
// positionedAncestor computed above), same mechanism as Popover's own
|
|
30338
|
-
// custom renderer.
|
|
30339
|
-
// from the result, same as popover.jsx
|
|
30338
|
+
// custom renderer. applyDialogPosition sets --container-position-remaining-height/-width
|
|
30339
|
+
// from the result, same as popover.jsx — except for layer="top", see its
|
|
30340
|
+
// own comment just above.
|
|
30341
|
+
// The placement is a snapshot taken on a debounce; the size caps must not
|
|
30342
|
+
// be one too. applyNewPosition writes --container-position-remaining-
|
|
30343
|
+
// height/width on every reposition, from what pickPositionRelativeTo
|
|
30344
|
+
// measured the container as at that instant. For layer="top" that value
|
|
30345
|
+
// says nothing --dialog-maxmax-height/width doesn't already say live: the
|
|
30346
|
+
// container IS the visual viewport and Dialog is never anchored, so the
|
|
30347
|
+
// "remaining" space is always the whole container net of its own margins
|
|
30348
|
+
// — the very definition of --dialog-maxmax-*, which tracks the visual
|
|
30349
|
+
// viewport through --navi-vvh/--navi-app-height without waiting for
|
|
30350
|
+
// anything. Identical values, one of them one debounce late.
|
|
30351
|
+
//
|
|
30352
|
+
// That lag stays invisible while the viewport SHRINKS — the two are
|
|
30353
|
+
// combined with min(), so the live var is the one that binds and the
|
|
30354
|
+
// dialog follows the mobile keyboard down, its top edge pinned. On the
|
|
30355
|
+
// way back up the stale pixel value is the smaller one, so it binds
|
|
30356
|
+
// instead and the dialog stays keyboard-sized until the debounced
|
|
30357
|
+
// reposition fires — which then places a still-shrunk box in a
|
|
30358
|
+
// full-height viewport (centered: visibly lower), grows it in the same
|
|
30359
|
+
// call, and has to slide it back up: the bounce. Dropping the property
|
|
30360
|
+
// for layer="top" leaves the live var alone in charge, so the height
|
|
30361
|
+
// comes back exactly the way it left, from the bottom edge.
|
|
30362
|
+
//
|
|
30363
|
+
// Kept for layer="local": there the container is a real element, its own
|
|
30364
|
+
// box is what the caps must read, and nothing in CSS tracks it.
|
|
30365
|
+
const applyDialogPosition = position => {
|
|
30366
|
+
applyNewPosition(dialogEl, position);
|
|
30367
|
+
if (isModal) {
|
|
30368
|
+
dialogEl.style.removeProperty("--container-position-remaining-height");
|
|
30369
|
+
dialogEl.style.removeProperty("--container-position-remaining-width");
|
|
30370
|
+
}
|
|
30371
|
+
};
|
|
30340
30372
|
const positionDialog = triggerEvent => {
|
|
30341
30373
|
const {
|
|
30342
30374
|
positionArea,
|
|
@@ -30366,8 +30398,8 @@ const useDialogProps = props => {
|
|
|
30366
30398
|
event: triggerEvent
|
|
30367
30399
|
};
|
|
30368
30400
|
let position = pickPositionRelativeTo(dialogEl, null, pickOptions);
|
|
30369
|
-
|
|
30370
|
-
//
|
|
30401
|
+
applyDialogPosition(position);
|
|
30402
|
+
// applyDialogPosition above just set --container-position-remaining-
|
|
30371
30403
|
// width/height to the real available space — narrower than whatever
|
|
30372
30404
|
// dialogEl measured at just before (nothing, on a first open — see
|
|
30373
30405
|
// popover.jsx's own identical comment on its own positionPopover for
|
|
@@ -30380,7 +30412,7 @@ const useDialogProps = props => {
|
|
|
30380
30412
|
// correct it — that one only reacts on the *next* animation frame.
|
|
30381
30413
|
if (dialogEl.offsetWidth !== position.width || dialogEl.offsetHeight !== position.height) {
|
|
30382
30414
|
position = pickPositionRelativeTo(dialogEl, null, pickOptions);
|
|
30383
|
-
|
|
30415
|
+
applyDialogPosition(position);
|
|
30384
30416
|
}
|
|
30385
30417
|
// A descendant's own visibleRectEffect (visible_rect.js — e.g. a
|
|
30386
30418
|
// Callout anchored to something inside this Dialog) knowing to
|