@scaleflex/widget-explorer 4.4.0 → 4.5.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.
- package/CHANGELOG.md +11 -0
- package/dist/style.css +2197 -0
- package/dist/style.min.css +1 -0
- package/lib/Explorer.styled.js +48 -0
- package/lib/components/ActionBar/ActionBar.styled.js +103 -0
- package/lib/components/ActionBar/DownloadWithExportButton.js +203 -0
- package/lib/components/ActionBar/SelectionMenu.js +111 -0
- package/lib/components/ActionBar/index.js +105 -0
- package/lib/components/AddFilesPanel/AddFiles.js +183 -0
- package/lib/components/AddFilesPanel/AddFiles.styled.js +137 -0
- package/lib/components/AddFilesPanel/index.js +59 -0
- package/lib/components/AiSwitcher/AiSwitcher.constants.js +1 -0
- package/lib/components/AiSwitcher/AiSwitcher.styled.js +24 -0
- package/lib/components/AiSwitcher/index.js +81 -0
- package/lib/components/AssetsList/AssetsList.styled.js +217 -0
- package/lib/components/AssetsList/GridView/FilesAccordion.js +76 -0
- package/lib/components/AssetsList/GridView/FilesSection/FileCell.js +260 -0
- package/lib/components/AssetsList/GridView/FilesSection/FileOverlayOptions.js +140 -0
- package/lib/components/AssetsList/GridView/FilesSection/FilesSection.styled.js +15 -0
- package/lib/components/AssetsList/GridView/FilesSection/index.js +31 -0
- package/lib/components/AssetsList/GridView/FilesSkeleton.js +47 -0
- package/lib/components/AssetsList/GridView/FoldersSection/FolderCell.js +239 -0
- package/lib/components/AssetsList/GridView/FoldersSection/FolderPreviewGrid.js +106 -0
- package/lib/components/AssetsList/GridView/FoldersSection/FolderTopOptions.js +70 -0
- package/lib/components/AssetsList/GridView/FoldersSection/index.js +23 -0
- package/lib/components/AssetsList/GridView/FoldersSkeleton.js +77 -0
- package/lib/components/AssetsList/GridView/GridView.styled.js +11 -0
- package/lib/components/AssetsList/GridView/SearchGridView/SearchGridView.styled.js +15 -0
- package/lib/components/AssetsList/GridView/SearchGridView/SearchGridViewSkeleton.js +30 -0
- package/lib/components/AssetsList/GridView/SearchGridView/index.js +97 -0
- package/lib/components/AssetsList/GridView/index.js +196 -0
- package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableHeader.js +152 -0
- package/lib/components/AssetsList/ListView/AssetsSection/AssetsSectionTableRow.js +333 -0
- package/lib/components/AssetsList/ListView/AssetsSection/index.js +99 -0
- package/lib/components/AssetsList/ListView/ColumnsMenu.js +89 -0
- package/lib/components/AssetsList/ListView/FilesAccordion.js +74 -0
- package/lib/components/AssetsList/ListView/FilesSkeleton.js +68 -0
- package/lib/components/AssetsList/ListView/FoldersSection/FoldersSectionTableHeader.js +98 -0
- package/lib/components/AssetsList/ListView/FoldersSection/FoldersSectionTableRow.js +156 -0
- package/lib/components/AssetsList/ListView/FoldersSection/index.js +54 -0
- package/lib/components/AssetsList/ListView/FoldersSkeleton.js +67 -0
- package/lib/components/AssetsList/ListView/ListView.styled.js +181 -0
- package/lib/components/AssetsList/ListView/ListView.utils.js +30 -0
- package/lib/components/AssetsList/ListView/SearchListView/index.js +109 -0
- package/lib/components/AssetsList/ListView/index.js +203 -0
- package/lib/components/AssetsList/ScrollToTop.js +70 -0
- package/lib/components/AssetsList/SearchView.hook.js +241 -0
- package/lib/components/AssetsList/__SearchTestPannel.js +238 -0
- package/lib/components/AssetsList/__SearchTestPannel.mock.js +1 -0
- package/lib/components/AssetsList/index.js +266 -0
- package/lib/components/AssetsList/relevanceBadge.js +15 -0
- package/lib/components/AssetsView/AssetsView.styled.js +25 -0
- package/lib/components/AssetsView/AssetsView.thunks.js +64 -0
- package/lib/components/AssetsView/index.js +142 -0
- package/lib/components/AuthExplorerView.js +79 -0
- package/lib/components/Breadcrumbs/BreadCrumbViews/BreadCrumbsViews.styled.js +30 -0
- package/lib/components/Breadcrumbs/BreadCrumbViews/index.js +32 -0
- package/lib/components/Breadcrumbs/Breadcrumb.js +52 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.styled.js +81 -0
- package/lib/components/Breadcrumbs/BreadcrumbsSkeleton.js +12 -0
- package/lib/components/Breadcrumbs/index.js +187 -0
- package/lib/components/BulkEditPanel/BulkEdit.js +330 -0
- package/lib/components/BulkEditPanel/BulkEditPanel.styled.js +62 -0
- package/lib/components/BulkEditPanel/BulkEditPanel.utils.js +55 -0
- package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.constants.js +29 -0
- package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.js +148 -0
- package/lib/components/BulkEditPanel/components/AssetsList/AssetsList.styled.js +81 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/Columns.styled.js +99 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileMetadataField.js +263 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileTagField.js +228 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/FileTextField.js +107 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/MetadataColumn.js +142 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/TableRow.js +139 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/TagsColumn.js +58 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/TagsField.js +80 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/TextColumn.js +53 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/columns.utils.js +272 -0
- package/lib/components/BulkEditPanel/components/AssetsList/Columns/getActiveColumn.js +23 -0
- package/lib/components/BulkEditPanel/components/AssetsList/FloatyPreview.js +55 -0
- package/lib/components/BulkEditPanel/components/AssetsList/FloatyPreview.styled.js +21 -0
- package/lib/components/BulkEditPanel/components/AssetsList/TableBody.js +64 -0
- package/lib/components/BulkEditPanel/components/AssetsList/TableHeader.js +67 -0
- package/lib/components/BulkEditPanel/components/BulkEditFooter.js +33 -0
- package/lib/components/BulkEditPanel/components/ConfirmationModal/ConfirmationModal.js +47 -0
- package/lib/components/BulkEditPanel/components/ConfirmationModal/ConfirmationModal.styled.js +25 -0
- package/lib/components/BulkEditPanel/components/MainContent/MainContent.js +110 -0
- package/lib/components/BulkEditPanel/components/MainContent/MainContent.styled.js +12 -0
- package/lib/components/BulkEditPanel/components/MainContent/index.js +2 -0
- package/lib/components/BulkEditPanel/components/Sidebar/Sidebar.styled.js +53 -0
- package/lib/components/BulkEditPanel/components/Sidebar/Sidebar.utils.js +28 -0
- package/lib/components/BulkEditPanel/components/Sidebar/index.js +158 -0
- package/lib/components/BulkEditPanel/components/Tabs/Metadata/Metadata.js +246 -0
- package/lib/components/BulkEditPanel/components/Tabs/Metadata/Metadata.styled.js +17 -0
- package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.js +222 -0
- package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.mixin.js +20 -0
- package/lib/components/BulkEditPanel/components/Tabs/Tags/Tags.styled.js +123 -0
- package/lib/components/BulkEditPanel/components/Tabs/Tags/TagsContianer.js +31 -0
- package/lib/components/BulkEditPanel/components/Tabs/Tags/TagsPaper.js +95 -0
- package/lib/components/BulkEditPanel/components/Tabs/Text/Text.js +167 -0
- package/lib/components/BulkEditPanel/components/Tabs/Text/Text.styled.js +15 -0
- package/lib/components/BulkEditPanel/components/Tabs/tabs.constants.js +113 -0
- package/lib/components/BulkEditPanel/components/Tabs/tabs.js +43 -0
- package/lib/components/BulkEditPanel/components/Tabs/tabs.utils.js +239 -0
- package/lib/components/BulkEditPanel/index.js +28 -0
- package/lib/components/ContextMenu/BeforeUploadMenu/index.js +51 -0
- package/lib/components/ContextMenu/ContextMenu.constants.js +64 -0
- package/lib/components/ContextMenu/ContextMenu.hooks.js +35 -0
- package/lib/components/ContextMenu/ContextMenu.styled.js +107 -0
- package/lib/components/ContextMenu/ContextMenuContent.js +202 -0
- package/lib/components/ContextMenu/ContextMenuItem.js +142 -0
- package/lib/components/ContextMenu/FileMenu/CollaborateSection/index.js +33 -0
- package/lib/components/ContextMenu/FileMenu/DeleteSection/index.js +25 -0
- package/lib/components/ContextMenu/FileMenu/EditSection/index.js +42 -0
- package/lib/components/ContextMenu/FileMenu/FindSection/index.js +29 -0
- package/lib/components/ContextMenu/FileMenu/index.js +15 -0
- package/lib/components/ContextMenu/FolderMenu/CollaborateSection/index.js +17 -0
- package/lib/components/ContextMenu/FolderMenu/DeleteSection/index.js +41 -0
- package/lib/components/ContextMenu/FolderMenu/EditSection/index.js +49 -0
- package/lib/components/ContextMenu/FolderMenu/FindSection/index.js +49 -0
- package/lib/components/ContextMenu/FolderMenu/FolderMenu.utils.js +31 -0
- package/lib/components/ContextMenu/FolderMenu/index.js +14 -0
- package/lib/components/ContextMenu/MenuOptions/AddVariationOption.js +59 -0
- package/lib/components/ContextMenu/MenuOptions/BulkEditOption.js +47 -0
- package/lib/components/ContextMenu/MenuOptions/CdnLinkOption.js +54 -0
- package/lib/components/ContextMenu/MenuOptions/DeleteOption.js +70 -0
- package/lib/components/ContextMenu/MenuOptions/DownloadOption.js +88 -0
- package/lib/components/ContextMenu/MenuOptions/EditImageOption.js +63 -0
- package/lib/components/ContextMenu/MenuOptions/EditVideoOption.js +87 -0
- package/lib/components/ContextMenu/MenuOptions/LocateFileOption.js +45 -0
- package/lib/components/ContextMenu/MenuOptions/ManagaAccessOption.js +67 -0
- package/lib/components/ContextMenu/MenuOptions/ManageDetailsOption.js +52 -0
- package/lib/components/ContextMenu/MenuOptions/MoveOption.js +54 -0
- package/lib/components/ContextMenu/MenuOptions/PreviewOption.js +35 -0
- package/lib/components/ContextMenu/MenuOptions/RenameOption.js +66 -0
- package/lib/components/ContextMenu/MenuOptions/TransformationOption.js +63 -0
- package/lib/components/ContextMenu/MultipleMenu/CollaborateSection/index.js +31 -0
- package/lib/components/ContextMenu/MultipleMenu/DeleteSection/index.js +6 -0
- package/lib/components/ContextMenu/MultipleMenu/EditSection/index.js +14 -0
- package/lib/components/ContextMenu/MultipleMenu/FindSection/index.js +14 -0
- package/lib/components/ContextMenu/MultipleMenu/index.js +14 -0
- package/lib/components/ContextMenu/SharedMenus/DownloadFolderSubMenu.js +36 -0
- package/lib/components/ContextMenu/SharedMenus/DownloadSubMenu.js +70 -0
- package/lib/components/ContextMenu/index.js +34 -0
- package/lib/components/ContextMenu/utils/calculateMenuHeight.js +20 -0
- package/lib/components/ContextMenu/utils/calculateMenuPosition.js +42 -0
- package/lib/components/ContextMenu/utils/createSeparator.js +14 -0
- package/lib/components/ContextMenu/utils/editMedia.js +17 -0
- package/lib/components/ContextMenu/utils/getFileLocation.js +8 -0
- package/lib/components/ContextMenu/utils/getFilteredOptions.js +20 -0
- package/lib/components/ContextMenu/utils/getProperFolderSelections.js +7 -0
- package/lib/components/ContextMenu/utils/isEmptyFolderSelection.js +5 -0
- package/lib/components/ContextMenu/utils/isFileContextMenu.js +5 -0
- package/lib/components/ContextMenu/utils/isFirstFileVisibilityPublic.js +9 -0
- package/lib/components/ContextMenu/utils/isMenuItemVisible.js +5 -0
- package/lib/components/ContextMenu/utils/isMixedFiles.js +9 -0
- package/lib/components/ContextMenu/utils/isMultipleSelection.js +6 -0
- package/lib/components/ContextMenu/utils/isSeparatorHidden.js +7 -0
- package/lib/components/ContextMenu/utils/triggerDownload.js +45 -0
- package/lib/components/CropPanel/CropOptions.js +155 -0
- package/lib/components/CropPanel/CropPanel.constants.js +44 -0
- package/lib/components/CropPanel/CropPanel.styled.js +107 -0
- package/lib/components/CropPanel/CropPanel.utils.js +48 -0
- package/lib/components/CropPanel/CropPanelContent.js +209 -0
- package/lib/components/CropPanel/ImageOptions.js +326 -0
- package/lib/components/CropPanel/ImageResize.js +207 -0
- package/lib/components/CropPanel/Option.js +113 -0
- package/lib/components/CropPanel/index.js +22 -0
- package/lib/components/Details/Details.constants.js +75 -0
- package/lib/components/Details/Details.utils.js +232 -0
- package/lib/components/Details/DetailsSideBar.styled.js +139 -0
- package/lib/components/Details/EditActionButtons/EditActionButtons.styled.js +27 -0
- package/lib/components/Details/EditActionButtons/index.js +38 -0
- package/lib/components/Details/FileDetails.js +31 -0
- package/lib/components/Details/FileItem/CustomMetadataTab.js +50 -0
- package/lib/components/Details/FileItem/FileItem.styled.js +47 -0
- package/lib/components/Details/FileItem/GeneralTab.js +113 -0
- package/lib/components/Details/FileItem/SharedFileEditData.js +97 -0
- package/lib/components/Details/FileItem/index.js +2 -0
- package/lib/components/Details/FolderDetails.js +138 -0
- package/lib/components/Details/FolderItemList/FolderListItem.js +77 -0
- package/lib/components/Details/FolderItemList/index.js +62 -0
- package/lib/components/Details/MultiItemsDetails.js +69 -0
- package/lib/components/Details/MultipleItems.js +71 -0
- package/lib/components/Details/TabChips.js +51 -0
- package/lib/components/Details/TabPanels.js +42 -0
- package/lib/components/Details/Title.js +52 -0
- package/lib/components/Details/index.js +53 -0
- package/lib/components/DnD/Dnd.styled.js +11 -0
- package/lib/components/DnD/DragImage.js +61 -0
- package/lib/components/DnD/index.js +219 -0
- package/lib/components/Drawer/Drawer.styled.js +45 -0
- package/lib/components/Drawer/Drawer.utils.js +163 -0
- package/lib/components/Drawer/Resizer.js +141 -0
- package/lib/components/Drawer/ResizerCore.js +213 -0
- package/lib/components/Drawer/index.js +68 -0
- package/lib/components/EmptyViewPlaceholder/EmptyViewPlaceholder.styled.js +39 -0
- package/lib/components/EmptyViewPlaceholder/index.js +58 -0
- package/lib/components/ExploreView.js +46 -0
- package/lib/components/ExplorerUI.js +17 -0
- package/lib/components/ExplorerWrapper.js +114 -0
- package/lib/components/FacetedSearch/DrawerBody/index.js +42 -0
- package/lib/components/FacetedSearch/DrawerWrapper/index.js +83 -0
- package/lib/components/FacetedSearch/FacetedSearch.constants.js +27 -0
- package/lib/components/FacetedSearch/FacetedSearch.styled.js +101 -0
- package/lib/components/FacetedSearch/FacetedSearch.utils.js +3 -0
- package/lib/components/FacetedSearch/Field/Date.js +69 -0
- package/lib/components/FacetedSearch/Field/Placeholder.js +20 -0
- package/lib/components/FacetedSearch/Field/Select.js +136 -0
- package/lib/components/FacetedSearch/Field/Switch.js +59 -0
- package/lib/components/FacetedSearch/Field/index.js +27 -0
- package/lib/components/FacetedSearch/GroupWrapper/index.js +129 -0
- package/lib/components/FacetedSearch/StaticFields/Date.js +152 -0
- package/lib/components/FacetedSearch/index.js +12 -0
- package/lib/components/FileItem/FileInfo/FileInfo.styled.js +126 -0
- package/lib/components/FileItem/FileInfo/FileInfo.utils.js +13 -0
- package/lib/components/FileItem/FileInfo/FileMetadata.js +37 -0
- package/lib/components/FileItem/FileInfo/FileName.js +197 -0
- package/lib/components/FileItem/FileInfo/index.js +194 -0
- package/lib/components/FileItem/FileItem.mixin.js +22 -0
- package/lib/components/FileItem/FileItem.styled.js +54 -0
- package/lib/components/FileItem/FileUploadTopOptions.js +87 -0
- package/lib/components/FileItem/PreUploadFileThumbnail/FileThumbnail.js +61 -0
- package/lib/components/FileItem/PreUploadFileThumbnail/PreUploadFileThumbnail.styled.js +8 -0
- package/lib/components/FileItem/PreUploadFileThumbnail/index.js +27 -0
- package/lib/components/FileItem/index.js +164 -0
- package/lib/components/FileWindowPanel/Body/ActionButtons.js +70 -0
- package/lib/components/FileWindowPanel/Body/Body.constants.js +5 -0
- package/lib/components/FileWindowPanel/Body/Body.styled.js +196 -0
- package/lib/components/FileWindowPanel/Body/BodyFile.js +165 -0
- package/lib/components/FileWindowPanel/Body/Footer.js +60 -0
- package/lib/components/FileWindowPanel/Body/Preview.js +232 -0
- package/lib/components/FileWindowPanel/Body/PreviewPlaceholder.js +20 -0
- package/lib/components/FileWindowPanel/Body/VideoEmbed.js +80 -0
- package/lib/components/FileWindowPanel/Body/index.js +108 -0
- package/lib/components/FileWindowPanel/FileTabs/FileTabButtons.js +98 -0
- package/lib/components/FileWindowPanel/FileTabs/FileTabs.constants.js +50 -0
- package/lib/components/FileWindowPanel/FileTabs/FileTabs.styled.js +99 -0
- package/lib/components/FileWindowPanel/FileTabs/FileTabsList.js +91 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/EditableField.js +78 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldLabel.js +40 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldRow.js +57 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldValue.js +20 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/FieldWithTooltip.js +29 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralSection.js +183 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTab.constants.js +2 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTab.styled.js +112 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/GeneralTabSkeleton.js +70 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/TableSeparator.js +10 -0
- package/lib/components/FileWindowPanel/FileTabs/GeneralTab/index.js +100 -0
- package/lib/components/FileWindowPanel/FileTabs/MetadataTab/CustomMetadataSection.js +247 -0
- package/lib/components/FileWindowPanel/FileTabs/MetadataTab/EmbeddedMetadataSection.js +31 -0
- package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTab.constants.js +2 -0
- package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTab.styled.js +134 -0
- package/lib/components/FileWindowPanel/FileTabs/MetadataTab/MetadataTabSkeleton.js +70 -0
- package/lib/components/FileWindowPanel/FileTabs/MetadataTab/index.js +181 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationItem.js +78 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.constants.js +26 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.styled.js +177 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.thunks.js +99 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/Variations.utils.js +23 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsContent.js +92 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsEditModalContent.js +57 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsSearch.js +44 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsSkeleton.js +35 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabNavigator.js +41 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTabs.js +40 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/VariationsTopOptions.js +204 -0
- package/lib/components/FileWindowPanel/FileTabs/VariationsTab/index.js +603 -0
- package/lib/components/FileWindowPanel/FileTabs/index.js +83 -0
- package/lib/components/FileWindowPanel/FileWindow.js +221 -0
- package/lib/components/FileWindowPanel/FileWindow.styled.js +19 -0
- package/lib/components/FileWindowPanel/FileWindow.utils.js +38 -0
- package/lib/components/FileWindowPanel/Header/AfterUploadActionBtns.js +69 -0
- package/lib/components/FileWindowPanel/Header/BeforeUploadActionBtns.js +100 -0
- package/lib/components/FileWindowPanel/Header/FileWindowHeader.styled.js +56 -0
- package/lib/components/FileWindowPanel/Header/MutualActionBtns.js +92 -0
- package/lib/components/FileWindowPanel/Header/index.js +109 -0
- package/lib/components/FileWindowPanel/index.js +60 -0
- package/lib/components/Filters/Filters.constants.js +358 -0
- package/lib/components/Filters/Filters.styled.js +235 -0
- package/lib/components/Filters/Filters.utils.js +536 -0
- package/lib/components/Filters/FiltersContext.js +59 -0
- package/lib/components/Filters/FiltersSkeleton.js +14 -0
- package/lib/components/Filters/Groups/Date/index.js +201 -0
- package/lib/components/Filters/Groups/Folders/FoldersSkeleton.js +43 -0
- package/lib/components/Filters/Groups/Folders/index.js +109 -0
- package/lib/components/Filters/Groups/Image/Colors.js +73 -0
- package/lib/components/Filters/Groups/Image/Faces.js +64 -0
- package/lib/components/Filters/Groups/Image/Orientations.js +64 -0
- package/lib/components/Filters/Groups/Image/Resolutions.js +65 -0
- package/lib/components/Filters/Groups/Image/Tooltip.js +14 -0
- package/lib/components/Filters/Groups/Image/index.js +104 -0
- package/lib/components/Filters/Groups/LicenseExpiry/LicenseExpiry.styled.js +17 -0
- package/lib/components/Filters/Groups/LicenseExpiry/index.js +97 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/ConditionSelector.js +40 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/ConditionSelector.js +35 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/ValueSelector.js +33 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/ExtraRow/index.js +18 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/AutoComplete.js +56 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/Boolean.js +35 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/Date.js +36 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/GeoPointField.js +30 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/Numeric.js +32 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/Select.js +55 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/Tags.js +21 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/Text.js +39 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Field/index.js +52 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/KeySelector.js +34 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/Row.js +53 -0
- package/lib/components/Filters/Groups/Metadata/Advanced/index.js +48 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/Date.js +45 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/Field.utils.js +58 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/Numeric.js +51 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/OptionsPopup.js +87 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/Select.js +168 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/Switch.js +41 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/Tags.js +38 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/Text.js +57 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/Uri.js +54 -0
- package/lib/components/Filters/Groups/Metadata/Basic/Field/index.js +46 -0
- package/lib/components/Filters/Groups/Metadata/Basic/GroupWrapper.js +79 -0
- package/lib/components/Filters/Groups/Metadata/Basic/index.js +80 -0
- package/lib/components/Filters/Groups/Metadata/Metadata.constants.js +42 -0
- package/lib/components/Filters/Groups/Metadata/Metadata.styled.js +150 -0
- package/lib/components/Filters/Groups/Metadata/Metadata.utils.js +160 -0
- package/lib/components/Filters/Groups/Metadata/MetadataFiltersContext.js +329 -0
- package/lib/components/Filters/Groups/Metadata/Placeholder.js +25 -0
- package/lib/components/Filters/Groups/Metadata/common/TagsField/TagsMenu.js +81 -0
- package/lib/components/Filters/Groups/Metadata/common/TagsField/TagsSearchPlaceholder.js +18 -0
- package/lib/components/Filters/Groups/Metadata/common/TagsField/index.js +142 -0
- package/lib/components/Filters/Groups/Metadata/index.js +111 -0
- package/lib/components/Filters/Groups/Size/index.js +125 -0
- package/lib/components/Filters/Groups/Tags/FilteredTags.js +62 -0
- package/lib/components/Filters/Groups/Tags/SelectedTags.js +51 -0
- package/lib/components/Filters/Groups/Tags/SuggestedTags.js +43 -0
- package/lib/components/Filters/Groups/Tags/index.js +146 -0
- package/lib/components/Filters/Groups/TypeAndFormat/Format.js +65 -0
- package/lib/components/Filters/Groups/TypeAndFormat/Type.js +85 -0
- package/lib/components/Filters/Groups/TypeAndFormat/index.js +114 -0
- package/lib/components/Filters/Groups/common/DateRangeField/DateRangeField.styled.js +10 -0
- package/lib/components/Filters/Groups/common/DateRangeField/index.js +72 -0
- package/lib/components/Filters/Groups/common/FilterFooter.js +67 -0
- package/lib/components/Filters/Groups/common/FilterOptions.js +29 -0
- package/lib/components/Filters/Groups/common/FilterSearch.js +22 -0
- package/lib/components/Filters/Groups/common/FilterSearch.styled.js +15 -0
- package/lib/components/Filters/Groups/common/FilterSkeleton.js +44 -0
- package/lib/components/Filters/Groups/common/TimeFrames.js +35 -0
- package/lib/components/Filters/Groups/index.js +55 -0
- package/lib/components/Filters/Placeholder.js +29 -0
- package/lib/components/Filters/hooks/useDateTypeFilterValues.js +182 -0
- package/lib/components/Filters/hooks/useFilters.js +78 -0
- package/lib/components/Filters/index.js +78 -0
- package/lib/components/FoldersView/FoldersTree/FoldersTree.styled.js +193 -0
- package/lib/components/FoldersView/FoldersTree/FoldersTree.utils.js +78 -0
- package/lib/components/FoldersView/FoldersTree/FoldersTreeHeader.js +52 -0
- package/lib/components/FoldersView/FoldersTree/FoldersTreeList.js +64 -0
- package/lib/components/FoldersView/FoldersTree/FoldersTreeListItem.js +270 -0
- package/lib/components/FoldersView/FoldersTree/FoldersTreeSearch.js +70 -0
- package/lib/components/FoldersView/FoldersTree/FoldersTreeSkeleton.js +23 -0
- package/lib/components/FoldersView/FoldersTree/NoFoldersResult.js +19 -0
- package/lib/components/FoldersView/FoldersTree/SearchedFoldersItem.js +113 -0
- package/lib/components/FoldersView/FoldersTree/index.js +163 -0
- package/lib/components/FoldersView/hooks/useAddFolder.js +60 -0
- package/lib/components/FoldersView/index.js +282 -0
- package/lib/components/GalleryRoleSelect/CustomRolesTab.js +47 -0
- package/lib/components/GalleryRoleSelect/CustomRolesTab.styled.js +10 -0
- package/lib/components/GalleryRoleSelect/GalleryRoleSelect.constants.js +11 -0
- package/lib/components/GalleryRoleSelect/GalleryRoleSelect.styled.js +132 -0
- package/lib/components/GalleryRoleSelect/GalleryRoleSelect.utils.js +87 -0
- package/lib/components/GalleryRoleSelect/StandardRolesTab.js +58 -0
- package/lib/components/GalleryRoleSelect/index.js +234 -0
- package/lib/components/HeaderBar/FacetedSearchToggleButton.js +28 -0
- package/lib/components/HeaderBar/HeaderBar.styled.js +25 -0
- package/lib/components/HeaderBar/RightSide.js +127 -0
- package/lib/components/HeaderBar/index.js +77 -0
- package/lib/components/ImageEditorPanel/index.js +33 -0
- package/lib/components/InfiniteScroll/InfiniteScroll.js +97 -0
- package/lib/components/InfiniteScroll/InfiniteScroll.styled.js +11 -0
- package/lib/components/Informer/index.js +9 -0
- package/lib/components/LoginScreen/LoginScreen.styled.js +39 -0
- package/lib/components/LoginScreen/index.js +133 -0
- package/lib/components/MainMenu/MainMenu.styled.js +12 -0
- package/lib/components/MainMenu/index.js +77 -0
- package/lib/components/Modals/AddNewFolder/AddNewFolder.hooks.js +99 -0
- package/lib/components/Modals/AddNewFolder/index.js +1 -0
- package/lib/components/Modals/ConfirmationModal/ConfirmationModal.hooks.js +101 -0
- package/lib/components/Modals/ConfirmationModal/index.js +1 -0
- package/lib/components/Modals/DeleteItems/DeleteItems.hooks.js +233 -0
- package/lib/components/Modals/DeleteItems/index.js +1 -0
- package/lib/components/Modals/DeleteModal/DeleteModal.hooks.js +87 -0
- package/lib/components/Modals/DeleteModal/index.js +1 -0
- package/lib/components/Modals/DownloadConsent/DownlaodConsent.styled.js +8 -0
- package/lib/components/Modals/DownloadConsent/DownloadConsent.hooks.js +90 -0
- package/lib/components/Modals/DownloadConsent/DownloadConsentContent.js +52 -0
- package/lib/components/Modals/DownloadConsent/index.js +2 -0
- package/lib/components/Modals/Modals.js +386 -0
- package/lib/components/Modals/Modals.styled.js +80 -0
- package/lib/components/Modals/MoveItems/MoveItems.hooks.js +88 -0
- package/lib/components/Modals/MoveItems/index.js +1 -0
- package/lib/components/Modals/TransformedDownload/PdfModalContent.js +109 -0
- package/lib/components/Modals/TransformedDownload/TransformedDownload.hooks.js +188 -0
- package/lib/components/Modals/TransformedDownload/TransformedDownload.styled.js +29 -0
- package/lib/components/Modals/TransformedDownload/TransformedDownload.utils.js +46 -0
- package/lib/components/Modals/TransformedDownload/index.js +2 -0
- package/lib/components/Modals/index.js +8 -0
- package/lib/components/NoItems/NoItems.styled.js +54 -0
- package/lib/components/NoItems/index.js +50 -0
- package/lib/components/PdftronPanel/index.js +31 -0
- package/lib/components/PickerPanel/PickerPanel.styled.js +41 -0
- package/lib/components/PickerPanel/PickerPanelContent.js +100 -0
- package/lib/components/PickerPanel/index.js +21 -0
- package/lib/components/ProgressPanel/ProgressPanel.utils.js +29 -0
- package/lib/components/ProgressPanel/index.js +37 -0
- package/lib/components/TopBar/AppliedFilterChips/AppliedFilterChips.styled.js +11 -0
- package/lib/components/TopBar/AppliedFilterChips/index.js +77 -0
- package/lib/components/TopBar/Search/ContextDropdown/ContextDropdown.styled.js +59 -0
- package/lib/components/TopBar/Search/ContextDropdown/ContextDropdown.utils.js +67 -0
- package/lib/components/TopBar/Search/ContextDropdown/index.js +170 -0
- package/lib/components/TopBar/Search/PrependedOptions/TempFilterRegexInput.js +133 -0
- package/lib/components/TopBar/Search/Search.utils.js +88 -0
- package/lib/components/TopBar/Search/SimilarSearchTag.js +60 -0
- package/lib/components/TopBar/Search/index.js +251 -0
- package/lib/components/TopBar/TopBar.styled.js +37 -0
- package/lib/components/TopBar/index.js +61 -0
- package/lib/components/TopSection/TopSection.styled.js +22 -0
- package/lib/components/TopSection/index.js +58 -0
- package/lib/components/UploadBar/UploadBar.styled.js +84 -0
- package/lib/components/UploadBar/index.js +222 -0
- package/lib/components/UploadStatus/index.js +20 -0
- package/lib/components/UploadsPanel/UploadsList/Header.js +19 -0
- package/lib/components/UploadsPanel/UploadsList/List.js +29 -0
- package/lib/components/UploadsPanel/UploadsList/PreUploadPlugins.js +22 -0
- package/lib/components/UploadsPanel/UploadsList/UploadsList.styled.js +64 -0
- package/lib/components/UploadsPanel/UploadsList/UploadsList.utils.js +17 -0
- package/lib/components/UploadsPanel/UploadsList/UploadsVirtualGrid.js +29 -0
- package/lib/components/UploadsPanel/UploadsList/index.js +55 -0
- package/lib/components/UploadsPanel/UploadsPanel.styled.js +24 -0
- package/lib/components/UploadsPanel/UploadsPanelTopBar.js +16 -0
- package/lib/components/UploadsPanel/index.js +36 -0
- package/lib/components/UrlBuilderModal/UrlBuilderModal.styled.js +9 -0
- package/lib/components/UrlBuilderModal/index.js +97 -0
- package/lib/components/Views/ErroredViewPlaceholder.js +48 -0
- package/lib/components/Views/Views.constants.js +29 -0
- package/lib/components/Views/Views.styled.js +87 -0
- package/lib/components/Views/index.js +100 -0
- package/lib/components/common/DeleteModalItemText/DeleteModalItemText.styled.js +8 -0
- package/lib/components/common/DeleteModalItemText/index.js +29 -0
- package/lib/components/common/EditDetailsButton/EditDetailsButton.styled.js +35 -0
- package/lib/components/common/EditDetailsButton/index.js +28 -0
- package/lib/components/common/ExpiryDateTooltipContent/ExpiryDateTooltipContent.styled.js +16 -0
- package/lib/components/common/ExpiryDateTooltipContent/index.js +29 -0
- package/lib/components/common/FileApprovalsInfoPopup/index.js +46 -0
- package/lib/components/common/FileMetadataFieldValue/CustomMetadataFieldValue.js +48 -0
- package/lib/components/common/FileMetadataFieldValue/FileMetadataFieldValue.styled.js +66 -0
- package/lib/components/common/FileMetadataFieldValue/FileMetadataFieldValue.utils.js +315 -0
- package/lib/components/common/FileMetadataFieldValue/GeneralMetadataFieldValue.js +120 -0
- package/lib/components/common/FileMetadataFieldValue/index.js +26 -0
- package/lib/components/common/FileMetadataFieldValue/utils/getFontInfo.js +78 -0
- package/lib/components/common/FolderSelector/BrowseFoldersMenu.js +114 -0
- package/lib/components/common/FolderSelector/FolderSearchMenu.js +45 -0
- package/lib/components/common/FolderSelector/FolderSelector.styled.js +41 -0
- package/lib/components/common/FolderSelector/index.js +186 -0
- package/lib/components/common/FormattedUriLink/FormattedUriLink.styled.js +15 -0
- package/lib/components/common/FormattedUriLink/index.js +21 -0
- package/lib/components/common/OriginalBadge/OriginalBadge.styled.js +17 -0
- package/lib/components/common/OriginalBadge/index.js +14 -0
- package/lib/components/common/SanitizedHtmlElement/index.js +11 -0
- package/lib/components/common/Sort/Sort.constants.js +61 -0
- package/lib/components/common/Sort/Sort.styled.js +47 -0
- package/lib/components/common/Sort/Sort.utils.js +14 -0
- package/lib/components/common/Sort/index.js +183 -0
- package/lib/components/common/TextWithCopyIcon/TextWithCopyIcon.styled.js +44 -0
- package/lib/components/common/TextWithCopyIcon/index.js +71 -0
- package/lib/components/common/TopBarUploadButton/index.js +40 -0
- package/lib/components/common/TrimmedFilePathWithLocate/TrimmedFilePathWithLocate.utils.js +3 -0
- package/lib/components/common/TrimmedFilePathWithLocate/index.js +34 -0
- package/lib/components/common/TrimmedFolderPathWithLocate/index.js +13 -0
- package/lib/components/common/TrimmedPathWithLocate/TrimmedPathWithLocate.styled.js +30 -0
- package/lib/components/common/TrimmedPathWithLocate/index.js +40 -0
- package/lib/components/metadata.adapter.js +365 -0
- package/lib/defaultLocale.js +1361 -0
- package/lib/hooks/index.js +16 -0
- package/lib/hooks/useAssetsPicker.js +274 -0
- package/lib/hooks/useDownloadFilesCsv.js +20 -0
- package/lib/hooks/useEditFileDetails.js +505 -0
- package/lib/hooks/useExplorer.js +6 -0
- package/lib/hooks/useExplorerI18n.js +10 -0
- package/lib/hooks/useExplorerInformer.js +10 -0
- package/lib/hooks/useFetchFileFolderPermissions.js +31 -0
- package/lib/hooks/useFetchMetadataTagsBySearchQuery.js +38 -0
- package/lib/hooks/useFileMetadata.js +117 -0
- package/lib/hooks/useFilterSearch.js +37 -0
- package/lib/hooks/useForcedFilters.js +39 -0
- package/lib/hooks/useIsOverflow.js +25 -0
- package/lib/hooks/useIsSmallScreen.js +20 -0
- package/lib/hooks/useLocateFile.js +231 -0
- package/lib/hooks/usePrevious.js +9 -0
- package/lib/hooks/useSearchSuggestions.js +168 -0
- package/lib/hooks/useStartUpload.js +43 -0
- package/lib/hooks/useToLocaleNumber.js +14 -0
- package/lib/hooks/useValidateFileName.js +324 -0
- package/lib/index.js +1616 -0
- package/lib/slices/common.slice.js +254 -0
- package/lib/slices/drag.slice.js +75 -0
- package/lib/slices/files.slice.js +1307 -0
- package/lib/slices/filters.slice.js +382 -0
- package/lib/slices/folders.slice.js +978 -0
- package/lib/slices/foldersTree.slice.js +501 -0
- package/lib/slices/index.js +32 -0
- package/lib/slices/metadata.slice.js +494 -0
- package/lib/slices/panels.slice.js +351 -0
- package/lib/slices/search.slice.js +995 -0
- package/lib/slices/selections.slice.js +315 -0
- package/lib/slices/targets.slice.js +44 -0
- package/lib/slices/topSection.slice.js +71 -0
- package/lib/slices/views.slice.js +345 -0
- package/lib/thunks/archive.thunks.js +175 -0
- package/lib/thunks/downloads.thunks.js +415 -0
- package/lib/thunks/items.thunks.js +274 -0
- package/lib/thunks/permissions.thunks.js +66 -0
- package/lib/thunks/uploads.thunks.js +235 -0
- package/lib/utils/SearchSuggestions/SearchSuggestionsMenu.js +95 -0
- package/lib/utils/SearchSuggestions/SuggestionMode.js +70 -0
- package/lib/utils/SearchSuggestions/SuggestionModeAttribute.js +87 -0
- package/lib/utils/SearchSuggestions/SuggestionModeExpression.js +121 -0
- package/lib/utils/SearchSuggestions/SuggestionModeTag.js +87 -0
- package/lib/utils/SearchSuggestions/SuggestionsManager.js +242 -0
- package/lib/utils/SearchSuggestions/constants.js +14 -0
- package/lib/utils/SearchSuggestions/index.js +4 -0
- package/lib/utils/SearchSuggestions/styled.js +12 -0
- package/lib/utils/availableScreenSizes.js +4 -0
- package/lib/utils/constants.js +14 -0
- package/lib/utils/convertItemsToFilesFoldersUuids.js +12 -0
- package/lib/utils/convertItemstoFoldersParentUuids.js +12 -0
- package/lib/utils/createPromise.js +9 -0
- package/lib/utils/createSuperFocus.js +43 -0
- package/lib/utils/decodeB64ToStr.js +11 -0
- package/lib/utils/filters.js +333 -0
- package/lib/utils/formatFolderPath.js +10 -0
- package/lib/utils/formatPinSubTitle.js +17 -0
- package/lib/utils/getAcquirerTitle.js +10 -0
- package/lib/utils/getActiveOverlayEl.js +11 -0
- package/lib/utils/getApiPathtype.js +10 -0
- package/lib/utils/getClosestStr.js +22 -0
- package/lib/utils/getItemUuids.js +12 -0
- package/lib/utils/getLabelsTotalAssetsCount.js +6 -0
- package/lib/utils/getMoveAndDeleteData.js +15 -0
- package/lib/utils/getParentFolderPath.js +4 -0
- package/lib/utils/getQueryStringFromUrl.js +6 -0
- package/lib/utils/getScrollableParent.js +15 -0
- package/lib/utils/getStringValueExistedInObj.js +9 -0
- package/lib/utils/isEmbeddableAsset.js +6 -0
- package/lib/utils/isFileVersion.js +9 -0
- package/lib/utils/mapArrayKeysToObjValues.js +33 -0
- package/lib/utils/mapFiltersToShownFormat.js +252 -0
- package/lib/utils/prepareExportedFilesLinks.js +12 -0
- package/lib/utils/prepareSearchUrl.js +65 -0
- package/lib/utils/removeBackground.js +60 -0
- package/lib/utils/removeExtraUrlParams.js +13 -0
- package/lib/utils/scrollToAndFocusItemElement.js +16 -0
- package/lib/utils/toggleFolderNotFoundModal.js +25 -0
- package/lib/utils/trapFocus.js +59 -0
- package/lib/utils/truncateString.js +28 -0
- package/package.json +8 -8
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
var _excluded = ["searchQuery", "offset", "cachedViewQueries", "sorting"];
|
|
2
|
+
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); }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
9
|
+
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); }
|
|
10
|
+
import { VIEW_IDS, PLUGINS_IDS, LAYOUTS_IDS, FMAW_URL_VIEW_QUERY_PARAMS, FMAW_URL_QUERY_PARAMS } from '@scaleflex/widget-utils/lib/constants';
|
|
11
|
+
import { createSlice, isAnyOf } from '@reduxjs/toolkit';
|
|
12
|
+
import { fetchUserAuthState, generateUserKey } from '@scaleflex/widget-core/lib/slices/user.slice';
|
|
13
|
+
import createThunk from '@scaleflex/widget-utils/lib/createThunk';
|
|
14
|
+
import { VIEW_OPTIONS } from '../components/Views/Views.constants';
|
|
15
|
+
import { loadSearchFromOutside, selectIsSimilarSearchActive, selectSearchQuery, submitSearch, updateSearchQuery, updateSearchSuggestions, searchFilesWithAiText, selectIsAiSearch, selectIsSearchFetchType } from './search.slice';
|
|
16
|
+
import { loadFiltersFromOutside, selectIsFiltersActive, updateFilteredFiles } from './filters.slice';
|
|
17
|
+
import { fetchFoldersPreviews, selectFoldersArray, selectFoldersSortOrder, selectFoldersSortedBy } from './folders.slice';
|
|
18
|
+
import { fetchFiles, selectFilesSortOrder, selectFilesSortedBy } from './files.slice';
|
|
19
|
+
import { SORT_BY, SORT_ORDER } from '../components/common/Sort/Sort.constants';
|
|
20
|
+
import { checkIsValidSearchSortBy, checkIsValidSortOrder } from '../components/common/Sort/Sort.utils';
|
|
21
|
+
var slicePropName = 'views';
|
|
22
|
+
var sliceName = "".concat(PLUGINS_IDS.EXPLORER, "/").concat(slicePropName);
|
|
23
|
+
var initialState = {
|
|
24
|
+
layout: LAYOUTS_IDS.GRID,
|
|
25
|
+
activeView: VIEW_IDS.FOLDERS,
|
|
26
|
+
list: Object.values(VIEW_IDS)
|
|
27
|
+
};
|
|
28
|
+
export var viewCachedFetchFilesQueries = null;
|
|
29
|
+
export var changeViewFetchFilesCachedQueries = function changeViewFetchFilesCachedQueries(newCachedQueries) {
|
|
30
|
+
viewCachedFetchFilesQueries = newCachedQueries;
|
|
31
|
+
};
|
|
32
|
+
export var changeView = createThunk(async function (_ref, thunkApi) {
|
|
33
|
+
var _VIEW_OPTIONS$newlyAc;
|
|
34
|
+
var view = _ref.view,
|
|
35
|
+
_ref$triggerActivate = _ref.triggerActivate,
|
|
36
|
+
triggerActivate = _ref$triggerActivate === void 0 ? false : _ref$triggerActivate,
|
|
37
|
+
activateOptions = _ref.activateOptions,
|
|
38
|
+
keepFiltersAndSearch = _ref.keepFiltersAndSearch,
|
|
39
|
+
_ref$fromUrl = _ref.fromUrl,
|
|
40
|
+
fromUrl = _ref$fromUrl === void 0 ? false : _ref$fromUrl,
|
|
41
|
+
forceRemoveFiltersAndSearch = _ref.forceRemoveFiltersAndSearch;
|
|
42
|
+
var state = thunkApi.getState();
|
|
43
|
+
var filerobot = thunkApi.extra.filerobot;
|
|
44
|
+
var viewBeforeChange = selectActiveView(state);
|
|
45
|
+
var newlyActivatedView = viewBeforeChange;
|
|
46
|
+
var isDiffView = viewBeforeChange !== view;
|
|
47
|
+
if (isDiffView) {
|
|
48
|
+
var allViews = selectAllViews(state);
|
|
49
|
+
var _filerobot$getPlugin = filerobot.getPlugin(PLUGINS_IDS.EXPLORER),
|
|
50
|
+
_filerobot$getPlugin$ = _filerobot$getPlugin.opts,
|
|
51
|
+
disableFiltersAndSearch = _filerobot$getPlugin$.disableFiltersAndSearch,
|
|
52
|
+
forceFilters = _filerobot$getPlugin$.forceFilters,
|
|
53
|
+
updateViewQueryInUrl = _filerobot$getPlugin.updateViewQueryInUrl;
|
|
54
|
+
if (!allViews.includes(view)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// We are almost don't need any running/pending request if we have changed the view to avoid issues with views changing
|
|
59
|
+
// by returning back to some view again due to late request's response that's received after switching to another view..
|
|
60
|
+
thunkApi.abortAllInProgressAsyncThunks();
|
|
61
|
+
changeViewFetchFilesCachedQueries(null);
|
|
62
|
+
var dontRemoveFiltersAndSearch = (disableFiltersAndSearch || forceFilters || keepFiltersAndSearch || fromUrl) && !forceRemoveFiltersAndSearch;
|
|
63
|
+
thunkApi.dispatch(viewChanged({
|
|
64
|
+
view: view,
|
|
65
|
+
keepFiltersAndSearch: dontRemoveFiltersAndSearch
|
|
66
|
+
}));
|
|
67
|
+
newlyActivatedView = selectActiveView(thunkApi.getState());
|
|
68
|
+
var isViewChanged = viewBeforeChange !== newlyActivatedView; // double checking that the view is changed, as there is possibility for otherwise if wrong view id is provided
|
|
69
|
+
|
|
70
|
+
// Triggered here for making sure it's triggered after changing the view, and avoid extrareducers/issues that handled after calling viewChanged.
|
|
71
|
+
filerobot.emit('view-change-request', newlyActivatedView, isDiffView);
|
|
72
|
+
if (isViewChanged) {
|
|
73
|
+
if (!fromUrl) {
|
|
74
|
+
updateViewQueryInUrl({
|
|
75
|
+
view: newlyActivatedView,
|
|
76
|
+
keysToDelete: Object.values(dontRemoveFiltersAndSearch ? FMAW_URL_VIEW_QUERY_PARAMS : FMAW_URL_QUERY_PARAMS)
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
filerobot.emit('view-changed', newlyActivatedView);
|
|
80
|
+
}
|
|
81
|
+
} else {
|
|
82
|
+
filerobot.emit('view-change-request', newlyActivatedView, isDiffView);
|
|
83
|
+
}
|
|
84
|
+
if (triggerActivate && typeof ((_VIEW_OPTIONS$newlyAc = VIEW_OPTIONS[newlyActivatedView]) === null || _VIEW_OPTIONS$newlyAc === void 0 ? void 0 : _VIEW_OPTIONS$newlyAc.activateAction) === 'function') {
|
|
85
|
+
thunkApi.dispatch(loadFiltersFromOutside({
|
|
86
|
+
fromUrl: fromUrl
|
|
87
|
+
}));
|
|
88
|
+
thunkApi.dispatch(loadSearchFromOutside({
|
|
89
|
+
fromUrl: fromUrl
|
|
90
|
+
}));
|
|
91
|
+
thunkApi.dispatch(VIEW_OPTIONS[newlyActivatedView].activateAction(_objectSpread({
|
|
92
|
+
skipViewDispatch: true,
|
|
93
|
+
keepFiltersAndSearch: keepFiltersAndSearch
|
|
94
|
+
}, activateOptions)));
|
|
95
|
+
}
|
|
96
|
+
return newlyActivatedView;
|
|
97
|
+
});
|
|
98
|
+
export var changeLayout = createThunk(function (newLayout, thunkApi) {
|
|
99
|
+
thunkApi.dispatch(layoutChanged(newLayout));
|
|
100
|
+
var state = thunkApi.getState();
|
|
101
|
+
var isFoldersView = selectIsFoldersView(state);
|
|
102
|
+
if (isFoldersView && newLayout === LAYOUTS_IDS.GRID) {
|
|
103
|
+
// If the first folder of current loaded folders doesn't contain value for previews property
|
|
104
|
+
// means no previews request triggered before, so we are triggering it now.
|
|
105
|
+
// Also if the sort of files & folders are not the same, while we are changing the layout from list to grid...
|
|
106
|
+
// then no need to trigger folder previews request cause we're going to refetch the folders with a unified sort with previews.
|
|
107
|
+
var folders = selectFoldersArray(state) || [];
|
|
108
|
+
var isFilesAndFoldersSortDifferent = selectFoldersSortedBy(state) !== selectFilesSortedBy(state) || selectFoldersSortOrder(state) !== selectFilesSortOrder(state);
|
|
109
|
+
if (folders.length > 0 && !folders[0].previews && !isFilesAndFoldersSortDifferent) {
|
|
110
|
+
thunkApi.dispatch(fetchFoldersPreviews({
|
|
111
|
+
abortSignal: thunkApi.signal
|
|
112
|
+
}));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
export var activateViewFromOutside = createThunk(function (_ref2, thunkApi) {
|
|
117
|
+
var _currentView$checkVis;
|
|
118
|
+
var _ref2$fromUrl = _ref2.fromUrl,
|
|
119
|
+
fromUrl = _ref2$fromUrl === void 0 ? false : _ref2$fromUrl;
|
|
120
|
+
var dispatch = thunkApi.dispatch,
|
|
121
|
+
getState = thunkApi.getState,
|
|
122
|
+
filerobot = thunkApi.extra.filerobot;
|
|
123
|
+
var _filerobot$getPlugin2 = filerobot.getPlugin(PLUGINS_IDS.EXPLORER),
|
|
124
|
+
getUrlQueryParam = _filerobot$getPlugin2.getUrlQueryParam,
|
|
125
|
+
opts = _filerobot$getPlugin2.opts,
|
|
126
|
+
checkUserPermissions = _filerobot$getPlugin2.checkUserPermissions,
|
|
127
|
+
i18n = _filerobot$getPlugin2.i18n,
|
|
128
|
+
info = _filerobot$getPlugin2.info;
|
|
129
|
+
var view = opts.view,
|
|
130
|
+
viewItem = opts.viewItem,
|
|
131
|
+
viewSubItem = opts.viewSubItem,
|
|
132
|
+
views = opts.views,
|
|
133
|
+
_opts$isRecursiveFetc = opts.isRecursiveFetch,
|
|
134
|
+
isRecursiveFetch = _opts$isRecursiveFetc === void 0 ? false : _opts$isRecursiveFetc;
|
|
135
|
+
var activeView = selectActiveView(getState());
|
|
136
|
+
var viewOptions = {
|
|
137
|
+
id: view || activeView,
|
|
138
|
+
itemToOpen: viewItem,
|
|
139
|
+
subItemToOpen: viewSubItem,
|
|
140
|
+
isRecursive: isRecursiveFetch
|
|
141
|
+
};
|
|
142
|
+
if (fromUrl) {
|
|
143
|
+
var _getUrlQueryParam;
|
|
144
|
+
var viewId = ((_getUrlQueryParam = getUrlQueryParam(FMAW_URL_QUERY_PARAMS.VIEW)) === null || _getUrlQueryParam === void 0 ? void 0 : _getUrlQueryParam.toUpperCase()) || viewOptions.id;
|
|
145
|
+
viewOptions = {
|
|
146
|
+
id: viewId,
|
|
147
|
+
itemToOpen: getUrlQueryParam(FMAW_URL_QUERY_PARAMS.VIEW_ITEM) || viewId === viewOptions.id && viewOptions.itemToOpen,
|
|
148
|
+
subItemToOpen: getUrlQueryParam(FMAW_URL_QUERY_PARAMS.VIEW_SUB_ITEM) || viewId === viewOptions.id && viewOptions.subItemToOpen,
|
|
149
|
+
fromUrl: true,
|
|
150
|
+
isRecursive: parseInt(getUrlQueryParam(FMAW_URL_QUERY_PARAMS.VIEW_RECURSIVE), 10) === 1
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
if (viewOptions.itemToOpen && (viewOptions.itemToOpen === '/.internal' || viewOptions.itemToOpen.startsWith('/.internal/'))) {
|
|
154
|
+
info(i18n('explorerInvalidPathInfo'), 'warning');
|
|
155
|
+
viewOptions.itemToOpen = '/';
|
|
156
|
+
}
|
|
157
|
+
var currentView = VIEW_OPTIONS[viewOptions.id];
|
|
158
|
+
var isVisibleView = currentView && views.includes(viewOptions.id.toUpperCase()) && (!fromUrl || !currentView.checkVisibility || ((_currentView$checkVis = currentView.checkVisibility) === null || _currentView$checkVis === void 0 ? void 0 : _currentView$checkVis.call(currentView, {
|
|
159
|
+
checkUserPermissions: checkUserPermissions
|
|
160
|
+
})));
|
|
161
|
+
if (isVisibleView) {
|
|
162
|
+
return dispatch(changeView({
|
|
163
|
+
triggerActivate: true,
|
|
164
|
+
view: viewOptions.id,
|
|
165
|
+
activateOptions: viewOptions,
|
|
166
|
+
fromUrl: fromUrl
|
|
167
|
+
}));
|
|
168
|
+
}
|
|
169
|
+
info(i18n('explorerInvalidViewProvided'), 'warning');
|
|
170
|
+
var activeViewId = selectActiveView(thunkApi.getState());
|
|
171
|
+
return dispatch(changeView({
|
|
172
|
+
triggerActivate: true,
|
|
173
|
+
view: activeViewId,
|
|
174
|
+
fromUrl: fromUrl
|
|
175
|
+
}));
|
|
176
|
+
});
|
|
177
|
+
export var searchOrListViewFiles = createThunk(function () {
|
|
178
|
+
var _extra$filerobot$getP, _extra$filerobot$getP2, _defaultSearchSort$te, _defaultSearchSort$te2;
|
|
179
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
180
|
+
searchQuery = _ref3.searchQuery,
|
|
181
|
+
offset = _ref3.offset,
|
|
182
|
+
cachedViewQueries = _ref3.cachedViewQueries,
|
|
183
|
+
sorting = _ref3.sorting,
|
|
184
|
+
rest = _objectWithoutProperties(_ref3, _excluded);
|
|
185
|
+
var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
|
|
186
|
+
var _rest$applyActiveView = rest.applyActiveViewItemCheck,
|
|
187
|
+
applyActiveViewItemCheck = _rest$applyActiveView === void 0 ? true : _rest$applyActiveView;
|
|
188
|
+
var dispatch = thunkApi.dispatch,
|
|
189
|
+
getState = thunkApi.getState,
|
|
190
|
+
extra = thunkApi.extra;
|
|
191
|
+
var state = getState();
|
|
192
|
+
if (applyActiveViewItemCheck && !selectActiveViewItem(state)) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
var currentSearchQuery = selectSearchQuery(state);
|
|
196
|
+
var isAiSearch = selectIsAiSearch(state);
|
|
197
|
+
var isAssetsView = selectIsAssetsView(state);
|
|
198
|
+
if (isAiSearch && isAssetsView) {
|
|
199
|
+
return dispatch(searchFilesWithAiText({
|
|
200
|
+
searchQuery: currentSearchQuery
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
var isSimilarSearchActive = selectIsSimilarSearchActive(state);
|
|
204
|
+
if (isSimilarSearchActive) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// If no search query at all then no need to trigger search request instead trigger fetchFiles for listing.
|
|
209
|
+
var isNoSearchAtAll = !searchQuery && !currentSearchQuery;
|
|
210
|
+
if (isNoSearchAtAll) {
|
|
211
|
+
var defaultOffset = rest.replaceOldFiles === false ? undefined : 0;
|
|
212
|
+
return dispatch(fetchFiles(_objectSpread({
|
|
213
|
+
offset: offset !== null && offset !== void 0 ? offset : defaultOffset,
|
|
214
|
+
cachedViewQueries: cachedViewQueries,
|
|
215
|
+
sorting: sorting
|
|
216
|
+
}, rest)));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// exact and extended search
|
|
220
|
+
var _ref4 = (extra === null || extra === void 0 ? void 0 : (_extra$filerobot$getP = extra.filerobot.getPlugin(PLUGINS_IDS.EXPLORER)) === null || _extra$filerobot$getP === void 0 ? void 0 : (_extra$filerobot$getP2 = _extra$filerobot$getP.opts) === null || _extra$filerobot$getP2 === void 0 ? void 0 : _extra$filerobot$getP2.config) || {},
|
|
221
|
+
defaultSearchSort = _ref4.defaultSearchSort;
|
|
222
|
+
var defaultSearchSortBy = checkIsValidSearchSortBy(defaultSearchSort === null || defaultSearchSort === void 0 ? void 0 : (_defaultSearchSort$te = defaultSearchSort.text) === null || _defaultSearchSort$te === void 0 ? void 0 : _defaultSearchSort$te.by) ? defaultSearchSort.text.by : SORT_BY.RELEVANCE;
|
|
223
|
+
var defaultSearchSortOrder = checkIsValidSortOrder(defaultSearchSort === null || defaultSearchSort === void 0 ? void 0 : (_defaultSearchSort$te2 = defaultSearchSort.text) === null || _defaultSearchSort$te2 === void 0 ? void 0 : _defaultSearchSort$te2.order) ? defaultSearchSort.text.order : SORT_ORDER.DSC;
|
|
224
|
+
var isSearchedBefore = selectIsSearchFetchType(state);
|
|
225
|
+
var searchArgs = {
|
|
226
|
+
searchQuery: searchQuery || currentSearchQuery,
|
|
227
|
+
cachedViewQueries: cachedViewQueries,
|
|
228
|
+
sorting: isSearchedBefore ? sorting : "".concat(defaultSearchSortBy, ":").concat(defaultSearchSortOrder)
|
|
229
|
+
};
|
|
230
|
+
return dispatch(submitSearch(searchArgs));
|
|
231
|
+
});
|
|
232
|
+
export var resetSearchAndFiltersMode = createThunk(function (_, thunkApi) {
|
|
233
|
+
thunkApi.dispatch(updateFilteredFiles({
|
|
234
|
+
filters: {},
|
|
235
|
+
dismissApiCall: true,
|
|
236
|
+
noInformer: true
|
|
237
|
+
}));
|
|
238
|
+
thunkApi.dispatch(updateSearchQuery({
|
|
239
|
+
query: '',
|
|
240
|
+
noInformer: true
|
|
241
|
+
}));
|
|
242
|
+
thunkApi.dispatch(updateSearchSuggestions({
|
|
243
|
+
filters: [],
|
|
244
|
+
tags: [],
|
|
245
|
+
dismissApiCall: true,
|
|
246
|
+
noInformer: true
|
|
247
|
+
}));
|
|
248
|
+
});
|
|
249
|
+
var viewsSlice = createSlice({
|
|
250
|
+
name: sliceName,
|
|
251
|
+
initialState: initialState,
|
|
252
|
+
reducers: {
|
|
253
|
+
viewChanged: function viewChanged(state, action) {
|
|
254
|
+
var newView = action.payload.view;
|
|
255
|
+
if (newView === state.activeView) {
|
|
256
|
+
return state;
|
|
257
|
+
}
|
|
258
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
259
|
+
activeView: newView
|
|
260
|
+
});
|
|
261
|
+
},
|
|
262
|
+
viewsChanged: function viewsChanged(state, action) {
|
|
263
|
+
var newViews = action.payload.views || state.list;
|
|
264
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
265
|
+
list: newViews
|
|
266
|
+
});
|
|
267
|
+
},
|
|
268
|
+
layoutChanged: function layoutChanged(state, action) {
|
|
269
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
270
|
+
layout: action.payload
|
|
271
|
+
});
|
|
272
|
+
},
|
|
273
|
+
viewsStateUpdated: function viewsStateUpdated(state, action) {
|
|
274
|
+
return _objectSpread(_objectSpread({}, state), action.payload);
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
extraReducers: function extraReducers(builder) {
|
|
278
|
+
builder.addMatcher(isAnyOf(generateUserKey.fulfilled, fetchUserAuthState.fulfilled), viewsSlice.caseReducers.viewsChanged);
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
var _viewsSlice$actions = viewsSlice.actions,
|
|
282
|
+
viewChanged = _viewsSlice$actions.viewChanged,
|
|
283
|
+
viewsChanged = _viewsSlice$actions.viewsChanged,
|
|
284
|
+
layoutChanged = _viewsSlice$actions.layoutChanged,
|
|
285
|
+
viewsStateUpdated = _viewsSlice$actions.viewsStateUpdated;
|
|
286
|
+
export { viewChanged, viewsChanged, layoutChanged, viewsStateUpdated };
|
|
287
|
+
export var selectViewsState = function selectViewsState(state) {
|
|
288
|
+
var _state$PLUGINS_IDS$EX;
|
|
289
|
+
return ((_state$PLUGINS_IDS$EX = state[PLUGINS_IDS.EXPLORER]) === null || _state$PLUGINS_IDS$EX === void 0 ? void 0 : _state$PLUGINS_IDS$EX[slicePropName]) || initialState;
|
|
290
|
+
};
|
|
291
|
+
export var selectActiveView = function selectActiveView(state) {
|
|
292
|
+
return selectViewsState(state).activeView;
|
|
293
|
+
};
|
|
294
|
+
var checkViewActivation = function checkViewActivation(state, viewId) {
|
|
295
|
+
return selectActiveView(state) === viewId;
|
|
296
|
+
};
|
|
297
|
+
var checkViewLayoutActivation = function checkViewLayoutActivation(state, layout) {
|
|
298
|
+
return selectViewLayout(state) === layout;
|
|
299
|
+
};
|
|
300
|
+
export var selectAllViews = function selectAllViews(state) {
|
|
301
|
+
return selectViewsState(state).list;
|
|
302
|
+
};
|
|
303
|
+
var checkViewAvailability = function checkViewAvailability(state, viewId) {
|
|
304
|
+
return selectAllViews(state).includes(viewId);
|
|
305
|
+
};
|
|
306
|
+
export var selectIsAssetsViewAvailable = function selectIsAssetsViewAvailable(state) {
|
|
307
|
+
return checkViewAvailability(state, VIEW_IDS.ASSETS);
|
|
308
|
+
};
|
|
309
|
+
export var selectIsFoldersViewAvailable = function selectIsFoldersViewAvailable(state) {
|
|
310
|
+
return checkViewAvailability(state, VIEW_IDS.FOLDERS);
|
|
311
|
+
};
|
|
312
|
+
export var selectIsSearchMode = function selectIsSearchMode(state) {
|
|
313
|
+
return Boolean(selectSearchQuery(state));
|
|
314
|
+
};
|
|
315
|
+
export var selectIsSearchOrFiltersMode = function selectIsSearchOrFiltersMode(state) {
|
|
316
|
+
return selectIsSearchMode(state) || selectIsFiltersActive(state);
|
|
317
|
+
};
|
|
318
|
+
export var selectIsAssetsView = function selectIsAssetsView(state) {
|
|
319
|
+
return checkViewActivation(state, VIEW_IDS.ASSETS);
|
|
320
|
+
};
|
|
321
|
+
export var selectIsFoldersView = function selectIsFoldersView(state) {
|
|
322
|
+
return checkViewActivation(state, VIEW_IDS.FOLDERS);
|
|
323
|
+
};
|
|
324
|
+
export var selectViewLayout = function selectViewLayout(state) {
|
|
325
|
+
return selectViewsState(state).layout;
|
|
326
|
+
};
|
|
327
|
+
export var selectIsListLayout = function selectIsListLayout(state) {
|
|
328
|
+
return checkViewLayoutActivation(state, LAYOUTS_IDS.LIST);
|
|
329
|
+
};
|
|
330
|
+
export var selectIsGridLayout = function selectIsGridLayout(state) {
|
|
331
|
+
return checkViewLayoutActivation(state, LAYOUTS_IDS.GRID);
|
|
332
|
+
};
|
|
333
|
+
export var selectIsTilesLayout = function selectIsTilesLayout(state) {
|
|
334
|
+
return checkViewLayoutActivation(state, LAYOUTS_IDS.TILES);
|
|
335
|
+
};
|
|
336
|
+
export var selectActiveViewItem = function selectActiveViewItem(state) {
|
|
337
|
+
var _VIEW_OPTIONS$activeV, _VIEW_OPTIONS$activeV2;
|
|
338
|
+
var activeView = selectActiveView(state);
|
|
339
|
+
if (!activeView) {
|
|
340
|
+
return null;
|
|
341
|
+
}
|
|
342
|
+
var activeViewItem = (_VIEW_OPTIONS$activeV = VIEW_OPTIONS[activeView]) === null || _VIEW_OPTIONS$activeV === void 0 ? void 0 : (_VIEW_OPTIONS$activeV2 = _VIEW_OPTIONS$activeV.activeItemSelector) === null || _VIEW_OPTIONS$activeV2 === void 0 ? void 0 : _VIEW_OPTIONS$activeV2.call(_VIEW_OPTIONS$activeV, state);
|
|
343
|
+
return activeViewItem || null;
|
|
344
|
+
};
|
|
345
|
+
export default viewsSlice.reducer;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
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); }
|
|
2
|
+
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; }
|
|
3
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
4
|
+
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); }
|
|
5
|
+
import cuid from 'cuid';
|
|
6
|
+
import { PROGRESS_PANEL_ACTIVITY, PROGRESS_PANEL_STATUS, PLUGINS_IDS } from '@scaleflex/widget-utils/lib/constants';
|
|
7
|
+
import createThunk from '@scaleflex/widget-utils/lib/createThunk';
|
|
8
|
+
import { PC } from '@scaleflex/widget-common';
|
|
9
|
+
var archiveItems = createThunk(async function (_ref, thunkApi) {
|
|
10
|
+
var folderIdentifiers = _ref.folderIdentifiers,
|
|
11
|
+
fileIdentifiers = _ref.fileIdentifiers,
|
|
12
|
+
urls = _ref.urls,
|
|
13
|
+
signal = _ref.signal;
|
|
14
|
+
var extra = thunkApi.extra;
|
|
15
|
+
var _await$extra$apiClien = await extra.apiClient.post('file-archive', {
|
|
16
|
+
data: {
|
|
17
|
+
folders_uuids: folderIdentifiers,
|
|
18
|
+
files_uuids: fileIdentifiers,
|
|
19
|
+
urls: urls
|
|
20
|
+
},
|
|
21
|
+
abortSignal: signal
|
|
22
|
+
}),
|
|
23
|
+
taskId = _await$extra$apiClien.task_id;
|
|
24
|
+
if (taskId) {
|
|
25
|
+
return {
|
|
26
|
+
taskId: taskId,
|
|
27
|
+
taskUrl: "file-archive/".concat(taskId)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
dismissGlobalAbort: true
|
|
32
|
+
});
|
|
33
|
+
var cancelArchive = createThunk(function (_ref2, thunkApi) {
|
|
34
|
+
var taskId = _ref2.taskId;
|
|
35
|
+
return thunkApi.extra.apiClient.patch("file-archive/".concat(taskId, "/cancel"));
|
|
36
|
+
});
|
|
37
|
+
var checkArchiveStatus = createThunk(async function (_ref3, thunkApi) {
|
|
38
|
+
var taskId = _ref3.taskId,
|
|
39
|
+
taskUrl = _ref3.taskUrl,
|
|
40
|
+
signal = _ref3.signal;
|
|
41
|
+
var extra = thunkApi.extra,
|
|
42
|
+
rejectWithValue = thunkApi.rejectWithValue;
|
|
43
|
+
if (!taskId) {
|
|
44
|
+
return rejectWithValue(extra.filerobot.i18n('mutualizedUnknownErrorMessage'));
|
|
45
|
+
}
|
|
46
|
+
var _await$extra$apiClien2 = await extra.apiClient.get("".concat(taskUrl, "?status_only=1"), {
|
|
47
|
+
abortSignal: signal
|
|
48
|
+
}),
|
|
49
|
+
status = _await$extra$apiClien2.task_status,
|
|
50
|
+
progress = _await$extra$apiClien2.task_percent;
|
|
51
|
+
if (['PENDING', 'RUNNING', 'PROCESSING'].includes(status)) {
|
|
52
|
+
return {
|
|
53
|
+
retrigger: true,
|
|
54
|
+
progress: progress
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (status === 'DONE') {
|
|
58
|
+
return {
|
|
59
|
+
retrigger: false,
|
|
60
|
+
taskId: taskId,
|
|
61
|
+
taskUrl: taskUrl,
|
|
62
|
+
headers: {
|
|
63
|
+
'Content-Type': 'application/zip'
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return rejectWithValue(extra.filerobot.i18n('mutualizedUnknownErrorMessage'));
|
|
68
|
+
}, {
|
|
69
|
+
dismissGlobalAbort: true
|
|
70
|
+
});
|
|
71
|
+
var addArchiveActivity = createThunk(function (_ref4, thunkApi) {
|
|
72
|
+
var activityId = _ref4.id,
|
|
73
|
+
items = _ref4.items,
|
|
74
|
+
itemsSize = _ref4.itemsSize,
|
|
75
|
+
urls = _ref4.urls,
|
|
76
|
+
avoidExportEvent = _ref4.avoidExportEvent,
|
|
77
|
+
onRetry = _ref4.onRetry,
|
|
78
|
+
_onStart = _ref4.onStart,
|
|
79
|
+
preparingStatusI18nKey = _ref4.preparingStatusI18nKey,
|
|
80
|
+
folderIdentifiers = _ref4.folderIdentifiers,
|
|
81
|
+
fileIdentifiers = _ref4.fileIdentifiers;
|
|
82
|
+
var dispatch = thunkApi.dispatch,
|
|
83
|
+
extra = thunkApi.extra;
|
|
84
|
+
var progressPanelPlugin = extra.filerobot.getPlugin(PLUGINS_IDS.PROGRESS_PANEL);
|
|
85
|
+
var id = activityId || cuid();
|
|
86
|
+
var archiveTaskId;
|
|
87
|
+
var useRetryAction = id && items && itemsSize && (urls || folderIdentifiers || fileIdentifiers);
|
|
88
|
+
return progressPanelPlugin.addActivity({
|
|
89
|
+
isSaveableActivity: true,
|
|
90
|
+
activity: {
|
|
91
|
+
id: id,
|
|
92
|
+
type: PROGRESS_PANEL_ACTIVITY.ARCHIVE,
|
|
93
|
+
hideRetryButton: !useRetryAction,
|
|
94
|
+
progress: {
|
|
95
|
+
percentage: 0,
|
|
96
|
+
startedAt: Date.now(),
|
|
97
|
+
status: PROGRESS_PANEL_STATUS.PREPARING
|
|
98
|
+
},
|
|
99
|
+
icon: {
|
|
100
|
+
name: 'Archive',
|
|
101
|
+
color: PC.BorderPrimaryStateless
|
|
102
|
+
},
|
|
103
|
+
statusData: _defineProperty(_defineProperty(_defineProperty({}, PROGRESS_PANEL_STATUS.PREPARING, {
|
|
104
|
+
labelI18nKey: preparingStatusI18nKey || 'progressPanelPreparingArchiveLabel'
|
|
105
|
+
}), PROGRESS_PANEL_STATUS.PROGRESSING, {
|
|
106
|
+
labelI18nKey: 'progressPanelPreparingArchiveLabel'
|
|
107
|
+
}), PROGRESS_PANEL_STATUS.ERROR, {
|
|
108
|
+
labelI18nKey: 'progressPanelArchiveFailedLabel'
|
|
109
|
+
})
|
|
110
|
+
},
|
|
111
|
+
onStart: async function onStart(_ref5) {
|
|
112
|
+
var activitySignal = _ref5.activitySignal;
|
|
113
|
+
var archiveItemsTask = typeof _onStart === 'function' ? _onStart() : await dispatch(archiveItems({
|
|
114
|
+
folderIdentifiers: folderIdentifiers,
|
|
115
|
+
fileIdentifiers: fileIdentifiers,
|
|
116
|
+
urls: urls,
|
|
117
|
+
signal: activitySignal
|
|
118
|
+
})).throwRejection();
|
|
119
|
+
archiveTaskId = archiveItemsTask === null || archiveItemsTask === void 0 ? void 0 : archiveItemsTask.taskId;
|
|
120
|
+
return archiveItemsTask;
|
|
121
|
+
},
|
|
122
|
+
onProgress: function onProgress(_ref6) {
|
|
123
|
+
var onStartData = _ref6.onStartData,
|
|
124
|
+
activitySignal = _ref6.activitySignal;
|
|
125
|
+
return dispatch(checkArchiveStatus({
|
|
126
|
+
taskId: onStartData.taskId,
|
|
127
|
+
taskUrl: onStartData.taskUrl,
|
|
128
|
+
signal: activitySignal
|
|
129
|
+
})).throwRejection();
|
|
130
|
+
},
|
|
131
|
+
onRetry: useRetryAction && function (_ref7) {
|
|
132
|
+
var id = _ref7.id;
|
|
133
|
+
if (typeof onRetry === 'function') {
|
|
134
|
+
return onRetry({
|
|
135
|
+
id: id
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return dispatch(addArchiveActivity({
|
|
139
|
+
id: id,
|
|
140
|
+
items: items,
|
|
141
|
+
itemsSize: itemsSize,
|
|
142
|
+
urls: urls,
|
|
143
|
+
avoidExportEvent: avoidExportEvent,
|
|
144
|
+
folderIdentifiers: folderIdentifiers,
|
|
145
|
+
fileIdentifiers: fileIdentifiers,
|
|
146
|
+
preparingStatusI18nKey: preparingStatusI18nKey,
|
|
147
|
+
onStart: _onStart
|
|
148
|
+
}));
|
|
149
|
+
},
|
|
150
|
+
onCancel: function onCancel() {
|
|
151
|
+
if (archiveTaskId) {
|
|
152
|
+
dispatch(cancelArchive({
|
|
153
|
+
taskId: archiveTaskId
|
|
154
|
+
}));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
export var addArchive = createThunk(async function (params, thunkApi) {
|
|
160
|
+
var urls = params.urls,
|
|
161
|
+
folderIdentifiers = params.folderIdentifiers,
|
|
162
|
+
fileIdentifiers = params.fileIdentifiers;
|
|
163
|
+
var dispatch = thunkApi.dispatch,
|
|
164
|
+
extra = thunkApi.extra;
|
|
165
|
+
var progressPanelPlugin = extra.filerobot.getPlugin(PLUGINS_IDS.PROGRESS_PANEL);
|
|
166
|
+
if (progressPanelPlugin) {
|
|
167
|
+
return dispatch(addArchiveActivity(params));
|
|
168
|
+
} else {
|
|
169
|
+
return dispatch(archiveItems({
|
|
170
|
+
folderIdentifiers: folderIdentifiers,
|
|
171
|
+
fileIdentifiers: fileIdentifiers,
|
|
172
|
+
urls: urls
|
|
173
|
+
})).throwRejection();
|
|
174
|
+
}
|
|
175
|
+
});
|