@antscorp/antsomi-ui 1.3.5-beta.7 → 1.3.5-beta.71

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 (327) hide show
  1. package/es/assets/images/background/skeleton-background.png +0 -0
  2. package/es/assets/images/components/PreviewModal/Banner/skeletonBackground.png +0 -0
  3. package/es/assets/images/components/PreviewModal/Information/buttonText.png +0 -0
  4. package/es/assets/images/components/PreviewModal/Information/clickButton.png +0 -0
  5. package/es/assets/images/components/PreviewModal/Information/description.png +0 -0
  6. package/es/assets/images/components/PreviewModal/Information/deviceRadio.png +0 -0
  7. package/es/assets/images/components/PreviewModal/Information/itemName.png +0 -0
  8. package/es/assets/images/components/PreviewModal/banner.png +0 -0
  9. package/es/assets/images/components/PreviewModal/information.png +0 -0
  10. package/es/assets/images/components/PreviewModal/similarTemplate.png +0 -0
  11. package/es/assets/images/components/PreviewModal/thumbnails.png +0 -0
  12. package/es/assets/images/components/TemplateListing/blankTemplate.png +0 -0
  13. package/es/assets/images/components/TemplateListing/categoryListing.png +0 -0
  14. package/es/assets/images/components/TemplateListing/empty.png +0 -0
  15. package/es/assets/images/components/TemplateListing/previewModal.png +0 -0
  16. package/es/assets/images/components/TemplateListing/templateItem.png +0 -0
  17. package/es/assets/images/components/TemplateListing/templates.png +0 -0
  18. package/es/assets/images/profile.png +0 -0
  19. package/es/assets/images/skeleton_bg.png +0 -0
  20. package/es/assets/images/tail.png +0 -0
  21. package/es/assets/svg/mobile-frame.svg +3 -0
  22. package/es/components/atoms/MobileFrame/MobileFrame.d.ts +2 -0
  23. package/es/components/atoms/MobileFrame/MobileFrame.js +1 -1
  24. package/es/components/atoms/MobileFrame/styled.d.ts +2 -1
  25. package/es/components/atoms/MobileFrame/styled.js +11 -6
  26. package/es/components/atoms/SlideBar/SlideBar.js +1 -1
  27. package/es/components/atoms/Spin/Spin.js +2 -2
  28. package/es/components/common/ConfigProvider/ConfigProvider.js +4 -3
  29. package/es/components/common/ConfigProvider/GlobalStyle.js +85 -16
  30. package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +3 -2
  31. package/es/components/molecules/CalendarSelection/CalendarSelection.d.ts +3 -0
  32. package/es/components/molecules/CalendarSelection/CalendarSelection.js +45 -0
  33. package/es/components/molecules/CalendarSelection/actions.d.ts +55 -0
  34. package/es/components/molecules/CalendarSelection/actions.js +39 -0
  35. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.d.ts +7 -0
  36. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/AutoUpdateTo.js +24 -0
  37. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.d.ts +1 -0
  38. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/index.js +1 -0
  39. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.d.ts +1 -0
  40. package/es/components/molecules/CalendarSelection/components/AutoUpdateTo/styled.js +10 -0
  41. package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.d.ts +3 -0
  42. package/es/components/molecules/CalendarSelection/components/CustomPicker/CustomPicker.js +108 -0
  43. package/es/components/molecules/CalendarSelection/components/CustomPicker/index.d.ts +1 -0
  44. package/es/components/molecules/CalendarSelection/components/CustomPicker/index.js +1 -0
  45. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.d.ts +6 -0
  46. package/es/components/molecules/CalendarSelection/components/CustomPicker/styled.js +152 -0
  47. package/es/components/molecules/CalendarSelection/components/CustomPicker/types.d.ts +1 -0
  48. package/es/components/molecules/CalendarSelection/components/CustomPicker/types.js +1 -0
  49. package/es/components/molecules/CalendarSelection/components/Footer/Footer.d.ts +2 -0
  50. package/es/components/molecules/CalendarSelection/components/Footer/Footer.js +11 -0
  51. package/es/components/molecules/CalendarSelection/components/Footer/index.d.ts +1 -0
  52. package/es/components/molecules/CalendarSelection/components/Footer/index.js +1 -0
  53. package/es/components/molecules/CalendarSelection/components/Footer/styled.d.ts +1 -0
  54. package/es/components/molecules/CalendarSelection/components/Footer/styled.js +6 -0
  55. package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.d.ts +5 -0
  56. package/es/components/molecules/CalendarSelection/components/RangePicker/RangePicker.js +4 -0
  57. package/es/components/molecules/CalendarSelection/components/RangePicker/index.d.ts +1 -0
  58. package/es/components/molecules/CalendarSelection/components/RangePicker/index.js +1 -0
  59. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.d.ts +5 -0
  60. package/es/components/molecules/CalendarSelection/components/RangePicker/styled.js +13 -0
  61. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.d.ts +3 -0
  62. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/RangeSelectOptions.js +23 -0
  63. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.d.ts +2 -0
  64. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/NumOfDaysRanges.js +41 -0
  65. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.d.ts +1 -0
  66. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/NumOfDaysRanges/index.js +1 -0
  67. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.d.ts +11 -0
  68. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/Option.js +40 -0
  69. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.d.ts +1 -0
  70. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/index.js +1 -0
  71. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.d.ts +1 -0
  72. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/Option/styled.js +29 -0
  73. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.d.ts +2 -0
  74. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/components/index.js +2 -0
  75. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.d.ts +1 -0
  76. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/index.js +1 -0
  77. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.d.ts +3 -0
  78. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/styled.js +34 -0
  79. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.d.ts +1 -0
  80. package/es/components/molecules/CalendarSelection/components/RangeSelectOptions/types.js +1 -0
  81. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.d.ts +8 -0
  82. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/TimeRangeDisplay.js +49 -0
  83. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.d.ts +2 -0
  84. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/index.js +2 -0
  85. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.d.ts +1 -0
  86. package/es/components/molecules/CalendarSelection/components/TimeRangeDisplay/styled.js +70 -0
  87. package/es/components/molecules/CalendarSelection/components/index.d.ts +5 -0
  88. package/es/components/molecules/CalendarSelection/components/index.js +5 -0
  89. package/es/components/molecules/CalendarSelection/constants.d.ts +97 -0
  90. package/es/components/molecules/CalendarSelection/constants.js +183 -0
  91. package/es/components/molecules/CalendarSelection/context.d.ts +4 -0
  92. package/es/components/molecules/CalendarSelection/context.js +6 -0
  93. package/es/components/molecules/CalendarSelection/hooks/index.d.ts +2 -0
  94. package/es/components/molecules/CalendarSelection/hooks/index.js +2 -0
  95. package/es/components/molecules/CalendarSelection/hooks/useStateContext.d.ts +4 -0
  96. package/es/components/molecules/CalendarSelection/hooks/useStateContext.js +13 -0
  97. package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.d.ts +9 -0
  98. package/es/components/molecules/CalendarSelection/hooks/useTriggerOut.js +19 -0
  99. package/es/components/molecules/CalendarSelection/index.d.ts +25 -0
  100. package/es/components/molecules/CalendarSelection/index.js +6 -0
  101. package/es/components/molecules/CalendarSelection/reducer.d.ts +3 -0
  102. package/es/components/molecules/CalendarSelection/reducer.js +121 -0
  103. package/es/components/molecules/CalendarSelection/styled.d.ts +6 -0
  104. package/es/components/molecules/CalendarSelection/styled.js +13 -0
  105. package/es/components/molecules/CalendarSelection/types.d.ts +98 -0
  106. package/es/components/molecules/CalendarSelection/types.js +1 -0
  107. package/es/components/molecules/CalendarSelection/utils.d.ts +52 -0
  108. package/es/components/molecules/CalendarSelection/utils.js +304 -0
  109. package/es/components/molecules/ColorPicker/CustomPicker/index.js +3 -3
  110. package/es/components/molecules/ColorPicker/index.d.ts +1 -0
  111. package/es/components/molecules/ColorPicker/index.js +3 -2
  112. package/es/components/molecules/DatePicker/components/AdvancedPicker/AdvancedPicker.js +20 -16
  113. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.d.ts +3 -0
  114. package/es/components/molecules/DatePicker/components/AdvancedPicker/styled.js +23 -0
  115. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.d.ts +1 -1
  116. package/es/components/molecules/DatePicker/components/AdvancedPicker/utils.js +2 -2
  117. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.d.ts +1 -0
  118. package/es/components/molecules/DatePicker/components/AdvancedRangePicker/AdvancedRangePicker.js +3 -3
  119. package/es/components/molecules/DatePicker/components/DropdownLabel/DropdownLabel.js +2 -2
  120. package/es/components/molecules/ModalV2/styled.js +4 -0
  121. package/es/components/molecules/ResizeGrid/ResizeGrid.js +10 -2
  122. package/es/components/molecules/ResizeGrid/types.d.ts +1 -0
  123. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.d.ts +1 -0
  124. package/es/components/molecules/RichMenu/RichMenuBlock/RichMenuBlock.js +2 -2
  125. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.d.ts +1 -0
  126. package/es/components/molecules/RichMenu/RichMenuChatBar/RichMenuChatBar.js +4 -3
  127. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.d.ts +1 -0
  128. package/es/components/molecules/RichMenu/RichMenuChatBar/styled.js +1 -1
  129. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.d.ts +7 -0
  130. package/es/components/molecules/RichMenu/RichMenuMobileView/RichMenuMobileView.js +25 -6
  131. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.d.ts +5 -0
  132. package/es/components/molecules/RichMenu/RichMenuMobileView/styled.js +31 -0
  133. package/es/components/molecules/ShareAccess/components/GeneralAccess/GeneralAccess.js +2 -2
  134. package/es/components/molecules/ShareAccess/components/GeneralAccess/styled.js +1 -0
  135. package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +2 -2
  136. package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +1 -1
  137. package/es/components/molecules/ShareAccess/index.d.ts +2 -3
  138. package/es/components/molecules/ShareAccess/index.js +2 -3
  139. package/es/components/molecules/ShareAccess/types.d.ts +2 -0
  140. package/es/components/molecules/ShareAccess/utils.d.ts +2 -1
  141. package/es/components/molecules/ShareAccess/utils.js +9 -0
  142. package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.d.ts +79 -0
  143. package/es/components/molecules/TemplateSaveAs/TemplateSaveAs.js +184 -0
  144. package/es/components/molecules/TemplateSaveAs/TemplateSaveAsModal.d.ts +10 -0
  145. package/es/components/molecules/TemplateSaveAs/TemplateSaveAsModal.js +50 -0
  146. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/ImageSlider.d.ts +20 -0
  147. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/ImageSlider.js +57 -0
  148. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/index.d.ts +1 -0
  149. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/index.js +1 -0
  150. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.d.ts +9 -0
  151. package/es/components/molecules/TemplateSaveAs/components/ImageSlider/styled.js +182 -0
  152. package/es/components/molecules/TemplateSaveAs/components/index.d.ts +1 -0
  153. package/es/components/molecules/TemplateSaveAs/components/index.js +1 -0
  154. package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.d.ts +65 -0
  155. package/es/components/molecules/TemplateSaveAs/hooks/useTemplateSave.js +121 -0
  156. package/es/components/molecules/TemplateSaveAs/index.d.ts +4 -0
  157. package/es/components/molecules/TemplateSaveAs/index.js +3 -0
  158. package/es/components/molecules/TemplateSaveAs/styled.d.ts +4 -0
  159. package/es/components/molecules/TemplateSaveAs/styled.js +73 -0
  160. package/es/components/molecules/ThumbnailCard/ThumbnailCard.js +29 -13
  161. package/es/components/molecules/ThumbnailCard/constants.d.ts +2 -2
  162. package/es/components/molecules/ThumbnailCard/constants.js +2 -2
  163. package/es/components/molecules/ThumbnailCard/styled.js +2 -1
  164. package/es/components/molecules/ThumbnailCard/types.d.ts +12 -6
  165. package/es/components/molecules/UploadImage/index.js +1 -1
  166. package/es/components/molecules/index.d.ts +3 -0
  167. package/es/components/molecules/index.js +2 -0
  168. package/es/components/organism/Help/Help.js +30 -1
  169. package/es/components/organism/Menu/Menu.d.ts +2 -0
  170. package/es/components/organism/Menu/Menu.js +2 -0
  171. package/es/components/organism/Menu/index.d.ts +1 -0
  172. package/es/components/organism/Menu/index.js +1 -0
  173. package/es/components/organism/PreviewTemplateModal/components/Banner/index.d.ts +3 -0
  174. package/es/components/organism/PreviewTemplateModal/components/Banner/index.js +13 -0
  175. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.d.ts +4 -0
  176. package/es/components/organism/PreviewTemplateModal/components/Banner/styled.js +98 -0
  177. package/es/components/organism/PreviewTemplateModal/components/Information/index.d.ts +3 -0
  178. package/es/components/organism/PreviewTemplateModal/components/Information/index.js +29 -0
  179. package/es/components/organism/PreviewTemplateModal/components/Information/styled.d.ts +2 -0
  180. package/es/components/organism/PreviewTemplateModal/components/Information/styled.js +41 -0
  181. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.d.ts +3 -0
  182. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/index.js +32 -0
  183. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.d.ts +2 -0
  184. package/es/components/organism/PreviewTemplateModal/components/SimilarTemplate/styled.js +12 -0
  185. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.d.ts +6 -0
  186. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/index.js +77 -0
  187. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.d.ts +3 -0
  188. package/es/components/organism/PreviewTemplateModal/components/ThumbnailSlider/styled.js +62 -0
  189. package/es/components/organism/PreviewTemplateModal/components/index.d.ts +4 -0
  190. package/es/components/organism/PreviewTemplateModal/components/index.js +4 -0
  191. package/es/components/organism/PreviewTemplateModal/constants/dataSample.d.ts +2 -0
  192. package/es/components/organism/PreviewTemplateModal/constants/dataSample.js +9 -0
  193. package/es/components/organism/PreviewTemplateModal/constants/defaultProps.d.ts +8 -0
  194. package/es/components/organism/PreviewTemplateModal/constants/defaultProps.js +12 -0
  195. package/es/components/organism/PreviewTemplateModal/constants/html.d.ts +1 -0
  196. package/es/components/organism/PreviewTemplateModal/constants/html.js +1 -0
  197. package/es/components/organism/PreviewTemplateModal/constants/index.d.ts +4 -0
  198. package/es/components/organism/PreviewTemplateModal/constants/index.js +4 -0
  199. package/es/components/organism/PreviewTemplateModal/constants/variables.d.ts +12 -0
  200. package/es/components/organism/PreviewTemplateModal/constants/variables.js +12 -0
  201. package/es/components/organism/PreviewTemplateModal/index.d.ts +3 -0
  202. package/es/components/organism/PreviewTemplateModal/index.js +34 -0
  203. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/BannerPropsTable/index.d.ts +2 -0
  204. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/BannerPropsTable/index.js +34 -0
  205. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/DataTypeTable/index.d.ts +2 -0
  206. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/DataTypeTable/index.js +62 -0
  207. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/InformationPropsTable/index.d.ts +2 -0
  208. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/InformationPropsTable/index.js +76 -0
  209. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/SimilarTemplatePropsTable/index.d.ts +2 -0
  210. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/SimilarTemplatePropsTable/index.js +40 -0
  211. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/TThumbnailTable/index.d.ts +2 -0
  212. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/TThumbnailTable/index.js +30 -0
  213. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/ThumbnailPropsTable/index.d.ts +2 -0
  214. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/ThumbnailPropsTable/index.js +46 -0
  215. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/index.d.ts +6 -0
  216. package/es/components/organism/PreviewTemplateModal/stories/dataTypes/components/index.js +6 -0
  217. package/es/components/organism/PreviewTemplateModal/styled.d.ts +4 -0
  218. package/es/components/organism/PreviewTemplateModal/styled.js +26 -0
  219. package/es/components/organism/PreviewTemplateModal/types.d.ts +38 -0
  220. package/es/components/organism/PreviewTemplateModal/types.js +1 -0
  221. package/es/components/organism/index.d.ts +1 -0
  222. package/es/components/organism/index.js +1 -0
  223. package/es/components/template/TemplateListing/Loadable.d.ts +6 -0
  224. package/es/components/template/TemplateListing/Loadable.js +7 -0
  225. package/es/components/template/TemplateListing/components/BlankTemplate/index.js +3 -1
  226. package/es/components/template/TemplateListing/components/CategoryListing/index.js +19 -10
  227. package/es/components/template/TemplateListing/components/CategoryListing/styled.d.ts +2 -0
  228. package/es/components/template/TemplateListing/components/CategoryListing/styled.js +50 -8
  229. package/es/components/template/TemplateListing/components/Empty/index.d.ts +3 -0
  230. package/es/components/template/TemplateListing/components/Empty/index.js +18 -0
  231. package/es/components/template/TemplateListing/components/Empty/styled.d.ts +3 -0
  232. package/es/components/template/TemplateListing/components/Empty/styled.js +35 -0
  233. package/es/components/template/TemplateListing/components/index.d.ts +1 -0
  234. package/es/components/template/TemplateListing/components/index.js +1 -0
  235. package/es/components/template/TemplateListing/constants/defaultProps.d.ts +5 -3
  236. package/es/components/template/TemplateListing/constants/defaultProps.js +8 -7
  237. package/es/components/template/TemplateListing/hooks/index.d.ts +1 -0
  238. package/es/components/template/TemplateListing/hooks/index.js +1 -0
  239. package/es/components/template/TemplateListing/hooks/useTemplateListing.d.ts +62 -0
  240. package/es/components/template/TemplateListing/hooks/useTemplateListing.js +230 -0
  241. package/es/components/template/TemplateListing/index.js +75 -14
  242. package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.d.ts +2 -0
  243. package/es/components/template/TemplateListing/stories/dataTypes/components/BlankTemplatePropsTable/index.js +46 -0
  244. package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.d.ts +2 -0
  245. package/es/components/template/TemplateListing/stories/dataTypes/components/CategoryListingPropsTable/index.js +57 -0
  246. package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.d.ts +2 -0
  247. package/es/components/template/TemplateListing/stories/dataTypes/components/DataTypeTables/index.js +78 -0
  248. package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.d.ts +2 -0
  249. package/es/components/template/TemplateListing/stories/dataTypes/components/EmptyPropsTable/index.js +30 -0
  250. package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.d.ts +2 -0
  251. package/es/components/template/TemplateListing/stories/dataTypes/components/TCategoryItemTable/index.js +46 -0
  252. package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.d.ts +2 -0
  253. package/es/components/template/TemplateListing/stories/dataTypes/components/TTemplateItemTable/index.js +38 -0
  254. package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.d.ts +2 -0
  255. package/es/components/template/TemplateListing/stories/dataTypes/components/TemplatesPropsTable/index.js +50 -0
  256. package/es/components/template/TemplateListing/stories/dataTypes/components/index.d.ts +7 -0
  257. package/es/components/template/TemplateListing/stories/dataTypes/components/index.js +7 -0
  258. package/es/components/template/TemplateListing/stories/demo/styled.d.ts +1 -0
  259. package/es/components/template/TemplateListing/stories/demo/styled.js +7 -0
  260. package/es/components/template/TemplateListing/styled/index.d.ts +1 -0
  261. package/es/components/template/TemplateListing/styled/index.js +24 -5
  262. package/es/components/template/TemplateListing/types/BlankTemplate.d.ts +1 -1
  263. package/es/components/template/TemplateListing/types/CategoryListing.d.ts +5 -2
  264. package/es/components/template/TemplateListing/types/Empty.d.ts +5 -0
  265. package/es/components/template/TemplateListing/types/Empty.js +1 -0
  266. package/es/components/template/TemplateListing/types/TemplateListing.d.ts +16 -6
  267. package/es/components/template/index.d.ts +2 -1
  268. package/es/components/template/index.js +5 -1
  269. package/es/constants/datetime.d.ts +8 -0
  270. package/es/constants/datetime.js +1594 -0
  271. package/es/constants/index.d.ts +5 -1
  272. package/es/constants/index.js +5 -1
  273. package/es/constants/queries.d.ts +4 -0
  274. package/es/constants/queries.js +5 -0
  275. package/es/constants/templateListing.d.ts +50 -0
  276. package/es/constants/templateListing.js +52 -0
  277. package/es/constants/theme.js +1 -1
  278. package/es/constants/variables.d.ts +19 -0
  279. package/es/constants/variables.js +19 -0
  280. package/es/hooks/index.d.ts +4 -0
  281. package/es/hooks/index.js +4 -0
  282. package/es/hooks/useEffectOnlyOnce.d.ts +2 -0
  283. package/es/hooks/useEffectOnlyOnce.js +12 -0
  284. package/es/hooks/useForceUpdate.d.ts +1 -0
  285. package/es/hooks/useForceUpdate.js +5 -0
  286. package/es/hooks/useIntersectionObserver.d.ts +57 -0
  287. package/es/hooks/useIntersectionObserver.js +97 -0
  288. package/es/hooks/useListingItemResize.d.ts +12 -0
  289. package/es/hooks/useListingItemResize.js +58 -0
  290. package/es/hooks/useScrollToEnd.d.ts +1 -0
  291. package/es/hooks/useScrollToEnd.js +30 -0
  292. package/es/index.d.ts +3 -0
  293. package/es/index.js +3 -0
  294. package/es/locales/en/translation.json +9 -1
  295. package/es/locales/i18n.d.ts +16 -0
  296. package/es/locales/translations.d.ts +8 -0
  297. package/es/locales/vi/translation.json +9 -1
  298. package/es/models/ObjectTemplate.d.ts +56 -0
  299. package/es/models/ObjectTemplate.js +82 -0
  300. package/es/models/TemplateCategory.d.ts +13 -0
  301. package/es/models/TemplateCategory.js +28 -0
  302. package/es/queries/CustomFunction/useCustomFunction.js +35 -35
  303. package/es/queries/TemplateListing/index.d.ts +52 -0
  304. package/es/queries/TemplateListing/index.js +105 -0
  305. package/es/queries/index.d.ts +1 -0
  306. package/es/queries/index.js +1 -0
  307. package/es/services/TemplateListing/index.d.ts +70 -0
  308. package/es/services/TemplateListing/index.js +161 -0
  309. package/es/test.js +65 -11
  310. package/es/types/index.d.ts +5 -0
  311. package/es/types/index.js +3 -0
  312. package/es/types/service.d.ts +22 -0
  313. package/es/types/service.js +1 -0
  314. package/es/types/share-access.d.ts +18 -0
  315. package/es/types/share-access.js +1 -0
  316. package/es/types/templateListing.d.ts +13 -0
  317. package/es/types/templateListing.js +1 -0
  318. package/es/types/variables.d.ts +3 -0
  319. package/es/utils/common.d.ts +4 -0
  320. package/es/utils/common.js +38 -0
  321. package/es/utils/commonComponent.d.ts +7 -0
  322. package/es/utils/commonComponent.js +28 -0
  323. package/es/utils/index.d.ts +1 -0
  324. package/es/utils/index.js +1 -0
  325. package/es/utils/templateListing.d.ts +2 -0
  326. package/es/utils/templateListing.js +12 -0
  327. package/package.json +6 -1
