@antscorp/antsomi-ui 2.0.92-text-editor-beta.6 → 2.0.93

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 (317) hide show
  1. package/es/assets/css/main.scss +2 -4
  2. package/es/components/icons/LazyIcon/LazyIcon.d.ts +9 -18
  3. package/es/components/icons/LazyIcon/LazyIcon.js +9 -18
  4. package/es/components/icons/index.d.ts +9 -18
  5. package/es/components/icons/index.js +9 -18
  6. package/es/components/molecules/EmojiCollections/CommonCollection/index.js +2 -2
  7. package/es/components/molecules/EmojiCollections/types.d.ts +0 -1
  8. package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +0 -1
  9. package/es/components/molecules/EmojiPopover/EmojiPopover.js +6 -10
  10. package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
  11. package/es/components/molecules/EmojiPopover/styled.js +1 -1
  12. package/es/components/molecules/TagifyInput/patternHandlers.js +12 -0
  13. package/es/components/molecules/TagifyInput/utils.d.ts +1 -0
  14. package/es/components/molecules/TagifyInput/utils.js +1 -0
  15. package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +3 -6
  16. package/es/components/molecules/VirtualizedMenu/__mocks__/index.js +982 -2594
  17. package/es/components/molecules/VirtualizedMenu/components/Item/Item.d.ts +11 -1
  18. package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +25 -53
  19. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +5 -8
  20. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +46 -289
  21. package/es/components/molecules/VirtualizedMenu/components/MenuInline/index.js +0 -1
  22. package/es/components/molecules/VirtualizedMenu/styled.d.ts +2 -2
  23. package/es/components/molecules/VirtualizedMenu/styled.js +4 -23
  24. package/es/components/molecules/VirtualizedMenu/types.d.ts +10 -27
  25. package/es/components/molecules/VirtualizedMenu/utils.d.ts +5 -8
  26. package/es/components/molecules/VirtualizedMenu/utils.js +18 -13
  27. package/es/components/molecules/index.d.ts +0 -1
  28. package/es/components/molecules/index.js +0 -1
  29. package/es/components/organism/index.d.ts +0 -1
  30. package/es/components/organism/index.js +0 -1
  31. package/es/constants/api.js +3 -3
  32. package/es/hooks/index.d.ts +0 -4
  33. package/es/hooks/index.js +0 -4
  34. package/es/locales/i18n.d.ts +1 -1
  35. package/es/utils/common.d.ts +9 -14
  36. package/es/utils/common.js +23 -60
  37. package/es/utils/index.d.ts +0 -1
  38. package/es/utils/index.js +0 -1
  39. package/es/utils/web.d.ts +0 -15
  40. package/es/utils/web.js +0 -39
  41. package/package.json +4 -22
  42. package/es/components/atoms/Eyedropper/Eyedropper.d.ts +0 -2
  43. package/es/components/atoms/Eyedropper/Eyedropper.js +0 -53
  44. package/es/components/atoms/Eyedropper/index.d.ts +0 -0
  45. package/es/components/atoms/Eyedropper/index.js +0 -1
  46. package/es/components/atoms/Eyedropper/styled.d.ts +0 -9
  47. package/es/components/atoms/Eyedropper/styled.js +0 -45
  48. package/es/components/atoms/Eyedropper/types.d.ts +0 -5
  49. package/es/components/atoms/Eyedropper/types.js +0 -1
  50. package/es/components/icons/ALignRightIcon.d.ts +0 -3
  51. package/es/components/icons/ALignRightIcon.js +0 -7
  52. package/es/components/icons/AlignCenterIcon.d.ts +0 -3
  53. package/es/components/icons/AlignCenterIcon.js +0 -7
  54. package/es/components/icons/AlignJustifyIcon.d.ts +0 -3
  55. package/es/components/icons/AlignJustifyIcon.js +0 -7
  56. package/es/components/icons/AlignLeftIcon.d.ts +0 -3
  57. package/es/components/icons/AlignLeftIcon.js +0 -7
  58. package/es/components/icons/ArrowDropDownIcon.d.ts +0 -3
  59. package/es/components/icons/ArrowDropDownIcon.js +0 -7
  60. package/es/components/icons/ChevronRightIcon.d.ts +0 -3
  61. package/es/components/icons/ChevronRightIcon.js +0 -7
  62. package/es/components/icons/ColorizeIcon.d.ts +0 -3
  63. package/es/components/icons/ColorizeIcon.js +0 -7
  64. package/es/components/icons/LinkOffIcon.d.ts +0 -3
  65. package/es/components/icons/LinkOffIcon.js +0 -7
  66. package/es/components/icons/MinusIcon.d.ts +0 -3
  67. package/es/components/icons/MinusIcon.js +0 -7
  68. package/es/components/index.scss +0 -2
  69. package/es/components/molecules/EyedropperButton/EyedropperButton.d.ts +0 -11
  70. package/es/components/molecules/EyedropperButton/EyedropperButton.js +0 -34
  71. package/es/components/molecules/EyedropperButton/index.d.ts +0 -0
  72. package/es/components/molecules/EyedropperButton/index.js +0 -1
  73. package/es/components/molecules/EyedropperButton/styled.d.ts +0 -7
  74. package/es/components/molecules/EyedropperButton/styled.js +0 -23
  75. package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +0 -3
  76. package/es/components/molecules/FontSizeInput/FontSizeInput.js +0 -134
  77. package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +0 -8
  78. package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +0 -14
  79. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +0 -21
  80. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +0 -19
  81. package/es/components/molecules/FontSizeInput/constants.d.ts +0 -2
  82. package/es/components/molecules/FontSizeInput/constants.js +0 -5
  83. package/es/components/molecules/FontSizeInput/index.d.ts +0 -2
  84. package/es/components/molecules/FontSizeInput/index.js +0 -1
  85. package/es/components/molecules/FontSizeInput/styled.d.ts +0 -7
  86. package/es/components/molecules/FontSizeInput/styled.js +0 -40
  87. package/es/components/molecules/FontSizeInput/styles.scss +0 -15
  88. package/es/components/molecules/FontSizeInput/types.d.ts +0 -23
  89. package/es/components/molecules/FontSizeInput/types.js +0 -1
  90. package/es/components/molecules/FontSizeInput/utils.d.ts +0 -7
  91. package/es/components/molecules/FontSizeInput/utils.js +0 -9
  92. package/es/components/molecules/index.scss +0 -1
  93. package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +0 -1290
  94. package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +0 -3059
  95. package/es/components/organism/TextEditor/TextEditor.d.ts +0 -3
  96. package/es/components/organism/TextEditor/TextEditor.js +0 -264
  97. package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +0 -320
  98. package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +0 -1
  99. package/es/components/organism/TextEditor/__mocks__/text-contennt.js +0 -38
  100. package/es/components/organism/TextEditor/constants.d.ts +0 -177
  101. package/es/components/organism/TextEditor/constants.js +0 -323
  102. package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +0 -25
  103. package/es/components/organism/TextEditor/extensions/BackgroundColor.js +0 -46
  104. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +0 -140
  105. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +0 -366
  106. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +0 -15
  107. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +0 -31
  108. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +0 -2
  109. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +0 -2
  110. package/es/components/organism/TextEditor/extensions/ClearFormatting.d.ts +0 -16
  111. package/es/components/organism/TextEditor/extensions/ClearFormatting.js +0 -26
  112. package/es/components/organism/TextEditor/extensions/Color.d.ts +0 -6
  113. package/es/components/organism/TextEditor/extensions/Color.js +0 -34
  114. package/es/components/organism/TextEditor/extensions/Emoji.d.ts +0 -57
  115. package/es/components/organism/TextEditor/extensions/Emoji.js +0 -184
  116. package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +0 -6
  117. package/es/components/organism/TextEditor/extensions/FontFamily.js +0 -36
  118. package/es/components/organism/TextEditor/extensions/FontSize.d.ts +0 -31
  119. package/es/components/organism/TextEditor/extensions/FontSize.js +0 -46
  120. package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +0 -23
  121. package/es/components/organism/TextEditor/extensions/FontWeight.js +0 -41
  122. package/es/components/organism/TextEditor/extensions/Indent.d.ts +0 -21
  123. package/es/components/organism/TextEditor/extensions/Indent.js +0 -63
  124. package/es/components/organism/TextEditor/extensions/LetterSpacing.d.ts +0 -32
  125. package/es/components/organism/TextEditor/extensions/LetterSpacing.js +0 -48
  126. package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +0 -20
  127. package/es/components/organism/TextEditor/extensions/LineHeight.js +0 -36
  128. package/es/components/organism/TextEditor/extensions/Link.d.ts +0 -29
  129. package/es/components/organism/TextEditor/extensions/Link.js +0 -187
  130. package/es/components/organism/TextEditor/extensions/ListItemMarker.d.ts +0 -13
  131. package/es/components/organism/TextEditor/extensions/ListItemMarker.js +0 -174
  132. package/es/components/organism/TextEditor/extensions/OrderedList.d.ts +0 -56
  133. package/es/components/organism/TextEditor/extensions/OrderedList.js +0 -187
  134. package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +0 -39
  135. package/es/components/organism/TextEditor/extensions/SmartTag.js +0 -167
  136. package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +0 -36
  137. package/es/components/organism/TextEditor/extensions/StyleMemory.js +0 -163
  138. package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +0 -30
  139. package/es/components/organism/TextEditor/extensions/TextTransform.js +0 -36
  140. package/es/components/organism/TextEditor/extensions/UnorderedList.d.ts +0 -55
  141. package/es/components/organism/TextEditor/extensions/UnorderedList.js +0 -176
  142. package/es/components/organism/TextEditor/hooks/index.d.ts +0 -6
  143. package/es/components/organism/TextEditor/hooks/index.js +0 -6
  144. package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +0 -4
  145. package/es/components/organism/TextEditor/hooks/useColorSet.js +0 -22
  146. package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +0 -18
  147. package/es/components/organism/TextEditor/hooks/useDocumentState.js +0 -42
  148. package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +0 -26
  149. package/es/components/organism/TextEditor/hooks/useMarkTracking.js +0 -68
  150. package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +0 -31
  151. package/es/components/organism/TextEditor/hooks/usePersistence.js +0 -169
  152. package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +0 -6
  153. package/es/components/organism/TextEditor/hooks/useStyleMemory.js +0 -42
  154. package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +0 -34
  155. package/es/components/organism/TextEditor/hooks/useStylePresets.js +0 -83
  156. package/es/components/organism/TextEditor/index.d.ts +0 -16
  157. package/es/components/organism/TextEditor/index.js +0 -8
  158. package/es/components/organism/TextEditor/index.scss +0 -61
  159. package/es/components/organism/TextEditor/provider.d.ts +0 -14
  160. package/es/components/organism/TextEditor/provider.js +0 -33
  161. package/es/components/organism/TextEditor/store.d.ts +0 -13
  162. package/es/components/organism/TextEditor/store.js +0 -20
  163. package/es/components/organism/TextEditor/styled.d.ts +0 -10
  164. package/es/components/organism/TextEditor/styled.js +0 -94
  165. package/es/components/organism/TextEditor/types.d.ts +0 -139
  166. package/es/components/organism/TextEditor/types.js +0 -5
  167. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +0 -6
  168. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +0 -84
  169. package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +0 -1
  170. package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +0 -1
  171. package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.d.ts +0 -1
  172. package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.js +0 -1
  173. package/es/components/organism/TextEditor/ui/BubbleToolbar/index.d.ts +0 -0
  174. package/es/components/organism/TextEditor/ui/BubbleToolbar/index.js +0 -1
  175. package/es/components/organism/TextEditor/ui/Button/Button.d.ts +0 -2
  176. package/es/components/organism/TextEditor/ui/Button/Button.js +0 -31
  177. package/es/components/organism/TextEditor/ui/Button/index.d.ts +0 -2
  178. package/es/components/organism/TextEditor/ui/Button/index.js +0 -1
  179. package/es/components/organism/TextEditor/ui/Button/types.d.ts +0 -10
  180. package/es/components/organism/TextEditor/ui/Button/types.js +0 -1
  181. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +0 -39
  182. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +0 -131
  183. package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +0 -1
  184. package/es/components/organism/TextEditor/ui/ColorPicker/index.js +0 -1
  185. package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.d.ts +0 -17
  186. package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +0 -51
  187. package/es/components/organism/TextEditor/ui/DropdownButton/index.d.ts +0 -1
  188. package/es/components/organism/TextEditor/ui/DropdownButton/index.js +0 -1
  189. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +0 -11
  190. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +0 -66
  191. package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +0 -2
  192. package/es/components/organism/TextEditor/ui/Emoji/index.js +0 -2
  193. package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +0 -4
  194. package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +0 -71
  195. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +0 -12
  196. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +0 -69
  197. package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +0 -1
  198. package/es/components/organism/TextEditor/ui/FontPopover/styled.js +0 -22
  199. package/es/components/organism/TextEditor/ui/Popover/Popover.d.ts +0 -6
  200. package/es/components/organism/TextEditor/ui/Popover/Popover.js +0 -9
  201. package/es/components/organism/TextEditor/ui/Popover/index.d.ts +0 -1
  202. package/es/components/organism/TextEditor/ui/Popover/index.js +0 -1
  203. package/es/components/organism/TextEditor/ui/Select/Select.d.ts +0 -4
  204. package/es/components/organism/TextEditor/ui/Select/Select.js +0 -7
  205. package/es/components/organism/TextEditor/ui/Select/index.d.ts +0 -1
  206. package/es/components/organism/TextEditor/ui/Select/index.js +0 -1
  207. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.d.ts +0 -2
  208. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.js +0 -44
  209. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.d.ts +0 -1
  210. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.js +0 -1
  211. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.d.ts +0 -2
  212. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +0 -52
  213. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.d.ts +0 -19
  214. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.js +0 -1
  215. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +0 -30
  216. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +0 -77
  217. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +0 -1
  218. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +0 -1
  219. package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.d.ts +0 -16
  220. package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +0 -42
  221. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +0 -5
  222. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +0 -18
  223. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +0 -6
  224. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +0 -93
  225. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +0 -5
  226. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +0 -20
  227. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +0 -4
  228. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +0 -31
  229. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +0 -7
  230. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +0 -28
  231. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +0 -7
  232. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +0 -44
  233. package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.d.ts +0 -5
  234. package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.js +0 -21
  235. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +0 -5
  236. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +0 -17
  237. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +0 -5
  238. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +0 -18
  239. package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.d.ts +0 -5
  240. package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.js +0 -28
  241. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +0 -6
  242. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +0 -17
  243. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +0 -5
  244. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +0 -67
  245. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +0 -5
  246. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +0 -17
  247. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +0 -7
  248. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +0 -18
  249. package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.d.ts +0 -10
  250. package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.js +0 -45
  251. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +0 -5
  252. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +0 -18
  253. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +0 -5
  254. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +0 -26
  255. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +0 -5
  256. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +0 -26
  257. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +0 -5
  258. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +0 -3
  259. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +0 -5
  260. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +0 -29
  261. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +0 -14
  262. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +0 -22
  263. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +0 -5
  264. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +0 -36
  265. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +0 -5
  266. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +0 -18
  267. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +0 -6
  268. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +0 -19
  269. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +0 -24
  270. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +0 -24
  271. package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +0 -1
  272. package/es/components/organism/TextEditor/ui/Toolbar/index.js +0 -1
  273. package/es/components/organism/TextEditor/utils/documentState.d.ts +0 -57
  274. package/es/components/organism/TextEditor/utils/documentState.js +0 -100
  275. package/es/components/organism/TextEditor/utils/font.d.ts +0 -73
  276. package/es/components/organism/TextEditor/utils/font.js +0 -160
  277. package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +0 -75
  278. package/es/components/organism/TextEditor/utils/htmlProcessing.js +0 -343
  279. package/es/components/organism/TextEditor/utils/indent.d.ts +0 -11
  280. package/es/components/organism/TextEditor/utils/indent.js +0 -56
  281. package/es/components/organism/TextEditor/utils/index.d.ts +0 -8
  282. package/es/components/organism/TextEditor/utils/index.js +0 -16
  283. package/es/components/organism/TextEditor/utils/link.d.ts +0 -108
  284. package/es/components/organism/TextEditor/utils/link.js +0 -151
  285. package/es/components/organism/TextEditor/utils/menu.d.ts +0 -134
  286. package/es/components/organism/TextEditor/utils/menu.js +0 -317
  287. package/es/components/organism/TextEditor/utils/selection.d.ts +0 -25
  288. package/es/components/organism/TextEditor/utils/selection.js +0 -57
  289. package/es/components/organism/TextEditor/utils/shared.d.ts +0 -1
  290. package/es/components/organism/TextEditor/utils/shared.js +0 -9
  291. package/es/components/organism/TextEditor/utils/smartTag.d.ts +0 -49
  292. package/es/components/organism/TextEditor/utils/smartTag.js +0 -89
  293. package/es/components/organism/TextEditor/utils/style.d.ts +0 -78
  294. package/es/components/organism/TextEditor/utils/style.js +0 -193
  295. package/es/components/organism/index.scss +0 -1
  296. package/es/hooks/useBroadcastedLocalStorage.d.ts +0 -5
  297. package/es/hooks/useBroadcastedLocalStorage.js +0 -71
  298. package/es/hooks/useElementSize.d.ts +0 -7
  299. package/es/hooks/useElementSize.js +0 -56
  300. package/es/hooks/useEyedropper/attach.d.ts +0 -4
  301. package/es/hooks/useEyedropper/attach.js +0 -9
  302. package/es/hooks/useEyedropper/eyedropper.d.ts +0 -69
  303. package/es/hooks/useEyedropper/eyedropper.js +0 -205
  304. package/es/hooks/useEyedropper/index.d.ts +0 -2
  305. package/es/hooks/useEyedropper/index.js +0 -7
  306. package/es/hooks/useEyedropper/support.d.ts +0 -1
  307. package/es/hooks/useEyedropper/support.js +0 -3
  308. package/es/hooks/useEyedropper/types.d.ts +0 -9
  309. package/es/hooks/useEyedropper/types.js +0 -1
  310. package/es/hooks/useEyedropper/useEyedropper.d.ts +0 -8
  311. package/es/hooks/useEyedropper/useEyedropper.js +0 -50
  312. package/es/hooks/useEyedropper/utils.d.ts +0 -11
  313. package/es/hooks/useEyedropper/utils.js +0 -17
  314. package/es/hooks/useIsMounted.d.ts +0 -1
  315. package/es/hooks/useIsMounted.js +0 -11
  316. package/es/utils/tree.d.ts +0 -225
  317. package/es/utils/tree.js +0 -469
