@wordpress/dom 4.32.0 → 4.32.1-next.ff1cebbba.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 (185) hide show
  1. package/build/data-transfer.js +30 -18
  2. package/build/data-transfer.js.map +7 -1
  3. package/build/dom/caret-range-from-point.js +22 -25
  4. package/build/dom/caret-range-from-point.js.map +7 -1
  5. package/build/dom/clean-node-list.js +122 -129
  6. package/build/dom/clean-node-list.js.map +7 -1
  7. package/build/dom/compute-caret-rect.js +36 -21
  8. package/build/dom/compute-caret-rect.js.map +7 -1
  9. package/build/dom/document-has-selection.js +36 -22
  10. package/build/dom/document-has-selection.js.map +7 -1
  11. package/build/dom/document-has-text-selection.js +25 -23
  12. package/build/dom/document-has-text-selection.js.map +7 -1
  13. package/build/dom/document-has-uncollapsed-selection.js +35 -22
  14. package/build/dom/document-has-uncollapsed-selection.js.map +7 -1
  15. package/build/dom/get-computed-style.js +27 -17
  16. package/build/dom/get-computed-style.js.map +7 -1
  17. package/build/dom/get-offset-parent.js +43 -32
  18. package/build/dom/get-offset-parent.js.map +7 -1
  19. package/build/dom/get-range-height.js +24 -18
  20. package/build/dom/get-range-height.js.map +7 -1
  21. package/build/dom/get-rectangle-from-range.js +47 -68
  22. package/build/dom/get-rectangle-from-range.js.map +7 -1
  23. package/build/dom/get-scroll-container.js +44 -37
  24. package/build/dom/get-scroll-container.js.map +7 -1
  25. package/build/dom/hidden-caret-range-from-point.js +39 -33
  26. package/build/dom/hidden-caret-range-from-point.js.map +7 -1
  27. package/build/dom/index.js +116 -195
  28. package/build/dom/index.js.map +7 -1
  29. package/build/dom/input-field-has-uncollapsed-selection.js +40 -42
  30. package/build/dom/input-field-has-uncollapsed-selection.js.map +7 -1
  31. package/build/dom/insert-after.js +24 -19
  32. package/build/dom/insert-after.js.map +7 -1
  33. package/build/dom/is-edge.js +57 -67
  34. package/build/dom/is-edge.js.map +7 -1
  35. package/build/dom/is-element.js +22 -11
  36. package/build/dom/is-element.js.map +7 -1
  37. package/build/dom/is-empty.js +27 -17
  38. package/build/dom/is-empty.js.map +7 -1
  39. package/build/dom/is-entirely-selected.js +46 -50
  40. package/build/dom/is-entirely-selected.js.map +7 -1
  41. package/build/dom/is-form-element.js +36 -24
  42. package/build/dom/is-form-element.js.map +7 -1
  43. package/build/dom/is-horizontal-edge.js +34 -20
  44. package/build/dom/is-horizontal-edge.js.map +7 -1
  45. package/build/dom/is-html-input-element.js +23 -12
  46. package/build/dom/is-html-input-element.js.map +7 -1
  47. package/build/dom/is-input-or-text-area.js +23 -12
  48. package/build/dom/is-input-or-text-area.js.map +7 -1
  49. package/build/dom/is-number-input.js +38 -29
  50. package/build/dom/is-number-input.js.map +7 -1
  51. package/build/dom/is-rtl.js +34 -19
  52. package/build/dom/is-rtl.js.map +7 -1
  53. package/build/dom/is-selection-forward.js +26 -40
  54. package/build/dom/is-selection-forward.js.map +7 -1
  55. package/build/dom/is-text-field.js +49 -24
  56. package/build/dom/is-text-field.js.map +7 -1
  57. package/build/dom/is-vertical-edge.js +34 -20
  58. package/build/dom/is-vertical-edge.js.map +7 -1
  59. package/build/dom/place-caret-at-edge.js +52 -55
  60. package/build/dom/place-caret-at-edge.js.map +7 -1
  61. package/build/dom/place-caret-at-horizontal-edge.js +34 -18
  62. package/build/dom/place-caret-at-horizontal-edge.js.map +7 -1
  63. package/build/dom/place-caret-at-vertical-edge.js +34 -19
  64. package/build/dom/place-caret-at-vertical-edge.js.map +7 -1
  65. package/build/dom/remove-invalid-html.js +35 -22
  66. package/build/dom/remove-invalid-html.js.map +7 -1
  67. package/build/dom/remove.js +24 -17
  68. package/build/dom/remove.js.map +7 -1
  69. package/build/dom/replace-tag.js +24 -19
  70. package/build/dom/replace-tag.js.map +7 -1
  71. package/build/dom/replace.js +38 -23
  72. package/build/dom/replace.js.map +7 -1
  73. package/build/dom/safe-html.js +39 -28
  74. package/build/dom/safe-html.js.map +7 -1
  75. package/build/dom/scroll-if-no-range.js +26 -18
  76. package/build/dom/scroll-if-no-range.js.map +7 -1
  77. package/build/dom/strip-html.js +36 -23
  78. package/build/dom/strip-html.js.map +7 -1
  79. package/build/dom/unwrap.js +24 -18
  80. package/build/dom/unwrap.js.map +7 -1
  81. package/build/dom/wrap.js +24 -17
  82. package/build/dom/wrap.js.map +7 -1
  83. package/build/focusable.js +52 -85
  84. package/build/focusable.js.map +7 -1
  85. package/build/index.js +44 -58
  86. package/build/index.js.map +7 -1
  87. package/build/phrasing-content.js +88 -128
  88. package/build/phrasing-content.js.map +7 -1
  89. package/build/tabbable.js +52 -137
  90. package/build/tabbable.js.map +7 -1
  91. package/build/utils/assert-is-defined.js +30 -7
  92. package/build/utils/assert-is-defined.js.map +7 -1
  93. package/build-module/data-transfer.js +9 -15
  94. package/build-module/data-transfer.js.map +7 -1
  95. package/build-module/dom/caret-range-from-point.js +5 -22
  96. package/build-module/dom/caret-range-from-point.js.map +7 -1
  97. package/build-module/dom/clean-node-list.js +94 -123
  98. package/build-module/dom/clean-node-list.js.map +7 -1
  99. package/build-module/dom/compute-caret-rect.js +8 -16
  100. package/build-module/dom/compute-caret-rect.js.map +7 -1
  101. package/build-module/dom/document-has-selection.js +8 -17
  102. package/build-module/dom/document-has-selection.js.map +7 -1
  103. package/build-module/dom/document-has-text-selection.js +8 -20
  104. package/build-module/dom/document-has-text-selection.js.map +7 -1
  105. package/build-module/dom/document-has-uncollapsed-selection.js +7 -17
  106. package/build-module/dom/document-has-uncollapsed-selection.js.map +7 -1
  107. package/build-module/dom/get-computed-style.js +10 -14
  108. package/build-module/dom/get-computed-style.js.map +7 -1
  109. package/build-module/dom/get-offset-parent.js +16 -28
  110. package/build-module/dom/get-offset-parent.js.map +7 -1
  111. package/build-module/dom/get-range-height.js +7 -15
  112. package/build-module/dom/get-range-height.js.map +7 -1
  113. package/build-module/dom/get-rectangle-from-range.js +30 -65
  114. package/build-module/dom/get-rectangle-from-range.js.map +7 -1
  115. package/build-module/dom/get-scroll-container.js +16 -32
  116. package/build-module/dom/get-scroll-container.js.map +7 -1
  117. package/build-module/dom/hidden-caret-range-from-point.js +11 -28
  118. package/build-module/dom/hidden-caret-range-from-point.js.map +7 -1
  119. package/build-module/dom/index.js +57 -28
  120. package/build-module/dom/index.js.map +7 -1
  121. package/build-module/dom/input-field-has-uncollapsed-selection.js +12 -37
  122. package/build-module/dom/input-field-has-uncollapsed-selection.js.map +7 -1
  123. package/build-module/dom/insert-after.js +7 -16
  124. package/build-module/dom/insert-after.js.map +7 -1
  125. package/build-module/dom/is-edge.js +24 -57
  126. package/build-module/dom/is-edge.js.map +7 -1
  127. package/build-module/dom/is-element.js +5 -8
  128. package/build-module/dom/is-element.js.map +7 -1
  129. package/build-module/dom/is-empty.js +10 -14
  130. package/build-module/dom/is-empty.js.map +7 -1
  131. package/build-module/dom/is-entirely-selected.js +18 -45
  132. package/build-module/dom/is-entirely-selected.js.map +7 -1
  133. package/build-module/dom/is-form-element.js +8 -19
  134. package/build-module/dom/is-form-element.js.map +7 -1
  135. package/build-module/dom/is-horizontal-edge.js +6 -15
  136. package/build-module/dom/is-horizontal-edge.js.map +7 -1
  137. package/build-module/dom/is-html-input-element.js +6 -9
  138. package/build-module/dom/is-html-input-element.js.map +7 -1
  139. package/build-module/dom/is-input-or-text-area.js +6 -9
  140. package/build-module/dom/is-input-or-text-area.js.map +7 -1
  141. package/build-module/dom/is-number-input.js +11 -25
  142. package/build-module/dom/is-number-input.js.map +7 -1
  143. package/build-module/dom/is-rtl.js +7 -15
  144. package/build-module/dom/is-rtl.js.map +7 -1
  145. package/build-module/dom/is-selection-forward.js +9 -37
  146. package/build-module/dom/is-selection-forward.js.map +7 -1
  147. package/build-module/dom/is-text-field.js +22 -20
  148. package/build-module/dom/is-text-field.js.map +7 -1
  149. package/build-module/dom/is-vertical-edge.js +6 -15
  150. package/build-module/dom/is-vertical-edge.js.map +7 -1
  151. package/build-module/dom/place-caret-at-edge.js +22 -48
  152. package/build-module/dom/place-caret-at-edge.js.map +7 -1
  153. package/build-module/dom/place-caret-at-horizontal-edge.js +7 -14
  154. package/build-module/dom/place-caret-at-horizontal-edge.js.map +7 -1
  155. package/build-module/dom/place-caret-at-vertical-edge.js +6 -14
  156. package/build-module/dom/place-caret-at-vertical-edge.js.map +7 -1
  157. package/build-module/dom/remove-invalid-html.js +7 -17
  158. package/build-module/dom/remove-invalid-html.js.map +7 -1
  159. package/build-module/dom/remove.js +7 -14
  160. package/build-module/dom/remove.js.map +7 -1
  161. package/build-module/dom/replace-tag.js +7 -16
  162. package/build-module/dom/replace-tag.js.map +7 -1
  163. package/build-module/dom/replace.js +9 -17
  164. package/build-module/dom/replace.js.map +7 -1
  165. package/build-module/dom/safe-html.js +11 -23
  166. package/build-module/dom/safe-html.js.map +7 -1
  167. package/build-module/dom/scroll-if-no-range.js +5 -15
  168. package/build-module/dom/scroll-if-no-range.js.map +7 -1
  169. package/build-module/dom/strip-html.js +8 -18
  170. package/build-module/dom/strip-html.js.map +7 -1
  171. package/build-module/dom/unwrap.js +7 -15
  172. package/build-module/dom/unwrap.js.map +7 -1
  173. package/build-module/dom/wrap.js +7 -14
  174. package/build-module/dom/wrap.js.map +7 -1
  175. package/build-module/focusable.js +30 -81
  176. package/build-module/focusable.js.map +7 -1
  177. package/build-module/index.js +9 -17
  178. package/build-module/index.js.map +7 -1
  179. package/build-module/phrasing-content.js +67 -125
  180. package/build-module/phrasing-content.js.map +7 -1
  181. package/build-module/tabbable.js +30 -133
  182. package/build-module/tabbable.js.map +7 -1
  183. package/build-module/utils/assert-is-defined.js +9 -4
  184. package/build-module/utils/assert-is-defined.js.map +7 -1
  185. package/package.json +11 -4