@@ -1,4 +1,8 @@
1
- export { THEME } from './theme';
2
1
  export * from './storybook';
3
2
  export * from './gradientSetting';
4
3
  export * from './richMenu';
4
+ export * from './datetime';
5
+ export * from './keyCode';
6
+ export * from './templateListing';
7
+ export * from './theme';
8
+ export * from './variables';
@@ -1,4 +1,8 @@
1
- export { THEME } from './theme';
2
1
  export * from './storybook';
3
2
  export * from './gradientSetting';
4
3
  export * from './richMenu';
4
+ export * from './datetime';
5
+ export * from './keyCode';
6
+ export * from './templateListing';
7
+ export * from './theme';
8
+ export * from './variables';
@@ -11,4 +11,8 @@ export declare const QUERY_KEYS: {
11
11
  GET_LIST_PROMOTION_POOL: string;
12
12
  GET_LIST_CUSTOM: string;
13
13
  GET_SAVE_CUSTOM_FUNCTION: string;
14
+ GET_TEMPLATE_CATEGORY_LIST: string;
15
+ GET_OBJECT_TEMPLATE_LIST: string;
16
+ GET_OBJECT_TEMPLATE_DETAIL: string;
17
+ GET_SAVE_AS_GALLERY_PERMISSION_EMAILS: string;
14
18
  };
