@jsenv/dom 0.17.20 → 0.17.22
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_dom.js +266 -49
- package/package.json +1 -1
package/dist/jsenv_dom.js
CHANGED
|
@@ -8159,6 +8159,18 @@ const css$5 = /* css */`
|
|
|
8159
8159
|
}
|
|
8160
8160
|
`;
|
|
8161
8161
|
import.meta.css = [css$5, "@jsenv/dom/src/interaction/drag/drag_gesture.js"];
|
|
8162
|
+
|
|
8163
|
+
/*
|
|
8164
|
+
* Who asked for the capture of a pointer, last. This module is the only place
|
|
8165
|
+
* that ever takes one, so the answer says whether a capture that goes was HANDED
|
|
8166
|
+
* OVER — somebody here took it — or simply LET GO OF by the browser, which does
|
|
8167
|
+
* that on its own more often than the specification suggests, in the middle of a
|
|
8168
|
+
* gesture whose hand is still down and still moving.
|
|
8169
|
+
*
|
|
8170
|
+
* The two must not be answered the same way, and nothing in the event tells them
|
|
8171
|
+
* apart: `lostpointercapture` says the same thing either way.
|
|
8172
|
+
*/
|
|
8173
|
+
const captureHolderByPointerId = new Map();
|
|
8162
8174
|
const createDragGestureController = (options = {}) => {
|
|
8163
8175
|
const {
|
|
8164
8176
|
name,
|
|
@@ -8786,6 +8798,11 @@ const createDragGestureController = (options = {}) => {
|
|
|
8786
8798
|
let captured = false;
|
|
8787
8799
|
dragGesture.capturePointer = () => {
|
|
8788
8800
|
captured = true;
|
|
8801
|
+
// Written down before it is taken: this is the only place a capture
|
|
8802
|
+
// is ever taken from, so what this map says is who asked for it
|
|
8803
|
+
// last — which is what tells a hand-over from a capture the browser
|
|
8804
|
+
// dropped on its own (see onCaptureLost).
|
|
8805
|
+
captureHolderByPointerId.set(grabEvent.pointerId, dragGesture);
|
|
8789
8806
|
target.setPointerCapture(grabEvent.pointerId);
|
|
8790
8807
|
};
|
|
8791
8808
|
if (!options?.pointerCaptureDeferred) {
|
|
@@ -8833,16 +8850,46 @@ const createDragGestureController = (options = {}) => {
|
|
|
8833
8850
|
// above it), and taken as our own it kills the new gesture one
|
|
8834
8851
|
// millisecond after it started.
|
|
8835
8852
|
//
|
|
8836
|
-
// And when it IS ours, it is a loss
|
|
8837
|
-
// has are the pointer going up and the pointer being
|
|
8838
|
-
// listened for below.
|
|
8839
|
-
//
|
|
8840
|
-
//
|
|
8841
|
-
//
|
|
8853
|
+
// And when it IS ours, it is a loss and never an end: the ends a
|
|
8854
|
+
// gesture has are the pointer going up and the pointer being
|
|
8855
|
+
// cancelled, both listened for below. What a loss MEANS is the
|
|
8856
|
+
// question, and the event does not answer it — two very different
|
|
8857
|
+
// things arrive as the same one:
|
|
8858
|
+
//
|
|
8859
|
+
// - it was HANDED OVER: another gesture took the pointer, or the
|
|
8860
|
+
// element it was held on left the document. There is nothing to go
|
|
8861
|
+
// on with, and what was being carried must go back rather than land
|
|
8862
|
+
// wherever the hand happened to be.
|
|
8863
|
+
// - it was simply LET GO OF by the browser, with the hand still down
|
|
8864
|
+
// and still moving. It happens, and not rarely: the capture is a
|
|
8865
|
+
// guarantee that events keep coming to one element, and the browser
|
|
8866
|
+
// drops it for reasons of its own that no code here can see. Killing
|
|
8867
|
+
// the gesture for that is dropping an object mid-air — the copy
|
|
8868
|
+
// vanishes, the place the hint had lit up is thrown away, and the
|
|
8869
|
+
// hand is left having done nothing.
|
|
8870
|
+
//
|
|
8871
|
+
// They are told apart by who asked (see captureHolderByPointerId): a
|
|
8872
|
+
// capture nobody here took, on an element still in the document, was
|
|
8873
|
+
// let go of. The gesture does not need it — every move and the release
|
|
8874
|
+
// are read at the WINDOW, not at the element — so it goes on.
|
|
8842
8875
|
const onCaptureLost = pointerEvent => {
|
|
8843
8876
|
if (!captured || pointerEvent.target !== target) {
|
|
8844
8877
|
return;
|
|
8845
8878
|
}
|
|
8879
|
+
const handedOver = captureHolderByPointerId.get(grabEvent.pointerId) !== dragGesture;
|
|
8880
|
+
if (!handedOver && target.isConnected) {
|
|
8881
|
+
// Nobody took it and the element it was held on is still there:
|
|
8882
|
+
// the browser let the capture go by itself, which it does — a
|
|
8883
|
+
// node moved by a re-render and put straight back, a decision of
|
|
8884
|
+
// its own we are not told the reason for. The hand has not let go
|
|
8885
|
+
// of anything, so neither does the gesture: it is a guarantee that
|
|
8886
|
+
// was lost, not the gesture. Every move and the release are read
|
|
8887
|
+
// at the window (see below), so it goes on without it rather than
|
|
8888
|
+
// dropping what is still being carried — and the drop the hand was
|
|
8889
|
+
// aiming at, which the hint had already lit up, still happens.
|
|
8890
|
+
captured = false;
|
|
8891
|
+
return;
|
|
8892
|
+
}
|
|
8846
8893
|
onRelease(pointerEvent, {
|
|
8847
8894
|
cancelled: true
|
|
8848
8895
|
});
|
|
@@ -8902,6 +8949,9 @@ const createDragGestureController = (options = {}) => {
|
|
|
8902
8949
|
// that is up no longer exists — the browser has already dropped the
|
|
8903
8950
|
// capture with it, and asking again throws ("No active pointer with
|
|
8904
8951
|
// the given id is found") on the most ordinary release there is.
|
|
8952
|
+
if (captureHolderByPointerId.get(grabEvent.pointerId) === dragGesture) {
|
|
8953
|
+
captureHolderByPointerId.delete(grabEvent.pointerId);
|
|
8954
|
+
}
|
|
8905
8955
|
if (captured && target.hasPointerCapture(grabEvent.pointerId)) {
|
|
8906
8956
|
target.releasePointerCapture(grabEvent.pointerId);
|
|
8907
8957
|
}
|
|
@@ -11064,7 +11114,10 @@ const roundForConstraints = (value) => {
|
|
|
11064
11114
|
|
|
11065
11115
|
/**
|
|
11066
11116
|
* Detects the drop target based on what element is actually under the mouse cursor.
|
|
11067
|
-
* Uses document.elementsFromPoint() to respect visual stacking order naturally
|
|
11117
|
+
* Uses document.elementsFromPoint() to respect visual stacking order naturally,
|
|
11118
|
+
* and falls back on the rectangles alone when the hit test cannot answer — which
|
|
11119
|
+
* is not only "over nothing": during a view transition the browser hands back the
|
|
11120
|
+
* root for every point of the page (see findTargetByGeometry).
|
|
11068
11121
|
*
|
|
11069
11122
|
* @param {Object} gestureInfo - Gesture information
|
|
11070
11123
|
* @param {Element[]} targetElements - Array of potential drop target elements
|
|
@@ -11203,8 +11256,20 @@ const getDropTargetInfo = (
|
|
|
11203
11256
|
}
|
|
11204
11257
|
}
|
|
11205
11258
|
if (!targetElement) {
|
|
11206
|
-
|
|
11207
|
-
|
|
11259
|
+
// Nothing in the stack answered. The point may be over no target at all —
|
|
11260
|
+
// and it may also be over one the hit test cannot see: a view transition
|
|
11261
|
+
// covers the page with its pictures, and from then on every point of the
|
|
11262
|
+
// document reads as the root, whatever is really under it. Taking the first
|
|
11263
|
+
// of the overlapped targets then means taking the first one in DOM ORDER,
|
|
11264
|
+
// which has nothing to do with where the hand is: a piece carried onto the
|
|
11265
|
+
// place next door comes back down on the place it left, and the hint says so
|
|
11266
|
+
// by lighting up the wrong one.
|
|
11267
|
+
//
|
|
11268
|
+
// Geometry is what is left, and it is the reading the eye makes anyway: the
|
|
11269
|
+
// place the middle of the carried thing is IN, or — the middle being over a
|
|
11270
|
+
// gap — the one it covers most of.
|
|
11271
|
+
targetElement = findTargetByGeometry(intersectingTargets, dragElementRect);
|
|
11272
|
+
intersectingIndex = intersectingTargets.indexOf(targetElement);
|
|
11208
11273
|
}
|
|
11209
11274
|
targetIndex = targetElements.indexOf(targetElement);
|
|
11210
11275
|
|
|
@@ -11257,6 +11322,41 @@ const getDropTargetInfo = (
|
|
|
11257
11322
|
return result;
|
|
11258
11323
|
};
|
|
11259
11324
|
|
|
11325
|
+
/**
|
|
11326
|
+
* Which of the overlapped targets the carried thing is on, said with rectangles
|
|
11327
|
+
* alone: the one holding its centre, or the one it covers the most of. Used when
|
|
11328
|
+
* the hit test cannot answer (see its caller).
|
|
11329
|
+
*/
|
|
11330
|
+
const findTargetByGeometry = (targetElements, dragElementRect) => {
|
|
11331
|
+
const dragCenterX = dragElementRect.left + dragElementRect.width / 2;
|
|
11332
|
+
const dragCenterY = dragElementRect.top + dragElementRect.height / 2;
|
|
11333
|
+
let bestElement = null;
|
|
11334
|
+
let bestOverlapArea = -1;
|
|
11335
|
+
for (const targetElement of targetElements) {
|
|
11336
|
+
const targetRect = targetElement.getBoundingClientRect();
|
|
11337
|
+
if (
|
|
11338
|
+
dragCenterX >= targetRect.left &&
|
|
11339
|
+
dragCenterX <= targetRect.right &&
|
|
11340
|
+
dragCenterY >= targetRect.top &&
|
|
11341
|
+
dragCenterY <= targetRect.bottom
|
|
11342
|
+
) {
|
|
11343
|
+
return targetElement;
|
|
11344
|
+
}
|
|
11345
|
+
const overlapWidth =
|
|
11346
|
+
Math.min(targetRect.right, dragElementRect.right) -
|
|
11347
|
+
Math.max(targetRect.left, dragElementRect.left);
|
|
11348
|
+
const overlapHeight =
|
|
11349
|
+
Math.min(targetRect.bottom, dragElementRect.bottom) -
|
|
11350
|
+
Math.max(targetRect.top, dragElementRect.top);
|
|
11351
|
+
const overlapArea = overlapWidth * overlapHeight;
|
|
11352
|
+
if (overlapArea > bestOverlapArea) {
|
|
11353
|
+
bestOverlapArea = overlapArea;
|
|
11354
|
+
bestElement = targetElement;
|
|
11355
|
+
}
|
|
11356
|
+
}
|
|
11357
|
+
return bestElement;
|
|
11358
|
+
};
|
|
11359
|
+
|
|
11260
11360
|
const rectangleAreIntersecting = (r1, r2) => {
|
|
11261
11361
|
return !(
|
|
11262
11362
|
r2.left > r1.right ||
|
|
@@ -14363,6 +14463,90 @@ const stickyAsRelativeCoords = (
|
|
|
14363
14463
|
return [leftPosition, topPosition];
|
|
14364
14464
|
};
|
|
14365
14465
|
|
|
14466
|
+
/**
|
|
14467
|
+
* The on-screen keyboard, when the app takes it over.
|
|
14468
|
+
*
|
|
14469
|
+
* By default a mobile browser answers the keyboard by shrinking the VISUAL
|
|
14470
|
+
* viewport, and everything sized against that viewport follows for free —
|
|
14471
|
+
* which is what the whole positioning layer here already relies on (see
|
|
14472
|
+
* pickPositionRelativeTo's own visualViewport reads). The VirtualKeyboard API
|
|
14473
|
+
* (Chromium only — no Firefox, no Safari) offers the other deal:
|
|
14474
|
+
* `overlaysContent = true` and the keyboard stops resizing anything, painting
|
|
14475
|
+
* over the page instead, while its geometry becomes readable — `boundingRect`
|
|
14476
|
+
* and a `geometrychange` event here, `env(keyboard-inset-*)` in CSS.
|
|
14477
|
+
*
|
|
14478
|
+
* That deal has to be taken whole: the instant the viewport stops shrinking,
|
|
14479
|
+
* whoever was sizing against it is sizing against a rectangle the keyboard now
|
|
14480
|
+
* covers. So this module answers ONE question — how many pixels at the bottom
|
|
14481
|
+
* of the visual viewport the keyboard covers — and the positioning layer
|
|
14482
|
+
* subtracts it. The answer is 0 in every other case (unsupported, never opted
|
|
14483
|
+
* in, keyboard closed), which is exactly what makes the two paths one path:
|
|
14484
|
+
* where the browser shrinks the viewport itself, there is nothing left to
|
|
14485
|
+
* subtract.
|
|
14486
|
+
*
|
|
14487
|
+
* Why take the deal at all, then, if the outcome is meant to match? Because a
|
|
14488
|
+
* resizing viewport is a resize of EVERYTHING, whether or not it had anything
|
|
14489
|
+
* to do with the field being typed into — the page reflows, fixed bars move,
|
|
14490
|
+
* and a mobile browser fires that resize transiently as focus goes from one
|
|
14491
|
+
* input to the next. Overlaying leaves the layout alone and hands over a
|
|
14492
|
+
* number instead. So navi takes it by default (see its own index.js) and only
|
|
14493
|
+
* offers a way back out, for an app whose own layout was built around the
|
|
14494
|
+
* viewport shrinking.
|
|
14495
|
+
*/
|
|
14496
|
+
|
|
14497
|
+
const virtualKeyboard = window.navigator.virtualKeyboard;
|
|
14498
|
+
|
|
14499
|
+
/**
|
|
14500
|
+
* Whether the keyboard overlays the content instead of resizing the viewport.
|
|
14501
|
+
* Returns whether it applies at all — false means the browser has no
|
|
14502
|
+
* VirtualKeyboard API and keeps shrinking the visual viewport, which is the
|
|
14503
|
+
* behavior everything here already follows, so there is nothing to report to
|
|
14504
|
+
* the caller beyond "not this way".
|
|
14505
|
+
*/
|
|
14506
|
+
const setVirtualKeyboardOverlaysContent = (value) => {
|
|
14507
|
+
if (!virtualKeyboard) {
|
|
14508
|
+
return false;
|
|
14509
|
+
}
|
|
14510
|
+
virtualKeyboard.overlaysContent = value;
|
|
14511
|
+
return true;
|
|
14512
|
+
};
|
|
14513
|
+
|
|
14514
|
+
/**
|
|
14515
|
+
* How many pixels at the bottom of the visual viewport the keyboard currently
|
|
14516
|
+
* covers — 0 unless the app opted in above AND the keyboard is up.
|
|
14517
|
+
*
|
|
14518
|
+
* `boundingRect` is all-zero when the keyboard is hidden, and also while
|
|
14519
|
+
* `overlaysContent` is false: a keyboard that resized the viewport covers
|
|
14520
|
+
* nothing that is left of it, so the zero is the right answer rather than a
|
|
14521
|
+
* missing one.
|
|
14522
|
+
*/
|
|
14523
|
+
const getVirtualKeyboardOverlayHeight = () => {
|
|
14524
|
+
if (!virtualKeyboard) {
|
|
14525
|
+
return 0;
|
|
14526
|
+
}
|
|
14527
|
+
const { height } = virtualKeyboard.boundingRect;
|
|
14528
|
+
return height > 0 ? height : 0;
|
|
14529
|
+
};
|
|
14530
|
+
|
|
14531
|
+
/**
|
|
14532
|
+
* Calls `callback` whenever the keyboard shows, hides or resizes. Returns an
|
|
14533
|
+
* unsubscribe function; a no-op (never calls back) without support.
|
|
14534
|
+
*
|
|
14535
|
+
* Undebounced on purpose, unlike window/visualViewport resize
|
|
14536
|
+
* (window_size.js): "geometrychange" is not the transient storm those are —
|
|
14537
|
+
* it fires on the keyboard itself changing, not on the layout reacting to it,
|
|
14538
|
+
* which is the whole point of overlaying.
|
|
14539
|
+
*/
|
|
14540
|
+
const subscribeVirtualKeyboardGeometryChange = (callback) => {
|
|
14541
|
+
if (!virtualKeyboard) {
|
|
14542
|
+
return () => {};
|
|
14543
|
+
}
|
|
14544
|
+
virtualKeyboard.addEventListener("geometrychange", callback);
|
|
14545
|
+
return () => {
|
|
14546
|
+
virtualKeyboard.removeEventListener("geometrychange", callback);
|
|
14547
|
+
};
|
|
14548
|
+
};
|
|
14549
|
+
|
|
14366
14550
|
// Both "resize" sources fire transiently on mobile (keyboard/UI chrome
|
|
14367
14551
|
// briefly shifting when focus moves between inputs) — debounced so
|
|
14368
14552
|
// consumers skip that in-between state. One shared timer per source (not
|
|
@@ -14377,17 +14561,29 @@ const [publishVisualViewportResize, subscribeVisualViewportResizeSettled] =
|
|
|
14377
14561
|
createPubSub();
|
|
14378
14562
|
const [publishWindowResize, subscribeWindowResizeSettled] = createPubSub();
|
|
14379
14563
|
|
|
14564
|
+
let visualViewportResizeTimeoutId;
|
|
14565
|
+
const scheduleVisualViewportResize = (event) => {
|
|
14566
|
+
visualViewportResizePending = true;
|
|
14567
|
+
clearTimeout(visualViewportResizeTimeoutId);
|
|
14568
|
+
visualViewportResizeTimeoutId = setTimeout(() => {
|
|
14569
|
+
visualViewportResizePending = false;
|
|
14570
|
+
publishVisualViewportResize(event);
|
|
14571
|
+
}, RESIZE_SETTLE_MS);
|
|
14572
|
+
};
|
|
14380
14573
|
if (window.visualViewport) {
|
|
14381
|
-
|
|
14382
|
-
|
|
14383
|
-
|
|
14384
|
-
|
|
14385
|
-
timeoutId = setTimeout(() => {
|
|
14386
|
-
visualViewportResizePending = false;
|
|
14387
|
-
publishVisualViewportResize(event);
|
|
14388
|
-
}, RESIZE_SETTLE_MS);
|
|
14389
|
-
});
|
|
14574
|
+
window.visualViewport.addEventListener(
|
|
14575
|
+
"resize",
|
|
14576
|
+
scheduleVisualViewportResize,
|
|
14577
|
+
);
|
|
14390
14578
|
}
|
|
14579
|
+
// The same event, said differently: where the keyboard overlays the content
|
|
14580
|
+
// (virtual_keyboard.js) there is no visualViewport resize at all when it
|
|
14581
|
+
// opens — the room left to place anything in changed
|
|
14582
|
+
// all the same, and every consumer here asks the same question either way
|
|
14583
|
+
// (getVisibleViewportRect in visible_rect.js already subtracts it). Through
|
|
14584
|
+
// the same debounce, and for the same reason: going straight from one input
|
|
14585
|
+
// to the next hides and re-shows the keyboard.
|
|
14586
|
+
subscribeVirtualKeyboardGeometryChange(scheduleVisualViewportResize);
|
|
14391
14587
|
|
|
14392
14588
|
let windowResizeTimeoutId;
|
|
14393
14589
|
window.addEventListener("resize", (event) => {
|
|
@@ -14406,6 +14602,39 @@ window.addEventListener("resize", (event) => {
|
|
|
14406
14602
|
}, RESIZE_SETTLE_MS);
|
|
14407
14603
|
});
|
|
14408
14604
|
|
|
14605
|
+
/**
|
|
14606
|
+
* The part of the viewport something can actually be placed in.
|
|
14607
|
+
*
|
|
14608
|
+
* visualViewport, not the layout viewport: only the visual one shrinks when
|
|
14609
|
+
* the on-screen keyboard opens (where the browser is the one shrinking it —
|
|
14610
|
+
* see below). Its offsetLeft/Top matter too, for pinch-zoom/pan.
|
|
14611
|
+
*
|
|
14612
|
+
* document.documentElement.clientWidth/Height is the fallback without
|
|
14613
|
+
* visualViewport support — the layout viewport net of any classic scrollbar,
|
|
14614
|
+
* which is what visualViewport itself reports, unlike window.innerWidth/Height
|
|
14615
|
+
* which counts the scrollbar in. Both readings existed here, one per call
|
|
14616
|
+
* site, for no reason anyone stated; they only ever differed by that scrollbar
|
|
14617
|
+
* and only on browsers with no visualViewport at all.
|
|
14618
|
+
*
|
|
14619
|
+
* The keyboard is then subtracted rather than assumed to have already shrunk
|
|
14620
|
+
* the viewport: with `overlaysContent` (virtual_keyboard.js, navi turns it on)
|
|
14621
|
+
* the viewport stays full height and the keyboard is painted over its bottom.
|
|
14622
|
+
* Zero everywhere else, the browser having done the subtraction itself.
|
|
14623
|
+
*/
|
|
14624
|
+
const getVisibleViewportRect = () => {
|
|
14625
|
+
const visualViewport = window.visualViewport;
|
|
14626
|
+
const documentElement = document.documentElement;
|
|
14627
|
+
const height = visualViewport
|
|
14628
|
+
? visualViewport.height
|
|
14629
|
+
: documentElement.clientHeight;
|
|
14630
|
+
return {
|
|
14631
|
+
left: visualViewport ? visualViewport.offsetLeft : 0,
|
|
14632
|
+
top: visualViewport ? visualViewport.offsetTop : 0,
|
|
14633
|
+
width: visualViewport ? visualViewport.width : documentElement.clientWidth,
|
|
14634
|
+
height: Math.max(0, height - getVirtualKeyboardOverlayHeight()),
|
|
14635
|
+
};
|
|
14636
|
+
};
|
|
14637
|
+
|
|
14409
14638
|
// Minimum fraction of element width/height that must be visible on the preferred side
|
|
14410
14639
|
// before flipping to the opposite side. Prevents flickering near the flip threshold.
|
|
14411
14640
|
const MIN_CONTENT_VISIBILITY_RATIO = 0.6;
|
|
@@ -14528,23 +14757,17 @@ const visibleRectEffect = (
|
|
|
14528
14757
|
const UNSET_EVENT = { type: "unset" };
|
|
14529
14758
|
const check = (event = UNSET_EVENT) => {
|
|
14530
14759
|
|
|
14531
|
-
//
|
|
14532
|
-
//
|
|
14533
|
-
// pickPositionRelativeTo's
|
|
14534
|
-
//
|
|
14535
|
-
//
|
|
14536
|
-
|
|
14537
|
-
|
|
14538
|
-
|
|
14539
|
-
|
|
14540
|
-
|
|
14541
|
-
|
|
14542
|
-
: window.innerWidth;
|
|
14543
|
-
const viewportHeight = visualViewport
|
|
14544
|
-
? visualViewport.height
|
|
14545
|
-
: window.innerHeight;
|
|
14546
|
-
const viewportOffsetLeft = visualViewport ? visualViewport.offsetLeft : 0;
|
|
14547
|
-
const viewportOffsetTop = visualViewport ? visualViewport.offsetTop : 0;
|
|
14760
|
+
// Computed here regardless of scroll container (not just where the
|
|
14761
|
+
// non-document branch below needs it) because a keyboard opening can
|
|
14762
|
+
// change pickPositionRelativeTo's available space without moving this
|
|
14763
|
+
// element's own visibleRect at all — see viewportRectChanged further
|
|
14764
|
+
// down.
|
|
14765
|
+
const {
|
|
14766
|
+
left: viewportOffsetLeft,
|
|
14767
|
+
top: viewportOffsetTop,
|
|
14768
|
+
width: viewportWidth,
|
|
14769
|
+
height: viewportHeight,
|
|
14770
|
+
} = getVisibleViewportRect();
|
|
14548
14771
|
|
|
14549
14772
|
// 1. Calculate element position relative to scrollable parent
|
|
14550
14773
|
const { scrollLeft, scrollTop } = scrollContainer;
|
|
@@ -15401,19 +15624,13 @@ const pickPositionRelativeTo = (
|
|
|
15401
15624
|
container,
|
|
15402
15625
|
} = {},
|
|
15403
15626
|
) => {
|
|
15404
|
-
// Needed before hasValidAnchor below.
|
|
15405
|
-
|
|
15406
|
-
|
|
15407
|
-
|
|
15408
|
-
|
|
15409
|
-
|
|
15410
|
-
|
|
15411
|
-
: document.documentElement.clientWidth;
|
|
15412
|
-
const viewportHeight = visualViewport
|
|
15413
|
-
? visualViewport.height
|
|
15414
|
-
: document.documentElement.clientHeight;
|
|
15415
|
-
const viewportLeft = visualViewport ? visualViewport.offsetLeft : 0;
|
|
15416
|
-
const viewportTop = visualViewport ? visualViewport.offsetTop : 0;
|
|
15627
|
+
// Needed before hasValidAnchor below.
|
|
15628
|
+
const {
|
|
15629
|
+
left: viewportLeft,
|
|
15630
|
+
top: viewportTop,
|
|
15631
|
+
width: viewportWidth,
|
|
15632
|
+
height: viewportHeight,
|
|
15633
|
+
} = getVisibleViewportRect();
|
|
15417
15634
|
|
|
15418
15635
|
// Resolved early: everything below that would otherwise reach for
|
|
15419
15636
|
// viewportLeft/Top/Width/Height instead uses these, so a "local" popover
|
|
@@ -19406,4 +19623,4 @@ const useResizeStatus = (elementRef, { as = "number" } = {}) => {
|
|
|
19406
19623
|
};
|
|
19407
19624
|
};
|
|
19408
19625
|
|
|
19409
|
-
export { EASING, ELEMENT_SIZE_CHANGE, activeElementSignal, addActiveElementEffect, addAttributeEffect, allowWheelThrough, appendStyles, applyNewPosition, canScroll, captureScrollState, chainEvent, claimWheelGesture, closestOpenableAncestor, contrastColor, createBackgroundColorTransition, createBackgroundTransition, createBorderRadiusTransition, createBorderTransition, createDragGestureController, createDragToMoveGestureController, createEventGroupLogger, createGroupTransitionController, createHeightTransition, createIterableWeakSet, createOpacityTransition, createPubSub, createStyleController, createTimelineTransition, createTransition, createTranslateXTransition, createValueEffect, createWidthTransition, cubicBezier, dispatchCustomEvent, dispatchInternalCustomEvent, dispatchPublicCustomEvent, dragAfterIntent, elementIsFocusable, elementIsVisibleForFocus, elementIsVisuallyVisible, findAfter, findAncestor, findBefore, findDescendant, findEvent, findFocusDelegateTarget, findFocusable, findSelfOrAncestorFixedPosition, formatEventSideEffect, getAncestorOpenType, getAvailableHeight, getAvailableWidth, getBackground, getBackgroundColor, getBorder, getBorderRadius, getBorderSizes, getContrastRatio, getDefaultStyles, getDragCoordinates, getDropTargetInfo, getElementSignature, getFirstVisuallyVisibleAncestor, getFocusVisibilityInfo, getHeight, getHeightWithoutTransition, getInnerHeight, getInnerWidth, getKeyboardEventDefaultAction, getLuminance, getMarginSizes, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpacity, getOpacityWithoutTransition, getPaddingSizes, getPositionedParent, getPositioningScrollOffset, getPreferedColorScheme, getScrollBox, getScrollContainer, getScrollContainerSet, getScrollRelativeRect, getSelfAndAncestorScrolls, getStyle, getTranslateX, getTranslateXWithoutTransition, getTranslateY, getVisuallyVisibleInfo, getWidth, getWidthWithoutTransition, hasCSSSizeUnit, initFlexDetailsSet, initFocusGroup, initPositionSticky, isAncestorOpen, isPrimaryButtonEvent, isSameColor, isScrollable, markDragSource, measureLongestVisualLineWidth, measureScrollbar, measureWidestChildRow, mergeOneStyle, mergeTwoStyles, normalizeKeyboardKey, normalizeStyle, normalizeStyles, observeAncestorOpenState, onAncestorReopen, parsePositionArea, parseStyle, performTabNavigation, pickPositionRelativeTo, prefersDarkColors, prefersLightColors, preventFocusNav, preventFocusNavViaKeyboard, preventIntermediateScrollbar, releaseWheelGesture, resolveCSSColor, resolveCSSSize, resolveColorLuminance, resolveOklchLightness, scrollIntoViewScoped, scrollIntoViewWithStickyAwareness, scrollRoomTowards, setAttribute, setAttributes, setStyles, snapToPixel, startDragTo, startDragToResizeGesture, startDragToTravel, stickyAsRelativeCoords, stringifyStyle, subscribeVisualViewportResizeSettled, subscribeWindowResizeSettled, suppressClickAfterGesture, trapFocusInside, trapScrollInside, useActiveElement, useAvailableHeight, useAvailableWidth, useMaxHeight, useMaxWidth, useResizeStatus, visibleRectEffect, waitForPressHeld, watchWheelTravel, wheelGestureIsTakenFrom };
|
|
19626
|
+
export { EASING, ELEMENT_SIZE_CHANGE, activeElementSignal, addActiveElementEffect, addAttributeEffect, allowWheelThrough, appendStyles, applyNewPosition, canScroll, captureScrollState, chainEvent, claimWheelGesture, closestOpenableAncestor, contrastColor, createBackgroundColorTransition, createBackgroundTransition, createBorderRadiusTransition, createBorderTransition, createDragGestureController, createDragToMoveGestureController, createEventGroupLogger, createGroupTransitionController, createHeightTransition, createIterableWeakSet, createOpacityTransition, createPubSub, createStyleController, createTimelineTransition, createTransition, createTranslateXTransition, createValueEffect, createWidthTransition, cubicBezier, dispatchCustomEvent, dispatchInternalCustomEvent, dispatchPublicCustomEvent, dragAfterIntent, elementIsFocusable, elementIsVisibleForFocus, elementIsVisuallyVisible, findAfter, findAncestor, findBefore, findDescendant, findEvent, findFocusDelegateTarget, findFocusable, findSelfOrAncestorFixedPosition, formatEventSideEffect, getAncestorOpenType, getAvailableHeight, getAvailableWidth, getBackground, getBackgroundColor, getBorder, getBorderRadius, getBorderSizes, getContrastRatio, getDefaultStyles, getDragCoordinates, getDropTargetInfo, getElementSignature, getFirstVisuallyVisibleAncestor, getFocusVisibilityInfo, getHeight, getHeightWithoutTransition, getInnerHeight, getInnerWidth, getKeyboardEventDefaultAction, getLuminance, getMarginSizes, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpacity, getOpacityWithoutTransition, getPaddingSizes, getPositionedParent, getPositioningScrollOffset, getPreferedColorScheme, getScrollBox, getScrollContainer, getScrollContainerSet, getScrollRelativeRect, getSelfAndAncestorScrolls, getStyle, getTranslateX, getTranslateXWithoutTransition, getTranslateY, getVirtualKeyboardOverlayHeight, getVisuallyVisibleInfo, getWidth, getWidthWithoutTransition, hasCSSSizeUnit, initFlexDetailsSet, initFocusGroup, initPositionSticky, isAncestorOpen, isPrimaryButtonEvent, isSameColor, isScrollable, markDragSource, measureLongestVisualLineWidth, measureScrollbar, measureWidestChildRow, mergeOneStyle, mergeTwoStyles, normalizeKeyboardKey, normalizeStyle, normalizeStyles, observeAncestorOpenState, onAncestorReopen, parsePositionArea, parseStyle, performTabNavigation, pickPositionRelativeTo, prefersDarkColors, prefersLightColors, preventFocusNav, preventFocusNavViaKeyboard, preventIntermediateScrollbar, releaseWheelGesture, resolveCSSColor, resolveCSSSize, resolveColorLuminance, resolveOklchLightness, scrollIntoViewScoped, scrollIntoViewWithStickyAwareness, scrollRoomTowards, setAttribute, setAttributes, setStyles, setVirtualKeyboardOverlaysContent, snapToPixel, startDragTo, startDragToResizeGesture, startDragToTravel, stickyAsRelativeCoords, stringifyStyle, subscribeVirtualKeyboardGeometryChange, subscribeVisualViewportResizeSettled, subscribeWindowResizeSettled, suppressClickAfterGesture, trapFocusInside, trapScrollInside, useActiveElement, useAvailableHeight, useAvailableWidth, useMaxHeight, useMaxWidth, useResizeStatus, visibleRectEffect, waitForPressHeld, watchWheelTravel, wheelGestureIsTakenFrom };
|