motion-dom 12.30.0 → 12.31.2

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.
@@ -13,23 +13,55 @@ function isValidHover(event) {
13
13
  */
14
14
  function hover(elementOrSelector, onHoverStart, options = {}) {
15
15
  const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);
16
- const onPointerEnter = (enterEvent) => {
17
- if (!isValidHover(enterEvent))
18
- return;
19
- const { target } = enterEvent;
20
- const onHoverEnd = onHoverStart(target, enterEvent);
21
- if (typeof onHoverEnd !== "function" || !target)
22
- return;
16
+ elements.forEach((element) => {
17
+ let isPressed = false;
18
+ let deferredHoverEnd = false;
19
+ let hoverEndCallback;
20
+ const removePointerLeave = () => {
21
+ element.removeEventListener("pointerleave", onPointerLeave);
22
+ };
23
+ const endHover = (event) => {
24
+ if (hoverEndCallback) {
25
+ hoverEndCallback(event);
26
+ hoverEndCallback = undefined;
27
+ }
28
+ removePointerLeave();
29
+ };
30
+ const onPointerUp = (event) => {
31
+ isPressed = false;
32
+ window.removeEventListener("pointerup", onPointerUp);
33
+ window.removeEventListener("pointercancel", onPointerUp);
34
+ if (deferredHoverEnd) {
35
+ deferredHoverEnd = false;
36
+ endHover(event);
37
+ }
38
+ };
39
+ const onPointerDown = () => {
40
+ isPressed = true;
41
+ window.addEventListener("pointerup", onPointerUp, eventOptions);
42
+ window.addEventListener("pointercancel", onPointerUp, eventOptions);
43
+ };
23
44
  const onPointerLeave = (leaveEvent) => {
24
- if (!isValidHover(leaveEvent))
45
+ if (leaveEvent.pointerType === "touch")
25
46
  return;
26
- onHoverEnd(leaveEvent);
27
- target.removeEventListener("pointerleave", onPointerLeave);
47
+ if (isPressed) {
48
+ deferredHoverEnd = true;
49
+ return;
50
+ }
51
+ endHover(leaveEvent);
52
+ };
53
+ const onPointerEnter = (enterEvent) => {
54
+ if (!isValidHover(enterEvent))
55
+ return;
56
+ deferredHoverEnd = false;
57
+ const onHoverEnd = onHoverStart(element, enterEvent);
58
+ if (typeof onHoverEnd !== "function")
59
+ return;
60
+ hoverEndCallback = onHoverEnd;
61
+ element.addEventListener("pointerleave", onPointerLeave, eventOptions);
28
62
  };
29
- target.addEventListener("pointerleave", onPointerLeave, eventOptions);
30
- };
31
- elements.forEach((element) => {
32
63
  element.addEventListener("pointerenter", onPointerEnter, eventOptions);
64
+ element.addEventListener("pointerdown", onPointerDown, eventOptions);
33
65
  });
34
66
  return cancel;
35
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n const { target } = enterEvent\n const onHoverEnd = onHoverStart(target as Element, enterEvent)\n\n if (typeof onHoverEnd !== \"function\" || !target) return\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (!isValidHover(leaveEvent)) return\n\n onHoverEnd(leaveEvent)\n target.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n target.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n elements.forEach((element) => {\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n"],"names":[],"mappings":";;;AAyBA,SAAS,YAAY,CAAC,KAAmB,EAAA;IACrC,OAAO,EAAE,KAAK,CAAC,WAAW,KAAK,OAAO,IAAI,YAAY,EAAE,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;AAMG;AACG,SAAU,KAAK,CACjB,iBAAoC,EACpC,YAA+B,EAC/B,UAAwB,EAAE,EAAA;AAE1B,IAAA,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,GAAG,YAAY,CACjD,iBAAiB,EACjB,OAAO,CACV,CAAA;AAED,IAAA,MAAM,cAAc,GAAG,CAAC,UAAwB,KAAI;AAChD,QAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;YAAE,OAAM;AAErC,QAAA,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;QAC7B,MAAM,UAAU,GAAG,YAAY,CAAC,MAAiB,EAAE,UAAU,CAAC,CAAA;AAE9D,QAAA,IAAI,OAAO,UAAU,KAAK,UAAU,IAAI,CAAC,MAAM;YAAE,OAAM;AAEvD,QAAA,MAAM,cAAc,GAAG,CAAC,UAAwB,KAAI;AAChD,YAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;gBAAE,OAAM;YAErC,UAAU,CAAC,UAAU,CAAC,CAAA;AACtB,YAAA,MAAM,CAAC,mBAAmB,CACtB,cAAc,EACd,cAA+B,CAClC,CAAA;AACL,SAAC,CAAA;QAED,MAAM,CAAC,gBAAgB,CACnB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf,CAAA;AACL,KAAC,CAAA;AAED,IAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;QACzB,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf,CAAA;AACL,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,MAAM,CAAA;AACjB;;;;"}
1
+ {"version":3,"file":"hover.mjs","sources":["../../../src/gestures/hover.ts"],"sourcesContent":["import { ElementOrSelector } from \"../utils/resolve-elements\"\nimport { isDragActive } from \"./drag/state/is-active\"\nimport { EventOptions } from \"./types\"\nimport { setupGesture } from \"./utils/setup\"\n\n/**\n * A function to be called when a hover gesture starts.\n *\n * This function can optionally return a function that will be called\n * when the hover gesture ends.\n *\n * @public\n */\nexport type OnHoverStartEvent = (\n element: Element,\n event: PointerEvent\n) => void | OnHoverEndEvent\n\n/**\n * A function to be called when a hover gesture ends.\n *\n * @public\n */\nexport type OnHoverEndEvent = (event: PointerEvent) => void\n\nfunction isValidHover(event: PointerEvent) {\n return !(event.pointerType === \"touch\" || isDragActive())\n}\n\n/**\n * Create a hover gesture. hover() is different to .addEventListener(\"pointerenter\")\n * in that it has an easier syntax, filters out polyfilled touch events, interoperates\n * with drag gestures, and automatically removes the \"pointerennd\" event listener when the hover ends.\n *\n * @public\n */\nexport function hover(\n elementOrSelector: ElementOrSelector,\n onHoverStart: OnHoverStartEvent,\n options: EventOptions = {}\n): VoidFunction {\n const [elements, eventOptions, cancel] = setupGesture(\n elementOrSelector,\n options\n )\n\n elements.forEach((element) => {\n let isPressed = false\n let deferredHoverEnd = false\n let hoverEndCallback: OnHoverEndEvent | undefined\n\n const removePointerLeave = () => {\n element.removeEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener\n )\n }\n\n const endHover = (event: PointerEvent) => {\n if (hoverEndCallback) {\n hoverEndCallback(event)\n hoverEndCallback = undefined\n }\n removePointerLeave()\n }\n\n const onPointerUp = (event: Event) => {\n isPressed = false\n window.removeEventListener(\n \"pointerup\",\n onPointerUp as EventListener\n )\n window.removeEventListener(\n \"pointercancel\",\n onPointerUp as EventListener\n )\n\n if (deferredHoverEnd) {\n deferredHoverEnd = false\n endHover(event as PointerEvent)\n }\n }\n\n const onPointerDown = () => {\n isPressed = true\n window.addEventListener(\n \"pointerup\",\n onPointerUp as EventListener,\n eventOptions\n )\n window.addEventListener(\n \"pointercancel\",\n onPointerUp as EventListener,\n eventOptions\n )\n }\n\n const onPointerLeave = (leaveEvent: PointerEvent) => {\n if (leaveEvent.pointerType === \"touch\") return\n\n if (isPressed) {\n deferredHoverEnd = true\n return\n }\n\n endHover(leaveEvent)\n }\n\n const onPointerEnter = (enterEvent: PointerEvent) => {\n if (!isValidHover(enterEvent)) return\n\n deferredHoverEnd = false\n\n const onHoverEnd = onHoverStart(\n element as Element,\n enterEvent\n )\n\n if (typeof onHoverEnd !== \"function\") return\n\n hoverEndCallback = onHoverEnd\n\n element.addEventListener(\n \"pointerleave\",\n onPointerLeave as EventListener,\n eventOptions\n )\n }\n\n element.addEventListener(\n \"pointerenter\",\n onPointerEnter as EventListener,\n eventOptions\n )\n element.addEventListener(\n \"pointerdown\",\n onPointerDown as EventListener,\n eventOptions\n )\n })\n\n return cancel\n}\n"],"names":[],"mappings":";;;AAyBA,SAAS,YAAY,CAAC,KAAmB,EAAA;IACrC,OAAO,EAAE,KAAK,CAAC,WAAW,KAAK,OAAO,IAAI,YAAY,EAAE,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;AAMG;AACG,SAAU,KAAK,CACjB,iBAAoC,EACpC,YAA+B,EAC/B,UAAwB,EAAE,EAAA;AAE1B,IAAA,MAAM,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,GAAG,YAAY,CACjD,iBAAiB,EACjB,OAAO,CACV,CAAA;AAED,IAAA,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,KAAI;QACzB,IAAI,SAAS,GAAG,KAAK,CAAA;QACrB,IAAI,gBAAgB,GAAG,KAAK,CAAA;AAC5B,QAAA,IAAI,gBAA6C,CAAA;QAEjD,MAAM,kBAAkB,GAAG,MAAK;AAC5B,YAAA,OAAO,CAAC,mBAAmB,CACvB,cAAc,EACd,cAA+B,CAClC,CAAA;AACL,SAAC,CAAA;AAED,QAAA,MAAM,QAAQ,GAAG,CAAC,KAAmB,KAAI;YACrC,IAAI,gBAAgB,EAAE;gBAClB,gBAAgB,CAAC,KAAK,CAAC,CAAA;gBACvB,gBAAgB,GAAG,SAAS,CAAA;aAC/B;AACD,YAAA,kBAAkB,EAAE,CAAA;AACxB,SAAC,CAAA;AAED,QAAA,MAAM,WAAW,GAAG,CAAC,KAAY,KAAI;YACjC,SAAS,GAAG,KAAK,CAAA;AACjB,YAAA,MAAM,CAAC,mBAAmB,CACtB,WAAW,EACX,WAA4B,CAC/B,CAAA;AACD,YAAA,MAAM,CAAC,mBAAmB,CACtB,eAAe,EACf,WAA4B,CAC/B,CAAA;YAED,IAAI,gBAAgB,EAAE;gBAClB,gBAAgB,GAAG,KAAK,CAAA;gBACxB,QAAQ,CAAC,KAAqB,CAAC,CAAA;aAClC;AACL,SAAC,CAAA;QAED,MAAM,aAAa,GAAG,MAAK;YACvB,SAAS,GAAG,IAAI,CAAA;YAChB,MAAM,CAAC,gBAAgB,CACnB,WAAW,EACX,WAA4B,EAC5B,YAAY,CACf,CAAA;YACD,MAAM,CAAC,gBAAgB,CACnB,eAAe,EACf,WAA4B,EAC5B,YAAY,CACf,CAAA;AACL,SAAC,CAAA;AAED,QAAA,MAAM,cAAc,GAAG,CAAC,UAAwB,KAAI;AAChD,YAAA,IAAI,UAAU,CAAC,WAAW,KAAK,OAAO;gBAAE,OAAM;YAE9C,IAAI,SAAS,EAAE;gBACX,gBAAgB,GAAG,IAAI,CAAA;gBACvB,OAAM;aACT;YAED,QAAQ,CAAC,UAAU,CAAC,CAAA;AACxB,SAAC,CAAA;AAED,QAAA,MAAM,cAAc,GAAG,CAAC,UAAwB,KAAI;AAChD,YAAA,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC;gBAAE,OAAM;YAErC,gBAAgB,GAAG,KAAK,CAAA;YAExB,MAAM,UAAU,GAAG,YAAY,CAC3B,OAAkB,EAClB,UAAU,CACb,CAAA;YAED,IAAI,OAAO,UAAU,KAAK,UAAU;gBAAE,OAAM;YAE5C,gBAAgB,GAAG,UAAU,CAAA;YAE7B,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf,CAAA;AACL,SAAC,CAAA;QAED,OAAO,CAAC,gBAAgB,CACpB,cAAc,EACd,cAA+B,EAC/B,YAAY,CACf,CAAA;QACD,OAAO,CAAC,gBAAgB,CACpB,aAAa,EACb,aAA8B,EAC9B,YAAY,CACf,CAAA;AACL,KAAC,CAAC,CAAA;AAEF,IAAA,OAAO,MAAM,CAAA;AACjB;;;;"}
@@ -1,4 +1,4 @@
1
- const interactiveElements = new Set([
1
+ const keyboardAccessibleElements = new Set([
2
2
  "BUTTON",
3
3
  "INPUT",
4
4
  "SELECT",
@@ -6,17 +6,29 @@ const interactiveElements = new Set([
6
6
  "A",
7
7
  ]);
8
8
  /**
9
- * Checks if an element is an interactive form element that should prevent
10
- * drag gestures from starting when clicked.
11
- *
12
- * This specifically targets form controls, buttons, and links - not just any
13
- * element with tabIndex, since motion elements with tap handlers automatically
14
- * get tabIndex=0 for keyboard accessibility.
9
+ * Checks if an element is natively keyboard accessible (focusable).
10
+ * Used by the press gesture to determine if we need to add tabIndex.
15
11
  */
16
12
  function isElementKeyboardAccessible(element) {
17
- return (interactiveElements.has(element.tagName) ||
13
+ return (keyboardAccessibleElements.has(element.tagName) ||
14
+ element.isContentEditable === true);
15
+ }
16
+ const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]);
17
+ /**
18
+ * Checks if an element has text selection or direct interaction behavior
19
+ * that should block drag gestures from starting.
20
+ *
21
+ * This specifically targets form controls where the user might want to select
22
+ * text or interact with the control (e.g., sliders, dropdowns).
23
+ *
24
+ * Buttons and links are NOT included because they don't have click-and-move
25
+ * actions of their own - they only respond to click events, so dragging
26
+ * should still work when initiated from these elements.
27
+ */
28
+ function isElementTextInput(element) {
29
+ return (textInputElements.has(element.tagName) ||
18
30
  element.isContentEditable === true);
19
31
  }
20
32
 
21
- export { isElementKeyboardAccessible };
33
+ export { isElementKeyboardAccessible, isElementTextInput };
22
34
  //# sourceMappingURL=is-keyboard-accessible.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-keyboard-accessible.mjs","sources":["../../../../../src/gestures/press/utils/is-keyboard-accessible.ts"],"sourcesContent":["const interactiveElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\n\n/**\n * Checks if an element is an interactive form element that should prevent\n * drag gestures from starting when clicked.\n *\n * This specifically targets form controls, buttons, and links - not just any\n * element with tabIndex, since motion elements with tap handlers automatically\n * get tabIndex=0 for keyboard accessibility.\n */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n interactiveElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n"],"names":[],"mappings":"AAAA,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC;IAChC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,GAAG;AACN,CAAA,CAAC,CAAA;AAEF;;;;;;;AAOG;AACG,SAAU,2BAA2B,CAAC,OAAgB,EAAA;IACxD,QACI,mBAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AACvC,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI,EACtD;AACL;;;;"}
1
+ {"version":3,"file":"is-keyboard-accessible.mjs","sources":["../../../../../src/gestures/press/utils/is-keyboard-accessible.ts"],"sourcesContent":["const keyboardAccessibleElements = new Set([\n \"BUTTON\",\n \"INPUT\",\n \"SELECT\",\n \"TEXTAREA\",\n \"A\",\n])\n\n/**\n * Checks if an element is natively keyboard accessible (focusable).\n * Used by the press gesture to determine if we need to add tabIndex.\n */\nexport function isElementKeyboardAccessible(element: Element) {\n return (\n keyboardAccessibleElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n\nconst textInputElements = new Set([\"INPUT\", \"SELECT\", \"TEXTAREA\"])\n\n/**\n * Checks if an element has text selection or direct interaction behavior\n * that should block drag gestures from starting.\n *\n * This specifically targets form controls where the user might want to select\n * text or interact with the control (e.g., sliders, dropdowns).\n *\n * Buttons and links are NOT included because they don't have click-and-move\n * actions of their own - they only respond to click events, so dragging\n * should still work when initiated from these elements.\n */\nexport function isElementTextInput(element: Element) {\n return (\n textInputElements.has(element.tagName) ||\n (element as HTMLElement).isContentEditable === true\n )\n}\n"],"names":[],"mappings":"AAAA,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC;IACvC,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,UAAU;IACV,GAAG;AACN,CAAA,CAAC,CAAA;AAEF;;;AAGG;AACG,SAAU,2BAA2B,CAAC,OAAgB,EAAA;IACxD,QACI,0BAA0B,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AAC9C,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI,EACtD;AACL,CAAC;AAED,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAA;AAElE;;;;;;;;;;AAUG;AACG,SAAU,kBAAkB,CAAC,OAAgB,EAAA;IAC/C,QACI,iBAAiB,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;AACrC,QAAA,OAAuB,CAAC,iBAAiB,KAAK,IAAI,EACtD;AACL;;;;"}
package/dist/es/index.mjs CHANGED
@@ -54,7 +54,7 @@ export { isDragActive, isDragging } from './gestures/drag/state/is-active.mjs';
54
54
  export { setDragLock } from './gestures/drag/state/set-active.mjs';
55
55
  export { hover } from './gestures/hover.mjs';
56
56
  export { press } from './gestures/press/index.mjs';
57
- export { isElementKeyboardAccessible } from './gestures/press/utils/is-keyboard-accessible.mjs';
57
+ export { isElementKeyboardAccessible, isElementTextInput } from './gestures/press/utils/is-keyboard-accessible.mjs';
58
58
  export { isNodeOrChild } from './gestures/utils/is-node-or-child.mjs';
59
59
  export { isPrimaryPointer } from './gestures/utils/is-primary-pointer.mjs';
60
60
  export { defaultTransformValue, parseValueFromTransform, readTransformValue } from './render/dom/parse-transform.mjs';
package/dist/index.d.ts CHANGED
@@ -461,7 +461,7 @@ interface MotionNodeHoverHandlers {
461
461
  * <motion.div onHoverStart={() => console.log('Hover starts')} />
462
462
  * ```
463
463
  */
464
- onHoverStart?(event: MouseEvent, info: EventInfo): void;
464
+ onHoverStart?(event: PointerEvent, info: EventInfo): void;
465
465
  /**
466
466
  * Callback function that fires when pointer stops hovering over the component.
467
467
  *
@@ -469,7 +469,7 @@ interface MotionNodeHoverHandlers {
469
469
  * <motion.div onHoverEnd={() => console.log("Hover ends")} />
470
470
  * ```
471
471
  */
472
- onHoverEnd?(event: MouseEvent, info: EventInfo): void;
472
+ onHoverEnd?(event: PointerEvent, info: EventInfo): void;
473
473
  }
474
474
  /**
475
475
  * Passed in to tap event handlers like `onTap` the `TapInfo` object contains
@@ -3105,14 +3105,22 @@ interface PointerEventOptions extends EventOptions {
3105
3105
  declare function press(targetOrSelector: ElementOrSelector, onPressStart: OnPressStartEvent, options?: PointerEventOptions): VoidFunction;
3106
3106
 
3107
3107
  /**
3108
- * Checks if an element is an interactive form element that should prevent
3109
- * drag gestures from starting when clicked.
3110
- *
3111
- * This specifically targets form controls, buttons, and links - not just any
3112
- * element with tabIndex, since motion elements with tap handlers automatically
3113
- * get tabIndex=0 for keyboard accessibility.
3108
+ * Checks if an element is natively keyboard accessible (focusable).
3109
+ * Used by the press gesture to determine if we need to add tabIndex.
3114
3110
  */
3115
3111
  declare function isElementKeyboardAccessible(element: Element): boolean;
3112
+ /**
3113
+ * Checks if an element has text selection or direct interaction behavior
3114
+ * that should block drag gestures from starting.
3115
+ *
3116
+ * This specifically targets form controls where the user might want to select
3117
+ * text or interact with the control (e.g., sliders, dropdowns).
3118
+ *
3119
+ * Buttons and links are NOT included because they don't have click-and-move
3120
+ * actions of their own - they only respond to click events, so dragging
3121
+ * should still work when initiated from these elements.
3122
+ */
3123
+ declare function isElementTextInput(element: Element): boolean;
3116
3124
 
3117
3125
  /**
3118
3126
  * Recursively traverse up the tree to check whether the provided child node
@@ -5000,4 +5008,4 @@ declare const sync: Batcher;
5000
5008
  */
5001
5009
  declare const cancelSync: Record<string, (process: Process) => void>;
5002
5010
 
5003
- export { type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type FrameStats, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type Phase, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type Stats, type StatsBuffer, type StatsRecording, type StatsSummary, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type Summary, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, activeAnimations, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw };
5011
+ export { type AcceptedAnimations, type ActiveStatsBuffer, type AnimationDefinition, type AnimationGeneratorName, type AnimationGeneratorType, type AnimationList, type AnimationOptions, type AnimationOrchestrationOptions, type AnimationPlaybackControls, type AnimationPlaybackControlsWithThen, type AnimationPlaybackLifecycles, type AnimationPlaybackOptions, type AnimationScope, type AnimationState, type AnimationType, type AnimationTypeState, type AnyResolvedKeyframe, AsyncMotionValueAnimation, type Batcher, type CSSStyleDeclarationWithTransform, type CSSVariableName, type CSSVariableToken, type CancelProcess, type Color, type ComplexValueInfo, type ComplexValues, type DOMKeyframesDefinition, DOMKeyframesResolver, type DOMValueAnimationOptions, DOMVisualElement, type DOMVisualElementOptions, type DecayOptions, type DelayedFunction, DocumentProjectionNode, type DragElastic, type DragHandler, type DraggableProps, type DurationSpringOptions, type DynamicOption, type ElementOrSelector, type EventInfo, type EventOptions, Feature, type FeatureClass, FlatTree, type FollowValueOptions, type FrameData, type FrameStats, type GeneratorFactory, type GeneratorFactoryFunction, GroupAnimation, GroupAnimationWithThen, type GroupedAnimations, type HSLA, HTMLProjectionNode, type HTMLRenderState, HTMLVisualElement, type HandoffFunction, type IProjectionNode, type InactiveStatsBuffer, type InertiaOptions, type InitialPromotionConfig, type InterpolateOptions, JSAnimation, type KeyframeGenerator, type KeyframeOptions, KeyframeResolver, LayoutAnimationBuilder, type LayoutEvents, type LayoutLifecycles, type LayoutUpdateData, type LayoutUpdateHandler, type LegacyAnimationControls, type MapInputRange, type Measurements, type Mixer, type MixerFactory, type MotionConfigContextProps, type MotionNodeAdvancedOptions, type MotionNodeAnimationOptions, type MotionNodeDragHandlers, type MotionNodeDraggableOptions, type MotionNodeEventOptions, type MotionNodeFocusHandlers, type MotionNodeHoverHandlers, type MotionNodeLayoutOptions, type MotionNodeOptions, type MotionNodePanHandlers, type MotionNodeTapHandlers, type MotionNodeViewportOptions, type MotionStyle, MotionValue, type MotionValueEventCallbacks, type MotionValueOptions, type MultiTransformer, NativeAnimation, NativeAnimationExtended, type NativeAnimationOptions, type NativeAnimationOptionsExtended, NativeAnimationWrapper, type NodeGroup, NodeStack, type NumberMap, ObjectVisualElement, type OnHoverEndEvent, type OnHoverStartEvent, type OnKeyframesResolved, type OnPressEndEvent, type OnPressStartEvent, type Owner, type PanHandler, type PanInfo, type PassiveEffect, type Phase, type PointerEventOptions, type PresenceContextProps, type PressGestureInfo, type Process, type ProgressTimeline, type ProjectionEventName, type ProjectionNodeConfig, type ProjectionNodeOptions, type RGBA, type ReducedMotionConfig, type RepeatType, type ResolvedConstraints, type ResolvedElastic, type ResolvedKeyframes, type ResolvedValueKeyframe, type ResolvedValues$1 as ResolvedValues, type SVGAttributes, type SVGForcedAttrKeyframesDefinition, type SVGForcedAttrProperties, type SVGForcedAttrTransitions, type SVGKeyframesDefinition, type SVGPathKeyframesDefinition, type SVGPathProperties, type SVGPathTransitions, type SVGRenderState, type SVGTransitions, SVGVisualElement, type ScaleCorrectionNode, type ScaleCorrector, type ScaleCorrectorDefinition, type ScaleCorrectorMap, type Schedule, type ScrapeMotionValuesFromProps, type ScrollMeasurements, type SelectorCache, type SingleTransformer, type Spring, type SpringOptions, type StaggerOptions, type StaggerOrigin, type StartAnimation, type Stats, type StatsBuffer, type StatsRecording, type StatsSummary, type Step, type StepId, type Steps, type StyleKeyframesDefinition, type StyleTransitions, type Subscriber, type Summary, type TapHandlers, type TapInfo, type Target, type TargetAndTransition, type TargetResolver, type TimelineWithFallback, type TransformInputRange, type TransformOptions, type TransformOrigin, type TransformProperties, type TransformTemplate, type Transformer, type Transition, type TransitionWithValueOverrides, type Tween, type UnresolvedKeyframes, type UnresolvedValueKeyframe, type UseRenderState, type ValueAnimationOptions, type ValueAnimationOptionsWithRenderContext, type ValueAnimationTransition, type ValueAnimationWithDynamicDelay, type ValueIndexes, type ValueKeyframe, type ValueKeyframesDefinition, type ValueTransformer, type ValueTransition, type ValueType, type ValueTypeMap, type VariableKeyframesDefinition, type VariableTransitions, type Variant, type VariantLabels, type Variants, type VelocityOptions, type ViewTransitionAnimationDefinition, ViewTransitionBuilder, type ViewTransitionOptions, type ViewTransitionTarget, type ViewTransitionTargetDefinition, type ViewportEventHandler, type ViewportOptions, VisualElement, type VisualElementAnimationOptions, type VisualElementEventCallbacks, type VisualElementOptions, type VisualState, type WillChange, type WithAppearProps, type WithDepth, type WithQuerySelectorAll, acceleratedValues, activeAnimations, addAttrValue, addDomEvent, addScaleCorrector, addStyleValue, addValueToWillChange, alpha, analyseComplexValue, animateMotionValue, animateSingleValue, animateTarget, animateValue, animateVariant, animateView, animateVisualElement, animationMapKey, applyAxisDelta, applyBoxDelta, applyGeneratorOptions, applyPointDelta, applyPxDefaults, applyTreeDeltas, aspectRatio, attachFollow, attachSpring, attrEffect, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, buildHTMLStyles, buildProjectionTransform, buildSVGAttrs, buildSVGPath, buildTransform, calcAxisDelta, calcBoxDelta, calcChildStagger, calcGeneratorDuration, calcLength, calcRelativeAxis, calcRelativeAxisPosition, calcRelativeBox, calcRelativePosition, camelCaseAttributes, camelToDash, cancelFrame, cancelMicrotask, cancelSync, checkVariantsDidChange, cleanDirtyNodes, collectMotionValues, color, compareByDepth, complex, containsCSSVariable, convertBoundingBoxToBox, convertBoxToBoundingBox, convertOffsetToTimes, copyAxisDeltaInto, copyAxisInto, copyBoxInto, correctBorderRadius, correctBoxShadow, createAnimationState, createAxis, createAxisDelta, createBox, createDelta, createGeneratorEasing, createProjectionNode, createRenderBatcher, cubicBezierAsString, defaultEasing, defaultOffset, defaultTransformValue, defaultValueTypes, degrees, delay, delayInSeconds, dimensionValueTypes, eachAxis, fillOffset, fillWildcards, findDimensionValueType, findValueType, flushKeyframeResolvers, followValue, frame, frameData, frameSteps, generateLinearEasing, getAnimatableNone, getAnimationMap, getComputedStyle, getDefaultTransition, getDefaultValueType, getFeatureDefinitions, getFinalKeyframe, getMixer, getOptimisedAppearId, getOriginIndex, getValueAsType, getValueTransition, getVariableValue, getVariantContext, getViewAnimationLayerInfo, getViewAnimations, globalProjectionState, has2DTranslate, hasReducedMotionListener, hasScale, hasTransform, hex, hover, hsla, hslaToRgba, inertia, initPrefersReducedMotion, interpolate, invisibleValues, isAnimationControls, isCSSVariableName, isCSSVariableToken, isControllingVariants, isDeltaZero, isDragActive, isDragging, isElementKeyboardAccessible, isElementTextInput, isForcedMotionValue, isGenerator, isHTMLElement, isKeyframesTarget, isMotionValue, isNear, isNodeOrChild, isPrimaryPointer, isSVGElement, isSVGSVGElement, isSVGTag, isTransitionDefined, isVariantLabel, isVariantNode, isWaapiSupportedEasing, isWillChangeMotionValue, keyframes, makeAnimationInstant, mapEasingToNativeEasing, mapValue, maxGeneratorDuration, measurePageBox, measureViewportBox, microtask, mix, mixArray, mixColor, mixComplex, mixImmediate, mixLinearColor, mixNumber, mixObject, mixValues, mixVisibility, motionValue, nodeGroup, number, numberValueTypes, observeTimeline, optimizedAppearDataAttribute, optimizedAppearDataId, parseAnimateLayoutArgs, parseCSSVariable, parseValueFromTransform, percent, pixelsToPercent, positionalKeys, prefersReducedMotion, press, progressPercentage, propEffect, propagateDirtyNodes, px, readTransformValue, recordStats, removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta, renderHTML, renderSVG, resize, resolveElements, resolveMotionValue, resolveVariant, resolveVariantFromProps, rgbUnit, rgba, rootProjectionNode, scale, scaleCorrectors, scalePoint, scrapeMotionValuesFromProps$1 as scrapeHTMLMotionValuesFromProps, scrapeMotionValuesFromProps as scrapeSVGMotionValuesFromProps, setDragLock, setFeatureDefinitions, setStyle, setTarget, spring, springValue, stagger, startWaapiAnimation, statsBuffer, styleEffect, supportedWaapiEasing, supportsBrowserAnimation, supportsFlags, supportsLinearEasing, supportsPartialKeyframes, supportsScrollTimeline, svgEffect, sync, testValueType, time, transform, transformAxis, transformBox, transformBoxPoints, transformPropOrder, transformProps, transformValue, transformValueTypes, translateAxis, updateMotionValuesFromProps, variantPriorityOrder, variantProps, vh, visualElementStore, vw };
@@ -4224,23 +4224,55 @@
4224
4224
  */
4225
4225
  function hover(elementOrSelector, onHoverStart, options = {}) {
4226
4226
  const [elements, eventOptions, cancel] = setupGesture(elementOrSelector, options);
4227
- const onPointerEnter = (enterEvent) => {
4228
- if (!isValidHover(enterEvent))
4229
- return;
4230
- const { target } = enterEvent;
4231
- const onHoverEnd = onHoverStart(target, enterEvent);
4232
- if (typeof onHoverEnd !== "function" || !target)
4233
- return;
4227
+ elements.forEach((element) => {
4228
+ let isPressed = false;
4229
+ let deferredHoverEnd = false;
4230
+ let hoverEndCallback;
4231
+ const removePointerLeave = () => {
4232
+ element.removeEventListener("pointerleave", onPointerLeave);
4233
+ };
4234
+ const endHover = (event) => {
4235
+ if (hoverEndCallback) {
4236
+ hoverEndCallback(event);
4237
+ hoverEndCallback = undefined;
4238
+ }
4239
+ removePointerLeave();
4240
+ };
4241
+ const onPointerUp = (event) => {
4242
+ isPressed = false;
4243
+ window.removeEventListener("pointerup", onPointerUp);
4244
+ window.removeEventListener("pointercancel", onPointerUp);
4245
+ if (deferredHoverEnd) {
4246
+ deferredHoverEnd = false;
4247
+ endHover(event);
4248
+ }
4249
+ };
4250
+ const onPointerDown = () => {
4251
+ isPressed = true;
4252
+ window.addEventListener("pointerup", onPointerUp, eventOptions);
4253
+ window.addEventListener("pointercancel", onPointerUp, eventOptions);
4254
+ };
4234
4255
  const onPointerLeave = (leaveEvent) => {
4235
- if (!isValidHover(leaveEvent))
4256
+ if (leaveEvent.pointerType === "touch")
4257
+ return;
4258
+ if (isPressed) {
4259
+ deferredHoverEnd = true;
4260
+ return;
4261
+ }
4262
+ endHover(leaveEvent);
4263
+ };
4264
+ const onPointerEnter = (enterEvent) => {
4265
+ if (!isValidHover(enterEvent))
4266
+ return;
4267
+ deferredHoverEnd = false;
4268
+ const onHoverEnd = onHoverStart(element, enterEvent);
4269
+ if (typeof onHoverEnd !== "function")
4236
4270
  return;
4237
- onHoverEnd(leaveEvent);
4238
- target.removeEventListener("pointerleave", onPointerLeave);
4271
+ hoverEndCallback = onHoverEnd;
4272
+ element.addEventListener("pointerleave", onPointerLeave, eventOptions);
4239
4273
  };
4240
- target.addEventListener("pointerleave", onPointerLeave, eventOptions);
4241
- };
4242
- elements.forEach((element) => {
4243
4274
  element.addEventListener("pointerenter", onPointerEnter, eventOptions);
4275
+ element.addEventListener("pointerdown", onPointerDown, eventOptions);
4244
4276
  });
4245
4277
  return cancel;
4246
4278
  }
@@ -4281,7 +4313,7 @@
4281
4313
  }
4282
4314
  };
4283
4315
 
4284
- const interactiveElements = new Set([
4316
+ const keyboardAccessibleElements = new Set([
4285
4317
  "BUTTON",
4286
4318
  "INPUT",
4287
4319
  "SELECT",
@@ -4289,15 +4321,27 @@
4289
4321
  "A",
4290
4322
  ]);
4291
4323
  /**
4292
- * Checks if an element is an interactive form element that should prevent
4293
- * drag gestures from starting when clicked.
4294
- *
4295
- * This specifically targets form controls, buttons, and links - not just any
4296
- * element with tabIndex, since motion elements with tap handlers automatically
4297
- * get tabIndex=0 for keyboard accessibility.
4324
+ * Checks if an element is natively keyboard accessible (focusable).
4325
+ * Used by the press gesture to determine if we need to add tabIndex.
4298
4326
  */
4299
4327
  function isElementKeyboardAccessible(element) {
4300
- return (interactiveElements.has(element.tagName) ||
4328
+ return (keyboardAccessibleElements.has(element.tagName) ||
4329
+ element.isContentEditable === true);
4330
+ }
4331
+ const textInputElements = new Set(["INPUT", "SELECT", "TEXTAREA"]);
4332
+ /**
4333
+ * Checks if an element has text selection or direct interaction behavior
4334
+ * that should block drag gestures from starting.
4335
+ *
4336
+ * This specifically targets form controls where the user might want to select
4337
+ * text or interact with the control (e.g., sliders, dropdowns).
4338
+ *
4339
+ * Buttons and links are NOT included because they don't have click-and-move
4340
+ * actions of their own - they only respond to click events, so dragging
4341
+ * should still work when initiated from these elements.
4342
+ */
4343
+ function isElementTextInput(element) {
4344
+ return (textInputElements.has(element.tagName) ||
4301
4345
  element.isContentEditable === true);
4302
4346
  }
4303
4347
 
@@ -9507,6 +9551,7 @@
9507
9551
  exports.isDragActive = isDragActive;
9508
9552
  exports.isDragging = isDragging;
9509
9553
  exports.isElementKeyboardAccessible = isElementKeyboardAccessible;
9554
+ exports.isElementTextInput = isElementTextInput;
9510
9555
  exports.isForcedMotionValue = isForcedMotionValue;
9511
9556
  exports.isGenerator = isGenerator;
9512
9557
  exports.isHTMLElement = isHTMLElement;