@testing-library/user-event 14.4.3 → 14.5.1

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.
Files changed (181) hide show
  1. package/dist/cjs/_interop/dtl.js +27 -0
  2. package/dist/cjs/_interop/dtlEventMap.js +27 -0
  3. package/dist/cjs/_interop/dtlHelpers.js +27 -0
  4. package/dist/cjs/clipboard/copy.js +2 -2
  5. package/dist/cjs/clipboard/cut.js +2 -2
  6. package/dist/cjs/clipboard/paste.js +4 -4
  7. package/dist/cjs/convenience/tab.js +1 -1
  8. package/dist/cjs/document/UI.js +5 -5
  9. package/dist/cjs/document/interceptor.js +1 -1
  10. package/dist/cjs/document/trackValue.js +4 -4
  11. package/dist/cjs/event/behavior/keydown.js +6 -6
  12. package/dist/cjs/event/behavior/keypress.js +2 -2
  13. package/dist/cjs/event/behavior/keyup.js +2 -2
  14. package/dist/cjs/event/behavior/paste.js +2 -2
  15. package/dist/cjs/event/createEvent.js +41 -41
  16. package/dist/cjs/event/dispatchEvent.js +2 -2
  17. package/dist/cjs/event/eventMap.js +22 -2
  18. package/dist/cjs/event/focus.js +1 -4
  19. package/dist/cjs/event/input.js +4 -4
  20. package/dist/cjs/event/selection/getInputRange.js +2 -2
  21. package/dist/cjs/event/selection/modifySelection.js +3 -3
  22. package/dist/cjs/event/selection/modifySelectionPerMouse.js +1 -1
  23. package/dist/cjs/event/selection/moveSelection.js +5 -5
  24. package/dist/cjs/event/selection/resolveCaretPosition.js +1 -1
  25. package/dist/cjs/event/selection/selectAll.js +4 -4
  26. package/dist/cjs/event/selection/setSelection.js +3 -3
  27. package/dist/cjs/event/selection/setSelectionPerMouse.js +5 -5
  28. package/dist/cjs/event/selection/setSelectionRange.js +2 -2
  29. package/dist/cjs/event/selection/updateSelectionOnFocus.js +2 -2
  30. package/dist/cjs/event/wrapEvent.js +23 -2
  31. package/dist/cjs/index.js +1 -0
  32. package/dist/cjs/keyboard/index.js +2 -2
  33. package/dist/cjs/keyboard/parseKeyDef.js +8 -8
  34. package/dist/cjs/pointer/index.js +11 -11
  35. package/dist/cjs/pointer/keyMap.js +1 -1
  36. package/dist/cjs/pointer/parseKeyDef.js +1 -1
  37. package/dist/cjs/setup/api.js +19 -17
  38. package/dist/cjs/setup/directApi.js +3 -3
  39. package/dist/cjs/setup/setup.js +10 -10
  40. package/dist/cjs/setup/wrapAsync.js +23 -2
  41. package/dist/cjs/system/index.js +15 -2
  42. package/dist/cjs/system/keyboard.js +27 -12
  43. package/dist/cjs/system/pointer/buttons.js +14 -1
  44. package/dist/cjs/system/pointer/device.js +14 -1
  45. package/dist/cjs/system/pointer/index.js +34 -17
  46. package/dist/cjs/system/pointer/mouse.js +33 -19
  47. package/dist/cjs/system/pointer/pointer.js +24 -8
  48. package/dist/cjs/system/pointer/shared.js +2 -2
  49. package/dist/cjs/utility/selectOptions.js +32 -11
  50. package/dist/cjs/utility/type.js +1 -1
  51. package/dist/cjs/utility/upload.js +4 -4
  52. package/dist/cjs/utils/dataTransfer/Clipboard.js +22 -8
  53. package/dist/cjs/utils/dataTransfer/DataTransfer.js +23 -8
  54. package/dist/cjs/utils/edit/maxLength.js +2 -2
  55. package/dist/cjs/utils/edit/setFiles.js +4 -4
  56. package/dist/cjs/utils/focus/cursor.js +2 -2
  57. package/dist/cjs/utils/focus/getActiveElement.js +2 -2
  58. package/dist/cjs/utils/focus/selector.js +1 -1
  59. package/dist/cjs/utils/keyDef/readNextDescriptor.js +5 -5
  60. package/dist/cjs/utils/misc/getTreeDiff.js +3 -3
  61. package/dist/cjs/utils/misc/getWindow.js +23 -2
  62. package/dist/cjs/utils/misc/isDisabled.js +3 -3
  63. package/dist/cjs/utils/misc/isVisible.js +1 -1
  64. package/dist/cjs/utils/misc/wait.js +1 -1
  65. package/dist/cjs/utils/pointer/cssPointerEvents.js +13 -13
  66. package/dist/esm/_interop/dtl.js +2 -0
  67. package/dist/esm/_interop/dtlEventMap.js +2 -0
  68. package/dist/esm/_interop/dtlHelpers.js +2 -0
  69. package/dist/esm/clipboard/copy.js +2 -2
  70. package/dist/esm/clipboard/cut.js +2 -2
  71. package/dist/esm/clipboard/paste.js +4 -4
  72. package/dist/esm/convenience/tab.js +1 -1
  73. package/dist/esm/document/UI.js +5 -5
  74. package/dist/esm/document/interceptor.js +1 -1
  75. package/dist/esm/document/trackValue.js +4 -4
  76. package/dist/esm/event/behavior/keydown.js +6 -6
  77. package/dist/esm/event/behavior/keypress.js +2 -2
  78. package/dist/esm/event/behavior/keyup.js +2 -2
  79. package/dist/esm/event/behavior/paste.js +2 -2
  80. package/dist/esm/event/createEvent.js +41 -41
  81. package/dist/esm/event/dispatchEvent.js +2 -2
  82. package/dist/esm/event/eventMap.js +2 -2
  83. package/dist/esm/event/focus.js +1 -4
  84. package/dist/esm/event/input.js +4 -4
  85. package/dist/esm/event/selection/getInputRange.js +2 -2
  86. package/dist/esm/event/selection/modifySelection.js +3 -3
  87. package/dist/esm/event/selection/modifySelectionPerMouse.js +1 -1
  88. package/dist/esm/event/selection/moveSelection.js +5 -5
  89. package/dist/esm/event/selection/resolveCaretPosition.js +1 -1
  90. package/dist/esm/event/selection/selectAll.js +4 -4
  91. package/dist/esm/event/selection/setSelection.js +3 -3
  92. package/dist/esm/event/selection/setSelectionPerMouse.js +5 -5
  93. package/dist/esm/event/selection/setSelectionRange.js +2 -2
  94. package/dist/esm/event/selection/updateSelectionOnFocus.js +2 -2
  95. package/dist/esm/event/wrapEvent.js +2 -1
  96. package/dist/esm/index.js +1 -1
  97. package/dist/esm/keyboard/index.js +2 -2
  98. package/dist/esm/keyboard/parseKeyDef.js +8 -8
  99. package/dist/esm/pointer/index.js +11 -11
  100. package/dist/esm/pointer/keyMap.js +1 -1
  101. package/dist/esm/pointer/parseKeyDef.js +1 -1
  102. package/dist/esm/setup/api.js +33 -12
  103. package/dist/esm/setup/directApi.js +3 -3
  104. package/dist/esm/setup/setup.js +11 -11
  105. package/dist/esm/setup/wrapAsync.js +2 -1
  106. package/dist/esm/system/index.js +15 -2
  107. package/dist/esm/system/keyboard.js +27 -12
  108. package/dist/esm/system/pointer/buttons.js +14 -1
  109. package/dist/esm/system/pointer/device.js +14 -1
  110. package/dist/esm/system/pointer/index.js +34 -17
  111. package/dist/esm/system/pointer/mouse.js +33 -19
  112. package/dist/esm/system/pointer/pointer.js +24 -8
  113. package/dist/esm/system/pointer/shared.js +2 -2
  114. package/dist/esm/utility/selectOptions.js +8 -7
  115. package/dist/esm/utility/type.js +1 -1
  116. package/dist/esm/utility/upload.js +4 -4
  117. package/dist/esm/utils/dataTransfer/Clipboard.js +22 -8
  118. package/dist/esm/utils/dataTransfer/DataTransfer.js +23 -8
  119. package/dist/esm/utils/edit/maxLength.js +2 -2
  120. package/dist/esm/utils/edit/setFiles.js +4 -4
  121. package/dist/esm/utils/focus/cursor.js +2 -2
  122. package/dist/esm/utils/focus/getActiveElement.js +2 -2
  123. package/dist/esm/utils/focus/selector.js +1 -1
  124. package/dist/esm/utils/keyDef/readNextDescriptor.js +5 -5
  125. package/dist/esm/utils/misc/getTreeDiff.js +3 -3
  126. package/dist/esm/utils/misc/getWindow.js +2 -1
  127. package/dist/esm/utils/misc/isDisabled.js +3 -3
  128. package/dist/esm/utils/misc/isVisible.js +1 -1
  129. package/dist/esm/utils/misc/wait.js +1 -1
  130. package/dist/esm/utils/pointer/cssPointerEvents.js +13 -13
  131. package/dist/types/_interop/dtl.d.ts +2 -0
  132. package/dist/types/_interop/dtlEventMap.d.ts +2 -0
  133. package/dist/types/_interop/dtlHelpers.d.ts +2 -0
  134. package/dist/types/clipboard/copy.d.ts +1 -1
  135. package/dist/types/clipboard/cut.d.ts +1 -1
  136. package/dist/types/clipboard/paste.d.ts +1 -1
  137. package/dist/types/convenience/click.d.ts +1 -1
  138. package/dist/types/convenience/hover.d.ts +1 -1
  139. package/dist/types/convenience/tab.d.ts +1 -1
  140. package/dist/types/document/UI.d.ts +3 -3
  141. package/dist/types/document/interceptor.d.ts +3 -3
  142. package/dist/types/event/behavior/registry.d.ts +1 -1
  143. package/dist/types/event/createEvent.d.ts +1 -1
  144. package/dist/types/event/dispatchEvent.d.ts +1 -1
  145. package/dist/types/event/eventMap.d.ts +8 -0
  146. package/dist/types/event/input.d.ts +1 -1
  147. package/dist/types/event/radio.d.ts +1 -1
  148. package/dist/types/event/selection/index.d.ts +2 -2
  149. package/dist/types/event/selection/modifySelectionPerMouse.d.ts +1 -1
  150. package/dist/types/event/selection/setSelectionPerMouse.d.ts +1 -1
  151. package/dist/types/event/types.d.ts +3 -3
  152. package/dist/types/index.d.ts +3 -1
  153. package/dist/types/keyboard/index.d.ts +1 -1
  154. package/dist/types/options.d.ts +2 -2
  155. package/dist/types/pointer/index.d.ts +7 -7
  156. package/dist/types/setup/api.d.ts +23 -5
  157. package/dist/types/setup/directApi.d.ts +5 -5
  158. package/dist/types/setup/setup.d.ts +5 -5
  159. package/dist/types/system/keyboard.d.ts +2 -2
  160. package/dist/types/system/pointer/buttons.d.ts +2 -2
  161. package/dist/types/system/pointer/device.d.ts +1 -1
  162. package/dist/types/system/pointer/mouse.d.ts +2 -2
  163. package/dist/types/system/pointer/pointer.d.ts +2 -2
  164. package/dist/types/utility/clear.d.ts +1 -1
  165. package/dist/types/utility/selectOptions.d.ts +1 -1
  166. package/dist/types/utility/type.d.ts +2 -2
  167. package/dist/types/utility/upload.d.ts +1 -1
  168. package/dist/types/utils/click/isClickableInput.d.ts +1 -1
  169. package/dist/types/utils/dataTransfer/Clipboard.d.ts +1 -1
  170. package/dist/types/utils/edit/isEditable.d.ts +2 -2
  171. package/dist/types/utils/edit/maxLength.d.ts +1 -1
  172. package/dist/types/utils/keyDef/readNextDescriptor.d.ts +1 -1
  173. package/dist/types/utils/misc/isElementType.d.ts +1 -1
  174. package/dist/types/utils/misc/level.d.ts +2 -2
  175. package/dist/types/utils/misc/wait.d.ts +1 -1
  176. package/dist/types/utils/pointer/cssPointerEvents.d.ts +1 -1
  177. package/package.json +22 -11
  178. /package/dist/cjs/{event → _interop}/dom-events.d.js +0 -0
  179. /package/dist/cjs/{utils/misc → _interop}/dom-helpers.d.js +0 -0
  180. /package/dist/esm/{event → _interop}/dom-events.d.js +0 -0
  181. /package/dist/esm/{utils/misc → _interop}/dom-helpers.d.js +0 -0
