@antscorp/antsomi-ui 2.0.109 → 2.0.111

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (587) hide show
  1. package/README.md +78 -78
  2. package/es/__mocks__/1000_city.json +802 -802
  3. package/es/__mocks__/sql-query.json +56 -56
  4. package/es/assets/css/main.scss +8 -6
  5. package/es/assets/images/feedback.svg +3 -3
  6. package/es/assets/svg/mobile-frame.svg +3 -3
  7. package/es/assets/svg/warning-icon.svg +5 -5
  8. package/es/components/atoms/Alert/Alert.js +28 -28
  9. package/es/components/atoms/ContentEditable/styled.js +16 -16
  10. package/es/components/atoms/DividerPure/styled.js +35 -35
  11. package/es/components/atoms/Eyedropper/Eyedropper.d.ts +2 -0
  12. package/es/components/atoms/Eyedropper/Eyedropper.js +53 -0
  13. package/es/components/atoms/Eyedropper/index.d.ts +0 -0
  14. package/es/components/atoms/Eyedropper/index.js +1 -0
  15. package/es/components/atoms/Eyedropper/styled.d.ts +9 -0
  16. package/es/components/atoms/Eyedropper/styled.js +45 -0
  17. package/es/components/atoms/Eyedropper/types.d.ts +5 -0
  18. package/es/components/atoms/Eyedropper/types.js +1 -0
  19. package/es/components/atoms/Icon/index.js +19 -19
  20. package/es/components/atoms/Iframe/Iframe.js +18 -18
  21. package/es/components/atoms/Input/styled.js +104 -104
  22. package/es/components/atoms/InputDynamic/styled.js +284 -284
  23. package/es/components/atoms/MobileBrandingBar/styled.js +21 -21
  24. package/es/components/atoms/MobileFrame/styled.js +30 -30
  25. package/es/components/atoms/MobileFrameV2/styled.js +42 -42
  26. package/es/components/atoms/MobileFrameV3/styled.js +31 -31
  27. package/es/components/atoms/NotificationStatus/styled.js +10 -10
  28. package/es/components/atoms/PreviewTabs/styled.js +69 -69
  29. package/es/components/atoms/Radio/index.js +16 -16
  30. package/es/components/atoms/ReactIframe/ReactIframe.js +5 -5
  31. package/es/components/atoms/ReactIframe/styled.js +9 -9
  32. package/es/components/atoms/RequiredLabel/styled.js +3 -3
  33. package/es/components/atoms/ScrollBox/index.js +5 -5
  34. package/es/components/atoms/Scrollbars/styled.js +21 -21
  35. package/es/components/atoms/SlideBar/styled.js +194 -194
  36. package/es/components/atoms/Slider/styled.js +31 -31
  37. package/es/components/atoms/Space/Space.js +4 -4
  38. package/es/components/atoms/Spin/styled.js +11 -11
  39. package/es/components/atoms/Steps/styled.js +244 -244
  40. package/es/components/atoms/Switch/styled.js +56 -56
  41. package/es/components/atoms/Tag/Tag.js +10 -10
  42. package/es/components/atoms/Text/styled.js +34 -34
  43. package/es/components/icons/ALignRightIcon.d.ts +3 -0
  44. package/es/components/icons/ALignRightIcon.js +7 -0
  45. package/es/components/icons/AlignCenterIcon.d.ts +3 -0
  46. package/es/components/icons/AlignCenterIcon.js +7 -0
  47. package/es/components/icons/AlignJustifyIcon.d.ts +3 -0
  48. package/es/components/icons/AlignJustifyIcon.js +7 -0
  49. package/es/components/icons/AlignLeftIcon.d.ts +3 -0
  50. package/es/components/icons/AlignLeftIcon.js +7 -0
  51. package/es/components/icons/ArrowDropDownIcon.d.ts +3 -0
  52. package/es/components/icons/ArrowDropDownIcon.js +7 -0
  53. package/es/components/icons/ChevronRightIcon.d.ts +3 -0
  54. package/es/components/icons/ChevronRightIcon.js +7 -0
  55. package/es/components/icons/ColorizeIcon.d.ts +3 -0
  56. package/es/components/icons/ColorizeIcon.js +7 -0
  57. package/es/components/icons/DomainManagementIcon.js +1 -1
  58. package/es/components/icons/LazyIcon/LazyIcon.d.ts +9 -0
  59. package/es/components/icons/LazyIcon/LazyIcon.js +9 -0
  60. package/es/components/icons/LinkOffIcon.d.ts +3 -0
  61. package/es/components/icons/LinkOffIcon.js +7 -0
  62. package/es/components/icons/LoadingIcon.js +33 -33
  63. package/es/components/icons/MinusIcon.d.ts +3 -0
  64. package/es/components/icons/MinusIcon.js +7 -0
  65. package/es/components/icons/document/styled.js +43 -43
  66. package/es/components/icons/index.d.ts +9 -0
  67. package/es/components/icons/index.js +9 -0
  68. package/es/components/index.scss +2 -1
  69. package/es/components/molecules/AccessDenied/styled.js +28 -28
  70. package/es/components/molecules/AccountSelection/styled.js +110 -110
  71. package/es/components/molecules/AddDynamicContent/styled.js +23 -23
  72. package/es/components/molecules/AlignSetting/styled.js +4 -4
  73. package/es/components/molecules/ApplyPopupContent/styled.js +32 -32
  74. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +8 -8
  75. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +79 -79
  76. package/es/components/molecules/CalendarSelection/components/Footer/styled.js +4 -4
  77. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +21 -21
  78. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +26 -26
  79. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +30 -30
  80. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +26 -26
  81. package/es/components/molecules/CalendarSelection/styled.js +8 -8
  82. package/es/components/molecules/CaptureScreen/components/CommentBox/styled.js +119 -119
  83. package/es/components/molecules/CaptureScreen/components/Cursor/styled.js +67 -67
  84. package/es/components/molecules/CaptureScreen/styled.js +240 -240
  85. package/es/components/molecules/ChartTab/components/styled.js +24 -24
  86. package/es/components/molecules/ChartTab/styled.js +20 -20
  87. package/es/components/molecules/ChatBox/AntsomiAI.js +8 -8
  88. package/es/components/molecules/ChatBox/ChatBoxInsight/QuestionItem.js +9 -9
  89. package/es/components/molecules/ChatBox/ChatBoxInsight/styled.js +365 -365
  90. package/es/components/molecules/ChatBox/styled.js +324 -324
  91. package/es/components/molecules/CodeStructure/styled.js +5 -5
  92. package/es/components/molecules/ColorPicker/ChromePicker/styled.js +10 -10
  93. package/es/components/molecules/ColorPicker/CustomPicker/styled.js +89 -89
  94. package/es/components/molecules/ColorPicker/SketchPicker/styled.js +5 -5
  95. package/es/components/molecules/ColorPicker/styled.js +7 -7
  96. package/es/components/molecules/ColorSetting/styled.js +39 -39
  97. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +110 -110
  98. package/es/components/molecules/DatePickerV2/styled.js +6 -6
  99. package/es/components/molecules/DisplayFormat/styled.js +12 -12
  100. package/es/components/molecules/DrawerDetail/components/ToggleDrawerSizeButton.js +24 -24
  101. package/es/components/molecules/DrawerDetail/styled.js +109 -109
  102. package/es/components/molecules/Dropdown/style.scss +11 -11
  103. package/es/components/molecules/Dropdown/styled.js +28 -28
  104. package/es/components/molecules/EdgeSetting/styled.js +10 -10
  105. package/es/components/molecules/EditableName/styled.js +70 -70
  106. package/es/components/molecules/EditingList/styled.js +29 -29
  107. package/es/components/molecules/EditingListV2/components/List/List.js +9 -9
  108. package/es/components/molecules/EditorTab/styled.js +156 -156
  109. package/es/components/molecules/EmojiCollections/CommonCollection/index.js +2 -2
  110. package/es/components/molecules/EmojiCollections/styled.js +22 -22
  111. package/es/components/molecules/EmojiCollections/types.d.ts +1 -0
  112. package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +2 -0
  113. package/es/components/molecules/EmojiPopover/EmojiPopover.js +10 -6
  114. package/es/components/molecules/EmojiPopover/styled.js +5 -5
  115. package/es/components/molecules/EmptyData/styled.js +53 -53
  116. package/es/components/molecules/EyedropperButton/EyedropperButton.d.ts +11 -0
  117. package/es/components/molecules/EyedropperButton/EyedropperButton.js +34 -0
  118. package/es/components/molecules/EyedropperButton/index.d.ts +0 -0
  119. package/es/components/molecules/EyedropperButton/index.js +1 -0
  120. package/es/components/molecules/EyedropperButton/styled.d.ts +7 -0
  121. package/es/components/molecules/EyedropperButton/styled.js +23 -0
  122. package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +3 -0
  123. package/es/components/molecules/FontSizeInput/FontSizeInput.js +134 -0
  124. package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +8 -0
  125. package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +14 -0
  126. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +21 -0
  127. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +19 -0
  128. package/es/components/molecules/FontSizeInput/constants.d.ts +2 -0
  129. package/es/components/molecules/FontSizeInput/constants.js +5 -0
  130. package/es/components/molecules/FontSizeInput/index.d.ts +2 -0
  131. package/es/components/molecules/FontSizeInput/index.js +1 -0
  132. package/es/components/molecules/FontSizeInput/index.scss +15 -15
  133. package/es/components/molecules/FontSizeInput/styled.d.ts +7 -0
  134. package/es/components/molecules/FontSizeInput/styled.js +39 -0
  135. package/es/components/molecules/FontSizeInput/types.d.ts +23 -0
  136. package/es/components/molecules/FontSizeInput/types.js +1 -0
  137. package/es/components/molecules/FontSizeInput/utils.d.ts +7 -0
  138. package/es/components/molecules/FontSizeInput/utils.js +9 -0
  139. package/es/components/molecules/GradientSetting/styled.js +57 -57
  140. package/es/components/molecules/HeaderV2/styled.js +70 -70
  141. package/es/components/molecules/IconSelection/styled.js +69 -69
  142. package/es/components/molecules/ImageEditor/components/ModalShortcut.js +21 -21
  143. package/es/components/molecules/ImageEditor/styled.js +5 -5
  144. package/es/components/molecules/ImagePreview/styled.js +3 -3
  145. package/es/components/molecules/InputNumberWithUnit/styled.js +14 -14
  146. package/es/components/molecules/InputSearch/styled.js +41 -41
  147. package/es/components/molecules/ItemNotFound/styled.js +26 -26
  148. package/es/components/molecules/MatchAnySelect/components/ExtendValuePopup.js +8 -8
  149. package/es/components/molecules/MatchAnySelect/styled.js +247 -247
  150. package/es/components/molecules/Modal/styled.js +63 -63
  151. package/es/components/molecules/ModalSelect/styled.js +152 -152
  152. package/es/components/molecules/ModalV2/styled.js +27 -27
  153. package/es/components/molecules/PopupDraggable/styled.js +57 -57
  154. package/es/components/molecules/PreviewModal/styled.js +26 -26
  155. package/es/components/molecules/ProcessLoading/styled.js +2 -2
  156. package/es/components/molecules/QuillEditor/CustomToolbar.js +3165 -3165
  157. package/es/components/molecules/QuillEditor/EditorToolbar.js +7 -7
  158. package/es/components/molecules/QuillEditor/styled.js +25 -25
  159. package/es/components/molecules/RadioGroup/styled.js +9 -9
  160. package/es/components/molecules/RequestAccess/styled.js +38 -38
  161. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +77 -77
  162. package/es/components/molecules/ResizeGrid/styled.js +50 -50
  163. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +118 -118
  164. package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +13 -13
  165. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +40 -40
  166. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +27 -27
  167. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +2 -2
  168. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +38 -38
  169. package/es/components/molecules/SearchPopover/SearchPopover.d.ts +2 -1
  170. package/es/components/molecules/SearchPopover/SearchPopover.js +3 -3
  171. package/es/components/molecules/SearchPopover/components/PopoverSelect/styled.js +36 -36
  172. package/es/components/molecules/SearchPopover/components/PopoverSelect/styles.scss +7 -7
  173. package/es/components/molecules/SearchPopover/styled.d.ts +12 -1
  174. package/es/components/molecules/SearchPopover/styled.js +32 -33
  175. package/es/components/molecules/SearchPopover/types.d.ts +4 -3
  176. package/es/components/molecules/Select/styled.js +32 -32
  177. package/es/components/molecules/SelectAccount/styled.js +147 -147
  178. package/es/components/molecules/SelectEventAttribute/styled.js +8 -8
  179. package/es/components/molecules/SelectMulti/styled.js +62 -62
  180. package/es/components/molecules/SelectV2/styled.js +124 -124
  181. package/es/components/molecules/SettingWrapper/styled.js +12 -12
  182. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +56 -56
  183. package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +5 -5
  184. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +15 -15
  185. package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +63 -63
  186. package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +31 -31
  187. package/es/components/molecules/SliderWithInputNumber/styled.js +2 -2
  188. package/es/components/molecules/Tabs/Tabs.js +11 -11
  189. package/es/components/molecules/TagifyInput/TagifyInput.js +50 -50
  190. package/es/components/molecules/TagifyInput/styled.js +37 -37
  191. package/es/components/molecules/TagifyInput/utils.js +13 -13
  192. package/es/components/molecules/TagifyInput/utils.style.js +218 -218
  193. package/es/components/molecules/TemplateSaveAs/components/Category/Category.js +5 -5
  194. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +276 -276
  195. package/es/components/molecules/TemplateSaveAs/styled.js +134 -134
  196. package/es/components/molecules/ThumbnailCard/styled.js +92 -92
  197. package/es/components/molecules/Tree/styled.js +38 -38
  198. package/es/components/molecules/UnsubscribePreferences/styled.js +7 -7
  199. package/es/components/molecules/UnsubscribePreview/components/styled.js +53 -53
  200. package/es/components/molecules/UnsubscribePreview/styled.js +48 -48
  201. package/es/components/molecules/UploadImage/styled.js +114 -114
  202. package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +1 -0
  203. package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +6 -8
  204. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +10 -10
  205. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +49 -289
  206. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.d.ts +9 -0
  207. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.js +5 -0
  208. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.d.ts +23 -0
  209. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.js +81 -0
  210. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.d.ts +24 -0
  211. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.js +32 -0
  212. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.d.ts +26 -0
  213. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.js +93 -0
  214. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.d.ts +24 -0
  215. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.js +94 -0
  216. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.d.ts +7 -0
  217. package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.js +132 -0
  218. package/es/components/molecules/VirtualizedMenu/styled.js +103 -82
  219. package/es/components/molecules/VirtualizedMenu/types.d.ts +2 -0
  220. package/es/components/molecules/VirtualizedMenu/utils.d.ts +2 -0
  221. package/es/components/molecules/VirtualizedMenu/utils.js +2 -0
  222. package/es/components/molecules/index.d.ts +1 -0
  223. package/es/components/molecules/index.js +1 -0
  224. package/es/components/molecules/index.scss +1 -0
  225. package/es/components/organism/AccountProfile/components/AccountSetting/components/EditableInput/styles.js +98 -98
  226. package/es/components/organism/AccountProfile/components/AccountSetting/components/LanguageSelector/styles.js +18 -18
  227. package/es/components/organism/AccountProfile/components/AccountSetting/styled.js +543 -543
  228. package/es/components/organism/AccountProfile/components/AccountSetting/styles.scss +39 -39
  229. package/es/components/organism/AccountSharing/styled.js +336 -336
  230. package/es/components/organism/ActivityTimeline/ActivityTimeline.js +3 -3
  231. package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +1290 -1290
  232. package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +1896 -3059
  233. package/es/components/organism/ActivityTimeline/components/ActionHistory/styled.js +28 -28
  234. package/es/components/organism/ActivityTimeline/components/CardMember/styled.js +60 -60
  235. package/es/components/organism/ActivityTimeline/components/ItemEvent/ItemEvent.js +7 -1
  236. package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/ItemGroupEvent.js +14 -2
  237. package/es/components/organism/ActivityTimeline/components/ItemGroupEvent/styled.js +4 -4
  238. package/es/components/organism/ActivityTimeline/components/List/styled.js +77 -77
  239. package/es/components/organism/ActivityTimeline/components/ListItem/styled.js +37 -37
  240. package/es/components/organism/ActivityTimeline/components/ProductCard/styled.js +92 -92
  241. package/es/components/organism/ActivityTimeline/components/Redeem/styled.js +7 -7
  242. package/es/components/organism/ActivityTimeline/components/Slide/styled.js +20 -20
  243. package/es/components/organism/ActivityTimeline/components/TimeLineTitle/styled.js +7 -7
  244. package/es/components/organism/ActivityTimeline/components/TimelineSection/styled.js +69 -69
  245. package/es/components/organism/ActivityTimeline/constants.d.ts +18 -18
  246. package/es/components/organism/ActivityTimeline/constants.js +7 -8
  247. package/es/components/organism/ActivityTimeline/index.d.ts +530 -1
  248. package/es/components/organism/ActivityTimeline/index.js +9 -1
  249. package/es/components/organism/ActivityTimeline/styled.js +43 -39
  250. package/es/components/organism/ActivityTimeline/utils.d.ts +7 -1
  251. package/es/components/organism/ActivityTimeline/utils.js +224 -162
  252. package/es/components/organism/AlgorithmsSetting/styled.js +35 -35
  253. package/es/components/organism/BasicLogin/components/ChooseMethod/styled.js +19 -19
  254. package/es/components/organism/BasicLogin/components/LoginWithEmail/styled.js +3 -3
  255. package/es/components/organism/BasicLogin/components/LoginWithGG/styled.js +3 -3
  256. package/es/components/organism/BasicLogin/components/SignIn/styled.js +8 -8
  257. package/es/components/organism/BasicLogin/components/WidgetLayout/styled.js +18 -18
  258. package/es/components/organism/BasicLogin/styled.js +107 -107
  259. package/es/components/organism/ContentSources/styled.js +50 -50
  260. package/es/components/organism/DataTable/components/AddButton/index.js +8 -8
  261. package/es/components/organism/DataTable/components/ModifyColumn/styled.js +18 -18
  262. package/es/components/organism/DataTable/components/Pagination/styled.js +26 -26
  263. package/es/components/organism/DataTable/components/Table/styled.js +135 -135
  264. package/es/components/organism/DataTable/components/Toolbar/SearchPopover.js +17 -17
  265. package/es/components/organism/DataTable/components/Toolbar/styled.js +70 -70
  266. package/es/components/organism/DataTable/styled/index.js +84 -84
  267. package/es/components/organism/Filter/components/FilterCondition/styled.js +34 -34
  268. package/es/components/organism/Filter/styled.js +109 -109
  269. package/es/components/organism/FilterSetting/components/common/InputArray/styled.js +5 -5
  270. package/es/components/organism/FilterSetting/components/common/InputOrSelect/index.js +63 -63
  271. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/ColumnSuggestion/index.js +31 -31
  272. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/Tree/index.js +22 -22
  273. package/es/components/organism/FilterSetting/components/common/InputSelectMulti/index.js +55 -55
  274. package/es/components/organism/FilterSetting/styled.js +19 -19
  275. package/es/components/organism/Help/styled.js +267 -267
  276. package/es/components/organism/LeftMenu/components/HomeMenu/styled.js +39 -39
  277. package/es/components/organism/LeftMenu/components/common/ChildMenu/components/MenuItemImage/styled.js +16 -16
  278. package/es/components/organism/LeftMenu/components/common/ChildMenu/styled.js +156 -156
  279. package/es/components/organism/LeftMenu/styled.js +214 -214
  280. package/es/components/organism/Login/components/ChooseMethod/styled.js +19 -19
  281. package/es/components/organism/Login/components/ForgotPassword/styled.js +8 -8
  282. package/es/components/organism/Login/components/LoginSelectPortal/Item/styled.js +31 -31
  283. package/es/components/organism/Login/components/LoginSelectPortal/styled.js +3 -3
  284. package/es/components/organism/Login/components/LoginWithEmail/styled.js +3 -3
  285. package/es/components/organism/Login/components/LoginWithGG/styled.js +3 -3
  286. package/es/components/organism/Login/components/SetupGGAuthenticator/styled.js +7 -7
  287. package/es/components/organism/Login/components/SignIn/styled.js +8 -8
  288. package/es/components/organism/Login/components/VerifyAccount/styled.js +13 -13
  289. package/es/components/organism/Login/components/WidgetLayout/styled.js +18 -18
  290. package/es/components/organism/Login/styled.js +115 -115
  291. package/es/components/organism/Menu/styled.js +6 -6
  292. package/es/components/organism/ModifyColumnModal/styled.js +132 -132
  293. package/es/components/organism/Notification/styled.js +155 -155
  294. package/es/components/organism/PreviewCollections/Messages/SkeletonMessage/styled.js +14 -14
  295. package/es/components/organism/PreviewCollections/WhatsappMessage/CarouselMessage/styled.js +63 -63
  296. package/es/components/organism/PreviewCollections/constants.js +50 -50
  297. package/es/components/organism/PreviewCollections/styled.js +16 -16
  298. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +78 -78
  299. package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +52 -52
  300. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +18 -18
  301. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +77 -77
  302. package/es/components/organism/PreviewTemplateModal/styled.js +21 -21
  303. package/es/components/organism/SQLGeneration/components/styled.js +354 -354
  304. package/es/components/organism/SQLGeneration/index.scss +1 -1
  305. package/es/components/organism/SQLGeneration/integrations/AceEditor/index.scss +4 -4
  306. package/es/components/organism/Table/CrossTabTable/components/CustomCell/styled.js +11 -11
  307. package/es/components/organism/Table/CrossTabTable/styled.js +11 -11
  308. package/es/components/organism/Table/ExplorePivotTable/components/CustomCell/styled.js +17 -17
  309. package/es/components/organism/Table/ExplorePivotTable/styled.js +11 -11
  310. package/es/components/organism/TextEditor/TextEditor.d.ts +10 -0
  311. package/es/components/organism/TextEditor/TextEditor.js +388 -0
  312. package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +320 -0
  313. package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +1 -0
  314. package/es/components/organism/TextEditor/__mocks__/text-contennt.js +47 -0
  315. package/es/components/organism/TextEditor/constants.d.ts +196 -0
  316. package/es/components/organism/TextEditor/constants.js +398 -0
  317. package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +25 -0
  318. package/es/components/organism/TextEditor/extensions/BackgroundColor.js +43 -0
  319. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +18 -0
  320. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +81 -0
  321. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +15 -0
  322. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +35 -0
  323. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +2 -0
  324. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +2 -0
  325. package/es/components/organism/TextEditor/extensions/ClearFormatting.d.ts +16 -0
  326. package/es/components/organism/TextEditor/extensions/ClearFormatting.js +30 -0
  327. package/es/components/organism/TextEditor/extensions/Color.d.ts +6 -0
  328. package/es/components/organism/TextEditor/extensions/Color.js +34 -0
  329. package/es/components/organism/TextEditor/extensions/Emoji.d.ts +57 -0
  330. package/es/components/organism/TextEditor/extensions/Emoji.js +184 -0
  331. package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +6 -0
  332. package/es/components/organism/TextEditor/extensions/FontFamily.js +36 -0
  333. package/es/components/organism/TextEditor/extensions/FontSize.d.ts +31 -0
  334. package/es/components/organism/TextEditor/extensions/FontSize.js +46 -0
  335. package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +23 -0
  336. package/es/components/organism/TextEditor/extensions/FontWeight.js +41 -0
  337. package/es/components/organism/TextEditor/extensions/Indent.d.ts +21 -0
  338. package/es/components/organism/TextEditor/extensions/Indent.js +63 -0
  339. package/es/components/organism/TextEditor/extensions/LetterSpacing.d.ts +32 -0
  340. package/es/components/organism/TextEditor/extensions/LetterSpacing.js +48 -0
  341. package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +20 -0
  342. package/es/components/organism/TextEditor/extensions/LineHeight.js +101 -0
  343. package/es/components/organism/TextEditor/extensions/Link.d.ts +22 -0
  344. package/es/components/organism/TextEditor/extensions/Link.js +178 -0
  345. package/es/components/organism/TextEditor/extensions/ListItem.d.ts +10 -0
  346. package/es/components/organism/TextEditor/extensions/ListItem.js +93 -0
  347. package/es/components/organism/TextEditor/extensions/ListItemMarker.d.ts +13 -0
  348. package/es/components/organism/TextEditor/extensions/ListItemMarker.js +174 -0
  349. package/es/components/organism/TextEditor/extensions/OrderedList.d.ts +56 -0
  350. package/es/components/organism/TextEditor/extensions/OrderedList.js +187 -0
  351. package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +28 -0
  352. package/es/components/organism/TextEditor/extensions/SmartTag.js +103 -0
  353. package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +36 -0
  354. package/es/components/organism/TextEditor/extensions/StyleMemory.js +163 -0
  355. package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +30 -0
  356. package/es/components/organism/TextEditor/extensions/TextTransform.js +36 -0
  357. package/es/components/organism/TextEditor/extensions/UnorderedList.d.ts +55 -0
  358. package/es/components/organism/TextEditor/extensions/UnorderedList.js +176 -0
  359. package/es/components/organism/TextEditor/hooks/index.d.ts +6 -0
  360. package/es/components/organism/TextEditor/hooks/index.js +6 -0
  361. package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +4 -0
  362. package/es/components/organism/TextEditor/hooks/useColorSet.js +29 -0
  363. package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +18 -0
  364. package/es/components/organism/TextEditor/hooks/useDocumentState.js +42 -0
  365. package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +26 -0
  366. package/es/components/organism/TextEditor/hooks/useMarkTracking.js +69 -0
  367. package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +31 -0
  368. package/es/components/organism/TextEditor/hooks/usePersistence.js +169 -0
  369. package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +6 -0
  370. package/es/components/organism/TextEditor/hooks/useStyleMemory.js +42 -0
  371. package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +34 -0
  372. package/es/components/organism/TextEditor/hooks/useStylePresets.js +83 -0
  373. package/es/components/organism/TextEditor/index.d.ts +18 -0
  374. package/es/components/organism/TextEditor/index.js +8 -0
  375. package/es/components/organism/TextEditor/index.scss +65 -0
  376. package/es/components/organism/TextEditor/provider.d.ts +15 -0
  377. package/es/components/organism/TextEditor/provider.js +36 -0
  378. package/es/components/organism/TextEditor/store.d.ts +20 -0
  379. package/es/components/organism/TextEditor/store.js +40 -0
  380. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/froala-legacy-format.settings.json +95 -0
  381. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.d.ts +111 -0
  382. package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.js +82 -0
  383. package/es/components/organism/TextEditor/stories/shared.d.ts +64 -0
  384. package/es/components/organism/TextEditor/stories/shared.js +57 -0
  385. package/es/components/organism/TextEditor/styled.d.ts +9 -0
  386. package/es/components/organism/TextEditor/styled.js +61 -0
  387. package/es/components/organism/TextEditor/types.d.ts +311 -0
  388. package/es/components/organism/TextEditor/types.js +6 -0
  389. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +3 -0
  390. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +114 -0
  391. package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +1 -0
  392. package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +1 -0
  393. package/es/components/organism/TextEditor/ui/Button/Button.d.ts +9 -0
  394. package/es/components/organism/TextEditor/ui/Button/Button.js +35 -0
  395. package/es/components/organism/TextEditor/ui/Button/index.d.ts +2 -0
  396. package/es/components/organism/TextEditor/ui/Button/index.js +1 -0
  397. package/es/components/organism/TextEditor/ui/Button/types.d.ts +10 -0
  398. package/es/components/organism/TextEditor/ui/Button/types.js +1 -0
  399. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +39 -0
  400. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +131 -0
  401. package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +1 -0
  402. package/es/components/organism/TextEditor/ui/ColorPicker/index.js +1 -0
  403. package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.d.ts +17 -0
  404. package/es/components/organism/TextEditor/ui/DropdownButton/DropdownButton.js +51 -0
  405. package/es/components/organism/TextEditor/ui/DropdownButton/index.d.ts +1 -0
  406. package/es/components/organism/TextEditor/ui/DropdownButton/index.js +1 -0
  407. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +11 -0
  408. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +66 -0
  409. package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +2 -0
  410. package/es/components/organism/TextEditor/ui/Emoji/index.js +2 -0
  411. package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +4 -0
  412. package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +71 -0
  413. package/es/components/organism/TextEditor/ui/FontPopover/FontItem.d.ts +2 -0
  414. package/es/components/organism/TextEditor/ui/FontPopover/FontItem.js +27 -0
  415. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +16 -0
  416. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +102 -0
  417. package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +2 -0
  418. package/es/components/organism/TextEditor/ui/FontPopover/styled.js +36 -0
  419. package/es/components/organism/TextEditor/ui/FontPopover/types.d.ts +35 -0
  420. package/es/components/organism/TextEditor/ui/FontPopover/types.js +1 -0
  421. package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.d.ts +16 -0
  422. package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.js +61 -0
  423. package/es/components/organism/TextEditor/ui/LinkInsertForm/index.d.ts +2 -0
  424. package/es/components/organism/TextEditor/ui/LinkInsertForm/index.js +1 -0
  425. package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.d.ts +9 -0
  426. package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.js +126 -0
  427. package/es/components/organism/TextEditor/ui/LinkPopover/index.d.ts +2 -0
  428. package/es/components/organism/TextEditor/ui/LinkPopover/index.js +1 -0
  429. package/es/components/organism/TextEditor/ui/Popover/Popover.d.ts +6 -0
  430. package/es/components/organism/TextEditor/ui/Popover/Popover.js +9 -0
  431. package/es/components/organism/TextEditor/ui/Popover/index.d.ts +1 -0
  432. package/es/components/organism/TextEditor/ui/Popover/index.js +1 -0
  433. package/es/components/organism/TextEditor/ui/Select/Select.d.ts +4 -0
  434. package/es/components/organism/TextEditor/ui/Select/Select.js +7 -0
  435. package/es/components/organism/TextEditor/ui/Select/index.d.ts +1 -0
  436. package/es/components/organism/TextEditor/ui/Select/index.js +1 -0
  437. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.d.ts +2 -0
  438. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/SplitButtonDropdown.js +44 -0
  439. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.d.ts +1 -0
  440. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/index.js +1 -0
  441. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.d.ts +2 -0
  442. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/styled.js +58 -0
  443. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.d.ts +19 -0
  444. package/es/components/organism/TextEditor/ui/SplitButtonDropdown/types.js +1 -0
  445. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +30 -0
  446. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +75 -0
  447. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +1 -0
  448. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +1 -0
  449. package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.d.ts +19 -0
  450. package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.js +85 -0
  451. package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.d.ts +10 -0
  452. package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.js +39 -0
  453. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +6 -0
  454. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +19 -0
  455. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +6 -0
  456. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +93 -0
  457. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +5 -0
  458. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +20 -0
  459. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +4 -0
  460. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +32 -0
  461. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +18 -0
  462. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +41 -0
  463. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +8 -0
  464. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +51 -0
  465. package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.d.ts +5 -0
  466. package/es/components/organism/TextEditor/ui/Toolbar/actions/HistoryAction.js +21 -0
  467. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +5 -0
  468. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +17 -0
  469. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +5 -0
  470. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +18 -0
  471. package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.d.ts +5 -0
  472. package/es/components/organism/TextEditor/ui/Toolbar/actions/LetterSpacing.js +28 -0
  473. package/es/components/organism/TextEditor/ui/Toolbar/actions/LineSpacingAction.d.ts +10 -0
  474. package/es/components/organism/TextEditor/ui/Toolbar/actions/LineSpacingAction.js +45 -0
  475. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +6 -0
  476. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +17 -0
  477. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +5 -0
  478. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +67 -0
  479. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +5 -0
  480. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +17 -0
  481. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +7 -0
  482. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +18 -0
  483. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +5 -0
  484. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +18 -0
  485. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +5 -0
  486. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +26 -0
  487. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +5 -0
  488. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +26 -0
  489. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +5 -0
  490. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +3 -0
  491. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +5 -0
  492. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +29 -0
  493. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +14 -0
  494. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +22 -0
  495. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +5 -0
  496. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +36 -0
  497. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +5 -0
  498. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +18 -0
  499. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +7 -0
  500. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +18 -0
  501. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +24 -0
  502. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +24 -0
  503. package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +2 -0
  504. package/es/components/organism/TextEditor/ui/Toolbar/index.js +2 -0
  505. package/es/components/organism/TextEditor/utils/documentState.d.ts +73 -0
  506. package/es/components/organism/TextEditor/utils/documentState.js +149 -0
  507. package/es/components/organism/TextEditor/utils/font.d.ts +74 -0
  508. package/es/components/organism/TextEditor/utils/font.js +147 -0
  509. package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +87 -0
  510. package/es/components/organism/TextEditor/utils/htmlProcessing.js +460 -0
  511. package/es/components/organism/TextEditor/utils/indent.d.ts +11 -0
  512. package/es/components/organism/TextEditor/utils/indent.js +56 -0
  513. package/es/components/organism/TextEditor/utils/index.d.ts +8 -0
  514. package/es/components/organism/TextEditor/utils/index.js +16 -0
  515. package/es/components/organism/TextEditor/utils/link.d.ts +116 -0
  516. package/es/components/organism/TextEditor/utils/link.js +304 -0
  517. package/es/components/organism/TextEditor/utils/menu.d.ts +134 -0
  518. package/es/components/organism/TextEditor/utils/menu.js +321 -0
  519. package/es/components/organism/TextEditor/utils/selection.d.ts +25 -0
  520. package/es/components/organism/TextEditor/utils/selection.js +58 -0
  521. package/es/components/organism/TextEditor/utils/shared.d.ts +13 -0
  522. package/es/components/organism/TextEditor/utils/shared.js +52 -0
  523. package/es/components/organism/TextEditor/utils/smartTag.d.ts +49 -0
  524. package/es/components/organism/TextEditor/utils/smartTag.js +90 -0
  525. package/es/components/organism/TextEditor/utils/style.d.ts +78 -0
  526. package/es/components/organism/TextEditor/utils/style.js +193 -0
  527. package/es/components/organism/TicketEditor/styled.js +850 -850
  528. package/es/components/organism/TicketEditorV2/styled.js +839 -839
  529. package/es/components/organism/index.d.ts +1 -0
  530. package/es/components/organism/index.js +1 -0
  531. package/es/components/organism/index.scss +2 -1
  532. package/es/components/template/Layout/Layout.js +10 -10
  533. package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/components/OldLeftMenu/styled.js +73 -73
  534. package/es/components/template/Layout/components/RecommendationWorkspace/components/MenuMapping/styled.js +39 -39
  535. package/es/components/template/Layout/components/RecommendationWorkspace/components/RecommendationImage/styled.js +61 -61
  536. package/es/components/template/Layout/components/RecommendationWorkspace/styled.js +16 -16
  537. package/es/components/template/Layout/styled.js +84 -84
  538. package/es/components/template/TemplateListing/components/BlankTemplate/styled.js +21 -21
  539. package/es/components/template/TemplateListing/components/CategoryListing/styled.js +123 -123
  540. package/es/components/template/TemplateListing/components/Empty/styled.js +20 -20
  541. package/es/components/template/TemplateListing/stories/demo/styled.js +4 -4
  542. package/es/components/template/TemplateListing/styled/index.js +40 -40
  543. package/es/constants/index.d.ts +1 -0
  544. package/es/constants/index.js +1 -0
  545. package/es/constants/web.d.ts +8 -0
  546. package/es/constants/web.js +57 -0
  547. package/es/hooks/index.d.ts +4 -0
  548. package/es/hooks/index.js +4 -0
  549. package/es/hooks/useBroadcastedLocalStorage.d.ts +5 -0
  550. package/es/hooks/useBroadcastedLocalStorage.js +71 -0
  551. package/es/hooks/useElementSize.d.ts +7 -0
  552. package/es/hooks/useElementSize.js +56 -0
  553. package/es/hooks/useEyedropper/attach.d.ts +4 -0
  554. package/es/hooks/useEyedropper/attach.js +9 -0
  555. package/es/hooks/useEyedropper/eyedropper.d.ts +69 -0
  556. package/es/hooks/useEyedropper/eyedropper.js +205 -0
  557. package/es/hooks/useEyedropper/index.d.ts +2 -0
  558. package/es/hooks/useEyedropper/index.js +7 -0
  559. package/es/hooks/useEyedropper/support.d.ts +1 -0
  560. package/es/hooks/useEyedropper/support.js +3 -0
  561. package/es/hooks/useEyedropper/types.d.ts +9 -0
  562. package/es/hooks/useEyedropper/types.js +1 -0
  563. package/es/hooks/useEyedropper/useEyedropper.d.ts +8 -0
  564. package/es/hooks/useEyedropper/useEyedropper.js +50 -0
  565. package/es/hooks/useEyedropper/utils.d.ts +11 -0
  566. package/es/hooks/useEyedropper/utils.js +17 -0
  567. package/es/hooks/useIsMounted.d.ts +1 -0
  568. package/es/hooks/useIsMounted.js +11 -0
  569. package/es/index.d.ts +1 -1
  570. package/es/index.js +1 -1
  571. package/es/locales/en/google-sheet.json +109 -8
  572. package/es/locales/i18n.d.ts +307 -4
  573. package/es/locales/ja/google-sheet.json +301 -200
  574. package/es/locales/vi/google-sheet.json +118 -17
  575. package/es/providers/ConfigProvider/GlobalStyle.js +1249 -1249
  576. package/es/styled/common.js +51 -51
  577. package/es/tests/styled.js +4 -4
  578. package/es/types/index.d.ts +9 -0
  579. package/es/utils/common.d.ts +15 -9
  580. package/es/utils/common.js +62 -24
  581. package/es/utils/index.d.ts +1 -0
  582. package/es/utils/index.js +1 -0
  583. package/es/utils/variables.js +7 -7
  584. package/es/utils/web.d.ts +80 -0
  585. package/es/utils/web.js +226 -0
  586. package/package.json +276 -266
  587. package/CHANGELOG.md +0 -63
