@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,6 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import type { MODE } from './config';
3
- import type { NormalizedNode } from '@antscorp/antsomi-ui/es/utils/tree';
2
+ import { MODE } from './config';
4
3
  export type Mode = (typeof MODE)[keyof typeof MODE];
5
4
  export type ItemKey = string;
6
5
  export type ItemType = {
@@ -12,6 +11,11 @@ export type ItemType = {
12
11
  errorMessage?: string | undefined;
13
12
  disabled?: boolean;
14
13
  };
14
+ export type SerializedItemType = ItemType & {
15
+ level: number;
16
+ pathKey: PathKey;
17
+ parent: ItemType | null;
18
+ };
15
19
  type VirtualizedMenuBaseProps = Partial<{
16
20
  items: ItemType[];
17
21
  inlineIndent: number;
@@ -20,43 +24,22 @@ type VirtualizedMenuBaseProps = Partial<{
20
24
  selectable: boolean;
21
25
  className: string;
22
26
  itemSize: number;
23
- selected: string | string[];
27
+ selected: string[];
24
28
  expanded: string[];
25
29
  onClick: (args: {
26
30
  item: ItemType;
27
- domEvent?: React.MouseEvent;
28
- elKey: 'item' | 'item-expand-el';
31
+ pathKey: PathKey;
29
32
  }) => void;
30
- action: React.ReactNode | ((item: ItemType, others: {
31
- expandEl: React.ReactNode;
32
- }) => React.ReactNode);
33
+ action: React.ReactNode | ((item: ItemType) => React.ReactNode);
33
34
  }>;
34
35
  export type VirtualizedMenuBaseHandle = {
35
36
  expandAll: () => void;
36
37
  };
38
+ export type PathKey = (string | number)[];
37
39
  export type MenuInlineHandle = VirtualizedMenuBaseHandle;
38
40
  export type MenuInlineProps = VirtualizedMenuBaseProps & {
39
41
  mode?: typeof MODE.Inline;
40
42
  };
41
43
  export type VirtualizedMenuHandle = MenuInlineHandle;
42
44
  export type VirtualizedMenuProps = MenuInlineProps;
43
- export type MemoryData = {
44
- itemSpacing: number;
45
- inlineIndent: number;
46
- inlinePadding: number;
47
- selectedKeys: Set<string>;
48
- expandedKeys: Set<string>;
49
- items: NormalizedNode<ItemType & {
50
- ref: (el: HTMLLIElement) => void;
51
- }>[];
52
- normalizeTreeItems: Map<string, NormalizedNode<ItemType>>;
53
- action: MenuInlineProps['action'];
54
- focusId: string | null;
55
- onClick: (args: {
56
- item: NormalizedNode<ItemType>;
57
- index: number;
58
- elKey: 'item' | 'item-expand-el';
59
- domEvent: React.MouseEvent;
60
- }) => void;
61
- };
62
45
  export {};
@@ -1,10 +1,8 @@
1
1
  /// <reference types="lodash" />
2
- import { ItemType } from './types';
3
- import { NormalizedTreeState } from '@antscorp/antsomi-ui/es/utils/tree';
4
- export declare const itemToTreeNode: (item: ItemType) => any;
5
- export declare const serializeItems: (args: {
2
+ import { ItemType, SerializedItemType } from './types';
3
+ export declare const getFlattenItems: (args: {
6
4
  items: ItemType[];
7
- }) => NormalizedTreeState<ItemType>;
5
+ }) => SerializedItemType[];
8
6
  export declare const CLS: {
9
7
  readonly Root: {
10
8
  readonly default: string;
@@ -29,8 +27,7 @@ export declare const CLS: {
29
27
  readonly disabled: string;
30
28
  readonly selected: string;
31
29
  readonly expanded: string;
32
- readonly selectedDescendant: string;
33
30
  };
34
31
  };
35
- export declare const getItemSize: ((itemSize?: number, itemSpacing?: number) => (index: number) => number) & import("lodash").MemoizedFunction;
36
- export declare const calInlineListSize: (itemLength: number, itemSize?: number, itemSpacing?: number) => number;
32
+ export declare const getItemSize: ((itemSize: number, itemSpacing: number) => (index: number) => number) & import("lodash").MemoizedFunction;
33
+ export declare const calInlineListSize: (itemLength: number, itemSize: number, itemSpacing: number) => number;
@@ -1,16 +1,22 @@
1
1
  import { antsomiClsx } from '@antscorp/antsomi-ui/es/utils';
2
- import { COMPONENT_NAME, ITEM_SIZE, ITEM_SPACING, MODE } from './config';
2
+ import { COMPONENT_NAME, MODE } from './config';
3
3
  import { memoize } from 'lodash';
4
- import { normalizeTreeData } from '@antscorp/antsomi-ui/es/utils/tree';
5
- export const itemToTreeNode = (item) => ({
6
- id: item.key,
7
- data: item,
8
- children: item.children?.map(itemToTreeNode),
9
- });
10
- export const serializeItems = (args) => {
4
+ export const getFlattenItems = (args) => {
11
5
  const { items } = args;
12
- const nodes = items.map(itemToTreeNode);
13
- return normalizeTreeData(nodes);
6
+ const result = [];
7
+ function recursively(items, level, pathKey, parent) {
8
+ items.forEach((item, idx) => {
9
+ const currentPathKey = [...pathKey, idx, item.key.toString()];
10
+ result.push({ ...item, level, pathKey: currentPathKey, parent });
11
+ if (item.children && item.children.length > 0) {
12
+ recursively(item.children, level + 1, currentPathKey, item);
13
+ }
14
+ });
15
+ }
16
+ if (items.length) {
17
+ recursively(items, 1, [], null);
18
+ }
19
+ return result;
14
20
  };
15
21
  const componentCls = antsomiClsx(COMPONENT_NAME);
16
22
  export const CLS = {
@@ -37,16 +43,15 @@ export const CLS = {
37
43
  disabled: componentCls('item-disabled'),
38
44
  selected: componentCls('item-selected'),
39
45
  expanded: componentCls('item-expanded'),
40
- selectedDescendant: componentCls('item-selected-descendant'),
41
46
  },
42
47
  };
43
- export const getItemSize = memoize((itemSize = ITEM_SIZE, itemSpacing = ITEM_SPACING) => (index) => {
48
+ export const getItemSize = memoize((itemSize, itemSpacing) => (index) => {
44
49
  if (index === 0) {
45
50
  return itemSize;
46
51
  }
47
52
  return itemSize + itemSpacing;
48
53
  });
49
- export const calInlineListSize = (itemLength, itemSize = ITEM_SIZE, itemSpacing = ITEM_SPACING) => {
54
+ export const calInlineListSize = (itemLength, itemSize, itemSpacing) => {
50
55
  let result = 0;
51
56
  const calItemSize = getItemSize(itemSize, itemSpacing);
52
57
  for (let i = 0; i < itemLength; i++) {
@@ -67,7 +67,6 @@ export * from './EmojiCollections';
67
67
  export * from './EmojiPopover';
68
68
  export * from './DisplayFormat';
69
69
  export * from './CodeStructure';
70
- export * from './FontSizeInput';
71
70
  export * from './ItemNotFound';
72
71
  export { EditorScript } from './EditorScript';
73
72
  export { EditorTab } from './EditorTab';
@@ -67,7 +67,6 @@ export * from './EmojiCollections';
67
67
  export * from './EmojiPopover';
68
68
  export * from './DisplayFormat';
69
69
  export * from './CodeStructure';
70
- export * from './FontSizeInput';
71
70
  export * from './ItemNotFound';
72
71
  export { EditorScript } from './EditorScript';
73
72
  export { EditorTab } from './EditorTab';
@@ -15,5 +15,4 @@ export { AccountProfile, type AccountSettingProps } from './AccountProfile';
15
15
  export * from './Login';
16
16
  export * from './Filter';
17
17
  export { ActivityTimeline, type ActivityTimeLineProps } from './ActivityTimeline';
18
- export { TextEditor, TextEditorProvider, type TextEditorProps, type TextEditorRef, type TextEditorJSONContent, type TextEditorProviderProps, type TextEditorProviderRefHandler, type TextEditorComponentsRender, CUSTOM_LINK_EXTENSION_NAME, } from './TextEditor';
19
18
  export { WhatsappMobile, SAMPLE_PREVIEW } from './PreviewCollections';
@@ -15,5 +15,4 @@ export { AccountProfile } from './AccountProfile';
15
15
  export * from './Login';
16
16
  export * from './Filter';
17
17
  export { ActivityTimeline } from './ActivityTimeline';
18
- export { TextEditor, TextEditorProvider, CUSTOM_LINK_EXTENSION_NAME, } from './TextEditor';
19
18
  export { WhatsappMobile, SAMPLE_PREVIEW } from './PreviewCollections';
@@ -26,9 +26,9 @@ export const ANTALYSER_API = {
26
26
  [ENV.DEV]: 'https://sandbox-antalyser.antsomi.com',
27
27
  [ENV.SANDBOX]: 'https://sandbox-antalyser.antsomi.com',
28
28
  [ENV.SANDBOX_CDP]: 'https://sandbox-antalyser.antsomi.com',
29
- [ENV.STAGING]: 'https://sandbox-antalyser.ants.vn',
30
- [ENV.PROD]: 'https://sandbox-antalyser.ants.vn',
31
- [ENV.PRO_VN]: 'https://sandbox-antalyser.ants.vn',
29
+ [ENV.STAGING]: 'https://staging-insights.antsomi.com',
30
+ [ENV.PROD]: 'https://insights.antsomi.com',
31
+ [ENV.PRO_VN]: 'https://insights.antsomi.com',
32
32
  };
33
33
  export const CDP_ROUTE = {
34
34
  [ENV.DEV]: 'https://sandbox-cdp.antsomi.com',
@@ -26,7 +26,3 @@ export * from './useCustomRouter';
26
26
  export * from './useUpdateEffect';
27
27
  export * from './useOutsideClick';
28
28
  export * from './useDebouncedCallbackV2';
29
- export * from './useElementSize';
30
- export * from './useIsMounted';
31
- export * from './useBroadcastedLocalStorage';
32
- export * from './useEyedropper';
package/es/hooks/index.js CHANGED
@@ -45,7 +45,3 @@ export * from './useCustomRouter';
45
45
  export * from './useUpdateEffect';
46
46
  export * from './useOutsideClick';
47
47
  export * from './useDebouncedCallbackV2';
48
- export * from './useElementSize';
49
- export * from './useIsMounted';
50
- export * from './useBroadcastedLocalStorage';
51
- export * from './useEyedropper';
@@ -10663,6 +10663,6 @@ export declare const translationsJson: {
10663
10663
  };
10664
10664
  };
10665
10665
  };
10666
- declare const i18nInstance: import("node_modules/i18next").i18n;
10666
+ declare const i18nInstance: import("i18next").i18n;
10667
10667
  export declare const getTranslateMessage: (id: string, defaultMessage?: string, value?: Record<string, unknown>) => string;
10668
10668
  export default i18nInstance;
@@ -66,14 +66,17 @@ export declare const searchParamsToObject: (searchParams?: string) => Record<str
66
66
  export declare const getShuffleArray: <T>(array: T[]) => T[];
67
67
  export declare const snakeCaseToCamelCase: <T = Record<string, any>>(object: Record<string, any> | Record<string, any>[], recursive?: boolean) => T;
68
68
  export declare const camelCaseToSnakeCase: <T = Record<string, any>>(object: Record<string, any>, recursive?: boolean) => T;
69
- export declare function generateKey(): string;
69
+ export declare function generateKey(): any;
70
70
  export declare const formatUserId: (userId?: number) => string;
71
71
  /**
72
- * Checks string matching based on a query, supporting fuzzy matching,
73
- * where the query characters must appear in order within the target string.
74
- * Allows for missing characters in the query relative to the target,
75
- * and ignores case, diacritics, and spaces.
76
- *
72
+ * Function to remove accent
73
+ * @param str - String want to remove accent
74
+ * @returns {string} - Result after remove accent
75
+ */
76
+ export declare const removeAccent: (str: string) => string;
77
+ /** Remove all accents and convert string to lower case, remove leading and trailing white space */
78
+ export declare const simplifyString: (str: string) => string;
79
+ /**
77
80
  * @param str target string
78
81
  * @param queryStr search query
79
82
  * @returns true if target string includes search query
@@ -162,11 +165,3 @@ export declare const convertNumberByDisplayFormat: (value: number | string, grou
162
165
  export declare function numberWithCommas(n: number): string;
163
166
  export declare const multiPercentageValue: (value?: string) => string;
164
167
  export declare const antsomiClsx: (componentName: string) => (className: string) => string;
165
- /**
166
- * Take an array of data attribute key/value pairs and return an object which
167
- * can be spread into a component's definition
168
- *
169
- * @param attributes
170
- * @returns A spreadable object of data-attributes
171
- */
172
- export declare const dataAttrArrayToObject: (attributes?: DataAttributes) => Record<string, string>;
@@ -430,56 +430,35 @@ export function generateKey() {
430
430
  }
431
431
  export const formatUserId = (userId) => String(userId || '').replace(/(\d{3})(\d{3})(\d{0,})/, `$1-$2-$3`);
432
432
  /**
433
- * Normalizes a string for searching by:
434
- * 1. Converting to NFD Unicode form and removing diacritics.
435
- * 2. Converting to lowercase.
436
- * 3. Removing all whitespace.
437
- * @param str The string to normalize.
438
- * @returns The normalized string.
433
+ * Function to remove accent
434
+ * @param str - String want to remove accent
435
+ * @returns {string} - Result after remove accent
439
436
  */
440
- function normalizeStringForSearch(str) {
441
- if (!str) {
442
- return ''; // Handle null, undefined, or empty string inputs
443
- }
444
- return str
445
- .normalize('NFD') // Decompose accented characters (e.g., "á" -> "a" + "´")
446
- .replace(/[\u0300-\u036f]/g, '') // Remove diacritical marks
447
- .toLowerCase() // Convert to lowercase
448
- .replace(/\s+/g, ''); // Remove all whitespace
449
- }
437
+ export const removeAccent = (str) => {
438
+ str = str.replace(/[àáạảãâầấậẩẫăằắặẳẵ]/g, 'a');
439
+ str = str.replace(/[èéẹẻẽêềếệểễ]/g, 'e');
440
+ str = str.replace(/[ìíịỉĩ]/g, 'i');
441
+ str = str.replace(/[òóọỏõôồốộổỗơờớợởỡ]/g, 'o');
442
+ str = str.replace(/[ùúụủũưừứựửữ]/g, 'u');
443
+ str = str.replace(/[ỳýỵỷỹ]/g, 'y');
444
+ str = str.replace(/đ/g, 'd');
445
+ str = str.replace(/[ÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴ]/g, 'A');
446
+ str = str.replace(/[ÈÉẸẺẼÊỀẾỆỂỄ]/g, 'E');
447
+ str = str.replace(/[ÌÍỊỈĨ]/g, 'I');
448
+ str = str.replace(/[ÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠ]/g, 'O');
449
+ str = str.replace(/Ù|Ú|Ụ|Ủ|Ũ|Ư|Ừ|Ứ|Ự|Ử|Ữ/g, 'U');
450
+ str = str.replace(/Ỳ|Ý|Ỵ|Ỷ|Ỹ/g, 'Y');
451
+ str = str.replace(/Đ/g, 'D');
452
+ return str;
453
+ };
454
+ /** Remove all accents and convert string to lower case, remove leading and trailing white space */
455
+ export const simplifyString = (str) => removeAccent(`${str || ''}`.toLowerCase().trim()) || '';
450
456
  /**
451
- * Checks string matching based on a query, supporting fuzzy matching,
452
- * where the query characters must appear in order within the target string.
453
- * Allows for missing characters in the query relative to the target,
454
- * and ignores case, diacritics, and spaces.
455
- *
456
457
  * @param str target string
457
458
  * @param queryStr search query
458
459
  * @returns true if target string includes search query
459
460
  */
460
- export const searchStringQuery = (str, queryStr) => {
461
- const normalizedQuery = normalizeStringForSearch(queryStr);
462
- const normalizedItem = normalizeStringForSearch(str);
463
- // Optimization: if normalized query is longer than normalized item,
464
- // it cannot be a subsequence.
465
- if (normalizedQuery.length > normalizedItem.length) {
466
- return false;
467
- }
468
- // Subsequence check:
469
- // Iterate through both normalized strings.
470
- // If characters match, advance the query pointer.
471
- // Always advance the item pointer.
472
- let queryIndex = 0;
473
- let itemIndex = 0;
474
- while (queryIndex < normalizedQuery.length && itemIndex < normalizedItem.length) {
475
- if (normalizedQuery[queryIndex] === normalizedItem[itemIndex]) {
476
- queryIndex++;
477
- }
478
- itemIndex++;
479
- }
480
- // If queryIndex reached the end of normalizedQuery, all its characters were found in order.
481
- return queryIndex === normalizedQuery.length;
482
- };
461
+ export const searchStringQuery = (str, queryStr) => simplifyString(str).includes(simplifyString(queryStr || ''));
483
462
  /**
484
463
  * Checks if any of the provided values match the search value.
485
464
  *
@@ -763,19 +742,3 @@ export const antsomiClsx = (componentName) => (className) => {
763
742
  });
764
743
  return clsx(classNames);
765
744
  };
766
- /**
767
- * Take an array of data attribute key/value pairs and return an object which
768
- * can be spread into a component's definition
769
- *
770
- * @param attributes
771
- * @returns A spreadable object of data-attributes
772
- */
773
- export const dataAttrArrayToObject = (attributes = []) => attributes.reduce((output, current) => {
774
- // Ensure we follow the correct syntax so we will just return the output if not
775
- if (!/^data-([a-z]+-)*[a-z]+$/g.test(current.key))
776
- return output;
777
- // Assign the key/value pair to the output object
778
- output[current.key] = current.value;
779
- // return the object
780
- return output;
781
- }, {});
@@ -9,4 +9,3 @@ export * from './actionButtons';
9
9
  export * from './dataTable';
10
10
  export * from './cookie';
11
11
  export * from './attribute';
12
- export * from './web';
package/es/utils/index.js CHANGED
@@ -9,4 +9,3 @@ export * from './actionButtons';
9
9
  export * from './dataTable';
10
10
  export * from './cookie';
11
11
  export * from './attribute';
12
- export * from './web';
package/es/utils/web.d.ts CHANGED
@@ -8,18 +8,3 @@ export declare const getPreventKeyboardAction: (actions?: Array<'undo' | 'copy'
8
8
  onKeyDown: (e: React.KeyboardEvent | KeyboardEvent) => false | undefined;
9
9
  onKeyUp: (e: React.KeyboardEvent | KeyboardEvent) => void;
10
10
  };
11
- export declare const getPlatform: () => "mac" | "window" | "linux" | "unknown";
12
- export declare const isMacOS: () => boolean;
13
- export declare const isWindows: () => boolean;
14
- export declare const isLinux: () => boolean;
15
- /**
16
- * Gets the modifier key based on the platform
17
- * @returns Platform-appropriate modifier key
18
- */
19
- export declare const getModifierKey: () => "⌘" | "Ctrl";
20
- /**
21
- * Formats a hotkey string with the appropriate modifier
22
- * @param key The key to format
23
- * @returns Formatted hotkey string
24
- */
25
- export declare const formatHotkey: (key: string) => string;
package/es/utils/web.js CHANGED
@@ -24,42 +24,3 @@ export const getPreventKeyboardAction = (actions = []) => ({
24
24
  }
25
25
  },
26
26
  });
27
- export const getPlatform = () => {
28
- // Modern API (userAgentData)
29
- const navAny = navigator;
30
- if (navAny.userAgentData && typeof navAny.userAgentData.platform === 'string') {
31
- const platform = navAny.userAgentData.platform.toLowerCase();
32
- if (platform.includes('mac'))
33
- return 'mac';
34
- if (platform.includes('win'))
35
- return 'window';
36
- if (platform.includes('linux') || platform.includes('x11'))
37
- return 'linux';
38
- }
39
- // Fallback for older browsers
40
- const ua = navigator.userAgent.toLowerCase();
41
- if (ua.includes('mac'))
42
- return 'mac';
43
- if (ua.includes('win'))
44
- return 'window';
45
- if (ua.includes('linux') || ua.includes('x11'))
46
- return 'linux';
47
- return 'unknown';
48
- };
49
- export const isMacOS = () => getPlatform() === 'mac';
50
- export const isWindows = () => getPlatform() === 'window';
51
- export const isLinux = () => getPlatform() === 'linux';
52
- /**
53
- * Gets the modifier key based on the platform
54
- * @returns Platform-appropriate modifier key
55
- */
56
- export const getModifierKey = () => (isMacOS() ? '⌘' : 'Ctrl');
57
- /**
58
- * Formats a hotkey string with the appropriate modifier
59
- * @param key The key to format
60
- * @returns Formatted hotkey string
61
- */
62
- export const formatHotkey = (key) => {
63
- const modifier = getModifierKey();
64
- return `${modifier}+${key}`;
65
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antscorp/antsomi-ui",
3
- "version": "2.0.92-text-editor-beta.6",
3
+ "version": "2.0.93",
4
4
  "description": "An enterprise-class UI design language and React UI library.",
5
5
  "sideEffects": [
6
6
  "dist/*",
@@ -36,7 +36,7 @@
36
36
  "test:ui": "vitest --ui",
37
37
  "coverage": "vitest run --coverage",
38
38
  "ts-compile": "tsc -p tsconfig.esm.json",
39
- "copy-files": "copyfiles -u 1 \"src/**/*.json\" \"src/**/*.svg\" \"src/**/*.png\" \"src/**/*.scss\" es",
39
+ "copy-files": "copyfiles -u 1 src/**/*.json src/**/*.svg src/**/*.scss src/**/*.png es",
40
40
  "icons:export": "sh -e scripts/generate-export-icon.sh",
41
41
  "icons:format": "prettier --loglevel warn --write \"src/components/icons/*.tsx\"",
42
42
  "icons:update": "sh -e scripts/update-icons.sh",
@@ -69,7 +69,6 @@
69
69
  "@dnd-kit/sortable": "^8.0.0",
70
70
  "@dnd-kit/utilities": "^3.2.2",
71
71
  "@emotion/react": "^11.11.1",
72
- "@floating-ui/react": "^0.27.8",
73
72
  "@fortawesome/fontawesome-svg-core": "6.1.1",
74
73
  "@fortawesome/free-brands-svg-icons": "6.1.1",
75
74
  "@fortawesome/free-regular-svg-icons": "6.1.1",
@@ -79,18 +78,6 @@
79
78
  "@tanstack/react-query": "4.20.4",
80
79
  "@tanstack/react-query-devtools": "4.20.4",
81
80
  "@tinymce/tinymce-react": "^3.7.0",
82
- "@tiptap/core": "3.0.7",
83
- "@tiptap/extension-link": "3.0.7",
84
- "@tiptap/extension-strike": "3.0.7",
85
- "@tiptap/extension-subscript": "3.0.7",
86
- "@tiptap/extension-superscript": "3.0.7",
87
- "@tiptap/extension-text-align": "3.0.7",
88
- "@tiptap/extension-text-style": "3.0.7",
89
- "@tiptap/extensions": "3.0.7",
90
- "@tiptap/pm": "3.0.7",
91
- "@tiptap/react": "3.0.7",
92
- "@tiptap/starter-kit": "3.0.7",
93
- "@tiptap/suggestion": "3.0.7",
94
81
  "@types/currency-formatter": "1.5.1",
95
82
  "@types/react-custom-scrollbars": "^4.0.13",
96
83
  "@types/react-frame-component": "^4.1.6",
@@ -116,7 +103,6 @@
116
103
  "html-react-parser": "^5.1.12",
117
104
  "html-to-image": "^1.11.11",
118
105
  "html2canvas": "^1.4.1",
119
- "html2canvas-pro": "^1.5.11",
120
106
  "i18next": "23.7.9",
121
107
  "i18next-browser-languagedetector": "6.1.2",
122
108
  "immer": "3.0.0",
@@ -126,8 +112,8 @@
126
112
  "pako": "2.0.4",
127
113
  "qs": "6.10.3",
128
114
  "quill": "2.0.3",
129
- "quill-image-drop-and-paste": "^2.0.1",
130
115
  "quill-upload": "0.0.13",
116
+ "quill-image-drop-and-paste": "^2.0.1",
131
117
  "react-ace": "9.5.0",
132
118
  "react-beautiful-dnd": "^13.1.1",
133
119
  "react-color": "2.19.3",
@@ -135,7 +121,6 @@
135
121
  "react-custom-scrollbars": "^4.2.1",
136
122
  "react-device-detect": "^2.2.3",
137
123
  "react-draggable": "^4.4.5",
138
- "react-fast-compare": "^3.2.1",
139
124
  "react-frame-component": "^5.2.6",
140
125
  "react-google-recaptcha": "^3.1.0",
141
126
  "react-helmet": "^6.1.0",
@@ -152,11 +137,9 @@
152
137
  "socket.io-client": "^4.7.5",
153
138
  "string-replace-to-array": "^2.1.0",
154
139
  "swiper": "^11.0.7",
155
- "tinycolor2": "^1.6.0",
156
140
  "tui-image-editor": "^3.15.3",
157
141
  "uniqid": "^5.4.0",
158
142
  "use-context-selector": "^1.4.4",
159
- "use-debounce": "^10.0.4",
160
143
  "use-image": "^1.1.1",
161
144
  "use-immer": "^0.4.1",
162
145
  "zustand": "^4.5.2"
@@ -205,8 +188,6 @@
205
188
  "@types/react-resizable": "^3.0.7",
206
189
  "@types/react-syntax-highlighter": "^15.5.11",
207
190
  "@types/styled-components": "^5.1.26",
208
- "@types/tinycolor2": "^1.4.6",
209
- "@types/uniqid": "^5.3.4",
210
191
  "@types/yaireo__tagify": "^4.27.0",
211
192
  "@typescript-eslint/eslint-plugin": "^5.55.0",
212
193
  "@typescript-eslint/parser": "^5.55.0",
@@ -246,6 +227,7 @@
246
227
  "prettier": "^3.3.3",
247
228
  "react": "18.2.0",
248
229
  "react-dom": "18.2.0",
230
+ "react-fast-compare": "^3.2.1",
249
231
  "react-i18next": "11.16.7",
250
232
  "react-router-dom": "5.1.0 || 6.14.2",
251
233
  "sass": "^1.77.8",
@@ -1,2 +0,0 @@
1
- import { EyedropperProps } from './types';
2
- export declare const Eyedropper: (props: EyedropperProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,53 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useState } from 'react';
3
- import { Typography, message } from 'antd';
4
- import { BgColorsOutlined } from '@ant-design/icons'; // Icon hình giọt nước
5
- import { ColorSwatch, StyledButton, StyledColorTag, StyledEyedropperContainer } from './styled';
6
- import tinycolor from 'tinycolor2';
7
- import clsx from 'clsx';
8
- const { Text } = Typography;
9
- export const Eyedropper = (props) => {
10
- const { defaultColor, onColorPick, className } = props;
11
- const [pickedColor, setPickedColor] = useState(defaultColor);
12
- const [isLoading, setIsLoading] = useState(false);
13
- const apiSupported = 'EyeDropper' in window;
14
- // Cập nhật màu mặc định nếu prop thay đổi
15
- useEffect(() => {
16
- setPickedColor(defaultColor);
17
- }, [defaultColor]);
18
- const handlePickColor = async () => {
19
- if (!apiSupported) {
20
- message.error('Trình duyệt của bạn không hỗ trợ EyeDropper API.');
21
- return;
22
- }
23
- setIsLoading(true);
24
- try {
25
- const eyeDropper = new window.EyeDropper();
26
- const { sRGBHex } = await eyeDropper.open();
27
- setPickedColor(sRGBHex);
28
- message.success(`Đã chọn màu: ${sRGBHex}`);
29
- onColorPick?.(sRGBHex);
30
- }
31
- catch (e) {
32
- if (e instanceof Error && e.name === 'AbortError') {
33
- message.info('Người dùng đã hủy chọn màu.');
34
- }
35
- else if (e instanceof Error) {
36
- message.error(`Đã xảy ra lỗi khi chọn màu: ${e.message}`);
37
- }
38
- }
39
- finally {
40
- setIsLoading(false);
41
- }
42
- };
43
- const isCurrentColorLight = tinycolor(pickedColor).isLight();
44
- return (_jsxs(StyledEyedropperContainer, { className: className, children: [_jsxs(Typography.Title, { level: 4, children: [_jsx(BgColorsOutlined, {}), " C\u00F4ng c\u1EE5 tr\u00EDch xu\u1EA5t m\u00E0u"] }), _jsx(Text, { type: "secondary", children: "B\u1EA5m n\u00FAt b\u00EAn d\u01B0\u1EDBi \u0111\u1EC3 k\u00EDch ho\u1EA1t c\u00F4ng c\u1EE5 Eyedropper c\u1EE7a tr\u00ECnh duy\u1EC7t v\u00E0 ch\u1ECDn m\u00E0u t\u1EEB b\u1EA5t k\u1EF3 \u0111\u00E2u tr\u00EAn m\u00E0n h\u00ECnh." }), _jsx(StyledButton, { type: "primary", icon: _jsx(BgColorsOutlined, {}), onClick: handlePickColor, loading: isLoading, disabled: isLoading || !apiSupported, size: "large", children: "Ch\u1ECDn M\u00E0u" }), pickedColor && (_jsxs("div", { style: {
45
- marginTop: '20px',
46
- display: 'flex',
47
- justifyContent: 'center',
48
- alignItems: 'center',
49
- gap: '10px',
50
- }, children: [_jsx(Text, { children: "M\u00E0u \u0111\u00E3 ch\u1ECDn:" }), _jsx(StyledColorTag, { color: pickedColor, className: clsx({
51
- 'is-lightcolor': isCurrentColorLight,
52
- }), children: pickedColor }), _jsx(ColorSwatch, { "$color": pickedColor })] })), !apiSupported && (_jsx(Text, { type: "danger", style: { marginTop: '15px', display: 'block' }, children: "Tr\u00ECnh duy\u1EC7t hi\u1EC7n t\u1EA1i kh\u00F4ng h\u1ED7 tr\u1EE3 EyeDropper API. Vui l\u00F2ng s\u1EED d\u1EE5ng Chrome, Edge ho\u1EB7c c\u00E1c tr\u00ECnh duy\u1EC7t d\u1EF1a tr\u00EAn Chromium." }))] }));
53
- };
File without changes
@@ -1 +0,0 @@
1
- "use strict";
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const StyledEyedropperContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
3
- export declare const StyledButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("antd").ButtonProps & import("react").RefAttributes<HTMLElement>> & {
4
- Group: import("react").FC<import("antd/es/button").ButtonGroupProps>;
5
- }, any, {}, never>;
6
- export declare const StyledColorTag: import("styled-components").StyledComponent<import("antd").TagType, any, {}, never>;
7
- export declare const ColorSwatch: import("styled-components").StyledComponent<"div", any, {
8
- $color: string;
9
- }, never>;
@@ -1,45 +0,0 @@
1
- import { Button, Tag } from 'antd';
2
- import styled from 'styled-components';
3
- export const StyledEyedropperContainer = styled.div `
4
- padding: 20px;
5
- border: 1px solid #e8e8e8;
6
- border-radius: 8px;
7
- max-width: 450px;
8
- margin: 20px auto;
9
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
10
- text-align: center; /* Căn giữa nội dung */
11
-
12
- h4 {
13
- margin-bottom: 15px;
14
- color: #333;
15
- display: flex;
16
- align-items: center;
17
- justify-content: center; /* Căn giữa icon và tiêu đề */
18
- gap: 8px; /* Khoảng cách giữa icon và chữ */
19
- }
20
- `;
21
- export const StyledButton = styled(Button) `
22
- margin-top: 20px;
23
- width: auto; /* Để nút không bị giãn full chiều rộng */
24
- `;
25
- export const StyledColorTag = styled(Tag) `
26
- padding: 4px 8px;
27
- font-size: 1em;
28
- font-weight: bold;
29
- min-width: 100px;
30
- text-align: center;
31
- border: none;
32
- color: white;
33
-
34
- &.is-lightcolor {
35
- border: 1px solid #d9d9d9;
36
- color: #333;
37
- }
38
- `;
39
- export const ColorSwatch = styled.div `
40
- width: 30px;
41
- height: 30px;
42
- background-color: ${props => props.$color || 'transparent'}; /* Nhận prop $color */
43
- border: 1px solid #d9d9d9;
44
- border-radius: 4px;
45
- `;