@unicom-cloud/ui 0.8.111 → 0.8.113

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 (431) hide show
  1. package/Affix.js +3 -3
  2. package/Alert.js +1 -1
  3. package/AutoComplete.js +1 -1
  4. package/BackTop.js +1 -1
  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 +2 -2
  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 +3 -47
  17. package/Countdown.js +9 -43
  18. package/DatePicker.js +1 -1
  19. package/Descriptions.js +1 -1
  20. package/Details.js +7 -43
  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 +8 -44
  27. package/Form.js +1 -1
  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 +1 -1
  34. package/LiquidFill.js +9 -44
  35. package/List.js +1 -1
  36. package/Loading.js +7 -43
  37. package/Marquee.js +10 -33
  38. package/Mentions.js +1 -1
  39. package/Menu.js +1 -1
  40. package/Message.js +1 -1
  41. package/Modal.js +1 -1
  42. package/Notice.js +6 -42
  43. package/Notification.js +1 -1
  44. package/OverflowEllipsis.js +2 -2
  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 +7 -44
  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 +12 -13
  55. package/Segmented.js +8 -43
  56. package/Skeleton.js +1 -1
  57. package/Slider.js +1 -1
  58. package/Space.js +8 -44
  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 +1 -1
  66. package/Tooltip.js +1 -1
  67. package/Tour.js +10 -46
  68. package/Transfer.js +1 -1
  69. package/Tree.js +1 -1
  70. package/TreeSelect.js +1 -1
  71. package/Trigger.js +2 -2
  72. package/affix/index.js +3 -3
  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 +1 -1
  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 +2 -2
  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 +1 -1
  90. package/carousel/Indicator.js +1 -1
  91. package/carousel/index.js +2 -2
  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/{Y_GQsZUt.js → 3t4FwEoB.js} +1 -1
  100. package/chunk/{Lyh0cz3R.js → BHAu6wbC.js} +1 -1
  101. package/chunk/{CgN4U7Ou.js → Bcl7dWlJ.js} +2 -2
  102. package/chunk/Bl3hZtxi.js +51 -0
  103. package/chunk/{n1tirBXA.js → Bzx5BueA.js} +4 -4
  104. package/chunk/CAA93JLq.js +6 -0
  105. package/chunk/{B8W1N4er.js → CHQ8c547.js} +11 -10
  106. package/chunk/CVMFAeSw.js +39 -0
  107. package/chunk/{BcEZk8pT.js → CYDaUML7.js} +73 -104
  108. package/chunk/{Dbw0YUY1.js → CbXCgtzv.js} +48 -82
  109. package/chunk/{BDgzrqDN.js → ClNkxEcR.js} +5 -5
  110. package/chunk/{BlflTd2i.js → CwLSam2p.js} +433 -470
  111. package/chunk/Cy26_CKq.js +33 -0
  112. package/chunk/D0dVE1v1.js +1839 -0
  113. package/chunk/{CFyN9Eio.js → DA5AMZwY.js} +4 -4
  114. package/chunk/{DSqW_efI.js → DB0hUIM1.js} +152 -156
  115. package/chunk/{BUNoUPLs.js → De8RLlOK.js} +1 -1
  116. package/chunk/{qsVvkBLU.js → DrYaod6k.js} +1 -1
  117. package/chunk/{BeHcDey_.js → DzlfiVe2.js} +1 -1
  118. package/chunk/gJsdBcpG.js +10 -0
  119. package/chunk/{BnUWOu3_.js → yWKJUe_w.js} +3 -3
  120. package/collapse/Collapse.js +1 -1
  121. package/collapse/Item.js +1 -1
  122. package/color-picker/ControlBar.js +1 -1
  123. package/color-picker/InputAlpha.js +1 -1
  124. package/color-picker/InputHex.js +1 -1
  125. package/color-picker/InputRgb.js +1 -1
  126. package/color-picker/Palette.js +1 -1
  127. package/color-picker/Panel.js +2 -2
  128. package/color-picker/index.js +1 -1
  129. package/comment/index.js +1 -1
  130. package/config-provider/ConfigProvider.js +1 -1
  131. package/config-provider/context.js +1 -1
  132. package/config-provider/index.js +2 -2
  133. package/copy/index.js +22 -66
  134. package/countdown/index.js +34 -68
  135. package/date-picker/Picker.js +1 -1
  136. package/date-picker/RangePicker.js +2 -2
  137. package/date-picker/index.js +1 -1
  138. package/descriptions/index.js +1 -1
  139. package/details/index.js +39 -75
  140. package/development/index.js +1 -1
  141. package/divider/index.js +1 -1
  142. package/draggable/index.js +1 -1
  143. package/drawer/Drawer.js +1 -1
  144. package/dropdown/Button.js +1 -1
  145. package/dropdown/index.js +1 -1
  146. package/empty/index.js +1 -1
  147. package/flex/index.js +30 -64
  148. package/form/Form.js +2 -2
  149. package/form/FormItem.js +1 -1
  150. package/form/index.js +1 -1
  151. package/grid/Grid.js +1 -1
  152. package/grid/Item.js +1 -1
  153. package/hooks/index.js +81 -81
  154. package/hooks/useId.js +1 -1
  155. package/hooks/useIsomorphicLayoutEffect.js +1 -1
  156. package/hooks/useResizeObserver.js +15 -2
  157. package/hooks/useStateWithPromise.js +1 -1
  158. package/hooks/useWindowSize.js +1 -1
  159. package/icon/index.js +1 -1
  160. package/icon-hover/index.js +1 -1
  161. package/icons/file.js +1 -1
  162. package/image/Image.js +2 -2
  163. package/image/ImagePreview.js +10 -45
  164. package/image/ImagePreviewArrow.js +1 -1
  165. package/image/ImagePreviewGroup.js +1 -1
  166. package/image/index.js +1 -1
  167. package/index.js +215 -215
  168. package/input/Button.js +1 -1
  169. package/input/Group.js +1 -1
  170. package/input/Input.js +2 -2
  171. package/input/InputElement.js +2 -2
  172. package/input/Password.js +1 -1
  173. package/input/Search.js +1 -1
  174. package/input/Textarea.js +2 -2
  175. package/input-number/index.js +1 -1
  176. package/input-number/useSelectionRange.js +1 -1
  177. package/input-tag/InputTag.js +1 -1
  178. package/layout/Content.js +1 -1
  179. package/layout/Footer.js +1 -1
  180. package/layout/Header.js +1 -1
  181. package/layout/Sider.js +1 -1
  182. package/layout/index.js +1 -1
  183. package/link/index.js +1 -1
  184. package/liquid-fill/index.js +49 -84
  185. package/list/Item.js +1 -1
  186. package/list/Meta.js +1 -1
  187. package/list/index.js +1 -1
  188. package/loading/index.js +19 -55
  189. package/marquee/index.js +58 -81
  190. package/marquee-/index.js +60 -83
  191. package/mentions/index.js +1 -1
  192. package/menu/Menu.js +3 -3
  193. package/menu/OverflowWrap.js +2 -2
  194. package/menu/index.js +2 -2
  195. package/message/index.js +1 -1
  196. package/message/useMessage.js +1 -1
  197. package/modal/Confirm.js +2 -2
  198. package/modal/Modal.js +2 -2
  199. package/modal/index.js +2 -2
  200. package/notice/index.js +6 -42
  201. package/notification/index.js +1 -1
  202. package/notification/useNotification.js +1 -1
  203. package/overflow-ellipsis/OverflowItem.js +2 -2
  204. package/overflow-ellipsis/index.js +2 -2
  205. package/package.json +1 -1
  206. package/page-header/index.js +2 -2
  207. package/pagination/PageItem.js +1 -1
  208. package/pagination/PageJumper.js +1 -1
  209. package/pagination/PageOption.js +1 -1
  210. package/pagination/Pagination.js +1 -1
  211. package/picker/Input.js +1 -1
  212. package/picker/InputRange.js +1 -1
  213. package/popconfirm/index.js +1 -1
  214. package/popover/index.js +1 -1
  215. package/progress/CircleProgress.js +1 -1
  216. package/progress/index.js +1 -1
  217. package/qr-code/index.js +19 -56
  218. package/radio/Group.js +2 -2
  219. package/radio/GroupBlock.js +2 -2
  220. package/radio/Radio.js +2 -2
  221. package/radio/index.js +2 -2
  222. package/rate/index.js +1 -1
  223. package/resize-box/ResizeTrigger.js +2 -2
  224. package/resize-box/Split.js +2 -2
  225. package/resize-box/SplitGroup.js +1 -1
  226. package/resize-box/index.js +1 -1
  227. package/result/index.js +1 -1
  228. package/rich-text/index.js +6333 -78
  229. package/rich-text/lib/diff/index.d.ts +21 -0
  230. package/row-col/Col-.js +1 -1
  231. package/row-col/Col.js +71 -74
  232. package/row-col/Row.js +1 -1
  233. package/segmented/index.js +111 -146
  234. package/select/Option.js +44 -41
  235. package/select/Select.js +11 -13
  236. package/select-view/Core.js +1 -1
  237. package/skeleton/index.js +1 -1
  238. package/slider/Button.js +1 -1
  239. package/slider/index.js +1 -1
  240. package/space/index.js +16 -52
  241. package/spin/DotLoading.js +1 -1
  242. package/spin/index.js +1 -1
  243. package/splitter/Panel.js +1 -1
  244. package/splitter/SplitBar.js +2 -2
  245. package/splitter/Splitter.js +3 -3
  246. package/statistic/index.js +1 -1
  247. package/steps/index.js +1 -1
  248. package/style.css +1 -1
  249. package/switch/index.js +1 -1
  250. package/table/Table.js +18 -7
  251. package/table/index.js +77 -120
  252. package/tabs/Tab.js +3 -3
  253. package/tabs/TabContent.js +2 -2
  254. package/tabs/TabPane.js +1 -1
  255. package/tabs/index.js +2 -2
  256. package/tag/index.js +1 -1
  257. package/time-picker/Picker.js +1 -1
  258. package/time-picker/TimePicker.js +1 -1
  259. package/timeline/Item.js +1 -1
  260. package/timeline/Timeline.js +1 -1
  261. package/tooltip/index.js +1 -1
  262. package/tour/index.js +71 -107
  263. package/transfer/Item.js +2 -2
  264. package/transfer/List.js +2 -2
  265. package/transfer/index.js +1 -1
  266. package/tree/Animation.js +2 -2
  267. package/tree/Node.js +3 -3
  268. package/tree/NodeList.js +1 -1
  269. package/tree/Tree.js +2 -2
  270. package/tree/index.js +1 -1
  271. package/tree-select/Select.js +3 -3
  272. package/tree-select/index.js +1 -1
  273. package/trigger/index.js +2 -2
  274. package/types/common/hooks/src/use-size/index.d.ts +1 -1
  275. package/types/common/hooks/src/utils/isBrowser.d.ts +1 -1
  276. package/types/common/hooks/useResizeObserver.d.ts +1 -5
  277. package/types/common/hooks/useStateWithPromise.d.ts +1 -1
  278. package/types/common/hooks/useWindowSize.d.ts +1 -1
  279. package/types/common/utils/dom.d.ts +12 -0
  280. package/types/common/utils/emitter.d.ts +1 -0
  281. package/types/pc/carousel/interface.d.ts +2 -2
  282. package/types/pc/color-picker/Panel.d.ts +1 -1
  283. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  284. package/types/pc/index.d.ts +2 -2
  285. package/types/pc/list/interface.d.ts +2 -2
  286. package/types/pc/rich-text/index.d.ts +7 -4
  287. package/types/pc/rich-text/interface.d.ts +3 -2
  288. package/types/pc/rich-text/{blots → lib/blots}/scroll.d.ts +2 -8
  289. package/types/pc/rich-text/{core → lib/core}/editor.d.ts +1 -1
  290. package/types/pc/rich-text/{core → lib/core}/emitter.d.ts +2 -3
  291. package/types/pc/rich-text/{core → lib/core}/rich.d.ts +14 -51
  292. package/types/pc/rich-text/{core → lib/core}/selection.d.ts +2 -8
  293. package/types/pc/rich-text/{core → lib/core}/theme.d.ts +3 -0
  294. package/types/pc/rich-text/{core.d.ts → lib/core.d.ts} +1 -1
  295. package/types/pc/rich-text/lib/delta/AttributeMap.d.ts +15 -0
  296. package/types/pc/rich-text/lib/delta/Op.d.ts +13 -0
  297. package/types/pc/rich-text/lib/delta/OpIterator.d.ts +14 -0
  298. package/types/pc/rich-text/lib/delta/index.d.ts +53 -0
  299. package/types/pc/rich-text/lib/diff/index.d.ts +40 -0
  300. package/types/pc/rich-text/{formats → lib/formats}/bold.d.ts +1 -1
  301. package/types/pc/rich-text/{formats → lib/formats}/font.d.ts +1 -1
  302. package/types/pc/rich-text/lib/formats/hr.d.ts +5 -0
  303. package/types/pc/rich-text/lib/formats/image-resize/index.d.ts +27 -0
  304. package/types/pc/rich-text/lib/formats/image-resize/modules/BaseModule.d.ts +10 -0
  305. package/types/pc/rich-text/lib/formats/image-resize/modules/DisplaySize.d.ts +5 -0
  306. package/types/pc/rich-text/lib/formats/image-resize/modules/Resize.d.ts +13 -0
  307. package/types/pc/rich-text/lib/formats/image-resize/options.d.ts +7 -0
  308. package/types/pc/rich-text/lib/formats/liOl.d.ts +10 -0
  309. package/types/pc/rich-text/lib/formats/liUl.d.ts +10 -0
  310. package/types/pc/rich-text/lib/formats/lineHeight.d.ts +3 -0
  311. package/types/pc/rich-text/{formats → lib/formats}/list.d.ts +1 -0
  312. package/types/pc/rich-text/{formats → lib/formats}/table.d.ts +3 -3
  313. package/types/pc/rich-text/{modules → lib/modules}/clipboard.d.ts +2 -2
  314. package/types/pc/rich-text/{modules → lib/modules}/history.d.ts +1 -1
  315. package/types/pc/rich-text/{modules → lib/modules}/keyboard.d.ts +1 -1
  316. package/types/pc/rich-text/{modules → lib/modules}/syntax.d.ts +2 -2
  317. package/types/pc/rich-text/{modules → lib/modules}/tableEmbed.d.ts +3 -3
  318. package/types/pc/rich-text/{modules → lib/modules}/toolbar.d.ts +1 -1
  319. package/types/pc/rich-text/{parchment → lib/parchment}/attributor/attributor.d.ts +3 -3
  320. package/types/pc/rich-text/{parchment → lib/parchment}/attributor/style.d.ts +2 -2
  321. package/types/pc/rich-text/{parchment → lib/parchment}/blot/abstract/parent.d.ts +2 -4
  322. package/types/pc/rich-text/{themes → lib/themes}/base.d.ts +3 -0
  323. package/types/pc/rich-text/{themes/snow.d.ts → lib/themes/pqb.d.ts} +2 -2
  324. package/types/pc/rich-text/{ui → lib/ui}/icons.d.ts +5 -1
  325. package/types/pc/rich-text/{ui → lib/ui}/picker.d.ts +1 -0
  326. package/types/pc/rich-text/{ui → lib/ui}/tooltip.d.ts +2 -0
  327. package/types/pc/tabs/hook/useDomSize.d.ts +2 -2
  328. package/types/pc/tabs/hook/useHeaderScroll.d.ts +2 -2
  329. package/types/pc/tree-select/hook/useStateValue.d.ts +2 -2
  330. package/types/pc/utils/date.d.ts +1 -0
  331. package/types/pc/utils/emitter.d.ts +1 -0
  332. package/types/pc/utils/index.d.ts +2 -2
  333. package/typography/Base.js +2 -2
  334. package/typography/Ellipsis.js +70 -114
  335. package/typography/Operations.js +29 -74
  336. package/typography/Paragraph.js +1 -1
  337. package/typography/Typography.js +1 -1
  338. package/typography/useEllipsis.js +1 -1
  339. package/upload/TriggerNode.js +1 -1
  340. package/upload/Upload.js +1 -1
  341. package/utils/contextHolder.js +1 -1
  342. package/utils/date.js +1 -0
  343. package/utils/emitter.js +5 -0
  344. package/utils/index.js +70 -70
  345. package/utils/resizeObserver.js +1 -1
  346. package/verification-code/VerificationCode.js +1 -1
  347. package/version/index.js +1 -1
  348. package/virtual-list/VirtualList.js +218 -217
  349. package/watermark/Watermark.js +1 -1
  350. package/chunk/BDMqvmVH.js +0 -4239
  351. package/chunk/BG6j6Ct7.js +0 -30
  352. package/chunk/BGJspFG9.js +0 -56
  353. package/chunk/B_c0gPsX.js +0 -83
  354. package/chunk/COsRZOz1.js +0 -1813
  355. package/chunk/CylJZkp8.js +0 -6
  356. package/chunk/Di5KBCVQ.js +0 -4
  357. package/chunk/cW_5U6dL.js +0 -28
  358. package/rich-text/core.js +0 -11
  359. package/rich-text/rich.js +0 -1877
  360. package/types/common/utils/index.d.ts +0 -47
  361. package/types/common/utils/keyboardCode.d.ts +0 -4
  362. package/types/common/utils/math.d.ts +0 -1
  363. package/types/common/utils/mitt.d.ts +0 -1
  364. package/types/common/utils/reactTransitionGroup.d.ts +0 -1
  365. package/types/common/utils/uuid.d.ts +0 -1
  366. package/types/common/utils/validate.d.ts +0 -1
  367. package/types/pc/rich-text/delta/AttributeMap.d.ts +0 -10
  368. package/types/pc/rich-text/delta/Op.d.ts +0 -11
  369. package/types/pc/rich-text/delta/OpIterator.d.ts +0 -13
  370. package/types/pc/rich-text/delta/index.d.ts +0 -45
  371. package/types/pc/rich-text/themes/bubble.d.ts +0 -18
  372. package/types/pc/utils/mitt.d.ts +0 -1
  373. package/utils/mitt.js +0 -5
  374. package/types/common/hooks/src/utils/{index.d.ts → is.d.ts} +0 -0
  375. package/types/pc/rich-text/{blots → lib/blots}/block.d.ts +0 -0
  376. package/types/pc/rich-text/{blots → lib/blots}/break.d.ts +0 -0
  377. package/types/pc/rich-text/{blots → lib/blots}/container.d.ts +0 -0
  378. package/types/pc/rich-text/{blots → lib/blots}/cursor.d.ts +0 -0
  379. package/types/pc/rich-text/{blots → lib/blots}/embed.d.ts +0 -0
  380. package/types/pc/rich-text/{blots → lib/blots}/inline.d.ts +0 -0
  381. package/types/pc/rich-text/{blots → lib/blots}/text.d.ts +0 -0
  382. package/types/pc/rich-text/{core → lib/core}/composition.d.ts +0 -0
  383. package/types/pc/rich-text/{core → lib/core}/instances.d.ts +0 -0
  384. package/types/pc/rich-text/{core → lib/core}/logger.d.ts +0 -0
  385. package/types/pc/rich-text/{core → lib/core}/module.d.ts +0 -0
  386. package/types/pc/rich-text/{core → lib/core}/utils/createRegistryWithFormats.d.ts +0 -0
  387. package/types/pc/rich-text/{core → lib/core}/utils/scrollRectIntoView.d.ts +0 -0
  388. package/types/pc/rich-text/{formats → lib/formats}/align.d.ts +0 -0
  389. package/types/pc/rich-text/{formats → lib/formats}/background.d.ts +0 -0
  390. package/types/pc/rich-text/{formats → lib/formats}/blockquote.d.ts +0 -0
  391. package/types/pc/rich-text/{formats → lib/formats}/code.d.ts +0 -0
  392. package/types/pc/rich-text/{formats → lib/formats}/color.d.ts +0 -0
  393. package/types/pc/rich-text/{formats → lib/formats}/direction.d.ts +0 -0
  394. package/types/pc/rich-text/{formats → lib/formats}/formula.d.ts +0 -0
  395. package/types/pc/rich-text/{formats → lib/formats}/header.d.ts +0 -0
  396. package/types/pc/rich-text/{formats → lib/formats}/image.d.ts +0 -0
  397. package/types/pc/rich-text/{formats → lib/formats}/indent.d.ts +0 -0
  398. package/types/pc/rich-text/{formats → lib/formats}/italic.d.ts +0 -0
  399. package/types/pc/rich-text/{formats → lib/formats}/link.d.ts +0 -0
  400. package/types/pc/rich-text/{formats → lib/formats}/script.d.ts +0 -0
  401. package/types/pc/rich-text/{formats → lib/formats}/size.d.ts +0 -0
  402. package/types/pc/rich-text/{formats → lib/formats}/strike.d.ts +0 -0
  403. package/types/pc/rich-text/{formats → lib/formats}/underline.d.ts +0 -0
  404. package/types/pc/rich-text/{formats → lib/formats}/video.d.ts +0 -0
  405. package/types/pc/rich-text/{rich.d.ts → lib/index.d.ts} +0 -0
  406. package/types/pc/rich-text/{modules → lib/modules}/input.d.ts +0 -0
  407. package/types/pc/rich-text/{modules → lib/modules}/normalizeExternalHTML/index.d.ts +0 -0
  408. package/types/pc/rich-text/{modules → lib/modules}/normalizeExternalHTML/normalizers/googleDocs.d.ts +0 -0
  409. package/types/pc/rich-text/{modules → lib/modules}/normalizeExternalHTML/normalizers/msWord.d.ts +0 -0
  410. package/types/pc/rich-text/{modules → lib/modules}/table.d.ts +0 -0
  411. package/types/pc/rich-text/{modules → lib/modules}/uiNode.d.ts +0 -0
  412. package/types/pc/rich-text/{modules → lib/modules}/uploader.d.ts +0 -0
  413. package/types/pc/rich-text/{parchment → lib/parchment}/attributor/class.d.ts +0 -0
  414. package/types/pc/rich-text/{parchment → lib/parchment}/attributor/store.d.ts +0 -0
  415. package/types/pc/rich-text/{parchment → lib/parchment}/blot/abstract/blot.d.ts +0 -0
  416. package/types/pc/rich-text/{parchment → lib/parchment}/blot/abstract/container.d.ts +0 -0
  417. package/types/pc/rich-text/{parchment → lib/parchment}/blot/abstract/leaf.d.ts +0 -0
  418. package/types/pc/rich-text/{parchment → lib/parchment}/blot/abstract/shadow.d.ts +0 -0
  419. package/types/pc/rich-text/{parchment → lib/parchment}/blot/block.d.ts +0 -0
  420. package/types/pc/rich-text/{parchment → lib/parchment}/blot/embed.d.ts +0 -0
  421. package/types/pc/rich-text/{parchment → lib/parchment}/blot/inline.d.ts +0 -0
  422. package/types/pc/rich-text/{parchment → lib/parchment}/blot/scroll.d.ts +0 -0
  423. package/types/pc/rich-text/{parchment → lib/parchment}/blot/text.d.ts +0 -0
  424. package/types/pc/rich-text/{parchment → lib/parchment}/collection/linked-list.d.ts +0 -0
  425. package/types/pc/rich-text/{parchment → lib/parchment}/collection/linked-node.d.ts +0 -0
  426. package/types/pc/rich-text/{parchment → lib/parchment}/error.d.ts +0 -0
  427. package/types/pc/rich-text/{parchment → lib/parchment}/index.d.ts +1 -1
  428. /package/types/pc/rich-text/{parchment → lib/parchment}/registry.d.ts +0 -0
  429. /package/types/pc/rich-text/{parchment → lib/parchment}/scope.d.ts +0 -0
  430. /package/types/pc/rich-text/{ui → lib/ui}/color-picker.d.ts +0 -0
  431. /package/types/pc/rich-text/{ui → lib/ui}/icon-picker.d.ts +0 -0
