@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,206 +1,185 @@
1
1
  "use strict";
2
2
 
3
- require("core-js/modules/es.object.define-property.js");
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
- exports["default"] = void 0;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- require("core-js/modules/es.array.concat.js");
11
- require("core-js/modules/es.array.includes.js");
12
- require("core-js/modules/es.array.map.js");
13
- require("core-js/modules/es.object.to-string.js");
14
- require("core-js/modules/es.string.includes.js");
15
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
16
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
6
+ exports.default = void 0;
17
7
  var _adminUiUtils = require("@blaze-cms/admin-ui-utils");
18
8
  var _constants = require("../../../constants");
19
- var getFromSearch = /*#__PURE__*/function () {
20
- var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
21
- var searchTerm, offset, limit, where, client, _ref$fileStores, fileStores, allTypesMatches, matchSpecificType, match, mustMatch, storeKeys, _yield$client$query, _yield$client$query$d, files, all, image, video, text;
22
- return _regenerator["default"].wrap(function _callee$(_context) {
23
- while (1) switch (_context.prev = _context.next) {
24
- case 0:
25
- searchTerm = _ref.searchTerm, offset = _ref.offset, limit = _ref.limit, where = _ref.where, client = _ref.client, _ref$fileStores = _ref.fileStores, fileStores = _ref$fileStores === void 0 ? [] : _ref$fileStores;
26
- allTypesMatches = [{
27
- match: {
28
- type: 'image'
29
- }
30
- }, {
31
- match: {
32
- type: 'video'
33
- }
34
- }, {
35
- match: {
36
- type: 'text'
37
- }
38
- }];
39
- matchSpecificType = [{
40
- match: {
41
- type: where.type
42
- }
43
- }];
44
- match = !where.type || where.type === _constants.ALL ? allTypesMatches : matchSpecificType;
45
- mustMatch = [];
46
- if (searchTerm) {
47
- mustMatch.push({
48
- simple_query_string: {
49
- query: "".concat(searchTerm, "*"),
50
- analyze_wildcard: true,
51
- fields: ['name', 'filename', 'data.altText', 'data.caption', 'data.title', 'data.credits']
9
+ const getFromSearch = async ({
10
+ searchTerm,
11
+ offset,
12
+ limit,
13
+ where,
14
+ client,
15
+ fileStores = []
16
+ }) => {
17
+ const allTypesMatches = [{
18
+ match: {
19
+ type: 'image'
20
+ }
21
+ }, {
22
+ match: {
23
+ type: 'video'
24
+ }
25
+ }, {
26
+ match: {
27
+ type: 'text'
28
+ }
29
+ }];
30
+ const matchSpecificType = [{
31
+ match: {
32
+ type: where.type
33
+ }
34
+ }];
35
+ const match = !where.type || where.type === _constants.ALL ? allTypesMatches : matchSpecificType;
36
+ const mustMatch = [];
37
+ if (searchTerm) {
38
+ mustMatch.push({
39
+ simple_query_string: {
40
+ query: `${searchTerm}*`,
41
+ analyze_wildcard: true,
42
+ fields: ['name', 'filename', 'data.altText', 'data.caption', 'data.title', 'data.credits']
43
+ }
44
+ });
45
+ }
46
+ const storeKeys = [];
47
+ if (_constants.INVALID_STORE_KEY_VALUES.includes(where.storeKey)) {
48
+ storeKeys.push(...fileStores.map(({
49
+ key
50
+ }) => key));
51
+ } else if (where.storeKey) {
52
+ storeKeys.push(where.storeKey);
53
+ }
54
+ mustMatch.push({
55
+ bool: {
56
+ should: storeKeys.map(storeKey => ({
57
+ match: {
58
+ storeKey
59
+ }
60
+ })),
61
+ minimum_should_match: 1
62
+ }
63
+ });
64
+ const {
65
+ data: {
66
+ files: {
67
+ results: files
68
+ },
69
+ all,
70
+ image,
71
+ video,
72
+ text
73
+ }
74
+ } = await client.query({
75
+ query: (0, _adminUiUtils.getQuery)('SEARCH_ADMIN_MEDIA'),
76
+ fetchPolicy: 'network-only',
77
+ variables: {
78
+ offset,
79
+ limit,
80
+ sort: searchTerm ? null : 'updated:desc',
81
+ rawQuery: {
82
+ query: {
83
+ bool: {
84
+ must: [...mustMatch, {
85
+ bool: {
86
+ should: match
52
87
  }
53
- });
54
- }
55
- storeKeys = [];
56
- if (_constants.INVALID_STORE_KEY_VALUES.includes(where.storeKey)) {
57
- storeKeys.push.apply(storeKeys, (0, _toConsumableArray2["default"])(fileStores.map(function (_ref3) {
58
- var key = _ref3.key;
59
- return key;
60
- })));
61
- } else if (where.storeKey) {
62
- storeKeys.push(where.storeKey);
88
+ }]
63
89
  }
64
- mustMatch.push({
65
- bool: {
66
- should: storeKeys.map(function (storeKey) {
67
- return {
90
+ }
91
+ },
92
+ rawQueryAllResults: {
93
+ query: {
94
+ bool: {
95
+ must: [...mustMatch, {
96
+ bool: {
97
+ should: [{
68
98
  match: {
69
- storeKey: storeKey
99
+ type: 'image'
70
100
  }
71
- };
72
- }),
73
- minimum_should_match: 1
74
- }
75
- });
76
- _context.next = 11;
77
- return client.query({
78
- query: (0, _adminUiUtils.getQuery)('SEARCH_ADMIN_MEDIA'),
79
- fetchPolicy: 'network-only',
80
- variables: {
81
- offset: offset,
82
- limit: limit,
83
- sort: searchTerm ? null : 'updated:desc',
84
- rawQuery: {
85
- query: {
86
- bool: {
87
- must: [].concat(mustMatch, [{
88
- bool: {
89
- should: match
90
- }
91
- }])
101
+ }, {
102
+ match: {
103
+ type: 'video'
92
104
  }
93
- }
94
- },
95
- rawQueryAllResults: {
96
- query: {
97
- bool: {
98
- must: [].concat(mustMatch, [{
99
- bool: {
100
- should: [{
101
- match: {
102
- type: 'image'
103
- }
104
- }, {
105
- match: {
106
- type: 'video'
107
- }
108
- }, {
109
- match: {
110
- type: 'text'
111
- }
112
- }]
113
- }
114
- }])
105
+ }, {
106
+ match: {
107
+ type: 'text'
115
108
  }
116
- }
117
- },
118
- rawQueryImages: {
119
- query: {
120
- bool: {
121
- must: [].concat(mustMatch, [{
122
- bool: {
123
- should: [{
124
- match: {
125
- type: 'image'
126
- }
127
- }]
128
- }
129
- }])
109
+ }]
110
+ }
111
+ }]
112
+ }
113
+ }
114
+ },
115
+ rawQueryImages: {
116
+ query: {
117
+ bool: {
118
+ must: [...mustMatch, {
119
+ bool: {
120
+ should: [{
121
+ match: {
122
+ type: 'image'
130
123
  }
131
- }
132
- },
133
- rawQueryVideos: {
134
- query: {
135
- bool: {
136
- must: [].concat(mustMatch, [{
137
- bool: {
138
- should: [{
139
- match: {
140
- type: 'video'
141
- }
142
- }]
143
- }
144
- }])
124
+ }]
125
+ }
126
+ }]
127
+ }
128
+ }
129
+ },
130
+ rawQueryVideos: {
131
+ query: {
132
+ bool: {
133
+ must: [...mustMatch, {
134
+ bool: {
135
+ should: [{
136
+ match: {
137
+ type: 'video'
145
138
  }
146
- }
147
- },
148
- rawQueryDocs: {
149
- query: {
150
- bool: {
151
- must: [].concat(mustMatch, [{
152
- bool: {
153
- should: [{
154
- match: {
155
- type: 'text'
156
- }
157
- }]
158
- }
159
- }])
139
+ }]
140
+ }
141
+ }]
142
+ }
143
+ }
144
+ },
145
+ rawQueryDocs: {
146
+ query: {
147
+ bool: {
148
+ must: [...mustMatch, {
149
+ bool: {
150
+ should: [{
151
+ match: {
152
+ type: 'text'
160
153
  }
161
- }
154
+ }]
162
155
  }
163
- }
164
- });
165
- case 11:
166
- _yield$client$query = _context.sent;
167
- _yield$client$query$d = _yield$client$query.data;
168
- files = _yield$client$query$d.files.results;
169
- all = _yield$client$query$d.all;
170
- image = _yield$client$query$d.image;
171
- video = _yield$client$query$d.video;
172
- text = _yield$client$query$d.text;
173
- return _context.abrupt("return", {
174
- files: files,
175
- all: all,
176
- image: image,
177
- video: video,
178
- text: text
179
- });
180
- case 19:
181
- case "end":
182
- return _context.stop();
156
+ }]
157
+ }
158
+ }
183
159
  }
184
- }, _callee);
185
- }));
186
- return function getFromSearch(_x) {
187
- return _ref2.apply(this, arguments);
188
- };
189
- }();
190
- var getFiles = function getFiles(_ref4, client) {
191
- var offset = _ref4.offset,
192
- limit = _ref4.limit,
193
- where = _ref4.where,
194
- searchTerm = _ref4.searchTerm,
195
- fileStores = _ref4.fileStores;
196
- return getFromSearch({
197
- searchTerm: searchTerm,
198
- offset: offset,
199
- limit: limit,
200
- where: where,
201
- client: client,
202
- fileStores: fileStores
160
+ }
203
161
  });
162
+ return {
163
+ files,
164
+ all,
165
+ image,
166
+ video,
167
+ text
168
+ };
204
169
  };
205
- var _default = exports["default"] = getFiles;
170
+ const getFiles = ({
171
+ offset,
172
+ limit,
173
+ where,
174
+ searchTerm,
175
+ fileStores
176
+ }, client) => getFromSearch({
177
+ searchTerm,
178
+ offset,
179
+ limit,
180
+ where,
181
+ client,
182
+ fileStores
183
+ });
184
+ var _default = exports.default = getFiles;
206
185
  //# sourceMappingURL=getFiles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getFiles.js","names":["_adminUiUtils","require","_constants","getFromSearch","_ref2","_asyncToGenerator2","_regenerator","mark","_callee","_ref","searchTerm","offset","limit","where","client","_ref$fileStores","fileStores","allTypesMatches","matchSpecificType","match","mustMatch","storeKeys","_yield$client$query","_yield$client$query$d","files","all","image","video","text","wrap","_callee$","_context","prev","next","type","ALL","push","simple_query_string","query","concat","analyze_wildcard","fields","INVALID_STORE_KEY_VALUES","includes","storeKey","apply","_toConsumableArray2","map","_ref3","key","bool","should","minimum_should_match","getQuery","fetchPolicy","variables","sort","rawQuery","must","rawQueryAllResults","rawQueryImages","rawQueryVideos","rawQueryDocs","sent","data","results","abrupt","stop","_x","arguments","getFiles","_ref4","_default","exports"],"sources":["../../../../src/components/FileList/useGetFiles/getFiles.js"],"sourcesContent":["import { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { ALL, INVALID_STORE_KEY_VALUES } from '../../../constants';\n\nconst getFromSearch = async ({ searchTerm, offset, limit, where, client, fileStores = [] }) => {\n const allTypesMatches = [\n {\n match: { type: 'image' }\n },\n {\n match: { type: 'video' }\n },\n {\n match: { type: 'text' }\n }\n ];\n const matchSpecificType = [\n {\n match: { type: where.type }\n }\n ];\n const match = !where.type || where.type === ALL ? allTypesMatches : matchSpecificType;\n const mustMatch = [];\n\n if (searchTerm) {\n mustMatch.push({\n simple_query_string: {\n query: `${searchTerm}*`,\n analyze_wildcard: true,\n fields: ['name', 'filename', 'data.altText', 'data.caption', 'data.title', 'data.credits']\n }\n });\n }\n\n const storeKeys = [];\n if (INVALID_STORE_KEY_VALUES.includes(where.storeKey)) {\n storeKeys.push(...fileStores.map(({ key }) => key));\n } else if (where.storeKey) {\n storeKeys.push(where.storeKey);\n }\n\n mustMatch.push({\n bool: {\n should: storeKeys.map(storeKey => ({\n match: { storeKey }\n })),\n minimum_should_match: 1\n }\n });\n\n const {\n data: {\n files: { results: files },\n all,\n image,\n video,\n text\n }\n } = await client.query({\n query: getQuery('SEARCH_ADMIN_MEDIA'),\n fetchPolicy: 'network-only',\n variables: {\n offset,\n limit,\n sort: searchTerm ? null : 'updated:desc',\n rawQuery: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: match\n }\n }\n ]\n }\n }\n },\n rawQueryAllResults: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: [\n {\n match: { type: 'image' }\n },\n {\n match: { type: 'video' }\n },\n {\n match: { type: 'text' }\n }\n ]\n }\n }\n ]\n }\n }\n },\n rawQueryImages: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: [\n {\n match: { type: 'image' }\n }\n ]\n }\n }\n ]\n }\n }\n },\n rawQueryVideos: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: [\n {\n match: { type: 'video' }\n }\n ]\n }\n }\n ]\n }\n }\n },\n rawQueryDocs: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: [\n {\n match: { type: 'text' }\n }\n ]\n }\n }\n ]\n }\n }\n }\n }\n });\n\n return { files, all, image, video, text };\n};\n\nconst getFiles = ({ offset, limit, where, searchTerm, fileStores }, client) =>\n getFromSearch({ searchTerm, offset, limit, where, client, fileStores });\n\nexport default getFiles;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAME,aAAa;EAAA,IAAAC,KAAA,OAAAC,kBAAA,0BAAAC,YAAA,YAAAC,IAAA,CAAG,SAAAC,QAAAC,IAAA;IAAA,IAAAC,UAAA,EAAAC,MAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,eAAA,EAAAC,UAAA,EAAAC,eAAA,EAAAC,iBAAA,EAAAC,KAAA,EAAAC,SAAA,EAAAC,SAAA,EAAAC,mBAAA,EAAAC,qBAAA,EAAAC,KAAA,EAAAC,GAAA,EAAAC,KAAA,EAAAC,KAAA,EAAAC,IAAA;IAAA,OAAAtB,YAAA,YAAAuB,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAASvB,UAAU,GAAAD,IAAA,CAAVC,UAAU,EAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM,EAAEC,KAAK,GAAAH,IAAA,CAALG,KAAK,EAAEC,KAAK,GAAAJ,IAAA,CAALI,KAAK,EAAEC,MAAM,GAAAL,IAAA,CAANK,MAAM,EAAAC,eAAA,GAAAN,IAAA,CAAEO,UAAU,EAAVA,UAAU,GAAAD,eAAA,cAAG,EAAE,GAAAA,eAAA;UAChFE,eAAe,GAAG,CACtB;YACEE,KAAK,EAAE;cAAEe,IAAI,EAAE;YAAQ;UACzB,CAAC,EACD;YACEf,KAAK,EAAE;cAAEe,IAAI,EAAE;YAAQ;UACzB,CAAC,EACD;YACEf,KAAK,EAAE;cAAEe,IAAI,EAAE;YAAO;UACxB,CAAC,CACF;UACKhB,iBAAiB,GAAG,CACxB;YACEC,KAAK,EA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AAU,GAAA6D,KAAA,CAAV7D,UAAU;IAAEM,UAAU,GAAAuD,KAAA,CAAVvD,UAAU;EAAA,OAC9Db,aAAa,CAAC;IAAEO,UAAU,EAAVA,UAAU;IAAEC,MAAM,EAANA,MAAM;IAAEC,KAAK,EAALA,KAAK;IAAEC,KAAK,EAALA,KAAK;IAAEC,MAAM,EAANA,MAAM;IAAEE,UAAU,EAAVA;EAAW,CAAC,CAAC;AAAA;AAAC,IAAAwD,QAAA,GAAAC,OAAA,cAE3DH,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"getFiles.js","names":["_adminUiUtils","require","_constants","getFromSearch","searchTerm","offset","limit","where","client","fileStores","allTypesMatches","match","type","matchSpecificType","ALL","mustMatch","push","simple_query_string","query","analyze_wildcard","fields","storeKeys","INVALID_STORE_KEY_VALUES","includes","storeKey","map","key","bool","should","minimum_should_match","data","files","results","all","image","video","text","getQuery","fetchPolicy","variables","sort","rawQuery","must","rawQueryAllResults","rawQueryImages","rawQueryVideos","rawQueryDocs","getFiles","_default","exports","default"],"sources":["../../../../src/components/FileList/useGetFiles/getFiles.js"],"sourcesContent":["import { getQuery } from '@blaze-cms/admin-ui-utils';\nimport { ALL, INVALID_STORE_KEY_VALUES } from '../../../constants';\n\nconst getFromSearch = async ({ searchTerm, offset, limit, where, client, fileStores = [] }) => {\n const allTypesMatches = [\n {\n match: { type: 'image' }\n },\n {\n match: { type: 'video' }\n },\n {\n match: { type: 'text' }\n }\n ];\n const matchSpecificType = [\n {\n match: { type: where.type }\n }\n ];\n const match = !where.type || where.type === ALL ? allTypesMatches : matchSpecificType;\n const mustMatch = [];\n\n if (searchTerm) {\n mustMatch.push({\n simple_query_string: {\n query: `${searchTerm}*`,\n analyze_wildcard: true,\n fields: ['name', 'filename', 'data.altText', 'data.caption', 'data.title', 'data.credits']\n }\n });\n }\n\n const storeKeys = [];\n if (INVALID_STORE_KEY_VALUES.includes(where.storeKey)) {\n storeKeys.push(...fileStores.map(({ key }) => key));\n } else if (where.storeKey) {\n storeKeys.push(where.storeKey);\n }\n\n mustMatch.push({\n bool: {\n should: storeKeys.map(storeKey => ({\n match: { storeKey }\n })),\n minimum_should_match: 1\n }\n });\n\n const {\n data: {\n files: { results: files },\n all,\n image,\n video,\n text\n }\n } = await client.query({\n query: getQuery('SEARCH_ADMIN_MEDIA'),\n fetchPolicy: 'network-only',\n variables: {\n offset,\n limit,\n sort: searchTerm ? null : 'updated:desc',\n rawQuery: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: match\n }\n }\n ]\n }\n }\n },\n rawQueryAllResults: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: [\n {\n match: { type: 'image' }\n },\n {\n match: { type: 'video' }\n },\n {\n match: { type: 'text' }\n }\n ]\n }\n }\n ]\n }\n }\n },\n rawQueryImages: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: [\n {\n match: { type: 'image' }\n }\n ]\n }\n }\n ]\n }\n }\n },\n rawQueryVideos: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: [\n {\n match: { type: 'video' }\n }\n ]\n }\n }\n ]\n }\n }\n },\n rawQueryDocs: {\n query: {\n bool: {\n must: [\n ...mustMatch,\n {\n bool: {\n should: [\n {\n match: { type: 'text' }\n }\n ]\n }\n }\n ]\n }\n }\n }\n }\n });\n\n return { files, all, image, video, text };\n};\n\nconst getFiles = ({ offset, limit, where, searchTerm, fileStores }, client) =>\n getFromSearch({ searchTerm, offset, limit, where, client, fileStores });\n\nexport default getFiles;\n"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAEA,MAAME,aAAa,GAAG,MAAAA,CAAO;EAAEC,UAAU;EAAEC,MAAM;EAAEC,KAAK;EAAEC,KAAK;EAAEC,MAAM;EAAEC,UAAU,GAAG;AAAG,CAAC,KAAK;EAC7F,MAAMC,eAAe,GAAG,CACtB;IACEC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AAE,CACJ,GAAG3B,SAAS,EACZ;cACEY,IAAI,EAAE;gBACJC,MAAM,EAAE,CACN;kBACEjB,KAAK,EAAE;oBAAEC,IAAI,EAAE;kBAAQ;gBACzB,CAAC;cAEL;YACF,CAAC;UAEL;QACF;MACF,CAAC;MACDkC,YAAY,EAAE;QACZ5B,KAAK,EAAE;UACLS,IAAI,EAAE;YACJe,IAAI,EAAE,CACJ,GAAG3B,SAAS,EACZ;cACEY,IAAI,EAAE;gBACJC,MAAM,EAAE,CACN;kBACEjB,KAAK,EAAE;oBAAEC,IAAI,EAAE;kBAAO;gBACxB,CAAC;cAEL;YACF,CAAC;UAEL;QACF;MACF;IACF;EACF,CAAC,CAAC;EAEF,OAAO;IAAEmB,KAAK;IAAEE,GAAG;IAAEC,KAAK;IAAEC,KAAK;IAAEC;EAAK,CAAC;AAC3C,CAAC;AAED,MAAMW,QAAQ,GAAGA,CAAC;EAAE1C,MAAM;EAAEC,KAAK;EAAEC,KAAK;EAAEH,UAAU;EAAEK;AAAW,CAAC,EAAED,MAAM,KACxEL,aAAa,CAAC;EAAEC,UAAU;EAAEC,MAAM;EAAEC,KAAK;EAAEC,KAAK;EAAEC,MAAM;EAAEC;AAAW,CAAC,CAAC;AAAC,IAAAuC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAE3DH,QAAQ","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 _useGetFiles = _interopRequireDefault(require("./useGetFiles"));
10
- var _default = exports["default"] = _useGetFiles["default"];
9
+ var _default = exports.default = _useGetFiles.default;
11
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_useGetFiles","_interopRequireDefault","require","_default","exports","useGetFiles"],"sources":["../../../../src/components/FileList/useGetFiles/index.js"],"sourcesContent":["import useGetFiles from './useGetFiles';\n\nexport default useGetFiles;\n"],"mappings":";;;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwC,IAAAC,QAAA,GAAAC,OAAA,cAEzBC,uBAAW","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_useGetFiles","_interopRequireDefault","require","_default","exports","default","useGetFiles"],"sources":["../../../../src/components/FileList/useGetFiles/index.js"],"sourcesContent":["import useGetFiles from './useGetFiles';\n\nexport default useGetFiles;\n"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAwC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEzBC,oBAAW","ignoreList":[]}