@webiny/app-admin 0.0.0-mt-3 → 0.0.0-unstable.1e66d121db
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/assets/icons/slack-logo.svg +1 -1
- package/base/Admin.d.ts +7 -0
- package/base/Admin.js +55 -0
- package/base/Admin.js.map +1 -0
- package/base/Base.d.ts +2 -0
- package/base/Base.js +110 -0
- package/base/Base.js.map +1 -0
- package/base/plugins/AddGraphQLQuerySelection.d.ts +9 -0
- package/base/plugins/AddGraphQLQuerySelection.js +31 -0
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -0
- package/base/providers/ApolloProvider.d.ts +10 -0
- package/base/providers/ApolloProvider.js +26 -0
- package/base/providers/ApolloProvider.js.map +1 -0
- package/base/providers/TelemetryProvider.d.ts +2 -0
- package/base/providers/TelemetryProvider.js +37 -0
- package/base/providers/TelemetryProvider.js.map +1 -0
- package/base/providers/UiStateProvider.d.ts +2 -0
- package/base/providers/UiStateProvider.js +23 -0
- package/base/providers/UiStateProvider.js.map +1 -0
- package/base/providers/ViewCompositionProvider.d.ts +17 -0
- package/base/providers/ViewCompositionProvider.js +70 -0
- package/base/providers/ViewCompositionProvider.js.map +1 -0
- package/base/ui/Brand.d.ts +2 -0
- package/base/ui/Brand.js +19 -0
- package/base/ui/Brand.js.map +1 -0
- package/base/ui/CenteredView.d.ts +4 -0
- package/base/ui/CenteredView.js +40 -0
- package/base/ui/CenteredView.js.map +1 -0
- package/base/ui/Dashboard.d.ts +2 -0
- package/base/ui/Dashboard.js +19 -0
- package/base/ui/Dashboard.js.map +1 -0
- package/base/ui/Layout.d.ts +7 -0
- package/base/ui/Layout.js +24 -0
- package/base/ui/Layout.js.map +1 -0
- package/base/ui/LocaleSelector.d.ts +2 -0
- package/base/ui/LocaleSelector.js +19 -0
- package/base/ui/LocaleSelector.js.map +1 -0
- package/base/ui/LoginScreen.d.ts +6 -0
- package/base/ui/LoginScreen.js +27 -0
- package/base/ui/LoginScreen.js.map +1 -0
- package/base/ui/Logo.d.ts +8 -0
- package/base/ui/Logo.js +36 -0
- package/base/ui/Logo.js.map +1 -0
- package/base/ui/Menu.d.ts +31 -0
- package/base/ui/Menu.js +166 -0
- package/base/ui/Menu.js.map +1 -0
- package/base/ui/Navigation.d.ts +24 -0
- package/base/ui/Navigation.js +184 -0
- package/base/ui/Navigation.js.map +1 -0
- package/base/ui/NotFound.d.ts +2 -0
- package/base/ui/NotFound.js +19 -0
- package/base/ui/NotFound.js.map +1 -0
- package/base/ui/Search.d.ts +19 -0
- package/base/ui/Search.js +81 -0
- package/base/ui/Search.js.map +1 -0
- package/base/ui/Tags.d.ts +10 -0
- package/base/ui/Tags.js +29 -0
- package/base/ui/Tags.js.map +1 -0
- package/base/ui/UserMenu.d.ts +30 -0
- package/base/ui/UserMenu.js +137 -0
- package/base/ui/UserMenu.js.map +1 -0
- package/components/AdminLayout.d.ts +1 -2
- package/components/AdminLayout.js +16 -29
- package/components/AdminLayout.js.map +1 -0
- package/components/AppInstaller/AppInstaller.d.ts +7 -0
- package/components/AppInstaller/AppInstaller.js +183 -0
- package/components/AppInstaller/AppInstaller.js.map +1 -0
- package/components/AppInstaller/Sidebar.d.ts +8 -6
- package/components/AppInstaller/Sidebar.js +66 -46
- package/components/AppInstaller/Sidebar.js.map +1 -0
- package/components/AppInstaller/index.d.ts +1 -4
- package/components/AppInstaller/index.js +20 -125
- package/components/AppInstaller/index.js.map +1 -0
- package/components/AppInstaller/styled.d.ts +6 -4
- package/components/AppInstaller/styled.js +31 -13
- package/components/AppInstaller/styled.js.map +1 -0
- package/components/AppInstaller/useInstaller.d.ts +29 -9
- package/components/AppInstaller/useInstaller.js +112 -70
- package/components/AppInstaller/useInstaller.js.map +1 -0
- package/components/EmptyView.d.ts +5 -5
- package/components/EmptyView.js +25 -11
- package/components/EmptyView.js.map +1 -0
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +5 -4
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +30 -10
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js.map +1 -0
- package/components/FileManager/BottomInfoBar/UploadStatus.d.ts +5 -4
- package/components/FileManager/BottomInfoBar/UploadStatus.js +21 -8
- package/components/FileManager/BottomInfoBar/UploadStatus.js.map +1 -0
- package/components/FileManager/BottomInfoBar.d.ts +4 -2
- package/components/FileManager/BottomInfoBar.js +29 -11
- package/components/FileManager/BottomInfoBar.js.map +1 -0
- package/components/FileManager/DropFilesHere.d.ts +5 -3
- package/components/FileManager/DropFilesHere.js +31 -13
- package/components/FileManager/DropFilesHere.js.map +1 -0
- package/components/FileManager/File.d.ts +8 -9
- package/components/FileManager/File.js +53 -27
- package/components/FileManager/File.js.map +1 -0
- package/components/FileManager/FileDetails/Name.d.ts +7 -5
- package/components/FileManager/FileDetails/Name.js +63 -38
- package/components/FileManager/FileDetails/Name.js.map +1 -0
- package/components/FileManager/FileDetails/Tags.d.ts +9 -5
- package/components/FileManager/FileDetails/Tags.js +183 -85
- package/components/FileManager/FileDetails/Tags.js.map +1 -0
- package/components/FileManager/FileDetails.d.ts +9 -8
- package/components/FileManager/FileDetails.js +226 -144
- package/components/FileManager/FileDetails.js.map +1 -0
- package/components/FileManager/FileManagerContext.d.ts +28 -9
- package/components/FileManager/FileManagerContext.js +76 -26
- package/components/FileManager/FileManagerContext.js.map +1 -0
- package/components/FileManager/FileManagerView.d.ts +12 -17
- package/components/FileManager/FileManagerView.js +291 -195
- package/components/FileManager/FileManagerView.js.map +1 -0
- package/components/FileManager/LeftSidebar.d.ts +7 -5
- package/components/FileManager/LeftSidebar.js +63 -31
- package/components/FileManager/LeftSidebar.js.map +1 -0
- package/components/FileManager/NoPermissionView.d.ts +2 -2
- package/components/FileManager/NoPermissionView.js +35 -18
- package/components/FileManager/NoPermissionView.js.map +1 -0
- package/components/FileManager/NoResults.d.ts +3 -2
- package/components/FileManager/NoResults.js +22 -7
- package/components/FileManager/NoResults.js.map +1 -0
- package/components/FileManager/getFileTypePlugin.d.ts +4 -1
- package/components/FileManager/getFileTypePlugin.js +48 -18
- package/components/FileManager/getFileTypePlugin.js.map +1 -0
- package/components/FileManager/getFileUploader.d.ts +2 -1
- package/components/FileManager/getFileUploader.js +14 -4
- package/components/FileManager/getFileUploader.js.map +1 -0
- package/components/FileManager/graphql.d.ts +90 -0
- package/components/FileManager/graphql.js +49 -8
- package/components/FileManager/graphql.js.map +1 -0
- package/components/FileManager/outputFileSelectionError.d.ts +7 -2
- package/components/FileManager/outputFileSelectionError.js +19 -4
- package/components/FileManager/outputFileSelectionError.js.map +1 -0
- package/components/FileManager/types.d.ts +21 -0
- package/components/FileManager/types.js +5 -0
- package/components/FileManager/types.js.map +1 -0
- package/components/FileManager.d.ts +63 -14
- package/components/FileManager.js +119 -108
- package/components/FileManager.js.map +1 -0
- package/components/FloatingActionButton.d.ts +2 -2
- package/components/FloatingActionButton.js +18 -6
- package/components/FloatingActionButton.js.map +1 -0
- package/components/MultiImageUpload.d.ts +13 -4
- package/components/MultiImageUpload.js +33 -10
- package/components/MultiImageUpload.js.map +1 -0
- package/components/OverlayLayout/OverlayLayout.d.ts +11 -13
- package/components/OverlayLayout/OverlayLayout.js +68 -43
- package/components/OverlayLayout/OverlayLayout.js.map +1 -0
- package/components/OverlayLayout/index.d.ts +1 -1
- package/components/OverlayLayout/index.js +18 -1
- package/components/OverlayLayout/index.js.map +1 -0
- package/components/Permissions/Permissions.d.ts +4 -4
- package/components/Permissions/Permissions.js +28 -11
- package/components/Permissions/Permissions.js.map +1 -0
- package/components/Permissions/StyledComponents.d.ts +6 -4
- package/components/Permissions/StyledComponents.js +26 -9
- package/components/Permissions/StyledComponents.js.map +1 -0
- package/components/Permissions/index.js +30 -2
- package/components/Permissions/index.js.map +1 -0
- package/components/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/components/RichTextEditor/RichTextEditor.js +24 -9
- package/components/RichTextEditor/RichTextEditor.js.map +1 -0
- package/components/RichTextEditor/index.js +21 -2
- package/components/RichTextEditor/index.js.map +1 -0
- package/components/RichTextEditor/styles.scss +39 -7
- package/components/RichTextEditor/tools/header/index.d.ts +35 -34
- package/components/RichTextEditor/tools/header/index.js +39 -39
- package/components/RichTextEditor/tools/header/index.js.map +1 -0
- package/components/RichTextEditor/tools/image/index.d.ts +40 -13
- package/components/RichTextEditor/tools/image/index.js +38 -30
- package/components/RichTextEditor/tools/image/index.js.map +1 -0
- package/components/RichTextEditor/tools/image/svgs.js +9 -2
- package/components/RichTextEditor/tools/image/svgs.js.map +1 -0
- package/components/RichTextEditor/tools/image/tunes.d.ts +14 -15
- package/components/RichTextEditor/tools/image/tunes.js +38 -26
- package/components/RichTextEditor/tools/image/tunes.js.map +1 -0
- package/components/RichTextEditor/tools/image/types.d.ts +29 -0
- package/components/RichTextEditor/tools/image/types.js +5 -0
- package/components/RichTextEditor/tools/image/types.js.map +1 -0
- package/components/RichTextEditor/tools/image/ui.d.ts +38 -27
- package/components/RichTextEditor/tools/image/ui.js +55 -35
- package/components/RichTextEditor/tools/image/ui.js.map +1 -0
- package/components/RichTextEditor/tools/paragraph/index.d.ts +34 -36
- package/components/RichTextEditor/tools/paragraph/index.js +57 -63
- package/components/RichTextEditor/tools/paragraph/index.js.map +1 -0
- package/components/RichTextEditor/tools/textColor/index.d.ts +33 -27
- package/components/RichTextEditor/tools/textColor/index.js +75 -36
- package/components/RichTextEditor/tools/textColor/index.js.map +1 -0
- package/components/RichTextEditor/tools/utils.js +14 -5
- package/components/RichTextEditor/tools/utils.js.map +1 -0
- package/components/Routes.d.ts +6 -0
- package/components/Routes.js +49 -0
- package/components/Routes.js.map +1 -0
- package/components/SearchUI.d.ts +4 -4
- package/components/SearchUI.js +23 -9
- package/components/SearchUI.js.map +1 -0
- package/components/SimpleForm/SimpleForm.d.ts +11 -11
- package/components/SimpleForm/SimpleForm.js +60 -29
- package/components/SimpleForm/SimpleForm.js.map +1 -0
- package/components/SimpleForm/index.js +31 -1
- package/components/SimpleForm/index.js.map +1 -0
- package/components/SimpleUI/InputField.d.ts +4 -3
- package/components/SimpleUI/InputField.js +56 -37
- package/components/SimpleUI/InputField.js.map +1 -0
- package/components/SingleImageUpload.d.ts +43 -13
- package/components/SingleImageUpload.js +88 -76
- package/components/SingleImageUpload.js.map +1 -0
- package/components/SplitView/SplitView.d.ts +6 -5
- package/components/SplitView/SplitView.js +45 -26
- package/components/SplitView/SplitView.js.map +1 -0
- package/components/SplitView/index.js +25 -1
- package/components/SplitView/index.js.map +1 -0
- package/components/index.js +13 -1
- package/components/index.js.map +1 -0
- package/hooks/useConfirmationDialog.d.ts +6 -5
- package/hooks/useConfirmationDialog.js +30 -18
- package/hooks/useConfirmationDialog.js.map +1 -0
- package/hooks/useDialog.d.ts +8 -3
- package/hooks/useDialog.js +16 -6
- package/hooks/useDialog.js.map +1 -0
- package/hooks/useSnackbar.d.ts +6 -3
- package/hooks/useSnackbar.js +20 -7
- package/hooks/useSnackbar.js.map +1 -0
- package/index.d.ts +35 -0
- package/index.js +373 -0
- package/index.js.map +1 -0
- package/package.json +48 -46
- package/plugins/FileManagerFileTypePlugin.d.ts +3 -3
- package/plugins/FileManagerFileTypePlugin.js +37 -20
- package/plugins/FileManagerFileTypePlugin.js.map +1 -0
- package/plugins/MenuPlugin.d.ts +22 -5
- package/plugins/MenuPlugin.js +37 -20
- package/plugins/MenuPlugin.js.map +1 -0
- package/plugins/PermissionRendererPlugin.d.ts +4 -4
- package/plugins/PermissionRendererPlugin.js +37 -20
- package/plugins/PermissionRendererPlugin.js.map +1 -0
- package/plugins/fileManager/fileDefault.d.ts +1 -2
- package/plugins/fileManager/fileDefault.js +22 -8
- package/plugins/fileManager/fileDefault.js.map +1 -0
- package/plugins/fileManager/fileImage/DeleteAction.d.ts +6 -2
- package/plugins/fileManager/fileImage/DeleteAction.js +45 -24
- package/plugins/fileManager/fileImage/DeleteAction.js.map +1 -0
- package/plugins/fileManager/fileImage/EditAction.d.ts +7 -6
- package/plugins/fileManager/fileImage/EditAction.js +73 -37
- package/plugins/fileManager/fileImage/EditAction.js.map +1 -0
- package/plugins/fileManager/fileImage/index.d.ts +1 -2
- package/plugins/fileManager/fileImage/index.js +27 -10
- package/plugins/fileManager/fileImage/index.js.map +1 -0
- package/plugins/fileManager/index.d.ts +2 -2
- package/plugins/fileManager/index.js +21 -3
- package/plugins/fileManager/index.js.map +1 -0
- package/plugins/globalSearch/SearchBar.d.ts +15 -3
- package/plugins/globalSearch/SearchBar.js +90 -58
- package/plugins/globalSearch/SearchBar.js.map +1 -0
- package/plugins/globalSearch/SearchBarDropdown.d.ts +19 -1
- package/plugins/globalSearch/SearchBarDropdown.js +46 -27
- package/plugins/globalSearch/SearchBarDropdown.js.map +1 -0
- package/plugins/globalSearch/index.d.ts +3 -4
- package/plugins/globalSearch/index.js +8 -22
- package/plugins/globalSearch/index.js.map +1 -0
- package/plugins/globalSearch/styled.d.ts +5 -3
- package/plugins/globalSearch/styled.js +33 -13
- package/plugins/globalSearch/styled.js.map +1 -0
- package/plugins/uiLayoutRenderer/index.d.ts +1 -2
- package/plugins/uiLayoutRenderer/index.js +25 -13
- package/plugins/uiLayoutRenderer/index.js.map +1 -0
- package/styles/material-theme-assignments.scss +79 -66
- package/styles/material.scss +2 -35
- package/types.d.ts +12 -19
- package/types.js +5 -1
- package/types.js.map +1 -0
- package/ui/UIElement.d.ts +1 -1
- package/ui/UIElement.js +19 -1
- package/ui/UIElement.js.map +1 -0
- package/ui/UILayout.js +19 -1
- package/ui/UILayout.js.map +1 -0
- package/ui/UIRenderer.js +13 -1
- package/ui/UIRenderer.js.map +1 -0
- package/ui/UIView.d.ts +1 -1
- package/ui/UIView.js +25 -1
- package/ui/UIView.js.map +1 -0
- package/ui/elements/AccordionElement.d.ts +5 -5
- package/ui/elements/AccordionElement.js +56 -32
- package/ui/elements/AccordionElement.js.map +1 -0
- package/ui/elements/ButtonElement.d.ts +3 -3
- package/ui/elements/ButtonElement.js +47 -20
- package/ui/elements/ButtonElement.js.map +1 -0
- package/ui/elements/ButtonGroupElement.d.ts +2 -2
- package/ui/elements/ButtonGroupElement.js +38 -19
- package/ui/elements/ButtonGroupElement.js.map +1 -0
- package/ui/elements/GenericElement.js +18 -1
- package/ui/elements/GenericElement.js.map +1 -0
- package/ui/elements/LabelElement.js +26 -13
- package/ui/elements/LabelElement.js.map +1 -0
- package/ui/elements/NavigationMenuElement.d.ts +2 -1
- package/ui/elements/NavigationMenuElement.js +51 -32
- package/ui/elements/NavigationMenuElement.js.map +1 -0
- package/ui/elements/PanelElement.js +27 -11
- package/ui/elements/PanelElement.js.map +1 -0
- package/ui/elements/PlaceholderElement.d.ts +2 -1
- package/ui/elements/PlaceholderElement.js +27 -13
- package/ui/elements/PlaceholderElement.js.map +1 -0
- package/ui/elements/SmallButtonElement.d.ts +1 -1
- package/ui/elements/SmallButtonElement.js +36 -19
- package/ui/elements/SmallButtonElement.js.map +1 -0
- package/ui/elements/TypographyElement.d.ts +1 -1
- package/ui/elements/TypographyElement.js +38 -20
- package/ui/elements/TypographyElement.js.map +1 -0
- package/ui/elements/ViewElement.js +18 -1
- package/ui/elements/ViewElement.js.map +1 -0
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.d.ts +2 -2
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +42 -26
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js.map +1 -0
- package/ui/elements/form/DynamicFieldsetElement.d.ts +19 -18
- package/ui/elements/form/DynamicFieldsetElement.js +54 -23
- package/ui/elements/form/DynamicFieldsetElement.js.map +1 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +30 -13
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +51 -28
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -0
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +53 -35
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -0
- package/ui/elements/form/FileManagerElement/styled.d.ts +19 -13
- package/ui/elements/form/FileManagerElement/styled.js +26 -12
- package/ui/elements/form/FileManagerElement/styled.js.map +1 -0
- package/ui/elements/form/FileManagerElement.d.ts +6 -6
- package/ui/elements/form/FileManagerElement.js +39 -22
- package/ui/elements/form/FileManagerElement.js.map +1 -0
- package/ui/elements/form/FormElement.d.ts +5 -5
- package/ui/elements/form/FormElement.js +42 -21
- package/ui/elements/form/FormElement.js.map +1 -0
- package/ui/elements/form/FormFieldElement.d.ts +9 -8
- package/ui/elements/form/FormFieldElement.js +53 -30
- package/ui/elements/form/FormFieldElement.js.map +1 -0
- package/ui/elements/form/HiddenElement.js +30 -15
- package/ui/elements/form/HiddenElement.js.map +1 -0
- package/ui/elements/form/InputElement.d.ts +1 -0
- package/ui/elements/form/InputElement.js +35 -18
- package/ui/elements/form/InputElement.js.map +1 -0
- package/ui/elements/form/PasswordElement.js +34 -18
- package/ui/elements/form/PasswordElement.js.map +1 -0
- package/ui/elements/form/SelectElement.d.ts +1 -1
- package/ui/elements/form/SelectElement.js +36 -20
- package/ui/elements/form/SelectElement.js.map +1 -0
- package/ui/elements/form/TextareaElement.js +34 -18
- package/ui/elements/form/TextareaElement.js.map +1 -0
- package/ui/views/AdminView/ContentElement.js +40 -24
- package/ui/views/AdminView/ContentElement.js.map +1 -0
- package/ui/views/AdminView/HeaderElement.js +72 -39
- package/ui/views/AdminView/HeaderElement.js.map +1 -0
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +2 -2
- package/ui/views/AdminView/HeaderSectionCenterElement.js +41 -21
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -0
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +2 -2
- package/ui/views/AdminView/HeaderSectionLeftElement.js +41 -21
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -0
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +2 -2
- package/ui/views/AdminView/HeaderSectionRightElement.js +41 -21
- package/ui/views/AdminView/HeaderSectionRightElement.js.map +1 -0
- package/ui/views/AdminView/components/Dialog.js +32 -15
- package/ui/views/AdminView/components/Dialog.js.map +1 -0
- package/ui/views/AdminView/components/Hamburger.d.ts +2 -2
- package/ui/views/AdminView/components/Hamburger.js +25 -11
- package/ui/views/AdminView/components/Hamburger.js.map +1 -0
- package/ui/views/AdminView/components/Snackbar.d.ts +2 -2
- package/ui/views/AdminView/components/Snackbar.js +26 -13
- package/ui/views/AdminView/components/Snackbar.js.map +1 -0
- package/ui/views/FormView/FormContainerElement.d.ts +2 -2
- package/ui/views/FormView/FormContainerElement.js +45 -25
- package/ui/views/FormView/FormContainerElement.js.map +1 -0
- package/ui/views/FormView/FormContentElement.js +27 -11
- package/ui/views/FormView/FormContentElement.js.map +1 -0
- package/ui/views/FormView/FormFooterElement.d.ts +3 -3
- package/ui/views/FormView/FormFooterElement.js +38 -19
- package/ui/views/FormView/FormFooterElement.js.map +1 -0
- package/ui/views/FormView/FormHeaderElement.d.ts +2 -2
- package/ui/views/FormView/FormHeaderElement.js +52 -30
- package/ui/views/FormView/FormHeaderElement.js.map +1 -0
- package/ui/views/FormView.d.ts +1 -1
- package/ui/views/FormView.js +85 -37
- package/ui/views/FormView.js.map +1 -0
- package/ui/views/OverlayView/ContentElement.d.ts +2 -2
- package/ui/views/OverlayView/ContentElement.js +38 -19
- package/ui/views/OverlayView/ContentElement.js.map +1 -0
- package/ui/views/OverlayView/HeaderElement.d.ts +5 -5
- package/ui/views/OverlayView/HeaderElement.js +56 -37
- package/ui/views/OverlayView/HeaderElement.js.map +1 -0
- package/ui/views/OverlayView/HeaderTitleElement.d.ts +1 -1
- package/ui/views/OverlayView/HeaderTitleElement.js +44 -25
- package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -0
- package/ui/views/OverlayView/useOverlayView.d.ts +4 -5
- package/ui/views/OverlayView/useOverlayView.js +32 -16
- package/ui/views/OverlayView/useOverlayView.js.map +1 -0
- package/ui/views/OverlayView.d.ts +4 -6
- package/ui/views/OverlayView.js +65 -42
- package/ui/views/OverlayView.js.map +1 -0
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +3 -3
- package/ui/views/SplitView/SplitViewPanelElement.js +47 -28
- package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -0
- package/ui/views/SplitView.d.ts +3 -3
- package/ui/views/SplitView.js +57 -37
- package/ui/views/SplitView.js.map +1 -0
- package/plugins/index.d.ts +0 -6
- package/plugins/index.js +0 -8
- package/plugins/logo/Logo.d.ts +0 -22
- package/plugins/logo/Logo.js +0 -108
- package/plugins/logo/index.d.ts +0 -5
- package/plugins/logo/index.js +0 -32
- package/plugins/menu/documentation.d.ts +0 -4
- package/plugins/menu/documentation.js +0 -16
- package/plugins/menu/fileManager.d.ts +0 -4
- package/plugins/menu/fileManager.js +0 -64
- package/plugins/menu/index.d.ts +0 -6
- package/plugins/menu/index.js +0 -24
- package/plugins/menu/renderers/MenuGroupRenderer.d.ts +0 -7
- package/plugins/menu/renderers/MenuGroupRenderer.js +0 -126
- package/plugins/menu/renderers/MenuLinkRenderer.d.ts +0 -7
- package/plugins/menu/renderers/MenuLinkRenderer.js +0 -52
- package/plugins/menu/renderers/MenuSectionItemRenderer.d.ts +0 -7
- package/plugins/menu/renderers/MenuSectionItemRenderer.js +0 -77
- package/plugins/menu/renderers/MenuSectionRenderer.d.ts +0 -7
- package/plugins/menu/renderers/MenuSectionRenderer.js +0 -51
- package/plugins/menu/slack.d.ts +0 -4
- package/plugins/menu/slack.js +0 -16
- package/plugins/menu/source.d.ts +0 -4
- package/plugins/menu/source.js +0 -16
- package/plugins/userMenu/UserMenuElement.d.ts +0 -7
- package/plugins/userMenu/UserMenuElement.js +0 -43
- package/plugins/userMenu/UserMenuRenderer.d.ts +0 -6
- package/plugins/userMenu/UserMenuRenderer.js +0 -47
- package/plugins/userMenu/index.d.ts +0 -4
- package/plugins/userMenu/index.js +0 -16
- package/ui/views/AdminView.d.ts +0 -12
- package/ui/views/AdminView.js +0 -90
- package/ui/views/NavigationView/ContentElement.d.ts +0 -10
- package/ui/views/NavigationView/ContentElement.js +0 -86
- package/ui/views/NavigationView/FooterElement.d.ts +0 -13
- package/ui/views/NavigationView/FooterElement.js +0 -57
- package/ui/views/NavigationView/HeaderElement.d.ts +0 -16
- package/ui/views/NavigationView/HeaderElement.js +0 -66
- package/ui/views/NavigationView/NavigationViewRenderer.d.ts +0 -6
- package/ui/views/NavigationView/NavigationViewRenderer.js +0 -38
- package/ui/views/NavigationView/Styled.d.ts +0 -7
- package/ui/views/NavigationView/Styled.js +0 -47
- package/ui/views/NavigationView/legacyMenu.d.ts +0 -22
- package/ui/views/NavigationView/legacyMenu.js +0 -1
- package/ui/views/NavigationView/useNavigation.d.ts +0 -6
- package/ui/views/NavigationView/useNavigation.js +0 -22
- package/ui/views/NavigationView.d.ts +0 -26
- package/ui/views/NavigationView.js +0 -204
|
@@ -1,6 +1,96 @@
|
|
|
1
|
+
import { FileItem } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* ##################
|
|
4
|
+
* List Files Query Response
|
|
5
|
+
*/
|
|
6
|
+
export interface ListFilesListFilesResponse {
|
|
7
|
+
data: FileItem[];
|
|
8
|
+
error?: Error | null;
|
|
9
|
+
meta: {
|
|
10
|
+
hasMoreItems: boolean;
|
|
11
|
+
totalItem: number;
|
|
12
|
+
cursor: string | null;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface ListFilesQueryResponse {
|
|
16
|
+
fileManager: {
|
|
17
|
+
listFiles: ListFilesListFilesResponse;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface ListFilesQueryVariables {
|
|
21
|
+
types?: string[];
|
|
22
|
+
tags?: string[];
|
|
23
|
+
limit?: number;
|
|
24
|
+
search?: string;
|
|
25
|
+
after?: string;
|
|
26
|
+
}
|
|
1
27
|
export declare const LIST_FILES: import("graphql").DocumentNode;
|
|
28
|
+
/**
|
|
29
|
+
* ##################
|
|
30
|
+
* List File Tags Query Response
|
|
31
|
+
*/
|
|
32
|
+
export interface ListFileTagsQueryResponse {
|
|
33
|
+
fileManager: {
|
|
34
|
+
listTags: string[];
|
|
35
|
+
error: Error | null;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
2
38
|
export declare const LIST_TAGS: import("graphql").DocumentNode;
|
|
39
|
+
/**
|
|
40
|
+
* ##################
|
|
41
|
+
* Create File Mutation Response
|
|
42
|
+
*/
|
|
43
|
+
export interface CreateFileMutationResponse {
|
|
44
|
+
fileManager: {
|
|
45
|
+
createFile: {
|
|
46
|
+
data: FileItem;
|
|
47
|
+
error?: Error | null;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface FileInput {
|
|
52
|
+
key: string;
|
|
53
|
+
name: string;
|
|
54
|
+
size: number;
|
|
55
|
+
type: string;
|
|
56
|
+
tags: string;
|
|
57
|
+
meta: Record<string, any>;
|
|
58
|
+
}
|
|
59
|
+
export interface CreateFileMutationVariables {
|
|
60
|
+
data: FileInput;
|
|
61
|
+
}
|
|
3
62
|
export declare const CREATE_FILE: import("graphql").DocumentNode;
|
|
63
|
+
/**
|
|
64
|
+
* ##################
|
|
65
|
+
* Update File Mutation Response
|
|
66
|
+
*/
|
|
67
|
+
export interface UpdateFileMutationResponse {
|
|
68
|
+
fileManager: {
|
|
69
|
+
updateFile: {
|
|
70
|
+
data: FileItem;
|
|
71
|
+
error?: Error | null;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export interface UpdateFileMutationVariables {
|
|
76
|
+
id: string;
|
|
77
|
+
data: Partial<FileInput>;
|
|
78
|
+
}
|
|
4
79
|
export declare const UPDATE_FILE: import("graphql").DocumentNode;
|
|
80
|
+
/**
|
|
81
|
+
* ##################
|
|
82
|
+
* Delete File Mutation Response
|
|
83
|
+
*/
|
|
84
|
+
export interface DeleteFileMutationResponse {
|
|
85
|
+
fileManager: {
|
|
86
|
+
updateFile: {
|
|
87
|
+
data: boolean;
|
|
88
|
+
error?: Error | null;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
export interface DeleteFileMutationVariables {
|
|
93
|
+
id: string;
|
|
94
|
+
}
|
|
5
95
|
export declare const DELETE_FILE: import("graphql").DocumentNode;
|
|
6
96
|
export declare const GET_FILE_SETTINGS: import("graphql").DocumentNode;
|
|
@@ -1,17 +1,58 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.UPDATE_FILE = exports.LIST_TAGS = exports.LIST_FILES = exports.GET_FILE_SETTINGS = exports.DELETE_FILE = exports.CREATE_FILE = void 0;
|
|
9
|
+
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
|
|
2
13
|
|
|
3
14
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
4
15
|
|
|
5
|
-
import gql from "graphql-tag";
|
|
6
16
|
var FILE_FIELDS =
|
|
7
17
|
/* GraphQL */
|
|
8
18
|
"\n {\n __typename\n id\n name\n key\n src\n size\n type\n tags\n createdOn\n createdBy {\n id\n }\n }\n";
|
|
9
19
|
var ERROR_FIELDS =
|
|
10
20
|
/* GraphQL */
|
|
11
21
|
"\n {\n code\n message\n data\n }\n";
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
22
|
+
/**
|
|
23
|
+
* ##################
|
|
24
|
+
* List Files Query Response
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
var LIST_FILES = (0, _graphqlTag.default)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n query ListFiles(\n $types: [String],\n $tags: [String],\n $limit: Int,\n $search: String,\n $after: String,\n $where: FileWhereInput\n ) {\n fileManager {\n listFiles(\n types: $types,\n limit: $limit,\n search: $search,\n tags: $tags,\n after: $after,\n where: $where\n ) {\n data ", "\n meta {\n cursor\n totalCount\n }\n }\n }\n }\n"])), FILE_FIELDS);
|
|
28
|
+
/**
|
|
29
|
+
* ##################
|
|
30
|
+
* List File Tags Query Response
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
exports.LIST_FILES = LIST_FILES;
|
|
34
|
+
var LIST_TAGS = (0, _graphqlTag.default)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n query ListTags($where: TagWhereInput) {\n fileManager {\n listTags(where: $where)\n }\n }\n"])));
|
|
35
|
+
/**
|
|
36
|
+
* ##################
|
|
37
|
+
* Create File Mutation Response
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
exports.LIST_TAGS = LIST_TAGS;
|
|
41
|
+
var CREATE_FILE = (0, _graphqlTag.default)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n mutation CreateFile($data: FileInput!) {\n fileManager {\n createFile(data: $data) {\n error ", "\n data ", "\n }\n }\n }\n"])), ERROR_FIELDS, FILE_FIELDS);
|
|
42
|
+
/**
|
|
43
|
+
* ##################
|
|
44
|
+
* Update File Mutation Response
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
exports.CREATE_FILE = CREATE_FILE;
|
|
48
|
+
var UPDATE_FILE = (0, _graphqlTag.default)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n mutation UpdateFile($id: ID!, $data: FileInput!) {\n fileManager {\n updateFile(id: $id, data: $data) {\n data {\n id\n src\n name\n tags\n }\n error ", "\n }\n }\n }\n"])), ERROR_FIELDS);
|
|
49
|
+
/**
|
|
50
|
+
* ##################
|
|
51
|
+
* Delete File Mutation Response
|
|
52
|
+
*/
|
|
53
|
+
|
|
54
|
+
exports.UPDATE_FILE = UPDATE_FILE;
|
|
55
|
+
var DELETE_FILE = (0, _graphqlTag.default)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n mutation deleteFile($id: ID!) {\n fileManager {\n deleteFile(id: $id) {\n data\n error ", "\n }\n }\n }\n"])), ERROR_FIELDS);
|
|
56
|
+
exports.DELETE_FILE = DELETE_FILE;
|
|
57
|
+
var GET_FILE_SETTINGS = (0, _graphqlTag.default)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n query getSettings {\n fileManager {\n getSettings {\n data {\n uploadMinFileSize\n uploadMaxFileSize\n }\n error ", "\n }\n }\n }\n"])), ERROR_FIELDS);
|
|
58
|
+
exports.GET_FILE_SETTINGS = GET_FILE_SETTINGS;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FILE_FIELDS","ERROR_FIELDS","LIST_FILES","gql","LIST_TAGS","CREATE_FILE","UPDATE_FILE","DELETE_FILE","GET_FILE_SETTINGS"],"sources":["graphql.ts"],"sourcesContent":["import gql from \"graphql-tag\";\nimport { FileItem } from \"~/components/FileManager/types\";\n\nconst FILE_FIELDS = /* GraphQL */ `\n {\n __typename\n id\n name\n key\n src\n size\n type\n tags\n createdOn\n createdBy {\n id\n }\n }\n`;\n\nconst ERROR_FIELDS = /* GraphQL */ `\n {\n code\n message\n data\n }\n`;\n\n/**\n * ##################\n * List Files Query Response\n */\nexport interface ListFilesListFilesResponse {\n data: FileItem[];\n error?: Error | null;\n meta: {\n hasMoreItems: boolean;\n totalItem: number;\n cursor: string | null;\n };\n}\nexport interface ListFilesQueryResponse {\n fileManager: {\n listFiles: ListFilesListFilesResponse;\n };\n}\nexport interface ListFilesQueryVariables {\n types?: string[];\n tags?: string[];\n limit?: number;\n search?: string;\n after?: string;\n}\nexport const LIST_FILES = gql`\n query ListFiles(\n $types: [String],\n $tags: [String],\n $limit: Int,\n $search: String,\n $after: String,\n $where: FileWhereInput\n ) {\n fileManager {\n listFiles(\n types: $types,\n limit: $limit,\n search: $search,\n tags: $tags,\n after: $after,\n where: $where\n ) {\n data ${FILE_FIELDS}\n meta {\n cursor\n totalCount\n }\n }\n }\n }\n`;\n/**\n * ##################\n * List File Tags Query Response\n */\nexport interface ListFileTagsQueryResponse {\n fileManager: {\n listTags: string[];\n error: Error | null;\n };\n}\nexport const LIST_TAGS = gql`\n query ListTags($where: TagWhereInput) {\n fileManager {\n listTags(where: $where)\n }\n }\n`;\n/**\n * ##################\n * Create File Mutation Response\n */\nexport interface CreateFileMutationResponse {\n fileManager: {\n createFile: {\n data: FileItem;\n error?: Error | null;\n };\n };\n}\nexport interface FileInput {\n key: string;\n name: string;\n size: number;\n type: string;\n tags: string;\n meta: Record<string, any>;\n}\nexport interface CreateFileMutationVariables {\n data: FileInput;\n}\nexport const CREATE_FILE = gql`\n mutation CreateFile($data: FileInput!) {\n fileManager {\n createFile(data: $data) {\n error ${ERROR_FIELDS}\n data ${FILE_FIELDS}\n }\n }\n }\n`;\n/**\n * ##################\n * Update File Mutation Response\n */\nexport interface UpdateFileMutationResponse {\n fileManager: {\n updateFile: {\n data: FileItem;\n error?: Error | null;\n };\n };\n}\nexport interface UpdateFileMutationVariables {\n id: string;\n data: Partial<FileInput>;\n}\nexport const UPDATE_FILE = gql`\n mutation UpdateFile($id: ID!, $data: FileInput!) {\n fileManager {\n updateFile(id: $id, data: $data) {\n data {\n id\n src\n name\n tags\n }\n error ${ERROR_FIELDS}\n }\n }\n }\n`;\n\n/**\n * ##################\n * Delete File Mutation Response\n */\nexport interface DeleteFileMutationResponse {\n fileManager: {\n updateFile: {\n data: boolean;\n error?: Error | null;\n };\n };\n}\nexport interface DeleteFileMutationVariables {\n id: string;\n}\nexport const DELETE_FILE = gql`\n mutation deleteFile($id: ID!) {\n fileManager {\n deleteFile(id: $id) {\n data\n error ${ERROR_FIELDS}\n }\n }\n }\n`;\n\nexport const GET_FILE_SETTINGS = gql`\n query getSettings {\n fileManager {\n getSettings {\n data {\n uploadMinFileSize\n uploadMaxFileSize\n }\n error ${ERROR_FIELDS}\n }\n }\n }\n`;\n"],"mappings":";;;;;;;;;;;AAAA;;;;AAGA,IAAMA,WAAW;AAAG;AAAH,uMAAjB;AAiBA,IAAMC,YAAY;AAAG;AAAH,+DAAlB;AAQA;AACA;AACA;AACA;;AAsBO,IAAMC,UAAU,OAAGC,mBAAH,srBAkBAH,WAlBA,CAAhB;AA2BP;AACA;AACA;AACA;;;AAOO,IAAMI,SAAS,OAAGD,mBAAH,mNAAf;AAOP;AACA;AACA;AACA;;;AAoBO,IAAME,WAAW,OAAGF,mBAAH,6RAIAF,YAJA,EAKDD,WALC,CAAjB;AAUP;AACA;AACA;AACA;;;AAaO,IAAMM,WAAW,OAAGH,mBAAH,qaAUAF,YAVA,CAAjB;AAgBP;AACA;AACA;AACA;;;AAYO,IAAMM,WAAW,OAAGJ,mBAAH,2QAKAF,YALA,CAAjB;;AAWA,IAAMO,iBAAiB,OAAGL,mBAAH,0VAQNF,YARM,CAAvB"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { FileError as BaseFileError } from "react-butterfiles";
|
|
2
|
+
interface FileError extends BaseFileError {
|
|
3
|
+
multipleMaxCount: number;
|
|
4
|
+
multipleMaxSize: number;
|
|
5
|
+
}
|
|
6
|
+
export declare const outputFileSelectionError: (errors: FileError[]) => string | null;
|
|
7
|
+
export {};
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.outputFileSelectionError = void 0;
|
|
9
|
+
|
|
10
|
+
var _bytes = _interopRequireDefault(require("bytes"));
|
|
11
|
+
|
|
12
|
+
var outputFileSelectionError = function outputFileSelectionError(errors) {
|
|
3
13
|
if (errors.length > 1) {
|
|
4
14
|
var error = errors.find(function (error) {
|
|
5
15
|
return error.type === "multipleMaxCountExceeded";
|
|
@@ -14,7 +24,7 @@ export default (function (errors) {
|
|
|
14
24
|
});
|
|
15
25
|
|
|
16
26
|
if (error) {
|
|
17
|
-
return "Cannot upload more than ".concat(
|
|
27
|
+
return "Cannot upload more than ".concat(_bytes.default.format(error.multipleMaxSize), " at once.");
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
return "Multiple invalid files selected.";
|
|
@@ -35,5 +45,10 @@ export default (function (errors) {
|
|
|
35
45
|
|
|
36
46
|
case "multipleNotAllowed":
|
|
37
47
|
return "Only one file allowed.";
|
|
48
|
+
|
|
49
|
+
default:
|
|
50
|
+
return null;
|
|
38
51
|
}
|
|
39
|
-
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.outputFileSelectionError = outputFileSelectionError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["outputFileSelectionError","errors","length","error","find","type","multipleMaxCount","bytes","format","multipleMaxSize"],"sources":["outputFileSelectionError.ts"],"sourcesContent":["import bytes from \"bytes\";\nimport { FileError as BaseFileError } from \"react-butterfiles\";\n\ninterface FileError extends BaseFileError {\n multipleMaxCount: number;\n multipleMaxSize: number;\n}\n\nexport const outputFileSelectionError = (errors: FileError[]): string | null => {\n if (errors.length > 1) {\n let error = errors.find(error => error.type === \"multipleMaxCountExceeded\");\n if (error) {\n return `Cannot upload more than ${error.multipleMaxCount} files at once.`;\n }\n\n error = errors.find(error => error.type === \"multipleMaxSizeExceeded\");\n if (error) {\n return `Cannot upload more than ${bytes.format(error.multipleMaxSize)} at once.`;\n }\n\n return \"Multiple invalid files selected.\";\n }\n\n switch (errors[0].type) {\n case \"unsupportedFileType\":\n return \"Unsupported file type.\";\n case \"maxSizeExceeded\":\n return \"Max size exceeded.\";\n case \"multipleMaxCountExceeded\":\n return \"Multiple max files exceeded.\";\n case \"multipleMaxSizeExceeded\":\n return \"Multiple max size exceeded.\";\n case \"multipleNotAllowed\":\n return \"Only one file allowed.\";\n default:\n return null;\n }\n};\n"],"mappings":";;;;;;;;;AAAA;;AAQO,IAAMA,wBAAwB,GAAG,SAA3BA,wBAA2B,CAACC,MAAD,EAAwC;EAC5E,IAAIA,MAAM,CAACC,MAAP,GAAgB,CAApB,EAAuB;IACnB,IAAIC,KAAK,GAAGF,MAAM,CAACG,IAAP,CAAY,UAAAD,KAAK;MAAA,OAAIA,KAAK,CAACE,IAAN,KAAe,0BAAnB;IAAA,CAAjB,CAAZ;;IACA,IAAIF,KAAJ,EAAW;MACP,yCAAkCA,KAAK,CAACG,gBAAxC;IACH;;IAEDH,KAAK,GAAGF,MAAM,CAACG,IAAP,CAAY,UAAAD,KAAK;MAAA,OAAIA,KAAK,CAACE,IAAN,KAAe,yBAAnB;IAAA,CAAjB,CAAR;;IACA,IAAIF,KAAJ,EAAW;MACP,yCAAkCI,cAAA,CAAMC,MAAN,CAAaL,KAAK,CAACM,eAAnB,CAAlC;IACH;;IAED,OAAO,kCAAP;EACH;;EAED,QAAQR,MAAM,CAAC,CAAD,CAAN,CAAUI,IAAlB;IACI,KAAK,qBAAL;MACI,OAAO,wBAAP;;IACJ,KAAK,iBAAL;MACI,OAAO,oBAAP;;IACJ,KAAK,0BAAL;MACI,OAAO,8BAAP;;IACJ,KAAK,yBAAL;MACI,OAAO,6BAAP;;IACJ,KAAK,oBAAL;MACI,OAAO,wBAAP;;IACJ;MACI,OAAO,IAAP;EAZR;AAcH,CA7BM"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SecurityPermission } from "@webiny/app-security/types";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a file as we receive from the GraphQL API.
|
|
4
|
+
*/
|
|
5
|
+
export interface FileItem {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
key: string;
|
|
9
|
+
src: string;
|
|
10
|
+
size: number;
|
|
11
|
+
type: string;
|
|
12
|
+
tags: string[];
|
|
13
|
+
createdOn: string;
|
|
14
|
+
createdBy: {
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface FileManagerSecurityPermission extends SecurityPermission {
|
|
19
|
+
rwd?: string;
|
|
20
|
+
own?: boolean;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import { SecurityPermission } from \"@webiny/app-security/types\";\n\n/**\n * Represents a file as we receive from the GraphQL API.\n */\nexport interface FileItem {\n id: string;\n name: string;\n key: string;\n src: string;\n size: number;\n type: string;\n tags: string[];\n createdOn: string;\n createdBy: {\n id: string;\n };\n}\n\nexport interface FileManagerSecurityPermission extends SecurityPermission {\n rwd?: string;\n own?: boolean;\n}\n"],"mappings":""}
|
|
@@ -1,18 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface OnChange<T> {
|
|
3
|
+
(value: T): void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Represents a file object managed by the File Manager.
|
|
7
|
+
*/
|
|
8
|
+
export interface FileManagerFileItem {
|
|
9
|
+
id: string;
|
|
10
|
+
src: string;
|
|
11
|
+
meta?: Array<FileManagerFileItemMetaItem>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* With this we allow developers to add any value to file's meta via component composition, thus the `value: any`.
|
|
15
|
+
*/
|
|
16
|
+
export interface FileManagerFileItemMetaItem {
|
|
17
|
+
key: string;
|
|
18
|
+
value: any;
|
|
19
|
+
}
|
|
20
|
+
export declare type DeprecatedFileManagerRenderPropParams = {
|
|
21
|
+
showFileManager: (onChange?: OnChange<FileManagerFileItem | FileManagerFileItem[]>) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare type FileManagerRenderPropParams<TValue> = {
|
|
24
|
+
showFileManager: (onChange?: OnChange<TValue>) => void;
|
|
25
|
+
};
|
|
26
|
+
interface SingleFileRenderProp {
|
|
27
|
+
(params: FileManagerRenderPropParams<FileManagerFileItem>): React.ReactNode;
|
|
28
|
+
}
|
|
29
|
+
interface MultiFileRenderProp {
|
|
30
|
+
(params: FileManagerRenderPropParams<FileManagerFileItem[]>): React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare type MultipleProps = {
|
|
33
|
+
multiple?: never;
|
|
34
|
+
multipleMaxCount?: never;
|
|
35
|
+
multipleMaxSize?: never;
|
|
36
|
+
onChange?: OnChange<FileManagerFileItem>;
|
|
37
|
+
render?: SingleFileRenderProp;
|
|
38
|
+
} | {
|
|
39
|
+
multiple: true;
|
|
12
40
|
multipleMaxCount?: number;
|
|
13
41
|
multipleMaxSize?: number | string;
|
|
14
|
-
|
|
15
|
-
|
|
42
|
+
onChange?: OnChange<FileManagerFileItem[]>;
|
|
43
|
+
render?: MultiFileRenderProp;
|
|
16
44
|
};
|
|
17
|
-
export declare
|
|
45
|
+
export declare type FileManagerProps = {
|
|
46
|
+
accept?: Array<string>;
|
|
47
|
+
images?: boolean;
|
|
48
|
+
maxSize?: number | string;
|
|
49
|
+
/**
|
|
50
|
+
* @deprecated This prop is no longer used. The file structure was reduced to a bare minimum so picking is no longer necessary.
|
|
51
|
+
*/
|
|
52
|
+
onChangePick?: string[];
|
|
53
|
+
onClose?: Function;
|
|
54
|
+
onUploadCompletion?: (files: FileManagerFileItem[]) => void;
|
|
55
|
+
own?: boolean;
|
|
56
|
+
scope?: string;
|
|
57
|
+
tags?: Array<string>;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated This prop is no longer used. Use the `render` prop to get better TS autocomplete.
|
|
60
|
+
*/
|
|
61
|
+
children?: (params: DeprecatedFileManagerRenderPropParams) => React.ReactNode;
|
|
62
|
+
} & MultipleProps;
|
|
63
|
+
declare type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;
|
|
64
|
+
export declare type FileManagerRendererProps = DistributiveOmit<FileManagerProps, "render" | "children">;
|
|
65
|
+
export declare const FileManagerRenderer: import("@webiny/react-composition").ComposableFC<FileManagerRendererProps>;
|
|
66
|
+
export declare const FileManager: React.FC<FileManagerProps>;
|
|
18
67
|
export {};
|
|
@@ -1,133 +1,144 @@
|
|
|
1
|
-
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
|
-
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
9
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
var _excluded = ["children"];
|
|
11
|
-
import * as React from "react";
|
|
12
|
-
import ReactDOM from "react-dom";
|
|
13
|
-
import FileManagerView from "./FileManager/FileManagerView";
|
|
14
|
-
import pick from "lodash/pick";
|
|
15
|
-
import { FileManagerProvider } from "./FileManager/FileManagerContext";
|
|
16
|
-
var useState = React.useState,
|
|
17
|
-
useRef = React.useRef,
|
|
18
|
-
useCallback = React.useCallback,
|
|
19
|
-
useEffect = React.useEffect;
|
|
20
|
-
|
|
21
|
-
var FileManagerPortal = /*#__PURE__*/function (_React$Component) {
|
|
22
|
-
_inherits(FileManagerPortal, _React$Component);
|
|
23
|
-
|
|
24
|
-
var _super = _createSuper(FileManagerPortal);
|
|
25
|
-
|
|
26
|
-
function FileManagerPortal(props) {
|
|
27
|
-
var _this;
|
|
28
|
-
|
|
29
|
-
_classCallCheck(this, FileManagerPortal);
|
|
30
|
-
|
|
31
|
-
_this = _super.call(this, props);
|
|
32
|
-
|
|
33
|
-
_defineProperty(_assertThisInitialized(_this), "container", void 0);
|
|
34
|
-
|
|
35
|
-
if (!window) {
|
|
36
|
-
return _possibleConstructorReturn(_this);
|
|
37
|
-
}
|
|
1
|
+
"use strict";
|
|
38
2
|
|
|
39
|
-
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
40
4
|
|
|
41
|
-
|
|
42
|
-
_this.container = document.createElement("div");
|
|
5
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
43
6
|
|
|
44
|
-
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports.FileManagerRenderer = exports.FileManager = void 0;
|
|
45
11
|
|
|
46
|
-
|
|
47
|
-
document.body && document.body.appendChild(container);
|
|
48
|
-
}
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
49
13
|
|
|
50
|
-
|
|
51
|
-
}
|
|
14
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
52
15
|
|
|
53
|
-
|
|
54
|
-
key: "render",
|
|
55
|
-
value: function render() {
|
|
56
|
-
var _this$props = this.props,
|
|
57
|
-
onChange = _this$props.onChange,
|
|
58
|
-
onClose = _this$props.onClose,
|
|
59
|
-
accept = _this$props.accept,
|
|
60
|
-
onChangePick = _this$props.onChangePick,
|
|
61
|
-
multiple = _this$props.multiple,
|
|
62
|
-
images = _this$props.images,
|
|
63
|
-
maxSize = _this$props.maxSize,
|
|
64
|
-
multipleMaxCount = _this$props.multipleMaxCount,
|
|
65
|
-
multipleMaxSize = _this$props.multipleMaxSize,
|
|
66
|
-
onUploadCompletion = _this$props.onUploadCompletion;
|
|
67
|
-
var container = this.container;
|
|
68
|
-
|
|
69
|
-
var handleFileOnChange = function handleFileOnChange(files) {
|
|
70
|
-
var fields = Array.isArray(onChangePick) ? onChangePick : ["id", "name", "key", "src", "size", "type"];
|
|
71
|
-
|
|
72
|
-
if (Array.isArray(files)) {
|
|
73
|
-
onChange(files.map(function (file) {
|
|
74
|
-
return pick(file, fields);
|
|
75
|
-
}));
|
|
76
|
-
} else {
|
|
77
|
-
onChange(pick(files, fields));
|
|
78
|
-
}
|
|
79
|
-
};
|
|
16
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
80
17
|
|
|
81
|
-
|
|
82
|
-
onChange: typeof onChange === "function" ? handleFileOnChange : undefined,
|
|
83
|
-
onClose: onClose,
|
|
84
|
-
accept: accept,
|
|
85
|
-
multiple: multiple,
|
|
86
|
-
maxSize: maxSize,
|
|
87
|
-
multipleMaxCount: multipleMaxCount,
|
|
88
|
-
multipleMaxSize: multipleMaxSize,
|
|
89
|
-
onUploadCompletion: onUploadCompletion
|
|
90
|
-
};
|
|
18
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
91
19
|
|
|
92
|
-
|
|
93
|
-
props.accept = ["image/jpg", "image/jpeg", "image/tiff", "image/gif", "image/png", "image/webp", "image/bmp", "image/svg+xml"];
|
|
94
|
-
} // Let's pass "permanent" / "persistent" / "temporary" flags as "mode" prop instead.
|
|
20
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
95
21
|
|
|
22
|
+
var _reactComposition = require("@webiny/react-composition");
|
|
96
23
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
24
|
+
var _FileManagerView = _interopRequireDefault(require("./FileManager/FileManagerView"));
|
|
25
|
+
|
|
26
|
+
var _FileManagerContext = require("./FileManager/FileManagerContext");
|
|
100
27
|
|
|
101
|
-
|
|
102
|
-
|
|
28
|
+
var _excluded = ["id", "src"],
|
|
29
|
+
_excluded2 = ["onChange", "images", "accept"],
|
|
30
|
+
_excluded3 = ["children", "render", "onChange"];
|
|
103
31
|
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
|
|
32
|
+
function getPortalTarget() {
|
|
33
|
+
var target = window.document.getElementById("file-manager-container");
|
|
34
|
+
|
|
35
|
+
if (!target) {
|
|
36
|
+
target = document.createElement("div");
|
|
37
|
+
target.setAttribute("id", "file-manager-container");
|
|
38
|
+
document.body && document.body.appendChild(target);
|
|
39
|
+
}
|
|
107
40
|
|
|
108
|
-
|
|
109
|
-
|
|
41
|
+
return target;
|
|
42
|
+
} // This jewel was taken from https://davidgomes.com/pick-omit-over-union-types-in-typescript/. Massive thanks, David!
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Convert a FileItem object to a FileManagerFileItem, which is then passed to `onChange` callback.
|
|
47
|
+
*/
|
|
48
|
+
var formatFileItem = function formatFileItem(_ref) {
|
|
49
|
+
var id = _ref.id,
|
|
50
|
+
src = _ref.src,
|
|
51
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
52
|
+
var props = rest;
|
|
53
|
+
return {
|
|
54
|
+
id: id,
|
|
55
|
+
src: src,
|
|
56
|
+
meta: Object.keys(rest).map(function (key) {
|
|
57
|
+
return {
|
|
58
|
+
key: key,
|
|
59
|
+
value: props[key]
|
|
60
|
+
};
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* If `accept` prop is not passed, and `images` prop is set, use these default mime types.
|
|
66
|
+
* Defaults can be overridden using the `createComponentPlugin` and `FileManagerRenderer` component.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
var imagesAccept = ["image/jpg", "image/jpeg", "image/tiff", "image/gif", "image/png", "image/webp", "image/bmp", "image/svg+xml"];
|
|
71
|
+
|
|
72
|
+
var DefaultFileManagerRenderer = function DefaultFileManagerRenderer(props) {
|
|
73
|
+
var onChange = props.onChange,
|
|
74
|
+
images = props.images,
|
|
75
|
+
accept = props.accept,
|
|
76
|
+
forwardProps = (0, _objectWithoutProperties2.default)(props, _excluded2);
|
|
77
|
+
|
|
78
|
+
var handleFileOnChange = function handleFileOnChange(value) {
|
|
79
|
+
if (!onChange || !value || Array.isArray(value) && !value.length) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (Array.isArray(value)) {
|
|
84
|
+
var finalValue = value.map(formatFileItem);
|
|
85
|
+
onChange(finalValue);
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
onChange(formatFileItem(value));
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
var viewProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, forwardProps), {}, {
|
|
93
|
+
onChange: typeof onChange === "function" ? handleFileOnChange : undefined,
|
|
94
|
+
accept: images ? accept || imagesAccept : accept || []
|
|
95
|
+
});
|
|
96
|
+
return /*#__PURE__*/_react.default.createElement(_FileManagerContext.FileManagerProvider, {
|
|
97
|
+
accept: viewProps.accept,
|
|
98
|
+
tags: viewProps.tags || [],
|
|
99
|
+
own: viewProps.own,
|
|
100
|
+
scope: viewProps.scope
|
|
101
|
+
}, /*#__PURE__*/_react.default.createElement(_FileManagerView.default, viewProps));
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
var FileManagerRenderer = (0, _reactComposition.makeComposable)("FileManagerRenderer", DefaultFileManagerRenderer);
|
|
105
|
+
exports.FileManagerRenderer = FileManagerRenderer;
|
|
106
|
+
|
|
107
|
+
var FileManager = function FileManager(_ref2) {
|
|
108
|
+
var children = _ref2.children,
|
|
109
|
+
render = _ref2.render,
|
|
110
|
+
onChange = _ref2.onChange,
|
|
111
|
+
rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded3);
|
|
112
|
+
var containerRef = (0, _react.useRef)(getPortalTarget());
|
|
113
|
+
|
|
114
|
+
var _useState = (0, _react.useState)(false),
|
|
115
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
110
116
|
show = _useState2[0],
|
|
111
117
|
setShow = _useState2[1];
|
|
112
118
|
|
|
113
|
-
var onChangeRef = useRef(
|
|
114
|
-
useEffect(function () {
|
|
115
|
-
onChangeRef.current =
|
|
116
|
-
}, [
|
|
117
|
-
var showFileManager = useCallback(function (onChange) {
|
|
119
|
+
var onChangeRef = (0, _react.useRef)(onChange);
|
|
120
|
+
(0, _react.useEffect)(function () {
|
|
121
|
+
onChangeRef.current = onChange;
|
|
122
|
+
}, [onChange]);
|
|
123
|
+
var showFileManager = (0, _react.useCallback)(function (onChange) {
|
|
118
124
|
if (typeof onChange === "function") {
|
|
119
125
|
onChangeRef.current = onChange;
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
setShow(true);
|
|
123
129
|
}, []);
|
|
124
|
-
return /*#__PURE__*/
|
|
130
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, show && /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement(FileManagerRenderer, Object.assign({
|
|
125
131
|
onClose: function onClose() {
|
|
126
132
|
return setShow(false);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
133
|
+
},
|
|
134
|
+
onChange:
|
|
135
|
+
/* TODO: figure out how to create a conditional type based on the value of `rest.multiple` */
|
|
136
|
+
onChangeRef.current
|
|
137
|
+
}, rest)), containerRef.current), children ? children({
|
|
131
138
|
showFileManager: showFileManager
|
|
132
|
-
})
|
|
133
|
-
|
|
139
|
+
}) : render ? render({
|
|
140
|
+
showFileManager: showFileManager
|
|
141
|
+
}) : null);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
exports.FileManager = FileManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getPortalTarget","target","window","document","getElementById","createElement","setAttribute","body","appendChild","formatFileItem","id","src","rest","props","meta","Object","keys","map","key","value","imagesAccept","DefaultFileManagerRenderer","onChange","images","accept","forwardProps","handleFileOnChange","Array","isArray","length","finalValue","viewProps","undefined","tags","own","scope","FileManagerRenderer","makeComposable","FileManager","children","render","containerRef","useRef","useState","show","setShow","onChangeRef","useEffect","current","showFileManager","useCallback","ReactDOM","createPortal"],"sources":["FileManager.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { makeComposable } from \"@webiny/react-composition\";\nimport FileManagerView, { FileManagerViewProps } from \"./FileManager/FileManagerView\";\nimport { FileItem } from \"./FileManager/types\";\nimport { FileManagerProvider } from \"./FileManager/FileManagerContext\";\n\ninterface OnChange<T> {\n (value: T): void;\n}\n\n/**\n * Represents a file object managed by the File Manager.\n */\nexport interface FileManagerFileItem {\n id: string;\n src: string;\n meta?: Array<FileManagerFileItemMetaItem>;\n}\n\n/**\n * With this we allow developers to add any value to file's meta via component composition, thus the `value: any`.\n */\nexport interface FileManagerFileItemMetaItem {\n key: string;\n value: any;\n}\n\nexport type DeprecatedFileManagerRenderPropParams = {\n showFileManager: (onChange?: OnChange<FileManagerFileItem | FileManagerFileItem[]>) => void;\n};\n\nexport type FileManagerRenderPropParams<TValue> = {\n showFileManager: (onChange?: OnChange<TValue>) => void;\n};\n\ninterface SingleFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem>): React.ReactNode;\n}\n\ninterface MultiFileRenderProp {\n (params: FileManagerRenderPropParams<FileManagerFileItem[]>): React.ReactNode;\n}\n\nexport type MultipleProps =\n | {\n multiple?: never;\n multipleMaxCount?: never;\n multipleMaxSize?: never;\n onChange?: OnChange<FileManagerFileItem>;\n render?: SingleFileRenderProp;\n }\n | {\n multiple: true;\n multipleMaxCount?: number;\n multipleMaxSize?: number | string;\n onChange?: OnChange<FileManagerFileItem[]>;\n render?: MultiFileRenderProp;\n };\n\nexport type FileManagerProps = {\n accept?: Array<string>;\n images?: boolean;\n maxSize?: number | string;\n /**\n * @deprecated This prop is no longer used. The file structure was reduced to a bare minimum so picking is no longer necessary.\n */\n onChangePick?: string[];\n onClose?: Function;\n onUploadCompletion?: (files: FileManagerFileItem[]) => void;\n own?: boolean;\n scope?: string;\n tags?: Array<string>;\n /**\n * @deprecated This prop is no longer used. Use the `render` prop to get better TS autocomplete.\n */\n children?: (params: DeprecatedFileManagerRenderPropParams) => React.ReactNode;\n} & MultipleProps;\n\nfunction getPortalTarget() {\n let target = window.document.getElementById(\"file-manager-container\");\n if (!target) {\n target = document.createElement(\"div\");\n target.setAttribute(\"id\", \"file-manager-container\");\n document.body && document.body.appendChild(target);\n }\n return target;\n}\n\n// This jewel was taken from https://davidgomes.com/pick-omit-over-union-types-in-typescript/. Massive thanks, David!\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;\n\nexport type FileManagerRendererProps = DistributiveOmit<FileManagerProps, \"render\" | \"children\">;\n\n/**\n * Convert a FileItem object to a FileManagerFileItem, which is then passed to `onChange` callback.\n */\nconst formatFileItem = ({ id, src, ...rest }: FileItem): FileManagerFileItem => {\n const props: { [key: string]: any } = rest;\n\n return {\n id,\n src,\n meta: Object.keys(rest).map(key => ({ key, value: props[key] }))\n };\n};\n\n/**\n * If `accept` prop is not passed, and `images` prop is set, use these default mime types.\n * Defaults can be overridden using the `createComponentPlugin` and `FileManagerRenderer` component.\n */\nconst imagesAccept = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/tiff\",\n \"image/gif\",\n \"image/png\",\n \"image/webp\",\n \"image/bmp\",\n \"image/svg+xml\"\n];\n\nconst DefaultFileManagerRenderer: React.FC<FileManagerRendererProps> = props => {\n const { onChange, images, accept, ...forwardProps } = props;\n\n const handleFileOnChange = (value?: FileItem[] | FileItem) => {\n if (!onChange || !value || (Array.isArray(value) && !value.length)) {\n return;\n }\n\n if (Array.isArray(value)) {\n const finalValue: FileManagerFileItem[] = value.map(formatFileItem);\n (onChange as OnChange<FileManagerFileItem[]>)(finalValue);\n return;\n }\n\n (onChange as OnChange<FileManagerFileItem>)(formatFileItem(value));\n };\n\n const viewProps: FileManagerViewProps = {\n ...forwardProps,\n onChange: typeof onChange === \"function\" ? handleFileOnChange : undefined,\n accept: images ? accept || imagesAccept : accept || []\n };\n\n return (\n <FileManagerProvider\n accept={viewProps.accept}\n tags={viewProps.tags || []}\n own={viewProps.own}\n scope={viewProps.scope}\n >\n <FileManagerView {...viewProps} />\n </FileManagerProvider>\n );\n};\n\nexport const FileManagerRenderer = makeComposable(\n \"FileManagerRenderer\",\n DefaultFileManagerRenderer\n);\n\nexport const FileManager: React.FC<FileManagerProps> = ({\n children,\n render,\n onChange,\n ...rest\n}) => {\n const containerRef = useRef<HTMLElement>(getPortalTarget());\n const [show, setShow] = useState(false);\n const onChangeRef = useRef(onChange);\n\n useEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n const showFileManager = useCallback(onChange => {\n if (typeof onChange === \"function\") {\n onChangeRef.current = onChange;\n }\n setShow(true);\n }, []);\n\n return (\n <>\n {show &&\n ReactDOM.createPortal(\n <FileManagerRenderer\n onClose={() => setShow(false)}\n onChange={\n /* TODO: figure out how to create a conditional type based on the value of `rest.multiple` */\n onChangeRef.current as any\n }\n {...rest}\n />,\n containerRef.current\n )}\n {children ? children({ showFileManager }) : render ? render({ showFileManager }) : null}\n </>\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
declare const FloatingActionButton:
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare const FloatingActionButton: React.FC;
|
|
3
3
|
export { FloatingActionButton };
|