@wordpress/dom 4.57.0 → 5.0.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 (327) hide show
  1. package/README.md +22 -22
  2. package/build/data-transfer.cjs +1 -1
  3. package/build/data-transfer.cjs.map +3 -3
  4. package/build/dom/caret-range-from-point.cjs +1 -1
  5. package/build/dom/caret-range-from-point.cjs.map +3 -3
  6. package/build/dom/clean-node-list.cjs +1 -1
  7. package/build/dom/clean-node-list.cjs.map +3 -3
  8. package/build/dom/compute-caret-rect.cjs +1 -1
  9. package/build/dom/compute-caret-rect.cjs.map +3 -3
  10. package/build/dom/document-has-selection.cjs +1 -1
  11. package/build/dom/document-has-selection.cjs.map +3 -3
  12. package/build/dom/document-has-text-selection.cjs +1 -1
  13. package/build/dom/document-has-text-selection.cjs.map +3 -3
  14. package/build/dom/document-has-uncollapsed-selection.cjs +1 -1
  15. package/build/dom/document-has-uncollapsed-selection.cjs.map +3 -3
  16. package/build/dom/get-computed-style.cjs +1 -1
  17. package/build/dom/get-computed-style.cjs.map +3 -3
  18. package/build/dom/get-offset-parent.cjs +7 -15
  19. package/build/dom/get-offset-parent.cjs.map +4 -4
  20. package/build/dom/get-range-height.cjs +1 -1
  21. package/build/dom/get-range-height.cjs.map +3 -3
  22. package/build/dom/get-rectangle-from-range.cjs +3 -8
  23. package/build/dom/get-rectangle-from-range.cjs.map +3 -3
  24. package/build/dom/get-scroll-container.cjs +2 -6
  25. package/build/dom/get-scroll-container.cjs.map +3 -3
  26. package/build/dom/hidden-caret-range-from-point.cjs +1 -1
  27. package/build/dom/hidden-caret-range-from-point.cjs.map +3 -3
  28. package/build/dom/index.cjs +1 -1
  29. package/build/dom/index.cjs.map +1 -1
  30. package/build/dom/input-field-has-uncollapsed-selection.cjs +2 -5
  31. package/build/dom/input-field-has-uncollapsed-selection.cjs.map +3 -3
  32. package/build/dom/insert-after.cjs +1 -1
  33. package/build/dom/insert-after.cjs.map +3 -3
  34. package/build/dom/is-edge.cjs +1 -1
  35. package/build/dom/is-edge.cjs.map +3 -3
  36. package/build/dom/is-element.cjs +1 -1
  37. package/build/dom/is-element.cjs.map +3 -3
  38. package/build/dom/is-empty.cjs +2 -5
  39. package/build/dom/is-empty.cjs.map +3 -3
  40. package/build/dom/is-entirely-selected.cjs +2 -5
  41. package/build/dom/is-entirely-selected.cjs.map +3 -3
  42. package/build/dom/is-form-element.cjs +1 -1
  43. package/build/dom/is-form-element.cjs.map +3 -3
  44. package/build/dom/is-horizontal-edge.cjs +1 -1
  45. package/build/dom/is-horizontal-edge.cjs.map +3 -3
  46. package/build/dom/is-html-input-element.cjs +1 -1
  47. package/build/dom/is-html-input-element.cjs.map +3 -3
  48. package/build/dom/is-input-or-text-area.cjs +1 -1
  49. package/build/dom/is-input-or-text-area.cjs.map +3 -3
  50. package/build/dom/is-number-input.cjs +1 -1
  51. package/build/dom/is-number-input.cjs.map +3 -3
  52. package/build/dom/is-rtl.cjs +1 -1
  53. package/build/dom/is-rtl.cjs.map +3 -3
  54. package/build/dom/is-selection-forward.cjs +1 -1
  55. package/build/dom/is-selection-forward.cjs.map +3 -3
  56. package/build/dom/is-text-field.cjs +2 -3
  57. package/build/dom/is-text-field.cjs.map +3 -3
  58. package/build/dom/is-vertical-edge.cjs +1 -1
  59. package/build/dom/is-vertical-edge.cjs.map +3 -3
  60. package/build/dom/place-caret-at-edge.cjs +1 -1
  61. package/build/dom/place-caret-at-edge.cjs.map +3 -3
  62. package/build/dom/place-caret-at-horizontal-edge.cjs +1 -1
  63. package/build/dom/place-caret-at-horizontal-edge.cjs.map +3 -3
  64. package/build/dom/place-caret-at-vertical-edge.cjs +1 -1
  65. package/build/dom/place-caret-at-vertical-edge.cjs.map +3 -3
  66. package/build/dom/remove-invalid-html.cjs +1 -1
  67. package/build/dom/remove-invalid-html.cjs.map +3 -3
  68. package/build/dom/remove.cjs +1 -1
  69. package/build/dom/remove.cjs.map +3 -3
  70. package/build/dom/replace-tag.cjs +1 -1
  71. package/build/dom/replace-tag.cjs.map +3 -3
  72. package/build/dom/replace.cjs +1 -1
  73. package/build/dom/replace.cjs.map +3 -3
  74. package/build/dom/safe-html.cjs +1 -1
  75. package/build/dom/safe-html.cjs.map +3 -3
  76. package/build/dom/scroll-if-no-range.cjs +1 -1
  77. package/build/dom/scroll-if-no-range.cjs.map +3 -3
  78. package/build/dom/strip-html.cjs +1 -1
  79. package/build/dom/strip-html.cjs.map +3 -3
  80. package/build/dom/types.cjs +19 -0
  81. package/build/dom/types.cjs.map +7 -0
  82. package/build/dom/unwrap.cjs +1 -1
  83. package/build/dom/unwrap.cjs.map +3 -3
  84. package/build/dom/wrap.cjs +1 -1
  85. package/build/dom/wrap.cjs.map +3 -3
  86. package/build/focusable.cjs +5 -6
  87. package/build/focusable.cjs.map +3 -3
  88. package/build/index.cjs +1 -1
  89. package/build/index.cjs.map +2 -2
  90. package/build/phrasing-content.cjs +1 -1
  91. package/build/phrasing-content.cjs.map +3 -3
  92. package/build/tabbable.cjs +1 -1
  93. package/build/tabbable.cjs.map +3 -3
  94. package/build/types.cjs +19 -0
  95. package/build/types.cjs.map +7 -0
  96. package/build-module/data-transfer.mjs +1 -1
  97. package/build-module/data-transfer.mjs.map +3 -3
  98. package/build-module/dom/caret-range-from-point.mjs +1 -1
  99. package/build-module/dom/caret-range-from-point.mjs.map +3 -3
  100. package/build-module/dom/clean-node-list.mjs +1 -1
  101. package/build-module/dom/clean-node-list.mjs.map +3 -3
  102. package/build-module/dom/compute-caret-rect.mjs +1 -1
  103. package/build-module/dom/compute-caret-rect.mjs.map +3 -3
  104. package/build-module/dom/document-has-selection.mjs +1 -1
  105. package/build-module/dom/document-has-selection.mjs.map +3 -3
  106. package/build-module/dom/document-has-text-selection.mjs +1 -1
  107. package/build-module/dom/document-has-text-selection.mjs.map +3 -3
  108. package/build-module/dom/document-has-uncollapsed-selection.mjs +1 -1
  109. package/build-module/dom/document-has-uncollapsed-selection.mjs.map +3 -3
  110. package/build-module/dom/get-computed-style.mjs +1 -1
  111. package/build-module/dom/get-computed-style.mjs.map +3 -3
  112. package/build-module/dom/get-offset-parent.mjs +7 -15
  113. package/build-module/dom/get-offset-parent.mjs.map +3 -3
  114. package/build-module/dom/get-range-height.mjs +1 -1
  115. package/build-module/dom/get-range-height.mjs.map +3 -3
  116. package/build-module/dom/get-rectangle-from-range.mjs +3 -8
  117. package/build-module/dom/get-rectangle-from-range.mjs.map +3 -3
  118. package/build-module/dom/get-scroll-container.mjs +2 -6
  119. package/build-module/dom/get-scroll-container.mjs.map +3 -3
  120. package/build-module/dom/hidden-caret-range-from-point.mjs +1 -1
  121. package/build-module/dom/hidden-caret-range-from-point.mjs.map +3 -3
  122. package/build-module/dom/index.mjs +1 -1
  123. package/build-module/dom/index.mjs.map +1 -1
  124. package/build-module/dom/input-field-has-uncollapsed-selection.mjs +2 -5
  125. package/build-module/dom/input-field-has-uncollapsed-selection.mjs.map +3 -3
  126. package/build-module/dom/insert-after.mjs +1 -1
  127. package/build-module/dom/insert-after.mjs.map +3 -3
  128. package/build-module/dom/is-edge.mjs +1 -1
  129. package/build-module/dom/is-edge.mjs.map +3 -3
  130. package/build-module/dom/is-element.mjs +1 -1
  131. package/build-module/dom/is-element.mjs.map +3 -3
  132. package/build-module/dom/is-empty.mjs +2 -5
  133. package/build-module/dom/is-empty.mjs.map +3 -3
  134. package/build-module/dom/is-entirely-selected.mjs +2 -5
  135. package/build-module/dom/is-entirely-selected.mjs.map +3 -3
  136. package/build-module/dom/is-form-element.mjs +1 -1
  137. package/build-module/dom/is-form-element.mjs.map +3 -3
  138. package/build-module/dom/is-horizontal-edge.mjs +1 -1
  139. package/build-module/dom/is-horizontal-edge.mjs.map +3 -3
  140. package/build-module/dom/is-html-input-element.mjs +1 -1
  141. package/build-module/dom/is-html-input-element.mjs.map +3 -3
  142. package/build-module/dom/is-input-or-text-area.mjs +1 -1
  143. package/build-module/dom/is-input-or-text-area.mjs.map +3 -3
  144. package/build-module/dom/is-number-input.mjs +1 -1
  145. package/build-module/dom/is-number-input.mjs.map +3 -3
  146. package/build-module/dom/is-rtl.mjs +1 -1
  147. package/build-module/dom/is-rtl.mjs.map +3 -3
  148. package/build-module/dom/is-selection-forward.mjs +1 -1
  149. package/build-module/dom/is-selection-forward.mjs.map +3 -3
  150. package/build-module/dom/is-text-field.mjs +2 -3
  151. package/build-module/dom/is-text-field.mjs.map +3 -3
  152. package/build-module/dom/is-vertical-edge.mjs +1 -1
  153. package/build-module/dom/is-vertical-edge.mjs.map +3 -3
  154. package/build-module/dom/place-caret-at-edge.mjs +1 -1
  155. package/build-module/dom/place-caret-at-edge.mjs.map +3 -3
  156. package/build-module/dom/place-caret-at-horizontal-edge.mjs +1 -1
  157. package/build-module/dom/place-caret-at-horizontal-edge.mjs.map +3 -3
  158. package/build-module/dom/place-caret-at-vertical-edge.mjs +1 -1
  159. package/build-module/dom/place-caret-at-vertical-edge.mjs.map +3 -3
  160. package/build-module/dom/remove-invalid-html.mjs +1 -1
  161. package/build-module/dom/remove-invalid-html.mjs.map +3 -3
  162. package/build-module/dom/remove.mjs +1 -1
  163. package/build-module/dom/remove.mjs.map +3 -3
  164. package/build-module/dom/replace-tag.mjs +1 -1
  165. package/build-module/dom/replace-tag.mjs.map +3 -3
  166. package/build-module/dom/replace.mjs +1 -1
  167. package/build-module/dom/replace.mjs.map +3 -3
  168. package/build-module/dom/safe-html.mjs +1 -1
  169. package/build-module/dom/safe-html.mjs.map +3 -3
  170. package/build-module/dom/scroll-if-no-range.mjs +1 -1
  171. package/build-module/dom/scroll-if-no-range.mjs.map +3 -3
  172. package/build-module/dom/strip-html.mjs +1 -1
  173. package/build-module/dom/strip-html.mjs.map +3 -3
  174. package/build-module/dom/types.mjs +1 -0
  175. package/build-module/dom/types.mjs.map +7 -0
  176. package/build-module/dom/unwrap.mjs +1 -1
  177. package/build-module/dom/unwrap.mjs.map +3 -3
  178. package/build-module/dom/wrap.mjs +1 -1
  179. package/build-module/dom/wrap.mjs.map +3 -3
  180. package/build-module/focusable.mjs +5 -6
  181. package/build-module/focusable.mjs.map +3 -3
  182. package/build-module/index.mjs +1 -1
  183. package/build-module/index.mjs.map +2 -2
  184. package/build-module/phrasing-content.mjs +1 -1
  185. package/build-module/phrasing-content.mjs.map +3 -3
  186. package/build-module/tabbable.mjs +1 -1
  187. package/build-module/tabbable.mjs.map +3 -3
  188. package/build-module/types.mjs +1 -0
  189. package/build-module/types.mjs.map +7 -0
  190. package/build-types/data-transfer.d.ts +2 -2
  191. package/build-types/data-transfer.d.ts.map +1 -1
  192. package/build-types/dom/caret-range-from-point.d.ts +4 -4
  193. package/build-types/dom/caret-range-from-point.d.ts.map +1 -1
  194. package/build-types/dom/clean-node-list.d.ts +5 -45
  195. package/build-types/dom/clean-node-list.d.ts.map +1 -1
  196. package/build-types/dom/compute-caret-rect.d.ts +2 -2
  197. package/build-types/dom/compute-caret-rect.d.ts.map +1 -1
  198. package/build-types/dom/document-has-selection.d.ts +2 -2
  199. package/build-types/dom/document-has-selection.d.ts.map +1 -1
  200. package/build-types/dom/document-has-text-selection.d.ts +2 -2
  201. package/build-types/dom/document-has-text-selection.d.ts.map +1 -1
  202. package/build-types/dom/document-has-uncollapsed-selection.d.ts +2 -2
  203. package/build-types/dom/document-has-uncollapsed-selection.d.ts.map +1 -1
  204. package/build-types/dom/get-computed-style.d.ts +3 -3
  205. package/build-types/dom/get-computed-style.d.ts.map +1 -1
  206. package/build-types/dom/get-offset-parent.d.ts +2 -2
  207. package/build-types/dom/get-offset-parent.d.ts.map +1 -1
  208. package/build-types/dom/get-range-height.d.ts +2 -2
  209. package/build-types/dom/get-range-height.d.ts.map +1 -1
  210. package/build-types/dom/get-rectangle-from-range.d.ts +2 -2
  211. package/build-types/dom/get-rectangle-from-range.d.ts.map +1 -1
  212. package/build-types/dom/get-scroll-container.d.ts +5 -5
  213. package/build-types/dom/get-scroll-container.d.ts.map +1 -1
  214. package/build-types/dom/hidden-caret-range-from-point.d.ts +5 -5
  215. package/build-types/dom/hidden-caret-range-from-point.d.ts.map +1 -1
  216. package/build-types/dom/index.d.ts.map +1 -1
  217. package/build-types/dom/input-field-has-uncollapsed-selection.d.ts +2 -2
  218. package/build-types/dom/input-field-has-uncollapsed-selection.d.ts.map +1 -1
  219. package/build-types/dom/insert-after.d.ts +2 -3
  220. package/build-types/dom/insert-after.d.ts.map +1 -1
  221. package/build-types/dom/is-edge.d.ts +4 -4
  222. package/build-types/dom/is-edge.d.ts.map +1 -1
  223. package/build-types/dom/is-element.d.ts.map +1 -1
  224. package/build-types/dom/is-empty.d.ts +3 -3
  225. package/build-types/dom/is-empty.d.ts.map +1 -1
  226. package/build-types/dom/is-entirely-selected.d.ts +2 -2
  227. package/build-types/dom/is-entirely-selected.d.ts.map +1 -1
  228. package/build-types/dom/is-form-element.d.ts +3 -3
  229. package/build-types/dom/is-form-element.d.ts.map +1 -1
  230. package/build-types/dom/is-horizontal-edge.d.ts.map +1 -1
  231. package/build-types/dom/is-html-input-element.d.ts +1 -1
  232. package/build-types/dom/is-html-input-element.d.ts.map +1 -1
  233. package/build-types/dom/is-input-or-text-area.d.ts.map +1 -1
  234. package/build-types/dom/is-number-input.d.ts +2 -2
  235. package/build-types/dom/is-number-input.d.ts.map +1 -1
  236. package/build-types/dom/is-rtl.d.ts +2 -2
  237. package/build-types/dom/is-rtl.d.ts.map +1 -1
  238. package/build-types/dom/is-selection-forward.d.ts +2 -2
  239. package/build-types/dom/is-selection-forward.d.ts.map +1 -1
  240. package/build-types/dom/is-text-field.d.ts +2 -2
  241. package/build-types/dom/is-text-field.d.ts.map +1 -1
  242. package/build-types/dom/is-vertical-edge.d.ts.map +1 -1
  243. package/build-types/dom/place-caret-at-edge.d.ts +3 -3
  244. package/build-types/dom/place-caret-at-edge.d.ts.map +1 -1
  245. package/build-types/dom/place-caret-at-horizontal-edge.d.ts.map +1 -1
  246. package/build-types/dom/place-caret-at-vertical-edge.d.ts.map +1 -1
  247. package/build-types/dom/remove-invalid-html.d.ts +5 -4
  248. package/build-types/dom/remove-invalid-html.d.ts.map +1 -1
  249. package/build-types/dom/remove.d.ts +1 -2
  250. package/build-types/dom/remove.d.ts.map +1 -1
  251. package/build-types/dom/replace-tag.d.ts +3 -3
  252. package/build-types/dom/replace-tag.d.ts.map +1 -1
  253. package/build-types/dom/replace.d.ts +2 -3
  254. package/build-types/dom/replace.d.ts.map +1 -1
  255. package/build-types/dom/safe-html.d.ts +2 -2
  256. package/build-types/dom/safe-html.d.ts.map +1 -1
  257. package/build-types/dom/scroll-if-no-range.d.ts +5 -5
  258. package/build-types/dom/scroll-if-no-range.d.ts.map +1 -1
  259. package/build-types/dom/strip-html.d.ts +2 -2
  260. package/build-types/dom/strip-html.d.ts.map +1 -1
  261. package/build-types/dom/types.d.ts +32 -0
  262. package/build-types/dom/types.d.ts.map +1 -0
  263. package/build-types/dom/unwrap.d.ts +1 -3
  264. package/build-types/dom/unwrap.d.ts.map +1 -1
  265. package/build-types/dom/wrap.d.ts +2 -2
  266. package/build-types/dom/wrap.d.ts.map +1 -1
  267. package/build-types/focusable.d.ts +11 -30
  268. package/build-types/focusable.d.ts.map +1 -1
  269. package/build-types/index.d.ts +17 -0
  270. package/build-types/index.d.ts.map +1 -1
  271. package/build-types/phrasing-content.d.ts +9 -24
  272. package/build-types/phrasing-content.d.ts.map +1 -1
  273. package/build-types/tabbable.d.ts +10 -15
  274. package/build-types/tabbable.d.ts.map +1 -1
  275. package/build-types/types.d.ts +29 -0
  276. package/build-types/types.d.ts.map +1 -0
  277. package/package.json +5 -6
  278. package/src/{data-transfer.js → data-transfer.ts} +3 -3
  279. package/src/dom/{caret-range-from-point.js → caret-range-from-point.ts} +9 -5
  280. package/src/dom/{clean-node-list.js → clean-node-list.ts} +16 -24
  281. package/src/dom/{compute-caret-rect.js → compute-caret-rect.ts} +3 -3
  282. package/src/dom/{document-has-selection.js → document-has-selection.ts} +3 -3
  283. package/src/dom/{document-has-text-selection.js → document-has-text-selection.ts} +3 -3
  284. package/src/dom/{document-has-uncollapsed-selection.js → document-has-uncollapsed-selection.ts} +5 -3
  285. package/src/dom/{get-computed-style.js → get-computed-style.ts} +5 -3
  286. package/src/dom/{get-offset-parent.js → get-offset-parent.ts} +9 -14
  287. package/src/dom/{get-range-height.js → get-range-height.ts} +3 -3
  288. package/src/dom/{get-rectangle-from-range.js → get-rectangle-from-range.ts} +6 -12
  289. package/src/dom/{get-scroll-container.js → get-scroll-container.ts} +9 -9
  290. package/src/dom/{hidden-caret-range-from-point.js → hidden-caret-range-from-point.ts} +11 -6
  291. package/src/dom/{input-field-has-uncollapsed-selection.js → input-field-has-uncollapsed-selection.ts} +7 -5
  292. package/src/dom/{insert-after.js → insert-after.ts} +6 -4
  293. package/src/dom/{is-edge.js → is-edge.ts} +9 -5
  294. package/src/dom/{is-element.js → is-element.ts} +3 -1
  295. package/src/dom/{is-empty.js → is-empty.ts} +5 -7
  296. package/src/dom/{is-entirely-selected.js → is-entirely-selected.ts} +14 -11
  297. package/src/dom/{is-form-element.js → is-form-element.ts} +5 -3
  298. package/src/dom/{is-horizontal-edge.js → is-horizontal-edge.ts} +4 -1
  299. package/src/dom/{is-html-input-element.js → is-html-input-element.ts} +3 -1
  300. package/src/dom/{is-input-or-text-area.js → is-input-or-text-area.ts} +3 -1
  301. package/src/dom/{is-number-input.js → is-number-input.ts} +3 -3
  302. package/src/dom/{is-rtl.js → is-rtl.ts} +3 -3
  303. package/src/dom/{is-selection-forward.js → is-selection-forward.ts} +3 -3
  304. package/src/dom/{is-text-field.js → is-text-field.ts} +4 -4
  305. package/src/dom/{is-vertical-edge.js → is-vertical-edge.ts} +4 -1
  306. package/src/dom/{place-caret-at-edge.js → place-caret-at-edge.ts} +17 -9
  307. package/src/dom/{place-caret-at-horizontal-edge.js → place-caret-at-horizontal-edge.ts} +4 -1
  308. package/src/dom/{place-caret-at-vertical-edge.js → place-caret-at-vertical-edge.ts} +5 -1
  309. package/src/dom/{remove-invalid-html.js → remove-invalid-html.ts} +9 -4
  310. package/src/dom/{remove.js → remove.ts} +2 -3
  311. package/src/dom/{replace-tag.js → replace-tag.ts} +4 -4
  312. package/src/dom/{replace.js → replace.ts} +6 -4
  313. package/src/dom/{safe-html.js → safe-html.ts} +3 -3
  314. package/src/dom/{scroll-if-no-range.js → scroll-if-no-range.ts} +9 -5
  315. package/src/dom/{strip-html.js → strip-html.ts} +3 -3
  316. package/src/dom/types.ts +28 -0
  317. package/src/dom/{unwrap.js → unwrap.ts} +2 -4
  318. package/src/dom/{wrap.js → wrap.ts} +3 -3
  319. package/src/{focusable.js → focusable.ts} +34 -32
  320. package/src/index.ts +33 -0
  321. package/src/{phrasing-content.js → phrasing-content.ts} +15 -30
  322. package/src/{tabbable.js → tabbable.ts} +48 -39
  323. package/src/test/dom.jsdom.test.js +21 -0
  324. package/src/types.ts +32 -0
  325. package/CHANGELOG.md +0 -317
  326. package/src/index.js +0 -12
  327. /package/src/dom/{index.js → index.ts} +0 -0
