@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
@@ -0,0 +1,82 @@
1
+ // Libraries
2
+ import dayjs from 'dayjs';
3
+ // Models
4
+ import { Model } from './model';
5
+ // Constants
6
+ import { DATE_TIME_FORMAT, LAYOUT_TEMPLATE } from '../constants';
7
+ export class ObjectTemplate extends Model {
8
+ get id() {
9
+ return this.model.template_id || '';
10
+ }
11
+ get name() {
12
+ return this.model.template_name || '';
13
+ }
14
+ get type() {
15
+ return +(this.model.template_type || '');
16
+ }
17
+ get typeLabel() {
18
+ const templateType = Object.values(LAYOUT_TEMPLATE).find(({ id }) => id === this.type);
19
+ return templateType ? templateType.label : '';
20
+ }
21
+ get description() {
22
+ return this.model.description || '';
23
+ }
24
+ get templateSettings() {
25
+ return this.model.template_setting || {};
26
+ }
27
+ get settings() {
28
+ return this.model.properties || {};
29
+ }
30
+ get status() {
31
+ return this.model.status || '';
32
+ }
33
+ get userId() {
34
+ return this.model.c_user_id || '';
35
+ }
36
+ get createdAt() {
37
+ return dayjs(this.model.ctime).isValid()
38
+ ? dayjs(this.model.ctime, DATE_TIME_FORMAT.DATE_TIME)
39
+ : '-';
40
+ }
41
+ get updatedAt() {
42
+ return dayjs(this.model.utime).isValid()
43
+ ? dayjs(this.model.utime, DATE_TIME_FORMAT.DATE_TIME)
44
+ : '-';
45
+ }
46
+ get objectiveTypes() {
47
+ return this.model.goal || [];
48
+ }
49
+ get networkId() {
50
+ return this.model.network_id;
51
+ }
52
+ get thumbnail() {
53
+ return this.model.thumbnail || '';
54
+ }
55
+ get objectType() {
56
+ return this.model.object_type;
57
+ }
58
+ get config() {
59
+ return this.model.config;
60
+ }
61
+ get configObject() {
62
+ return this.model.config_object;
63
+ }
64
+ get seasonality() {
65
+ return this.model.seasonality;
66
+ }
67
+ get industry() {
68
+ return this.model.industry;
69
+ }
70
+ get lifecycleStage() {
71
+ return this.model.lifecycle_stage;
72
+ }
73
+ get journeyType() {
74
+ return this.model.journey_type;
75
+ }
76
+ get goal() {
77
+ return this.model.goal;
78
+ }
79
+ get shareAccess() {
80
+ return this.model.share_access;
81
+ }
82
+ }
@@ -0,0 +1,13 @@
1
+ import { TObjectType } from '../types/templateListing';
2
+ export type TTemplateCategory = {};
3
+ export interface TemplateCategory {
4
+ categoryId: number;
5
+ categoryCode: string;
6
+ parentCategoryCode: string;
7
+ categoryName: string;
8
+ description: string;
9
+ objectTypes: TObjectType[];
10
+ filterOperator?: string;
11
+ children: TemplateCategory[];
12
+ total?: number;
13
+ }
@@ -0,0 +1,28 @@
1
+ export {};
2
+ // export class TemplateCategory extends Model<TTemplateCategory> {
3
+ // get id() {
4
+ // return this.model.media_id || '';
5
+ // }
6
+ // get name() {
7
+ // return this.model.name || '';
8
+ // }
9
+ // get url() {
10
+ // return this.model.properties?.url || '';
11
+ // }
12
+ // get thumbnail() {
13
+ // return this.model.properties?.thumbnail || '';
14
+ // }
15
+ // get createdAt() {
16
+ // return moment(this.model.ctime, true).isValid() ? moment(this.model.ctime) : null;
17
+ // }
18
+ // get size() {
19
+ // return +(this.model.properties?.size || 0);
20
+ // }
21
+ // get sizeString() {
22
+ // const { properties } = this.model;
23
+ // const dimensionsFile = properties?.dimensions_file;
24
+ // return `${Math.round(10 * ((properties?.size || 0) / 1024)) / 10} KB, ${
25
+ // dimensionsFile?.width
26
+ // } x ${dimensionsFile?.height} `;
27
+ // }
28
+ // }
@@ -8,46 +8,46 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  // Libraries
11
- import { useMutation, useQuery } from '@tanstack/react-query';
11
+ import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
12
12
  // Services
