@wordpress/dom 3.38.0 → 3.40.0

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 (202) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +2 -2
  3. package/build/data-transfer.js +0 -2
  4. package/build/data-transfer.js.map +1 -1
  5. package/build/dom/caret-range-from-point.js +3 -5
  6. package/build/dom/caret-range-from-point.js.map +1 -1
  7. package/build/dom/clean-node-list.js +25 -42
  8. package/build/dom/clean-node-list.js.map +1 -1
  9. package/build/dom/compute-caret-rect.js +0 -6
  10. package/build/dom/compute-caret-rect.js.map +1 -1
  11. package/build/dom/document-has-selection.js +0 -5
  12. package/build/dom/document-has-selection.js.map +1 -1
  13. package/build/dom/document-has-text-selection.js +0 -2
  14. package/build/dom/document-has-text-selection.js.map +1 -1
  15. package/build/dom/document-has-uncollapsed-selection.js +0 -4
  16. package/build/dom/document-has-uncollapsed-selection.js.map +1 -1
  17. package/build/dom/get-computed-style.js +0 -3
  18. package/build/dom/get-computed-style.js.map +1 -1
  19. package/build/dom/get-offset-parent.js +8 -19
  20. package/build/dom/get-offset-parent.js.map +1 -1
  21. package/build/dom/get-range-height.js +0 -3
  22. package/build/dom/get-range-height.js.map +1 -1
  23. package/build/dom/get-rectangle-from-range.js +15 -22
  24. package/build/dom/get-rectangle-from-range.js.map +1 -1
  25. package/build/dom/get-scroll-container.js +3 -13
  26. package/build/dom/get-scroll-container.js.map +1 -1
  27. package/build/dom/hidden-caret-range-from-point.js +2 -6
  28. package/build/dom/hidden-caret-range-from-point.js.map +1 -1
  29. package/build/dom/index.js +0 -27
  30. package/build/dom/index.js.map +1 -1
  31. package/build/dom/input-field-has-uncollapsed-selection.js +8 -12
  32. package/build/dom/input-field-has-uncollapsed-selection.js.map +1 -1
  33. package/build/dom/insert-after.js +0 -2
  34. package/build/dom/insert-after.js.map +1 -1
  35. package/build/dom/is-edge.js +18 -40
  36. package/build/dom/is-edge.js.map +1 -1
  37. package/build/dom/is-element.js +0 -2
  38. package/build/dom/is-element.js.map +1 -1
  39. package/build/dom/is-empty.js +1 -7
  40. package/build/dom/is-empty.js.map +1 -1
  41. package/build/dom/is-entirely-selected.js +2 -18
  42. package/build/dom/is-entirely-selected.js.map +1 -1
  43. package/build/dom/is-form-element.js +0 -4
  44. package/build/dom/is-form-element.js.map +1 -1
  45. package/build/dom/is-horizontal-edge.js +2 -5
  46. package/build/dom/is-horizontal-edge.js.map +1 -1
  47. package/build/dom/is-html-input-element.js +0 -2
  48. package/build/dom/is-html-input-element.js.map +1 -1
  49. package/build/dom/is-input-or-text-area.js +0 -2
  50. package/build/dom/is-input-or-text-area.js.map +1 -1
  51. package/build/dom/is-number-input.js +0 -6
  52. package/build/dom/is-number-input.js.map +1 -1
  53. package/build/dom/is-rtl.js +0 -3
  54. package/build/dom/is-rtl.js.map +1 -1
  55. package/build/dom/is-selection-forward.js +6 -10
  56. package/build/dom/is-selection-forward.js.map +1 -1
  57. package/build/dom/is-text-field.js +1 -7
  58. package/build/dom/is-text-field.js.map +1 -1
  59. package/build/dom/is-vertical-edge.js +2 -5
  60. package/build/dom/is-vertical-edge.js.map +1 -1
  61. package/build/dom/place-caret-at-edge.js +8 -31
  62. package/build/dom/place-caret-at-edge.js.map +1 -1
  63. package/build/dom/place-caret-at-horizontal-edge.js +0 -3
  64. package/build/dom/place-caret-at-horizontal-edge.js.map +1 -1
  65. package/build/dom/place-caret-at-vertical-edge.js +0 -3
  66. package/build/dom/place-caret-at-vertical-edge.js.map +1 -1
  67. package/build/dom/remove-invalid-html.js +0 -3
  68. package/build/dom/remove-invalid-html.js.map +1 -1
  69. package/build/dom/remove.js +0 -2
  70. package/build/dom/remove.js.map +1 -1
  71. package/build/dom/replace-tag.js +0 -4
  72. package/build/dom/replace-tag.js.map +1 -1
  73. package/build/dom/replace.js +0 -5
  74. package/build/dom/replace.js.map +1 -1
  75. package/build/dom/safe-html.js +0 -8
  76. package/build/dom/safe-html.js.map +1 -1
  77. package/build/dom/scroll-if-no-range.js +31 -0
  78. package/build/dom/scroll-if-no-range.js.map +1 -0
  79. package/build/dom/strip-html.js +0 -3
  80. package/build/dom/strip-html.js.map +1 -1
  81. package/build/dom/unwrap.js +0 -4
  82. package/build/dom/unwrap.js.map +1 -1
  83. package/build/dom/wrap.js +0 -2
  84. package/build/dom/wrap.js.map +1 -1
  85. package/build/focusable.js +5 -18
  86. package/build/focusable.js.map +1 -1
  87. package/build/index.js +0 -11
  88. package/build/index.js.map +1 -1
  89. package/build/phrasing-content.js +13 -14
  90. package/build/phrasing-content.js.map +1 -1
  91. package/build/tabbable.js +21 -37
  92. package/build/tabbable.js.map +1 -1
  93. package/build/utils/assert-is-defined.js +0 -1
  94. package/build/utils/assert-is-defined.js.map +1 -1
  95. package/build-module/data-transfer.js +0 -1
  96. package/build-module/data-transfer.js.map +1 -1
  97. package/build-module/dom/caret-range-from-point.js +3 -4
  98. package/build-module/dom/caret-range-from-point.js.map +1 -1
  99. package/build-module/dom/clean-node-list.js +24 -35
  100. package/build-module/dom/clean-node-list.js.map +1 -1
  101. package/build-module/dom/compute-caret-rect.js +1 -3
  102. package/build-module/dom/compute-caret-rect.js.map +1 -1
  103. package/build-module/dom/document-has-selection.js +1 -1
  104. package/build-module/dom/document-has-selection.js.map +1 -1
  105. package/build-module/dom/document-has-text-selection.js +1 -1
  106. package/build-module/dom/document-has-text-selection.js.map +1 -1
  107. package/build-module/dom/document-has-uncollapsed-selection.js +1 -1
  108. package/build-module/dom/document-has-uncollapsed-selection.js.map +1 -1
  109. package/build-module/dom/get-computed-style.js +1 -2
  110. package/build-module/dom/get-computed-style.js.map +1 -1
  111. package/build-module/dom/get-offset-parent.js +9 -17
  112. package/build-module/dom/get-offset-parent.js.map +1 -1
  113. package/build-module/dom/get-range-height.js +0 -2
  114. package/build-module/dom/get-range-height.js.map +1 -1
  115. package/build-module/dom/get-rectangle-from-range.js +16 -21
  116. package/build-module/dom/get-rectangle-from-range.js.map +1 -1
  117. package/build-module/dom/get-scroll-container.js +4 -11
  118. package/build-module/dom/get-scroll-container.js.map +1 -1
  119. package/build-module/dom/hidden-caret-range-from-point.js +3 -3
  120. package/build-module/dom/hidden-caret-range-from-point.js.map +1 -1
  121. package/build-module/dom/index.js.map +1 -1
  122. package/build-module/dom/input-field-has-uncollapsed-selection.js +9 -9
  123. package/build-module/dom/input-field-has-uncollapsed-selection.js.map +1 -1
  124. package/build-module/dom/insert-after.js +1 -1
  125. package/build-module/dom/insert-after.js.map +1 -1
  126. package/build-module/dom/is-edge.js +19 -32
  127. package/build-module/dom/is-edge.js.map +1 -1
  128. package/build-module/dom/is-element.js +0 -1
  129. package/build-module/dom/is-element.js.map +1 -1
  130. package/build-module/dom/is-empty.js +1 -6
  131. package/build-module/dom/is-empty.js.map +1 -1
  132. package/build-module/dom/is-entirely-selected.js +3 -14
  133. package/build-module/dom/is-entirely-selected.js.map +1 -1
  134. package/build-module/dom/is-form-element.js +1 -2
  135. package/build-module/dom/is-form-element.js.map +1 -1
  136. package/build-module/dom/is-horizontal-edge.js +3 -3
  137. package/build-module/dom/is-horizontal-edge.js.map +1 -1
  138. package/build-module/dom/is-html-input-element.js +0 -1
  139. package/build-module/dom/is-html-input-element.js.map +1 -1
  140. package/build-module/dom/is-input-or-text-area.js +0 -1
  141. package/build-module/dom/is-input-or-text-area.js.map +1 -1
  142. package/build-module/dom/is-number-input.js +2 -4
  143. package/build-module/dom/is-number-input.js.map +1 -1
  144. package/build-module/dom/is-rtl.js +1 -1
  145. package/build-module/dom/is-rtl.js.map +1 -1
  146. package/build-module/dom/is-selection-forward.js +7 -9
  147. package/build-module/dom/is-selection-forward.js.map +1 -1
  148. package/build-module/dom/is-text-field.js +2 -5
  149. package/build-module/dom/is-text-field.js.map +1 -1
  150. package/build-module/dom/is-vertical-edge.js +3 -3
  151. package/build-module/dom/is-vertical-edge.js.map +1 -1
  152. package/build-module/dom/place-caret-at-edge.js +9 -26
  153. package/build-module/dom/place-caret-at-edge.js.map +1 -1
  154. package/build-module/dom/place-caret-at-horizontal-edge.js +1 -1
  155. package/build-module/dom/place-caret-at-horizontal-edge.js.map +1 -1
  156. package/build-module/dom/place-caret-at-vertical-edge.js +1 -1
  157. package/build-module/dom/place-caret-at-vertical-edge.js.map +1 -1
  158. package/build-module/dom/remove-invalid-html.js +1 -1
  159. package/build-module/dom/remove-invalid-html.js.map +1 -1
  160. package/build-module/dom/remove.js +1 -1
  161. package/build-module/dom/remove.js.map +1 -1
  162. package/build-module/dom/replace-tag.js +1 -3
  163. package/build-module/dom/replace-tag.js.map +1 -1
  164. package/build-module/dom/replace.js +1 -1
  165. package/build-module/dom/replace.js.map +1 -1
  166. package/build-module/dom/safe-html.js +1 -6
  167. package/build-module/dom/safe-html.js.map +1 -1
  168. package/build-module/dom/scroll-if-no-range.js +25 -0
  169. package/build-module/dom/scroll-if-no-range.js.map +1 -0
  170. package/build-module/dom/strip-html.js +1 -1
  171. package/build-module/dom/strip-html.js.map +1 -1
  172. package/build-module/dom/unwrap.js +1 -3
  173. package/build-module/dom/unwrap.js.map +1 -1
  174. package/build-module/dom/wrap.js +1 -1
  175. package/build-module/dom/wrap.js.map +1 -1
  176. package/build-module/focusable.js +5 -17
  177. package/build-module/focusable.js.map +1 -1
  178. package/build-module/index.js +1 -1
  179. package/build-module/index.js.map +1 -1
  180. package/build-module/phrasing-content.js +13 -11
  181. package/build-module/phrasing-content.js.map +1 -1
  182. package/build-module/tabbable.js +22 -33
  183. package/build-module/tabbable.js.map +1 -1
  184. package/build-module/utils/assert-is-defined.js.map +1 -1
  185. package/build-types/dom/is-edge.d.ts +4 -4
  186. package/build-types/dom/is-edge.d.ts.map +1 -1
  187. package/build-types/dom/is-horizontal-edge.d.ts +3 -3
  188. package/build-types/dom/is-horizontal-edge.d.ts.map +1 -1
  189. package/build-types/dom/is-vertical-edge.d.ts +3 -3
  190. package/build-types/dom/is-vertical-edge.d.ts.map +1 -1
  191. package/build-types/dom/place-caret-at-edge.d.ts.map +1 -1
  192. package/build-types/dom/scroll-if-no-range.d.ts +12 -0
  193. package/build-types/dom/scroll-if-no-range.d.ts.map +1 -0
  194. package/build-types/index.d.ts +2 -2
  195. package/build-types/index.d.ts.map +1 -1
  196. package/package.json +3 -3
  197. package/src/dom/is-edge.js +6 -8
  198. package/src/dom/is-horizontal-edge.js +2 -2
  199. package/src/dom/is-vertical-edge.js +2 -2
  200. package/src/dom/place-caret-at-edge.js +5 -19
  201. package/src/dom/scroll-if-no-range.js +34 -0
  202. package/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-element.js"],"names":["isElement","node","nodeType","ELEMENT_NODE"],"mappings":";;;;;;;AAAA;;AACA;AACA;AACA;AACA;AACe,SAASA,SAAT,CAAoBC,IAApB,EAA2B;AACzC;AACA,SAAO,CAAC,CAAEA,IAAH,IAAWA,IAAI,CAACC,QAAL,KAAkBD,IAAI,CAACE,YAAzC;AACA","sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Node | null | undefined} node\n * @return {node is Element} True if node is an Element node\n */\nexport default function isElement( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn !! node && node.nodeType === node.ELEMENT_NODE;\n}\n"]}