@@ -18,4 +18,9 @@ export const QUERY_KEYS = {
18
18
  // Custom Function
19
19
  GET_LIST_CUSTOM: 'GET_LIST_CUSTOM',
20
20
  GET_SAVE_CUSTOM_FUNCTION: 'GET_SAVE_CUSTOM_FUNCTION',
21
+ // Template Listing
22
+ GET_TEMPLATE_CATEGORY_LIST: 'GET_TEMPLATE_CATEGORY_LIST',
23
+ GET_OBJECT_TEMPLATE_LIST: 'GET_OBJECT_TEMPLATE_LIST',
24
+ GET_OBJECT_TEMPLATE_DETAIL: 'GET_OBJECT_TEMPLATE_DETAIL',
25
+ GET_SAVE_AS_GALLERY_PERMISSION_EMAILS: 'GET_SAVE_AS_GALLERY_PERMISSION_EMAILS',
21
26
  };
@@ -0,0 +1,50 @@
1
+ export declare const PUBLIC_LEVEL: {
2
+ readonly RESTRICTED: 0;
3
+ readonly PUBLIC: 1;
4
+ };
5
+ export declare const TEMPLATE_STATUS: {
6
+ readonly ACTIVE: 1;
7
+ readonly REMOVED: 80;
8
+ };
9
+ export declare const LIMIT_LIST_PER_PAGE = 10;
10
+ export declare const CATEGORY_SPLIT_KEY = "::";
11
+ export declare const LAYOUT_TEMPLATE: {
12
+ POP_UP: {
13
+ id: number;
14
+ name: string;
15
+ label: string;
16
+ };
17
+ FLOATING_BAR: {
18
+ id: number;
19
+ name: string;
20
+ label: string;
21
+ };
22
+ FULL_SCREEN: {
23
+ id: number;
24
+ name: string;
25
+ label: string;
26
+ };
27
+ INLINE: {
28
+ id: number;
29
+ name: string;
30
+ label: string;
31
+ };
32
+ SLIDE_IN: {
33
+ id: number;
34
+ name: string;
35
+ label: string;
36
+ };
37
+ GAMIFIED: {
38
+ id: number;
39
+ name: string;
40
+ label: string;
41
+ };
42
+ };
43
+ export declare const TEMPLATE_CATEGORY_KEYS: {
44
+ readonly INDUSTRY: "industry";
45
+ readonly SEASONALITY: "seasonality";
46
+ readonly GOAL: "goal";
47
+ readonly OBJECTIVE: "objective";
48
+ readonly JOURNEY_TYPE: "journey_type";
49
+ readonly LIFECYCLE_STAGE: "lifecycle_stage";
50
+ };
@@ -0,0 +1,52 @@
1
+ export const PUBLIC_LEVEL = {
2
+ RESTRICTED: 0,
3
+ PUBLIC: 1,
4
+ };
5
+ export const TEMPLATE_STATUS = {
6
+ ACTIVE: 1,
7
+ REMOVED: 80,
8
+ };
9
+ export const LIMIT_LIST_PER_PAGE = 10;
10
+ export const CATEGORY_SPLIT_KEY = '::';
11
+ export const LAYOUT_TEMPLATE = {
12
+ POP_UP: {
13
+ id: 1,
14
+ name: 'pop_up',
15
+ label: 'Popup',
16
+ },
17
+ FLOATING_BAR: {
18
+ id: 2,
19
+ name: 'floating_bar',
20
+ label: 'Floating Bar',
21
+ },
22
+ FULL_SCREEN: {
23
+ id: 3,
24
+ name: 'full_screen',
25
+ label: 'Fullscreen',
26
+ },
27
+ INLINE: {
28
+ id: 4,
29
+ name: 'inline',
30
+ label: 'Inline',
31
+ },
32
+ SLIDE_IN: {
33
+ id: 5,
34
+ name: 'slide_in',
35
+ label: 'Slide-in',
36
+ },
37
+ GAMIFIED: {
38
+ id: 6,
39
+ name: 'gamified',
40
+ label: 'Gamified',
41
+ },
42
+ };
43
+ export const TEMPLATE_CATEGORY_KEYS = {
44
+ // DEVICE_TYPE: 'device_type',
45
+ // TEMPLATE_TYPE: 'template_type',
46
+ INDUSTRY: 'industry',
47
+ SEASONALITY: 'seasonality',
48
+ GOAL: 'goal',
49
+ OBJECTIVE: 'objective',
50
+ JOURNEY_TYPE: 'journey_type',
51
+ LIFECYCLE_STAGE: 'lifecycle_stage',
52
+ };
@@ -149,7 +149,7 @@ THEME.components = {
149
149
  },