@@ -4,56 +4,56 @@ import styled from 'styled-components';
4
4
  import { globalToken } from '../constants';
5
5
  // Components
6
6
  import { Button } from '@antscorp/antsomi-ui/es/components/atoms';
7
- export const IconButton = styled.div `
8
- width: 20px;
9
- height: 20px;
10
- display: flex;
11
- align-items: center;
12
- justify-content: center;
13
- transition: all 200ms;
14
- flex-shrink: 0;
15
-
16
- i {
17
- font-size: 14px;
18
- color: ${globalToken?.bw8};
19
- }
20
-
21
- &:hover {
22
- i {
23
- color: ${globalToken?.bw10};
24
- }
25
- }
7
+ export const IconButton = styled.div `
8
+ width: 20px;
9
+ height: 20px;
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: center;
13
+ transition: all 200ms;
14
+ flex-shrink: 0;
15
+
16
+ i {
17
+ font-size: 14px;
18
+ color: ${globalToken?.bw8};
19
+ }
20
+
21
+ &:hover {
22
+ i {
23
+ color: ${globalToken?.bw10};
24
+ }
25
+ }
26
26
  `;
27
- export const ActionButton = styled(Button) `
28
- display: flex !important;
29
- flex-direction: column;
30
- align-items: center;
31
- height: 43px !important;
32
- width: 50px !important;
33
- gap: 4px !important;
34
- padding: 3px 0px !important;
35
- font-size: 8px !important;
36
- line-height: 1 !important;
37
- color: ${globalToken?.bw8} !important;
38
-
39
- ${props => props.$hide && `visibility: hidden !important;`}
40
-
41
- .action-icon {
42
- display: flex;
43
- align-items: center;
44
- justify-content: center;
45
- flex-shrink: 0;
46
- > i {
47
- font-size: 24px !important;
48
- }
49
- }
50
-
51
- /* &:hover, */
52
- &:active {
53
- color: ${globalToken?.colorPrimary} !important;
54
- }
55
-
56
- &:disabled {
57
- background-color: ${globalToken?.bw2} !important;
58
- }
27
+ export const ActionButton = styled(Button) `
28
+ display: flex !important;
29
+ flex-direction: column;
30
+ align-items: center;
31
+ height: 43px !important;
32
+ width: 50px !important;
33
+ gap: 4px !important;
34
+ padding: 3px 0px !important;
35
+ font-size: 8px !important;
36
+ line-height: 1 !important;
37
+ color: ${globalToken?.bw8} !important;
38
+
39
+ ${props => props.$hide && `visibility: hidden !important;`}
40
+
41
+ .action-icon {
42
+ display: flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ flex-shrink: 0;
46
+ > i {
47
+ font-size: 24px !important;
48
+ }
49
+ }
50
+
51
+ /* &:hover, */
52
+ &:active {
53
+ color: ${globalToken?.colorPrimary} !important;
54
+ }
55
+
56
+ &:disabled {
57
+ background-color: ${globalToken?.bw2} !important;
58
+ }
59
59
  `;