13
13
  import { getListingTemplateCustomFunction, createSavedCustomFunction, updateSavedCustomFunction, } from '../../services/MediaTemplateDesign/CustomFunction';
14
14
  // Constants
15
15
  import { QUERY_KEYS } from '../../constants/queries';
16
- // Query client
17
- import { queryClientAntsomiUI } from '../configs';
18
16
  export const useGetCustomFunction = (apiConfig, infos, queryOptions) => useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_LIST_CUSTOM], queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
19
17
  const data = yield getListingTemplateCustomFunction({ url: apiConfig.url }, infos);
20
18
  return data;
21
19
  }) }, queryOptions));
22
- export const useAddSavedCSFunction = () => useMutation(createSavedCustomFunction, {
23
- onMutate: (_payload) => {
24
- const previousSavedBlock = queryClientAntsomiUI.getQueryData([
25
- QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION,
26
- ]);
27
- return { previousSavedBlock };
28
- },
29
- onError: (_error, _payload, context) => {
30
- queryClientAntsomiUI.setQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], context === null || context === void 0 ? void 0 : context.previousSavedBlock);
31
- },
32
- onSettled: () => {
33
- queryClientAntsomiUI.invalidateQueries([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], {
34
- exact: true,
35
- });
36
- },
37
- });
38
- export const useUpdateCSFunction = () => useMutation(updateSavedCustomFunction, {
39
- onMutate: (_payload) => {
40
- const previousSavedBlock = queryClientAntsomiUI.getQueryData([
41
- QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION,
42
- ]);
43
- return { previousSavedBlock };
44
- },
45
- onError: (_error, _payload, context) => {
46
- queryClientAntsomiUI.setQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], context === null || context === void 0 ? void 0 : context.previousSavedBlock);
47
- },
48
- onSettled: () => {
49
- queryClientAntsomiUI.invalidateQueries([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], {
50
- exact: true,
51
- });
52
- },
53
- });
20
+ export const useAddSavedCSFunction = () => {
21
+ const queryClient = useQueryClient();
22
+ return useMutation(createSavedCustomFunction, {
23
+ onMutate: (_payload) => {
24
+ const previousSavedBlock = queryClient.getQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION]);
25
+ return { previousSavedBlock };
26
+ },
27
+ onError: (_error, _payload, context) => {
28
+ queryClient.setQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], context === null || context === void 0 ? void 0 : context.previousSavedBlock);
29
+ },
30
+ onSettled: () => {
31
+ queryClient.invalidateQueries([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], {
32
+ exact: true,
33
+ });
34
+ },
35
+ });
36
+ };
37
+ export const useUpdateCSFunction = () => {
38
+ const queryClient = useQueryClient();
39
+ return useMutation(updateSavedCustomFunction, {
40
+ onMutate: (_payload) => {
41
+ const previousSavedBlock = queryClient.getQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION]);
42
+ return { previousSavedBlock };
43
+ },
44
+ onError: (_error, _payload, context) => {
45
+ queryClient.setQueryData([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], context === null || context === void 0 ? void 0 : context.previousSavedBlock);
46
+ },
47
+ onSettled: () => {
48
+ queryClient.invalidateQueries([QUERY_KEYS.GET_SAVE_CUSTOM_FUNCTION], {
49
+ exact: true,
50
+ });
51
+ },
52
+ });
53
+ };
@@ -0,0 +1,52 @@
1
+ import { UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from '@tanstack/react-query';
2
+ import { TemplateCategory } from '@antscorp/antsomi-ui/es/models/TemplateCategory';
3
+ import { TBulkUpdateObjectTemplateArgs, TGetCategoryListArgs, TGetObjectTemplateDetailArgs, TGetObjectTemplateListArgs, TGetSaveAsGalleryPermissionArgs, TUpdateObjectTemplateArgs, TValidateObjectTemplateNameArgs } from '@antscorp/antsomi-ui/es/services/TemplateListing';
4
+ import { ResponseCheckNameExist, ResponseListing } from '../../types';
5
+ import { ObjectTemplate } from '../../models/ObjectTemplate';
6
+ import { TCreateObjectTemplateArgs } from '../../services/TemplateListing';
7
+ export type TGetTemplateCategoryList = {
8
+ args: TGetCategoryListArgs;
9
+ options?: UseQueryOptions<any, any, TemplateCategory[], any[]>;
10
+ };
11
+ export type TGetSaveAsGalleryPermissionEmails = {
12
+ args: TGetSaveAsGalleryPermissionArgs;
13
+ options?: UseQueryOptions<any, any, string[], any[]>;
14
+ };
15
+ export type TGetObjectTEmplateList = {
16
+ args: TGetObjectTemplateListArgs;
17
+ options?: UseInfiniteQueryOptions<any, any, ResponseListing<ObjectTemplate>, (string | number)[]>;
18
+ };
19
+ export type TGetObjectTemplateDetail = {
20
+ args: TGetObjectTemplateDetailArgs;
21
+ options?: UseQueryOptions<ObjectTemplate, any, ObjectTemplate, any[]>;
22
+ };
23
+ export type TBulkUpdateTemplate = {
24
+ options?: UseMutationOptions<any, any, TBulkUpdateObjectTemplateArgs, unknown>;
25
+ };
26
+ export type TUseCreateTemplate = {
27
+ options?: UseMutationOptions<any, any, TCreateObjectTemplateArgs, unknown>;
28
+ };
29
+ export type TUseUpdateTemplate = {
30
+ options?: UseMutationOptions<any, any, TUpdateObjectTemplateArgs, unknown>;
31
+ };
32
+ export type TUseValidateTemplateName = {
33
+ options?: UseMutationOptions<ResponseCheckNameExist, any, TValidateObjectTemplateNameArgs, unknown>;
34
+ };
35
+ export type TUsePersistTemplate = {
36
+ options?: UseMutationOptions<ObjectTemplate, any, {
37
+ persistType: 'create' | 'update';
38
+ params: TUpdateObjectTemplateArgs;
39
+ }, unknown>;
40
+ };
41
+ export declare const useGetTemplateCategoryList: (params: TGetTemplateCategoryList) => import("@tanstack/react-query").UseQueryResult<TemplateCategory[], any>;
42
+ export declare const useGetSaveAsGalleryPermissionEmails: (params: TGetSaveAsGalleryPermissionEmails) => import("@tanstack/react-query").UseQueryResult<string[], any>;
43
+ export declare const useGetObjectTemplateList: (params: TGetObjectTEmplateList) => import("@tanstack/react-query").UseInfiniteQueryResult<ResponseListing<ObjectTemplate>, any>;
44
+ export declare const useGetObjectTemplateDetail: (params: TGetObjectTemplateDetail) => import("@tanstack/react-query").UseQueryResult<ObjectTemplate, any>;
45
+ export declare const useValidateTemplateName: (params: TUseValidateTemplateName) => import("@tanstack/react-query").UseMutationResult<ResponseCheckNameExist, any, TValidateObjectTemplateNameArgs, unknown>;
46
+ export declare const useBulkUpdateTemplate: (params: TBulkUpdateTemplate) => import("@tanstack/react-query").UseMutationResult<any, any, TBulkUpdateObjectTemplateArgs, unknown>;
47
+ export declare const useCreateTemplate: (params: TUseCreateTemplate) => import("@tanstack/react-query").UseMutationResult<any, any, TCreateObjectTemplateArgs, unknown>;
48
+ export declare const useUpdateTemplate: (params: TUseUpdateTemplate) => import("@tanstack/react-query").UseMutationResult<any, any, TUpdateObjectTemplateArgs, unknown>;
49
+ export declare const usePersistTemplate: (params: TUsePersistTemplate) => import("@tanstack/react-query").UseMutationResult<ObjectTemplate, any, {
50
+ persistType: 'create' | 'update';
51
+ params: TUpdateObjectTemplateArgs;
52
+ }, unknown>;
@@ -0,0 +1,105 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ // Libraries
11
+ import { useInfiniteQuery, useMutation, useQuery, useQueryClient, } from '@tanstack/react-query';
12
+ import { get, omit } from 'lodash';
13
+ // Services
14
+ import { templateListingServices, } from '@antscorp/antsomi-ui/es/services/TemplateListing';
15
+ // Constants
16
+ import { QUERY_KEYS } from '../../constants/queries';
17
+ const { category, objectTemplate } = templateListingServices;
18
+ export const useGetTemplateCategoryList = (params) => {
19
+ const { options, args } = params;
20
+ return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST, args.params], queryFn: () => category.getList(params.args), onSuccess() { } }, options));
21
+ };
22
+ export const useGetSaveAsGalleryPermissionEmails = (params) => {
23
+ const { options } = params;
24
+ return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_SAVE_AS_GALLERY_PERMISSION_EMAILS], queryFn: () => objectTemplate.getSaveAsGalleryPermission(params.args), onSuccess() { } }, options));
25
+ };
26
+ export const useGetObjectTemplateList = (params) => {
27
+ const { options, args } = params;
28
+ return useInfiniteQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST, args.params], queryFn: ({ pageParam = 1 }) => __awaiter(void 0, void 0, void 0, function* () {
29
+ const res = yield objectTemplate.getList(Object.assign(Object.assign({}, args), { params: Object.assign(Object.assign({}, args.params), { page: pageParam }) }));
30
+ return res;
31
+ }), getNextPageParam: lastPage => {
32
+ const { meta } = lastPage;
33
+ const { currentPage, totalPages } = meta;
34
+ return +currentPage < +totalPages ? Number(lastPage.meta.currentPage) + 1 : undefined;
35
+ } }, options));
36
+ };
37
+ export const useGetObjectTemplateDetail = (params) => {
38
+ const { args, options } = params;
39
+ return useQuery(Object.assign({ queryKey: [QUERY_KEYS.GET_OBJECT_TEMPLATE_DETAIL, +args.params.template_id], queryFn: () => objectTemplate.getDetail(args), enabled: !!args.params.template_id }, options));
40
+ };
41
+ export const useValidateTemplateName = (params) => {
42
+ const { options } = params;
43
+ return useMutation(Object.assign({ mutationFn: objectTemplate.validateName }, options));
44
+ };
45
+ export const useBulkUpdateTemplate = (params) => {
46
+ const { options } = params;
47
+ const queryClient = useQueryClient();
48
+ return useMutation(Object.assign({ mutationFn: objectTemplate.bulkUpdate, onSettled() {
49
+ queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
50
+ exact: false,
51
+ });
52
+ queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
53
+ exact: false,
54
+ });
55
+ } }, options));
56
+ };
57
+ export const useCreateTemplate = (params) => {
58
+ const { options } = params;
59
+ const queryClient = useQueryClient();
60
+ return useMutation(Object.assign({ mutationFn: objectTemplate.create, onSettled() {
61
+ queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
62
+ exact: false,
63
+ });
64
+ queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
65
+ exact: false,
66
+ });
67
+ } }, options));
68
+ };
69
+ export const useUpdateTemplate = (params) => {
70
+ const { options } = params;
71
+ const queryClient = useQueryClient();
72
+ return useMutation(Object.assign({ mutationFn: objectTemplate.update, onSettled() {
73
+ queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
74
+ exact: false,
75
+ });
76
+ queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
77
+ exact: false,
78
+ });
79
+ } }, options));
80
+ };
81
+ export const usePersistTemplate = (params) => {
82
+ const { options } = params;
83
+ const queryClient = useQueryClient();
84
+ return useMutation(Object.assign({ mutationFn: (args) => {
85
+ const { persistType, params } = args;
86
+ switch (persistType) {
87
+ case 'update':
88
+ return objectTemplate.update(params);
89
+ case 'create':
90
+ default:
91
+ return objectTemplate.create(Object.assign(Object.assign({}, params), { data: omit(params.data, ['template_id']) }));
92
+ }
93
+ }, onSettled(data, error, variables) {
94
+ queryClient.invalidateQueries([
95
+ QUERY_KEYS.GET_OBJECT_TEMPLATE_DETAIL,
96
+ +get(variables, 'params.data.template_id', -1),
97
+ ]);
98
+ queryClient.invalidateQueries([QUERY_KEYS.GET_OBJECT_TEMPLATE_LIST], {
99
+ exact: false,
100
+ });
101
+ queryClient.invalidateQueries([QUERY_KEYS.GET_TEMPLATE_CATEGORY_LIST], {
102
+ exact: false,
103
+ });
104
+ } }, options));
105
+ };
@@ -4,3 +4,4 @@ export * from './CustomFunction';
4
4
  export * from './PromotionPool';
