@antscorp/antsomi-ui 1.3.3-beta.7 → 1.3.3-beta.70

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 (372) hide show
  1. package/es/assets/images/iphone-top-bar.png +0 -0
  2. package/es/assets/images/iphone.png +0 -0
  3. package/es/assets/images/stars_slider.png +0 -0
  4. package/es/components/atoms/Button/index.d.ts +1 -8
  5. package/es/components/atoms/Empty/Empty.d.ts +6 -5
  6. package/es/components/atoms/Empty/Empty.js +7 -1
  7. package/es/components/atoms/Flex/Flex.d.ts +2 -0
  8. package/es/components/atoms/Flex/Flex.js +1 -0
  9. package/es/components/atoms/Flex/index.d.ts +1 -0
  10. package/es/components/atoms/Flex/index.js +1 -0
  11. package/es/components/atoms/Input/Input.d.ts +14 -3
  12. package/es/components/atoms/Input/Input.js +7 -3
  13. package/es/components/atoms/InputDynamic/EditCaretPositioning.d.ts +2 -0
  14. package/es/components/atoms/InputDynamic/EditCaretPositioning.js +89 -0
  15. package/es/components/atoms/InputDynamic/InputDynamic.d.ts +10 -0
  16. package/es/components/atoms/InputDynamic/InputDynamic.js +504 -0
  17. package/es/components/atoms/InputDynamic/PopupShortLink.d.ts +16 -0
  18. package/es/components/atoms/InputDynamic/PopupShortLink.js +85 -0
  19. package/es/components/atoms/InputDynamic/constants.d.ts +71 -0
  20. package/es/components/atoms/InputDynamic/constants.js +71 -0
  21. package/es/components/atoms/InputDynamic/index.d.ts +2 -0
  22. package/es/components/atoms/InputDynamic/index.js +1 -0
  23. package/es/components/atoms/InputDynamic/styled.d.ts +13 -0
  24. package/es/components/atoms/InputDynamic/styled.js +293 -0
  25. package/es/components/atoms/InputDynamic/types.d.ts +110 -0
  26. package/es/components/atoms/InputDynamic/types.js +1 -0
  27. package/es/components/atoms/InputDynamic/utils.d.ts +30 -0
  28. package/es/components/atoms/InputDynamic/utils.js +872 -0
  29. package/es/components/atoms/MobileFrame/MobileFrame.d.ts +4 -0
  30. package/es/components/atoms/MobileFrame/MobileFrame.js +22 -0
  31. package/es/components/atoms/MobileFrame/constants.d.ts +4 -0
  32. package/es/components/atoms/MobileFrame/constants.js +4 -0
  33. package/es/components/atoms/MobileFrame/index.d.ts +2 -0
  34. package/es/components/atoms/MobileFrame/index.js +1 -0
  35. package/es/components/atoms/MobileFrame/styled.d.ts +3 -0
  36. package/es/components/atoms/MobileFrame/styled.js +33 -0
  37. package/es/components/atoms/Pagination/index.d.ts +1 -0
  38. package/es/components/atoms/Popover/Popover.d.ts +1 -1
  39. package/es/components/atoms/Popover/styled.d.ts +1 -1
  40. package/es/components/atoms/PreviewTabs/PreviewTabs.d.ts +7 -0
  41. package/es/components/atoms/PreviewTabs/PreviewTabs.js +67 -0
  42. package/es/components/atoms/PreviewTabs/index.d.ts +2 -0
  43. package/es/components/atoms/PreviewTabs/index.js +1 -0
  44. package/es/components/atoms/PreviewTabs/styled.d.ts +6 -0
  45. package/es/components/atoms/PreviewTabs/styled.js +79 -0
  46. package/es/components/atoms/Progress/Progress.d.ts +1 -1
  47. package/es/components/atoms/Radio/index.d.ts +3 -3
  48. package/es/components/atoms/RateV2/RateV2.d.ts +18 -0
  49. package/es/components/atoms/RateV2/RateV2.js +73 -0
  50. package/es/components/atoms/RateV2/index.d.ts +1 -0
  51. package/es/components/atoms/RateV2/index.js +1 -0
  52. package/es/components/atoms/RequiredLabel/index.d.ts +1 -0
  53. package/es/components/atoms/RequiredLabel/index.js +4 -3
  54. package/es/components/atoms/Slider/index.d.ts +2 -1
  55. package/es/components/atoms/Slider/index.js +7 -14
  56. package/es/components/atoms/SliderV2/index.d.ts +6 -0
  57. package/es/components/atoms/SliderV2/index.js +21 -0
  58. package/es/components/atoms/Space/Space.d.ts +1 -1
  59. package/es/components/atoms/Spin/Spin.d.ts +2 -1
  60. package/es/components/atoms/Spin/styled.d.ts +1 -1
  61. package/es/components/atoms/Statistic/Statistic.d.ts +1 -4
  62. package/es/components/atoms/index.d.ts +8 -0
  63. package/es/components/atoms/index.js +6 -0
  64. package/es/components/common/ConfigProvider/ConfigProvider.js +6 -0
  65. package/es/components/common/ConfigProvider/GlobalStyle.js +281 -27
  66. package/es/components/icons/ArrowGrowIcon.d.ts +2 -1
  67. package/es/components/icons/AudioRecordIcon.d.ts +2 -1
  68. package/es/components/icons/BugIcon.d.ts +2 -1
  69. package/es/components/icons/CameraIcon.d.ts +2 -1
  70. package/es/components/icons/CaptureIcon.d.ts +2 -1
  71. package/es/components/icons/CheckSlimIcon.d.ts +2 -1
  72. package/es/components/icons/CloseIcon.d.ts +2 -1
  73. package/es/components/icons/CommentIcon.d.ts +2 -1
  74. package/es/components/icons/EventIcon.d.ts +2 -1
  75. package/es/components/icons/FreeDrawIcon.d.ts +2 -1
  76. package/es/components/icons/GPTIcon.d.ts +2 -1
  77. package/es/components/icons/GPTIconV2.d.ts +2 -1
  78. package/es/components/icons/GPTIconV3.d.ts +2 -1
  79. package/es/components/icons/HighlightIcon.d.ts +2 -1
  80. package/es/components/icons/IdeaIcon.d.ts +2 -1
  81. package/es/components/icons/InvisibleIcon.d.ts +2 -1
  82. package/es/components/icons/MuteIcon.d.ts +2 -1
  83. package/es/components/icons/OpenUrlIcon.d.ts +2 -1
  84. package/es/components/icons/PauseIcon.d.ts +2 -1
  85. package/es/components/icons/PlaneIcon.d.ts +2 -1
  86. package/es/components/icons/RequestIcon.d.ts +2 -1
  87. package/es/components/icons/StopRecordIcon.d.ts +2 -1
  88. package/es/components/icons/UserIcon.d.ts +2 -1
  89. package/es/components/icons/VerticalDotsIcon.d.ts +2 -1
  90. package/es/components/icons/WarningIcon.d.ts +2 -1
  91. package/es/components/molecules/AddDynamicContent/AddDynamicContent.d.ts +35 -0
  92. package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +1245 -0
  93. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +12 -0
  94. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.js +25 -0
  95. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/index.d.ts +3 -0
  96. package/es/components/molecules/AddDynamicContent/components/DisplayFormat/index.js +3 -0
  97. package/es/components/molecules/AddDynamicContent/components/FormatDatetime/FormatDatetime.d.ts +19 -0
  98. package/es/components/molecules/AddDynamicContent/components/FormatDatetime/FormatDatetime.js +101 -0
  99. package/es/components/molecules/AddDynamicContent/components/FormatDatetime/index.d.ts +1 -0
  100. package/es/components/molecules/AddDynamicContent/components/FormatDatetime/index.js +1 -0
  101. package/es/components/molecules/AddDynamicContent/components/FormatNumber/FormatNumber.d.ts +52 -0
  102. package/es/components/molecules/AddDynamicContent/components/FormatNumber/FormatNumber.js +132 -0
  103. package/es/components/molecules/AddDynamicContent/components/FormatNumber/index.d.ts +1 -0
  104. package/es/components/molecules/AddDynamicContent/components/FormatNumber/index.js +1 -0
  105. package/es/components/molecules/AddDynamicContent/components/index.d.ts +3 -0
  106. package/es/components/molecules/AddDynamicContent/components/index.js +3 -0
  107. package/es/components/molecules/AddDynamicContent/constants.d.ts +101 -0
  108. package/es/components/molecules/AddDynamicContent/constants.js +152 -0
  109. package/es/components/molecules/AddDynamicContent/currencies.json +1523 -0
  110. package/es/components/molecules/AddDynamicContent/index.d.ts +2 -0
  111. package/es/components/molecules/AddDynamicContent/index.js +2 -0
  112. package/es/components/molecules/AddDynamicContent/styled.d.ts +9 -0
  113. package/es/components/molecules/AddDynamicContent/styled.js +18 -0
  114. package/es/components/molecules/AddDynamicContent/types.d.ts +13 -0
  115. package/es/components/molecules/AddDynamicContent/types.js +1 -0
  116. package/es/components/molecules/AddDynamicContent/utils.d.ts +42 -0
  117. package/es/components/molecules/AddDynamicContent/utils.js +398 -0
  118. package/es/components/molecules/CaptureScreen/CaptureScreen.d.ts +2 -1
  119. package/es/components/molecules/CaptureScreen/components/CommentBox/CommentBox.d.ts +2 -1
  120. package/es/components/molecules/CaptureScreen/components/Cursor/Cursor.d.ts +2 -1
  121. package/es/components/molecules/Collapse/Collapse.d.ts +3 -3
  122. package/es/components/molecules/Collapse/Collapse.js +9 -0
  123. package/es/components/molecules/ColorSetting/styled.d.ts +1 -8
  124. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.d.ts +2 -2
  125. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +260 -113
  126. package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.d.ts +66 -25
  127. package/es/components/molecules/DatePicker/components/AdvancedPicker/constants.js +109 -0
  128. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +48 -4
  129. package/es/components/molecules/DatePicker/components/AdvancedPicker/types.d.ts +22 -0
  130. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +20 -0
  131. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +90 -1
  132. package/es/components/molecules/Drawer/Drawer.d.ts +5 -1
  133. package/es/components/molecules/Drawer/Drawer.js +3 -1
  134. package/es/components/molecules/Drawer/index.d.ts +1 -0
  135. package/es/components/molecules/Form/Form.d.ts +1 -0
  136. package/es/components/molecules/Form/Form.js +1 -0
  137. package/es/components/molecules/Form/index.d.ts +1 -0
  138. package/es/components/molecules/Form/index.js +1 -0
  139. package/es/components/molecules/IconSelection/styled.d.ts +1 -8
  140. package/es/components/molecules/Modal/Modal.d.ts +2 -2
  141. package/es/components/molecules/Modal/index.d.ts +1 -0
  142. package/es/components/molecules/Modal/styled.d.ts +1 -1
  143. package/es/components/molecules/Modal/styled.js +2 -0
  144. package/es/components/molecules/ModalV2/ModalV2.d.ts +5 -0
  145. package/es/components/molecules/ModalV2/ModalV2.js +26 -0
  146. package/es/components/molecules/ModalV2/index.d.ts +2 -0
  147. package/es/components/molecules/ModalV2/index.js +1 -0
  148. package/es/components/molecules/ModalV2/styled.d.ts +7 -0
  149. package/es/components/molecules/ModalV2/styled.js +22 -0
  150. package/es/components/molecules/Popconfirm/Popconfirm.d.ts +1 -1
  151. package/es/components/molecules/PreviewModal/PreviewModal.d.ts +7 -0
  152. package/es/components/molecules/PreviewModal/PreviewModal.js +30 -0
  153. package/es/components/molecules/PreviewModal/index.d.ts +2 -0
  154. package/es/components/molecules/PreviewModal/index.js +1 -0
  155. package/es/components/molecules/PreviewModal/styled.d.ts +4 -0
  156. package/es/components/molecules/PreviewModal/styled.js +39 -0
  157. package/es/components/molecules/ResizeGrid/ResizeGrid.d.ts +3 -0
  158. package/es/components/molecules/ResizeGrid/ResizeGrid.js +728 -0
  159. package/es/components/molecules/ResizeGrid/components/Cell/Cell.d.ts +3 -0
  160. package/es/components/molecules/ResizeGrid/components/Cell/Cell.js +87 -0
  161. package/es/components/molecules/ResizeGrid/components/Cell/index.d.ts +1 -0
  162. package/es/components/molecules/ResizeGrid/components/Cell/index.js +1 -0
  163. package/es/components/molecules/ResizeGrid/components/Cell/styled.d.ts +3 -0
  164. package/es/components/molecules/ResizeGrid/components/Cell/styled.js +80 -0
  165. package/es/components/molecules/ResizeGrid/constant.d.ts +35 -0
  166. package/es/components/molecules/ResizeGrid/constant.js +111 -0
  167. package/es/components/molecules/ResizeGrid/index.d.ts +2 -0
  168. package/es/components/molecules/ResizeGrid/index.js +1 -0
  169. package/es/components/molecules/ResizeGrid/styled.d.ts +10 -0
  170. package/es/components/molecules/ResizeGrid/styled.js +56 -0
  171. package/es/components/molecules/ResizeGrid/types.d.ts +147 -0
  172. package/es/components/molecules/ResizeGrid/types.js +1 -0
  173. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +12 -0
  174. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +53 -0
  175. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.d.ts +17 -0
  176. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/index.js +108 -0
  177. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.d.ts +20 -0
  178. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuCell/styled.js +135 -0
  179. package/es/components/molecules/RichMenu/RichMenuBlock/constants.d.ts +2 -0
  180. package/es/components/molecules/RichMenu/RichMenuBlock/constants.js +765 -0
  181. package/es/components/molecules/RichMenu/RichMenuBlock/index.d.ts +3 -0
  182. package/es/components/molecules/RichMenu/RichMenuBlock/index.js +2 -0
  183. package/es/components/molecules/RichMenu/RichMenuBlock/styled.d.ts +9 -0
  184. package/es/components/molecules/RichMenu/RichMenuBlock/styled.js +17 -0
  185. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +10 -0
  186. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +32 -0
  187. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.d.ts +6 -0
  188. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/index.js +15 -0
  189. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.d.ts +4 -0
  190. package/es/components/molecules/RichMenu/RichMenuChatBar/TypingChat/styled.js +47 -0
  191. package/es/components/molecules/RichMenu/RichMenuChatBar/index.d.ts +2 -0
  192. package/es/components/molecules/RichMenu/RichMenuChatBar/index.js +1 -0
  193. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +9 -0
  194. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +37 -0
  195. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +10 -0
  196. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +37 -0
  197. package/es/components/molecules/RichMenu/RichMenuMobileView/index.d.ts +1 -0
  198. package/es/components/molecules/RichMenu/RichMenuMobileView/index.js +1 -0
  199. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +6 -0
  200. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +20 -0
  201. package/es/components/molecules/RichMenu/index.d.ts +3 -0
  202. package/es/components/molecules/RichMenu/index.js +3 -0
  203. package/es/components/molecules/Select/Select.d.ts +6 -4
  204. package/es/components/molecules/Select/Select.js +23 -2
  205. package/es/components/molecules/Select/Test.d.ts +2 -1
  206. package/es/components/molecules/ShareAccess/ShareAccess.d.ts +3 -0
  207. package/es/components/molecules/ShareAccess/ShareAccess.js +23 -0
  208. package/es/components/molecules/ShareAccess/actions.d.ts +16 -0
  209. package/es/components/molecules/ShareAccess/actions.js +12 -0
  210. package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.d.ts +2 -0
  211. package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.js +78 -0
  212. package/es/components/molecules/ShareAccess/components/GeneralAccess/index.d.ts +1 -0
  213. package/es/components/molecules/ShareAccess/components/GeneralAccess/index.js +1 -0
  214. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.d.ts +1 -0
  215. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +57 -0
  216. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.d.ts +3 -0
  217. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +19 -0
  218. package/es/components/molecules/ShareAccess/components/LayoutContent/index.d.ts +1 -0
  219. package/es/components/molecules/ShareAccess/components/LayoutContent/index.js +1 -0
  220. package/es/components/molecules/ShareAccess/components/LayoutContent/styled.d.ts +1 -0
  221. package/es/components/molecules/ShareAccess/components/LayoutContent/styled.js +7 -0
  222. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/ModalTransferOwnerShip.d.ts +2 -0
  223. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/ModalTransferOwnerShip.js +43 -0
  224. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/index.d.ts +0 -0
  225. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/index.js +1 -0
  226. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.d.ts +7 -0
  227. package/es/components/molecules/ShareAccess/components/ModalTransferOwnerShip/styled.js +18 -0
  228. package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.d.ts +5 -0
  229. package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +97 -0
  230. package/es/components/molecules/ShareAccess/components/PeopleAccess/index.d.ts +1 -0
  231. package/es/components/molecules/ShareAccess/components/PeopleAccess/index.js +1 -0
  232. package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.d.ts +1 -0
  233. package/es/components/molecules/ShareAccess/components/PeopleAccess/styled.js +46 -0
  234. package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.d.ts +5 -0
  235. package/es/components/molecules/ShareAccess/components/SearchUser/SearchUser.js +73 -0
  236. package/es/components/molecules/ShareAccess/components/SearchUser/index.d.ts +1 -0
  237. package/es/components/molecules/ShareAccess/components/SearchUser/index.js +1 -0
  238. package/es/components/molecules/ShareAccess/components/SearchUser/styled.d.ts +2 -0
  239. package/es/components/molecules/ShareAccess/components/SearchUser/styled.js +29 -0
  240. package/es/components/molecules/ShareAccess/components/index.d.ts +1 -0
  241. package/es/components/molecules/ShareAccess/components/index.js +1 -0
  242. package/es/components/molecules/ShareAccess/constants.d.ts +67 -0
  243. package/es/components/molecules/ShareAccess/constants.js +85 -0
  244. package/es/components/molecules/ShareAccess/context.d.ts +4 -0
  245. package/es/components/molecules/ShareAccess/context.js +3 -0
  246. package/es/components/molecules/ShareAccess/hooks/index.d.ts +1 -0
  247. package/es/components/molecules/ShareAccess/hooks/index.js +1 -0
  248. package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +18 -0
  249. package/es/components/molecules/ShareAccess/hooks/useShareAccess.js +29 -0
  250. package/es/components/molecules/ShareAccess/index.d.ts +4 -0
  251. package/es/components/molecules/ShareAccess/index.js +4 -0
  252. package/es/components/molecules/ShareAccess/reducer.d.ts +2 -0
  253. package/es/components/molecules/ShareAccess/reducer.js +19 -0
  254. package/es/components/molecules/ShareAccess/types.d.ts +54 -0
  255. package/es/components/molecules/ShareAccess/types.js +1 -0
  256. package/es/components/molecules/ShareAccess/utils.d.ts +38 -0
  257. package/es/components/molecules/ShareAccess/utils.js +57 -0
  258. package/es/components/molecules/TreeSelect/TreeSelect.d.ts +4 -5
  259. package/es/components/molecules/UploadImage/MediaIcon.d.ts +2 -1
  260. package/es/components/molecules/UploadImage/MediaThumb.d.ts +11 -0
  261. package/es/components/molecules/UploadImage/MediaThumb.js +31 -0
  262. package/es/components/molecules/UploadImage/index.d.ts +6 -2
  263. package/es/components/molecules/UploadImage/index.js +101 -77
  264. package/es/components/molecules/UploadImage/styled.js +0 -4
  265. package/es/components/molecules/UploadImage/utils.d.ts +3 -0
  266. package/es/components/molecules/UploadImage/utils.js +24 -0
  267. package/es/components/molecules/index.d.ts +10 -3
  268. package/es/components/molecules/index.js +8 -3
  269. package/es/components/organism/Help/styled.d.ts +6 -16
  270. package/es/components/organism/Table/ExplorePivotTable/styled.d.ts +1 -0
  271. package/es/constants/index.d.ts +1 -0
  272. package/es/constants/index.js +1 -0
  273. package/es/constants/queries.d.ts +14 -0
  274. package/es/constants/queries.js +21 -0
  275. package/es/constants/richMenu.d.ts +19 -0
  276. package/es/constants/richMenu.js +19 -0
  277. package/es/constants/storybook.d.ts +7 -1
  278. package/es/constants/storybook.js +12 -0
  279. package/es/constants/theme.js +30 -3
  280. package/es/hooks/index.d.ts +1 -0
  281. package/es/hooks/index.js +1 -0
  282. package/es/hooks/useDebounceCallback.d.ts +1 -0
  283. package/es/hooks/useDebounceCallback.js +5 -0
  284. package/es/hooks/useDebounceV2.d.ts +1 -0
  285. package/es/hooks/useDebounceV2.js +11 -0
  286. package/es/hooks/useDeepCompareEffect.d.ts +1 -0
  287. package/es/hooks/useDeepCompareEffect.js +21 -0
  288. package/es/hooks/useDeepCompareMemo.d.ts +2 -0
  289. package/es/hooks/useDeepCompareMemo.js +21 -0
  290. package/es/hooks/usePrevious.d.ts +2 -0
  291. package/es/hooks/usePrevious.js +9 -0
  292. package/es/locales/en/translation.json +156 -3
  293. package/es/locales/i18n.d.ts +154 -0
  294. package/es/locales/translations.d.ts +153 -0
  295. package/es/locales/vi/translation.json +2 -1
  296. package/es/models/BusinessObject.d.ts +116 -0
  297. package/es/models/BusinessObject.js +113 -0
  298. package/es/models/Currency.d.ts +9 -0
  299. package/es/models/Currency.js +10 -0
  300. package/es/models/CustomFunction.d.ts +19 -0
  301. package/es/models/CustomFunction.js +25 -0
  302. package/es/models/DynamicContentAttribute.d.ts +34 -0
  303. package/es/models/DynamicContentAttribute.js +9 -0
  304. package/es/models/EventTrackingAttribute.d.ts +11 -0
  305. package/es/models/EventTrackingAttribute.js +13 -0
  306. package/es/models/PromotionPool.d.ts +11 -0
  307. package/es/models/PromotionPool.js +12 -0
  308. package/es/models/{SavedImage.d.ts → SavedMedia.d.ts} +5 -5
  309. package/es/models/{SavedImage.js → SavedMedia.js} +3 -3
  310. package/es/queries/BusinessObject/index.d.ts +6 -0
  311. package/es/queries/BusinessObject/index.js +6 -0
  312. package/es/queries/BusinessObject/useGetListAllEvents.d.ts +11 -0
  313. package/es/queries/BusinessObject/useGetListAllEvents.js +14 -0
  314. package/es/queries/BusinessObject/useGetListAttributeBO.d.ts +17 -0
  315. package/es/queries/BusinessObject/useGetListAttributeBO.js +41 -0
  316. package/es/queries/BusinessObject/useGetListBO.d.ts +6 -0
  317. package/es/queries/BusinessObject/useGetListBO.js +19 -0
  318. package/es/queries/BusinessObject/useGetListEventAttr.d.ts +4 -0
  319. package/es/queries/BusinessObject/useGetListEventAttr.js +15 -0
  320. package/es/queries/BusinessObject/useGetListPromotionCodeAttr.d.ts +6 -0
  321. package/es/queries/BusinessObject/useGetListPromotionCodeAttr.js +26 -0
  322. package/es/queries/BusinessObject/useGetListSourceByEvent.d.ts +13 -0
  323. package/es/queries/BusinessObject/useGetListSourceByEvent.js +11 -0
  324. package/es/queries/CustomFunction/index.d.ts +2 -0
  325. package/es/queries/CustomFunction/index.js +2 -0
  326. package/es/queries/CustomFunction/useCustomFunction.d.ts +19 -0
  327. package/es/queries/CustomFunction/useCustomFunction.js +53 -0
  328. package/es/queries/DynamicContentAttribute/index.d.ts +1 -0
  329. package/es/queries/DynamicContentAttribute/index.js +1 -0
  330. package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.d.ts +10 -0
  331. package/es/queries/DynamicContentAttribute/useGetDynamicContentAttr.js +21 -0
  332. package/es/queries/PromotionPool/index.d.ts +1 -0
  333. package/es/queries/PromotionPool/index.js +1 -0
  334. package/es/queries/PromotionPool/useGetListPromotionPool.d.ts +9 -0
  335. package/es/queries/PromotionPool/useGetListPromotionPool.js +62 -0
  336. package/es/queries/ThirdParty/index.d.ts +1 -0
  337. package/es/queries/ThirdParty/index.js +1 -0
  338. package/es/queries/ThirdParty/useGetEventTrackingAttributes.d.ts +14 -0
  339. package/es/queries/ThirdParty/useGetEventTrackingAttributes.js +15 -0
  340. package/es/queries/configs.d.ts +4 -0
  341. package/es/queries/configs.js +13 -0
  342. package/es/queries/index.d.ts +6 -0
  343. package/es/queries/index.js +6 -0
  344. package/es/services/MediaTemplateDesign/BusinessObject/index.d.ts +8 -0
  345. package/es/services/MediaTemplateDesign/BusinessObject/index.js +100 -0
  346. package/es/services/MediaTemplateDesign/CustomFunction/index.d.ts +15 -0
  347. package/es/services/MediaTemplateDesign/CustomFunction/index.js +135 -0
  348. package/es/services/MediaTemplateDesign/DynamicContentAttribute/index.d.ts +4 -0
  349. package/es/services/MediaTemplateDesign/DynamicContentAttribute/index.js +39 -0
  350. package/es/services/MediaTemplateDesign/ListCurrency/index.d.ts +6 -0
  351. package/es/services/MediaTemplateDesign/ListCurrency/index.js +34 -0
  352. package/es/services/MediaTemplateDesign/PromotionPool/index.d.ts +3 -0
  353. package/es/services/MediaTemplateDesign/PromotionPool/index.js +31 -0
  354. package/es/services/MediaTemplateDesign/UploadFile/index.d.ts +5 -5
  355. package/es/services/MediaTemplateDesign/UploadFile/index.js +36 -19
  356. package/es/services/ThirParty/index.d.ts +8 -0
  357. package/es/services/ThirParty/index.js +26 -0
  358. package/es/services/index.d.ts +14 -5
  359. package/es/services/index.js +45 -1
  360. package/es/test.d.ts +2 -1
  361. package/es/test.js +201 -63
  362. package/es/types/index.d.ts +17 -0
  363. package/es/types/index.js +2 -1
  364. package/es/types/richMenu.d.ts +214 -0
  365. package/es/types/richMenu.js +1 -0
  366. package/es/types/variables.d.ts +2 -0
  367. package/es/types/variables.js +1 -0
  368. package/es/utils/common.d.ts +4 -0
  369. package/es/utils/common.js +21 -0
  370. package/es/utils/handleError.d.ts +32 -2
  371. package/es/utils/handleError.js +42 -4
  372. package/package.json +17 -8
