@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
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var named = require('@testing-library/dom');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n["default"] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var named__namespace = /*#__PURE__*/_interopNamespace(named);
24
+
25
+
26
+
27
+ module.exports = named__namespace;
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var named = require('@testing-library/dom/dist/event-map.js');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n["default"] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var named__namespace = /*#__PURE__*/_interopNamespace(named);
24
+
25
+
26
+
27
+ module.exports = named__namespace;
@@ -0,0 +1,27 @@
1
+ 'use strict';
2
+
3
+ var named = require('@testing-library/dom/dist/helpers.js');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n["default"] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var named__namespace = /*#__PURE__*/_interopNamespace(named);
24
+
25
+
26
+
27
+ module.exports = named__namespace;
@@ -14,8 +14,8 @@ var copySelection = require('../document/copySelection.js');
14
14
 
15
15
  async function copy() {
16
16
  const doc = this.config.document;
17
- var _activeElement;
18
- const target = (_activeElement = doc.activeElement) !== null && _activeElement !== void 0 ? _activeElement : /* istanbul ignore next */ doc.body;
17
+ var _doc_activeElement;
18
+ const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
19
19
  const clipboardData = copySelection.copySelection(target);
20
20
  if (clipboardData.items.length === 0) {
21
21
  return;
@@ -14,8 +14,8 @@ var copySelection = require('../document/copySelection.js');
14
14
 
15
15
  async function cut() {
16
16
  const doc = this.config.document;
17
- var _activeElement;
18
- const target = (_activeElement = doc.activeElement) !== null && _activeElement !== void 0 ? _activeElement : /* istanbul ignore next */ doc.body;
17
+ var _doc_activeElement;
18
+ const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
19
19
  const clipboardData = copySelection.copySelection(target);
20
20
  if (clipboardData.items.length === 0) {
21
21
  return;
@@ -14,10 +14,10 @@ require('../options.js');
14
14
 
15
15
  async function paste(clipboardData) {
16
16
  const doc = this.config.document;
17
- var _activeElement;
18
- const target = (_activeElement = doc.activeElement) !== null && _activeElement !== void 0 ? _activeElement : /* istanbul ignore next */ doc.body;
19
- var ref;
20
- const dataTransfer = (ref = typeof clipboardData === 'string' ? getClipboardDataFromString(doc, clipboardData) : clipboardData) !== null && ref !== void 0 ? ref : await Clipboard.readDataTransferFromClipboard(doc).catch(()=>{
17
+ var _doc_activeElement;
18
+ const target = (_doc_activeElement = doc.activeElement) !== null && _doc_activeElement !== void 0 ? _doc_activeElement : /* istanbul ignore next */ doc.body;
19
+ var _ref;
20
+ const dataTransfer = (_ref = typeof clipboardData === 'string' ? getClipboardDataFromString(doc, clipboardData) : clipboardData) !== null && _ref !== void 0 ? _ref : await Clipboard.readDataTransferFromClipboard(doc).catch(()=>{
21
21
  throw new Error('`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.');
22
22
  });
23
23
  this.dispatchUIEvent(target, 'paste', {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- async function tab({ shift } = {}) {
5
+ async function tab({ shift } = {}) {
6
6
  return this.keyboard(shift === true ? '{Shift>}{Tab}{/Shift}' : shift === false ? '[/ShiftLeft][/ShiftRight]{Tab}' : '{Tab}');
7
7
  }
8
8
 
@@ -36,7 +36,7 @@ function getInitialValue(element) {
36
36
  function setUISelectionRaw(element, selection) {
37
37
  element[UISelection] = selection;
38
38
  }
39
- function setUISelection(element, { focusOffset: focusOffsetParam , anchorOffset: anchorOffsetParam = focusOffsetParam }, mode = 'replace') {
39
+ function setUISelection(element, { focusOffset: focusOffsetParam, anchorOffset: anchorOffsetParam = focusOffsetParam }, mode = 'replace') {
40
40
  const valueLength = getUIValue(element).length;
41
41
  const sanitizeOffset = (o)=>Math.max(0, Math.min(valueLength, o));
42
42
  const anchorOffset = mode === 'replace' || element[UISelection] === undefined ? sanitizeOffset(anchorOffsetParam) : element[UISelection].anchorOffset;
@@ -62,10 +62,10 @@ function setUISelection(element, { focusOffset: focusOffsetParam , anchorOffset:
62
62
  }
63
63
  }
64
64
  function getUISelection(element) {
65
- var _selectionStart, _selectionEnd, _UISelection;
66
- const sel = (_UISelection = element[UISelection]) !== null && _UISelection !== void 0 ? _UISelection : {
67
- anchorOffset: (_selectionStart = element.selectionStart) !== null && _selectionStart !== void 0 ? _selectionStart : 0,
68
- focusOffset: (_selectionEnd = element.selectionEnd) !== null && _selectionEnd !== void 0 ? _selectionEnd : 0
65
+ var _element_selectionStart, _element_selectionEnd, _element_UISelection;
66
+ const sel = (_element_UISelection = element[UISelection]) !== null && _element_UISelection !== void 0 ? _element_UISelection : {
67
+ anchorOffset: (_element_selectionStart = element.selectionStart) !== null && _element_selectionStart !== void 0 ? _element_selectionStart : 0,
68
+ focusOffset: (_element_selectionEnd = element.selectionEnd) !== null && _element_selectionEnd !== void 0 ? _element_selectionEnd : 0
69
69
  };
70
70
  return {
71
71
  ...sel,
@@ -23,7 +23,7 @@ function prepareInterceptor(element, propName, interceptorImpl) {
23
23
  throw new Error(`Element ${element.tagName} does not implement "${String(propName)}".`);
24
24
  }
25
25
  function intercept(...args) {
26
- const { applyNative =false , realArgs , then , } = interceptorImpl.call(this, ...args);
26
+ const { applyNative = false, realArgs, then } = interceptorImpl.call(this, ...args);
27
27
  const realFunc = (!applyNative && objectDescriptor || prototypeDescriptor)[target];
28
28
  if (target === 'set') {
29
29
  realFunc.call(this, realArgs);
@@ -33,8 +33,8 @@ function startTrackValue(element) {
33
33
  };
34
34
  }
35
35
  function trackOrSetValue(element, v) {
36
- var ref, ref1;
37
- (ref = element[TrackChanges]) === null || ref === void 0 ? void 0 : (ref1 = ref.tracked) === null || ref1 === void 0 ? void 0 : ref1.push(v);
36
+ var _element_TrackChanges_tracked, _element_TrackChanges;
37
+ (_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);
38
38
  if (!element[TrackChanges]) {
39
39
  UI.setUIValueClean(element);
40
40
  UI.setUISelection(element, {
@@ -43,10 +43,10 @@ function trackOrSetValue(element, v) {
43
43
  }
44
44
  }
45
45
  function commitValueAfterInput(element, cursorOffset) {
46
- var ref;
46
+ var _changes_tracked;
47
47
  const changes = element[TrackChanges];
48
48
  element[TrackChanges] = undefined;
49
- if (!(changes === null || changes === void 0 ? void 0 : (ref = changes.tracked) === null || ref === void 0 ? void 0 : ref.length)) {
49
+ if (!(changes === null || changes === void 0 ? void 0 : (_changes_tracked = changes.tracked) === null || _changes_tracked === void 0 ? void 0 : _changes_tracked.length)) {
50
50
  return;
51
51
  }
52
52
  const isJustReactStateUpdate = changes.tracked.length === 2 && changes.tracked[0] === changes.previousValue && changes.tracked[1] === element.value;
@@ -23,9 +23,9 @@ var radio = require('../radio.js');
23
23
  var registry = require('./registry.js');
24
24
 
25
25
  registry.behavior.keydown = (event, target, instance)=>{
26
- var ref;
27
- var ref1;
28
- 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);
26
+ var _keydownBehavior_event_key;
27
+ var _keydownBehavior_event_key1;
28
+ 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);
29
29
  };
30
30
  const keydownBehavior = {
31
31
  ArrowDown: (event, target, instance)=>{
@@ -78,9 +78,9 @@ const keydownBehavior = {
78
78
  'textarea'
79
79
  ]) || isContentEditable.isContentEditable(target)) {
80
80
  return ()=>{
81
- var ref;
82
- var ref1;
83
- const newPos = (ref1 = (ref = getValueOrTextContent.getValueOrTextContent(target)) === null || ref === void 0 ? void 0 : ref.length) !== null && ref1 !== void 0 ? ref1 : /* istanbul ignore next */ 0;
81
+ var _getValueOrTextContent;
82
+ var _getValueOrTextContent_length;
83
+ const newPos = (_getValueOrTextContent_length = (_getValueOrTextContent = getValueOrTextContent.getValueOrTextContent(target)) === null || _getValueOrTextContent === void 0 ? void 0 : _getValueOrTextContent.length) !== null && _getValueOrTextContent_length !== void 0 ? _getValueOrTextContent_length : /* istanbul ignore next */ 0;
84
84
  setSelectionRange.setSelectionRange(target, newPos, newPos);
85
85
  };
86
86
  }
@@ -43,7 +43,7 @@ const ClickInputOnEnter = [
43
43
  'file',
44
44
  'image',
45
45
  'reset',
46
- 'submit',
46
+ 'submit'
47
47
  ];
48
48
  const SubmitSingleInputOnEnter = [
49
49
  'email',
@@ -53,5 +53,5 @@ const SubmitSingleInputOnEnter = [
53
53
  'tel',
54
54
  'text',
55
55
  'url',
56
- 'week',
56
+ 'week'
57
57
  ];
@@ -11,8 +11,8 @@ require('../../options.js');
11
11
  var registry = require('./registry.js');
12
12
 
13
13
  registry.behavior.keyup = (event, target, instance)=>{
14
- var ref;
15
- return (ref = keyupBehavior[event.key]) === null || ref === void 0 ? void 0 : ref.call(keyupBehavior, event, target, instance);
14
+ var _keyupBehavior_event_key;
15
+ return (_keyupBehavior_event_key = keyupBehavior[event.key]) === null || _keyupBehavior_event_key === void 0 ? void 0 : _keyupBehavior_event_key.call(keyupBehavior, event, target, instance);
16
16
  };
17
17
  const keyupBehavior = {
18
18
  ' ': (event, target, instance)=>{
@@ -14,8 +14,8 @@ var registry = require('./registry.js');
14
14
  registry.behavior.paste = (event, target, instance)=>{
15
15
  if (isEditable.isEditable(target)) {
16
16
  return ()=>{
17
- var ref;
18
- const insertData = (ref = event.clipboardData) === null || ref === void 0 ? void 0 : ref.getData('text');
17
+ var _event_clipboardData;
18
+ const insertData = (_event_clipboardData = event.clipboardData) === null || _event_clipboardData === void 0 ? void 0 : _event_clipboardData.getData('text');
19
19
  if (insertData) {
20
20
  input.input(instance, target, insertData, 'insertFromPaste');
21
21
  }
@@ -29,7 +29,7 @@ const eventInitializer = {
29
29
  initUIEvent,
30
30
  initUIEventModififiers,
31
31
  initMouseEvent,
32
- initPointerEvent,
32
+ initPointerEvent
33
33
  ],
34
34
  KeyboardEvent: [
35
35
  initUIEvent,
@@ -38,58 +38,58 @@ const eventInitializer = {
38
38
  ]
39
39
  };
40
40
  function createEvent(type, target, init) {
41
- var ref;
41
+ var _eventInitializer_EventType;
42
42
  const window = getWindow.getWindow(target);
43
- const { EventType , defaultInit } = eventMap.eventMap[eventMap.eventMapKeys[type]];
43
+ const { EventType, defaultInit } = eventMap.eventMap[eventMap.eventMapKeys[type]];
44
44
  const event = new (getEventConstructors(window))[EventType](type, defaultInit);
45
- (ref = eventInitializer[EventType]) === null || ref === void 0 ? void 0 : ref.forEach((f)=>f(event, init !== null && init !== void 0 ? init : {}));
45
+ (_eventInitializer_EventType = eventInitializer[EventType]) === null || _eventInitializer_EventType === void 0 ? void 0 : _eventInitializer_EventType.forEach((f)=>f(event, init !== null && init !== void 0 ? init : {}));
46
46
  return event;
47
47
  }
48
48
  /* istanbul ignore next */ function getEventConstructors(window) {
49
- var _Event;
50
- /* eslint-disable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-extraneous-class */ const Event = (_Event = window.Event) !== null && _Event !== void 0 ? _Event : class Event {
49
+ var _window_Event;
50
+ /* 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 {
51
51
  };
52
- var _AnimationEvent;
53
- const AnimationEvent = (_AnimationEvent = window.AnimationEvent) !== null && _AnimationEvent !== void 0 ? _AnimationEvent : class AnimationEvent extends Event {
52
+ var _window_AnimationEvent;
53
+ const AnimationEvent = (_window_AnimationEvent = window.AnimationEvent) !== null && _window_AnimationEvent !== void 0 ? _window_AnimationEvent : class AnimationEvent extends Event {
54
54
  };
55
- var _ClipboardEvent;
56
- const ClipboardEvent = (_ClipboardEvent = window.ClipboardEvent) !== null && _ClipboardEvent !== void 0 ? _ClipboardEvent : class ClipboardEvent extends Event {
55
+ var _window_ClipboardEvent;
56
+ const ClipboardEvent = (_window_ClipboardEvent = window.ClipboardEvent) !== null && _window_ClipboardEvent !== void 0 ? _window_ClipboardEvent : class ClipboardEvent extends Event {
57
57
  };
58
- var _PopStateEvent;
59
- const PopStateEvent = (_PopStateEvent = window.PopStateEvent) !== null && _PopStateEvent !== void 0 ? _PopStateEvent : class PopStateEvent extends Event {
58
+ var _window_PopStateEvent;
59
+ const PopStateEvent = (_window_PopStateEvent = window.PopStateEvent) !== null && _window_PopStateEvent !== void 0 ? _window_PopStateEvent : class PopStateEvent extends Event {
60
60
  };
61
- var _ProgressEvent;
62
- const ProgressEvent = (_ProgressEvent = window.ProgressEvent) !== null && _ProgressEvent !== void 0 ? _ProgressEvent : class ProgressEvent extends Event {
61
+ var _window_ProgressEvent;
62
+ const ProgressEvent = (_window_ProgressEvent = window.ProgressEvent) !== null && _window_ProgressEvent !== void 0 ? _window_ProgressEvent : class ProgressEvent extends Event {
63
63
  };
64
- var _TransitionEvent;
65
- const TransitionEvent = (_TransitionEvent = window.TransitionEvent) !== null && _TransitionEvent !== void 0 ? _TransitionEvent : class TransitionEvent extends Event {
64
+ var _window_TransitionEvent;
65
+ const TransitionEvent = (_window_TransitionEvent = window.TransitionEvent) !== null && _window_TransitionEvent !== void 0 ? _window_TransitionEvent : class TransitionEvent extends Event {
66
66
  };
67
- var _UIEvent;
68
- const UIEvent = (_UIEvent = window.UIEvent) !== null && _UIEvent !== void 0 ? _UIEvent : class UIEvent extends Event {
67
+ var _window_UIEvent;
68
+ const UIEvent = (_window_UIEvent = window.UIEvent) !== null && _window_UIEvent !== void 0 ? _window_UIEvent : class UIEvent extends Event {
69
69
  };
70
- var _CompositionEvent;
71
- const CompositionEvent = (_CompositionEvent = window.CompositionEvent) !== null && _CompositionEvent !== void 0 ? _CompositionEvent : class CompositionEvent extends UIEvent {
70
+ var _window_CompositionEvent;
71
+ const CompositionEvent = (_window_CompositionEvent = window.CompositionEvent) !== null && _window_CompositionEvent !== void 0 ? _window_CompositionEvent : class CompositionEvent extends UIEvent {
72
72
  };
73
- var _FocusEvent;
74
- const FocusEvent = (_FocusEvent = window.FocusEvent) !== null && _FocusEvent !== void 0 ? _FocusEvent : class FocusEvent extends UIEvent {
73
+ var _window_FocusEvent;
74
+ const FocusEvent = (_window_FocusEvent = window.FocusEvent) !== null && _window_FocusEvent !== void 0 ? _window_FocusEvent : class FocusEvent extends UIEvent {
75
75
  };
76
- var _InputEvent;
77
- const InputEvent = (_InputEvent = window.InputEvent) !== null && _InputEvent !== void 0 ? _InputEvent : class InputEvent extends UIEvent {
76
+ var _window_InputEvent;
77
+ const InputEvent = (_window_InputEvent = window.InputEvent) !== null && _window_InputEvent !== void 0 ? _window_InputEvent : class InputEvent extends UIEvent {
78
78
  };
79
- var _KeyboardEvent;
80
- const KeyboardEvent = (_KeyboardEvent = window.KeyboardEvent) !== null && _KeyboardEvent !== void 0 ? _KeyboardEvent : class KeyboardEvent extends UIEvent {
79
+ var _window_KeyboardEvent;
80
+ const KeyboardEvent = (_window_KeyboardEvent = window.KeyboardEvent) !== null && _window_KeyboardEvent !== void 0 ? _window_KeyboardEvent : class KeyboardEvent extends UIEvent {
81
81
  };
82
- var _MouseEvent;
83
- const MouseEvent = (_MouseEvent = window.MouseEvent) !== null && _MouseEvent !== void 0 ? _MouseEvent : class MouseEvent extends UIEvent {
82
+ var _window_MouseEvent;
83
+ const MouseEvent = (_window_MouseEvent = window.MouseEvent) !== null && _window_MouseEvent !== void 0 ? _window_MouseEvent : class MouseEvent extends UIEvent {
84
84
  };
85
- var _DragEvent;
86
- const DragEvent = (_DragEvent = window.DragEvent) !== null && _DragEvent !== void 0 ? _DragEvent : class DragEvent extends MouseEvent {
85
+ var _window_DragEvent;
86
+ const DragEvent = (_window_DragEvent = window.DragEvent) !== null && _window_DragEvent !== void 0 ? _window_DragEvent : class DragEvent extends MouseEvent {
87
87
  };
88
- var _PointerEvent;
89
- const PointerEvent = (_PointerEvent = window.PointerEvent) !== null && _PointerEvent !== void 0 ? _PointerEvent : class PointerEvent extends MouseEvent {
88
+ var _window_PointerEvent;
89
+ const PointerEvent = (_window_PointerEvent = window.PointerEvent) !== null && _window_PointerEvent !== void 0 ? _window_PointerEvent : class PointerEvent extends MouseEvent {
90
90
  };
91
- var _TouchEvent;
92
- const TouchEvent = (_TouchEvent = window.TouchEvent) !== null && _TouchEvent !== void 0 ? _TouchEvent : class TouchEvent extends UIEvent {
91
+ var _window_TouchEvent;
92
+ const TouchEvent = (_window_TouchEvent = window.TouchEvent) !== null && _window_TouchEvent !== void 0 ? _window_TouchEvent : class TouchEvent extends UIEvent {
93
93
  };
94
94
  /* eslint-enable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-extraneous-class */ return {
95
95
  Event,
@@ -119,25 +119,25 @@ function assignProps(obj, props) {
119
119
  function sanitizeNumber(n) {
120
120
  return Number(n !== null && n !== void 0 ? n : 0);
121
121
  }
122
- function initClipboardEvent(event, { clipboardData }) {
122
+ function initClipboardEvent(event, { clipboardData }) {
123
123
  assignProps(event, {
124
124
  clipboardData
125
125
  });
126
126
  }
127
- function initInputEvent(event, { data , inputType , isComposing }) {
127
+ function initInputEvent(event, { data, inputType, isComposing }) {
128
128
  assignProps(event, {
129
129
  data,
130
130
  isComposing: Boolean(isComposing),
131
131
  inputType: String(inputType)
132
132
  });
133
133
  }
134
- function initUIEvent(event, { view , detail }) {
134
+ function initUIEvent(event, { view, detail }) {
135
135
  assignProps(event, {
136
136
  view,
137
137
  detail: sanitizeNumber(detail !== null && detail !== void 0 ? detail : 0)
138
138
  });
139
139
  }
140
- function initUIEventModififiers(event, { altKey , ctrlKey , metaKey , shiftKey , modifierAltGraph , modifierCapsLock , modifierFn , modifierFnLock , modifierNumLock , modifierScrollLock , modifierSymbol , modifierSymbolLock }) {
140
+ function initUIEventModififiers(event, { altKey, ctrlKey, metaKey, shiftKey, modifierAltGraph, modifierCapsLock, modifierFn, modifierFnLock, modifierNumLock, modifierScrollLock, modifierSymbol, modifierSymbolLock }) {
141
141
  assignProps(event, {
142
142
  altKey: Boolean(altKey),
143
143
  ctrlKey: Boolean(ctrlKey),
@@ -161,7 +161,7 @@ function initUIEventModififiers(event, { altKey , ctrlKey , metaKey , shiftKey ,
161
161
  }
162
162
  });
163
163
  }
164
- function initKeyboardEvent(event, { key , code , location , repeat , isComposing , charCode }) {
164
+ function initKeyboardEvent(event, { key, code, location, repeat, isComposing, charCode }) {
165
165
  assignProps(event, {
166
166
  key: String(key),
167
167
  code: String(code),
@@ -171,7 +171,7 @@ function initKeyboardEvent(event, { key , code , location , repeat , isComposing
171
171
  charCode
172
172
  });
173
173
  }
174
- function initMouseEvent(event, { x , y , screenX , screenY , clientX =x , clientY =y , button , buttons , relatedTarget }) {
174
+ function initMouseEvent(event, { x, y, screenX, screenY, clientX = x, clientY = y, button, buttons, relatedTarget }) {
175
175
  assignProps(event, {
176
176
  screenX: sanitizeNumber(screenX),
177
177
  screenY: sanitizeNumber(screenY),
@@ -184,7 +184,7 @@ function initMouseEvent(event, { x , y , screenX , screenY , clientX =x , client
184
184
  relatedTarget
185
185
  });
186
186
  }
187
- function initPointerEvent(event, { pointerId , width , height , pressure , tangentialPressure , tiltX , tiltY , twist , pointerType , isPrimary }) {
187
+ function initPointerEvent(event, { pointerId, width, height, pressure, tangentialPressure, tiltX, tiltY, twist, pointerType, isPrimary }) {
188
188
  assignProps(event, {
189
189
  pointerId: sanitizeNumber(pointerId),
190
190
  width: sanitizeNumber(width),
@@ -24,9 +24,9 @@ function dispatchUIEvent(target, type, init, preventDefault = false) {
24
24
  return dispatchEvent.call(this, target, event, preventDefault);
25
25
  }
26
26
  function dispatchEvent(target, event, preventDefault = false) {
27
- var ref;
27
+ var _behavior_type;
28
28
  const type = event.type;
29
- const behaviorImplementation = preventDefault ? ()=>{} : (ref = registry.behavior[type]) === null || ref === void 0 ? void 0 : ref(event, target, this);
29
+ const behaviorImplementation = preventDefault ? ()=>{} : (_behavior_type = registry.behavior[type]) === null || _behavior_type === void 0 ? void 0 : _behavior_type.call(registry.behavior, event, target, this);
30
30
  if (behaviorImplementation) {
31
31
  event.preventDefault();
32
32
  let defaultPrevented = false;
@@ -2,10 +2,30 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var eventMap_js = require('@testing-library/dom/dist/event-map.js');
5
+ var named = require('@testing-library/dom/dist/event-map.js');
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);
6
26
 
7
27
  const eventMap = {
8
- ...eventMap_js.eventMap,
28
+ ...named__namespace.eventMap,
9
29
  click: {
10
30
  EventType: 'PointerEvent',
11
31
  defaultInit: {
@@ -26,10 +26,7 @@ var wrapEvent = require('./wrapEvent.js');
26
26
  } else if (target) {
27
27
  wrapEvent.wrapEvent(()=>target.focus());
28
28
  } else {
29
- wrapEvent.wrapEvent(()=>{
30
- var ref;
31
- return (ref = activeElement) === null || ref === void 0 ? void 0 : ref.blur();
32
- });
29
+ wrapEvent.wrapEvent(()=>activeElement === null || activeElement === void 0 ? void 0 : activeElement.blur());
33
30
  }
34
31
  updateSelectionOnFocus.updateSelectionOnFocus(target !== null && target !== void 0 ? target : element.ownerDocument.body);
35
32
  }
@@ -98,7 +98,7 @@ function editInputElement(instance, element, inputRange, data, inputType) {
98
98
  }
99
99
  }
100
100
  }
101
- const { newValue , newOffset , oldValue } = calculateNewValue(dataToInsert, element, inputRange, inputType);
101
+ const { newValue, newOffset, oldValue } = calculateNewValue(dataToInsert, element, inputRange, inputType);
102
102
  if (newValue === oldValue && newOffset === inputRange.startOffset && newOffset === inputRange.endOffset) {
103
103
  return;
104
104
  }
@@ -126,7 +126,7 @@ function editInputElement(instance, element, inputRange, data, inputType) {
126
126
  });
127
127
  }
128
128
  }
129
- function calculateNewValue(inputData, node, { startOffset , endOffset }, inputType) {
129
+ function calculateNewValue(inputData, node, { startOffset, endOffset }, inputType) {
130
130
  const value = UI.getUIValue(node);
131
131
  const prologEnd = Math.max(0, startOffset === endOffset && inputType === 'deleteContentBackward' ? startOffset - 1 : startOffset);
132
132
  const prolog = value.substring(0, prologEnd);
@@ -154,12 +154,12 @@ function commitInput(instance, element, newOffset, inputInit) {
154
154
  trackValue.commitValueAfterInput(element, newOffset);
155
155
  }
156
156
  function isValidNumberInput(value) {
157
- var ref, ref1;
157
+ var _value_match, _value_match1;
158
158
  // the browser allows some invalid input but not others
159
159
  // it allows up to two '-' at any place before any 'e' or one directly following 'e'
160
160
  // it allows one '.' at any place before e
161
161
  const valueParts = value.split('e', 2);
162
- 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]));
162
+ 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]));
163
163
  }
164
164
 
165
165
  exports.input = input;
@@ -11,9 +11,9 @@ var getTargetTypeAndSelection = require('./getTargetTypeAndSelection.js');
11
11
  if (typeAndSelection.type === 'input') {
12
12
  return typeAndSelection.selection;
13
13
  } else if (typeAndSelection.type === 'contenteditable') {
14
- var ref;
14
+ var _typeAndSelection_selection;
15
15
  // Multi-range on contenteditable edits the first selection instead of the last
16
- return (ref = typeAndSelection.selection) === null || ref === void 0 ? void 0 : ref.getRangeAt(0);
16
+ return (_typeAndSelection_selection = typeAndSelection.selection) === null || _typeAndSelection_selection === void 0 ? void 0 : _typeAndSelection_selection.getRangeAt(0);
17
17
  }
18
18
  }
19
19
 
@@ -15,8 +15,8 @@ var getTargetTypeAndSelection = require('./getTargetTypeAndSelection.js');
15
15
 
16
16
  /**
17
17
  * Extend/shrink the selection like with Shift+Arrows or Shift+Mouse
18
- */ function modifySelection({ focusNode , focusOffset }) {
19
- var ref, ref1;
18
+ */ function modifySelection({ focusNode, focusOffset }) {
19
+ var _focusNode_ownerDocument_getSelection, _focusNode_ownerDocument;
20
20
  const typeAndSelection = getTargetTypeAndSelection.getTargetTypeAndSelection(focusNode);
21
21
  if (typeAndSelection.type === 'input') {
22
22
  return UI.setUISelection(focusNode, {
@@ -24,7 +24,7 @@ var getTargetTypeAndSelection = require('./getTargetTypeAndSelection.js');
24
24
  focusOffset
25
25
  }, 'modify');
26
26
  }
27
- (ref1 = (ref = focusNode.ownerDocument) === null || ref === void 0 ? void 0 : ref.getSelection()) === null || ref1 === void 0 ? void 0 : ref1.extend(focusNode, focusOffset);
27
+ (_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);
28
28
  }
29
29
 
30
30
  exports.modifySelection = modifySelection;
@@ -13,7 +13,7 @@ require('../../utils/misc/level.js');
13
13
  require('../../options.js');
14
14
  var resolveCaretPosition = require('./resolveCaretPosition.js');
15
15
 
16
- function modifySelectionPerMouseMove(selectionRange, { document , target , node , offset }) {
16
+ function modifySelectionPerMouseMove(selectionRange, { document, target, node, offset }) {
17
17
  const selectionFocus = resolveCaretPosition.resolveCaretPosition({
18
18
  target,
19
19
  node,
@@ -26,12 +26,12 @@ var setSelection = require('./setSelection.js');
26
26
  focusOffset: selection.startOffset === selection.endOffset ? selection.focusOffset + direction : direction < 0 ? selection.startOffset : selection.endOffset
27
27
  });
28
28
  } else {
29
- const selection1 = node.ownerDocument.getSelection();
30
- if (!(selection1 === null || selection1 === void 0 ? void 0 : selection1.focusNode)) {
29
+ const selection = node.ownerDocument.getSelection();
30
+ if (!(selection === null || selection === void 0 ? void 0 : selection.focusNode)) {
31
31
  return;
32
32
  }
33
- if (selection1.isCollapsed) {
34
- const nextPosition = cursor.getNextCursorPosition(selection1.focusNode, selection1.focusOffset, direction);
33
+ if (selection.isCollapsed) {
34
+ const nextPosition = cursor.getNextCursorPosition(selection.focusNode, selection.focusOffset, direction);
35
35
  if (nextPosition) {
36
36
  setSelection.setSelection({
37
37
  focusNode: nextPosition.node,
@@ -39,7 +39,7 @@ var setSelection = require('./setSelection.js');
39
39
  });
40
40
  }
41
41
  } else {
42
- selection1[direction < 0 ? 'collapseToStart' : 'collapseToEnd']();
42
+ selection[direction < 0 ? 'collapseToStart' : 'collapseToEnd']();
43
43
  }
44
44
  }
45
45
  }
@@ -13,7 +13,7 @@ require('../../utils/keyDef/readNextDescriptor.js');
13
13
  require('../../utils/misc/level.js');
14
14
  require('../../options.js');
15
15
 
16
- function resolveCaretPosition({ target , node , offset }) {
16
+ function resolveCaretPosition({ target, node, offset }) {
17
17
  if (selection.hasOwnSelection(target)) {
18
18
  return {
19
19
  node: target,
@@ -25,8 +25,8 @@ var setSelection = require('./setSelection.js');
25
25
  focusOffset: UI.getUIValue(target).length
26
26
  });
27
27
  }
28
- var ref;
29
- const focusNode = (ref = isContentEditable.getContentEditable(target)) !== null && ref !== void 0 ? ref : target.ownerDocument.body;
28
+ var _getContentEditable;
29
+ const focusNode = (_getContentEditable = isContentEditable.getContentEditable(target)) !== null && _getContentEditable !== void 0 ? _getContentEditable : target.ownerDocument.body;
30
30
  setSelection.setSelection({
31
31
  focusNode,
32
32
  anchorOffset: 0,
@@ -37,8 +37,8 @@ function isAllSelected(target) {
37
37
  if (selection.hasOwnSelection(target)) {
38
38
  return UI.getUISelection(target).startOffset === 0 && UI.getUISelection(target).endOffset === UI.getUIValue(target).length;
39
39
  }
40
- var ref;
41
- const focusNode = (ref = isContentEditable.getContentEditable(target)) !== null && ref !== void 0 ? ref : target.ownerDocument.body;
40
+ var _getContentEditable;
41
+ const focusNode = (_getContentEditable = isContentEditable.getContentEditable(target)) !== null && _getContentEditable !== void 0 ? _getContentEditable : target.ownerDocument.body;
42
42
  const selection$1 = target.ownerDocument.getSelection();
43
43
  return (selection$1 === null || selection$1 === void 0 ? void 0 : selection$1.anchorNode) === focusNode && selection$1.focusNode === focusNode && selection$1.anchorOffset === 0 && selection$1.focusOffset === focusNode.childNodes.length;
44
44
  }