@@ -1,6 +1,6 @@
1
1
  import styled from 'styled-components';
2
- export const TableTestWrapper = styled.div `
3
- padding: 10px;
4
- height: 100vh;
5
- overflow: auto;
2
+ export const TableTestWrapper = styled.div `
3
+ padding: 10px;
4
+ height: 100vh;
5
+ overflow: auto;
6
6
  `;
@@ -3,6 +3,15 @@ export type THandleErrorPayload = {
3
3
  name: string;
4
4
  args: Record<string, any>;
5
5
  };
6
+ /** Generic data attributes to set on components */
7
+ export type DataAttribute = {
8
+ /** The key for the attribute */
9
+ key: `data-${string}`;
10
+ /** The value */
11
+ value: string;
12
+ };
13
+ /** An array of data attributes */
14
+ export type DataAttributes = DataAttribute[];
6
15
  export type TLocale = 'en' | 'vi';
7
16
  export type GenericFunction = (...args: any[]) => any;
8
17
  export type TConfigErrorInfo = {
@@ -1,3 +1,4 @@
1
+ import { DataAttributes } from '../types';
1
2
  /**
2
3
  * Function to reorder list
3
4
  * @param {Object[]} list - list of item want to reorder
@@ -66,17 +67,14 @@ export declare const searchParamsToObject: (searchParams?: string) => Record<str
66
67
  export declare const getShuffleArray: <T>(array: T[]) => T[];
67
68
  export declare const snakeCaseToCamelCase: <T = Record<string, any>>(object: Record<string, any> | Record<string, any>[], recursive?: boolean) => T;
68
69
  export declare const camelCaseToSnakeCase: <T = Record<string, any>>(object: Record<string, any>, recursive?: boolean) => T;
69
- export declare function generateKey(): any;
70
+ export declare function generateKey(): string;
70
71
  export declare const formatUserId: (userId?: number) => string;
71
72
  /**
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
- /**
73
+ * Checks string matching based on a query, supporting fuzzy matching,
74
+ * where the query characters must appear in order within the target string.
75
+ * Allows for missing characters in the query relative to the target,
76
+ * and ignores case, diacritics, and spaces.
77
+ *
80
78
  * @param str target string
81
79
  * @param queryStr search query
82
80
  * @returns true if target string includes search query
@@ -165,5 +163,13 @@ export declare const convertNumberByDisplayFormat: (value: number | string, grou
165
163
  export declare function numberWithCommas(n: number): string;
166
164
  export declare const multiPercentageValue: (value?: string) => string;
167
165
  export declare const antsomiClsx: (componentName: string) => (className: string) => string;
166
+ /**
167
+ * Take an array of data attribute key/value pairs and return an object which
168
+ * can be spread into a component's definition
169
+ *
170
+ * @param attributes
171
+ * @returns A spreadable object of data-attributes
172
+ */
173
+ export declare const dataAttrArrayToObject: (attributes?: DataAttributes) => Record<string, string>;
168
174
  export declare function arrayToMapByProperty<T extends object, K extends keyof T>(array: T[], propertyName: K): Map<T[K], T>;
169
175
  export declare function compareStrings(a: any, b: any): number;
@@ -6,7 +6,7 @@ import uniqid from 'uniqid';
6
6
  import { MESSAGES, PORTAL_KEYS } from '@antscorp/antsomi-ui/es/services/constants';
7
7
  // Utils
8
8
  import { handleError } from './handleError';
9
- import { keyBy, sortBy } from 'lodash';
9
+ import { kebabCase, keyBy, sortBy, toString } from 'lodash';
10
10
  import clsx from 'clsx';
11
11
  import { ANTSOMI_COMPONENT_PREFIX_CLS } from '../constants';
12
12
  const PATH = 'src/utils/common.ts';
@@ -430,35 +430,57 @@ 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
- * Function to remove accent
434
- * @param str - String want to remove accent
435
- * @returns {string} - Result after remove accent
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.
436
439
  */
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()) || '';
440
+ function normalizeStringForSearch(str) {
441
+ const normalizedStr = typeof str !== 'string' ? toString(str) : str;
442
+ if (!normalizedStr) {
443
+ return ''; // Handle null, undefined, or empty string inputs
444
+ }
445
+ return normalizedStr
446
+ .normalize('NFD') // Decompose accented characters (e.g., "á" -> "a" + "´")
447
+ .replace(/[\u0300-\u036f]/g, '') // Remove diacritical marks
448
+ .toLowerCase() // Convert to lowercase
449
+ .replace(/\s+/g, ''); // Remove all whitespace
450
+ }
456
451
  /**
452
+ * Checks string matching based on a query, supporting fuzzy matching,
453
+ * where the query characters must appear in order within the target string.
454
+ * Allows for missing characters in the query relative to the target,
455
+ * and ignores case, diacritics, and spaces.
456
+ *
457
457
  * @param str target string
458
458
  * @param queryStr search query
459
459
  * @returns true if target string includes search query
460
460
  */
461
- export const searchStringQuery = (str, queryStr) => simplifyString(str).includes(simplifyString(queryStr || ''));
461
+ export const searchStringQuery = (str, queryStr) => {
462
+ const normalizedQuery = normalizeStringForSearch(queryStr);
463
+ const normalizedItem = normalizeStringForSearch(str);
464
+ // Optimization: if normalized query is longer than normalized item,
465
+ // it cannot be a subsequence.
466
+ if (normalizedQuery.length > normalizedItem.length) {
467
+ return false;
468
+ }
469
+ // Subsequence check:
470
+ // Iterate through both normalized strings.
471
+ // If characters match, advance the query pointer.
472
+ // Always advance the item pointer.
473
+ let queryIndex = 0;
474
+ let itemIndex = 0;
475
+ while (queryIndex < normalizedQuery.length && itemIndex < normalizedItem.length) {
476
+ if (normalizedQuery[queryIndex] === normalizedItem[itemIndex]) {
477
+ queryIndex++;
478
+ }
479
+ itemIndex++;
480
+ }
481
+ // If queryIndex reached the end of normalizedQuery, all its characters were found in order.
482
+ return queryIndex === normalizedQuery.length;
483
+ };
462
484
  /**
463
485
  * Checks if any of the provided values match the search value.
464
486
  *
@@ -742,6 +764,22 @@ export const antsomiClsx = (componentName) => (className) => {
742
764
  });
743
765
  return clsx(classNames);
744
766
  };
767
+ /**
768
+ * Take an array of data attribute key/value pairs and return an object which
769
+ * can be spread into a component's definition
770
+ *
771
+ * @param attributes
772
+ * @returns A spreadable object of data-attributes
773
+ */
774
+ export const dataAttrArrayToObject = (attributes = []) => attributes.reduce((output, current) => {
775
+ // Ensure we follow the correct syntax so we will just return the output if not
776
+ if (!/^data-([a-z]+-)*[a-z]+$/g.test(kebabCase(current.key)))
777
+ return output;
778
+ // Assign the key/value pair to the output object
779
+ output[kebabCase(current.key)] = current.value;
780
+ // return the object
781
+ return output;
782
+ }, {});
745
783
  export function arrayToMapByProperty(array, propertyName) {
746
784
  // Đảm bảo đầu vào là một mảng và không rỗng
747
785
  if (!Array.isArray(array) || array.length === 0) {
@@ -9,3 +9,4 @@ 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,3 +9,4 @@ export * from './actionButtons';
9
9
  export * from './dataTable';
10
10
  export * from './cookie';
11
11
  export * from './attribute';
12
+ export * from './web';
@@ -1,9 +1,9 @@
1
1
  import { css } from 'styled-components';
2
- export const breakdownMd = style => css `
3
- /* @media (max-width: 1600px) {
4
- ${style};
5
- } */
6
- ${style}/* @media (max-width: 1500px) {
7
- ${style};
8
- } */
2
+ export const breakdownMd = style => css `
3
+ /* @media (max-width: 1600px) {
4
+ ${style};
5
+ } */
6
+ ${style}/* @media (max-width: 1500px) {
7
+ ${style};
8
+ } */
9
9
  `;