@@ -1 +1,7 @@
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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dom/is-entirely-selected.js"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,+BAAgC;AAChC,mCAA8B;AAUf,SAAR,mBAAqC,SAAU;AACrD,UAAK,6BAAAA,SAAmB,OAAQ,GAAI;AACnC,WACC,QAAQ,mBAAmB,KAC3B,QAAQ,MAAM,WAAW,QAAQ;AAAA,EAEnC;AAEA,MAAK,CAAE,QAAQ,mBAAoB;AAClC,WAAO;AAAA,EACR;AAEA,QAAM,EAAE,cAAc,IAAI;AAC1B,QAAM,EAAE,YAAY,IAAI;AACxB,gDAAiB,aAAa,aAAc;AAC5C,QAAM,YAAY,YAAY,aAAa;AAC3C,gDAAiB,WAAW,WAAY;AACxC,QAAM,QAAQ,UAAU,aAAa,UAAU,WAAY,CAAE,IAAI;AAEjE,MAAK,CAAE,OAAQ;AACd,WAAO;AAAA,EACR;AAEA,QAAM,EAAE,gBAAgB,cAAc,aAAa,UAAU,IAAI;AAEjE,MACC,mBAAmB,WACnB,iBAAiB,WACjB,gBAAgB,KAChB,cAAc,QAAQ,WAAW,QAChC;AACD,WAAO;AAAA,EACR;AAEA,QAAM,YAAY,QAAQ;AAC1B,gDAAiB,WAAW,WAAY;AACxC,QAAM,4BACL,aAAa,aAAa,aAAa;AAAA;AAAA,IACd,aAAe,KAAK;AAAA,MAC1C,aAAa,WAAW;AAE5B,SACC,YAAa,gBAAgB,SAAS,YAAa,KACnD,YAAa,cAAc,SAAS,WAAY,KAChD,gBAAgB,KAChB,cAAc;AAEhB;AAYA,SAAS,YAAa,OAAO,WAAW,UAAW;AAElD,MAAI,YAAY;AAChB,KAAG;AACF,QAAK,UAAU,WAAY;AAC1B,aAAO;AAAA,IACR;AACA,gBAAY,UAAW,QAAS;AAAA,EACjC,SAAU;AACV,SAAO;AACR;",
6
+ "names": ["isInputOrTextArea"]
7
+ }
@@ -1,31 +1,43 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var is_form_element_exports = {};
30
+ __export(is_form_element_exports, {
31
+ default: () => isFormElement
6
32
  });
