@blaze-cms/plugin-media-ui 0.146.0-node18.1 → 0.146.0-rc-eagle.0

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 (334) hide show
  1. package/CHANGELOG.md +10 -16
  2. package/lib/components/CardMedia/CardMedia.js +168 -221
  3. package/lib/components/CardMedia/CardMedia.js.map +1 -1
  4. package/lib/components/CardMedia/index.js +2 -3
  5. package/lib/components/CardMedia/index.js.map +1 -1
  6. package/lib/components/EditMediaFile/EditMediaFile.js +162 -113
  7. package/lib/components/EditMediaFile/EditMediaFile.js.map +1 -1
  8. package/lib/components/EditMediaFile/EditMediaFilePage.js +81 -97
  9. package/lib/components/EditMediaFile/EditMediaFilePage.js.map +1 -1
  10. package/lib/components/EditMediaFile/index.js +2 -3
  11. package/lib/components/EditMediaFile/index.js.map +1 -1
  12. package/lib/components/EditorAdapter/EditorAdapter.js +43 -22
  13. package/lib/components/EditorAdapter/EditorAdapter.js.map +1 -1
  14. package/lib/components/EditorAdapter/index.js +2 -3
  15. package/lib/components/EditorAdapter/index.js.map +1 -1
  16. package/lib/components/FileList/FilesListContext/index.js +3 -4
  17. package/lib/components/FileList/FilesListContext/index.js.map +1 -1
  18. package/lib/components/FileList/FilesListProvider/index.js +27 -29
  19. package/lib/components/FileList/FilesListProvider/index.js.map +1 -1
  20. package/lib/components/FileList/useFileList/index.js +3 -6
  21. package/lib/components/FileList/useFileList/index.js.map +1 -1
  22. package/lib/components/FileList/useGetFiles/getFiles.js +164 -185
  23. package/lib/components/FileList/useGetFiles/getFiles.js.map +1 -1
  24. package/lib/components/FileList/useGetFiles/index.js +2 -3
  25. package/lib/components/FileList/useGetFiles/index.js.map +1 -1
  26. package/lib/components/FileList/useGetFiles/useGetFiles.js +88 -133
  27. package/lib/components/FileList/useGetFiles/useGetFiles.js.map +1 -1
  28. package/lib/components/FileList/useGetFilesList/getCounters.js +10 -30
  29. package/lib/components/FileList/useGetFilesList/getCounters.js.map +1 -1
  30. package/lib/components/FileList/useGetFilesList/index.js +2 -3
  31. package/lib/components/FileList/useGetFilesList/index.js.map +1 -1
  32. package/lib/components/FileList/useGetFilesList/useGetFilesList.js +89 -110
  33. package/lib/components/FileList/useGetFilesList/useGetFilesList.js.map +1 -1
  34. package/lib/components/FilePreview/Actions/index.js +24 -38
  35. package/lib/components/FilePreview/Actions/index.js.map +1 -1
  36. package/lib/components/FilePreview/Image/Image.js +35 -24
  37. package/lib/components/FilePreview/Image/Image.js.map +1 -1
  38. package/lib/components/FilePreview/Image/RawImage.js +25 -27
  39. package/lib/components/FilePreview/Image/RawImage.js.map +1 -1
  40. package/lib/components/FilePreview/Image/imageSchema.js +2 -3
  41. package/lib/components/FilePreview/Image/imageSchema.js.map +1 -1
  42. package/lib/components/FilePreview/Image/index.js +1 -2
  43. package/lib/components/FilePreview/Image/index.js.map +1 -1
  44. package/lib/components/FilePreview/ModalContext.js +9 -0
  45. package/lib/components/FilePreview/ModalContext.js.map +1 -0
  46. package/lib/components/FilePreview/PDF/PDF.js +44 -31
  47. package/lib/components/FilePreview/PDF/PDF.js.map +1 -1
  48. package/lib/components/FilePreview/PDF/RawPDF.js +27 -29
  49. package/lib/components/FilePreview/PDF/RawPDF.js.map +1 -1
  50. package/lib/components/FilePreview/PDF/index.js +1 -2
  51. package/lib/components/FilePreview/PDF/index.js.map +1 -1
  52. package/lib/components/FilePreview/PDF/schema.js +1 -2
  53. package/lib/components/FilePreview/PDF/schema.js.map +1 -1
  54. package/lib/components/FilePreview/get-preview.js +12 -10
  55. package/lib/components/FilePreview/get-preview.js.map +1 -1
  56. package/lib/components/FilePreview/index.js +66 -57
  57. package/lib/components/FilePreview/index.js.map +1 -1
  58. package/lib/components/FilePreview/previewDefault/PreviewDefault.js +35 -23
  59. package/lib/components/FilePreview/previewDefault/PreviewDefault.js.map +1 -1
  60. package/lib/components/FilePreview/previewDefault/RawPreviewDefault.js +33 -27
  61. package/lib/components/FilePreview/previewDefault/RawPreviewDefault.js.map +1 -1
  62. package/lib/components/FilePreview/previewDefault/icons/DefaultIcon.js +120 -123
  63. package/lib/components/FilePreview/previewDefault/icons/DefaultIcon.js.map +1 -1
  64. package/lib/components/FilePreview/previewDefault/icons/index.js +2 -3
  65. package/lib/components/FilePreview/previewDefault/icons/index.js.map +1 -1
  66. package/lib/components/FilePreview/previewDefault/index.js +1 -2
  67. package/lib/components/FilePreview/previewDefault/index.js.map +1 -1
  68. package/lib/components/FilePreview/previewDefault/previewDefaultSchema.js +1 -2
  69. package/lib/components/FilePreview/previewDefault/previewDefaultSchema.js.map +1 -1
  70. package/lib/components/FilePreviewReadOnly/FileList.js +10 -12
  71. package/lib/components/FilePreviewReadOnly/FileList.js.map +1 -1
  72. package/lib/components/FilePreviewReadOnly/FilePreviewList.js +14 -20
  73. package/lib/components/FilePreviewReadOnly/FilePreviewList.js.map +1 -1
  74. package/lib/components/FilePreviewReadOnly/FilePreviewReadOnly.js +52 -98
  75. package/lib/components/FilePreviewReadOnly/FilePreviewReadOnly.js.map +1 -1
  76. package/lib/components/FilePreviewReadOnly/index.js +2 -3
  77. package/lib/components/FilePreviewReadOnly/index.js.map +1 -1
  78. package/lib/components/FilePreviewReadOnly/mappers/format-initial-value.js +7 -8
  79. package/lib/components/FilePreviewReadOnly/mappers/format-initial-value.js.map +1 -1
  80. package/lib/components/FilePreviewReadOnly/mappers/index.js +1 -2
  81. package/lib/components/FilePreviewReadOnly/mappers/index.js.map +1 -1
  82. package/lib/components/FileUploadAdapter/FileList.js +26 -39
  83. package/lib/components/FileUploadAdapter/FileList.js.map +1 -1
  84. package/lib/components/FileUploadAdapter/FilePreviewList.js +14 -20
  85. package/lib/components/FileUploadAdapter/FilePreviewList.js.map +1 -1
  86. package/lib/components/FileUploadAdapter/FileReorderList.js +18 -21
  87. package/lib/components/FileUploadAdapter/FileReorderList.js.map +1 -1
  88. package/lib/components/FileUploadAdapter/FileReorderListItem.js +20 -23
  89. package/lib/components/FileUploadAdapter/FileReorderListItem.js.map +1 -1
  90. package/lib/components/FileUploadAdapter/FileUploadAdapter.js +238 -338
  91. package/lib/components/FileUploadAdapter/FileUploadAdapter.js.map +1 -1
  92. package/lib/components/FileUploadAdapter/index.js +2 -3
  93. package/lib/components/FileUploadAdapter/index.js.map +1 -1
  94. package/lib/components/FileUploadAdapter/mappers/format-initial-value.js +7 -8
  95. package/lib/components/FileUploadAdapter/mappers/format-initial-value.js.map +1 -1
  96. package/lib/components/FileUploadAdapter/mappers/get-button-text.js +9 -6
  97. package/lib/components/FileUploadAdapter/mappers/get-button-text.js.map +1 -1
  98. package/lib/components/FileUploadAdapter/mappers/get-format.js +7 -13
  99. package/lib/components/FileUploadAdapter/mappers/get-format.js.map +1 -1
  100. package/lib/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js +6 -5
  101. package/lib/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js.map +1 -1
  102. package/lib/components/FileUploadAdapter/mappers/index.js +6 -7
  103. package/lib/components/FileUploadAdapter/mappers/index.js.map +1 -1
  104. package/lib/components/FileUploadAdapter/mappers/is-unselecting.js +2 -10
  105. package/lib/components/FileUploadAdapter/mappers/is-unselecting.js.map +1 -1
  106. package/lib/components/FileUploadAdapter/mappers/transform-to-array.js +2 -5
  107. package/lib/components/FileUploadAdapter/mappers/transform-to-array.js.map +1 -1
  108. package/lib/components/FileUploadAdapter/useLimit.js +4 -10
  109. package/lib/components/FileUploadAdapter/useLimit.js.map +1 -1
  110. package/lib/components/FileUploadModal/FileUploadModal.js +150 -145
  111. package/lib/components/FileUploadModal/FileUploadModal.js.map +1 -1
  112. package/lib/components/FileUploadModal/index.js +2 -3
  113. package/lib/components/FileUploadModal/index.js.map +1 -1
  114. package/lib/components/FilterPanel/FilterPanel.js +68 -88
  115. package/lib/components/FilterPanel/FilterPanel.js.map +1 -1
  116. package/lib/components/FilterPanel/index.js +2 -3
  117. package/lib/components/FilterPanel/index.js.map +1 -1
  118. package/lib/components/ListingContainer/Listing/Listing.js +58 -48
  119. package/lib/components/ListingContainer/Listing/Listing.js.map +1 -1
  120. package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +75 -92
  121. package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +1 -1
  122. package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js +2 -3
  123. package/lib/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js.map +1 -1
  124. package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js +22 -26
  125. package/lib/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +1 -1
  126. package/lib/components/ListingContainer/Listing/MediaListing/index.js +2 -3
  127. package/lib/components/ListingContainer/Listing/MediaListing/index.js.map +1 -1
  128. package/lib/components/ListingContainer/Listing/index.js +2 -3
  129. package/lib/components/ListingContainer/Listing/index.js.map +1 -1
  130. package/lib/components/ListingContainer/ListingContainer.js +69 -92
  131. package/lib/components/ListingContainer/ListingContainer.js.map +1 -1
  132. package/lib/components/ListingContainer/index.js +2 -3
  133. package/lib/components/ListingContainer/index.js.map +1 -1
  134. package/lib/components/ListingContainer/mappers/exist-previous.js +3 -10
  135. package/lib/components/ListingContainer/mappers/exist-previous.js.map +1 -1
  136. package/lib/components/ListingContainer/mappers/index.js +2 -3
  137. package/lib/components/ListingContainer/mappers/index.js.map +1 -1
  138. package/lib/components/MediaListing.js +14 -26
  139. package/lib/components/MediaListing.js.map +1 -1
  140. package/lib/constants.js +15 -16
  141. package/lib/constants.js.map +1 -1
  142. package/lib/icons/MediaLibraryIcon.js +17 -20
  143. package/lib/icons/MediaLibraryIcon.js.map +1 -1
  144. package/lib/icons/index.js +2 -3
  145. package/lib/icons/index.js.map +1 -1
  146. package/lib/index.js +67 -92
  147. package/lib/index.js.map +1 -1
  148. package/lib/utils/available-filters/available-filters.js +1 -2
  149. package/lib/utils/available-filters/available-filters.js.map +1 -1
  150. package/lib/utils/bustUrl.js +13 -0
  151. package/lib/utils/bustUrl.js.map +1 -0
  152. package/lib/utils/media-context/index.js +4 -5
  153. package/lib/utils/media-context/index.js.map +1 -1
  154. package/lib/utils/media-context/media-context.js +3 -4
  155. package/lib/utils/media-context/media-context.js.map +1 -1
  156. package/lib/utils/media-context/useMediaContext.js +2 -4
  157. package/lib/utils/media-context/useMediaContext.js.map +1 -1
  158. package/package.json +14 -14
  159. package/src/components/CardMedia/CardMedia.js +27 -8
  160. package/src/components/EditMediaFile/EditMediaFile.js +115 -37
  161. package/src/components/EditMediaFile/EditMediaFilePage.js +35 -9
  162. package/src/components/EditorAdapter/EditorAdapter.js +31 -4
  163. package/src/components/FilePreview/Actions/index.js +25 -27
  164. package/src/components/FilePreview/Image/Image.js +15 -2
  165. package/src/components/FilePreview/Image/imageSchema.js +1 -1
  166. package/src/components/FilePreview/ModalContext.js +3 -0
  167. package/src/components/FilePreview/PDF/PDF.js +17 -4
  168. package/src/components/FilePreview/index.js +35 -6
  169. package/src/components/FilePreview/previewDefault/PreviewDefault.js +16 -3
  170. package/src/components/FilePreview/previewDefault/RawPreviewDefault.js +17 -7
  171. package/src/components/FilePreviewReadOnly/FileList.js +1 -3
  172. package/src/components/FilePreviewReadOnly/FilePreviewReadOnly.js +17 -29
  173. package/src/components/FileUploadAdapter/FileUploadAdapter.js +42 -18
  174. package/src/components/FileUploadAdapter/mappers/get-button-text.js +4 -3
  175. package/src/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js +6 -4
  176. package/src/components/FileUploadModal/FileUploadModal.js +88 -42
  177. package/src/components/ListingContainer/Listing/Listing.js +15 -5
  178. package/src/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +11 -5
  179. package/src/components/ListingContainer/Listing/MediaListing/MediaListing.js +10 -2
  180. package/src/components/ListingContainer/ListingContainer.js +13 -4
  181. package/src/index.js +17 -14
  182. package/src/utils/bustUrl.js +6 -0
  183. package/lib-es/components/CardMedia/CardMedia.js +0 -219
  184. package/lib-es/components/CardMedia/CardMedia.js.map +0 -1
  185. package/lib-es/components/CardMedia/index.js +0 -3
  186. package/lib-es/components/CardMedia/index.js.map +0 -1
  187. package/lib-es/components/EditMediaFile/EditMediaFile.js +0 -115
  188. package/lib-es/components/EditMediaFile/EditMediaFile.js.map +0 -1
  189. package/lib-es/components/EditMediaFile/EditMediaFilePage.js +0 -86
  190. package/lib-es/components/EditMediaFile/EditMediaFilePage.js.map +0 -1
  191. package/lib-es/components/EditMediaFile/index.js +0 -3
  192. package/lib-es/components/EditMediaFile/index.js.map +0 -1
  193. package/lib-es/components/EditorAdapter/EditorAdapter.js +0 -39
  194. package/lib-es/components/EditorAdapter/EditorAdapter.js.map +0 -1
  195. package/lib-es/components/EditorAdapter/index.js +0 -3
  196. package/lib-es/components/EditorAdapter/index.js.map +0 -1
  197. package/lib-es/components/FileList/FilesListContext/index.js +0 -4
  198. package/lib-es/components/FileList/FilesListContext/index.js.map +0 -1
  199. package/lib-es/components/FileList/FilesListProvider/index.js +0 -36
  200. package/lib-es/components/FileList/FilesListProvider/index.js.map +0 -1
  201. package/lib-es/components/FileList/useFileList/index.js +0 -5
  202. package/lib-es/components/FileList/useFileList/index.js.map +0 -1
  203. package/lib-es/components/FileList/useGetFiles/getFiles.js +0 -179
  204. package/lib-es/components/FileList/useGetFiles/getFiles.js.map +0 -1
  205. package/lib-es/components/FileList/useGetFiles/index.js +0 -3
  206. package/lib-es/components/FileList/useGetFiles/index.js.map +0 -1
  207. package/lib-es/components/FileList/useGetFiles/useGetFiles.js +0 -114
  208. package/lib-es/components/FileList/useGetFiles/useGetFiles.js.map +0 -1
  209. package/lib-es/components/FileList/useGetFilesList/getCounters.js +0 -11
  210. package/lib-es/components/FileList/useGetFilesList/getCounters.js.map +0 -1
  211. package/lib-es/components/FileList/useGetFilesList/index.js +0 -3
  212. package/lib-es/components/FileList/useGetFilesList/index.js.map +0 -1
  213. package/lib-es/components/FileList/useGetFilesList/useGetFilesList.js +0 -172
  214. package/lib-es/components/FileList/useGetFilesList/useGetFilesList.js.map +0 -1
  215. package/lib-es/components/FilePreview/Actions/index.js +0 -38
  216. package/lib-es/components/FilePreview/Actions/index.js.map +0 -1
  217. package/lib-es/components/FilePreview/Image/Image.js +0 -27
  218. package/lib-es/components/FilePreview/Image/Image.js.map +0 -1
  219. package/lib-es/components/FilePreview/Image/RawImage.js +0 -31
  220. package/lib-es/components/FilePreview/Image/RawImage.js.map +0 -1
  221. package/lib-es/components/FilePreview/Image/imageSchema.js +0 -53
  222. package/lib-es/components/FilePreview/Image/imageSchema.js.map +0 -1
  223. package/lib-es/components/FilePreview/Image/index.js +0 -12
  224. package/lib-es/components/FilePreview/Image/index.js.map +0 -1
  225. package/lib-es/components/FilePreview/PDF/PDF.js +0 -34
  226. package/lib-es/components/FilePreview/PDF/PDF.js.map +0 -1
  227. package/lib-es/components/FilePreview/PDF/RawPDF.js +0 -33
  228. package/lib-es/components/FilePreview/PDF/RawPDF.js.map +0 -1
  229. package/lib-es/components/FilePreview/PDF/index.js +0 -12
  230. package/lib-es/components/FilePreview/PDF/index.js.map +0 -1
  231. package/lib-es/components/FilePreview/PDF/schema.js +0 -21
  232. package/lib-es/components/FilePreview/PDF/schema.js.map +0 -1
  233. package/lib-es/components/FilePreview/get-preview.js +0 -28
  234. package/lib-es/components/FilePreview/get-preview.js.map +0 -1
  235. package/lib-es/components/FilePreview/index.js +0 -85
  236. package/lib-es/components/FilePreview/index.js.map +0 -1
  237. package/lib-es/components/FilePreview/previewDefault/PreviewDefault.js +0 -27
  238. package/lib-es/components/FilePreview/previewDefault/PreviewDefault.js.map +0 -1
  239. package/lib-es/components/FilePreview/previewDefault/RawPreviewDefault.js +0 -31
  240. package/lib-es/components/FilePreview/previewDefault/RawPreviewDefault.js.map +0 -1
  241. package/lib-es/components/FilePreview/previewDefault/icons/DefaultIcon.js +0 -121
  242. package/lib-es/components/FilePreview/previewDefault/icons/DefaultIcon.js.map +0 -1
  243. package/lib-es/components/FilePreview/previewDefault/icons/index.js +0 -3
  244. package/lib-es/components/FilePreview/previewDefault/icons/index.js.map +0 -1
  245. package/lib-es/components/FilePreview/previewDefault/index.js +0 -12
  246. package/lib-es/components/FilePreview/previewDefault/index.js.map +0 -1
  247. package/lib-es/components/FilePreview/previewDefault/previewDefaultSchema.js +0 -25
  248. package/lib-es/components/FilePreview/previewDefault/previewDefaultSchema.js.map +0 -1
  249. package/lib-es/components/FilePreviewReadOnly/FileList.js +0 -18
  250. package/lib-es/components/FilePreviewReadOnly/FileList.js.map +0 -1
  251. package/lib-es/components/FilePreviewReadOnly/FilePreviewList.js +0 -22
  252. package/lib-es/components/FilePreviewReadOnly/FilePreviewList.js.map +0 -1
  253. package/lib-es/components/FilePreviewReadOnly/FilePreviewReadOnly.js +0 -66
  254. package/lib-es/components/FilePreviewReadOnly/FilePreviewReadOnly.js.map +0 -1
  255. package/lib-es/components/FilePreviewReadOnly/index.js +0 -3
  256. package/lib-es/components/FilePreviewReadOnly/index.js.map +0 -1
  257. package/lib-es/components/FilePreviewReadOnly/mappers/format-initial-value.js +0 -11
  258. package/lib-es/components/FilePreviewReadOnly/mappers/format-initial-value.js.map +0 -1
  259. package/lib-es/components/FilePreviewReadOnly/mappers/index.js +0 -3
  260. package/lib-es/components/FilePreviewReadOnly/mappers/index.js.map +0 -1
  261. package/lib-es/components/FileUploadAdapter/FileList.js +0 -52
  262. package/lib-es/components/FileUploadAdapter/FileList.js.map +0 -1
  263. package/lib-es/components/FileUploadAdapter/FilePreviewList.js +0 -22
  264. package/lib-es/components/FileUploadAdapter/FilePreviewList.js.map +0 -1
  265. package/lib-es/components/FileUploadAdapter/FileReorderList.js +0 -32
  266. package/lib-es/components/FileUploadAdapter/FileReorderList.js.map +0 -1
  267. package/lib-es/components/FileUploadAdapter/FileReorderListItem.js +0 -24
  268. package/lib-es/components/FileUploadAdapter/FileReorderListItem.js.map +0 -1
  269. package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js +0 -367
  270. package/lib-es/components/FileUploadAdapter/FileUploadAdapter.js.map +0 -1
  271. package/lib-es/components/FileUploadAdapter/index.js +0 -3
  272. package/lib-es/components/FileUploadAdapter/index.js.map +0 -1
  273. package/lib-es/components/FileUploadAdapter/mappers/format-initial-value.js +0 -11
  274. package/lib-es/components/FileUploadAdapter/mappers/format-initial-value.js.map +0 -1
  275. package/lib-es/components/FileUploadAdapter/mappers/get-button-text.js +0 -9
  276. package/lib-es/components/FileUploadAdapter/mappers/get-button-text.js.map +0 -1
  277. package/lib-es/components/FileUploadAdapter/mappers/get-format.js +0 -12
  278. package/lib-es/components/FileUploadAdapter/mappers/get-format.js.map +0 -1
  279. package/lib-es/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js +0 -6
  280. package/lib-es/components/FileUploadAdapter/mappers/get-number-files-pending-to-fetch.js.map +0 -1
  281. package/lib-es/components/FileUploadAdapter/mappers/index.js +0 -8
  282. package/lib-es/components/FileUploadAdapter/mappers/index.js.map +0 -1
  283. package/lib-es/components/FileUploadAdapter/mappers/is-unselecting.js +0 -2
  284. package/lib-es/components/FileUploadAdapter/mappers/is-unselecting.js.map +0 -1
  285. package/lib-es/components/FileUploadAdapter/mappers/transform-to-array.js +0 -2
  286. package/lib-es/components/FileUploadAdapter/mappers/transform-to-array.js.map +0 -1
  287. package/lib-es/components/FileUploadAdapter/useLimit.js +0 -13
  288. package/lib-es/components/FileUploadAdapter/useLimit.js.map +0 -1
  289. package/lib-es/components/FileUploadModal/FileUploadModal.js +0 -113
  290. package/lib-es/components/FileUploadModal/FileUploadModal.js.map +0 -1
  291. package/lib-es/components/FileUploadModal/index.js +0 -3
  292. package/lib-es/components/FileUploadModal/index.js.map +0 -1
  293. package/lib-es/components/FilterPanel/FilterPanel.js +0 -135
  294. package/lib-es/components/FilterPanel/FilterPanel.js.map +0 -1
  295. package/lib-es/components/FilterPanel/index.js +0 -3
  296. package/lib-es/components/FilterPanel/index.js.map +0 -1
  297. package/lib-es/components/ListingContainer/Listing/Listing.js +0 -58
  298. package/lib-es/components/ListingContainer/Listing/Listing.js.map +0 -1
  299. package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js +0 -145
  300. package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/MediaFileList.js.map +0 -1
  301. package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js +0 -3
  302. package/lib-es/components/ListingContainer/Listing/MediaListing/MediaFileList/index.js.map +0 -1
  303. package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js +0 -24
  304. package/lib-es/components/ListingContainer/Listing/MediaListing/MediaListing.js.map +0 -1
  305. package/lib-es/components/ListingContainer/Listing/MediaListing/index.js +0 -3
  306. package/lib-es/components/ListingContainer/Listing/MediaListing/index.js.map +0 -1
  307. package/lib-es/components/ListingContainer/Listing/index.js +0 -3
  308. package/lib-es/components/ListingContainer/Listing/index.js.map +0 -1
  309. package/lib-es/components/ListingContainer/ListingContainer.js +0 -106
  310. package/lib-es/components/ListingContainer/ListingContainer.js.map +0 -1
  311. package/lib-es/components/ListingContainer/index.js +0 -3
  312. package/lib-es/components/ListingContainer/index.js.map +0 -1
  313. package/lib-es/components/ListingContainer/mappers/exist-previous.js +0 -3
  314. package/lib-es/components/ListingContainer/mappers/exist-previous.js.map +0 -1
  315. package/lib-es/components/ListingContainer/mappers/index.js +0 -3
  316. package/lib-es/components/ListingContainer/mappers/index.js.map +0 -1
  317. package/lib-es/components/MediaListing.js +0 -29
  318. package/lib-es/components/MediaListing.js.map +0 -1
  319. package/lib-es/constants.js +0 -36
  320. package/lib-es/constants.js.map +0 -1
  321. package/lib-es/icons/MediaLibraryIcon.js +0 -70
  322. package/lib-es/icons/MediaLibraryIcon.js.map +0 -1
  323. package/lib-es/icons/index.js +0 -3
  324. package/lib-es/icons/index.js.map +0 -1
  325. package/lib-es/index.js +0 -61
  326. package/lib-es/index.js.map +0 -1
  327. package/lib-es/utils/available-filters/available-filters.js +0 -26
  328. package/lib-es/utils/available-filters/available-filters.js.map +0 -1
  329. package/lib-es/utils/media-context/index.js +0 -4
  330. package/lib-es/utils/media-context/index.js.map +0 -1
  331. package/lib-es/utils/media-context/media-context.js +0 -6
  332. package/lib-es/utils/media-context/media-context.js.map +0 -1
  333. package/lib-es/utils/media-context/useMediaContext.js +0 -4
  334. package/lib-es/utils/media-context/useMediaContext.js.map +0 -1
