@scaleflex/widget-explorer 4.4.0 → 4.5.1
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 +22 -0
- package/README.md +21 -3
- 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 +231 -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 +295 -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/CollectionsView/CollectionFolderIcon.js +35 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionTreeSkeletion.js +26 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionVirtualFoldersTree.styled.js +52 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/CollectionVirtualFoldersTree.utils.js +24 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/Folder.js +88 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/Tree.js +50 -0
- package/lib/components/CollectionsView/CollectionVirtualFoldersTree/index.js +75 -0
- package/lib/components/CollectionsView/CollectionsSkeleton.js +30 -0
- package/lib/components/CollectionsView/CollectionsTree/ActiveCollectionContent.js +61 -0
- package/lib/components/CollectionsView/CollectionsTree/CollectionTreeItem.js +44 -0
- package/lib/components/CollectionsView/CollectionsTree/CollectionsContent.js +130 -0
- package/lib/components/CollectionsView/CollectionsTree/CollectionsTree.styled.js +84 -0
- package/lib/components/CollectionsView/CollectionsTree/index.js +47 -0
- package/lib/components/CollectionsView/CollectionsView.styled.js +38 -0
- package/lib/components/CollectionsView/VirtualFoldersGrid.js +67 -0
- package/lib/components/CollectionsView/index.js +188 -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 +76 -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 +200 -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 +35 -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 +606 -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 +118 -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 +79 -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 +81 -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/LabelsView/LabelsTree/LabelsTree.styled.js +86 -0
- package/lib/components/LabelsView/LabelsTree/LabelsTreeSkeleton.js +21 -0
- package/lib/components/LabelsView/LabelsTree/index.js +128 -0
- package/lib/components/LabelsView/LabelsView.styled.js +10 -0
- package/lib/components/LabelsView/index.js +139 -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 +101 -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 +197 -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 +55 -0
- package/lib/components/Views/Views.styled.js +87 -0
- package/lib/components/Views/index.js +107 -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 +88 -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 +1396 -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/collections.slice.js +714 -0
- package/lib/slices/common.slice.js +217 -0
- package/lib/slices/drag.slice.js +75 -0
- package/lib/slices/files.slice.js +1310 -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 +36 -0
- package/lib/slices/labels.slice.js +652 -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 +357 -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 +75 -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,652 @@
|
|
|
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 _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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; } }
|
|
5
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
6
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
7
|
+
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; }
|
|
8
|
+
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; }
|
|
9
|
+
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; }
|
|
10
|
+
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; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
13
|
+
import { createSelector, createSlice } from '@reduxjs/toolkit';
|
|
14
|
+
import createThunk from '@scaleflex/widget-utils/lib/createThunk';
|
|
15
|
+
import { VIEW_IDS, PLUGINS_IDS, FMAW_URL_QUERY_PARAMS } from '@scaleflex/widget-utils/lib/constants';
|
|
16
|
+
import escapeRegExp from '@scaleflex/widget-utils/lib/escapeRegExp';
|
|
17
|
+
import getActionErrorState from '@scaleflex/widget-utils/lib/getActionErrorState';
|
|
18
|
+
import { filesRemoved, searchFilesService } from './files.slice';
|
|
19
|
+
import { downloadOneFile, downloadItems } from '../thunks/downloads.thunks';
|
|
20
|
+
import { selectIsLabelsView, changeView, searchOrListViewFiles, changeViewFetchFilesCachedQueries } from './views.slice';
|
|
21
|
+
import { SORT_ORDER, SORT_BY } from '../components/common/Sort/Sort.constants';
|
|
22
|
+
import { selectionsCleared } from './selections.slice';
|
|
23
|
+
import { currentFolderUpdated } from './folders.slice';
|
|
24
|
+
import { applyBulkFilesPropertiesChanges, updateBulkFilesLabels } from './metadata.slice';
|
|
25
|
+
import { fileWindowUpdated } from './panels.slice';
|
|
26
|
+
import { exactAndExtendedFilesRemoved } from './search.slice';
|
|
27
|
+
|
|
28
|
+
// TODO: We are hardcoding file slice name as it causes initialization error
|
|
29
|
+
var filesSliceName = 'Explorer/files';
|
|
30
|
+
var slicePropName = 'labels';
|
|
31
|
+
var sliceName = "".concat(PLUGINS_IDS.EXPLORER, "/").concat(slicePropName);
|
|
32
|
+
var ATTACH_LABELS_TO_FILES_LIMIT = 250;
|
|
33
|
+
var BULK_EDIT_LABELS_TYPES = {
|
|
34
|
+
ADD: 'labels.add',
|
|
35
|
+
DELETE: 'labels.del'
|
|
36
|
+
};
|
|
37
|
+
var initialState = {
|
|
38
|
+
uuids: [],
|
|
39
|
+
entities: {},
|
|
40
|
+
activeLabelUuid: null,
|
|
41
|
+
searchTerm: '',
|
|
42
|
+
selectedUuids: [],
|
|
43
|
+
sortOrder: SORT_ORDER.ASC,
|
|
44
|
+
sortedBy: SORT_BY.NAME,
|
|
45
|
+
loading: true,
|
|
46
|
+
showTree: true,
|
|
47
|
+
error: null
|
|
48
|
+
};
|
|
49
|
+
var checkIfReachedTheLimit = function checkIfReachedTheLimit(filesUuids) {
|
|
50
|
+
return filesUuids.length >= ATTACH_LABELS_TO_FILES_LIMIT;
|
|
51
|
+
};
|
|
52
|
+
var prepareBulkAttachedLabels = function prepareBulkAttachedLabels(type, labelsSids) {
|
|
53
|
+
return labelsSids.map(function (labelSid) {
|
|
54
|
+
return {
|
|
55
|
+
type: type,
|
|
56
|
+
value: labelSid
|
|
57
|
+
};
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Used only in enabling/opening/activating labels view, and possible to open a specific label after loading the view through its param.
|
|
62
|
+
export var activateLabelsView = createThunk(async function () {
|
|
63
|
+
var _labels, _selectSortedLabelsUu;
|
|
64
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
65
|
+
_ref$itemToOpen = _ref.itemToOpen,
|
|
66
|
+
labelUuidOrSidToActivate = _ref$itemToOpen === void 0 ? null : _ref$itemToOpen,
|
|
67
|
+
_ref$skipViewDispatch = _ref.skipViewDispatch,
|
|
68
|
+
skipViewDispatch = _ref$skipViewDispatch === void 0 ? false : _ref$skipViewDispatch,
|
|
69
|
+
_ref$skipFetch = _ref.skipFetch,
|
|
70
|
+
skipFetch = _ref$skipFetch === void 0 ? false : _ref$skipFetch,
|
|
71
|
+
_ref$keepFiltersAndSe = _ref.keepFiltersAndSearch,
|
|
72
|
+
keepFiltersAndSearch = _ref$keepFiltersAndSe === void 0 ? false : _ref$keepFiltersAndSe,
|
|
73
|
+
_ref$fromUrl = _ref.fromUrl,
|
|
74
|
+
fromUrl = _ref$fromUrl === void 0 ? false : _ref$fromUrl;
|
|
75
|
+
var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
|
|
76
|
+
var dispatch = thunkApi.dispatch,
|
|
77
|
+
getState = thunkApi.getState,
|
|
78
|
+
signal = thunkApi.signal,
|
|
79
|
+
extra = thunkApi.extra;
|
|
80
|
+
var _extra$filerobot = extra.filerobot,
|
|
81
|
+
i18n = _extra$filerobot.i18n,
|
|
82
|
+
info = _extra$filerobot.info;
|
|
83
|
+
if (!skipViewDispatch) dispatch(changeView({
|
|
84
|
+
view: VIEW_IDS.LABELS,
|
|
85
|
+
keepFiltersAndSearch: keepFiltersAndSearch,
|
|
86
|
+
fromUrl: fromUrl
|
|
87
|
+
}));
|
|
88
|
+
dispatch(currentFolderUpdated({}));
|
|
89
|
+
dispatch(filesRemoved());
|
|
90
|
+
dispatch(exactAndExtendedFilesRemoved([]));
|
|
91
|
+
var labels;
|
|
92
|
+
if (!skipFetch) {
|
|
93
|
+
labels = await dispatch(fetchLabels({
|
|
94
|
+
abortSignal: signal
|
|
95
|
+
})).throwRejection();
|
|
96
|
+
}
|
|
97
|
+
var state = getState();
|
|
98
|
+
var foundLabel = labelUuidOrSidToActivate && (selectLabelByUuid(state, labelUuidOrSidToActivate) || ((_labels = labels) === null || _labels === void 0 ? void 0 : _labels.length) > 0 && labels.find(function () {
|
|
99
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
100
|
+
sid = _ref2.sid;
|
|
101
|
+
return sid === labelUuidOrSidToActivate;
|
|
102
|
+
}));
|
|
103
|
+
if (labelUuidOrSidToActivate && !foundLabel) {
|
|
104
|
+
info(i18n('labelsDefaultLabelError'), 'error', 3000);
|
|
105
|
+
dispatch(labelsStateUpdated({
|
|
106
|
+
error: {
|
|
107
|
+
message: i18n('labelsDefaultLabelError'),
|
|
108
|
+
details: i18n('labelsDefaultLabelErrorDescription')
|
|
109
|
+
}
|
|
110
|
+
}));
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
var labelUuid = (foundLabel === null || foundLabel === void 0 ? void 0 : foundLabel.uuid) || ((_selectSortedLabelsUu = selectSortedLabelsUuids(state)) === null || _selectSortedLabelsUu === void 0 ? void 0 : _selectSortedLabelsUu[0]);
|
|
114
|
+
return labelUuid ? dispatch(activateLabel({
|
|
115
|
+
uuid: labelUuid,
|
|
116
|
+
fromUrl: fromUrl
|
|
117
|
+
})) : null;
|
|
118
|
+
});
|
|
119
|
+
export var toggleLabelsTree = createThunk(function (showTree, thunkApi) {
|
|
120
|
+
var newValue = showTree !== null && showTree !== void 0 ? showTree : !selectIsLabelsTreeOpened(thunkApi.getState());
|
|
121
|
+
thunkApi.dispatch(labelsStateUpdated({
|
|
122
|
+
showTree: newValue
|
|
123
|
+
}));
|
|
124
|
+
thunkApi.extra.filerobot.emit('labels-tree-trigger', newValue);
|
|
125
|
+
return newValue;
|
|
126
|
+
});
|
|
127
|
+
export var fetchLabelFiles = createThunk(async function () {
|
|
128
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
129
|
+
labelSid = _ref3.labelSid,
|
|
130
|
+
offset = _ref3.offset,
|
|
131
|
+
_ref3$replaceOldFiles = _ref3.replaceOldFiles,
|
|
132
|
+
replaceOldFiles = _ref3$replaceOldFiles === void 0 ? false : _ref3$replaceOldFiles,
|
|
133
|
+
sortBy = _ref3.sortBy,
|
|
134
|
+
sortOrder = _ref3.sortOrder,
|
|
135
|
+
_ref3$skipPending = _ref3.skipPending,
|
|
136
|
+
skipPending = _ref3$skipPending === void 0 ? true : _ref3$skipPending,
|
|
137
|
+
_ref3$abortSignal = _ref3.abortSignal,
|
|
138
|
+
abortSignal = _ref3$abortSignal === void 0 ? null : _ref3$abortSignal;
|
|
139
|
+
var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
|
|
140
|
+
var state = thunkApi.getState();
|
|
141
|
+
var sid = labelSid || selectActiveLabelSid(state);
|
|
142
|
+
var result = await thunkApi.dispatch(searchOrListViewFiles({
|
|
143
|
+
cachedViewQueries: {
|
|
144
|
+
labels: sid.replace('#', ''),
|
|
145
|
+
recursive: true
|
|
146
|
+
},
|
|
147
|
+
offset: offset,
|
|
148
|
+
sorting: sortBy && sortOrder && [sortBy, sortOrder],
|
|
149
|
+
skipPendingDispatch: skipPending,
|
|
150
|
+
replaceOldFiles: replaceOldFiles,
|
|
151
|
+
abortSignal: abortSignal,
|
|
152
|
+
withStats: false
|
|
153
|
+
}));
|
|
154
|
+
return result;
|
|
155
|
+
}, {
|
|
156
|
+
actionType: "".concat(sliceName, "/fetchLabelFiles")
|
|
157
|
+
});
|
|
158
|
+
export var activateFirstLabel = createThunk(function (_, thunkApi) {
|
|
159
|
+
var _labels$;
|
|
160
|
+
var labels = selectLabelsArray(thunkApi.getState());
|
|
161
|
+
return thunkApi.dispatch(activateLabel({
|
|
162
|
+
uuid: (_labels$ = labels[0]) === null || _labels$ === void 0 ? void 0 : _labels$.uuid
|
|
163
|
+
}));
|
|
164
|
+
});
|
|
165
|
+
export var activateLabel = createThunk(function (_ref4, thunkApi) {
|
|
166
|
+
var labelUuid = _ref4.uuid,
|
|
167
|
+
labelSid = _ref4.sid,
|
|
168
|
+
_ref4$abortSignal = _ref4.abortSignal,
|
|
169
|
+
abortSignal = _ref4$abortSignal === void 0 ? null : _ref4$abortSignal,
|
|
170
|
+
fromUrl = _ref4.fromUrl;
|
|
171
|
+
var state = thunkApi.getState();
|
|
172
|
+
if (!labelUuid) {
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
if (!fromUrl) {
|
|
176
|
+
// Close file details panel when activate label, unless it's from url then don't close it as we might open file window from url in labels view
|
|
177
|
+
thunkApi.dispatch(fileWindowUpdated(null));
|
|
178
|
+
}
|
|
179
|
+
var isLabelsViewNotActivated = !selectIsLabelsView(state);
|
|
180
|
+
if (isLabelsViewNotActivated) {
|
|
181
|
+
thunkApi.dispatch(activateLabelsView({
|
|
182
|
+
itemToOpen: labelUuid
|
|
183
|
+
}));
|
|
184
|
+
} else {
|
|
185
|
+
var _thunkApi$extra$filer;
|
|
186
|
+
var _ref5 = labelSid ? {
|
|
187
|
+
sid: labelSid
|
|
188
|
+
} : selectLabelByUuid(state, labelUuid) || {},
|
|
189
|
+
_ref5$sid = _ref5.sid,
|
|
190
|
+
sid = _ref5$sid === void 0 ? '' : _ref5$sid;
|
|
191
|
+
if (!sid) {
|
|
192
|
+
return;
|
|
193
|
+
}
|
|
194
|
+
thunkApi.dispatch(labelActivated({
|
|
195
|
+
labelUuid: labelUuid,
|
|
196
|
+
selectedUuids: []
|
|
197
|
+
}));
|
|
198
|
+
// We are not awaiting for the request to finish, as we don't want to wait for it to finish to activate the label
|
|
199
|
+
(_thunkApi$extra$filer = thunkApi.extra.filerobot.getPlugin(PLUGINS_IDS.EXPLORER)) === null || _thunkApi$extra$filer === void 0 ? void 0 : _thunkApi$extra$filer.updateViewQueryInUrl({
|
|
200
|
+
viewItem: sid
|
|
201
|
+
});
|
|
202
|
+
return thunkApi.dispatch(fetchLabelFiles({
|
|
203
|
+
labelSid: sid,
|
|
204
|
+
offset: 0,
|
|
205
|
+
skipPending: false,
|
|
206
|
+
abortSignal: abortSignal
|
|
207
|
+
}));
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
export var downloadLabelAssets = createThunk(async function (labelUuid, thunkApi) {
|
|
211
|
+
var _selectLabelByUuid;
|
|
212
|
+
var labelSid = (_selectLabelByUuid = selectLabelByUuid(thunkApi.getState(), labelUuid)) === null || _selectLabelByUuid === void 0 ? void 0 : _selectLabelByUuid.sid;
|
|
213
|
+
var _await$searchFilesSer = await searchFilesService({
|
|
214
|
+
filters: {
|
|
215
|
+
labels: [labelSid]
|
|
216
|
+
},
|
|
217
|
+
recursive: true
|
|
218
|
+
}, thunkApi),
|
|
219
|
+
_await$searchFilesSer2 = _await$searchFilesSer.files,
|
|
220
|
+
files = _await$searchFilesSer2 === void 0 ? [] : _await$searchFilesSer2;
|
|
221
|
+
return thunkApi.dispatch(files.length === 1 ? downloadOneFile({
|
|
222
|
+
file: files[0]
|
|
223
|
+
}) : downloadItems({
|
|
224
|
+
items: files
|
|
225
|
+
}));
|
|
226
|
+
});
|
|
227
|
+
export var fetchLabels = createThunk(async function () {
|
|
228
|
+
var _ref6 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
229
|
+
avoidLabelsUpdate = _ref6.avoidLabelsUpdate;
|
|
230
|
+
var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
|
|
231
|
+
if (avoidLabelsUpdate) {
|
|
232
|
+
thunkApi.skipDispatch();
|
|
233
|
+
}
|
|
234
|
+
var _await$thunkApi$extra = await thunkApi.extra.apiClient.get('labels', {
|
|
235
|
+
id: 'listLabels',
|
|
236
|
+
abortSignal: thunkApi.signal
|
|
237
|
+
}),
|
|
238
|
+
labels = _await$thunkApi$extra.labels;
|
|
239
|
+
return labels || [];
|
|
240
|
+
}, {
|
|
241
|
+
actionType: "".concat(sliceName, "/fetchLabels")
|
|
242
|
+
});
|
|
243
|
+
export var createLabel = createThunk(async function (_ref7, thunkApi) {
|
|
244
|
+
var _ref7$label = _ref7.label,
|
|
245
|
+
label = _ref7$label === void 0 ? {} : _ref7$label,
|
|
246
|
+
_ref7$selectionUuids = _ref7.selectionUuids,
|
|
247
|
+
selectionUuids = _ref7$selectionUuids === void 0 ? [] : _ref7$selectionUuids;
|
|
248
|
+
/**
|
|
249
|
+
* !TODO: Once we have the whole new label object returned in the backend request's response, we should return the addedLabel const...
|
|
250
|
+
* then add a case for it in extraReducer to append that label to labels entities for enabling auto updating with no additional requests
|
|
251
|
+
* (FRA-2623)
|
|
252
|
+
*/
|
|
253
|
+
var _await$thunkApi$extra2 = await thunkApi.extra.apiClient.post('labels', {
|
|
254
|
+
data: {
|
|
255
|
+
label: label
|
|
256
|
+
},
|
|
257
|
+
abortSignal: thunkApi.signal
|
|
258
|
+
}),
|
|
259
|
+
_await$thunkApi$extra3 = _await$thunkApi$extra2.label,
|
|
260
|
+
addedLabel = _await$thunkApi$extra3 === void 0 ? {} : _await$thunkApi$extra3;
|
|
261
|
+
var updatedLabels = await thunkApi.dispatch(fetchLabels({
|
|
262
|
+
avoidLabelsUpdate: true
|
|
263
|
+
}));
|
|
264
|
+
var newLabelUuid = addedLabel.uuid;
|
|
265
|
+
var newActiveLabel = (updatedLabels || []).find(function (label) {
|
|
266
|
+
return label.uuid === newLabelUuid;
|
|
267
|
+
}) || addedLabel;
|
|
268
|
+
|
|
269
|
+
// If we have files selection we need to add new label to those files and redirect to active label view
|
|
270
|
+
if (selectionUuids.length > 0 && newActiveLabel) {
|
|
271
|
+
await thunkApi.dispatch(attachFilesLabels({
|
|
272
|
+
filesUuids: selectionUuids,
|
|
273
|
+
labelsSids: [newActiveLabel.sid]
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
276
|
+
return [newActiveLabel];
|
|
277
|
+
}, {
|
|
278
|
+
actionType: "".concat(sliceName, "/createLabel")
|
|
279
|
+
});
|
|
280
|
+
export var updateLabelByUuid = createThunk(async function () {
|
|
281
|
+
var label = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
282
|
+
var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
|
|
283
|
+
var labelUuid = label.uuid;
|
|
284
|
+
/**
|
|
285
|
+
* !TODO: Once we have the whole label object returned in the backend request's response,
|
|
286
|
+
* then we shold un-comment the updatedLabel const & remove dispatched fetchLabels
|
|
287
|
+
* (FRA-2623)
|
|
288
|
+
*/
|
|
289
|
+
// const { label: updatedLabel } = await thunkApi.extra.apiClient.put(
|
|
290
|
+
await thunkApi.extra.apiClient.put("labels/".concat(labelUuid), {
|
|
291
|
+
data: {
|
|
292
|
+
label: label
|
|
293
|
+
},
|
|
294
|
+
abortSignal: thunkApi.signal
|
|
295
|
+
});
|
|
296
|
+
var labels = await thunkApi.dispatch(fetchLabels({
|
|
297
|
+
avoidLabelsUpdate: true
|
|
298
|
+
}));
|
|
299
|
+
var updatedLabel = (labels || []).find(function (label) {
|
|
300
|
+
return label.uuid === labelUuid;
|
|
301
|
+
});
|
|
302
|
+
return updatedLabel;
|
|
303
|
+
}, {
|
|
304
|
+
actionType: "".concat(sliceName, "/updateLabelByUuid")
|
|
305
|
+
});
|
|
306
|
+
export var deleteLabels = createThunk(async function () {
|
|
307
|
+
var labelsUuids = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
308
|
+
var thunkApi = arguments.length > 1 ? arguments[1] : undefined;
|
|
309
|
+
var dispatch = thunkApi.dispatch,
|
|
310
|
+
extra = thunkApi.extra,
|
|
311
|
+
getState = thunkApi.getState;
|
|
312
|
+
var response = await thunkApi.extra.apiClient["delete"]('labels', {
|
|
313
|
+
data: {
|
|
314
|
+
labels: labelsUuids
|
|
315
|
+
},
|
|
316
|
+
abortSignal: thunkApi.signal
|
|
317
|
+
});
|
|
318
|
+
var _thunkApi$extra$filer2 = thunkApi.extra.filerobot.getPlugin(PLUGINS_IDS.EXPLORER),
|
|
319
|
+
deleteUrlQueryParams = _thunkApi$extra$filer2.deleteUrlQueryParams;
|
|
320
|
+
var state = getState();
|
|
321
|
+
var labelsSids = labelsUuids.map(function (labelUuid) {
|
|
322
|
+
var _selectLabelByUuid2;
|
|
323
|
+
return (_selectLabelByUuid2 = selectLabelByUuid(state, labelUuid)) === null || _selectLabelByUuid2 === void 0 ? void 0 : _selectLabelByUuid2.sid;
|
|
324
|
+
});
|
|
325
|
+
dispatch(labelsRemoved(labelsUuids));
|
|
326
|
+
|
|
327
|
+
// Deactivate label if it was deleted + remove all previously active label files + remove URL query param
|
|
328
|
+
var activeLabelUuid = selectActiveLabelUuid(getState());
|
|
329
|
+
if (activeLabelUuid && labelsUuids.includes(activeLabelUuid)) {
|
|
330
|
+
dispatch(filesRemoved());
|
|
331
|
+
dispatch(exactAndExtendedFilesRemoved([]));
|
|
332
|
+
dispatch(labelActivated({
|
|
333
|
+
labelUuid: null,
|
|
334
|
+
selectedUuids: []
|
|
335
|
+
}));
|
|
336
|
+
deleteUrlQueryParams([FMAW_URL_QUERY_PARAMS.VIEW_ITEM, FMAW_URL_QUERY_PARAMS.VIEW_SUB_ITEM]);
|
|
337
|
+
changeViewFetchFilesCachedQueries(null);
|
|
338
|
+
}
|
|
339
|
+
extra.filerobot.emit('objects-removed', labelsSids, 'labels');
|
|
340
|
+
return response;
|
|
341
|
+
});
|
|
342
|
+
export var applyBulkAttachedLabels = createThunk(async function (_ref8, thunkApi) {
|
|
343
|
+
var type = _ref8.type,
|
|
344
|
+
filesUuids = _ref8.filesUuids,
|
|
345
|
+
labelsSids = _ref8.labelsSids;
|
|
346
|
+
var dispatch = thunkApi.dispatch;
|
|
347
|
+
var changes = prepareBulkAttachedLabels(type, labelsSids);
|
|
348
|
+
var bulkEditPayload = {
|
|
349
|
+
filesUuids: filesUuids
|
|
350
|
+
};
|
|
351
|
+
if (type === BULK_EDIT_LABELS_TYPES.ADD) {
|
|
352
|
+
bulkEditPayload.addedLabels = labelsSids;
|
|
353
|
+
} else {
|
|
354
|
+
bulkEditPayload.removedLabels = labelsSids;
|
|
355
|
+
}
|
|
356
|
+
await dispatch(applyBulkFilesPropertiesChanges({
|
|
357
|
+
filesUuids: filesUuids,
|
|
358
|
+
changes: changes
|
|
359
|
+
}));
|
|
360
|
+
dispatch(updateBulkFilesLabels({
|
|
361
|
+
filesUuids: filesUuids,
|
|
362
|
+
addedLabels: labelsSids
|
|
363
|
+
}));
|
|
364
|
+
});
|
|
365
|
+
export var attachFilesLabels = createThunk(async function (_ref9, thunkApi) {
|
|
366
|
+
var _ref9$filesUuids = _ref9.filesUuids,
|
|
367
|
+
filesUuids = _ref9$filesUuids === void 0 ? [] : _ref9$filesUuids,
|
|
368
|
+
_ref9$labelsSids = _ref9.labelsSids,
|
|
369
|
+
labelsSids = _ref9$labelsSids === void 0 ? [] : _ref9$labelsSids;
|
|
370
|
+
if (checkIfReachedTheLimit(filesUuids)) {
|
|
371
|
+
thunkApi.dispatch(applyBulkAttachedLabels({
|
|
372
|
+
type: BULK_EDIT_LABELS_TYPES.ADD,
|
|
373
|
+
filesUuids: filesUuids,
|
|
374
|
+
labelsSids: labelsSids
|
|
375
|
+
}));
|
|
376
|
+
thunkApi.dispatch(selectionsCleared());
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
var isOneFileOnly = filesUuids.length === 1;
|
|
380
|
+
// attach labels in files request (first case for single file and second for multiple files)
|
|
381
|
+
var response = await thunkApi.extra.apiClient.post(isOneFileOnly ? "files/".concat(filesUuids[0], "/labels") : 'files/labels',
|
|
382
|
+
// else case => Attaching N labels to M files
|
|
383
|
+
{
|
|
384
|
+
data: _objectSpread({
|
|
385
|
+
labels: labelsSids
|
|
386
|
+
}, !isOneFileOnly && {
|
|
387
|
+
files_uuids: filesUuids
|
|
388
|
+
})
|
|
389
|
+
});
|
|
390
|
+
return response.files || [response.file];
|
|
391
|
+
}, {
|
|
392
|
+
actionType: "".concat(filesSliceName, "/updateFilesByAttachLabels")
|
|
393
|
+
});
|
|
394
|
+
export var detachFilesLabels = createThunk(async function (_ref10, thunkApi) {
|
|
395
|
+
var _ref10$filesUuids = _ref10.filesUuids,
|
|
396
|
+
filesUuids = _ref10$filesUuids === void 0 ? [] : _ref10$filesUuids,
|
|
397
|
+
_ref10$labelsSids = _ref10.labelsSids,
|
|
398
|
+
labelsSids = _ref10$labelsSids === void 0 ? [] : _ref10$labelsSids,
|
|
399
|
+
toggleContextMenu = _ref10.toggleContextMenu;
|
|
400
|
+
if (checkIfReachedTheLimit(filesUuids)) {
|
|
401
|
+
thunkApi.dispatch(applyBulkAttachedLabels({
|
|
402
|
+
type: BULK_EDIT_LABELS_TYPES.DELETE,
|
|
403
|
+
filesUuids: filesUuids,
|
|
404
|
+
labelsSids: labelsSids
|
|
405
|
+
}));
|
|
406
|
+
thunkApi.dispatch(selectionsCleared());
|
|
407
|
+
return;
|
|
408
|
+
}
|
|
409
|
+
var isOneFileOnly = filesUuids.length === 1;
|
|
410
|
+
var response = await thunkApi.extra.apiClient["delete"](isOneFileOnly ? "files/".concat(filesUuids[0], "/labels") : 'files/labels',
|
|
411
|
+
// else case => // Detaching N labels from M files
|
|
412
|
+
{
|
|
413
|
+
data: _objectSpread({
|
|
414
|
+
labels: labelsSids
|
|
415
|
+
}, !isOneFileOnly && {
|
|
416
|
+
files_uuids: filesUuids
|
|
417
|
+
})
|
|
418
|
+
});
|
|
419
|
+
if (typeof toggleContextMenu === 'function') {
|
|
420
|
+
toggleContextMenu();
|
|
421
|
+
}
|
|
422
|
+
thunkApi.dispatch(selectionsCleared());
|
|
423
|
+
return {
|
|
424
|
+
removeFiles: true,
|
|
425
|
+
filesUuids: response.files ? response.files.map(function (_ref11) {
|
|
426
|
+
var uuid = _ref11.uuid;
|
|
427
|
+
return uuid;
|
|
428
|
+
}) : [response.file.uuid]
|
|
429
|
+
};
|
|
430
|
+
}, {
|
|
431
|
+
actionType: "".concat(filesSliceName, "/updateFilesByDeAttachLabels")
|
|
432
|
+
});
|
|
433
|
+
var labelsSlice = createSlice({
|
|
434
|
+
name: sliceName,
|
|
435
|
+
initialState: initialState,
|
|
436
|
+
reducers: {
|
|
437
|
+
labelsAdded: function labelsAdded(state, action) {
|
|
438
|
+
var newLabels = _objectSpread({}, state.entities);
|
|
439
|
+
var newLabelsUuids = _toConsumableArray(state.uuids);
|
|
440
|
+
action.payload.forEach(function (label) {
|
|
441
|
+
newLabels[label.uuid] = label;
|
|
442
|
+
newLabelsUuids.push(label.uuid);
|
|
443
|
+
});
|
|
444
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
445
|
+
uuids: _toConsumableArray(new Set(newLabelsUuids)),
|
|
446
|
+
entities: newLabels,
|
|
447
|
+
loading: false,
|
|
448
|
+
error: null
|
|
449
|
+
});
|
|
450
|
+
},
|
|
451
|
+
labelUpdated: function labelUpdated(state, action) {
|
|
452
|
+
var newLabels = _objectSpread({}, state.entities);
|
|
453
|
+
newLabels[action.payload.uuid] = _objectSpread(_objectSpread({}, newLabels[action.payload.uuid]), action.payload);
|
|
454
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
455
|
+
entities: newLabels
|
|
456
|
+
});
|
|
457
|
+
},
|
|
458
|
+
labelsRemoved: function labelsRemoved(state, action) {
|
|
459
|
+
var labelsUuids = action.payload;
|
|
460
|
+
var newLabels = _objectSpread({}, state.entities);
|
|
461
|
+
var newLabelsUuids = _toConsumableArray(state.uuids);
|
|
462
|
+
labelsUuids.forEach(function (labelUuid) {
|
|
463
|
+
newLabelsUuids.splice(newLabelsUuids.indexOf(labelUuid), 1);
|
|
464
|
+
delete newLabels[labelUuid];
|
|
465
|
+
});
|
|
466
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
467
|
+
uuids: newLabelsUuids,
|
|
468
|
+
entities: newLabels
|
|
469
|
+
});
|
|
470
|
+
},
|
|
471
|
+
labelsSearchTermUpdated: function labelsSearchTermUpdated(state, action) {
|
|
472
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
473
|
+
searchTerm: action.payload
|
|
474
|
+
});
|
|
475
|
+
},
|
|
476
|
+
labelsSortingUpdated: function labelsSortingUpdated(state, action) {
|
|
477
|
+
var _action$payload = action.payload,
|
|
478
|
+
_action$payload$sortB = _action$payload.sortBy,
|
|
479
|
+
sortBy = _action$payload$sortB === void 0 ? state.sortedBy : _action$payload$sortB,
|
|
480
|
+
_action$payload$order = _action$payload.order,
|
|
481
|
+
order = _action$payload$order === void 0 ? state.sortOrder : _action$payload$order;
|
|
482
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
483
|
+
sortedBy: sortBy,
|
|
484
|
+
sortOrder: order
|
|
485
|
+
});
|
|
486
|
+
},
|
|
487
|
+
labelActivated: function labelActivated(state, action) {
|
|
488
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
489
|
+
activeLabelUuid: action.payload.labelUuid,
|
|
490
|
+
selectedUuids: action.payload.selectedUuids || []
|
|
491
|
+
});
|
|
492
|
+
},
|
|
493
|
+
labelsSelectionToggled: function labelsSelectionToggled(state, action) {
|
|
494
|
+
if (action.payload.uuids) {
|
|
495
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
496
|
+
selectedUuids: action.payload.uuids
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
var selectedLabels = _toConsumableArray(state.selectedUuids);
|
|
500
|
+
var selectedLabelUuid = action.payload.uuid;
|
|
501
|
+
var labelIndex = selectedLabels.indexOf(selectedLabelUuid);
|
|
502
|
+
var newSelections;
|
|
503
|
+
if (labelIndex > -1) {
|
|
504
|
+
selectedLabels.splice(labelIndex, 1);
|
|
505
|
+
newSelections = _toConsumableArray(selectedLabels);
|
|
506
|
+
} else {
|
|
507
|
+
newSelections = [].concat(_toConsumableArray(selectedLabels), [selectedLabelUuid]);
|
|
508
|
+
}
|
|
509
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
510
|
+
selectedUuids: newSelections
|
|
511
|
+
});
|
|
512
|
+
},
|
|
513
|
+
labelsStateUpdated: function labelsStateUpdated(state, action) {
|
|
514
|
+
return _objectSpread(_objectSpread({}, state), action.payload);
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
extraReducers: function extraReducers(builder) {
|
|
518
|
+
builder.addCase(updateLabelByUuid.fulfilled, function (state, action) {
|
|
519
|
+
return labelsSlice.caseReducers.labelUpdated(state, action);
|
|
520
|
+
}).addCase(createLabel.fulfilled, function (state, action) {
|
|
521
|
+
return labelsSlice.caseReducers.labelsAdded(state, action);
|
|
522
|
+
}).addCase(fetchLabels.pending, function (state) {
|
|
523
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
524
|
+
loading: true
|
|
525
|
+
});
|
|
526
|
+
}).addCase(fetchLabels.fulfilled, function (state, action) {
|
|
527
|
+
return labelsSlice.caseReducers.labelsAdded(state, action);
|
|
528
|
+
}).addCase(fetchLabels.rejected, function (state, action) {
|
|
529
|
+
return getActionErrorState(state, action);
|
|
530
|
+
}).addCase(fetchLabelFiles.pending, function (state, action) {
|
|
531
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
532
|
+
error: null
|
|
533
|
+
});
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
});
|
|
537
|
+
var _labelsSlice$actions = labelsSlice.actions,
|
|
538
|
+
labelsViewActivated = _labelsSlice$actions.labelsViewActivated,
|
|
539
|
+
labelsAdded = _labelsSlice$actions.labelsAdded,
|
|
540
|
+
labelUpdated = _labelsSlice$actions.labelUpdated,
|
|
541
|
+
labelsRemoved = _labelsSlice$actions.labelsRemoved,
|
|
542
|
+
labelsSearchTermUpdated = _labelsSlice$actions.labelsSearchTermUpdated,
|
|
543
|
+
labelsSortingUpdated = _labelsSlice$actions.labelsSortingUpdated,
|
|
544
|
+
labelActivated = _labelsSlice$actions.labelActivated,
|
|
545
|
+
labelsSelectionToggled = _labelsSlice$actions.labelsSelectionToggled,
|
|
546
|
+
labelsStateUpdated = _labelsSlice$actions.labelsStateUpdated;
|
|
547
|
+
export { labelsViewActivated, labelsAdded, labelUpdated, labelsRemoved, labelsSearchTermUpdated, labelsSortingUpdated, labelActivated, labelsSelectionToggled, labelsStateUpdated };
|
|
548
|
+
export var selectLabelsState = function selectLabelsState(state) {
|
|
549
|
+
var _state$PLUGINS_IDS$EX;
|
|
550
|
+
return ((_state$PLUGINS_IDS$EX = state[PLUGINS_IDS.EXPLORER]) === null || _state$PLUGINS_IDS$EX === void 0 ? void 0 : _state$PLUGINS_IDS$EX[slicePropName]) || initialState;
|
|
551
|
+
};
|
|
552
|
+
export var selectLabels = function selectLabels(state) {
|
|
553
|
+
return selectLabelsState(state).entities;
|
|
554
|
+
};
|
|
555
|
+
export var selectLabelsUuids = function selectLabelsUuids(state) {
|
|
556
|
+
return selectLabelsState(state).uuids;
|
|
557
|
+
};
|
|
558
|
+
export var selectLabelsArray = createSelector(selectLabels, function (labels) {
|
|
559
|
+
return Object.values(labels);
|
|
560
|
+
});
|
|
561
|
+
export var selectLabelByUuid = function selectLabelByUuid(state, uuid) {
|
|
562
|
+
return selectLabels(state)[uuid];
|
|
563
|
+
};
|
|
564
|
+
export var selectActiveLabelUuid = function selectActiveLabelUuid(state) {
|
|
565
|
+
return selectLabelsState(state).activeLabelUuid;
|
|
566
|
+
};
|
|
567
|
+
export var selectActiveLabel = function selectActiveLabel(state) {
|
|
568
|
+
return selectLabelByUuid(state, selectActiveLabelUuid(state));
|
|
569
|
+
};
|
|
570
|
+
export var selectActiveLabelSid = function selectActiveLabelSid(state) {
|
|
571
|
+
var _selectActiveLabel;
|
|
572
|
+
return (_selectActiveLabel = selectActiveLabel(state)) === null || _selectActiveLabel === void 0 ? void 0 : _selectActiveLabel.sid;
|
|
573
|
+
};
|
|
574
|
+
export var selectLabelsSearchTerm = function selectLabelsSearchTerm(state) {
|
|
575
|
+
return selectLabelsState(state).searchTerm;
|
|
576
|
+
};
|
|
577
|
+
export var selectIsLabelsLoading = function selectIsLabelsLoading(state) {
|
|
578
|
+
return selectIsLabelsView(state) && selectLabelsState(state).loading;
|
|
579
|
+
};
|
|
580
|
+
export var selectLabelsSorting = function selectLabelsSorting(state) {
|
|
581
|
+
return selectLabelsState(state).sorting;
|
|
582
|
+
};
|
|
583
|
+
export var selectLabelsSortBy = function selectLabelsSortBy(state) {
|
|
584
|
+
return selectLabelsState(state).sortedBy;
|
|
585
|
+
};
|
|
586
|
+
export var selectLabelsSortOrder = function selectLabelsSortOrder(state) {
|
|
587
|
+
return selectLabelsState(state).sortOrder;
|
|
588
|
+
};
|
|
589
|
+
export var selectLabelsSelectedUuids = function selectLabelsSelectedUuids(state) {
|
|
590
|
+
return selectLabelsState(state).selectedUuids;
|
|
591
|
+
};
|
|
592
|
+
export var selectIsLabelsTreeOpened = function selectIsLabelsTreeOpened(state) {
|
|
593
|
+
return selectLabelsState(state).showTree;
|
|
594
|
+
};
|
|
595
|
+
export var selectLabelsError = function selectLabelsError(state) {
|
|
596
|
+
return selectLabelsState(state).error;
|
|
597
|
+
};
|
|
598
|
+
export var selectLabelsSelected = createSelector([selectLabels, selectLabelsSelectedUuids], function (labels, selectedUuids) {
|
|
599
|
+
return selectedUuids.map(function (uuid) {
|
|
600
|
+
return labels[uuid];
|
|
601
|
+
});
|
|
602
|
+
});
|
|
603
|
+
export var selectIsLabelSelected = function selectIsLabelSelected(state, uuid) {
|
|
604
|
+
return selectLabelsSelectedUuids(state).includes(uuid);
|
|
605
|
+
};
|
|
606
|
+
export var selectFileLabels = createSelector([selectLabelsArray, function (_state, fileLabels) {
|
|
607
|
+
return Array.isArray(fileLabels) ? fileLabels : [];
|
|
608
|
+
}], function (labels, fileLabels) {
|
|
609
|
+
return fileLabels.map(function (fileLabel) {
|
|
610
|
+
return labels.find(function (label) {
|
|
611
|
+
return fileLabel === label.sid;
|
|
612
|
+
});
|
|
613
|
+
});
|
|
614
|
+
});
|
|
615
|
+
var sortLabels = function sortLabels() {
|
|
616
|
+
var labels = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
617
|
+
var currentLabelsUuids = arguments.length > 1 ? arguments[1] : undefined;
|
|
618
|
+
var sortBy = arguments.length > 2 ? arguments[2] : undefined;
|
|
619
|
+
var sortOrder = arguments.length > 3 ? arguments[3] : undefined;
|
|
620
|
+
if (sortBy) {
|
|
621
|
+
var isAscOrder = sortOrder === SORT_ORDER.ASC;
|
|
622
|
+
return _toConsumableArray(currentLabelsUuids).sort(function (aUuid, bUuid) {
|
|
623
|
+
var _x$sortBy, _y$sortBy;
|
|
624
|
+
var aLabel = labels[aUuid];
|
|
625
|
+
var bLabel = labels[bUuid];
|
|
626
|
+
var x = isAscOrder ? aLabel : bLabel;
|
|
627
|
+
var y = isAscOrder ? bLabel : aLabel;
|
|
628
|
+
var xValue = (_x$sortBy = x === null || x === void 0 ? void 0 : x[sortBy]) !== null && _x$sortBy !== void 0 ? _x$sortBy : '';
|
|
629
|
+
var yValue = (_y$sortBy = y === null || y === void 0 ? void 0 : y[sortBy]) !== null && _y$sortBy !== void 0 ? _y$sortBy : '';
|
|
630
|
+
if (!Number.isNaN(+xValue) && !Number.isNaN(+yValue)) return +xValue - +yValue;
|
|
631
|
+
if (!isNaN(new Date(xValue)) && !isNaN(new Date(yValue))) return yValue.toString().localeCompare(xValue);
|
|
632
|
+
return xValue.toString().localeCompare(yValue);
|
|
633
|
+
});
|
|
634
|
+
}
|
|
635
|
+
return currentLabelsUuids;
|
|
636
|
+
};
|
|
637
|
+
export var selectSortedLabelsUuids = createSelector([selectLabels, selectLabelsUuids, selectLabelsSortBy, selectLabelsSortOrder], sortLabels);
|
|
638
|
+
export var selectLabelsBySearchTerm = createSelector([selectLabelsArray, function (_state, labelsSearchTerm) {
|
|
639
|
+
return labelsSearchTerm;
|
|
640
|
+
}], function (labels, labelsSearchTerm) {
|
|
641
|
+
var filteredLabels = labelsSearchTerm ? labels.filter(function (label) {
|
|
642
|
+
return new RegExp(escapeRegExp(labelsSearchTerm), 'i').test(label.name);
|
|
643
|
+
}) : labels;
|
|
644
|
+
return filteredLabels;
|
|
645
|
+
});
|
|
646
|
+
export var selectSortedLabelsUuidsBySearchTerm = createSelector([selectLabelsBySearchTerm, selectLabels, selectLabelsSortBy, selectLabelsSortOrder], function (filteredLabels, labels, sortBy, sortOrder) {
|
|
647
|
+
return sortLabels(labels, filteredLabels.map(function (_ref12) {
|
|
648
|
+
var uuid = _ref12.uuid;
|
|
649
|
+
return uuid;
|
|
650
|
+
}), sortBy, sortOrder);
|
|
651
|
+
});
|
|
652
|
+
export default labelsSlice.reducer;
|