7
- exports.default = isFormElement;
8
- var _isInputOrTextArea = _interopRequireDefault(require("./is-input-or-text-area"));
9
- /**
10
- * Internal dependencies
11
- */
12
-
13
- /**
14
- *
15
- * Detects if element is a form element.
16
- *
17
- * @param {Element} element The element to check.
18
- *
19
- * @return {boolean} True if form element and false otherwise.
20
- */
33
+ module.exports = __toCommonJS(is_form_element_exports);
34
+ var import_is_input_or_text_area = __toESM(require("./is-input-or-text-area"));
21
35
  function isFormElement(element) {
22
36
  if (!element) {
23
37
  return false;
24
38
  }
25
- const {
26
- tagName
27
- } = element;
28
- const checkForInputTextarea = (0, _isInputOrTextArea.default)(element);
29
- return checkForInputTextarea || tagName === 'BUTTON' || tagName === 'SELECT';
39
+ const { tagName } = element;
40
+ const checkForInputTextarea = (0, import_is_input_or_text_area.default)(element);
41
+ return checkForInputTextarea || tagName === "BUTTON" || tagName === "SELECT";
30
42
  }
31
- //# sourceMappingURL=is-form-element.js.map
43
+ //# sourceMappingURL=is-form-element.js.map
@@ -1 +1,7 @@
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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dom/is-form-element.js"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mCAA8B;AAUf,SAAR,cAAgC,SAAU;AAChD,MAAK,CAAE,SAAU;AAChB,WAAO;AAAA,EACR;AAEA,QAAM,EAAE,QAAQ,IAAI;AACpB,QAAM,4BAAwB,6BAAAA,SAAmB,OAAQ;AACzD,SACC,yBAAyB,YAAY,YAAY,YAAY;AAE/D;",
6
+ "names": ["isInputOrTextArea"]
7
+ }
@@ -1,24 +1,38 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var is_horizontal_edge_exports = {};
30
+ __export(is_horizontal_edge_exports, {
31
+ default: () => isHorizontalEdge
6
32
  });