@@ -1,154 +1,152 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
- require("core-js/modules/es.object.get-own-property-descriptor.js");
5
- require("core-js/modules/es.weak-map.js");
6
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
7
- var _typeof = require("@babel/runtime/helpers/typeof");
8
4
  Object.defineProperty(exports, "__esModule", {
9
5
  value: true
10
6
  });
11
- exports["default"] = void 0;
12
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
- require("core-js/modules/es.array.iterator.js");
14
- require("core-js/modules/es.array.join.js");
15
- require("core-js/modules/es.array.map.js");
16
- require("core-js/modules/es.function.name.js");
17
- require("core-js/modules/es.object.to-string.js");
18
- require("core-js/modules/es.promise.js");
19
- require("core-js/modules/es.string.iterator.js");
20
- require("core-js/modules/web.dom-collections.iterator.js");
21
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
22
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
7
+ exports.default = void 0;
8
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
10
  var _react = _interopRequireWildcard(require("react"));
24
11
  var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
25
12
  var _fileUpload = _interopRequireDefault(require("@blaze-react/file-upload"));
26
13
  var _propTypes = _interopRequireDefault(require("prop-types"));
27
14
  var _toaster = require("@blaze-react/toaster");
28
15
  var _client = require("@apollo/client");
29
- var _useFileList2 = _interopRequireDefault(require("../FileList/useFileList"));
30
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
31
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
32
- var FileUploadModal = function FileUploadModal(_ref) {
33
- var onClose = _ref.onClose,
34
- getSelectedFiles = _ref.getSelectedFiles,
35
- closeModalAndSetValue = _ref.closeModalAndSetValue,
36
- simpleLayout = _ref.simpleLayout;
37
- var _useState = (0, _react.useState)([]),
38
- _useState2 = (0, _slicedToArray2["default"])(_useState, 2),
39
- files = _useState2[0],
40
- setFiles = _useState2[1];
41
- var _useToasts = (0, _toaster.useToasts)(),
42
- addToast = _useToasts.addToast;
43
- var client = (0, _client.useApolloClient)();
44
- var _useFileList = (0, _useFileList2["default"])(),
45
- addNewFile = _useFileList.addNewFile;
46
- var fileStoresType = (0, _adminUiUtils.getQuery)('GET_FILE_STORES');
47
- var _useQuery = (0, _client.useQuery)(fileStoresType, {
48
- variables: {
49
- visibleInAdmin: true
50
- }
51
- }),
52
- _useQuery$data = _useQuery.data,
53
- _useQuery$data2 = _useQuery$data === void 0 ? {} : _useQuery$data,
54
- _useQuery$data2$getFi = _useQuery$data2.getFileStores,
55
- storeType = _useQuery$data2$getFi === void 0 ? [] : _useQuery$data2$getFi;
56
- var handleFiles = function handleFiles(filesToUpload) {
16
+ var _useFileList = _interopRequireDefault(require("../FileList/useFileList"));
17
+ const _excluded = ["message"],
18
+ _excluded2 = ["message"];
19
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
20
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
21
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
22
+ const FileUploadModal = ({
23
+ onClose,
24
+ getSelectedFiles,
25
+ closeModalAndSetValue,
26
+ simpleLayout,
27
+ fileId,
28
+ storeKey,
29
+ selectedStoreKey
30
+ }) => {
31
+ const [files, setFiles] = (0, _react.useState)([]);
32
+ const {
33
+ addToast
34
+ } = (0, _toaster.useToasts)();
35
+ const client = (0, _client.useApolloClient)();
36
+ const {
37
+ addNewFile
38
+ } = (0, _useFileList.default)();
39
+ const fileStoresType = (0, _adminUiUtils.getQuery)('GET_FILE_STORES');
40
+ const {
41
+ data: {
42
+ getFileStores: storeType = []
43
+ } = {}
44
+ } = (0, _client.useQuery)(fileStoresType, {
45
+ variables: {
46
+ visibleInAdmin: true
47
+ }
48
+ });
49
+ const handleFiles = filesToUpload => {
50
+ if (fileId && filesToUpload && filesToUpload.length) {
51
+ setFiles([filesToUpload[0]]);
52
+ return;
53
+ }
57
54
  setFiles(filesToUpload);
58
55
  };
59
- var uploadFiles = /*#__PURE__*/function () {
60
- var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
61
- var response, parsedResponse, fileNames, toastMessage, filesToSelect;
62
- return _regenerator["default"].wrap(function _callee$(_context) {
63
- while (1) switch (_context.prev = _context.next) {
64
- case 0:
65
- _context.next = 2;
66
- return Promise.all(files.map(function (_ref3) {
67
- var file = _ref3.file,
68
- name = _ref3.name,
69
- fileData = _ref3.data,
70
- storeKey = _ref3.storeKey;
71
- return client.mutate({
72
- mutation: (0, _adminUiUtils.getMutation)('UPLOAD_FILE'),
73
- variables: {
74
- input: {
75
- file: file,
76
- name: name || file.filename,
77
- storeKey: storeKey,
78
- data: fileData
79
- }
80
- }
81
- });
82
- }))["catch"](function (error) {
83
- addToast(error.message, {
84
- appearance: 'error',
85
- autoDismiss: true
86
- });
87
- });
88
- case 2:
89
- response = _context.sent;
90
- parsedResponse = response.map(function (_ref4) {
91
- var file = _ref4.data.file;
92
- return file.result;
93
- });
94
- fileNames = files.map(function (_ref5) {
95
- var file = _ref5.file;
96
- return file.name;
97
- });
98
- addNewFile(parsedResponse);
99
- toastMessage = "Uploaded: ".concat(fileNames.join(', '));
100
- if (!simpleLayout) {
101
- _context.next = 12;
102
- break;
103
- }
104
- filesToSelect = parsedResponse.map(function (file) {
105
- return file.id;
106
- });
107
- getSelectedFiles(null, filesToSelect);
108
- closeModalAndSetValue(simpleLayout, filesToSelect, toastMessage);
109
- return _context.abrupt("return");
110
- case 12:
111
- addToast(toastMessage, {
112
- appearance: 'success',
113
- autoDismiss: true
114
- });
115
- case 13:
116
- case "end":
117
- return _context.stop();
56
+ const uploadFiles = async () => {
57
+ const filesToProcess = fileId && files.length ? [files[0]] : files;
58
+ const response = await Promise.all(filesToProcess.map(({
59
+ file,
60
+ name,
61
+ data,
62
+ storeKey: fileStoreKey
63
+ }) => {
64
+ const payload = {
65
+ name,
66
+ storeKey: fileStoreKey || selectedStoreKey || storeKey,
67
+ data
68
+ };
69
+ if (fileId) {
70
+ payload.id = fileId;
71
+ } else if (!name) {
72
+ payload.name = file.filename;
73
+ }
74
+ return client.mutate({
75
+ mutation: (0, _adminUiUtils.getMutation)('UPLOAD_FILE'),
76
+ variables: {
77
+ input: _objectSpread({
78
+ file
79
+ }, payload)
118
80
  }
119
- }, _callee);
120
- }));
121
- return function uploadFiles() {
122
- return _ref2.apply(this, arguments);
123
- };
124
- }();
125
- var handleOnSave = /*#__PURE__*/function () {
126
- var _ref6 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
127
- return _regenerator["default"].wrap(function _callee2$(_context2) {
128
- while (1) switch (_context2.prev = _context2.next) {
129
- case 0:
130
- if (!files.length) {
131
- _context2.next = 3;
132
- break;
81
+ });
82
+ })).catch(error => {
83
+ addToast(error.message, {
84
+ appearance: 'error',
85
+ autoDismiss: true
86
+ });
87
+ return [];
88
+ });
89
+ const parsedResponse = response.map(({
90
+ data: {
91
+ file
92
+ }
93
+ }) => {
94
+ const _ref = file.result || {},
95
+ {
96
+ message
97
+ } = _ref,
98
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
99
+ return rest;
100
+ });
101
+ const fileNames = files.map(({
102
+ file
103
+ }) => file.name);
104
+ if (simpleLayout) {
105
+ if (fileId && parsedResponse && parsedResponse.length) {
106
+ const _parsedResponse$ = parsedResponse[0],
107
+ {
108
+ message
109
+ } = _parsedResponse$,
110
+ updatedFile = (0, _objectWithoutProperties2.default)(_parsedResponse$, _excluded2);
111
+ try {
112
+ client.writeQuery({
113
+ query: (0, _adminUiUtils.getQuery)('GET_FILE_BY_ID'),
114
+ variables: {
115
+ id: fileId
116
+ },
117
+ data: {
118
+ file: updatedFile
133
119
  }
134
- _context2.next = 3;
135
- return uploadFiles();
136
- case 3:
137
- onClose();
138
- case 4:
139
- case "end":
140
- return _context2.stop();
120
+ });
121
+ } catch (e) {
122
+ console.error(e); //eslint-disable-line
141
123
  }
142
- }, _callee2);
143
- }));
144
- return function handleOnSave() {
145
- return _ref6.apply(this, arguments);
146
- };
147
- }();
148
- var storeOptions = storeType.map(function (type) {
149
- return [type.key, type.name];
150
- });
151
- return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_adminUiUtils.ModalAdapter, {
124
+ const updateMessage = `Updated: ${updatedFile.filename || fileNames[0]}`;
125
+ closeModalAndSetValue(simpleLayout, updatedFile, updateMessage);
126
+ return;
127
+ }
128
+ const filesToSelect = parsedResponse.map(({
129
+ id
130
+ }) => id);
131
+ const uploadMessage = `Uploaded: ${fileNames.join(', ')}`;
132
+ getSelectedFiles(null, filesToSelect);
133
+ closeModalAndSetValue(simpleLayout, filesToSelect, uploadMessage);
134
+ return;
135
+ }
136
+ addNewFile && addNewFile(parsedResponse);
137
+ const toastMessage = fileId ? `Updated: ${fileNames[0]}` : `Uploaded: ${fileNames.join(', ')}`;
138
+ addToast(toastMessage, {
139
+ appearance: 'success',
140
+ autoDismiss: true
141
+ });
142
+ };
143
+ const handleOnSave = async () => {
144
+ if (files.length) await uploadFiles();
145
+ onClose();
146
+ };
147
+ let storeOptions = storeType.map(type => [type.key, type.name]);
148
+ storeOptions = storeKey ? storeOptions.filter(([key]) => key === storeKey) : storeOptions;
149
+ return /*#__PURE__*/_react.default.createElement(_adminUiUtils.ModalAdapter, {
152
150
  onClose: onClose,
153
151
  title: "Add media",
154
152
  actions: [{
@@ -156,26 +154,33 @@ var FileUploadModal = function FileUploadModal(_ref) {
156
154
  callback: onClose,
157
155
  modifiers: ['cancel']
158
156
  }, {
159
- textButton: 'Save',
157
+ textButton: 'Upload',
160
158
  callback: handleOnSave,
161
159
  modifiers: []
162
160
  }],
163
161
  upload: true
164
- }, /*#__PURE__*/_react["default"].createElement(_fileUpload["default"], {
162
+ }, /*#__PURE__*/_react.default.createElement(_fileUpload.default, {
163
+ storeKey: selectedStoreKey || storeKey,
165
164
  onChange: handleFiles,
166
165
  selectOptions: storeOptions
167
- })));
166
+ }));
168
167
  };
