@webiny/app-scheduler 0.0.0-unstable.7be00a75a9

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 (429) hide show
  1. package/Domain/Models/SchedulerItem/SchedulerItem.d.ts +13 -0
  2. package/Domain/Models/SchedulerItem/SchedulerItem.js +18 -0
  3. package/Domain/Models/SchedulerItem/SchedulerItem.js.map +1 -0
  4. package/Domain/Models/SchedulerItem/index.d.ts +1 -0
  5. package/Domain/Models/SchedulerItem/index.js +1 -0
  6. package/Domain/Models/index.d.ts +1 -0
  7. package/Domain/Models/index.js +1 -0
  8. package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.d.ts +14 -0
  9. package/Domain/Repositories/SchedulerItems/ISchedulerItemsRepository.js +0 -0
  10. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.d.ts +36 -0
  11. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js +119 -0
  12. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepository.js.map +1 -0
  13. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.d.ts +19 -0
  14. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js +18 -0
  15. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryFactory.js.map +1 -0
  16. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.d.ts +17 -0
  17. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js +39 -0
  18. package/Domain/Repositories/SchedulerItems/SchedulerItemsRepositoryWithLoading.js.map +1 -0
  19. package/Domain/Repositories/SchedulerItems/index.d.ts +4 -0
  20. package/Domain/Repositories/SchedulerItems/index.js +3 -0
  21. package/Domain/Repositories/Search/ISearchRepository.d.ts +4 -0
  22. package/Domain/Repositories/Search/ISearchRepository.js +0 -0
  23. package/Domain/Repositories/Search/SearchRepository.d.ts +7 -0
  24. package/Domain/Repositories/Search/SearchRepository.js +16 -0
  25. package/Domain/Repositories/Search/SearchRepository.js.map +1 -0
  26. package/Domain/Repositories/Search/SearchRepositoryFactory.d.ts +7 -0
  27. package/Domain/Repositories/Search/SearchRepositoryFactory.js +18 -0
  28. package/Domain/Repositories/Search/SearchRepositoryFactory.js.map +1 -0
  29. package/Domain/Repositories/Search/index.d.ts +3 -0
  30. package/Domain/Repositories/Search/index.js +2 -0
  31. package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.d.ts +8 -0
  32. package/Domain/Repositories/SelectedItems/ISelectedItemsRepository.js +0 -0
  33. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.d.ts +12 -0
  34. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js +28 -0
  35. package/Domain/Repositories/SelectedItems/SelectedItemsRepository.js.map +1 -0
  36. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.d.ts +7 -0
  37. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js +18 -0
  38. package/Domain/Repositories/SelectedItems/SelectedItemsRepositoryFactory.js.map +1 -0
  39. package/Domain/Repositories/SelectedItems/index.d.ts +3 -0
  40. package/Domain/Repositories/SelectedItems/index.js +2 -0
  41. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.d.ts +8 -0
  42. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js +21 -0
  43. package/Domain/Repositories/Sorting/SortingRepositoryWithDefaults.js.map +1 -0
  44. package/Domain/Repositories/Sorting/index.d.ts +1 -0
  45. package/Domain/Repositories/Sorting/index.js +1 -0
  46. package/Domain/Repositories/index.d.ts +4 -0
  47. package/Domain/Repositories/index.js +4 -0
  48. package/Domain/index.d.ts +2 -0
  49. package/Domain/index.js +2 -0
  50. package/Gateways/SchedulerCancelGraphQLGateway.d.ts +7 -0
  51. package/Gateways/SchedulerCancelGraphQLGateway.js +42 -0
  52. package/Gateways/SchedulerCancelGraphQLGateway.js.map +1 -0
  53. package/Gateways/SchedulerGetGraphQLGateway.d.ts +21 -0
  54. package/Gateways/SchedulerGetGraphQLGateway.js +68 -0
  55. package/Gateways/SchedulerGetGraphQLGateway.js.map +1 -0
  56. package/Gateways/SchedulerListGraphQLGateway.d.ts +7 -0
  57. package/Gateways/SchedulerListGraphQLGateway.js +86 -0
  58. package/Gateways/SchedulerListGraphQLGateway.js.map +1 -0
  59. package/Gateways/SchedulerPublishGraphQLGateway.d.ts +7 -0
  60. package/Gateways/SchedulerPublishGraphQLGateway.js +59 -0
  61. package/Gateways/SchedulerPublishGraphQLGateway.js.map +1 -0
  62. package/Gateways/SchedulerUnpublishGraphQLGateway.d.ts +23 -0
  63. package/Gateways/SchedulerUnpublishGraphQLGateway.js +63 -0
  64. package/Gateways/SchedulerUnpublishGraphQLGateway.js.map +1 -0
  65. package/Gateways/abstractions/CancelScheduledActionGateway.d.ts +7 -0
  66. package/Gateways/abstractions/CancelScheduledActionGateway.js +0 -0
  67. package/Gateways/abstractions/GetScheduledActionGateway.d.ts +9 -0
  68. package/Gateways/abstractions/GetScheduledActionGateway.js +0 -0
  69. package/Gateways/abstractions/ListScheduledActionsGateway.d.ts +27 -0
  70. package/Gateways/abstractions/ListScheduledActionsGateway.js +0 -0
  71. package/Gateways/abstractions/SchedulePublishActionGateway.d.ts +12 -0
  72. package/Gateways/abstractions/SchedulePublishActionGateway.js +0 -0
  73. package/Gateways/abstractions/ScheduleUnpublishActionGateway.d.ts +12 -0
  74. package/Gateways/abstractions/ScheduleUnpublishActionGateway.js +0 -0
  75. package/Gateways/graphql/fields.d.ts +1 -0
  76. package/Gateways/graphql/fields.js +17 -0
  77. package/Gateways/graphql/fields.js.map +1 -0
  78. package/Gateways/index.d.ts +5 -0
  79. package/Gateways/index.js +0 -0
  80. package/Gateways/schema/schedulerEntry.d.ts +16 -0
  81. package/Gateways/schema/schedulerEntry.js +19 -0
  82. package/Gateways/schema/schedulerEntry.js.map +1 -0
  83. package/LICENSE +21 -0
  84. package/Presentation/Scheduler/Scheduler.d.ts +17 -0
  85. package/Presentation/Scheduler/Scheduler.js +78 -0
  86. package/Presentation/Scheduler/Scheduler.js.map +1 -0
  87. package/Presentation/Scheduler/SchedulerControllers.d.ts +30 -0
  88. package/Presentation/Scheduler/SchedulerControllers.js +54 -0
  89. package/Presentation/Scheduler/SchedulerControllers.js.map +1 -0
  90. package/Presentation/Scheduler/SchedulerPresenter.d.ts +32 -0
  91. package/Presentation/Scheduler/SchedulerPresenter.js +45 -0
  92. package/Presentation/Scheduler/SchedulerPresenter.js.map +1 -0
  93. package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.d.ts +7 -0
  94. package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js +12 -0
  95. package/Presentation/Scheduler/controllers/CancelItem/CancelItemController.js.map +1 -0
  96. package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.d.ts +3 -0
  97. package/Presentation/Scheduler/controllers/CancelItem/ICancelItemController.js +0 -0
  98. package/Presentation/Scheduler/controllers/CancelItem/index.d.ts +2 -0
  99. package/Presentation/Scheduler/controllers/CancelItem/index.js +1 -0
  100. package/Presentation/Scheduler/controllers/GetItem/GetItemController.d.ts +8 -0
  101. package/Presentation/Scheduler/controllers/GetItem/GetItemController.js +12 -0
  102. package/Presentation/Scheduler/controllers/GetItem/GetItemController.js.map +1 -0
  103. package/Presentation/Scheduler/controllers/GetItem/IGetItemController.d.ts +4 -0
  104. package/Presentation/Scheduler/controllers/GetItem/IGetItemController.js +0 -0
  105. package/Presentation/Scheduler/controllers/GetItem/index.d.ts +2 -0
  106. package/Presentation/Scheduler/controllers/GetItem/index.js +1 -0
  107. package/Presentation/Scheduler/controllers/ListItems/IListItemsController.d.ts +4 -0
  108. package/Presentation/Scheduler/controllers/ListItems/IListItemsController.js +0 -0
  109. package/Presentation/Scheduler/controllers/ListItems/ListItemsController.d.ts +8 -0
  110. package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js +12 -0
  111. package/Presentation/Scheduler/controllers/ListItems/ListItemsController.js.map +1 -0
  112. package/Presentation/Scheduler/controllers/ListItems/index.d.ts +2 -0
  113. package/Presentation/Scheduler/controllers/ListItems/index.js +1 -0
  114. package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.d.ts +3 -0
  115. package/Presentation/Scheduler/controllers/ListMoreItems/IListMoreItemsController.js +0 -0
  116. package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.d.ts +7 -0
  117. package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js +12 -0
  118. package/Presentation/Scheduler/controllers/ListMoreItems/ListMoreItemsController.js.map +1 -0
  119. package/Presentation/Scheduler/controllers/ListMoreItems/index.d.ts +2 -0
  120. package/Presentation/Scheduler/controllers/ListMoreItems/index.js +1 -0
  121. package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.d.ts +3 -0
  122. package/Presentation/Scheduler/controllers/PublishItem/IPublishItemController.js +0 -0
  123. package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.d.ts +7 -0
  124. package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js +12 -0
  125. package/Presentation/Scheduler/controllers/PublishItem/PublishItemController.js.map +1 -0
  126. package/Presentation/Scheduler/controllers/PublishItem/index.d.ts +2 -0
  127. package/Presentation/Scheduler/controllers/PublishItem/index.js +1 -0
  128. package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.d.ts +3 -0
  129. package/Presentation/Scheduler/controllers/SearchItems/ISearchItemsController.js +0 -0
  130. package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.d.ts +8 -0
  131. package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js +15 -0
  132. package/Presentation/Scheduler/controllers/SearchItems/SearchItemsController.js.map +1 -0
  133. package/Presentation/Scheduler/controllers/SearchItems/index.d.ts +2 -0
  134. package/Presentation/Scheduler/controllers/SearchItems/index.js +1 -0
  135. package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.d.ts +3 -0
  136. package/Presentation/Scheduler/controllers/SelectAllItems/ISelectAllItemsController.js +0 -0
  137. package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.d.ts +7 -0
  138. package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js +12 -0
  139. package/Presentation/Scheduler/controllers/SelectAllItems/SelectAllItemsController.js.map +1 -0
  140. package/Presentation/Scheduler/controllers/SelectAllItems/index.d.ts +2 -0
  141. package/Presentation/Scheduler/controllers/SelectAllItems/index.js +1 -0
  142. package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.d.ts +4 -0
  143. package/Presentation/Scheduler/controllers/SelectItems/ISelectItemsController.js +0 -0
  144. package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.d.ts +8 -0
  145. package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js +14 -0
  146. package/Presentation/Scheduler/controllers/SelectItems/SelectItemsController.js.map +1 -0
  147. package/Presentation/Scheduler/controllers/SelectItems/index.d.ts +2 -0
  148. package/Presentation/Scheduler/controllers/SelectItems/index.js +1 -0
  149. package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.d.ts +4 -0
  150. package/Presentation/Scheduler/controllers/SortItems/ISortItemsController.js +0 -0
  151. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.d.ts +9 -0
  152. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js +18 -0
  153. package/Presentation/Scheduler/controllers/SortItems/SortItemsController.js.map +1 -0
  154. package/Presentation/Scheduler/controllers/SortItems/index.d.ts +2 -0
  155. package/Presentation/Scheduler/controllers/SortItems/index.js +1 -0
  156. package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.d.ts +3 -0
  157. package/Presentation/Scheduler/controllers/UnpublishItem/IUnpublishItemController.js +0 -0
  158. package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.d.ts +7 -0
  159. package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js +12 -0
  160. package/Presentation/Scheduler/controllers/UnpublishItem/UnpublishItemController.js.map +1 -0
  161. package/Presentation/Scheduler/controllers/UnpublishItem/index.d.ts +2 -0
  162. package/Presentation/Scheduler/controllers/UnpublishItem/index.js +1 -0
  163. package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.d.ts +3 -0
  164. package/Presentation/Scheduler/controllers/UnselectAllItems/IUnselectAllItemsController.js +0 -0
  165. package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.d.ts +7 -0
  166. package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js +12 -0
  167. package/Presentation/Scheduler/controllers/UnselectAllItems/UnselectAllItemsController.js.map +1 -0
  168. package/Presentation/Scheduler/controllers/UnselectAllItems/index.d.ts +2 -0
  169. package/Presentation/Scheduler/controllers/UnselectAllItems/index.js +1 -0
  170. package/Presentation/Scheduler/controllers/index.d.ts +11 -0
  171. package/Presentation/Scheduler/controllers/index.js +11 -0
  172. package/Presentation/Scheduler/index.d.ts +1 -0
  173. package/Presentation/Scheduler/index.js +1 -0
  174. package/Presentation/SchedulerConfigs/SchedulerConfigs.d.ts +2 -0
  175. package/Presentation/SchedulerConfigs/SchedulerConfigs.js +52 -0
  176. package/Presentation/SchedulerConfigs/SchedulerConfigs.js.map +1 -0
  177. package/Presentation/SchedulerConfigs/index.d.ts +1 -0
  178. package/Presentation/SchedulerConfigs/index.js +1 -0
  179. package/Presentation/SchedulerRenderer/SchedulerRenderer.d.ts +6 -0
  180. package/Presentation/SchedulerRenderer/SchedulerRenderer.js +16 -0
  181. package/Presentation/SchedulerRenderer/SchedulerRenderer.js.map +1 -0
  182. package/Presentation/SchedulerRenderer/index.d.ts +1 -0
  183. package/Presentation/SchedulerRenderer/index.js +1 -0
  184. package/Presentation/abstractions/ISchedulerControllers.d.ts +14 -0
  185. package/Presentation/abstractions/ISchedulerControllers.js +0 -0
  186. package/Presentation/abstractions/ISchedulerPresenter.d.ts +20 -0
  187. package/Presentation/abstractions/ISchedulerPresenter.js +0 -0
  188. package/Presentation/abstractions/index.d.ts +2 -0
  189. package/Presentation/abstractions/index.js +0 -0
  190. package/Presentation/components/Actions/CancelItem/CancelItem.d.ts +2 -0
  191. package/Presentation/components/Actions/CancelItem/CancelItem.js +19 -0
  192. package/Presentation/components/Actions/CancelItem/CancelItem.js.map +1 -0
  193. package/Presentation/components/Actions/CancelItem/index.d.ts +1 -0
  194. package/Presentation/components/Actions/CancelItem/index.js +1 -0
  195. package/Presentation/components/Actions/index.d.ts +1 -0
  196. package/Presentation/components/Actions/index.js +1 -0
  197. package/Presentation/components/BottomInfoBar/BottomInfoBar.d.ts +2 -0
  198. package/Presentation/components/BottomInfoBar/BottomInfoBar.js +19 -0
  199. package/Presentation/components/BottomInfoBar/BottomInfoBar.js.map +1 -0
  200. package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.d.ts +20 -0
  201. package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.js +43 -0
  202. package/Presentation/components/BottomInfoBar/BottomInfoBar.styled.js.map +1 -0
  203. package/Presentation/components/BottomInfoBar/ListMeta.d.ts +7 -0
  204. package/Presentation/components/BottomInfoBar/ListMeta.js +9 -0
  205. package/Presentation/components/BottomInfoBar/ListMeta.js.map +1 -0
  206. package/Presentation/components/BottomInfoBar/ListStatus.d.ts +5 -0
  207. package/Presentation/components/BottomInfoBar/ListStatus.js +12 -0
  208. package/Presentation/components/BottomInfoBar/ListStatus.js.map +1 -0
  209. package/Presentation/components/BottomInfoBar/index.d.ts +1 -0
  210. package/Presentation/components/BottomInfoBar/index.js +1 -0
  211. package/Presentation/components/Cells/CellActions/CellActions.d.ts +2 -0
  212. package/Presentation/components/Cells/CellActions/CellActions.js +18 -0
  213. package/Presentation/components/Cells/CellActions/CellActions.js.map +1 -0
  214. package/Presentation/components/Cells/CellActions/index.d.ts +1 -0
  215. package/Presentation/components/Cells/CellActions/index.js +1 -0
  216. package/Presentation/components/Cells/CellRevision/CellRevision.d.ts +2 -0
  217. package/Presentation/components/Cells/CellRevision/CellRevision.js +15 -0
  218. package/Presentation/components/Cells/CellRevision/CellRevision.js.map +1 -0
  219. package/Presentation/components/Cells/CellRevision/CellRevision.styled.d.ts +11 -0
  220. package/Presentation/components/Cells/CellRevision/CellRevision.styled.js +18 -0
  221. package/Presentation/components/Cells/CellRevision/CellRevision.styled.js.map +1 -0
  222. package/Presentation/components/Cells/CellRevision/index.d.ts +1 -0
  223. package/Presentation/components/Cells/CellRevision/index.js +1 -0
  224. package/Presentation/components/Cells/CellScheduledBy/CellScheduledBy.d.ts +2 -0
  225. package/Presentation/components/Cells/CellScheduledBy/CellScheduledBy.js +10 -0
  226. package/Presentation/components/Cells/CellScheduledBy/CellScheduledBy.js.map +1 -0
  227. package/Presentation/components/Cells/CellScheduledBy/index.d.ts +1 -0
  228. package/Presentation/components/Cells/CellScheduledBy/index.js +1 -0
  229. package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.d.ts +24 -0
  230. package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.js +17 -0
  231. package/Presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -0
  232. package/Presentation/components/Cells/CellScheduledOn/index.d.ts +1 -0
  233. package/Presentation/components/Cells/CellScheduledOn/index.js +1 -0
  234. package/Presentation/components/Cells/CellTitle/CellTitle.d.ts +2 -0
  235. package/Presentation/components/Cells/CellTitle/CellTitle.js +14 -0
  236. package/Presentation/components/Cells/CellTitle/CellTitle.js.map +1 -0
  237. package/Presentation/components/Cells/CellTitle/CellTitle.styled.d.ts +11 -0
  238. package/Presentation/components/Cells/CellTitle/CellTitle.styled.js +18 -0
  239. package/Presentation/components/Cells/CellTitle/CellTitle.styled.js.map +1 -0
  240. package/Presentation/components/Cells/CellTitle/index.d.ts +1 -0
  241. package/Presentation/components/Cells/CellTitle/index.js +1 -0
  242. package/Presentation/components/Cells/CellType/CellActionType.d.ts +2 -0
  243. package/Presentation/components/Cells/CellType/CellActionType.js +15 -0
  244. package/Presentation/components/Cells/CellType/CellActionType.js.map +1 -0
  245. package/Presentation/components/Cells/CellType/CellActionType.styled.d.ts +11 -0
  246. package/Presentation/components/Cells/CellType/CellActionType.styled.js +18 -0
  247. package/Presentation/components/Cells/CellType/CellActionType.styled.js.map +1 -0
  248. package/Presentation/components/Cells/CellType/index.d.ts +1 -0
  249. package/Presentation/components/Cells/CellType/index.js +1 -0
  250. package/Presentation/components/Cells/index.d.ts +6 -0
  251. package/Presentation/components/Cells/index.js +6 -0
  252. package/Presentation/components/Empty/Empty.d.ts +2 -0
  253. package/Presentation/components/Empty/Empty.js +21 -0
  254. package/Presentation/components/Empty/Empty.js.map +1 -0
  255. package/Presentation/components/Empty/Empty.styled.d.ts +8 -0
  256. package/Presentation/components/Empty/Empty.styled.js +16 -0
  257. package/Presentation/components/Empty/Empty.styled.js.map +1 -0
  258. package/Presentation/components/Empty/index.d.ts +1 -0
  259. package/Presentation/components/Empty/index.js +1 -0
  260. package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.d.ts +26 -0
  261. package/Presentation/components/ScheduleDialog/IScheduleDialogPresenter.js +0 -0
  262. package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.d.ts +22 -0
  263. package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js +86 -0
  264. package/Presentation/components/ScheduleDialog/ScheduleDialogPresenter.js.map +1 -0
  265. package/Presentation/components/ScheduleDialog/index.d.ts +1 -0
  266. package/Presentation/components/ScheduleDialog/index.js +1 -0
  267. package/Presentation/components/ScheduleDialog/types.d.ts +15 -0
  268. package/Presentation/components/ScheduleDialog/types.js +0 -0
  269. package/Presentation/components/ScheduleDialog/useScheduleDialog.d.ts +41 -0
  270. package/Presentation/components/ScheduleDialog/useScheduleDialog.js +192 -0
  271. package/Presentation/components/ScheduleDialog/useScheduleDialog.js.map +1 -0
  272. package/Presentation/components/SchedulerOverlay/SchedulerOverlay.d.ts +7 -0
  273. package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js +30 -0
  274. package/Presentation/components/SchedulerOverlay/SchedulerOverlay.js.map +1 -0
  275. package/Presentation/components/SchedulerOverlay/index.d.ts +1 -0
  276. package/Presentation/components/SchedulerOverlay/index.js +1 -0
  277. package/Presentation/components/SearchInput/SearchInput.d.ts +2 -0
  278. package/Presentation/components/SearchInput/SearchInput.js +30 -0
  279. package/Presentation/components/SearchInput/SearchInput.js.map +1 -0
  280. package/Presentation/components/SearchInput/index.d.ts +1 -0
  281. package/Presentation/components/SearchInput/index.js +1 -0
  282. package/Presentation/components/Table/Table.d.ts +2 -0
  283. package/Presentation/components/Table/Table.js +29 -0
  284. package/Presentation/components/Table/Table.js.map +1 -0
  285. package/Presentation/components/Table/index.d.ts +1 -0
  286. package/Presentation/components/Table/index.js +1 -0
  287. package/Presentation/components/Title/Title.d.ts +5 -0
  288. package/Presentation/components/Title/Title.js +10 -0
  289. package/Presentation/components/Title/Title.js.map +1 -0
  290. package/Presentation/components/Title/Title.styled.d.ts +3 -0
  291. package/Presentation/components/Title/Title.styled.js +13 -0
  292. package/Presentation/components/Title/Title.styled.js.map +1 -0
  293. package/Presentation/components/Title/index.d.ts +1 -0
  294. package/Presentation/components/Title/index.js +1 -0
  295. package/Presentation/configs/index.d.ts +1 -0
  296. package/Presentation/configs/index.js +1 -0
  297. package/Presentation/configs/list/Browser/EntryAction.d.ts +7 -0
  298. package/Presentation/configs/list/Browser/EntryAction.js +13 -0
  299. package/Presentation/configs/list/Browser/EntryAction.js.map +1 -0
  300. package/Presentation/configs/list/Browser/Table/Column.d.ts +14 -0
  301. package/Presentation/configs/list/Browser/Table/Column.js +11 -0
  302. package/Presentation/configs/list/Browser/Table/Column.js.map +1 -0
  303. package/Presentation/configs/list/Browser/Table/Sorting.d.ts +5 -0
  304. package/Presentation/configs/list/Browser/Table/Sorting.js +7 -0
  305. package/Presentation/configs/list/Browser/Table/Sorting.js.map +1 -0
  306. package/Presentation/configs/list/Browser/Table/index.d.ts +18 -0
  307. package/Presentation/configs/list/Browser/Table/index.js +9 -0
  308. package/Presentation/configs/list/Browser/Table/index.js.map +1 -0
  309. package/Presentation/configs/list/Browser/index.d.ts +23 -0
  310. package/Presentation/configs/list/Browser/index.js +9 -0
  311. package/Presentation/configs/list/Browser/index.js.map +1 -0
  312. package/Presentation/configs/list/SchedulerListConfig.d.ts +33 -0
  313. package/Presentation/configs/list/SchedulerListConfig.js +30 -0
  314. package/Presentation/configs/list/SchedulerListConfig.js.map +1 -0
  315. package/Presentation/configs/list/index.d.ts +1 -0
  316. package/Presentation/configs/list/index.js +1 -0
  317. package/Presentation/hooks/index.d.ts +3 -0
  318. package/Presentation/hooks/index.js +3 -0
  319. package/Presentation/hooks/useCancelSchedulerItem.d.ts +8 -0
  320. package/Presentation/hooks/useCancelSchedulerItem.js +27 -0
  321. package/Presentation/hooks/useCancelSchedulerItem.js.map +1 -0
  322. package/Presentation/hooks/useScheduler.d.ts +28 -0
  323. package/Presentation/hooks/useScheduler.js +68 -0
  324. package/Presentation/hooks/useScheduler.js.map +1 -0
  325. package/Presentation/hooks/useSchedulerItem.d.ts +11 -0
  326. package/Presentation/hooks/useSchedulerItem.js +7 -0
  327. package/Presentation/hooks/useSchedulerItem.js.map +1 -0
  328. package/Presentation/index.d.ts +25 -0
  329. package/Presentation/index.js +49 -0
  330. package/Presentation/index.js.map +1 -0
  331. package/README.md +11 -0
  332. package/UseCases/CancelItem/CancelItemUseCase.d.ts +7 -0
  333. package/UseCases/CancelItem/CancelItemUseCase.js +13 -0
  334. package/UseCases/CancelItem/CancelItemUseCase.js.map +1 -0
  335. package/UseCases/CancelItem/ICancelItemUseCase.d.ts +3 -0
  336. package/UseCases/CancelItem/ICancelItemUseCase.js +0 -0
  337. package/UseCases/CancelItem/index.d.ts +2 -0
  338. package/UseCases/CancelItem/index.js +1 -0
  339. package/UseCases/GetItem/GetItemUseCase.d.ts +8 -0
  340. package/UseCases/GetItem/GetItemUseCase.js +13 -0
  341. package/UseCases/GetItem/GetItemUseCase.js.map +1 -0
  342. package/UseCases/GetItem/IGetItemUseCase.d.ts +4 -0
  343. package/UseCases/GetItem/IGetItemUseCase.js +0 -0
  344. package/UseCases/GetItem/index.d.ts +2 -0
  345. package/UseCases/GetItem/index.js +1 -0
  346. package/UseCases/GetScheduledItem/GetScheduledItemUseCase.d.ts +7 -0
  347. package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js +14 -0
  348. package/UseCases/GetScheduledItem/GetScheduledItemUseCase.js.map +1 -0
  349. package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.d.ts +4 -0
  350. package/UseCases/GetScheduledItem/IGetScheduledItemUseCase.js +0 -0
  351. package/UseCases/GetScheduledItem/index.d.ts +2 -0
  352. package/UseCases/GetScheduledItem/index.js +1 -0
  353. package/UseCases/ListItems/IListItemsUseCase.d.ts +4 -0
  354. package/UseCases/ListItems/IListItemsUseCase.js +0 -0
  355. package/UseCases/ListItems/ListItemsUseCase.d.ts +8 -0
  356. package/UseCases/ListItems/ListItemsUseCase.js +13 -0
  357. package/UseCases/ListItems/ListItemsUseCase.js.map +1 -0
  358. package/UseCases/ListItems/ListItemsUseCaseWithSearch.d.ts +9 -0
  359. package/UseCases/ListItems/ListItemsUseCaseWithSearch.js +23 -0
  360. package/UseCases/ListItems/ListItemsUseCaseWithSearch.js.map +1 -0
  361. package/UseCases/ListItems/ListItemsUseCaseWithSorting.d.ts +9 -0
  362. package/UseCases/ListItems/ListItemsUseCaseWithSorting.js +21 -0
  363. package/UseCases/ListItems/ListItemsUseCaseWithSorting.js.map +1 -0
  364. package/UseCases/ListItems/index.d.ts +4 -0
  365. package/UseCases/ListItems/index.js +3 -0
  366. package/UseCases/ListMoreItems/IListMoreItemsUseCase.d.ts +3 -0
  367. package/UseCases/ListMoreItems/IListMoreItemsUseCase.js +0 -0
  368. package/UseCases/ListMoreItems/ListMoreItemsUseCase.d.ts +7 -0
  369. package/UseCases/ListMoreItems/ListMoreItemsUseCase.js +13 -0
  370. package/UseCases/ListMoreItems/ListMoreItemsUseCase.js.map +1 -0
  371. package/UseCases/ListMoreItems/index.d.ts +2 -0
  372. package/UseCases/ListMoreItems/index.js +1 -0
  373. package/UseCases/PublishItem/IPublishItemUseCase.d.ts +3 -0
  374. package/UseCases/PublishItem/IPublishItemUseCase.js +0 -0
  375. package/UseCases/PublishItem/PublishItemUseCase.d.ts +7 -0
  376. package/UseCases/PublishItem/PublishItemUseCase.js +13 -0
  377. package/UseCases/PublishItem/PublishItemUseCase.js.map +1 -0
  378. package/UseCases/PublishItem/index.d.ts +2 -0
  379. package/UseCases/PublishItem/index.js +1 -0
  380. package/UseCases/SearchItems/ISearchItemsUseCase.d.ts +3 -0
  381. package/UseCases/SearchItems/ISearchItemsUseCase.js +0 -0
  382. package/UseCases/SearchItems/SearchItemsUseCase.d.ts +7 -0
  383. package/UseCases/SearchItems/SearchItemsUseCase.js +13 -0
  384. package/UseCases/SearchItems/SearchItemsUseCase.js.map +1 -0
  385. package/UseCases/SearchItems/index.d.ts +2 -0
  386. package/UseCases/SearchItems/index.js +1 -0
  387. package/UseCases/SelectAllItems/ISelectAllItemsUseCase.d.ts +3 -0
  388. package/UseCases/SelectAllItems/ISelectAllItemsUseCase.js +0 -0
  389. package/UseCases/SelectAllItems/SelectAllItemsUseCase.d.ts +7 -0
  390. package/UseCases/SelectAllItems/SelectAllItemsUseCase.js +13 -0
  391. package/UseCases/SelectAllItems/SelectAllItemsUseCase.js.map +1 -0
  392. package/UseCases/SelectAllItems/index.d.ts +2 -0
  393. package/UseCases/SelectAllItems/index.js +1 -0
  394. package/UseCases/SelectItems/ISelectItemsUseCase.d.ts +4 -0
  395. package/UseCases/SelectItems/ISelectItemsUseCase.js +0 -0
  396. package/UseCases/SelectItems/SelectItemsUseCase.d.ts +7 -0
  397. package/UseCases/SelectItems/SelectItemsUseCase.js +13 -0
  398. package/UseCases/SelectItems/SelectItemsUseCase.js.map +1 -0
  399. package/UseCases/SelectItems/index.d.ts +2 -0
  400. package/UseCases/SelectItems/index.js +1 -0
  401. package/UseCases/SortItems/ISortItemsUseCase.d.ts +4 -0
  402. package/UseCases/SortItems/ISortItemsUseCase.js +0 -0
  403. package/UseCases/SortItems/SortItemsUseCase.d.ts +7 -0
  404. package/UseCases/SortItems/SortItemsUseCase.js +13 -0
  405. package/UseCases/SortItems/SortItemsUseCase.js.map +1 -0
  406. package/UseCases/SortItems/index.d.ts +2 -0
  407. package/UseCases/SortItems/index.js +1 -0
  408. package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.d.ts +3 -0
  409. package/UseCases/UnSelectAllItems/IUnselectAllItemsUseCase.js +0 -0
  410. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.d.ts +7 -0
  411. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js +13 -0
  412. package/UseCases/UnSelectAllItems/UnselectAllItemsUseCase.js.map +1 -0
  413. package/UseCases/UnSelectAllItems/index.d.ts +2 -0
  414. package/UseCases/UnSelectAllItems/index.js +1 -0
  415. package/UseCases/UnpublishItem/IUnpublishItemUseCase.d.ts +3 -0
  416. package/UseCases/UnpublishItem/IUnpublishItemUseCase.js +0 -0
  417. package/UseCases/UnpublishItem/UnpublishItemUseCase.d.ts +7 -0
  418. package/UseCases/UnpublishItem/UnpublishItemUseCase.js +13 -0
  419. package/UseCases/UnpublishItem/UnpublishItemUseCase.js.map +1 -0
  420. package/UseCases/UnpublishItem/index.d.ts +2 -0
  421. package/UseCases/UnpublishItem/index.js +1 -0
  422. package/UseCases/index.d.ts +11 -0
  423. package/UseCases/index.js +11 -0
  424. package/index.d.ts +1 -0
  425. package/index.js +1 -0
  426. package/package.json +57 -0
  427. package/types.d.ts +37 -0
  428. package/types.js +16 -0
  429. package/types.js.map +1 -0