7
- exports.default = isHorizontalEdge;
8
- var _isEdge = _interopRequireDefault(require("./is-edge"));
9
- /**
10
- * Internal dependencies
11
- */
12
-
13
- /**
14
- * Check whether the selection is horizontally at the edge of the container.
15
- *
16
- * @param {HTMLElement} container Focusable element.
17
- * @param {boolean} isReverse Set to true to check left, false for right.
18
- *
19
- * @return {boolean} True if at the horizontal edge, false if not.
20
- */
33
+ module.exports = __toCommonJS(is_horizontal_edge_exports);
34
+ var import_is_edge = __toESM(require("./is-edge"));
21
35
  function isHorizontalEdge(container, isReverse) {
22
- return (0, _isEdge.default)(container, isReverse);
36
+ return (0, import_is_edge.default)(container, isReverse);
23
37
  }
24
- //# sourceMappingURL=is-horizontal-edge.js.map
38
+ //# sourceMappingURL=is-horizontal-edge.js.map
@@ -1 +1,7 @@
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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dom/is-horizontal-edge.js"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAmB;AAUJ,SAAR,iBAAmC,WAAW,WAAY;AAChE,aAAO,eAAAA,SAAQ,WAAW,SAAU;AACrC;",
6
+ "names": ["isEdge"]
7
+ }
@@ -1,16 +1,27 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var is_html_input_element_exports = {};
20
+ __export(is_html_input_element_exports, {
21
+ default: () => isHTMLInputElement
5
22
  });
