@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,5 +0,0 @@
1
- export type EyedropperProps = {
2
- defaultColor?: string;
3
- onColorPick?: (color: string) => void;
4
- className?: string;
5
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const ALignRightIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const ALignRightIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "M3 21H21V19H3V21ZM9 17H21V15H9V17ZM3 13H21V11H3V13ZM9 9H21V7H9V9ZM3 3V5H21V3H3Z", fill: "currentColor" }) }));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const AlignCenterIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const AlignCenterIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "M7 15V17H17V15H7ZM3 21H21V19H3V21ZM3 13H21V11H3V13ZM7 7V9H17V7H7ZM3 3V5H21V3H3Z", fill: "currentColor" }) }));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const AlignJustifyIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const AlignJustifyIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "M3 21H21V19H3V21ZM3 17H21V15H3V17ZM3 13H21V11H3V13ZM3 9H21V7H3V9ZM3 3V5H21V3H3Z", fill: "currentColor" }) }));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const AlignLeftIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const AlignLeftIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "M15 15H3V17H15V15ZM15 7H3V9H15V7ZM3 13H21V11H3V13ZM3 21H21V19H3V21ZM3 3V5H21V3H3Z", fill: "currentColor" }) }));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const ArrowDropDownIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const ArrowDropDownIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "M7 10L12 15L17 10H7Z", fill: "black" }) }));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const ChevronRightIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const ChevronRightIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "m9 18 6-6-6-6" }) }));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const ColorizeIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const ColorizeIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "M21.6764 4.92454L19.0766 2.32489C18.9738 2.2219 18.8517 2.1402 18.7173 2.08445C18.5829 2.0287 18.4388 2 18.2933 2C18.1478 2 18.0037 2.0287 17.8693 2.08445C17.7349 2.1402 17.6128 2.2219 17.51 2.32489L14.0436 5.79109L11.8993 3.66916L10.3327 5.23561L11.9104 6.81317L2 16.7229V22H7.27741L17.1878 12.0902L18.7655 13.6678L20.332 12.1013L18.1989 9.9683L21.6653 6.50211C22.1097 6.05772 22.1097 5.35782 21.6764 4.92454ZM6.35525 19.7781L4.22207 17.645L13.177 8.6907L15.3102 10.8237L6.35525 19.7781Z", fill: "black" }) }));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const LinkOffIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const LinkOffIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "M21.7338 20.4488C22.0886 20.8038 22.0888 21.3789 21.7338 21.7338C21.3789 22.0888 20.8038 22.0886 20.4488 21.7338L21.7338 20.4488ZM2 12.0006C2 10.554 2.57508 9.16568 3.59799 8.14276C4.16642 7.57438 4.8477 7.14486 5.58882 6.875L2.26633 3.55247L2.15048 3.40998C1.91716 3.05707 1.95555 2.57685 2.26633 2.26607C2.57711 1.95529 3.05732 1.91689 3.41023 2.15021L3.55271 2.26607L21.7338 20.4488L21.0907 21.0906L20.4488 21.7338L11.6239 12.9088H8.364C7.86207 12.9088 7.45471 12.5025 7.45447 12.0006C7.45447 11.4985 7.86193 11.0911 8.364 11.0911H9.80485L7.09493 8.37979C6.26264 8.46253 5.47964 8.83254 4.88304 9.42915C4.20138 10.1111 3.81905 11.0364 3.81905 12.0006C3.81916 12.9649 4.2012 13.8902 4.88304 14.5721C5.56488 15.2539 6.49022 15.636 7.45447 15.6361H9.27352L9.45596 15.6547C9.87039 15.7394 10.1817 16.1062 10.1817 16.5456C10.1817 16.9851 9.87039 17.3519 9.45596 17.4365L9.27352 17.4552H7.45447C6.00802 17.455 4.6208 16.88 3.59799 15.8572C2.57518 14.8343 2.00012 13.4471 2 12.0006ZM16.5457 6.54608C17.5584 6.54608 18.5512 6.82743 19.4128 7.35973C20.2744 7.89228 20.9719 8.65496 21.4249 9.56099C21.8778 10.4669 22.0685 11.4819 21.9775 12.4907C21.8865 13.4992 21.517 14.4624 20.9096 15.2725L20.7844 15.4084C20.468 15.6888 19.9879 15.7185 19.6365 15.455C19.2348 15.1537 19.1541 14.5836 19.4554 14.1819L19.5992 13.9742C19.9185 13.4802 20.1148 12.9152 20.1678 12.3269C20.2285 11.6543 20.0996 10.9773 19.7976 10.3733C19.4957 9.76978 19.032 9.26202 18.458 8.90714C17.8835 8.5521 17.221 8.36381 16.5457 8.36381H14.728C14.2259 8.36381 13.8185 7.95636 13.8185 7.45428C13.8187 6.95241 14.2261 6.54608 14.728 6.54608H16.5457Z", fill: "currentColor" }) }));
7
- });
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { IconProps } from './types';
3
- export declare const MinusIcon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from 'react';
3
- import { useIcon } from './hooks/useIcon';
4
- export const MinusIcon = forwardRef((props, ref) => {
5
- const { width, height } = useIcon(props);
6
- return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, ref: ref, width: width, height: height, children: _jsx("path", { d: "M19 13H5V11H19V13Z", fill: "currentColor" }) }));
7
- });
@@ -1,2 +0,0 @@
1
- @import url('./organism/index.scss');
2
- @import url('./molecules/index.scss');
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- interface EyedropperButtonProps {
3
- onColorPick?: (color: string) => void;
4
- size?: 'small' | 'middle' | 'large';
5
- type?: 'primary' | 'default' | 'dashed' | 'link' | 'text';
6
- disabled?: boolean;
7
- className?: string;
8
- showIcon?: boolean;
9
- }
10
- export declare const EyedropperButton: React.FC<EyedropperButtonProps>;
11
- export {};
@@ -1,34 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useState } from 'react';
3
- import { Button, Popover, Typography } from 'antd';
4
- import tinycolor from 'tinycolor2';
5
- import { useEyedropper } from '@antscorp/antsomi-ui/es/hooks';
6
- import { ColorizeIcon } from '../../icons';
7
- import { ColorSwatch, ColorText, PopoverContent } from './styled';
8
- const { Text } = Typography;
9
- export const EyedropperButton = ({ onColorPick, size = 'middle', type = 'text', disabled = false, className, showIcon = true, }) => {
10
- const { isLoading, apiSupported, pickColor, copyToClipboard } = useEyedropper();
11
- const [popoverVisible, setPopoverVisible] = useState(false);
12
- const [currentColor, setCurrentColor] = useState(null);
13
- const handlePickColor = useCallback(async () => {
14
- const color = await pickColor();
15
- if (color) {
16
- setCurrentColor(color);
17
- const copySuccess = await copyToClipboard(color);
18
- if (copySuccess) {
19
- setPopoverVisible(true);
20
- setTimeout(() => {
21
- setPopoverVisible(false);
22
- }, 2000);
23
- }
24
- onColorPick?.(color);
25
- }
26
- }, [copyToClipboard, onColorPick, pickColor]);
27
- const renderPopoverContent = useCallback(() => {
28
- if (!currentColor)
29
- return null;
30
- const isLight = tinycolor(currentColor).isLight();
31
- return (_jsxs(PopoverContent, { children: [_jsx(ColorSwatch, { "$color": currentColor }), _jsxs("div", { children: [_jsx(Text, { type: "secondary", style: { fontSize: '12px' }, children: "\u0110\u00E3 copy:" }), _jsx("br", {}), _jsx(ColorText, { color: currentColor, "$isLight": isLight, children: currentColor })] })] }));
32
- }, [currentColor]);
33
- return (_jsx(Popover, { content: renderPopoverContent(), title: "M\u00E0u \u0111\u00E3 tr\u00EDch xu\u1EA5t", trigger: ['click'], open: popoverVisible, onOpenChange: setPopoverVisible, placement: "top", children: _jsx(Button, { type: type, size: size, icon: showIcon ? _jsx(ColorizeIcon, { size: 16 }) : undefined, onClick: handlePickColor, loading: isLoading, disabled: disabled || isLoading || !apiSupported, className: className, title: !apiSupported ? 'Trình duyệt không hỗ trợ EyeDropper API' : 'Trích xuất màu từ màn hình' }) }));
34
- };
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,7 +0,0 @@
1
- export declare const ColorSwatch: import("styled-components").StyledComponent<"div", any, {
2
- $color: string;
3
- }, never>;
4
- export declare const PopoverContent: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const ColorText: import("styled-components").StyledComponent<"span", any, {
6
- $isLight: boolean;
7
- }, never>;
@@ -1,23 +0,0 @@
1
- import styled from 'styled-components';
2
- export const ColorSwatch = styled.div `
3
- width: 24px;
4
- height: 24px;
5
- border-radius: 4px;
6
- background-color: ${props => props.$color};
7
- border: 1px solid #d9d9d9;
8
- flex-shrink: 0;
9
- `;
10
- export const PopoverContent = styled.div `
11
- display: flex;
12
- align-items: center;
13
- gap: 8px;
14
- padding: 4px 0;
15
- `;
16
- export const ColorText = styled.span `
17
- background-color: ${props => props.color};
18
- color: ${props => (props.$isLight ? '#000' : '#fff')};
19
- padding: 2px 6px;
20
- border-radius: 4px;
21
- font-family: monospace;
22
- font-size: 12px;
23
- `;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import { FontSizeInputProps, HandlerRef } from './types';
3
- export declare const FontSizeInput: import("react").ForwardRefExoticComponent<FontSizeInputProps & import("react").RefAttributes<HandlerRef>>;
@@ -1,134 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef, useCallback, useState, useImperativeHandle, useEffect, useRef, useMemo, } from 'react';
3
- import clsx from 'clsx';
4
- import { useElementSize } from '@antscorp/antsomi-ui/es/hooks';
5
- import { DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE_OPTIONS } from './constants';
6
- import { CLS } from './utils';
7
- import { FontSizeDropdown } from './components/FontSizeDropdown';
8
- import { FontSizeControl } from './components/FontSizeControl';
9
- export const FontSizeInput = forwardRef((props, ref) => {
10
- const { min = 1, max = 300, value: valueProp, defaultValue = DEFAULT_FONT_SIZE, options = DEFAULT_FONT_SIZE_OPTIONS, placeholder, style, className, disabled, dropdownProps, onFocus, onBlur, onChange = () => undefined, } = props;
11
- const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue);
12
- const [isPopoverOpen, setIsPopoverOpen] = useState(false);
13
- const [popoverValue, setPopoverValue] = useState(null);
14
- const [initialPopoverValue, setInitialPopoverValue] = useState(null);
15
- const [inputRef, { width: inputWidth }] = useElementSize();
16
- const isControlled = valueProp !== undefined;
17
- const value = isControlled ? +valueProp : +uncontrolledValue;
18
- const popoverItemRefs = useRef(new Map());
19
- const fontSizeOptions = useMemo(() => options.map(option => ({
20
- size: option,
21
- label: option.toString(),
22
- className: clsx(CLS.PopoverListItem, {
23
- [CLS.PopoverListItemSelected]: option === (value || initialPopoverValue),
24
- }),
25
- })), [options, value, initialPopoverValue]);
26
- useEffect(() => {
27
- if (!isPopoverOpen) {
28
- setPopoverValue(null);
29
- }
30
- if (isPopoverOpen && popoverValue) {
31
- popoverItemRefs.current.get(popoverValue)?.focus();
32
- }
33
- }, [popoverValue, isPopoverOpen]);
34
- const handleInputFocus = (event) => {
35
- onFocus?.(value, event);
36
- setIsPopoverOpen(true);
37
- if (!popoverValue && fontSizeOptions.some(item => item.size === value)) {
38
- setInitialPopoverValue(value);
39
- }
40
- };
41
- const handleInputBlur = (event) => {
42
- onBlur?.(value, event);
43
- if (!popoverValue) {
44
- setIsPopoverOpen(false);
45
- }
46
- };
47
- const handleValueChange = useCallback((newValue, info) => {
48
- if (!isControlled) {
49
- setUncontrolledValue(newValue);
50
- }
51
- onChange(newValue, info);
52
- }, [isControlled, onChange]);
53
- const handleKeyDown = useCallback((e) => {
54
- const currentSize = popoverValue ?? value;
55
- const currentFocusIndex = fontSizeOptions.findIndex(item => item.size === currentSize);
56
- const firstFontSize = fontSizeOptions.at(0);
57
- const lastFontSize = fontSizeOptions.at(-1);
58
- switch (e.key) {
59
- case 'Enter': {
60
- handleValueChange(uncontrolledValue, { type: 'input' });
61
- inputRef.current?.blur();
62
- break;
63
- }
64
- case 'ArrowDown': {
65
- e.preventDefault();
66
- if (currentFocusIndex !== -1) {
67
- // Infinite scroll: go to first item when reaching the end
68
- const nextFocusIndex = (currentFocusIndex + 1) % fontSizeOptions.length;
69
- setPopoverValue(fontSizeOptions[nextFocusIndex].size);
70
- }
71
- else if (firstFontSize) {
72
- setPopoverValue(firstFontSize.size);
73
- }
74
- break;
75
- }
76
- case 'ArrowUp': {
77
- e.preventDefault();
78
- if (currentFocusIndex !== -1) {
79
- // Infinite scroll: go to last item when reaching the beginning
80
- const nextFocusIndex = (currentFocusIndex - 1 + fontSizeOptions.length) % fontSizeOptions.length;
81
- setPopoverValue(fontSizeOptions[nextFocusIndex].size);
82
- }
83
- else if (lastFontSize) {
84
- setPopoverValue(lastFontSize.size);
85
- }
86
- break;
87
- }
88
- default:
89
- break;
90
- }
91
- }, [fontSizeOptions, inputRef, popoverValue, uncontrolledValue, value, handleValueChange]);
92
- const handleClickPopoverItem = useCallback((size) => {
93
- handleValueChange(size, { type: 'dropdown' });
94
- setIsPopoverOpen(false);
95
- inputRef.current?.blur();
96
- }, [handleValueChange, inputRef]);
97
- const handlePopoverItemKeydown = useCallback((e, size) => {
98
- const currentFocusIndex = fontSizeOptions.findIndex(item => item.size === popoverValue);
99
- switch (e.key) {
100
- case 'Enter': {
101
- handleClickPopoverItem(size);
102
- break;
103
- }
104
- case 'ArrowDown': {
105
- // Infinite scroll: go to first item when reaching the end
106
- const nextFocusIndex = (currentFocusIndex + 1) % fontSizeOptions.length;
107
- setPopoverValue(fontSizeOptions[nextFocusIndex].size);
108
- e.stopPropagation();
109
- break;
110
- }
111
- case 'ArrowUp': {
112
- // Infinite scroll: go to last item when reaching the beginning
113
- const nextFocusIndex = (currentFocusIndex - 1 + fontSizeOptions.length) % fontSizeOptions.length;
114
- setPopoverValue(fontSizeOptions[nextFocusIndex].size);
115
- e.stopPropagation();
116
- break;
117
- }
118
- default:
119
- break;
120
- }
121
- }, [fontSizeOptions, popoverValue, handleClickPopoverItem]);
122
- useImperativeHandle(ref, () => ({
123
- closeDropdown: () => setIsPopoverOpen(false),
124
- }));
125
- const content = (_jsx(FontSizeControl, { disabled: disabled, ref: inputRef, className: className, value: popoverValue ?? value, max: max, min: min, keyboard: false, defaultValue: defaultValue, style: style, placeholder: placeholder, onFocus: handleInputFocus, onBlur: handleInputBlur, onKeyDown: handleKeyDown, onChange: newValue => {
126
- if (newValue === null)
127
- return;
128
- setUncontrolledValue(Number(newValue));
129
- }, onIncrement: () => handleValueChange(value + 1, { type: 'input' }), onDecrement: () => handleValueChange(value - 1, { type: 'input' }) }));
130
- if (options.length) {
131
- return (_jsx(FontSizeDropdown, { isOpen: isPopoverOpen, options: fontSizeOptions, popoverValue: popoverValue, initialPopoverValue: initialPopoverValue, width: inputWidth, itemRefs: popoverItemRefs, onItemClick: handleClickPopoverItem, onItemKeyDown: handlePopoverItemKeydown, onClose: () => setIsPopoverOpen(false), getPopupContainer: () => dropdownProps?.getPopupContainer?.() || document.body, children: content }));
132
- }
133
- return content;
134
- });
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { InputNumberProps } from 'antd';
3
- interface FontSizeControlProps extends InputNumberProps {
4
- onIncrement: () => void;
5
- onDecrement: () => void;
6
- }
7
- export declare const FontSizeControl: import("react").ForwardRefExoticComponent<FontSizeControlProps & import("react").RefAttributes<HTMLInputElement>>;
8
- export {};
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { InputNumber } from 'antd';
3
- import { forwardRef } from 'react';
4
- import { ControlButton, InputRoot } from '../styled';
5
- import { CLS } from '../utils';
6
- import clsx from 'clsx';
7
- import { AddIcon, MinusIcon } from '../../../icons';
8
- export const FontSizeControl = forwardRef(({ onIncrement, onDecrement, ...rest }, ref) => (_jsxs(InputRoot, { children: [_jsx(ControlButton, { type: "text", onClick: onDecrement, disabled: rest.disabled ||
9
- typeof rest.value !== 'number' ||
10
- typeof rest.min !== 'number' ||
11
- rest.value <= rest.min, children: _jsx(MinusIcon, { size: 14 }) }), _jsx(InputNumber, { ref: ref, className: clsx(CLS.Input, rest.className), parser: value => value?.replace(/[^\d]/g, ''), controls: false, ...rest }), _jsx(ControlButton, { type: "text", onClick: onIncrement, disabled: rest.disabled ||
12
- typeof rest.value !== 'number' ||
13
- typeof rest.max !== 'number' ||
14
- rest.value >= rest.max, children: _jsx(AddIcon, { size: 14 }) })] })));
@@ -1,21 +0,0 @@
1
- import { RefObject } from 'react';
2
- type FontSizeOption = {
3
- size: number;
4
- label: string;
5
- className: string;
6
- };
7
- interface FontSizeDropdownProps {
8
- children: React.ReactNode;
9
- isOpen: boolean;
10
- options: FontSizeOption[];
11
- popoverValue: number | null;
12
- initialPopoverValue?: number | null;
13
- width: number;
14
- itemRefs: RefObject<Map<number, HTMLLIElement>>;
15
- onItemClick: (size: number) => void;
16
- onItemKeyDown: (e: React.KeyboardEvent, size: number) => void;
17
- onClose: () => void;
18
- getPopupContainer?: () => HTMLElement;
19
- }
20
- export declare const FontSizeDropdown: ({ children, isOpen, options, popoverValue, width, itemRefs, onItemClick, onItemKeyDown, onClose, getPopupContainer, initialPopoverValue, }: FontSizeDropdownProps) => import("react/jsx-runtime").JSX.Element;
21
- export {};
@@ -1,19 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Popover } from 'antd';
3
- import { CLS } from '../utils';
4
- import { StyledListFont, StyledListItemFont } from '../styled';
5
- export const FontSizeDropdown = ({ children, isOpen, options, popoverValue, width, itemRefs, onItemClick, onItemKeyDown, onClose, getPopupContainer, initialPopoverValue, }) => {
6
- const content = (_jsx(StyledListFont, { role: "list", className: CLS.PopoverList, style: { width: `${width}px` }, onMouseDown: e => e.preventDefault(), children: options.map((i, idx) => {
7
- const isFocused = i.size === (popoverValue || initialPopoverValue);
8
- return (_jsx(StyledListItemFont, { ref: el => {
9
- if (!el || !itemRefs.current)
10
- return;
11
- itemRefs.current.set(i.size, el);
12
- }, role: "listitem", className: i.className, "aria-posinset": idx + 1, "aria-setsize": options.length, tabIndex: isFocused ? 0 : -1, onClick: () => onItemClick(i.size), onKeyDown: e => onItemKeyDown(e, i.size), ...(isFocused && {
13
- onBlur: onClose,
14
- }), children: i.label }, i.size));
15
- }) }));
16
- return (_jsx(Popover, { arrow: false, open: isOpen, overlayClassName: CLS.Popover, overlayInnerStyle: {
17
- borderRadius: 4,
18
- }, content: content, getPopupContainer: getPopupContainer, placement: "bottom", children: children }));
19
- };
@@ -1,2 +0,0 @@
1
- export declare const DEFAULT_FONT_SIZE_OPTIONS: number[];
2
- export declare const DEFAULT_FONT_SIZE: number;
@@ -1,5 +0,0 @@
1
- import { THEME } from '@antscorp/antsomi-ui/es/constants';
2
- export const DEFAULT_FONT_SIZE_OPTIONS = [
3
- 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72, 96,
4
- ];
5
- export const DEFAULT_FONT_SIZE = THEME.token?.fontSize || 14;
@@ -1,2 +0,0 @@
1
- export * from './FontSizeInput';
2
- export type { FontSizeInputProps, HandlerRef as FontSizeInputHandlerRef } from './types';
@@ -1 +0,0 @@
1
- export * from './FontSizeInput';
@@ -1,7 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const StyledListFont: import("styled-components").StyledComponent<"ul", any, {}, never>;
3
- export declare const StyledListItemFont: import("styled-components").StyledComponent<"li", any, {}, never>;
4
- export declare const InputRoot: import("styled-components").StyledComponent<"div", any, {}, never>;
5
- export declare const ControlButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<HTMLElement>> & {
6
- Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
7
- }, any, {}, never>;
@@ -1,40 +0,0 @@
1
- import { THEME } from '@antscorp/antsomi-ui/es/constants';
2
- import { Button } from 'antd';
3
- import styled from 'styled-components';
4
- import { CLS } from './utils';
5
- export const StyledListFont = styled.ul `
6
- &.${CLS.PopoverList} {
7
- margin: 0;
8
- padding: 0;
9
- list-style-type: none;
10
- }
11
- `;
12
- export const StyledListItemFont = styled.li `
13
- &.${CLS.PopoverListItem} {
14
- padding: 6px 10px;
15
- cursor: pointer;
16
- text-align: center;
17
-
18
- &:hover,
19
- &:focus,
20
- &:focus-visible,
21
- &.${CLS.PopoverListItemSelected} {
22
- outline: none;
23
- background-color: ${THEME.components?.Menu?.itemHoverBg};
24
- }
25
- }
26
- `;
27
- export const InputRoot = styled.div `
28
- gap: 2px;
29
- display: flex;
30
- align-items: center;
31
- width: fit-content;
32
- `;
33
- export const ControlButton = styled(Button) `
34
- &.antsomi-btn {
35
- width: 24px;
36
- height: 24px;
37
- border-radius: 4px;
38
- padding: 0px;
39
- }
40
- `;
@@ -1,15 +0,0 @@
1
- .antsomi-font-size-input-popover {
2
- &.antsomi-popover {
3
- .antsomi-popover-inner {
4
- padding: 0;
5
-
6
- .antsomi-popover-inner-content {
7
- overflow: auto;
8
-
9
- > ul {
10
- max-height: 240px;
11
- }
12
- }
13
- }
14
- }
15
- }
@@ -1,23 +0,0 @@
1
- /// <reference types="react" />
2
- export interface HandlerRef {
3
- closeDropdown: () => void;
4
- }
5
- export interface FontSizeInputProps {
6
- value: number;
7
- min?: number;
8
- max?: number;
9
- defaultValue?: number;
10
- options?: number[];
11
- placeholder?: string;
12
- style?: React.CSSProperties;
13
- className?: string;
14
- disabled?: boolean;
15
- onChange?: (value: number, info: {
16
- type: 'input' | 'dropdown';
17
- }) => void;
18
- onFocus?: (value: number, event: React.FocusEvent<HTMLInputElement>) => void;
19
- onBlur?: (value: number, event: React.FocusEvent<HTMLInputElement>) => void;
20
- dropdownProps?: {
21
- getPopupContainer?: () => HTMLElement | null;
22
- };
23
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- export declare const CLS: {
2
- Popover: string;
3
- PopoverList: string;
4
- PopoverListItem: string;
5
- PopoverListItemSelected: string;
6
- Input: string;
7
- };
@@ -1,9 +0,0 @@
1
- import { antsomiClsx } from '@antscorp/antsomi-ui/es/utils';
2
- const componentCls = antsomiClsx('font-size-input');
3
- export const CLS = {
4
- Popover: componentCls('popover'),
5
- PopoverList: componentCls('popover-list'),
6
- PopoverListItem: componentCls('popover-list-item'),
7
- PopoverListItemSelected: componentCls('popover-list-item-selected'),
8
- Input: componentCls('input'),
9
- };
@@ -1 +0,0 @@
1
- @import url('./FontSizeInput/styles.scss');