@scaleflex/widget-explorer 4.3.0 → 4.4.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 (564) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +8 -8
  3. package/dist/style.css +0 -2197
  4. package/dist/style.min.css +0 -1
  5. package/lib/Explorer.styled.js +0 -48
  6. package/lib/components/ActionBar/ActionBar.styled.js +0 -103
  7. package/lib/components/ActionBar/DownloadWithExportButton.js +0 -203
  8. package/lib/components/ActionBar/SelectionMenu.js +0 -111
  9. package/lib/components/ActionBar/index.js +0 -105
  10. package/lib/components/AddFilesPanel/AddFiles.js +0 -183
  11. package/lib/components/AddFilesPanel/AddFiles.styled.js +0 -137
  12. package/lib/components/AddFilesPanel/index.js +0 -59
  13. package/lib/components/AiSwitcher/AiSwitcher.constants.js +0 -1
  14. package/lib/components/AiSwitcher/AiSwitcher.styled.js +0 -24
  15. package/lib/components/AiSwitcher/index.js +0 -81
  16. package/lib/components/AssetsList/AssetsList.styled.js +0 -217
  17. package/lib/components/AssetsList/GridView/FilesAccordion.js +0 -76
  18. package/lib/components/AssetsList/GridView/FilesSection/FileCell.js +0 -260
  19. package/lib/components/AssetsList/GridView/FilesSection/FileOverlayOptions.js +0 -140
  20. package/lib/components/AssetsList/GridView/FilesSection/FilesSection.styled.js +0 -15
  21. package/lib/components/AssetsList/GridView/FilesSection/index.js +0 -31
  22. package/lib/components/AssetsList/GridView/FilesSkeleton.js +0 -47
  23. package/lib/components/AssetsList/GridView/FoldersSection/FolderCell.js +0 -239
  24. package/lib/components/AssetsList/GridView/FoldersSection/FolderPreviewGrid.js +0 -106
  25. package/lib/components/AssetsList/GridView/FoldersSection/FolderTopOptions.js +0 -70
  26. package/lib/components/AssetsList/GridView/FoldersSection/index.js +0 -23
  27. package/lib/components/AssetsList/GridView/FoldersSkeleton.js +0 -77
  28. package/lib/components/AssetsList/GridView/GridView.styled.js +0 -11
  29. package/lib/components/AssetsList/GridView/SearchGridView/SearchGridView.styled.js +0 -15
  30. package/lib/components/AssetsList/GridView/SearchGridView/SearchGridViewSkeleton.js +0 -30
  31. package/lib/components/AssetsList/GridView/SearchGridView/index.js +0 -97
  32. package/lib/components/AssetsList/GridView/index.js +0 -196
  33. package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableHeader.js +0 -152
  34. package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableRow.js +0 -333
  35. package/lib/components/AssetsList/ListView/AssetsSection/index.js +0 -99
  36. package/lib/components/AssetsList/ListView/ColumnsMenu.js +0 -89
  37. package/lib/components/AssetsList/ListView/FilesAccordion.js +0 -74
  38. package/lib/components/AssetsList/ListView/FilesSkeleton.js +0 -68
  39. package/lib/components/AssetsList/ListView/FoldersSection/FoldersSectionTableHeader.js +0 -98
  40. package/lib/components/AssetsList/ListView/FoldersSection/FoldersSectionTableRow.js +0 -156
  41. package/lib/components/AssetsList/ListView/FoldersSection/index.js +0 -54
  42. package/lib/components/AssetsList/ListView/FoldersSkeleton.js +0 -67
  43. package/lib/components/AssetsList/ListView/ListView.styled.js +0 -181
  44. package/lib/components/AssetsList/ListView/ListView.utils.js +0 -30
  45. package/lib/components/AssetsList/ListView/SearchListView/index.js +0 -109
  46. package/lib/components/AssetsList/ListView/index.js +0 -203
  47. package/lib/components/AssetsList/ScrollToTop.js +0 -70
  48. package/lib/components/AssetsList/SearchView.hook.js +0 -241
  49. package/lib/components/AssetsList/__SearchTestPannel.js +0 -238
  50. package/lib/components/AssetsList/__SearchTestPannel.mock.js +0 -1
  51. package/lib/components/AssetsList/index.js +0 -266
  52. package/lib/components/AssetsList/relevanceBadge.js +0 -15
  53. package/lib/components/AssetsView/AssetsView.styled.js +0 -25
  54. package/lib/components/AssetsView/AssetsView.thunks.js +0 -64
  55. package/lib/components/AssetsView/index.js +0 -142
  56. package/lib/components/AuthExplorerView.js +0 -79
  57. package/lib/components/Breadcrumbs/BreadCrumbViews/BreadCrumbsViews.styled.js +0 -30
  58. package/lib/components/Breadcrumbs/BreadCrumbViews/index.js +0 -32
  59. package/lib/components/Breadcrumbs/Breadcrumb.js +0 -52
  60. package/lib/components/Breadcrumbs/Breadcrumbs.styled.js +0 -81
  61. package/lib/components/Breadcrumbs/BreadcrumbsSkeleton.js +0 -12
  62. package/lib/components/Breadcrumbs/index.js +0 -187
  63. package/lib/components/BulkEditPanel/BulkEdit.js +0 -330
  64. package/lib/components/BulkEditPanel/BulkEditPanel.styled.js +0 -62
  65. package/lib/components/BulkEditPanel/BulkEditPanel.utils.js +0 -55
  66. package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.constants.js +0 -29
  67. package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.js +0 -148
  68. package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.styled.js +0 -81
  69. package/lib/components/BulkEditPanel/components/AssetsList/Columns/Columns.styled.js +0 -99
  70. package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileMetadataField.js +0 -263
  71. package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileTagField.js +0 -228
  72. package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileTextField.js +0 -107
  73. package/lib/components/BulkEditPanel/components/AssetsList/Columns/MetadataColumn.js +0 -142
  74. package/lib/components/BulkEditPanel/components/AssetsList/Columns/TableRow.js +0 -139
  75. package/lib/components/BulkEditPanel/components/AssetsList/Columns/TagsColumn.js +0 -58
  76. package/lib/components/BulkEditPanel/components/AssetsList/Columns/TagsField.js +0 -80
  77. package/lib/components/BulkEditPanel/components/AssetsList/Columns/TextColumn.js +0 -53
  78. package/lib/components/BulkEditPanel/components/AssetsList/Columns/columns.utils.js +0 -272
  79. package/lib/components/BulkEditPanel/components/AssetsList/Columns/getActiveColumn.js +0 -23
  80. package/lib/components/BulkEditPanel/components/AssetsList/FloatyPreview.js +0 -55
  81. package/lib/components/BulkEditPanel/components/AssetsList/FloatyPreview.styled.js +0 -21
  82. package/lib/components/BulkEditPanel/components/AssetsList/TableBody.js +0 -64
  83. package/lib/components/BulkEditPanel/components/AssetsList/TableHeader.js +0 -67
  84. package/lib/components/BulkEditPanel/components/BulkEditFooter.js +0 -33
  85. package/lib/components/BulkEditPanel/components/ConfirmationModal/ConfirmationModal.js +0 -47
  86. package/lib/components/BulkEditPanel/components/ConfirmationModal/ConfirmationModal.styled.js +0 -25
  87. package/lib/components/BulkEditPanel/components/MainContent/MainContent.js +0 -110
  88. package/lib/components/BulkEditPanel/components/MainContent/MainContent.styled.js +0 -12
  89. package/lib/components/BulkEditPanel/components/MainContent/index.js +0 -2
  90. package/lib/components/BulkEditPanel/components/Sidebar/Sidebar.styled.js +0 -53
  91. package/lib/components/BulkEditPanel/components/Sidebar/Sidebar.utils.js +0 -28
  92. package/lib/components/BulkEditPanel/components/Sidebar/index.js +0 -158
  93. package/lib/components/BulkEditPanel/components/Tabs/Metadata/Metadata.js +0 -246
  94. package/lib/components/BulkEditPanel/components/Tabs/Metadata/Metadata.styled.js +0 -17
  95. package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.js +0 -222
  96. package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.mixin.js +0 -20
  97. package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.styled.js +0 -123
  98. package/lib/components/BulkEditPanel/components/Tabs/Tags/TagsContianer.js +0 -31
  99. package/lib/components/BulkEditPanel/components/Tabs/Tags/TagsPaper.js +0 -95
  100. package/lib/components/BulkEditPanel/components/Tabs/Text/Text.js +0 -167
  101. package/lib/components/BulkEditPanel/components/Tabs/Text/Text.styled.js +0 -15
  102. package/lib/components/BulkEditPanel/components/Tabs/tabs.constants.js +0 -113
  103. package/lib/components/BulkEditPanel/components/Tabs/tabs.js +0 -43
  104. package/lib/components/BulkEditPanel/components/Tabs/tabs.utils.js +0 -239
  105. package/lib/components/BulkEditPanel/index.js +0 -28
  106. package/lib/components/ContextMenu/BeforeUploadMenu/index.js +0 -51
  107. package/lib/components/ContextMenu/ContextMenu.constants.js +0 -64
  108. package/lib/components/ContextMenu/ContextMenu.hooks.js +0 -35
  109. package/lib/components/ContextMenu/ContextMenu.styled.js +0 -107
  110. package/lib/components/ContextMenu/ContextMenuContent.js +0 -202
  111. package/lib/components/ContextMenu/ContextMenuItem.js +0 -142
  112. package/lib/components/ContextMenu/FileMenu/CollaborateSection/index.js +0 -33
  113. package/lib/components/ContextMenu/FileMenu/DeleteSection/index.js +0 -25
  114. package/lib/components/ContextMenu/FileMenu/EditSection/index.js +0 -42
  115. package/lib/components/ContextMenu/FileMenu/FindSection/index.js +0 -29
  116. package/lib/components/ContextMenu/FileMenu/index.js +0 -15
  117. package/lib/components/ContextMenu/FolderMenu/CollaborateSection/index.js +0 -17
  118. package/lib/components/ContextMenu/FolderMenu/DeleteSection/index.js +0 -41
  119. package/lib/components/ContextMenu/FolderMenu/EditSection/index.js +0 -49
  120. package/lib/components/ContextMenu/FolderMenu/FindSection/index.js +0 -49
  121. package/lib/components/ContextMenu/FolderMenu/FolderMenu.utils.js +0 -31
  122. package/lib/components/ContextMenu/FolderMenu/index.js +0 -14
  123. package/lib/components/ContextMenu/MenuOptions/AddVariationOption.js +0 -59
  124. package/lib/components/ContextMenu/MenuOptions/BulkEditOption.js +0 -47
  125. package/lib/components/ContextMenu/MenuOptions/CdnLinkOption.js +0 -54
  126. package/lib/components/ContextMenu/MenuOptions/DeleteOption.js +0 -70
  127. package/lib/components/ContextMenu/MenuOptions/DownloadOption.js +0 -88
  128. package/lib/components/ContextMenu/MenuOptions/EditImageOption.js +0 -63
  129. package/lib/components/ContextMenu/MenuOptions/EditVideoOption.js +0 -87
  130. package/lib/components/ContextMenu/MenuOptions/LocateFileOption.js +0 -45
  131. package/lib/components/ContextMenu/MenuOptions/ManagaAccessOption.js +0 -67
  132. package/lib/components/ContextMenu/MenuOptions/ManageDetailsOption.js +0 -52
  133. package/lib/components/ContextMenu/MenuOptions/MoveOption.js +0 -54
  134. package/lib/components/ContextMenu/MenuOptions/PreviewOption.js +0 -35
  135. package/lib/components/ContextMenu/MenuOptions/RenameOption.js +0 -66
  136. package/lib/components/ContextMenu/MenuOptions/TransformationOption.js +0 -63
  137. package/lib/components/ContextMenu/MultipleMenu/CollaborateSection/index.js +0 -31
  138. package/lib/components/ContextMenu/MultipleMenu/DeleteSection/index.js +0 -6
  139. package/lib/components/ContextMenu/MultipleMenu/EditSection/index.js +0 -14
  140. package/lib/components/ContextMenu/MultipleMenu/FindSection/index.js +0 -14
  141. package/lib/components/ContextMenu/MultipleMenu/index.js +0 -14
  142. package/lib/components/ContextMenu/SharedMenus/DownloadFolderSubMenu.js +0 -36
  143. package/lib/components/ContextMenu/SharedMenus/DownloadSubMenu.js +0 -70
  144. package/lib/components/ContextMenu/index.js +0 -34
  145. package/lib/components/ContextMenu/utils/calculateMenuHeight.js +0 -20
  146. package/lib/components/ContextMenu/utils/calculateMenuPosition.js +0 -42
  147. package/lib/components/ContextMenu/utils/createSeparator.js +0 -14
  148. package/lib/components/ContextMenu/utils/editMedia.js +0 -17
  149. package/lib/components/ContextMenu/utils/getFileLocation.js +0 -8
  150. package/lib/components/ContextMenu/utils/getFilteredOptions.js +0 -20
  151. package/lib/components/ContextMenu/utils/getProperFolderSelections.js +0 -7
  152. package/lib/components/ContextMenu/utils/isEmptyFolderSelection.js +0 -5
  153. package/lib/components/ContextMenu/utils/isFileContextMenu.js +0 -5
  154. package/lib/components/ContextMenu/utils/isFirstFileVisibilityPublic.js +0 -9
  155. package/lib/components/ContextMenu/utils/isMenuItemVisible.js +0 -5
  156. package/lib/components/ContextMenu/utils/isMixedFiles.js +0 -9
  157. package/lib/components/ContextMenu/utils/isMultipleSelection.js +0 -6
  158. package/lib/components/ContextMenu/utils/isSeparatorHidden.js +0 -7
  159. package/lib/components/ContextMenu/utils/triggerDownload.js +0 -45
  160. package/lib/components/CropPanel/CropOptions.js +0 -155
  161. package/lib/components/CropPanel/CropPanel.constants.js +0 -44
  162. package/lib/components/CropPanel/CropPanel.styled.js +0 -107
  163. package/lib/components/CropPanel/CropPanel.utils.js +0 -48
  164. package/lib/components/CropPanel/CropPanelContent.js +0 -209
  165. package/lib/components/CropPanel/ImageOptions.js +0 -326
  166. package/lib/components/CropPanel/ImageResize.js +0 -207
  167. package/lib/components/CropPanel/Option.js +0 -113
  168. package/lib/components/CropPanel/index.js +0 -22
  169. package/lib/components/Details/Details.constants.js +0 -75
  170. package/lib/components/Details/Details.utils.js +0 -232
  171. package/lib/components/Details/DetailsSideBar.styled.js +0 -139
  172. package/lib/components/Details/EditActionButtons/EditActionButtons.styled.js +0 -27
  173. package/lib/components/Details/EditActionButtons/index.js +0 -38
  174. package/lib/components/Details/FileDetails.js +0 -31
  175. package/lib/components/Details/FileItem/CustomMetadataTab.js +0 -50
  176. package/lib/components/Details/FileItem/FileItem.styled.js +0 -47
  177. package/lib/components/Details/FileItem/GeneralTab.js +0 -113
  178. package/lib/components/Details/FileItem/SharedFileEditData.js +0 -97
  179. package/lib/components/Details/FileItem/index.js +0 -2
  180. package/lib/components/Details/FolderDetails.js +0 -138
  181. package/lib/components/Details/FolderItemList/FolderListItem.js +0 -77
  182. package/lib/components/Details/FolderItemList/index.js +0 -62
  183. package/lib/components/Details/MultiItemsDetails.js +0 -69
  184. package/lib/components/Details/MultipleItems.js +0 -71
  185. package/lib/components/Details/TabChips.js +0 -51
  186. package/lib/components/Details/TabPanels.js +0 -42
  187. package/lib/components/Details/Title.js +0 -52
  188. package/lib/components/Details/index.js +0 -53
  189. package/lib/components/DnD/Dnd.styled.js +0 -11
  190. package/lib/components/DnD/DragImage.js +0 -61
  191. package/lib/components/DnD/index.js +0 -219
  192. package/lib/components/Drawer/Drawer.styled.js +0 -45
  193. package/lib/components/Drawer/Drawer.utils.js +0 -163
  194. package/lib/components/Drawer/Resizer.js +0 -141
  195. package/lib/components/Drawer/ResizerCore.js +0 -213
  196. package/lib/components/Drawer/index.js +0 -68
  197. package/lib/components/EmptyViewPlaceholder/EmptyViewPlaceholder.styled.js +0 -39
  198. package/lib/components/EmptyViewPlaceholder/index.js +0 -58
  199. package/lib/components/ExploreView.js +0 -46
  200. package/lib/components/ExplorerUI.js +0 -17
  201. package/lib/components/ExplorerWrapper.js +0 -114
  202. package/lib/components/FacetedSearch/DrawerBody/index.js +0 -42
  203. package/lib/components/FacetedSearch/DrawerWrapper/index.js +0 -83
  204. package/lib/components/FacetedSearch/FacetedSearch.constants.js +0 -27
  205. package/lib/components/FacetedSearch/FacetedSearch.styled.js +0 -101
  206. package/lib/components/FacetedSearch/FacetedSearch.utils.js +0 -3
  207. package/lib/components/FacetedSearch/Field/Date.js +0 -69
  208. package/lib/components/FacetedSearch/Field/Placeholder.js +0 -20
  209. package/lib/components/FacetedSearch/Field/Select.js +0 -136
  210. package/lib/components/FacetedSearch/Field/Switch.js +0 -59
  211. package/lib/components/FacetedSearch/Field/index.js +0 -27
  212. package/lib/components/FacetedSearch/GroupWrapper/index.js +0 -129
  213. package/lib/components/FacetedSearch/StaticFields/Date.js +0 -152
  214. package/lib/components/FacetedSearch/index.js +0 -12
  215. package/lib/components/FileItem/FileInfo/FileInfo.styled.js +0 -126
  216. package/lib/components/FileItem/FileInfo/FileInfo.utils.js +0 -13
  217. package/lib/components/FileItem/FileInfo/FileMetadata.js +0 -37
  218. package/lib/components/FileItem/FileInfo/FileName.js +0 -197
  219. package/lib/components/FileItem/FileInfo/index.js +0 -194
  220. package/lib/components/FileItem/FileItem.mixin.js +0 -22
  221. package/lib/components/FileItem/FileItem.styled.js +0 -54
  222. package/lib/components/FileItem/FileUploadTopOptions.js +0 -87
  223. package/lib/components/FileItem/PreUploadFileThumbnail/FileThumbnail.js +0 -61
  224. package/lib/components/FileItem/PreUploadFileThumbnail/PreUploadFileThumbnail.styled.js +0 -8
  225. package/lib/components/FileItem/PreUploadFileThumbnail/index.js +0 -27
  226. package/lib/components/FileItem/index.js +0 -164
  227. package/lib/components/FileWindowPanel/Body/ActionButtons.js +0 -70
  228. package/lib/components/FileWindowPanel/Body/Body.constants.js +0 -5
  229. package/lib/components/FileWindowPanel/Body/Body.styled.js +0 -196
  230. package/lib/components/FileWindowPanel/Body/BodyFile.js +0 -165
  231. package/lib/components/FileWindowPanel/Body/Footer.js +0 -60
  232. package/lib/components/FileWindowPanel/Body/Preview.js +0 -232
  233. package/lib/components/FileWindowPanel/Body/PreviewPlaceholder.js +0 -20
  234. package/lib/components/FileWindowPanel/Body/VideoEmbed.js +0 -80
  235. package/lib/components/FileWindowPanel/Body/index.js +0 -108
  236. package/lib/components/FileWindowPanel/FileTabs/FileTabButtons.js +0 -98
  237. package/lib/components/FileWindowPanel/FileTabs/FileTabs.constants.js +0 -50
  238. package/lib/components/FileWindowPanel/FileTabs/FileTabs.styled.js +0 -99
  239. package/lib/components/FileWindowPanel/FileTabs/FileTabsList.js +0 -91
  240. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/EditableField.js +0 -78
  241. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldLabel.js +0 -40
  242. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldRow.js +0 -57
  243. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldValue.js +0 -20
  244. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldWithTooltip.js +0 -29
  245. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralSection.js +0 -183
  246. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTab.constants.js +0 -2
  247. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTab.styled.js +0 -112
  248. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTabSkeleton.js +0 -70
  249. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/TableSeparator.js +0 -10
  250. package/lib/components/FileWindowPanel/FileTabs/GeneralTab/index.js +0 -100
  251. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/CustomMetadataSection.js +0 -247
  252. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/EmbeddedMetadataSection.js +0 -31
  253. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTab.constants.js +0 -2
  254. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTab.styled.js +0 -134
  255. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTabSkeleton.js +0 -70
  256. package/lib/components/FileWindowPanel/FileTabs/MetadataTab/index.js +0 -181
  257. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationItem.js +0 -78
  258. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.constants.js +0 -26
  259. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.styled.js +0 -177
  260. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.thunks.js +0 -99
  261. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.utils.js +0 -23
  262. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsContent.js +0 -92
  263. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsEditModalContent.js +0 -57
  264. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsSearch.js +0 -44
  265. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsSkeleton.js +0 -35
  266. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabNavigator.js +0 -38
  267. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabs.js +0 -40
  268. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTopOptions.js +0 -204
  269. package/lib/components/FileWindowPanel/FileTabs/VariationsTab/index.js +0 -603
  270. package/lib/components/FileWindowPanel/FileTabs/index.js +0 -83
  271. package/lib/components/FileWindowPanel/FileWindow.js +0 -221
  272. package/lib/components/FileWindowPanel/FileWindow.styled.js +0 -19
  273. package/lib/components/FileWindowPanel/FileWindow.utils.js +0 -38
  274. package/lib/components/FileWindowPanel/Header/AfterUploadActionBtns.js +0 -69
  275. package/lib/components/FileWindowPanel/Header/BeforeUploadActionBtns.js +0 -100
  276. package/lib/components/FileWindowPanel/Header/FileWindowHeader.styled.js +0 -56
  277. package/lib/components/FileWindowPanel/Header/MutualActionBtns.js +0 -92
  278. package/lib/components/FileWindowPanel/Header/index.js +0 -109
  279. package/lib/components/FileWindowPanel/index.js +0 -60
  280. package/lib/components/Filters/Filters.constants.js +0 -358
  281. package/lib/components/Filters/Filters.styled.js +0 -235
  282. package/lib/components/Filters/Filters.utils.js +0 -536
  283. package/lib/components/Filters/FiltersContext.js +0 -59
  284. package/lib/components/Filters/FiltersSkeleton.js +0 -14
  285. package/lib/components/Filters/Groups/Date/index.js +0 -201
  286. package/lib/components/Filters/Groups/Folders/FoldersSkeleton.js +0 -43
  287. package/lib/components/Filters/Groups/Folders/index.js +0 -109
  288. package/lib/components/Filters/Groups/Image/Colors.js +0 -73
  289. package/lib/components/Filters/Groups/Image/Faces.js +0 -64
  290. package/lib/components/Filters/Groups/Image/Orientations.js +0 -64
  291. package/lib/components/Filters/Groups/Image/Resolutions.js +0 -65
  292. package/lib/components/Filters/Groups/Image/Tooltip.js +0 -14
  293. package/lib/components/Filters/Groups/Image/index.js +0 -104
  294. package/lib/components/Filters/Groups/LicenseExpiry/LicenseExpiry.styled.js +0 -17
  295. package/lib/components/Filters/Groups/LicenseExpiry/index.js +0 -97
  296. package/lib/components/Filters/Groups/Metadata/Advanced/ConditionSelector.js +0 -40
  297. package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/ConditionSelector.js +0 -35
  298. package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/ValueSelector.js +0 -33
  299. package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/index.js +0 -18
  300. package/lib/components/Filters/Groups/Metadata/Advanced/Field/AutoComplete.js +0 -56
  301. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Boolean.js +0 -35
  302. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Date.js +0 -36
  303. package/lib/components/Filters/Groups/Metadata/Advanced/Field/GeoPointField.js +0 -30
  304. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Numeric.js +0 -32
  305. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Select.js +0 -55
  306. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Tags.js +0 -21
  307. package/lib/components/Filters/Groups/Metadata/Advanced/Field/Text.js +0 -39
  308. package/lib/components/Filters/Groups/Metadata/Advanced/Field/index.js +0 -52
  309. package/lib/components/Filters/Groups/Metadata/Advanced/KeySelector.js +0 -34
  310. package/lib/components/Filters/Groups/Metadata/Advanced/Row.js +0 -53
  311. package/lib/components/Filters/Groups/Metadata/Advanced/index.js +0 -48
  312. package/lib/components/Filters/Groups/Metadata/Basic/Field/Date.js +0 -45
  313. package/lib/components/Filters/Groups/Metadata/Basic/Field/Field.utils.js +0 -58
  314. package/lib/components/Filters/Groups/Metadata/Basic/Field/Numeric.js +0 -51
  315. package/lib/components/Filters/Groups/Metadata/Basic/Field/OptionsPopup.js +0 -87
  316. package/lib/components/Filters/Groups/Metadata/Basic/Field/Select.js +0 -168
  317. package/lib/components/Filters/Groups/Metadata/Basic/Field/Switch.js +0 -41
  318. package/lib/components/Filters/Groups/Metadata/Basic/Field/Tags.js +0 -38
  319. package/lib/components/Filters/Groups/Metadata/Basic/Field/Text.js +0 -57
  320. package/lib/components/Filters/Groups/Metadata/Basic/Field/Uri.js +0 -54
  321. package/lib/components/Filters/Groups/Metadata/Basic/Field/index.js +0 -46
  322. package/lib/components/Filters/Groups/Metadata/Basic/GroupWrapper.js +0 -79
  323. package/lib/components/Filters/Groups/Metadata/Basic/index.js +0 -80
  324. package/lib/components/Filters/Groups/Metadata/Metadata.constants.js +0 -42
  325. package/lib/components/Filters/Groups/Metadata/Metadata.styled.js +0 -150
  326. package/lib/components/Filters/Groups/Metadata/Metadata.utils.js +0 -160
  327. package/lib/components/Filters/Groups/Metadata/MetadataFiltersContext.js +0 -329
  328. package/lib/components/Filters/Groups/Metadata/Placeholder.js +0 -25
  329. package/lib/components/Filters/Groups/Metadata/common/TagsField/TagsMenu.js +0 -81
  330. package/lib/components/Filters/Groups/Metadata/common/TagsField/TagsSearchPlaceholder.js +0 -18
  331. package/lib/components/Filters/Groups/Metadata/common/TagsField/index.js +0 -142
  332. package/lib/components/Filters/Groups/Metadata/index.js +0 -111
  333. package/lib/components/Filters/Groups/Size/index.js +0 -125
  334. package/lib/components/Filters/Groups/Tags/FilteredTags.js +0 -62
  335. package/lib/components/Filters/Groups/Tags/SelectedTags.js +0 -51
  336. package/lib/components/Filters/Groups/Tags/SuggestedTags.js +0 -43
  337. package/lib/components/Filters/Groups/Tags/index.js +0 -146
  338. package/lib/components/Filters/Groups/TypeAndFormat/Format.js +0 -65
  339. package/lib/components/Filters/Groups/TypeAndFormat/Type.js +0 -85
  340. package/lib/components/Filters/Groups/TypeAndFormat/index.js +0 -114
  341. package/lib/components/Filters/Groups/common/DateRangeField/DateRangeField.styled.js +0 -10
  342. package/lib/components/Filters/Groups/common/DateRangeField/index.js +0 -72
  343. package/lib/components/Filters/Groups/common/FilterFooter.js +0 -67
  344. package/lib/components/Filters/Groups/common/FilterOptions.js +0 -29
  345. package/lib/components/Filters/Groups/common/FilterSearch.js +0 -22
  346. package/lib/components/Filters/Groups/common/FilterSearch.styled.js +0 -15
  347. package/lib/components/Filters/Groups/common/FilterSkeleton.js +0 -44
  348. package/lib/components/Filters/Groups/common/TimeFrames.js +0 -35
  349. package/lib/components/Filters/Groups/index.js +0 -55
  350. package/lib/components/Filters/Placeholder.js +0 -29
  351. package/lib/components/Filters/hooks/useDateTypeFilterValues.js +0 -182
  352. package/lib/components/Filters/hooks/useFilters.js +0 -78
  353. package/lib/components/Filters/index.js +0 -78
  354. package/lib/components/FoldersView/FoldersTree/FoldersTree.styled.js +0 -193
  355. package/lib/components/FoldersView/FoldersTree/FoldersTree.utils.js +0 -78
  356. package/lib/components/FoldersView/FoldersTree/FoldersTreeHeader.js +0 -52
  357. package/lib/components/FoldersView/FoldersTree/FoldersTreeList.js +0 -64
  358. package/lib/components/FoldersView/FoldersTree/FoldersTreeListItem.js +0 -270
  359. package/lib/components/FoldersView/FoldersTree/FoldersTreeSearch.js +0 -70
  360. package/lib/components/FoldersView/FoldersTree/FoldersTreeSkeleton.js +0 -23
  361. package/lib/components/FoldersView/FoldersTree/NoFoldersResult.js +0 -19
  362. package/lib/components/FoldersView/FoldersTree/SearchedFoldersItem.js +0 -113
  363. package/lib/components/FoldersView/FoldersTree/index.js +0 -163
  364. package/lib/components/FoldersView/hooks/useAddFolder.js +0 -60
  365. package/lib/components/FoldersView/index.js +0 -282
  366. package/lib/components/GalleryRoleSelect/CustomRolesTab.js +0 -47
  367. package/lib/components/GalleryRoleSelect/CustomRolesTab.styled.js +0 -10
  368. package/lib/components/GalleryRoleSelect/GalleryRoleSelect.constants.js +0 -11
  369. package/lib/components/GalleryRoleSelect/GalleryRoleSelect.styled.js +0 -132
  370. package/lib/components/GalleryRoleSelect/GalleryRoleSelect.utils.js +0 -87
  371. package/lib/components/GalleryRoleSelect/StandardRolesTab.js +0 -58
  372. package/lib/components/GalleryRoleSelect/index.js +0 -234
  373. package/lib/components/HeaderBar/FacetedSearchToggleButton.js +0 -28
  374. package/lib/components/HeaderBar/HeaderBar.styled.js +0 -25
  375. package/lib/components/HeaderBar/RightSide.js +0 -127
  376. package/lib/components/HeaderBar/index.js +0 -77
  377. package/lib/components/ImageEditorPanel/index.js +0 -33
  378. package/lib/components/InfiniteScroll/InfiniteScroll.js +0 -97
  379. package/lib/components/InfiniteScroll/InfiniteScroll.styled.js +0 -11
  380. package/lib/components/Informer/index.js +0 -9
  381. package/lib/components/LoginScreen/LoginScreen.styled.js +0 -39
  382. package/lib/components/LoginScreen/index.js +0 -133
  383. package/lib/components/MainMenu/MainMenu.styled.js +0 -12
  384. package/lib/components/MainMenu/index.js +0 -77
  385. package/lib/components/Modals/AddNewFolder/AddNewFolder.hooks.js +0 -99
  386. package/lib/components/Modals/AddNewFolder/index.js +0 -1
  387. package/lib/components/Modals/ConfirmationModal/ConfirmationModal.hooks.js +0 -101
  388. package/lib/components/Modals/ConfirmationModal/index.js +0 -1
  389. package/lib/components/Modals/DeleteItems/DeleteItems.hooks.js +0 -233
  390. package/lib/components/Modals/DeleteItems/index.js +0 -1
  391. package/lib/components/Modals/DeleteModal/DeleteModal.hooks.js +0 -87
  392. package/lib/components/Modals/DeleteModal/index.js +0 -1
  393. package/lib/components/Modals/DownloadConsent/DownlaodConsent.styled.js +0 -8
  394. package/lib/components/Modals/DownloadConsent/DownloadConsent.hooks.js +0 -90
  395. package/lib/components/Modals/DownloadConsent/DownloadConsentContent.js +0 -52
  396. package/lib/components/Modals/DownloadConsent/index.js +0 -2
  397. package/lib/components/Modals/Modals.js +0 -386
  398. package/lib/components/Modals/Modals.styled.js +0 -80
  399. package/lib/components/Modals/MoveItems/MoveItems.hooks.js +0 -88
  400. package/lib/components/Modals/MoveItems/index.js +0 -1
  401. package/lib/components/Modals/TransformedDownload/PdfModalContent.js +0 -109
  402. package/lib/components/Modals/TransformedDownload/TransformedDownload.hooks.js +0 -188
  403. package/lib/components/Modals/TransformedDownload/TransformedDownload.styled.js +0 -29
  404. package/lib/components/Modals/TransformedDownload/TransformedDownload.utils.js +0 -46
  405. package/lib/components/Modals/TransformedDownload/index.js +0 -2
  406. package/lib/components/Modals/index.js +0 -8
  407. package/lib/components/NoItems/NoItems.styled.js +0 -54
  408. package/lib/components/NoItems/index.js +0 -50
  409. package/lib/components/PdftronPanel/index.js +0 -31
  410. package/lib/components/PickerPanel/PickerPanel.styled.js +0 -41
  411. package/lib/components/PickerPanel/PickerPanelContent.js +0 -100
  412. package/lib/components/PickerPanel/index.js +0 -21
  413. package/lib/components/ProgressPanel/ProgressPanel.utils.js +0 -29
  414. package/lib/components/ProgressPanel/index.js +0 -37
  415. package/lib/components/TopBar/AppliedFilterChips/AppliedFilterChips.styled.js +0 -11
  416. package/lib/components/TopBar/AppliedFilterChips/index.js +0 -77
  417. package/lib/components/TopBar/Search/ContextDropdown/ContextDropdown.styled.js +0 -59
  418. package/lib/components/TopBar/Search/ContextDropdown/ContextDropdown.utils.js +0 -67
  419. package/lib/components/TopBar/Search/ContextDropdown/index.js +0 -170
  420. package/lib/components/TopBar/Search/PrependedOptions/TempFilterRegexInput.js +0 -133
  421. package/lib/components/TopBar/Search/Search.utils.js +0 -88
  422. package/lib/components/TopBar/Search/SimilarSearchTag.js +0 -60
  423. package/lib/components/TopBar/Search/index.js +0 -251
  424. package/lib/components/TopBar/TopBar.styled.js +0 -37
  425. package/lib/components/TopBar/index.js +0 -61
  426. package/lib/components/TopSection/TopSection.styled.js +0 -22
  427. package/lib/components/TopSection/index.js +0 -58
  428. package/lib/components/UploadBar/UploadBar.styled.js +0 -84
  429. package/lib/components/UploadBar/index.js +0 -222
  430. package/lib/components/UploadStatus/index.js +0 -20
  431. package/lib/components/UploadsPanel/UploadsList/Header.js +0 -19
  432. package/lib/components/UploadsPanel/UploadsList/List.js +0 -29
  433. package/lib/components/UploadsPanel/UploadsList/PreUploadPlugins.js +0 -22
  434. package/lib/components/UploadsPanel/UploadsList/UploadsList.styled.js +0 -64
  435. package/lib/components/UploadsPanel/UploadsList/UploadsList.utils.js +0 -17
  436. package/lib/components/UploadsPanel/UploadsList/UploadsVirtualGrid.js +0 -29
  437. package/lib/components/UploadsPanel/UploadsList/index.js +0 -55
  438. package/lib/components/UploadsPanel/UploadsPanel.styled.js +0 -24
  439. package/lib/components/UploadsPanel/UploadsPanelTopBar.js +0 -16
  440. package/lib/components/UploadsPanel/index.js +0 -36
  441. package/lib/components/UrlBuilderModal/UrlBuilderModal.styled.js +0 -9
  442. package/lib/components/UrlBuilderModal/index.js +0 -97
  443. package/lib/components/Views/ErroredViewPlaceholder.js +0 -48
  444. package/lib/components/Views/Views.constants.js +0 -29
  445. package/lib/components/Views/Views.styled.js +0 -87
  446. package/lib/components/Views/index.js +0 -100
  447. package/lib/components/common/DeleteModalItemText/DeleteModalItemText.styled.js +0 -8
  448. package/lib/components/common/DeleteModalItemText/index.js +0 -24
  449. package/lib/components/common/EditDetailsButton/EditDetailsButton.styled.js +0 -35
  450. package/lib/components/common/EditDetailsButton/index.js +0 -28
  451. package/lib/components/common/ExpiryDateTooltipContent/ExpiryDateTooltipContent.styled.js +0 -16
  452. package/lib/components/common/ExpiryDateTooltipContent/index.js +0 -29
  453. package/lib/components/common/FileApprovalsInfoPopup/index.js +0 -46
  454. package/lib/components/common/FileMetadataFieldValue/CustomMetadataFieldValue.js +0 -48
  455. package/lib/components/common/FileMetadataFieldValue/FileMetadataFieldValue.styled.js +0 -66
  456. package/lib/components/common/FileMetadataFieldValue/FileMetadataFieldValue.utils.js +0 -315
  457. package/lib/components/common/FileMetadataFieldValue/GeneralMetadataFieldValue.js +0 -120
  458. package/lib/components/common/FileMetadataFieldValue/index.js +0 -26
  459. package/lib/components/common/FileMetadataFieldValue/utils/getFontInfo.js +0 -78
  460. package/lib/components/common/FolderSelector/BrowseFoldersMenu.js +0 -114
  461. package/lib/components/common/FolderSelector/FolderSearchMenu.js +0 -45
  462. package/lib/components/common/FolderSelector/FolderSelector.styled.js +0 -41
  463. package/lib/components/common/FolderSelector/index.js +0 -186
  464. package/lib/components/common/FormattedUriLink/FormattedUriLink.styled.js +0 -15
  465. package/lib/components/common/FormattedUriLink/index.js +0 -21
  466. package/lib/components/common/OriginalBadge/OriginalBadge.styled.js +0 -17
  467. package/lib/components/common/OriginalBadge/index.js +0 -14
  468. package/lib/components/common/SanitizedHtmlElement/index.js +0 -11
  469. package/lib/components/common/Sort/Sort.constants.js +0 -61
  470. package/lib/components/common/Sort/Sort.styled.js +0 -47
  471. package/lib/components/common/Sort/Sort.utils.js +0 -14
  472. package/lib/components/common/Sort/index.js +0 -183
  473. package/lib/components/common/TextWithCopyIcon/TextWithCopyIcon.styled.js +0 -44
  474. package/lib/components/common/TextWithCopyIcon/index.js +0 -71
  475. package/lib/components/common/TopBarUploadButton/index.js +0 -40
  476. package/lib/components/common/TrimmedFilePathWithLocate/TrimmedFilePathWithLocate.utils.js +0 -3
  477. package/lib/components/common/TrimmedFilePathWithLocate/index.js +0 -34
  478. package/lib/components/common/TrimmedFolderPathWithLocate/index.js +0 -13
  479. package/lib/components/common/TrimmedPathWithLocate/TrimmedPathWithLocate.styled.js +0 -30
  480. package/lib/components/common/TrimmedPathWithLocate/index.js +0 -40
  481. package/lib/components/metadata.adapter.js +0 -365
  482. package/lib/defaultLocale.js +0 -1361
  483. package/lib/hooks/index.js +0 -16
  484. package/lib/hooks/useAssetsPicker.js +0 -274
  485. package/lib/hooks/useDownloadFilesCsv.js +0 -20
  486. package/lib/hooks/useEditFileDetails.js +0 -505
  487. package/lib/hooks/useExplorer.js +0 -6
  488. package/lib/hooks/useExplorerI18n.js +0 -10
  489. package/lib/hooks/useExplorerInformer.js +0 -10
  490. package/lib/hooks/useFetchFileFolderPermissions.js +0 -31
  491. package/lib/hooks/useFetchMetadataTagsBySearchQuery.js +0 -38
  492. package/lib/hooks/useFileMetadata.js +0 -117
  493. package/lib/hooks/useFilterSearch.js +0 -37
  494. package/lib/hooks/useForcedFilters.js +0 -39
  495. package/lib/hooks/useIsOverflow.js +0 -25
  496. package/lib/hooks/useIsSmallScreen.js +0 -20
  497. package/lib/hooks/useLocateFile.js +0 -231
  498. package/lib/hooks/usePrevious.js +0 -9
  499. package/lib/hooks/useSearchSuggestions.js +0 -168
  500. package/lib/hooks/useStartUpload.js +0 -43
  501. package/lib/hooks/useToLocaleNumber.js +0 -14
  502. package/lib/hooks/useValidateFileName.js +0 -324
  503. package/lib/index.js +0 -1587
  504. package/lib/slices/common.slice.js +0 -254
  505. package/lib/slices/drag.slice.js +0 -75
  506. package/lib/slices/files.slice.js +0 -1307
  507. package/lib/slices/filters.slice.js +0 -382
  508. package/lib/slices/folders.slice.js +0 -964
  509. package/lib/slices/foldersTree.slice.js +0 -501
  510. package/lib/slices/index.js +0 -32
  511. package/lib/slices/metadata.slice.js +0 -494
  512. package/lib/slices/panels.slice.js +0 -351
  513. package/lib/slices/search.slice.js +0 -995
  514. package/lib/slices/selections.slice.js +0 -315
  515. package/lib/slices/targets.slice.js +0 -44
  516. package/lib/slices/topSection.slice.js +0 -71
  517. package/lib/slices/views.slice.js +0 -345
  518. package/lib/thunks/archive.thunks.js +0 -175
  519. package/lib/thunks/downloads.thunks.js +0 -415
  520. package/lib/thunks/items.thunks.js +0 -274
  521. package/lib/thunks/permissions.thunks.js +0 -66
  522. package/lib/thunks/uploads.thunks.js +0 -235
  523. package/lib/utils/SearchSuggestions/SearchSuggestionsMenu.js +0 -95
  524. package/lib/utils/SearchSuggestions/SuggestionMode.js +0 -70
  525. package/lib/utils/SearchSuggestions/SuggestionModeAttribute.js +0 -87
  526. package/lib/utils/SearchSuggestions/SuggestionModeExpression.js +0 -121
  527. package/lib/utils/SearchSuggestions/SuggestionModeTag.js +0 -87
  528. package/lib/utils/SearchSuggestions/SuggestionsManager.js +0 -242
  529. package/lib/utils/SearchSuggestions/constants.js +0 -14
  530. package/lib/utils/SearchSuggestions/index.js +0 -4
  531. package/lib/utils/SearchSuggestions/styled.js +0 -12
  532. package/lib/utils/availableScreenSizes.js +0 -4
  533. package/lib/utils/constants.js +0 -14
  534. package/lib/utils/convertItemsToFilesFoldersUuids.js +0 -12
  535. package/lib/utils/convertItemstoFoldersParentUuids.js +0 -12
  536. package/lib/utils/createPromise.js +0 -9
  537. package/lib/utils/createSuperFocus.js +0 -43
  538. package/lib/utils/decodeB64ToStr.js +0 -11
  539. package/lib/utils/filters.js +0 -333
  540. package/lib/utils/formatFolderPath.js +0 -10
  541. package/lib/utils/formatPinSubTitle.js +0 -17
  542. package/lib/utils/getAcquirerTitle.js +0 -10
  543. package/lib/utils/getActiveOverlayEl.js +0 -11
  544. package/lib/utils/getApiPathtype.js +0 -10
  545. package/lib/utils/getClosestStr.js +0 -22
  546. package/lib/utils/getItemUuids.js +0 -12
  547. package/lib/utils/getLabelsTotalAssetsCount.js +0 -6
  548. package/lib/utils/getMoveAndDeleteData.js +0 -15
  549. package/lib/utils/getParentFolderPath.js +0 -4
  550. package/lib/utils/getQueryStringFromUrl.js +0 -6
  551. package/lib/utils/getScrollableParent.js +0 -15
  552. package/lib/utils/getStringValueExistedInObj.js +0 -9
  553. package/lib/utils/isEmbeddableAsset.js +0 -6
  554. package/lib/utils/isFileVersion.js +0 -9
  555. package/lib/utils/mapArrayKeysToObjValues.js +0 -33
  556. package/lib/utils/mapFiltersToShownFormat.js +0 -252
  557. package/lib/utils/prepareExportedFilesLinks.js +0 -12
  558. package/lib/utils/prepareSearchUrl.js +0 -65
  559. package/lib/utils/removeBackground.js +0 -60
  560. package/lib/utils/removeExtraUrlParams.js +0 -13
  561. package/lib/utils/scrollToAndFocusItemElement.js +0 -16
  562. package/lib/utils/toggleFolderNotFoundModal.js +0 -25
  563. package/lib/utils/trapFocus.js +0 -59
  564. package/lib/utils/truncateString.js +0 -28