6
- exports.default = isHTMLInputElement;
7
- /* eslint-disable jsdoc/valid-types */
8
- /**
9
- * @param {Node} node
10
- * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.
11
- */
23
+ module.exports = __toCommonJS(is_html_input_element_exports);
12
24
  function isHTMLInputElement(node) {
13
- /* eslint-enable jsdoc/valid-types */
14
- return node?.nodeName === 'INPUT';
25
+ return node?.nodeName === "INPUT";
15
26
  }
16
- //# sourceMappingURL=is-html-input-element.js.map
27
+ //# sourceMappingURL=is-html-input-element.js.map
@@ -1 +1,7 @@
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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dom/is-html-input-element.js"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKe,SAAR,mBAAqC,MAAO;AAElD,SAAO,MAAM,aAAa;AAC3B;",
6
+ "names": []
7
+ }
@@ -1,16 +1,27 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var is_input_or_text_area_exports = {};
20
+ __export(is_input_or_text_area_exports, {
21
+ default: () => isInputOrTextArea
5
22
  });
6
- exports.default = isInputOrTextArea;
7
- /* eslint-disable jsdoc/valid-types */
8
- /**
9
- * @param {Element} element
10
- * @return {element is HTMLInputElement | HTMLTextAreaElement} Whether the element is an input or textarea
11
- */
23
+ module.exports = __toCommonJS(is_input_or_text_area_exports);
12
24
  function isInputOrTextArea(element) {
13
- /* eslint-enable jsdoc/valid-types */
14
- return element.tagName === 'INPUT' || element.tagName === 'TEXTAREA';
25
+ return element.tagName === "INPUT" || element.tagName === "TEXTAREA";
15
26
  }
16
- //# sourceMappingURL=is-input-or-text-area.js.map
27
+ //# sourceMappingURL=is-input-or-text-area.js.map
@@ -1 +1,7 @@
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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dom/is-input-or-text-area.js"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKe,SAAR,kBAAoC,SAAU;AAEpD,SAAO,QAAQ,YAAY,WAAW,QAAQ,YAAY;AAC3D;",
6
+ "names": []
7
+ }
@@ -1,34 +1,43 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var is_number_input_exports = {};
30
+ __export(is_number_input_exports, {
31
+ default: () => isNumberInput
6
32
  });