150
150
  Tabs: {
151
151
  colorPrimary: '#1F5FAC',
152
- horizontalItemPadding: '10px 20px',
152
+ horizontalItemPadding: '17px 30px',
153
153
  horizontalItemGutter: 0,
154
154
  lineWidthBold: 3,
155
155
  titleFontSize: 14,
@@ -0,0 +1,19 @@
1
+ export declare const OBJECT_TYPES: {
2
+ readonly DASHBOARD: 1;
3
+ readonly JOURNEY_OVERVIEW: 2;
4
+ readonly SEGMENT: 3;
5
+ readonly BUSINESS_OBJECT: 4;
6
+ readonly VIEW: 5;
7
+ readonly DESTINATION: 6;
8
+ readonly EXPLORATION: 7;
9
+ readonly MEDIA_TEMPLATE: 8;
10
+ readonly EMAIL_TEMPLATE: 9;
11
+ readonly JOURNEY_TEMPLATE: 10;
12
+ readonly RICH_MENU_TEMPLATE: 11;
13
+ };
14
+ export declare const GET_LIST_TYPE: {
15
+ readonly OWNER: 1;
16
+ readonly SHARE_WITH_ME: 2;
17
+ readonly HAVE_ACCESS: 3;
18
+ readonly SELECTOR: 4;
19
+ };
@@ -0,0 +1,19 @@
1
+ export const OBJECT_TYPES = {
2
+ DASHBOARD: 1,
3
+ JOURNEY_OVERVIEW: 2,
4
+ SEGMENT: 3,
5
+ BUSINESS_OBJECT: 4,
6
+ VIEW: 5,
7
+ DESTINATION: 6,
8
+ EXPLORATION: 7,
9
+ MEDIA_TEMPLATE: 8,
10
+ EMAIL_TEMPLATE: 9,
11
+ JOURNEY_TEMPLATE: 10,
12
+ RICH_MENU_TEMPLATE: 11,
13
+ };
14
+ export const GET_LIST_TYPE = {
15
+ OWNER: 1,
16
+ SHARE_WITH_ME: 2,
17
+ HAVE_ACCESS: 3,
18
+ SELECTOR: 4,
19
+ };
@@ -1,3 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export declare function useDeepCompareEffect(callback: React.EffectCallback, dependencies: React.DependencyList | undefined): void;
3
3
  export { useDeepCompareMemo } from './useDeepCompareMemo';
4
+ export * from './useIntersectionObserver';
5
+ export * from './useEffectOnlyOnce';
6
+ export * from './useForceUpdate';
7
+ export * from './useListingItemResize';
package/es/hooks/index.js CHANGED
@@ -20,3 +20,7 @@ export function useDeepCompareEffect(callback, dependencies) {
20
20
  useEffect(callback, dependencies === null || dependencies === void 0 ? void 0 : dependencies.map(useDeepCompareMemoize));
21
21
  }
22
22
  export { useDeepCompareMemo } from './useDeepCompareMemo';
23
+ export * from './useIntersectionObserver';
24
+ export * from './useEffectOnlyOnce';
25
+ export * from './useForceUpdate';
26
+ export * from './useListingItemResize';
@@ -0,0 +1,2 @@
1
+ import { DependencyList } from 'react';
2
+ export declare const useEffectOnlyOnce: (fn: Function, dependencies: DependencyList) => void;
@@ -0,0 +1,12 @@
1
+ // Libraries
2
+ import { useEffect, useState } from 'react';
3
+ export const useEffectOnlyOnce = (fn, dependencies) => {
4
+ const [didLoad, setDidLoad] = useState(false);
5
+ useEffect(() => {
6
+ if (!didLoad) {
7
+ fn();
8
+ setDidLoad(true);
9
+ }
10
+ // eslint-disable-next-line react-hooks/exhaustive-deps
11
+ }, [...dependencies]);
12
+ };
@@ -0,0 +1 @@
1
+ export declare const useForceUpdate: () => () => void;
@@ -0,0 +1,5 @@
1
+ import { useCallback, useState } from 'react';
2
+ export const useForceUpdate = () => {
3
+ const [, updateState] = useState();
4
+ return useCallback(() => updateState({}), []);
5
+ };
@@ -0,0 +1,57 @@
1
+ import type { RefObject } from 'react';
2
+ type ObserverCallback = (isIntersecting: boolean, entry: IntersectionObserverEntry) => void;
3
+ /**
4
+ * Represents the options for configuring the Intersection Observer.
5
+ * @interface IntersectionObserverOptions
6
+ * @property {number | number[]} [threshold=0] - A threshold indicating the percentage of the target's visibility needed to trigger the callback.
7
+ * @property {Element | Document | null} [root=null] - The element that is used as the viewport for checking visibility of the target.
8
+ * @property {string} [rootMargin='0%'] - A margin around the root.
9
+ * @property {boolean} [freezeOnceVisible=false] - If true, freezes the intersection state once the element becomes visible.
10
+ * @property {ObserverCallback} [onChange] - A callback function to be invoked when the intersection state changes.
11
+ * @property {boolean} [initialIsIntersecting=false] - The initial state of the intersection.
12
+ */
13
+ interface IntersectionObserverOptions extends IntersectionObserverInit {
14
+ freezeOnceVisible?: boolean;
15
+ onChange?: ObserverCallback;
16
+ initialIsIntersecting?: boolean;
17
+ }
18
+ /** Supports both array and object destructing */
19
+ type IntersectionResult = [
20
+ (node?: Element | null) => void,
21
+ boolean,
22
+ IntersectionObserverEntry | undefined
23
+ ] & {
24
+ ref: (node?: Element | null) => void;
25
+ isIntersecting: boolean;
26
+ entry?: IntersectionObserverEntry;
27
+ };
28
+ /**
29
+ * Custom hook for tracking the intersection of a DOM element with its containing element or the viewport.
30
+ * @param {IntersectionObserverOptions} options - The options for the Intersection Observer.
31
+ * @returns {IntersectionResult} The ref callback, a boolean indicating if the element is intersecting, and the intersection observer entry.
32
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-intersection-observer)
33
+ * @see [MDN Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)
34
+ * @example
35
+ * // Example 1
36
+ * const [ref, isIntersecting, entry] = useIntersectionObserver({ threshold: 0.5 });
37
+ *
38
+ * // Example 2
39
+ * const { ref, isIntersecting, entry } = useIntersectionObserver({ threshold: 0.5 });
40
+ */
41
+ export declare function useIntersectionObserver(options: IntersectionObserverOptions): IntersectionResult;
42
+ /**
43
+ * @deprecated Use the new signature with an unique option object instead.
44
+ * Custom hook for tracking the intersection of a DOM element with its containing element or the viewport.
45
+ * @param {RefObject<Element>} elementRef - The ref object for the DOM element to observe.
46
+ * @param {IntersectionObserverOptions} [options] - The options for the Intersection Observer (optional).
47
+ * @returns {IntersectionObserverEntry | undefined} The intersection observer entry representing the state of the intersection.
48
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-intersection-observer)
49
+ * @see [MDN Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)
50
+ * @example
51
+ * const targetRef = useRef<HTMLDivElement>(null);
52
+ * const options = { threshold: 0.5 };
53
+ * const entry = useIntersectionObserver(targetRef, options);
54
+ * // Access the intersection details from the entry variable.
55
+ */
56
+ export declare function useIntersectionObserver(elementRef: RefObject<Element>, legacyOptions: IntersectionObserverOptions): IntersectionObserverEntry | undefined;
57
+ export {};
@@ -0,0 +1,97 @@
1
+ /* eslint-disable prefer-destructuring */
2
+ // Libraries
3
+ import { useEffect, useRef, useState } from 'react';
4
+ /**
5
+ * Custom hook for tracking the intersection of a DOM element with its containing element or the viewport.
6
+ * @param {IntersectionObserverOptions | RefObject<Element>} optionsOrLegacyRef - The options for the Intersection Observer.
7
+ * @param {?IntersectionObserverOptions} [legacyOptions] - The options for the Intersection Observer (optional, legacy).
8
+ * @returns {NewIntersectionResult | IntersectionObserverEntry | undefined} The ref callback, a boolean indicating if the element is intersecting, and the intersection observer entry.
9
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-intersection-observer)
10
+ * @see [MDN Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)
11
+ * @example
12
+ * // Example 1
13
+ * const [ref, isIntersecting, entry] = useIntersectionObserver({ threshold: 0.5 });
14
+ *
15
+ * // Example 2
16
+ * const { ref, isIntersecting, entry } = useIntersectionObserver({ threshold: 0.5 });
17
+ */
18
+ export function useIntersectionObserver(optionsOrLegacyRef, legacyOptions) {
19
+ var _a;
20
+ // TODO: Remove this mess when the old signature is removed.
21
+ const isLegacySignature = 'current' in optionsOrLegacyRef;
22
+ const options = isLegacySignature ? legacyOptions : optionsOrLegacyRef;
23
+ const { threshold = 0, root = null, rootMargin = '0%', freezeOnceVisible = false, initialIsIntersecting = false, } = options !== null && options !== void 0 ? options : {};
24
+ const [newRef, setNewRef] = useState(null);
25
+ const ref = isLegacySignature ? optionsOrLegacyRef.current : newRef;
26
+ const [state, setState] = useState(() => ({
27
+ isIntersecting: initialIsIntersecting,
28
+ entry: undefined,
29
+ }));
30
+ const callbackRef = useRef();
31
+ callbackRef.current = options === null || options === void 0 ? void 0 : options.onChange;
32
+ const frozen = ((_a = state.entry) === null || _a === void 0 ? void 0 : _a.isIntersecting) && freezeOnceVisible;
33
+ useEffect(() => {
34
+ // Ensure we have a ref to observe
35
+ if (!ref)
36
+ return;
37
+ // Ensure the browser supports the Intersection Observer API
38
+ if (!('IntersectionObserver' in window))
39
+ return;
40
+ // Skip if frozen
41
+ if (frozen)
42
+ return;
43
+ let unobserve;
44
+ const observer = new IntersectionObserver((entries) => {
45
+ const thresholds = Array.isArray(observer.thresholds)
46
+ ? observer.thresholds
47
+ : [observer.thresholds];
48
+ entries.forEach(entry => {
49
+ const isIntersecting = entry.isIntersecting &&
50
+ thresholds.some(threshold => entry.intersectionRatio >= threshold);
51
+ setState({ isIntersecting, entry });
52
+ if (callbackRef.current) {
53
+ callbackRef.current(isIntersecting, entry);
54
+ }
55
+ if (isIntersecting && freezeOnceVisible && unobserve) {
56
+ unobserve();
57
+ unobserve = undefined;
58
+ }
59
+ });
60
+ }, { threshold, root, rootMargin });
61
+ observer.observe(ref);
62
+ return () => {
63
+ observer.disconnect();
64
+ };
65
+ // eslint-disable-next-line react-hooks/exhaustive-deps
66
+ }, [
67
+ ref,
68
+ // eslint-disable-next-line react-hooks/exhaustive-deps
69
+ JSON.stringify(threshold),
70
+ root,
71
+ rootMargin,
72
+ frozen,
73
+ freezeOnceVisible,
74
+ ]);
75
+ // ensures that if the observed element changes, the intersection observer is reinitialized
76
+ const prevRef = useRef(null);
77
+ useEffect(() => {
78
+ var _a;
79
+ if (!ref &&
80
+ ((_a = state.entry) === null || _a === void 0 ? void 0 : _a.target) &&
81
+ !freezeOnceVisible &&
82
+ !frozen &&
83
+ prevRef.current !== state.entry.target) {
84
+ prevRef.current = state.entry.target;
85
+ setState({ isIntersecting: initialIsIntersecting, entry: undefined });
86
+ }
87
+ }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);
88
+ if (isLegacySignature) {
89
+ return state.entry;
90
+ }
91
+ const result = [setNewRef, !!state.isIntersecting, state.entry];
92
+ // Support object destructuring, by adding the specific values.
93
+ result.ref = result[0];
94
+ result.isIntersecting = result[1];
95
+ result.entry = result[2];
96
+ return result;
97
+ }
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ interface ComponentSizeProps {
3
+ initialWidth: number;
4
+ gap: number;
5
+ }
6
+ export declare const useListingItemResize: (props: ComponentSizeProps) => {
7
+ ref: import("react").MutableRefObject<any>;
8
+ itemPerRow: number | undefined;
9
+ ratio: number;
10
+ gap: number;
11
+ };
12
+ export {};
@@ -0,0 +1,58 @@
1
+ // Libraries
2
+ import { useMemo, useRef } from 'react';
3
+ import { useForceUpdate } from '@antscorp/antsomi-ui/es/hooks';
4
+ import { isNumber } from 'lodash';
5
+ const DEFAULT_RATIO = 1;
6
+ export const useListingItemResize = (props) => {
7
+ var _a;
8
+ const { initialWidth, gap } = props;
9
+ // Ref
10
+ const ref = useRef(null);
11
+ const timeoutAfterChange = useRef(null);
12
+ // Hooks
13
+ const forceUpdate = useForceUpdate();
14
+ /* Variables */
15
+ const containerWidth = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
16
+ /* Memo */
17
+ /**
18
+ * The number of items per row to display in the container
19
+ */
20
+ const itemPerRow = useMemo(() => {
21
+ if (isNumber(containerWidth)) {
22
+ /**
23
+ * The temporary number of items per row that the container is able to contain
24
+ */
25
+ const tempItemPerRow = Math.floor(containerWidth / initialWidth);
26
+ const totalGapWidth = gap * (tempItemPerRow - 1);
27
+ /**
28
+ * Check if the container is able to contain the total items with @initialWidth including the total @gap size
29
+ */
30
+ const isPossibleContain = containerWidth >= tempItemPerRow * initialWidth + totalGapWidth;
31
+ /**
32
+ * If it doesn't, reduce the @itemPerRow by 1
33
+ */
34
+ return isPossibleContain ? tempItemPerRow : tempItemPerRow - 1;
35
+ }
36
+ }, [containerWidth, gap, initialWidth]);
37
+ /**
38
+ * The ratio of the new width and height to the initial length and height
39
+ */
40
+ const ratio = useMemo(() => {
41
+ if (isNumber(containerWidth) && isNumber(itemPerRow)) {
42
+ const totalGapWidth = gap * (itemPerRow - 1);
43
+ const newWidth = (containerWidth - totalGapWidth) / itemPerRow;
44
+ return newWidth / initialWidth;
45
+ }
46
+ return DEFAULT_RATIO;
47
+ }, [containerWidth, gap, initialWidth, itemPerRow]);
48
+ /* Events */
49
+ window.addEventListener('resize', () => {
50
+ if (timeoutAfterChange) {
51
+ clearTimeout(timeoutAfterChange.current);
52
+ }
53
+ timeoutAfterChange.current = setTimeout(() => {
54
+ forceUpdate();
55
+ }, 500);
56
+ });
57
+ return { ref, itemPerRow, ratio, gap };
58
+ };
@@ -0,0 +1 @@
1
+ export declare const useScrollToEnd: (containerRef: React.RefObject<HTMLDivElement>, callback: () => void) => boolean;
@@ -0,0 +1,30 @@
1
+ import { useState, useEffect, useCallback } from 'react';
2
+ export const useScrollToEnd = (containerRef, callback) => {
3
+ const [isAtEnd, setIsAtEnd] = useState(false);
4
+ const handleScroll = useCallback(() => {
5
+ const container = containerRef.current;
6
+ if (!container) {
7
+ return;
8
+ }
9
+ const { clientHeight, scrollHeight, scrollTop } = container;
10
+ console.log({ clientHeight, scrollHeight, scrollTop });
11
+ const isScrolledToEnd = scrollTop + clientHeight >= scrollHeight;
12
+ setIsAtEnd(isScrolledToEnd);
13
+ }, [containerRef]);
14
+ useEffect(() => {
15
+ const container = containerRef.current;
16
+ if (!container) {
17
+ return;
18
+ }
19
+ container.addEventListener('scroll', handleScroll);
20
+ return () => {
21
+ container.removeEventListener('scroll', handleScroll);
22
+ };
23
+ }, [containerRef, handleScroll]);
24
+ useEffect(() => {
25
+ if (isAtEnd) {
26
+ callback();
27
+ }
28
+ }, [isAtEnd, callback]);
29
+ return isAtEnd;
30
+ };
package/es/index.d.ts CHANGED
@@ -1 +1,4 @@
1
1
  export * from './components';
2
+ export * from './types';
3
+ export * from './queries';
4
+ export { snakeCaseToCamelCase, camelCaseToSnakeCase, getCategoriesFromObjectTemplate, } from './utils';
package/es/index.js CHANGED
@@ -1 +1,4 @@
1
1
  export * from './components';
2
+ export * from './types';
3
+ export * from './queries';
4
+ export { snakeCaseToCamelCase, camelCaseToSnakeCase, getCategoriesFromObjectTemplate, } from './utils';
@@ -228,5 +228,13 @@
228
228
  "ninth": "Ninth",
229
229
  "tenth": "Tenth"
230
230
  },