@@ -1,10 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- interface SpacingActionProps {
3
- editor: Editor;
4
- defaultValue?: string;
5
- }
6
- export declare const SpacingIcon: (props: React.SVGProps<SVGSVGElement> & {
7
- size?: number;
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export declare const SpacingAction: (props: SpacingActionProps) => import("react/jsx-runtime").JSX.Element;
10
- export {};
@@ -1,45 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { DEFAULT_TEXT_STYLE, TEXT_EDITOR_CONSTANTS } from '../../../constants';
3
- import { DropdownButton } from '../../DropdownButton';
4
- import { LineHeight } from '../../../extensions/LineHeight';
5
- import { range, round } from 'lodash';
6
- import { Tooltip } from 'antd';
7
- import { useEditorState } from '@tiptap/react';
8
- const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
9
- export const SpacingIcon = (props) => {
10
- const { size = 24, ...restProps } = props;
11
- return (_jsx("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...restProps, children: _jsx("path", { d: "M21 10H13M21 6H13M21 14H13M21 18H13M6 20L6 4M6 20L3 17M6 20L9 17M6 4L3 7M6 4L9 7", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
12
- };
13
- const OPTIONS = [
14
- { value: '1', label: 'Single' },
15
- { value: '2', label: 'Double' },
16
- ...range(1.1, 3.1, 0.1).map(spacing => {
17
- const roundValue = round(spacing, 1);
18
- return {
19
- value: `${roundValue}`,
20
- label: `${roundValue}`,
21
- };
22
- }),
23
- ];
24
- export const SpacingAction = (props) => {
25
- const { editor, defaultValue = DEFAULT_TEXT_STYLE.lineHeight } = props;
26
- const { selectedLineHeight } = useEditorState({
27
- editor,
28
- selector: ({ editor: editorInstance }) => ({
29
- selectedLineHeight: OPTIONS.map(i => i.value).find(lineHeight => editorInstance?.isActive({
30
- [LineHeight.name]: lineHeight,
31
- })),
32
- }),
33
- });
34
- return (_jsx(DropdownButton, { value: selectedLineHeight, options: [
35
- {
36
- label: (_jsx(Tooltip, { mouseEnterDelay: 0.4, title: defaultValue, arrow: false, children: "Default" })),
37
- value: defaultValue,
38
- },
39
- ...OPTIONS,
40
- ], onClickOption: value => {
41
- editor.chain().focus().setLineHeight(value).run();
42
- }, tooltipProps: {
43
- title: TOOLTIPS.LINE_SPACING.TITLE,
44
- }, children: _jsx(SpacingIcon, { size: 18 }) }));
45
- };
@@ -1,5 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- export interface StrikeActionProps {
3
- editor: Editor;
4
- }
5
- export declare const StrikeAction: ({ editor }: StrikeActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TextEditorButton } from '../../Button';
3
- import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
4
- import { useEditorState } from '@tiptap/react';
5
- const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
6
- const StrikethroughIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M9.77778 21H14.2222V17.6H9.77778V21ZM4.22222 4V7.4H9.77778V10.8H14.2222V7.4H19.7778V4H4.22222ZM2 15.3333H22V13.0667H2V15.3333Z", fill: "currentColor" }) }));
7
- export const StrikeAction = ({ editor }) => {
8
- const { isStrike, disabled } = useEditorState({
9
- editor,
10
- selector: ({ editor: editorInstance }) => ({
11
- isStrike: editorInstance.isActive('strike'),
12
- disabled: !editorInstance.can().chain().focus().toggleStrike().run(),
13
- }),
14
- });
15
- return (_jsx(TextEditorButton, { icon: _jsx(StrikethroughIcon, { size: 18 }), disabled: disabled, isActive: isStrike, onClick: () => editor.chain().focus().toggleStrike().run(), tooltipProps: {
16
- title: `${TOOLTIPS.STRIKE.TITLE} (${TOOLTIPS.STRIKE.SHORTCUT})`,
17
- } }));
18
- };
@@ -1,5 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- export interface SubscriptActionProps {
3
- editor: Editor;
4
- }
5
- export declare const SubscriptAction: ({ editor }: SubscriptActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
3
- import { TextEditorButton } from '../../Button';
4
- import { useEditorState } from '@tiptap/react';
5
- const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
6
- const SubscriptIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M20.8318 19.625H18.4953V20.8125H22V22H17.3271V19.625C17.3271 18.9719 17.8528 18.4375 18.4953 18.4375H20.8318V17.25H17.3271V16.0625H20.8318C21.4743 16.0625 22 16.5969 22 17.25V18.4375C22 19.0906 21.4743 19.625 20.8318 19.625ZM2 19.625H5.10748L9.07944 13.1887H9.21963L13.1916 19.625H16.2991L10.8668 10.9919L15.9369 3H12.8061L9.21963 8.92562H9.07944L5.46963 3H2.36215L7.40888 10.9919L2 19.625Z", fill: "currentColor" }) }));
7
- export const SubscriptAction = ({ editor }) => {
8
- const { isSubscript, isSuperscript, disabled } = useEditorState({
9
- editor,
10
- selector: ({ editor: editorInstance }) => ({
11
- isSubscript: editorInstance.isActive('subscript'),
12
- isSuperscript: editorInstance.isActive('superscript'),
13
- disabled: !editorInstance.can().chain().focus().toggleSubscript().run(),
14
- }),
15
- });
16
- return (_jsx(TextEditorButton, { onClick: () => {
17
- if (isSuperscript) {
18
- editor.chain().focus().toggleSuperscript().toggleSubscript().run();
19
- }
20
- else {
21
- editor.chain().focus().toggleSubscript().run();
22
- }
23
- }, disabled: disabled, isActive: isSubscript, icon: _jsx(SubscriptIcon, { size: 18 }), tooltipProps: {
24
- title: `${TOOLTIPS.SUBSCRIPT.TITLE} (${TOOLTIPS.SUBSCRIPT.SHORTCUT})`,
25
- } }));
26
- };
@@ -1,5 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- export interface SuperscriptActionProps {
3
- editor: Editor;
4
- }
5
- export declare const SuperscriptAction: ({ editor }: SuperscriptActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,26 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
3
- import { TextEditorButton } from '../../Button';
4
- import { useEditorState } from '@tiptap/react';
5
- const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
6
- const SuperscriptIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M20.8318 6.5625H18.4953V7.75H22V8.9375H17.3271V6.5625C17.3271 5.90937 17.8528 5.375 18.4953 5.375H20.8318V4.1875H17.3271V3H20.8318C21.4743 3 22 3.53437 22 4.1875V5.375C22 6.02813 21.4743 6.5625 20.8318 6.5625ZM2 22H5.10748L9.07944 15.5637H9.21963L13.1916 22H16.2991L10.8668 13.3669L15.9369 5.375H12.8061L9.21963 11.3006H9.07944L5.46963 5.375H2.36215L7.40888 13.3669L2 22Z", fill: "currentColor" }) }));
7
- export const SuperscriptAction = ({ editor }) => {
8
- const { isSuperscript, isSubscript, disabled } = useEditorState({
9
- editor,
10
- selector: ({ editor: editorInstance }) => ({
11
- isSuperscript: editorInstance.isActive('superscript'),
12
- isSubscript: editorInstance.isActive('subscript'),
13
- disabled: !editorInstance.can().chain().focus().toggleSuperscript().run(),
14
- }),
15
- });
16
- return (_jsx(TextEditorButton, { onClick: () => {
17
- if (isSubscript) {
18
- editor.chain().focus().toggleSubscript().toggleSuperscript().run();
19
- }
20
- else {
21
- editor.chain().focus().toggleSuperscript().run();
22
- }
23
- }, disabled: disabled, isActive: isSuperscript, icon: _jsx(SuperscriptIcon, { size: 18 }), tooltipProps: {
24
- title: `${TOOLTIPS.SUPERSCRIPT.TITLE} (${TOOLTIPS.SUBSCRIPT.SHORTCUT})`,
25
- } }));
26
- };
@@ -1,5 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- export interface TextAlignActionProps {
3
- editor: Editor;
4
- }
5
- export declare const TextAlignAction: ({ editor }: TextAlignActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TextAlignSelect } from '../../TextAlignSelect';
3
- export const TextAlignAction = ({ editor }) => (_jsx(TextAlignSelect, { editor: editor, onChange: v => editor.chain().focus().setTextAlign(v).run() }));
@@ -1,5 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- export interface HighlightActionProps {
3
- editor: Editor;
4
- }
5
- export declare const TextBackColorAction: ({ editor }: HighlightActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,29 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Button, Flex } from 'antd';
3
- import { ColorPicker } from '../../ColorPicker';
4
- import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
5
- import { useRef } from 'react';
6
- import tinycolor from 'tinycolor2';
7
- import { TextEditorButton } from '../../Button';
8
- import { useEditorState } from '@tiptap/react';
9
- const BrushCleaningIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M20.7879 12.7767C20.7879 13.3592 20.7205 13.9175 20.5859 14.4515C20.4512 14.9854 20.266 15.4951 20.0303 15.9806L18.4646 14.5243C18.5657 14.2492 18.6414 13.9701 18.6919 13.6869C18.7424 13.4037 18.7677 13.1003 18.7677 12.7767C18.7677 12.0162 18.6204 11.2961 18.3258 10.6165C18.0311 9.93689 17.5892 9.3301 17 8.79612L12.7071 4.71845L10.4848 6.80583L9.07071 5.4466L12.7071 2L18.4141 7.38835C19.1549 8.06796 19.7357 8.87298 20.1566 9.8034C20.5774 10.7338 20.7879 11.7249 20.7879 12.7767ZM20.5859 22L17.4545 18.9903C16.7643 19.4595 16.0236 19.8196 15.2323 20.0704C14.4411 20.3212 13.5993 20.4466 12.7071 20.4466C10.468 20.4466 8.56145 19.6982 6.98737 18.2015C5.4133 16.7047 4.62626 14.8964 4.62626 12.7767C4.62626 11.9515 4.76094 11.1586 5.0303 10.3981C5.29966 9.63754 5.7037 8.90938 6.24242 8.21359L2 4.13592L3.41414 2.7767L22 20.6408L20.5859 22ZM12.7071 18.5049C13.3131 18.5049 13.8897 18.4239 14.4369 18.2621C14.984 18.1003 15.5017 17.8738 15.9899 17.5825L7.65657 9.62136C7.30303 10.1392 7.0463 10.657 6.88636 11.1748C6.72643 11.6926 6.64646 12.2265 6.64646 12.7767C6.64646 14.3625 7.23569 15.7136 8.41414 16.8301C9.59259 17.9466 11.0236 18.5049 12.7071 18.5049Z", fill: "currentColor" }) }));
10
- const HighlighterIcon = ({ size, color = 'currentColor' }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: [_jsx("path", { d: "M2 24V20H22V24H2Z", fill: color }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M16.7246 12.6748L12 17.4248C11.6001 17.8247 11.1294 18.0253 10.5879 18.0254C10.0462 18.0254 9.5748 17.8248 9.1748 17.4248L8.5 18H3.5L6.65039 14.875C6.25039 14.475 6.04206 13.9958 6.02539 13.4375C6.00873 12.8793 6.19974 12.4 6.59961 12L11.3252 7.27539L16.7246 12.6748ZM8 13.4004L10.5752 16L14.5996 12L12 9.40039L8 13.4004Z", fill: "currentColor" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M17.4121 2C17.9537 2 18.4252 2.19968 18.8252 2.59961L21.4248 5.1748C21.8248 5.5748 22.0254 6.04622 22.0254 6.58789C22.0253 7.12939 21.8247 7.6001 21.4248 8L16.7246 12.6748L11.3252 7.27539L16 2.59961C16.3999 2.19984 16.8707 2.0001 17.4121 2ZM13.4248 8L16 10.5752L20 6.59961L17.4004 4L13.4248 8Z", fill: "currentColor" })] }));
11
- const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
12
- export const TextBackColorAction = ({ editor }) => {
13
- const ref = useRef(null);
14
- const { activeColor } = useEditorState({
15
- editor,
16
- selector: ({ editor: editorInstance }) => ({
17
- activeColor: editorInstance.getAttributes('textStyle').backgroundColor,
18
- }),
19
- });
20
- const handleClearBackgroundColor = () => {
21
- editor.chain().focus().unsetBackgroundColor().run();
22
- ref.current?.setOpen(false);
23
- };
24
- return (_jsx(ColorPicker, { ref: ref, value: activeColor, onChange: v => editor.chain().focus().setBackgroundColor(v).run(), popoverProps: {
25
- content: ({ colorGrid, usedColors, customColorPicker }) => (_jsxs(Flex, { vertical: true, gap: 8, children: [colorGrid, usedColors, customColorPicker, _jsx(Button, { icon: _jsx(BrushCleaningIcon, { size: 18 }), onClick: handleClearBackgroundColor, type: "text", children: "None" })] })),
26
- }, children: _jsx(TextEditorButton, { tooltipProps: {
27
- title: TOOLTIPS.HIGHLIGHT.TITLE,
28
- }, icon: _jsx(HighlighterIcon, { color: tinycolor(activeColor).isValid() ? activeColor : 'transparent', size: 18 }) }) }));
29
- };
@@ -1,14 +0,0 @@
1
- /// <reference types="react" />
2
- import { Editor } from '@tiptap/core';
3
- interface IconProps extends React.SVGProps<SVGSVGElement> {
4
- color?: string;
5
- textColor?: string;
6
- size?: number;
7
- }
8
- export declare const TextColorIcon: (props: IconProps) => import("react/jsx-runtime").JSX.Element;
9
- export interface TextColorActionProps {
10
- editor: Editor;
11
- defaultValue?: string;
12
- }
13
- export declare const TextColorAction: ({ editor, defaultValue, }: TextColorActionProps) => import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { ColorPicker } from '../../ColorPicker';
3
- import { DEFAULT_TEXT_STYLE, TEXT_EDITOR_CONSTANTS } from '../../../constants';
4
- import tinycolor from 'tinycolor2';
5
- import { TextEditorButton } from '../../Button';
6
- import { useEditorState } from '@tiptap/react';
7
- const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
8
- export const TextColorIcon = (props) => {
9
- const { color, textColor = 'currentColor', size = 24, ...rest } = props;
10
- return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", ...rest, children: [_jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M19 18H16.415L15.0688 13.8862H8.98483L7.58504 18H5L10.6538 2H13.3462L19 18ZM9.73888 11.6004H14.2611L12.0536 4.97098H11.9464L9.73888 11.6004Z", fill: "currentColor" }), _jsx("path", { d: "M2 24V20H22V24H2Z", fill: textColor })] }));
11
- };
12
- export const TextColorAction = ({ editor, defaultValue = DEFAULT_TEXT_STYLE.color, }) => {
13
- const { activeColor } = useEditorState({
14
- editor,
15
- selector: ({ editor: editorInstance }) => ({
16
- activeColor: editorInstance.getAttributes('textStyle').color,
17
- }),
18
- });
19
- return (_jsx(ColorPicker, { value: activeColor, onChange: v => editor.chain().focus().setColor(v).run(), children: _jsx(TextEditorButton, { icon: _jsx(TextColorIcon, { size: 18, textColor: tinycolor(activeColor).isValid() ? activeColor : defaultValue }), tooltipProps: {
20
- title: TOOLTIPS.TEXT_COLOR.TITLE,
21
- } }) }));
22
- };
@@ -1,5 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- export interface TextTransformActionProps {
3
- editor: Editor;
4
- }
5
- export declare const TextTransformAction: ({ editor }: TextTransformActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,36 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
3
- import { DropdownButton } from '../../DropdownButton';
4
- import { useEditorState } from '@tiptap/react';
5
- const { TEXT_TRANSFORM, TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
6
- const TextTransformIcon = ({ size }) => (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: [_jsx("path", { d: "M21.8775 10.3857V12.3506H15.9394V10.3857H21.8775ZM17.4098 7.81406H20.1243V17.6674C20.1243 17.9692 20.162 18.2004 20.2374 18.3609C20.3191 18.5214 20.4385 18.6338 20.5956 18.698C20.7527 18.7558 20.9506 18.7847 21.1894 18.7847C21.3591 18.7847 21.5099 18.7783 21.6418 18.7654C21.7801 18.7462 21.8963 18.7269 21.9906 18.7076L22 20.7496C21.7675 20.8266 21.5162 20.8876 21.246 20.9326C20.9758 20.9775 20.6773 21 20.3505 21C19.7536 21 19.232 20.9005 18.7859 20.7014C18.346 20.4959 18.0067 20.1685 17.7679 19.719C17.5292 19.2695 17.4098 18.6787 17.4098 17.9467V7.81406Z", fill: "currentColor" }), _jsx("path", { d: "M2 3V6.59617H8.64727V20.9808H12.2836V6.59617H18.9309V3H2Z", fill: "currentColor" })] }));
7
- export const TextTransformAction = ({ editor }) => {
8
- const { textTransform } = useEditorState({
9
- editor,
10
- selector: ({ editor: editorInstance }) => ({
11
- textTransform: editorInstance.getAttributes('textStyle').textTransform,
12
- }),
13
- });
14
- return (_jsx(DropdownButton, { tooltipProps: {
15
- title: TOOLTIPS.TEXT_TRANSFORM.TITLE,
16
- }, value: textTransform, options: [
17
- {
18
- label: TEXT_TRANSFORM.OPTIONS.UPPERCASE.LABEL,
19
- value: TEXT_TRANSFORM.OPTIONS.UPPERCASE.VALUE,
20
- },
21
- {
22
- label: TEXT_TRANSFORM.OPTIONS.LOWERCASE.LABEL,
23
- value: TEXT_TRANSFORM.OPTIONS.LOWERCASE.VALUE,
24
- },
25
- {
26
- label: TEXT_TRANSFORM.OPTIONS.CAPITALIZE.LABEL,
27
- value: TEXT_TRANSFORM.OPTIONS.CAPITALIZE.VALUE,
28
- },
29
- {
30
- label: TEXT_TRANSFORM.OPTIONS.NONE.LABEL,
31
- value: TEXT_TRANSFORM.OPTIONS.NONE.VALUE,
32
- },
33
- ], onClickOption: v => {
34
- editor.chain().focus().setTextTransform(v).run();
35
- }, children: _jsx(TextTransformIcon, { size: 18 }) }));
36
- };
@@ -1,5 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- export interface UnderlineActionProps {
3
- editor: Editor;
4
- }
5
- export declare const UnderlineAction: ({ editor }: UnderlineActionProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,18 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { TextEditorButton } from '../../Button';
3
- import { TEXT_EDITOR_CONSTANTS } from '../../../constants';
4
- import { useEditorState } from '@tiptap/react';
5
- const { TOOLTIPS } = TEXT_EDITOR_CONSTANTS;
6
- const UnderlineIcon = ({ size }) => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: size, height: size, viewBox: "0 0 24 24", fill: "none", children: _jsx("path", { d: "M4 22V19.7778H20V22H4ZM12 17.5556C10.0762 17.5556 8.58095 16.9722 7.51429 15.8056C6.44762 14.6389 5.91429 13.0926 5.91429 11.1667V2H8.85714V11.3333C8.85714 12.3704 9.12381 13.213 9.65714 13.8611C10.1905 14.5093 10.9714 14.8333 12 14.8333C13.0286 14.8333 13.8095 14.5093 14.3429 13.8611C14.8762 13.213 15.1429 12.3704 15.1429 11.3333V2H18.0857V11.1667C18.0857 13.0926 17.5524 14.6389 16.4857 15.8056C15.419 16.9722 13.9238 17.5556 12 17.5556Z", fill: "currentColor" }) }));
7
- export const UnderlineAction = ({ editor }) => {
8
- const { isUnderline, disabled } = useEditorState({
9
- editor,
10
- selector: ({ editor: editorInstance }) => ({
11
- isUnderline: editorInstance.isActive('underline'),
12
- disabled: !editorInstance.can().chain().focus().toggleUnderline().run(),
13
- }),
14
- });
15
- return (_jsx(TextEditorButton, { onClick: () => editor.chain().focus().toggleUnderline().run(), disabled: disabled, isActive: isUnderline, icon: _jsx(UnderlineIcon, { size: 18 }), tooltipProps: {
16
- title: `${TOOLTIPS.UNDERLINE.TITLE} (${TOOLTIPS.UNDERLINE.SHORTCUT})`,
17
- } }));
18
- };
@@ -1,6 +0,0 @@
1
- import { Editor } from '@tiptap/core';
2
- interface UnsetLinkActionProps {
3
- editor: Editor;
4
- }
5
- export declare const UnsetLinkAction: (props: UnsetLinkActionProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // Hooks
3
- // import { useLinkHandler } from '../../../hooks/useLinkHandler';
4
- import { LinkOffIcon } from '@antscorp/antsomi-ui/es/components/icons';
5
- import { TextEditorButton } from '../../Button';
6
- import { useEditorState } from '@tiptap/react';
7
- export const UnsetLinkAction = (props) => {
8
- const { editor } = props;
9
- // const { unsetLink } = useLinkHandler({ editor });
10
- const { disabled } = useEditorState({
11
- editor,
12
- selector: ({ editor: editorInstance }) => ({
13
- disabled: !editorInstance.can().chain().focus().unsetLink().run(),
14
- }),
15
- });
16
- return (_jsx(TextEditorButton, { tooltipProps: {
17
- title: 'Remove link',
18
- }, disabled: disabled, icon: _jsx(LinkOffIcon, { size: 18 }), onClick: () => editor.chain().unsetCustomLink() }));
19
- };
@@ -1,24 +0,0 @@
1
- export * from './BoldAction';
2
- export * from './BulletListAction';
3
- export * from './ClearFormattingAction';
4
- export * from './FontFamilyAction';
5
- export * from './FontSizeAction';
6
- export * from './ItalicAction';
7
- export * from './StrikeAction';
8
- export * from './SuperscriptAction';
9
- export * from './SubscriptAction';
10
- export * from './TextTransformAction';
11
- export * from './LinkAction';
12
- export * from './SmartTagAction';
13
- export * from './TextColorAction';
14
- export * from './OrderedListAction';
15
- export * from './TextAlignAction';
16
- export * from './IndentAction';
17
- export * from './OutdentAction';
18
- export * from './UnderlineAction';
19
- export * from './EmojiAction';
20
- export * from './HistoryAction';
21
- export * from './LetterSpacing';
22
- export * from './TextBackgroundColorAction';
23
- export * from './UnsetLink';
24
- export * from './SpacingAction';
@@ -1,24 +0,0 @@
1
- export * from './BoldAction';
2
- export * from './BulletListAction';
3
- export * from './ClearFormattingAction';
4
- export * from './FontFamilyAction';
5
- export * from './FontSizeAction';
6
- export * from './ItalicAction';
7
- export * from './StrikeAction';
8
- export * from './SuperscriptAction';
9
- export * from './SubscriptAction';
10
- export * from './TextTransformAction';
11
- export * from './LinkAction';
12
- export * from './SmartTagAction';
13
- export * from './TextColorAction';
14
- export * from './OrderedListAction';
15
- export * from './TextAlignAction';
16
- export * from './IndentAction';
17
- export * from './OutdentAction';
18
- export * from './UnderlineAction';
19
- export * from './EmojiAction';
20
- export * from './HistoryAction';
21
- export * from './LetterSpacing';
22
- export * from './TextBackgroundColorAction';
23
- export * from './UnsetLink';
24
- export * from './SpacingAction';
@@ -1 +0,0 @@
1
- export { Toolbar, type ToolbarProps } from './Toolbar';
@@ -1 +0,0 @@
1
- export { Toolbar } from './Toolbar';
@@ -1,57 +0,0 @@
1
- import { EditorState } from '@tiptap/pm/state';
2
- import { Node as ProseMirrorNode } from '@tiptap/pm/model';
3
- /**
4
- * Configuration for document emptiness detection
5
- */
6
- export interface DocumentStateConfig {
7
- /** Minimum size to consider document as having content */
8
- minContentSize?: number;
9
- /** Whether to consider whitespace-only content as empty */
10
- ignoreWhitespace?: boolean;
11
- /** Custom validation function */
12
- customValidator?: (doc: ProseMirrorNode) => boolean;
13
- }
14
- /**
15
- * Calculates the minimum size of an empty document based on schema
16
- */
17
- export declare function calculateEmptyDocumentSize(state: EditorState): number;
18
- /**
19
- * Checks if document is effectively empty
20
- */
21
- export declare function isDocumentEmpty(state: EditorState, config?: DocumentStateConfig): boolean;
22
- /**
23
- * Checks if document has meaningful content
24
- */
25
- export declare function hasDocumentContent(state: EditorState, config?: DocumentStateConfig): boolean;
26
- /**
27
- * Gets document content statistics
28
- */
29
- export declare function getDocumentStats(state: EditorState): {
30
- nodeSize: number;
31
- textLength: number;
32
- trimmedTextLength: number;
33
- nodeCount: void;
34
- isEmpty: boolean;
35
- emptyDocumentSize: number;
36
- };
37
- /**
38
- * Document state change detector
39
- */
40
- export declare class DocumentStateTracker {
41
- private previousState;
42
- /**
43
- * Updates tracker with new state and returns changes
44
- */
45
- update(state: EditorState): {
46
- isEmpty: boolean;
47
- wasEmpty: boolean;
48
- becameEmpty: boolean;
49
- becameNonEmpty: boolean;
50
- sizeChanged: boolean;
51
- textLengthChanged: boolean;
52
- };
53
- /**
54
- * Resets the tracker
55
- */
56
- reset(): void;
57
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * Default configuration for document state detection
3
- */
4
- const DEFAULT_CONFIG = {
5
- minContentSize: 4, // Standard ProseMirror empty doc size
6
- ignoreWhitespace: true,
7
- customValidator: () => false,
8
- };
9
- /**
10
- * Calculates the minimum size of an empty document based on schema
11
- */
12
- export function calculateEmptyDocumentSize(state) {
13
- // Create a minimal document with the same schema
14
- const emptyDoc = state.schema.topNodeType.createAndFill();
15
- return emptyDoc?.nodeSize ?? 4;
16
- }
17
- /**
18
- * Checks if document is effectively empty
19
- */
20
- export function isDocumentEmpty(state, config = {}) {
21
- const { minContentSize, ignoreWhitespace, customValidator } = {
22
- ...DEFAULT_CONFIG,
23
- ...config,
24
- };
25
- const { doc } = state;
26
- // Use custom validator if provided
27
- if (customValidator(doc)) {
28
- return true;
29
- }
30
- // Check document size
31
- const calculatedMinSize = calculateEmptyDocumentSize(state);
32
- const effectiveMinSize = minContentSize === 4 ? calculatedMinSize : minContentSize;
33
- if (doc.nodeSize <= effectiveMinSize) {
34
- return true;
35
- }
36
- // Check if content is only whitespace
37
- if (ignoreWhitespace) {
38
- const textContent = doc.textContent.trim();
39
- return textContent.length === 0;
40
- }
41
- return false;
42
- }
43
- /**
44
- * Checks if document has meaningful content
45
- */
46
- export function hasDocumentContent(state, config = {}) {
47
- return !isDocumentEmpty(state, config);
48
- }
49
- /**
50
- * Gets document content statistics
51
- */
52
- export function getDocumentStats(state) {
53
- const { doc } = state;
54
- return {
55
- nodeSize: doc.nodeSize,
56
- textLength: doc.textContent.length,
57
- trimmedTextLength: doc.textContent.trim().length,
58
- nodeCount: doc.nodesBetween(0, doc.nodeSize, () => true),
59
- isEmpty: isDocumentEmpty(state),
60
- emptyDocumentSize: calculateEmptyDocumentSize(state),
61
- };
62
- }
63
- /**
64
- * Document state change detector
65
- */
66
- export class DocumentStateTracker {
67
- constructor() {
68
- this.previousState = null;
69
- }
70
- /**
71
- * Updates tracker with new state and returns changes
72
- */
73
- update(state) {
74
- const isEmpty = isDocumentEmpty(state);
75
- const { nodeSize } = state.doc;
76
- const textLength = state.doc.textContent.length;
77
- const result = {
78
- isEmpty,
79
- wasEmpty: this.previousState?.isEmpty ?? true,
80
- becameEmpty: false,
81
- becameNonEmpty: false,
82
- sizeChanged: false,
83
- textLengthChanged: false,
84
- };
85
- if (this.previousState) {
86
- result.becameEmpty = !this.previousState.isEmpty && isEmpty;
87
- result.becameNonEmpty = this.previousState.isEmpty && !isEmpty;
88
- result.sizeChanged = this.previousState.nodeSize !== nodeSize;
89
- result.textLengthChanged = this.previousState.textLength !== textLength;
90
- }
91
- this.previousState = { isEmpty, nodeSize, textLength };
92
- return result;
93
- }
94
- /**
95
- * Resets the tracker
96
- */
97
- reset() {
98
- this.previousState = null;
99
- }
100
- }
@@ -1,73 +0,0 @@
1
- import { FontConfig } from '../types';
2
- /**
3
- * Gets the appropriate bold font weight for a given font family
4
- * @param currentFontFamily The font family to find bold weight for
5
- * @param fonts Array of available font configurations
6
- * @param minBoldWeight Minimum weight considered bold (default 700)
7
- * @returns The first available bold weight for the font family, or minBoldWeight if none found
8
- */
9
- export declare const getBoldFontWeight: (currentFontFamily: string, fonts: FontConfig[], minBoldWeight?: number) => number;
10
- /**
11
- * Validates if a font family name is a generic CSS font
12
- * @param fontFamily Font family name to check
13
- * @returns true if it's a generic font family
14
- */
15
- export declare function isGenericFontFamily(fontFamily: string): boolean;
16
- /**
17
- * Extracts the primary font from a font-family string
18
- * @param fontFamily Font family string (may contain fallbacks)
19
- * @returns Primary font name
20
- */
21
- export declare function getPrimaryFontFamily(fontFamily: string): string;
22
- /**
23
- * Checks if a font weight is considered bold
24
- * @param weight Font weight to check
25
- * @param threshold Bold threshold (default 600)
26
- * @returns true if weight is bold
27
- */
28
- export declare function isBoldWeight(weight: string | number, threshold?: number): boolean;
29
- /**
30
- * Gets all available font weights for a font family
31
- * @param fontFamily Font family name
32
- * @param fonts Array of font configurations
33
- * @returns Array of available weights
34
- */
35
- export declare function getFontWeights(fontFamily: string, fonts: FontConfig[]): number[];
36
- /**
37
- * Finds the closest available font weight
38
- * @param targetWeight Desired font weight
39
- * @param availableWeights Array of available weights
40
- * @returns Closest available weight
41
- */
42
- export declare function getClosestFontWeight(targetWeight: number, availableWeights: number[]): number;
43
- /**
44
- * Validates font configuration
45
- * @param fontConfig Font configuration to validate
46
- * @returns true if configuration is valid
47
- */
48
- export declare function isValidFontConfig(fontConfig: FontConfig): boolean;
49
- /**
50
- * Sorts font configurations alphabetically by name
51
- * @param fonts Array of font configurations
52
- * @returns Sorted array of font configurations
53
- */
54
- export declare function sortFontsByName(fonts: FontConfig[]): FontConfig[];
55
- /**
56
- * Groups fonts by category (if category property exists)
57
- * @param fonts Array of font configurations
58
- * @returns Object with fonts grouped by category
59
- */
60
- export declare function groupFontsByCategory(fonts: FontConfig[]): Record<string, FontConfig[]>;
61
- /**
62
- * Checks if a font is web safe
63
- * @param fontFamily Font family name
64
- * @returns true if font is web safe
65
- */
66
- export declare function isWebSafeFont(fontFamily: string): boolean;
67
- /**
68
- * Creates a font stack with appropriate fallbacks
69
- * @param primaryFont Primary font family
70
- * @param category Font category for fallback selection
71
- * @returns Complete font stack string
72
- */
73
- export declare function createFontStack(primaryFont: string, category?: 'serif' | 'sans-serif' | 'monospace'): string;