@webiny/app-file-manager 0.0.0-unstable.78f581c1d2 → 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 (738) hide show
  1. package/README.md +7 -28
  2. package/app.d.ts +2 -0
  3. package/app.js +57 -0
  4. package/app.js.map +1 -0
  5. package/domain/constants.d.ts +4 -0
  6. package/domain/constants.js +7 -0
  7. package/domain/constants.js.map +1 -0
  8. package/domain/permissionsSchema.d.ts +18 -0
  9. package/domain/permissionsSchema.js +32 -0
  10. package/domain/permissionsSchema.js.map +1 -0
  11. package/domain/tagsHelpers.d.ts +16 -0
  12. package/domain/tagsHelpers.js +25 -0
  13. package/domain/tagsHelpers.js.map +1 -0
  14. package/domain/types.d.ts +34 -0
  15. package/domain/types.js +0 -0
  16. package/exports/admin/ui/file-manager.d.ts +2 -0
  17. package/exports/admin/ui/file-manager.js +1 -0
  18. package/features/deleteFile/DeleteFile.test.d.ts +1 -0
  19. package/features/deleteFile/DeleteFile.test.js +150 -0
  20. package/features/deleteFile/DeleteFile.test.js.map +1 -0
  21. package/features/deleteFile/DeleteFileGateway.d.ts +11 -0
  22. package/features/deleteFile/DeleteFileGateway.js +23 -0
  23. package/features/deleteFile/DeleteFileGateway.js.map +1 -0
  24. package/features/deleteFile/DeleteFileRepository.d.ts +12 -0
  25. package/features/deleteFile/DeleteFileRepository.js +26 -0
  26. package/features/deleteFile/DeleteFileRepository.js.map +1 -0
  27. package/features/deleteFile/DeleteFileUseCase.d.ts +10 -0
  28. package/features/deleteFile/DeleteFileUseCase.js +34 -0
  29. package/features/deleteFile/DeleteFileUseCase.js.map +1 -0
  30. package/features/deleteFile/abstractions.d.ts +36 -0
  31. package/features/deleteFile/abstractions.js +7 -0
  32. package/features/deleteFile/abstractions.js.map +1 -0
  33. package/features/deleteFile/feature.d.ts +3 -0
  34. package/features/deleteFile/feature.js +21 -0
  35. package/features/deleteFile/feature.js.map +1 -0
  36. package/features/deleteFile/index.d.ts +3 -0
  37. package/features/deleteFile/index.js +2 -0
  38. package/features/fileModel/FileModelProvider.d.ts +12 -0
  39. package/features/fileModel/FileModelProvider.js +21 -0
  40. package/features/fileModel/FileModelProvider.js.map +1 -0
  41. package/features/fileModel/GetFileModelGqlGateway.d.ts +12 -0
  42. package/features/fileModel/GetFileModelGqlGateway.js +38 -0
  43. package/features/fileModel/GetFileModelGqlGateway.js.map +1 -0
  44. package/features/fileModel/GetFileModelRepository.d.ts +14 -0
  45. package/features/fileModel/GetFileModelRepository.js +32 -0
  46. package/features/fileModel/GetFileModelRepository.js.map +1 -0
  47. package/features/fileModel/abstractions.d.ts +24 -0
  48. package/features/fileModel/abstractions.js +7 -0
  49. package/features/fileModel/abstractions.js.map +1 -0
  50. package/features/fileModel/feature.d.ts +1 -0
  51. package/features/fileModel/feature.js +15 -0
  52. package/features/fileModel/feature.js.map +1 -0
  53. package/features/fileModel/index.d.ts +2 -0
  54. package/features/fileModel/index.js +2 -0
  55. package/features/fileUploader/FileUploader.d.ts +23 -0
  56. package/features/fileUploader/FileUploader.js +243 -0
  57. package/features/fileUploader/FileUploader.js.map +1 -0
  58. package/features/fileUploader/FileUploader.test.d.ts +1 -0
  59. package/features/fileUploader/FileUploader.test.js +427 -0
  60. package/features/fileUploader/FileUploader.test.js.map +1 -0
  61. package/features/fileUploader/abstractions.d.ts +51 -0
  62. package/features/fileUploader/abstractions.js +5 -0
  63. package/features/fileUploader/abstractions.js.map +1 -0
  64. package/features/fileUploader/feature.d.ts +3 -0
  65. package/features/fileUploader/feature.js +17 -0
  66. package/features/fileUploader/feature.js.map +1 -0
  67. package/features/fileUploader/index.d.ts +3 -0
  68. package/features/fileUploader/index.js +2 -0
  69. package/features/fileUrlFormatter/FileUrlFormatter.d.ts +8 -0
  70. package/features/fileUrlFormatter/FileUrlFormatter.js +13 -0
  71. package/features/fileUrlFormatter/FileUrlFormatter.js.map +1 -0
  72. package/features/fileUrlFormatter/abstractions.d.ts +1 -0
  73. package/features/fileUrlFormatter/abstractions.js +1 -0
  74. package/features/fileUrlFormatter/feature.d.ts +1 -0
  75. package/features/fileUrlFormatter/feature.js +11 -0
  76. package/features/fileUrlFormatter/feature.js.map +1 -0
  77. package/features/getFile/GetFileGateway.d.ts +14 -0
  78. package/features/getFile/GetFileGateway.js +28 -0
  79. package/features/getFile/GetFileGateway.js.map +1 -0
  80. package/features/getFile/GetFileRepository.d.ts +11 -0
  81. package/features/getFile/GetFileRepository.js +18 -0
  82. package/features/getFile/GetFileRepository.js.map +1 -0
  83. package/features/getFile/GetFileUseCase.d.ts +10 -0
  84. package/features/getFile/GetFileUseCase.js +35 -0
  85. package/features/getFile/GetFileUseCase.js.map +1 -0
  86. package/features/getFile/abstractions.d.ts +38 -0
  87. package/features/getFile/abstractions.js +7 -0
  88. package/features/getFile/abstractions.js.map +1 -0
  89. package/features/getFile/feature.d.ts +3 -0
  90. package/features/getFile/feature.js +21 -0
  91. package/features/getFile/feature.js.map +1 -0
  92. package/features/getFile/index.d.ts +3 -0
  93. package/features/getFile/index.js +2 -0
  94. package/features/listFiles/ListFiles.test.d.ts +1 -0
  95. package/features/listFiles/ListFiles.test.js +192 -0
  96. package/features/listFiles/ListFiles.test.js.map +1 -0
  97. package/features/listFiles/ListFilesGateway.d.ts +13 -0
  98. package/features/listFiles/ListFilesGateway.js +35 -0
  99. package/features/listFiles/ListFilesGateway.js.map +1 -0
  100. package/features/listFiles/ListFilesRepository.d.ts +12 -0
  101. package/features/listFiles/ListFilesRepository.js +26 -0
  102. package/features/listFiles/ListFilesRepository.js.map +1 -0
  103. package/features/listFiles/ListFilesUseCase.d.ts +10 -0
  104. package/features/listFiles/ListFilesUseCase.js +28 -0
  105. package/features/listFiles/ListFilesUseCase.js.map +1 -0
  106. package/features/listFiles/abstractions.d.ts +45 -0
  107. package/features/listFiles/abstractions.js +7 -0
  108. package/features/listFiles/abstractions.js.map +1 -0
  109. package/features/listFiles/feature.d.ts +3 -0
  110. package/features/listFiles/feature.js +21 -0
  111. package/features/listFiles/feature.js.map +1 -0
  112. package/features/listFiles/index.d.ts +3 -0
  113. package/features/listFiles/index.js +2 -0
  114. package/features/permissions/abstractions.d.ts +17 -0
  115. package/features/permissions/abstractions.js +6 -0
  116. package/features/permissions/abstractions.js.map +1 -0
  117. package/features/permissions/feature.d.ts +14 -0
  118. package/features/permissions/feature.js +7 -0
  119. package/features/permissions/feature.js.map +1 -0
  120. package/features/resolveImageTool/ResolveImageTool.d.ts +40 -0
  121. package/features/resolveImageTool/ResolveImageTool.js +49 -0
  122. package/features/resolveImageTool/ResolveImageTool.js.map +1 -0
  123. package/features/resolveImageTool/feature.d.ts +1 -0
  124. package/features/resolveImageTool/feature.js +11 -0
  125. package/features/resolveImageTool/feature.js.map +1 -0
  126. package/features/settings/GetSettings.test.d.ts +1 -0
  127. package/features/settings/GetSettings.test.js +92 -0
  128. package/features/settings/GetSettings.test.js.map +1 -0
  129. package/features/settings/GetSettingsGateway.d.ts +12 -0
  130. package/features/settings/GetSettingsGateway.js +43 -0
  131. package/features/settings/GetSettingsGateway.js.map +1 -0
  132. package/features/settings/GetSettingsRepository.d.ts +14 -0
  133. package/features/settings/GetSettingsRepository.js +34 -0
  134. package/features/settings/GetSettingsRepository.js.map +1 -0
  135. package/features/settings/GetSettingsUseCase.d.ts +11 -0
  136. package/features/settings/GetSettingsUseCase.js +18 -0
  137. package/features/settings/GetSettingsUseCase.js.map +1 -0
  138. package/features/settings/SaveSettingsGateway.d.ts +12 -0
  139. package/features/settings/SaveSettingsGateway.js +50 -0
  140. package/features/settings/SaveSettingsGateway.js.map +1 -0
  141. package/features/settings/abstractions.d.ts +31 -0
  142. package/features/settings/abstractions.js +8 -0
  143. package/features/settings/abstractions.js.map +1 -0
  144. package/features/settings/feature.d.ts +3 -0
  145. package/features/settings/feature.js +23 -0
  146. package/features/settings/feature.js.map +1 -0
  147. package/features/settings/index.d.ts +3 -0
  148. package/features/settings/index.js +2 -0
  149. package/features/shared/FILE_FIELDS.d.ts +1 -0
  150. package/features/shared/FILE_FIELDS.js +32 -0
  151. package/features/shared/FILE_FIELDS.js.map +1 -0
  152. package/features/shared/FileFieldsProvider.d.ts +8 -0
  153. package/features/shared/FileFieldsProvider.js +14 -0
  154. package/features/shared/FileFieldsProvider.js.map +1 -0
  155. package/features/shared/FileFieldsProviderWithWcp.d.ts +12 -0
  156. package/features/shared/FileFieldsProviderWithWcp.js +25 -0
  157. package/features/shared/FileFieldsProviderWithWcp.js.map +1 -0
  158. package/features/shared/FilesListCache.d.ts +1 -0
  159. package/features/shared/FilesListCache.js +1 -0
  160. package/features/shared/abstractions.d.ts +13 -0
  161. package/features/shared/abstractions.js +6 -0
  162. package/features/shared/abstractions.js.map +1 -0
  163. package/features/shared/feature.d.ts +5 -0
  164. package/features/shared/feature.js +22 -0
  165. package/features/shared/feature.js.map +1 -0
  166. package/features/shared/index.d.ts +4 -0
  167. package/features/shared/index.js +3 -0
  168. package/features/shared/types.d.ts +16 -0
  169. package/features/shared/types.js +0 -0
  170. package/features/tags/ListTags.test.d.ts +1 -0
  171. package/features/tags/ListTags.test.js +126 -0
  172. package/features/tags/ListTags.test.js.map +1 -0
  173. package/features/tags/ListTagsGateway.d.ts +11 -0
  174. package/features/tags/ListTagsGateway.js +23 -0
  175. package/features/tags/ListTagsGateway.js.map +1 -0
  176. package/features/tags/ListTagsRepository.d.ts +12 -0
  177. package/features/tags/ListTagsRepository.js +25 -0
  178. package/features/tags/ListTagsRepository.js.map +1 -0
  179. package/features/tags/ListTagsUseCase.d.ts +10 -0
  180. package/features/tags/ListTagsUseCase.js +20 -0
  181. package/features/tags/ListTagsUseCase.js.map +1 -0
  182. package/features/tags/abstractions.d.ts +32 -0
  183. package/features/tags/abstractions.js +7 -0
  184. package/features/tags/abstractions.js.map +1 -0
  185. package/features/tags/feature.d.ts +3 -0
  186. package/features/tags/feature.js +21 -0
  187. package/features/tags/feature.js.map +1 -0
  188. package/features/tags/index.d.ts +3 -0
  189. package/features/tags/index.js +2 -0
  190. package/features/updateFile/UpdateFile.test.d.ts +1 -0
  191. package/features/updateFile/UpdateFile.test.js +260 -0
  192. package/features/updateFile/UpdateFile.test.js.map +1 -0
  193. package/features/updateFile/UpdateFileGateway.d.ts +12 -0
  194. package/features/updateFile/UpdateFileGateway.js +25 -0
  195. package/features/updateFile/UpdateFileGateway.js.map +1 -0
  196. package/features/updateFile/UpdateFileRepository.d.ts +14 -0
  197. package/features/updateFile/UpdateFileRepository.js +32 -0
  198. package/features/updateFile/UpdateFileRepository.js.map +1 -0
  199. package/features/updateFile/UpdateFileUseCase.d.ts +12 -0
  200. package/features/updateFile/UpdateFileUseCase.js +41 -0
  201. package/features/updateFile/UpdateFileUseCase.js.map +1 -0
  202. package/features/updateFile/abstractions.d.ts +53 -0
  203. package/features/updateFile/abstractions.js +7 -0
  204. package/features/updateFile/abstractions.js.map +1 -0
  205. package/features/updateFile/feature.d.ts +3 -0
  206. package/features/updateFile/feature.js +21 -0
  207. package/features/updateFile/feature.js.map +1 -0
  208. package/features/updateFile/index.d.ts +3 -0
  209. package/features/updateFile/index.js +2 -0
  210. package/index.d.ts +3 -2
  211. package/index.js +3 -37
  212. package/modules/Enterprise/HandleWebsocketMessages.d.ts +1 -0
  213. package/modules/Enterprise/HandleWebsocketMessages.js +53 -0
  214. package/modules/Enterprise/HandleWebsocketMessages.js.map +1 -0
  215. package/modules/Enterprise/components/ThreatScanInProgressFileBody.d.ts +2 -0
  216. package/modules/Enterprise/components/ThreatScanInProgressFileBody.js +22 -0
  217. package/modules/Enterprise/components/ThreatScanInProgressFileBody.js.map +1 -0
  218. package/modules/Enterprise/components/ThreatScanInProgressTableCell.d.ts +6 -0
  219. package/modules/Enterprise/components/ThreatScanInProgressTableCell.js +20 -0
  220. package/modules/Enterprise/components/ThreatScanInProgressTableCell.js.map +1 -0
  221. package/modules/Enterprise/constants.d.ts +3 -0
  222. package/modules/Enterprise/constants.js +6 -0
  223. package/modules/Enterprise/constants.js.map +1 -0
  224. package/modules/Enterprise/index.d.ts +2 -0
  225. package/modules/Enterprise/index.js +30 -0
  226. package/modules/Enterprise/index.js.map +1 -0
  227. package/modules/FileManagerRoutes.d.ts +2 -0
  228. package/modules/FileManagerRoutes.js +31 -0
  229. package/modules/FileManagerRoutes.js.map +1 -0
  230. package/modules/FileModelModule.d.ts +2 -0
  231. package/modules/FileModelModule.js +18 -0
  232. package/modules/FileModelModule.js.map +1 -0
  233. package/modules/FileUrlFormatter.d.ts +2 -0
  234. package/modules/FileUrlFormatter.js +9 -0
  235. package/modules/FileUrlFormatter.js.map +1 -0
  236. package/modules/HeadlessCms/fileField.d.ts +2 -0
  237. package/modules/HeadlessCms/fileField.js +44 -0
  238. package/modules/HeadlessCms/fileField.js.map +1 -0
  239. package/modules/HeadlessCms/fileRenderer/fileField.d.ts +2 -0
  240. package/modules/HeadlessCms/fileRenderer/fileField.js +53 -0
  241. package/modules/HeadlessCms/fileRenderer/fileField.js.map +1 -0
  242. package/modules/HeadlessCms/fileRenderer/fileFields.d.ts +2 -0
  243. package/modules/HeadlessCms/fileRenderer/fileFields.js +73 -0
  244. package/modules/HeadlessCms/fileRenderer/fileFields.js.map +1 -0
  245. package/modules/HeadlessCms/fileRenderer/utils.d.ts +2 -0
  246. package/modules/HeadlessCms/fileRenderer/utils.js +15 -0
  247. package/modules/HeadlessCms/fileRenderer/utils.js.map +1 -0
  248. package/modules/HeadlessCms/index.d.ts +1 -0
  249. package/modules/HeadlessCms/index.js +14 -0
  250. package/modules/HeadlessCms/index.js.map +1 -0
  251. package/modules/SecurityPermissions.d.ts +2 -0
  252. package/modules/SecurityPermissions.js +15 -0
  253. package/modules/SecurityPermissions.js.map +1 -0
  254. package/modules/Settings/assets/icons/folder-open.js +19 -0
  255. package/modules/Settings/assets/icons/folder-open.js.map +1 -0
  256. package/{admin → modules/Settings}/graphql.d.ts +7 -0
  257. package/modules/Settings/graphql.js +36 -0
  258. package/modules/Settings/graphql.js.map +1 -0
  259. package/modules/Settings/index.d.ts +2 -0
  260. package/modules/Settings/index.js +27 -0
  261. package/modules/Settings/index.js.map +1 -0
  262. package/modules/Settings/views/FileManagerSettings.d.ts +2 -0
  263. package/modules/Settings/views/FileManagerSettings.js +134 -0
  264. package/modules/Settings/views/FileManagerSettings.js.map +1 -0
  265. package/package.json +46 -37
  266. package/presentation/FileActions/FileDetails/CopyUrl.d.ts +2 -0
  267. package/presentation/FileActions/FileDetails/CopyUrl.js +19 -0
  268. package/presentation/FileActions/FileDetails/CopyUrl.js.map +1 -0
  269. package/presentation/FileActions/FileDetails/DeleteImage.d.ts +2 -0
  270. package/presentation/FileActions/FileDetails/DeleteImage.js +24 -0
  271. package/presentation/FileActions/FileDetails/DeleteImage.js.map +1 -0
  272. package/presentation/FileActions/FileDetails/Download.d.ts +2 -0
  273. package/presentation/FileActions/FileDetails/Download.js +19 -0
  274. package/presentation/FileActions/FileDetails/Download.js.map +1 -0
  275. package/presentation/FileActions/FileDetails/MoveToFolder.d.ts +2 -0
  276. package/presentation/FileActions/FileDetails/MoveToFolder.js +16 -0
  277. package/presentation/FileActions/FileDetails/MoveToFolder.js.map +1 -0
  278. package/presentation/FileActions/Grid/Delete.d.ts +2 -0
  279. package/presentation/FileActions/Grid/Delete.js +23 -0
  280. package/presentation/FileActions/Grid/Delete.js.map +1 -0
  281. package/presentation/FileActions/Grid/Download.d.ts +2 -0
  282. package/presentation/FileActions/Grid/Download.js +19 -0
  283. package/presentation/FileActions/Grid/Download.js.map +1 -0
  284. package/presentation/FileActions/Grid/MoveToFolder.d.ts +2 -0
  285. package/presentation/FileActions/Grid/MoveToFolder.js +16 -0
  286. package/presentation/FileActions/Grid/MoveToFolder.js.map +1 -0
  287. package/presentation/FileActions/Grid/Settings.d.ts +2 -0
  288. package/presentation/FileActions/Grid/Settings.js +23 -0
  289. package/presentation/FileActions/Grid/Settings.js.map +1 -0
  290. package/presentation/FileActions/index.d.ts +2 -0
  291. package/presentation/FileActions/index.js +39 -0
  292. package/presentation/FileActions/index.js.map +1 -0
  293. package/presentation/FileDetails/FileDetailsPresenter.d.ts +28 -0
  294. package/presentation/FileDetails/FileDetailsPresenter.js +138 -0
  295. package/presentation/FileDetails/FileDetailsPresenter.js.map +1 -0
  296. package/presentation/FileDetails/FileDetailsPresenter.test.d.ts +1 -0
  297. package/presentation/FileDetails/FileDetailsPresenter.test.js +280 -0
  298. package/presentation/FileDetails/FileDetailsPresenter.test.js.map +1 -0
  299. package/presentation/FileDetails/abstractions.d.ts +22 -0
  300. package/presentation/FileDetails/abstractions.js +5 -0
  301. package/presentation/FileDetails/abstractions.js.map +1 -0
  302. package/presentation/FileDetails/components/ActionButton.d.ts +10 -0
  303. package/presentation/FileDetails/components/ActionButton.js +15 -0
  304. package/presentation/FileDetails/components/ActionButton.js.map +1 -0
  305. package/presentation/FileDetails/components/Actions.d.ts +2 -0
  306. package/presentation/FileDetails/components/Actions.js +13 -0
  307. package/presentation/FileDetails/components/Actions.js.map +1 -0
  308. package/presentation/FileDetails/components/Content.d.ts +14 -0
  309. package/presentation/FileDetails/components/Content.js +20 -0
  310. package/presentation/FileDetails/components/Content.js.map +1 -0
  311. package/presentation/FileDetails/components/CreatedOn.d.ts +2 -0
  312. package/presentation/FileDetails/components/CreatedOn.js +21 -0
  313. package/presentation/FileDetails/components/CreatedOn.js.map +1 -0
  314. package/presentation/FileDetails/components/Description.d.ts +2 -0
  315. package/presentation/FileDetails/components/Description.js +16 -0
  316. package/presentation/FileDetails/components/Description.js.map +1 -0
  317. package/presentation/FileDetails/components/FileDetailsDrawer.d.ts +4 -0
  318. package/presentation/FileDetails/components/FileDetailsDrawer.js +73 -0
  319. package/presentation/FileDetails/components/FileDetailsDrawer.js.map +1 -0
  320. package/presentation/FileDetails/components/Preview.d.ts +2 -0
  321. package/presentation/FileDetails/components/Preview.js +15 -0
  322. package/presentation/FileDetails/components/Preview.js.map +1 -0
  323. package/presentation/FileDetails/components/Thumbnail.d.ts +2 -0
  324. package/presentation/FileDetails/components/Thumbnail.js +12 -0
  325. package/presentation/FileDetails/components/Thumbnail.js.map +1 -0
  326. package/presentation/FileDetails/feature.d.ts +3 -0
  327. package/presentation/FileDetails/feature.js +17 -0
  328. package/presentation/FileDetails/feature.js.map +1 -0
  329. package/presentation/FileDetails/index.d.ts +3 -0
  330. package/presentation/FileDetails/index.js +2 -0
  331. package/presentation/FileList/FileListDataSource.d.ts +20 -0
  332. package/presentation/FileList/FileListDataSource.js +122 -0
  333. package/presentation/FileList/FileListDataSource.js.map +1 -0
  334. package/presentation/FileList/FileListPresenter.test.d.ts +1 -0
  335. package/presentation/FileList/FileListPresenter.test.js +424 -0
  336. package/presentation/FileList/FileListPresenter.test.js.map +1 -0
  337. package/presentation/FileList/FileManagerPresenter.d.ts +43 -0
  338. package/presentation/FileList/FileManagerPresenter.js +213 -0
  339. package/presentation/FileList/FileManagerPresenter.js.map +1 -0
  340. package/presentation/FileList/FileManagerPresenterProvider.d.ts +9 -0
  341. package/presentation/FileList/FileManagerPresenterProvider.js +13 -0
  342. package/presentation/FileList/FileManagerPresenterProvider.js.map +1 -0
  343. package/presentation/FileList/abstractions.d.ts +76 -0
  344. package/presentation/FileList/abstractions.js +5 -0
  345. package/presentation/FileList/abstractions.js.map +1 -0
  346. package/presentation/FileList/components/BottomInfoBar/BottomInfoBar.d.ts +6 -0
  347. package/presentation/FileList/components/BottomInfoBar/BottomInfoBar.js +12 -0
  348. package/presentation/FileList/components/BottomInfoBar/BottomInfoBar.js.map +1 -0
  349. package/presentation/FileList/components/BottomInfoBar/ListStatus.d.ts +6 -0
  350. package/presentation/FileList/components/BottomInfoBar/ListStatus.js +20 -0
  351. package/presentation/FileList/components/BottomInfoBar/ListStatus.js.map +1 -0
  352. package/presentation/FileList/components/BottomInfoBar/SupportedFileTypes.d.ts +8 -0
  353. package/presentation/FileList/components/BottomInfoBar/SupportedFileTypes.js +56 -0
  354. package/presentation/FileList/components/BottomInfoBar/SupportedFileTypes.js.map +1 -0
  355. package/presentation/FileList/components/BottomInfoBar/index.d.ts +1 -0
  356. package/presentation/FileList/components/BottomInfoBar/index.js +1 -0
  357. package/presentation/FileList/components/BulkActions/ActionEdit.types.d.ts +2 -0
  358. package/presentation/FileList/components/BulkActions/ActionEdit.types.js +0 -0
  359. package/presentation/FileList/components/BulkActions/ActionEditPresenter.d.ts +35 -0
  360. package/presentation/FileList/components/BulkActions/ActionEditPresenter.js +55 -0
  361. package/presentation/FileList/components/BulkActions/ActionEditPresenter.js.map +1 -0
  362. package/presentation/FileList/components/BulkActions/ActionEditPresenter.test.d.ts +1 -0
  363. package/presentation/FileList/components/BulkActions/ActionEditPresenter.test.js +170 -0
  364. package/presentation/FileList/components/BulkActions/ActionEditPresenter.test.js.map +1 -0
  365. package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.d.ts +7 -0
  366. package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.js +15 -0
  367. package/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.js.map +1 -0
  368. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.d.ts +15 -0
  369. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.js +44 -0
  370. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.js.map +1 -0
  371. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.d.ts +15 -0
  372. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.js +52 -0
  373. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.js.map +1 -0
  374. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.d.ts +61 -0
  375. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js +111 -0
  376. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js.map +1 -0
  377. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.d.ts +1 -0
  378. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.js +372 -0
  379. package/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.test.js.map +1 -0
  380. package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.d.ts +8 -0
  381. package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.js +31 -0
  382. package/presentation/FileList/components/BulkActions/BatchEditorDialog/FieldRenderer.js.map +1 -0
  383. package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.d.ts +11 -0
  384. package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.js +33 -0
  385. package/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.js.map +1 -0
  386. package/presentation/FileList/components/BulkActions/BatchEditorDialog/index.d.ts +1 -0
  387. package/presentation/FileList/components/BulkActions/BatchEditorDialog/index.js +1 -0
  388. package/presentation/FileList/components/BulkActions/BulkActionBar.d.ts +5 -0
  389. package/presentation/FileList/components/BulkActions/BulkActionBar.js +42 -0
  390. package/presentation/FileList/components/BulkActions/BulkActionBar.js.map +1 -0
  391. package/presentation/FileList/components/BulkActions/BulkActionDelete.d.ts +4 -0
  392. package/presentation/FileList/components/BulkActions/BulkActionDelete.js +65 -0
  393. package/presentation/FileList/components/BulkActions/BulkActionDelete.js.map +1 -0
  394. package/presentation/FileList/components/BulkActions/BulkActionEdit.d.ts +4 -0
  395. package/presentation/FileList/components/BulkActions/BulkActionEdit.js +105 -0
  396. package/presentation/FileList/components/BulkActions/BulkActionEdit.js.map +1 -0
  397. package/presentation/FileList/components/BulkActions/BulkActionMove.d.ts +4 -0
  398. package/presentation/FileList/components/BulkActions/BulkActionMove.js +87 -0
  399. package/presentation/FileList/components/BulkActions/BulkActionMove.js.map +1 -0
  400. package/presentation/FileList/components/BulkActions/GraphQLInputMapper.d.ts +23 -0
  401. package/presentation/FileList/components/BulkActions/GraphQLInputMapper.js +40 -0
  402. package/presentation/FileList/components/BulkActions/GraphQLInputMapper.js.map +1 -0
  403. package/presentation/FileList/components/BulkActions/GraphQLInputMapper.test.d.ts +1 -0
  404. package/presentation/FileList/components/BulkActions/GraphQLInputMapper.test.js +319 -0
  405. package/presentation/FileList/components/BulkActions/GraphQLInputMapper.test.js.map +1 -0
  406. package/presentation/FileList/components/BulkActions/domain/Batch.d.ts +32 -0
  407. package/presentation/FileList/components/BulkActions/domain/Batch.js +32 -0
  408. package/presentation/FileList/components/BulkActions/domain/Batch.js.map +1 -0
  409. package/presentation/FileList/components/BulkActions/domain/BatchMapper.d.ts +4 -0
  410. package/presentation/FileList/components/BulkActions/domain/BatchMapper.js +14 -0
  411. package/presentation/FileList/components/BulkActions/domain/BatchMapper.js.map +1 -0
  412. package/presentation/FileList/components/BulkActions/domain/Field.d.ts +32 -0
  413. package/presentation/FileList/components/BulkActions/domain/Field.js +49 -0
  414. package/presentation/FileList/components/BulkActions/domain/Field.js.map +1 -0
  415. package/presentation/FileList/components/BulkActions/domain/FieldMapper.d.ts +7 -0
  416. package/presentation/FileList/components/BulkActions/domain/FieldMapper.js +21 -0
  417. package/presentation/FileList/components/BulkActions/domain/FieldMapper.js.map +1 -0
  418. package/presentation/FileList/components/BulkActions/domain/index.d.ts +4 -0
  419. package/presentation/FileList/components/BulkActions/domain/index.js +4 -0
  420. package/presentation/FileList/components/BulkActions/index.d.ts +5 -0
  421. package/presentation/FileList/components/BulkActions/index.js +5 -0
  422. package/presentation/FileList/components/BulkActions/useBulkActionWorker.d.ts +16 -0
  423. package/presentation/FileList/components/BulkActions/useBulkActionWorker.js +43 -0
  424. package/presentation/FileList/components/BulkActions/useBulkActionWorker.js.map +1 -0
  425. package/presentation/FileList/components/Empty/Empty.d.ts +8 -0
  426. package/presentation/FileList/components/Empty/Empty.js +20 -0
  427. package/presentation/FileList/components/Empty/Empty.js.map +1 -0
  428. package/presentation/FileList/components/Empty/index.d.ts +1 -0
  429. package/presentation/FileList/components/Empty/index.js +1 -0
  430. package/presentation/FileList/components/FileDropArea/FileDropArea.d.ts +9 -0
  431. package/presentation/FileList/components/FileDropArea/FileDropArea.js +62 -0
  432. package/presentation/FileList/components/FileDropArea/FileDropArea.js.map +1 -0
  433. package/presentation/FileList/components/FileDropArea/index.d.ts +1 -0
  434. package/presentation/FileList/components/FileDropArea/index.js +1 -0
  435. package/presentation/FileList/components/FileDropPlaceholder/FileDropPlaceholder.d.ts +2 -0
  436. package/presentation/FileList/components/FileDropPlaceholder/FileDropPlaceholder.js +11 -0
  437. package/presentation/FileList/components/FileDropPlaceholder/FileDropPlaceholder.js.map +1 -0
  438. package/presentation/FileList/components/FileDropPlaceholder/index.d.ts +1 -0
  439. package/presentation/FileList/components/FileDropPlaceholder/index.js +1 -0
  440. package/presentation/FileList/components/FilePicker/FilePicker.d.ts +11 -0
  441. package/presentation/FileList/components/FilePicker/FilePicker.js +28 -0
  442. package/presentation/FileList/components/FilePicker/FilePicker.js.map +1 -0
  443. package/presentation/FileList/components/Filters/FilterByType.d.ts +2 -0
  444. package/presentation/FileList/components/Filters/FilterByType.js +39 -0
  445. package/presentation/FileList/components/Filters/FilterByType.js.map +1 -0
  446. package/presentation/FileList/components/Filters/SubFoldersToggle.d.ts +9 -0
  447. package/presentation/FileList/components/Filters/SubFoldersToggle.js +25 -0
  448. package/presentation/FileList/components/Filters/SubFoldersToggle.js.map +1 -0
  449. package/presentation/FileList/components/Filters/TagsFilter.d.ts +9 -0
  450. package/presentation/FileList/components/Filters/TagsFilter.js +86 -0
  451. package/presentation/FileList/components/Filters/TagsFilter.js.map +1 -0
  452. package/presentation/FileList/components/Filters/TypeFilter.d.ts +8 -0
  453. package/presentation/FileList/components/Filters/TypeFilter.js +46 -0
  454. package/presentation/FileList/components/Filters/TypeFilter.js.map +1 -0
  455. package/presentation/FileList/components/Filters/index.d.ts +3 -0
  456. package/presentation/FileList/components/Filters/index.js +3 -0
  457. package/presentation/FileList/components/Grid/ActionButton.d.ts +9 -0
  458. package/presentation/FileList/components/Grid/ActionButton.js +24 -0
  459. package/presentation/FileList/components/Grid/ActionButton.js.map +1 -0
  460. package/presentation/FileList/components/Grid/File.d.ts +32 -0
  461. package/presentation/FileList/components/Grid/File.js +84 -0
  462. package/presentation/FileList/components/Grid/File.js.map +1 -0
  463. package/presentation/FileList/components/Grid/FileGrid.d.ts +9 -0
  464. package/presentation/FileList/components/Grid/FileGrid.js +162 -0
  465. package/presentation/FileList/components/Grid/FileGrid.js.map +1 -0
  466. package/presentation/FileList/components/Grid/FileGrid.test.d.ts +1 -0
  467. package/presentation/FileList/components/Grid/FileGrid.test.js +387 -0
  468. package/presentation/FileList/components/Grid/FileGrid.test.js.map +1 -0
  469. package/presentation/FileList/components/Grid/index.d.ts +1 -0
  470. package/presentation/FileList/components/Grid/index.js +1 -0
  471. package/presentation/FileList/components/Header/FileManagerHeader.d.ts +7 -0
  472. package/presentation/FileList/components/Header/FileManagerHeader.js +114 -0
  473. package/presentation/FileList/components/Header/FileManagerHeader.js.map +1 -0
  474. package/presentation/FileList/components/LayoutSwitch/LayoutSwitch.d.ts +2 -0
  475. package/presentation/FileList/components/LayoutSwitch/LayoutSwitch.js +24 -0
  476. package/presentation/FileList/components/LayoutSwitch/LayoutSwitch.js.map +1 -0
  477. package/presentation/FileList/components/LayoutSwitch/index.d.ts +1 -0
  478. package/presentation/FileList/components/LayoutSwitch/index.js +1 -0
  479. package/presentation/FileList/components/NoPermissions/NoPermissions.d.ts +2 -0
  480. package/presentation/FileList/components/NoPermissions/NoPermissions.js +27 -0
  481. package/presentation/FileList/components/NoPermissions/NoPermissions.js.map +1 -0
  482. package/presentation/FileList/components/NoPermissions/index.d.ts +1 -0
  483. package/presentation/FileList/components/NoPermissions/index.js +1 -0
  484. package/presentation/FileList/components/NoResults/NoResults.d.ts +2 -0
  485. package/presentation/FileList/components/NoResults/NoResults.js +21 -0
  486. package/presentation/FileList/components/NoResults/NoResults.js.map +1 -0
  487. package/presentation/FileList/components/NoResults/index.d.ts +1 -0
  488. package/presentation/FileList/components/NoResults/index.js +1 -0
  489. package/presentation/FileList/components/Search/SearchBar.d.ts +9 -0
  490. package/presentation/FileList/components/Search/SearchBar.js +33 -0
  491. package/presentation/FileList/components/Search/SearchBar.js.map +1 -0
  492. package/presentation/FileList/components/Search/index.d.ts +1 -0
  493. package/presentation/FileList/components/Search/index.js +1 -0
  494. package/presentation/FileList/components/Table/Actions/CopyFile.d.ts +2 -0
  495. package/presentation/FileList/components/Table/Actions/CopyFile.js +21 -0
  496. package/presentation/FileList/components/Table/Actions/CopyFile.js.map +1 -0
  497. package/presentation/FileList/components/Table/Actions/DeleteFile.d.ts +2 -0
  498. package/presentation/FileList/components/Table/Actions/DeleteFile.js +24 -0
  499. package/presentation/FileList/components/Table/Actions/DeleteFile.js.map +1 -0
  500. package/presentation/FileList/components/Table/Actions/EditFile.d.ts +2 -0
  501. package/presentation/FileList/components/Table/Actions/EditFile.js +19 -0
  502. package/presentation/FileList/components/Table/Actions/EditFile.js.map +1 -0
  503. package/presentation/FileList/components/Table/Actions/MoveFile.d.ts +2 -0
  504. package/presentation/FileList/components/Table/Actions/MoveFile.js +19 -0
  505. package/presentation/FileList/components/Table/Actions/MoveFile.js.map +1 -0
  506. package/presentation/FileList/components/Table/Actions/index.d.ts +4 -0
  507. package/presentation/FileList/components/Table/Actions/index.js +4 -0
  508. package/presentation/FileList/components/Table/Cells/CellActions.d.ts +2 -0
  509. package/presentation/FileList/components/Table/Cells/CellActions.js +28 -0
  510. package/presentation/FileList/components/Table/Cells/CellActions.js.map +1 -0
  511. package/presentation/FileList/components/Table/Cells/CellAuthor.d.ts +2 -0
  512. package/presentation/FileList/components/Table/Cells/CellAuthor.js +10 -0
  513. package/presentation/FileList/components/Table/Cells/CellAuthor.js.map +1 -0
  514. package/presentation/FileList/components/Table/Cells/CellCreated.d.ts +2 -0
  515. package/presentation/FileList/components/Table/Cells/CellCreated.js +13 -0
  516. package/presentation/FileList/components/Table/Cells/CellCreated.js.map +1 -0
  517. package/presentation/FileList/components/Table/Cells/CellModified.d.ts +2 -0
  518. package/presentation/FileList/components/Table/Cells/CellModified.js +13 -0
  519. package/presentation/FileList/components/Table/Cells/CellModified.js.map +1 -0
  520. package/presentation/FileList/components/Table/Cells/CellName.d.ts +16 -0
  521. package/presentation/FileList/components/Table/Cells/CellName.js +59 -0
  522. package/presentation/FileList/components/Table/Cells/CellName.js.map +1 -0
  523. package/presentation/FileList/components/Table/Cells/CellSize.d.ts +2 -0
  524. package/presentation/FileList/components/Table/Cells/CellSize.js +14 -0
  525. package/presentation/FileList/components/Table/Cells/CellSize.js.map +1 -0
  526. package/presentation/FileList/components/Table/Cells/CellThumbnail.d.ts +2 -0
  527. package/presentation/FileList/components/Table/Cells/CellThumbnail.js +12 -0
  528. package/presentation/FileList/components/Table/Cells/CellThumbnail.js.map +1 -0
  529. package/presentation/FileList/components/Table/Cells/CellType.d.ts +2 -0
  530. package/presentation/FileList/components/Table/Cells/CellType.js +11 -0
  531. package/presentation/FileList/components/Table/Cells/CellType.js.map +1 -0
  532. package/presentation/FileList/components/Table/Cells/index.d.ts +7 -0
  533. package/presentation/FileList/components/Table/Cells/index.js +7 -0
  534. package/presentation/FileList/components/Table/FileTable.d.ts +12 -0
  535. package/presentation/FileList/components/Table/FileTable.js +79 -0
  536. package/presentation/FileList/components/Table/FileTable.js.map +1 -0
  537. package/presentation/FileList/components/Table/FileTable.test.d.ts +1 -0
  538. package/presentation/FileList/components/Table/FileTable.test.js +365 -0
  539. package/presentation/FileList/components/Table/FileTable.test.js.map +1 -0
  540. package/presentation/FileList/components/Table/index.d.ts +4 -0
  541. package/presentation/FileList/components/Table/index.js +3 -0
  542. package/presentation/FileList/components/TagsList/Empty.d.ts +6 -0
  543. package/presentation/FileList/components/TagsList/Empty.js +8 -0
  544. package/presentation/FileList/components/TagsList/Empty.js.map +1 -0
  545. package/presentation/FileList/components/TagsList/FilterSelect.d.ts +2 -0
  546. package/presentation/FileList/components/TagsList/FilterSelect.js +38 -0
  547. package/presentation/FileList/components/TagsList/FilterSelect.js.map +1 -0
  548. package/presentation/FileList/components/TagsList/FilterStatus.d.ts +7 -0
  549. package/presentation/FileList/components/TagsList/FilterStatus.js +25 -0
  550. package/presentation/FileList/components/TagsList/FilterStatus.js.map +1 -0
  551. package/presentation/FileList/components/TagsList/Tag.d.ts +9 -0
  552. package/presentation/FileList/components/TagsList/Tag.js +11 -0
  553. package/presentation/FileList/components/TagsList/Tag.js.map +1 -0
  554. package/presentation/FileList/components/TagsList/Tags.d.ts +8 -0
  555. package/presentation/FileList/components/TagsList/Tags.js +30 -0
  556. package/presentation/FileList/components/TagsList/Tags.js.map +1 -0
  557. package/presentation/FileList/components/TagsList/TagsList.d.ts +11 -0
  558. package/presentation/FileList/components/TagsList/TagsList.js +24 -0
  559. package/presentation/FileList/components/TagsList/TagsList.js.map +1 -0
  560. package/presentation/FileList/components/TagsList/index.d.ts +1 -0
  561. package/presentation/FileList/components/TagsList/index.js +1 -0
  562. package/presentation/FileList/components/Thumbnail/Thumbnail.d.ts +2 -0
  563. package/presentation/FileList/components/Thumbnail/Thumbnail.js +12 -0
  564. package/presentation/FileList/components/Thumbnail/Thumbnail.js.map +1 -0
  565. package/presentation/FileList/components/Thumbnail/index.d.ts +1 -0
  566. package/presentation/FileList/components/Thumbnail/index.js +1 -0
  567. package/presentation/FileList/components/Upload/UploadProgress.d.ts +9 -0
  568. package/presentation/FileList/components/Upload/UploadProgress.js +45 -0
  569. package/presentation/FileList/components/Upload/UploadProgress.js.map +1 -0
  570. package/presentation/FileList/components/Upload/index.d.ts +1 -0
  571. package/presentation/FileList/components/Upload/index.js +1 -0
  572. package/presentation/FileList/feature.d.ts +3 -0
  573. package/presentation/FileList/feature.js +17 -0
  574. package/presentation/FileList/feature.js.map +1 -0
  575. package/presentation/FileList/index.d.ts +5 -0
  576. package/presentation/FileList/index.js +3 -0
  577. package/presentation/FileManager/FileManagerRenderer.d.ts +2 -0
  578. package/presentation/FileManager/FileManagerRenderer.js +33 -0
  579. package/presentation/FileManager/FileManagerRenderer.js.map +1 -0
  580. package/presentation/FileManager/FileManagerView.d.ts +12 -0
  581. package/presentation/FileManager/FileManagerView.js +246 -0
  582. package/presentation/FileManager/FileManagerView.js.map +1 -0
  583. package/presentation/FileManager/OverlayContext.d.ts +14 -0
  584. package/presentation/FileManager/OverlayContext.js +11 -0
  585. package/presentation/FileManager/OverlayContext.js.map +1 -0
  586. package/presentation/FileManager/outputFileSelectionError.d.ts +2 -0
  587. package/presentation/FileManager/outputFileSelectionError.js +27 -0
  588. package/presentation/FileManager/outputFileSelectionError.js.map +1 -0
  589. package/presentation/Settings/SettingsPresenter.d.ts +14 -0
  590. package/presentation/Settings/SettingsPresenter.js +78 -0
  591. package/presentation/Settings/SettingsPresenter.js.map +1 -0
  592. package/presentation/Settings/components/SettingsView.d.ts +4 -0
  593. package/presentation/Settings/components/SettingsView.js +45 -0
  594. package/presentation/Settings/components/SettingsView.js.map +1 -0
  595. package/presentation/config/DefaultFileManagerConfig.d.ts +2 -0
  596. package/presentation/config/DefaultFileManagerConfig.js +118 -0
  597. package/presentation/config/DefaultFileManagerConfig.js.map +1 -0
  598. package/presentation/config/FileManagerViewConfig.d.ts +248 -0
  599. package/presentation/config/FileManagerViewConfig.js +74 -0
  600. package/presentation/config/FileManagerViewConfig.js.map +1 -0
  601. package/presentation/config/configComponents/Browser/BulkAction.d.ts +26 -0
  602. package/presentation/config/configComponents/Browser/BulkAction.js +57 -0
  603. package/presentation/config/configComponents/Browser/BulkAction.js.map +1 -0
  604. package/presentation/config/configComponents/Browser/BulkEditField.d.ts +10 -0
  605. package/presentation/config/configComponents/Browser/BulkEditField.js +24 -0
  606. package/presentation/config/configComponents/Browser/BulkEditField.js.map +1 -0
  607. package/presentation/config/configComponents/Browser/FileAction.d.ts +8 -0
  608. package/presentation/config/configComponents/Browser/FileAction.js +11 -0
  609. package/presentation/config/configComponents/Browser/FileAction.js.map +1 -0
  610. package/presentation/config/configComponents/Browser/Filter.d.ts +39 -0
  611. package/presentation/config/configComponents/Browser/Filter.js +37 -0
  612. package/presentation/config/configComponents/Browser/Filter.js.map +1 -0
  613. package/presentation/config/configComponents/Browser/FilterByTags.d.ts +5 -0
  614. package/presentation/config/configComponents/Browser/FilterByTags.js +14 -0
  615. package/presentation/config/configComponents/Browser/FilterByTags.js.map +1 -0
  616. package/presentation/config/configComponents/Browser/FiltersToWhere.d.ts +7 -0
  617. package/presentation/config/configComponents/Browser/FiltersToWhere.js +13 -0
  618. package/presentation/config/configComponents/Browser/FiltersToWhere.js.map +1 -0
  619. package/presentation/config/configComponents/Browser/FolderAction.d.ts +7 -0
  620. package/presentation/config/configComponents/Browser/FolderAction.js +10 -0
  621. package/presentation/config/configComponents/Browser/FolderAction.js.map +1 -0
  622. package/presentation/config/configComponents/Browser/FolderDropConfirmation.d.ts +5 -0
  623. package/presentation/config/configComponents/Browser/FolderDropConfirmation.js +7 -0
  624. package/presentation/config/configComponents/Browser/FolderDropConfirmation.js.map +1 -0
  625. package/presentation/config/configComponents/Browser/FolderFieldDecorator.d.ts +7 -0
  626. package/presentation/config/configComponents/Browser/FolderFieldDecorator.js +11 -0
  627. package/presentation/config/configComponents/Browser/FolderFieldDecorator.js.map +1 -0
  628. package/presentation/config/configComponents/Browser/Grid/Action.d.ts +31 -0
  629. package/presentation/config/configComponents/Browser/Grid/Action.js +33 -0
  630. package/presentation/config/configComponents/Browser/Grid/Action.js.map +1 -0
  631. package/presentation/config/configComponents/Browser/Grid/Thumbnail.d.ts +28 -0
  632. package/presentation/config/configComponents/Browser/Grid/Thumbnail.js +28 -0
  633. package/presentation/config/configComponents/Browser/Grid/Thumbnail.js.map +1 -0
  634. package/presentation/config/configComponents/Browser/Grid/index.d.ts +6 -0
  635. package/presentation/config/configComponents/Browser/Grid/index.js +0 -0
  636. package/presentation/config/configComponents/Browser/Table/Column.d.ts +32 -0
  637. package/presentation/config/configComponents/Browser/Table/Column.js +13 -0
  638. package/presentation/config/configComponents/Browser/Table/Column.js.map +1 -0
  639. package/presentation/config/configComponents/Browser/Table/Thumbnail.d.ts +28 -0
  640. package/presentation/config/configComponents/Browser/Table/Thumbnail.js +28 -0
  641. package/presentation/config/configComponents/Browser/Table/Thumbnail.js.map +1 -0
  642. package/presentation/config/configComponents/Browser/Table/index.d.ts +56 -0
  643. package/presentation/config/configComponents/Browser/Table/index.js +11 -0
  644. package/presentation/config/configComponents/Browser/Table/index.js.map +1 -0
  645. package/presentation/config/configComponents/Browser/index.d.ts +189 -0
  646. package/presentation/config/configComponents/Browser/index.js +47 -0
  647. package/presentation/config/configComponents/Browser/index.js.map +1 -0
  648. package/presentation/config/configComponents/FileDetails/Action.d.ts +31 -0
  649. package/presentation/config/configComponents/FileDetails/Action.js +30 -0
  650. package/presentation/config/configComponents/FileDetails/Action.js.map +1 -0
  651. package/presentation/config/configComponents/FileDetails/Thumbnail.d.ts +28 -0
  652. package/presentation/config/configComponents/FileDetails/Thumbnail.js +25 -0
  653. package/presentation/config/configComponents/FileDetails/Thumbnail.js.map +1 -0
  654. package/presentation/config/configComponents/FileDetails/Width.d.ts +5 -0
  655. package/presentation/config/configComponents/FileDetails/Width.js +13 -0
  656. package/presentation/config/configComponents/FileDetails/Width.js.map +1 -0
  657. package/presentation/config/configComponents/FileDetails/index.d.ts +52 -0
  658. package/presentation/config/configComponents/FileDetails/index.js +16 -0
  659. package/presentation/config/configComponents/FileDetails/index.js.map +1 -0
  660. package/presentation/config/fields/AccessControl.d.ts +7 -0
  661. package/presentation/config/fields/AccessControl.js +38 -0
  662. package/presentation/config/fields/AccessControl.js.map +1 -0
  663. package/presentation/config/fields/Tags.d.ts +2 -0
  664. package/presentation/config/fields/Tags.js +32 -0
  665. package/presentation/config/fields/Tags.js.map +1 -0
  666. package/presentation/config/fields/index.d.ts +2 -0
  667. package/presentation/config/fields/index.js +2 -0
  668. package/presentation/config/fields/useAccessControlField.d.ts +6 -0
  669. package/presentation/config/fields/useAccessControlField.js +21 -0
  670. package/presentation/config/fields/useAccessControlField.js.map +1 -0
  671. package/presentation/config/fields/useFileOrUndefined.d.ts +3 -0
  672. package/presentation/config/fields/useFileOrUndefined.js +13 -0
  673. package/presentation/config/fields/useFileOrUndefined.js.map +1 -0
  674. package/presentation/config/getThumbnailRenderer.d.ts +4 -0
  675. package/presentation/config/getThumbnailRenderer.js +16 -0
  676. package/presentation/config/getThumbnailRenderer.js.map +1 -0
  677. package/presentation/config/thumbnailRenderers/FilePreviewDefaultRenderer.d.ts +2 -0
  678. package/presentation/config/thumbnailRenderers/FilePreviewDefaultRenderer.js +11 -0
  679. package/presentation/config/thumbnailRenderers/FilePreviewDefaultRenderer.js.map +1 -0
  680. package/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.d.ts +2 -0
  681. package/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js +18 -0
  682. package/presentation/config/thumbnailRenderers/FilePreviewImageRenderer.js.map +1 -0
  683. package/presentation/config/thumbnailRenderers/GridItemDefaultRenderer.d.ts +2 -0
  684. package/presentation/config/thumbnailRenderers/GridItemDefaultRenderer.js +11 -0
  685. package/presentation/config/thumbnailRenderers/GridItemDefaultRenderer.js.map +1 -0
  686. package/presentation/config/thumbnailRenderers/GridItemImageRenderer.d.ts +2 -0
  687. package/presentation/config/thumbnailRenderers/GridItemImageRenderer.js +18 -0
  688. package/presentation/config/thumbnailRenderers/GridItemImageRenderer.js.map +1 -0
  689. package/presentation/config/thumbnailRenderers/TableItemDefaultRenderer.d.ts +2 -0
  690. package/presentation/config/thumbnailRenderers/TableItemDefaultRenderer.js +18 -0
  691. package/presentation/config/thumbnailRenderers/TableItemDefaultRenderer.js.map +1 -0
  692. package/presentation/config/thumbnailRenderers/TableItemImageRenderer.d.ts +2 -0
  693. package/presentation/config/thumbnailRenderers/TableItemImageRenderer.js +18 -0
  694. package/presentation/config/thumbnailRenderers/TableItemImageRenderer.js.map +1 -0
  695. package/presentation/contexts/FileProvider.d.ts +12 -0
  696. package/presentation/contexts/FileProvider.js +13 -0
  697. package/presentation/contexts/FileProvider.js.map +1 -0
  698. package/presentation/hooks/useCopyFile.d.ts +11 -0
  699. package/presentation/hooks/useCopyFile.js +24 -0
  700. package/presentation/hooks/useCopyFile.js.map +1 -0
  701. package/presentation/hooks/useDeleteFile.d.ts +9 -0
  702. package/presentation/hooks/useDeleteFile.js +35 -0
  703. package/presentation/hooks/useDeleteFile.js.map +1 -0
  704. package/presentation/hooks/useFile.d.ts +2 -0
  705. package/presentation/hooks/useFile.js +10 -0
  706. package/presentation/hooks/useFile.js.map +1 -0
  707. package/presentation/hooks/useMoveFileToFolder.d.ts +2 -0
  708. package/presentation/hooks/useMoveFileToFolder.js +36 -0
  709. package/presentation/hooks/useMoveFileToFolder.js.map +1 -0
  710. package/routes.d.ts +7 -0
  711. package/routes.js +17 -0
  712. package/routes.js.map +1 -0
  713. package/static/svg/folder-open.ae8d0fac.svg +1 -0
  714. package/admin/graphql.js +0 -24
  715. package/admin/graphql.js.map +0 -1
  716. package/admin/index.d.ts +0 -2
  717. package/admin/index.js +0 -16
  718. package/admin/index.js.map +0 -1
  719. package/admin/plugins/index.d.ts +0 -2
  720. package/admin/plugins/index.js +0 -18
  721. package/admin/plugins/index.js.map +0 -1
  722. package/admin/plugins/installation.d.ts +0 -3
  723. package/admin/plugins/installation.js +0 -134
  724. package/admin/plugins/installation.js.map +0 -1
  725. package/admin/plugins/permissionRenderer/FileManagerPermissions.d.ts +0 -14
  726. package/admin/plugins/permissionRenderer/FileManagerPermissions.js +0 -249
  727. package/admin/plugins/permissionRenderer/FileManagerPermissions.js.map +0 -1
  728. package/admin/plugins/permissionRenderer/index.d.ts +0 -3
  729. package/admin/plugins/permissionRenderer/index.js +0 -38
  730. package/admin/plugins/permissionRenderer/index.js.map +0 -1
  731. package/admin/views/FileManagerSettings.d.ts +0 -3
  732. package/admin/views/FileManagerSettings.js +0 -162
  733. package/admin/views/FileManagerSettings.js.map +0 -1
  734. package/index.js.map +0 -1
  735. package/types.d.ts +0 -26
  736. package/types.js +0 -5
  737. package/types.js.map +0 -1
  738. /package/{admin → modules/Settings}/assets/icons/folder-open.svg +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/FileList/components/BulkActions/ActionEditPresenter.js","sources":["../../../../../src/presentation/FileList/components/BulkActions/ActionEditPresenter.ts"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\nimport type {\n BatchDTO,\n FieldDTO,\n FieldRaw\n} from \"~/presentation/FileList/components/BulkActions/domain/index.js\";\nimport {\n Batch,\n BatchMapper,\n Field,\n FieldMapper\n} from \"~/presentation/FileList/components/BulkActions/domain/index.js\";\n\nfunction isBulkEditableField(field: FieldRaw) {\n return field.tags && field.tags.includes(\"$bulk-edit\");\n}\n\ninterface IActionEditPresenter {\n load: (fields: FieldRaw[]) => void;\n openEditor: () => void;\n closeEditor: () => void;\n get vm(): {\n show: boolean;\n currentBatch: BatchDTO;\n fields: FieldDTO[];\n editorVm: {\n isOpen: boolean;\n };\n };\n}\n\nexport class ActionEditPresenter implements IActionEditPresenter {\n private showEditor = false;\n private readonly currentBatch: BatchDTO;\n private fields: FieldDTO[];\n\n constructor() {\n this.fields = [];\n this.currentBatch = BatchMapper.toDTO(Batch.createEmpty());\n makeAutoObservable(this);\n }\n\n load(fields: FieldRaw[]) {\n this.fields = [...this.getBuiltInFields(fields), ...this.getExtensionFields(fields)];\n }\n\n get vm() {\n return {\n show: this.fields.length > 0,\n currentBatch: this.currentBatch,\n fields: this.fields,\n editorVm: this.editorVm\n };\n }\n\n openEditor() {\n this.showEditor = true;\n }\n\n closeEditor() {\n this.showEditor = false;\n }\n\n private getBuiltInFields(fields: FieldRaw[]) {\n const builtInFields = fields\n .filter(field => field.fieldId !== \"extensions\")\n .filter(isBulkEditableField);\n\n return FieldMapper.toDTO(builtInFields.map(field => Field.createFromRaw(field)));\n }\n\n private getExtensionFields(fields: FieldRaw[]) {\n const extensions = fields.find(field => field.fieldId === \"extensions\");\n\n if (!extensions?.settings?.fields) {\n return [];\n }\n\n const extensionFields = extensions.settings.fields.filter(isBulkEditableField) || [];\n\n const extFields = FieldMapper.toDTO(\n extensionFields.map(field => Field.createFromRaw(field))\n );\n\n return extFields.map(field => {\n return { ...field, value: `extensions.${field.value}` };\n });\n }\n\n private get editorVm() {\n return {\n isOpen: this.showEditor\n };\n }\n}\n"],"names":["isBulkEditableField","field","ActionEditPresenter","BatchMapper","Batch","makeAutoObservable","fields","builtInFields","FieldMapper","Field","extensions","extensionFields","extFields"],"mappings":";;AAcA,SAASA,oBAAoBC,KAAe;IACxC,OAAOA,MAAM,IAAI,IAAIA,MAAM,IAAI,CAAC,QAAQ,CAAC;AAC7C;AAgBO,MAAMC;IAKT,aAAc;aAJN,UAAU,GAAG;QAKjB,IAAI,CAAC,MAAM,GAAG,EAAE;QAChB,IAAI,CAAC,YAAY,GAAGC,YAAY,KAAK,CAACC,MAAM,WAAW;QACvDC,mBAAmB,IAAI;IAC3B;IAEA,KAAKC,MAAkB,EAAE;QACrB,IAAI,CAAC,MAAM,GAAG;eAAI,IAAI,CAAC,gBAAgB,CAACA;eAAY,IAAI,CAAC,kBAAkB,CAACA;SAAQ;IACxF;IAEA,IAAI,KAAK;QACL,OAAO;YACH,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG;YAC3B,cAAc,IAAI,CAAC,YAAY;YAC/B,QAAQ,IAAI,CAAC,MAAM;YACnB,UAAU,IAAI,CAAC,QAAQ;QAC3B;IACJ;IAEA,aAAa;QACT,IAAI,CAAC,UAAU,GAAG;IACtB;IAEA,cAAc;QACV,IAAI,CAAC,UAAU,GAAG;IACtB;IAEQ,iBAAiBA,MAAkB,EAAE;QACzC,MAAMC,gBAAgBD,OACjB,MAAM,CAACL,CAAAA,QAASA,AAAkB,iBAAlBA,MAAM,OAAO,EAC7B,MAAM,CAACD;QAEZ,OAAOQ,YAAY,KAAK,CAACD,cAAc,GAAG,CAACN,CAAAA,QAASQ,MAAM,aAAa,CAACR;IAC5E;IAEQ,mBAAmBK,MAAkB,EAAE;QAC3C,MAAMI,aAAaJ,OAAO,IAAI,CAACL,CAAAA,QAASA,AAAkB,iBAAlBA,MAAM,OAAO;QAErD,IAAI,CAACS,YAAY,UAAU,QACvB,OAAO,EAAE;QAGb,MAAMC,kBAAkBD,WAAW,QAAQ,CAAC,MAAM,CAAC,MAAM,CAACV,wBAAwB,EAAE;QAEpF,MAAMY,YAAYJ,YAAY,KAAK,CAC/BG,gBAAgB,GAAG,CAACV,CAAAA,QAASQ,MAAM,aAAa,CAACR;QAGrD,OAAOW,UAAU,GAAG,CAACX,CAAAA,QACV;gBAAE,GAAGA,KAAK;gBAAE,OAAO,CAAC,WAAW,EAAEA,MAAM,KAAK,EAAE;YAAC;IAE9D;IAEA,IAAY,WAAW;QACnB,OAAO;YACH,QAAQ,IAAI,CAAC,UAAU;QAC3B;IACJ;AACJ"}