@@ -1,1307 +0,0 @@
1
- var _excluded = ["method"],
2
- _excluded2 = ["recursive", "path", "noPagination"],
3
- _excluded3 = ["requestProgress", "abortFunction", "sendStatsReq", "responseType", "headers", "replaceOldFiles"],
4
- _excluded4 = ["addNotFound"];
5
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
6
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
7
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
9
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
10
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
11
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
12
- function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
13
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
14
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
15
- function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
16
- function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
17
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
18
- 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; }
19
- 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) { _defineProperty(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; }
20
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
21
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
22
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
23
- import { createSlice, createSelector, isAnyOf } from '@reduxjs/toolkit';
24
- import { PLUGINS_IDS, PERMISSIONS, SEARCH_METHODS, REMOVE_BACKGROUND_ENDPOINT, REMOVE_BACKGROUND_LINK_PLACEHOLDER, FMAW_URL_QUERY_PARAMS, DESCRIBE_AI_SUPPORTED_LANGUAGES } from '@scaleflex/widget-utils/lib/constants';
25
- import createThunk from '@scaleflex/widget-utils/lib/createThunk';
26
- import { selectUploads, selectUploadsIds } from '@scaleflex/widget-core/lib/slices/uploads.slice';
27
- import getFileLink from '@scaleflex/widget-utils/lib/getFileLink';
28
- import getActionErrorState from '@scaleflex/widget-utils/lib/getActionErrorState';
29
- import getNormalizedItems from '@scaleflex/widget-utils/lib/getNormalizedItems';
30
- import copyText from '@scaleflex/widget-utils/lib/copyText';
31
- import prepareSearchUrl from '../utils/prepareSearchUrl';
32
- import { fileWindowUpdated, selectFileWindowFor, selectIsUploadsPanelOpened } from './panels.slice';
33
- import { selectAppliedFilters } from './filters.slice';
34
- import { exactAndExtendedFilesUpdated, searchFilesWithAiText, searchSimilarFiles, selectAllSearchFiles, selectAllSearchFilesUuids, selectExactSearchFileByUuid, selectExtendedSearchFileByUuid, selectIsAiSearch, selectIsExtendFetching, selectIsQuickFetching, selectSearchQuery, selectSearchSuggestionsFilters, selectSearchSuggestionsTags } from './search.slice';
35
- import { selectAllSelectedItemsCount, selectionsCleared } from './selections.slice';
36
- import { DEFAULT_SORT_OPTION, SORT_BY } from '../components/common/Sort/Sort.constants';
37
- import { selectIsSearchOrFiltersMode, selectIsSearchMode, selectIsFoldersView, viewChanged, selectIsAssetsView, viewCachedFetchFilesQueries, changeViewFetchFilesCachedQueries, selectActiveViewItem } from './views.slice';
38
- import { FILTER_SECTION_KEYS } from '../components/Filters/Filters.constants';
39
- import { selectCurrentFolderPath, selectIsFolderFilesRecursiveFetch } from './folders.slice';
40
- import decodeB64ToStr from '../utils/decodeB64ToStr';
41
- import { getMetaRegionalGroupsLanguagesApiValues } from '../components/metadata.adapter';
42
- import { selectActiveRegionalLang, selectIsCdnPermalinkEnabled, selectMetadataRegionalGroups } from './metadata.slice';
43
- import { adaptFiltersToBackendNotation } from '../utils/filters';
44
-
45
- /**
46
- * The order of the code in slice file is:
47
- * 1. initialState (*No* export needed)
48
- * 2. automated thunks functions -- uses createThunk API-- (export needed)
49
- * 3. createSlice (*No* export needed)
50
- * 4. actions exports
51
- * 5. selectors (export needed)
52
- * 6. default reducer export
53
- *
54
- */
55
- var slicePropName = 'files';
56
- export var sliceName = "".concat(PLUGINS_IDS.EXPLORER, "/").concat(slicePropName);
57
- export var ACTION_TYPE = {
58
- FETCH_FILES: "".concat(sliceName, "/fetchFiles"),
59
- FETCH_FILES_STATS: "".concat(sliceName, "/fetchFilesStats")
60
- };
61
-
62
- // Changed from object to function to always re-calculate the object on calling to have the latest value of referenced objects (sorting...etc if changed.
63
- var getInitialState = function getInitialState() {
64
- return {
65
- uuids: [],
66
- entities: {},
67
- stats: {
68
- loading: false,
69
- filesCount: 0,
70
- filesCountMethod: null,
71
- filesSize: 0
72
- },
73
- tmpFile: null,
74
- // used to show a file temporary from any place after fetching it for ex. (showing a file in file window if not existed in entities)
75
- loading: true,
76
- variations: {},
77
- offset: 0,
78
- noMoreFiles: false,
79
- sortOrder: DEFAULT_SORT_OPTION.order,
80
- sortedBy: DEFAULT_SORT_OPTION.by
81
- };
82
- };
83
- export var getQueryForSearchAndFilters = function getQueryForSearchAndFilters(state) {
84
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
85
- _ref$noSearch = _ref.noSearch,
86
- noSearch = _ref$noSearch === void 0 ? false : _ref$noSearch,
87
- _ref$noFilters = _ref.noFilters,
88
- noFilters = _ref$noFilters === void 0 ? false : _ref$noFilters,
89
- _ref$moreFilters = _ref.moreFilters,
90
- moreFilters = _ref$moreFilters === void 0 ? {} : _ref$moreFilters,
91
- _ref$filterKeysToDisr = _ref.filterKeysToDisregard,
92
- filterKeysToDisregard = _ref$filterKeysToDisr === void 0 ? [] : _ref$filterKeysToDisr;
93
- var searchSuggestionsFilters = selectSearchSuggestionsFilters(state);
94
- var searchSuggestionsTags = selectSearchSuggestionsTags(state);
95
- var searchQuery = selectSearchQuery(state);
96
- // De-structuring to make it possible to delete filters.
97
- var filters = _objectSpread(_objectSpread({}, moreFilters), selectAppliedFilters(state));
98
- var queries = [];
99
- if (!noSearch) {
100
- queries.push.apply(queries, [searchQuery].concat(_toConsumableArray((searchSuggestionsFilters || []).map(function (filter) {
101
- var _filter$value;
102
- return "".concat(filter.key, ":\"").concat(((_filter$value = filter.value) === null || _filter$value === void 0 ? void 0 : _filter$value.sys_key) || filter.value, "\"");
103
- })), _toConsumableArray((searchSuggestionsTags || []).map(function (tag) {
104
- return tag.input;
105
- }))));
106
- }
107
- if (!noFilters) {
108
- if (Array.isArray(filterKeysToDisregard) && filterKeysToDisregard.length > 0) {
109
- filterKeysToDisregard.forEach(function (filterKey) {
110
- return delete filters[filterKey];
111
- });
112
- }
113
- queries.push.apply(queries, _toConsumableArray(adaptFiltersToBackendNotation(filters)));
114
- }
115
- return queries.filter(Boolean).join(' ');
116
- };
117
- export var updateFiles = createThunk(function (_ref2, thunkApi) {
118
- var _ref2$files = _ref2.files,
119
- files = _ref2$files === void 0 ? [] : _ref2$files,
120
- _ref2$addNotFoundSing = _ref2.addNotFoundSingleFile,
121
- addNotFoundSingleFile = _ref2$addNotFoundSing === void 0 ? false : _ref2$addNotFoundSing;
122
- var state = thunkApi.getState();
123
- var isSearchMode = selectIsSearchMode(state);
124
- if (isSearchMode) {
125
- thunkApi.dispatch(exactAndExtendedFilesUpdated({
126
- files: files
127
- }));
128
- } else if (Array.isArray(files) && files.length === 1 && addNotFoundSingleFile) {
129
- var singleFile = files[0];
130
- if (singleFile !== null && singleFile !== void 0 && singleFile.uuid) {
131
- thunkApi.dispatch(fileUpdated(_objectSpread(_objectSpread({}, singleFile), {}, {
132
- addNotFound: addNotFoundSingleFile
133
- })));
134
- }
135
- } else {
136
- thunkApi.dispatch(filesUpdated(files));
137
- }
138
- });
139
- export var removeFilesBackground = createThunk(function () {
140
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
141
- files = _ref3.files,
142
- removeBackgroundFolder = _ref3.removeBackgroundFolder;
143
- var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
144
- var dispatch = thunkApi.dispatch,
145
- _thunkApi$extra = thunkApi.extra,
146
- apiClient = _thunkApi$extra.apiClient,
147
- _thunkApi$extra$filer = _thunkApi$extra.filerobot,
148
- opts = _thunkApi$extra$filer.opts,
149
- info = _thunkApi$extra$filer.info;
150
- var container = opts.container;
151
- var _thunkApi$extra$filer2 = thunkApi.extra.filerobot.getPlugin(PLUGINS_IDS.EXPLORER),
152
- i18n = _thunkApi$extra$filer2.i18n;
153
- var isInternalFolder = removeBackgroundFolder === 'internal';
154
- info(i18n('backgroundRemovedProcessingInfo'), 'success');
155
- var updatedFiles = files.map(function (file) {
156
- var uuid = file.uuid,
157
- _file$folder = file.folder,
158
- _file$folder2 = _file$folder === void 0 ? {} : _file$folder,
159
- folderPath = _file$folder2.name;
160
- var fileLink = getFileLink(file);
161
- var endpointWithFileLink = REMOVE_BACKGROUND_ENDPOINT.replace(REMOVE_BACKGROUND_LINK_PLACEHOLDER, fileLink);
162
- apiClient.get(endpointWithFileLink, {
163
- checkOnlySuccessStatus: true,
164
- headers: _objectSpread({
165
- 'Filerobot-Token': container,
166
- 'Filerobot-uuid': uuid
167
- }, !isInternalFolder && {
168
- 'Filerobot-folder': folderPath
169
- })
170
- }).then(function () {
171
- var _ref4 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
172
- status = _ref4.status;
173
- setTimeout(function () {
174
- return dispatch(handleFileBackgroundRemoval({
175
- originalFile: file,
176
- statusUrl: status,
177
- info: info,
178
- i18n: i18n
179
- }));
180
- }, 3000);
181
- });
182
- return _objectSpread(_objectSpread({}, file), {}, {
183
- isRemovingBackground: true
184
- });
185
- });
186
- return thunkApi.dispatch(updateFiles({
187
- files: updatedFiles
188
- }));
189
- });
190
- var handleFileBackgroundRemoval = createThunk(async function (_ref5, thunkApi) {
191
- var originalFile = _ref5.originalFile,
192
- statusUrl = _ref5.statusUrl,
193
- info = _ref5.info,
194
- i18n = _ref5.i18n,
195
- signal = _ref5.signal;
196
- if (!statusUrl) {
197
- return;
198
- }
199
- var _ref6 = (await thunkApi.extra.apiClient.get(statusUrl, {
200
- abortSignal: signal,
201
- checkOnlySuccessStatus: true
202
- })) || {},
203
- status = _ref6.status,
204
- result = _ref6.result;
205
- if (status === 'success') {
206
- var _file$folder3;
207
- var _ref7 = result || {},
208
- _ref7$filerobot_info = _ref7.filerobot_info,
209
- _ref7$filerobot_info2 = _ref7$filerobot_info === void 0 ? {} : _ref7$filerobot_info,
210
- file = _ref7$filerobot_info2.file;
211
- var fileFolderPath = file === null || file === void 0 ? void 0 : (_file$folder3 = file.folder) === null || _file$folder3 === void 0 ? void 0 : _file$folder3.name;
212
- var state = thunkApi.getState();
213
- var currentFolderPath = selectCurrentFolderPath(state);
214
- if (fileFolderPath === currentFolderPath || selectIsAssetsView(state)) {
215
- thunkApi.dispatch(fileUpdated(_objectSpread(_objectSpread({}, originalFile), {}, {
216
- isRemovingBackground: false,
217
- removedBackground: true
218
- })));
219
- if (file) {
220
- thunkApi.dispatch(fileAdded(file));
221
- }
222
- }
223
- info(i18n('backgroundRemovedSuccessfullyInfo', {
224
- fileName: originalFile.name,
225
- folder: fileFolderPath || '.internal'
226
- }), 'success');
227
- return;
228
- }
229
- if (status === 'error') {
230
- info(i18n('backgroundRemovedFailInfo', {
231
- fileName: originalFile.name
232
- }), 'error');
233
- return;
234
- }
235
- setTimeout(function () {
236
- return !(signal !== null && signal !== void 0 && signal.aborted) && thunkApi.dispatch(handleFileBackgroundRemoval({
237
- originalFile: originalFile,
238
- statusUrl: statusUrl,
239
- info: info,
240
- i18n: i18n,
241
- signal: signal
242
- }));
243
- }, 3000);
244
- });
245
- export var fetchFilesStats = createThunk(async function (_ref8, thunkApi) {
246
- var _stats$approx_files_c, _stats$approx_files_c2, _stats$approx_files_s;
247
- var path = _ref8.path,
248
- queryParams = _ref8.queryParams,
249
- fetchArgs = _ref8.fetchArgs;
250
- var _ref9 = (fetchArgs === null || fetchArgs === void 0 ? void 0 : fetchArgs.moreQueries) || {},
251
- method = _ref9.method,
252
- moreQueries = _objectWithoutProperties(_ref9, _excluded);
253
- var _ref10 = (await thunkApi.extra.apiClient.fetch("".concat(path, "/stats").concat((queryParams === null || queryParams === void 0 ? void 0 : queryParams.length) > 0 ? "?".concat(queryParams.join('&')) : ''), _objectSpread(_objectSpread({}, fetchArgs), {}, {
254
- moreQueries: moreQueries,
255
- abortSignal: fetchArgs.abortSignal || thunkApi.signal,
256
- noPagination: true,
257
- noFormatAndSortParams: true
258
- }))) || {},
259
- _ref10$stats = _ref10.stats,
260
- stats = _ref10$stats === void 0 ? {} : _ref10$stats;
261
- return {
262
- filesCount: (_stats$approx_files_c = stats.approx_files_count) !== null && _stats$approx_files_c !== void 0 ? _stats$approx_files_c : selectFilesUuids(thunkApi.getState()).length,
263
- filesCountMethod: (_stats$approx_files_c2 = stats.approx_files_count_method) !== null && _stats$approx_files_c2 !== void 0 ? _stats$approx_files_c2 : null,
264
- filesSize: (_stats$approx_files_s = stats.approx_files_size) !== null && _stats$approx_files_s !== void 0 ? _stats$approx_files_s : Object.values(selectFiles(thunkApi.getState())).reduce(function (acc, file) {
265
- var _file$size;
266
- return acc + (file === null || file === void 0 ? void 0 : (_file$size = file.size) === null || _file$size === void 0 ? void 0 : _file$size.bytes) || 0;
267
- }, 0)
268
- };
269
- }, {
270
- actionType: ACTION_TYPE.FETCH_FILES_STATS
271
- });
272
- var updateFilesSorting = function updateFilesSorting(_ref11) {
273
- var state = _ref11.state,
274
- sorting = _ref11.sorting,
275
- thunkApi = _ref11.thunkApi;
276
- var dispatch = thunkApi.dispatch,
277
- extra = thunkApi.extra;
278
- var sortBy;
279
- var sortOrder;
280
- // If there is custom sorting provided, then let's update it while using.
281
- if (Array.isArray(sorting) || typeof sorting === 'string') {
282
- var _ref12 = Array.isArray(sorting) ? sorting : sorting.split(':');
283
- var _ref13 = _slicedToArray(_ref12, 2);
284
- sortBy = _ref13[0];
285
- sortOrder = _ref13[1];
286
- if (sortBy && sortOrder) {
287
- dispatch(filesSortingUpdated({
288
- sortBy: sortBy,
289
- order: sortOrder
290
- }));
291
- }
292
- } else {
293
- sortOrder = selectFilesSortOrder(state);
294
- sortBy = selectFilesSortedBy(state);
295
- if (!selectIsSearchMode(state)) {
296
- var _extra$filerobot$getP2, _extra$filerobot$getP3;
297
- var _extra$filerobot$getP = extra === null || extra === void 0 ? void 0 : (_extra$filerobot$getP2 = extra.filerobot.getPlugin(PLUGINS_IDS.EXPLORER)) === null || _extra$filerobot$getP2 === void 0 ? void 0 : (_extra$filerobot$getP3 = _extra$filerobot$getP2.opts) === null || _extra$filerobot$getP3 === void 0 ? void 0 : _extra$filerobot$getP3.config,
298
- defaultSort = _extra$filerobot$getP.defaultSort;
299
- sortBy = sortBy || defaultSort.by || DEFAULT_SORT_OPTION.by;
300
- sortOrder = sortOrder || defaultSort.order || DEFAULT_SORT_OPTION.order;
301
- if (sortBy === SORT_BY.RELEVANCE) {
302
- sortBy = defaultSort.by || DEFAULT_SORT_OPTION.by;
303
- }
304
- dispatch(filesSortingUpdated({
305
- sortBy: sortBy,
306
- order: sortOrder
307
- }));
308
- }
309
- }
310
- return !sortBy ? undefined : "".concat(sortBy, ":").concat(sortOrder);
311
- };
312
- /**
313
- * cachedViewQueries === { [key]: value }, means we are fetching the files for which view-mode/feature (folder/label/...etc), examples:
314
- * { folder: 'folderUuid' } or { labels: 'labelSid' }
315
- * or { search: 'searchQuery' } or { search: 'searchQuery', folder: 'folderPath' }
316
- * -- u could add `recursive: true` to be cached with the view also to be considered always in the request till changing the view.
317
- *
318
- */
319
- // `lastViewOptions` - used to keep tracked of the last applied view for fetchFiles...
320
- // to be used in fetching files again for the same query without providing query one more time (easier to call the thunk from anyplace without query or complex/spaghetti logic).
321
- export var fetchInitialFiles = function fetchInitialFiles(args) {
322
- return fetchFiles(_objectSpread(_objectSpread({
323
- withStats: true
324
- }, args), {}, {
325
- offset: 0
326
- }));
327
- };
328
- export var fetchFiles = createThunk(async function () {
329
- var _selectIsFolderFilesR;
330
- var _ref14 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
331
- _ref14$cachedViewQuer = _ref14.cachedViewQueries,
332
- cachedViewQueries = _ref14$cachedViewQuer === void 0 ? viewCachedFetchFilesQueries : _ref14$cachedViewQuer,
333
- queries = _ref14.queries,
334
- offset = _ref14.offset,
335
- limit = _ref14.limit,
336
- filters = _ref14.filters,
337
- format = _ref14.format,
338
- _ref14$recursive = _ref14.recursive,
339
- recursive = _ref14$recursive === void 0 ? false : _ref14$recursive,
340
- sorting = _ref14.sorting,
341
- _ref14$path = _ref14.path,
342
- path = _ref14$path === void 0 ? 'files' : _ref14$path,
343
- _ref14$abortSignal = _ref14.abortSignal,
344
- abortSignal = _ref14$abortSignal === void 0 ? null : _ref14$abortSignal,
345
- _ref14$withStats = _ref14.withStats,
346
- withStats = _ref14$withStats === void 0 ? false : _ref14$withStats,
347
- _ref14$replaceOldFile = _ref14.replaceOldFiles,
348
- replaceOldFiles = _ref14$replaceOldFile === void 0 ? false : _ref14$replaceOldFile,
349
- _ref14$noPagination = _ref14.noPagination,
350
- noPagination = _ref14$noPagination === void 0 ? false : _ref14$noPagination,
351
- _ref14$id = _ref14.id,
352
- id = _ref14$id === void 0 ? 'listFiles' : _ref14$id,
353
- _ref14$useSameApiStat = _ref14.useSameApiStats,
354
- useSameApiStats = _ref14$useSameApiStat === void 0 ? false : _ref14$useSameApiStat,
355
- _ref14$skipDispatch = _ref14.skipDispatch,
356
- skipDispatch = _ref14$skipDispatch === void 0 ? false : _ref14$skipDispatch,
357
- _ref14$skipPendingDis = _ref14.skipPendingDispatch,
358
- skipPendingDispatch = _ref14$skipPendingDis === void 0 ? false : _ref14$skipPendingDis,
359
- _ref14$returnBlob = _ref14.returnBlob,
360
- returnBlob = _ref14$returnBlob === void 0 ? false : _ref14$returnBlob,
361
- _ref14$xhrOptions = _ref14.xhrOptions,
362
- xhrOptions = _ref14$xhrOptions === void 0 ? {} : _ref14$xhrOptions,
363
- _ref14$noSearch = _ref14.noSearch,
364
- noSearch = _ref14$noSearch === void 0 ? false : _ref14$noSearch,
365
- _ref14$noFilters = _ref14.noFilters,
366
- noFilters = _ref14$noFilters === void 0 ? false : _ref14$noFilters,
367
- _ref14$noSorting = _ref14.noSorting,
368
- noSorting = _ref14$noSorting === void 0 ? false : _ref14$noSorting,
369
- _ref14$deleteFiltersA = _ref14.deleteFiltersAndSearchUrlQueries,
370
- deleteFiltersAndSearchUrlQueries = _ref14$deleteFiltersA === void 0 ? false : _ref14$deleteFiltersA,
371
- _ref14$applyActiveVie = _ref14.applyActiveViewItemCheck,
372
- applyActiveViewItemCheck = _ref14$applyActiveVie === void 0 ? true : _ref14$applyActiveVie;
373
- var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
374
- if (applyActiveViewItemCheck && !selectActiveViewItem(thunkApi.getState())) {
375
- thunkApi.skipDispatch();
376
- return;
377
- }
378
- if (skipDispatch) {
379
- thunkApi.skipDispatch();
380
- } else if (skipPendingDispatch) {
381
- thunkApi.skipPendingDispatch();
382
- }
383
- var _thunkApi$extra$filer3 = thunkApi.extra.filerobot.getPlugin(PLUGINS_IDS.EXPLORER),
384
- opts = _thunkApi$extra$filer3.opts,
385
- replaceUrlQueryParams = _thunkApi$extra$filer3.replaceUrlQueryParams;
386
- var defaultFilters = opts.defaultFilters,
387
- forceFilters = opts.forceFilters,
388
- disableFiltersAndSearch = opts.disableFiltersAndSearch,
389
- _opts$config = opts.config,
390
- config = _opts$config === void 0 ? {} : _opts$config;
391
- var filesLimit = config.filesLimit;
392
- var fetch = thunkApi.extra.apiClient.fetch;
393
- var state = thunkApi.getState();
394
- var currentOffset = (['undefined', 'null'].includes(_typeof(offset)) && !replaceOldFiles ? selectFilesOffset(state) : offset) || 0;
395
- var currentLimit = limit || filesLimit;
396
- if (!disableFiltersAndSearch && deleteFiltersAndSearchUrlQueries) {
397
- replaceUrlQueryParams({
398
- keysToDelete: [!forceFilters && FMAW_URL_QUERY_PARAMS.FILTER_PREFIX, FMAW_URL_QUERY_PARAMS.SEARCH_PREFIX]
399
- });
400
- }
401
-
402
- // If there is custom sorting provided, then let's update it while using.
403
- var currentSorting = updateFilesSorting({
404
- state: state,
405
- sorting: sorting,
406
- thunkApi: thunkApi
407
- });
408
- changeViewFetchFilesCachedQueries(cachedViewQueries);
409
- var _ref15 = cachedViewQueries || {},
410
- isRecursiveView = _ref15.recursive,
411
- viewPath = _ref15.path,
412
- isNoPaginationView = _ref15.noPagination,
413
- viewQueries = _objectWithoutProperties(_ref15, _excluded2);
414
- var customQueries = _objectSpread(_objectSpread({}, viewQueries), queries);
415
- var filterKeysToDisregard = [];
416
- var isFoldersView = selectIsFoldersView(state);
417
- if (!noFilters && (isFoldersView || customQueries.folder)) {
418
- filterKeysToDisregard.push(FILTER_SECTION_KEYS.FOLDERS);
419
- }
420
- var searchAndFiltersQuery = getQueryForSearchAndFilters(state, {
421
- noSearch: noSearch,
422
- noFilters: noFilters,
423
- filterKeysToDisregard: filterKeysToDisregard,
424
- moreFilters: _objectSpread(_objectSpread({}, filters), defaultFilters)
425
- });
426
- var isCdnPermalinkEnabled = selectIsCdnPermalinkEnabled(state);
427
- var moreQueries = _objectSpread(_objectSpread(_objectSpread({}, searchAndFiltersQuery && {
428
- q: searchAndFiltersQuery
429
- }), customQueries), isCdnPermalinkEnabled && {
430
- fields: 'cdn_permalink'
431
- });
432
- if (!noFilters && moreQueries.folder && selectAppliedFilters(state)[FILTER_SECTION_KEYS.FOLDERS]) {
433
- var _selectAppliedFilters;
434
- moreQueries.folder = ((_selectAppliedFilters = selectAppliedFilters(state)[FILTER_SECTION_KEYS.FOLDERS].value) === null || _selectAppliedFilters === void 0 ? void 0 : _selectAppliedFilters[0]) || moreQueries.folder;
435
- }
436
- var fetchArgs = _objectSpread(_objectSpread({}, xhrOptions), {}, {
437
- id: id,
438
- offset: currentOffset,
439
- limit: currentLimit,
440
- sorting: noSorting ? undefined : currentSorting,
441
- format: format,
442
- noPagination: isNoPaginationView || noPagination,
443
- abortSignal: abortSignal || thunkApi.signal,
444
- moreQueries: moreQueries,
445
- recursive: (_selectIsFolderFilesR = selectIsFolderFilesRecursiveFetch(state)) !== null && _selectIsFolderFilesR !== void 0 ? _selectIsFolderFilesR : isRecursiveView || recursive,
446
- noRecursiveParam: false,
447
- useCustomEncoding: true
448
- });
449
- var selectedItemsCount = selectAllSelectedItemsCount(state);
450
- if ((replaceOldFiles || currentOffset === 0) && selectedItemsCount > 0) {
451
- thunkApi.dispatch(selectionsCleared());
452
- }
453
- var filesRequest = fetch("".concat(viewPath || path, "?preview=2301"), fetchArgs);
454
- if (returnBlob) {
455
- var filesResponse = await filesRequest;
456
- return filesResponse;
457
- }
458
- if (withStats) {
459
- thunkApi.dispatch(fetchFilesStats({
460
- path: path,
461
- fetchArgs: _objectSpread(_objectSpread({}, fetchArgs), {}, {
462
- id: 'listFilesStats'
463
- })
464
- }));
465
- }
466
- var _ref16 = (await filesRequest) || {},
467
- folder = _ref16.base,
468
- _ref16$files = _ref16.files,
469
- files = _ref16$files === void 0 ? [] : _ref16$files,
470
- _ref16$info = _ref16.info,
471
- info = _ref16$info === void 0 ? {} : _ref16$info,
472
- type = _ref16.type;
473
- return _objectSpread(_objectSpread({
474
- fetchType: type
475
- }, isFoldersView && {
476
- folder: folder
477
- }), {}, {
478
- files: files,
479
- // if `replace` is provided, then the files response will contain `replace` for the reducer
480
- // to replace current files in the store, otherwise they will get appended.
481
- replaceOldFiles: replaceOldFiles || currentOffset === 0,
482
- noMoreFiles: files.length < currentLimit * 0.5,
483
- // TODO: Remove "* 0.5" when BE fix issue and send correct number of files, now sometimes they send less. To avoid lazy loading stops we need this hack.
484
- newOffset: currentLimit + currentOffset
485
- }, useSameApiStats && {
486
- stats: {
487
- loading: false,
488
- filesCountMethod: null,
489
- filesCount: info.total_files_count || files.length,
490
- filesSize: info.total_files_size || files.reduce(function (acc, file) {
491
- var _file$size2;
492
- return acc + (file === null || file === void 0 ? void 0 : (_file$size2 = file.size) === null || _file$size2 === void 0 ? void 0 : _file$size2.bytes) || 0;
493
- }, 0)
494
- }
495
- });
496
- }, {
497
- actionType: ACTION_TYPE.FETCH_FILES
498
- });
499
- var getCdnPermalinkFieldsQueryParams = function getCdnPermalinkFieldsQueryParams(isEnabled) {
500
- return isEnabled ? '?fields=cdn_permalink' : '';
501
- };
502
- export var fetchFileByUuid = createThunk(async function () {
503
- var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
504
- var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
505
- // To support old params type in-case of not modified one, but in-fact as a new there is no use-case for it and we should provide object.
506
- var _ref17 = typeof params === 'string' ? {
507
- uuid: params,
508
- addNotFound: true
509
- } : params,
510
- uuid = _ref17.uuid,
511
- _ref17$addNotFound = _ref17.addNotFound,
512
- addNotFound = _ref17$addNotFound === void 0 ? true : _ref17$addNotFound,
513
- _ref17$skipDispatch = _ref17.skipDispatch,
514
- skipDispatch = _ref17$skipDispatch === void 0 ? false : _ref17$skipDispatch;
515
- var isCdnPermalinkEnabled = selectIsCdnPermalinkEnabled(thunkApi.getState());
516
- if (skipDispatch) {
517
- thunkApi.skipDispatch();
518
- }
519
- var _await$thunkApi$extra = await thunkApi.extra.apiClient.get("file/".concat(uuid).concat(getCdnPermalinkFieldsQueryParams(isCdnPermalinkEnabled)), {
520
- id: 'getFile',
521
- abortSignal: thunkApi.signal
522
- }),
523
- _await$thunkApi$extra2 = _await$thunkApi$extra.file,
524
- file = _await$thunkApi$extra2 === void 0 ? {} : _await$thunkApi$extra2;
525
- return _objectSpread(_objectSpread({}, file), {}, {
526
- addNotFound: addNotFound
527
- });
528
- }, {
529
- actionType: "".concat(sliceName, "/updateFileByUuid")
530
- });
531
-
532
- // gets the file from the state only without fetching to be used in places that not able to use selectors.
533
- export var getFileByUuidFromState = createThunk(function (uuid, thunkApi) {
534
- return selectFileByUuid(thunkApi.getState(), uuid);
535
- });
536
- export var renameFile = createThunk(async function (_ref18, thunkApi) {
537
- var uuid = _ref18.uuid,
538
- name = _ref18.name,
539
- _ref18$skipPendingDis = _ref18.skipPendingDispatch,
540
- skipPendingDispatch = _ref18$skipPendingDis === void 0 ? false : _ref18$skipPendingDis;
541
- if (skipPendingDispatch) {
542
- thunkApi.skipPendingDispatch();
543
- }
544
- var _await$thunkApi$extra3 = await thunkApi.extra.apiClient.put("file/".concat(uuid, "/name"), {
545
- data: {
546
- name: name
547
- },
548
- permissionsToCheck: [PERMISSIONS.FILE_RENAME],
549
- abortSignal: thunkApi.signal
550
- }),
551
- _await$thunkApi$extra4 = _await$thunkApi$extra3.file,
552
- file = _await$thunkApi$extra4 === void 0 ? {} : _await$thunkApi$extra4;
553
- return file;
554
- }, {
555
- actionType: "".concat(sliceName, "/updateFileName")
556
- });
557
- export var updateFileMeta = createThunk(async function (_ref19, thunkApi) {
558
- var uuid = _ref19.uuid,
559
- meta = _ref19.meta,
560
- _ref19$skipPendingDis = _ref19.skipPendingDispatch,
561
- skipPendingDispatch = _ref19$skipPendingDis === void 0 ? false : _ref19$skipPendingDis;
562
- if (skipPendingDispatch) {
563
- thunkApi.skipPendingDispatch();
564
- }
565
- if (Object.keys(meta).length < 1) {
566
- return selectFileByUuid(thunkApi.getState(), uuid);
567
- }
568
- var _await$thunkApi$extra5 = await thunkApi.extra.apiClient.put("file/".concat(uuid, "/meta"), {
569
- data: {
570
- meta: meta
571
- },
572
- permissionToCheck: [PERMISSIONS.FILE_META],
573
- enabledAbort: false,
574
- abortSignal: thunkApi.signal
575
- }),
576
- _await$thunkApi$extra6 = _await$thunkApi$extra5.file,
577
- file = _await$thunkApi$extra6 === void 0 ? {} : _await$thunkApi$extra6;
578
- return file;
579
- }, {
580
- actionType: "".concat(sliceName, "/updateFileMeta")
581
- });
582
- export var updateFileTags = createThunk(async function (_ref20, thunkApi) {
583
- var uuid = _ref20.uuid,
584
- languageKey = _ref20.languageKey,
585
- existingTags = _ref20.existingTags,
586
- newTags = _ref20.newTags,
587
- _ref20$skipPendingDis = _ref20.skipPendingDispatch,
588
- skipPendingDispatch = _ref20$skipPendingDis === void 0 ? false : _ref20$skipPendingDis;
589
- if (skipPendingDispatch) {
590
- thunkApi.skipPendingDispatch();
591
- }
592
- var _await$thunkApi$extra7 = await thunkApi.extra.apiClient.put("file/".concat(uuid, "/tags"), {
593
- data: _objectSpread(_objectSpread({
594
- lang: languageKey
595
- }, existingTags ? {
596
- existing_tags: existingTags
597
- } : {}), newTags ? {
598
- new_tags: newTags
599
- } : {}),
600
- permissionToCheck: [PERMISSIONS.FILE_META],
601
- abortSignal: thunkApi.signal
602
- }),
603
- _await$thunkApi$extra8 = _await$thunkApi$extra7.file,
604
- file = _await$thunkApi$extra8 === void 0 ? {} : _await$thunkApi$extra8;
605
- return file;
606
- }, {
607
- actionType: "".concat(sliceName, "/updateFileTags")
608
- });
609
- export var updateFileProduct = createThunk(async function (_ref21, thunkApi) {
610
- var uuid = _ref21.uuid,
611
- product = _ref21.product,
612
- _ref21$skipPendingDis = _ref21.skipPendingDispatch,
613
- skipPendingDispatch = _ref21$skipPendingDis === void 0 ? false : _ref21$skipPendingDis;
614
- if (skipPendingDispatch) {
615
- thunkApi.skipPendingDispatch();
616
- }
617
- var _await$thunkApi$extra9 = await thunkApi.extra.apiClient.put("file/".concat(uuid, "/product"), {
618
- data: {
619
- product: product
620
- },
621
- permissionToCheck: [PERMISSIONS.FILE_PRODUCT_CHANGE],
622
- abortSignal: thunkApi.signal
623
- }),
624
- _await$thunkApi$extra10 = _await$thunkApi$extra9.file,
625
- file = _await$thunkApi$extra10 === void 0 ? {} : _await$thunkApi$extra10;
626
- return file;
627
- }, {
628
- actionType: "".concat(sliceName, "/updateFileProduct")
629
- });
630
- export var generateFileTags = createThunk(async function (_ref22, thunkApi) {
631
- var _ref22$uuid = _ref22.uuid,
632
- uuid = _ref22$uuid === void 0 ? '' : _ref22$uuid,
633
- _ref22$provider = _ref22.provider,
634
- provider = _ref22$provider === void 0 ? 'google' : _ref22$provider,
635
- _ref22$confidence = _ref22.confidence,
636
- confidence = _ref22$confidence === void 0 ? 60 : _ref22$confidence,
637
- _ref22$limit = _ref22.limit,
638
- limit = _ref22$limit === void 0 ? 10 : _ref22$limit,
639
- _ref22$languages = _ref22.languages,
640
- languages = _ref22$languages === void 0 ? ['en'] : _ref22$languages;
641
- var _await$thunkApi$extra11 = await thunkApi.extra.apiClient.post('process/autotag', {
642
- data: {
643
- file: {
644
- uuid: uuid
645
- },
646
- meta: {
647
- languages: languages,
648
- provider: provider,
649
- limit: limit,
650
- confidence: confidence
651
- }
652
- },
653
- permissionToCheck: [PERMISSIONS.FILE_META],
654
- id: 'generateTags',
655
- abortSignal: thunkApi.signal
656
- }),
657
- file = _await$thunkApi$extra11.file;
658
- return file;
659
- });
660
- export var generateFileDescription = createThunk(async function (_ref23, thunkApi) {
661
- var _ref23$uuid = _ref23.uuid,
662
- uuid = _ref23$uuid === void 0 ? '' : _ref23$uuid;
663
- var state = thunkApi.getState();
664
- var metaRegionalGroups = selectMetadataRegionalGroups(state);
665
- var activeRegionalLangKey = selectActiveRegionalLang(state);
666
- var regionalLanguages = getMetaRegionalGroupsLanguagesApiValues(metaRegionalGroups);
667
- var includeActiveLang = DESCRIBE_AI_SUPPORTED_LANGUAGES[activeRegionalLangKey];
668
- var supportedLanguages = regionalLanguages.filter(function (lang) {
669
- return lang !== activeRegionalLangKey && lang !== 'en' && DESCRIBE_AI_SUPPORTED_LANGUAGES[lang];
670
- });
671
- var languages = [].concat(_toConsumableArray(includeActiveLang ? [activeRegionalLangKey] : []), _toConsumableArray(supportedLanguages)).slice(0, 5);
672
- var response = await thunkApi.extra.apiClient.post('process/describe', {
673
- data: {
674
- file: {
675
- uuid: uuid
676
- },
677
- meta: {
678
- languages: languages
679
- }
680
- },
681
- abortSignal: thunkApi.signal
682
- });
683
- if (response !== null && response !== void 0 && response.translations) {
684
- return _objectSpread({
685
- en: response.response
686
- }, response.translations);
687
- }
688
- return _defineProperty({}, languages[0], response === null || response === void 0 ? void 0 : response.response);
689
- });
690
- export var searchFilesService = async function searchFilesService(params, thunkApi) {
691
- var requestProgress = params.requestProgress,
692
- abortFunction = params.abortFunction,
693
- sendStatsReq = params.sendStatsReq,
694
- responseType = params.responseType,
695
- headers = params.headers,
696
- replaceOldFiles = params.replaceOldFiles,
697
- searchParams = _objectWithoutProperties(params, _excluded3);
698
- var url = prepareSearchUrl(_objectSpread(_objectSpread({}, searchParams), {}, {
699
- apiPath: 'files?preview=2301'
700
- }), function (queryItems) {
701
- if (sendStatsReq) {
702
- thunkApi.dispatch(fetchFilesStats({
703
- path: 'files',
704
- queryParams: queryItems,
705
- fetchArgs: {
706
- id: 'searchFilesStats',
707
- abortSignal: thunkApi.signal
708
- }
709
- }));
710
- }
711
- });
712
- var searchResponse = (await thunkApi.extra.apiClient.get(url, {
713
- id: searchParams.method === SEARCH_METHODS.EXTENDED ? 'searchFilesExtended' : 'searchFiles',
714
- onProgress: requestProgress,
715
- onAbort: abortFunction,
716
- headers: headers,
717
- responseType: responseType,
718
- abortSignal: thunkApi.signal
719
- })) || {};
720
- return responseType === 'blob' ? searchResponse : {
721
- files: searchResponse.files,
722
- replaceOldFiles: replaceOldFiles
723
- };
724
- };
725
- export var moveFiles = createThunk(async function (_ref25, thunkApi) {
726
- var _ref25$fileUuids = _ref25.fileUuids,
727
- fileUuids = _ref25$fileUuids === void 0 ? [] : _ref25$fileUuids,
728
- folderPath = _ref25.folderPath;
729
- var response = await thunkApi.extra.apiClient.post("files".concat(getCdnPermalinkFieldsQueryParams(selectIsCdnPermalinkEnabled(thunkApi.getState()))), {
730
- data: {
731
- files_uuids: fileUuids,
732
- new_folder_name: folderPath
733
- },
734
- permissionToCheck: [PERMISSIONS.FILE_MOVE],
735
- abortSignal: thunkApi.signal
736
- });
737
- return response.files.map(function (file) {
738
- return file.uuid;
739
- });
740
- }, {
741
- actionType: "".concat(sliceName, "/moveFiles")
742
- });
743
- export var deleteFiles = createThunk(async function (uuids, thunkApi) {
744
- var response = await thunkApi.extra.apiClient["delete"]("files".concat(getCdnPermalinkFieldsQueryParams(selectIsCdnPermalinkEnabled(thunkApi.getState()))), {
745
- data: {
746
- files_uuids: uuids
747
- },
748
- permissionToCheck: [PERMISSIONS.FILE_DELETE],
749
- abortSignal: thunkApi.signal
750
- });
751
- thunkApi.extra.filerobot.emit('objects-removed', uuids, 'files');
752
- return response.files_uuids;
753
- }, {
754
- actionType: "".concat(sliceName, "/deleteFiles")
755
- });
756
- export var openFileWindowFromUrl = createThunk(function (_, thunkApi) {
757
- var _thunkApi$extra$filer4 = thunkApi.extra.filerobot.getPlugin(PLUGINS_IDS.EXPLORER),
758
- getUrlQueryParam = _thunkApi$extra$filer4.getUrlQueryParam;
759
- var fileUuidFromUrl = decodeB64ToStr(getUrlQueryParam(FMAW_URL_QUERY_PARAMS.FILE_WINDOW));
760
- var currentFileWindowUuid = selectFileWindowFor(thunkApi.getState());
761
- if (fileUuidFromUrl && fileUuidFromUrl !== currentFileWindowUuid) {
762
- var tabToOpen = getUrlQueryParam(FMAW_URL_QUERY_PARAMS.FILE_WINDOW_TAB);
763
- thunkApi.dispatch(fileWindowUpdated({
764
- "for": fileUuidFromUrl,
765
- tabId: tabToOpen
766
- }));
767
- return thunkApi.dispatch(fetchFileByUuid({
768
- uuid: fileUuidFromUrl
769
- }));
770
- }
771
- });
772
- export var getFileConfiguredCdnLink = createThunk(function (file, thunkApi) {
773
- if (!file || _typeof(file) !== 'object') {
774
- return;
775
- }
776
- var isCdnPermalinkEnabled = selectIsCdnPermalinkEnabled(thunkApi.getState());
777
- var cdnPermalink = isCdnPermalinkEnabled && getFileLink(file, 'cdn_permalink');
778
- return cdnPermalink || getFileLink(file);
779
- });
780
- export var copyFileCdnLink = createThunk(function (file, thunkApi) {
781
- if (!file || _typeof(file) !== 'object') {
782
- return;
783
- }
784
- var _thunkApi$extra$filer5 = thunkApi.extra.filerobot.getPlugin(PLUGINS_IDS.EXPLORER),
785
- info = _thunkApi$extra$filer5.info,
786
- i18n = _thunkApi$extra$filer5.i18n;
787
- var link = thunkApi.dispatch(getFileConfiguredCdnLink(file));
788
- copyText({
789
- text: link,
790
- i18n: i18n,
791
- info: info
792
- });
793
- return link;
794
- });
795
- var filesSlice = createSlice({
796
- name: sliceName,
797
- initialState: getInitialState(),
798
- reducers: {
799
- filesAdded: function filesAdded(state, action) {
800
- var _action$payload = action.payload,
801
- files = _action$payload.files,
802
- newOffset = _action$payload.newOffset,
803
- noMoreFiles = _action$payload.noMoreFiles,
804
- stats = _action$payload.stats;
805
- var _getNormalizedItems = getNormalizedItems(files, {
806
- extraProps: {
807
- loading: false,
808
- error: null
809
- }
810
- }),
811
- normalizedSlices = _getNormalizedItems.normalizedSlices;
812
- var newFiles = _objectSpread(_objectSpread({}, state.entities), normalizedSlices);
813
- var newUuids = Object.keys(newFiles);
814
- return _objectSpread(_objectSpread({}, state), {}, {
815
- entities: newFiles,
816
- uuids: newUuids,
817
- loading: false,
818
- error: null,
819
- offset: newOffset,
820
- noMoreFiles: noMoreFiles
821
- }, stats && {
822
- stats: stats
823
- });
824
- },
825
- fileAdded: function fileAdded(state, action) {
826
- var _state$stats$filesCou;
827
- var newUuids = state.uuids;
828
- var addedFile = action.payload;
829
- var newFiles = _objectSpread({}, state.entities);
830
- // This case for handling the case when we upload a file that same considered as version for a current file, we recognize that through their names
831
- var foundFile = Object.values(state.entities).find(function (file) {
832
- return file.name === addedFile.name;
833
- });
834
- if (foundFile) {
835
- delete newFiles[foundFile.uuid];
836
- newUuids = newUuids.filter(function (uuid) {
837
- return uuid !== foundFile.uuid;
838
- });
839
- }
840
- newFiles[addedFile.uuid] = addedFile;
841
- newUuids = [addedFile.uuid].concat(_toConsumableArray(newUuids));
842
- return _objectSpread(_objectSpread({}, state), {}, {
843
- stats: _objectSpread(_objectSpread({}, state.stats), {}, {
844
- // if `foundFile` true then don't increase the files count, as the file is replacing the current one.
845
- filesCount: ((_state$stats$filesCou = state.stats.filesCount) !== null && _state$stats$filesCou !== void 0 ? _state$stats$filesCou : 0) + (foundFile ? 0 : 1)
846
- }),
847
- entities: newFiles,
848
- uuids: newUuids,
849
- loading: false,
850
- error: null
851
- });
852
- },
853
- filesReplaced: function filesReplaced(state, action) {
854
- var _action$payload2 = action.payload,
855
- files = _action$payload2.files,
856
- _action$payload2$newO = _action$payload2.newOffset,
857
- newOffset = _action$payload2$newO === void 0 ? 0 : _action$payload2$newO,
858
- noMoreFiles = _action$payload2.noMoreFiles,
859
- _action$payload2$erro = _action$payload2.error,
860
- error = _action$payload2$erro === void 0 ? null : _action$payload2$erro,
861
- stats = _action$payload2.stats,
862
- overrideLoading = _action$payload2.overrideLoading;
863
- var newFiles = {};
864
- var newFilesUuids = [];
865
- if (Array.isArray(files)) {
866
- var _getNormalizedItems2 = getNormalizedItems(files, {
867
- extraProps: _objectSpread(_objectSpread({}, !overrideLoading && {
868
- loading: false
869
- }), {}, {
870
- error: null
871
- })
872
- }),
873
- normalizedSlices = _getNormalizedItems2.normalizedSlices,
874
- uuids = _getNormalizedItems2.uuids;
875
- newFiles = normalizedSlices;
876
- newFilesUuids = uuids;
877
- } else {
878
- newFiles = _objectSpread({}, files);
879
- newFilesUuids = Object.keys(newFiles);
880
- }
881
- return _objectSpread(_objectSpread({}, state), {}, {
882
- entities: newFiles,
883
- uuids: newFilesUuids,
884
- loading: false,
885
- error: error,
886
- offset: newOffset,
887
- noMoreFiles: noMoreFiles
888
- }, stats && {
889
- stats: stats
890
- });
891
- },
892
- fileReplacedByNewer: function fileReplacedByNewer(state, action) {
893
- var _action$payload3 = action.payload,
894
- oldFileUuid = _action$payload3.oldFileUuid,
895
- newFile = _action$payload3.newFile,
896
- _action$payload3$erro = _action$payload3.error,
897
- error = _action$payload3$erro === void 0 ? null : _action$payload3$erro;
898
- var newFiles = _objectSpread({}, state.entities);
899
- var newUuids = _toConsumableArray(state.uuids);
900
- delete newFiles[oldFileUuid];
901
- newFiles[newFile.uuid] = newFile;
902
- var findOlderUuidIndex = newUuids.indexOf(oldFileUuid);
903
- if (findOlderUuidIndex > -1) {
904
- newUuids[findOlderUuidIndex] = newFile.uuid;
905
- }
906
- return _objectSpread(_objectSpread({}, state), {}, {
907
- loading: false,
908
- error: error,
909
- entities: newFiles,
910
- uuids: newUuids
911
- });
912
- },
913
- filesRemoved: function filesRemoved(state) {
914
- var _state$stats, _state$stats2;
915
- var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
916
- var removedFileUuids = action.payload;
917
- if (!Array.isArray(removedFileUuids)) {
918
- return _objectSpread(_objectSpread({}, state), {}, {
919
- entities: {},
920
- uuids: [],
921
- loading: false,
922
- error: null,
923
- stats: _objectSpread(_objectSpread({}, state.stats), {}, {
924
- filesCount: 0,
925
- filesSize: 0
926
- })
927
- });
928
- }
929
- var currentFiles = _objectSpread({}, state.entities);
930
- var newUuids = state.uuids;
931
- var isFileRemoved = false;
932
- var removedFilesSize = 0;
933
- removedFileUuids.forEach(function (fileUuid) {
934
- if (currentFiles[fileUuid]) {
935
- var _currentFiles$fileUui;
936
- removedFilesSize += ((_currentFiles$fileUui = currentFiles[fileUuid].size) === null || _currentFiles$fileUui === void 0 ? void 0 : _currentFiles$fileUui.bytes) || 0;
937
- delete currentFiles[fileUuid];
938
- newUuids = newUuids.filter(function (uuid) {
939
- return fileUuid !== uuid;
940
- });
941
- isFileRemoved = true;
942
- }
943
- });
944
- if (!isFileRemoved) {
945
- return state;
946
- }
947
- return _objectSpread(_objectSpread({}, state), {}, {
948
- entities: currentFiles,
949
- uuids: newUuids,
950
- stats: _objectSpread(_objectSpread({}, state.stats), {}, {
951
- filesSize: Math.max(0, (((_state$stats = state.stats) === null || _state$stats === void 0 ? void 0 : _state$stats.filesSize) || 0) - removedFilesSize),
952
- filesCount: Math.max(0, (((_state$stats2 = state.stats) === null || _state$stats2 === void 0 ? void 0 : _state$stats2.filesCount) || 0) - removedFileUuids.length)
953
- })
954
- });
955
- },
956
- filesUpdated: function filesUpdated(state, action) {
957
- var files = action.payload;
958
- var updatedFiles = _objectSpread({}, state.entities);
959
- files.forEach(function (file) {
960
- if (!updatedFiles[file.uuid]) {
961
- return;
962
- }
963
- updatedFiles[file.uuid] = _objectSpread(_objectSpread({}, state.entities[file.uuid]), {}, {
964
- // Those will get overridden if their values are assigned inside the filesUpdated
965
- loading: false,
966
- error: null
967
- }, file);
968
- });
969
- return _objectSpread(_objectSpread({}, state), {}, {
970
- entities: updatedFiles
971
- });
972
- },
973
- fileUpdated: function fileUpdated(state, action) {
974
- var _ref26 = action.payload || {},
975
- fileUuid = _ref26.uuid,
976
- _ref26$addNotFound = _ref26.addNotFound,
977
- addNotFound = _ref26$addNotFound === void 0 ? false : _ref26$addNotFound;
978
- if (!fileUuid) {
979
- return state;
980
- }
981
- var updatedFiles = _objectSpread({}, state.entities);
982
- if (!updatedFiles[fileUuid] && !addNotFound) {
983
- return state;
984
- }
985
- var _action$payload4 = action.payload,
986
- _ = _action$payload4.addNotFound,
987
- newFile = _objectWithoutProperties(_action$payload4, _excluded4);
988
- updatedFiles[fileUuid] = _objectSpread(_objectSpread({}, updatedFiles[fileUuid]), newFile);
989
- return _objectSpread(_objectSpread({}, state), {}, {
990
- entities: updatedFiles
991
- }, addNotFound && {
992
- tmpFile: updatedFiles[fileUuid]
993
- });
994
- },
995
- removingBackgroundUuidsUpdated: function removingBackgroundUuidsUpdated(state, action) {
996
- return _objectSpread(_objectSpread({}, state), {}, {
997
- removingBackgroundUuids: action.payload
998
- });
999
- },
1000
- filesLoadingSet: function filesLoadingSet(state, action) {
1001
- var isLoading = action.payload;
1002
- return _objectSpread(_objectSpread({}, state), {}, {
1003
- loading: isLoading
1004
- }, isLoading && {
1005
- entities: {},
1006
- uuids: [],
1007
- stats: _objectSpread(_objectSpread({}, state.stats), {}, {
1008
- filesCount: 0,
1009
- filesSize: 0
1010
- })
1011
- });
1012
- },
1013
- filesSortingUpdated: function filesSortingUpdated(state, action) {
1014
- var _action$payload5 = action.payload,
1015
- _action$payload5$sort = _action$payload5.sortBy,
1016
- sortBy = _action$payload5$sort === void 0 ? state.sortedBy : _action$payload5$sort,
1017
- _action$payload5$orde = _action$payload5.order,
1018
- order = _action$payload5$orde === void 0 ? state.sortOrder : _action$payload5$orde;
1019
- var isTheSameSort = sortBy === state.sortedBy && order === state.sortOrder;
1020
- if (isTheSameSort) {
1021
- return state;
1022
- }
1023
- return _objectSpread(_objectSpread({}, state), {}, {
1024
- sortedBy: sortBy,
1025
- sortOrder: order
1026
- });
1027
- },
1028
- filesVariationsUpdated: function filesVariationsUpdated(state, action) {
1029
- return _objectSpread(_objectSpread({}, state), {}, {
1030
- variations: action.payload
1031
- });
1032
- }
1033
- },
1034
- extraReducers: function extraReducers(builder) {
1035
- builder.addCase(moveFiles.fulfilled, function (state, action) {
1036
- return filesSlice.caseReducers.filesRemoved(state, action);
1037
- }).addCase(deleteFiles.fulfilled, function (state, action) {
1038
- return filesSlice.caseReducers.filesRemoved(state, action);
1039
- }).addCase(fetchFilesStats.pending, function (state) {
1040
- return _objectSpread(_objectSpread({}, state), {}, {
1041
- stats: _objectSpread(_objectSpread({}, state.stats), {}, {
1042
- filesCount: 0,
1043
- filesSize: 0,
1044
- loading: true
1045
- })
1046
- });
1047
- }).addCase(viewChanged.type, getInitialState).addCase(fileWindowUpdated.type, function (state, action) {
1048
- return action.payload === null ? _objectSpread(_objectSpread({}, state), {}, {
1049
- tmpFile: null
1050
- }) : state;
1051
- }).addMatcher(isAnyOf(fetchFiles.pending, searchFilesWithAiText.pending, searchSimilarFiles.pending), function (state) {
1052
- return _objectSpread(_objectSpread({}, state), {}, {
1053
- uuids: [],
1054
- entities: {},
1055
- loading: true,
1056
- error: null
1057
- });
1058
- }).addMatcher(isAnyOf(fetchFiles.fulfilled, searchFilesWithAiText.fulfilled, searchSimilarFiles.fulfilled), function (state, action) {
1059
- return action.payload.replaceOldFiles ? filesSlice.caseReducers.filesReplaced(state, action) : filesSlice.caseReducers.filesAdded(state, action);
1060
- }).addMatcher(isAnyOf(fetchFiles.rejected, searchFilesWithAiText.rejected, searchSimilarFiles.rejected), function (state, action) {
1061
- return _objectSpread(_objectSpread({}, getActionErrorState(state, action)), {}, {
1062
- uuids: [],
1063
- entities: {}
1064
- });
1065
- }).addMatcher(isAnyOf(fetchFilesStats.fulfilled, fetchFilesStats.rejected), function (state, action) {
1066
- return _objectSpread(_objectSpread({}, state), {}, {
1067
- stats: _objectSpread(_objectSpread(_objectSpread({}, state.stats), action.payload), {}, {
1068
- loading: false
1069
- })
1070
- });
1071
- }).addMatcher(function (_ref27) {
1072
- var type = _ref27.type;
1073
- return type.startsWith(sliceName) && Boolean(type.match(/\/updateFile.*\/pending/));
1074
- }, function (state, action) {
1075
- var _action$meta$arg, _action$meta$arg2;
1076
- return filesSlice.caseReducers.fileUpdated(state, {
1077
- payload: {
1078
- uuid: ((_action$meta$arg = action.meta.arg) === null || _action$meta$arg === void 0 ? void 0 : _action$meta$arg.uuid) || ((_action$meta$arg2 = action.meta.arg) === null || _action$meta$arg2 === void 0 ? void 0 : _action$meta$arg2.fileUuid) || action.meta.arg,
1079
- loading: true,
1080
- error: null
1081
- }
1082
- });
1083
- }).addMatcher(function (_ref28) {
1084
- var type = _ref28.type;
1085
- return type.startsWith(sliceName) && Boolean(type.match(/\/updateFile.*\/fulfilled/));
1086
- }, function (state, action) {
1087
- return filesSlice.caseReducers.fileUpdated(state, {
1088
- payload: _objectSpread(_objectSpread({}, action.payload), {}, {
1089
- loading: false,
1090
- error: null
1091
- })
1092
- });
1093
- }).addMatcher(function (_ref29) {
1094
- var type = _ref29.type;
1095
- return type.startsWith(sliceName) && Boolean(type.match(/\/updateFile.*\/rejected/));
1096
- }, function (state, action) {
1097
- var _action$meta$arg3, _action$meta$arg4;
1098
- return filesSlice.caseReducers.fileUpdated(state, {
1099
- payload: {
1100
- uuid: ((_action$meta$arg3 = action.meta.arg) === null || _action$meta$arg3 === void 0 ? void 0 : _action$meta$arg3.uuid) || ((_action$meta$arg4 = action.meta.arg) === null || _action$meta$arg4 === void 0 ? void 0 : _action$meta$arg4.fileUuid) || action.meta.arg,
1101
- loading: false,
1102
- error: getActionErrorState(state, action, true)
1103
- }
1104
- });
1105
- }).addMatcher(function (_ref30) {
1106
- var type = _ref30.type;
1107
- return type.startsWith(sliceName) && Boolean(type.match(/\/updateFiles.*\/pending/));
1108
- }, function (state, action) {
1109
- var _action$meta$arg5, _action$meta$arg6;
1110
- return filesSlice.caseReducers.filesUpdated(state, {
1111
- payload: (((_action$meta$arg5 = action.meta.arg) === null || _action$meta$arg5 === void 0 ? void 0 : _action$meta$arg5.filesUuids) || ((_action$meta$arg6 = action.meta.arg) === null || _action$meta$arg6 === void 0 ? void 0 : _action$meta$arg6.uuids) || action.meta.arg || []).map(function (uuid) {
1112
- return {
1113
- uuid: uuid,
1114
- loading: true,
1115
- error: null
1116
- };
1117
- })
1118
- });
1119
- }).addMatcher(function (_ref31) {
1120
- var type = _ref31.type;
1121
- return type.startsWith(sliceName) && Boolean(type.match(/\/updateFiles.*\/fulfilled/));
1122
- }, function (state, action) {
1123
- return action.payload.removeFiles ? filesSlice.caseReducers.filesRemoved(state, {
1124
- payload: action.payload.filesUuids
1125
- }) : filesSlice.caseReducers.filesUpdated(state, action);
1126
- }).addMatcher(function (_ref32) {
1127
- var type = _ref32.type;
1128
- return type.startsWith(sliceName) && Boolean(type.match(/\/updateFiles.*\/rejected/));
1129
- }, function (state, action) {
1130
- var _action$meta$arg7, _action$meta$arg8;
1131
- return filesSlice.caseReducers.filesUpdated(state, {
1132
- payload: (((_action$meta$arg7 = action.meta.arg) === null || _action$meta$arg7 === void 0 ? void 0 : _action$meta$arg7.filesUuids) || ((_action$meta$arg8 = action.meta.arg) === null || _action$meta$arg8 === void 0 ? void 0 : _action$meta$arg8.uuids) || action.meta.arg || []).map(function (uuid) {
1133
- return {
1134
- uuid: uuid,
1135
- loading: false,
1136
- error: getActionErrorState(state, action, true)
1137
- };
1138
- })
1139
- });
1140
- });
1141
- }
1142
- });
1143
- var _filesSlice$actions = filesSlice.actions,
1144
- filesAdded = _filesSlice$actions.filesAdded,
1145
- fileAdded = _filesSlice$actions.fileAdded,
1146
- filesReplaced = _filesSlice$actions.filesReplaced,
1147
- filesRemoved = _filesSlice$actions.filesRemoved,
1148
- filesUpdated = _filesSlice$actions.filesUpdated,
1149
- fileUpdated = _filesSlice$actions.fileUpdated,
1150
- fileReplacedByNewer = _filesSlice$actions.fileReplacedByNewer,
1151
- removingBackgroundUuidsUpdated = _filesSlice$actions.removingBackgroundUuidsUpdated,
1152
- filesLoadingSet = _filesSlice$actions.filesLoadingSet,
1153
- filesSortingUpdated = _filesSlice$actions.filesSortingUpdated,
1154
- filesVariationsUpdated = _filesSlice$actions.filesVariationsUpdated;
1155
- export { filesAdded, fileAdded, filesReplaced, filesRemoved, filesUpdated, fileUpdated, fileReplacedByNewer, removingBackgroundUuidsUpdated, filesLoadingSet, filesSortingUpdated, filesVariationsUpdated };
1156
- export var selectFilesState = function selectFilesState(state) {
1157
- var _state$PLUGINS_IDS$EX;
1158
- return ((_state$PLUGINS_IDS$EX = state[PLUGINS_IDS.EXPLORER]) === null || _state$PLUGINS_IDS$EX === void 0 ? void 0 : _state$PLUGINS_IDS$EX[slicePropName]) || getInitialState();
1159
- };
1160
-
1161
- // returns the files entities object that are relative to folder's/backend's files not searched nor being uploaded.
1162
- export var selectFiles = function selectFiles(state) {
1163
- return selectFilesState(state).entities;
1164
- };
1165
- export var selectFilesArray = createSelector(selectFiles, function (files) {
1166
- return Object.values(files);
1167
- });
1168
- export var selectFilesUuids = function selectFilesUuids(state) {
1169
- return selectFilesState(state).uuids;
1170
- };
1171
- export var selectFilesStats = function selectFilesStats(state) {
1172
- return selectFilesState(state).stats;
1173
- };
1174
- export var selectFileByUuid = function selectFileByUuid(state, fileUuid) {
1175
- return selectFiles(state)[fileUuid];
1176
- };
1177
- export var selectFilesByUuids = createSelector([selectFiles, function (_state, fileUuids) {
1178
- return fileUuids;
1179
- }], function (files, fileUuids) {
1180
- return fileUuids.map(function (fileUuid) {
1181
- return files[fileUuid];
1182
- });
1183
- });
1184
- export var selectIsFilesLoading = function selectIsFilesLoading(state) {
1185
- return selectFilesState(state).loading;
1186
- };
1187
- export var selectFilesOffset = function selectFilesOffset(state) {
1188
- return selectFilesState(state).offset;
1189
- };
1190
- export var selectIsNoMoreFiles = function selectIsNoMoreFiles(state) {
1191
- return selectFilesState(state).noMoreFiles;
1192
- };
1193
- export var selectCurrentFiles = function selectCurrentFiles(state) {
1194
- var isUploadsPanelShown = selectIsUploadsPanelOpened(state);
1195
- if (isUploadsPanelShown) {
1196
- return selectUploads(state);
1197
- }
1198
-
1199
- // If search view (exact & extended) files, if filters only applied then deal with it as files normally.
1200
- if (selectIsSearchMode(state)) {
1201
- return selectAllSearchFiles(state);
1202
- }
1203
- return selectFiles(state);
1204
- };
1205
- export var selectCurrentFilesUuids = function selectCurrentFilesUuids(state) {
1206
- // If search view (exact & extended) files, if filters only applied then deal with it as files normally.
1207
- if (selectIsSearchMode(state) && !selectIsAiSearch(state)) {
1208
- return selectAllSearchFilesUuids(state);
1209
- }
1210
- return selectFilesUuids(state);
1211
- };
1212
- export var selectIsCurrentFilesLoading = function selectIsCurrentFilesLoading(state) {
1213
- // If search view (exact & extended) files, if filters only applied then deal with it as files normally.
1214
- if (selectIsSearchMode(state) && !selectIsAiSearch(state)) {
1215
- return selectIsQuickFetching(state) && selectIsQuickFetching(state);
1216
- }
1217
- return selectIsFilesLoading(state);
1218
- };
1219
- export var selectCurrentFilesIdsOrUuids = function selectCurrentFilesIdsOrUuids(state) {
1220
- var isUploadsPanelShown = selectIsUploadsPanelOpened(state);
1221
- if (isUploadsPanelShown) {
1222
- return selectUploadsIds(state);
1223
- }
1224
- return selectCurrentFilesUuids(state);
1225
- };
1226
-
1227
- // Once files uploaded in contextual menu we need to get file data from server
1228
- var getAlreadyUploadedFilesFromCurrentUploads = function getAlreadyUploadedFilesFromCurrentUploads(currentUploads) {
1229
- return Object.values(currentUploads).reduce(function (acc, currentFileInUpload) {
1230
- if (currentFileInUpload.response) {
1231
- var file = currentFileInUpload.response.body.file;
1232
- if (file !== null && file !== void 0 && file.uuid) {
1233
- acc[file.uuid] = file;
1234
- }
1235
- }
1236
- return acc;
1237
- }, {});
1238
- };
1239
-
1240
- // Selectors for the file window/bulk edit modal...etc, as they are possible to be opened through upload panel or items' browser.
1241
- // priority goes for uploads so if we found the passed files in uploads then use them instead of current files.
1242
- export var selectCurrentFilesByIdsOrUuids = createSelector([function (state) {
1243
- return selectIsSearchOrFiltersMode(state);
1244
- },
1245
- // called like that to avoid initialization issue
1246
- function (state) {
1247
- return selectAllSearchFiles(state);
1248
- }, selectFiles, selectUploads, function (_state, filesIdsOrUuids) {
1249
- return filesIdsOrUuids;
1250
- }], function (isSearchView, searchedFiles, files, uploads, filesIdsOrUuids) {
1251
- return (filesIdsOrUuids || []).map(function (idOrUuid) {
1252
- return isSearchView && searchedFiles[idOrUuid] || files[idOrUuid] || uploads[idOrUuid];
1253
- }).filter(Boolean);
1254
- });
1255
- export var selectCurrentFileByIdOrUuid = function selectCurrentFileByIdOrUuid(state, fileIdOrUuid) {
1256
- // In case it's not a string then we expect it to be file object.
1257
- if (typeof fileIdOrUuid !== 'string') return fileIdOrUuid;
1258
-
1259
- // If in searchView find the file using fileIdOrUuid in the searched files
1260
- if (selectIsSearchOrFiltersMode(state)) {
1261
- var searchedFile = selectAllSearchFiles(state)[fileIdOrUuid];
1262
- // Return file if found in the searched files
1263
- if (searchedFile) return searchedFile;
1264
- }
1265
-
1266
- // Find the file using fileIdOrUuid in the uploaded files
1267
- var files = selectFiles(state);
1268
- var selectedFile = files[fileIdOrUuid];
1269
-
1270
- // Return file if found in the already uploaded files
1271
- if (selectedFile) return selectedFile;
1272
-
1273
- // Find the file using fileIdOrUuid in the staging uploads
1274
- var uploads = selectUploads(state);
1275
- return uploads[fileIdOrUuid] || getAlreadyUploadedFilesFromCurrentUploads(uploads)[fileIdOrUuid] || selectCurrentTmpFile(state, fileIdOrUuid);
1276
- };
1277
- export var selectCurrentTmpFile = function selectCurrentTmpFile(state, fileUuid) {
1278
- var file = selectFilesState(state).tmpFile;
1279
- return !fileUuid || (file === null || file === void 0 ? void 0 : file.uuid) === fileUuid ? file : undefined;
1280
- };
1281
- export var selectCurrentFileByUuid = function selectCurrentFileByUuid(state, fileUuid) {
1282
- return selectExactSearchFileByUuid(state, fileUuid) || selectExtendedSearchFileByUuid(state, fileUuid) || selectFileByUuid(state, fileUuid) || selectCurrentTmpFile(state, fileUuid);
1283
- };
1284
- export var selectCurrentFilesArray = createSelector(selectCurrentFiles, function () {
1285
- var files = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1286
- return Object.values(files);
1287
- });
1288
- export var selectFilesSortedBy = function selectFilesSortedBy(state) {
1289
- return selectFilesState(state).sortedBy;
1290
- };
1291
- export var selectFilesSortOrder = function selectFilesSortOrder(state) {
1292
- return selectFilesState(state).sortOrder;
1293
- };
1294
- export var selectFilesError = function selectFilesError(state) {
1295
- return selectFilesState(state).error;
1296
- };
1297
- export var selectIsNoFilesFound = function selectIsNoFilesFound(state) {
1298
- var _selectCurrentFilesUu;
1299
- return ((_selectCurrentFilesUu = selectCurrentFilesUuids(state)) === null || _selectCurrentFilesUu === void 0 ? void 0 : _selectCurrentFilesUu.length) === 0;
1300
- };
1301
- export var selectFilesVariations = function selectFilesVariations(state) {
1302
- return selectFilesState(state).variations;
1303
- };
1304
- export var selectIsSearchOrFilesLoading = function selectIsSearchOrFilesLoading(state) {
1305
- return selectIsSearchMode(state) && !selectIsAiSearch(state) ? selectIsQuickFetching(state) || selectIsExtendFetching(state) : selectIsFilesLoading(state);
1306
- };
1307
- export default filesSlice.reducer;