@@ -2,9 +2,9 @@
2
2
  * Recursively checks if an element is empty. An element is not empty if it
3
3
  * contains text or contains elements with attributes such as images.
4
4
  *
5
- * @param {Element} element The element to check.
5
+ * @param element The element to check.
6
6
  *
7
- * @return {boolean} Whether or not the element is empty.
7
+ * @return Whether or not the element is empty.
8
8
  */
9
- export default function isEmpty(element: Element): boolean;
9
+ export default function isEmpty(element: Node): boolean;
10
10
  //# sourceMappingURL=is-empty.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-empty.d.ts","sourceRoot":"","sources":["../../src/dom/is-empty.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAE,OAAO,EAJ7B,OAI6B,GAF5B,OAAO,CAqBlB"}
1
+ {"version":3,"file":"is-empty.d.ts","sourceRoot":"","sources":["../../src/dom/is-empty.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAE,OAAO,EAAE,IAAI,GAAI,OAAO,CAiBxD"}
@@ -2,9 +2,9 @@
2
2
  * Check whether the contents of the element have been entirely selected.
3
3
  * Returns true if there is no possibility of selection.
4
4
  *
5
- * @param {HTMLElement} element The element to check.
5
+ * @param element The element to check.
6
6
  *
7
- * @return {boolean} True if entirely selected, false if not.
7
+ * @return True if entirely selected, false if not.
8
8
  */
9
9
  export default function isEntirelySelected(element: HTMLElement): boolean;
10
10
  //# sourceMappingURL=is-entirely-selected.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-entirely-selected.d.ts","sourceRoot":"","sources":["../../src/dom/is-entirely-selected.js"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,OAAO,EAJxC,WAIwC,GAFvC,OAAO,CAyDlB"}
1
+ {"version":3,"file":"is-entirely-selected.d.ts","sourceRoot":"","sources":["../../src/dom/is-entirely-selected.ts"],"names":[],"mappings":"AASA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,OAAO,EAAE,WAAW,GAAI,OAAO,CAuD1E"}
@@ -2,9 +2,9 @@
2
2
  *
3
3
  * Detects if element is a form element.
4
4
  *
5
- * @param {Element} element The element to check.
5
+ * @param element The element to check.
6
6
  *
7
- * @return {boolean} True if form element and false otherwise.
7
+ * @return True if form element and false otherwise.
8
8
  */
9
- export default function isFormElement(element: Element): boolean;
9
+ export default function isFormElement(element: Element | null | undefined): boolean;
10
10
  //# sourceMappingURL=is-form-element.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-form-element.d.ts","sourceRoot":"","sources":["../../src/dom/is-form-element.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAE,OAAO,EAJnC,OAImC,GAFlC,OAAO,CAYlB"}
1
+ {"version":3,"file":"is-form-element.d.ts","sourceRoot":"","sources":["../../src/dom/is-form-element.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACpC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,GACjC,OAAO,CAUT"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-horizontal-edge.d.ts","sourceRoot":"","sources":["../../src/dom/is-horizontal-edge.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAE,SAAS,EALxC,WAKwC,EAAE,SAAS,EAJnD,OAImD,GAFlD,OAAO,CAIlB"}
1
+ {"version":3,"file":"is-horizontal-edge.d.ts","sourceRoot":"","sources":["../../src/dom/is-horizontal-edge.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACvC,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,OAAO,GAChB,OAAO,CAET"}
@@ -2,5 +2,5 @@
2
2
  * @param {Node} node
3
3
  * @return {node is HTMLInputElement} Whether the node is an HTMLInputElement.
4
4
  */
5
- export default function isHTMLInputElement(node: Node): node is HTMLInputElement;
5
+ export default function isHTMLInputElement(node: Node | null | undefined): node is HTMLInputElement;
6
6
  //# sourceMappingURL=is-html-input-element.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-html-input-element.d.ts","sourceRoot":"","sources":["../../src/dom/is-html-input-element.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,IAAI,EAHrC,IAGqC,GAFpC,IAAI,IAAI,gBAAgB,CAInC"}
1
+ {"version":3,"file":"is-html-input-element.d.ts","sourceRoot":"","sources":["../../src/dom/is-html-input-element.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CACzC,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,SAAS,GAC3B,IAAI,IAAI,gBAAgB,CAE1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-input-or-text-area.d.ts","sourceRoot":"","sources":["../../src/dom/is-input-or-text-area.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAE,OAAO,EAHvC,OAGuC,GAFtC,OAAO,IAAI,gBAAgB,GAAG,mBAAmB,CAI5D"}
1
+ {"version":3,"file":"is-input-or-text-area.d.ts","sourceRoot":"","sources":["../../src/dom/is-input-or-text-area.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACxC,OAAO,EAAE,OAAO,GACd,OAAO,IAAI,gBAAgB,GAAG,mBAAmB,CAEnD"}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Check whether the given element is an input field of type number.
3
3
  *
4
- * @param {Node} node The HTML node.
4
+ * @param node The HTML node.
5
5
  *
6
- * @return {node is HTMLInputElement} True if the node is number input.
6
+ * @return True if the node is number input.
7
7
  */
8
8
  export default function isNumberInput(node: Node): node is HTMLInputElement;
9
9
  //# sourceMappingURL=is-number-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-number-input.d.ts","sourceRoot":"","sources":["../../src/dom/is-number-input.js"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAE,IAAI,EAJhC,IAIgC,GAF/B,IAAI,IAAI,gBAAgB,CAYnC"}
1
+ {"version":3,"file":"is-number-input.d.ts","sourceRoot":"","sources":["../../src/dom/is-number-input.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CAAE,IAAI,EAAE,IAAI,GAAI,IAAI,IAAI,gBAAgB,CAU5E"}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Whether the element's text direction is right-to-left.
3
3
  *
4
- * @param {Element} element The element to check.
4
+ * @param element The element to check.
5
5
  *
6
- * @return {boolean} True if rtl, false if ltr.
6
+ * @return True if rtl, false if ltr.
7
7
  */
8
8
  export default function isRTL(element: Element): boolean;
9
9
  //# sourceMappingURL=is-rtl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-rtl.d.ts","sourceRoot":"","sources":["../../src/dom/is-rtl.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAE,OAAO,EAJ3B,OAI2B,GAF1B,OAAO,CAIlB"}
1
+ {"version":3,"file":"is-rtl.d.ts","sourceRoot":"","sources":["../../src/dom/is-rtl.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAE,OAAO,EAAE,OAAO,GAAI,OAAO,CAEzD"}
@@ -4,9 +4,9 @@
4
4
  *
5
5
  * @see https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
6
6
  *
7
- * @param {Selection} selection Selection object to check.
7
+ * @param selection Selection object to check.
8
8
  *
9
- * @return {boolean} Whether the selection is forward.
9
+ * @return Whether the selection is forward.
10
10
  */
11
11
  export default function isSelectionForward(selection: Selection): boolean;
12
12
  //# sourceMappingURL=is-selection-forward.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-selection-forward.d.ts","sourceRoot":"","sources":["../../src/dom/is-selection-forward.js"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,SAAS,EAJ1C,SAI0C,GAFzC,OAAO,CA+BlB"}
1
+ {"version":3,"file":"is-selection-forward.d.ts","sourceRoot":"","sources":["../../src/dom/is-selection-forward.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,SAAS,EAAE,SAAS,GAAI,OAAO,CA6B1E"}
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * See: https://html.spec.whatwg.org/#textFieldSelection
6
6
  *
7
- * @param {Node} node The HTML element.
8
- * @return {node is HTMLElement} True if the element is an text field, false if not.
7
+ * @param node The HTML element.
8
+ * @return True if the element is an text field, false if not.
9
9
  */
10
10
  export default function isTextField(node: Node): node is HTMLElement;
11
11
  //# sourceMappingURL=is-text-field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-text-field.d.ts","sourceRoot":"","sources":["../../src/dom/is-text-field.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,IAAI,EAH9B,IAG8B,GAF7B,IAAI,IAAI,WAAW,CAwB9B"}
1
+ {"version":3,"file":"is-text-field.d.ts","sourceRoot":"","sources":["../../src/dom/is-text-field.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,CAAE,IAAI,EAAE,IAAI,GAAI,IAAI,IAAI,WAAW,CAsBrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"is-vertical-edge.d.ts","sourceRoot":"","sources":["../../src/dom/is-vertical-edge.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAE,SAAS,EALtC,WAKsC,EAAE,SAAS,EAJjD,OAIiD,GAFhD,OAAO,CAIlB"}
1
+ {"version":3,"file":"is-vertical-edge.d.ts","sourceRoot":"","sources":["../../src/dom/is-vertical-edge.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CACrC,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,OAAO,GAChB,OAAO,CAET"}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Places the caret at start or end of a given element.
3
3
  *
4
- * @param {HTMLElement} container Focusable element.
5
- * @param {boolean} isReverse True for end, false for start.
6
- * @param {number|undefined} x X coordinate to vertically position.
4
+ * @param container Focusable element.
5
+ * @param isReverse True for end, false for start.
6
+ * @param x X coordinate to vertically position.
7
7
  */
8
8
  export default function placeCaretAtEdge(container: HTMLElement, isReverse: boolean, x: number | undefined): void;
9
9
  //# sourceMappingURL=place-caret-at-edge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"place-caret-at-edge.d.ts","sourceRoot":"","sources":["../../src/dom/place-caret-at-edge.js"],"names":[],"mappings":"AAmCA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAE,SAAS,EAJxC,WAIwC,EAAE,SAAS,EAHnD,OAGmD,EAAE,CAAC,EAFtD,MAAM,GAAC,SAE+C,QA+ChE"}
1
+ {"version":3,"file":"place-caret-at-edge.d.ts","sourceRoot":"","sources":["../../src/dom/place-caret-at-edge.ts"],"names":[],"mappings":"AAuCA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CACvC,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,OAAO,EAClB,CAAC,EAAE,MAAM,GAAG,SAAS,QAgDrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"place-caret-at-horizontal-edge.d.ts","sourceRoot":"","sources":["../../src/dom/place-caret-at-horizontal-edge.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,0BAA0B,CAAE,SAAS,EAHlD,WAGkD,EAAE,SAAS,EAF7D,OAE6D,QAEvE"}
1
+ {"version":3,"file":"place-caret-at-horizontal-edge.d.ts","sourceRoot":"","sources":["../../src/dom/place-caret-at-horizontal-edge.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,0BAA0B,CACjD,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,OAAO,QAGlB"}
@@ -1 +1 @@
1
- {"version":3,"file":"place-caret-at-vertical-edge.d.ts","sourceRoot":"","sources":["../../src/dom/place-caret-at-vertical-edge.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAE,SAAS,EAJhD,WAIgD,EAAE,SAAS,EAH3D,OAG2D,EAAE,IAAI,AAFzE,CACF,EADU,OAEiE,QAE3E"}
1
+ {"version":3,"file":"place-caret-at-vertical-edge.d.ts","sourceRoot":"","sources":["../../src/dom/place-caret-at-vertical-edge.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC/C,SAAS,EAAE,WAAW,EACtB,SAAS,EAAE,OAAO,EAClB,IAAI,CAAC,EAAE,OAAO,QAGd"}
@@ -1,11 +1,12 @@
1
+ import type { Schema } from './types';
1
2
  /**
2
3
  * Given a schema, unwraps or removes nodes, attributes and classes on HTML.
3
4
  *
4
- * @param {string} HTML The HTML to clean up.
5
- * @param {import('./clean-node-list').Schema} schema Schema for the HTML.
6
- * @param {boolean} inline Whether to clean for inline mode.
5
+ * @param {string} HTML The HTML to clean up.
6
+ * @param {Schema} schema Schema for the HTML.
7
+ * @param {boolean} inline Whether to clean for inline mode.
7
8
  *
8
9
  * @return {string} The cleaned up HTML.
9
10
  */
10
- export default function removeInvalidHTML(HTML: string, schema: import('./clean-node-list').Schema, inline: boolean): string;
11
+ export default function removeInvalidHTML(HTML: string, schema: Schema, inline: boolean): string;
11
12
  //# sourceMappingURL=remove-invalid-html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remove-invalid-html.d.ts","sourceRoot":"","sources":["../../src/dom/remove-invalid-html.js"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAE,IAAI,EANpC,MAMoC,EAAE,MAAM,EAL5C,OAAO,mBAAmB,EAAE,MAKgB,EAAE,MAAM,EAJpD,OAIoD,GAFnD,MAAM,CAUjB"}
1
+ {"version":3,"file":"remove-invalid-html.d.ts","sourceRoot":"","sources":["../../src/dom/remove-invalid-html.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACxC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,GACb,MAAM,CAQR"}
@@ -1,8 +1,7 @@
1
1
  /**
2
2
  * Given a DOM node, removes it from the DOM.
3
3
  *
4
- * @param {Node} node Node to be removed.
5
- * @return {void}
4
+ * @param node Node to be removed.
6
5
  */
7
6
  export default function remove(node: Node): void;
8
7
  //# sourceMappingURL=remove.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/dom/remove.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,IAAI,EAHzB,IAGyB,GAFxB,IAAI,CAKf"}
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/dom/remove.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,IAAI,EAAE,IAAI,GAAI,IAAI,CAGjD"}
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Replaces the given node with a new node with the given tag name.
3
3
  *
4
- * @param {Element} node The node to replace
5
- * @param {string} tagName The new tag name.
4
+ * @param node The node to replace
5
+ * @param tagName The new tag name.
6
6
  *
7
- * @return {Element} The new node.
7
+ * @return The new node.
8
8
  */
9
9
  export default function replaceTag(node: Element, tagName: string): Element;
10
10
  //# sourceMappingURL=replace-tag.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replace-tag.d.ts","sourceRoot":"","sources":["../../src/dom/replace-tag.js"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAE,IAAI,EAL7B,OAK6B,EAAE,OAAO,EAJtC,MAIsC,GAFrC,OAAO,CAalB"}
1
+ {"version":3,"file":"replace-tag.d.ts","sourceRoot":"","sources":["../../src/dom/replace-tag.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,CAAC,OAAO,UAAU,UAAU,CAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAI,OAAO,CAW5E"}
@@ -1,9 +1,8 @@
1
1
  /**
2
2
  * Given two DOM nodes, replaces the former with the latter in the DOM.
3
3
  *
4
- * @param {Element} processedNode Node to be removed.
5
- * @param {Element} newNode Node to be inserted in its place.
6
- * @return {void}
4
+ * @param processedNode Node to be removed.
5
+ * @param newNode Node to be inserted in its place.
7
6
  */
8
7
  export default function replace(processedNode: Element, newNode: Element): void;
9
8
  //# sourceMappingURL=replace.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../../src/dom/replace.js"],"names":[],"mappings":"AAIA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAE,aAAa,EAJnC,OAImC,EAAE,OAAO,EAH5C,OAG4C,GAF3C,IAAI,CAMf"}
1
+ {"version":3,"file":"replace.d.ts","sourceRoot":"","sources":["../../src/dom/replace.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAC9B,aAAa,EAAE,OAAO,EACtB,OAAO,EAAE,OAAO,GACd,IAAI,CAIN"}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Strips scripts and on* attributes from HTML.
3
3
  *
4
- * @param {string} html HTML to sanitize.
4
+ * @param html HTML to sanitize.
5
5
  *
6
- * @return {string} The sanitized HTML.
6
+ * @return The sanitized HTML.
7
7
  */
8
8
  export default function safeHTML(html: string): string;
9
9
  //# sourceMappingURL=safe-html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"safe-html.d.ts","sourceRoot":"","sources":["../../src/dom/safe-html.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,IAAI,EAJ3B,MAI2B,GAF1B,MAAM,CA2BjB"}
1
+ {"version":3,"file":"safe-html.d.ts","sourceRoot":"","sources":["../../src/dom/safe-html.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAE,IAAI,EAAE,MAAM,GAAI,MAAM,CAyBvD"}
@@ -2,11 +2,11 @@
2
2
  * If no range range can be created or it is outside the container, the element
3
3
  * may be out of view, so scroll it into view and try again.
4
4
  *
5
- * @param {HTMLElement} container The container to scroll.
6
- * @param {boolean} alignToTop True to align to top, false to bottom.
7
- * @param {Function} callback The callback to create the range.
5
+ * @param container The container to scroll.
6
+ * @param alignToTop True to align to top, false to bottom.
7
+ * @param callback The callback to create the range.
8
8
  *
9
- * @return {?Range} The range returned by the callback.
9
+ * @return The range returned by the callback.
10
10
  */
11
- export declare function scrollIfNoRange(container: HTMLElement, alignToTop: boolean, callback: Function): Range | null;
11
+ export declare function scrollIfNoRange(container: HTMLElement, alignToTop: boolean, callback: () => Range | null): Range | null;
12
12
  //# sourceMappingURL=scroll-if-no-range.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-if-no-range.d.ts","sourceRoot":"","sources":["../../src/dom/scroll-if-no-range.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAE,SAAS,EAN/B,WAM+B,EAAE,UAAU,EAL3C,OAK2C,EAAE,QAAQ,UAAA,GAFnD,KAAK,OAAA,CAyBjB"}
1
+ {"version":3,"file":"scroll-if-no-range.d.ts","sourceRoot":"","sources":["../../src/dom/scroll-if-no-range.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAC9B,SAAS,EAAE,WAAW,EACtB,UAAU,EAAE,OAAO,EACnB,QAAQ,EAAE,MAAM,KAAK,GAAG,IAAI,GAC1B,KAAK,GAAG,IAAI,CAuBd"}
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * Removes any HTML tags from the provided string.
3
3
  *
4
- * @param {string} html The string containing html.
4
+ * @param html The string containing html.
5
5
  *
6
- * @return {string} The text content with any html removed.
6
+ * @return The text content with any html removed.
7
7
  */
8
8
  export default function stripHTML(html: string): string;
9
9
  //# sourceMappingURL=strip-html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"strip-html.d.ts","sourceRoot":"","sources":["../../src/dom/strip-html.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,IAAI,EAJ5B,MAI4B,GAF3B,MAAM,CAUjB"}
1
+ {"version":3,"file":"strip-html.d.ts","sourceRoot":"","sources":["../../src/dom/strip-html.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAE,IAAI,EAAE,MAAM,GAAI,MAAM,CAQxD"}
@@ -0,0 +1,32 @@
1
+ export interface SchemaItem {
2
+ /**
3
+ * Attributes.
4
+ */
5
+ attributes?: string[];
6
+ /**
7
+ * Classnames or RegExp to test against. Use '*' to keep all classes.
8
+ */
9
+ classes?: (string | RegExp)[];
10
+ /**
11
+ * Child schemas.
12
+ */
13
+ children?: '*' | {
14
+ [tag: string]: SchemaItem;
15
+ };
16
+ /**
17
+ * Selectors to test required children against. Leave empty or undefined if there are no requirements.
18
+ */
19
+ require?: string[];
20
+ /**
21
+ * Whether to allow nodes without children.
22
+ */
23
+ allowEmpty?: boolean;
24
+ /**
25
+ * Function to test whether a node is a match. If left undefined any node will be assumed to match.
26
+ */
27
+ isMatch?: (node: Node) => boolean;
28
+ }
29
+ export type Schema = {
30
+ [tag: string]: SchemaItem;
31
+ };
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/dom/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAE,MAAM,GAAG,MAAM,CAAE,EAAE,CAAC;IAChC;;OAEG;IACH,QAAQ,CAAC,EAAE,GAAG,GAAG;QAAE,CAAE,GAAG,EAAE,MAAM,GAAI,UAAU,CAAA;KAAE,CAAC;IACjD;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAE,IAAI,EAAE,IAAI,KAAM,OAAO,CAAC;CACpC;AAED,MAAM,MAAM,MAAM,GAAG;IAAE,CAAE,GAAG,EAAE,MAAM,GAAI,UAAU,CAAA;CAAE,CAAC"}
@@ -1,9 +1,7 @@
1
1
  /**
2
2
  * Unwrap the given node. This means any child nodes are moved to the parent.
3
3
  *
4
- * @param {Node} node The node to unwrap.
5
- *
6
- * @return {void}
4
+ * @param node The node to unwrap.
7
5
  */
8
6
  export default function unwrap(node: Node): void;
9
7
  //# sourceMappingURL=unwrap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"unwrap.d.ts","sourceRoot":"","sources":["../../src/dom/unwrap.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,IAAI,EAJzB,IAIyB,GAFxB,IAAI,CAYf"}
1
+ {"version":3,"file":"unwrap.d.ts","sourceRoot":"","sources":["../../src/dom/unwrap.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAE,IAAI,EAAE,IAAI,GAAI,IAAI,CAUjD"}
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * Wraps the given node with a new node with the given tag name.
3
3
  *
4
- * @param {Element} newNode The node to insert.
5
- * @param {Element} referenceNode The node to wrap.
4
+ * @param newNode The node to insert.
5
+ * @param referenceNode The node to wrap.
6
6
  */
7
7
  export default function wrap(newNode: Element, referenceNode: Element): void;
8
8
  //# sourceMappingURL=wrap.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../src/dom/wrap.js"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAE,OAAO,EAH1B,OAG0B,EAAE,aAAa,EAFzC,OAEyC,QAInD"}
1
+ {"version":3,"file":"wrap.d.ts","sourceRoot":"","sources":["../../src/dom/wrap.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,CAAC,OAAO,UAAU,IAAI,CAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,OAAO,QAIrE"}
@@ -1,36 +1,17 @@
1
- /**
2
- * References:
3
- *
4
- * Focusable:
5
- * - https://www.w3.org/TR/html5/editing.html#focus-management
6
- *
7
- * Sequential focus navigation:
8
- * - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
9
- *
10
- * Disabled elements:
11
- * - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements
12
- *
13
- * getClientRects algorithm (requiring layout box):
14
- * - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface
15
- *
16
- * AREA elements associated with an IMG:
17
- * - https://w3c.github.io/html/editing.html#data-model
18
- */
1
+ import type { FindFocusableOptions } from './types';
19
2
  /**
20
3
  * Returns all focusable elements within a given context.
21
4
  *
22
- * @param {Element} context Element in which to search.
23
- * @param {Object} options
24
- * @param {boolean} [options.sequential] If set, only return elements that are
25
- * sequentially focusable.
26
- * Non-interactive elements with a
27
- * negative `tabindex` are focusable but
28
- * not sequentially focusable.
29
- * https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
5
+ * @param context Element in which to search.
6
+ * @param options
7
+ * @param [options.sequential] If set, only return elements that are
8
+ * sequentially focusable.
9
+ * Non-interactive elements with a
10
+ * negative `tabindex` are focusable but
11
+ * not sequentially focusable.
12
+ * https://html.spec.whatwg.org/multipage/interaction.html#the-tabindex-attribute
30
13
  *
31
- * @return {HTMLElement[]} Focusable elements.
14
+ * @return Focusable elements.
32
15
  */
33
- export declare function find(context: Element, { sequential }?: {
34
- sequential?: boolean;
35
- }): HTMLElement[];
16
+ export declare function find(context: Element, { sequential }?: FindFocusableOptions): HTMLElement[];
36
17
  //# sourceMappingURL=focusable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"focusable.d.ts","sourceRoot":"","sources":["../src/focusable.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAmFH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CAAE,OAAO,EAXlB,OAWkB,EAAE,EAAE,UAAkB,EAAE,GATlD;IAA0B,UAAU,AAApC,CAOA,EAPQ,OAAO,CAOf;CAEuD,GAF9C,WAAW,EAAE,CAsBxB"}
1
+ {"version":3,"file":"focusable.d.ts","sourceRoot":"","sources":["../src/focusable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAoGpD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,IAAI,CACnB,OAAO,EAAE,OAAO,EAChB,EAAE,UAAkB,EAAE,GAAE,oBAAyB,GAC/C,WAAW,EAAE,CAmBf"}
@@ -11,4 +11,21 @@ export declare const focus: {
11
11
  export * from './dom';
12
12
  export * from './phrasing-content';
13
13
  export * from './data-transfer';
14
+ /**
15
+ * Schema of the content allowed inside an element, keyed by tag name.
16
+ */
17
+ export type { ContentSchema } from './types';
18
+ /**
19
+ * The attributes and children allowed for an element in a `ContentSchema`.
20
+ */
21
+ export type { SemanticElementDefinition } from './types';
22
+ /**
23
+ * Schema that `cleanNodeList` and `removeInvalidHTML` clean HTML against,
24
+ * keyed by tag name.
25
+ */
26
+ export type { Schema } from './dom/types';
27
+ /**
28
+ * The rules for a single tag in a `Schema`.
29
+ */
30
+ export type { SchemaItem } from './dom/types';
14
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,KAAK;;;CAA0B,CAAC;AAE7C,cAAc,OAAO,CAAC;AACtB,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,KAAK;;;CAA0B,CAAC;AAE7C,cAAc,OAAO,CAAC;AACtB,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAEhC;;GAEG;AACH,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;GAEG;AACH,YAAY,EAAE,yBAAyB,EAAE,MAAM,SAAS,CAAC;AAEzD;;;GAGG;AACH,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}
@@ -1,43 +1,28 @@
1
- /**
2
- * All phrasing content elements.
3
- *
4
- * @see https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#phrasing-content-0
5
- */
6
- export type ContentSchema = Record<string, SemanticElementDefinition>;
7
- export type SemanticElementDefinition = {
8
- /**
9
- * Content attributes
10
- */
11
- attributes?: string[];
12
- /**
13
- * Content attributes
14
- */
15
- children?: ContentSchema | '*';
16
- };
1
+ import type { ContentSchema } from './types';
17
2
  /**
18
3
  * Get schema of possible paths for phrasing content.
19
4
  *
20
5
  * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
21
6
  *
22
- * @param {string} [context] Set to "paste" to exclude invisible elements and
23
- * sensitive data.
7
+ * @param [context] Set to "paste" to exclude invisible elements and
8
+ * sensitive data.
24
9
  *
25
- * @return {Partial<ContentSchema>} Schema.
10
+ * @return Schema.
26
11
  */
27
- export declare function getPhrasingContentSchema(context?: string): Partial<ContentSchema>;
12
+ export declare function getPhrasingContentSchema(context?: string): ContentSchema;
28
13
  /**
29
14
  * Find out whether or not the given node is phrasing content.
30
15
  *
31
16
  * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
32
17
  *
33
- * @param {Node} node The node to test.
18
+ * @param node The node to test.
34
19
  *
35
- * @return {boolean} True if phrasing content, false if not.
20
+ * @return True if phrasing content, false if not.
36
21
  */
37
22
  export declare function isPhrasingContent(node: Node): boolean;
38
23
  /**
39
- * @param {Node} node
40
- * @return {boolean} Node is text content
24
+ * @param node
25
+ * @return Node is text content
41
26
  */
42
27
  export declare function isTextContent(node: Node): boolean;
43
28
  //# sourceMappingURL=phrasing-content.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phrasing-content.d.ts","sourceRoot":"","sources":["../src/phrasing-content.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAGA,YAAoD,aAAa,GAAvD,MAAM,CAAC,MAAM,EAAC,yBAAyB,CAAC,CAAe;AAIjE,YAAS,yBAAyB,GAClC;;;;IAA+B,UAAU,AAAzC,CACA,EADW,MAAM,EAAE,CACnB;;;;IAA+B,QAAQ,AAAvC,CACF,EADa,aAAa,GAAC,GAAG,CAC9B;CAAA,CAAA;AAqID;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAE,OAAO,AAL9C,CAGA,EAHQ,MAKsC,GAFrC,OAAO,CAAC,aAAa,CAAC,CA4BjC;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAE,IAAI,EAJ5B,IAI4B,GAF3B,OAAO,CAKlB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAE,IAAI,EAHxB,IAGwB,GAFvB,OAAO,CAKlB"}
1
+ {"version":3,"file":"phrasing-content.d.ts","sourceRoot":"","sources":["../src/phrasing-content.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAuI7C;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAE,OAAO,CAAC,EAAE,MAAM,GAAI,aAAa,CAuB1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAE,IAAI,EAAE,IAAI,GAAI,OAAO,CAGvD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAE,IAAI,EAAE,IAAI,GAAI,OAAO,CAGnD"}
@@ -1,37 +1,32 @@
1
1
  /**
2
2
  * Returns true if the specified element is tabbable, or false otherwise.
3
3
  *
4
- * @param {Element} element Element to test.
4
+ * @param element Element to test.
5
5
  *
6
- * @return {boolean} Whether element is tabbable.
6
+ * @return Whether element is tabbable.
7
7
  */
8
8
  export declare function isTabbableIndex(element: Element): boolean;
9
- export type MaybeHTMLInputElement = HTMLElement & {
10
- type?: string;
11
- checked?: boolean;
12
- name?: string;
13
- };
14
9
  /**
15
- * @param {Element} context
16
- * @return {HTMLElement[]} Tabbable elements within the context.
10
+ * @param context
11
+ * @return Tabbable elements within the context.
17
12
  */
18
13
  export declare function find(context: Element): HTMLElement[];
19
14
  /**
20
15
  * Given a focusable element, find the preceding tabbable element.
21
16
  *
22
- * @param {Element} element The focusable element before which to look. Defaults
23
- * to the active element.
17
+ * @param element The focusable element before which to look. Defaults
18
+ * to the active element.
24
19
  *
25
- * @return {HTMLElement|undefined} Preceding tabbable element.
20
+ * @return Preceding tabbable element.
26
21
  */
27
22
  export declare function findPrevious(element: Element): HTMLElement | undefined;
28
23
  /**
29
24
  * Given a focusable element, find the next tabbable element.
30
25
  *
31
- * @param {Element} element The focusable element after which to look. Defaults
32
- * to the active element.
26
+ * @param element The focusable element after which to look. Defaults
27
+ * to the active element.
33
28
  *
34
- * @return {HTMLElement|undefined} Next tabbable element.
29
+ * @return Next tabbable element.
35
30
  */
36
31
  export declare function findNext(element: Element): HTMLElement | undefined;
37
32
  //# sourceMappingURL=tabbable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tabbable.d.ts","sourceRoot":"","sources":["../src/tabbable.js"],"names":[],"mappings":"AAmBA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAE,OAAO,EAJ7B,OAI6B,GAF5B,OAAO,CAIlB;AAEG,YAA6E,qBAAqB,GAAxF,WAAW,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAuB;AA+GtG;;;GAGG;AACH,wBAAgB,IAAI,CAAE,OAAO,EAHlB,OAGkB,GAFjB,WAAW,EAAE,CAIxB;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAE,OAAO,EAL1B,OAK0B,GAFzB,WAAW,GAAC,SAAS,CAWhC;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAE,OAAO,EALtB,OAKsB,GAFrB,WAAW,GAAC,SAAS,CAShC"}
1
+ {"version":3,"file":"tabbable.d.ts","sourceRoot":"","sources":["../src/tabbable.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAE,OAAO,EAAE,OAAO,GAAI,OAAO,CAE3D;AAyHD;;;GAGG;AACH,wBAAgB,IAAI,CAAE,OAAO,EAAE,OAAO,GAAI,WAAW,EAAE,CAEtD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAE,OAAO,EAAE,OAAO,GAAI,WAAW,GAAG,SAAS,CASxE;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAE,OAAO,EAAE,OAAO,GAAI,WAAW,GAAG,SAAS,CAOpE"}