7
- exports.default = isNumberInput;
8
- var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
9
- var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-element"));
10
- /**
11
- * WordPress dependencies
12
- */
13
-
14
- /**
15
- * Internal dependencies
16
- */
17
-
18
- /* eslint-disable jsdoc/valid-types */
19
- /**
20
- * Check whether the given element is an input field of type number.
21
- *
22
- * @param {Node} node The HTML node.
23
- *
24
- * @return {node is HTMLInputElement} True if the node is number input.
25
- */
33
+ module.exports = __toCommonJS(is_number_input_exports);
34
+ var import_deprecated = __toESM(require("@wordpress/deprecated"));
35
+ var import_is_html_input_element = __toESM(require("./is-html-input-element"));
26
36
  function isNumberInput(node) {
27
- (0, _deprecated.default)('wp.dom.isNumberInput', {
28
- since: '6.1',
29
- version: '6.5'
37
+ (0, import_deprecated.default)("wp.dom.isNumberInput", {
38
+ since: "6.1",
39
+ version: "6.5"
30
40
  });
31
- /* eslint-enable jsdoc/valid-types */
32
- return (0, _isHtmlInputElement.default)(node) && node.type === 'number' && !isNaN(node.valueAsNumber);
41
+ return (0, import_is_html_input_element.default)(node) && node.type === "number" && !isNaN(node.valueAsNumber);
33
42
  }
34
- //# sourceMappingURL=is-number-input.js.map
43
+ //# sourceMappingURL=is-number-input.js.map
@@ -1 +1,7 @@
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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dom/is-number-input.js"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAAuB;AAKvB,mCAA+B;AAUhB,SAAR,cAAgC,MAAO;AAC7C,wBAAAA,SAAY,wBAAwB;AAAA,IACnC,OAAO;AAAA,IACP,SAAS;AAAA,EACV,CAAE;AAEF,aACC,6BAAAC,SAAoB,IAAK,KACzB,KAAK,SAAS,YACd,CAAE,MAAO,KAAK,aAAc;AAE9B;",
6
+ "names": ["deprecated", "isHTMLInputElement"]
7
+ }
@@ -1,23 +1,38 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var is_rtl_exports = {};
30
+ __export(is_rtl_exports, {
31
+ default: () => isRTL
6
32
  });
7
- exports.default = isRTL;
8
- var _getComputedStyle = _interopRequireDefault(require("./get-computed-style"));
9
- /**
10
- * Internal dependencies
11
- */
12
-
13
- /**
14
- * Whether the element's text direction is right-to-left.
15
- *
16
- * @param {Element} element The element to check.
17
- *
18
- * @return {boolean} True if rtl, false if ltr.
19
- */
33
+ module.exports = __toCommonJS(is_rtl_exports);
34
+ var import_get_computed_style = __toESM(require("./get-computed-style"));
20
35
  function isRTL(element) {
21
- return (0, _getComputedStyle.default)(element).direction === 'rtl';
36
+ return (0, import_get_computed_style.default)(element).direction === "rtl";
22
37
  }
23
- //# sourceMappingURL=is-rtl.js.map
38
+ //# sourceMappingURL=is-rtl.js.map
@@ -1 +1,7 @@
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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dom/is-rtl.js"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gCAA6B;AASd,SAAR,MAAwB,SAAU;AACxC,aAAO,0BAAAA,SAAkB,OAAQ,EAAE,cAAc;AAClD;",
6
+ "names": ["getComputedStyle"]
7
+ }
@@ -1,55 +1,41 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var is_selection_forward_exports = {};
20
+ __export(is_selection_forward_exports, {
21
+ default: () => isSelectionForward
5
22
  });
6
- exports.default = isSelectionForward;
7
- var _assertIsDefined = require("../utils/assert-is-defined");
8
- /**
9
- * Internal dependencies
10
- */
11
-
12
- /**
13
- * Returns true if the given selection object is in the forward direction, or
14
- * false otherwise.
15
- *
16
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
17
- *
18
- * @param {Selection} selection Selection object to check.
19
- *
20
- * @return {boolean} Whether the selection is forward.
21
- */
23
+ module.exports = __toCommonJS(is_selection_forward_exports);
24
+ var import_assert_is_defined = require("../utils/assert-is-defined");
22
25
  function isSelectionForward(selection) {
23
- const {
24
- anchorNode,
25
- focusNode,
26
- anchorOffset,
27
- focusOffset
28
- } = selection;
29
- (0, _assertIsDefined.assertIsDefined)(anchorNode, 'anchorNode');
30
- (0, _assertIsDefined.assertIsDefined)(focusNode, 'focusNode');
26
+ const { anchorNode, focusNode, anchorOffset, focusOffset } = selection;
27
+ (0, import_assert_is_defined.assertIsDefined)(anchorNode, "anchorNode");
28
+ (0, import_assert_is_defined.assertIsDefined)(focusNode, "focusNode");
31
29
  const position = anchorNode.compareDocumentPosition(focusNode);
32
-
33
- // Disable reason: `Node#compareDocumentPosition` returns a bitmask value,
34
- // so bitwise operators are intended.
35
- /* eslint-disable no-bitwise */
36
- // Compare whether anchor node precedes focus node. If focus node (where
37
- // end of selection occurs) is after the anchor node, it is forward.
38
30
  if (position & anchorNode.DOCUMENT_POSITION_PRECEDING) {
39
31
  return false;
40
32
  }
41
33
  if (position & anchorNode.DOCUMENT_POSITION_FOLLOWING) {
42
34
  return true;
43
35
  }
44
- /* eslint-enable no-bitwise */
45
-
46
- // `compareDocumentPosition` returns 0 when passed the same node, in which
47
- // case compare offsets.
48
36
  if (position === 0) {
49
37
  return anchorOffset <= focusOffset;
50
38
  }
51
-
52
- // This should never be reached, but return true as default case.
53
39
  return true;
54
40
  }
