@jsenv/dom 0.17.71 → 0.17.72
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 +18 -16
- package/package.json +1 -1
package/dist/jsenv_dom.js
CHANGED
|
@@ -8917,12 +8917,15 @@ const captureHolderByPointerId = new Map();
|
|
|
8917
8917
|
* @param {boolean} [options.backdrop=true]
|
|
8918
8918
|
* @param {number} [options.backdropZIndex=999999]
|
|
8919
8919
|
* @returns {{grab: function, grabViaPointer: function}}
|
|
8920
|
-
* `grabViaPointer(pointerdownEvent, { element, direction, cursor, scrollContainer
|
|
8921
|
-
* gesture a hand starts
|
|
8922
|
-
*
|
|
8923
|
-
*
|
|
8924
|
-
*
|
|
8925
|
-
*
|
|
8920
|
+
* `grabViaPointer(pointerdownEvent, { element, direction, cursor, scrollContainer,
|
|
8921
|
+
* pointerCaptureElement })` for a gesture a hand starts — `pointerCaptureElement` (the
|
|
8922
|
+
* pressed target by default) must outlive whatever the gesture re-renders, or the capture
|
|
8923
|
+
* is lost and the gesture ends cancelled; `grab({ element, grabX, grabY })` for one nothing
|
|
8924
|
+
* pressed. Both give back the gesture — `gestureInfo` (its `layout` with `xDelta`/`yDelta`,
|
|
8925
|
+
* its velocity, the way it is going), `drag`, `release`, and
|
|
8926
|
+
* `addDragCallback`/`addReleaseCallback` for whoever joins after it started.
|
|
8927
|
+
* `grabViaPointer` gives back `null` when the press is not one it can read: a secondary
|
|
8928
|
+
* button, a text node, an element that has left the document since the press.
|
|
8926
8929
|
*/
|
|
8927
8930
|
const createDragGestureController = (options = {}) => {
|
|
8928
8931
|
const {
|
|
@@ -11966,8 +11969,6 @@ const roundForConstraints = (value) => {
|
|
|
11966
11969
|
* @param {Object} gestureInfo - Gesture information
|
|
11967
11970
|
* @param {Element[]} targetElements - Array of potential drop target elements
|
|
11968
11971
|
* @param {object} [options]
|
|
11969
|
-
* @param {Element} [options.dragElement] - The element being dragged. When provided and
|
|
11970
|
-
* `fallbackToEdge` is true, used to compute the fallback rect.
|
|
11971
11972
|
* @param {boolean} [options.fallbackToEdge=false] - When true and the drag element does
|
|
11972
11973
|
* not intersect any target, falls back to the first item (if above all items) or the
|
|
11973
11974
|
* last item (if below all items) so there is always a valid drop target at list edges.
|
|
@@ -14531,8 +14532,8 @@ const createDragToMoveGestureController = ({
|
|
|
14531
14532
|
* @param {("move"|"reorder"|"toss"|"land"|"leave")[]} effects
|
|
14532
14533
|
* What letting go of this element can mean. `reorder`, `toss` and `land` carry a
|
|
14533
14534
|
* copy; `move` carries the element itself, and `leave` goes with either. Asking
|
|
14534
|
-
* for `move`
|
|
14535
|
-
* and so is asking for `reorder` and `land`.
|
|
14535
|
+
* for `move` beside any of the three that carry a copy is asking one release to
|
|
14536
|
+
* mean two things, and so is asking for `reorder` and `land`.
|
|
14536
14537
|
* @param {object} [options]
|
|
14537
14538
|
* @param {Element} [options.draggedElement=event.currentTarget]
|
|
14538
14539
|
* @param {(detail: {gestureInfo: object, x: number, y: number}) => void} [options.onMoving]
|
|
@@ -14552,8 +14553,8 @@ const createDragToMoveGestureController = ({
|
|
|
14552
14553
|
* a node rebuilt), and the element's own translate otherwise, baked in — see
|
|
14553
14554
|
* settleMovedElement.
|
|
14554
14555
|
* @param {(detail: {gestureInfo: object, x: number, y: number}) => Promise|void} [options.onLeave]
|
|
14555
|
-
* It was let go of away from every place:
|
|
14556
|
-
* from all of
|
|
14556
|
+
* It was let go of away from every place: beside `reorder` or `land`, away
|
|
14557
|
+
* from all of their places; otherwise, out of `outsideOf`. Beside `move` the element
|
|
14557
14558
|
* itself is left where the hand put it while this runs, and the answer says
|
|
14558
14559
|
* what becomes of that position — let go of on a resolve (the caller has
|
|
14559
14560
|
* removed the thing, or drawn it where it goes back to), travelled home on a
|
|
@@ -14588,7 +14589,7 @@ const createDragToMoveGestureController = ({
|
|
|
14588
14589
|
* if the promise rejects, because the thing still exists and the screen has to
|
|
14589
14590
|
* say so.
|
|
14590
14591
|
* @param {(detail: {fromId: string, toId: string, x: number, y: number, width: number, height: number, syncCloneWithDropTarget: Function}) => Promise|void} [options.onLand]
|
|
14591
|
-
* It came down on `toId
|
|
14592
|
+
* It came down on the element `toId` names, never null: nothing under the
|
|
14592
14593
|
* copy is a cancelled release. `x`/`y`/`width`/`height` say WHERE on it, which
|
|
14593
14594
|
* is the whole answer when the place is a surface — a plan, a map — with no
|
|
14594
14595
|
* element under the copy to name. The copy is held until what comes back
|
|
@@ -15431,13 +15432,14 @@ const getRectInside = (element, containerElement) => {
|
|
|
15431
15432
|
// Creates the two-layer clone structure used for drag-to-reorder.
|
|
15432
15433
|
//
|
|
15433
15434
|
// Layer 1 — wrapper (navi-drag-clone-wrapper):
|
|
15434
|
-
// Positioned
|
|
15435
|
+
// Positioned fixed via --clone-top/--clone-left CSS vars.
|
|
15435
15436
|
// Carries the box-shadow and size. Moved every drag frame via dragStyleController.
|
|
15436
15437
|
// Has a view-transition-name so the View Transitions API can animate it on release.
|
|
15437
15438
|
//
|
|
15438
15439
|
// Layer 2 — inner clone (navi-drag-clone):
|
|
15439
15440
|
// A deep clone of the grabbed element.
|
|
15440
|
-
// Applies transform: scale(1.
|
|
15441
|
+
// Applies transform: scale(var(--drag-clone-scale, 1.03)) via the CSS rule
|
|
15442
|
+
// for [navi-drag-clone],
|
|
15441
15443
|
// giving the "lifted" feel. The transform-origin is set to the grab point
|
|
15442
15444
|
// so the element expands naturally from where the user clicked.
|
|
15443
15445
|
// On release, the `navi-drag-clone` attribute is removed inside
|
|
@@ -15702,7 +15704,7 @@ const createDragClone = (element, pointerEvent) => {
|
|
|
15702
15704
|
wrapper.viewTransitionName = "navi-drag-clone-wrapper";
|
|
15703
15705
|
setCloneViewportRect(wrapper, element);
|
|
15704
15706
|
// Grab point within the element — used as transform-origin so the
|
|
15705
|
-
// scale
|
|
15707
|
+
// scale expands from where the user clicked, not the element center.
|
|
15706
15708
|
// These offsets are element-relative so viewport coords are correct here.
|
|
15707
15709
|
wrapper.style.setProperty(
|
|
15708
15710
|
"--drag-origin",
|