5
5
  export * from './DynamicContentAttribute';
6
6
  export * from './ThirdParty';
7
+ export * from './TemplateListing';
@@ -4,3 +4,4 @@ export * from './CustomFunction';
4
4
  export * from './PromotionPool';
5
5
  export * from './DynamicContentAttribute';
6
6
  export * from './ThirdParty';
7
+ export * from './TemplateListing';
@@ -0,0 +1,70 @@
1
+ import { PaginationRequest, PayloadInfo, ResponseCheckNameExist, ResponseListing, TGetListType, TServiceAuth } from '../../types';
2
+ import { TObjectType, TPublicLevel } from '../../types/templateListing';
3
+ import { TThumbnailCardId } from '../../components/molecules/ThumbnailCard';
4
+ import { TemplateCategory } from '../../models/TemplateCategory';
5
+ import { ObjectTemplate, TObjectTemplate } from '../../models/ObjectTemplate';
6
+ export type TGetCategoryListArgs = {
7
+ params: {
8
+ objectTypes: TObjectType[];
9
+ categoryCodes?: string[];
10
+ publicLevel?: TPublicLevel;
11
+ getListType?: TGetListType;
12
+ };
13
+ auth: PayloadInfo;
14
+ };
15
+ export type TGetObjectTemplateDetailArgs = {
16
+ params: {
17
+ template_id: TThumbnailCardId;
18
+ object_type: TObjectType;
19
+ public_level: TPublicLevel;
20
+ };
21
+ auth: PayloadInfo;
22
+ };
23
+ export type TGetObjectTemplateListArgs = {
24
+ params: {
25
+ object_type: TObjectType;
26
+ public_level: TPublicLevel;
27
+ get_list_type: TGetListType;
28
+ } & PaginationRequest;
29
+ auth: TServiceAuth;
30
+ };
31
+ export type TBulkUpdateObjectTemplateArgs = {
32
+ params: {
33
+ template_ids: number[];
34
+ data: Partial<TObjectTemplate>;
35
+ };
36
+ auth: TServiceAuth;
37
+ };
38
+ export type TUpdateObjectTemplateArgs = {
39
+ data: Partial<TObjectTemplate>;
40
+ auth: TServiceAuth;
41
+ };
42
+ export type TCreateObjectTemplateArgs = {
43
+ data: Partial<TObjectTemplate>;
44
+ auth: TServiceAuth;
45
+ };
46
+ export type TGetSaveAsGalleryPermissionArgs = {
47
+ auth: TServiceAuth;
48
+ };
49
+ export type TValidateObjectTemplateNameArgs = {
50
+ params: {
51
+ template_name: string;
52
+ object_type: TObjectType;
53
+ public_level: TPublicLevel;
54
+ };
55
+ auth: TServiceAuth;
56
+ };
57
+ export declare const templateListingServices: {
58
+ category: {
59
+ getList: ({ params, auth }: TGetCategoryListArgs) => Promise<TemplateCategory[]>;
60
+ };
61
+ objectTemplate: {
62
+ getList: ({ params, auth, }: TGetObjectTemplateListArgs) => Promise<ResponseListing<ObjectTemplate>>;
63
+ getDetail: ({ params, auth }: TGetObjectTemplateDetailArgs) => Promise<ObjectTemplate>;
64
+ create: ({ data, auth }: TCreateObjectTemplateArgs) => Promise<ObjectTemplate>;
65
+ update: ({ data, auth }: TUpdateObjectTemplateArgs) => Promise<ObjectTemplate>;
66
+ bulkUpdate: ({ params, auth }: TBulkUpdateObjectTemplateArgs) => Promise<any>;
67
+ validateName: ({ params, auth, }: TValidateObjectTemplateNameArgs) => Promise<ResponseCheckNameExist>;
68
+ getSaveAsGalleryPermission: ({ auth, }: TGetSaveAsGalleryPermissionArgs) => Promise<string[]>;
69
+ };
70
+ };
@@ -0,0 +1,161 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
21
+ // Libraries
22
+ import { get } from 'lodash';
23
+ import isEmpty from 'lodash/isEmpty';
24
+ // Services
25
+ // Types
26
+ import axios from 'axios';
27
+ import { ObjectTemplate } from '../../models/ObjectTemplate';
28
+ const TEMPLATE_CATEGORY_ROUTE = 'template-category/index';
29
+ const OBJECT_TEMPLATE_ROUTE = 'object_template';
30
+ export const templateListingServices = {
31
+ category: {
32
+ getList: ({ params, auth }) => __awaiter(void 0, void 0, void 0, function* () {
33
+ try {
34
+ const { objectTypes = [], categoryCodes, publicLevel, getListType } = params;
35
+ const response = yield axios({
36
+ method: 'GET',
37
+ url: `${auth.url}/${TEMPLATE_CATEGORY_ROUTE}`,
38
+ params: Object.assign({ _token: auth.token, _user_id: auth.userId, _account_id: auth.accountId, objectTypes: objectTypes.join(','), publicLevel: publicLevel !== null && publicLevel !== void 0 ? publicLevel : 0, getListType }, (!isEmpty(categoryCodes) ? { categoryCodes: categoryCodes === null || categoryCodes === void 0 ? void 0 : categoryCodes.join(',') } : {})),
39
+ });
40
+ return get(response, 'data.data', []);
41
+ }
42
+ catch (error) {
43
+ return Promise.reject(error);
44
+ }
45
+ }),
46
+ },
47
+ objectTemplate: {
48
+ getList: ({ params, auth, }) => __awaiter(void 0, void 0, void 0, function* () {
49
+ try {
50
+ const response = yield axios({
51
+ method: 'GET',
52
+ url: `${auth.url}/${OBJECT_TEMPLATE_ROUTE}`,
53
+ params: Object.assign({ _token: auth.token, _user_id: auth.userId, _account_id: auth.accountId }, params),
54
+ });
55
+ const { entities, meta } = get(response, 'data.data', {});
56
+ return {
57
+ entities: entities.map(entity => new ObjectTemplate(entity)),
58
+ meta,
59
+ };
60
+ }
61
+ catch (error) {
62
+ return Promise.reject(error);
63
+ }
64
+ }),
65
+ getDetail: ({ params, auth }) => __awaiter(void 0, void 0, void 0, function* () {
66
+ try {
67
+ const { template_id } = params, restOfPrams = __rest(params, ["template_id"]);
68
+ const response = yield axios({
69
+ method: 'GET',
70
+ url: `${auth.url}/${OBJECT_TEMPLATE_ROUTE}/${template_id}`,
71
+ params: Object.assign({ _token: auth.token, _user_id: auth.userId, _account_id: auth.accountId }, restOfPrams),
72
+ });
73
+ return new ObjectTemplate(get(response, 'data.data', {}));
74
+ }
75
+ catch (error) {
76
+ return Promise.reject(error);
77
+ }
78
+ }),
79
+ create: ({ data, auth }) => __awaiter(void 0, void 0, void 0, function* () {
80
+ try {
81
+ const response = yield axios({
82
+ method: 'POST',
83
+ url: `${auth.url}/${OBJECT_TEMPLATE_ROUTE}`,
84
+ params: {
85
+ _token: auth.token,
86
+ _user_id: auth.userId,
87
+ _account_id: auth.accountId,
88
+ },
89
+ data,
90
+ });
91
+ return new ObjectTemplate(get(response, 'data.data', {}));
92
+ }
93
+ catch (error) {
94
+ return Promise.reject(error);
95
+ }
96
+ }),
97
+ update: ({ data, auth }) => __awaiter(void 0, void 0, void 0, function* () {
98
+ try {
99
+ const { template_id } = data, restOfData = __rest(data, ["template_id"]);
100
+ const response = yield axios({
101
+ method: 'PUT',
102
+ url: `${auth.url}/${OBJECT_TEMPLATE_ROUTE}/${template_id}`,
103
+ params: {
104
+ _token: auth.token,
105
+ _user_id: auth.userId,
106
+ _account_id: auth.accountId,
107
+ },
108
+ data: restOfData,
109
+ });
110
+ return new ObjectTemplate(get(response, 'data.data', {}));
111
+ }
112
+ catch (error) {
113
+ return Promise.reject(error);
114
+ }
115
+ }),
116
+ bulkUpdate: ({ params, auth }) => __awaiter(void 0, void 0, void 0, function* () {
117
+ try {
118
+ const response = yield axios({
119
+ method: 'POST',
120
+ url: `${auth.url}/${OBJECT_TEMPLATE_ROUTE}/bulk-update`,
121
+ params: {
122
+ _token: auth.token,
123
+ _user_id: auth.userId,
124
+ _account_id: auth.accountId,
125
+ template_ids: (params.template_ids || []).join(','),
126
+ },
127
+ data: params.data,
128
+ });
129
+ return get(response, 'data.data', {});
130
+ }
131
+ catch (error) {
132
+ return Promise.reject(error);
133
+ }
134
+ }),
135
+ validateName: ({ params, auth, }) => __awaiter(void 0, void 0, void 0, function* () {
136
+ try {
137
+ const response = yield axios({
138
+ method: 'POST',
139
+ url: `${auth.url}/${OBJECT_TEMPLATE_ROUTE}/validate-name`,
140
+ params: Object.assign({ _token: auth.token, _user_id: auth.userId, _account_id: auth.accountId }, params),
141
+ });
142
+ return get(response, 'data.data', {});
143
+ }
144
+ catch (error) {
145
+ return Promise.reject(error);
146
+ }
147
+ }),
148
+ getSaveAsGalleryPermission: ({ auth, }) => __awaiter(void 0, void 0, void 0, function* () {
149
+ try {
150
+ const response = yield axios({
151
+ method: 'GET',
152
+ url: `${auth.url}/${OBJECT_TEMPLATE_ROUTE}/save-as-gallery-permission-emails`,
153
+ });
154
+ return get(response, 'data.data', []);
155
+ }
156
+ catch (error) {
157
+ return Promise.reject(error);
158
+ }
159
+ }),
160
+ },
161
+ };