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