169
168
  FileUploadModal.propTypes = {
170
- getSelectedFiles: _propTypes["default"].func.isRequired,
171
- onClose: _propTypes["default"].func,
172
- simpleLayout: _propTypes["default"].bool,
173
- closeModalAndSetValue: _propTypes["default"].func
169
+ fileId: _propTypes.default.string,
170
+ getSelectedFiles: _propTypes.default.func.isRequired,
171
+ onClose: _propTypes.default.func,
172
+ simpleLayout: _propTypes.default.bool,
173
+ closeModalAndSetValue: _propTypes.default.func,
174
+ storeKey: _propTypes.default.string,
175
+ selectedStoreKey: _propTypes.default.string
174
176
  };
175
177
  FileUploadModal.defaultProps = {
176
- onClose: function onClose() {},
177
- closeModalAndSetValue: function closeModalAndSetValue() {},
178
- simpleLayout: false
178
+ onClose: () => {},
179
+ closeModalAndSetValue: () => {},
180
+ simpleLayout: false,
181
+ fileId: null,
182
+ storeKey: null,
183
+ selectedStoreKey: null
179
184
  };
180
- var _default = exports["default"] = FileUploadModal;
185
+ var _default = exports.default = FileUploadModal;
181
186
  //# sourceMappingURL=FileUploadModal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploadModal.js","names":["_react","_interopRequireWildcard","require","_adminUiUtils","_fileUpload","_interopRequireDefault","_propTypes","_toaster","_client","_useFileList2","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FileUploadModal","_ref","onClose","getSelectedFiles","closeModalAndSetValue","simpleLayout","_useState","useState","_useState2","_slicedToArray2","files","setFiles","_useToasts","useToasts","addToast","client","useApolloClient","_useFileList","useFileList","addNewFile","fileStoresType","getQuery","_useQuery","useQuery","variables","visibleInAdmin","_useQuery$data","data","_useQuery$data2","_useQuery$data2$getFi","getFileStores","storeType","handleFiles","filesToUpload","uploadFiles","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","response","parsedResponse","fileNames","toastMessage","filesToSelect","wrap","_callee$","_context","prev","next","Promise","all","map","_ref3","file","name","fileData","storeKey","mutate","mutation","getMutation","input","filename","error","message","appearance","autoDismiss","sent","_ref4","result","_ref5","concat","join","id","abrupt","stop","apply","arguments","handleOnSave","_ref6","_callee2","_callee2$","_context2","length","storeOptions","type","key","createElement","Fragment","ModalAdapter","title","actions","textButton","callback","modifiers","upload","onChange","selectOptions","propTypes","PropTypes","func","isRequired","bool","defaultProps","_default","exports"],"sources":["../../../src/components/FileUploadModal/FileUploadModal.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { ModalAdapter as Modal, getMutation, getQuery } from '@blaze-cms/admin-ui-utils';\nimport FileUpload from '@blaze-react/file-upload';\nimport PropTypes from 'prop-types';\nimport { useToasts } from '@blaze-react/toaster';\nimport { useApolloClient, useQuery } from '@apollo/client';\nimport useFileList from '../FileList/useFileList';\n\nconst FileUploadModal = ({ onClose, getSelectedFiles, closeModalAndSetValue, simpleLayout }) => {\n const [files, setFiles] = useState([]);\n const { addToast } = useToasts();\n const client = useApolloClient();\n const { addNewFile } = useFileList();\n\n const fileStoresType = getQuery('GET_FILE_STORES');\n\n const { data: { getFileStores: storeType = [] } = {} } = useQuery(fileStoresType, {\n variables: { visibleInAdmin: true }\n });\n\n const handleFiles = filesToUpload => {\n setFiles(filesToUpload);\n };\n\n const uploadFiles = async () => {\n const response = await Promise.all(\n files.map(({ file, name, data: fileData, storeKey }) =>\n client.mutate({\n mutation: getMutation('UPLOAD_FILE'),\n variables: {\n input: {\n file,\n name: name || file.filename,\n storeKey,\n data: fileData\n }\n }\n })\n )\n ).catch(error => {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n });\n\n const parsedResponse = response.map(({ data: { file } }) => file.result);\n\n const fileNames = files.map(({ file }) => file.name);\n addNewFile(parsedResponse);\n const toastMessage = `Uploaded: ${fileNames.join(', ')}`;\n\n if (simpleLayout) {\n const filesToSelect = parsedResponse.map(file => file.id);\n getSelectedFiles(null, filesToSelect);\n closeModalAndSetValue(simpleLayout, filesToSelect, toastMessage);\n return;\n }\n\n addToast(toastMessage, {\n appearance: 'success',\n autoDismiss: true\n });\n };\n\n const handleOnSave = async () => {\n if (files.length) await uploadFiles();\n onClose();\n };\n\n const storeOptions = storeType.map(type => [type.key, type.name]);\n\n return (\n <>\n <Modal\n onClose={onClose}\n title=\"Add media\"\n actions={[\n {\n textButton: 'Cancel',\n callback: onClose,\n modifiers: ['cancel']\n },\n {\n textButton: 'Save',\n callback: handleOnSave,\n modifiers: []\n }\n ]}\n upload>\n <FileUpload onChange={handleFiles} selectOptions={storeOptions} />\n </Modal>\n </>\n );\n};\n\nFileUploadModal.propTypes = {\n getSelectedFiles: PropTypes.func.isRequired,\n onClose: PropTypes.func,\n simpleLayout: PropTypes.bool,\n closeModalAndSetValue: PropTypes.func\n};\n\nFileUploadModal.defaultProps = {\n onClose: () => {},\n closeModalAndSetValue: () => {},\n simpleLayout: false\n};\n\nexport default FileUploadModal;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,aAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAAkD,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE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AO,EAAEA,OAAQ;IACjBwF,KAAK,EAAC,WAAW;IACjBC,OAAO,EAAE,CACP;MACEC,UAAU,EAAE,QAAQ;MACpBC,QAAQ,EAAE3F,OAAO;MACjB4F,SAAS,EAAE,CAAC,QAAQ;IACtB,CAAC,EACD;MACEF,UAAU,EAAE,MAAM;MAClBC,QAAQ,EAAEf,YAAY;MACtBgB,SAAS,EAAE;IACb,CAAC,CACD;IACFC,MAAM;EAAA,gBACN7H,MAAA,YAAAqH,aAAA,CAACjH,WAAA,WAAU;IAAC0H,QAAQ,EAAEhE,WAAY;IAACiE,aAAa,EAAEb;EAAa,CAAE,CAC5D,CACP,CAAC;AAEP,CAAC;AAEDpF,eAAe,CAACkG,SAAS,GAAG;EAC1B/F,gBAAgB,EAAEgG,qBAAS,CAACC,IAAI,CAACC,UAAU;EAC3CnG,OAAO,EAAEiG,qBAAS,CAACC,IAAI;EACvB/F,YAAY,EAAE8F,qBAAS,CAACG,IAAI;EAC5BlG,qBAAqB,EAAE+F,qBAAS,CAACC;AACnC,CAAC;AAEDpG,eAAe,CAACuG,YAAY,GAAG;EAC7BrG,OAAO,EAAE,SAATA,OAAOA,CAAA,EAAQ,CAAC,CAAC;EACjBE,qBAAqB,EAAE,SAAvBA,qBAAqBA,CAAA,EAAQ,CAAC,CAAC;EAC/BC,YAAY,EAAE;AAChB,CAAC;AAAC,IAAAmG,QAAA,GAAAC,OAAA,cAEazG,eAAe","ignoreList":[]}
