@unicom-cloud/ui 0.8.109 → 0.8.111

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 (447) hide show
  1. package/Affix.js +2 -2
  2. package/Alert.js +1 -1
  3. package/AutoComplete.js +1 -1
  4. package/BackTop.js +2 -2
  5. package/Badge.js +1 -1
  6. package/Breadcrumb.js +2 -2
  7. package/Button.js +1 -1
  8. package/Calendar.js +1 -1
  9. package/Card.js +1 -1
  10. package/Carousel.js +1 -1
  11. package/Cascader.js +1 -1
  12. package/Checkbox.js +1 -1
  13. package/ColorPicker.js +1 -1
  14. package/Comment.js +1 -1
  15. package/ConfigProvider.js +1 -1
  16. package/Copy.js +6 -4
  17. package/Countdown.js +42 -8
  18. package/DatePicker.js +1 -1
  19. package/Descriptions.js +1 -1
  20. package/Details.js +42 -6
  21. package/Development.js +1 -1
  22. package/Divider.js +1 -1
  23. package/Draggable.js +1 -1
  24. package/Dropdown.js +1 -1
  25. package/Empty.js +1 -1
  26. package/Flex.js +43 -7
  27. package/Form.js +21 -16
  28. package/Icon.js +1 -1
  29. package/IconHover.js +1 -1
  30. package/Image.js +1 -1
  31. package/InputNumber.js +1 -1
  32. package/Layout.js +1 -1
  33. package/Link.js +2 -2
  34. package/LiquidFill.js +12 -10
  35. package/List.js +1 -1
  36. package/Loading.js +42 -6
  37. package/Marquee.js +12 -10
  38. package/Mentions.js +1 -1
  39. package/Menu.js +1 -1
  40. package/Message.js +3 -3
  41. package/Modal.js +1 -1
  42. package/Notice.js +41 -5
  43. package/Notification.js +1 -1
  44. package/OverflowEllipsis.js +1 -1
  45. package/PageHeader.js +2 -2
  46. package/Popconfirm.js +1 -1
  47. package/Popover.js +1 -1
  48. package/Progress.js +1 -1
  49. package/QrCode.js +12 -10
  50. package/Radio.js +1 -1
  51. package/Rate.js +1 -1
  52. package/ResizeBox.js +1 -1
  53. package/Result.js +1 -1
  54. package/RichText.js +19 -0
  55. package/Segmented.js +42 -7
  56. package/Skeleton.js +1 -1
  57. package/Slider.js +1 -1
  58. package/Space.js +43 -7
  59. package/Spin.js +1 -1
  60. package/Statistic.js +1 -1
  61. package/Steps.js +1 -1
  62. package/Switch.js +1 -1
  63. package/Table.js +1 -1
  64. package/Tabs.js +1 -1
  65. package/Tag.js +2 -2
  66. package/Tooltip.js +1 -1
  67. package/Tour.js +13 -11
  68. package/Transfer.js +1 -1
  69. package/Tree.js +1 -1
  70. package/TreeSelect.js +1 -1
  71. package/Trigger.js +1 -1
  72. package/affix/index.js +2 -2
  73. package/alert/index.js +1 -1
  74. package/anchor/Anchor.js +2 -2
  75. package/anchor/Link.js +1 -1
  76. package/app/App.js +2 -2
  77. package/auto-complete/index.js +1 -1
  78. package/avatar/Avatar.js +1 -1
  79. package/avatar/Group.js +1 -1
  80. package/back-top/index.js +2 -2
  81. package/badge/index.js +1 -1
  82. package/breadcrumb/index.js +2 -2
  83. package/button/Group.js +1 -1
  84. package/button/index.js +1 -1
  85. package/calendar/index.js +3 -3
  86. package/card/Grid.js +1 -1
  87. package/card/Meta.js +1 -1
  88. package/card/index.js +1 -1
  89. package/carousel/Arrow.js +2 -2
  90. package/carousel/Indicator.js +1 -1
  91. package/carousel/index.js +1 -1
  92. package/cascader/Cascader.js +3 -3
  93. package/cascader/index.js +1 -1
  94. package/cascader/util.js +1 -1
  95. package/checkbox/Checkbox.js +2 -2
  96. package/checkbox/Group.js +2 -2
  97. package/checkbox/GroupBlock.js +2 -2
  98. package/checkbox/index.js +2 -2
  99. package/chunk/BDMqvmVH.js +4239 -0
  100. package/chunk/BDgzrqDN.js +154 -0
  101. package/chunk/BG6j6Ct7.js +30 -0
  102. package/chunk/BGJspFG9.js +56 -0
  103. package/chunk/BO_5qdS_.js +13 -0
  104. package/chunk/{DblEjsQ8.js → BUNoUPLs.js} +1 -1
  105. package/chunk/B_c0gPsX.js +83 -0
  106. package/chunk/BcEZk8pT.js +837 -0
  107. package/chunk/{DGSfSsAY.js → BeHcDey_.js} +1 -1
  108. package/chunk/{B9YvSTvI.js → BlflTd2i.js} +695 -856
  109. package/chunk/{Bm3gJPkz.js → BnUWOu3_.js} +5 -5
  110. package/chunk/Bvxzb1wd.js +16 -0
  111. package/chunk/{DryCfcSV.js → CFyN9Eio.js} +4 -4
  112. package/chunk/CN7NKv_2.js +11 -0
  113. package/chunk/{BDKb_-wj.js → COsRZOz1.js} +4 -4
  114. package/chunk/CT7ury1Z.js +13 -0
  115. package/chunk/Ca6eMq_Y.js +8 -0
  116. package/chunk/{p9jiLDTk.js → CgN4U7Ou.js} +2 -2
  117. package/chunk/{Bg3uJGPu.js → CsqGBZv1.js} +1 -1
  118. package/chunk/CylJZkp8.js +6 -0
  119. package/chunk/{9WWq1a0I.js → DSqW_efI.js} +1 -1
  120. package/chunk/{Bz3KT4sO.js → Dbw0YUY1.js} +81 -47
  121. package/chunk/Dh-zFF65.js +15 -0
  122. package/chunk/Di5KBCVQ.js +4 -0
  123. package/chunk/{DjPTURUf.js → Lyh0cz3R.js} +3 -3
  124. package/chunk/{DgWzb7M5.js → Y_GQsZUt.js} +1 -1
  125. package/chunk/{BfBHo0RR.js → n1tirBXA.js} +7 -7
  126. package/chunk/{DYc9a7tm.js → qsVvkBLU.js} +1 -1
  127. package/collapse/Collapse.js +2 -2
  128. package/collapse/Item.js +2 -2
  129. package/color-picker/ControlBar.js +1 -1
  130. package/color-picker/InputAlpha.js +1 -1
  131. package/color-picker/InputHex.js +1 -1
  132. package/color-picker/InputRgb.js +1 -1
  133. package/color-picker/Palette.js +1 -1
  134. package/color-picker/Panel.js +2 -2
  135. package/color-picker/index.js +1 -1
  136. package/comment/index.js +1 -1
  137. package/config-provider/ConfigProvider.js +1 -1
  138. package/config-provider/context.js +1 -1
  139. package/config-provider/index.js +2 -2
  140. package/copy/index.js +10 -8
  141. package/countdown/index.js +67 -33
  142. package/date-picker/Picker.js +1 -1
  143. package/date-picker/RangePicker.js +2 -2
  144. package/date-picker/index.js +1 -1
  145. package/descriptions/index.js +1 -1
  146. package/details/index.js +74 -38
  147. package/development/index.js +1 -1
  148. package/divider/index.js +1 -1
  149. package/draggable/index.js +1 -1
  150. package/drawer/Drawer.js +1 -1
  151. package/dropdown/Button.js +1 -1
  152. package/dropdown/index.js +1 -1
  153. package/empty/index.js +1 -1
  154. package/flex/index.js +63 -29
  155. package/form/Form.js +3 -3
  156. package/form/FormItem.js +1 -1
  157. package/form/index.js +85 -77
  158. package/grid/Grid.js +1 -1
  159. package/grid/Item.js +1 -1
  160. package/hooks/index.js +123 -129
  161. package/hooks/useCreation.js +4 -0
  162. package/hooks/useId.js +1 -1
  163. package/hooks/useIsomorphicLayoutEffect.js +1 -1
  164. package/hooks/useKeyboardEvent.js +1 -1
  165. package/hooks/useMedia.js +1 -1
  166. package/hooks/usePersistCallback.js +1 -1
  167. package/hooks/useRefs.js +1 -1
  168. package/hooks/useStateWithPromise.js +1 -1
  169. package/hooks/useWatch.js +1 -1
  170. package/hooks/useWindowSize.js +1 -1
  171. package/icon/index.js +1 -1
  172. package/icon-hover/index.js +1 -1
  173. package/icons/file.js +1 -1
  174. package/image/Image.js +3 -3
  175. package/image/ImagePreview.js +44 -9
  176. package/image/ImagePreviewArrow.js +1 -1
  177. package/image/ImagePreviewGroup.js +1 -1
  178. package/image/index.js +1 -1
  179. package/index.js +470 -470
  180. package/input/Button.js +1 -1
  181. package/input/Group.js +1 -1
  182. package/input/Input.js +3 -3
  183. package/input/InputElement.js +2 -2
  184. package/input/Password.js +2 -2
  185. package/input/Search.js +1 -1
  186. package/input/Textarea.js +2 -2
  187. package/input-number/index.js +1 -1
  188. package/input-number/useSelectionRange.js +1 -1
  189. package/input-tag/InputTag.js +1 -1
  190. package/layout/Content.js +1 -1
  191. package/layout/Footer.js +1 -1
  192. package/layout/Header.js +1 -1
  193. package/layout/Sider.js +1 -1
  194. package/layout/index.js +1 -1
  195. package/link/index.js +2 -2
  196. package/liquid-fill/index.js +17 -15
  197. package/list/Item.js +1 -1
  198. package/list/Meta.js +1 -1
  199. package/list/index.js +1 -1
  200. package/loading/index.js +54 -18
  201. package/marquee/index.js +19 -17
  202. package/marquee-/index.js +17 -15
  203. package/mentions/index.js +1 -1
  204. package/menu/Menu.js +4 -4
  205. package/menu/OverflowWrap.js +1 -1
  206. package/menu/index.js +2 -2
  207. package/message/index.js +3 -3
  208. package/message/useMessage.js +4 -3
  209. package/modal/Confirm.js +2 -2
  210. package/modal/Modal.js +2 -2
  211. package/modal/index.js +2 -2
  212. package/notice/index.js +41 -5
  213. package/notification/index.js +1 -1
  214. package/notification/useNotification.js +1 -1
  215. package/overflow-ellipsis/OverflowItem.js +1 -1
  216. package/overflow-ellipsis/index.js +1 -1
  217. package/package.json +1 -1
  218. package/page-header/index.js +120 -81
  219. package/pagination/PageItem.js +2 -2
  220. package/pagination/PageJumper.js +1 -1
  221. package/pagination/PageOption.js +1 -1
  222. package/pagination/Pagination.js +1 -1
  223. package/picker/Input.js +1 -1
  224. package/picker/InputRange.js +1 -1
  225. package/popconfirm/index.js +1 -1
  226. package/popover/index.js +1 -1
  227. package/progress/CircleProgress.js +2 -2
  228. package/progress/index.js +1 -1
  229. package/qr-code/index.js +15 -13
  230. package/radio/Group.js +2 -2
  231. package/radio/GroupBlock.js +2 -2
  232. package/radio/Radio.js +2 -2
  233. package/radio/index.js +2 -2
  234. package/rate/index.js +1 -1
  235. package/resize-box/ResizeTrigger.js +1 -1
  236. package/resize-box/Split.js +2 -2
  237. package/resize-box/SplitGroup.js +1 -1
  238. package/resize-box/index.js +1 -1
  239. package/result/index.js +1 -1
  240. package/rich-text/constant.js +5 -0
  241. package/rich-text/core.js +11 -0
  242. package/rich-text/index.js +119 -0
  243. package/rich-text/interface.js +1 -0
  244. package/rich-text/rich.js +1877 -0
  245. package/row-col/Col-.js +1 -1
  246. package/row-col/Col.js +1 -1
  247. package/row-col/Row.js +1 -1
  248. package/segmented/index.js +145 -110
  249. package/select/Option.js +1 -1
  250. package/select/Select.js +235 -227
  251. package/select-view/Core.js +2 -2
  252. package/skeleton/index.js +1 -1
  253. package/slider/Button.js +2 -2
  254. package/slider/index.js +1 -1
  255. package/space/index.js +51 -15
  256. package/spin/DotLoading.js +1 -1
  257. package/spin/index.js +1 -1
  258. package/splitter/Panel.js +1 -1
  259. package/splitter/SplitBar.js +2 -2
  260. package/splitter/Splitter.js +2 -2
  261. package/statistic/index.js +1 -1
  262. package/steps/index.js +1 -1
  263. package/style.css +1 -1
  264. package/switch/index.js +1 -1
  265. package/table/Table.js +3 -3
  266. package/table/index.js +41 -39
  267. package/tabs/Tab.js +3 -3
  268. package/tabs/TabContent.js +2 -2
  269. package/tabs/TabPane.js +1 -1
  270. package/tabs/index.js +2 -2
  271. package/tag/index.js +2 -2
  272. package/time-picker/Picker.js +1 -1
  273. package/time-picker/TimePicker.js +1 -1
  274. package/timeline/Item.js +1 -1
  275. package/timeline/Timeline.js +1 -1
  276. package/tooltip/index.js +1 -1
  277. package/tour/index.js +20 -18
  278. package/transfer/Item.js +3 -3
  279. package/transfer/List.js +3 -3
  280. package/transfer/index.js +1 -1
  281. package/tree/Animation.js +2 -2
  282. package/tree/Node.js +3 -3
  283. package/tree/NodeList.js +1 -1
  284. package/tree/Tree.js +2 -2
  285. package/tree/index.js +1 -1
  286. package/tree-select/Select.js +4 -4
  287. package/tree-select/index.js +1 -1
  288. package/trigger/index.js +1 -1
  289. package/types/common/hooks/src/index.d.ts +1 -5
  290. package/types/common/hooks/src/use-url-state/index.d.ts +1 -1
  291. package/types/common/hooks/useId.d.ts +1 -1
  292. package/types/common/hooks/useIsomorphicLayoutEffect.d.ts +1 -3
  293. package/types/common/hooks/useKeyboardEvent.d.ts +1 -1
  294. package/types/common/hooks/{useListenResize.d.ts → useListenWindowResize.d.ts} +4 -6
  295. package/types/common/hooks/useWatch.d.ts +1 -1
  296. package/types/common/hooks/useWindowSize.d.ts +2 -2
  297. package/types/common/utils/index.d.ts +47 -0
  298. package/types/common/utils/keyboardCode.d.ts +4 -0
  299. package/types/common/utils/math.d.ts +1 -0
  300. package/types/common/utils/mitt.d.ts +1 -0
  301. package/types/common/utils/pinyin.d.ts +1 -0
  302. package/types/common/utils/reactTransitionGroup.d.ts +1 -0
  303. package/types/common/utils/uuid.d.ts +1 -0
  304. package/types/common/utils/validate.d.ts +1 -0
  305. package/types/pc/config-provider/interface.d.ts +2 -0
  306. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  307. package/types/pc/form/index.d.ts +6 -1
  308. package/types/pc/hooks/index.d.ts +2 -2
  309. package/types/pc/hooks/useCreation.d.ts +1 -0
  310. package/types/pc/hooks/useListenWindowResize.d.ts +1 -0
  311. package/types/pc/index.d.ts +2 -0
  312. package/types/pc/message/index.d.ts +1 -0
  313. package/types/pc/message/interface.d.ts +2 -2
  314. package/types/pc/page-header/interface.d.ts +3 -0
  315. package/types/pc/rich-text/blots/block.d.ts +34 -0
  316. package/types/pc/rich-text/blots/break.d.ts +8 -0
  317. package/types/pc/rich-text/blots/container.d.ts +4 -0
  318. package/types/pc/rich-text/blots/cursor.d.ts +26 -0
  319. package/types/pc/rich-text/blots/embed.d.ts +18 -0
  320. package/types/pc/rich-text/blots/inline.d.ts +12 -0
  321. package/types/pc/rich-text/blots/scroll.d.ts +49 -0
  322. package/types/pc/rich-text/blots/text.d.ts +5 -0
  323. package/types/pc/rich-text/constant.d.ts +1 -0
  324. package/types/pc/rich-text/core/composition.d.ts +12 -0
  325. package/types/pc/rich-text/core/editor.d.ts +28 -0
  326. package/types/pc/rich-text/core/emitter.d.ts +37 -0
  327. package/types/pc/rich-text/core/instances.d.ts +3 -0
  328. package/types/pc/rich-text/core/logger.d.ts +7 -0
  329. package/types/pc/rich-text/core/module.d.ts +8 -0
  330. package/types/pc/rich-text/core/rich.d.ts +217 -0
  331. package/types/pc/rich-text/core/selection.d.ts +74 -0
  332. package/types/pc/rich-text/core/theme.d.ts +32 -0
  333. package/types/pc/rich-text/core/utils/createRegistryWithFormats.d.ts +5 -0
  334. package/types/pc/rich-text/core/utils/scrollRectIntoView.d.ts +11 -0
  335. package/types/pc/rich-text/core.d.ts +7 -0
  336. package/types/pc/rich-text/delta/AttributeMap.d.ts +10 -0
  337. package/types/pc/rich-text/delta/Op.d.ts +11 -0
  338. package/types/pc/rich-text/delta/OpIterator.d.ts +13 -0
  339. package/types/pc/rich-text/delta/index.d.ts +45 -0
  340. package/types/pc/rich-text/formats/align.d.ts +5 -0
  341. package/types/pc/rich-text/formats/background.d.ts +5 -0
  342. package/types/pc/rich-text/formats/blockquote.d.ts +6 -0
  343. package/types/pc/rich-text/formats/bold.d.ts +11 -0
  344. package/types/pc/rich-text/formats/code.d.ts +15 -0
  345. package/types/pc/rich-text/formats/color.d.ts +7 -0
  346. package/types/pc/rich-text/formats/direction.d.ts +5 -0
  347. package/types/pc/rich-text/formats/font.d.ts +7 -0
  348. package/types/pc/rich-text/formats/formula.d.ts +10 -0
  349. package/types/pc/rich-text/formats/header.d.ts +7 -0
  350. package/types/pc/rich-text/formats/image.d.ts +13 -0
  351. package/types/pc/rich-text/formats/indent.d.ts +8 -0
  352. package/types/pc/rich-text/formats/italic.d.ts +6 -0
  353. package/types/pc/rich-text/formats/link.d.ts +13 -0
  354. package/types/pc/rich-text/formats/list.d.ts +13 -0
  355. package/types/pc/rich-text/formats/script.d.ts +8 -0
  356. package/types/pc/rich-text/formats/size.d.ts +4 -0
  357. package/types/pc/rich-text/formats/strike.d.ts +6 -0
  358. package/types/pc/rich-text/formats/table.d.ts +45 -0
  359. package/types/pc/rich-text/formats/underline.d.ts +6 -0
  360. package/types/pc/rich-text/formats/video.d.ts +14 -0
  361. package/types/pc/rich-text/index.d.ts +6 -0
  362. package/types/pc/rich-text/interface.d.ts +17 -0
  363. package/types/pc/rich-text/modules/clipboard.d.ts +43 -0
  364. package/types/pc/rich-text/modules/history.d.ts +36 -0
  365. package/types/pc/rich-text/modules/input.d.ts +10 -0
  366. package/types/pc/rich-text/modules/keyboard.d.ts +58 -0
  367. package/types/pc/rich-text/modules/normalizeExternalHTML/index.d.ts +2 -0
  368. package/types/pc/rich-text/modules/normalizeExternalHTML/normalizers/googleDocs.d.ts +1 -0
  369. package/types/pc/rich-text/modules/normalizeExternalHTML/normalizers/msWord.d.ts +1 -0
  370. package/types/pc/rich-text/modules/syntax.d.ts +50 -0
  371. package/types/pc/rich-text/modules/table.d.ts +20 -0
  372. package/types/pc/rich-text/modules/tableEmbed.d.ts +27 -0
  373. package/types/pc/rich-text/modules/toolbar.d.ts +24 -0
  374. package/types/pc/rich-text/modules/uiNode.d.ts +19 -0
  375. package/types/pc/rich-text/modules/uploader.d.ts +15 -0
  376. package/types/pc/rich-text/parchment/attributor/attributor.d.ts +17 -0
  377. package/types/pc/rich-text/parchment/attributor/class.d.ts +8 -0
  378. package/types/pc/rich-text/parchment/attributor/store.d.ts +15 -0
  379. package/types/pc/rich-text/parchment/attributor/style.d.ts +8 -0
  380. package/types/pc/rich-text/parchment/blot/abstract/blot.d.ts +115 -0
  381. package/types/pc/rich-text/parchment/blot/abstract/container.d.ts +18 -0
  382. package/types/pc/rich-text/parchment/blot/abstract/leaf.d.ts +29 -0
  383. package/types/pc/rich-text/parchment/blot/abstract/parent.d.ts +50 -0
  384. package/types/pc/rich-text/parchment/blot/abstract/shadow.d.ts +37 -0
  385. package/types/pc/rich-text/parchment/blot/block.d.ts +25 -0
  386. package/types/pc/rich-text/parchment/blot/embed.d.ts +11 -0
  387. package/types/pc/rich-text/parchment/blot/inline.d.ts +28 -0
  388. package/types/pc/rich-text/parchment/blot/scroll.d.ts +34 -0
  389. package/types/pc/rich-text/parchment/blot/text.d.ts +26 -0
  390. package/types/pc/rich-text/parchment/collection/linked-list.d.ts +21 -0
  391. package/types/pc/rich-text/parchment/collection/linked-node.d.ts +6 -0
  392. package/types/pc/rich-text/parchment/error.d.ts +6 -0
  393. package/types/pc/rich-text/parchment/index.d.ts +21 -0
  394. package/types/pc/rich-text/parchment/registry.d.ts +21 -0
  395. package/types/pc/rich-text/parchment/scope.d.ts +14 -0
  396. package/types/pc/rich-text/rich.d.ts +5 -0
  397. package/types/pc/rich-text/themes/base.d.ts +35 -0
  398. package/types/pc/rich-text/themes/bubble.d.ts +18 -0
  399. package/types/pc/rich-text/themes/snow.d.ts +9 -0
  400. package/types/pc/rich-text/ui/color-picker.d.ts +7 -0
  401. package/types/pc/rich-text/ui/icon-picker.d.ts +7 -0
  402. package/types/pc/rich-text/ui/icons.d.ts +51 -0
  403. package/types/pc/rich-text/ui/picker.d.ts +16 -0
  404. package/types/pc/rich-text/ui/tooltip.d.ts +12 -0
  405. package/types/pc/select/interface.d.ts +4 -0
  406. package/types/pc/utils/index.d.ts +2 -0
  407. package/types/pc/utils/mitt.d.ts +1 -0
  408. package/types/pc/utils/names.d.ts +107 -91
  409. package/types/pc/utils/pinyin.d.ts +1 -0
  410. package/types/pc/version/index.d.ts +1 -1
  411. package/typography/Base.js +1 -1
  412. package/typography/Ellipsis.js +5 -3
  413. package/typography/Operations.js +6 -4
  414. package/typography/Paragraph.js +1 -1
  415. package/typography/Typography.js +1 -1
  416. package/typography/useEllipsis.js +1 -1
  417. package/upload/TriggerNode.js +2 -2
  418. package/upload/Upload.js +2 -2
  419. package/utils/contextHolder.js +1 -1
  420. package/utils/index.js +167 -163
  421. package/utils/mitt.js +5 -0
  422. package/utils/names.js +12 -2
  423. package/utils/pinyin.js +5 -0
  424. package/verification-code/VerificationCode.js +1 -1
  425. package/version/index.js +1 -1
  426. package/virtual-list/VirtualList.js +2 -2
  427. package/watermark/Watermark.js +1 -1
  428. package/chunk/5_U1CBIu.js +0 -8
  429. package/chunk/BLOlsa0k.js +0 -11
  430. package/chunk/BTLlOOe9.js +0 -189
  431. package/chunk/C6Aw3qIJ.js +0 -16
  432. package/chunk/CMl7m9nA.js +0 -6
  433. package/chunk/COqvRD0G.js +0 -11
  434. package/chunk/DXlwLh0Y.js +0 -806
  435. package/chunk/DlSv5Vu0.js +0 -16
  436. package/chunk/DmDh7NRL.js +0 -14
  437. package/chunk/Duezix3m.js +0 -25
  438. package/chunk/siEVY1s5.js +0 -33
  439. package/hooks/useCreate.js +0 -4
  440. package/types/common/hooks/src/use-dynamic-list/index.d.ts +0 -18
  441. package/types/common/hooks/src/use-event-emitter/index.d.ts +0 -11
  442. package/types/common/hooks/src/use-map/index.d.ts +0 -8
  443. package/types/common/hooks/src/use-set/index.d.ts +0 -6
  444. package/types/common/hooks/useCreate.d.ts +0 -2
  445. package/types/pc/hooks/useCreate.d.ts +0 -1
  446. package/types/pc/hooks/useListenResize.d.ts +0 -1
  447. /package/hooks/{useListenResize.js → useListenWindowResize.js} +0 -0