55
- //# sourceMappingURL=is-selection-forward.js.map
41
+ //# sourceMappingURL=is-selection-forward.js.map
@@ -1 +1,7 @@
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","ignoreList":[]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dom/is-selection-forward.js"],
4
+ "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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,+BAAgC;AAYjB,SAAR,mBAAqC,WAAY;AACvD,QAAM,EAAE,YAAY,WAAW,cAAc,YAAY,IAAI;AAE7D,gDAAiB,YAAY,YAAa;AAC1C,gDAAiB,WAAW,WAAY;AACxC,QAAM,WAAW,WAAW,wBAAyB,SAAU;AAO/D,MAAK,WAAW,WAAW,6BAA8B;AACxD,WAAO;AAAA,EACR;AAEA,MAAK,WAAW,WAAW,6BAA8B;AACxD,WAAO;AAAA,EACR;AAKA,MAAK,aAAa,GAAI;AACrB,WAAO,gBAAgB;AAAA,EACxB;AAGA,SAAO;AACR;",
6
+ "names": []
7
+ }
@@ -1,28 +1,53 @@
1
1
  "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var is_text_field_exports = {};
30
+ __export(is_text_field_exports, {
31
+ default: () => isTextField
6
32
  });
7
- exports.default = isTextField;
8
- var _isHtmlInputElement = _interopRequireDefault(require("./is-html-input-element"));
9
- /**
10
- * Internal dependencies
11
- */
12
-
13
- /* eslint-disable jsdoc/valid-types */
14
- /**
15
- * Check whether the given element is a text field, where text field is defined
16
- * by the ability to select within the input, or that it is contenteditable.
17
- *
18
- * See: https://html.spec.whatwg.org/#textFieldSelection
19
- *
20
- * @param {Node} node The HTML element.
21
- * @return {node is HTMLElement} True if the element is an text field, false if not.
22
- */
33
+ module.exports = __toCommonJS(is_text_field_exports);
34
+ var import_is_html_input_element = __toESM(require("./is-html-input-element"));
23
35
  function isTextField(node) {
24
- /* eslint-enable jsdoc/valid-types */
25
- const nonTextInputs = ['button', 'checkbox', 'hidden', 'file', 'radio', 'image', 'range', 'reset', 'submit', 'number', 'email', 'time'];
26
- return (0, _isHtmlInputElement.default)(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === 'TEXTAREA' || /** @type {HTMLElement} */node.contentEditable === 'true';
36
+ const nonTextInputs = [
37
+ "button",
38
+ "checkbox",
39
+ "hidden",
40
+ "file",
41
+ "radio",
42
+ "image",
43
+ "range",
44
+ "reset",
45
+ "submit",
46
+ "number",
47
+ "email",
48
+ "time"
49
+ ];
50
+ return (0, import_is_html_input_element.default)(node) && node.type && !nonTextInputs.includes(node.type) || node.nodeName === "TEXTAREA" || /** @type {HTMLElement} */
51
+ node.contentEditable === "true";
27
52
  }
28
- //# sourceMappingURL=is-text-field.js.map
53
+ //# sourceMappingURL=is-text-field.js.map