1
+ {"version":3,"names":["isElement","node","nodeType","ELEMENT_NODE"],"sources":["@wordpress/dom/src/dom/is-element.js"],"sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Node | null | undefined} node\n * @return {node is Element} True if node is an Element node\n */\nexport default function isElement( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn !! node && node.nodeType === node.ELEMENT_NODE;\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACe,SAASA,SAASA,CAAEC,IAAI,EAAG;EACzC;EACA,OAAO,CAAC,CAAEA,IAAI,IAAIA,IAAI,CAACC,QAAQ,KAAKD,IAAI,CAACE,YAAY;AACtD"}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = isEmpty;
7
-
8
7
  /**
9
8
  * Recursively checks if an element is empty. An element is not empty if it
10
9
  * contains text or contains elements with attributes such as images.
@@ -19,19 +18,14 @@ function isEmpty(element) {
19
18
  // We cannot use \s since it includes special spaces which we want
20
19
  // to preserve.
21
20
  return /^[ \f\n\r\t\v\u00a0]*$/.test(element.nodeValue || '');
22
-
23
21
  case element.ELEMENT_NODE:
24
22
  if (element.hasAttributes()) {
25
23
  return false;
26
24
  } else if (!element.hasChildNodes()) {
27
25
  return true;
28
26
  }
29
-
30
- return (
31
- /** @type {Element[]} */
32
- Array.from(element.childNodes).every(isEmpty)
27
+ return (/** @type {Element[]} */Array.from(element.childNodes).every(isEmpty)
33
28
  );
34
-
35
29
  default:
36
30
  return true;