231
- "cellAction": "Click to add image"
231
+ "cellAction": "Click to add image",
232
+ "templateListing": {
233
+ "removeSuccess": "Remove template successfully",
234
+ "removeFailed": "Remove template failed",
235
+ "addFailed": "Add template failed",
236
+ "addSuccess": "Add template successfully",
237
+ "updateFailed": "Update template failed",
238
+ "updateSuccess": "Update template successfully"
239
+ }
232
240
  }
@@ -231,6 +231,14 @@ export declare const translationsJson: {
231
231
  tenth: string;
232
232
  };
233
233
  cellAction: string;
234
+ templateListing: {
235
+ removeSuccess: string;
236
+ removeFailed: string;
237
+ addFailed: string;
238
+ addSuccess: string;
239
+ updateFailed: string;
240
+ updateSuccess: string;
241
+ };
234
242
  };
235
243
  };
236
244
  vi: {
@@ -300,6 +308,14 @@ export declare const translationsJson: {
300
308
  tenth: string;
301
309
  };
302
310
  close: string;
311
+ templateListing: {
312
+ removeSuccess: string;
313
+ removeFailed: string;
314
+ addFailed: string;
315
+ addSuccess: string;
316
+ updateFailed: string;
317
+ updateSuccess: string;
318
+ };
303
319
  };