@@ -0,0 +1,15 @@
1
+ import type { ScheduleActionType } from "../../../types.js";
2
+ export interface IScheduleDialogScheduledActionExecuteParams {
3
+ targetId: string;
4
+ namespace: string;
5
+ scheduleOn: Date;
6
+ actionType: ScheduleActionType;
7
+ }
8
+ export interface IScheduleDialogCancelActionExecuteParams {
9
+ id: string;
10
+ namespace: string;
11
+ }
12
+ export interface IScheduleDialogAction {
13
+ schedule(params: IScheduleDialogScheduledActionExecuteParams): Promise<void>;
14
+ cancel(params: IScheduleDialogCancelActionExecuteParams): Promise<void>;
15
+ }
@@ -0,0 +1,41 @@
1
+ import React from "react";
2
+ import { type BindComponentRenderProp } from "@webiny/form";
3
+ import ApolloClient from "apollo-client/ApolloClient.js";
4
+ export type ShowDialogParamsEntryStatus = "published" | "unpublished" | "draft" | string;
5
+ export interface IShowDialogParamsEntry {
6
+ id: string;
7
+ status: ShowDialogParamsEntryStatus;
8
+ title: string;
9
+ }
10
+ interface UseShowScheduleDialogResponse {
11
+ showDialog: () => void;
12
+ }
13
+ export interface ISchedulerDialogFormComponentDateTimeInputProps {
14
+ bind: BindComponentRenderProp<Date>;
15
+ }
16
+ export declare const SchedulerDialogFormComponentDateTimeInput: ((props: ISchedulerDialogFormComponentDateTimeInputProps) => React.JSX.Element) & {
17
+ original: (props: ISchedulerDialogFormComponentDateTimeInputProps) => React.JSX.Element;
18
+ originalName: string;
19
+ displayName: string;
20
+ } & {
21
+ original: ((props: ISchedulerDialogFormComponentDateTimeInputProps) => React.JSX.Element) & {
22
+ original: (props: ISchedulerDialogFormComponentDateTimeInputProps) => React.JSX.Element;
23
+ originalName: string;
24
+ displayName: string;
25
+ };
26
+ originalName: string;
27
+ displayName: string;
28
+ } & {
29
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: ISchedulerDialogFormComponentDateTimeInputProps) => React.JSX.Element) & {
30
+ original: (props: ISchedulerDialogFormComponentDateTimeInputProps) => React.JSX.Element;
31
+ originalName: string;
32
+ displayName: string;
33
+ }>) => (props: unknown) => React.JSX.Element;
34
+ };
35
+ export interface IUseScheduleDialogProps {
36
+ client: ApolloClient<object>;
37
+ namespace: string;
38
+ target: IShowDialogParamsEntry;
39
+ }
40
+ export declare const useScheduleDialog: (props: IUseScheduleDialogProps) => UseShowScheduleDialogResponse;
41
+ export {};
@@ -0,0 +1,192 @@
1
+ import react, { useCallback, useMemo, useRef } from "react";
2
+ import { Alert, Button, Grid, Input } from "@webiny/admin-ui";
3
+ import { ReactComponent } from "@webiny/icons/delete.svg";
4
+ import { useDialogs, useSnackbar } from "@webiny/app-admin";
5
+ import { Bind } from "@webiny/form";
6
+ import { validation } from "@webiny/validation";
7
+ import { ScheduleActionType } from "../../../types.js";
8
+ import validationError from "@webiny/validation/validationError.js";
9
+ import { makeDecoratable } from "@webiny/react-composition";
10
+ import { SchedulerCancelGraphQLGateway } from "../../../Gateways/SchedulerCancelGraphQLGateway.js";
11
+ import { SchedulerPublishGraphQLGateway } from "../../../Gateways/SchedulerPublishGraphQLGateway.js";
12
+ import { SchedulerUnpublishGraphQLGateway } from "../../../Gateways/SchedulerUnpublishGraphQLGateway.js";
13
+ import { SchedulerGetGraphQLGateway } from "../../../Gateways/SchedulerGetGraphQLGateway.js";
14
+ import { ScheduleDialogPresenter } from "./ScheduleDialogPresenter.js";
15
+ const dateToLocaleStringFormatter = new Intl.DateTimeFormat(void 0, {
16
+ year: "numeric",
17
+ month: "2-digit",
18
+ day: "2-digit",
19
+ hour: "2-digit",
20
+ minute: "2-digit",
21
+ second: void 0,
22
+ hour12: false
23
+ });
24
+ const ReschedulingAlert = ({ scheduleOn, actionType })=>{
25
+ if (!scheduleOn || !actionType) return null;
26
+ const actionName = actionType === ScheduleActionType.publish ? "publish" : "unpublish";
27
+ return /*#__PURE__*/ react.createElement(Alert, {
28
+ type: "danger"
29
+ }, /*#__PURE__*/ react.createElement(react.Fragment, null, "A ", actionName, " is already scheduled at", /*#__PURE__*/ react.createElement("br", null), /*#__PURE__*/ react.createElement("strong", null, dateToLocaleStringFormatter.format(scheduleOn)), "."));
30
+ };
31
+ const padLeft = (num)=>String(num).padStart(2, "0");
32
+ const formatDateForDateTimeLocal = (date)=>{
33
+ if (!date) return;
34
+ if ("string" == typeof date) date = new Date(date);
35
+ const year = date.getFullYear();
36
+ const month = padLeft(date.getMonth() + 1);
37
+ const day = padLeft(date.getDate());
38
+ const hours = padLeft(date.getHours());
39
+ const minutes = padLeft(date.getMinutes());
40
+ return `${year}-${month}-${day}T${hours}:${minutes}`;
41
+ };
42
+ const minDateValidator = (input)=>{
43
+ const value = new Date(input);
44
+ const minDate = new Date(new Date().getTime() + 120000);
45
+ if (minDate < value) return;
46
+ throw new validationError(`The date must be at least 2 minutes in the future. Current minimum date is ${dateToLocaleStringFormatter.format(minDate)}.`);
47
+ };
48
+ minDateValidator.validatorName = "minDateValidator";
49
+ const CancelButtonComponent = ({ enabled, onCancel })=>{
50
+ if (!enabled) return null;
51
+ return /*#__PURE__*/ react.createElement(Button, {
52
+ variant: "ghost",
53
+ onClick: onCancel,
54
+ text: "Cancel Schedule",
55
+ size: "md",
56
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
57
+ iconPosition: "start"
58
+ });
59
+ };
60
+ const SchedulerDialogFormComponentDateTimeInput = makeDecoratable("SchedulerDialogFormComponentDateTimeInput", (props)=>{
61
+ const { bind } = props;
62
+ return /*#__PURE__*/ react.createElement(Input, {
63
+ ...bind,
64
+ value: formatDateForDateTimeLocal(bind.value),
65
+ title: "Schedule On",
66
+ label: "Schedule On",
67
+ size: "lg",
68
+ type: "datetime-local",
69
+ required: true,
70
+ autoFocus: true
71
+ });
72
+ });
73
+ const FormComponent = ({ scheduleOn, actionType })=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(ReschedulingAlert, {
74
+ actionType: actionType,
75
+ scheduleOn: scheduleOn
76
+ }), /*#__PURE__*/ react.createElement(Grid, null, /*#__PURE__*/ react.createElement(Grid.Column, {
77
+ span: 12
78
+ }, /*#__PURE__*/ react.createElement(Bind, {
79
+ name: "scheduleOn",
80
+ validators: [
81
+ validation.create("required"),
82
+ minDateValidator
83
+ ]
84
+ }, (bind)=>/*#__PURE__*/ react.createElement(SchedulerDialogFormComponentDateTimeInput, {
85
+ bind: bind
86
+ })))));
87
+ const useScheduleDialog = (props)=>{
88
+ const { client, target, namespace } = props;
89
+ const dialog = useDialogs();
90
+ const { showSnackbar } = useSnackbar();
91
+ const presenter = useMemo(()=>new ScheduleDialogPresenter({
92
+ getGateway: new SchedulerGetGraphQLGateway(client),
93
+ cancelGateway: new SchedulerCancelGraphQLGateway(client),
94
+ publishGateway: new SchedulerPublishGraphQLGateway(client),
95
+ unpublishGateway: new SchedulerUnpublishGraphQLGateway(client)
96
+ }), [
97
+ client
98
+ ]);
99
+ const dialogClose = useRef(()=>{});
100
+ const onAccept = useCallback(async (params)=>{
101
+ const { scheduleOn, actionType } = params;
102
+ try {
103
+ await presenter.schedule({
104
+ targetId: target.id,
105
+ namespace,
106
+ scheduleOn,
107
+ actionType
108
+ });
109
+ showSnackbar(`Scheduled ${actionType} action for "${target.title}"!`);
110
+ } catch (error) {
111
+ showSnackbar(error.message);
112
+ console.error(error);
113
+ }
114
+ }, [
115
+ presenter.vm
116
+ ]);
117
+ const onCancel = useCallback(async ()=>{
118
+ const entry = presenter.vm.entry;
119
+ if (!entry) {
120
+ showSnackbar(`No scheduled action found for "${target.title}"!`);
121
+ if (dialogClose.current) {
122
+ dialogClose.current();
123
+ dialogClose.current = null;
124
+ }
125
+ return;
126
+ }
127
+ try {
128
+ await presenter.cancel({
129
+ id: entry.id,
130
+ namespace: entry.namespace
131
+ });
132
+ showSnackbar(`Canceled scheduled ${entry.actionType} on "${entry.title}"!`);
133
+ } catch (error) {
134
+ showSnackbar(error.message);
135
+ }
136
+ if (!dialogClose.current) return;
137
+ dialogClose.current();
138
+ dialogClose.current = null;
139
+ }, [
140
+ presenter.vm
141
+ ]);
142
+ const showDialog = async ()=>{
143
+ await presenter.load({
144
+ namespace,
145
+ id: target.id
146
+ });
147
+ const isPublished = "published" === target.status;
148
+ const entry = presenter.vm.entry;
149
+ const scheduleOn = entry?.publishOn || entry?.unpublishOn;
150
+ dialogClose.current = dialog.showDialog({
151
+ title: `Schedule "${target.title}"`,
152
+ content: /*#__PURE__*/ react.createElement(FormComponent, {
153
+ actionType: entry?.actionType,
154
+ scheduleOn: scheduleOn
155
+ }),
156
+ formData: {
157
+ scheduleOn
158
+ },
159
+ acceptLabel: isPublished ? "Schedule Unpublish" : "Schedule Publish",
160
+ cancelLabel: "Discard",
161
+ loadingLabel: "Scheduling...",
162
+ info: /*#__PURE__*/ react.createElement(CancelButtonComponent, {
163
+ enabled: !!scheduleOn,
164
+ onCancel: onCancel
165
+ }),
166
+ onAccept: (data)=>{
167
+ if (!data.scheduleOn) return void showSnackbar('Missing "Schedule On" date!');
168
+ let scheduleOn;
169
+ try {
170
+ scheduleOn = new Date(data.scheduleOn);
171
+ } catch (ex) {
172
+ showSnackbar('Invalid "Schedule On" date!', {
173
+ value: data.scheduleOn
174
+ });
175
+ console.error(ex);
176
+ return;
177
+ }
178
+ const actionType = isPublished ? ScheduleActionType.unpublish : ScheduleActionType.publish;
179
+ return onAccept({
180
+ scheduleOn,
181
+ actionType
182
+ });
183
+ }
184
+ });
185
+ };
186
+ return {
187
+ showDialog
188
+ };
189
+ };
190
+ export { SchedulerDialogFormComponentDateTimeInput, useScheduleDialog };
191
+
192
+ //# sourceMappingURL=useScheduleDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/components/ScheduleDialog/useScheduleDialog.js","sources":["../../../../src/Presentation/components/ScheduleDialog/useScheduleDialog.tsx"],"sourcesContent":["import React, { useCallback, useMemo, useRef } from \"react\";\nimport { Alert, Button, Grid, Input } from \"@webiny/admin-ui\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete.svg\";\nimport { useDialogs, useSnackbar } from \"@webiny/app-admin\";\nimport { Bind, type BindComponentRenderProp } from \"@webiny/form\";\nimport { validation } from \"@webiny/validation\";\nimport { ScheduleActionType } from \"~/types.js\";\nimport type { Validator } from \"@webiny/validation/types.js\";\nimport ValidationError from \"@webiny/validation/validationError.js\";\nimport { makeDecoratable } from \"@webiny/react-composition\";\nimport ApolloClient from \"apollo-client/ApolloClient.js\";\nimport { SchedulerCancelGraphQLGateway } from \"~/Gateways/SchedulerCancelGraphQLGateway.js\";\nimport { SchedulerPublishGraphQLGateway } from \"~/Gateways/SchedulerPublishGraphQLGateway.js\";\nimport { SchedulerUnpublishGraphQLGateway } from \"~/Gateways/SchedulerUnpublishGraphQLGateway.js\";\nimport { SchedulerGetGraphQLGateway } from \"~/Gateways/SchedulerGetGraphQLGateway.js\";\nimport { ScheduleDialogPresenter } from \"./ScheduleDialogPresenter.js\";\n\nexport type ShowDialogParamsEntryStatus = \"published\" | \"unpublished\" | \"draft\" | string;\n\nexport interface IShowDialogParamsEntry {\n id: string;\n status: ShowDialogParamsEntryStatus;\n title: string;\n}\n\ninterface UseShowScheduleDialogResponse {\n showDialog: () => void;\n}\n\ninterface FormComponentProps {\n scheduleOn: Date | undefined;\n actionType: ScheduleActionType | undefined;\n}\n\nconst dateToLocaleStringFormatter = new Intl.DateTimeFormat(undefined, {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: undefined,\n hour12: false\n});\n\ninterface IReschedulingAlertProps {\n scheduleOn: Date | undefined;\n actionType: ScheduleActionType | undefined;\n}\n\nconst ReschedulingAlert = ({ scheduleOn, actionType }: IReschedulingAlertProps) => {\n if (!scheduleOn || !actionType) {\n return null;\n }\n const actionName = actionType === ScheduleActionType.publish ? \"publish\" : \"unpublish\";\n return (\n <Alert type={\"danger\"}>\n <>\n A {actionName} is already scheduled at\n <br />\n <strong>{dateToLocaleStringFormatter.format(scheduleOn)}</strong>.\n </>\n </Alert>\n );\n};\n/**\n * DO NOT use a library for this!\n */\nconst padLeft = (num: number) => {\n return String(num).padStart(2, \"0\");\n};\n\nconst formatDateForDateTimeLocal = (date?: Date | string): string | undefined => {\n if (!date) {\n return undefined;\n } else if (typeof date === \"string\") {\n date = new Date(date);\n }\n\n const year = date.getFullYear();\n const month = padLeft(date.getMonth() + 1);\n const day = padLeft(date.getDate());\n const hours = padLeft(date.getHours());\n const minutes = padLeft(date.getMinutes());\n\n return `${year}-${month}-${day}T${hours}:${minutes}`;\n};\n\nconst minDateValidator: Validator = (input: string) => {\n const value = new Date(input);\n const minDate = new Date(new Date().getTime() + 120 * 1000);\n if (minDate < value) {\n return;\n }\n throw new ValidationError(\n `The date must be at least 2 minutes in the future. Current minimum date is ${dateToLocaleStringFormatter.format(\n minDate\n )}.`\n );\n};\n\nminDateValidator.validatorName = \"minDateValidator\";\n\nexport interface ISchedulerDialogFormComponentDateTimeInputProps {\n bind: BindComponentRenderProp<Date>;\n}\n\ninterface ICancelButtonComponentProps {\n enabled: boolean;\n onCancel: OnCancelCallable;\n}\nconst CancelButtonComponent = ({ enabled, onCancel }: ICancelButtonComponentProps) => {\n if (!enabled) {\n return null;\n }\n return (\n <Button\n variant=\"ghost\"\n onClick={onCancel}\n text={\"Cancel Schedule\"}\n size=\"md\"\n icon={<DeleteIcon />}\n iconPosition=\"start\"\n />\n );\n};\n\nexport const SchedulerDialogFormComponentDateTimeInput = makeDecoratable(\n \"SchedulerDialogFormComponentDateTimeInput\",\n (props: ISchedulerDialogFormComponentDateTimeInputProps) => {\n const { bind } = props;\n\n return (\n <Input\n {...bind}\n value={formatDateForDateTimeLocal(bind.value)}\n title={\"Schedule On\"}\n label={\"Schedule On\"}\n size={\"lg\"}\n type={\"datetime-local\"}\n required\n autoFocus\n />\n );\n }\n);\n\nconst FormComponent = ({ scheduleOn, actionType }: FormComponentProps) => {\n return (\n <>\n {<ReschedulingAlert actionType={actionType} scheduleOn={scheduleOn} />}\n <Grid>\n <Grid.Column span={12}>\n <Bind\n name={\"scheduleOn\"}\n validators={[validation.create(\"required\"), minDateValidator]}\n >\n {bind => {\n return <SchedulerDialogFormComponentDateTimeInput bind={bind} />;\n }}\n </Bind>\n </Grid.Column>\n </Grid>\n </>\n );\n};\n\ninterface ScheduleFormData {\n scheduleOn?: string;\n}\n\ninterface IOnAcceptParams {\n scheduleOn: Date;\n actionType: ScheduleActionType;\n}\n\ninterface OnCancelCallable {\n (): Promise<void>;\n}\n\nexport interface IUseScheduleDialogProps {\n client: ApolloClient<object>;\n namespace: string;\n target: IShowDialogParamsEntry;\n}\n\nexport const useScheduleDialog = (\n props: IUseScheduleDialogProps\n): UseShowScheduleDialogResponse => {\n const { client, target, namespace } = props;\n const dialog = useDialogs();\n const { showSnackbar } = useSnackbar();\n\n const presenter = useMemo(() => {\n return new ScheduleDialogPresenter({\n getGateway: new SchedulerGetGraphQLGateway(client),\n cancelGateway: new SchedulerCancelGraphQLGateway(client),\n publishGateway: new SchedulerPublishGraphQLGateway(client),\n unpublishGateway: new SchedulerUnpublishGraphQLGateway(client)\n });\n }, [client]);\n\n const dialogClose = useRef<null | (() => void)>(() => {\n return;\n });\n\n const onAccept = useCallback(\n async (params: IOnAcceptParams) => {\n const { scheduleOn, actionType } = params;\n\n try {\n await presenter.schedule({\n targetId: target.id,\n namespace,\n scheduleOn,\n actionType\n });\n showSnackbar(`Scheduled ${actionType} action for \"${target.title}\"!`);\n } catch (error) {\n showSnackbar(error.message);\n console.error(error);\n }\n },\n [presenter.vm]\n );\n\n const onCancel = useCallback(async () => {\n const entry = presenter.vm.entry;\n if (!entry) {\n showSnackbar(`No scheduled action found for \"${target.title}\"!`);\n if (dialogClose.current) {\n dialogClose.current();\n dialogClose.current = null;\n }\n return;\n }\n try {\n await presenter.cancel({\n id: entry.id,\n namespace: entry.namespace\n });\n showSnackbar(`Canceled scheduled ${entry.actionType} on \"${entry.title}\"!`);\n } catch (error) {\n showSnackbar(error.message);\n }\n if (!dialogClose.current) {\n return;\n }\n dialogClose.current();\n dialogClose.current = null;\n }, [presenter.vm]);\n\n const showDialog = async () => {\n await presenter.load({ namespace, id: target.id });\n\n const isPublished = target.status === \"published\";\n const entry = presenter.vm.entry;\n const scheduleOn = entry?.publishOn || entry?.unpublishOn;\n\n dialogClose.current = dialog.showDialog({\n title: `Schedule \"${target.title}\"`,\n content: <FormComponent actionType={entry?.actionType} scheduleOn={scheduleOn} />,\n formData: {\n scheduleOn\n },\n acceptLabel: isPublished ? \"Schedule Unpublish\" : \"Schedule Publish\",\n cancelLabel: \"Discard\",\n loadingLabel: \"Scheduling...\",\n info: <CancelButtonComponent enabled={!!scheduleOn} onCancel={onCancel} />,\n onAccept: (data: Partial<ScheduleFormData>) => {\n if (!data.scheduleOn) {\n showSnackbar(`Missing \"Schedule On\" date!`);\n return;\n }\n /**\n * We need to convert scheduleOn from local string to the ISO String (UTC) format.\n * This is important because the date will be stored in the database in UTC format.\n *\n * We display the date (in the UI) in users timezone time.\n */\n let scheduleOn: Date;\n try {\n scheduleOn = new Date(data.scheduleOn);\n } catch (ex) {\n showSnackbar(`Invalid \"Schedule On\" date!`, {\n value: data.scheduleOn\n });\n console.error(ex);\n return;\n }\n\n const actionType = isPublished\n ? ScheduleActionType.unpublish\n : ScheduleActionType.publish;\n\n return onAccept({\n scheduleOn,\n actionType\n });\n }\n });\n };\n\n return {\n showDialog\n };\n};\n"],"names":["dateToLocaleStringFormatter","Intl","undefined","ReschedulingAlert","scheduleOn","actionType","actionName","ScheduleActionType","Alert","padLeft","num","String","formatDateForDateTimeLocal","date","Date","year","month","day","hours","minutes","minDateValidator","input","value","minDate","ValidationError","CancelButtonComponent","enabled","onCancel","Button","DeleteIcon","SchedulerDialogFormComponentDateTimeInput","makeDecoratable","props","bind","Input","FormComponent","Grid","Bind","validation","useScheduleDialog","client","target","namespace","dialog","useDialogs","showSnackbar","useSnackbar","presenter","useMemo","ScheduleDialogPresenter","SchedulerGetGraphQLGateway","SchedulerCancelGraphQLGateway","SchedulerPublishGraphQLGateway","SchedulerUnpublishGraphQLGateway","dialogClose","useRef","onAccept","useCallback","params","error","console","entry","showDialog","isPublished","data","ex"],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface SchedulerOverlayProps {
3
+ title: string;
4
+ onExited: () => void;
5
+ }
6
+ export declare const SchedulerOverlay: (props: SchedulerOverlayProps) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,30 @@
1
+ import react from "react";
2
+ import debounce from "lodash/debounce.js";
3
+ import { OverlayLayout } from "@webiny/app-admin";
4
+ import { Scrollbar } from "@webiny/admin-ui";
5
+ import { Title } from "../Title/index.js";
6
+ import { SearchInput } from "../SearchInput/index.js";
7
+ import { Empty } from "../Empty/index.js";
8
+ import { Table } from "../Table/index.js";
9
+ import { BottomInfoBar } from "../BottomInfoBar/index.js";
10
+ import { useScheduler } from "../../hooks/index.js";
11
+ const SchedulerOverlay = (props)=>{
12
+ const { listMoreItems, vm } = useScheduler();
13
+ const onTableScroll = debounce(async ({ scrollFrame })=>{
14
+ if (scrollFrame.top > 0.8) await listMoreItems();
15
+ }, 200);
16
+ return /*#__PURE__*/ react.createElement(OverlayLayout, {
17
+ onExited: props.onExited,
18
+ barLeft: /*#__PURE__*/ react.createElement(Title, {
19
+ title: props.title
20
+ }),
21
+ barMiddle: /*#__PURE__*/ react.createElement(SearchInput, null)
22
+ }, /*#__PURE__*/ react.createElement(Scrollbar, {
23
+ onScrollFrame: (scrollFrame)=>onTableScroll({
24
+ scrollFrame
25
+ })
26
+ }, vm.isEmptyView ? /*#__PURE__*/ react.createElement(Empty, null) : /*#__PURE__*/ react.createElement(Table, null)), /*#__PURE__*/ react.createElement(BottomInfoBar, null));
27
+ };
28
+ export { SchedulerOverlay };
29
+
30
+ //# sourceMappingURL=SchedulerOverlay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/components/SchedulerOverlay/SchedulerOverlay.js","sources":["../../../../src/Presentation/components/SchedulerOverlay/SchedulerOverlay.tsx"],"sourcesContent":["import React from \"react\";\nimport debounce from \"lodash/debounce.js\";\nimport { OverlayLayout } from \"@webiny/app-admin\";\nimport { Scrollbar } from \"@webiny/admin-ui\";\nimport { Title } from \"~/Presentation/components/Title/index.js\";\nimport { SearchInput } from \"~/Presentation/components/SearchInput/index.js\";\nimport { Empty } from \"~/Presentation/components/Empty/index.js\";\nimport { Table } from \"~/Presentation/components/Table/index.js\";\nimport { BottomInfoBar } from \"~/Presentation/components/BottomInfoBar/index.js\";\nimport { useScheduler } from \"~/Presentation/hooks/index.js\";\n\ninterface SchedulerOverlayProps {\n title: string;\n onExited: () => void;\n}\n\nexport const SchedulerOverlay = (props: SchedulerOverlayProps) => {\n const { listMoreItems, vm } = useScheduler();\n\n const onTableScroll = debounce(async ({ scrollFrame }) => {\n if (scrollFrame.top > 0.8) {\n await listMoreItems();\n }\n }, 200);\n\n return (\n <OverlayLayout\n onExited={props.onExited}\n barLeft={<Title title={props.title} />}\n barMiddle={<SearchInput />}\n >\n <Scrollbar onScrollFrame={scrollFrame => onTableScroll({ scrollFrame })}>\n {vm.isEmptyView ? <Empty /> : <Table />}\n </Scrollbar>\n <BottomInfoBar />\n </OverlayLayout>\n );\n};\n"],"names":["SchedulerOverlay","props","listMoreItems","vm","useScheduler","onTableScroll","debounce","scrollFrame","OverlayLayout","Title","SearchInput","Scrollbar","Empty","Table","BottomInfoBar"],"mappings":";;;;;;;;;;AAgBO,MAAMA,mBAAmB,CAACC;IAC7B,MAAM,EAAEC,aAAa,EAAEC,EAAE,EAAE,GAAGC;IAE9B,MAAMC,gBAAgBC,SAAS,OAAO,EAAEC,WAAW,EAAE;QACjD,IAAIA,YAAY,GAAG,GAAG,KAClB,MAAML;IAEd,GAAG;IAEH,OAAO,WAAP,GACI,oBAACM,eAAaA;QACV,UAAUP,MAAM,QAAQ;QACxB,uBAAS,oBAACQ,OAAKA;YAAC,OAAOR,MAAM,KAAK;;QAClC,yBAAW,oBAACS,aAAWA;qBAEvB,oBAACC,WAASA;QAAC,eAAeJ,CAAAA,cAAeF,cAAc;gBAAEE;YAAY;OAChEJ,GAAG,WAAW,GAAG,WAAH,GAAG,oBAACS,OAAKA,QAAAA,WAAAA,GAAM,oBAACC,OAAKA,QAAAA,WAAAA,GAExC,oBAACC,eAAaA;AAG1B"}
@@ -0,0 +1 @@
1
+ export * from "./SchedulerOverlay.js";
@@ -0,0 +1 @@
1
+ export * from "./SchedulerOverlay.js";
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const SearchInput: () => React.JSX.Element;
@@ -0,0 +1,30 @@
1
+ import react from "react";
2
+ import { ReactComponent } from "@webiny/icons/search.svg";
3
+ import { DelayedOnChange, Icon, Input } from "@webiny/admin-ui";
4
+ import { useScheduler } from "../../hooks/index.js";
5
+ const SearchInput = ()=>{
6
+ const { vm, searchItems } = useScheduler();
7
+ return /*#__PURE__*/ react.createElement(DelayedOnChange, {
8
+ value: vm.searchQuery,
9
+ onChange: (value)=>{
10
+ if (value === vm.searchQuery) return;
11
+ searchItems(value);
12
+ }
13
+ }, ({ value, onChange })=>/*#__PURE__*/ react.createElement(Input, {
14
+ id: "scheduler__search-input",
15
+ value: value,
16
+ onChange: (e)=>onChange(e.target.value),
17
+ forwardEventOnChange: true,
18
+ placeholder: vm.searchLabel,
19
+ "data-testid": "scheduler.search-input",
20
+ startIcon: /*#__PURE__*/ react.createElement(Icon, {
21
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
22
+ label: "Search"
23
+ }),
24
+ size: "md",
25
+ variant: "ghost"
26
+ }));
27
+ };
28
+ export { SearchInput };
29
+
30
+ //# sourceMappingURL=SearchInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/components/SearchInput/SearchInput.js","sources":["../../../../src/Presentation/components/SearchInput/SearchInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { ReactComponent as SearchIcon } from \"@webiny/icons/search.svg\";\nimport { DelayedOnChange, Icon, Input } from \"@webiny/admin-ui\";\nimport { useScheduler } from \"~/Presentation/hooks/index.js\";\n\nexport const SearchInput = () => {\n const { vm, searchItems } = useScheduler();\n\n return (\n <DelayedOnChange\n value={vm.searchQuery}\n onChange={value => {\n if (value === vm.searchQuery) {\n return;\n }\n searchItems(value);\n }}\n >\n {({ value, onChange }) => (\n <Input\n id={\"scheduler__search-input\"}\n value={value}\n onChange={e => onChange(e.target.value)}\n forwardEventOnChange={true}\n placeholder={vm.searchLabel}\n data-testid={\"scheduler.search-input\"}\n startIcon={<Icon icon={<SearchIcon />} label=\"Search\" />}\n size={\"md\"}\n variant={\"ghost\"}\n />\n )}\n </DelayedOnChange>\n );\n};\n"],"names":["SearchInput","vm","searchItems","useScheduler","DelayedOnChange","value","onChange","Input","e","Icon","SearchIcon"],"mappings":";;;;AAKO,MAAMA,cAAc;IACvB,MAAM,EAAEC,EAAE,EAAEC,WAAW,EAAE,GAAGC;IAE5B,OAAO,WAAP,GACI,oBAACC,iBAAeA;QACZ,OAAOH,GAAG,WAAW;QACrB,UAAUI,CAAAA;YACN,IAAIA,UAAUJ,GAAG,WAAW,EACxB;YAEJC,YAAYG;QAChB;OAEC,CAAC,EAAEA,KAAK,EAAEC,QAAQ,EAAE,iBACjB,oBAACC,OAAKA;YACF,IAAI;YACJ,OAAOF;YACP,UAAUG,CAAAA,IAAKF,SAASE,EAAE,MAAM,CAAC,KAAK;YACtC,sBAAsB;YACtB,aAAaP,GAAG,WAAW;YAC3B,eAAa;YACb,yBAAW,oBAACQ,MAAIA;gBAAC,oBAAM,oBAACC,gBAAUA;gBAAK,OAAM;;YAC7C,MAAM;YACN,SAAS;;AAK7B"}
@@ -0,0 +1 @@
1
+ export * from "./SearchInput.js";
@@ -0,0 +1 @@
1
+ export * from "./SearchInput.js";
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const Table: () => React.JSX.Element;
@@ -0,0 +1,29 @@
1
+ import react, { useMemo } from "react";
2
+ import { Table, createRecordsData } from "@webiny/app-aco";
3
+ import { useScheduler } from "../../hooks/index.js";
4
+ import { LoadingActions } from "../../../types.js";
5
+ import { useSchedulerListConfig } from "../../configs/index.js";
6
+ const Table_Table = ()=>{
7
+ const { vm, selectItems, sortItems } = useScheduler();
8
+ const { browser } = useSchedulerListConfig();
9
+ const data = useMemo(()=>createRecordsData(vm.items), [
10
+ vm.items
11
+ ]);
12
+ const selected = useMemo(()=>createRecordsData(vm.selectedItems), [
13
+ vm.selectedItems
14
+ ]);
15
+ return /*#__PURE__*/ react.createElement(Table, {
16
+ columns: browser.table.columns,
17
+ data: data,
18
+ loading: vm.loading[LoadingActions.list],
19
+ onSelectRow: (entries)=>selectItems(entries.map((entry)=>entry.data)),
20
+ sorting: vm.sorting,
21
+ onSortingChange: (sort)=>sortItems(sort),
22
+ selected: selected,
23
+ nameColumnId: vm.nameColumnId,
24
+ namespace: "scheduler/list"
25
+ });
26
+ };
27
+ export { Table_Table as Table };
28
+
29
+ //# sourceMappingURL=Table.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/components/Table/Table.js","sources":["../../../../src/Presentation/components/Table/Table.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { createRecordsData, Table as AcoTable } from \"@webiny/app-aco\";\nimport { useScheduler } from \"~/Presentation/hooks/index.js\";\nimport { LoadingActions, type SchedulerEntryTableRow } from \"~/types.js\";\nimport { useSchedulerListConfig } from \"~/Presentation/configs/index.js\";\n\nexport const Table = () => {\n const { vm, selectItems, sortItems } = useScheduler();\n const { browser } = useSchedulerListConfig();\n\n const data = useMemo<SchedulerEntryTableRow[]>(() => {\n return createRecordsData(vm.items);\n }, [vm.items]);\n\n const selected = useMemo<SchedulerEntryTableRow[]>(() => {\n return createRecordsData(vm.selectedItems);\n }, [vm.selectedItems]);\n\n return (\n <AcoTable<SchedulerEntryTableRow>\n columns={browser.table.columns}\n data={data}\n loading={vm.loading[LoadingActions.list]}\n onSelectRow={entries => selectItems(entries.map(entry => entry.data))}\n sorting={vm.sorting}\n onSortingChange={sort => sortItems(sort)}\n selected={selected}\n nameColumnId={vm.nameColumnId}\n namespace={\"scheduler/list\"}\n />\n );\n};\n"],"names":["Table","vm","selectItems","sortItems","useScheduler","browser","useSchedulerListConfig","data","useMemo","createRecordsData","selected","AcoTable","LoadingActions","entries","entry","sort"],"mappings":";;;;;AAMO,MAAMA,cAAQ;IACjB,MAAM,EAAEC,EAAE,EAAEC,WAAW,EAAEC,SAAS,EAAE,GAAGC;IACvC,MAAM,EAAEC,OAAO,EAAE,GAAGC;IAEpB,MAAMC,OAAOC,QAAkC,IACpCC,kBAAkBR,GAAG,KAAK,GAClC;QAACA,GAAG,KAAK;KAAC;IAEb,MAAMS,WAAWF,QAAkC,IACxCC,kBAAkBR,GAAG,aAAa,GAC1C;QAACA,GAAG,aAAa;KAAC;IAErB,OAAO,WAAP,GACI,oBAACU,OAAQA;QACL,SAASN,QAAQ,KAAK,CAAC,OAAO;QAC9B,MAAME;QACN,SAASN,GAAG,OAAO,CAACW,eAAe,IAAI,CAAC;QACxC,aAAaC,CAAAA,UAAWX,YAAYW,QAAQ,GAAG,CAACC,CAAAA,QAASA,MAAM,IAAI;QACnE,SAASb,GAAG,OAAO;QACnB,iBAAiBc,CAAAA,OAAQZ,UAAUY;QACnC,UAAUL;QACV,cAAcT,GAAG,YAAY;QAC7B,WAAW;;AAGvB"}
@@ -0,0 +1 @@
1
+ export * from "./Table.js";
@@ -0,0 +1 @@
1
+ export * from "./Table.js";
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export interface TitleProps {
3
+ title?: string;
4
+ }
5
+ export declare const Title: ({ title }: TitleProps) => React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import react from "react";
2
+ import { Skeleton } from "@webiny/admin-ui";
3
+ import { Name } from "./Title.styled.js";
4
+ const Title = ({ title })=>/*#__PURE__*/ react.createElement(Name, {
5
+ level: 6,
6
+ as: "h1"
7
+ }, title || /*#__PURE__*/ react.createElement(Skeleton, null));
8
+ export { Title };
9
+
10
+ //# sourceMappingURL=Title.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/components/Title/Title.js","sources":["../../../../src/Presentation/components/Title/Title.tsx"],"sourcesContent":["import React from \"react\";\nimport { Skeleton } from \"@webiny/admin-ui\";\nimport { Name } from \"./Title.styled.js\";\n\nexport interface TitleProps {\n title?: string;\n}\n\nexport const Title = ({ title }: TitleProps) => {\n return (\n <Name level={6} as={\"h1\"}>\n {title || <Skeleton />}\n </Name>\n );\n};\n"],"names":["Title","title","Name","Skeleton"],"mappings":";;;AAQO,MAAMA,QAAQ,CAAC,EAAEC,KAAK,EAAc,GAChC,WAAP,GACI,oBAACC,MAAIA;QAAC,OAAO;QAAG,IAAI;OACfD,SAAS,WAATA,GAAS,oBAACE,UAAQA"}
@@ -0,0 +1,3 @@
1
+ export declare const Name: import("@emotion/styled").StyledComponent<import("@webiny/admin-ui").HeadingProps & {
2
+ theme?: import("@emotion/react").Theme;
3
+ }, {}, {}>;
@@ -0,0 +1,13 @@
1
+ import styled from "@emotion/styled";
2
+ import { Heading } from "@webiny/admin-ui";
3
+ const Name = styled(Heading)`
4
+ color: var(--mdc-theme-text-primary-on-background);
5
+ padding-left: 8px;
6
+ line-height: 48px;
7
+ white-space: nowrap;
8
+ overflow: hidden;
9
+ text-overflow: ellipsis;
10
+ `;
11
+ export { Name };
12
+
13
+ //# sourceMappingURL=Title.styled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/components/Title/Title.styled.js","sources":["../../../../src/Presentation/components/Title/Title.styled.tsx"],"sourcesContent":["import styled from \"@emotion/styled\";\nimport { Heading } from \"@webiny/admin-ui\";\n\nexport const Name = styled(Heading)`\n color: var(--mdc-theme-text-primary-on-background);\n padding-left: 8px;\n line-height: 48px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n`;\n"],"names":["Name","styled","Heading"],"mappings":";;AAGO,MAAMA,OAAOC,OAAOC,QAAQ,CAAC;;;;;;;AAOpC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./Title.js";
@@ -0,0 +1 @@
1
+ export * from "./Title.js";
@@ -0,0 +1 @@
1
+ export * from "./list/index.js";
@@ -0,0 +1 @@
1
+ export * from "./list/index.js";
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { AcoConfig, type RecordActionConfig } from "@webiny/app-aco";
3
+ export type { RecordActionConfig as EntryActionConfig };
4
+ type EntryActionProps = React.ComponentProps<typeof AcoConfig.Record.Action>;
5
+ export declare const EntryAction: ((props: EntryActionProps) => React.JSX.Element) & {
6
+ OptionsMenuItem: (props: import("@webiny/app-admin/components").OptionsMenuItemProps) => React.JSX.Element;
7
+ };
@@ -0,0 +1,13 @@
1
+ import react from "react";
2
+ import { CompositionScope } from "@webiny/react-composition";
3
+ import { AcoConfig } from "@webiny/app-aco";
4
+ const { Record: Record } = AcoConfig;
5
+ const BaseEntryAction = (props)=>/*#__PURE__*/ react.createElement(CompositionScope, {
6
+ name: "scheduler"
7
+ }, /*#__PURE__*/ react.createElement(Record.Action, props));
8
+ const EntryAction = Object.assign(BaseEntryAction, {
9
+ OptionsMenuItem: Record.Action.OptionsMenuItem
10
+ });
11
+ export { EntryAction };
12
+
13
+ //# sourceMappingURL=EntryAction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/configs/list/Browser/EntryAction.js","sources":["../../../../../src/Presentation/configs/list/Browser/EntryAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { CompositionScope } from \"@webiny/react-composition\";\nimport { AcoConfig, type RecordActionConfig } from \"@webiny/app-aco\";\n\nconst { Record } = AcoConfig;\n\nexport type { RecordActionConfig as EntryActionConfig };\n\ntype EntryActionProps = React.ComponentProps<typeof AcoConfig.Record.Action>;\n\nconst BaseEntryAction = (props: EntryActionProps) => {\n return (\n <CompositionScope name={\"scheduler\"}>\n <Record.Action {...props} />\n </CompositionScope>\n );\n};\n\nexport const EntryAction = Object.assign(BaseEntryAction, {\n OptionsMenuItem: Record.Action.OptionsMenuItem\n});\n"],"names":["Record","AcoConfig","BaseEntryAction","props","CompositionScope","EntryAction","Object"],"mappings":";;;AAIA,MAAM,EAAEA,QAAAA,MAAM,EAAE,GAAGC;AAMnB,MAAMC,kBAAkB,CAACC,QACd,WAAP,GACI,oBAACC,kBAAgBA;QAAC,MAAM;qBACpB,oBAACJ,OAAO,MAAM,EAAKG;AAKxB,MAAME,cAAcC,OAAO,MAAM,CAACJ,iBAAiB;IACtD,iBAAiBF,OAAO,MAAM,CAAC,eAAe;AAClD"}
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+ import { AcoConfig, type TableColumnConfig as ColumnConfig } from "@webiny/app-aco";
3
+ import type { SchedulerEntryTableRow } from "../../../../../types.js";
4
+ export type { ColumnConfig };
5
+ type ColumnProps = React.ComponentProps<typeof AcoConfig.Table.Column>;
6
+ export declare const Column: ((props: ColumnProps) => React.JSX.Element) & {
7
+ useTableRow: {
8
+ (): import("@webiny/app-aco").TableRowContextData<SchedulerEntryTableRow>;
9
+ <TUserRow>(): import("@webiny/app-aco").TableRowContextData<SchedulerEntryTableRow & {
10
+ data: TUserRow;
11
+ }>;
12
+ };
13
+ isFolderRow: (row: import("@webiny/app-aco").TableRow) => row is import("@webiny/app-aco").FolderTableRow;
14
+ };
@@ -0,0 +1,11 @@
1
+ import react from "react";
2
+ import { AcoConfig } from "@webiny/app-aco";
3
+ const { Table: Table } = AcoConfig;
4
+ const BaseColumn = (props)=>/*#__PURE__*/ react.createElement(Table.Column, props);
5
+ const Column = Object.assign(BaseColumn, {
6
+ useTableRow: Table.Column.createUseTableRow(),
7
+ isFolderRow: Table.Column.isFolderRow
8
+ });
9
+ export { Column };
10
+
11
+ //# sourceMappingURL=Column.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/configs/list/Browser/Table/Column.js","sources":["../../../../../../src/Presentation/configs/list/Browser/Table/Column.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type TableColumnConfig as ColumnConfig } from \"@webiny/app-aco\";\nimport type { SchedulerEntryTableRow } from \"~/types.js\";\n\nconst { Table } = AcoConfig;\n\nexport type { ColumnConfig };\n\ntype ColumnProps = React.ComponentProps<typeof AcoConfig.Table.Column>;\n\nconst BaseColumn = (props: ColumnProps) => {\n return <Table.Column {...props} />;\n};\n\nexport const Column = Object.assign(BaseColumn, {\n useTableRow: Table.Column.createUseTableRow<SchedulerEntryTableRow>(),\n isFolderRow: Table.Column.isFolderRow\n});\n"],"names":["Table","AcoConfig","BaseColumn","props","Column","Object"],"mappings":";;AAIA,MAAM,EAAEA,OAAAA,KAAK,EAAE,GAAGC;AAMlB,MAAMC,aAAa,CAACC,QACT,WAAP,GAAO,oBAACH,MAAM,MAAM,EAAKG;AAGtB,MAAMC,SAASC,OAAO,MAAM,CAACH,YAAY;IAC5C,aAAaF,MAAM,MAAM,CAAC,iBAAiB;IAC3C,aAAaA,MAAM,MAAM,CAAC,WAAW;AACzC"}
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { AcoConfig, type TableSortingConfig as SortingConfig } from "@webiny/app-aco";
3
+ export type { SortingConfig };
4
+ type SortingProps = React.ComponentProps<typeof AcoConfig.Table.Sorting>;
5
+ export declare const Sorting: (props: SortingProps) => React.JSX.Element;
@@ -0,0 +1,7 @@
1
+ import react from "react";
2
+ import { AcoConfig } from "@webiny/app-aco";
3
+ const { Table: Table } = AcoConfig;
4
+ const Sorting = (props)=>/*#__PURE__*/ react.createElement(Table.Sorting, props);
5
+ export { Sorting };
6
+
7
+ //# sourceMappingURL=Sorting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/configs/list/Browser/Table/Sorting.js","sources":["../../../../../../src/Presentation/configs/list/Browser/Table/Sorting.tsx"],"sourcesContent":["import React from \"react\";\nimport { AcoConfig, type TableSortingConfig as SortingConfig } from \"@webiny/app-aco\";\n\nconst { Table } = AcoConfig;\n\nexport type { SortingConfig };\n\ntype SortingProps = React.ComponentProps<typeof AcoConfig.Table.Sorting>;\n\nexport const Sorting = (props: SortingProps) => {\n return <Table.Sorting {...props} />;\n};\n"],"names":["Table","AcoConfig","Sorting","props"],"mappings":";;AAGA,MAAM,EAAEA,OAAAA,KAAK,EAAE,GAAGC;AAMX,MAAMC,UAAU,CAACC,QACb,WAAP,GAAO,oBAACH,MAAM,OAAO,EAAKG"}
@@ -0,0 +1,18 @@
1
+ import type { ColumnConfig } from "./Column.js";
2
+ import type { SortingConfig } from "./Sorting.js";
3
+ export interface TableConfig {
4
+ columns: ColumnConfig[];
5
+ sorting: SortingConfig[];
6
+ }
7
+ export declare const Table: {
8
+ Column: ((props: import("@webiny/app-aco/config/table/Column.js").ColumnProps) => import("react").JSX.Element) & {
9
+ useTableRow: {
10
+ (): import("@webiny/app-aco/index.js").TableRowContextData<import("../../../../../types.js").SchedulerEntryTableRow>;
11
+ <TUserRow>(): import("@webiny/app-aco/index.js").TableRowContextData<import("../../../../../types.js").SchedulerEntryTableRow & {
12
+ data: TUserRow;
13
+ }>;
14
+ };
15
+ isFolderRow: (row: import("@webiny/app-aco/table.types.js").TableRow) => row is import("@webiny/app-aco/table.types.js").FolderTableRow;
16
+ };
17
+ Sorting: (props: import("@webiny/app-aco/config/table/Sorting.js").SortingProps) => import("react").JSX.Element;
18
+ };
@@ -0,0 +1,9 @@
1
+ import { Column } from "./Column.js";
2
+ import { Sorting } from "./Sorting.js";
3
+ const Table = {
4
+ Column: Column,
5
+ Sorting: Sorting
6
+ };
7
+ export { Table };
8
+
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Presentation/configs/list/Browser/Table/index.js","sources":["../../../../../../src/Presentation/configs/list/Browser/Table/index.ts"],"sourcesContent":["import type { ColumnConfig } from \"./Column.js\";\nimport { Column } from \"./Column.js\";\nimport type { SortingConfig } from \"./Sorting.js\";\nimport { Sorting } from \"./Sorting.js\";\n\nexport interface TableConfig {\n columns: ColumnConfig[];\n sorting: SortingConfig[];\n}\n\nexport const Table = {\n Column,\n Sorting\n};\n"],"names":["Table","Column","Sorting"],"mappings":";;AAUO,MAAMA,QAAQ;IACjBC,QAAMA;IACNC,SAAOA;AACX"}