@webiny/app-admin 0.0.0-mt-2 → 0.0.0-unstable.085ff6572f
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/add-18px.svg +1 -1
- package/assets/icons/arrow_drop_down-24px.svg +1 -1
- package/assets/icons/filter-24px.svg +1 -1
- package/assets/icons/highlight-24px.svg +1 -1
- package/assets/icons/info.svg +1 -1
- package/assets/icons/insert_drive_file-24px.svg +1 -1
- package/assets/icons/insert_photo-24px.svg +1 -1
- package/assets/icons/label-24px.svg +1 -1
- package/assets/icons/round-account_circle-24px.svg +1 -1
- package/assets/icons/round-arrow_drop_down-24px.svg +1 -1
- package/assets/icons/round-help-24px.svg +1 -1
- package/assets/icons/round-settings-24px.svg +1 -1
- package/assets/icons/slack-logo.svg +1 -1
- package/assets/icons/today-24px.svg +1 -1
- package/assets/icons/touch_app.svg +1 -1
- package/base/Admin.d.ts +7 -0
- package/base/Admin.js +42 -0
- package/base/Admin.js.map +1 -0
- package/base/Base.d.ts +2 -0
- package/base/Base.js +75 -0
- package/base/Base.js.map +1 -0
- package/base/plugins/AddGraphQLQuerySelection.d.ts +9 -0
- package/base/plugins/AddGraphQLQuerySelection.js +27 -0
- package/base/plugins/AddGraphQLQuerySelection.js.map +1 -0
- package/base/providers/ApolloProvider.d.ts +10 -0
- package/base/providers/ApolloProvider.js +21 -0
- package/base/providers/ApolloProvider.js.map +1 -0
- package/base/providers/TelemetryProvider.d.ts +2 -0
- package/base/providers/TelemetryProvider.js +31 -0
- package/base/providers/TelemetryProvider.js.map +1 -0
- package/base/providers/UiStateProvider.d.ts +2 -0
- package/base/providers/UiStateProvider.js +18 -0
- package/base/providers/UiStateProvider.js.map +1 -0
- package/base/providers/ViewCompositionProvider.d.ts +17 -0
- package/base/providers/ViewCompositionProvider.js +57 -0
- package/base/providers/ViewCompositionProvider.js.map +1 -0
- package/base/ui/Brand.d.ts +2 -0
- package/base/ui/Brand.js +15 -0
- package/base/ui/Brand.js.map +1 -0
- package/base/ui/CenteredView.d.ts +4 -0
- package/base/ui/CenteredView.js +35 -0
- package/base/ui/CenteredView.js.map +1 -0
- package/base/ui/Dashboard.d.ts +2 -0
- package/base/ui/Dashboard.js +15 -0
- package/base/ui/Dashboard.js.map +1 -0
- package/base/ui/FileManager.d.ts +68 -0
- package/base/ui/FileManager.js +62 -0
- package/base/ui/FileManager.js.map +1 -0
- package/base/ui/Layout.d.ts +7 -0
- package/base/ui/Layout.js +19 -0
- package/base/ui/Layout.js.map +1 -0
- package/base/ui/LocaleSelector.d.ts +2 -0
- package/base/ui/LocaleSelector.js +15 -0
- package/base/ui/LocaleSelector.js.map +1 -0
- package/base/ui/LoginScreen.d.ts +6 -0
- package/base/ui/LoginScreen.js +21 -0
- package/base/ui/LoginScreen.js.map +1 -0
- package/base/ui/Logo.d.ts +8 -0
- package/base/ui/Logo.js +30 -0
- package/base/ui/Logo.js.map +1 -0
- package/base/ui/Menu.d.ts +31 -0
- package/base/ui/Menu.js +137 -0
- package/base/ui/Menu.js.map +1 -0
- package/base/ui/Navigation.d.ts +24 -0
- package/base/ui/Navigation.js +151 -0
- package/base/ui/Navigation.js.map +1 -0
- package/base/ui/NotFound.d.ts +2 -0
- package/base/ui/NotFound.js +15 -0
- package/base/ui/NotFound.js.map +1 -0
- package/base/ui/Search.d.ts +19 -0
- package/base/ui/Search.js +63 -0
- package/base/ui/Search.js.map +1 -0
- package/base/ui/Tags.d.ts +10 -0
- package/base/ui/Tags.js +22 -0
- package/base/ui/Tags.js.map +1 -0
- package/base/ui/UserMenu.d.ts +30 -0
- package/base/ui/UserMenu.js +113 -0
- package/base/ui/UserMenu.js.map +1 -0
- package/components/AdminLayout.d.ts +1 -2
- package/components/AdminLayout.js +16 -34
- package/components/AdminLayout.js.map +1 -0
- package/components/AppInstaller/AppInstaller.d.ts +7 -0
- package/components/AppInstaller/AppInstaller.js +117 -0
- package/components/AppInstaller/AppInstaller.js.map +1 -0
- package/components/AppInstaller/Sidebar.d.ts +8 -6
- package/components/AppInstaller/Sidebar.js +53 -66
- package/components/AppInstaller/Sidebar.js.map +1 -0
- package/components/AppInstaller/index.d.ts +1 -4
- package/components/AppInstaller/index.js +21 -133
- package/components/AppInstaller/index.js.map +1 -0
- package/components/AppInstaller/styled.d.ts +18 -4
- package/components/AppInstaller/styled.js +27 -13
- package/components/AppInstaller/styled.js.map +1 -0
- package/components/AppInstaller/useInstaller.d.ts +23 -9
- package/components/AppInstaller/useInstaller.js +124 -193
- package/components/AppInstaller/useInstaller.js.map +1 -0
- package/components/EmptyView.d.ts +5 -5
- package/components/EmptyView.js +21 -15
- package/components/EmptyView.js.map +1 -0
- package/components/FloatingActionButton.d.ts +2 -2
- package/components/FloatingActionButton.js +13 -7
- package/components/FloatingActionButton.js.map +1 -0
- package/components/MultiImageUpload.d.ts +13 -4
- package/components/MultiImageUpload.js +25 -11
- package/components/MultiImageUpload.js.map +1 -0
- package/components/OverlayLayout/OverlayLayout.d.ts +11 -13
- package/components/OverlayLayout/OverlayLayout.js +54 -58
- package/components/OverlayLayout/OverlayLayout.js.map +1 -0
- package/components/OverlayLayout/index.d.ts +1 -1
- package/components/OverlayLayout/index.js +16 -1
- package/components/OverlayLayout/index.js.map +1 -0
- package/components/Permissions/CannotUseAaclAlert.d.ts +2 -0
- package/components/Permissions/CannotUseAaclAlert.js +20 -0
- package/components/Permissions/CannotUseAaclAlert.js.map +1 -0
- package/components/Permissions/Permissions.d.ts +6 -4
- package/components/Permissions/Permissions.js +43 -28
- package/components/Permissions/Permissions.js.map +1 -0
- package/components/Permissions/StyledComponents.d.ts +6 -4
- package/components/Permissions/StyledComponents.js +20 -10
- package/components/Permissions/StyledComponents.js.map +1 -0
- package/components/Permissions/index.d.ts +1 -0
- package/components/Permissions/index.js +35 -2
- package/components/Permissions/index.js.map +1 -0
- package/components/RichTextEditor/RichTextEditor.d.ts +2 -2
- package/components/RichTextEditor/RichTextEditor.js +17 -9
- package/components/RichTextEditor/RichTextEditor.js.map +1 -0
- package/components/RichTextEditor/index.js +19 -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 +93 -133
- 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 +45 -58
- 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 +35 -40
- 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 +61 -64
- 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 +101 -133
- 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 +73 -60
- package/components/RichTextEditor/tools/textColor/index.js.map +1 -0
- package/components/RichTextEditor/tools/utils.js +13 -6
- package/components/RichTextEditor/tools/utils.js.map +1 -0
- package/components/Routes.d.ts +6 -0
- package/components/Routes.js +42 -0
- package/components/Routes.js.map +1 -0
- package/components/SearchUI.d.ts +5 -4
- package/components/SearchUI.js +28 -14
- package/components/SearchUI.js.map +1 -0
- package/components/SimpleForm/SimpleForm.d.ts +11 -11
- package/components/SimpleForm/SimpleForm.js +41 -39
- package/components/SimpleForm/SimpleForm.js.map +1 -0
- package/components/SimpleForm/index.js +30 -1
- package/components/SimpleForm/index.js.map +1 -0
- package/components/SimpleUI/InputField.d.ts +6 -3
- package/components/SimpleUI/InputField.js +51 -46
- package/components/SimpleUI/InputField.js.map +1 -0
- package/components/SingleImageUpload.d.ts +43 -13
- package/components/SingleImageUpload.js +79 -83
- package/components/SingleImageUpload.js.map +1 -0
- package/components/SplitView/SplitView.d.ts +6 -5
- package/components/SplitView/SplitView.js +34 -34
- package/components/SplitView/SplitView.js.map +1 -0
- package/components/SplitView/index.js +24 -1
- package/components/SplitView/index.js.map +1 -0
- package/components/index.d.ts +1 -1
- package/components/index.js +12 -1
- package/components/index.js.map +1 -0
- package/hooks/useConfirmationDialog.d.ts +10 -5
- package/hooks/useConfirmationDialog.js +35 -25
- package/hooks/useConfirmationDialog.js.map +1 -0
- package/hooks/useDialog.d.ts +8 -3
- package/hooks/useDialog.js +12 -7
- package/hooks/useDialog.js.map +1 -0
- package/hooks/useSnackbar.d.ts +6 -3
- package/hooks/useSnackbar.js +15 -7
- package/hooks/useSnackbar.js.map +1 -0
- package/index.d.ts +35 -0
- package/index.js +321 -0
- package/index.js.map +1 -0
- package/package.json +46 -54
- package/plugins/MenuPlugin.d.ts +22 -5
- package/plugins/MenuPlugin.js +26 -24
- package/plugins/MenuPlugin.js.map +1 -0
- package/plugins/PermissionRendererPlugin.d.ts +4 -4
- package/plugins/PermissionRendererPlugin.js +26 -24
- package/plugins/PermissionRendererPlugin.js.map +1 -0
- package/plugins/globalSearch/SearchBar.d.ts +15 -3
- package/plugins/globalSearch/SearchBar.js +69 -85
- package/plugins/globalSearch/SearchBar.js.map +1 -0
- package/plugins/globalSearch/SearchBarDropdown.d.ts +19 -1
- package/plugins/globalSearch/SearchBarDropdown.js +45 -44
- 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 +14 -3
- package/plugins/globalSearch/styled.js +29 -13
- package/plugins/globalSearch/styled.js.map +1 -0
- package/plugins/uiLayoutRenderer/index.d.ts +1 -2
- package/plugins/uiLayoutRenderer/index.js +23 -25
- package/plugins/uiLayoutRenderer/index.js.map +1 -0
- package/styles/material-theme-assignments.scss +84 -67
- package/styles/material.scss +4 -35
- package/styles/theme.scss +34 -1
- package/types.d.ts +45 -45
- package/types.js +5 -1
- package/types.js.map +1 -0
- package/ui/UIElement.d.ts +1 -1
- package/ui/UIElement.js +18 -1
- package/ui/UIElement.js.map +1 -0
- package/ui/UILayout.js +18 -1
- package/ui/UILayout.js.map +1 -0
- package/ui/UIRenderer.js +12 -1
- package/ui/UIRenderer.js.map +1 -0
- package/ui/UIView.d.ts +1 -1
- package/ui/UIView.js +24 -1
- package/ui/UIView.js.map +1 -0
- package/ui/elements/AccordionElement.d.ts +5 -5
- package/ui/elements/AccordionElement.js +41 -43
- package/ui/elements/AccordionElement.js.map +1 -0
- package/ui/elements/ButtonElement.d.ts +3 -3
- package/ui/elements/ButtonElement.js +35 -27
- package/ui/elements/ButtonElement.js.map +1 -0
- package/ui/elements/ButtonGroupElement.d.ts +2 -2
- package/ui/elements/ButtonGroupElement.js +25 -25
- package/ui/elements/ButtonGroupElement.js.map +1 -0
- package/ui/elements/GenericElement.js +16 -1
- package/ui/elements/GenericElement.js.map +1 -0
- package/ui/elements/LabelElement.js +19 -20
- package/ui/elements/LabelElement.js.map +1 -0
- package/ui/elements/NavigationMenuElement.d.ts +2 -1
- package/ui/elements/NavigationMenuElement.js +39 -53
- package/ui/elements/NavigationMenuElement.js.map +1 -0
- package/ui/elements/PanelElement.js +18 -13
- package/ui/elements/PanelElement.js.map +1 -0
- package/ui/elements/PlaceholderElement.d.ts +2 -1
- package/ui/elements/PlaceholderElement.js +18 -15
- package/ui/elements/PlaceholderElement.js.map +1 -0
- package/ui/elements/SmallButtonElement.d.ts +1 -1
- package/ui/elements/SmallButtonElement.js +25 -27
- package/ui/elements/SmallButtonElement.js.map +1 -0
- package/ui/elements/TypographyElement.d.ts +1 -1
- package/ui/elements/TypographyElement.js +25 -26
- package/ui/elements/TypographyElement.js.map +1 -0
- package/ui/elements/ViewElement.js +16 -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 +32 -32
- 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 +47 -39
- package/ui/elements/form/DynamicFieldsetElement.js.map +1 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +20 -18
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js.map +1 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +33 -32
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js.map +1 -0
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +53 -44
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js.map +1 -0
- package/ui/elements/form/FileManagerElement/styled.d.ts +26 -13
- package/ui/elements/form/FileManagerElement/styled.js +22 -13
- 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 +25 -28
- package/ui/elements/form/FileManagerElement.js.map +1 -0
- package/ui/elements/form/FormElement.d.ts +5 -5
- package/ui/elements/form/FormElement.js +27 -27
- package/ui/elements/form/FormElement.js.map +1 -0
- package/ui/elements/form/FormFieldElement.d.ts +9 -8
- package/ui/elements/form/FormFieldElement.js +39 -49
- package/ui/elements/form/FormFieldElement.js.map +1 -0
- package/ui/elements/form/HiddenElement.js +21 -23
- package/ui/elements/form/HiddenElement.js.map +1 -0
- package/ui/elements/form/InputElement.d.ts +1 -0
- package/ui/elements/form/InputElement.js +24 -25
- package/ui/elements/form/InputElement.js.map +1 -0
- package/ui/elements/form/PasswordElement.js +22 -21
- package/ui/elements/form/PasswordElement.js.map +1 -0
- package/ui/elements/form/SelectElement.d.ts +1 -1
- package/ui/elements/form/SelectElement.js +25 -27
- package/ui/elements/form/SelectElement.js.map +1 -0
- package/ui/elements/form/TextareaElement.js +23 -24
- package/ui/elements/form/TextareaElement.js.map +1 -0
- package/ui/views/AdminView/ContentElement.js +30 -38
- package/ui/views/AdminView/ContentElement.js.map +1 -0
- package/ui/views/AdminView/HeaderElement.js +51 -58
- package/ui/views/AdminView/HeaderElement.js.map +1 -0
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +2 -2
- package/ui/views/AdminView/HeaderSectionCenterElement.js +27 -27
- package/ui/views/AdminView/HeaderSectionCenterElement.js.map +1 -0
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +2 -2
- package/ui/views/AdminView/HeaderSectionLeftElement.js +27 -27
- package/ui/views/AdminView/HeaderSectionLeftElement.js.map +1 -0
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +2 -2
- package/ui/views/AdminView/HeaderSectionRightElement.js +27 -27
- package/ui/views/AdminView/HeaderSectionRightElement.js.map +1 -0
- package/ui/views/AdminView/components/Dialog.js +33 -27
- 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 +18 -12
- 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 +20 -16
- 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 +30 -31
- package/ui/views/FormView/FormContainerElement.js.map +1 -0
- package/ui/views/FormView/FormContentElement.js +18 -13
- package/ui/views/FormView/FormContentElement.js.map +1 -0
- package/ui/views/FormView/FormFooterElement.d.ts +3 -3
- package/ui/views/FormView/FormFooterElement.js +25 -25
- package/ui/views/FormView/FormFooterElement.js.map +1 -0
- package/ui/views/FormView/FormHeaderElement.d.ts +2 -2
- package/ui/views/FormView/FormHeaderElement.js +38 -38
- package/ui/views/FormView/FormHeaderElement.js.map +1 -0
- package/ui/views/FormView.d.ts +1 -1
- package/ui/views/FormView.js +58 -51
- package/ui/views/FormView.js.map +1 -0
- package/ui/views/OverlayView/ContentElement.d.ts +2 -2
- package/ui/views/OverlayView/ContentElement.js +25 -25
- package/ui/views/OverlayView/ContentElement.js.map +1 -0
- package/ui/views/OverlayView/HeaderElement.d.ts +5 -5
- package/ui/views/OverlayView/HeaderElement.js +42 -45
- package/ui/views/OverlayView/HeaderElement.js.map +1 -0
- package/ui/views/OverlayView/HeaderTitleElement.d.ts +1 -1
- package/ui/views/OverlayView/HeaderTitleElement.js +30 -33
- package/ui/views/OverlayView/HeaderTitleElement.js.map +1 -0
- package/ui/views/OverlayView/useOverlayView.d.ts +4 -5
- package/ui/views/OverlayView/useOverlayView.js +26 -20
- package/ui/views/OverlayView/useOverlayView.js.map +1 -0
- package/ui/views/OverlayView.d.ts +4 -6
- package/ui/views/OverlayView.js +48 -59
- package/ui/views/OverlayView.js.map +1 -0
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +3 -3
- package/ui/views/SplitView/SplitViewPanelElement.js +32 -33
- package/ui/views/SplitView/SplitViewPanelElement.js.map +1 -0
- package/ui/views/SplitView.d.ts +3 -3
- package/ui/views/SplitView.js +39 -59
- package/ui/views/SplitView.js.map +1 -0
- package/assets/images/icons.png +0 -0
- package/assets/images/icons_retina.png +0 -0
- package/assets/images/swich.png +0 -0
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +0 -5
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +0 -35
- package/components/FileManager/BottomInfoBar/UploadStatus.d.ts +0 -5
- package/components/FileManager/BottomInfoBar/UploadStatus.js +0 -47
- package/components/FileManager/BottomInfoBar.d.ts +0 -3
- package/components/FileManager/BottomInfoBar.js +0 -42
- package/components/FileManager/DropFilesHere.d.ts +0 -8
- package/components/FileManager/DropFilesHere.js +0 -58
- package/components/FileManager/File.d.ts +0 -18
- package/components/FileManager/File.js +0 -129
- package/components/FileManager/FileDetails/Name.d.ts +0 -6
- package/components/FileManager/FileDetails/Name.js +0 -113
- package/components/FileManager/FileDetails/Tags.d.ts +0 -6
- package/components/FileManager/FileDetails/Tags.js +0 -241
- package/components/FileManager/FileDetails.d.ts +0 -23
- package/components/FileManager/FileDetails.js +0 -392
- package/components/FileManager/FileManagerContext.d.ts +0 -23
- package/components/FileManager/FileManagerContext.js +0 -174
- package/components/FileManager/FileManagerView.d.ts +0 -23
- package/components/FileManager/FileManagerView.js +0 -632
- package/components/FileManager/LeftSidebar.d.ts +0 -8
- package/components/FileManager/LeftSidebar.js +0 -95
- package/components/FileManager/NoPermissionView.d.ts +0 -3
- package/components/FileManager/NoPermissionView.js +0 -70
- package/components/FileManager/NoResults.d.ts +0 -2
- package/components/FileManager/NoResults.js +0 -13
- package/components/FileManager/getFileTypePlugin.d.ts +0 -1
- package/components/FileManager/getFileTypePlugin.js +0 -27
- package/components/FileManager/getFileUploader.d.ts +0 -2
- package/components/FileManager/getFileUploader.js +0 -10
- package/components/FileManager/graphql.d.ts +0 -6
- package/components/FileManager/graphql.js +0 -17
- package/components/FileManager/icons/content_copy-black-24px.svg +0 -1
- package/components/FileManager/icons/delete.svg +0 -12
- package/components/FileManager/icons/privacy_tip-24px.svg +0 -10
- package/components/FileManager/icons/round-check_box-24px.svg +0 -4
- package/components/FileManager/icons/round-check_box_outline_blank-24px.svg +0 -4
- package/components/FileManager/icons/round-cloud_download-24px.svg +0 -4
- package/components/FileManager/icons/round-cloud_upload-24px.svg +0 -4
- package/components/FileManager/icons/round-description-24px.svg +0 -4
- package/components/FileManager/icons/round-edit-24px.svg +0 -4
- package/components/FileManager/icons/round-info-24px.svg +0 -4
- package/components/FileManager/icons/round-label-24px.svg +0 -4
- package/components/FileManager/icons/round-more_vert-24px.svg +0 -4
- package/components/FileManager/icons/round-search-24px.svg +0 -20
- package/components/FileManager/outputFileSelectionError.d.ts +0 -2
- package/components/FileManager/outputFileSelectionError.js +0 -39
- package/components/FileManager.d.ts +0 -18
- package/components/FileManager.js +0 -133
- package/plugins/FileManagerFileTypePlugin.d.ts +0 -33
- package/plugins/FileManagerFileTypePlugin.js +0 -46
- package/plugins/fileManager/fileDefault.d.ts +0 -3
- package/plugins/fileManager/fileDefault.js +0 -20
- package/plugins/fileManager/fileImage/DeleteAction.d.ts +0 -3
- package/plugins/fileManager/fileImage/DeleteAction.js +0 -62
- package/plugins/fileManager/fileImage/EditAction.d.ts +0 -9
- package/plugins/fileManager/fileImage/EditAction.js +0 -143
- package/plugins/fileManager/fileImage/index.d.ts +0 -3
- package/plugins/fileManager/fileImage/index.js +0 -29
- package/plugins/fileManager/icons/edit.svg +0 -17
- package/plugins/fileManager/icons/round-description-24px.svg +0 -1
- package/plugins/fileManager/index.d.ts +0 -2
- package/plugins/fileManager/index.js +0 -3
- 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,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _ui = require("./ui");
|
|
12
|
+
var _svgs = _interopRequireDefault(require("./svgs"));
|
|
7
13
|
/**
|
|
8
14
|
* Working with Block Tunes
|
|
9
15
|
*/
|
|
@@ -16,32 +22,25 @@ var Tunes = /*#__PURE__*/function () {
|
|
|
16
22
|
*/
|
|
17
23
|
function Tunes(_ref) {
|
|
18
24
|
var api = _ref.api,
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
25
|
+
actions = _ref.actions,
|
|
26
|
+
onChange = _ref.onChange;
|
|
27
|
+
(0, _classCallCheck2.default)(this, Tunes);
|
|
28
|
+
(0, _defineProperty2.default)(this, "api", void 0);
|
|
29
|
+
(0, _defineProperty2.default)(this, "actions", void 0);
|
|
30
|
+
(0, _defineProperty2.default)(this, "onChange", void 0);
|
|
31
|
+
(0, _defineProperty2.default)(this, "buttons", void 0);
|
|
32
32
|
this.api = api;
|
|
33
33
|
this.actions = actions;
|
|
34
34
|
this.onChange = onChange;
|
|
35
35
|
this.buttons = [];
|
|
36
36
|
}
|
|
37
|
+
|
|
37
38
|
/**
|
|
38
39
|
* Available Image tunes
|
|
39
40
|
*
|
|
40
41
|
* @returns {{name: string, icon: string, title: string}[]}
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
_createClass(Tunes, [{
|
|
43
|
+
(0, _createClass2.default)(Tunes, [{
|
|
45
44
|
key: "CSS",
|
|
46
45
|
get:
|
|
47
46
|
/**
|
|
@@ -57,51 +56,47 @@ var Tunes = /*#__PURE__*/function () {
|
|
|
57
56
|
buttonActive: this.api.styles.settingsButtonActive
|
|
58
57
|
};
|
|
59
58
|
}
|
|
59
|
+
|
|
60
60
|
/**
|
|
61
61
|
* Makes buttons with tunes: stretch image
|
|
62
62
|
*
|
|
63
63
|
* @param {ImageToolData} toolData - generate Elements of tunes
|
|
64
64
|
* @returns {Element}
|
|
65
65
|
*/
|
|
66
|
-
|
|
67
66
|
}, {
|
|
68
67
|
key: "render",
|
|
69
68
|
value: function render(toolData) {
|
|
70
69
|
var _this = this;
|
|
71
|
-
|
|
72
|
-
var wrapper = make("div", this.CSS.wrapper);
|
|
70
|
+
var wrapper = (0, _ui.make)("div", this.CSS.wrapper);
|
|
73
71
|
this.buttons = [];
|
|
74
72
|
var tunes = Tunes.tunes.concat(this.actions);
|
|
75
73
|
tunes.forEach(function (tune) {
|
|
76
74
|
var title = _this.api.i18n.t(tune.title);
|
|
77
|
-
|
|
78
|
-
var el = make("div", [_this.CSS.buttonBase, _this.CSS.button], {
|
|
75
|
+
var el = (0, _ui.make)("div", [_this.CSS.buttonBase, _this.CSS.button], {
|
|
79
76
|
innerHTML: tune.icon,
|
|
80
77
|
title: title
|
|
81
78
|
});
|
|
82
79
|
el.addEventListener("click", function () {
|
|
83
80
|
_this.tuneClicked(tune.name, tune.action);
|
|
84
81
|
});
|
|
85
|
-
el.dataset
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
el.dataset["tune"] = tune.name;
|
|
83
|
+
var name = tune.name;
|
|
84
|
+
el.classList.toggle(_this.CSS.buttonActive, !!toolData[name]);
|
|
88
85
|
_this.buttons.push(el);
|
|
89
|
-
|
|
90
86
|
_this.api.tooltip.onHover(el, title, {
|
|
91
87
|
placement: "top"
|
|
92
88
|
});
|
|
93
|
-
|
|
94
89
|
wrapper.appendChild(el);
|
|
95
90
|
});
|
|
96
91
|
return wrapper;
|
|
97
92
|
}
|
|
93
|
+
|
|
98
94
|
/**
|
|
99
95
|
* Clicks to one of the tunes
|
|
100
96
|
*
|
|
101
97
|
* @param {string} tuneName - clicked tune name
|
|
102
98
|
* @param {Function} customFunction - function to execute on click
|
|
103
99
|
*/
|
|
104
|
-
|
|
105
100
|
}, {
|
|
106
101
|
key: "tuneClicked",
|
|
107
102
|
value: function tuneClicked(tuneName, customFunction) {
|
|
@@ -110,25 +105,25 @@ var Tunes = /*#__PURE__*/function () {
|
|
|
110
105
|
return false;
|
|
111
106
|
}
|
|
112
107
|
}
|
|
113
|
-
|
|
114
108
|
var button = this.buttons.find(function (el) {
|
|
115
|
-
return el.dataset
|
|
109
|
+
return el.dataset["tune"] === tuneName;
|
|
116
110
|
});
|
|
117
|
-
|
|
111
|
+
if (button) {
|
|
112
|
+
button.classList.toggle(this.CSS.buttonActive, !button.classList.contains(this.CSS.buttonActive));
|
|
113
|
+
}
|
|
118
114
|
this.onChange(tuneName);
|
|
115
|
+
return true;
|
|
119
116
|
}
|
|
120
117
|
}], [{
|
|
121
118
|
key: "tunes",
|
|
122
119
|
get: function get() {
|
|
123
120
|
return [{
|
|
124
121
|
name: "stretched",
|
|
125
|
-
icon:
|
|
122
|
+
icon: _svgs.default.stretched,
|
|
126
123
|
title: "Stretch image"
|
|
127
124
|
}];
|
|
128
125
|
}
|
|
129
126
|
}]);
|
|
130
|
-
|
|
131
127
|
return Tunes;
|
|
132
128
|
}();
|
|
133
|
-
|
|
134
|
-
export { Tunes as default };
|
|
129
|
+
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 {};
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.make = exports.default = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
6
12
|
/**
|
|
7
13
|
* Class for working with UI:
|
|
8
14
|
* - rendering base structure
|
|
@@ -11,30 +17,23 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
11
17
|
*/
|
|
12
18
|
var Ui = /*#__PURE__*/function () {
|
|
13
19
|
/**
|
|
14
|
-
* @param
|
|
15
|
-
* @param
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @param
|
|
20
|
+
* @param ui - image tool Ui module
|
|
21
|
+
* @param ui.api - Editor.js API
|
|
22
|
+
* @param ui.config - user config
|
|
23
|
+
* @param ui.onSelectFile - callback for clicks on Select file button
|
|
24
|
+
* @param ui.readOnly - read-only mode flag
|
|
19
25
|
*/
|
|
20
26
|
function Ui(_ref) {
|
|
21
27
|
var api = _ref.api,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
_defineProperty(this, "readOnly", void 0);
|
|
33
|
-
|
|
34
|
-
_defineProperty(this, "onSelectFile", void 0);
|
|
35
|
-
|
|
36
|
-
_defineProperty(this, "nodes", void 0);
|
|
37
|
-
|
|
28
|
+
config = _ref.config,
|
|
29
|
+
onSelectFile = _ref.onSelectFile,
|
|
30
|
+
readOnly = _ref.readOnly;
|
|
31
|
+
(0, _classCallCheck2.default)(this, Ui);
|
|
32
|
+
(0, _defineProperty2.default)(this, "api", void 0);
|
|
33
|
+
(0, _defineProperty2.default)(this, "config", void 0);
|
|
34
|
+
(0, _defineProperty2.default)(this, "readOnly", void 0);
|
|
35
|
+
(0, _defineProperty2.default)(this, "onSelectFile", void 0);
|
|
36
|
+
(0, _defineProperty2.default)(this, "nodes", void 0);
|
|
38
37
|
this.api = api;
|
|
39
38
|
this.config = config;
|
|
40
39
|
this.onSelectFile = onSelectFile;
|
|
@@ -48,6 +47,7 @@ var Ui = /*#__PURE__*/function () {
|
|
|
48
47
|
contentEditable: !this.readOnly
|
|
49
48
|
})
|
|
50
49
|
};
|
|
50
|
+
|
|
51
51
|
/**
|
|
52
52
|
* Create base structure
|
|
53
53
|
* <wrapper>
|
|
@@ -55,27 +55,24 @@ var Ui = /*#__PURE__*/function () {
|
|
|
55
55
|
* <caption />
|
|
56
56
|
* </wrapper>
|
|
57
57
|
*/
|
|
58
|
-
|
|
59
|
-
this.nodes.caption.dataset.placeholder = this.config.captionPlaceholder;
|
|
58
|
+
this.nodes.caption.dataset["placeholder"] = this.config.captionPlaceholder;
|
|
60
59
|
this.nodes.wrapper.appendChild(this.nodes.imageContainer);
|
|
61
60
|
this.nodes.wrapper.appendChild(this.nodes.caption);
|
|
62
61
|
this.nodes.wrapper.appendChild(this.nodes.fileButton);
|
|
63
62
|
}
|
|
63
|
+
|
|
64
64
|
/**
|
|
65
65
|
* CSS classes
|
|
66
66
|
*
|
|
67
67
|
* @returns {object}
|
|
68
68
|
*/
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
_createClass(Ui, [{
|
|
69
|
+
(0, _createClass2.default)(Ui, [{
|
|
72
70
|
key: "CSS",
|
|
73
71
|
get: function get() {
|
|
74
72
|
return {
|
|
75
73
|
baseClass: this.api.styles.block,
|
|
76
74
|
input: this.api.styles.input,
|
|
77
75
|
button: this.api.styles.button,
|
|
78
|
-
|
|
79
76
|
/**
|
|
80
77
|
* Tool's classes
|
|
81
78
|
*/
|
|
@@ -85,6 +82,7 @@ var Ui = /*#__PURE__*/function () {
|
|
|
85
82
|
caption: "image-tool__caption"
|
|
86
83
|
};
|
|
87
84
|
}
|
|
85
|
+
|
|
88
86
|
/**
|
|
89
87
|
* Ui statuses:
|
|
90
88
|
* - empty
|
|
@@ -92,7 +90,6 @@ var Ui = /*#__PURE__*/function () {
|
|
|
92
90
|
*
|
|
93
91
|
* @returns {{EMPTY: string, UPLOADING: string, FILLED: string}}
|
|
94
92
|
*/
|
|
95
|
-
|
|
96
93
|
}, {
|
|
97
94
|
key: "render",
|
|
98
95
|
value:
|
|
@@ -106,20 +103,18 @@ var Ui = /*#__PURE__*/function () {
|
|
|
106
103
|
if (!toolData.file || Object.keys(toolData.file).length === 0) {
|
|
107
104
|
this.toggleStatus(Ui.status.EMPTY);
|
|
108
105
|
}
|
|
109
|
-
|
|
110
106
|
return this.nodes.wrapper;
|
|
111
107
|
}
|
|
108
|
+
|
|
112
109
|
/**
|
|
113
110
|
* Creates upload-file button
|
|
114
111
|
*
|
|
115
112
|
* @returns {Element}
|
|
116
113
|
*/
|
|
117
|
-
|
|
118
114
|
}, {
|
|
119
115
|
key: "createFileButton",
|
|
120
116
|
value: function createFileButton() {
|
|
121
117
|
var _this = this;
|
|
122
|
-
|
|
123
118
|
var button = make("div", [this.CSS.button]);
|
|
124
119
|
button.innerHTML = this.api.i18n.t("Select an Image");
|
|
125
120
|
button.addEventListener("click", function () {
|
|
@@ -127,18 +122,17 @@ var Ui = /*#__PURE__*/function () {
|
|
|
127
122
|
});
|
|
128
123
|
return button;
|
|
129
124
|
}
|
|
125
|
+
|
|
130
126
|
/**
|
|
131
127
|
* Shows an image
|
|
132
128
|
*
|
|
133
129
|
* @param {string} url - image source
|
|
134
130
|
* @returns {void}
|
|
135
131
|
*/
|
|
136
|
-
|
|
137
132
|
}, {
|
|
138
133
|
key: "fillImage",
|
|
139
134
|
value: function fillImage(url) {
|
|
140
135
|
var _this2 = this;
|
|
141
|
-
|
|
142
136
|
/**
|
|
143
137
|
* Check for a source extension to compose element correctly: video tag for mp4, img — for others
|
|
144
138
|
*/
|
|
@@ -146,6 +140,7 @@ var Ui = /*#__PURE__*/function () {
|
|
|
146
140
|
var attributes = {
|
|
147
141
|
src: url
|
|
148
142
|
};
|
|
143
|
+
|
|
149
144
|
/**
|
|
150
145
|
* We use eventName variable because IMG and VIDEO tags have different event to be called on source load
|
|
151
146
|
* - IMG: load
|
|
@@ -153,12 +148,11 @@ var Ui = /*#__PURE__*/function () {
|
|
|
153
148
|
*
|
|
154
149
|
* @type {string}
|
|
155
150
|
*/
|
|
156
|
-
|
|
157
151
|
var eventName = "load";
|
|
152
|
+
|
|
158
153
|
/**
|
|
159
154
|
* Update attributes and eventName if source is a mp4 video
|
|
160
155
|
*/
|
|
161
|
-
|
|
162
156
|
if (tag === "VIDEO") {
|
|
163
157
|
/**
|
|
164
158
|
* Add attributes for playing muted mp4 as a gif
|
|
@@ -169,61 +163,64 @@ var Ui = /*#__PURE__*/function () {
|
|
|
169
163
|
attributes.loop = true;
|
|
170
164
|
attributes.muted = true;
|
|
171
165
|
attributes.playsinline = true;
|
|
166
|
+
|
|
172
167
|
/**
|
|
173
168
|
* Change event to be listened
|
|
174
169
|
*
|
|
175
170
|
* @type {string}
|
|
176
171
|
*/
|
|
177
|
-
|
|
178
172
|
eventName = "loadeddata";
|
|
179
173
|
}
|
|
174
|
+
|
|
180
175
|
/**
|
|
181
176
|
* Compose tag with defined attributes
|
|
182
177
|
*
|
|
183
178
|
* @type {Element}
|
|
184
179
|
*/
|
|
185
|
-
|
|
186
|
-
|
|
187
180
|
this.nodes.imageEl = make(tag, this.CSS.imageEl, attributes);
|
|
181
|
+
|
|
188
182
|
/**
|
|
189
183
|
* Add load event listener
|
|
190
184
|
*/
|
|
191
|
-
|
|
192
185
|
this.nodes.imageEl.addEventListener(eventName, function () {
|
|
193
186
|
_this2.toggleStatus(Ui.status.FILLED);
|
|
194
187
|
});
|
|
195
188
|
this.nodes.imageContainer.appendChild(this.nodes.imageEl);
|
|
196
189
|
}
|
|
190
|
+
|
|
197
191
|
/**
|
|
198
192
|
* Shows caption input
|
|
199
193
|
*
|
|
200
194
|
* @param {string} text - caption text
|
|
201
195
|
* @returns {void}
|
|
202
196
|
*/
|
|
203
|
-
|
|
204
197
|
}, {
|
|
205
198
|
key: "fillCaption",
|
|
206
199
|
value: function fillCaption(text) {
|
|
207
|
-
if (this.nodes.caption) {
|
|
208
|
-
|
|
200
|
+
if (!this.nodes.caption) {
|
|
201
|
+
return;
|
|
209
202
|
}
|
|
203
|
+
this.nodes.caption.innerHTML = text;
|
|
210
204
|
}
|
|
205
|
+
|
|
211
206
|
/**
|
|
212
207
|
* Changes UI status
|
|
213
208
|
*
|
|
214
209
|
* @param {string} status - see {@link Ui.status} constants
|
|
215
210
|
* @returns {void}
|
|
216
211
|
*/
|
|
217
|
-
|
|
218
212
|
}, {
|
|
219
213
|
key: "toggleStatus",
|
|
220
214
|
value: function toggleStatus(status) {
|
|
221
215
|
for (var statusType in Ui.status) {
|
|
222
|
-
if (Object.prototype.hasOwnProperty.call(Ui.status, statusType)) {
|
|
223
|
-
|
|
216
|
+
if (Object.prototype.hasOwnProperty.call(Ui.status, statusType) === false) {
|
|
217
|
+
continue;
|
|
224
218
|
}
|
|
219
|
+
var newStatus = Ui.status[statusType];
|
|
220
|
+
this.nodes.wrapper.classList.toggle("".concat(this.CSS.wrapper, "--").concat(newStatus), status === newStatus);
|
|
225
221
|
}
|
|
226
222
|
}
|
|
223
|
+
|
|
227
224
|
/**
|
|
228
225
|
* Apply visual representation of activated tune
|
|
229
226
|
*
|
|
@@ -231,7 +228,6 @@ var Ui = /*#__PURE__*/function () {
|
|
|
231
228
|
* @param {boolean} status - true for enable, false for disable
|
|
232
229
|
* @returns {void}
|
|
233
230
|
*/
|
|
234
|
-
|
|
235
231
|
}, {
|
|
236
232
|
key: "applyTune",
|
|
237
233
|
value: function applyTune(tuneName, status) {
|
|
@@ -246,7 +242,6 @@ var Ui = /*#__PURE__*/function () {
|
|
|
246
242
|
};
|
|
247
243
|
}
|
|
248
244
|
}]);
|
|
249
|
-
|
|
250
245
|
return Ui;
|
|
251
246
|
}();
|
|
252
247
|
/**
|
|
@@ -255,27 +250,29 @@ var Ui = /*#__PURE__*/function () {
|
|
|
255
250
|
* @param {string} tagName - new Element tag name
|
|
256
251
|
* @param {Array|string} classNames - list or name of CSS class
|
|
257
252
|
* @param {object} attributes - any attributes
|
|
258
|
-
* @returns {
|
|
253
|
+
* @returns {HTMLElement}
|
|
259
254
|
*/
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
export { Ui as default };
|
|
263
|
-
export var make = function make(tagName) {
|
|
255
|
+
exports.default = Ui;
|
|
256
|
+
var make = function make(tagName) {
|
|
264
257
|
var classNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
265
|
-
var attributes = arguments.length > 2
|
|
258
|
+
var attributes = arguments.length > 2 ? arguments[2] : undefined;
|
|
266
259
|
var el = document.createElement(tagName);
|
|
267
|
-
|
|
268
260
|
if (Array.isArray(classNames)) {
|
|
269
261
|
var _el$classList;
|
|
270
|
-
|
|
271
|
-
(_el$classList = el.classList).add.apply(_el$classList, _toConsumableArray(classNames));
|
|
262
|
+
(_el$classList = el.classList).add.apply(_el$classList, (0, _toConsumableArray2.default)(classNames));
|
|
272
263
|
} else if (classNames) {
|
|
273
264
|
el.classList.add(classNames);
|
|
274
265
|
}
|
|
275
|
-
|
|
266
|
+
if (!attributes) {
|
|
267
|
+
return el;
|
|
268
|
+
}
|
|
276
269
|
for (var attrName in attributes) {
|
|
270
|
+
/**
|
|
271
|
+
* Unfortunately it is a problem to map attributes to element because element is complaining
|
|
272
|
+
* that attrName is a string, which cannot index the HTMLElement
|
|
273
|
+
*/
|
|
277
274
|
el[attrName] = attributes[attrName];
|
|
278
275
|
}
|
|
279
|
-
|
|
280
276
|
return el;
|
|
281
|
-
};
|
|
277
|
+
};
|
|
278
|
+
exports.make = make;
|