@webiny/app-admin 0.0.0-mt-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/components/AdminLayout.d.ts +7 -0
- package/components/AdminLayout.js +35 -0
- package/components/AppInstaller/Sidebar.d.ts +7 -0
- package/components/AppInstaller/Sidebar.js +158 -0
- package/components/AppInstaller/assets/sign-in-divider.svg +19 -0
- package/components/AppInstaller/index.d.ts +5 -0
- package/components/AppInstaller/index.js +134 -0
- package/components/AppInstaller/styled.d.ts +7 -0
- package/components/AppInstaller/styled.js +73 -0
- package/components/AppInstaller/useInstaller.d.ts +11 -0
- package/components/AppInstaller/useInstaller.js +279 -0
- package/components/EmptyView.d.ts +8 -0
- package/components/EmptyView.js +56 -0
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.d.ts +5 -0
- package/components/FileManager/BottomInfoBar/SupportedFileTypes.js +35 -0
- package/components/FileManager/BottomInfoBar/UploadStatus.d.ts +5 -0
- package/components/FileManager/BottomInfoBar/UploadStatus.js +47 -0
- package/components/FileManager/BottomInfoBar.d.ts +3 -0
- package/components/FileManager/BottomInfoBar.js +42 -0
- package/components/FileManager/DropFilesHere.d.ts +8 -0
- package/components/FileManager/DropFilesHere.js +58 -0
- package/components/FileManager/File.d.ts +18 -0
- package/components/FileManager/File.js +129 -0
- package/components/FileManager/FileDetails/Name.d.ts +6 -0
- package/components/FileManager/FileDetails/Name.js +113 -0
- package/components/FileManager/FileDetails/Tags.d.ts +6 -0
- package/components/FileManager/FileDetails/Tags.js +241 -0
- package/components/FileManager/FileDetails.d.ts +23 -0
- package/components/FileManager/FileDetails.js +392 -0
- package/components/FileManager/FileManagerContext.d.ts +23 -0
- package/components/FileManager/FileManagerContext.js +174 -0
- package/components/FileManager/FileManagerView.d.ts +23 -0
- package/components/FileManager/FileManagerView.js +632 -0
- package/components/FileManager/LeftSidebar.d.ts +8 -0
- package/components/FileManager/LeftSidebar.js +95 -0
- package/components/FileManager/NoPermissionView.d.ts +3 -0
- package/components/FileManager/NoPermissionView.js +70 -0
- package/components/FileManager/NoResults.d.ts +2 -0
- package/components/FileManager/NoResults.js +13 -0
- package/components/FileManager/getFileTypePlugin.d.ts +1 -0
- package/components/FileManager/getFileTypePlugin.js +27 -0
- package/components/FileManager/getFileUploader.d.ts +2 -0
- package/components/FileManager/getFileUploader.js +10 -0
- package/components/FileManager/graphql.d.ts +6 -0
- package/components/FileManager/graphql.js +17 -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 +2 -0
- package/components/FileManager/outputFileSelectionError.js +39 -0
- package/components/FileManager.d.ts +18 -0
- package/components/FileManager.js +133 -0
- package/components/FloatingActionButton.d.ts +3 -0
- package/components/FloatingActionButton.js +17 -0
- package/components/MultiImageUpload.d.ts +4 -0
- package/components/MultiImageUpload.js +20 -0
- package/components/OverlayLayout/OverlayLayout.d.ts +25 -0
- package/components/OverlayLayout/OverlayLayout.js +159 -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 +1 -0
- package/components/Permissions/Permissions.d.ts +7 -0
- package/components/Permissions/Permissions.js +37 -0
- package/components/Permissions/StyledComponents.d.ts +6 -0
- package/components/Permissions/StyledComponents.js +19 -0
- package/components/Permissions/index.d.ts +2 -0
- package/components/Permissions/index.js +2 -0
- package/components/RichTextEditor/RichTextEditor.d.ts +3 -0
- package/components/RichTextEditor/RichTextEditor.js +15 -0
- package/components/RichTextEditor/index.d.ts +2 -0
- package/components/RichTextEditor/index.js +2 -0
- package/components/RichTextEditor/styles.scss +64 -0
- package/components/RichTextEditor/tools/header/index.d.ts +228 -0
- package/components/RichTextEditor/tools/header/index.js +731 -0
- package/components/RichTextEditor/tools/header/styles.scss +48 -0
- package/components/RichTextEditor/tools/image/index.d.ts +97 -0
- package/components/RichTextEditor/tools/image/index.js +257 -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 +5 -0
- package/components/RichTextEditor/tools/image/tunes.d.ts +58 -0
- package/components/RichTextEditor/tools/image/tunes.js +134 -0
- package/components/RichTextEditor/tools/image/ui.d.ts +111 -0
- package/components/RichTextEditor/tools/image/ui.js +281 -0
- package/components/RichTextEditor/tools/paragraph/index.d.ts +211 -0
- package/components/RichTextEditor/tools/paragraph/index.js +520 -0
- package/components/RichTextEditor/tools/paragraph/styles.scss +29 -0
- package/components/RichTextEditor/tools/textColor/index.d.ts +58 -0
- package/components/RichTextEditor/tools/textColor/index.js +232 -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 +24 -0
- package/components/SearchUI.d.ts +8 -0
- package/components/SearchUI.js +59 -0
- package/components/SimpleForm/SimpleForm.d.ts +21 -0
- package/components/SimpleForm/SimpleForm.js +75 -0
- package/components/SimpleForm/index.d.ts +1 -0
- package/components/SimpleForm/index.js +1 -0
- package/components/SimpleUI/InputField.d.ts +9 -0
- package/components/SimpleUI/InputField.js +97 -0
- package/components/SingleImageUpload.d.ts +25 -0
- package/components/SingleImageUpload.js +102 -0
- package/components/SplitView/SplitView.d.ts +10 -0
- package/components/SplitView/SplitView.js +76 -0
- package/components/SplitView/index.d.ts +1 -0
- package/components/SplitView/index.js +1 -0
- package/components/index.d.ts +1 -0
- package/components/index.js +1 -0
- package/hooks/useConfirmationDialog.d.ts +10 -0
- package/hooks/useConfirmationDialog.js +47 -0
- package/hooks/useDialog.d.ts +5 -0
- package/hooks/useDialog.js +27 -0
- package/hooks/useSnackbar.d.ts +4 -0
- package/hooks/useSnackbar.js +25 -0
- package/package.json +101 -0
- package/plugins/FileManagerFileTypePlugin.d.ts +33 -0
- package/plugins/FileManagerFileTypePlugin.js +46 -0
- package/plugins/MenuPlugin.d.ts +20 -0
- package/plugins/MenuPlugin.js +41 -0
- package/plugins/PermissionRendererPlugin.d.ts +22 -0
- package/plugins/PermissionRendererPlugin.js +41 -0
- package/plugins/fileManager/fileDefault.d.ts +3 -0
- package/plugins/fileManager/fileDefault.js +20 -0
- package/plugins/fileManager/fileImage/DeleteAction.d.ts +3 -0
- package/plugins/fileManager/fileImage/DeleteAction.js +62 -0
- package/plugins/fileManager/fileImage/EditAction.d.ts +9 -0
- package/plugins/fileManager/fileImage/EditAction.js +143 -0
- package/plugins/fileManager/fileImage/index.d.ts +3 -0
- package/plugins/fileManager/fileImage/index.js +29 -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 +3 -0
- package/plugins/globalSearch/SearchBar.d.ts +3 -0
- package/plugins/globalSearch/SearchBar.js +241 -0
- package/plugins/globalSearch/SearchBarDropdown.d.ts +5 -0
- package/plugins/globalSearch/SearchBarDropdown.js +82 -0
- package/plugins/globalSearch/icons/round-search-24px.svg +20 -0
- package/plugins/globalSearch/index.d.ts +8 -0
- package/plugins/globalSearch/index.js +30 -0
- package/plugins/globalSearch/styled.d.ts +9 -0
- package/plugins/globalSearch/styled.js +115 -0
- package/plugins/index.d.ts +6 -0
- package/plugins/index.js +8 -0
- package/plugins/logo/Logo.d.ts +22 -0
- package/plugins/logo/Logo.js +108 -0
- package/plugins/logo/index.d.ts +5 -0
- package/plugins/logo/index.js +32 -0
- package/plugins/menu/documentation.d.ts +4 -0
- package/plugins/menu/documentation.js +16 -0
- package/plugins/menu/fileManager.d.ts +4 -0
- package/plugins/menu/fileManager.js +64 -0
- package/plugins/menu/index.d.ts +6 -0
- package/plugins/menu/index.js +24 -0
- package/plugins/menu/renderers/MenuGroupRenderer.d.ts +7 -0
- package/plugins/menu/renderers/MenuGroupRenderer.js +126 -0
- package/plugins/menu/renderers/MenuLinkRenderer.d.ts +7 -0
- package/plugins/menu/renderers/MenuLinkRenderer.js +52 -0
- package/plugins/menu/renderers/MenuSectionItemRenderer.d.ts +7 -0
- package/plugins/menu/renderers/MenuSectionItemRenderer.js +77 -0
- package/plugins/menu/renderers/MenuSectionRenderer.d.ts +7 -0
- package/plugins/menu/renderers/MenuSectionRenderer.js +51 -0
- package/plugins/menu/slack.d.ts +4 -0
- package/plugins/menu/slack.js +16 -0
- package/plugins/menu/source.d.ts +4 -0
- package/plugins/menu/source.js +16 -0
- package/plugins/uiLayoutRenderer/index.d.ts +3 -0
- package/plugins/uiLayoutRenderer/index.js +63 -0
- package/plugins/userMenu/UserMenuElement.d.ts +7 -0
- package/plugins/userMenu/UserMenuElement.js +43 -0
- package/plugins/userMenu/UserMenuRenderer.d.ts +6 -0
- package/plugins/userMenu/UserMenuRenderer.js +47 -0
- package/plugins/userMenu/index.d.ts +4 -0
- package/plugins/userMenu/index.js +16 -0
- package/styles/material-theme-assignments.scss +333 -0
- package/styles/material.scss +74 -0
- package/styles/theme.scss +43 -0
- package/styles.scss +2 -0
- package/types.d.ts +100 -0
- package/types.js +1 -0
- package/ui/UIElement.d.ts +2 -0
- package/ui/UIElement.js +1 -0
- package/ui/UILayout.d.ts +1 -0
- package/ui/UILayout.js +1 -0
- package/ui/UIRenderer.d.ts +2 -0
- package/ui/UIRenderer.js +1 -0
- package/ui/UIView.d.ts +2 -0
- package/ui/UIView.js +1 -0
- package/ui/elements/AccordionElement.d.ts +27 -0
- package/ui/elements/AccordionElement.js +86 -0
- package/ui/elements/ButtonElement.d.ts +24 -0
- package/ui/elements/ButtonElement.js +78 -0
- package/ui/elements/ButtonGroupElement.d.ts +6 -0
- package/ui/elements/ButtonGroupElement.js +48 -0
- package/ui/elements/GenericElement.d.ts +1 -0
- package/ui/elements/GenericElement.js +1 -0
- package/ui/elements/LabelElement.d.ts +16 -0
- package/ui/elements/LabelElement.js +47 -0
- package/ui/elements/NavigationMenuElement.d.ts +32 -0
- package/ui/elements/NavigationMenuElement.js +158 -0
- package/ui/elements/PanelElement.d.ts +3 -0
- package/ui/elements/PanelElement.js +17 -0
- package/ui/elements/PlaceholderElement.d.ts +5 -0
- package/ui/elements/PlaceholderElement.js +30 -0
- package/ui/elements/SmallButtonElement.d.ts +6 -0
- package/ui/elements/SmallButtonElement.js +47 -0
- package/ui/elements/TypographyElement.d.ts +13 -0
- package/ui/elements/TypographyElement.js +49 -0
- package/ui/elements/ViewElement.d.ts +1 -0
- package/ui/elements/ViewElement.js +1 -0
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.d.ts +6 -0
- package/ui/elements/form/DynamicFieldsetElement/DynamicFieldsetRowElement.js +44 -0
- package/ui/elements/form/DynamicFieldsetElement.d.ts +42 -0
- package/ui/elements/form/DynamicFieldsetElement.js +127 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElement.d.ts +4 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElement.js +24 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.d.ts +7 -0
- package/ui/elements/form/FileManagerElement/EmptyStateElementRenderer.js +72 -0
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.d.ts +13 -0
- package/ui/elements/form/FileManagerElement/FileManagerElementRenderer.js +95 -0
- package/ui/elements/form/FileManagerElement/styled.d.ts +14 -0
- package/ui/elements/form/FileManagerElement/styled.js +106 -0
- package/ui/elements/form/FileManagerElement.d.ts +24 -0
- package/ui/elements/form/FileManagerElement.js +91 -0
- package/ui/elements/form/FormElement.d.ts +21 -0
- package/ui/elements/form/FormElement.js +45 -0
- package/ui/elements/form/FormFieldElement.d.ts +55 -0
- package/ui/elements/form/FormFieldElement.js +183 -0
- package/ui/elements/form/HiddenElement.d.ts +6 -0
- package/ui/elements/form/HiddenElement.js +49 -0
- package/ui/elements/form/InputElement.d.ts +6 -0
- package/ui/elements/form/InputElement.js +55 -0
- package/ui/elements/form/PasswordElement.d.ts +6 -0
- package/ui/elements/form/PasswordElement.js +50 -0
- package/ui/elements/form/README.md +2 -0
- package/ui/elements/form/SelectElement.d.ts +15 -0
- package/ui/elements/form/SelectElement.js +71 -0
- package/ui/elements/form/TextareaElement.d.ts +15 -0
- package/ui/elements/form/TextareaElement.js +56 -0
- package/ui/views/AdminView/ContentElement.d.ts +4 -0
- package/ui/views/AdminView/ContentElement.js +62 -0
- package/ui/views/AdminView/HeaderElement.d.ts +13 -0
- package/ui/views/AdminView/HeaderElement.js +111 -0
- package/ui/views/AdminView/HeaderSectionCenterElement.d.ts +6 -0
- package/ui/views/AdminView/HeaderSectionCenterElement.js +42 -0
- package/ui/views/AdminView/HeaderSectionLeftElement.d.ts +6 -0
- package/ui/views/AdminView/HeaderSectionLeftElement.js +42 -0
- package/ui/views/AdminView/HeaderSectionRightElement.d.ts +6 -0
- package/ui/views/AdminView/HeaderSectionRightElement.js +42 -0
- package/ui/views/AdminView/components/Dialog.d.ts +2 -0
- package/ui/views/AdminView/components/Dialog.js +40 -0
- package/ui/views/AdminView/components/Hamburger.d.ts +3 -0
- package/ui/views/AdminView/components/Hamburger.js +25 -0
- package/ui/views/AdminView/components/Snackbar.d.ts +3 -0
- package/ui/views/AdminView/components/Snackbar.js +28 -0
- package/ui/views/AdminView.d.ts +12 -0
- package/ui/views/AdminView.js +90 -0
- package/ui/views/FormView/FormContainerElement.d.ts +12 -0
- package/ui/views/FormView/FormContainerElement.js +51 -0
- package/ui/views/FormView/FormContentElement.d.ts +3 -0
- package/ui/views/FormView/FormContentElement.js +17 -0
- package/ui/views/FormView/FormFooterElement.d.ts +6 -0
- package/ui/views/FormView/FormFooterElement.js +49 -0
- package/ui/views/FormView/FormHeaderElement.d.ts +14 -0
- package/ui/views/FormView/FormHeaderElement.js +81 -0
- package/ui/views/FormView.d.ts +40 -0
- package/ui/views/FormView.js +160 -0
- package/ui/views/NavigationView/ContentElement.d.ts +10 -0
- package/ui/views/NavigationView/ContentElement.js +86 -0
- package/ui/views/NavigationView/FooterElement.d.ts +13 -0
- package/ui/views/NavigationView/FooterElement.js +57 -0
- package/ui/views/NavigationView/HeaderElement.d.ts +16 -0
- package/ui/views/NavigationView/HeaderElement.js +66 -0
- package/ui/views/NavigationView/NavigationViewRenderer.d.ts +6 -0
- package/ui/views/NavigationView/NavigationViewRenderer.js +38 -0
- package/ui/views/NavigationView/Styled.d.ts +7 -0
- package/ui/views/NavigationView/Styled.js +47 -0
- package/ui/views/NavigationView/legacyMenu.d.ts +22 -0
- package/ui/views/NavigationView/legacyMenu.js +1 -0
- package/ui/views/NavigationView/useNavigation.d.ts +6 -0
- package/ui/views/NavigationView/useNavigation.js +22 -0
- package/ui/views/NavigationView.d.ts +26 -0
- package/ui/views/NavigationView.js +204 -0
- package/ui/views/OverlayView/ContentElement.d.ts +6 -0
- package/ui/views/OverlayView/ContentElement.js +42 -0
- package/ui/views/OverlayView/HeaderElement.d.ts +24 -0
- package/ui/views/OverlayView/HeaderElement.js +115 -0
- package/ui/views/OverlayView/HeaderTitleElement.d.ts +13 -0
- package/ui/views/OverlayView/HeaderTitleElement.js +54 -0
- package/ui/views/OverlayView/useOverlayView.d.ts +6 -0
- package/ui/views/OverlayView/useOverlayView.js +38 -0
- package/ui/views/OverlayView.d.ts +31 -0
- package/ui/views/OverlayView.js +176 -0
- package/ui/views/SplitView/SplitViewPanelElement.d.ts +11 -0
- package/ui/views/SplitView/SplitViewPanelElement.js +72 -0
- package/ui/views/SplitView.d.ts +21 -0
- package/ui/views/SplitView.js +142 -0
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
+
import { ALIGNMENTS, TextAlign, ALIGNMENT_ICONS } from "../utils";
|
|
7
|
+
/**
|
|
8
|
+
* @typedef {object} ParagraphConfig
|
|
9
|
+
* @property {string} placeholder - placeholder for the empty paragraph
|
|
10
|
+
* @property {boolean} preserveBlank - Whether or not to keep blank paragraphs when saving editor data`
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
var Paragraph = /*#__PURE__*/function () {
|
|
14
|
+
/**
|
|
15
|
+
* Render plugin`s main Element and fill it with saved data
|
|
16
|
+
*
|
|
17
|
+
* @param {object} params - constructor params
|
|
18
|
+
* @param {ParagraphData} params.data - previously saved data
|
|
19
|
+
* @param {ParagraphConfig} params.config - user config for Tool
|
|
20
|
+
* @param {object} params.api - editor.js api
|
|
21
|
+
* @param {boolean} readOnly - read only mode flag
|
|
22
|
+
*/
|
|
23
|
+
function Paragraph(_ref) {
|
|
24
|
+
var data = _ref.data,
|
|
25
|
+
config = _ref.config,
|
|
26
|
+
api = _ref.api,
|
|
27
|
+
readOnly = _ref.readOnly;
|
|
28
|
+
|
|
29
|
+
_classCallCheck(this, Paragraph);
|
|
30
|
+
|
|
31
|
+
_defineProperty(this, "api", void 0);
|
|
32
|
+
|
|
33
|
+
_defineProperty(this, "readOnly", void 0);
|
|
34
|
+
|
|
35
|
+
_defineProperty(this, "_CSS", void 0);
|
|
36
|
+
|
|
37
|
+
_defineProperty(this, "_settings", void 0);
|
|
38
|
+
|
|
39
|
+
_defineProperty(this, "_data", void 0);
|
|
40
|
+
|
|
41
|
+
_defineProperty(this, "_element", void 0);
|
|
42
|
+
|
|
43
|
+
_defineProperty(this, "_placeholder", void 0);
|
|
44
|
+
|
|
45
|
+
_defineProperty(this, "_preserveBlank", void 0);
|
|
46
|
+
|
|
47
|
+
_defineProperty(this, "alignments", void 0);
|
|
48
|
+
|
|
49
|
+
_defineProperty(this, "settingsButtons", void 0);
|
|
50
|
+
|
|
51
|
+
_defineProperty(this, "typography", void 0);
|
|
52
|
+
|
|
53
|
+
this.api = api;
|
|
54
|
+
this.readOnly = readOnly;
|
|
55
|
+
this.typography = config.typography || null;
|
|
56
|
+
this._CSS = {
|
|
57
|
+
block: this.api.styles.block,
|
|
58
|
+
settingsButton: this.api.styles.settingsButton,
|
|
59
|
+
settingsButtonActive: this.api.styles.settingsButtonActive,
|
|
60
|
+
wrapper: "ce-paragraph"
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
if (!this.readOnly) {
|
|
64
|
+
this.onKeyUp = this.onKeyUp.bind(this);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Placeholder for paragraph if it is first Block
|
|
68
|
+
* @type {string}
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
this._placeholder = config.placeholder ? config.placeholder : Paragraph.DEFAULT_PLACEHOLDER;
|
|
73
|
+
this._data = this.normalizeData(data);
|
|
74
|
+
this._element = this.drawView();
|
|
75
|
+
this._preserveBlank = config.preserveBlank !== undefined ? config.preserveBlank : false;
|
|
76
|
+
this.settingsButtons = [];
|
|
77
|
+
this.alignments = ALIGNMENTS;
|
|
78
|
+
this.data = this.normalizeData(data);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Default placeholder for Paragraph Tool
|
|
82
|
+
*
|
|
83
|
+
* @return {string}
|
|
84
|
+
* @constructor
|
|
85
|
+
*/
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
_createClass(Paragraph, [{
|
|
89
|
+
key: "data",
|
|
90
|
+
get:
|
|
91
|
+
/**
|
|
92
|
+
* Get current Tools`s data
|
|
93
|
+
* @returns {ParagraphData} Current data
|
|
94
|
+
* @private
|
|
95
|
+
*/
|
|
96
|
+
function get() {
|
|
97
|
+
var text = this._element.innerHTML; // this._data.text = text;
|
|
98
|
+
|
|
99
|
+
return _objectSpread(_objectSpread({}, this._data), {}, {
|
|
100
|
+
text: text
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Store data in plugin:
|
|
105
|
+
* - at the this._data property
|
|
106
|
+
* - at the HTML
|
|
107
|
+
*
|
|
108
|
+
* @param {ParagraphData} data — data to set
|
|
109
|
+
* @private
|
|
110
|
+
*/
|
|
111
|
+
,
|
|
112
|
+
set: function set(data) {
|
|
113
|
+
var _this = this;
|
|
114
|
+
|
|
115
|
+
this._data = data || {};
|
|
116
|
+
this._element.innerHTML = this._data.text || "";
|
|
117
|
+
/**
|
|
118
|
+
* Add Alignment class
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
this.alignments.forEach(function (alignment) {
|
|
122
|
+
if (alignment.name === _this._data.textAlign) {
|
|
123
|
+
_this._element.classList.add("ce-header-text--".concat(alignment.name));
|
|
124
|
+
} else {
|
|
125
|
+
_this._element.classList.remove("ce-header-text--".concat(alignment.name));
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
/**
|
|
129
|
+
* Add Typography class
|
|
130
|
+
*/
|
|
131
|
+
|
|
132
|
+
if (this._data.className) {
|
|
133
|
+
var _this$_element$classL;
|
|
134
|
+
|
|
135
|
+
(_this$_element$classL = this._element.classList).add.apply(_this$_element$classL, _toConsumableArray(this._data.className.split(" ")));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Used by Editor paste handling API.
|
|
140
|
+
* Provides configuration to handle P tags.
|
|
141
|
+
*
|
|
142
|
+
* @returns {{tags: string[]}}
|
|
143
|
+
*/
|
|
144
|
+
|
|
145
|
+
}, {
|
|
146
|
+
key: "currentAlignment",
|
|
147
|
+
get:
|
|
148
|
+
/**
|
|
149
|
+
* Get current alignment
|
|
150
|
+
*
|
|
151
|
+
* @returns {alignment}
|
|
152
|
+
*/
|
|
153
|
+
function get() {
|
|
154
|
+
var _this2 = this;
|
|
155
|
+
|
|
156
|
+
var alignment = this.alignments.find(function (alignment) {
|
|
157
|
+
return alignment.name === _this2._data.textAlign;
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
if (!alignment) {
|
|
161
|
+
alignment = {
|
|
162
|
+
name: TextAlign.START,
|
|
163
|
+
svg: ALIGNMENT_ICONS.start
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return alignment;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Check if text content is empty and set empty string to inner html.
|
|
171
|
+
* We need this because some browsers (e.g. Safari) insert <br> into empty contentEditable elements
|
|
172
|
+
*
|
|
173
|
+
* @param {KeyboardEvent} e - key up event
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
}, {
|
|
177
|
+
key: "onKeyUp",
|
|
178
|
+
value: function onKeyUp(e) {
|
|
179
|
+
if (e.code !== "Backspace" && e.code !== "Delete") {
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
var textContent = this._element.textContent;
|
|
184
|
+
|
|
185
|
+
if (textContent === "") {
|
|
186
|
+
this._element.innerHTML = "";
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Create Tool's view
|
|
191
|
+
* @return {HTMLElement}
|
|
192
|
+
* @private
|
|
193
|
+
*/
|
|
194
|
+
|
|
195
|
+
}, {
|
|
196
|
+
key: "drawView",
|
|
197
|
+
value: function drawView() {
|
|
198
|
+
var div = document.createElement("DIV");
|
|
199
|
+
div.classList.add(this._CSS.wrapper, this._CSS.block); // Add custom className to view.
|
|
200
|
+
|
|
201
|
+
if (this._data.className) {
|
|
202
|
+
div.classList.add(this._data.className);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
div.contentEditable = "false";
|
|
206
|
+
div.dataset.placeholder = this.api.i18n.t(this._placeholder);
|
|
207
|
+
|
|
208
|
+
if (!this.readOnly) {
|
|
209
|
+
div.contentEditable = "true";
|
|
210
|
+
div.addEventListener("keyup", this.onKeyUp);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return div;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Return Tool's view
|
|
217
|
+
*
|
|
218
|
+
* @returns {HTMLDivElement}
|
|
219
|
+
*/
|
|
220
|
+
|
|
221
|
+
}, {
|
|
222
|
+
key: "render",
|
|
223
|
+
value: function render() {
|
|
224
|
+
return this._element;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Create Block's settings block
|
|
228
|
+
*
|
|
229
|
+
* @returns {HTMLElement}
|
|
230
|
+
*/
|
|
231
|
+
|
|
232
|
+
}, {
|
|
233
|
+
key: "renderSettings",
|
|
234
|
+
value: function renderSettings() {
|
|
235
|
+
var _this3 = this;
|
|
236
|
+
|
|
237
|
+
var holder = document.createElement("DIV"); // Add alignment selectors
|
|
238
|
+
|
|
239
|
+
this.alignments.forEach(function (alignment) {
|
|
240
|
+
var selectTypeButton = document.createElement("SPAN");
|
|
241
|
+
selectTypeButton.classList.add(_this3._CSS.settingsButton);
|
|
242
|
+
/**
|
|
243
|
+
* Highlight current level button
|
|
244
|
+
*/
|
|
245
|
+
|
|
246
|
+
if (_this3.currentAlignment.name === alignment.name) {
|
|
247
|
+
selectTypeButton.classList.add(_this3._CSS.settingsButtonActive);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Add SVG icon
|
|
251
|
+
*/
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
selectTypeButton.innerHTML = alignment.svg;
|
|
255
|
+
/**
|
|
256
|
+
* Save alignment to its button
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
selectTypeButton.dataset.textAlign = alignment.name;
|
|
260
|
+
/**
|
|
261
|
+
* Set up click handler
|
|
262
|
+
*/
|
|
263
|
+
|
|
264
|
+
selectTypeButton.addEventListener("click", function () {
|
|
265
|
+
_this3.setAlignment(alignment);
|
|
266
|
+
});
|
|
267
|
+
/**
|
|
268
|
+
* Append settings button to holder
|
|
269
|
+
*/
|
|
270
|
+
|
|
271
|
+
holder.appendChild(selectTypeButton);
|
|
272
|
+
/**
|
|
273
|
+
* Save settings buttons
|
|
274
|
+
*/
|
|
275
|
+
|
|
276
|
+
_this3.settingsButtons.push(selectTypeButton);
|
|
277
|
+
}); // Add `Typography` selector
|
|
278
|
+
|
|
279
|
+
if (this.typography) {
|
|
280
|
+
var typographyForParagraph = Object.values(this.typography).filter(function (item) {
|
|
281
|
+
return item.component === "p";
|
|
282
|
+
});
|
|
283
|
+
var selectTypeButton = document.createElement("SELECT"); // Add editor's default input style
|
|
284
|
+
|
|
285
|
+
selectTypeButton.classList.add(this.api.styles.input); // Add typography options
|
|
286
|
+
|
|
287
|
+
typographyForParagraph.forEach(function (item) {
|
|
288
|
+
var option = new Option(item.label, item.className);
|
|
289
|
+
selectTypeButton.appendChild(option);
|
|
290
|
+
}); // Add "onclick" handler
|
|
291
|
+
|
|
292
|
+
selectTypeButton.onclick = function (event) {
|
|
293
|
+
var _ref2 = event.target,
|
|
294
|
+
value = _ref2.value;
|
|
295
|
+
|
|
296
|
+
_this3.setTypographyClass(value);
|
|
297
|
+
};
|
|
298
|
+
/**
|
|
299
|
+
* Append settings button to holder
|
|
300
|
+
*/
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
holder.appendChild(selectTypeButton);
|
|
304
|
+
/**
|
|
305
|
+
* Save settings buttons
|
|
306
|
+
*/
|
|
307
|
+
|
|
308
|
+
this.settingsButtons.push(selectTypeButton);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return holder;
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Method that specified how to merge two Text blocks.
|
|
315
|
+
* Called by Editor.js by backspace at the beginning of the Block
|
|
316
|
+
* @param {ParagraphData} data
|
|
317
|
+
* @public
|
|
318
|
+
*/
|
|
319
|
+
|
|
320
|
+
}, {
|
|
321
|
+
key: "merge",
|
|
322
|
+
value: function merge(data) {
|
|
323
|
+
this.data = {
|
|
324
|
+
text: this.data.text + data.text
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Validate Paragraph block data:
|
|
329
|
+
* - check for emptiness
|
|
330
|
+
*
|
|
331
|
+
* @param {ParagraphData} savedData — data received after saving
|
|
332
|
+
* @returns {boolean} false if saved data is not correct, otherwise true
|
|
333
|
+
* @public
|
|
334
|
+
*/
|
|
335
|
+
|
|
336
|
+
}, {
|
|
337
|
+
key: "validate",
|
|
338
|
+
value: function validate(savedData) {
|
|
339
|
+
return !(savedData.text.trim() === "" && !this._preserveBlank);
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Extract Tool's data from the view
|
|
343
|
+
* @param {HTMLDivElement} toolsContent - Paragraph tools rendered view
|
|
344
|
+
* @returns {ParagraphData} - saved data
|
|
345
|
+
* @public
|
|
346
|
+
*/
|
|
347
|
+
|
|
348
|
+
}, {
|
|
349
|
+
key: "save",
|
|
350
|
+
value: function save(toolsContent) {
|
|
351
|
+
return {
|
|
352
|
+
text: toolsContent.innerHTML,
|
|
353
|
+
textAlign: this.getTextAlign(toolsContent.className),
|
|
354
|
+
className: this.data.className
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Extract textAlign from className
|
|
359
|
+
*
|
|
360
|
+
* @param {string} className - heading element className
|
|
361
|
+
* @returns {TextAlign} textAlign
|
|
362
|
+
*/
|
|
363
|
+
|
|
364
|
+
}, {
|
|
365
|
+
key: "getTextAlign",
|
|
366
|
+
value: function getTextAlign(className) {
|
|
367
|
+
var textAlign = TextAlign.START; // Match className with alignment
|
|
368
|
+
|
|
369
|
+
this.alignments.forEach(function (alignment) {
|
|
370
|
+
if (className.includes("ce-header-text--".concat(alignment.name))) {
|
|
371
|
+
textAlign = alignment.name;
|
|
372
|
+
}
|
|
373
|
+
});
|
|
374
|
+
return textAlign;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* On paste callback fired from Editor.
|
|
378
|
+
*
|
|
379
|
+
* @param {PasteEvent} event - event with pasted data
|
|
380
|
+
*/
|
|
381
|
+
|
|
382
|
+
}, {
|
|
383
|
+
key: "onPaste",
|
|
384
|
+
value: function onPaste(event) {
|
|
385
|
+
var data = {
|
|
386
|
+
text: event.detail.data.innerHTML
|
|
387
|
+
};
|
|
388
|
+
this.data = data;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Callback for Block's settings buttons
|
|
392
|
+
*
|
|
393
|
+
* @param {number} alignment - level to set
|
|
394
|
+
*/
|
|
395
|
+
|
|
396
|
+
}, {
|
|
397
|
+
key: "setAlignment",
|
|
398
|
+
value: function setAlignment(alignment) {
|
|
399
|
+
var _this4 = this;
|
|
400
|
+
|
|
401
|
+
this.data = {
|
|
402
|
+
textAlign: alignment.name,
|
|
403
|
+
text: this.data.text
|
|
404
|
+
};
|
|
405
|
+
/**
|
|
406
|
+
* Highlight button by selected level
|
|
407
|
+
*/
|
|
408
|
+
|
|
409
|
+
this.settingsButtons.forEach(function (button) {
|
|
410
|
+
button.classList.toggle(_this4._CSS.settingsButtonActive, button.dataset.textAlign === alignment.name);
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* Callback for Block's settings buttons
|
|
415
|
+
*
|
|
416
|
+
* @param {string} className - name of typography class
|
|
417
|
+
*/
|
|
418
|
+
|
|
419
|
+
}, {
|
|
420
|
+
key: "setTypographyClass",
|
|
421
|
+
value: function setTypographyClass(className) {
|
|
422
|
+
this.data = {
|
|
423
|
+
textAlign: this.data.textAlign,
|
|
424
|
+
text: this.data.text,
|
|
425
|
+
className: className
|
|
426
|
+
};
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Normalize input data
|
|
430
|
+
*
|
|
431
|
+
* @param {HeaderData} data - saved data to process
|
|
432
|
+
*
|
|
433
|
+
* @returns {HeaderData}
|
|
434
|
+
* @private
|
|
435
|
+
*/
|
|
436
|
+
|
|
437
|
+
}, {
|
|
438
|
+
key: "normalizeData",
|
|
439
|
+
value: function normalizeData(data) {
|
|
440
|
+
var newData = {};
|
|
441
|
+
|
|
442
|
+
if (typeof data !== "object") {
|
|
443
|
+
data = {};
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
newData.text = data.text || "";
|
|
447
|
+
newData.textAlign = data.textAlign || TextAlign.START;
|
|
448
|
+
newData.className = data.className || "";
|
|
449
|
+
return newData;
|
|
450
|
+
}
|
|
451
|
+
}], [{
|
|
452
|
+
key: "DEFAULT_PLACEHOLDER",
|
|
453
|
+
get: function get() {
|
|
454
|
+
return "";
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Enable Conversion Toolbar. Paragraph can be converted to/from other tools
|
|
458
|
+
*/
|
|
459
|
+
|
|
460
|
+
}, {
|
|
461
|
+
key: "conversionConfig",
|
|
462
|
+
get: function get() {
|
|
463
|
+
return {
|
|
464
|
+
export: "text",
|
|
465
|
+
// to convert Paragraph to other block, use 'text' property of saved data
|
|
466
|
+
import: "text" // to covert other block's exported string to Paragraph, fill 'text' property of tool data
|
|
467
|
+
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Sanitizer rules
|
|
472
|
+
*/
|
|
473
|
+
|
|
474
|
+
}, {
|
|
475
|
+
key: "sanitize",
|
|
476
|
+
get: function get() {
|
|
477
|
+
return {
|
|
478
|
+
text: {
|
|
479
|
+
br: true
|
|
480
|
+
}
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Returns true to notify the core that read-only mode is supported
|
|
485
|
+
*
|
|
486
|
+
* @return {boolean}
|
|
487
|
+
*/
|
|
488
|
+
|
|
489
|
+
}, {
|
|
490
|
+
key: "isReadOnlySupported",
|
|
491
|
+
get: function get() {
|
|
492
|
+
return true;
|
|
493
|
+
}
|
|
494
|
+
}, {
|
|
495
|
+
key: "pasteConfig",
|
|
496
|
+
get: function get() {
|
|
497
|
+
return {
|
|
498
|
+
tags: ["P"]
|
|
499
|
+
};
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Icon and title for displaying at the Toolbox
|
|
503
|
+
*
|
|
504
|
+
* @return {{icon: string, title: string}}
|
|
505
|
+
*/
|
|
506
|
+
|
|
507
|
+
}, {
|
|
508
|
+
key: "toolbox",
|
|
509
|
+
get: function get() {
|
|
510
|
+
return {
|
|
511
|
+
icon: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0.2 -0.3 9 11.4" width="12" height="14">\n' + ' <path d="M0 2.77V.92A1 1 0 01.2.28C.35.1.56 0 .83 0h7.66c.28.01.48.1.63.28.14.17.21.38.21.64v1.85c0 .26-.08.48-.23.66-.15.17-.37.26-.66.26-.28 0-.5-.09-.64-.26a1 1 0 01-.21-.66V1.69H5.6v7.58h.5c.25 0 .45.08.6.23.17.16.25.35.25.6s-.08.45-.24.6a.87.87 0 01-.62.22H3.21a.87.87 0 01-.61-.22.78.78 0 01-.24-.6c0-.25.08-.44.24-.6a.85.85 0 01.61-.23h.5V1.7H1.73v1.08c0 .26-.08.48-.23.66-.15.17-.37.26-.66.26-.28 0-.5-.09-.64-.26A1 1 0 010 2.77z"/>\n' + "</svg>",
|
|
512
|
+
title: "Text"
|
|
513
|
+
};
|
|
514
|
+
}
|
|
515
|
+
}]);
|
|
516
|
+
|
|
517
|
+
return Paragraph;
|
|
518
|
+
}();
|
|
519
|
+
|
|
520
|
+
export default Paragraph;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.ce-paragraph {
|
|
2
|
+
line-height: 1.6em;
|
|
3
|
+
outline: none;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ce-paragraph[data-placeholder]:empty::before {
|
|
7
|
+
content: attr(data-placeholder);
|
|
8
|
+
color: #707684;
|
|
9
|
+
font-weight: normal;
|
|
10
|
+
opacity: 0;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** Show placeholder at the first paragraph if Editor is empty */
|
|
14
|
+
.codex-editor--empty .ce-block:first-of-type .ce-paragraph[data-placeholder]:empty::before {
|
|
15
|
+
opacity: 1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.codex-editor--toolbox-opened .ce-block:first-of-type .ce-paragraph[data-placeholder]:empty::before,
|
|
19
|
+
.codex-editor--empty .ce-block:first-of-type .ce-paragraph[data-placeholder]:empty:focus::before {
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ce-paragraph p:first-of-type {
|
|
24
|
+
margin-top: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ce-paragraph p:last-of-type {
|
|
28
|
+
margin-bottom: 0;
|
|
29
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { API } from "@editorjs/editorjs";
|
|
2
|
+
declare class TextColorTool {
|
|
3
|
+
_state: boolean;
|
|
4
|
+
color: string;
|
|
5
|
+
api: API;
|
|
6
|
+
tag: string;
|
|
7
|
+
class: string;
|
|
8
|
+
colorPicker: HTMLDivElement;
|
|
9
|
+
button: HTMLButtonElement;
|
|
10
|
+
config: {
|
|
11
|
+
themeColors: string[];
|
|
12
|
+
};
|
|
13
|
+
_CSS: any;
|
|
14
|
+
constructor({ api, config }: {
|
|
15
|
+
api: any;
|
|
16
|
+
config: any;
|
|
17
|
+
});
|
|
18
|
+
static get isInline(): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Sanitize method returns rules to let Editor know which HTML tags it should respect.
|
|
21
|
+
* @returns {object} sanitizer configuration.
|
|
22
|
+
* https://editorjs.io/sanitizer
|
|
23
|
+
*/
|
|
24
|
+
static get sanitize(): {
|
|
25
|
+
span: (el: any) => {
|
|
26
|
+
class: string;
|
|
27
|
+
style: any;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
get state(): boolean;
|
|
31
|
+
set state(state: boolean);
|
|
32
|
+
/**
|
|
33
|
+
* Render method must return HTML element of the button for Inline Toolbar.
|
|
34
|
+
*/
|
|
35
|
+
render(): HTMLButtonElement;
|
|
36
|
+
/**
|
|
37
|
+
* Input for the link
|
|
38
|
+
*/
|
|
39
|
+
renderActions(): HTMLElement;
|
|
40
|
+
/**
|
|
41
|
+
* Finally, when button is pressed Editor calls
|
|
42
|
+
* surround method of the tool with Range object as an argument.
|
|
43
|
+
* @param range
|
|
44
|
+
*/
|
|
45
|
+
surround(range: any): void;
|
|
46
|
+
wrap(range: any): void;
|
|
47
|
+
unwrap(range: any): void;
|
|
48
|
+
showActions(mark: any): void;
|
|
49
|
+
hideActions(): void;
|
|
50
|
+
/**
|
|
51
|
+
* CheckState method of each Inline Tool is called by Editor with current `Selection`
|
|
52
|
+
* when user selects some text
|
|
53
|
+
*/
|
|
54
|
+
checkState(): void;
|
|
55
|
+
convertToHex(color: any): string;
|
|
56
|
+
clear(): void;
|
|
57
|
+
}
|
|
58
|
+
export default TextColorTool;
|