37
31
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-empty.js"],"names":["isEmpty","element","nodeType","TEXT_NODE","test","nodeValue","ELEMENT_NODE","hasAttributes","hasChildNodes","Array","from","childNodes","every"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,OAAT,CAAkBC,OAAlB,EAA4B;AAC1C,UAASA,OAAO,CAACC,QAAjB;AACC,SAAKD,OAAO,CAACE,SAAb;AACC;AACA;AACA,aAAO,yBAAyBC,IAAzB,CAA+BH,OAAO,CAACI,SAAR,IAAqB,EAApD,CAAP;;AACD,SAAKJ,OAAO,CAACK,YAAb;AACC,UAAKL,OAAO,CAACM,aAAR,EAAL,EAA+B;AAC9B,eAAO,KAAP;AACA,OAFD,MAEO,IAAK,CAAEN,OAAO,CAACO,aAAR,EAAP,EAAiC;AACvC,eAAO,IAAP;AACA;;AAED;AAAO;AACNC,QAAAA,KAAK,CAACC,IAAN,CAAYT,OAAO,CAACU,UAApB,CAD+B,CAE9BC,KAF8B,CAEvBZ,OAFuB;AAAhC;;AAGD;AACC,aAAO,IAAP;AAhBF;AAkBA","sourcesContent":["/**\n * Recursively checks if an element is empty. An element is not empty if it\n * contains text or contains elements with attributes such as images.\n *\n * @param {Element} element The element to check.\n *\n * @return {boolean} Whether or not the element is empty.\n */\nexport default function isEmpty( element ) {\n\tswitch ( element.nodeType ) {\n\t\tcase element.TEXT_NODE:\n\t\t\t// We cannot use \\s since it includes special spaces which we want\n\t\t\t// to preserve.\n\t\t\treturn /^[ \\f\\n\\r\\t\\v\\u00a0]*$/.test( element.nodeValue || '' );\n\t\tcase element.ELEMENT_NODE:\n\t\t\tif ( element.hasAttributes() ) {\n\t\t\t\treturn false;\n\t\t\t} else if ( ! element.hasChildNodes() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn /** @type {Element[]} */ (\n\t\t\t\tArray.from( element.childNodes )\n\t\t\t).every( isEmpty );\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n"]}
1
+ {"version":3,"names":["isEmpty","element","nodeType","TEXT_NODE","test","nodeValue","ELEMENT_NODE","hasAttributes","hasChildNodes","Array","from","childNodes","every"],"sources":["@wordpress/dom/src/dom/is-empty.js"],"sourcesContent":["/**\n * Recursively checks if an element is empty. An element is not empty if it\n * contains text or contains elements with attributes such as images.\n *\n * @param {Element} element The element to check.\n *\n * @return {boolean} Whether or not the element is empty.\n */\nexport default function isEmpty( element ) {\n\tswitch ( element.nodeType ) {\n\t\tcase element.TEXT_NODE:\n\t\t\t// We cannot use \\s since it includes special spaces which we want\n\t\t\t// to preserve.\n\t\t\treturn /^[ \\f\\n\\r\\t\\v\\u00a0]*$/.test( element.nodeValue || '' );\n\t\tcase element.ELEMENT_NODE:\n\t\t\tif ( element.hasAttributes() ) {\n\t\t\t\treturn false;\n\t\t\t} else if ( ! element.hasChildNodes() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn /** @type {Element[]} */ (\n\t\t\t\tArray.from( element.childNodes )\n\t\t\t).every( isEmpty );\n\t\tdefault:\n\t\t\treturn true;\n\t}\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,OAAOA,CAAEC,OAAO,EAAG;EAC1C,QAASA,OAAO,CAACC,QAAQ;IACxB,KAAKD,OAAO,CAACE,SAAS;MACrB;MACA;MACA,OAAO,wBAAwB,CAACC,IAAI,CAAEH,OAAO,CAACI,SAAS,IAAI,EAAG,CAAC;IAChE,KAAKJ,OAAO,CAACK,YAAY;MACxB,IAAKL,OAAO,CAACM,aAAa,CAAC,CAAC,EAAG;QAC9B,OAAO,KAAK;MACb,CAAC,MAAM,IAAK,CAAEN,OAAO,CAACO,aAAa,CAAC,CAAC,EAAG;QACvC,OAAO,IAAI;MACZ;MAEA,OAAO,yBACNC,KAAK,CAACC,IAAI,CAAET,OAAO,CAACU,UAAW,CAAC,CAC/BC,KAAK,CAAEZ,OAAQ;MAAC;IACnB;MACC,OAAO,IAAI;EACb;AACD"}
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = isEntirelySelected;
9
-
10
8
  var _assertIsDefined = require("../utils/assert-is-defined");
11
-
12
9
  var _isInputOrTextArea = _interopRequireDefault(require("./is-input-or-text-area"));
13
-
14
10
  /**
15
11
  * Internal dependencies
16
12
  */
@@ -27,11 +23,9 @@ function isEntirelySelected(element) {
27
23
  if ((0, _isInputOrTextArea.default)(element)) {
28
24
  return element.selectionStart === 0 && element.value.length === element.selectionEnd;
29
25
  }
30
-
31
26
  if (!element.isContentEditable) {
32
27
  return true;
33
28
  }
34
-
35
29
  const {
36
30
  ownerDocument
37
31
  } = element;
@@ -42,29 +36,24 @@ function isEntirelySelected(element) {
42
36
  const selection = defaultView.getSelection();
43
37
  (0, _assertIsDefined.assertIsDefined)(selection, 'selection');
44
38
  const range = selection.rangeCount ? selection.getRangeAt(0) : null;
45
-
46
39
  if (!range) {
47
40
  return true;
48
41
  }
49
-
50
42
  const {
51
43
  startContainer,
52
44
  endContainer,
53
45
  startOffset,
54
46
  endOffset
55
47
  } = range;
56
-
57
48
  if (startContainer === element && endContainer === element && startOffset === 0 && endOffset === element.childNodes.length) {
58
49
  return true;
59
50
  }
60
-
61
51
  const lastChild = element.lastChild;
62
52
  (0, _assertIsDefined.assertIsDefined)(lastChild, 'lastChild');
63
- const endContainerContentLength = endContainer.nodeType === endContainer.TEXT_NODE ?
64
- /** @type {Text} */
65
- endContainer.data.length : endContainer.childNodes.length;
53
+ const endContainerContentLength = endContainer.nodeType === endContainer.TEXT_NODE ? /** @type {Text} */endContainer.data.length : endContainer.childNodes.length;
66
54
  return isDeepChild(startContainer, element, 'firstChild') && isDeepChild(endContainer, element, 'lastChild') && startOffset === 0 && endOffset === endContainerContentLength;
67
55
  }
56
+
68
57
  /**
69
58
  * Check whether the contents of the element have been entirely selected.
70
59
  * Returns true if there is no possibility of selection.
@@ -75,20 +64,15 @@ function isEntirelySelected(element) {
75
64
  *
76
65
  * @return {boolean} True if query is a deep first/last child of container, false otherwise.
77
66
  */
78
-
79
-
80
67
  function isDeepChild(query, container, propName) {
81
68
  /** @type {HTMLElement | ChildNode | null} */
82
69
  let candidate = container;
83
-
84
70
  do {
85
71
  if (query === candidate) {
86
72
  return true;
87
73
  }
88
-
89
74
  candidate = candidate[propName];
90
75
  } while (candidate);
91
-
92
76
  return false;
93
77
  }
94
78
  //# sourceMappingURL=is-entirely-selected.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-entirely-selected.js"],"names":["isEntirelySelected","element","selectionStart","value","length","selectionEnd","isContentEditable","ownerDocument","defaultView","selection","getSelection","range","rangeCount","getRangeAt","startContainer","endContainer","startOffset","endOffset","childNodes","lastChild","endContainerContentLength","nodeType","TEXT_NODE","data","isDeepChild","query","container","propName","candidate"],"mappings":";;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAT,CAA6BC,OAA7B,EAAuC;AACrD,MAAK,gCAAmBA,OAAnB,CAAL,EAAoC;AACnC,WACCA,OAAO,CAACC,cAAR,KAA2B,CAA3B,IACAD,OAAO,CAACE,KAAR,CAAcC,MAAd,KAAyBH,OAAO,CAACI,YAFlC;AAIA;;AAED,MAAK,CAAEJ,OAAO,CAACK,iBAAf,EAAmC;AAClC,WAAO,IAAP;AACA;;AAED,QAAM;AAAEC,IAAAA;AAAF,MAAoBN,OAA1B;AACA,QAAM;AAAEO,IAAAA;AAAF,MAAkBD,aAAxB;AACA,wCAAiBC,WAAjB,EAA8B,aAA9B;AACA,QAAMC,SAAS,GAAGD,WAAW,CAACE,YAAZ,EAAlB;AACA,wCAAiBD,SAAjB,EAA4B,WAA5B;AACA,QAAME,KAAK,GAAGF,SAAS,CAACG,UAAV,GAAuBH,SAAS,CAACI,UAAV,CAAsB,CAAtB,CAAvB,GAAmD,IAAjE;;AAEA,MAAK,CAAEF,KAAP,EAAe;AACd,WAAO,IAAP;AACA;;AAED,QAAM;AAAEG,IAAAA,cAAF;AAAkBC,IAAAA,YAAlB;AAAgCC,IAAAA,WAAhC;AAA6CC,IAAAA;AAA7C,MAA2DN,KAAjE;;AAEA,MACCG,cAAc,KAAKb,OAAnB,IACAc,YAAY,KAAKd,OADjB,IAEAe,WAAW,KAAK,CAFhB,IAGAC,SAAS,KAAKhB,OAAO,CAACiB,UAAR,CAAmBd,MAJlC,EAKE;AACD,WAAO,IAAP;AACA;;AAED,QAAMe,SAAS,GAAGlB,OAAO,CAACkB,SAA1B;AACA,wCAAiBA,SAAjB,EAA4B,WAA5B;AACA,QAAMC,yBAAyB,GAC9BL,YAAY,CAACM,QAAb,KAA0BN,YAAY,CAACO,SAAvC;AACG;AAAsBP,EAAAA,YAAF,CAAiBQ,IAAjB,CAAsBnB,MAD7C,GAEGW,YAAY,CAACG,UAAb,CAAwBd,MAH5B;AAKA,SACCoB,WAAW,CAAEV,cAAF,EAAkBb,OAAlB,EAA2B,YAA3B,CAAX,IACAuB,WAAW,CAAET,YAAF,EAAgBd,OAAhB,EAAyB,WAAzB,CADX,IAEAe,WAAW,KAAK,CAFhB,IAGAC,SAAS,KAAKG,yBAJf;AAMA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASI,WAAT,CAAsBC,KAAtB,EAA6BC,SAA7B,EAAwCC,QAAxC,EAAmD;AAClD;AACA,MAAIC,SAAS,GAAGF,SAAhB;;AACA,KAAG;AACF,QAAKD,KAAK,KAAKG,SAAf,EAA2B;AAC1B,aAAO,IAAP;AACA;;AACDA,IAAAA,SAAS,GAAGA,SAAS,CAAED,QAAF,CAArB;AACA,GALD,QAKUC,SALV;;AAMA,SAAO,KAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { assertIsDefined } from '../utils/assert-is-defined';\nimport isInputOrTextArea from './is-input-or-text-area';\n\n/**\n * Check whether the contents of the element have been entirely selected.\n * Returns true if there is no possibility of selection.\n *\n * @param {HTMLElement} element The element to check.\n *\n * @return {boolean} True if entirely selected, false if not.\n */\nexport default function isEntirelySelected( element ) {\n\tif ( isInputOrTextArea( element ) ) {\n\t\treturn (\n\t\t\telement.selectionStart === 0 &&\n\t\t\telement.value.length === element.selectionEnd\n\t\t);\n\t}\n\n\tif ( ! element.isContentEditable ) {\n\t\treturn true;\n\t}\n\n\tconst { ownerDocument } = element;\n\tconst { defaultView } = ownerDocument;\n\tassertIsDefined( defaultView, 'defaultView' );\n\tconst selection = defaultView.getSelection();\n\tassertIsDefined( selection, 'selection' );\n\tconst range = selection.rangeCount ? selection.getRangeAt( 0 ) : null;\n\n\tif ( ! range ) {\n\t\treturn true;\n\t}\n\n\tconst { startContainer, endContainer, startOffset, endOffset } = range;\n\n\tif (\n\t\tstartContainer === element &&\n\t\tendContainer === element &&\n\t\tstartOffset === 0 &&\n\t\tendOffset === element.childNodes.length\n\t) {\n\t\treturn true;\n\t}\n\n\tconst lastChild = element.lastChild;\n\tassertIsDefined( lastChild, 'lastChild' );\n\tconst endContainerContentLength =\n\t\tendContainer.nodeType === endContainer.TEXT_NODE\n\t\t\t? /** @type {Text} */ ( endContainer ).data.length\n\t\t\t: endContainer.childNodes.length;\n\n\treturn (\n\t\tisDeepChild( startContainer, element, 'firstChild' ) &&\n\t\tisDeepChild( endContainer, element, 'lastChild' ) &&\n\t\tstartOffset === 0 &&\n\t\tendOffset === endContainerContentLength\n\t);\n}\n\n/**\n * Check whether the contents of the element have been entirely selected.\n * Returns true if there is no possibility of selection.\n *\n * @param {HTMLElement|Node} query The element to check.\n * @param {HTMLElement} container The container that we suspect \"query\" may be a first or last child of.\n * @param {\"firstChild\"|\"lastChild\"} propName \"firstChild\" or \"lastChild\"\n *\n * @return {boolean} True if query is a deep first/last child of container, false otherwise.\n */\nfunction isDeepChild( query, container, propName ) {\n\t/** @type {HTMLElement | ChildNode | null} */\n\tlet candidate = container;\n\tdo {\n\t\tif ( query === candidate ) {\n\t\t\treturn true;\n\t\t}\n\t\tcandidate = candidate[ propName ];\n\t} while ( candidate );\n\treturn false;\n}\n"]}
1
+ {"version":3,"names":["_assertIsDefined","require","_isInputOrTextArea","_interopRequireDefault","isEntirelySelected","element","isInputOrTextArea","selectionStart","value","length","selectionEnd","isContentEditable","ownerDocument","defaultView","assertIsDefined","selection","getSelection","range","rangeCount","getRangeAt","startContainer","endContainer","startOffset","endOffset","childNodes","lastChild","endContainerContentLength","nodeType","TEXT_NODE","data","isDeepChild","query","container","propName","candidate"],"sources":["@wordpress/dom/src/dom/is-entirely-selected.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { assertIsDefined } from '../utils/assert-is-defined';\nimport isInputOrTextArea from './is-input-or-text-area';\n\n/**\n * Check whether the contents of the element have been entirely selected.\n * Returns true if there is no possibility of selection.\n *\n * @param {HTMLElement} element The element to check.\n *\n * @return {boolean} True if entirely selected, false if not.\n */\nexport default function isEntirelySelected( element ) {\n\tif ( isInputOrTextArea( element ) ) {\n\t\treturn (\n\t\t\telement.selectionStart === 0 &&\n\t\t\telement.value.length === element.selectionEnd\n\t\t);\n\t}\n\n\tif ( ! element.isContentEditable ) {\n\t\treturn true;\n\t}\n\n\tconst { ownerDocument } = element;\n\tconst { defaultView } = ownerDocument;\n\tassertIsDefined( defaultView, 'defaultView' );\n\tconst selection = defaultView.getSelection();\n\tassertIsDefined( selection, 'selection' );\n\tconst range = selection.rangeCount ? selection.getRangeAt( 0 ) : null;\n\n\tif ( ! range ) {\n\t\treturn true;\n\t}\n\n\tconst { startContainer, endContainer, startOffset, endOffset } = range;\n\n\tif (\n\t\tstartContainer === element &&\n\t\tendContainer === element &&\n\t\tstartOffset === 0 &&\n\t\tendOffset === element.childNodes.length\n\t) {\n\t\treturn true;\n\t}\n\n\tconst lastChild = element.lastChild;\n\tassertIsDefined( lastChild, 'lastChild' );\n\tconst endContainerContentLength =\n\t\tendContainer.nodeType === endContainer.TEXT_NODE\n\t\t\t? /** @type {Text} */ ( endContainer ).data.length\n\t\t\t: endContainer.childNodes.length;\n\n\treturn (\n\t\tisDeepChild( startContainer, element, 'firstChild' ) &&\n\t\tisDeepChild( endContainer, element, 'lastChild' ) &&\n\t\tstartOffset === 0 &&\n\t\tendOffset === endContainerContentLength\n\t);\n}\n\n/**\n * Check whether the contents of the element have been entirely selected.\n * Returns true if there is no possibility of selection.\n *\n * @param {HTMLElement|Node} query The element to check.\n * @param {HTMLElement} container The container that we suspect \"query\" may be a first or last child of.\n * @param {\"firstChild\"|\"lastChild\"} propName \"firstChild\" or \"lastChild\"\n *\n * @return {boolean} True if query is a deep first/last child of container, false otherwise.\n */\nfunction isDeepChild( query, container, propName ) {\n\t/** @type {HTMLElement | ChildNode | null} */\n\tlet candidate = container;\n\tdo {\n\t\tif ( query === candidate ) {\n\t\t\treturn true;\n\t\t}\n\t\tcandidate = candidate[ propName ];\n\t} while ( candidate );\n\treturn false;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAC,sBAAA,CAAAF,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASG,kBAAkBA,CAAEC,OAAO,EAAG;EACrD,IAAK,IAAAC,0BAAiB,EAAED,OAAQ,CAAC,EAAG;IACnC,OACCA,OAAO,CAACE,cAAc,KAAK,CAAC,IAC5BF,OAAO,CAACG,KAAK,CAACC,MAAM,KAAKJ,OAAO,CAACK,YAAY;EAE/C;EAEA,IAAK,CAAEL,OAAO,CAACM,iBAAiB,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,MAAM;IAAEC;EAAc,CAAC,GAAGP,OAAO;EACjC,MAAM;IAAEQ;EAAY,CAAC,GAAGD,aAAa;EACrC,IAAAE,gCAAe,EAAED,WAAW,EAAE,aAAc,CAAC;EAC7C,MAAME,SAAS,GAAGF,WAAW,CAACG,YAAY,CAAC,CAAC;EAC5C,IAAAF,gCAAe,EAAEC,SAAS,EAAE,WAAY,CAAC;EACzC,MAAME,KAAK,GAAGF,SAAS,CAACG,UAAU,GAAGH,SAAS,CAACI,UAAU,CAAE,CAAE,CAAC,GAAG,IAAI;EAErE,IAAK,CAAEF,KAAK,EAAG;IACd,OAAO,IAAI;EACZ;EAEA,MAAM;IAAEG,cAAc;IAAEC,YAAY;IAAEC,WAAW;IAAEC;EAAU,CAAC,GAAGN,KAAK;EAEtE,IACCG,cAAc,KAAKf,OAAO,IAC1BgB,YAAY,KAAKhB,OAAO,IACxBiB,WAAW,KAAK,CAAC,IACjBC,SAAS,KAAKlB,OAAO,CAACmB,UAAU,CAACf,MAAM,EACtC;IACD,OAAO,IAAI;EACZ;EAEA,MAAMgB,SAAS,GAAGpB,OAAO,CAACoB,SAAS;EACnC,IAAAX,gCAAe,EAAEW,SAAS,EAAE,WAAY,CAAC;EACzC,MAAMC,yBAAyB,GAC9BL,YAAY,CAACM,QAAQ,KAAKN,YAAY,CAACO,SAAS,GAC7C,mBAAsBP,YAAY,CAAGQ,IAAI,CAACpB,MAAM,GAChDY,YAAY,CAACG,UAAU,CAACf,MAAM;EAElC,OACCqB,WAAW,CAAEV,cAAc,EAAEf,OAAO,EAAE,YAAa,CAAC,IACpDyB,WAAW,CAAET,YAAY,EAAEhB,OAAO,EAAE,WAAY,CAAC,IACjDiB,WAAW,KAAK,CAAC,IACjBC,SAAS,KAAKG,yBAAyB;AAEzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASI,WAAWA,CAAEC,KAAK,EAAEC,SAAS,EAAEC,QAAQ,EAAG;EAClD;EACA,IAAIC,SAAS,GAAGF,SAAS;EACzB,GAAG;IACF,IAAKD,KAAK,KAAKG,SAAS,EAAG;MAC1B,OAAO,IAAI;IACZ;IACAA,SAAS,GAAGA,SAAS,CAAED,QAAQ,CAAE;EAClC,CAAC,QAASC,SAAS;EACnB,OAAO,KAAK;AACb"}
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = isFormElement;
9
-
10
8
  var _isInputOrTextArea = _interopRequireDefault(require("./is-input-or-text-area"));
11
-
12
9
  /**
13
10
  * Internal dependencies
14
11
  */
@@ -25,7 +22,6 @@ function isFormElement(element) {
25
22
  if (!element) {
26
23
  return false;
27
24
  }
28
-
29
25
  const {
30
26
  tagName
31
27
  } = element;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-form-element.js"],"names":["isFormElement","element","tagName","checkForInputTextarea"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAT,CAAwBC,OAAxB,EAAkC;AAChD,MAAK,CAAEA,OAAP,EAAiB;AAChB,WAAO,KAAP;AACA;;AAED,QAAM;AAAEC,IAAAA;AAAF,MAAcD,OAApB;AACA,QAAME,qBAAqB,GAAG,gCAAmBF,OAAnB,CAA9B;AACA,SACCE,qBAAqB,IAAID,OAAO,KAAK,QAArC,IAAiDA,OAAO,KAAK,QAD9D;AAGA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isInputOrTextArea from './is-input-or-text-area';\n\n/**\n *\n * Detects if element is a form element.\n *\n * @param {Element} element The element to check.\n *\n * @return {boolean} True if form element and false otherwise.\n */\nexport default function isFormElement( element ) {\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tconst { tagName } = element;\n\tconst checkForInputTextarea = isInputOrTextArea( element );\n\treturn (\n\t\tcheckForInputTextarea || tagName === 'BUTTON' || tagName === 'SELECT'\n\t);\n}\n"]}
1
+ {"version":3,"names":["_isInputOrTextArea","_interopRequireDefault","require","isFormElement","element","tagName","checkForInputTextarea","isInputOrTextArea"],"sources":["@wordpress/dom/src/dom/is-form-element.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport isInputOrTextArea from './is-input-or-text-area';\n\n/**\n *\n * Detects if element is a form element.\n *\n * @param {Element} element The element to check.\n *\n * @return {boolean} True if form element and false otherwise.\n */\nexport default function isFormElement( element ) {\n\tif ( ! element ) {\n\t\treturn false;\n\t}\n\n\tconst { tagName } = element;\n\tconst checkForInputTextarea = isInputOrTextArea( element );\n\treturn (\n\t\tcheckForInputTextarea || tagName === 'BUTTON' || tagName === 'SELECT'\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,kBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,aAAaA,CAAEC,OAAO,EAAG;EAChD,IAAK,CAAEA,OAAO,EAAG;IAChB,OAAO,KAAK;EACb;EAEA,MAAM;IAAEC;EAAQ,CAAC,GAAGD,OAAO;EAC3B,MAAME,qBAAqB,GAAG,IAAAC,0BAAiB,EAAEH,OAAQ,CAAC;EAC1D,OACCE,qBAAqB,IAAID,OAAO,KAAK,QAAQ,IAAIA,OAAO,KAAK,QAAQ;AAEvE"}
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = isHorizontalEdge;
9
-
10
8
  var _isEdge = _interopRequireDefault(require("./is-edge"));
11
-
12
9
  /**
13
10
  * Internal dependencies
14
11
  */
@@ -16,8 +13,8 @@ var _isEdge = _interopRequireDefault(require("./is-edge"));
16
13
  /**
17
14
  * Check whether the selection is horizontally at the edge of the container.
18
15
  *
19
- * @param {Element} container Focusable element.
20
- * @param {boolean} isReverse Set to true to check left, false for right.
16
+ * @param {HTMLElement} container Focusable element.
17
+ * @param {boolean} isReverse Set to true to check left, false for right.
21
18
  *
22
19
  * @return {boolean} True if at the horizontal edge, false if not.
23
20
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-horizontal-edge.js"],"names":["isHorizontalEdge","container","isReverse"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,gBAAT,CAA2BC,SAA3B,EAAsCC,SAAtC,EAAkD;AAChE,SAAO,qBAAQD,SAAR,EAAmBC,SAAnB,CAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isEdge from './is-edge';\n\n/**\n * Check whether the selection is horizontally at the edge of the container.\n *\n * @param {Element} container Focusable element.\n * @param {boolean} isReverse Set to true to check left, false for right.\n *\n * @return {boolean} True if at the horizontal edge, false if not.\n */\nexport default function isHorizontalEdge( container, isReverse ) {\n\treturn isEdge( container, isReverse );\n}\n"]}
1
+ {"version":3,"names":["_isEdge","_interopRequireDefault","require","isHorizontalEdge","container","isReverse","isEdge"],"sources":["@wordpress/dom/src/dom/is-horizontal-edge.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport isEdge from './is-edge';\n\n/**\n * Check whether the selection is horizontally at the edge of the container.\n *\n * @param {HTMLElement} container Focusable element.\n * @param {boolean} isReverse Set to true to check left, false for right.\n *\n * @return {boolean} True if at the horizontal edge, false if not.\n */\nexport default function isHorizontalEdge( container, isReverse ) {\n\treturn isEdge( container, isReverse );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,gBAAgBA,CAAEC,SAAS,EAAEC,SAAS,EAAG;EAChE,OAAO,IAAAC,eAAM,EAAEF,SAAS,EAAEC,SAAU,CAAC;AACtC"}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = isHTMLInputElement;
7
-
8
7
  /* eslint-disable jsdoc/valid-types */
9
-
10
8
  /**
11
9
  * @param {Node} node
12
10
  * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-html-input-element.js"],"names":["isHTMLInputElement","node","nodeName"],"mappings":";;;;;;;AAAA;;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAT,CAA6BC,IAA7B,EAAoC;AAClD;AACA,SAAOA,IAAI,EAAEC,QAAN,KAAmB,OAA1B;AACA","sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Node} node\n * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.\n */\nexport default function isHTMLInputElement( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn node?.nodeName === 'INPUT';\n}\n"]}
1
+ {"version":3,"names":["isHTMLInputElement","node","nodeName"],"sources":["@wordpress/dom/src/dom/is-html-input-element.js"],"sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Node} node\n * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.\n */\nexport default function isHTMLInputElement( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn node?.nodeName === 'INPUT';\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAkBA,CAAEC,IAAI,EAAG;EAClD;EACA,OAAOA,IAAI,EAAEC,QAAQ,KAAK,OAAO;AAClC"}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = isInputOrTextArea;
7
-
8
7
  /* eslint-disable jsdoc/valid-types */
9
-
10
8
  /**
11
9
  * @param {Element} element
12
10
  * @return {element is HTMLInputElement | HTMLTextAreaElement} Whether the element is an input or textarea
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-input-or-text-area.js"],"names":["isInputOrTextArea","element","tagName"],"mappings":";;;;;;;AAAA;;AACA;AACA;AACA;AACA;AACe,SAASA,iBAAT,CAA4BC,OAA5B,EAAsC;AACpD;AACA,SAAOA,OAAO,CAACC,OAAR,KAAoB,OAApB,IAA+BD,OAAO,CAACC,OAAR,KAAoB,UAA1D;AACA","sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Element} element\n * @return {element is HTMLInputElement | HTMLTextAreaElement} Whether the element is an input or textarea\n */\nexport default function isInputOrTextArea( element ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn element.tagName === 'INPUT' || element.tagName === 'TEXTAREA';\n}\n"]}
1
+ {"version":3,"names":["isInputOrTextArea","element","tagName"],"sources":["@wordpress/dom/src/dom/is-input-or-text-area.js"],"sourcesContent":["/* eslint-disable jsdoc/valid-types */\n/**\n * @param {Element} element\n * @return {element is HTMLInputElement | HTMLTextAreaElement} Whether the element is an input or textarea\n */\nexport default function isInputOrTextArea( element ) {\n\t/* eslint-enable jsdoc/valid-types */\n\treturn element.tagName === 'INPUT' || element.tagName === 'TEXTAREA';\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACe,SAASA,iBAAiBA,CAAEC,OAAO,EAAG;EACpD;EACA,OAAOA,OAAO,CAACC,OAAO,KAAK,OAAO,IAAID,OAAO,CAACC,OAAO,KAAK,UAAU;AACrE"}
@@ -1,16 +1,12 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = isNumberInput;
9
-
10
8
  var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
11
-
12
9
  var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-element"));
13
-
14
10
  /**
15
11
  * WordPress dependencies
16
12
  */
@@ -20,7 +16,6 @@ var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-elemen
20
16
  */
21
17
 
22
18
  /* eslint-disable jsdoc/valid-types */
23
-
24
19
  /**
25
20
  * Check whether the given element is an input field of type number.
26
21
  *
@@ -34,7 +29,6 @@ function isNumberInput(node) {
34
29
  version: '6.5'
35
30
  });
36
31
  /* eslint-enable jsdoc/valid-types */
37
-
38
32
  return (0, _isHtmlInputElement.default)(node) && node.type === 'number' && !isNaN(node.valueAsNumber);
39
33
  }
40
34
  //# sourceMappingURL=is-number-input.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-number-input.js"],"names":["isNumberInput","node","since","version","type","isNaN","valueAsNumber"],"mappings":";;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,aAAT,CAAwBC,IAAxB,EAA+B;AAC7C,2BAAY,sBAAZ,EAAoC;AACnCC,IAAAA,KAAK,EAAE,KAD4B;AAEnCC,IAAAA,OAAO,EAAE;AAF0B,GAApC;AAIA;;AACA,SACC,iCAAoBF,IAApB,KACAA,IAAI,CAACG,IAAL,KAAc,QADd,IAEA,CAAEC,KAAK,CAAEJ,IAAI,CAACK,aAAP,CAHR;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is an input field of type number.\n *\n * @param {Node} node The HTML node.\n *\n * @return {node is HTMLInputElement} True if the node is number input.\n */\nexport default function isNumberInput( node ) {\n\tdeprecated( 'wp.dom.isNumberInput', {\n\t\tsince: '6.1',\n\t\tversion: '6.5',\n\t} );\n\t/* eslint-enable jsdoc/valid-types */\n\treturn (\n\t\tisHTMLInputElement( node ) &&\n\t\tnode.type === 'number' &&\n\t\t! isNaN( node.valueAsNumber )\n\t);\n}\n"]}
1
+ {"version":3,"names":["_deprecated","_interopRequireDefault","require","_isHtmlInputElement","isNumberInput","node","deprecated","since","version","isHTMLInputElement","type","isNaN","valueAsNumber"],"sources":["@wordpress/dom/src/dom/is-number-input.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\n\n/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is an input field of type number.\n *\n * @param {Node} node The HTML node.\n *\n * @return {node is HTMLInputElement} True if the node is number input.\n */\nexport default function isNumberInput( node ) {\n\tdeprecated( 'wp.dom.isNumberInput', {\n\t\tsince: '6.1',\n\t\tversion: '6.5',\n\t} );\n\t/* eslint-enable jsdoc/valid-types */\n\treturn (\n\t\tisHTMLInputElement( node ) &&\n\t\tnode.type === 'number' &&\n\t\t! isNaN( node.valueAsNumber )\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAF,sBAAA,CAAAC,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASE,aAAaA,CAAEC,IAAI,EAAG;EAC7C,IAAAC,mBAAU,EAAE,sBAAsB,EAAE;IACnCC,KAAK,EAAE,KAAK;IACZC,OAAO,EAAE;EACV,CAAE,CAAC;EACH;EACA,OACC,IAAAC,2BAAkB,EAAEJ,IAAK,CAAC,IAC1BA,IAAI,CAACK,IAAI,KAAK,QAAQ,IACtB,CAAEC,KAAK,CAAEN,IAAI,CAACO,aAAc,CAAC;AAE/B"}
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = isRTL;
9
-
10
8
  var _getComputedStyle = _interopRequireDefault(require("./get-computed-style"));
11
-
12
9
  /**
13
10
  * Internal dependencies
14
11
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-rtl.js"],"names":["isRTL","element","direction"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,KAAT,CAAgBC,OAAhB,EAA0B;AACxC,SAAO,+BAAkBA,OAAlB,EAA4BC,SAA5B,KAA0C,KAAjD;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport getComputedStyle from './get-computed-style';\n\n/**\n * Whether the element's text direction is right-to-left.\n *\n * @param {Element} element The element to check.\n *\n * @return {boolean} True if rtl, false if ltr.\n */\nexport default function isRTL( element ) {\n\treturn getComputedStyle( element ).direction === 'rtl';\n}\n"]}
1
+ {"version":3,"names":["_getComputedStyle","_interopRequireDefault","require","isRTL","element","getComputedStyle","direction"],"sources":["@wordpress/dom/src/dom/is-rtl.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport getComputedStyle from './get-computed-style';\n\n/**\n * Whether the element's text direction is right-to-left.\n *\n * @param {Element} element The element to check.\n *\n * @return {boolean} True if rtl, false if ltr.\n */\nexport default function isRTL( element ) {\n\treturn getComputedStyle( element ).direction === 'rtl';\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,KAAKA,CAAEC,OAAO,EAAG;EACxC,OAAO,IAAAC,yBAAgB,EAAED,OAAQ,CAAC,CAACE,SAAS,KAAK,KAAK;AACvD"}
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = isSelectionForward;
7
-
8
7
  var _assertIsDefined = require("../utils/assert-is-defined");
9
-
10
8
  /**
11
9
  * Internal dependencies
12
10
  */
@@ -30,30 +28,28 @@ function isSelectionForward(selection) {
30
28
  } = selection;
31
29
  (0, _assertIsDefined.assertIsDefined)(anchorNode, 'anchorNode');
32
30
  (0, _assertIsDefined.assertIsDefined)(focusNode, 'focusNode');
33
- const position = anchorNode.compareDocumentPosition(focusNode); // Disable reason: `Node#compareDocumentPosition` returns a bitmask value,
34
- // so bitwise operators are intended.
31
+ const position = anchorNode.compareDocumentPosition(focusNode);
35
32
 
33
+ // Disable reason: `Node#compareDocumentPosition` returns a bitmask value,
34
+ // so bitwise operators are intended.
36
35
  /* eslint-disable no-bitwise */
37
36
  // Compare whether anchor node precedes focus node. If focus node (where
38
37
  // end of selection occurs) is after the anchor node, it is forward.
39
-
40
38
  if (position & anchorNode.DOCUMENT_POSITION_PRECEDING) {
41
39
  return false;
42
40
  }
43
-
44
41
  if (position & anchorNode.DOCUMENT_POSITION_FOLLOWING) {
45
42
  return true;
46
43
  }
47
44
  /* eslint-enable no-bitwise */
45
+
48
46
  // `compareDocumentPosition` returns 0 when passed the same node, in which
49
47
  // case compare offsets.
50
-
51
-
52
48
  if (position === 0) {
53
49
  return anchorOffset <= focusOffset;
54
- } // This should never be reached, but return true as default case.
55
-
50
+ }
56
51
 
52
+ // This should never be reached, but return true as default case.
57
53
  return true;
58
54
  }
59
55
  //# sourceMappingURL=is-selection-forward.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-selection-forward.js"],"names":["isSelectionForward","selection","anchorNode","focusNode","anchorOffset","focusOffset","position","compareDocumentPosition","DOCUMENT_POSITION_PRECEDING","DOCUMENT_POSITION_FOLLOWING"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,kBAAT,CAA6BC,SAA7B,EAAyC;AACvD,QAAM;AAAEC,IAAAA,UAAF;AAAcC,IAAAA,SAAd;AAAyBC,IAAAA,YAAzB;AAAuCC,IAAAA;AAAvC,MAAuDJ,SAA7D;AAEA,wCAAiBC,UAAjB,EAA6B,YAA7B;AACA,wCAAiBC,SAAjB,EAA4B,WAA5B;AACA,QAAMG,QAAQ,GAAGJ,UAAU,CAACK,uBAAX,CAAoCJ,SAApC,CAAjB,CALuD,CAOvD;AACA;;AACA;AACA;AACA;;AACA,MAAKG,QAAQ,GAAGJ,UAAU,CAACM,2BAA3B,EAAyD;AACxD,WAAO,KAAP;AACA;;AAED,MAAKF,QAAQ,GAAGJ,UAAU,CAACO,2BAA3B,EAAyD;AACxD,WAAO,IAAP;AACA;AACD;AAEA;AACA;;;AACA,MAAKH,QAAQ,KAAK,CAAlB,EAAsB;AACrB,WAAOF,YAAY,IAAIC,WAAvB;AACA,GAzBsD,CA2BvD;;;AACA,SAAO,IAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport { assertIsDefined } from '../utils/assert-is-defined';\n\n/**\n * Returns true if the given selection object is in the forward direction, or\n * false otherwise.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n *\n * @param {Selection} selection Selection object to check.\n *\n * @return {boolean} Whether the selection is forward.\n */\nexport default function isSelectionForward( selection ) {\n\tconst { anchorNode, focusNode, anchorOffset, focusOffset } = selection;\n\n\tassertIsDefined( anchorNode, 'anchorNode' );\n\tassertIsDefined( focusNode, 'focusNode' );\n\tconst position = anchorNode.compareDocumentPosition( focusNode );\n\n\t// Disable reason: `Node#compareDocumentPosition` returns a bitmask value,\n\t// so bitwise operators are intended.\n\t/* eslint-disable no-bitwise */\n\t// Compare whether anchor node precedes focus node. If focus node (where\n\t// end of selection occurs) is after the anchor node, it is forward.\n\tif ( position & anchorNode.DOCUMENT_POSITION_PRECEDING ) {\n\t\treturn false;\n\t}\n\n\tif ( position & anchorNode.DOCUMENT_POSITION_FOLLOWING ) {\n\t\treturn true;\n\t}\n\t/* eslint-enable no-bitwise */\n\n\t// `compareDocumentPosition` returns 0 when passed the same node, in which\n\t// case compare offsets.\n\tif ( position === 0 ) {\n\t\treturn anchorOffset <= focusOffset;\n\t}\n\n\t// This should never be reached, but return true as default case.\n\treturn true;\n}\n"]}
1
+ {"version":3,"names":["_assertIsDefined","require","isSelectionForward","selection","anchorNode","focusNode","anchorOffset","focusOffset","assertIsDefined","position","compareDocumentPosition","DOCUMENT_POSITION_PRECEDING","DOCUMENT_POSITION_FOLLOWING"],"sources":["@wordpress/dom/src/dom/is-selection-forward.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { assertIsDefined } from '../utils/assert-is-defined';\n\n/**\n * Returns true if the given selection object is in the forward direction, or\n * false otherwise.\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition\n *\n * @param {Selection} selection Selection object to check.\n *\n * @return {boolean} Whether the selection is forward.\n */\nexport default function isSelectionForward( selection ) {\n\tconst { anchorNode, focusNode, anchorOffset, focusOffset } = selection;\n\n\tassertIsDefined( anchorNode, 'anchorNode' );\n\tassertIsDefined( focusNode, 'focusNode' );\n\tconst position = anchorNode.compareDocumentPosition( focusNode );\n\n\t// Disable reason: `Node#compareDocumentPosition` returns a bitmask value,\n\t// so bitwise operators are intended.\n\t/* eslint-disable no-bitwise */\n\t// Compare whether anchor node precedes focus node. If focus node (where\n\t// end of selection occurs) is after the anchor node, it is forward.\n\tif ( position & anchorNode.DOCUMENT_POSITION_PRECEDING ) {\n\t\treturn false;\n\t}\n\n\tif ( position & anchorNode.DOCUMENT_POSITION_FOLLOWING ) {\n\t\treturn true;\n\t}\n\t/* eslint-enable no-bitwise */\n\n\t// `compareDocumentPosition` returns 0 when passed the same node, in which\n\t// case compare offsets.\n\tif ( position === 0 ) {\n\t\treturn anchorOffset <= focusOffset;\n\t}\n\n\t// This should never be reached, but return true as default case.\n\treturn true;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,gBAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,kBAAkBA,CAAEC,SAAS,EAAG;EACvD,MAAM;IAAEC,UAAU;IAAEC,SAAS;IAAEC,YAAY;IAAEC;EAAY,CAAC,GAAGJ,SAAS;EAEtE,IAAAK,gCAAe,EAAEJ,UAAU,EAAE,YAAa,CAAC;EAC3C,IAAAI,gCAAe,EAAEH,SAAS,EAAE,WAAY,CAAC;EACzC,MAAMI,QAAQ,GAAGL,UAAU,CAACM,uBAAuB,CAAEL,SAAU,CAAC;;EAEhE;EACA;EACA;EACA;EACA;EACA,IAAKI,QAAQ,GAAGL,UAAU,CAACO,2BAA2B,EAAG;IACxD,OAAO,KAAK;EACb;EAEA,IAAKF,QAAQ,GAAGL,UAAU,CAACQ,2BAA2B,EAAG;IACxD,OAAO,IAAI;EACZ;EACA;;EAEA;EACA;EACA,IAAKH,QAAQ,KAAK,CAAC,EAAG;IACrB,OAAOH,YAAY,IAAIC,WAAW;EACnC;;EAEA;EACA,OAAO,IAAI;AACZ"}
@@ -1,20 +1,16 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = isTextField;
9
-
10
8
  var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-element"));
11
-
12
9
  /**
13
10
  * Internal dependencies
14
11
  */
15
12
 
16
13
  /* eslint-disable jsdoc/valid-types */
17
-
18
14
  /**
19
15
  * Check whether the given element is a text field, where text field is defined
20
16
  * by the ability to select within the input, or that it is contenteditable.
@@ -27,8 +23,6 @@ var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-elemen
27
23
  function isTextField(node) {
28
24
  /* eslint-enable jsdoc/valid-types */
29
25
  const nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number', 'email', 'time'];
30
- return (0, _isHtmlInputElement.default)(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === 'TEXTAREA' ||
31
- /** @type {HTMLElement} */
32
- node.contentEditable === 'true';
26
+ return (0, _isHtmlInputElement.default)(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === 'TEXTAREA' || /** @type {HTMLElement} */node.contentEditable === 'true';
33
27
  }
34
28
  //# sourceMappingURL=is-text-field.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-text-field.js"],"names":["isTextField","node","nonTextInputs","type","includes","nodeName","contentEditable"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,WAAT,CAAsBC,IAAtB,EAA6B;AAC3C;AACA,QAAMC,aAAa,GAAG,CACrB,QADqB,EAErB,UAFqB,EAGrB,QAHqB,EAIrB,MAJqB,EAKrB,OALqB,EAMrB,OANqB,EAOrB,OAPqB,EAQrB,OARqB,EASrB,QATqB,EAUrB,QAVqB,EAWrB,OAXqB,EAYrB,MAZqB,CAAtB;AAcA,SACG,iCAAoBD,IAApB,KACDA,IAAI,CAACE,IADJ,IAED,CAAED,aAAa,CAACE,QAAd,CAAwBH,IAAI,CAACE,IAA7B,CAFH,IAGAF,IAAI,CAACI,QAAL,KAAkB,UAHlB;AAIA;AAA6BJ,EAAAA,IAAF,CAASK,eAAT,KAA6B,MALzD;AAOA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is a text field, where text field is defined\n * by the ability to select within the input, or that it is contenteditable.\n *\n * See: https://html.spec.whatwg.org/#textFieldSelection\n *\n * @param {Node} node The HTML element.\n * @return {node is HTMLElement} True if the element is an text field, false if not.\n */\nexport default function isTextField( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\tconst nonTextInputs = [\n\t\t'button',\n\t\t'checkbox',\n\t\t'hidden',\n\t\t'file',\n\t\t'radio',\n\t\t'image',\n\t\t'range',\n\t\t'reset',\n\t\t'submit',\n\t\t'number',\n\t\t'email',\n\t\t'time',\n\t];\n\treturn (\n\t\t( isHTMLInputElement( node ) &&\n\t\t\tnode.type &&\n\t\t\t! nonTextInputs.includes( node.type ) ) ||\n\t\tnode.nodeName === 'TEXTAREA' ||\n\t\t/** @type {HTMLElement} */ ( node ).contentEditable === 'true'\n\t);\n}\n"]}
1
+ {"version":3,"names":["_isHtmlInputElement","_interopRequireDefault","require","isTextField","node","nonTextInputs","isHTMLInputElement","type","includes","nodeName","contentEditable"],"sources":["@wordpress/dom/src/dom/is-text-field.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport isHTMLInputElement from './is-html-input-element';\n\n/* eslint-disable jsdoc/valid-types */\n/**\n * Check whether the given element is a text field, where text field is defined\n * by the ability to select within the input, or that it is contenteditable.\n *\n * See: https://html.spec.whatwg.org/#textFieldSelection\n *\n * @param {Node} node The HTML element.\n * @return {node is HTMLElement} True if the element is an text field, false if not.\n */\nexport default function isTextField( node ) {\n\t/* eslint-enable jsdoc/valid-types */\n\tconst nonTextInputs = [\n\t\t'button',\n\t\t'checkbox',\n\t\t'hidden',\n\t\t'file',\n\t\t'radio',\n\t\t'image',\n\t\t'range',\n\t\t'reset',\n\t\t'submit',\n\t\t'number',\n\t\t'email',\n\t\t'time',\n\t];\n\treturn (\n\t\t( isHTMLInputElement( node ) &&\n\t\t\tnode.type &&\n\t\t\t! nonTextInputs.includes( node.type ) ) ||\n\t\tnode.nodeName === 'TEXTAREA' ||\n\t\t/** @type {HTMLElement} */ ( node ).contentEditable === 'true'\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,mBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,WAAWA,CAAEC,IAAI,EAAG;EAC3C;EACA,MAAMC,aAAa,GAAG,CACrB,QAAQ,EACR,UAAU,EACV,QAAQ,EACR,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,MAAM,CACN;EACD,OACG,IAAAC,2BAAkB,EAAEF,IAAK,CAAC,IAC3BA,IAAI,CAACG,IAAI,IACT,CAAEF,aAAa,CAACG,QAAQ,CAAEJ,IAAI,CAACG,IAAK,CAAC,IACtCH,IAAI,CAACK,QAAQ,KAAK,UAAU,IAC5B,0BAA6BL,IAAI,CAAGM,eAAe,KAAK,MAAM;AAEhE"}
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = isVerticalEdge;
9
-
10
8
  var _isEdge = _interopRequireDefault(require("./is-edge"));
11
-
12
9
  /**
13
10
  * Internal dependencies
14
11
  */
@@ -16,8 +13,8 @@ var _isEdge = _interopRequireDefault(require("./is-edge"));
16
13
  /**
17
14
  * Check whether the selection is vertically at the edge of the container.
18
15
  *
19
- * @param {Element} container Focusable element.
20
- * @param {boolean} isReverse Set to true to check top, false for bottom.
16
+ * @param {HTMLElement} container Focusable element.
17
+ * @param {boolean} isReverse Set to true to check top, false for bottom.
21
18
  *
22
19
  * @return {boolean} True if at the vertical edge, false if not.
23
20
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/is-vertical-edge.js"],"names":["isVerticalEdge","container","isReverse"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,cAAT,CAAyBC,SAAzB,EAAoCC,SAApC,EAAgD;AAC9D,SAAO,qBAAQD,SAAR,EAAmBC,SAAnB,EAA8B,IAA9B,CAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport isEdge from './is-edge';\n\n/**\n * Check whether the selection is vertically at the edge of the container.\n *\n * @param {Element} container Focusable element.\n * @param {boolean} isReverse Set to true to check top, false for bottom.\n *\n * @return {boolean} True if at the vertical edge, false if not.\n */\nexport default function isVerticalEdge( container, isReverse ) {\n\treturn isEdge( container, isReverse, true );\n}\n"]}
1
+ {"version":3,"names":["_isEdge","_interopRequireDefault","require","isVerticalEdge","container","isReverse","isEdge"],"sources":["@wordpress/dom/src/dom/is-vertical-edge.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport isEdge from './is-edge';\n\n/**\n * Check whether the selection is vertically at the edge of the container.\n *\n * @param {HTMLElement} container Focusable element.\n * @param {boolean} isReverse Set to true to check top, false for bottom.\n *\n * @return {boolean} True if at the vertical edge, false if not.\n */\nexport default function isVerticalEdge( container, isReverse ) {\n\treturn isEdge( container, isReverse, true );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,cAAcA,CAAEC,SAAS,EAAEC,SAAS,EAAG;EAC9D,OAAO,IAAAC,eAAM,EAAEF,SAAS,EAAEC,SAAS,EAAE,IAAK,CAAC;AAC5C"}
@@ -1,20 +1,15 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = placeCaretAtEdge;
9
-
10
8
  var _hiddenCaretRangeFromPoint = _interopRequireDefault(require("./hidden-caret-range-from-point"));
11
-
12
9
  var _assertIsDefined = require("../utils/assert-is-defined");
13
-
14
10
  var _isInputOrTextArea = _interopRequireDefault(require("./is-input-or-text-area"));
15
-
16
11
  var _isRtl = _interopRequireDefault(require("./is-rtl"));
17
-
12
+ var _scrollIfNoRange = require("./scroll-if-no-range");
18
13
  /**
19
14
  * Internal dependencies
20
15
  */
@@ -31,14 +26,14 @@ var _isRtl = _interopRequireDefault(require("./is-rtl"));
31
26
  function getRange(container, isReverse, x) {
32
27
  const {
33
28
  ownerDocument
34
- } = container; // In the case of RTL scripts, the horizontal edge is at the opposite side.
35
-
29
+ } = container;
30
+ // In the case of RTL scripts, the horizontal edge is at the opposite side.
36
31
  const isReverseDir = (0, _isRtl.default)(container) ? !isReverse : isReverse;
37
- const containerRect = container.getBoundingClientRect(); // When placing at the end (isReverse), find the closest range to the bottom
32
+ const containerRect = container.getBoundingClientRect();
33
+ // When placing at the end (isReverse), find the closest range to the bottom
38
34
  // right corner. When placing at the start, to the top left corner.
39
35
  // Ensure x is defined and within the container's boundaries. When it's
40
36
  // exactly at the boundary, it's not considered within the boundaries.
41
-
42
37
  if (x === undefined) {
43
38
  x = isReverse ? containerRect.right - 1 : containerRect.left + 1;
44
39
  } else if (x <= containerRect.left) {
@@ -46,10 +41,10 @@ function getRange(container, isReverse, x) {
46
41
  } else if (x >= containerRect.right) {
47
42
  x = containerRect.right - 1;
48
43
  }
49
-
50
44
  const y = isReverseDir ? containerRect.bottom - 1 : containerRect.top + 1;
51
45
  return (0, _hiddenCaretRangeFromPoint.default)(ownerDocument, x, y, container);
52
46
  }
47
+
53
48
  /**
54
49
  * Places the caret at start or end of a given element.
55
50
  *
@@ -57,21 +52,16 @@ function getRange(container, isReverse, x) {
57
52
  * @param {boolean} isReverse True for end, false for start.
58
53
  * @param {number|undefined} x X coordinate to vertically position.
59
54
  */
60
-
61
-
62
55
  function placeCaretAtEdge(container, isReverse, x) {
63
56
  if (!container) {
64
57
  return;
65
58
  }
66
-
67
59
  container.focus();
68
-
69
60
  if ((0, _isInputOrTextArea.default)(container)) {
70
61
  // The element may not support selection setting.
71
62
  if (typeof container.selectionStart !== 'number') {
72
63
  return;
73
64
  }
74
-
75
65
  if (isReverse) {
76
66
  container.selectionStart = container.value.length;
77
67
  container.selectionEnd = container.value.length;
@@ -79,26 +69,13 @@ function placeCaretAtEdge(container, isReverse, x) {
79
69
  container.selectionStart = 0;
80
70
  container.selectionEnd = 0;
81
71
  }
82
-
83
72
  return;
84
73
  }
85
-
86
74
  if (!container.isContentEditable) {
87
75
  return;
88
76
  }
89
-
90
- let range = getRange(container, isReverse, x); // If no range range can be created or it is outside the container, the
91
- // element may be out of view.
92
-
93
- if (!range || !range.startContainer || !container.contains(range.startContainer)) {
94
- container.scrollIntoView(isReverse);
95
- range = range = getRange(container, isReverse, x);
96
-
97
- if (!range || !range.startContainer || !container.contains(range.startContainer)) {
98
- return;
99
- }
100
- }
101
-
77
+ const range = (0, _scrollIfNoRange.scrollIfNoRange)(container, isReverse, () => getRange(container, isReverse, x));
78
+ if (!range) return;
102
79
  const {
103
80
  ownerDocument
104
81
  } = container;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/place-caret-at-edge.js"],"names":["getRange","container","isReverse","x","ownerDocument","isReverseDir","containerRect","getBoundingClientRect","undefined","right","left","y","bottom","top","placeCaretAtEdge","focus","selectionStart","value","length","selectionEnd","isContentEditable","range","startContainer","contains","scrollIntoView","defaultView","selection","getSelection","removeAllRanges","addRange"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAT,CAAmBC,SAAnB,EAA8BC,SAA9B,EAAyCC,CAAzC,EAA6C;AAC5C,QAAM;AAAEC,IAAAA;AAAF,MAAoBH,SAA1B,CAD4C,CAE5C;;AACA,QAAMI,YAAY,GAAG,oBAAOJ,SAAP,IAAqB,CAAEC,SAAvB,GAAmCA,SAAxD;AACA,QAAMI,aAAa,GAAGL,SAAS,CAACM,qBAAV,EAAtB,CAJ4C,CAK5C;AACA;AACA;AACA;;AACA,MAAKJ,CAAC,KAAKK,SAAX,EAAuB;AACtBL,IAAAA,CAAC,GAAGD,SAAS,GAAGI,aAAa,CAACG,KAAd,GAAsB,CAAzB,GAA6BH,aAAa,CAACI,IAAd,GAAqB,CAA/D;AACA,GAFD,MAEO,IAAKP,CAAC,IAAIG,aAAa,CAACI,IAAxB,EAA+B;AACrCP,IAAAA,CAAC,GAAGG,aAAa,CAACI,IAAd,GAAqB,CAAzB;AACA,GAFM,MAEA,IAAKP,CAAC,IAAIG,aAAa,CAACG,KAAxB,EAAgC;AACtCN,IAAAA,CAAC,GAAGG,aAAa,CAACG,KAAd,GAAsB,CAA1B;AACA;;AACD,QAAME,CAAC,GAAGN,YAAY,GAAGC,aAAa,CAACM,MAAd,GAAuB,CAA1B,GAA8BN,aAAa,CAACO,GAAd,GAAoB,CAAxE;AACA,SAAO,wCAA2BT,aAA3B,EAA0CD,CAA1C,EAA6CQ,CAA7C,EAAgDV,SAAhD,CAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACe,SAASa,gBAAT,CAA2Bb,SAA3B,EAAsCC,SAAtC,EAAiDC,CAAjD,EAAqD;AACnE,MAAK,CAAEF,SAAP,EAAmB;AAClB;AACA;;AAEDA,EAAAA,SAAS,CAACc,KAAV;;AAEA,MAAK,gCAAmBd,SAAnB,CAAL,EAAsC;AACrC;AACA,QAAK,OAAOA,SAAS,CAACe,cAAjB,KAAoC,QAAzC,EAAoD;AACnD;AACA;;AAED,QAAKd,SAAL,EAAiB;AAChBD,MAAAA,SAAS,CAACe,cAAV,GAA2Bf,SAAS,CAACgB,KAAV,CAAgBC,MAA3C;AACAjB,MAAAA,SAAS,CAACkB,YAAV,GAAyBlB,SAAS,CAACgB,KAAV,CAAgBC,MAAzC;AACA,KAHD,MAGO;AACNjB,MAAAA,SAAS,CAACe,cAAV,GAA2B,CAA3B;AACAf,MAAAA,SAAS,CAACkB,YAAV,GAAyB,CAAzB;AACA;;AAED;AACA;;AAED,MAAK,CAAElB,SAAS,CAACmB,iBAAjB,EAAqC;AACpC;AACA;;AAED,MAAIC,KAAK,GAAGrB,QAAQ,CAAEC,SAAF,EAAaC,SAAb,EAAwBC,CAAxB,CAApB,CA5BmE,CA8BnE;AACA;;AACA,MACC,CAAEkB,KAAF,IACA,CAAEA,KAAK,CAACC,cADR,IAEA,CAAErB,SAAS,CAACsB,QAAV,CAAoBF,KAAK,CAACC,cAA1B,CAHH,EAIE;AACDrB,IAAAA,SAAS,CAACuB,cAAV,CAA0BtB,SAA1B;AACAmB,IAAAA,KAAK,GAAGA,KAAK,GAAGrB,QAAQ,CAAEC,SAAF,EAAaC,SAAb,EAAwBC,CAAxB,CAAxB;;AAEA,QACC,CAAEkB,KAAF,IACA,CAAEA,KAAK,CAACC,cADR,IAEA,CAAErB,SAAS,CAACsB,QAAV,CAAoBF,KAAK,CAACC,cAA1B,CAHH,EAIE;AACD;AACA;AACD;;AAED,QAAM;AAAElB,IAAAA;AAAF,MAAoBH,SAA1B;AACA,QAAM;AAAEwB,IAAAA;AAAF,MAAkBrB,aAAxB;AACA,wCAAiBqB,WAAjB,EAA8B,aAA9B;AACA,QAAMC,SAAS,GAAGD,WAAW,CAACE,YAAZ,EAAlB;AACA,wCAAiBD,SAAjB,EAA4B,WAA5B;AACAA,EAAAA,SAAS,CAACE,eAAV;AACAF,EAAAA,SAAS,CAACG,QAAV,CAAoBR,KAApB;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport hiddenCaretRangeFromPoint from './hidden-caret-range-from-point';\nimport { assertIsDefined } from '../utils/assert-is-defined';\nimport isInputOrTextArea from './is-input-or-text-area';\nimport isRTL from './is-rtl';\n\n/**\n * Gets the range to place.\n *\n * @param {HTMLElement} container Focusable element.\n * @param {boolean} isReverse True for end, false for start.\n * @param {number|undefined} x X coordinate to vertically position.\n *\n * @return {Range|null} The range to place.\n */\nfunction getRange( container, isReverse, x ) {\n\tconst { ownerDocument } = container;\n\t// In the case of RTL scripts, the horizontal edge is at the opposite side.\n\tconst isReverseDir = isRTL( container ) ? ! isReverse : isReverse;\n\tconst containerRect = container.getBoundingClientRect();\n\t// When placing at the end (isReverse), find the closest range to the bottom\n\t// right corner. When placing at the start, to the top left corner.\n\t// Ensure x is defined and within the container's boundaries. When it's\n\t// exactly at the boundary, it's not considered within the boundaries.\n\tif ( x === undefined ) {\n\t\tx = isReverse ? containerRect.right - 1 : containerRect.left + 1;\n\t} else if ( x <= containerRect.left ) {\n\t\tx = containerRect.left + 1;\n\t} else if ( x >= containerRect.right ) {\n\t\tx = containerRect.right - 1;\n\t}\n\tconst y = isReverseDir ? containerRect.bottom - 1 : containerRect.top + 1;\n\treturn hiddenCaretRangeFromPoint( ownerDocument, x, y, container );\n}\n\n/**\n * Places the caret at start or end of a given element.\n *\n * @param {HTMLElement} container Focusable element.\n * @param {boolean} isReverse True for end, false for start.\n * @param {number|undefined} x X coordinate to vertically position.\n */\nexport default function placeCaretAtEdge( container, isReverse, x ) {\n\tif ( ! container ) {\n\t\treturn;\n\t}\n\n\tcontainer.focus();\n\n\tif ( isInputOrTextArea( container ) ) {\n\t\t// The element may not support selection setting.\n\t\tif ( typeof container.selectionStart !== 'number' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isReverse ) {\n\t\t\tcontainer.selectionStart = container.value.length;\n\t\t\tcontainer.selectionEnd = container.value.length;\n\t\t} else {\n\t\t\tcontainer.selectionStart = 0;\n\t\t\tcontainer.selectionEnd = 0;\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif ( ! container.isContentEditable ) {\n\t\treturn;\n\t}\n\n\tlet range = getRange( container, isReverse, x );\n\n\t// If no range range can be created or it is outside the container, the\n\t// element may be out of view.\n\tif (\n\t\t! range ||\n\t\t! range.startContainer ||\n\t\t! container.contains( range.startContainer )\n\t) {\n\t\tcontainer.scrollIntoView( isReverse );\n\t\trange = range = getRange( container, isReverse, x );\n\n\t\tif (\n\t\t\t! range ||\n\t\t\t! range.startContainer ||\n\t\t\t! container.contains( range.startContainer )\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t}\n\n\tconst { ownerDocument } = container;\n\tconst { defaultView } = ownerDocument;\n\tassertIsDefined( defaultView, 'defaultView' );\n\tconst selection = defaultView.getSelection();\n\tassertIsDefined( selection, 'selection' );\n\tselection.removeAllRanges();\n\tselection.addRange( range );\n}\n"]}
1
+ {"version":3,"names":["_hiddenCaretRangeFromPoint","_interopRequireDefault","require","_assertIsDefined","_isInputOrTextArea","_isRtl","_scrollIfNoRange","getRange","container","isReverse","x","ownerDocument","isReverseDir","isRTL","containerRect","getBoundingClientRect","undefined","right","left","y","bottom","top","hiddenCaretRangeFromPoint","placeCaretAtEdge","focus","isInputOrTextArea","selectionStart","value","length","selectionEnd","isContentEditable","range","scrollIfNoRange","defaultView","assertIsDefined","selection","getSelection","removeAllRanges","addRange"],"sources":["@wordpress/dom/src/dom/place-caret-at-edge.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport hiddenCaretRangeFromPoint from './hidden-caret-range-from-point';\nimport { assertIsDefined } from '../utils/assert-is-defined';\nimport isInputOrTextArea from './is-input-or-text-area';\nimport isRTL from './is-rtl';\nimport { scrollIfNoRange } from './scroll-if-no-range';\n\n/**\n * Gets the range to place.\n *\n * @param {HTMLElement} container Focusable element.\n * @param {boolean} isReverse True for end, false for start.\n * @param {number|undefined} x X coordinate to vertically position.\n *\n * @return {Range|null} The range to place.\n */\nfunction getRange( container, isReverse, x ) {\n\tconst { ownerDocument } = container;\n\t// In the case of RTL scripts, the horizontal edge is at the opposite side.\n\tconst isReverseDir = isRTL( container ) ? ! isReverse : isReverse;\n\tconst containerRect = container.getBoundingClientRect();\n\t// When placing at the end (isReverse), find the closest range to the bottom\n\t// right corner. When placing at the start, to the top left corner.\n\t// Ensure x is defined and within the container's boundaries. When it's\n\t// exactly at the boundary, it's not considered within the boundaries.\n\tif ( x === undefined ) {\n\t\tx = isReverse ? containerRect.right - 1 : containerRect.left + 1;\n\t} else if ( x <= containerRect.left ) {\n\t\tx = containerRect.left + 1;\n\t} else if ( x >= containerRect.right ) {\n\t\tx = containerRect.right - 1;\n\t}\n\tconst y = isReverseDir ? containerRect.bottom - 1 : containerRect.top + 1;\n\treturn hiddenCaretRangeFromPoint( ownerDocument, x, y, container );\n}\n\n/**\n * Places the caret at start or end of a given element.\n *\n * @param {HTMLElement} container Focusable element.\n * @param {boolean} isReverse True for end, false for start.\n * @param {number|undefined} x X coordinate to vertically position.\n */\nexport default function placeCaretAtEdge( container, isReverse, x ) {\n\tif ( ! container ) {\n\t\treturn;\n\t}\n\n\tcontainer.focus();\n\n\tif ( isInputOrTextArea( container ) ) {\n\t\t// The element may not support selection setting.\n\t\tif ( typeof container.selectionStart !== 'number' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( isReverse ) {\n\t\t\tcontainer.selectionStart = container.value.length;\n\t\t\tcontainer.selectionEnd = container.value.length;\n\t\t} else {\n\t\t\tcontainer.selectionStart = 0;\n\t\t\tcontainer.selectionEnd = 0;\n\t\t}\n\n\t\treturn;\n\t}\n\n\tif ( ! container.isContentEditable ) {\n\t\treturn;\n\t}\n\n\tconst range = scrollIfNoRange( container, isReverse, () =>\n\t\tgetRange( container, isReverse, x )\n\t);\n\n\tif ( ! range ) return;\n\n\tconst { ownerDocument } = container;\n\tconst { defaultView } = ownerDocument;\n\tassertIsDefined( defaultView, 'defaultView' );\n\tconst selection = defaultView.getSelection();\n\tassertIsDefined( selection, 'selection' );\n\tselection.removeAllRanges();\n\tselection.addRange( range );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASK,QAAQA,CAAEC,SAAS,EAAEC,SAAS,EAAEC,CAAC,EAAG;EAC5C,MAAM;IAAEC;EAAc,CAAC,GAAGH,SAAS;EACnC;EACA,MAAMI,YAAY,GAAG,IAAAC,cAAK,EAAEL,SAAU,CAAC,GAAG,CAAEC,SAAS,GAAGA,SAAS;EACjE,MAAMK,aAAa,GAAGN,SAAS,CAACO,qBAAqB,CAAC,CAAC;EACvD;EACA;EACA;EACA;EACA,IAAKL,CAAC,KAAKM,SAAS,EAAG;IACtBN,CAAC,GAAGD,SAAS,GAAGK,aAAa,CAACG,KAAK,GAAG,CAAC,GAAGH,aAAa,CAACI,IAAI,GAAG,CAAC;EACjE,CAAC,MAAM,IAAKR,CAAC,IAAII,aAAa,CAACI,IAAI,EAAG;IACrCR,CAAC,GAAGI,aAAa,CAACI,IAAI,GAAG,CAAC;EAC3B,CAAC,MAAM,IAAKR,CAAC,IAAII,aAAa,CAACG,KAAK,EAAG;IACtCP,CAAC,GAAGI,aAAa,CAACG,KAAK,GAAG,CAAC;EAC5B;EACA,MAAME,CAAC,GAAGP,YAAY,GAAGE,aAAa,CAACM,MAAM,GAAG,CAAC,GAAGN,aAAa,CAACO,GAAG,GAAG,CAAC;EACzE,OAAO,IAAAC,kCAAyB,EAAEX,aAAa,EAAED,CAAC,EAAES,CAAC,EAAEX,SAAU,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACe,SAASe,gBAAgBA,CAAEf,SAAS,EAAEC,SAAS,EAAEC,CAAC,EAAG;EACnE,IAAK,CAAEF,SAAS,EAAG;IAClB;EACD;EAEAA,SAAS,CAACgB,KAAK,CAAC,CAAC;EAEjB,IAAK,IAAAC,0BAAiB,EAAEjB,SAAU,CAAC,EAAG;IACrC;IACA,IAAK,OAAOA,SAAS,CAACkB,cAAc,KAAK,QAAQ,EAAG;MACnD;IACD;IAEA,IAAKjB,SAAS,EAAG;MAChBD,SAAS,CAACkB,cAAc,GAAGlB,SAAS,CAACmB,KAAK,CAACC,MAAM;MACjDpB,SAAS,CAACqB,YAAY,GAAGrB,SAAS,CAACmB,KAAK,CAACC,MAAM;IAChD,CAAC,MAAM;MACNpB,SAAS,CAACkB,cAAc,GAAG,CAAC;MAC5BlB,SAAS,CAACqB,YAAY,GAAG,CAAC;IAC3B;IAEA;EACD;EAEA,IAAK,CAAErB,SAAS,CAACsB,iBAAiB,EAAG;IACpC;EACD;EAEA,MAAMC,KAAK,GAAG,IAAAC,gCAAe,EAAExB,SAAS,EAAEC,SAAS,EAAE,MACpDF,QAAQ,CAAEC,SAAS,EAAEC,SAAS,EAAEC,CAAE,CACnC,CAAC;EAED,IAAK,CAAEqB,KAAK,EAAG;EAEf,MAAM;IAAEpB;EAAc,CAAC,GAAGH,SAAS;EACnC,MAAM;IAAEyB;EAAY,CAAC,GAAGtB,aAAa;EACrC,IAAAuB,gCAAe,EAAED,WAAW,EAAE,aAAc,CAAC;EAC7C,MAAME,SAAS,GAAGF,WAAW,CAACG,YAAY,CAAC,CAAC;EAC5C,IAAAF,gCAAe,EAAEC,SAAS,EAAE,WAAY,CAAC;EACzCA,SAAS,CAACE,eAAe,CAAC,CAAC;EAC3BF,SAAS,CAACG,QAAQ,CAAEP,KAAM,CAAC;AAC5B"}
@@ -1,14 +1,11 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = placeCaretAtHorizontalEdge;
9
-
10
8
  var _placeCaretAtEdge = _interopRequireDefault(require("./place-caret-at-edge"));
11
-
12
9
  /**
13
10
  * Internal dependencies
14
11
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/dom/src/dom/place-caret-at-horizontal-edge.js"],"names":["placeCaretAtHorizontalEdge","container","isReverse","undefined"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASA,0BAAT,CAAqCC,SAArC,EAAgDC,SAAhD,EAA4D;AAC1E,SAAO,+BAAkBD,SAAlB,EAA6BC,SAA7B,EAAwCC,SAAxC,CAAP;AACA","sourcesContent":["/**\n * Internal dependencies\n */\nimport placeCaretAtEdge from './place-caret-at-edge';\n\n/**\n * Places the caret at start or end of a given element.\n *\n * @param {HTMLElement} container Focusable element.\n * @param {boolean} isReverse True for end, false for start.\n */\nexport default function placeCaretAtHorizontalEdge( container, isReverse ) {\n\treturn placeCaretAtEdge( container, isReverse, undefined );\n}\n"]}
1
+ {"version":3,"names":["_placeCaretAtEdge","_interopRequireDefault","require","placeCaretAtHorizontalEdge","container","isReverse","placeCaretAtEdge","undefined"],"sources":["@wordpress/dom/src/dom/place-caret-at-horizontal-edge.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport placeCaretAtEdge from './place-caret-at-edge';\n\n/**\n * Places the caret at start or end of a given element.\n *\n * @param {HTMLElement} container Focusable element.\n * @param {boolean} isReverse True for end, false for start.\n */\nexport default function placeCaretAtHorizontalEdge( container, isReverse ) {\n\treturn placeCaretAtEdge( container, isReverse, undefined );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACe,SAASC,0BAA0BA,CAAEC,SAAS,EAAEC,SAAS,EAAG;EAC1E,OAAO,IAAAC,yBAAgB,EAAEF,SAAS,EAAEC,SAAS,EAAEE,SAAU,CAAC;AAC3D"}