304
320
  };
305
321
  };
@@ -231,6 +231,14 @@ export declare const convertLanguageJsonToObject: (json: any, objToConvertTo?: C
231
231
  tenth: string;
232
232
  };
233
233
  cellAction: string;
234
+ templateListing: {
235
+ removeSuccess: string;
236
+ removeFailed: string;
237
+ addFailed: string;
238
+ addSuccess: string;
239
+ updateFailed: string;
240
+ updateSuccess: string;
241
+ };
234
242
  }>, current?: string) => void;
235
243
  export declare const t: (id: string, ...rest: any[]) => [string, ...any[]];
236
244
  export declare const getTranslateMessage: (id: string, defaultMessage?: string, value?: Record<string, unknown>) => string;
@@ -63,5 +63,13 @@
63
63
  "ninth": "thứ chín",
64
64
  "tenth": "thứ mười"
65
65
  },
66
- "close": "Đóng"
66
+ "close": "Đóng",
67
+ "templateListing": {
68
+ "removeSuccess": "Xóa mẫu thành công",
69
+ "removeFailed": "Xóa mẫu thất bại",
70
+ "addFailed": "Thêm mẫu thất bại",
71
+ "addSuccess": "Thêm mẫu thành công",
72
+ "updateFailed": "Cập nhật mẫu thất bại",
73
+ "updateSuccess": "Cập nhật mẫu thành công"
74
+ }
67
75
  }