package/rich-text/rich.js DELETED
@@ -1,1877 +0,0 @@
1
- import { S as H, C as W, B as $, b as R, R as c, c as L, E as pt, d as X, e as ft, f as bt, T as xt, g as gt, h as y, i as mt, j as yt, D as q, k as K, M as B, t as vt, n as kt, l as Q, m as d, a as J, o as At, F as wt, p as qt, q as Y, r as tt, s as Et, u as et, v as st, w as it, x as Lt, y as St, z as nt, G as Nt, H as Tt } from "../chunk/BDMqvmVH.js";
2
- import { A as Fe, O as ze, I as Pe, P as _e } from "../chunk/BDMqvmVH.js";
3
- import { RICH_TEXT_CLASS_NAME_PREFIX as l } from "./constant.js";
4
- import O from "lodash/merge";
5
- class It extends W {
6
- add(t, e) {
7
- let s = 0;
8
- if (e === "+1" || e === "-1") {
9
- const i = this.value(t) || 0;
10
- s = e === "+1" ? i + 1 : i - 1;
11
- } else typeof e == "number" && (s = e);
12
- return s === 0 ? (this.remove(t), !0) : super.add(t, s.toString());
13
- }
14
- canAdd(t, e) {
15
- return super.canAdd(t, e) || super.canAdd(t, parseInt(e, 10));
16
- }
17
- value(t) {
18
- return parseInt(super.value(t), 10) || void 0;
19
- }
20
- }
21
- const Ct = new It(
22
- "indent",
23
- `${l}-indent`,
24
- {
25
- scope: H.BLOCK,
26
- whitelist: [1, 2, 3, 4, 5, 6, 7, 8]
27
- }
28
- );
29
- class $t extends $ {
30
- static {
31
- this.blotName = "blockquote";
32
- }
33
- static {
34
- this.tagName = "blockquote";
35
- }
36
- }
37
- class Rt extends $ {
38
- static {
39
- this.blotName = "header";
40
- }
41
- static {
42
- this.tagName = ["H1", "H2", "H3", "H4", "H5", "H6"];
43
- }
44
- static formats(t) {
45
- return this.tagName.indexOf(t.tagName) + 1;
46
- }
47
- }
48
- class S extends R {
49
- }
50
- S.blotName = "list-container";
51
- S.tagName = "OL";
52
- class N extends $ {
53
- static create(t) {
54
- const e = super.create();
55
- return e.setAttribute("data-list", t), e;
56
- }
57
- static formats(t) {
58
- return t.getAttribute("data-list") || void 0;
59
- }
60
- static register() {
61
- c.register(S);
62
- }
63
- constructor(t, e) {
64
- super(t, e);
65
- const s = e.ownerDocument.createElement("span"), i = (n) => {
66
- if (!t.isEnabled()) return;
67
- const o = this.statics.formats(e, t);
68
- o === "checked" ? (this.format("list", "unchecked"), n.preventDefault()) : o === "unchecked" && (this.format("list", "checked"), n.preventDefault());
69
- };
70
- s.addEventListener("mousedown", i), s.addEventListener("touchstart", i), this.attachUI(s);
71
- }
72
- format(t, e) {
73
- t === this.statics.blotName && e ? this.domNode.setAttribute("data-list", e) : super.format(t, e);
74
- }
75
- }
76
- N.blotName = "list";
77
- N.tagName = "LI";
78
- S.allowedChildren = [N];
79
- N.requiredContainer = S;
80
- class U extends L {
81
- static {
82
- this.blotName = "bold";
83
- }
84
- static {
85
- this.tagName = ["STRONG", "B"];
86
- }
87
- static create() {
88
- return super.create();
89
- }
90
- static formats() {
91
- return !0;
92
- }
93
- optimize(t) {
94
- super.optimize(t), this.domNode.tagName !== this.statics.tagName[0] && this.replaceWith(this.statics.blotName);
95
- }
96
- }
97
- class Mt extends U {
98
- static {
99
- this.blotName = "italic";
100
- }
101
- static {
102
- this.tagName = ["EM", "I"];
103
- }
104
- }
105
- class I extends L {
106
- static {
107
- this.blotName = "link";
108
- }
109
- static {
110
- this.tagName = "A";
111
- }
112
- static {
113
- this.SANITIZED_URL = "about:blank";
114
- }
115
- static {
116
- this.PROTOCOL_WHITELIST = ["http", "https", "mailto", "tel", "sms"];
117
- }
118
- static create(t) {
119
- const e = super.create(t);
120
- return e.setAttribute("href", this.sanitize(t)), e.setAttribute("rel", "noopener noreferrer"), e.setAttribute("target", "_blank"), e;
121
- }
122
- static formats(t) {
123
- return t.getAttribute("href");
124
- }
125
- static sanitize(t) {
126
- return rt(t, this.PROTOCOL_WHITELIST) ? t : this.SANITIZED_URL;
127
- }
128
- format(t, e) {
129
- t !== this.statics.blotName || !e ? super.format(t, e) : this.domNode.setAttribute("href", this.constructor.sanitize(e));
130
- }
131
- }
132
- function rt(r, t) {
133
- const e = document.createElement("a");
134
- e.href = r;
135
- const s = e.href.slice(0, e.href.indexOf(":"));
136
- return t.indexOf(s) > -1;
137
- }
138
- class Ht extends L {
139
- static {
140
- this.blotName = "script";
141
- }
142
- static {
143
- this.tagName = ["SUB", "SUP"];
144
- }
145
- static create(t) {
146
- return t === "super" ? document.createElement("sup") : t === "sub" ? document.createElement("sub") : super.create(t);
147
- }
148
- static formats(t) {
149
- if (t.tagName === "SUB") return "sub";
150
- if (t.tagName === "SUP") return "super";
151
- }
152
- }
153
- class Bt extends U {
154
- static {
155
- this.blotName = "strike";
156
- }
157
- static {
158
- this.tagName = ["S", "STRIKE"];
159
- }
160
- }
161
- class Ot extends L {
162
- static {
163
- this.blotName = "underline";
164
- }
165
- static {
166
- this.tagName = "U";
167
- }
168
- }
169
- class Ut extends pt {
170
- static {
171
- this.blotName = "formula";
172
- }
173
- static {
174
- this.className = `${l}-formula`;
175
- }
176
- static {
177
- this.tagName = "SPAN";
178
- }
179
- static create(t) {
180
- if (window.katex == null)
181
- throw new Error("Formula module requires KaTeX.");
182
- const e = super.create(t);
183
- return typeof t == "string" && (window.katex.render(t, e, {
184
- throwOnError: !1,
185
- errorColor: "#f00"
186
- }), e.setAttribute("data-value", t)), e;
187
- }
188
- static value(t) {
189
- return t.getAttribute("data-value");
190
- }
191
- html() {
192
- const { formula: t } = this.value();
193
- return `<span>${t}</span>`;
194
- }
195
- }
196
- const D = ["alt", "height", "width"];
197
- class Vt extends X {
198
- static {
199
- this.blotName = "image";
200
- }
201
- static {
202
- this.tagName = "IMG";
203
- }
204
- static create(t) {
205
- const e = super.create(t);
206
- return typeof t == "string" && e.setAttribute("src", this.sanitize(t)), e;
207
- }
208
- static formats(t) {
209
- return D.reduce(
210
- (e, s) => (t.hasAttribute(s) && (e[s] = t.getAttribute(s)), e),
211
- {}
212
- );
213
- }
214
- static match(t) {
215
- return /\.(jpe?g|gif|png)$/.test(t) || /^data:image\/.+;base64/.test(t);
216
- }
217
- static sanitize(t) {
218
- return rt(t, ["http", "https", "data"]) ? t : "//:0";
219
- }
220
- static value(t) {
221
- return t.getAttribute("src");
222
- }
223
- format(t, e) {
224
- D.indexOf(t) > -1 ? e ? this.domNode.setAttribute(t, e) : this.domNode.removeAttribute(t) : super.format(t, e);
225
- }
226
- }
227
- const F = ["height", "width"];
228
- class Zt extends ft {
229
- static {
230
- this.blotName = "video";
231
- }
232
- static {
233
- this.className = `${l}-video`;
234
- }
235
- static {
236
- this.tagName = "IFRAME";
237
- }
238
- static create(t) {
239
- const e = super.create(t);
240
- return e.setAttribute("frameborder", "0"), e.setAttribute("allowfullscreen", "true"), e.setAttribute("src", this.sanitize(t)), e;
241
- }
242
- static formats(t) {
243
- return F.reduce(
244
- (e, s) => (t.hasAttribute(s) && (e[s] = t.getAttribute(s)), e),
245
- {}
246
- );
247
- }
248
- static sanitize(t) {
249
- return I.sanitize(t);
250
- }
251
- static value(t) {
252
- return t.getAttribute("src");
253
- }
254
- format(t, e) {
255
- F.indexOf(t) > -1 ? e ? this.domNode.setAttribute(t, e) : this.domNode.removeAttribute(t) : super.format(t, e);
256
- }
257
- html() {
258
- const { video: t } = this.value();
259
- return `<a href="${t}">${t}</a>`;
260
- }
261
- }
262
- const A = new W("code-token", "hljs", {
263
- scope: H.INLINE
264
- });
265
- class f extends L {
266
- static formats(t, e) {
267
- for (; t != null && t !== e.domNode; ) {
268
- if (t.classList && t.classList.contains(y.className))
269
- return super.formats(t, e);
270
- t = t.parentNode;
271
- }
272
- }
273
- constructor(t, e, s) {
274
- super(t, e, s), A.add(this.domNode, s);
275
- }
276
- format(t, e) {
277
- t !== f.blotName ? super.format(t, e) : e ? A.add(this.domNode, e) : (A.remove(this.domNode), this.domNode.classList.remove(this.statics.className));
278
- }
279
- optimize(...t) {
280
- super.optimize(...t), A.value(this.domNode) || this.unwrap();
281
- }
282
- }
283
- f.blotName = "code-token";
284
- f.className = `${l}-token`;
285
- class u extends y {
286
- static create(t) {
287
- const e = super.create(t);
288
- return typeof t == "string" && e.setAttribute("data-language", t), e;
289
- }
290
- static formats(t) {
291
- return t.getAttribute("data-language") || "plain";
292
- }
293
- static register() {
294
- }
295
- // Syntax module will register
296
- format(t, e) {
297
- t === this.statics.blotName && e ? this.domNode.setAttribute("data-language", e) : super.format(t, e);
298
- }
299
- replaceWith(t, e) {
300
- return this.formatAt(0, this.length(), f.blotName, !1), super.replaceWith(t, e);
301
- }
302
- }
303
- class w extends mt {
304
- attach() {
305
- super.attach(), this.forceNext = !1, this.scroll.emitMount(this);
306
- }
307
- format(t, e) {
308
- t === u.blotName && (this.forceNext = !0, this.children.forEach((s) => {
309
- s.format(t, e);
310
- }));
311
- }
312
- formatAt(t, e, s, i) {
313
- s === u.blotName && (this.forceNext = !0), super.formatAt(t, e, s, i);
314
- }
315
- highlight(t, e = !1) {
316
- if (this.children.head == null) return;
317
- const i = `${Array.from(this.domNode.childNodes).filter(
318
- (o) => o !== this.uiNode
319
- ).map((o) => o.textContent).join(`
320
- `)}
321
- `, n = u.formats(this.children.head.domNode);
322
- if (e || this.forceNext || this.cachedText !== i) {
323
- if (i.trim().length > 0 || this.cachedText == null) {
324
- const o = this.children.reduce((h, b) => h.concat(yt(b, !1)), new q()), a = t(i, n);
325
- o.diff(a).reduce((h, { retain: b, attributes: v }) => b ? (v && Object.keys(v).forEach((m) => {
326
- [u.blotName, f.blotName].includes(m) && this.formatAt(h, b, m, v[m]);
327
- }), h + b) : h, 0);
328
- }
329
- this.cachedText = i, this.forceNext = !1;
330
- }
331
- }
332
- html(t, e) {
333
- const [s] = this.children.find(t);
334
- return `<pre data-language="${s ? u.formats(s.domNode) : "plain"}">
335
- ${K(
336
- this.code(t, e)
337
- )}
338
- </pre>`;
339
- }
340
- optimize(t) {
341
- if (super.optimize(t), this.parent != null && this.children.head != null && this.uiNode != null) {
342
- const e = u.formats(this.children.head.domNode);
343
- e !== this.uiNode.value && (this.uiNode.value = e);
344
- }
345
- }
346
- }
347
- w.allowedChildren = [u];
348
- u.requiredContainer = w;
349
- u.allowedChildren = [f, bt, xt, gt];
350
- const Dt = (r, t, e) => {
351
- if (typeof r.versionString == "string") {
352
- const s = r.versionString.split(".")[0];
353
- if (parseInt(s, 10) >= 11)
354
- return r.highlight(e, { language: t }).value;
355
- }
356
- return r.highlight(t, e).value;
357
- };
358
- class lt extends B {
359
- static register() {
360
- c.register(f, !0), c.register(u, !0), c.register(w, !0);
361
- }
362
- constructor(t, e) {
363
- if (super(t, e), this.options.hljs == null)
364
- throw new Error(
365
- "Syntax module requires highlight.js. Please include the library on the page before Rich."
366
- );
367
- this.languages = this.options.languages.reduce(
368
- (s, { key: i }) => (s[i] = !0, s),
369
- {}
370
- ), this.highlightBlot = this.highlightBlot.bind(this), this.initListener(), this.initTimer();
371
- }
372
- initListener() {
373
- this.rich.on(c.events.SCROLL_BLOT_MOUNT, (t) => {
374
- if (!(t instanceof w)) return;
375
- const e = this.rich.root.ownerDocument.createElement("select");
376
- this.options.languages.forEach(({ key: s, label: i }) => {
377
- const n = e.ownerDocument.createElement("option");
378
- n.textContent = i, n.setAttribute("value", s), e.appendChild(n);
379
- }), e.addEventListener("change", () => {
380
- t.format(u.blotName, e.value), this.rich.root.focus(), this.highlight(t, !0);
381
- }), t.uiNode == null && (t.attachUI(e), t.children.head && (e.value = u.formats(t.children.head.domNode)));
382
- });
383
- }
384
- initTimer() {
385
- let t = null;
386
- this.rich.on(c.events.SCROLL_OPTIMIZE, () => {
387
- t && clearTimeout(t), t = setTimeout(() => {
388
- this.highlight(), t = null;
389
- }, this.options.interval);
390
- });
391
- }
392
- highlight(t = null, e = !1) {
393
- if (this.rich.selection.composing) return;
394
- this.rich.update(c.sources.USER);
395
- const s = this.rich.getSelection();
396
- (t == null ? this.rich.scroll.descendants(w) : [t]).forEach((n) => {
397
- n.highlight(this.highlightBlot, e);
398
- }), this.rich.update(c.sources.SILENT), s != null && this.rich.setSelection(s, c.sources.SILENT);
399
- }
400
- highlightBlot(t, e = "plain") {
401
- if (e = this.languages[e] ? e : "plain", e === "plain")
402
- return K(t).split(`
403
- `).reduce((i, n, o) => (o !== 0 && i.insert(`
404
- `, { [y.blotName]: e }), i.insert(n)), new q());
405
- const s = this.rich.root.ownerDocument.createElement("div");
406
- return s.classList.add(y.className), s.innerHTML = Dt(this.options.hljs, e, t), vt(
407
- this.rich.scroll,
408
- s,
409
- [
410
- (i, n) => {
411
- const o = A.value(i);
412
- return o ? n.compose(
413
- new q().retain(n.length(), {
414
- [f.blotName]: o
415
- })
416
- ) : n;
417
- }
418
- ],
419
- [
420
- (i, n) => i.data.split(`
421
- `).reduce((o, a, h) => (h !== 0 && o.insert(`
422
- `, { [y.blotName]: e }), o.insert(a)), n)
423
- ],
424
- /* @__PURE__ */ new WeakMap()
425
- );
426
- }
427
- }
428
- lt.DEFAULTS = {
429
- hljs: window.hljs,
430
- interval: 1e3,
431
- languages: [
432
- { key: "plain", label: "Plain" },
433
- { key: "bash", label: "Bash" },
434
- { key: "cpp", label: "C++" },
435
- { key: "cs", label: "C#" },
436
- { key: "css", label: "CSS" },
437
- { key: "diff", label: "Diff" },
438
- { key: "xml", label: "HTML/XML" },
439
- { key: "java", label: "Java" },
440
- { key: "javascript", label: "JavaScript" },
441
- { key: "markdown", label: "Markdown" },
442
- { key: "php", label: "PHP" },
443
- { key: "python", label: "Python" },
444
- { key: "ruby", label: "Ruby" },
445
- { key: "sql", label: "SQL" }
446
- ]
447
- };
448
- class p extends $ {
449
- static {
450
- this.blotName = "table";
451
- }
452
- static {
453
- this.tagName = "TD";
454
- }
455
- static create(t) {
456
- const e = super.create();
457
- return t ? e.setAttribute("data-row", t) : e.setAttribute("data-row", V()), e;
458
- }
459
- static formats(t) {
460
- if (t.hasAttribute("data-row"))
461
- return t.getAttribute("data-row");
462
- }
463
- cellOffset() {
464
- return this.parent ? this.parent.children.indexOf(this) : -1;
465
- }
466
- format(t, e) {
467
- t === p.blotName && e ? this.domNode.setAttribute("data-row", e) : super.format(t, e);
468
- }
469
- row() {
470
- return this.parent;
471
- }
472
- rowOffset() {
473
- return this.row() ? this.row().rowOffset() : -1;
474
- }
475
- table() {
476
- return this.row() && this.row().table();
477
- }
478
- }
479
- class g extends R {
480
- static {
481
- this.blotName = "table-row";
482
- }
483
- static {
484
- this.tagName = "TR";
485
- }
486
- checkMerge() {
487
- if (super.checkMerge() && this.next.children.head != null) {
488
- const t = this.children.head.formats(), e = this.children.tail.formats(), s = this.next.children.head.formats(), i = this.next.children.tail.formats();
489
- return t.table === e.table && t.table === s.table && t.table === i.table;
490
- }
491
- return !1;
492
- }
493
- optimize(t) {
494
- super.optimize(t), this.children.forEach((e) => {
495
- if (e.next == null) return;
496
- const s = e.formats(), i = e.next.formats();
497
- if (s.table !== i.table) {
498
- const n = this.splitAfter(e);
499
- n && n.optimize(), this.prev && this.prev.optimize();
500
- }
501
- });
502
- }
503
- rowOffset() {
504
- return this.parent ? this.parent.children.indexOf(this) : -1;
505
- }
506
- table() {
507
- return this.parent && this.parent.parent;
508
- }
509
- }
510
- class x extends R {
511
- static {
512
- this.blotName = "table-body";
513
- }
514
- static {
515
- this.tagName = "TBODY";
516
- }
517
- }
518
- class C extends R {
519
- static {
520
- this.blotName = "table-container";
521
- }
522
- static {
523
- this.tagName = "TABLE";
524
- }
525
- balanceCells() {
526
- const t = this.descendants(g), e = t.reduce((s, i) => Math.max(i.children.length, s), 0);
527
- t.forEach((s) => {
528
- new Array(e - s.children.length).fill(0).forEach(() => {
529
- let i;
530
- s.children.head != null && (i = p.formats(s.children.head.domNode));
531
- const n = this.scroll.create(p.blotName, i);
532
- s.appendChild(n), n.optimize();
533
- });
534
- });
535
- }
536
- cells(t) {
537
- return this.rows().map((e) => e.children.at(t));
538
- }
539
- deleteColumn(t) {
540
- const [e] = this.descendant(x);
541
- e == null || e.children.head == null || e.children.forEach((s) => {
542
- const i = s.children.at(t);
543
- i?.remove();
544
- });
545
- }
546
- insertColumn(t) {
547
- const [e] = this.descendant(x);
548
- e == null || e.children.head == null || e.children.forEach((s) => {
549
- const i = s.children.at(t), n = p.formats(s.children.head.domNode), o = this.scroll.create(p.blotName, n);
550
- s.insertBefore(o, i);
551
- });
552
- }
553
- insertRow(t) {
554
- const [e] = this.descendant(x);
555
- if (e == null || e.children.head == null) return;
556
- const s = V(), i = this.scroll.create(g.blotName);
557
- e.children.head.children.forEach(() => {
558
- const o = this.scroll.create(p.blotName, s);
559
- i.appendChild(o);
560
- });
561
- const n = e.children.at(t);
562
- e.insertBefore(i, n);
563
- }
564
- rows() {
565
- const t = this.children.head;
566
- return t == null ? [] : t.children.map((e) => e);
567
- }
568
- }
569
- C.allowedChildren = [x];
570
- x.requiredContainer = C;
571
- x.allowedChildren = [g];
572
- g.requiredContainer = x;
573
- g.allowedChildren = [p];
574
- p.requiredContainer = g;
575
- function V() {
576
- return `row-${Math.random().toString(36).slice(2, 6)}`;
577
- }
578
- class Ft extends B {
579
- static register() {
580
- c.register(p), c.register(g), c.register(x), c.register(C);
581
- }
582
- constructor(...t) {
583
- super(...t), this.listenBalanceCells();
584
- }
585
- balanceTables() {
586
- this.rich.scroll.descendants(C).forEach((t) => {
587
- t.balanceCells();
588
- });
589
- }
590
- deleteColumn() {
591
- const [t, , e] = this.getTable();
592
- e != null && (t.deleteColumn(e.cellOffset()), this.rich.update(c.sources.USER));
593
- }
594
- deleteRow() {
595
- const [, t] = this.getTable();
596
- t != null && (t.remove(), this.rich.update(c.sources.USER));
597
- }
598
- deleteTable() {
599
- const [t] = this.getTable();
600
- if (t == null) return;
601
- const e = t.offset();
602
- t.remove(), this.rich.update(c.sources.USER), this.rich.setSelection(e, c.sources.SILENT);
603
- }
604
- getTable(t = this.rich.getSelection()) {
605
- if (t == null) return [null, null, null, -1];
606
- const [e, s] = this.rich.getLine(t.index);
607
- if (e == null || e.statics.blotName !== p.blotName)
608
- return [null, null, null, -1];
609
- const i = e.parent;
610
- return [i.parent.parent, i, e, s];
611
- }
612
- insertColumn(t) {
613
- const e = this.rich.getSelection();
614
- if (!e) return;
615
- const [s, i, n] = this.getTable(e);
616
- if (n == null) return;
617
- const o = n.cellOffset();
618
- s.insertColumn(o + t), this.rich.update(c.sources.USER);
619
- let a = i.rowOffset();
620
- t === 0 && (a += 1), this.rich.setSelection(
621
- e.index + a,
622
- e.length,
623
- c.sources.SILENT
624
- );
625
- }
626
- insertColumnLeft() {
627
- this.insertColumn(0);
628
- }
629
- insertColumnRight() {
630
- this.insertColumn(1);
631
- }
632
- insertRow(t) {
633
- const e = this.rich.getSelection();
634
- if (!e) return;
635
- const [s, i, n] = this.getTable(e);
636
- if (n == null) return;
637
- const o = i.rowOffset();
638
- s.insertRow(o + t), this.rich.update(c.sources.USER), t > 0 ? this.rich.setSelection(e, c.sources.SILENT) : this.rich.setSelection(
639
- e.index + i.children.length,
640
- e.length,
641
- c.sources.SILENT
642
- );
643
- }
644
- insertRowAbove() {
645
- this.insertRow(0);
646
- }
647
- insertRowBelow() {
648
- this.insertRow(1);
649
- }
650
- insertTable(t, e) {
651
- const s = this.rich.getSelection();
652
- if (s == null) return;
653
- const i = new Array(t).fill(0).reduce((n) => {
654
- const o = new Array(e).fill(`
655
- `).join("");
656
- return n.insert(o, { table: V() });
657
- }, new q().retain(s.index));
658
- this.rich.updateContents(i, c.sources.USER), this.rich.setSelection(s.index, c.sources.SILENT), this.balanceTables();
659
- }
660
- listenBalanceCells() {
661
- this.rich.on(c.events.SCROLL_OPTIMIZE, (t) => {
662
- t.some((e) => ["TD", "TR", "TBODY", "TABLE"].includes(
663
- e.target.tagName
664
- ) ? (this.rich.once(c.events.TEXT_CHANGE, (s, i, n) => {
665
- n === c.sources.USER && this.balanceTables();
666
- }), !0) : !1);
667
- });
668
- }
669
- }
670
- const z = kt("rich:toolbar");
671
- class Z extends B {
672
- constructor(t, e) {
673
- if (super(t, e), Array.isArray(this.options.container)) {
674
- const s = document.createElement("div");
675
- s.setAttribute("role", "toolbar"), zt(s, this.options.container), t.container?.parentNode?.insertBefore(s, t.container), this.container = s;
676
- } else typeof this.options.container == "string" ? this.container = document.querySelector(this.options.container) : this.container = this.options.container;
677
- if (!(this.container instanceof HTMLElement)) {
678
- z.error("Container required for toolbar", this.options);
679
- return;
680
- }
681
- this.container.classList.add(`${l}-toolbar`), this.controls = [], this.handlers = {}, this.options.handlers && Object.keys(this.options.handlers).forEach((s) => {
682
- const i = this.options.handlers?.[s];
683
- i && this.addHandler(s, i);
684
- }), Array.from(this.container.querySelectorAll("button, select")).forEach(
685
- (s) => {
686
- this.attach(s);
687
- }
688
- ), this.rich.on(c.events.EDITOR_CHANGE, () => {
689
- const [s] = this.rich.selection.getRange();
690
- this.update(s);
691
- });
692
- }
693
- addHandler(t, e) {
694
- this.handlers[t] = e;
695
- }
696
- attach(t) {
697
- let e = Array.from(t.classList).find((i) => i.indexOf(`${l}-`) === 0);
698
- if (!e) return;
699
- if (e = e.slice(`${l}-`.length), t.tagName === "BUTTON" && t.setAttribute("type", "button"), this.handlers[e] == null && this.rich.scroll.query(e) == null) {
700
- z.warn("ignoring attaching to nonexistent format", e, t);
701
- return;
702
- }
703
- const s = t.tagName === "SELECT" ? "change" : "click";
704
- t.addEventListener(s, (i) => {
705
- let n;
706
- if (t.tagName === "SELECT") {
707
- if (t.selectedIndex < 0) return;
708
- const a = t.options[t.selectedIndex];
709
- a.hasAttribute("selected") ? n = !1 : n = a.value || !1;
710
- } else
711
- t.classList.contains(`${l}-active`) ? n = !1 : n = t.value || !t.hasAttribute("value"), i.preventDefault();
712
- this.rich.focus();
713
- const [o] = this.rich.selection.getRange();
714
- if (this.handlers[e] != null)
715
- this.handlers[e].call(this, n);
716
- else if (this.rich.scroll.query(e).prototype instanceof X) {
717
- if (n = prompt(`Enter ${e}`), !n) return;
718
- this.rich.updateContents(
719
- new q().retain(o.index).delete(o.length).insert({ [e]: n }),
720
- c.sources.USER
721
- );
722
- } else
723
- this.rich.format(e, n, c.sources.USER);
724
- this.update(o);
725
- }), this.controls.push([e, t]);
726
- }
727
- update(t) {
728
- const e = t == null ? {} : this.rich.getFormat(t);
729
- this.controls.forEach((s) => {
730
- const [i, n] = s;
731
- if (n.tagName === "SELECT") {
732
- let o = null;
733
- if (t == null)
734
- o = null;
735
- else if (e[i] == null)
736
- o = n.querySelector("option[selected]");
737
- else if (!Array.isArray(e[i])) {
738
- let a = e[i];
739
- typeof a == "string" && (a = a.replace(/"/g, '\\"')), o = n.querySelector(`option[value="${a}"]`);
740
- }
741
- o == null ? (n.value = "", n.selectedIndex = -1) : o.selected = !0;
742
- } else if (t == null)
743
- n.classList.remove(`${l}-active`), n.setAttribute("aria-pressed", "false");
744
- else if (n.hasAttribute("value")) {
745
- const o = e[i], a = o === n.getAttribute("value") || o != null && o.toString() === n.getAttribute("value") || o == null && !n.getAttribute("value");
746
- n.classList.toggle(
747
- `${l}-active`,
748
- a
749
- ), n.setAttribute("aria-pressed", a.toString());
750
- } else {
751
- const o = e[i] != null;
752
- n.classList.toggle(
753
- `${l}-active`,
754
- o
755
- ), n.setAttribute("aria-pressed", o.toString());
756
- }
757
- });
758
- }
759
- }
760
- Z.DEFAULTS = {};
761
- function P(r, t, e) {
762
- const s = document.createElement("button");
763
- s.setAttribute("type", "button"), s.classList.add(`${l}-${t}`), s.setAttribute("aria-pressed", "false"), e != null ? (s.value = e, s.setAttribute("aria-label", `${t}: ${e}`)) : s.setAttribute("aria-label", t), r.appendChild(s);
764
- }
765
- function zt(r, t) {
766
- Array.isArray(t[0]) || (t = [t]), t.forEach((e) => {
767
- const s = document.createElement("span");
768
- s.classList.add(`${l}-formats`), e.forEach((i) => {
769
- if (typeof i == "string")
770
- P(s, i);
771
- else {
772
- const n = Object.keys(i)[0], o = i[n];
773
- Array.isArray(o) ? Pt(s, n, o) : P(s, n, o);
774
- }
775
- }), r.appendChild(s);
776
- });
777
- }
778
- function Pt(r, t, e) {
779
- const s = document.createElement("select");
780
- s.classList.add(`${l}-${t}`), e.forEach((i) => {
781
- const n = document.createElement("option");
782
- i !== !1 ? n.setAttribute("value", String(i)) : n.setAttribute("selected", "selected"), s.appendChild(n);
783
- }), r.appendChild(s);
784
- }
785
- Z.DEFAULTS = {
786
- container: null,
787
- handlers: {
788
- clean() {
789
- const r = this.rich.getSelection();
790
- if (r != null)
791
- if (r.length === 0) {
792
- const t = this.rich.getFormat();
793
- Object.keys(t).forEach((e) => {
794
- this.rich.scroll.query(e, H.INLINE) != null && this.rich.format(e, !1, c.sources.USER);
795
- });
796
- } else
797
- this.rich.removeFormat(r.index, r.length, c.sources.USER);
798
- },
799
- direction(r) {
800
- const { align: t } = this.rich.getFormat();
801
- r === "rtl" && t == null ? this.rich.format("align", "right", c.sources.USER) : !r && t === "right" && this.rich.format("align", !1, c.sources.USER), this.rich.format("direction", r, c.sources.USER);
802
- },
803
- indent(r) {
804
- const t = this.rich.getSelection(), e = this.rich.getFormat(t), s = parseInt(e.indent || 0, 10);
805
- if (r === "+1" || r === "-1") {
806
- let i = r === "+1" ? 1 : -1;
807
- e.direction === "rtl" && (i *= -1), this.rich.format("indent", s + i, c.sources.USER);
808
- }
809
- },
810
- link(r) {
811
- r === !0 && (r = prompt("Enter link URL:")), this.rich.format("link", r, c.sources.USER);
812
- },
813
- list(r) {
814
- const t = this.rich.getSelection(), e = this.rich.getFormat(t);
815
- r === "check" ? e.list === "checked" || e.list === "unchecked" ? this.rich.format("list", !1, c.sources.USER) : this.rich.format("list", "unchecked", c.sources.USER) : this.rich.format("list", r, c.sources.USER);
816
- },
817
- redo() {
818
- this.rich.history.redo();
819
- },
820
- undo() {
821
- this.rich.history.undo();
822
- }
823
- }
824
- };
825
- const _t = `<svg viewbox="0 0 18 18">
826
- <polygon class="pqb-rich-text-stroke" points="7 11 9 13 11 11 7 11"></polygon>
827
- <polygon class="pqb-rich-text-stroke" points="7 7 9 5 11 7 7 7"></polygon>
828
- </svg>
829
- `;
830
- let _ = 0;
831
- function j(r, t) {
832
- r.setAttribute(
833
- t,
834
- `${r.getAttribute(t) !== "true"}`
835
- );
836
- }
837
- class M {
838
- constructor(t) {
839
- this.select = t, this.container = document.createElement("span"), this.buildPicker(), this.select.style.display = "none", this.select.parentNode.insertBefore(this.container, this.select), this.label.addEventListener("mousedown", () => {
840
- this.togglePicker();
841
- }), this.label.addEventListener("keydown", (e) => {
842
- switch (e.key) {
843
- case "Enter":
844
- this.togglePicker();
845
- break;
846
- case "Escape":
847
- this.escape(), e.preventDefault();
848
- break;
849
- }
850
- }), this.select.addEventListener("change", this.update.bind(this));
851
- }
852
- togglePicker() {
853
- this.container.classList.toggle(`${l}-expanded`), j(this.label, "aria-expanded"), j(this.options, "aria-hidden");
854
- }
855
- buildItem(t) {
856
- const e = document.createElement("span");
857
- e.tabIndex = "0", e.setAttribute("role", "button"), e.classList.add(`${l}-picker-item`);
858
- const s = t.getAttribute("value");
859
- return s && e.setAttribute("data-value", s), t.textContent && e.setAttribute("data-label", t.textContent), e.addEventListener("click", () => {
860
- this.selectItem(e, !0);
861
- }), e.addEventListener("keydown", (i) => {
862
- switch (i.key) {
863
- case "Enter":
864
- this.selectItem(e, !0), i.preventDefault();
865
- break;
866
- case "Escape":
867
- this.escape(), i.preventDefault();
868
- break;
869
- }
870
- }), e;
871
- }
872
- buildLabel() {
873
- const t = document.createElement("span");
874
- return t.classList.add(`${l}-picker-label`), t.innerHTML = _t, t.tabIndex = "0", t.setAttribute("role", "button"), t.setAttribute("aria-expanded", "false"), this.container.appendChild(t), t;
875
- }
876
- buildOptions() {
877
- const t = document.createElement("span");
878
- t.classList.add(`${l}-picker-options`), t.setAttribute("aria-hidden", "true"), t.tabIndex = "-1", t.id = `${l}-picker-options-${_}`, _ += 1, this.label.setAttribute("aria-controls", t.id), this.options = t, Array.from(this.select.options).forEach((e) => {
879
- const s = this.buildItem(e);
880
- t.appendChild(s), e.selected === !0 && this.selectItem(s);
881
- }), this.container.appendChild(t);
882
- }
883
- buildPicker() {
884
- Array.from(this.select.attributes).forEach((t) => {
885
- this.container.setAttribute(t.name, t.value);
886
- }), this.container.classList.add(`${l}-picker`), this.label = this.buildLabel(), this.buildOptions();
887
- }
888
- escape() {
889
- this.close(), setTimeout(() => this.label.focus(), 1);
890
- }
891
- close() {
892
- this.container.classList.remove(`${l}-expanded`), this.label.setAttribute("aria-expanded", "false"), this.options.setAttribute("aria-hidden", "true");
893
- }
894
- selectItem(t, e = !1) {
895
- const s = this.container.querySelector(
896
- `.${l}-selected`
897
- );
898
- t !== s && (s?.classList.remove(`${l}-selected`), t != null && (t.classList.add(`${l}-selected`), this.select.selectedIndex = Array.from(t.parentNode.children).indexOf(
899
- t
900
- ), t.hasAttribute("data-value") ? this.label.setAttribute("data-value", t.getAttribute("data-value")) : this.label.removeAttribute("data-value"), t.hasAttribute("data-label") ? this.label.setAttribute("data-label", t.getAttribute("data-label")) : this.label.removeAttribute("data-label"), e && (this.select.dispatchEvent(new Event("change")), this.close())));
901
- }
902
- update() {
903
- let t;
904
- if (this.select.selectedIndex > -1) {
905
- const s = this.container.querySelector(
906
- `.${l}-picker-options`
907
- ).children[this.select.selectedIndex];
908
- t = this.select.options[this.select.selectedIndex], this.selectItem(s);
909
- } else
910
- this.selectItem(null);
911
- const e = t != null && t !== this.select.querySelector("option[selected]");
912
- this.label.classList.toggle(
913
- `${l}-active`,
914
- e
915
- );
916
- }
917
- }
918
- class ot extends M {
919
- constructor(t, e) {
920
- super(t), this.label.innerHTML = e, this.container.classList.add(`${l}-color-picker`), Array.from(
921
- this.container.querySelectorAll(
922
- `.${l}-picker-item`
923
- )
924
- ).slice(0, 7).forEach((s) => {
925
- s.classList.add(`${l}-primary`);
926
- });
927
- }
928
- buildItem(t) {
929
- const e = super.buildItem(t);
930
- return e.style.backgroundColor = t.getAttribute("value") || "", e;
931
- }
932
- selectItem(t, e) {
933
- super.selectItem(t, e);
934
- const s = this.label.querySelector(
935
- `.${l}-color-label`
936
- ), i = t && t.getAttribute("data-value") || "";
937
- s && (s.tagName === "line" ? s.style.stroke = i : s.style.fill = i);
938
- }
939
- }
940
- class ct extends M {
941
- constructor(t, e) {
942
- super(t), this.container.classList.add(`${l}-icon-picker`), Array.from(
943
- this.container.querySelectorAll(
944
- `.${l}-picker-item`
945
- )
946
- ).forEach((s) => {
947
- s.innerHTML = e[s.getAttribute("data-value") || ""];
948
- }), this.defaultItem = this.container.querySelector(
949
- `.${l}-selected`
950
- ), this.selectItem(this.defaultItem);
951
- }
952
- selectItem(t, e) {
953
- super.selectItem(t, e);
954
- const s = t || this.defaultItem;
955
- if (s != null) {
956
- if (this.label.innerHTML === s.innerHTML) return;
957
- this.label.innerHTML = s.innerHTML;
958
- }
959
- }
960
- }
961
- const jt = `<svg viewbox="0 0 18 18">
962
- <line class="pqb-rich-text-stroke" x1="15" x2="3" y1="9" y2="9"></line>
963
- <line class="pqb-rich-text-stroke" x1="14" x2="4" y1="14" y2="14"></line>
964
- <line class="pqb-rich-text-stroke" x1="12" x2="6" y1="4" y2="4"></line>
965
- </svg>
966
- `, Gt = `<svg viewbox="0 0 18 18">
967
- <line class="pqb-rich-text-stroke" x1="15" x2="3" y1="9" y2="9"></line>
968
- <line class="pqb-rich-text-stroke" x1="15" x2="3" y1="14" y2="14"></line>
969
- <line class="pqb-rich-text-stroke" x1="15" x2="3" y1="4" y2="4"></line>
970
- </svg>
971
- `, Wt = `<svg viewbox="0 0 18 18">
972
- <line class="pqb-rich-text-stroke" x1="3" x2="15" y1="9" y2="9"></line>
973
- <line class="pqb-rich-text-stroke" x1="3" x2="13" y1="14" y2="14"></line>
974
- <line class="pqb-rich-text-stroke" x1="3" x2="9" y1="4" y2="4"></line>
975
- </svg>
976
- `, Xt = `<svg viewbox="0 0 18 18">
977
- <line class="pqb-rich-text-stroke" x1="15" x2="3" y1="9" y2="9"></line>
978
- <line class="pqb-rich-text-stroke" x1="15" x2="5" y1="14" y2="14"></line>
979
- <line class="pqb-rich-text-stroke" x1="15" x2="9" y1="4" y2="4"></line>
980
- </svg>
981
- `, Kt = `<svg viewbox="0 0 18 18">
982
- <g class="pqb-rich-text-fill pqb-rich-text-color-label">
983
- <polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"></polygon>
984
- <rect height="1" width="1" x="4" y="4"></rect>
985
- <polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"></polygon>
986
- <rect height="1" width="1" x="2" y="6"></rect>
987
- <rect height="1" width="1" x="3" y="5"></rect>
988
- <rect height="1" width="1" x="4" y="7"></rect>
989
- <polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"></polygon>
990
- <rect height="1" width="1" x="2" y="12"></rect>
991
- <rect height="1" width="1" x="2" y="9"></rect>
992
- <rect height="1" width="1" x="2" y="15"></rect>
993
- <polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"></polygon>
994
- <rect height="1" width="1" x="3" y="8"></rect>
995
- <path
996
- d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"
997
- ></path>
998
- <path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"></path>
999
- <path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"></path>
1000
- <rect height="1" width="1" x="12" y="2"></rect>
1001
- <rect height="1" width="1" x="11" y="3"></rect>
1002
- <path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"></path>
1003
- <rect height="1" width="1" x="2" y="3"></rect>
1004
- <rect height="1" width="1" x="6" y="2"></rect>
1005
- <rect height="1" width="1" x="3" y="2"></rect>
1006
- <rect height="1" width="1" x="5" y="3"></rect>
1007
- <rect height="1" width="1" x="9" y="2"></rect>
1008
- <rect height="1" width="1" x="15" y="14"></rect>
1009
- <polygon
1010
- points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"
1011
- ></polygon>
1012
- <rect height="1" width="1" x="13" y="7"></rect>
1013
- <rect height="1" width="1" x="15" y="5"></rect>
1014
- <rect height="1" width="1" x="14" y="6"></rect>
1015
- <rect height="1" width="1" x="15" y="8"></rect>
1016
- <rect height="1" width="1" x="14" y="9"></rect>
1017
- <path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"></path>
1018
- <rect height="1" width="1" x="14" y="3"></rect>
1019
- <polygon points="12 6.868 12 6 11.62 6 12 6.868"></polygon>
1020
- <rect height="1" width="1" x="15" y="2"></rect>
1021
- <rect height="1" width="1" x="12" y="5"></rect>
1022
- <rect height="1" width="1" x="13" y="4"></rect>
1023
- <polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"></polygon>
1024
- <rect height="1" width="1" x="9" y="14"></rect>
1025
- <rect height="1" width="1" x="8" y="15"></rect>
1026
- <path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"></path>
1027
- <rect height="1" width="1" x="5" y="15"></rect>
1028
- <path
1029
- d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"
1030
- ></path>
1031
- <rect height="1" width="1" x="11" y="15"></rect>
1032
- <path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"></path>
1033
- <rect height="1" width="1" x="14" y="15"></rect>
1034
- <rect height="1" width="1" x="15" y="11"></rect>
1035
- </g>
1036
- <polyline class="pqb-rich-text-stroke" points="5.5 13 9 5 12.5 13"></polyline>
1037
- <line
1038
- class="pqb-rich-text-stroke"
1039
- x1="11.63"
1040
- x2="6.38"
1041
- y1="11"
1042
- y2="11"
1043
- ></line>
1044
- </svg>
1045
- `, Qt = `<svg viewbox="0 0 18 18">
1046
- <rect
1047
- class="pqb-rich-text-fill pqb-rich-text-stroke"
1048
- height="3"
1049
- width="3"
1050
- x="4"
1051
- y="5"
1052
- ></rect>
1053
- <rect
1054
- class="pqb-rich-text-fill pqb-rich-text-stroke"
1055
- height="3"
1056
- width="3"
1057
- x="11"
1058
- y="5"
1059
- ></rect>
1060
- <path
1061
- class="pqb-rich-text-even pqb-rich-text-fill pqb-rich-text-stroke"
1062
- d="M7,8c0,4.031-3,5-3,5"
1063
- ></path>
1064
- <path
1065
- class="pqb-rich-text-even pqb-rich-text-fill pqb-rich-text-stroke"
1066
- d="M14,8c0,4.031-3,5-3,5"
1067
- ></path>
1068
- </svg>
1069
- `, Jt = `<svg viewbox="0 0 18 18">
1070
- <path
1071
- class="pqb-rich-text-stroke"
1072
- d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"
1073
- ></path>
1074
- <path
1075
- class="pqb-rich-text-stroke"
1076
- d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"
1077
- ></path>
1078
- </svg>
1079
- `, Yt = `<svg class="" viewbox="0 0 18 18">
1080
- <line class="pqb-rich-text-stroke" x1="5" x2="13" y1="3" y2="3"></line>
1081
- <line class="pqb-rich-text-stroke" x1="6" x2="9.35" y1="12" y2="3"></line>
1082
- <line class="pqb-rich-text-stroke" x1="11" x2="15" y1="11" y2="15"></line>
1083
- <line class="pqb-rich-text-stroke" x1="15" x2="11" y1="11" y2="15"></line>
1084
- <rect
1085
- class="pqb-rich-text-fill"
1086
- height="1"
1087
- rx="0.5"
1088
- ry="0.5"
1089
- width="7"
1090
- x="2"
1091
- y="14"
1092
- ></rect>
1093
- </svg>
1094
- `, G = `<svg viewbox="0 0 18 18">
1095
- <polyline
1096
- class="pqb-rich-text-even pqb-rich-text-stroke"
1097
- points="5 7 3 9 5 11"
1098
- ></polyline>
1099
- <polyline
1100
- class="pqb-rich-text-even pqb-rich-text-stroke"
1101
- points="13 7 15 9 13 11"
1102
- ></polyline>
1103
- <line class="pqb-rich-text-stroke" x1="10" x2="8" y1="5" y2="13"></line>
1104
- </svg>
1105
- `, te = `<svg viewbox="0 0 18 18">
1106
- <line
1107
- class="pqb-rich-text-color-label pqb-rich-text-stroke pqb-rich-text-transparent"
1108
- x1="3"
1109
- x2="15"
1110
- y1="15"
1111
- y2="15"
1112
- ></line>
1113
- <polyline class="pqb-rich-text-stroke" points="5.5 11 9 3 12.5 11"></polyline>
1114
- <line class="pqb-rich-text-stroke" x1="11.63" x2="6.38" y1="9" y2="9"></line>
1115
- </svg>
1116
- `, ee = `<svg viewbox="0 0 18 18">
1117
- <polygon
1118
- class="pqb-rich-text-stroke pqb-rich-text-fill"
1119
- points="3 11 5 9 3 7 3 11"
1120
- ></polygon>
1121
- <line
1122
- class="pqb-rich-text-stroke pqb-rich-text-fill"
1123
- x1="15"
1124
- x2="11"
1125
- y1="4"
1126
- y2="4"
1127
- ></line>
1128
- <path class="pqb-rich-text-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"></path>
1129
- <rect class="pqb-rich-text-fill" height="11" width="1" x="11" y="4"></rect>
1130
- <rect class="pqb-rich-text-fill" height="11" width="1" x="13" y="4"></rect>
1131
- </svg>
1132
- `, se = `<svg viewbox="0 0 18 18">
1133
- <polygon
1134
- class="pqb-rich-text-stroke pqb-rich-text-fill"
1135
- points="15 12 13 10 15 8 15 12"
1136
- ></polygon>
1137
- <line
1138
- class="pqb-rich-text-stroke pqb-rich-text-fill"
1139
- x1="9"
1140
- x2="5"
1141
- y1="4"
1142
- y2="4"
1143
- ></line>
1144
- <path class="pqb-rich-text-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"></path>
1145
- <rect class="pqb-rich-text-fill" height="11" width="1" x="5" y="4"></rect>
1146
- <rect class="pqb-rich-text-fill" height="11" width="1" x="7" y="4"></rect>
1147
- </svg>
1148
- `, ie = `<svg viewbox="0 0 18 18">
1149
- <path
1150
- class="pqb-rich-text-fill"
1151
- d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"
1152
- ></path>
1153
- <rect
1154
- class="pqb-rich-text-fill"
1155
- height="1.6"
1156
- rx="0.8"
1157
- ry="0.8"
1158
- width="5"
1159
- x="5.15"
1160
- y="6.2"
1161
- ></rect>
1162
- <path
1163
- class="pqb-rich-text-fill"
1164
- d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"
1165
- ></path>
1166
- </svg>
1167
- `, ne = `<svg viewBox="0 0 18 18">
1168
- <path
1169
- class="pqb-rich-text-fill"
1170
- d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"
1171
- />
1172
- </svg>
1173
- `, re = `<svg viewBox="0 0 18 18">
1174
- <path
1175
- class="pqb-rich-text-fill"
1176
- d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"
1177
- />
1178
- </svg>
1179
- `, le = `<svg viewBox="0 0 18 18">
1180
- <path
1181
- class="pqb-rich-text-fill"
1182
- d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"
1183
- />
1184
- </svg>
1185
- `, oe = `<svg viewBox="0 0 18 18">
1186
- <path
1187
- class="pqb-rich-text-fill"
1188
- d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"
1189
- />
1190
- </svg>
1191
- `, ce = `<svg viewBox="0 0 18 18">
1192
- <path
1193
- class="pqb-rich-text-fill"
1194
- d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"
1195
- />
1196
- </svg>
1197
- `, ae = `<svg viewBox="0 0 18 18">
1198
- <path
1199
- class="pqb-rich-text-fill"
1200
- d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"
1201
- />
1202
- </svg>
1203
- `, he = `<svg viewbox="0 0 18 18">
1204
- <rect class="pqb-rich-text-stroke" height="10" width="12" x="3" y="4"></rect>
1205
- <circle class="pqb-rich-text-fill" cx="6" cy="7" r="1"></circle>
1206
- <polyline
1207
- class="pqb-rich-text-even pqb-rich-text-fill"
1208
- points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"
1209
- ></polyline>
1210
- </svg>
1211
- `, de = `<svg viewbox="0 0 18 18">
1212
- <line class="pqb-rich-text-stroke" x1="3" x2="15" y1="14" y2="14"></line>
1213
- <line class="pqb-rich-text-stroke" x1="3" x2="15" y1="4" y2="4"></line>
1214
- <line class="pqb-rich-text-stroke" x1="9" x2="15" y1="9" y2="9"></line>
1215
- <polyline
1216
- class="pqb-rich-text-fill pqb-rich-text-stroke"
1217
- points="3 7 3 11 5 9 3 7"
1218
- ></polyline>
1219
- </svg>
1220
- `, ue = `<svg viewbox="0 0 18 18">
1221
- <line class="pqb-rich-text-stroke" x1="7" x2="13" y1="4" y2="4"></line>
1222
- <line class="pqb-rich-text-stroke" x1="5" x2="11" y1="14" y2="14"></line>
1223
- <line class="pqb-rich-text-stroke" x1="8" x2="10" y1="14" y2="4"></line>
1224
- </svg>
1225
- `, pe = `<svg viewbox="0 0 18 18">
1226
- <line class="pqb-rich-text-stroke" x1="7" x2="11" y1="7" y2="11"></line>
1227
- <path
1228
- class="pqb-rich-text-even pqb-rich-text-stroke"
1229
- d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"
1230
- ></path>
1231
- <path
1232
- class="pqb-rich-text-even pqb-rich-text-stroke"
1233
- d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"
1234
- ></path>
1235
- </svg>
1236
- `, fe = `<svg viewbox="0 0 18 18">
1237
- <line class="pqb-rich-text-stroke" x1="6" x2="15" y1="4" y2="4"></line>
1238
- <line class="pqb-rich-text-stroke" x1="6" x2="15" y1="9" y2="9"></line>
1239
- <line class="pqb-rich-text-stroke" x1="6" x2="15" y1="14" y2="14"></line>
1240
- <line class="pqb-rich-text-stroke" x1="3" x2="3" y1="4" y2="4"></line>
1241
- <line class="pqb-rich-text-stroke" x1="3" x2="3" y1="9" y2="9"></line>
1242
- <line class="pqb-rich-text-stroke" x1="3" x2="3" y1="14" y2="14"></line>
1243
- </svg>
1244
- `, be = `<svg class="" viewbox="0 0 18 18">
1245
- <line class="pqb-rich-text-stroke" x1="9" x2="15" y1="4" y2="4"></line>
1246
- <polyline class="pqb-rich-text-stroke" points="3 4 4 5 6 3"></polyline>
1247
- <line class="pqb-rich-text-stroke" x1="9" x2="15" y1="14" y2="14"></line>
1248
- <polyline class="pqb-rich-text-stroke" points="3 14 4 15 6 13"></polyline>
1249
- <line class="pqb-rich-text-stroke" x1="9" x2="15" y1="9" y2="9"></line>
1250
- <polyline class="pqb-rich-text-stroke" points="3 9 4 10 6 8"></polyline>
1251
- </svg>
1252
- `, xe = `<svg viewbox="0 0 18 18">
1253
- <line class="pqb-rich-text-stroke" x1="7" x2="15" y1="4" y2="4"></line>
1254
- <line class="pqb-rich-text-stroke" x1="7" x2="15" y1="9" y2="9"></line>
1255
- <line class="pqb-rich-text-stroke" x1="7" x2="15" y1="14" y2="14"></line>
1256
- <line
1257
- class="pqb-rich-text-stroke pqb-rich-text-thin"
1258
- x1="2.5"
1259
- x2="4.5"
1260
- y1="5.5"
1261
- y2="5.5"
1262
- ></line>
1263
- <path
1264
- class="pqb-rich-text-fill"
1265
- d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"
1266
- ></path>
1267
- <path
1268
- class="pqb-rich-text-stroke pqb-rich-text-thin"
1269
- d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"
1270
- ></path>
1271
- <path
1272
- class="pqb-rich-text-stroke pqb-rich-text-thin"
1273
- d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"
1274
- ></path>
1275
- </svg>
1276
- `, ge = `<svg viewbox="0 0 18 18">
1277
- <line class="pqb-rich-text-stroke" x1="3" x2="15" y1="14" y2="14"></line>
1278
- <line class="pqb-rich-text-stroke" x1="3" x2="15" y1="4" y2="4"></line>
1279
- <line class="pqb-rich-text-stroke" x1="9" x2="15" y1="9" y2="9"></line>
1280
- <polyline class="pqb-rich-text-stroke" points="5 7 5 11 3 9 5 7"></polyline>
1281
- </svg>
1282
- `, me = `<svg viewbox="0 0 18 18">
1283
- <polygon
1284
- class="pqb-rich-text-fill pqb-rich-text-stroke"
1285
- points="12 10 14 12 16 10 12 10"
1286
- ></polygon>
1287
- <path
1288
- class="pqb-rich-text-stroke"
1289
- d="M9.91,13.91A4.6,4.6,0,0,1,9,14a5,5,0,1,1,5-5"
1290
- ></path>
1291
- </svg>
1292
- `, ye = `<svg viewbox="0 0 18 18">
1293
- <line
1294
- class="pqb-rich-text-stroke pqb-rich-text-thin"
1295
- x1="15.5"
1296
- x2="2.5"
1297
- y1="8.5"
1298
- y2="9.5"
1299
- ></line>
1300
- <path
1301
- class="pqb-rich-text-fill"
1302
- d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"
1303
- ></path>
1304
- <path
1305
- class="pqb-rich-text-fill"
1306
- d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"
1307
- ></path>
1308
- </svg>
1309
- `, ve = `<svg viewbox="0 0 18 18">
1310
- <path
1311
- class="pqb-rich-text-fill"
1312
- d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"
1313
- />
1314
- <path
1315
- class="pqb-rich-text-fill"
1316
- d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"
1317
- />
1318
- </svg>
1319
- `, ke = `<svg viewbox="0 0 18 18">
1320
- <path
1321
- class="pqb-rich-text-fill"
1322
- d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"
1323
- />
1324
- <path
1325
- class="pqb-rich-text-fill"
1326
- d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"
1327
- />
1328
- </svg>
1329
- `, Ae = `<svg viewbox="0 0 18 18">
1330
- <rect class="pqb-rich-text-stroke" height="12" width="12" x="3" y="3"></rect>
1331
- <rect class="pqb-rich-text-fill" height="2" width="3" x="5" y="5"></rect>
1332
- <rect class="pqb-rich-text-fill" height="2" width="4" x="9" y="5"></rect>
1333
- <g class="pqb-rich-text-fill pqb-rich-text-transparent">
1334
- <rect height="2" width="3" x="5" y="8"></rect>
1335
- <rect height="2" width="4" x="9" y="8"></rect>
1336
- <rect height="2" width="3" x="5" y="11"></rect>
1337
- <rect height="2" width="4" x="9" y="11"></rect>
1338
- </g>
1339
- </svg>
1340
- `, we = `<svg viewbox="0 0 18 18">
1341
- <path
1342
- class="pqb-rich-text-stroke"
1343
- d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"
1344
- ></path>
1345
- <rect
1346
- class="pqb-rich-text-fill"
1347
- height="1"
1348
- rx="0.5"
1349
- ry="0.5"
1350
- width="12"
1351
- x="3"
1352
- y="15"
1353
- ></rect>
1354
- </svg>
1355
- `, qe = `<svg viewbox="0 0 18 18">
1356
- <polygon
1357
- class="pqb-rich-text-fill pqb-rich-text-stroke"
1358
- points="6 10 4 12 2 10 6 10"
1359
- ></polygon>
1360
- <path
1361
- class="pqb-rich-text-stroke"
1362
- d="M8.09,13.91A4.6,4.6,0,0,0,9,14,5,5,0,1,0,4,9"
1363
- ></path>
1364
- </svg>
1365
- `, Ee = `<svg viewbox="0 0 18 18">
1366
- <rect class="pqb-rich-text-stroke" height="12" width="12" x="3" y="3"></rect>
1367
- <rect class="pqb-rich-text-fill" height="12" width="1" x="5" y="3"></rect>
1368
- <rect class="pqb-rich-text-fill" height="12" width="1" x="12" y="3"></rect>
1369
- <rect class="pqb-rich-text-fill" height="2" width="8" x="5" y="8"></rect>
1370
- <rect class="pqb-rich-text-fill" height="1" width="3" x="3" y="5"></rect>
1371
- <rect class="pqb-rich-text-fill" height="1" width="3" x="3" y="7"></rect>
1372
- <rect class="pqb-rich-text-fill" height="1" width="3" x="3" y="10"></rect>
1373
- <rect class="pqb-rich-text-fill" height="1" width="3" x="3" y="12"></rect>
1374
- <rect class="pqb-rich-text-fill" height="1" width="3" x="12" y="5"></rect>
1375
- <rect class="pqb-rich-text-fill" height="1" width="3" x="12" y="7"></rect>
1376
- <rect class="pqb-rich-text-fill" height="1" width="3" x="12" y="10"></rect>
1377
- <rect class="pqb-rich-text-fill" height="1" width="3" x="12" y="12"></rect>
1378
- </svg>
1379
- `, E = {
1380
- align: {
1381
- "": Wt,
1382
- // left: alignLeftIcon,
1383
- center: jt,
1384
- right: Xt,
1385
- justify: Gt
1386
- },
1387
- background: Kt,
1388
- blockquote: Qt,
1389
- bold: Jt,
1390
- clean: Yt,
1391
- code: G,
1392
- "code-block": G,
1393
- color: te,
1394
- direction: {
1395
- "": ee,
1396
- // ltr: directionLeftToRightIcon,
1397
- rtl: se
1398
- },
1399
- formula: ie,
1400
- header: {
1401
- 1: ae,
1402
- 2: ne,
1403
- 3: re,
1404
- 4: le,
1405
- 5: oe,
1406
- 6: ce
1407
- },
1408
- italic: ue,
1409
- image: he,
1410
- indent: {
1411
- "+1": de,
1412
- "-1": ge
1413
- },
1414
- link: pe,
1415
- list: {
1416
- bullet: fe,
1417
- check: be,
1418
- ordered: xe
1419
- },
1420
- script: {
1421
- sub: ve,
1422
- super: ke
1423
- },
1424
- strike: ye,
1425
- table: Ae,
1426
- underline: we,
1427
- video: Ee,
1428
- redo: me,
1429
- undo: qe
1430
- }, Le = (r) => {
1431
- const { overflowY: t } = getComputedStyle(r, null);
1432
- return t !== "visible" && t !== "clip";
1433
- };
1434
- class at {
1435
- constructor(t, e) {
1436
- this.rich = t, this.boundsContainer = e || document.body, this.root = t.addContainer(`${l}-tooltip`), this.root.innerHTML = this.constructor.TEMPLATE, Le(this.rich.root) && this.rich.root.addEventListener("scroll", () => {
1437
- this.root.style.marginTop = `${-1 * this.rich.root.scrollTop}px`;
1438
- }), this.hide();
1439
- }
1440
- hide() {
1441
- this.root.classList.add(`${l}-hidden`);
1442
- }
1443
- position(t) {
1444
- const e = t.left + t.width / 2 - this.root.offsetWidth / 2, s = t.bottom + this.rich.root.scrollTop;
1445
- this.root.style.left = `${e}px`, this.root.style.top = `${s}px`, this.root.classList.remove(`${l}-flip`);
1446
- const i = this.boundsContainer.getBoundingClientRect(), n = this.root.getBoundingClientRect();
1447
- let o = 0;
1448
- if (n.right > i.right && (o = i.right - n.right, this.root.style.left = `${e + o}px`), n.left < i.left && (o = i.left - n.left, this.root.style.left = `${e + o}px`), n.bottom > i.bottom) {
1449
- const a = n.bottom - n.top, h = t.bottom - t.top + a;
1450
- this.root.style.top = `${s - h}px`, this.root.classList.add(`${l}-flip`);
1451
- }
1452
- return o;
1453
- }
1454
- show() {
1455
- this.root.classList.remove(`${l}-editing`), this.root.classList.remove(`${l}-hidden`);
1456
- }
1457
- }
1458
- const Se = [!1, "center", "right", "justify"], Ne = [
1459
- "#000000",
1460
- "#e60000",
1461
- "#ff9900",
1462
- "#ffff00",
1463
- "#008a00",
1464
- "#0066cc",
1465
- "#9933ff",
1466
- "#ffffff",
1467
- "#facccc",
1468
- "#ffebcc",
1469
- "#ffffcc",
1470
- "#cce8cc",
1471
- "#cce0f5",
1472
- "#ebd6ff",
1473
- "#bbbbbb",
1474
- "#f06666",
1475
- "#ffc266",
1476
- "#ffff66",
1477
- "#66b966",
1478
- "#66a3e0",
1479
- "#c285ff",
1480
- "#888888",
1481
- "#a10000",
1482
- "#b26b00",
1483
- "#b2b200",
1484
- "#006100",
1485
- "#0047b2",
1486
- "#6b24b2",
1487
- "#444444",
1488
- "#5c0000",
1489
- "#663d00",
1490
- "#666600",
1491
- "#003700",
1492
- "#002966",
1493
- "#3d1466"
1494
- ], Te = [!1, "serif", "monospace"], Ie = ["1", "2", "3", !1], Ce = ["small", !1, "large", "huge"];
1495
- class T extends Q {
1496
- constructor(t, e) {
1497
- super(t, e);
1498
- const s = (i) => {
1499
- if (!document.body.contains(t.root)) {
1500
- document.body.removeEventListener("click", s);
1501
- return;
1502
- }
1503
- this.tooltip != null && !this.tooltip.root.contains(i.target) && document.activeElement !== this.tooltip.textbox && !this.rich.hasFocus() && this.tooltip.hide(), this.pickers != null && this.pickers.forEach((n) => {
1504
- n.container.contains(i.target) || n.close();
1505
- });
1506
- };
1507
- t.emitter.listenDOM("click", document.body, s);
1508
- }
1509
- addModule(t) {
1510
- const e = super.addModule(t);
1511
- return t === "toolbar" && this.extendToolbar(e), e;
1512
- }
1513
- buildButtons(t, e) {
1514
- Array.from(t).forEach((s) => {
1515
- (s.getAttribute("class") || "").split(/\s+/).forEach((n) => {
1516
- if (n.startsWith(`${l}-`) && (n = n.slice(`${l}-`.length), e[n] != null))
1517
- if (n === "direction")
1518
- s.innerHTML = e[n][""] + e[n].rtl;
1519
- else if (typeof e[n] == "string")
1520
- s.innerHTML = e[n];
1521
- else {
1522
- const o = s.value || "";
1523
- o != null && e[n][o] && (s.innerHTML = e[n][o]);
1524
- }
1525
- });
1526
- });
1527
- }
1528
- buildPickers(t, e) {
1529
- this.pickers = Array.from(t).map((i) => {
1530
- if (i.classList.contains(`${l}-align`) && (i.querySelector("option") == null && k(i, Se), typeof e.align == "object"))
1531
- return new ct(i, e.align);
1532
- if (i.classList.contains(
1533
- `${l}-background`
1534
- ) || i.classList.contains(`${l}-color`)) {
1535
- const n = i.classList.contains(
1536
- `${l}-background`
1537
- ) ? "background" : "color";
1538
- return i.querySelector("option") == null && k(
1539
- i,
1540
- Ne,
1541
- n === "background" ? "#ffffff" : "#000000"
1542
- ), new ot(i, e[n]);
1543
- }
1544
- return i.querySelector("option") == null && (i.classList.contains(`${l}-font`) ? k(i, Te) : i.classList.contains(`${l}-header`) ? k(i, Ie) : i.classList.contains(`${l}-size`) && k(i, Ce)), new M(i);
1545
- });
1546
- const s = () => {
1547
- this.pickers.forEach((i) => {
1548
- i.update();
1549
- });
1550
- };
1551
- this.rich.on(d.events.EDITOR_CHANGE, s);
1552
- }
1553
- }
1554
- T.DEFAULTS = O({}, Q.DEFAULTS, {
1555
- modules: {
1556
- toolbar: {
1557
- handlers: {
1558
- formula() {
1559
- this.rich.theme.tooltip.edit("formula");
1560
- },
1561
- image() {
1562
- let r = this.container.querySelector(
1563
- `input.${l}-image[type=file]`
1564
- );
1565
- r == null && (r = document.createElement("input"), r.setAttribute("type", "file"), r.setAttribute(
1566
- "accept",
1567
- this.rich.uploader.options.mimetypes.join(", ")
1568
- ), r.classList.add(`${l}-image`), r.addEventListener("change", () => {
1569
- const t = this.rich.getSelection(!0);
1570
- this.rich.uploader.upload(t, r.files), r.value = "";
1571
- }), this.container.appendChild(r)), r.click();
1572
- },
1573
- video() {
1574
- this.rich.theme.tooltip.edit("video");
1575
- }
1576
- }
1577
- }
1578
- }
1579
- });
1580
- class ht extends at {
1581
- constructor(t, e) {
1582
- super(t, e), this.textbox = this.root.querySelector('input[type="text"]'), this.listen();
1583
- }
1584
- listen() {
1585
- this.textbox.addEventListener("keydown", (t) => {
1586
- t.key === "Enter" ? (this.save(), t.preventDefault()) : t.key === "Escape" && (this.cancel(), t.preventDefault());
1587
- });
1588
- }
1589
- cancel() {
1590
- this.hide(), this.restoreFocus();
1591
- }
1592
- edit(t = "link", e = null) {
1593
- if (this.root.classList.remove(`${l}-hidden`), this.root.classList.add(`${l}-editing`), this.textbox == null) return;
1594
- e != null ? this.textbox.value = e : t !== this.root.getAttribute("data-mode") && (this.textbox.value = "");
1595
- const s = this.rich.getBounds(this.rich.selection.savedRange);
1596
- s != null && this.position(s), this.textbox.select(), this.textbox.setAttribute(
1597
- "placeholder",
1598
- this.textbox.getAttribute(`data-${t}`) || ""
1599
- ), this.root.setAttribute("data-mode", t);
1600
- }
1601
- restoreFocus() {
1602
- this.rich.focus({ preventScroll: !0 });
1603
- }
1604
- save() {
1605
- let { value: t } = this.textbox;
1606
- switch (this.root.getAttribute("data-mode")) {
1607
- case "link": {
1608
- const { scrollTop: e } = this.rich.root;
1609
- this.linkRange ? (this.rich.formatText(
1610
- this.linkRange,
1611
- "link",
1612
- t,
1613
- d.sources.USER
1614
- ), delete this.linkRange) : (this.restoreFocus(), this.rich.format("link", t, d.sources.USER)), this.rich.root.scrollTop = e;
1615
- break;
1616
- }
1617
- case "video":
1618
- t = $e(t);
1619
- // eslint-disable-next-line no-fallthrough
1620
- case "formula": {
1621
- if (!t) break;
1622
- const e = this.rich.getSelection(!0);
1623
- if (e != null) {
1624
- const s = e.index + e.length;
1625
- this.rich.insertEmbed(
1626
- s,
1627
- this.root.getAttribute("data-mode"),
1628
- t,
1629
- d.sources.USER
1630
- ), this.root.getAttribute("data-mode") === "formula" && this.rich.insertText(s + 1, " ", d.sources.USER), this.rich.setSelection(s + 2, d.sources.USER);
1631
- }
1632
- break;
1633
- }
1634
- }
1635
- this.textbox.value = "", this.hide();
1636
- }
1637
- }
1638
- function $e(r) {
1639
- let t = r.match(
1640
- /^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/
1641
- ) || r.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);
1642
- return t ? `${t[1] || "https"}://www.youtube.com/embed/${t[2]}?showinfo=0` : (t = r.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/)) ? `${t[1] || "https"}://player.vimeo.com/video/${t[2]}/` : r;
1643
- }
1644
- function k(r, t, e = !1) {
1645
- t.forEach((s) => {
1646
- const i = document.createElement("option");
1647
- s === e ? i.setAttribute("selected", "selected") : i.setAttribute("value", String(s)), r.appendChild(i);
1648
- });
1649
- }
1650
- const Re = [
1651
- ["bold", "italic", "link"],
1652
- [{ header: 1 }, { header: 2 }, "blockquote"]
1653
- ];
1654
- class Me extends ht {
1655
- static {
1656
- this.TEMPLATE = [
1657
- `<span class="${l}-tooltip-arrow"></span>`,
1658
- `<div class="${l}-tooltip-editor">`,
1659
- '<input type="text" data-formula="e=mc^2" data-link="https://xxx.com" data-video="嵌入URL">',
1660
- `<a class="${l}-close"></a>`,
1661
- "</div>"
1662
- ].join("");
1663
- }
1664
- constructor(t, e) {
1665
- super(t, e), this.rich.on(
1666
- d.events.EDITOR_CHANGE,
1667
- (s, i, n, o) => {
1668
- if (s === d.events.SELECTION_CHANGE)
1669
- if (i != null && i.length > 0 && o === d.sources.USER) {
1670
- this.show(), this.root.style.left = "0px", this.root.style.width = "", this.root.style.width = `${this.root.offsetWidth}px`;
1671
- const a = this.rich.getLines(i.index, i.length);
1672
- if (a.length === 1) {
1673
- const h = this.rich.getBounds(i);
1674
- h != null && this.position(h);
1675
- } else {
1676
- const h = a[a.length - 1], b = this.rich.getIndex(h), v = Math.min(
1677
- h.length() - 1,
1678
- i.index + i.length - b
1679
- ), m = this.rich.getBounds(new J(b, v));
1680
- m != null && this.position(m);
1681
- }
1682
- } else document.activeElement !== this.textbox && this.rich.hasFocus() && this.hide();
1683
- }
1684
- );
1685
- }
1686
- listen() {
1687
- super.listen(), this.root.querySelector(`.${l}-close`).addEventListener("click", () => {
1688
- this.root.classList.remove(`${l}-editing`);
1689
- }), this.rich.on(d.events.SCROLL_OPTIMIZE, () => {
1690
- setTimeout(() => {
1691
- if (this.root.classList.contains(`${l}-hidden`))
1692
- return;
1693
- const t = this.rich.getSelection();
1694
- if (t != null) {
1695
- const e = this.rich.getBounds(t);
1696
- e != null && this.position(e);
1697
- }
1698
- }, 1);
1699
- });
1700
- }
1701
- cancel() {
1702
- this.show();
1703
- }
1704
- position(t) {
1705
- const e = super.position(t), s = this.root.querySelector(
1706
- `.${l}-tooltip-arrow`
1707
- );
1708
- return s.style.marginLeft = "", e !== 0 && (s.style.marginLeft = `${-1 * e - s.offsetWidth / 2}px`), e;
1709
- }
1710
- }
1711
- class dt extends T {
1712
- constructor(t, e) {
1713
- e.modules.toolbar != null && e.modules.toolbar.container == null && (e.modules.toolbar.container = Re), super(t, e), this.rich.container.classList.add(`${l}-bubble`);
1714
- }
1715
- extendToolbar(t) {
1716
- this.tooltip = new Me(this.rich, this.options.bounds), t.container != null && (this.tooltip.root.appendChild(t.container), this.buildButtons(t.container.querySelectorAll("button"), E), this.buildPickers(t.container.querySelectorAll("select"), E));
1717
- }
1718
- }
1719
- dt.DEFAULTS = O({}, T.DEFAULTS, {
1720
- modules: {
1721
- toolbar: {
1722
- handlers: {
1723
- link(r) {
1724
- r ? this.rich.theme.tooltip.edit() : this.rich.format("link", !1, c.sources.USER);
1725
- }
1726
- }
1727
- }
1728
- }
1729
- });
1730
- const He = [
1731
- [{ header: ["1", "2", "3", !1] }],
1732
- ["bold", "italic", "underline", "link"],
1733
- [{ list: "ordered" }, { list: "bullet" }],
1734
- ["clean"]
1735
- ];
1736
- class Be extends ht {
1737
- constructor() {
1738
- super(...arguments), this.preview = this.root.querySelector(`a.${l}-preview`);
1739
- }
1740
- static {
1741
- this.TEMPLATE = [
1742
- `<a class="${l}-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>`,
1743
- '<input type="text" data-formula="e=mc^2" data-link="https://xxx.com" data-video="嵌入URL">',
1744
- `<a class="${l}-action"></a>`,
1745
- `<a class="${l}-remove"></a>`
1746
- ].join("");
1747
- }
1748
- listen() {
1749
- super.listen(), this.root.querySelector(`a.${l}-action`).addEventListener("click", (t) => {
1750
- this.root.classList.contains(`${l}-editing`) ? this.save() : this.edit("link", this.preview.textContent), t.preventDefault();
1751
- }), this.root.querySelector(`a.${l}-remove`).addEventListener("click", (t) => {
1752
- if (this.linkRange != null) {
1753
- const e = this.linkRange;
1754
- this.restoreFocus(), this.rich.formatText(e, "link", !1, d.sources.USER), delete this.linkRange;
1755
- }
1756
- t.preventDefault(), this.hide();
1757
- }), this.rich.on(d.events.SELECTION_CHANGE, (t, e, s) => {
1758
- if (t != null) {
1759
- if (t.length === 0 && s === d.sources.USER) {
1760
- const [i, n] = this.rich.scroll.descendant(
1761
- I,
1762
- t.index
1763
- );
1764
- if (i != null) {
1765
- this.linkRange = new J(t.index - n, i.length());
1766
- const o = I.formats(i.domNode);
1767
- this.preview.textContent = o, this.preview.setAttribute("href", o), this.show();
1768
- const a = this.rich.getBounds(this.linkRange);
1769
- a != null && this.position(a);
1770
- return;
1771
- }
1772
- } else
1773
- delete this.linkRange;
1774
- this.hide();
1775
- }
1776
- });
1777
- }
1778
- show() {
1779
- super.show(), this.root.removeAttribute("data-mode");
1780
- }
1781
- }
1782
- class ut extends T {
1783
- constructor(t, e) {
1784
- e.modules.toolbar != null && e.modules.toolbar.container == null && (e.modules.toolbar.container = He), super(t, e), this.rich.container.classList.add(`${l}-snow`);
1785
- }
1786
- extendToolbar(t) {
1787
- t.container != null && (t.container.classList.add(`${l}-snow`), this.buildButtons(t.container.querySelectorAll("button"), E), this.buildPickers(t.container.querySelectorAll("select"), E), this.tooltip = new Be(this.rich, this.options.bounds), t.container.querySelector(`.${l}-link`) && this.rich.keyboard.addBinding(
1788
- { key: "k", shortKey: !0 },
1789
- (e, s) => {
1790
- t.handlers.link.call(t, !s.format.link);
1791
- }
1792
- ));
1793
- }
1794
- }
1795
- ut.DEFAULTS = O({}, T.DEFAULTS, {
1796
- modules: {
1797
- toolbar: {
1798
- handlers: {
1799
- link(r) {
1800
- if (r) {
1801
- const t = this.rich.getSelection();
1802
- if (t == null || t.length === 0) return;
1803
- let e = this.rich.getText(t);
1804
- /^\S+@\S+\.\S+$/.test(e) && e.indexOf("mailto:") !== 0 && (e = `mailto:${e}`);
1805
- const { tooltip: s } = this.rich.theme;
1806
- s.edit("link", e);
1807
- } else
1808
- this.rich.format("link", !1, c.sources.USER);
1809
- }
1810
- }
1811
- }
1812
- }
1813
- });
1814
- c.register(
1815
- {
1816
- "attributors/attribute/direction": Nt,
1817
- "attributors/class/align": nt,
1818
- "attributors/class/background": St,
1819
- "attributors/class/color": Lt,
1820
- "attributors/class/direction": it,
1821
- "attributors/class/font": st,
1822
- "attributors/class/size": et,
1823
- "attributors/style/align": Et,
1824
- "attributors/style/background": tt,
1825
- "attributors/style/color": Y,
1826
- "attributors/style/direction": qt,
1827
- "attributors/style/font": wt,
1828
- "attributors/style/size": At
1829
- },
1830
- !0
1831
- );
1832
- c.register(
1833
- {
1834
- "formats/align": nt,
1835
- "formats/direction": it,
1836
- "formats/indent": Ct,
1837
- "formats/background": tt,
1838
- "formats/color": Y,
1839
- "formats/font": st,
1840
- "formats/size": et,
1841
- "formats/blockquote": $t,
1842
- "formats/code-block": y,
1843
- "formats/header": Rt,
1844
- "formats/list": N,
1845
- "formats/bold": U,
1846
- "formats/code": Tt,
1847
- "formats/italic": Mt,
1848
- "formats/link": I,
1849
- "formats/script": Ht,
1850
- "formats/strike": Bt,
1851
- "formats/underline": Ot,
1852
- "formats/formula": Ut,
1853
- "formats/image": Vt,
1854
- "formats/video": Zt,
1855
- "modules/syntax": lt,
1856
- "modules/table": Ft,
1857
- "modules/toolbar": Z,
1858
- "themes/bubble": dt,
1859
- "themes/snow": ut,
1860
- "ui/icons": E,
1861
- "ui/picker": M,
1862
- "ui/icon-picker": ct,
1863
- "ui/color-picker": ot,
1864
- "ui/tooltip": at
1865
- },
1866
- !0
1867
- );
1868
- export {
1869
- Fe as AttributeMap,
1870
- q as Delta,
1871
- B as Module,
1872
- ze as Op,
1873
- Pe as OpIterator,
1874
- _e as Parchment,
1875
- J as Range,
1876
- c as default
1877
- };