package/es/utils/web.d.ts CHANGED
@@ -1,4 +1,70 @@
1
1
  /// <reference types="react" />
2
+ /**
3
+ * Parses a font family string and extracts individual font names
4
+ * Handles quoted fonts, fallbacks, and CSS font-family syntax
5
+ * @param fontFamily - Font family string (e.g., "'Roboto', Arial, sans-serif")
6
+ * @returns Array of individual font names
7
+ */
8
+ export declare function parseFontFamily(fontFamily: string): string[];
9
+ /**
10
+ * Checks if a given font name is considered a web safe font
11
+ * @param fontName - The font name to check (case insensitive)
12
+ * @param includeGeneric - Whether to consider generic font families as web safe (default: false)
13
+ * @returns boolean - True if the font is web safe, false otherwise
14
+ */
15
+ export declare function isWebSafeFont(fontName: string, includeGeneric?: boolean): boolean;
16
+ /**
17
+ * Extracts the primary font from a font-family string
18
+ * @param fontFamily Font family string (may contain fallbacks)
19
+ * @returns Primary font name
20
+ */
21
+ export declare function getPrimaryFontFamily(fontFamily: string): string;
22
+ /**
23
+ * Checks if the first font in a font family string is web safe
24
+ * @param fontFamily - Font family string
25
+ * @returns boolean - True if the primary font is web safe
26
+ */
27
+ export declare function isPrimaryFontWebSafe(fontFamily: string): boolean;
28
+ /**
29
+ * Checks if a font name is a generic font family (CSS keyword)
30
+ * @param fontName - The font name to check
31
+ * @returns boolean - True if it's a generic font family
32
+ */
33
+ export declare function isGenericFontFamily(fontName: string): boolean;
34
+ /**
35
+ * Checks if a font family string (with potential fallbacks) contains any web safe fonts
36
+ * @param fontFamily - Font family string with potential fallbacks (e.g., "'Custom Font', Arial, sans-serif")
37
+ * @param options - Configuration options
38
+ * @returns Object with detailed analysis
39
+ */
40
+ export declare function analyzeFontFamily(fontFamily: string, options?: {
41
+ includeGenericAsWebSafe?: boolean;
42
+ }): {
43
+ hasWebSafeFonts: boolean;
44
+ webSafeFonts: string[];
45
+ nonWebSafeFonts: string[];
46
+ genericFonts: string[];
47
+ allFonts: string[];
48
+ isFullyWebSafe: boolean;
49
+ isPrimaryFontWebSafe: boolean;
50
+ };
51
+ /**
52
+ * Gets all available web safe fonts
53
+ * @returns Array of web safe font names
54
+ */
55
+ export declare function getWebSafeFonts(): readonly string[];
56
+ /**
57
+ * Finds web safe font alternatives for a given font
58
+ * @param fontName - The font name to find alternatives for
59
+ * @returns Array of similar web safe fonts
60
+ */
61
+ export declare function getWebSafeFontAlternatives(fontName: string): string[];
62
+ /**
63
+ * Creates a font stack with appropriate fallbacks
64
+ * @param primaryFont Primary font family
65
+ * @returns Complete font stack string
66
+ */
67
+ export declare function createFontStack(primaryFont: string): string;
2
68
  /**
3
69
  * Function to parse search params string to object
4
70
  * @param {string} searchParams - search params
@@ -21,3 +87,17 @@ export declare const isLinux: () => boolean;
21
87
  * @returns Platform-appropriate modifier key
22
88
  */