@@ -0,0 +1,56 @@
1
+ import dayjs from 'dayjs';
2
+ import { TTemplateStatus } from '../types/templateListing';
3
+ import { Model } from './model';
4
+ import { TShareAccess } from '../types';
5
+ export type TObjectTemplate = {
6
+ template_id: number;
7
+ template_name: string;
8
+ object_type: number;
9
+ public_level: number;
10
+ network_id: number;
11
+ description: string;
12
+ properties: Record<string, any>;
13
+ c_user_id: number;
14
+ u_user_id: number;
15
+ status: TTemplateStatus;
16
+ ctime: string;
17
+ utime: string;
18
+ thumbnail: string;
19
+ device_type: number;
20
+ template_type: number;
21
+ template_setting: Record<string, any>;
22
+ config: Record<string, any>;
23
+ config_object: Record<string, any>;
24
+ objective: number[];
25
+ seasonality: number[];
26
+ industry: number[];
27
+ goal: number[];
28
+ journey_type: number[];
29
+ lifecycle_stage: number[];
30
+ share_access: TShareAccess;
31
+ };
32
+ export declare class ObjectTemplate extends Model<TObjectTemplate> {
33
+ get id(): number | "";
34
+ get name(): string;
35
+ get type(): number;
36
+ get typeLabel(): string;
37
+ get description(): string;
38
+ get templateSettings(): Record<string, any>;
39
+ get settings(): Record<string, any>;
40
+ get status(): "" | TTemplateStatus;
41
+ get userId(): number | "";
42
+ get createdAt(): "-" | dayjs.Dayjs;
43
+ get updatedAt(): "-" | dayjs.Dayjs;
44
+ get objectiveTypes(): number[];
45
+ get networkId(): number | undefined;
46
+ get thumbnail(): string;
47
+ get objectType(): number | undefined;
48
+ get config(): Record<string, any> | undefined;
49
+ get configObject(): Record<string, any> | undefined;
50
+ get seasonality(): number[] | undefined;
51
+ get industry(): number[] | undefined;
52
+ get lifecycleStage(): number[] | undefined;
53
+ get journeyType(): number[] | undefined;
54
+ get goal(): number[] | undefined;
55
+ get shareAccess(): TShareAccess | undefined;
56
+ }