1
+ {"version":3,"file":"FileUploadModal.js","names":["_react","_interopRequireWildcard","require","_adminUiUtils","_fileUpload","_interopRequireDefault","_propTypes","_toaster","_client","_useFileList","_excluded","_excluded2","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","ownKeys","keys","getOwnPropertySymbols","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","FileUploadModal","onClose","getSelectedFiles","closeModalAndSetValue","simpleLayout","fileId","storeKey","selectedStoreKey","files","setFiles","useState","addToast","useToasts","client","useApolloClient","addNewFile","useFileList","fileStoresType","getQuery","data","getFileStores","storeType","useQuery","variables","visibleInAdmin","handleFiles","filesToUpload","uploadFiles","filesToProcess","response","Promise","all","map","file","name","fileStoreKey","payload","id","filename","mutate","mutation","getMutation","input","catch","error","message","appearance","autoDismiss","parsedResponse","_ref","result","rest","_objectWithoutProperties2","fileNames","_parsedResponse$","updatedFile","writeQuery","query","console","updateMessage","filesToSelect","uploadMessage","join","toastMessage","handleOnSave","storeOptions","type","key","createElement","ModalAdapter","title","actions","textButton","callback","modifiers","upload","onChange","selectOptions","propTypes","PropTypes","string","func","isRequired","bool","defaultProps","_default","exports"],"sources":["../../../src/components/FileUploadModal/FileUploadModal.js"],"sourcesContent":["import React, { useState } from 'react';\nimport { ModalAdapter as Modal, getMutation, getQuery } from '@blaze-cms/admin-ui-utils';\nimport FileUpload from '@blaze-react/file-upload';\nimport PropTypes from 'prop-types';\nimport { useToasts } from '@blaze-react/toaster';\nimport { useApolloClient, useQuery } from '@apollo/client';\nimport useFileList from '../FileList/useFileList';\n\nconst FileUploadModal = ({\n onClose,\n getSelectedFiles,\n closeModalAndSetValue,\n simpleLayout,\n fileId,\n storeKey,\n selectedStoreKey\n}) => {\n const [files, setFiles] = useState([]);\n const { addToast } = useToasts();\n const client = useApolloClient();\n const { addNewFile } = useFileList();\n\n const fileStoresType = getQuery('GET_FILE_STORES');\n const { data: { getFileStores: storeType = [] } = {} } = useQuery(fileStoresType, {\n variables: { visibleInAdmin: true }\n });\n\n const handleFiles = filesToUpload => {\n if (fileId && filesToUpload && filesToUpload.length) {\n setFiles([filesToUpload[0]]);\n return;\n }\n setFiles(filesToUpload);\n };\n\n const uploadFiles = async () => {\n const filesToProcess = fileId && files.length ? [files[0]] : files;\n\n const response = await Promise.all(\n filesToProcess.map(({ file, name, data, storeKey: fileStoreKey }) => {\n const payload = {\n name,\n storeKey: fileStoreKey || selectedStoreKey || storeKey,\n data\n };\n if (fileId) {\n payload.id = fileId;\n } else if (!name) {\n payload.name = file.filename;\n }\n return client.mutate({\n mutation: getMutation('UPLOAD_FILE'),\n variables: { input: { file, ...payload } }\n });\n })\n ).catch(error => {\n addToast(error.message, {\n appearance: 'error',\n autoDismiss: true\n });\n return [];\n });\n\n const parsedResponse = response.map(({ data: { file } }) => {\n const { message, ...rest } = file.result || {};\n return rest;\n });\n\n const fileNames = files.map(({ file }) => file.name);\n\n if (simpleLayout) {\n if (fileId && parsedResponse && parsedResponse.length) {\n const { message, ...updatedFile } = parsedResponse[0];\n try {\n client.writeQuery({\n query: getQuery('GET_FILE_BY_ID'),\n variables: { id: fileId },\n data: { file: updatedFile }\n });\n } catch (e) {\n console.error(e); //eslint-disable-line\n }\n const updateMessage = `Updated: ${updatedFile.filename || fileNames[0]}`;\n closeModalAndSetValue(simpleLayout, updatedFile, updateMessage);\n return;\n }\n const filesToSelect = parsedResponse.map(({ id }) => id);\n const uploadMessage = `Uploaded: ${fileNames.join(', ')}`;\n getSelectedFiles(null, filesToSelect);\n closeModalAndSetValue(simpleLayout, filesToSelect, uploadMessage);\n return;\n }\n\n addNewFile && addNewFile(parsedResponse);\n const toastMessage = fileId ? `Updated: ${fileNames[0]}` : `Uploaded: ${fileNames.join(', ')}`;\n\n addToast(toastMessage, {\n appearance: 'success',\n autoDismiss: true\n });\n };\n\n const handleOnSave = async () => {\n if (files.length) await uploadFiles();\n onClose();\n };\n\n let storeOptions = storeType.map(type => [type.key, type.name]);\n storeOptions = storeKey ? storeOptions.filter(([key]) => key === storeKey) : storeOptions;\n\n return (\n <Modal\n onClose={onClose}\n title=\"Add media\"\n actions={[\n {\n textButton: 'Cancel',\n callback: onClose,\n modifiers: ['cancel']\n },\n {\n textButton: 'Upload',\n callback: handleOnSave,\n modifiers: []\n }\n ]}\n upload>\n <FileUpload\n storeKey={selectedStoreKey || storeKey}\n onChange={handleFiles}\n selectOptions={storeOptions}\n />\n </Modal>\n );\n};\n\nFileUploadModal.propTypes = {\n fileId: PropTypes.string,\n getSelectedFiles: PropTypes.func.isRequired,\n onClose: PropTypes.func,\n simpleLayout: PropTypes.bool,\n closeModalAndSetValue: PropTypes.func,\n storeKey: PropTypes.string,\n selectedStoreKey: PropTypes.string\n};\n\nFileUploadModal.defaultProps = {\n onClose: () => {},\n closeModalAndSetValue: () => {},\n simpleLayout: false,\n fileId: null,\n storeKey: null,\n selectedStoreKey: null\n};\n\nexport default FileUploadModal;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAJ,sBAAA,CAAAH,OAAA;AAAkD,MAAAQ,SAAA;EAAAC,UAAA;AAAA,SAAAV,wBAAAW,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAb,uBAAA,YAAAA,CAAAW,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OA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ACE,IAAI,CAACC,UAAU;EAC3CjF,OAAO,EAAE8E,kBAAS,CAACE,IAAI;EACvB7E,YAAY,EAAE2E,kBAAS,CAACI,IAAI;EAC5BhF,qBAAqB,EAAE4E,kBAAS,CAACE,IAAI;EACrC3E,QAAQ,EAAEyE,kBAAS,CAACC,MAAM;EAC1BzE,gBAAgB,EAAEwE,kBAAS,CAACC;AAC9B,CAAC;AAEDhF,eAAe,CAACoF,YAAY,GAAG;EAC7BnF,OAAO,EAAEA,CAAA,KAAM,CAAC,CAAC;EACjBE,qBAAqB,EAAEA,CAAA,KAAM,CAAC,CAAC;EAC/BC,YAAY,EAAE,KAAK;EACnBC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,IAAI;EACdC,gBAAgB,EAAE;AACpB,CAAC;AAAC,IAAA8E,QAAA,GAAAC,OAAA,CAAA7G,OAAA,GAEauB,eAAe","ignoreList":[]}
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports["default"] = void 0;
7
+ exports.default = void 0;
9
8
  var _FileUploadModal = _interopRequireDefault(require("./FileUploadModal"));
10
- var _default = exports["default"] = _FileUploadModal["default"];
9
+ var _default = exports.default = _FileUploadModal.default;
11
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_FileUploadModal","_interopRequireDefault","require","_default","exports","FileUploadModal"],"sources":["../../../src/components/FileUploadModal/index.js"],"sourcesContent":["import FileUploadModal from './FileUploadModal';\n\nexport default FileUploadModal;\n"],"mappings":";;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAgD,IAAAC,QAAA,GAAAC,OAAA,cAEjCC,2BAAe","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_FileUploadModal","_interopRequireDefault","require","_default","exports","default","FileUploadModal"],"sources":["../../../src/components/FileUploadModal/index.js"],"sourcesContent":["import FileUploadModal from './FileUploadModal';\n\nexport default FileUploadModal;\n"],"mappings":";;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAgD,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEjCC,wBAAe","ignoreList":[]}