@@ -0,0 +1,6 @@
1
+ import Inline from '../blots/inline.js';
2
+ declare class Underline extends Inline {
3
+ static blotName: string;
4
+ static tagName: string;
5
+ }
6
+ export default Underline;
@@ -0,0 +1,14 @@
1
+ import { BlockEmbed } from '../blots/block.js';
2
+ declare class Video extends BlockEmbed {
3
+ static blotName: string;
4
+ static className: string;
5
+ static tagName: string;
6
+ static create(value: string): Element;
7
+ static formats(domNode: Element): Record<string, string | null>;
8
+ static sanitize(url: string): string;
9
+ static value(domNode: Element): string | null;
10
+ domNode: HTMLVideoElement;
11
+ format(name: string, value: string): void;
12
+ html(): string;
13
+ }
14
+ export default Video;
@@ -0,0 +1,6 @@
1
+ import Rich from './rich';
2
+ export * from './rich';
3
+ export type { Bounds, DebugLevel, EmitterSource, ExpandedRichOptions, RichOptions, } from './rich';
4
+ export { Rich };
5
+ declare const RichText: import("react").ForwardRefExoticComponent<Omit<any, "ref"> & import("react").RefAttributes<unknown>>;
6
+ export default RichText;
@@ -0,0 +1,17 @@
1
+ import { CSSProperties } from 'react';
2
+ import type { EmitterSource } from './core/emitter';
3
+ import Delta from './delta';
4
+ /**
5
+ * @title RichText
6
+ */
7
+ export interface RichTextProps {
8
+ style?: CSSProperties;
9
+ className?: string | string[];
10
+ readOnly?: boolean;
11
+ defaultValue?: object | string;
12
+ value?: object | string;
13
+ onChange?: (value: Delta, delta: Delta, preValue: Delta, source: EmitterSource) => void;
14
+ onTextChange?: (delta: Delta, preValue: Delta, source: EmitterSource) => void;
15
+ onSelectionChange?: (...args: any[]) => void;
16
+ onEditorChange?: (...args: any[]) => void;
17
+ }
@@ -0,0 +1,43 @@
1
+ import type { EmitterSource } from '../core/emitter.js';
2
+ import Module from '../core/module.js';
3
+ import Rich from '../core/rich.js';
4
+ import type { Range } from '../core/selection.js';
5
+ import Delta from '../delta';
6
+ import type { ScrollBlot } from '../parchment';
7
+ type Selector = string | Node['TEXT_NODE'] | Node['ELEMENT_NODE'];
8
+ type Matcher = (node: Node, delta: Delta, scroll: ScrollBlot) => Delta;
9
+ interface ClipboardOptions {
10
+ matchers: [Selector, Matcher][];
11
+ }
12
+ declare class Clipboard extends Module<ClipboardOptions> {
13
+ static DEFAULTS: ClipboardOptions;
14
+ matchers: [Selector, Matcher][];
15
+ constructor(rich: Rich, options: Partial<ClipboardOptions>);
16
+ addMatcher(selector: Selector, matcher: Matcher): void;
17
+ convert({ html, text }: {
18
+ html?: string;
19
+ text?: string;
20
+ }, formats?: Record<string, unknown>): Delta;
21
+ protected normalizeHTML(doc: Document): void;
22
+ protected convertHTML(html: string): Delta;
23
+ dangerouslyPasteHTML(html: string, source?: EmitterSource): void;
24
+ dangerouslyPasteHTML(index: number, html: string, source?: EmitterSource): void;
25
+ onCaptureCopy(e: ClipboardEvent, isCut?: boolean): void;
26
+ private normalizeURIList;
27
+ onCapturePaste(e: ClipboardEvent): void;
28
+ onCopy(range: Range, isCut: boolean): {
29
+ html: string;
30
+ text: string;
31
+ };
32
+ onPaste(range: Range, { text, html }: {
33
+ text?: string;
34
+ html?: string;
35
+ }): void;
36
+ prepareMatching(container: Element, nodeMatches: WeakMap<Node, Matcher[]>): Matcher[][];
37
+ }
38
+ declare function traverse(scroll: ScrollBlot, node: ChildNode, elementMatchers: Matcher[], textMatchers: Matcher[], nodeMatches: WeakMap<Node, Matcher[]>): Delta;
39
+ declare function matchAttributor(node: HTMLElement, delta: Delta, scroll: ScrollBlot): Delta;
40
+ declare function matchBlot(node: Node, delta: Delta, scroll: ScrollBlot): Delta;
41
+ declare function matchNewline(node: Node, delta: Delta, scroll: ScrollBlot): Delta;
42
+ declare function matchText(node: HTMLElement, delta: Delta, scroll: ScrollBlot): Delta;
43
+ export { Clipboard as default, matchAttributor, matchBlot, matchNewline, matchText, traverse, };
@@ -0,0 +1,36 @@
1
+ import type Scroll from '../blots/scroll.js';
2
+ import Module from '../core/module.js';
3
+ import Rich from '../core/rich.js';
4
+ import type { Range } from '../core/selection.js';
5
+ import type Delta from '../delta';
6
+ export interface HistoryOptions {
7
+ userOnly: boolean;
8
+ delay: number;
9
+ maxStack: number;
10
+ }
11
+ export interface StackItem {
12
+ delta: Delta;
13
+ range: Range | null;
14
+ }
15
+ interface Stack {
16
+ undo: StackItem[];
17
+ redo: StackItem[];
18
+ }
19
+ declare class History extends Module<HistoryOptions> {
20
+ static DEFAULTS: HistoryOptions;
21
+ lastRecorded: number;
22
+ ignoreChange: boolean;
23
+ stack: Stack;
24
+ currentRange: Range | null;
25
+ constructor(rich: Rich, options: Partial<HistoryOptions>);
26
+ change(source: 'undo' | 'redo', dest: 'redo' | 'undo'): void;
27
+ clear(): void;
28
+ cutoff(): void;
29
+ record(changeDelta: Delta, oldDelta: Delta): void;
30
+ redo(): void;
31
+ transform(delta: Delta): void;
32
+ undo(): void;
33
+ protected restoreSelection(stackItem: StackItem): void;
34
+ }
35
+ declare function getLastChangeIndex(scroll: Scroll, delta: Delta): number;
36
+ export { History as default, getLastChangeIndex };
@@ -0,0 +1,10 @@
1
+ import Module from '../core/module.js';
2
+ import Rich from '../core/rich.js';
3
+ declare class Input extends Module {
4
+ constructor(rich: Rich, options: Record<string, never>);
5
+ private deleteRange;
6
+ private replaceText;
7
+ private handleBeforeInput;
8
+ private handleCompositionStart;
9
+ }
10
+ export default Input;
@@ -0,0 +1,58 @@
1
+ import type { BlockEmbed } from '../blots/block.js';
2
+ import Module from '../core/module.js';
3
+ import Rich from '../core/rich.js';
4
+ import type { Range } from '../core/selection.js';
5
+ import type { BlockBlot } from '../parchment';
6
+ declare const SHORTKEY: string;
7
+ export interface Context {
8
+ collapsed: boolean;
9
+ empty: boolean;
10
+ offset: number;
11
+ prefix: string;
12
+ suffix: string;
13
+ format: Record<string, unknown>;
14
+ event: KeyboardEvent;
15
+ line: BlockEmbed | BlockBlot;
16
+ }
17
+ interface BindingObject extends Partial<Omit<Context, 'prefix' | 'suffix' | 'format'>> {
18
+ key: number | string | string[];
19
+ shortKey?: boolean | null;
20
+ shiftKey?: boolean | null;
21
+ altKey?: boolean | null;
22
+ metaKey?: boolean | null;
23
+ ctrlKey?: boolean | null;
24
+ prefix?: RegExp;
25
+ suffix?: RegExp;
26
+ format?: Record<string, unknown> | string[];
27
+ handler?: (this: {
28
+ rich: Rich;
29
+ }, range: Range, curContext: Context, binding: NormalizedBinding) => boolean | void;
30
+ }
31
+ type Binding = BindingObject | string | number;
32
+ interface NormalizedBinding extends Omit<BindingObject, 'key' | 'shortKey'> {
33
+ key: string | number;
34
+ }
35
+ interface KeyboardOptions {
36
+ bindings: Record<string, Binding>;
37
+ }
38
+ interface KeyboardOptions {
39
+ bindings: Record<string, Binding>;
40
+ }
41
+ declare class Keyboard extends Module<KeyboardOptions> {
42
+ static DEFAULTS: KeyboardOptions;
43
+ static match(evt: KeyboardEvent, binding: BindingObject): boolean;
44
+ bindings: Record<string, NormalizedBinding[]>;
45
+ constructor(rich: Rich, options: Partial<KeyboardOptions>);
46
+ addBinding(keyBinding: Binding, context?: Required<BindingObject['handler']> | Partial<Omit<BindingObject, 'key' | 'handler'>>, handler?: Required<BindingObject['handler']> | Partial<Omit<BindingObject, 'key' | 'handler'>>): void;
47
+ listen(): void;
48
+ handleBackspace(range: Range, context: Context): void;
49
+ handleDelete(range: Range, context: Context): void;
50
+ handleDeleteRange(range: Range): void;
51
+ handleEnter(range: Range, context: Context): void;
52
+ }
53
+ declare function normalize(binding: Binding): BindingObject | null;
54
+ declare function deleteRange({ rich, range }: {
55
+ rich: Rich;
56
+ range: Range;
57
+ }): void;
58
+ export { Keyboard as default, deleteRange, normalize, SHORTKEY };
@@ -0,0 +1,2 @@
1
+ declare const normalizeExternalHTML: (doc: Document) => void;
2
+ export default normalizeExternalHTML;
@@ -0,0 +1 @@
1
+ export default function normalize(doc: Document): void;
@@ -0,0 +1 @@
1
+ export default function normalize(doc: Document): void;
@@ -0,0 +1,50 @@
1
+ import Inline from '../blots/inline.js';
2
+ import Module from '../core/module.js';
3
+ import Rich from '../core/rich.js';
4
+ import Delta from '../delta';
5
+ import CodeBlock, { CodeBlockContainer } from '../formats/code.js';
6
+ import type { Blot, ScrollBlot } from '../parchment';
7
+ declare class CodeToken extends Inline {
8
+ static formats(node: Element, scroll: ScrollBlot): any;
9
+ constructor(scroll: ScrollBlot, domNode: Node, value: unknown);
10
+ format(format: string, value: unknown): void;
11
+ optimize(...args: unknown[]): void;
12
+ }
13
+ declare class SyntaxCodeBlock extends CodeBlock {
14
+ static create(value: unknown): HTMLElement;
15
+ static formats(domNode: Node): any;
16
+ static register(): void;
17
+ format(name: string, value: unknown): void;
18
+ replaceWith(name: string | Blot, value?: any): Blot;
19
+ }
20
+ declare class SyntaxCodeBlockContainer extends CodeBlockContainer {
21
+ forceNext?: boolean;
22
+ cachedText?: string | null;
23
+ attach(): void;
24
+ format(name: string, value: unknown): void;
25
+ formatAt(index: number, length: number, name: string, value: unknown): void;
26
+ highlight(highlight: (text: string, language: string) => Delta, forced?: boolean): void;
27
+ html(index: number, length: number): string;
28
+ optimize(context: Record<string, any>): void;
29
+ }
30
+ interface SyntaxOptions {
31
+ interval: number;
32
+ languages: {
33
+ key: string;
34
+ label: string;
35
+ }[];
36
+ hljs: any;
37
+ }
38
+ declare class Syntax extends Module<SyntaxOptions> {
39
+ static DEFAULTS: SyntaxOptions & {
40
+ hljs: any;
41
+ };
42
+ static register(): void;
43
+ languages: Record<string, true>;
44
+ constructor(rich: Rich, options: Partial<SyntaxOptions>);
45
+ initListener(): void;
46
+ initTimer(): void;
47
+ highlight(blot?: SyntaxCodeBlockContainer | null, force?: boolean): void;
48
+ highlightBlot(text: string, language?: string): Delta;
49
+ }
50
+ export { SyntaxCodeBlock as CodeBlock, CodeToken, Syntax as default };
@@ -0,0 +1,20 @@
1
+ import Module from '../core/module.js';
2
+ import { TableCell, TableRow } from '../formats/table.js';
3
+ declare class Table extends Module {
4
+ static register(): void;
5
+ constructor(...args: ConstructorParameters<typeof Module>);
6
+ balanceTables(): void;
7
+ deleteColumn(): void;
8
+ deleteRow(): void;
9
+ deleteTable(): void;
10
+ getTable(range?: import("../core.js").Range | null): [null, null, null, -1] | [Table, TableRow, TableCell, number];
11
+ insertColumn(offset: number): void;
12
+ insertColumnLeft(): void;
13
+ insertColumnRight(): void;
14
+ insertRow(offset: number): void;
15
+ insertRowAbove(): void;
16
+ insertRowBelow(): void;
17
+ insertTable(rows: number, columns: number): void;
18
+ listenBalanceCells(): void;
19
+ }
20
+ export default Table;
@@ -0,0 +1,27 @@
1
+ import Module from '../core/module.js';
2
+ import type { Op } from '../delta';
3
+ import Delta from '../delta';
4
+ export type CellData = {
5
+ content?: Delta['ops'];
6
+ attributes?: Record<string, unknown>;
7
+ };
8
+ export type TableRowColumnOp = Omit<Op, 'insert'> & {
9
+ insert?: {
10
+ id: string;
11
+ };
12
+ };
13
+ export interface TableData {
14
+ rows?: Delta['ops'];
15
+ columns?: Delta['ops'];
16
+ cells?: Record<string, CellData>;
17
+ }
18
+ export declare const composePosition: (delta: Delta, index: number) => number | null;
19
+ export declare const tableHandler: {
20
+ compose(a: TableData, b: TableData, keepNull?: boolean): TableData;
21
+ transform(a: TableData, b: TableData, priority: boolean): TableData;
22
+ invert(change: TableData, base: TableData): TableData;
23
+ };
24
+ declare class TableEmbed extends Module {
25
+ static register(): void;
26
+ }
27
+ export default TableEmbed;
@@ -0,0 +1,24 @@
1
+ import Module from '../core/module.js';
2
+ import Rich from '../core/rich.js';
3
+ import type { Range } from '../core/selection.js';
4
+ type Handler = (this: Toolbar, value: any) => void;
5
+ export type ToolbarConfig = Array<string[] | Array<string | Record<string, unknown>>>;
6
+ export interface ToolbarProps {
7
+ container?: HTMLElement | ToolbarConfig | null;
8
+ handlers?: Record<string, Handler>;
9
+ option?: number;
10
+ module?: boolean;
11
+ theme?: boolean;
12
+ }
13
+ declare class Toolbar extends Module<ToolbarProps> {
14
+ static DEFAULTS: ToolbarProps;
15
+ container?: HTMLElement | null;
16
+ controls: [string, HTMLElement][];
17
+ handlers: Record<string, Handler>;
18
+ constructor(rich: Rich, options: Partial<ToolbarProps>);
19
+ addHandler(format: string, handler: Handler): void;
20
+ attach(input: HTMLElement): void;
21
+ update(range: Range | null): void;
22
+ }
23
+ declare function addControls(container: HTMLElement, groups: (string | Record<string, unknown>)[][] | (string | Record<string, unknown>)[]): void;
24
+ export { addControls, Toolbar as default };
@@ -0,0 +1,19 @@
1
+ import Module from '../core/module.js';
2
+ import Rich from '../core/rich.js';
3
+ export declare const TTL_FOR_VALID_SELECTION_CHANGE = 100;
4
+ declare class UINode extends Module {
5
+ isListening: boolean;
6
+ selectionChangeDeadline: number;
7
+ constructor(rich: Rich, options: Record<string, never>);
8
+ private handleArrowKeys;
9
+ private handleNavigationShortcuts;
10
+ /**
11
+ * We only listen to the `selectionchange` event when
12
+ * there is an intention of moving the caret to the beginning using shortcuts.
13
+ * This is primarily implemented to prevent infinite loops, as we are changing
14
+ * the selection within the handler of a `selectionchange` event.
15
+ */
16
+ private ensureListeningToSelectionChange;
17
+ private handleSelectionChange;
18
+ }
19
+ export default UINode;
@@ -0,0 +1,15 @@
1
+ import Module from '../core/module.js';
2
+ import type Rich from '../core/rich.js';
3
+ import type { Range } from '../core/selection.js';
4
+ interface UploaderOptions {
5
+ mimetypes: string[];
6
+ handler: (this: {
7
+ rich: Rich;
8
+ }, range: Range, files: File[]) => void;
9
+ }
10
+ declare class Uploader extends Module<UploaderOptions> {
11
+ static DEFAULTS: UploaderOptions;
12
+ constructor(rich: Rich, options: Partial<UploaderOptions>);
13
+ upload(range: Range, files: FileList | File[]): void;
14
+ }
15
+ export default Uploader;
@@ -0,0 +1,17 @@
1
+ import Scope from '../scope.js';
2
+ export interface AttributorOptions {
3
+ scope?: Scope;
4
+ whitelist?: string[];
5
+ }
6
+ export default class Attributor {
7
+ readonly attrName: string;
8
+ readonly keyName: string;
9
+ static keys(node: HTMLElement): string[];
10
+ scope: Scope;
11
+ whitelist: string[] | undefined;
12
+ constructor(attrName: string, keyName: string, options?: AttributorOptions);
13
+ add(node: HTMLElement, value: any): boolean;
14
+ canAdd(_node: HTMLElement, value: any): boolean;
15
+ remove(node: HTMLElement): void;
16
+ value(node: HTMLElement): any;
17
+ }
@@ -0,0 +1,8 @@
1
+ import Attributor from './attributor.js';
2
+ declare class ClassAttributor extends Attributor {
3
+ static keys(node: HTMLElement): string[];
4
+ add(node: HTMLElement, value: any): boolean;
5
+ remove(node: HTMLElement): void;
6
+ value(node: HTMLElement): any;
7
+ }
8
+ export default ClassAttributor;
@@ -0,0 +1,15 @@
1
+ import type { Formattable } from '../blot/abstract/blot.js';
2
+ import Attributor from './attributor.js';
3
+ declare class AttributorStore {
4
+ private attributes;
5
+ private domNode;
6
+ constructor(domNode: HTMLElement);
7
+ attribute(attribute: Attributor, value: any): void;
8
+ build(): void;
9
+ copy(target: Formattable): void;
10
+ move(target: Formattable): void;
11
+ values(): {
12
+ [key: string]: any;
13
+ };
14
+ }
15
+ export default AttributorStore;
@@ -0,0 +1,8 @@
1
+ import Attributor from './attributor.js';
2
+ declare class StyleAttributor extends Attributor {
3
+ static keys(node: HTMLElement): string[];
4
+ add(node: HTMLElement, value: any): boolean;
5
+ remove(node: HTMLElement): void;
6
+ value(node: HTMLElement): any;
7
+ }
8
+ export default StyleAttributor;
@@ -0,0 +1,115 @@
1
+ import type LinkedList from '../../collection/linked-list.js';
2
+ import type LinkedNode from '../../collection/linked-node.js';
3
+ import type { RegistryDefinition } from '../../registry.js';
4
+ import Scope from '../../scope.js';
5
+ export interface BlotConstructor {
6
+ new (...args: any[]): Blot;
7
+ /**
8
+ * Creates corresponding DOM node
9
+ */
10
+ create(value?: any): Node;
11
+ blotName: string;
12
+ tagName: string | string[];
13
+ scope: Scope;
14
+ className?: string;
15
+ requiredContainer?: BlotConstructor;
16
+ allowedChildren?: BlotConstructor[];
17
+ defaultChild?: BlotConstructor;
18
+ }
19
+ /**
20
+ * Blots are the basic building blocks of a Parchment document.
21
+ *
22
+ * Several basic implementations such as Block, Inline, and Embed are provided.
23
+ * In general you will want to extend one of these, instead of building from scratch.
24
+ * After implementation, blots need to be registered before usage.
25
+ *
26
+ * At the very minimum a Blot must be named with a static blotName and associated with either a tagName or className.
27
+ * If a Blot is defined with both a tag and class, the class takes precedence, but the tag may be used as a fallback.
28
+ * Blots must also have a scope, which determine if it is inline or block.
29
+ */
30
+ export interface Blot extends LinkedNode {
31
+ scroll: Root;
32
+ parent: Parent;
33
+ prev: Blot | null;
34
+ next: Blot | null;
35
+ domNode: Node;
36
+ statics: BlotConstructor;
37
+ attach(): void;
38
+ clone(): Blot;
39
+ detach(): void;
40
+ isolate(index: number, length: number): Blot;
41
+ /**
42
+ * For leaves, length of blot's value()
43
+ * For parents, sum of children's values
44
+ */
45
+ length(): number;
46
+ /**
47
+ * Returns offset between this blot and an ancestor's
48
+ */
49
+ offset(root?: Blot): number;
50
+ remove(): void;
51
+ replaceWith(name: string, value: any): Blot;
52
+ replaceWith(replacement: Blot): Blot;
53
+ split(index: number, force?: boolean): Blot | null;
54
+ wrap(name: string, value?: any): Parent;
55
+ wrap(wrapper: Parent): Parent;
56
+ deleteAt(index: number, length: number): void;
57
+ formatAt(index: number, length: number, name: string, value: any): void;
58
+ insertAt(index: number, value: string, def?: any): void;
59
+ /**
60
+ * Called after update cycle completes. Cannot change the value or length
61
+ * of the document, and any DOM operation must reduce complexity of the DOM
62
+ * tree. A shared context object is passed through all blots.
63
+ */
64
+ optimize(context: {
65
+ [key: string]: any;
66
+ }): void;
67
+ optimize(mutations: MutationRecord[], context: {
68
+ [key: string]: any;
69
+ }): void;
70
+ /**
71
+ * Called when blot changes, with the mutation records of its change.
72
+ * Internal records of the blot values can be updated, and modifications of
73
+ * the blot itself is permitted. Can be trigger from user change or API call.
74
+ * A shared context object is passed through all blots.
75
+ */
76
+ update(mutations: MutationRecord[], context: {
77
+ [key: string]: any;
78
+ }): void;
79
+ }
80
+ export interface Parent extends Blot {
81
+ children: LinkedList<Blot>;
82
+ domNode: HTMLElement;
83
+ appendChild(child: Blot): void;
84
+ descendant<T>(type: new () => T, index: number): [T, number];
85
+ descendant<T>(matcher: (blot: Blot) => boolean, index: number): [T, number];
86
+ descendants<T>(type: new () => T, index: number, length: number): T[];
87
+ descendants<T>(matcher: (blot: Blot) => boolean, index: number, length: number): T[];
88
+ insertBefore(child: Blot, refNode?: Blot | null): void;
89
+ moveChildren(parent: Parent, refNode?: Blot | null): void;
90
+ path(index: number, inclusive?: boolean): [Blot, number][];
91
+ removeChild(child: Blot): void;
92
+ unwrap(): void;
93
+ }
94
+ export interface Root extends Parent {
95
+ create(input: Node | string | Scope, value?: any): Blot;
96
+ find(node: Node | null, bubble?: boolean): Blot | null;
97
+ query(query: string | Node | Scope, scope?: Scope): RegistryDefinition | null;
98
+ }
99
+ export interface Formattable extends Blot {
100
+ /**
101
+ * Apply format to blot. Should not pass onto child or other blot.
102
+ */
103
+ format(name: string, value: any): void;
104
+ /**
105
+ * Return formats represented by blot, including from Attributors.
106
+ */
107
+ formats(): {
108
+ [index: string]: any;
109
+ };
110
+ }
111
+ export interface Leaf extends Blot {
112
+ index(node: Node, offset: number): number;
113
+ position(index: number, inclusive: boolean): [Node, number];
114
+ value(): any;
115
+ }
@@ -0,0 +1,18 @@
1
+ import Scope from '../../scope.js';
2
+ import BlockBlot from '../block.js';
3
+ import ParentBlot from './parent.js';
4
+ declare class ContainerBlot extends ParentBlot {
5
+ static blotName: string;
6
+ static scope: Scope;
7
+ static tagName: string | string[];
8
+ prev: BlockBlot | ContainerBlot | null;
9
+ next: BlockBlot | ContainerBlot | null;
10
+ checkMerge(): boolean;
11
+ deleteAt(index: number, length: number): void;
12
+ formatAt(index: number, length: number, name: string, value: any): void;
13
+ insertAt(index: number, value: string, def?: any): void;
14
+ optimize(context: {
15
+ [key: string]: any;
16
+ }): void;
17
+ }
18
+ export default ContainerBlot;
@@ -0,0 +1,29 @@
1
+ import Scope from '../../scope.js';
2
+ import type { Leaf } from './blot.js';
3
+ import ShadowBlot from './shadow.js';
4
+ declare class LeafBlot extends ShadowBlot implements Leaf {
5
+ static scope: Scope;
6
+ /**
7
+ * Returns the value represented by domNode if it is this Blot's type
8
+ * No checking that domNode can represent this Blot type is required so
9
+ * applications needing it should check externally before calling.
10
+ */
11
+ static value(_domNode: Node): any;
12
+ /**
13
+ * Given location represented by node and offset from DOM Selection Range,
14
+ * return index to that location.
15
+ */
16
+ index(node: Node, offset: number): number;
17
+ /**
18
+ * Given index to location within blot, return node and offset representing
19
+ * that location, consumable by DOM Selection Range
20
+ */
21
+ position(index: number, _inclusive?: boolean): [Node, number];
22
+ /**
23
+ * Return value represented by this blot
24
+ * Should not change without interaction from API or
25
+ * user change detectable by update()
26
+ */
27
+ value(): any;
28
+ }
29
+ export default LeafBlot;
@@ -0,0 +1,50 @@
1
+ import LinkedList from '../../collection/linked-list.js';
2
+ import type { Blot, BlotConstructor, Parent, Root } from './blot.js';
3
+ import ShadowBlot from './shadow.js';
4
+ declare class ParentBlot extends ShadowBlot implements Parent {
5
+ /**
6
+ * Whitelist array of Blots that can be direct children.
7
+ */
8
+ static allowedChildren?: BlotConstructor[];
9
+ /**
10
+ * Default child blot to be inserted if this blot becomes empty.
11
+ */
12
+ static defaultChild?: BlotConstructor;
13
+ static uiClass: string;
14
+ children: LinkedList<Blot>;
15
+ domNode: HTMLElement;
16
+ uiNode: HTMLElement | null;
17
+ constructor(scroll: Root, domNode: Node);
18
+ appendChild(other: Blot): void;
19
+ attach(): void;
20
+ attachUI(node: HTMLElement): void;
21
+ /**
22
+ * Called during construction, should fill its own children LinkedList.
23
+ */
24
+ build(): void;
25
+ deleteAt(index: number, length: number): void;
26
+ descendant<T extends Blot>(criteria: new (...args: any[]) => T, index: number): [T | null, number];
27
+ descendant(criteria: (blot: Blot) => boolean, index: number): [Blot | null, number];
28
+ descendants<T extends Blot>(criteria: new (...args: any[]) => T, index?: number, length?: number): T[];
29
+ descendants(criteria: (blot: Blot) => boolean, index?: number, length?: number): Blot[];
30
+ detach(): void;
31
+ enforceAllowedChildren(): void;
32
+ formatAt(index: number, length: number, name: string, value: any): void;
33
+ insertAt(index: number, value: string, def?: any): void;
34
+ insertBefore(childBlot: Blot, refBlot?: Blot | null): void;
35
+ length(): number;
36
+ moveChildren(targetParent: Parent, refNode?: Blot | null): void;
37
+ optimize(context?: {
38
+ [key: string]: any;
39
+ }): void;
40
+ path(index: number, inclusive?: boolean): [Blot, number][];
41
+ removeChild(child: Blot): void;
42
+ replaceWith(name: string | Blot, value?: any): Blot;
43
+ split(index: number, force?: boolean): Blot | null;
44
+ splitAfter(child: Blot): Parent;
45
+ unwrap(): void;
46
+ update(mutations: MutationRecord[], _context: {
47
+ [key: string]: any;
48
+ }): void;
49
+ }
50
+ export default ParentBlot;