@@ -8,8 +8,8 @@ function getTreeDiff(a, b) {
8
8
  treeA.push(el);
9
9
  }
10
10
  const treeB = [];
11
- for(let el1 = b; el1; el1 = el1.parentElement){
12
- treeB.push(el1);
11
+ for(let el = b; el; el = el.parentElement){
12
+ treeB.push(el);
13
13
  }
14
14
  let i = 0;
15
15
  for(;; i++){
@@ -20,7 +20,7 @@ function getTreeDiff(a, b) {
20
20
  return [
21
21
  treeA.slice(0, treeA.length - i),
22
22
  treeB.slice(0, treeB.length - i),
23
- treeB.slice(treeB.length - i),
23
+ treeB.slice(treeB.length - i)
24
24
  ];
25
25
  }
26
26
 
@@ -2,10 +2,31 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var helpers_js = require('@testing-library/dom/dist/helpers.js');
5
+ var named = require('@testing-library/dom/dist/helpers.js');
6
6
 
7
+ function _interopNamespace(e) {
8
+ if (e && e.__esModule) return e;
9
+ var n = Object.create(null);
10
+ if (e) {
11
+ Object.keys(e).forEach(function (k) {
12
+ if (k !== 'default') {
13
+ var d = Object.getOwnPropertyDescriptor(e, k);
14
+ Object.defineProperty(n, k, d.get ? d : {
15
+ enumerable: true,
16
+ get: function () { return e[k]; }
17
+ });
18
+ }
19
+ });
20
+ }
21
+ n["default"] = e;
22
+ return Object.freeze(n);
23
+ }
24
+
25
+ var named__namespace = /*#__PURE__*/_interopNamespace(named);
26
+
27
+ const { getWindowFromNode } = named__namespace;
7
28
  function getWindow(node) {
8
- return helpers_js.getWindowFromNode(node);
29
+ return getWindowFromNode(node);
9
30
  }
10
31
 
11
32
  exports.getWindow = getWindow;
@@ -13,14 +13,14 @@ function isDisabled(element) {
13
13
  'select',
14
14
  'textarea',
15
15
  'optgroup',
16
- 'option',
16
+ 'option'
17
17
  ])) {
18
18
  if (el.hasAttribute('disabled')) {
19
19
  return true;
20
20
  }
21
21
  } else if (isElementType.isElementType(el, 'fieldset')) {
22
- var ref;
23
- if (el.hasAttribute('disabled') && !((ref = el.querySelector(':scope > legend')) === null || ref === void 0 ? void 0 : ref.contains(element))) {
22
+ var _el_querySelector;
23
+ if (el.hasAttribute('disabled') && !((_el_querySelector = el.querySelector(':scope > legend')) === null || _el_querySelector === void 0 ? void 0 : _el_querySelector.contains(element))) {
24
24
  return true;
25
25
  }
26
26
  } else if (el.tagName.includes('-')) {
@@ -7,7 +7,7 @@ var getWindow = require('./getWindow.js');
7
7
  function isVisible(element) {
8
8
  const window = getWindow.getWindow(element);
9
9
  for(let el = element; el === null || el === void 0 ? void 0 : el.ownerDocument; el = el.parentElement){
10
- const { display , visibility } = window.getComputedStyle(el);
10
+ const { display, visibility } = window.getComputedStyle(el);
11
11
  if (display === 'none') {
12
12
  return false;
13
13
  }
@@ -9,7 +9,7 @@ function wait(config) {
9
9
  }
10
10
  return Promise.all([
11
11
  new Promise((resolve)=>globalThis.setTimeout(()=>resolve(), delay)),
12
- config.advanceTimers(delay),
12
+ config.advanceTimers(delay)
13
13
  ]);
14
14
  }
15
15
 
@@ -8,8 +8,8 @@ var isElementType = require('../misc/isElementType.js');
8
8
  var level = require('../misc/level.js');
9
9
 
10
10
  function hasPointerEvents(instance, element) {
11
- var ref;
12
- return ((ref = checkPointerEvents(instance, element)) === null || ref === void 0 ? void 0 : ref.pointerEvents) !== 'none';
11
+ var _checkPointerEvents;
12
+ return ((_checkPointerEvents = checkPointerEvents(instance, element)) === null || _checkPointerEvents === void 0 ? void 0 : _checkPointerEvents.pointerEvents) !== 'none';
13
13
  }
14
14
  function closestPointerEventsDeclaration(element) {
15
15
  const window = getWindow.getWindow(element);
@@ -49,7 +49,7 @@ function assertPointerEvents(instance, element) {
49
49
  throw new Error([
50
50
  `Unable to perform pointer interaction as the element ${declaration.tree.length > 1 ? 'inherits' : 'has'} \`pointer-events: none\`:`,
51
51
  '',
52
- printTree(declaration.tree),
52
+ printTree(declaration.tree)
53
53
  ].join('\n'));
54
54
  }
55
55
  }
@@ -61,17 +61,17 @@ function printTree(tree) {
61
61
  el.hasAttribute('data-testid') && `(testId=${el.getAttribute('data-testid')})`,
62
62
  getLabelDescr(el),
63
63
  tree.length > 1 && i === 0 && ' <-- This element declared `pointer-events: none`',
64
- tree.length > 1 && i === tree.length - 1 && ' <-- Asserted pointer events here',
64
+ tree.length > 1 && i === tree.length - 1 && ' <-- Asserted pointer events here'
65
65
  ].filter(Boolean).join('')).join('\n');
66
66
  }
67
67
  function getLabelDescr(element) {
68
- var ref;
68
+ var _element_labels;
69
69
  let label;
70
70
  if (element.hasAttribute('aria-label')) {
71
71
  label = element.getAttribute('aria-label');
72
72
  } else if (element.hasAttribute('aria-labelledby')) {
73
- var ref1, ref2;
74
- label = (ref1 = element.ownerDocument.getElementById(element.getAttribute('aria-labelledby'))) === null || ref1 === void 0 ? void 0 : (ref2 = ref1.textContent) === null || ref2 === void 0 ? void 0 : ref2.trim();
73
+ var _element_ownerDocument_getElementById_textContent, _element_ownerDocument_getElementById;
74
+ label = (_element_ownerDocument_getElementById = element.ownerDocument.getElementById(element.getAttribute('aria-labelledby'))) === null || _element_ownerDocument_getElementById === void 0 ? void 0 : (_element_ownerDocument_getElementById_textContent = _element_ownerDocument_getElementById.textContent) === null || _element_ownerDocument_getElementById_textContent === void 0 ? void 0 : _element_ownerDocument_getElementById_textContent.trim();
75
75
  } else if (isElementType.isElementType(element, [
76
76
  'button',
77
77
  'input',
@@ -79,15 +79,15 @@ function getLabelDescr(element) {
79
79
  'output',
80
80
  'progress',
81
81
  'select',
82
- 'textarea',
83
- ]) && ((ref = element.labels) === null || ref === void 0 ? void 0 : ref.length)) {
82
+ 'textarea'
83
+ ]) && ((_element_labels = element.labels) === null || _element_labels === void 0 ? void 0 : _element_labels.length)) {
84
84
  label = Array.from(element.labels).map((el)=>{
85
- var ref;
86
- return (ref = el.textContent) === null || ref === void 0 ? void 0 : ref.trim();
85
+ var _el_textContent;
86
+ return (_el_textContent = el.textContent) === null || _el_textContent === void 0 ? void 0 : _el_textContent.trim();
87
87
  }).join('|');
88
88
  } else if (isElementType.isElementType(element, 'button')) {
89
- var ref3;
90
- label = (ref3 = element.textContent) === null || ref3 === void 0 ? void 0 : ref3.trim();
89
+ var _element_textContent;
90
+ label = (_element_textContent = element.textContent) === null || _element_textContent === void 0 ? void 0 : _element_textContent.trim();
91
91
  }
92
92
  label = label === null || label === void 0 ? void 0 : label.replace(/\n/g, ' ');
93
93
  if (Number(label === null || label === void 0 ? void 0 : label.length) > 30) {
@@ -0,0 +1,2 @@
1
+ import * as named from '@testing-library/dom';
2
+ export { named as default };
@@ -0,0 +1,2 @@
1
+ import * as named from '@testing-library/dom/dist/event-map.js';
2
+ export { named as default };
@@ -0,0 +1,2 @@
1
+ import * as named from '@testing-library/dom/dist/helpers.js';
2
+ export { named as default };
@@ -10,8 +10,8 @@ import { copySelection } from '../document/copySelection.js';
10
10
 
11
11
  async function copy() {
12
12
  const doc = this.config.document;
13
- var _activeElement;
14
- const target = (_activeElement = doc.activeElement) !== null && _activeElement !== void 0 ? _activeElement : /* istanbul ignore next */ doc.body;
13
+ var _doc_activeElement;
14
+ const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
15
15
  const clipboardData = copySelection(target);
16
16
  if (clipboardData.items.length === 0) {
17
17
  return;
@@ -10,8 +10,8 @@ import { copySelection } from '../document/copySelection.js';
10
10
 
11
11
  async function cut() {
12
12
  const doc = this.config.document;
13
- var _activeElement;
14
- const target = (_activeElement = doc.activeElement) !== null && _activeElement !== void 0 ? _activeElement : /* istanbul ignore next */ doc.body;
13
+ var _doc_activeElement;
14
+ const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
15
15
  const clipboardData = copySelection(target);
16
16
  if (clipboardData.items.length === 0) {
17
17
  return;
@@ -10,10 +10,10 @@ import '../options.js';
10
10
 
11
11
  async function paste(clipboardData) {
12
12
  const doc = this.config.document;
13
- var _activeElement;
14
- const target = (_activeElement = doc.activeElement) !== null && _activeElement !== void 0 ? _activeElement : /* istanbul ignore next */ doc.body;
15
- var ref;
16
- const dataTransfer = (ref = typeof clipboardData === 'string' ? getClipboardDataFromString(doc, clipboardData) : clipboardData) !== null && ref !== void 0 ? ref : await readDataTransferFromClipboard(doc).catch(()=>{
13
+ var _doc_activeElement;
14
+ const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
15
+ var _ref;
16
+ const dataTransfer = (_ref = typeof clipboardData === 'string' ? getClipboardDataFromString(doc, clipboardData) : clipboardData) !== null && _ref !== void 0 ? _ref : await readDataTransferFromClipboard(doc).catch(()=>{
17
17
  throw new Error('`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.');
18
18
  });
19
19
  this.dispatchUIEvent(target, 'paste', {
@@ -1,4 +1,4 @@
1
- async function tab({ shift } = {}) {
1
+ async function tab({ shift } = {}) {
2
2
  return this.keyboard(shift === true ? '{Shift>}{Tab}{/Shift}' : shift === false ? '[/ShiftLeft][/ShiftRight]{Tab}' : '{Tab}');
3
3
  }
4
4
 
@@ -32,7 +32,7 @@ function getInitialValue(element) {
32
32
  function setUISelectionRaw(element, selection) {
33
33
  element[UISelection] = selection;
34
34
  }
35
- function setUISelection(element, { focusOffset: focusOffsetParam , anchorOffset: anchorOffsetParam = focusOffsetParam }, mode = 'replace') {
35
+ function setUISelection(element, { focusOffset: focusOffsetParam, anchorOffset: anchorOffsetParam = focusOffsetParam }, mode = 'replace') {
36
36
  const valueLength = getUIValue(element).length;
37
37
  const sanitizeOffset = (o)=>Math.max(0, Math.min(valueLength, o));
38
38
  const anchorOffset = mode === 'replace' || element[UISelection] === undefined ? sanitizeOffset(anchorOffsetParam) : element[UISelection].anchorOffset;
@@ -58,10 +58,10 @@ function setUISelection(element, { focusOffset: focusOffsetParam , anchorOffset:
58
58
  }
59
59
  }
60
60
  function getUISelection(element) {
61
- var _selectionStart, _selectionEnd, _UISelection;
62
- const sel = (_UISelection = element[UISelection]) !== null && _UISelection !== void 0 ? _UISelection : {
63
- anchorOffset: (_selectionStart = element.selectionStart) !== null && _selectionStart !== void 0 ? _selectionStart : 0,
64
- focusOffset: (_selectionEnd = element.selectionEnd) !== null && _selectionEnd !== void 0 ? _selectionEnd : 0
61
+ var _element_selectionStart, _element_selectionEnd, _element_UISelection;
62
+ const sel = (_element_UISelection = element[UISelection]) !== null && _element_UISelection !== void 0 ? _element_UISelection : {
63
+ anchorOffset: (_element_selectionStart = element.selectionStart) !== null && _element_selectionStart !== void 0 ? _element_selectionStart : 0,
64
+ focusOffset: (_element_selectionEnd = element.selectionEnd) !== null && _element_selectionEnd !== void 0 ? _element_selectionEnd : 0
65
65
  };
66
66
  return {
67
67
  ...sel,
@@ -19,7 +19,7 @@ function prepareInterceptor(element, propName, interceptorImpl) {
19
19
  throw new Error(`Element ${element.tagName} does not implement "${String(propName)}".`);
20
20
  }
21
21
  function intercept(...args) {
22
- const { applyNative =false , realArgs , then , } = interceptorImpl.call(this, ...args);
22
+ const { applyNative = false, realArgs, then } = interceptorImpl.call(this, ...args);
23
23
  const realFunc = (!applyNative && objectDescriptor || prototypeDescriptor)[target];
24
24
  if (target === 'set') {
25
25
  realFunc.call(this, realArgs);
@@ -29,8 +29,8 @@ function startTrackValue(element) {
29
29
  };
30
30
  }
31
31
  function trackOrSetValue(element, v) {
32
- var ref, ref1;
33
- (ref = element[TrackChanges]) === null || ref === void 0 ? void 0 : (ref1 = ref.tracked) === null || ref1 === void 0 ? void 0 : ref1.push(v);
32
+ var _element_TrackChanges_tracked, _element_TrackChanges;
33
+ (_element_TrackChanges = element[TrackChanges]) === null || _element_TrackChanges === void 0 ? void 0 : (_element_TrackChanges_tracked = _element_TrackChanges.tracked) === null || _element_TrackChanges_tracked === void 0 ? void 0 : _element_TrackChanges_tracked.push(v);
34
34
  if (!element[TrackChanges]) {
35
35
  setUIValueClean(element);
36
36
  setUISelection(element, {
@@ -39,10 +39,10 @@ function trackOrSetValue(element, v) {
39
39
  }
40
40
  }
41
41
  function commitValueAfterInput(element, cursorOffset) {
42
- var ref;
42
+ var _changes_tracked;
43
43
  const changes = element[TrackChanges];
44
44
  element[TrackChanges] = undefined;
45
- if (!(changes === null || changes === void 0 ? void 0 : (ref = changes.tracked) === null || ref === void 0 ? void 0 : ref.length)) {
45
+ if (!(changes === null || changes === void 0 ? void 0 : (_changes_tracked = changes.tracked) === null || _changes_tracked === void 0 ? void 0 : _changes_tracked.length)) {
46
46
  return;
47
47
  }
48
48
  const isJustReactStateUpdate = changes.tracked.length === 2 && changes.tracked[0] === changes.previousValue && changes.tracked[1] === element.value;
@@ -21,9 +21,9 @@ import { walkRadio } from '../radio.js';
21
21
  import { behavior } from './registry.js';
22
22
 
23
23
  behavior.keydown = (event, target, instance)=>{
24
- var ref;
25
- var ref1;
26
- return (ref1 = (ref = keydownBehavior[event.key]) === null || ref === void 0 ? void 0 : ref.call(keydownBehavior, event, target, instance)) !== null && ref1 !== void 0 ? ref1 : combinationBehavior(event, target, instance);
24
+ var _keydownBehavior_event_key;
25
+ var _keydownBehavior_event_key1;
26
+ return (_keydownBehavior_event_key1 = (_keydownBehavior_event_key = keydownBehavior[event.key]) === null || _keydownBehavior_event_key === void 0 ? void 0 : _keydownBehavior_event_key.call(keydownBehavior, event, target, instance)) !== null && _keydownBehavior_event_key1 !== void 0 ? _keydownBehavior_event_key1 : combinationBehavior(event, target, instance);
27
27
  };
28
28
  const keydownBehavior = {
29
29
  ArrowDown: (event, target, instance)=>{
@@ -76,9 +76,9 @@ const keydownBehavior = {
76
76
  'textarea'
77
77
  ]) || isContentEditable(target)) {
78
78
  return ()=>{
79
- var ref;
80
- var ref1;
81
- const newPos = (ref1 = (ref = getValueOrTextContent(target)) === null || ref === void 0 ? void 0 : ref.length) !== null && ref1 !== void 0 ? ref1 : /* istanbul ignore next */ 0;
79
+ var _getValueOrTextContent;
80
+ var _getValueOrTextContent_length;
81
+ const newPos = (_getValueOrTextContent_length = (_getValueOrTextContent = getValueOrTextContent(target)) === null || _getValueOrTextContent === void 0 ? void 0 : _getValueOrTextContent.length) !== null && _getValueOrTextContent_length !== void 0 ? _getValueOrTextContent_length : /* istanbul ignore next */ 0;
82
82
  setSelectionRange(target, newPos, newPos);
83
83
  };
84
84
  }
@@ -41,7 +41,7 @@ const ClickInputOnEnter = [
41
41
  'file',
42
42
  'image',
43
43
  'reset',
44
- 'submit',
44
+ 'submit'
45
45
  ];
46
46
  const SubmitSingleInputOnEnter = [
47
47
  'email',
@@ -51,5 +51,5 @@ const SubmitSingleInputOnEnter = [
51
51
  'tel',
52
52
  'text',
53
53
  'url',
54
- 'week',
54
+ 'week'
55
55
  ];
@@ -9,8 +9,8 @@ import '../../options.js';
9
9
  import { behavior } from './registry.js';
10
10
 
11
11
  behavior.keyup = (event, target, instance)=>{
12
- var ref;
13
- return (ref = keyupBehavior[event.key]) === null || ref === void 0 ? void 0 : ref.call(keyupBehavior, event, target, instance);
12
+ var _keyupBehavior_event_key;
13
+ return (_keyupBehavior_event_key = keyupBehavior[event.key]) === null || _keyupBehavior_event_key === void 0 ? void 0 : _keyupBehavior_event_key.call(keyupBehavior, event, target, instance);
14
14
  };
15
15
  const keyupBehavior = {
16
16
  ' ': (event, target, instance)=>{
@@ -12,8 +12,8 @@ import { behavior } from './registry.js';
12
12
  behavior.paste = (event, target, instance)=>{
13
13
  if (isEditable(target)) {
14
14
  return ()=>{
15
- var ref;
16
- const insertData = (ref = event.clipboardData) === null || ref === void 0 ? void 0 : ref.getData('text');
15
+ var _event_clipboardData;
16
+ const insertData = (_event_clipboardData = event.clipboardData) === null || _event_clipboardData === void 0 ? void 0 : _event_clipboardData.getData('text');
17
17
  if (insertData) {
18
18
  input(instance, target, insertData, 'insertFromPaste');
19
19
  }
@@ -25,7 +25,7 @@ const eventInitializer = {
25
25
  initUIEvent,
26
26
  initUIEventModififiers,
27
27
  initMouseEvent,
28
- initPointerEvent,
28
+ initPointerEvent
29
29
  ],
30
30
  KeyboardEvent: [
31
31
  initUIEvent,
@@ -34,58 +34,58 @@ const eventInitializer = {
34
34
  ]
35
35
  };
36
36
  function createEvent(type, target, init) {
37
- var ref;
37
+ var _eventInitializer_EventType;
38
38
  const window = getWindow(target);
39
- const { EventType , defaultInit } = eventMap[eventMapKeys[type]];
39
+ const { EventType, defaultInit } = eventMap[eventMapKeys[type]];
40
40
  const event = new (getEventConstructors(window))[EventType](type, defaultInit);
41
- (ref = eventInitializer[EventType]) === null || ref === void 0 ? void 0 : ref.forEach((f)=>f(event, init !== null && init !== void 0 ? init : {}));
41
+ (_eventInitializer_EventType = eventInitializer[EventType]) === null || _eventInitializer_EventType === void 0 ? void 0 : _eventInitializer_EventType.forEach((f)=>f(event, init !== null && init !== void 0 ? init : {}));
42
42
  return event;
43
43
  }
44
44
  /* istanbul ignore next */ function getEventConstructors(window) {
45
- var _Event;
46
- /* eslint-disable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-extraneous-class */ const Event = (_Event = window.Event) !== null && _Event !== void 0 ? _Event : class Event {
45
+ var _window_Event;
46
+ /* eslint-disable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-extraneous-class */ const Event = (_window_Event = window.Event) !== null && _window_Event !== void 0 ? _window_Event : class Event {
47
47
  };
48
- var _AnimationEvent;
49
- const AnimationEvent = (_AnimationEvent = window.AnimationEvent) !== null && _AnimationEvent !== void 0 ? _AnimationEvent : class AnimationEvent extends Event {
48
+ var _window_AnimationEvent;
49
+ const AnimationEvent = (_window_AnimationEvent = window.AnimationEvent) !== null && _window_AnimationEvent !== void 0 ? _window_AnimationEvent : class AnimationEvent extends Event {
50
50
  };
51
- var _ClipboardEvent;
52
- const ClipboardEvent = (_ClipboardEvent = window.ClipboardEvent) !== null && _ClipboardEvent !== void 0 ? _ClipboardEvent : class ClipboardEvent extends Event {
51
+ var _window_ClipboardEvent;
52
+ const ClipboardEvent = (_window_ClipboardEvent = window.ClipboardEvent) !== null && _window_ClipboardEvent !== void 0 ? _window_ClipboardEvent : class ClipboardEvent extends Event {
53
53
  };
54
- var _PopStateEvent;
55
- const PopStateEvent = (_PopStateEvent = window.PopStateEvent) !== null && _PopStateEvent !== void 0 ? _PopStateEvent : class PopStateEvent extends Event {
54
+ var _window_PopStateEvent;
55
+ const PopStateEvent = (_window_PopStateEvent = window.PopStateEvent) !== null && _window_PopStateEvent !== void 0 ? _window_PopStateEvent : class PopStateEvent extends Event {
56
56
  };
57
- var _ProgressEvent;
58
- const ProgressEvent = (_ProgressEvent = window.ProgressEvent) !== null && _ProgressEvent !== void 0 ? _ProgressEvent : class ProgressEvent extends Event {
57
+ var _window_ProgressEvent;
58
+ const ProgressEvent = (_window_ProgressEvent = window.ProgressEvent) !== null && _window_ProgressEvent !== void 0 ? _window_ProgressEvent : class ProgressEvent extends Event {
59
59
  };
60
- var _TransitionEvent;
61
- const TransitionEvent = (_TransitionEvent = window.TransitionEvent) !== null && _TransitionEvent !== void 0 ? _TransitionEvent : class TransitionEvent extends Event {
60
+ var _window_TransitionEvent;
61
+ const TransitionEvent = (_window_TransitionEvent = window.TransitionEvent) !== null && _window_TransitionEvent !== void 0 ? _window_TransitionEvent : class TransitionEvent extends Event {
62
62
  };
63
- var _UIEvent;
64
- const UIEvent = (_UIEvent = window.UIEvent) !== null && _UIEvent !== void 0 ? _UIEvent : class UIEvent extends Event {
63
+ var _window_UIEvent;
64
+ const UIEvent = (_window_UIEvent = window.UIEvent) !== null && _window_UIEvent !== void 0 ? _window_UIEvent : class UIEvent extends Event {
65
65
  };
66
- var _CompositionEvent;
67
- const CompositionEvent = (_CompositionEvent = window.CompositionEvent) !== null && _CompositionEvent !== void 0 ? _CompositionEvent : class CompositionEvent extends UIEvent {
66
+ var _window_CompositionEvent;
67
+ const CompositionEvent = (_window_CompositionEvent = window.CompositionEvent) !== null && _window_CompositionEvent !== void 0 ? _window_CompositionEvent : class CompositionEvent extends UIEvent {
68
68
  };
69
- var _FocusEvent;
70
- const FocusEvent = (_FocusEvent = window.FocusEvent) !== null && _FocusEvent !== void 0 ? _FocusEvent : class FocusEvent extends UIEvent {
69
+ var _window_FocusEvent;
70
+ const FocusEvent = (_window_FocusEvent = window.FocusEvent) !== null && _window_FocusEvent !== void 0 ? _window_FocusEvent : class FocusEvent extends UIEvent {
71
71
  };
72
- var _InputEvent;
73
- const InputEvent = (_InputEvent = window.InputEvent) !== null && _InputEvent !== void 0 ? _InputEvent : class InputEvent extends UIEvent {
72
+ var _window_InputEvent;
73
+ const InputEvent = (_window_InputEvent = window.InputEvent) !== null && _window_InputEvent !== void 0 ? _window_InputEvent : class InputEvent extends UIEvent {
74
74
  };
75
- var _KeyboardEvent;
76
- const KeyboardEvent = (_KeyboardEvent = window.KeyboardEvent) !== null && _KeyboardEvent !== void 0 ? _KeyboardEvent : class KeyboardEvent extends UIEvent {
75
+ var _window_KeyboardEvent;
76
+ const KeyboardEvent = (_window_KeyboardEvent = window.KeyboardEvent) !== null && _window_KeyboardEvent !== void 0 ? _window_KeyboardEvent : class KeyboardEvent extends UIEvent {
77
77
  };
78
- var _MouseEvent;
79
- const MouseEvent = (_MouseEvent = window.MouseEvent) !== null && _MouseEvent !== void 0 ? _MouseEvent : class MouseEvent extends UIEvent {
78
+ var _window_MouseEvent;
79
+ const MouseEvent = (_window_MouseEvent = window.MouseEvent) !== null && _window_MouseEvent !== void 0 ? _window_MouseEvent : class MouseEvent extends UIEvent {
80
80
  };
81
- var _DragEvent;
82
- const DragEvent = (_DragEvent = window.DragEvent) !== null && _DragEvent !== void 0 ? _DragEvent : class DragEvent extends MouseEvent {
81
+ var _window_DragEvent;
82
+ const DragEvent = (_window_DragEvent = window.DragEvent) !== null && _window_DragEvent !== void 0 ? _window_DragEvent : class DragEvent extends MouseEvent {
83
83
  };
84
- var _PointerEvent;
85
- const PointerEvent = (_PointerEvent = window.PointerEvent) !== null && _PointerEvent !== void 0 ? _PointerEvent : class PointerEvent extends MouseEvent {
84
+ var _window_PointerEvent;
85
+ const PointerEvent = (_window_PointerEvent = window.PointerEvent) !== null && _window_PointerEvent !== void 0 ? _window_PointerEvent : class PointerEvent extends MouseEvent {
86
86
  };
87
- var _TouchEvent;
88
- const TouchEvent = (_TouchEvent = window.TouchEvent) !== null && _TouchEvent !== void 0 ? _TouchEvent : class TouchEvent extends UIEvent {
87
+ var _window_TouchEvent;
88
+ const TouchEvent = (_window_TouchEvent = window.TouchEvent) !== null && _window_TouchEvent !== void 0 ? _window_TouchEvent : class TouchEvent extends UIEvent {
89
89
  };
90
90
  /* eslint-enable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-extraneous-class */ return {
91
91
  Event,
@@ -115,25 +115,25 @@ function assignProps(obj, props) {
115
115
  function sanitizeNumber(n) {
116
116
  return Number(n !== null && n !== void 0 ? n : 0);
117
117
  }
118
- function initClipboardEvent(event, { clipboardData }) {
118
+ function initClipboardEvent(event, { clipboardData }) {
119
119
  assignProps(event, {
120
120
  clipboardData
121
121
  });
122
122
  }
123
- function initInputEvent(event, { data , inputType , isComposing }) {
123
+ function initInputEvent(event, { data, inputType, isComposing }) {
124
124
  assignProps(event, {
125
125
  data,
126
126
  isComposing: Boolean(isComposing),
127
127
  inputType: String(inputType)
128
128
  });
129
129
  }
130
- function initUIEvent(event, { view , detail }) {
130
+ function initUIEvent(event, { view, detail }) {
131
131
  assignProps(event, {
132
132
  view,
133
133
  detail: sanitizeNumber(detail !== null && detail !== void 0 ? detail : 0)
134
134
  });
135
135
  }
136
- function initUIEventModififiers(event, { altKey , ctrlKey , metaKey , shiftKey , modifierAltGraph , modifierCapsLock , modifierFn , modifierFnLock , modifierNumLock , modifierScrollLock , modifierSymbol , modifierSymbolLock }) {
136
+ function initUIEventModififiers(event, { altKey, ctrlKey, metaKey, shiftKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierNumLock, modifierScrollLock, modifierSymbol, modifierSymbolLock }) {
137
137
  assignProps(event, {
138
138
  altKey: Boolean(altKey),
139
139
  ctrlKey: Boolean(ctrlKey),
@@ -157,7 +157,7 @@ function initUIEventModififiers(event, { altKey , ctrlKey , metaKey , shiftKey ,
157
157
  }
158
158
  });
159
159
  }
160
- function initKeyboardEvent(event, { key , code , location , repeat , isComposing , charCode }) {
160
+ function initKeyboardEvent(event, { key, code, location, repeat, isComposing, charCode }) {
161
161
  assignProps(event, {
162
162
  key: String(key),
163
163
  code: String(code),
@@ -167,7 +167,7 @@ function initKeyboardEvent(event, { key , code , location , repeat , isComposing
167
167
  charCode
168
168
  });
169
169
  }
170
- function initMouseEvent(event, { x , y , screenX , screenY , clientX =x , clientY =y , button , buttons , relatedTarget }) {
170
+ function initMouseEvent(event, { x, y, screenX, screenY, clientX = x, clientY = y, button, buttons, relatedTarget }) {
171
171
  assignProps(event, {
172
172
  screenX: sanitizeNumber(screenX),
173
173
  screenY: sanitizeNumber(screenY),
@@ -180,7 +180,7 @@ function initMouseEvent(event, { x , y , screenX , screenY , clientX =x , client
180
180
  relatedTarget
181
181
  });
182
182
  }
183
- function initPointerEvent(event, { pointerId , width , height , pressure , tangentialPressure , tiltX , tiltY , twist , pointerType , isPrimary }) {
183
+ function initPointerEvent(event, { pointerId, width, height, pressure, tangentialPressure, tiltX, tiltY, twist, pointerType, isPrimary }) {
184
184
  assignProps(event, {
185
185
  pointerId: sanitizeNumber(pointerId),
186
186
  width: sanitizeNumber(width),
@@ -20,9 +20,9 @@ function dispatchUIEvent(target, type, init, preventDefault = false) {
20
20
  return dispatchEvent.call(this, target, event, preventDefault);
21
21
  }
22
22
  function dispatchEvent(target, event, preventDefault = false) {
23
- var ref;
23
+ var _behavior_type;
24
24
  const type = event.type;
25
- const behaviorImplementation = preventDefault ? ()=>{} : (ref = behavior[type]) === null || ref === void 0 ? void 0 : ref(event, target, this);
25
+ const behaviorImplementation = preventDefault ? ()=>{} : (_behavior_type = behavior[type]) === null || _behavior_type === void 0 ? void 0 : _behavior_type.call(behavior, event, target, this);
26
26
  if (behaviorImplementation) {
27
27
  event.preventDefault();
28
28
  let defaultPrevented = false;
@@ -1,7 +1,7 @@
1
- import { eventMap as eventMap$1 } from '@testing-library/dom/dist/event-map.js';
1
+ import * as named from '@testing-library/dom/dist/event-map.js';
2
2
 
3
3
  const eventMap = {
4
- ...eventMap$1,
4
+ ...named.eventMap,
5
5
  click: {
6
6
  EventType: 'PointerEvent',
7
7
  defaultInit: {
@@ -22,10 +22,7 @@ import { wrapEvent } from './wrapEvent.js';
22
22
  } else if (target) {
23
23
  wrapEvent(()=>target.focus());
24
24
  } else {
25
- wrapEvent(()=>{
26
- var ref;
27
- return (ref = activeElement) === null || ref === void 0 ? void 0 : ref.blur();
28
- });
25
+ wrapEvent(()=>activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur());
29
26
  }
30
27
  updateSelectionOnFocus(target !== null && target !== void 0 ? target : element.ownerDocument.body);
31
28
  }
@@ -94,7 +94,7 @@ function editInputElement(instance, element, inputRange, data, inputType) {
94
94
  }
95
95
  }
96
96
  }
97
- const { newValue , newOffset , oldValue } = calculateNewValue(dataToInsert, element, inputRange, inputType);
97
+ const { newValue, newOffset, oldValue } = calculateNewValue(dataToInsert, element, inputRange, inputType);
98
98
  if (newValue === oldValue && newOffset === inputRange.startOffset && newOffset === inputRange.endOffset) {
99
99
  return;
100
100
  }
@@ -122,7 +122,7 @@ function editInputElement(instance, element, inputRange, data, inputType) {
122
122
  });
123
123
  }
124
124
  }
125
- function calculateNewValue(inputData, node, { startOffset , endOffset }, inputType) {
125
+ function calculateNewValue(inputData, node, { startOffset, endOffset }, inputType) {
126
126
  const value = getUIValue(node);
127
127
  const prologEnd = Math.max(0, startOffset === endOffset && inputType === 'deleteContentBackward' ? startOffset - 1 : startOffset);
128
128
  const prolog = value.substring(0, prologEnd);
@@ -150,12 +150,12 @@ function commitInput(instance, element, newOffset, inputInit) {
150
150
  commitValueAfterInput(element, newOffset);
151
151
  }
152
152
  function isValidNumberInput(value) {
153
- var ref, ref1;
153
+ var _value_match, _value_match1;
154
154
  // the browser allows some invalid input but not others
155
155
  // it allows up to two '-' at any place before any 'e' or one directly following 'e'
156
156
  // it allows one '.' at any place before e
157
157
  const valueParts = value.split('e', 2);
158
- return !(/[^\d.\-e]/.test(value) || Number((ref = value.match(/-/g)) === null || ref === void 0 ? void 0 : ref.length) > 2 || Number((ref1 = value.match(/\./g)) === null || ref1 === void 0 ? void 0 : ref1.length) > 1 || valueParts[1] && !/^-?\d*$/.test(valueParts[1]));
158
+ return !(/[^\d.\-e]/.test(value) || Number((_value_match = value.match(/-/g)) === null || _value_match === void 0 ? void 0 : _value_match.length) > 2 || Number((_value_match1 = value.match(/\./g)) === null || _value_match1 === void 0 ? void 0 : _value_match1.length) > 1 || valueParts[1] && !/^-?\d*$/.test(valueParts[1]));
159
159
  }
160
160
 
161
161
  export { input };
@@ -7,9 +7,9 @@ import { getTargetTypeAndSelection } from './getTargetTypeAndSelection.js';
7
7
  if (typeAndSelection.type === 'input') {
8
8
  return typeAndSelection.selection;
9
9
  } else if (typeAndSelection.type === 'contenteditable') {
10
- var ref;
10
+ var _typeAndSelection_selection;
11
11
  // Multi-range on contenteditable edits the first selection instead of the last
12
- return (ref = typeAndSelection.selection) === null || ref === void 0 ? void 0 : ref.getRangeAt(0);
12
+ return (_typeAndSelection_selection = typeAndSelection.selection) === null || _typeAndSelection_selection === void 0 ? void 0 : _typeAndSelection_selection.getRangeAt(0);
13
13
  }
14
14
  }
15
15
 
@@ -11,8 +11,8 @@ import { getTargetTypeAndSelection } from './getTargetTypeAndSelection.js';
11
11
 
12
12
  /**
13
13
  * Extend/shrink the selection like with Shift+Arrows or Shift+Mouse
14
- */ function modifySelection({ focusNode , focusOffset }) {
15
- var ref, ref1;
14
+ */ function modifySelection({ focusNode, focusOffset }) {
15
+ var _focusNode_ownerDocument_getSelection, _focusNode_ownerDocument;
16
16
  const typeAndSelection = getTargetTypeAndSelection(focusNode);
17
17
  if (typeAndSelection.type === 'input') {
18
18
  return setUISelection(focusNode, {
@@ -20,7 +20,7 @@ import { getTargetTypeAndSelection } from './getTargetTypeAndSelection.js';
20
20
  focusOffset
21
21
  }, 'modify');
22
22
  }
23
- (ref1 = (ref = focusNode.ownerDocument) === null || ref === void 0 ? void 0 : ref.getSelection()) === null || ref1 === void 0 ? void 0 : ref1.extend(focusNode, focusOffset);
23
+ (_focusNode_ownerDocument = focusNode.ownerDocument) === null || _focusNode_ownerDocument === void 0 ? void 0 : (_focusNode_ownerDocument_getSelection = _focusNode_ownerDocument.getSelection()) === null || _focusNode_ownerDocument_getSelection === void 0 ? void 0 : _focusNode_ownerDocument_getSelection.extend(focusNode, focusOffset);
24
24
  }
25
25
 
26
26
  export { modifySelection };
@@ -9,7 +9,7 @@ import '../../utils/misc/level.js';
9
9
  import '../../options.js';
10
10
  import { resolveCaretPosition } from './resolveCaretPosition.js';
11
11
 
12
- function modifySelectionPerMouseMove(selectionRange, { document , target , node , offset }) {
12
+ function modifySelectionPerMouseMove(selectionRange, { document, target, node, offset }) {
13
13
  const selectionFocus = resolveCaretPosition({
14
14
  target,
15
15
  node,