@@ -0,0 +1,170 @@
1
+ import { ActionEditPresenter } from "./ActionEditPresenter.js";
2
+ import { beforeEach, describe, expect, it, vi } from "vitest";
3
+ describe("ActionEditPresenter", ()=>{
4
+ const extensionFields = [
5
+ {
6
+ id: "field1",
7
+ fieldId: "field1",
8
+ label: "Field 1",
9
+ type: "text",
10
+ renderer: {
11
+ name: "text-input"
12
+ },
13
+ tags: [
14
+ "$bulk-edit"
15
+ ],
16
+ storageId: "text@field1"
17
+ },
18
+ {
19
+ id: "field2",
20
+ fieldId: "field2",
21
+ label: "Field 2",
22
+ type: "ref",
23
+ renderer: {
24
+ name: "ref-inputs"
25
+ },
26
+ list: true,
27
+ settings: {
28
+ models: [
29
+ {
30
+ modelId: "any-model"
31
+ }
32
+ ]
33
+ },
34
+ tags: [
35
+ "$bulk-edit"
36
+ ],
37
+ storageId: "ref@field2"
38
+ },
39
+ {
40
+ id: "field3",
41
+ fieldId: "field3",
42
+ label: "Field 3",
43
+ type: "number",
44
+ renderer: {
45
+ name: "number-input"
46
+ },
47
+ tags: [],
48
+ storageId: "number@field3"
49
+ }
50
+ ];
51
+ const createFields = (extensionFields)=>[
52
+ {
53
+ id: "name",
54
+ storageId: "text@name",
55
+ fieldId: "name",
56
+ label: "Name",
57
+ type: "text",
58
+ settings: {},
59
+ listValidation: [],
60
+ validation: [
61
+ {
62
+ name: "required",
63
+ message: "Value is required."
64
+ }
65
+ ],
66
+ list: false,
67
+ predefinedValues: {
68
+ values: [],
69
+ enabled: false
70
+ },
71
+ renderer: {
72
+ name: "text-input"
73
+ }
74
+ },
75
+ {
76
+ id: "extensions",
77
+ storageId: "object@extensions",
78
+ fieldId: "extensions",
79
+ label: "Extensions",
80
+ type: "object",
81
+ settings: {
82
+ layout: extensionFields.map((field)=>[
83
+ field.id
84
+ ]),
85
+ fields: extensionFields
86
+ },
87
+ listValidation: [],
88
+ validation: [],
89
+ list: false,
90
+ predefinedValues: {
91
+ values: [],
92
+ enabled: false
93
+ },
94
+ renderer: {
95
+ name: "any"
96
+ }
97
+ }
98
+ ];
99
+ let presenter;
100
+ beforeEach(()=>{
101
+ vi.clearAllMocks();
102
+ presenter = new ActionEditPresenter();
103
+ });
104
+ it("should create a presenter and load extensions fields", ()=>{
105
+ presenter.load(createFields(extensionFields));
106
+ expect(presenter.vm.show).toEqual(true);
107
+ expect(presenter.vm.currentBatch).toEqual({
108
+ operations: [
109
+ {
110
+ field: "",
111
+ operator: "",
112
+ value: void 0
113
+ }
114
+ ]
115
+ });
116
+ expect(presenter.vm.fields).toEqual([
117
+ {
118
+ label: "Field 1",
119
+ value: "extensions.field1",
120
+ operators: [
121
+ {
122
+ label: "Override existing values",
123
+ value: "OVERRIDE"
124
+ },
125
+ {
126
+ label: "Clear all existing values",
127
+ value: "REMOVE"
128
+ }
129
+ ],
130
+ raw: extensionFields[0]
131
+ },
132
+ {
133
+ label: "Field 2",
134
+ value: "extensions.field2",
135
+ operators: [
136
+ {
137
+ label: "Override existing values",
138
+ value: "OVERRIDE"
139
+ },
140
+ {
141
+ label: "Clear all existing values",
142
+ value: "REMOVE"
143
+ },
144
+ {
145
+ label: "Append to existing values",
146
+ value: "APPEND"
147
+ }
148
+ ],
149
+ raw: extensionFields[1]
150
+ }
151
+ ]);
152
+ expect(presenter.vm.editorVm).toEqual({
153
+ isOpen: false
154
+ });
155
+ });
156
+ it("should not show the bulk action if no `extensions` fields are defined", ()=>{
157
+ presenter.load(createFields([]));
158
+ expect(presenter.vm.show).toBe(false);
159
+ });
160
+ it("should open / close the editor", ()=>{
161
+ presenter.load(createFields(extensionFields));
162
+ expect(presenter.vm.editorVm.isOpen).toBe(false);
163
+ presenter.openEditor();
164
+ expect(presenter.vm.editorVm.isOpen).toBe(true);
165
+ presenter.closeEditor();
166
+ expect(presenter.vm.editorVm.isOpen).toBe(false);
167
+ });
168
+ });
169
+
170
+ //# sourceMappingURL=ActionEditPresenter.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/FileList/components/BulkActions/ActionEditPresenter.test.js","sources":["../../../../../src/presentation/FileList/components/BulkActions/ActionEditPresenter.test.ts"],"sourcesContent":["import { ActionEditPresenter } from \"./ActionEditPresenter.js\";\nimport type { FieldRaw } from \"~/presentation/FileList/components/BulkActions/domain/index.js\";\nimport { vi, describe, it, expect, beforeEach } from \"vitest\";\n\ndescribe(\"ActionEditPresenter\", () => {\n const extensionFields = [\n {\n id: \"field1\",\n fieldId: \"field1\",\n label: \"Field 1\",\n type: \"text\",\n renderer: {\n name: \"text-input\"\n },\n tags: [\"$bulk-edit\"],\n storageId: \"text@field1\"\n },\n {\n id: \"field2\",\n fieldId: \"field2\",\n label: \"Field 2\",\n type: \"ref\",\n renderer: {\n name: \"ref-inputs\"\n },\n list: true,\n settings: {\n models: [\n {\n modelId: \"any-model\"\n }\n ]\n },\n tags: [\"$bulk-edit\"],\n storageId: \"ref@field2\"\n },\n {\n id: \"field3\",\n fieldId: \"field3\",\n label: \"Field 3\",\n type: \"number\",\n renderer: {\n name: \"number-input\"\n },\n tags: [],\n storageId: \"number@field3\"\n }\n ];\n\n const createFields = (extensionFields: FieldRaw[]) => {\n return [\n {\n id: \"name\",\n storageId: \"text@name\",\n fieldId: \"name\",\n label: \"Name\",\n type: \"text\",\n settings: {},\n listValidation: [],\n validation: [\n {\n name: \"required\",\n message: \"Value is required.\"\n }\n ],\n list: false,\n predefinedValues: {\n values: [],\n enabled: false\n },\n renderer: {\n name: \"text-input\"\n }\n },\n {\n id: \"extensions\",\n storageId: \"object@extensions\",\n fieldId: \"extensions\",\n label: \"Extensions\",\n type: \"object\",\n settings: {\n layout: extensionFields.map(field => [field.id]),\n fields: extensionFields\n },\n listValidation: [],\n validation: [],\n list: false,\n predefinedValues: {\n values: [],\n enabled: false\n },\n renderer: {\n name: \"any\"\n }\n }\n ];\n };\n\n let presenter: ActionEditPresenter;\n\n beforeEach(() => {\n vi.clearAllMocks();\n presenter = new ActionEditPresenter();\n });\n\n it(\"should create a presenter and load extensions fields\", () => {\n presenter.load(createFields(extensionFields));\n\n // I should see the bulk edit action\n expect(presenter.vm.show).toEqual(true);\n\n // I should receive a `currentBatch`\n expect(presenter.vm.currentBatch).toEqual({\n operations: [\n {\n field: \"\",\n operator: \"\",\n value: undefined\n }\n ]\n });\n\n // I should receive the `fields` available for bulk edit\n expect(presenter.vm.fields).toEqual([\n {\n label: \"Field 1\",\n value: \"extensions.field1\",\n operators: [\n {\n label: \"Override existing values\",\n value: \"OVERRIDE\"\n },\n {\n label: \"Clear all existing values\",\n value: \"REMOVE\"\n }\n ],\n raw: extensionFields[0]\n },\n {\n label: \"Field 2\",\n value: \"extensions.field2\",\n operators: [\n {\n label: \"Override existing values\",\n value: \"OVERRIDE\"\n },\n {\n label: \"Clear all existing values\",\n value: \"REMOVE\"\n },\n {\n label: \"Append to existing values\",\n value: \"APPEND\"\n }\n ],\n raw: extensionFields[1]\n }\n ]);\n\n // I should receive the editor.vm\n expect(presenter.vm.editorVm).toEqual({\n isOpen: false\n });\n });\n\n it(\"should not show the bulk action if no `extensions` fields are defined\", () => {\n presenter.load(createFields([]));\n\n // The editor action should not be rendered\n expect(presenter.vm.show).toBe(false);\n });\n\n it(\"should open / close the editor\", () => {\n presenter.load(createFields(extensionFields));\n\n // The editor should be closed by default\n expect(presenter.vm.editorVm.isOpen).toBe(false);\n\n // Let's open the editor\n presenter.openEditor();\n expect(presenter.vm.editorVm.isOpen).toBe(true);\n\n // Let's open the editor\n presenter.closeEditor();\n expect(presenter.vm.editorVm.isOpen).toBe(false);\n });\n});\n"],"names":["describe","extensionFields","createFields","field","presenter","beforeEach","vi","ActionEditPresenter","it","expect","undefined"],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface AddOperationProps {
3
+ disabled: boolean;
4
+ onClick: () => void;
5
+ }
6
+ export declare const AddOperation: ({ disabled, onClick }: AddOperationProps) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,15 @@
1
+ import react from "react";
2
+ import { Button } from "@webiny/admin-ui";
3
+ import { ReactComponent } from "@webiny/icons/add.svg";
4
+ const AddOperation = ({ disabled, onClick })=>/*#__PURE__*/ react.createElement("div", {
5
+ className: "wby-mt-lg wby-text-center"
6
+ }, /*#__PURE__*/ react.createElement(Button, {
7
+ onClick: onClick,
8
+ text: "Add new operation",
9
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
10
+ variant: "secondary",
11
+ disabled: disabled
12
+ }));
13
+ export { AddOperation };
14
+
15
+ //# sourceMappingURL=AddOperation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.js","sources":["../../../../../../src/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.tsx"],"sourcesContent":["import React from \"react\";\nimport { Button } from \"@webiny/admin-ui\";\nimport { ReactComponent as AddIcon } from \"@webiny/icons/add.svg\";\n\ninterface AddOperationProps {\n disabled: boolean;\n onClick: () => void;\n}\n\nexport const AddOperation = ({ disabled, onClick }: AddOperationProps) => {\n return (\n <div className={\"wby-mt-lg wby-text-center\"}>\n <Button\n onClick={onClick}\n text={\"Add new operation\"}\n icon={<AddIcon />}\n variant={\"secondary\"}\n disabled={disabled}\n />\n </div>\n );\n};\n"],"names":["AddOperation","disabled","onClick","Button","AddIcon"],"mappings":";;;AASO,MAAMA,eAAe,CAAC,EAAEC,QAAQ,EAAEC,OAAO,EAAqB,GAC1D,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACC,QAAMA;QACH,SAASD;QACT,MAAM;QACN,oBAAM,oBAACE,gBAAOA;QACd,SAAS;QACT,UAAUH"}
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { FormAPI, FormOnSubmit } from "@webiny/form";
3
+ import type { BatchEditorDialogViewModel, BatchEditorFormData } from "../../../../../presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js";
4
+ export interface BatchEditorProps {
5
+ onForm: (form: FormAPI) => void;
6
+ onAdd: () => void;
7
+ onDelete: (operationIndex: number) => void;
8
+ onChange: (data: BatchEditorFormData) => void;
9
+ onSetOperationFieldData: (operationIndex: number, data: string) => void;
10
+ onSubmit: FormOnSubmit<BatchEditorFormData>;
11
+ vm: BatchEditorDialogViewModel;
12
+ }
13
+ export declare const BatchEditor: ((props: BatchEditorProps) => React.JSX.Element) & {
14
+ displayName: string;
15
+ };
@@ -0,0 +1,44 @@
1
+ import react, { useEffect } from "react";
2
+ import { observer } from "mobx-react-lite";
3
+ import { ReactComponent } from "@webiny/icons/delete_outline.svg";
4
+ import { Form } from "@webiny/form";
5
+ import { AddOperation } from "./AddOperation.js";
6
+ import { Operation } from "./Operation.js";
7
+ import { Accordion } from "@webiny/admin-ui";
8
+ const BatchEditor = observer((props)=>{
9
+ const formRef = /*#__PURE__*/ react.createRef();
10
+ useEffect(()=>{
11
+ if (formRef.current) props.onForm(formRef.current);
12
+ }, []);
13
+ return /*#__PURE__*/ react.createElement("div", {
14
+ className: "wby-py-lg"
15
+ }, /*#__PURE__*/ react.createElement(Form, {
16
+ ref: formRef,
17
+ data: props.vm.data,
18
+ onChange: props.onChange,
19
+ invalidFields: props.vm.invalidFields
20
+ }, ()=>/*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Accordion, {
21
+ variant: "container",
22
+ background: "light"
23
+ }, props.vm.data.operations.map((operation, operationIndex)=>/*#__PURE__*/ react.createElement(Accordion.Item, {
24
+ key: `operation-${operationIndex}`,
25
+ title: operation.title,
26
+ defaultOpen: operation.open,
27
+ actions: /*#__PURE__*/ react.createElement(Accordion.Item.Action, {
28
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
29
+ onClick: ()=>props.onDelete(operationIndex),
30
+ disabled: !operation.canDelete
31
+ })
32
+ }, /*#__PURE__*/ react.createElement(Operation, {
33
+ name: `operations.${operationIndex}`,
34
+ operation: operation,
35
+ onDelete: ()=>props.onDelete(operationIndex),
36
+ onSetOperationFieldData: (data)=>props.onSetOperationFieldData(operationIndex, data)
37
+ })))), /*#__PURE__*/ react.createElement(AddOperation, {
38
+ disabled: !props.vm.canAddOperation,
39
+ onClick: ()=>props.onAdd()
40
+ }))));
41
+ });
42
+ export { BatchEditor };
43
+
44
+ //# sourceMappingURL=BatchEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.js","sources":["../../../../../../src/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\n\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as DeleteIcon } from \"@webiny/icons/delete_outline.svg\";\nimport type { FormAPI, FormOnSubmit } from \"@webiny/form\";\nimport { Form } from \"@webiny/form\";\n\nimport { AddOperation } from \"~/presentation/FileList/components/BulkActions/BatchEditorDialog/AddOperation.js\";\nimport { Operation } from \"~/presentation/FileList/components/BulkActions/BatchEditorDialog/Operation.js\";\nimport type {\n BatchEditorDialogViewModel,\n BatchEditorFormData\n} from \"~/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js\";\nimport { Accordion } from \"@webiny/admin-ui\";\n\nexport interface BatchEditorProps {\n onForm: (form: FormAPI) => void;\n onAdd: () => void;\n onDelete: (operationIndex: number) => void;\n onChange: (data: BatchEditorFormData) => void;\n onSetOperationFieldData: (operationIndex: number, data: string) => void;\n onSubmit: FormOnSubmit<BatchEditorFormData>;\n vm: BatchEditorDialogViewModel;\n}\n\nexport const BatchEditor = observer((props: BatchEditorProps) => {\n const formRef = React.createRef<FormAPI>();\n\n useEffect(() => {\n if (formRef.current) {\n props.onForm(formRef.current);\n }\n }, []);\n\n return (\n <div className={\"wby-py-lg\"}>\n <Form\n ref={formRef}\n data={props.vm.data}\n onChange={props.onChange}\n invalidFields={props.vm.invalidFields}\n >\n {() => (\n <>\n <Accordion variant={\"container\"} background={\"light\"}>\n {props.vm.data.operations.map((operation, operationIndex) => (\n <Accordion.Item\n key={`operation-${operationIndex}`}\n title={operation.title}\n defaultOpen={operation.open}\n actions={\n <Accordion.Item.Action\n icon={<DeleteIcon />}\n onClick={() => props.onDelete(operationIndex)}\n disabled={!operation.canDelete}\n />\n }\n >\n <Operation\n name={`operations.${operationIndex}`}\n operation={operation}\n onDelete={() => props.onDelete(operationIndex)}\n onSetOperationFieldData={data =>\n props.onSetOperationFieldData(operationIndex, data)\n }\n />\n </Accordion.Item>\n ))}\n </Accordion>\n <AddOperation\n disabled={!props.vm.canAddOperation}\n onClick={() => props.onAdd()}\n />\n </>\n )}\n </Form>\n </div>\n );\n});\n"],"names":["BatchEditor","observer","props","formRef","React","useEffect","Form","Accordion","operation","operationIndex","DeleteIcon","Operation","data","AddOperation"],"mappings":";;;;;;;AAyBO,MAAMA,cAAcC,SAAS,CAACC;IACjC,MAAMC,UAAU,WAAVA,GAAUC,MAAAA,SAAe;IAE/BC,UAAU;QACN,IAAIF,QAAQ,OAAO,EACfD,MAAM,MAAM,CAACC,QAAQ,OAAO;IAEpC,GAAG,EAAE;IAEL,OAAO,WAAP,GACI,oBAAC;QAAI,WAAW;qBACZ,oBAACG,MAAIA;QACD,KAAKH;QACL,MAAMD,MAAM,EAAE,CAAC,IAAI;QACnB,UAAUA,MAAM,QAAQ;QACxB,eAAeA,MAAM,EAAE,CAAC,aAAa;OAEpC,kBACG,wDACI,oBAACK,WAASA;YAAC,SAAS;YAAa,YAAY;WACxCL,MAAM,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAACM,WAAWC,iBAAAA,WAAAA,GACtC,oBAACF,UAAU,IAAI;gBACX,KAAK,CAAC,UAAU,EAAEE,gBAAgB;gBAClC,OAAOD,UAAU,KAAK;gBACtB,aAAaA,UAAU,IAAI;gBAC3B,uBACI,oBAACD,UAAU,IAAI,CAAC,MAAM;oBAClB,oBAAM,oBAACG,gBAAUA;oBACjB,SAAS,IAAMR,MAAM,QAAQ,CAACO;oBAC9B,UAAU,CAACD,UAAU,SAAS;;6BAItC,oBAACG,WAASA;gBACN,MAAM,CAAC,WAAW,EAAEF,gBAAgB;gBACpC,WAAWD;gBACX,UAAU,IAAMN,MAAM,QAAQ,CAACO;gBAC/B,yBAAyBG,CAAAA,OACrBV,MAAM,uBAAuB,CAACO,gBAAgBG;iCAMlE,oBAACC,cAAYA;YACT,UAAU,CAACX,MAAM,EAAE,CAAC,eAAe;YACnC,SAAS,IAAMA,MAAM,KAAK;;AAOtD"}
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import type { BatchDTO, FieldDTO } from "../../../../../presentation/FileList/components/BulkActions/domain/index.js";
3
+ interface BatchEditorDialogProps {
4
+ fields: FieldDTO[];
5
+ batch: BatchDTO;
6
+ vm: {
7
+ isOpen: boolean;
8
+ };
9
+ onApply: (batch: BatchDTO) => void;
10
+ onClose: () => void;
11
+ }
12
+ export declare const BatchEditorDialog: ((props: BatchEditorDialogProps) => React.JSX.Element) & {
13
+ displayName: string;
14
+ };
15
+ export {};
@@ -0,0 +1,52 @@
1
+ import react, { useEffect, useMemo, useRef } from "react";
2
+ import { Drawer } from "@webiny/admin-ui";
3
+ import { observer } from "mobx-react-lite";
4
+ import { BatchEditorDialogPresenter } from "./BatchEditorDialogPresenter.js";
5
+ import { BatchEditor } from "./BatchEditor.js";
6
+ const BatchEditorDialog = observer((props)=>{
7
+ const presenter = useMemo(()=>new BatchEditorDialogPresenter(), []);
8
+ const ref = useRef(null);
9
+ useEffect(()=>{
10
+ presenter.load(props.batch, props.fields);
11
+ }, [
12
+ props.batch,
13
+ props.fields
14
+ ]);
15
+ const onChange = (data)=>{
16
+ presenter.setBatch(data);
17
+ };
18
+ const onApply = ()=>{
19
+ ref.current?.validate().then((isValid)=>{
20
+ if (isValid) presenter.onApply((batch)=>{
21
+ props.onApply(batch);
22
+ });
23
+ });
24
+ };
25
+ return /*#__PURE__*/ react.createElement(Drawer, {
26
+ open: props.vm.isOpen,
27
+ onClose: props.onClose,
28
+ modal: true,
29
+ width: 800,
30
+ headerSeparator: true,
31
+ footerSeparator: true,
32
+ title: "Edit items",
33
+ actions: /*#__PURE__*/ react.createElement(react.Fragment, null, /*#__PURE__*/ react.createElement(Drawer.CancelButton, {
34
+ text: "Cancel",
35
+ onClick: props.onClose
36
+ }), /*#__PURE__*/ react.createElement(Drawer.ConfirmButton, {
37
+ onClick: onApply,
38
+ text: "Submit"
39
+ }))
40
+ }, /*#__PURE__*/ react.createElement(BatchEditor, {
41
+ onForm: (form)=>ref.current = form,
42
+ onChange: (data)=>onChange(data),
43
+ onSubmit: onApply,
44
+ onDelete: (operationIndex)=>presenter.deleteOperation(operationIndex),
45
+ onAdd: ()=>presenter.addOperation(),
46
+ onSetOperationFieldData: (operationIndex, data)=>presenter.setOperationFieldData(operationIndex, data),
47
+ vm: presenter.vm
48
+ }));
49
+ });
50
+ export { BatchEditorDialog };
51
+
52
+ //# sourceMappingURL=BatchEditorDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.js","sources":["../../../../../../src/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialog.tsx"],"sourcesContent":["import React, { useMemo, useEffect, useRef } from \"react\";\n\nimport { Drawer } from \"@webiny/admin-ui\";\nimport { observer } from \"mobx-react-lite\";\nimport type { FormAPI } from \"@webiny/form\";\n\nimport type { BatchEditorFormData } from \"./BatchEditorDialogPresenter.js\";\nimport { BatchEditorDialogPresenter } from \"./BatchEditorDialogPresenter.js\";\nimport { BatchEditor } from \"~/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditor.js\";\nimport type {\n BatchDTO,\n FieldDTO\n} from \"~/presentation/FileList/components/BulkActions/domain/index.js\";\n\ninterface BatchEditorDialogProps {\n fields: FieldDTO[];\n batch: BatchDTO;\n vm: {\n isOpen: boolean;\n };\n onApply: (batch: BatchDTO) => void;\n onClose: () => void;\n}\n\nexport const BatchEditorDialog = observer((props: BatchEditorDialogProps) => {\n const presenter = useMemo<BatchEditorDialogPresenter>(() => {\n return new BatchEditorDialogPresenter();\n }, []);\n\n const ref = useRef<FormAPI | null>(null);\n\n useEffect(() => {\n presenter.load(props.batch, props.fields);\n }, [props.batch, props.fields]);\n\n const onChange = (data: BatchEditorFormData) => {\n presenter.setBatch(data);\n };\n\n const onApply = () => {\n ref.current?.validate().then(isValid => {\n if (isValid) {\n presenter.onApply(batch => {\n props.onApply(batch);\n });\n }\n });\n };\n\n return (\n <Drawer\n open={props.vm.isOpen}\n onClose={props.onClose}\n modal={true}\n width={800}\n headerSeparator={true}\n footerSeparator={true}\n title={\"Edit items\"}\n actions={\n <>\n <Drawer.CancelButton text={\"Cancel\"} onClick={props.onClose} />\n <Drawer.ConfirmButton onClick={onApply} text={\"Submit\"} />\n </>\n }\n >\n <BatchEditor\n onForm={form => (ref.current = form)}\n onChange={data => onChange(data)}\n onSubmit={onApply}\n onDelete={operationIndex => presenter.deleteOperation(operationIndex)}\n onAdd={() => presenter.addOperation()}\n onSetOperationFieldData={(operationIndex, data) =>\n presenter.setOperationFieldData(operationIndex, data)\n }\n vm={presenter.vm}\n />\n </Drawer>\n );\n});\n"],"names":["BatchEditorDialog","observer","props","presenter","useMemo","BatchEditorDialogPresenter","ref","useRef","useEffect","onChange","data","onApply","isValid","batch","Drawer","BatchEditor","form","operationIndex"],"mappings":";;;;;AAwBO,MAAMA,oBAAoBC,SAAS,CAACC;IACvC,MAAMC,YAAYC,QAAoC,IAC3C,IAAIC,8BACZ,EAAE;IAEL,MAAMC,MAAMC,OAAuB;IAEnCC,UAAU;QACNL,UAAU,IAAI,CAACD,MAAM,KAAK,EAAEA,MAAM,MAAM;IAC5C,GAAG;QAACA,MAAM,KAAK;QAAEA,MAAM,MAAM;KAAC;IAE9B,MAAMO,WAAW,CAACC;QACdP,UAAU,QAAQ,CAACO;IACvB;IAEA,MAAMC,UAAU;QACZL,IAAI,OAAO,EAAE,WAAW,KAAKM,CAAAA;YACzB,IAAIA,SACAT,UAAU,OAAO,CAACU,CAAAA;gBACdX,MAAM,OAAO,CAACW;YAClB;QAER;IACJ;IAEA,OAAO,WAAP,GACI,oBAACC,QAAMA;QACH,MAAMZ,MAAM,EAAE,CAAC,MAAM;QACrB,SAASA,MAAM,OAAO;QACtB,OAAO;QACP,OAAO;QACP,iBAAiB;QACjB,iBAAiB;QACjB,OAAO;QACP,uBACI,wDACI,oBAACY,OAAO,YAAY;YAAC,MAAM;YAAU,SAASZ,MAAM,OAAO;0BAC3D,oBAACY,OAAO,aAAa;YAAC,SAASH;YAAS,MAAM;;qBAItD,oBAACI,aAAWA;QACR,QAAQC,CAAAA,OAASV,IAAI,OAAO,GAAGU;QAC/B,UAAUN,CAAAA,OAAQD,SAASC;QAC3B,UAAUC;QACV,UAAUM,CAAAA,iBAAkBd,UAAU,eAAe,CAACc;QACtD,OAAO,IAAMd,UAAU,YAAY;QACnC,yBAAyB,CAACc,gBAAgBP,OACtCP,UAAU,qBAAqB,CAACc,gBAAgBP;QAEpD,IAAIP,UAAU,EAAE;;AAIhC"}
@@ -0,0 +1,61 @@
1
+ import type { BatchDTO, FieldDTO, OperationDTO, OperatorDTO } from "../../../../../presentation/FileList/components/BulkActions/domain/index.js";
2
+ import type { FormInvalidFields } from "@webiny/form";
3
+ export interface IBatchEditorDialogPresenter {
4
+ load(batch: BatchDTO, fields: FieldDTO[]): void;
5
+ addOperation(): void;
6
+ deleteOperation(operationIndex: number): void;
7
+ setOperationFieldData(operationIndex: number, data: string): void;
8
+ setBatch(data: any): void;
9
+ onApply(onSuccess?: (batch: BatchDTO) => void, onError?: (batch: BatchDTO) => void): void;
10
+ get vm(): BatchEditorDialogViewModel;
11
+ }
12
+ export interface BatchEditorDialogViewModel {
13
+ invalidFields: FormInvalidFields;
14
+ canAddOperation: boolean;
15
+ data: BatchEditorFormData;
16
+ }
17
+ export interface BatchEditorFormData {
18
+ operations: OperationFormData[];
19
+ }
20
+ export type OperationFormData = OperationDTO & {
21
+ canDelete: boolean;
22
+ title: string;
23
+ open: boolean;
24
+ fieldOptions: FieldDTO[];
25
+ operatorOptions: OperatorDTO[];
26
+ selectedField?: FieldDTO;
27
+ };
28
+ export declare class BatchEditorDialogPresenter implements IBatchEditorDialogPresenter {
29
+ private batch;
30
+ private fields;
31
+ private invalidFields;
32
+ private formWasSubmitted;
33
+ constructor();
34
+ load(batch: BatchDTO, fields: FieldDTO[]): void;
35
+ get vm(): {
36
+ invalidFields: FormInvalidFields;
37
+ canAddOperation: boolean;
38
+ data: {
39
+ operations: {
40
+ title: string;
41
+ open: boolean;
42
+ field: string;
43
+ operator: string;
44
+ value: Record<string, any> | undefined;
45
+ canDelete: boolean;
46
+ fieldOptions: FieldDTO[];
47
+ selectedField: FieldDTO | undefined;
48
+ operatorOptions: OperatorDTO[];
49
+ }[];
50
+ };
51
+ };
52
+ addOperation(): void;
53
+ deleteOperation(operationIndex: number): void;
54
+ setOperationFieldData(batchIndex: number, data: string): void;
55
+ setBatch(data: BatchEditorFormData): void;
56
+ onApply(onSuccess?: (batch: BatchDTO) => void, onError?: (batch: BatchDTO, invalidFields: BatchEditorDialogViewModel["invalidFields"]) => void): void;
57
+ private getOperations;
58
+ private getOperationTitle;
59
+ private getFieldOptions;
60
+ private validateBatch;
61
+ }
@@ -0,0 +1,111 @@
1
+ import { makeAutoObservable } from "mobx";
2
+ import { Batch } from "../domain/index.js";
3
+ class BatchEditorDialogPresenter {
4
+ constructor(){
5
+ this.invalidFields = {};
6
+ this.formWasSubmitted = false;
7
+ this.getOperations = ()=>this.batch?.operations.map((operation, operationIndex)=>{
8
+ const fieldOptions = this.getFieldOptions(operation.field);
9
+ const selectedField = fieldOptions.find((field)=>field.value === operation.field);
10
+ const operatorOptions = selectedField?.operators || [];
11
+ return {
12
+ title: this.getOperationTitle(operation.field, operation.operator) ?? `Operation #${operationIndex + 1}`,
13
+ open: true,
14
+ field: operation.field,
15
+ operator: operation.operator,
16
+ value: operation.value,
17
+ canDelete: 0 !== operationIndex,
18
+ fieldOptions,
19
+ selectedField,
20
+ operatorOptions
21
+ };
22
+ }) || [];
23
+ this.batch = void 0;
24
+ this.fields = [];
25
+ makeAutoObservable(this);
26
+ }
27
+ load(batch, fields) {
28
+ this.batch = batch;
29
+ this.fields = fields;
30
+ }
31
+ get vm() {
32
+ const operations = this.getOperations();
33
+ const canAddOperation = operations[operations.length - 1]?.fieldOptions.length > 1 || false;
34
+ return {
35
+ invalidFields: this.invalidFields,
36
+ canAddOperation,
37
+ data: {
38
+ operations
39
+ }
40
+ };
41
+ }
42
+ addOperation() {
43
+ if (!this.batch) return;
44
+ this.batch.operations.push({
45
+ field: "",
46
+ operator: "",
47
+ value: void 0
48
+ });
49
+ }
50
+ deleteOperation(operationIndex) {
51
+ if (!this.batch) return;
52
+ this.batch.operations = this.batch.operations.filter((_, index)=>index !== operationIndex);
53
+ if (0 === this.batch.operations.length) this.addOperation();
54
+ }
55
+ setOperationFieldData(batchIndex, data) {
56
+ if (!this.batch) return;
57
+ this.batch.operations = [
58
+ ...this.batch.operations.slice(0, batchIndex),
59
+ {
60
+ field: data,
61
+ operator: "",
62
+ value: void 0
63
+ },
64
+ ...this.batch.operations.slice(batchIndex + 1)
65
+ ];
66
+ }
67
+ setBatch(data) {
68
+ if (!this.batch) return;
69
+ this.batch = {
70
+ ...this.batch,
71
+ operations: data.operations.map((operation)=>({
72
+ field: operation.field,
73
+ operator: operation.operator,
74
+ value: operation.value
75
+ }))
76
+ };
77
+ if (this.formWasSubmitted) this.validateBatch(this.batch);
78
+ }
79
+ onApply(onSuccess, onError) {
80
+ if (!this.batch) return;
81
+ const result = this.validateBatch(this.batch);
82
+ if (result.success) onSuccess && onSuccess(this.batch);
83
+ else onError && onError(this.batch, this.invalidFields);
84
+ }
85
+ getOperationTitle(inputField, inputOperation) {
86
+ if (!inputField || !inputOperation) return;
87
+ const field = this.fields.find((field)=>field.value === inputField);
88
+ if (!field) return;
89
+ const operator = field.operators.find((operator)=>operator.value === inputOperation);
90
+ if (!operator) return;
91
+ return `${operator.label} for field "${field.label}"`;
92
+ }
93
+ getFieldOptions(currentFieldId = "") {
94
+ if (!this.batch) return [];
95
+ const existings = this.batch.operations.filter((operation)=>operation.field !== currentFieldId).map((operation)=>operation.field);
96
+ return this.fields.filter((field)=>!existings.includes(field.value));
97
+ }
98
+ validateBatch(data) {
99
+ this.formWasSubmitted = true;
100
+ const validation = Batch.validate(data);
101
+ if (validation.success) this.invalidFields = {};
102
+ else this.invalidFields = validation.error.issues.reduce((acc, issue)=>({
103
+ ...acc,
104
+ [issue.path.join(".")]: issue.message
105
+ }), {});
106
+ return validation;
107
+ }
108
+ }
109
+ export { BatchEditorDialogPresenter };
110
+
111
+ //# sourceMappingURL=BatchEditorDialogPresenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.js","sources":["../../../../../../src/presentation/FileList/components/BulkActions/BatchEditorDialog/BatchEditorDialogPresenter.tsx"],"sourcesContent":["import { makeAutoObservable } from \"mobx\";\n\nimport type {\n BatchDTO,\n FieldDTO,\n OperationDTO,\n OperatorDTO\n} from \"~/presentation/FileList/components/BulkActions/domain/index.js\";\nimport { Batch } from \"~/presentation/FileList/components/BulkActions/domain/index.js\";\nimport type { FormInvalidFields } from \"@webiny/form\";\n\nexport interface IBatchEditorDialogPresenter {\n load(batch: BatchDTO, fields: FieldDTO[]): void;\n addOperation(): void;\n deleteOperation(operationIndex: number): void;\n setOperationFieldData(operationIndex: number, data: string): void;\n setBatch(data: any): void;\n onApply(onSuccess?: (batch: BatchDTO) => void, onError?: (batch: BatchDTO) => void): void;\n get vm(): BatchEditorDialogViewModel;\n}\n\nexport interface BatchEditorDialogViewModel {\n invalidFields: FormInvalidFields;\n canAddOperation: boolean;\n data: BatchEditorFormData;\n}\n\nexport interface BatchEditorFormData {\n operations: OperationFormData[];\n}\n\nexport type OperationFormData = OperationDTO & {\n canDelete: boolean;\n title: string;\n open: boolean;\n fieldOptions: FieldDTO[];\n operatorOptions: OperatorDTO[];\n selectedField?: FieldDTO;\n};\n\nexport class BatchEditorDialogPresenter implements IBatchEditorDialogPresenter {\n private batch: BatchDTO | undefined;\n private fields: FieldDTO[];\n private invalidFields: BatchEditorDialogViewModel[\"invalidFields\"] = {};\n private formWasSubmitted = false;\n\n constructor() {\n this.batch = undefined;\n this.fields = [];\n makeAutoObservable(this);\n }\n\n load(batch: BatchDTO, fields: FieldDTO[]) {\n this.batch = batch;\n this.fields = fields;\n }\n\n get vm() {\n const operations = this.getOperations();\n const canAddOperation = operations[operations.length - 1]?.fieldOptions.length > 1 || false;\n\n return {\n invalidFields: this.invalidFields,\n canAddOperation,\n data: {\n operations\n }\n };\n }\n\n addOperation(): void {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations.push({\n field: \"\",\n operator: \"\",\n value: undefined\n });\n }\n\n deleteOperation(operationIndex: number): void {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations = this.batch.operations.filter(\n (_, index) => index !== operationIndex\n );\n\n // Make sure we always have at least 1 operation!\n if (this.batch.operations.length === 0) {\n this.addOperation();\n }\n }\n\n setOperationFieldData(batchIndex: number, data: string) {\n if (!this.batch) {\n return;\n }\n\n this.batch.operations = [\n ...this.batch.operations.slice(0, batchIndex),\n {\n field: data,\n operator: \"\",\n value: undefined\n },\n ...this.batch.operations.slice(batchIndex + 1)\n ];\n }\n\n setBatch(data: BatchEditorFormData): void {\n if (!this.batch) {\n return;\n }\n\n this.batch = {\n ...this.batch,\n operations: data.operations.map(operation => ({\n field: operation.field,\n operator: operation.operator,\n value: operation.value\n }))\n };\n\n if (this.formWasSubmitted) {\n this.validateBatch(this.batch);\n }\n }\n\n onApply(\n onSuccess?: (batch: BatchDTO) => void,\n onError?: (\n batch: BatchDTO,\n invalidFields: BatchEditorDialogViewModel[\"invalidFields\"]\n ) => void\n ) {\n if (!this.batch) {\n return;\n }\n\n const result = this.validateBatch(this.batch);\n if (result.success) {\n onSuccess && onSuccess(this.batch);\n } else {\n onError && onError(this.batch, this.invalidFields);\n }\n }\n\n private getOperations = () => {\n return (\n this.batch?.operations.map((operation: OperationDTO, operationIndex) => {\n const fieldOptions = this.getFieldOptions(operation.field);\n const selectedField = fieldOptions.find(field => field.value === operation.field);\n const operatorOptions = selectedField?.operators || [];\n\n return {\n title:\n this.getOperationTitle(operation.field, operation.operator) ??\n `Operation #${operationIndex + 1}`,\n open: true,\n field: operation.field,\n operator: operation.operator,\n value: operation.value,\n canDelete: operationIndex !== 0,\n fieldOptions,\n selectedField,\n operatorOptions\n };\n }) || []\n );\n };\n\n private getOperationTitle(inputField?: string, inputOperation?: string) {\n if (!inputField || !inputOperation) {\n return undefined;\n }\n\n const field = this.fields.find(field => field.value === inputField);\n\n if (!field) {\n return undefined;\n }\n\n const operator = field.operators.find(operator => operator.value === inputOperation);\n\n if (!operator) {\n return undefined;\n }\n\n return `${operator.label} for field \"${field.label}\"`;\n }\n\n private getFieldOptions(currentFieldId = \"\") {\n if (!this.batch) {\n return [];\n }\n\n const existings = this.batch.operations\n .filter(operation => operation.field !== currentFieldId)\n .map(operation => operation.field);\n\n return this.fields.filter(field => !existings.includes(field.value));\n }\n\n private validateBatch(data: BatchDTO) {\n this.formWasSubmitted = true;\n const validation = Batch.validate(data);\n\n if (!validation.success) {\n this.invalidFields = validation.error.issues.reduce((acc, issue) => {\n return {\n ...acc,\n [issue.path.join(\".\")]: issue.message\n };\n }, {});\n } else {\n this.invalidFields = {};\n }\n\n return validation;\n }\n}\n"],"names":["BatchEditorDialogPresenter","operation","operationIndex","fieldOptions","selectedField","field","operatorOptions","undefined","makeAutoObservable","batch","fields","operations","canAddOperation","_","index","batchIndex","data","onSuccess","onError","result","inputField","inputOperation","operator","currentFieldId","existings","validation","Batch","acc","issue"],"mappings":"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"}