@webiny/app-admin 0.0.0-mt-3 → 0.0.0-unstable.40876133bb
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 +27 -10
- 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 +57 -38
- 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 +80 -67
- package/styles/material.scss +4 -35
- package/styles/theme.scss +4 -1
- 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 +65 -37
- 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,9 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _ui = _interopRequireDefault(require("./ui"));
|
|
17
|
+
|
|
18
|
+
var _tunes = _interopRequireDefault(require("./tunes"));
|
|
19
|
+
|
|
20
|
+
var _svgs = _interopRequireDefault(require("./svgs"));
|
|
7
21
|
|
|
8
22
|
var defaultGetFileSrc = function defaultGetFileSrc(file) {
|
|
9
23
|
if (typeof file === "string") {
|
|
@@ -25,21 +39,13 @@ var ImageTool = /*#__PURE__*/function () {
|
|
|
25
39
|
config = _ref.config,
|
|
26
40
|
api = _ref.api,
|
|
27
41
|
readOnly = _ref.readOnly;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
_defineProperty(this, "config", void 0);
|
|
36
|
-
|
|
37
|
-
_defineProperty(this, "tunes", void 0);
|
|
38
|
-
|
|
39
|
-
_defineProperty(this, "ui", void 0);
|
|
40
|
-
|
|
41
|
-
_defineProperty(this, "_data", void 0);
|
|
42
|
-
|
|
42
|
+
(0, _classCallCheck2.default)(this, ImageTool);
|
|
43
|
+
(0, _defineProperty2.default)(this, "api", void 0);
|
|
44
|
+
(0, _defineProperty2.default)(this, "readOnly", void 0);
|
|
45
|
+
(0, _defineProperty2.default)(this, "config", void 0);
|
|
46
|
+
(0, _defineProperty2.default)(this, "tunes", void 0);
|
|
47
|
+
(0, _defineProperty2.default)(this, "ui", void 0);
|
|
48
|
+
(0, _defineProperty2.default)(this, "_data", void 0);
|
|
43
49
|
this.api = api;
|
|
44
50
|
this.readOnly = readOnly;
|
|
45
51
|
this.config = {
|
|
@@ -52,7 +58,7 @@ var ImageTool = /*#__PURE__*/function () {
|
|
|
52
58
|
* Module for working with UI
|
|
53
59
|
*/
|
|
54
60
|
|
|
55
|
-
this.ui = new
|
|
61
|
+
this.ui = new _ui.default({
|
|
56
62
|
api: api,
|
|
57
63
|
config: this.config,
|
|
58
64
|
onSelectFile: function onSelectFile() {
|
|
@@ -66,7 +72,7 @@ var ImageTool = /*#__PURE__*/function () {
|
|
|
66
72
|
* Module for working with tunes
|
|
67
73
|
*/
|
|
68
74
|
|
|
69
|
-
this.tunes = new
|
|
75
|
+
this.tunes = new _tunes.default({
|
|
70
76
|
api: api,
|
|
71
77
|
actions: this.config.actions,
|
|
72
78
|
onChange: function onChange(tuneName) {
|
|
@@ -89,7 +95,7 @@ var ImageTool = /*#__PURE__*/function () {
|
|
|
89
95
|
*/
|
|
90
96
|
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
(0, _createClass2.default)(ImageTool, [{
|
|
93
99
|
key: "render",
|
|
94
100
|
value: function render() {
|
|
95
101
|
return this.ui.render(this.data);
|
|
@@ -157,9 +163,12 @@ var ImageTool = /*#__PURE__*/function () {
|
|
|
157
163
|
this.image = data.file;
|
|
158
164
|
this._data.caption = data.caption || "";
|
|
159
165
|
this.ui.fillCaption(this._data.caption);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
var
|
|
166
|
+
|
|
167
|
+
_tunes.default.tunes.forEach(function (_ref2) {
|
|
168
|
+
var name = _ref2.name;
|
|
169
|
+
var tune = name;
|
|
170
|
+
var initialValue = data[tune];
|
|
171
|
+
var value = initialValue === true || initialValue === "true";
|
|
163
172
|
|
|
164
173
|
_this2.setTune(tune, value);
|
|
165
174
|
});
|
|
@@ -245,13 +254,12 @@ var ImageTool = /*#__PURE__*/function () {
|
|
|
245
254
|
key: "toolbox",
|
|
246
255
|
get: function get() {
|
|
247
256
|
return {
|
|
248
|
-
icon:
|
|
257
|
+
icon: _svgs.default.toolbox,
|
|
249
258
|
title: "Image"
|
|
250
259
|
};
|
|
251
260
|
}
|
|
252
261
|
}]);
|
|
253
|
-
|
|
254
262
|
return ImageTool;
|
|
255
263
|
}();
|
|
256
264
|
|
|
257
|
-
|
|
265
|
+
exports.default = ImageTool;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["defaultGetFileSrc","file","src","defaultOnSelectFile","ImageTool","data","config","api","readOnly","getFileSrc","onSelectFile","actions","context","ui","Ui","showFileManager","image","tunes","Tunes","onChange","tuneName","tuneToggled","_data","render","caption","nodes","innerHTML","fillCaption","forEach","name","tune","initialValue","value","setTune","fillImage","applyTune","Promise","resolve","then","blockId","blocks","getCurrentBlockIndex","stretchBlock","catch","err","console","error","icon","svgs","toolbox","title"],"sources":["index.ts"],"sourcesContent":["import { API } from \"@editorjs/editorjs\";\nimport Ui from \"./ui\";\nimport Tunes from \"./tunes\";\nimport svgs from \"./svgs\";\nimport { Tune } from \"./types\";\n\ninterface File {\n src: string;\n}\ninterface GetFileSourceCallable {\n (file: File | string): string;\n}\nconst defaultGetFileSrc: GetFileSourceCallable = file => {\n if (typeof file === \"string\") {\n return file;\n }\n\n return file.src;\n};\ninterface OnSelectFileCallable {\n (file: File): string;\n}\nconst defaultOnSelectFile: OnSelectFileCallable = file => {\n return file.src;\n};\n\ninterface ImageToolData {\n caption: string;\n file: string;\n}\ninterface ImageToolParams {\n data: ImageToolData;\n config: Config;\n api: API;\n readOnly: boolean;\n}\ninterface Config {\n getFileSrc: GetFileSourceCallable;\n onSelectFile: OnSelectFileCallable;\n actions: Tune[];\n context: {\n showFileManager: (cb: (file: File) => void) => void;\n };\n}\nexport default class ImageTool {\n private readonly api: API;\n private readonly readOnly: boolean;\n private readonly config: Config;\n private readonly tunes: Tunes;\n private readonly ui: Ui;\n private readonly _data: any;\n\n /**\n * Notify core that read-only mode is supported\n *\n * @returns {boolean}\n */\n static get isReadOnlySupported() {\n return true;\n }\n\n /**\n * Get Tool toolbox settings\n * icon - Tool icon's SVG\n * title - title to show in toolbox\n *\n * @returns {{icon: string, title: string}}\n */\n static get toolbox() {\n return {\n icon: svgs.toolbox,\n title: \"Image\"\n };\n }\n\n constructor({ data, config, api, readOnly }: ImageToolParams) {\n this.api = api;\n this.readOnly = readOnly;\n\n this.config = {\n getFileSrc: config.getFileSrc || defaultGetFileSrc,\n onSelectFile: config.onSelectFile || defaultOnSelectFile,\n actions: config.actions || [],\n context: config.context\n };\n\n /**\n * Module for working with UI\n */\n this.ui = new Ui({\n api,\n config: this.config,\n onSelectFile: () => {\n this.config.context.showFileManager((file: File) => {\n this.image = this.config.onSelectFile(file);\n });\n },\n readOnly\n });\n\n /**\n * Module for working with tunes\n */\n this.tunes = new Tunes({\n api,\n actions: this.config.actions,\n onChange: (tuneName: string) => this.tuneToggled(tuneName)\n });\n\n /**\n * Set saved state\n */\n this._data = {};\n this.data = data;\n }\n\n /**\n * Renders Block content\n *\n * @public\n *\n * @returns {HTMLDivElement}\n */\n render() {\n return this.ui.render(this.data);\n }\n\n /**\n * Return Block data\n *\n * @public\n *\n * @returns {ImageToolData}\n */\n save() {\n const caption = this.ui.nodes.caption;\n\n this._data.caption = caption.innerHTML;\n\n return this.data;\n }\n\n /**\n * Makes buttons with tunes: stretch image\n *\n * @public\n *\n * @returns {Element}\n */\n renderSettings() {\n return this.tunes.render(this.data);\n }\n\n /**\n * Stores all Tool's data\n *\n * @private\n *\n * @param {ImageToolData} data - data in Image Tool format\n */\n set data(data) {\n this.image = data.file;\n\n this._data.caption = data.caption || \"\";\n this.ui.fillCaption(this._data.caption);\n\n Tunes.tunes.forEach(({ name }) => {\n const tune = name as keyof ImageToolData;\n\n const initialValue = data[tune] as unknown as string | boolean;\n\n const value = initialValue === true || initialValue === \"true\";\n\n this.setTune(tune, value);\n });\n }\n\n /**\n * Return Tool data\n *\n * @private\n *\n * @returns {ImageToolData}\n */\n get data(): ImageToolData {\n return this._data;\n }\n\n /**\n * Set new image file\n *\n * @private\n *\n * @param {object} file - uploaded file data\n */\n set image(file: File | string) {\n this._data.file = file || {};\n\n if (file) {\n this.ui.fillImage(this.config.getFileSrc(file));\n }\n }\n\n /**\n * Callback fired when Block Tune is activated\n *\n * @private\n *\n * @param {string} tuneName - tune that has been clicked\n * @returns {void}\n */\n public tuneToggled(tuneName: string): void {\n // inverse tune state\n this.setTune(tuneName, !this._data[tuneName]);\n }\n\n /**\n * Set one tune\n *\n * @param {string} tuneName - {@link Tunes.tunes}\n * @param {boolean} value - tune state\n * @returns {void}\n */\n public setTune(tuneName: string, value: boolean): void {\n this._data[tuneName] = value;\n\n this.ui.applyTune(tuneName, value);\n\n if (tuneName === \"stretched\") {\n /**\n * Wait until the API is ready\n */\n Promise.resolve()\n .then(() => {\n const blockId = this.api.blocks.getCurrentBlockIndex();\n\n this.api.blocks.stretchBlock(blockId, value);\n })\n .catch(err => {\n console.error(err);\n });\n }\n }\n\n public isReadOnly(): boolean {\n return this.readOnly;\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = {
|
|
2
8
|
buttonIcon: "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.15 13.628A7.749 7.749 0 0 0 10 17.75a7.74 7.74 0 0 0 6.305-3.242l-2.387-2.127-2.765 2.244-4.389-4.496-3.614 3.5zm-.787-2.303l4.446-4.371 4.52 4.63 2.534-2.057 3.533 2.797c.23-.734.354-1.514.354-2.324a7.75 7.75 0 1 0-15.387 1.325zM10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10z\"/>",
|
|
3
9
|
stretched: "<svg width=\"17\" height=\"10\" viewBox=\"0 0 17 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M13.568 5.925H4.056l1.703 1.703a1.125 1.125 0 0 1-1.59 1.591L.962 6.014A1.069 1.069 0 0 1 .588 4.26L4.38.469a1.069 1.069 0 0 1 1.512 1.511L4.084 3.787h9.606l-1.85-1.85a1.069 1.069 0 1 1 1.512-1.51l3.792 3.791a1.069 1.069 0 0 1-.475 1.788L13.514 9.16a1.125 1.125 0 0 1-1.59-1.591l1.644-1.644z\"/></svg>",
|
|
4
10
|
toolbox: "<svg width=\"17\" height=\"15\" viewBox=\"0 0 336 276\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M291 150.242V79c0-18.778-15.222-34-34-34H79c-18.778 0-34 15.222-34 34v42.264l67.179-44.192 80.398 71.614 56.686-29.14L291 150.242zm-.345 51.622l-42.3-30.246-56.3 29.884-80.773-66.925L45 174.187V197c0 18.778 15.222 34 34 34h178c17.126 0 31.295-12.663 33.655-29.136zM79 0h178c43.63 0 79 35.37 79 79v118c0 43.63-35.37 79-79 79H79c-43.63 0-79-35.37-79-79V79C0 35.37 35.37 0 79 0z\"/></svg>"
|
|
5
|
-
};
|
|
11
|
+
};
|
|
12
|
+
exports.default = _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["buttonIcon","stretched","toolbox"],"sources":["svgs.ts"],"sourcesContent":["export default {\n buttonIcon: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M3.15 13.628A7.749 7.749 0 0 0 10 17.75a7.74 7.74 0 0 0 6.305-3.242l-2.387-2.127-2.765 2.244-4.389-4.496-3.614 3.5zm-.787-2.303l4.446-4.371 4.52 4.63 2.534-2.057 3.533 2.797c.23-.734.354-1.514.354-2.324a7.75 7.75 0 1 0-15.387 1.325zM10 20C4.477 20 0 15.523 0 10S4.477 0 10 0s10 4.477 10 10-4.477 10-10 10z\"/>`,\n stretched: `<svg width=\"17\" height=\"10\" viewBox=\"0 0 17 10\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M13.568 5.925H4.056l1.703 1.703a1.125 1.125 0 0 1-1.59 1.591L.962 6.014A1.069 1.069 0 0 1 .588 4.26L4.38.469a1.069 1.069 0 0 1 1.512 1.511L4.084 3.787h9.606l-1.85-1.85a1.069 1.069 0 1 1 1.512-1.51l3.792 3.791a1.069 1.069 0 0 1-.475 1.788L13.514 9.16a1.125 1.125 0 0 1-1.59-1.591l1.644-1.644z\"/></svg>`,\n toolbox: `<svg width=\"17\" height=\"15\" viewBox=\"0 0 336 276\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M291 150.242V79c0-18.778-15.222-34-34-34H79c-18.778 0-34 15.222-34 34v42.264l67.179-44.192 80.398 71.614 56.686-29.14L291 150.242zm-.345 51.622l-42.3-30.246-56.3 29.884-80.773-66.925L45 174.187V197c0 18.778 15.222 34 34 34h178c17.126 0 31.295-12.663 33.655-29.136zM79 0h178c43.63 0 79 35.37 79 79v118c0 43.63-35.37 79-79 79H79c-43.63 0-79-35.37-79-79V79C0 35.37 35.37 0 79 0z\"/></svg>`\n};\n"],"mappings":";;;;;;eAAe;EACXA,UAAU,8ZADC;EAEXC,SAAS,sZAFE;EAGXC,OAAO;AAHI,C"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="web" />
|
|
3
|
+
import { API } from "@editorjs/editorjs";
|
|
4
|
+
import { ImageToolData, Tune, TuneOnChangeCallable } from "./types";
|
|
5
|
+
interface TunesParams {
|
|
6
|
+
api: API;
|
|
7
|
+
actions: Tune[];
|
|
8
|
+
onChange: TuneOnChangeCallable;
|
|
9
|
+
}
|
|
7
10
|
/**
|
|
8
11
|
* Working with Block Tunes
|
|
9
12
|
*/
|
|
10
13
|
export default class Tunes {
|
|
11
14
|
private api;
|
|
12
|
-
private actions;
|
|
13
|
-
private onChange;
|
|
15
|
+
private readonly actions;
|
|
16
|
+
private readonly onChange;
|
|
14
17
|
private buttons;
|
|
15
18
|
/**
|
|
16
19
|
* @param {object} tune - image tool Tunes managers
|
|
@@ -18,11 +21,7 @@ export default class Tunes {
|
|
|
18
21
|
* @param {object} tune.actions - list of user defined tunes
|
|
19
22
|
* @param {Function} tune.onChange - tune toggling callback
|
|
20
23
|
*/
|
|
21
|
-
constructor({ api, actions, onChange }:
|
|
22
|
-
api: any;
|
|
23
|
-
actions: any;
|
|
24
|
-
onChange: any;
|
|
25
|
-
});
|
|
24
|
+
constructor({ api, actions, onChange }: TunesParams);
|
|
26
25
|
/**
|
|
27
26
|
* Available Image tunes
|
|
28
27
|
*
|
|
@@ -46,13 +45,13 @@ export default class Tunes {
|
|
|
46
45
|
* @param {ImageToolData} toolData - generate Elements of tunes
|
|
47
46
|
* @returns {Element}
|
|
48
47
|
*/
|
|
49
|
-
render(toolData:
|
|
48
|
+
render(toolData: ImageToolData): HTMLElement;
|
|
50
49
|
/**
|
|
51
50
|
* Clicks to one of the tunes
|
|
52
51
|
*
|
|
53
52
|
* @param {string} tuneName - clicked tune name
|
|
54
53
|
* @param {Function} customFunction - function to execute on click
|
|
55
54
|
*/
|
|
56
|
-
tuneClicked(tuneName:
|
|
55
|
+
tuneClicked(tuneName: string, customFunction?: TuneOnChangeCallable): boolean;
|
|
57
56
|
}
|
|
58
57
|
export {};
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
+
|
|
12
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
+
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
|
+
|
|
16
|
+
var _ui = require("./ui");
|
|
17
|
+
|
|
18
|
+
var _svgs = _interopRequireDefault(require("./svgs"));
|
|
6
19
|
|
|
7
20
|
/**
|
|
8
21
|
* Working with Block Tunes
|
|
@@ -18,17 +31,11 @@ var Tunes = /*#__PURE__*/function () {
|
|
|
18
31
|
var api = _ref.api,
|
|
19
32
|
actions = _ref.actions,
|
|
20
33
|
onChange = _ref.onChange;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_defineProperty(this, "actions", void 0);
|
|
27
|
-
|
|
28
|
-
_defineProperty(this, "onChange", void 0);
|
|
29
|
-
|
|
30
|
-
_defineProperty(this, "buttons", void 0);
|
|
31
|
-
|
|
34
|
+
(0, _classCallCheck2.default)(this, Tunes);
|
|
35
|
+
(0, _defineProperty2.default)(this, "api", void 0);
|
|
36
|
+
(0, _defineProperty2.default)(this, "actions", void 0);
|
|
37
|
+
(0, _defineProperty2.default)(this, "onChange", void 0);
|
|
38
|
+
(0, _defineProperty2.default)(this, "buttons", void 0);
|
|
32
39
|
this.api = api;
|
|
33
40
|
this.actions = actions;
|
|
34
41
|
this.onChange = onChange;
|
|
@@ -41,7 +48,7 @@ var Tunes = /*#__PURE__*/function () {
|
|
|
41
48
|
*/
|
|
42
49
|
|
|
43
50
|
|
|
44
|
-
|
|
51
|
+
(0, _createClass2.default)(Tunes, [{
|
|
45
52
|
key: "CSS",
|
|
46
53
|
get:
|
|
47
54
|
/**
|
|
@@ -69,21 +76,22 @@ var Tunes = /*#__PURE__*/function () {
|
|
|
69
76
|
value: function render(toolData) {
|
|
70
77
|
var _this = this;
|
|
71
78
|
|
|
72
|
-
var wrapper = make("div", this.CSS.wrapper);
|
|
79
|
+
var wrapper = (0, _ui.make)("div", this.CSS.wrapper);
|
|
73
80
|
this.buttons = [];
|
|
74
81
|
var tunes = Tunes.tunes.concat(this.actions);
|
|
75
82
|
tunes.forEach(function (tune) {
|
|
76
83
|
var title = _this.api.i18n.t(tune.title);
|
|
77
84
|
|
|
78
|
-
var el = make("div", [_this.CSS.buttonBase, _this.CSS.button], {
|
|
85
|
+
var el = (0, _ui.make)("div", [_this.CSS.buttonBase, _this.CSS.button], {
|
|
79
86
|
innerHTML: tune.icon,
|
|
80
87
|
title: title
|
|
81
88
|
});
|
|
82
89
|
el.addEventListener("click", function () {
|
|
83
90
|
_this.tuneClicked(tune.name, tune.action);
|
|
84
91
|
});
|
|
85
|
-
el.dataset
|
|
86
|
-
|
|
92
|
+
el.dataset["tune"] = tune.name;
|
|
93
|
+
var name = tune.name;
|
|
94
|
+
el.classList.toggle(_this.CSS.buttonActive, !!toolData[name]);
|
|
87
95
|
|
|
88
96
|
_this.buttons.push(el);
|
|
89
97
|
|
|
@@ -112,23 +120,27 @@ var Tunes = /*#__PURE__*/function () {
|
|
|
112
120
|
}
|
|
113
121
|
|
|
114
122
|
var button = this.buttons.find(function (el) {
|
|
115
|
-
return el.dataset
|
|
123
|
+
return el.dataset["tune"] === tuneName;
|
|
116
124
|
});
|
|
117
|
-
|
|
125
|
+
|
|
126
|
+
if (button) {
|
|
127
|
+
button.classList.toggle(this.CSS.buttonActive, !button.classList.contains(this.CSS.buttonActive));
|
|
128
|
+
}
|
|
129
|
+
|
|
118
130
|
this.onChange(tuneName);
|
|
131
|
+
return true;
|
|
119
132
|
}
|
|
120
133
|
}], [{
|
|
121
134
|
key: "tunes",
|
|
122
135
|
get: function get() {
|
|
123
136
|
return [{
|
|
124
137
|
name: "stretched",
|
|
125
|
-
icon:
|
|
138
|
+
icon: _svgs.default.stretched,
|
|
126
139
|
title: "Stretch image"
|
|
127
140
|
}];
|
|
128
141
|
}
|
|
129
142
|
}]);
|
|
130
|
-
|
|
131
143
|
return Tunes;
|
|
132
144
|
}();
|
|
133
145
|
|
|
134
|
-
|
|
146
|
+
exports.default = Tunes;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Tunes","api","actions","onChange","buttons","wrapper","buttonBase","styles","settingsButton","button","buttonActive","settingsButtonActive","toolData","make","CSS","tunes","concat","forEach","tune","title","i18n","t","el","innerHTML","icon","addEventListener","tuneClicked","name","action","dataset","classList","toggle","push","tooltip","onHover","placement","appendChild","tuneName","customFunction","find","contains","svgs","stretched"],"sources":["tunes.ts"],"sourcesContent":["import { API } from \"@editorjs/editorjs\";\nimport { make } from \"./ui\";\nimport svgs from \"./svgs\";\nimport { ImageToolData, Tune, TuneOnChangeCallable } from \"./types\";\n\ninterface TunesParams {\n api: API;\n actions: Tune[];\n onChange: TuneOnChangeCallable;\n}\n/**\n * Working with Block Tunes\n */\nexport default class Tunes {\n private api: API;\n private readonly actions: Tune[];\n private readonly onChange: TuneOnChangeCallable;\n private buttons: Array<HTMLElement>;\n /**\n * @param {object} tune - image tool Tunes managers\n * @param {object} tune.api - Editor API\n * @param {object} tune.actions - list of user defined tunes\n * @param {Function} tune.onChange - tune toggling callback\n */\n constructor({ api, actions, onChange }: TunesParams) {\n this.api = api;\n this.actions = actions;\n this.onChange = onChange;\n this.buttons = [];\n }\n\n /**\n * Available Image tunes\n *\n * @returns {{name: string, icon: string, title: string}[]}\n */\n static get tunes(): Tune[] {\n return [\n {\n name: \"stretched\",\n icon: svgs.stretched,\n title: \"Stretch image\"\n }\n ];\n }\n\n /**\n * Styles\n *\n * @returns {{wrapper: string, buttonBase: *, button: string, buttonActive: *}}\n */\n get CSS() {\n return {\n wrapper: \"\",\n buttonBase: this.api.styles.settingsButton,\n button: \"image-tool__tune\",\n buttonActive: this.api.styles.settingsButtonActive\n };\n }\n\n /**\n * Makes buttons with tunes: stretch image\n *\n * @param {ImageToolData} toolData - generate Elements of tunes\n * @returns {Element}\n */\n render(toolData: ImageToolData): HTMLElement {\n const wrapper = make(\"div\", this.CSS.wrapper);\n\n this.buttons = [];\n\n const tunes = Tunes.tunes.concat(this.actions);\n\n tunes.forEach(tune => {\n const title = this.api.i18n.t(tune.title);\n const el = make(\"div\", [this.CSS.buttonBase, this.CSS.button], {\n innerHTML: tune.icon,\n title\n });\n\n el.addEventListener(\"click\", () => {\n this.tuneClicked(tune.name, tune.action);\n });\n\n el.dataset[\"tune\"] = tune.name;\n const name = tune.name as keyof ImageToolData;\n el.classList.toggle(this.CSS.buttonActive, !!toolData[name]);\n\n this.buttons.push(el);\n\n this.api.tooltip.onHover(el, title, {\n placement: \"top\"\n });\n\n wrapper.appendChild(el);\n });\n\n return wrapper;\n }\n\n /**\n * Clicks to one of the tunes\n *\n * @param {string} tuneName - clicked tune name\n * @param {Function} customFunction - function to execute on click\n */\n tuneClicked(tuneName: string, customFunction?: TuneOnChangeCallable): boolean {\n if (typeof customFunction === \"function\") {\n if (!customFunction(tuneName)) {\n return false;\n }\n }\n\n const button = this.buttons.find(el => el.dataset[\"tune\"] === tuneName);\n\n if (button) {\n button.classList.toggle(\n this.CSS.buttonActive,\n !button.classList.contains(this.CSS.buttonActive)\n );\n }\n\n this.onChange(tuneName);\n return true;\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface TuneOnChangeCallable {
|
|
2
|
+
(tune: string): boolean | void;
|
|
3
|
+
}
|
|
4
|
+
export interface Tune {
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
title: string;
|
|
8
|
+
action?: TuneOnChangeCallable;
|
|
9
|
+
}
|
|
10
|
+
export interface ImageToolData {
|
|
11
|
+
caption: string;
|
|
12
|
+
file: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ImageToolFile {
|
|
15
|
+
src: string;
|
|
16
|
+
}
|
|
17
|
+
export interface GetFileSourceCallable {
|
|
18
|
+
(file: ImageToolFile | string): string;
|
|
19
|
+
}
|
|
20
|
+
export interface OnSelectFileCallable {
|
|
21
|
+
(file: ImageToolFile): string;
|
|
22
|
+
}
|
|
23
|
+
export interface ImageToolConfig {
|
|
24
|
+
getFileSrc: GetFileSourceCallable;
|
|
25
|
+
onSelectFile: OnSelectFileCallable;
|
|
26
|
+
captionPlaceholder?: string;
|
|
27
|
+
actions: Tune[];
|
|
28
|
+
context: Record<string, any>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["export interface TuneOnChangeCallable {\n (tune: string): boolean | void;\n}\nexport interface Tune {\n name: string;\n icon: string;\n title: string;\n action?: TuneOnChangeCallable;\n}\n\nexport interface ImageToolData {\n caption: string;\n file: string;\n}\nexport interface ImageToolFile {\n src: string;\n}\nexport interface GetFileSourceCallable {\n (file: ImageToolFile | string): string;\n}\nexport interface OnSelectFileCallable {\n (file: ImageToolFile): string;\n}\nexport interface ImageToolConfig {\n getFileSrc: GetFileSourceCallable;\n onSelectFile: OnSelectFileCallable;\n captionPlaceholder?: string;\n actions: Tune[];\n context: Record<string, any>;\n}\n"],"mappings":""}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/// <reference types="web" />
|
|
3
|
+
import { API } from "@editorjs/editorjs";
|
|
4
|
+
import { ImageToolConfig, ImageToolData } from "./types";
|
|
5
|
+
interface OnSelectFileCallable {
|
|
6
|
+
(): void;
|
|
7
|
+
}
|
|
8
|
+
interface UiStatus {
|
|
9
|
+
EMPTY: "empty";
|
|
10
|
+
FILLED: "filled";
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
}
|
|
13
|
+
interface UiParams {
|
|
14
|
+
api: API;
|
|
15
|
+
config: ImageToolConfig;
|
|
16
|
+
onSelectFile: OnSelectFileCallable;
|
|
17
|
+
readOnly: boolean;
|
|
18
|
+
}
|
|
1
19
|
/**
|
|
2
20
|
* Class for working with UI:
|
|
3
21
|
* - rendering base structure
|
|
@@ -7,28 +25,23 @@
|
|
|
7
25
|
export default class Ui {
|
|
8
26
|
private api;
|
|
9
27
|
private config;
|
|
10
|
-
private readOnly;
|
|
11
|
-
private onSelectFile;
|
|
12
|
-
nodes: {
|
|
28
|
+
private readonly readOnly;
|
|
29
|
+
private readonly onSelectFile;
|
|
30
|
+
readonly nodes: {
|
|
13
31
|
wrapper: HTMLElement;
|
|
14
32
|
imageContainer: HTMLElement;
|
|
15
33
|
fileButton: HTMLElement;
|
|
16
|
-
imageEl
|
|
34
|
+
imageEl?: HTMLElement;
|
|
17
35
|
caption: HTMLElement;
|
|
18
36
|
};
|
|
19
37
|
/**
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param
|
|
38
|
+
* @param ui - image tool Ui module
|
|
39
|
+
* @param ui.api - Editor.js API
|
|
40
|
+
* @param ui.config - user config
|
|
41
|
+
* @param ui.onSelectFile - callback for clicks on Select file button
|
|
42
|
+
* @param ui.readOnly - read-only mode flag
|
|
25
43
|
*/
|
|
26
|
-
constructor({ api, config, onSelectFile, readOnly }:
|
|
27
|
-
api: any;
|
|
28
|
-
config: any;
|
|
29
|
-
onSelectFile: any;
|
|
30
|
-
readOnly: any;
|
|
31
|
-
});
|
|
44
|
+
constructor({ api, config, onSelectFile, readOnly }: UiParams);
|
|
32
45
|
/**
|
|
33
46
|
* CSS classes
|
|
34
47
|
*
|
|
@@ -53,44 +66,41 @@ export default class Ui {
|
|
|
53
66
|
*
|
|
54
67
|
* @returns {{EMPTY: string, UPLOADING: string, FILLED: string}}
|
|
55
68
|
*/
|
|
56
|
-
static get status():
|
|
57
|
-
EMPTY: string;
|
|
58
|
-
FILLED: string;
|
|
59
|
-
};
|
|
69
|
+
static get status(): UiStatus;
|
|
60
70
|
/**
|
|
61
71
|
* Renders tool UI
|
|
62
72
|
*
|
|
63
73
|
* @param {ImageToolData} toolData - saved tool data
|
|
64
74
|
* @returns {Element}
|
|
65
75
|
*/
|
|
66
|
-
render(toolData:
|
|
76
|
+
render(toolData: ImageToolData): HTMLElement;
|
|
67
77
|
/**
|
|
68
78
|
* Creates upload-file button
|
|
69
79
|
*
|
|
70
80
|
* @returns {Element}
|
|
71
81
|
*/
|
|
72
|
-
createFileButton():
|
|
82
|
+
createFileButton(): HTMLElement;
|
|
73
83
|
/**
|
|
74
84
|
* Shows an image
|
|
75
85
|
*
|
|
76
86
|
* @param {string} url - image source
|
|
77
87
|
* @returns {void}
|
|
78
88
|
*/
|
|
79
|
-
fillImage(url:
|
|
89
|
+
fillImage(url: string): void;
|
|
80
90
|
/**
|
|
81
91
|
* Shows caption input
|
|
82
92
|
*
|
|
83
93
|
* @param {string} text - caption text
|
|
84
94
|
* @returns {void}
|
|
85
95
|
*/
|
|
86
|
-
fillCaption(text:
|
|
96
|
+
fillCaption(text: string): void;
|
|
87
97
|
/**
|
|
88
98
|
* Changes UI status
|
|
89
99
|
*
|
|
90
100
|
* @param {string} status - see {@link Ui.status} constants
|
|
91
101
|
* @returns {void}
|
|
92
102
|
*/
|
|
93
|
-
toggleStatus(status:
|
|
103
|
+
toggleStatus(status: string): void;
|
|
94
104
|
/**
|
|
95
105
|
* Apply visual representation of activated tune
|
|
96
106
|
*
|
|
@@ -98,7 +108,7 @@ export default class Ui {
|
|
|
98
108
|
* @param {boolean} status - true for enable, false for disable
|
|
99
109
|
* @returns {void}
|
|
100
110
|
*/
|
|
101
|
-
applyTune(tuneName:
|
|
111
|
+
applyTune(tuneName: string, status: boolean): void;
|
|
102
112
|
}
|
|
103
113
|
/**
|
|
104
114
|
* Helper for making Elements with attributes
|
|
@@ -106,6 +116,7 @@ export default class Ui {
|
|
|
106
116
|
* @param {string} tagName - new Element tag name
|
|
107
117
|
* @param {Array|string} classNames - list or name of CSS class
|
|
108
118
|
* @param {object} attributes - any attributes
|
|
109
|
-
* @returns {
|
|
119
|
+
* @returns {HTMLElement}
|
|
110
120
|
*/
|
|
111
|
-
export declare const make: (tagName:
|
|
121
|
+
export declare const make: (tagName: string, classNames?: string[] | string | null, attributes?: Record<string, string | number | boolean>) => HTMLElement;
|
|
122
|
+
export {};
|