package/es/test.js CHANGED
@@ -2,12 +2,9 @@
2
2
  import React, { useState } from 'react';
3
3
  import { createRoot } from 'react-dom/client';
4
4
  import '@antscorp/icons/main.css';
5
- import { ConfigProvider, EdgeSetting, GradientSetting, IconSelection, PositionSetting, SettingWrapper,
6
- // Slider,
7
- SliderWithInputNumber, Space, UploadImage, } from './components';
8
- // import { Slider } from 'antd';
9
- import { Slider } from '@antscorp/antsomi-ui/es/components/atoms/Slider';
10
- import { Rate } from './components/atoms/Rate';
5
+ import { ConfigProvider, InputDynamic, SettingWrapper, UploadImage, } from './components';
6
+ // Queries configs
7
+ import { queryClientAntsomiUI, QueryClientProviderAntsomiUI } from './queries';
11
8
  export const BACKGROUND_COLOR_STYLE = {
12
9
  SOLID: {
13
10
  value: 'color',
@@ -18,6 +15,7 @@ export const BACKGROUND_COLOR_STYLE = {
18
15
  label: 'Gradient',
19
16
  },
20
17
  };
18
+ const DOMAIN_MEDIA_SANDBOX = 'https://sandbox-media-template.antsomi.com/cdp';
21
19
  export const customColors = [
22
20
  '#f7da64',
23
21
  '#8912dd',
@@ -31,6 +29,8 @@ export const customColors = [
31
29
  '#57b8c2',
32
30
  ];
33
31
  export const App = () => {
32
+ // const [valueShortlink, setValueShortlink] = useState('#{shortlink(https://test.com.vn)}');
33
+ const [valueShortlink, setValueShortlink] = useState('');
34
34
  const [state, setState] = useState({
35
35
  option: {
36
36
  dateType: 'today',
@@ -49,6 +49,7 @@ export const App = () => {
49
49
  const [sliderValue, setSliderValue] = useState(10);
50
50
  const [edge, setEdge] = useState(['auto', 'auto', 700, 700]);
51
51
  const [icon, setIcon] = useState('');
52
+ console.log('valueShortlink :>', valueShortlink);
52
53
  const callbackColorSetting = (key, dataIn) => {
53
54
  switch (key) {
54
55
  case 'ON_ADD_NEW_PRESET':
@@ -78,75 +79,212 @@ export const App = () => {
78
79
  const handleSetIcon = value => {
79
80
  setIcon(value);
80
81
  };
81
- // ---------------------------- Test Helps Start ------------------------------
82
+ // ---------------------------- Test Input Dynamic start ------------------------------
82
83
  // return (
83
- // <div style={{ display: 'flex', justifyContent: 'center', width: '100vw', height: '100vh' }}>
84
- // <Help />
84
+ // <div
85
+ // style={{
86
+ // width: 500,
87
+ // height: 500,
88
+ // border: '1px solid black',
89
+ // margin: '0 auto',
90
+ // padding: 12,
91
+ // borderRadius: '10px',
92
+ // }}
93
+ // >
94
+ // <InputDynamic
95
+ // errors={[]}
96
+ // onChange={dataOut => setValueShortlink(dataOut)}
97
+ // onError={() => {}}
98
+ // isViewMode={false}
99
+ // canMultipleLine={false}
100
+ // value={valueShortlink}
101
+ // />
85
102
  // </div>
86
103
  // );
87
- // ---------------------------- Test Helps End ------------------------------
88
- // ------------------------ Media template components test start -------------------------
89
- return (React.createElement(ConfigProvider, null,
104
+ return (React.createElement(QueryClientProviderAntsomiUI, { client: queryClientAntsomiUI },
90
105
  React.createElement("div", { style: {
91
106
  width: 500,
92
- height: 1000,
107
+ height: 500,
93
108
  border: '1px solid black',
94
109
  margin: '0 auto',
95
110
  padding: 12,
96
111
  borderRadius: '10px',
97
- marginTop: 12,
98
112
  } },
99
- React.createElement("h2", { style: { textAlign: 'center' } }, "Test component of media template"),
100
- React.createElement(Space, { size: 20, direction: "vertical" },
101
- React.createElement(SettingWrapper, { vertical: true, label: "Color Setting" },
102
- React.createElement(GradientSetting, null)),
103
- React.createElement(SliderWithInputNumber, { label: "Size (px)", labelStyling: { marginTop: 10 }, min: 0, max: 100, value: sliderValue, onAfterChange: handleChangeSlider }),
104
- React.createElement(EdgeSetting, { label: "Notification Spacing", unit: "px", linked: false, values: edge,
105
- // edgeLabels={[t(translations.column.title), t(translations.row.title)]}
106
- onChange: ({ values, linked, unit }) => {
107
- setEdge(values);
108
- // onUpdateSettings({
109
- // gapX: values[0] + unit,
110
- // gapY: values[1] + unit,
111
- // gapSuffix: unit,
112
- // linkedGapInput: linked,
113
+ React.createElement(InputDynamic, { errors: [], onChange: dataOut => setValueShortlink(dataOut), onError: () => { }, isViewMode: false, canMultipleLine: false, allowDynamicOptions: ['addPersonalization', 'shortlink'], value: valueShortlink }),
114
+ React.createElement(SettingWrapper, { vertical: true, label: "Background Image", containerStyle: { gap: '20px' } },
115
+ React.createElement(UploadImage, { domainMedia: "https://sandbox-media-template.antsomi.com", slug: "cdp/api/v1", labelButtonSelect: "Select Toggle from Computor", labelHeadingModal: "Toggle Selection", searchPlaceholder: "Search toggle", paramConfigs: {
116
+ token: '5474r2x214z294b423a4y474d4j5q274p4g494f4k5p5',
117
+ userId: '1600084695',
118
+ accountId: '1600084695',
119
+ },
120
+ // title="Background Image"
121
+ selectedImage: {
122
+ url: 'https://th.bing.com/th?id=OSK.8664d1b5838c79a3d74a3e97739978b5&w=148&h=148&c=7&o=6&dpr=2&pid=SANGAM',
123
+ }, onChangeImage: image => { }, onRemoveImage: () => {
124
+ // onChangeSettings('backgroundImageObj', {
125
+ // name: '',
126
+ // previewUrl: '',
113
127
  // });
114
- } }),
115
- React.createElement(PositionSetting, { settings: { linkedPositionInput: false, positionSuffix: 'px' }, styles: { top: '10px', right: '20px', bottom: '30', left: '40' }, onChange: () => { } })),
116
- React.createElement(Space, { size: 10, direction: "vertical" },
117
- React.createElement(SettingWrapper, { vertical: true, label: "Background Image", containerStyle: { gap: '20px' } },
118
- React.createElement(UploadImage, { domainMedia: "https://sandbox-media-template.antsomi.com", slug: "cdp/api/v1", labelButtonSelect: "Select Toggle from Computor", labelHeadingModal: "Toggle Selection", searchPlaceholder: "Search toggle", paramConfigs: {
119
- token: '5474r2x214z294b423a4y474d4j5q274p4g494f4k5p5',
120
- userId: '1600084695',
121
- accountId: '1600084695',
122
- },
123
- // title="Background Image"
124
- selectedImage: {
125
- url: 'https://th.bing.com/th?id=OSK.8664d1b5838c79a3d74a3e97739978b5&w=148&h=148&c=7&o=6&dpr=2&pid=SANGAM',
126
- }, onChangeImage: image => { }, onRemoveImage: () => {
127
- // onChangeSettings('backgroundImageObj', {
128
- // name: '',
129
- // previewUrl: '',
130
- // });
131
- } })),
132
- React.createElement(SettingWrapper, { vertical: true, label: "Icon" },
133
- React.createElement(IconSelection, { isOpen: false, labelHeadingModal: "Toggle Selection", searchPlaceholder: "Search for toggle...", icon: icon, onChange: handleSetIcon, iconTypes: ['cus', 'font-awesome'], onChangeSvg: value => {
134
- console.log('onChangeSvg', value);
135
- } }))))));
128
+ } })))));
129
+ // ---------------------------- Test Input Dynamic End ------------------------------
130
+ // ---------------------------- Test Helps Start ------------------------------
131
+ // return (
132
+ // <div style={{ display: 'flex', justifyContent: 'center', width: '100vw', height: '100vh' }}>
133
+ // <Help />
134
+ // </div>
135
+ // );
136
+ // ---------------------------- Test Helps End ------------------------------
137
+ // ------------------------ Media template components test start -------------------------
138
+ // return (
139
+ // <ConfigProvider>
140
+ // <div
141
+ // style={{
142
+ // width: 500,
143
+ // height: 1000,
144
+ // border: '1px solid black',
145
+ // margin: '0 auto',
146
+ // padding: 12,
147
+ // borderRadius: '10px',
148
+ // marginTop: 12,
149
+ // }}
150
+ // >
151
+ // <h2 style={{ textAlign: 'center' }}>Test component of media template</h2>
152
+ // <Space size={20} direction="vertical">
153
+ // {/* <SettingWrapper vertical label="Color Setting">
154
+ // <ColorSetting
155
+ // label="Background Color"
156
+ // labelStyling={{ color: THEME.token?.colorIcon }}
157
+ // color={colorSettingState.color}
158
+ // customColors={colorSettingState.customColors}
159
+ // callback={callbackColorSetting}
160
+ // onChange={handleChangeColorSetting}
161
+ // />
162
+ // </SettingWrapper>
163
+ // <SettingWrapper vertical label="Input number with unit">
164
+ // <InputNumberWithUnit
165
+ // unit="px"
166
+ // min={0}
167
+ // max={2000}
168
+ // value={700}
169
+ // onChange={value => {
170
+ // console.log('onChange:: ', value);
171
+ // }}
172
+ // onChangeUnit={unit => {
173
+ // console.log('onChangeUnit:: ', unit);
174
+ // }}
175
+ // />
176
+ // </SettingWrapper>
177
+ // <SettingWrapper label="Radio Group">
178
+ // <RadioGroup
179
+ // options={Object.values(BACKGROUND_COLOR_STYLE)}
180
+ // value={radioValue}
181
+ // onChange={e => handleChangeRadio(e)}
182
+ // />
183
+ // </SettingWrapper> */}
184
+ // <SettingWrapper vertical label="Color Setting">
185
+ // <GradientSetting />
186
+ // </SettingWrapper>
187
+ // <SliderWithInputNumber
188
+ // label="Size (px)"
189
+ // labelStyling={{ marginTop: 10 }}
190
+ // min={0}
191
+ // max={100}
192
+ // value={sliderValue}
193
+ // onAfterChange={handleChangeSlider}
194
+ // />
195
+ // <EdgeSetting
196
+ // label="Notification Spacing"
197
+ // unit="px"
198
+ // linked={false}
199
+ // values={edge}
200
+ // // edgeLabels={[t(translations.column.title), t(translations.row.title)]}
201
+ // onChange={({ values, linked, unit }) => {
202
+ // setEdge(values);
203
+ // // onUpdateSettings({
204
+ // // gapX: values[0] + unit,
205
+ // // gapY: values[1] + unit,
206
+ // // gapSuffix: unit,
207
+ // // linkedGapInput: linked,
208
+ // // });
209
+ // }}
210
+ // />
211
+ // <PositionSetting
212
+ // settings={{ linkedPositionInput: false, positionSuffix: 'px' }}
213
+ // styles={{ top: '10px', right: '20px', bottom: '30', left: '40' }}
214
+ // onChange={() => {}}
215
+ // />
216
+ // </Space>
217
+ // <Space size={10} direction="vertical">
218
+ // <SettingWrapper vertical label="Background Image" containerStyle={{ gap: '20px' }}>
219
+ // <UploadImage
220
+ // domainMedia="https://sandbox-media-template.antsomi.com"
221
+ // slug="cdp/api/v1"
222
+ // labelButtonSelect="Select Toggle from Computor"
223
+ // labelHeadingModal="Toggle Selection"
224
+ // searchPlaceholder="Search toggle"
225
+ // paramConfigs={{
226
+ // token: '5474r2x214z294b423a4y474d4j5q274p4g494f4k5p5',
227
+ // userId: '1600084695',
228
+ // accountId: '1600084695',
229
+ // }}
230
+ // // title="Background Image"
231
+ // selectedImage={{
232
+ // url: 'https://th.bing.com/th?id=OSK.8664d1b5838c79a3d74a3e97739978b5&w=148&h=148&c=7&o=6&dpr=2&pid=SANGAM',
233
+ // }}
234
+ // onChangeImage={image =>
235
+ // // onChangeSettings('backgroundImageObj', {
236
+ // // name: image.name,
237
+ // // previewUrl: image.url,
238
+ // // })
239
+ // {}
240
+ // }
241
+ // onRemoveImage={() => {
242
+ // // onChangeSettings('backgroundImageObj', {
243
+ // // name: '',
244
+ // // previewUrl: '',
245
+ // // });
246
+ // }}
247
+ // />
248
+ // </SettingWrapper>
249
+ // <SettingWrapper vertical label="Icon">
250
+ // <IconSelection
251
+ // isOpen={false}
252
+ // labelHeadingModal="Toggle Selection"
253
+ // searchPlaceholder="Search for toggle..."
254
+ // icon={icon}
255
+ // onChange={handleSetIcon}
256
+ // iconTypes={['cus', 'font-awesome']}
257
+ // onChangeSvg={value => {
258
+ // console.log('onChangeSvg', value);
259
+ // }}
260
+ // />
261
+ // </SettingWrapper>
262
+ // </Space>
263
+ // </div>
264
+ // </ConfigProvider>
265
+ // );
136
266
  // ------------------------ Media template components test end -------------------------
137
- return (React.createElement("div", { style: { width: '500px', margin: '32px' } },
138
- React.createElement(GradientSetting, { onChange: e => console.log('gradient change') }),
139
- React.createElement("br", null),
140
- React.createElement("br", null),
141
- React.createElement("br", null),
142
- React.createElement("br", null),
143
- React.createElement(Slider, { className: "test-classname", min: -10, max: 10, onChange: e => console.log('slider change', e) }),
144
- React.createElement("br", null),
145
- React.createElement("br", null),
146
- React.createElement(Rate, null),
147
- React.createElement("br", null),
148
- React.createElement("br", null),
149
- React.createElement(Slider, { className: "test-classname" })));
267
+ // return (
268
+ // <div style={{ width: '500px', margin: '32px' }}>
269
+ // <GradientSetting onChange={e => console.log('gradient change')} />
270
+ // <br />
271
+ // <br />
272
+ // <br />
273
+ // <br />
274
+ // <Slider
275
+ // className="test-classname"
276
+ // min={-10}
277
+ // max={10}
278
+ // onChange={e => console.log('slider change', e)}
279
+ // />
280
+ // <br />
281
+ // <br />
282
+ // <Rate />
283
+ // <br />
284
+ // <br />
285
+ // <Slider className="test-classname" />
286
+ // </div>
287
+ // );
150
288
  };
151
289
  const container = document.getElementById('root');
152
290
  const root = createRoot(container);
@@ -4,3 +4,20 @@ export type THandleErrorPayload = {
4
4
  args: Record<string, any>;
5
5
  };
6
6
  export type TLocale = 'en' | 'vi';
7
+ export type GenericFunction = (...args: any[]) => any;
8
+ export type TConfigErrorInfo = {
9
+ [key: string]: any;
10
+ path?: string;
11
+ action?: string;
12
+ name?: string;
13
+ args?: any;
14
+ priority?: 'low' | 'medium' | 'high';
15
+ from?: 'try-catch' | 'error-boundary';
16
+ };
17
+ export type PayloadInfo = {
18
+ userId?: string;
19
+ token?: string;
20
+ accountId?: string;
21
+ };
22
+ export * from './richMenu';
23
+ export * from './variables';
package/es/types/index.js CHANGED
@@ -1 +1,2 @@
1
- export {};
1
+ export * from './richMenu';
2
+ export * from './variables';
@@ -0,0 +1,214 @@
1
+ /// <reference types="react" />
2
+ import { AREA_LAYOUT_KEYS, BLOCK_KEYS } from '../constants';
3
+ import { TAlign } from './variables';
4
+ export type TImageStyles = {
5
+ borderTopLeftRadius: string;
6
+ borderTopRightRadius: string;
7
+ borderBottomRightRadius: string;
8
+ borderBottomLeftRadius: string;
9
+ borderTopWidth: string;
10
+ borderRightWidth: string;
11
+ borderBottomWidth: string;
12
+ borderLeftWidth: string;
13
+ borderStyle: string;
14
+ borderColor: string;
15
+ boxShadow: string;
16
+ opacity: number;
17
+ width: string;
18
+ height: string;
19
+ objectPosition: string;
20
+ objectFit: string;
21
+ paddingTop: string;
22
+ paddingRight: string;
23
+ paddingBottom: string;
24
+ paddingLeft: string;
25
+ };
26
+ export type TImageSettings = {
27
+ borderRadiusStyle: string;
28
+ borderRadiusSuffix: string;
29
+ linkedBorderRadiusInput: boolean;
30
+ linkedBorderWidthInput: boolean;
31
+ linkedPaddingInput: boolean;
32
+ paddingSuffix: string;
33
+ boxShadowStyle: string;
34
+ boxShadowColor: string;
35
+ boxShadowBlur: string;
36
+ boxShadowSpread: string;
37
+ boxShadowHorizontal: string;
38
+ boxShadowVertical: string;
39
+ boxShadowInset: boolean;
40
+ widthSuffix: string;
41
+ heightSuffix: string;
42
+ };
43
+ export type TOuterContainerStyles = {
44
+ textAlign: TAlign;
45
+ };
46
+ export type TAreaStyles = React.CSSProperties;
47
+ export type TAreaStylesSettings = {
48
+ borderRadiusStyle: string;
49
+ borderRadiusSuffix: string;
50
+ linkedBorderRadiusInput: boolean;
51
+ linkedBorderWidthInput: boolean;
52
+ linkedPaddingInput: boolean;
53
+ paddingSuffix: string;
54
+ linkedMarginInput: boolean;
55
+ marginSuffix: string;
56
+ boxShadowStyle: string;
57
+ boxShadowColor: string;
58
+ boxShadowBlur: string;
59
+ boxShadowSpread: string;
60
+ boxShadowHorizontal: string;
61
+ boxShadowVertical: string;
62
+ boxShadowInset: boolean;
63
+ backgroundColor: string;
64
+ backgroundColorStyle: string;
65
+ backgroundPosition: string;
66
+ backgroundRepeat: string;
67
+ backgroundSize: string;
68
+ gradientType: string;
69
+ radialPosition: string;
70
+ linearAngle: number;
71
+ gradients: {
72
+ gradientColor: string;
73
+ gradientColorLocation: number;
74
+ }[];
75
+ };
76
+ export type TRichMenuMode = 'single' | 'multiple';
77
+ export type TUPloadMode = 'single' | 'multiple';
78
+ export type TAreaLayoutType = 'large' | 'compact';
79
+ export type TActionType = 'none' | 'message' | 'uri' | 'postback' | 'richmenuswitch' | 'datetimepicker';
80
+ export type TImage = {
81
+ imageUrl: string;
82
+ imageStyles: TImageStyles;
83
+ imageSettings: TImageSettings;
84
+ };
85
+ export type AreaLayoutKey = (typeof AREA_LAYOUT_KEYS)[keyof typeof AREA_LAYOUT_KEYS];
86
+ export type BlockKey = (typeof BLOCK_KEYS)[keyof typeof BLOCK_KEYS];
87
+ export type TActionMessageSettings = {
88
+ text: string;
89
+ };
90
+ export type TActionUriSettings = {
91
+ uriType: 'url' | 'tel';
92
+ uri: string | number;
93
+ };
94
+ export type TActionUrlSettings = {
95
+ url: string;
96
+ };
97
+ export type TActionVideoSettings = {
98
+ videoUrl: string;
99
+ previewImage: string;
100
+ isAddLabel: false;
101
+ } | {
102
+ videoUrl: string;
103
+ previewImage: string;
104
+ isAddLabel: true;
105
+ label: string;
106
+ externalUrl: string;
107
+ };
108
+ export type TActionPostbackSettings = {
109
+ data: string | number;
110
+ };
111
+ export type TActionRichmenuSwitchSettings = {
112
+ richMenuAliasId: string | number;
113
+ data: string | number;
114
+ };
115
+ export type TActionDateTimePickerSettings = {
116
+ data: string;
117
+ mode: 'date' | 'time' | 'datetime';
118
+ min: string | {
119
+ date: string;
120
+ time: string;
121
+ };
122
+ max: string | {
123
+ date: string;
124
+ time: string;
125
+ };
126
+ initial: string | {
127
+ date: string;
128
+ time: string;
129
+ };
130
+ };
131
+ export type TAction = {
132
+ type: 'none';
133
+ } | ({
134
+ type: 'message';
135
+ } & TActionMessageSettings) | ({
136
+ type: 'uri';
137
+ } & TActionUriSettings) | ({
138
+ type: 'postback';
139
+ } & TActionPostbackSettings) | ({
140
+ type: 'richmenuswitch';
141
+ } & TActionRichmenuSwitchSettings) | ({
142
+ type: 'datetimepicker';
143
+ } & TActionDateTimePickerSettings);
144
+ export type TActionImageMap = {
145
+ type: 'none';
146
+ } | ({
147
+ type: 'message';
148
+ } & TActionMessageSettings) | ({
149
+ type: 'url';
150
+ } & TActionUrlSettings) | ({
151
+ type: 'video';
152
+ } & TActionVideoSettings);
153
+ export type CellArea = {
154
+ bounds: CellBounds;
155
+ action: TAction;
156
+ };
157
+ export interface RichMenuSettings {
158
+ size: {
159
+ width: number;
160
+ height: number;
161
+ };
162
+ selected: boolean;
163
+ name: string;
164
+ chatBarText: string;
165
+ areas: CellArea[];
166
+ }
167
+ export interface RichMenu {
168
+ id: number | string;
169
+ menuName?: string;
170
+ aliasId?: number | string;
171
+ isDefault: boolean;
172
+ rows: number;
173
+ cols: number;
174
+ cells: TChildrenCell[];
175
+ areaLayoutId?: AreaLayoutKey;
176
+ gridTemplateRows: (number | string)[];
177
+ gridTemplateCols: (number | string)[];
178
+ layoutType: TAreaLayoutType;
179
+ uploadMode: TUPloadMode;
180
+ image: TImage;
181
+ chatBar: {
182
+ label: string;
183
+ displayDefault: boolean;
184
+ };
185
+ settings?: RichMenuSettings;
186
+ }
187
+ export type CellBounds = {
188
+ x: number;
189
+ y: number;
190
+ width: number;
191
+ height: number;
192
+ };
193
+ export interface RichMenuTemplate {
194
+ name: string;
195
+ id: number | string;
196
+ mode: TRichMenuMode;
197
+ richMenus: RichMenu[];
198
+ }
199
+ export type TChildrenCell = {
200
+ rowStart: number;
201
+ colStart: number;
202
+ rowEnd: number;
203
+ colEnd: number;
204
+ width?: number;
205
+ height?: number;
206
+ x?: number;
207
+ y?: number;
208
+ action?: TAction | TActionImageMap;
209
+ image: TImage;
210
+ outerContainerStyles: TOuterContainerStyles;
211
+ areaStyles: TAreaStyles;
212
+ areaStylesSettings: TAreaStylesSettings;
213
+ active?: boolean;
214
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export type TUnit = 'px' | '%' | any;
2
+ export type TAlign = 'left' | 'center' | 'right';
@@ -0,0 +1 @@
1
+ export {};
@@ -7,6 +7,8 @@
7
7
  */
8
8
  export declare const reorder: (list: Array<Record<string, unknown> | string | number>, startIndex: number, endIndex: number) => any[];
9
9
  export declare const safeParse: (val: any, defaultVal: any) => any;
10
+ export declare const getObjectPropSafely: (fn: any, defaultValue?: string) => any;
11
+ export declare const random: (number: any) => string;
10
12
  export declare function getPortalId(config: any): any;
11
13
  export declare const safeParseInt: (val: any, defaultVal: any) => any;
12
14
  export declare function isUrlEmbedded(): boolean;
@@ -45,9 +47,11 @@ export declare function getEntriesV2(res: any, def: any): {
45
47
  messageAPI?: undefined;
46
48
  };
47
49
  export declare const getNumberFromString: (str: string) => number;
50
+ export declare const isEmail: (email: string) => boolean;
48
51
  /**
49
52
  * Maps a number to its corresponding ordinal text representation.
50
53
  * @param {number} num - The number to be mapped.
51
54
  * @return {string} The ordinal text representation of the number.
52
55
  */
53
56
  export declare function mapNumberToOrdinalText(num: number): string;
57
+ export declare const searchParamsToObject: (searchParams?: string) => Record<string, unknown>;
@@ -26,6 +26,22 @@ export const safeParse = (val, defaultVal) => {
26
26
  }
27
27
  return val;
28
28
  };
29
+ export const getObjectPropSafely = (fn, defaultValue = '') => {
30
+ try {
31
+ return fn();
32
+ }
33
+ catch (e) {
34
+ return defaultValue;
35
+ }
36
+ };
37
+ export const random = number => {
38
+ let text = '';
39
+ const possible = 'abcdefghijklmnopqrstuvwxyz0123456789';
40
+ for (let i = 0; i < number; i++) {
41
+ text += possible.charAt(Math.floor(Math.random() * possible.length));
42
+ }
43
+ return text;
44
+ };
29
45
  export function getPortalId(config) {
30
46
  const portalId = safeParse(getSessionStorage('api_pid', config), 0);
31
47
  if (portalId === 0) {
@@ -320,6 +336,10 @@ export const getNumberFromString = (str) => {
320
336
  return 0;
321
337
  }
322
338
  };
339
+ export const isEmail = (email) => {
340
+ const emailRegex = /^[A-Za-z0-9_!#$%&'*+\/=?`{|}~^.-]+@[A-Za-z0-9.-]+$/gm;
341
+ return emailRegex.test(email);
342
+ };
323
343
  /**
324
344
  * Maps a number to its corresponding ordinal text representation.
325
345
  * @param {number} num - The number to be mapped.
@@ -353,3 +373,4 @@ export function mapNumberToOrdinalText(num) {
353
373
  return '';
354
374
  }
355
375
  }
376
+ export const searchParamsToObject = (searchParams = '') => Object.fromEntries(new URLSearchParams(searchParams));
@@ -1,2 +1,32 @@
1
- import { THandleErrorPayload } from '@antscorp/antsomi-ui/es/types';
2
- export declare const handleError: (error: any, payload: THandleErrorPayload) => void;
1
+ import { GenericFunction, TConfigErrorInfo } from '@antscorp/antsomi-ui/es/types';
2
+ export declare const handleError: (error?: any, configInfo?: TConfigErrorInfo, isShowMessageError?: boolean) => Promise<void>;
3
+ type TryCatchWrapper<F extends GenericFunction> = (...args: Parameters<F>) => ReturnType<F>;
4
+ /**
5
+ * @param func callback function need to try-catch
6
+ * @param path relative path of current file that func execute
7
+ * @returns func(args:? any[])
8
+ * @example
9
+ * ```
10
+ * function handler(argument: string) {
11
+ * console.log(argument)
12
+ * }
13
+ *
14
+ * tryCatchWrapper(handler, PATH)('this string will be log to console');
15
+ * ```
16
+ */
17
+ export declare function tryCatchWrapper<F extends GenericFunction>(func: F, path: string): TryCatchWrapper<F>;
18
+ /**
19
+ * @param func callback function need to try-catch
20
+ * @param options options config for handleError function
21
+ * @returns func(args:? any[])
22
+ * @example
23
+ * ```
24
+ * function handler(argument: string) {
25
+ * console.log(argument)
26
+ * }
27
+ *
28
+ * tryCatchWrapper(handler, PATH)('this string will be log to console');
29
+ * ```
30
+ */
31
+ export declare function tryCatchWrapper<F extends GenericFunction>(func: F, options: TConfigErrorInfo): TryCatchWrapper<F>;
32
+ export {};