23
89
  export declare const getModifierKey: () => "⌘" | "Ctrl";
90
+ /**
91
+ * Formats a hotkey string with the appropriate modifier
92
+ * @param key The key to format
93
+ * @returns Formatted hotkey string
94
+ */
95
+ export declare const formatHotkey: (key: string) => string;
96
+ /**
97
+ * Chuyển đổi giá trị CSS 'px' thành số nguyên.
98
+ * Ví dụ: "16px" => 16
99
+ *
100
+ * @param fontSizeString - Chuỗi kích thước font, ví dụ: "16px".
101
+ * @returns Số nguyên hoặc null nếu chuỗi không hợp lệ.
102
+ */
103
+ export declare function convertPxToNumber(fontSizeString: unknown): number | null;
package/es/utils/web.js CHANGED
@@ -1,4 +1,199 @@
1
1
  import { VALUE_C, VALUE_CONTROL, VALUE_LEFT_WINDOW, VALUE_V, VALUE_X, VALUE_Z, } from '@antscorp/antsomi-ui/es/constants/keyCode';
2
+ import { GENERIC_FONT_FAMILIES, WEB_SAFE_FONTS } from '../constants';
3
+ /**
4
+ * Parses a font family string and extracts individual font names
5
+ * Handles quoted fonts, fallbacks, and CSS font-family syntax
6
+ * @param fontFamily - Font family string (e.g., "'Roboto', Arial, sans-serif")
7
+ * @returns Array of individual font names
8
+ */
9
+ export function parseFontFamily(fontFamily) {
10
+ if (!fontFamily || typeof fontFamily !== 'string') {
11
+ return [];
12
+ }
13
+ // Split by comma and clean up each font name
14
+ return fontFamily
15
+ .split(',')
16
+ .map(font => font.trim())
17
+ .map(font =>
18
+ // Remove quotes (single or double)
19
+ font.replace(/^['"]|['"]$/g, ''))
20
+ .map(font => font.trim())
21
+ .filter(font => font.length > 0);
22
+ }
23
+ /**
24
+ * Checks if a given font name is considered a web safe font
25
+ * @param fontName - The font name to check (case insensitive)
26
+ * @param includeGeneric - Whether to consider generic font families as web safe (default: false)
27
+ * @returns boolean - True if the font is web safe, false otherwise
28
+ */
29
+ export function isWebSafeFont(fontName, includeGeneric = false) {
30
+ if (!fontName || typeof fontName !== 'string') {
31
+ return false;
32
+ }
33
+ // Normalize the font name: trim whitespace and convert to lowercase
34
+ const normalizedFontName = fontName.trim().toLowerCase();
35
+ // Check if it's a specific web safe font
36
+ const isSpecificWebSafe = WEB_SAFE_FONTS.some(f => f === normalizedFontName);
37
+ // If including generic fonts, also check if it's a generic font family
38
+ if (includeGeneric) {
39
+ const isGeneric = GENERIC_FONT_FAMILIES.some(f => f === normalizedFontName);
40
+ return isSpecificWebSafe || isGeneric;
41
+ }
42
+ return isSpecificWebSafe;
43
+ }
44
+ /**
45
+ * Extracts the primary font from a font-family string
46
+ * @param fontFamily Font family string (may contain fallbacks)
47
+ * @returns Primary font name
48
+ */
49
+ export function getPrimaryFontFamily(fontFamily) {
50
+ if (!fontFamily)
51
+ return '';
52
+ const fonts = parseFontFamily(fontFamily);
53
+ const primaryFont = fonts[0].trim();
54
+ // Remove quotes if present
55
+ return primaryFont.replace(/^["']|["']$/g, '');
56
+ }
57
+ /**
58
+ * Checks if the first font in a font family string is web safe
59
+ * @param fontFamily - Font family string
60
+ * @returns boolean - True if the primary font is web safe
61
+ */
62
+ export function isPrimaryFontWebSafe(fontFamily) {
63
+ const fonts = parseFontFamily(fontFamily);
64
+ return fonts.length > 0 ? isWebSafeFont(fonts[0]) : false;
65
+ }
66
+ /**
67
+ * Checks if a font name is a generic font family (CSS keyword)
68
+ * @param fontName - The font name to check
69
+ * @returns boolean - True if it's a generic font family
70
+ */
71
+ export function isGenericFontFamily(fontName) {
72
+ if (!fontName || typeof fontName !== 'string') {
73
+ return false;
74
+ }
75
+ const normalizedFontName = fontName.trim().toLowerCase();
76
+ return GENERIC_FONT_FAMILIES.includes(normalizedFontName);
77
+ }
78
+ /**
79
+ * Checks if a font family string (with potential fallbacks) contains any web safe fonts
80
+ * @param fontFamily - Font family string with potential fallbacks (e.g., "'Custom Font', Arial, sans-serif")
81
+ * @param options - Configuration options
82
+ * @returns Object with detailed analysis
83
+ */
84
+ export function analyzeFontFamily(fontFamily, options = {}) {
85
+ const { includeGenericAsWebSafe = false } = options;
86
+ const fonts = parseFontFamily(fontFamily);
87
+ const webSafeFonts = [];
88
+ const nonWebSafeFonts = [];
89
+ const genericFonts = [];
90
+ fonts.forEach(font => {
91
+ if (isGenericFontFamily(font)) {
92
+ genericFonts.push(font);
93
+ }
94
+ else if (isWebSafeFont(font)) {
95
+ webSafeFonts.push(font);
96
+ }
97
+ else {
98
+ nonWebSafeFonts.push(font);
99
+ }
100
+ });
101
+ // Calculate web safety based on options
102
+ let isFullyWebSafe;
103
+ let hasWebSafeFonts;
104
+ if (includeGenericAsWebSafe) {
105
+ // Include generic fonts as web safe
106
+ hasWebSafeFonts = webSafeFonts.length > 0 || genericFonts.length > 0;
107
+ isFullyWebSafe =
108
+ nonWebSafeFonts.length === 0 && (webSafeFonts.length > 0 || genericFonts.length > 0);
109
+ }
110
+ else {
111
+ // Only specific web safe fonts count
112
+ hasWebSafeFonts = webSafeFonts.length > 0;
113
+ // Must have NO non-web-safe fonts AND NO generic fonts for strict mode
114
+ isFullyWebSafe =
115
+ nonWebSafeFonts.length === 0 && genericFonts.length === 0 && webSafeFonts.length > 0;
116
+ }
117
+ return {
118
+ hasWebSafeFonts,
119
+ webSafeFonts,
120
+ nonWebSafeFonts,
121
+ genericFonts,
122
+ allFonts: fonts,
123
+ isFullyWebSafe,
124
+ isPrimaryFontWebSafe: isPrimaryFontWebSafe(fontFamily),
125
+ };
126
+ }
127
+ /**
128
+ * Gets all available web safe fonts
129
+ * @returns Array of web safe font names
130
+ */
131
+ export function getWebSafeFonts() {
132
+ return WEB_SAFE_FONTS;
133
+ }
134
+ /**
135
+ * Finds web safe font alternatives for a given font
136
+ * @param fontName - The font name to find alternatives for
137
+ * @returns Array of similar web safe fonts
138
+ */
139
+ export function getWebSafeFontAlternatives(fontName) {
140
+ const normalizedFontName = fontName.trim().toLowerCase();
141
+ // Define font categories and their alternatives
142
+ const fontCategories = {
143
+ serif: [
144
+ 'times new roman',
145
+ 'times',
146
+ 'georgia',
147
+ 'garamond',
148
+ 'book antiqua',
149
+ 'palatino linotype',
150
+ 'palatino',
151
+ ],
152
+ sansSerif: ['arial', 'helvetica', 'verdana', 'tahoma', 'geneva', 'lucida sans'],
153
+ monospace: ['courier new', 'courier', 'monaco', 'menlo', 'consolas', 'lucida console'],
154
+ cursive: ['comic sans ms', 'brush script mt'],
155
+ fantasy: ['papyrus', 'copperplate', 'fantasy'],
156
+ };
157
+ // If it's already web safe, return similar fonts from the same category
158
+ if (isWebSafeFont(normalizedFontName)) {
159
+ for (const [_category, fonts] of Object.entries(fontCategories)) {
160
+ if (fonts.includes(normalizedFontName)) {
161
+ return fonts.filter(font => font !== normalizedFontName);
162
+ }
163
+ }
164
+ }
165
+ // For non-web-safe fonts, suggest based on common patterns
166
+ if (normalizedFontName.includes('serif') && !normalizedFontName.includes('sans')) {
167
+ return fontCategories.serif;
168
+ }
169
+ if (normalizedFontName.includes('sans') ||
170
+ normalizedFontName.includes('arial') ||
171
+ normalizedFontName.includes('helvetica')) {
172
+ return fontCategories.sansSerif;
173
+ }
174
+ if (normalizedFontName.includes('mono') ||
175
+ normalizedFontName.includes('courier') ||
176
+ normalizedFontName.includes('code')) {
177
+ return fontCategories.monospace;
178
+ }
179
+ if (normalizedFontName.includes('script') ||
180
+ normalizedFontName.includes('cursive') ||
181
+ normalizedFontName.includes('comic')) {
182
+ return fontCategories.cursive;
183
+ }
184
+ // Default fallback to common sans-serif fonts
185
+ return fontCategories.sansSerif;
186
+ }
187
+ /**
188
+ * Creates a font stack with appropriate fallbacks
189
+ * @param primaryFont Primary font family
190
+ * @returns Complete font stack string
191
+ */
192
+ export function createFontStack(primaryFont) {
193
+ const fallbacks = getWebSafeFontAlternatives(primaryFont);
194
+ const stack = [primaryFont, ...fallbacks];
195
+ return stack.join(', ');
196
+ }
2
197
  /**
3
198
  * Function to parse search params string to object
4
199
  * @param {string} searchParams - search params
@@ -57,3 +252,34 @@ export const isLinux = () => getPlatform() === 'linux';
57
252
  * @returns Platform-appropriate modifier key
58
253
  */
59
254
  export const getModifierKey = () => (isMacOS() ? '⌘' : 'Ctrl');
255
+ /**
256
+ * Formats a hotkey string with the appropriate modifier
257
+ * @param key The key to format
258
+ * @returns Formatted hotkey string
259
+ */
260
+ export const formatHotkey = (key) => {
261
+ const modifier = getModifierKey();
262
+ return `${modifier}+${key}`;
263
+ };
264
+ /**
265
+ * Chuyển đổi giá trị CSS 'px' thành số nguyên.
266
+ * Ví dụ: "16px" => 16
267
+ *
268
+ * @param fontSizeString - Chuỗi kích thước font, ví dụ: "16px".
269
+ * @returns Số nguyên hoặc null nếu chuỗi không hợp lệ.
270
+ */
271
+ export function convertPxToNumber(fontSizeString) {
272
+ // Kiểm tra xem đầu vào có phải là chuỗi không
273
+ if (typeof fontSizeString !== 'string') {
274
+ return null;
275
+ }
276
+ // Sử dụng parseInt để lấy phần số.
277
+ // parseInt sẽ dừng lại khi gặp ký tự không phải số, ví dụ 'p' trong 'px'.
278
+ const numberValue = parseInt(fontSizeString, 10);
279
+ // Kiểm tra xem kết quả có phải là một số hợp lệ không
280
+ // (isNaN - Is Not a Number)
281
+ if (isNaN(numberValue)) {
282
+ return null;
283
+ }
284
+ return numberValue;
285
+ }