@wangeditor-next/editor 6.4.2 → 6.4.3
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/dist/core.d.ts +996 -0
- package/dist/core.js +41 -12
- package/dist/core.mjs +41 -12
- package/dist/css/style.css +7 -7
- package/dist/index.d.ts +971 -0
- package/dist/index.js +76 -19
- package/dist/index.mjs +76 -19
- package/dist/upload.d.ts +450 -0
- package/dist/upload.js +16 -12
- package/dist/upload.mjs +16 -12
- package/package.json +20 -21
- package/dist/basic-modules/src/constants/icon-svg.d.ts +0 -49
- package/dist/basic-modules/src/index.d.ts +0 -9
- package/dist/basic-modules/src/locale/en.d.ts +0 -107
- package/dist/basic-modules/src/locale/index.d.ts +0 -5
- package/dist/basic-modules/src/locale/zh-CN.d.ts +0 -107
- package/dist/basic-modules/src/modules/blockquote/custom-types.d.ts +0 -9
- package/dist/basic-modules/src/modules/blockquote/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/blockquote/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/blockquote/menu/BlockquoteMenu.d.ts +0 -20
- package/dist/basic-modules/src/modules/blockquote/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/blockquote/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/blockquote/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/blockquote/render-elem.d.ts +0 -20
- package/dist/basic-modules/src/modules/code-block/custom-types.d.ts +0 -17
- package/dist/basic-modules/src/modules/code-block/elem-to-html.d.ts +0 -16
- package/dist/basic-modules/src/modules/code-block/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/code-block/menu/CodeBlockMenu.d.ts +0 -23
- package/dist/basic-modules/src/modules/code-block/menu/index.d.ts +0 -12
- package/dist/basic-modules/src/modules/code-block/parse-elem-html.d.ts +0 -19
- package/dist/basic-modules/src/modules/code-block/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/code-block/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/code-block/render-elem.d.ts +0 -18
- package/dist/basic-modules/src/modules/color/custom-types.d.ts +0 -9
- package/dist/basic-modules/src/modules/color/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/color/menu/BaseMenu.d.ts +0 -20
- package/dist/basic-modules/src/modules/color/menu/BgColorMenu.d.ts +0 -11
- package/dist/basic-modules/src/modules/color/menu/ColorMenu.d.ts +0 -11
- package/dist/basic-modules/src/modules/color/menu/config.d.ts +0 -6
- package/dist/basic-modules/src/modules/color/menu/index.d.ts +0 -20
- package/dist/basic-modules/src/modules/color/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/color/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/color/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/color/style-to-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/common/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/common/menu/EnterMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/common/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/divider/custom-types.d.ts +0 -12
- package/dist/basic-modules/src/modules/divider/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/divider/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/divider/menu/InsertDividerMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/divider/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/divider/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/divider/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/divider/render-elem.d.ts +0 -13
- package/dist/basic-modules/src/modules/emotion/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/emotion/menu/EmotionMenu.d.ts +0 -19
- package/dist/basic-modules/src/modules/emotion/menu/config.d.ts +0 -5
- package/dist/basic-modules/src/modules/emotion/menu/index.d.ts +0 -12
- package/dist/basic-modules/src/modules/font-size-family/custom-types.d.ts +0 -9
- package/dist/basic-modules/src/modules/font-size-family/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/font-size-family/menu/BaseMenu.d.ts +0 -18
- package/dist/basic-modules/src/modules/font-size-family/menu/FontFamilyMenu.d.ts +0 -14
- package/dist/basic-modules/src/modules/font-size-family/menu/FontSizeMenu.d.ts +0 -13
- package/dist/basic-modules/src/modules/font-size-family/menu/config.d.ts +0 -12
- package/dist/basic-modules/src/modules/font-size-family/menu/index.d.ts +0 -26
- package/dist/basic-modules/src/modules/font-size-family/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/font-size-family/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/font-size-family/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/font-size-family/style-to-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/format-painter/helper.d.ts +0 -3
- package/dist/basic-modules/src/modules/format-painter/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/format-painter/menu/FormatPainter.d.ts +0 -37
- package/dist/basic-modules/src/modules/format-painter/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/format-painter/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/full-screen/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/full-screen/menu/FullScreen.d.ts +0 -18
- package/dist/basic-modules/src/modules/full-screen/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/header/custom-types.d.ts +0 -29
- package/dist/basic-modules/src/modules/header/elem-to-html.d.ts +0 -29
- package/dist/basic-modules/src/modules/header/helper.d.ts +0 -14
- package/dist/basic-modules/src/modules/header/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/header/menu/Header1ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header2ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header3ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header4ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header5ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/Header6ButtonMenu.d.ts +0 -10
- package/dist/basic-modules/src/modules/header/menu/HeaderButtonMenuBase.d.ts +0 -19
- package/dist/basic-modules/src/modules/header/menu/HeaderSelectMenu.d.ts +0 -26
- package/dist/basic-modules/src/modules/header/menu/index.d.ts +0 -39
- package/dist/basic-modules/src/modules/header/parse-elem-html.d.ts +0 -32
- package/dist/basic-modules/src/modules/header/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/header/render-elem.d.ts +0 -32
- package/dist/basic-modules/src/modules/image/custom-types.d.ts +0 -22
- package/dist/basic-modules/src/modules/image/elem-to-html.d.ts +0 -12
- package/dist/basic-modules/src/modules/image/helper.d.ts +0 -13
- package/dist/basic-modules/src/modules/image/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/image/menu/DeleteImage.d.ts +0 -15
- package/dist/basic-modules/src/modules/image/menu/EditImage.d.ts +0 -28
- package/dist/basic-modules/src/modules/image/menu/EditImageSizeMenu.d.ts +0 -25
- package/dist/basic-modules/src/modules/image/menu/InsertImage.d.ts +0 -27
- package/dist/basic-modules/src/modules/image/menu/PreviewImage.d.ts +0 -14
- package/dist/basic-modules/src/modules/image/menu/ViewImageLink.d.ts +0 -15
- package/dist/basic-modules/src/modules/image/menu/Width100.d.ts +0 -10
- package/dist/basic-modules/src/modules/image/menu/Width30.d.ts +0 -10
- package/dist/basic-modules/src/modules/image/menu/Width50.d.ts +0 -10
- package/dist/basic-modules/src/modules/image/menu/WidthBase.d.ts +0 -17
- package/dist/basic-modules/src/modules/image/menu/config.d.ts +0 -30
- package/dist/basic-modules/src/modules/image/menu/index.d.ts +0 -61
- package/dist/basic-modules/src/modules/image/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/image/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/image/render-elem.d.ts +0 -13
- package/dist/basic-modules/src/modules/image/resize.d.ts +0 -14
- package/dist/basic-modules/src/modules/indent/custom-types.d.ts +0 -10
- package/dist/basic-modules/src/modules/indent/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/indent/is-indent-target.d.ts +0 -4
- package/dist/basic-modules/src/modules/indent/menu/BaseMenu.d.ts +0 -25
- package/dist/basic-modules/src/modules/indent/menu/DecreaseIndentMenu.d.ts +0 -13
- package/dist/basic-modules/src/modules/indent/menu/IncreaseIndentMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/indent/menu/index.d.ts +0 -14
- package/dist/basic-modules/src/modules/indent/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/indent/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/indent/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/indent/style-to-html.d.ts +0 -7
- package/dist/basic-modules/src/modules/justify/custom-types.d.ts +0 -10
- package/dist/basic-modules/src/modules/justify/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/justify/menu/BaseMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/justify/menu/JustifyCenterMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/justify/menu/JustifyJustifyMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/justify/menu/JustifyLeftMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/justify/menu/JustifyRightMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/justify/menu/index.d.ts +0 -24
- package/dist/basic-modules/src/modules/justify/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/justify/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/justify/style-to-html.d.ts +0 -7
- package/dist/basic-modules/src/modules/line-height/custom-types.d.ts +0 -10
- package/dist/basic-modules/src/modules/line-height/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/line-height/menu/LineHeightMenu.d.ts +0 -26
- package/dist/basic-modules/src/modules/line-height/menu/config.d.ts +0 -5
- package/dist/basic-modules/src/modules/line-height/menu/index.d.ts +0 -12
- package/dist/basic-modules/src/modules/line-height/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/line-height/render-style.d.ts +0 -15
- package/dist/basic-modules/src/modules/line-height/style-to-html.d.ts +0 -7
- package/dist/basic-modules/src/modules/link/custom-types.d.ts +0 -11
- package/dist/basic-modules/src/modules/link/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/link/helper.d.ts +0 -20
- package/dist/basic-modules/src/modules/link/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/link/menu/EditLink.d.ts +0 -30
- package/dist/basic-modules/src/modules/link/menu/InsertLink.d.ts +0 -25
- package/dist/basic-modules/src/modules/link/menu/UnLink.d.ts +0 -15
- package/dist/basic-modules/src/modules/link/menu/ViewLink.d.ts +0 -16
- package/dist/basic-modules/src/modules/link/menu/config.d.ts +0 -18
- package/dist/basic-modules/src/modules/link/menu/index.d.ts +0 -33
- package/dist/basic-modules/src/modules/link/parse-elem-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/link/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/link/render-elem.d.ts +0 -20
- package/dist/basic-modules/src/modules/link/url.d.ts +0 -10
- package/dist/basic-modules/src/modules/paragraph/custom-types.d.ts +0 -9
- package/dist/basic-modules/src/modules/paragraph/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/paragraph/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/paragraph/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/paragraph/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/paragraph/render-elem.d.ts +0 -20
- package/dist/basic-modules/src/modules/text-style/custom-types.d.ts +0 -16
- package/dist/basic-modules/src/modules/text-style/helper.d.ts +0 -8
- package/dist/basic-modules/src/modules/text-style/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/text-style/menu/BaseMenu.d.ts +0 -27
- package/dist/basic-modules/src/modules/text-style/menu/BoldMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/ClearStyleMenu.d.ts +0 -20
- package/dist/basic-modules/src/modules/text-style/menu/CodeMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/EmphasisDotMenu.d.ts +0 -11
- package/dist/basic-modules/src/modules/text-style/menu/ItalicMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/SubMenu.d.ts +0 -13
- package/dist/basic-modules/src/modules/text-style/menu/SupMenu.d.ts +0 -13
- package/dist/basic-modules/src/modules/text-style/menu/ThroughMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/UnderlineMenu.d.ts +0 -12
- package/dist/basic-modules/src/modules/text-style/menu/WavyUnderlineMenu.d.ts +0 -11
- package/dist/basic-modules/src/modules/text-style/menu/index.d.ts +0 -54
- package/dist/basic-modules/src/modules/text-style/parse-style-html.d.ts +0 -8
- package/dist/basic-modules/src/modules/text-style/render-style.d.ts +0 -14
- package/dist/basic-modules/src/modules/text-style/style-constants.d.ts +0 -35
- package/dist/basic-modules/src/modules/text-style/style-to-html.d.ts +0 -13
- package/dist/basic-modules/src/modules/todo/custom-types.d.ts +0 -10
- package/dist/basic-modules/src/modules/todo/elem-to-html.d.ts +0 -11
- package/dist/basic-modules/src/modules/todo/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/todo/menu/Todo.d.ts +0 -15
- package/dist/basic-modules/src/modules/todo/menu/index.d.ts +0 -9
- package/dist/basic-modules/src/modules/todo/parse-elem-html.d.ts +0 -14
- package/dist/basic-modules/src/modules/todo/plugin.d.ts +0 -7
- package/dist/basic-modules/src/modules/todo/pre-parse-html.d.ts +0 -15
- package/dist/basic-modules/src/modules/todo/render-elem.d.ts +0 -20
- package/dist/basic-modules/src/modules/undo-redo/index.d.ts +0 -7
- package/dist/basic-modules/src/modules/undo-redo/menu/RedoMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/undo-redo/menu/UndoMenu.d.ts +0 -15
- package/dist/basic-modules/src/modules/undo-redo/menu/index.d.ts +0 -14
- package/dist/basic-modules/src/utils/dom.d.ts +0 -36
- package/dist/basic-modules/src/utils/style-class.d.ts +0 -14
- package/dist/basic-modules/src/utils/util.d.ts +0 -11
- package/dist/basic-modules/src/utils/vdom.d.ts +0 -25
- package/dist/code-highlight/src/constants/svg.d.ts +0 -10
- package/dist/code-highlight/src/custom-types.d.ts +0 -17
- package/dist/code-highlight/src/decorate/index.d.ts +0 -7
- package/dist/code-highlight/src/index.d.ts +0 -9
- package/dist/code-highlight/src/locale/en.d.ts +0 -10
- package/dist/code-highlight/src/locale/index.d.ts +0 -5
- package/dist/code-highlight/src/locale/zh-CN.d.ts +0 -10
- package/dist/code-highlight/src/module/elem-to-html.d.ts +0 -11
- package/dist/code-highlight/src/module/index.d.ts +0 -7
- package/dist/code-highlight/src/module/menu/SelectLangMenu.d.ts +0 -24
- package/dist/code-highlight/src/module/menu/config.d.ts +0 -8
- package/dist/code-highlight/src/module/menu/index.d.ts +0 -15
- package/dist/code-highlight/src/module/parse-style-html.d.ts +0 -8
- package/dist/code-highlight/src/module/render-style.d.ts +0 -13
- package/dist/code-highlight/src/utils/dom.d.ts +0 -15
- package/dist/code-highlight/src/utils/vdom.d.ts +0 -11
- package/dist/code-highlight/src/vendor/prism.d.ts +0 -37
- package/dist/core/src/config/index.d.ts +0 -13
- package/dist/core/src/config/interface.d.ts +0 -339
- package/dist/core/src/config/register.d.ts +0 -12
- package/dist/core/src/config/style-mode.d.ts +0 -8
- package/dist/core/src/constants/index.d.ts +0 -1
- package/dist/core/src/constants/svg.d.ts +0 -12
- package/dist/core/src/create/bind-node-relation.d.ts +0 -15
- package/dist/core/src/create/create-editor.d.ts +0 -10
- package/dist/core/src/create/create-toolbar.d.ts +0 -14
- package/dist/core/src/create/helper.d.ts +0 -37
- package/dist/core/src/create/index.d.ts +0 -8
- package/dist/core/src/editor/dom-editor.d.ts +0 -154
- package/dist/core/src/editor/interface.d.ts +0 -90
- package/dist/core/src/editor/plugins/with-config.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-content.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-dom.d.ts +0 -10
- package/dist/core/src/editor/plugins/with-emitter.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-event-data.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-history.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-max-length.d.ts +0 -7
- package/dist/core/src/editor/plugins/with-selection.d.ts +0 -7
- package/dist/core/src/i18n/index.d.ts +0 -32
- package/dist/core/src/index.d.ts +0 -45
- package/dist/core/src/menus/bar/HoverBar.d.ts +0 -48
- package/dist/core/src/menus/bar/Toolbar.d.ts +0 -38
- package/dist/core/src/menus/bar-item/BaseButton.d.ts +0 -26
- package/dist/core/src/menus/bar-item/DropPanelButton.d.ts +0 -14
- package/dist/core/src/menus/bar-item/GroupButton.d.ts +0 -17
- package/dist/core/src/menus/bar-item/ModalButton.d.ts +0 -25
- package/dist/core/src/menus/bar-item/Select.d.ts +0 -22
- package/dist/core/src/menus/bar-item/SimpleButton.d.ts +0 -11
- package/dist/core/src/menus/bar-item/index.d.ts +0 -24
- package/dist/core/src/menus/bar-item/tooltip.d.ts +0 -6
- package/dist/core/src/menus/helpers/helpers.d.ts +0 -18
- package/dist/core/src/menus/helpers/position.d.ts +0 -36
- package/dist/core/src/menus/index.d.ts +0 -9
- package/dist/core/src/menus/interface.d.ts +0 -65
- package/dist/core/src/menus/panel-and-modal/BaseClass.d.ts +0 -26
- package/dist/core/src/menus/panel-and-modal/DropPanel.d.ts +0 -12
- package/dist/core/src/menus/panel-and-modal/Modal.d.ts +0 -44
- package/dist/core/src/menus/panel-and-modal/SelectList.d.ts +0 -20
- package/dist/core/src/menus/register.d.ts +0 -15
- package/dist/core/src/parse-html/helper.d.ts +0 -10
- package/dist/core/src/parse-html/index.d.ts +0 -35
- package/dist/core/src/parse-html/parse-common-elem-html.d.ts +0 -15
- package/dist/core/src/parse-html/parse-elem-html.d.ts +0 -15
- package/dist/core/src/parse-html/parse-text-elem-html.d.ts +0 -16
- package/dist/core/src/render/element/getRenderElem.d.ts +0 -11
- package/dist/core/src/render/element/renderElement.d.ts +0 -9
- package/dist/core/src/render/element/renderStyle.d.ts +0 -15
- package/dist/core/src/render/helper.d.ts +0 -6
- package/dist/core/src/render/index.d.ts +0 -27
- package/dist/core/src/render/node2Vnode.d.ts +0 -15
- package/dist/core/src/render/text/genVnode.d.ts +0 -9
- package/dist/core/src/render/text/renderStyle.d.ts +0 -15
- package/dist/core/src/render/text/renderText.d.ts +0 -9
- package/dist/core/src/text-area/TextArea.d.ts +0 -52
- package/dist/core/src/text-area/event-handlers/beforeInput.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/blur.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/click.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/composition.d.ts +0 -27
- package/dist/core/src/text-area/event-handlers/copy.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/cut.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/drag.d.ts +0 -9
- package/dist/core/src/text-area/event-handlers/drop.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/focus.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/index.d.ts +0 -35
- package/dist/core/src/text-area/event-handlers/keydown.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/keypress.d.ts +0 -8
- package/dist/core/src/text-area/event-handlers/paste.d.ts +0 -8
- package/dist/core/src/text-area/helpers.d.ts +0 -30
- package/dist/core/src/text-area/place-holder.d.ts +0 -18
- package/dist/core/src/text-area/syncSelection.d.ts +0 -19
- package/dist/core/src/text-area/update-view.d.ts +0 -13
- package/dist/core/src/to-html/elem2html.d.ts +0 -9
- package/dist/core/src/to-html/index.d.ts +0 -44
- package/dist/core/src/to-html/node2html.d.ts +0 -12
- package/dist/core/src/to-html/text2html.d.ts +0 -9
- package/dist/core/src/upload/createUploader.d.ts +0 -14
- package/dist/core/src/upload/createUppyUploader.d.ts +0 -7
- package/dist/core/src/upload/index.d.ts +0 -9
- package/dist/core/src/upload/interface.d.ts +0 -72
- package/dist/core/src/upload.d.ts +0 -5
- package/dist/core/src/utils/dom.d.ts +0 -103
- package/dist/core/src/utils/hotkeys.d.ts +0 -35
- package/dist/core/src/utils/key.d.ts +0 -11
- package/dist/core/src/utils/line.d.ts +0 -14
- package/dist/core/src/utils/sanitize-html.d.ts +0 -5
- package/dist/core/src/utils/ua.d.ts +0 -14
- package/dist/core/src/utils/util.d.ts +0 -28
- package/dist/core/src/utils/vdom.d.ts +0 -34
- package/dist/core/src/utils/weak-maps.d.ts +0 -60
- package/dist/editor/src/Boot.d.ts +0 -31
- package/dist/editor/src/constants/svg.d.ts +0 -14
- package/dist/editor/src/core.d.ts +0 -54
- package/dist/editor/src/create.d.ts +0 -29
- package/dist/editor/src/index.d.ts +0 -27
- package/dist/editor/src/init-default-config/config/hoverbar.d.ts +0 -47
- package/dist/editor/src/init-default-config/config/index.d.ts +0 -67
- package/dist/editor/src/init-default-config/config/toolbar.d.ts +0 -16
- package/dist/editor/src/init-default-config/index.d.ts +0 -5
- package/dist/editor/src/locale/en.d.ts +0 -14
- package/dist/editor/src/locale/index.d.ts +0 -5
- package/dist/editor/src/locale/zh-CN.d.ts +0 -14
- package/dist/editor/src/register-builtin-modules/index.d.ts +0 -5
- package/dist/editor/src/register-builtin-modules/register.d.ts +0 -7
- package/dist/editor/src/upload.d.ts +0 -6
- package/dist/editor/src/utils/browser-polyfill.d.ts +0 -6
- package/dist/editor/src/utils/dom.d.ts +0 -6
- package/dist/editor/src/utils/node-polyfill.d.ts +0 -4
- package/dist/list-module/src/constants/svg.d.ts +0 -11
- package/dist/list-module/src/index.d.ts +0 -8
- package/dist/list-module/src/locale/en.d.ts +0 -15
- package/dist/list-module/src/locale/index.d.ts +0 -5
- package/dist/list-module/src/locale/zh-CN.d.ts +0 -15
- package/dist/list-module/src/module/custom-types.d.ts +0 -27
- package/dist/list-module/src/module/elem-to-html.d.ts +0 -16
- package/dist/list-module/src/module/helpers.d.ts +0 -26
- package/dist/list-module/src/module/html-transform.d.ts +0 -10
- package/dist/list-module/src/module/index.d.ts +0 -7
- package/dist/list-module/src/module/menu/BaseMenu.d.ts +0 -20
- package/dist/list-module/src/module/menu/BulletedListMenu.d.ts +0 -11
- package/dist/list-module/src/module/menu/LowerAlphaListMenu.d.ts +0 -13
- package/dist/list-module/src/module/menu/NumberedListMenu.d.ts +0 -11
- package/dist/list-module/src/module/menu/index.d.ts +0 -19
- package/dist/list-module/src/module/outline-actions.d.ts +0 -9
- package/dist/list-module/src/module/parse-elem-html.d.ts +0 -18
- package/dist/list-module/src/module/plugin.d.ts +0 -7
- package/dist/list-module/src/module/render-elem.d.ts +0 -13
- package/dist/list-module/src/module/style-class.d.ts +0 -6
- package/dist/list-module/src/utils/dom.d.ts +0 -19
- package/dist/list-module/src/utils/maps.d.ts +0 -7
- package/dist/list-module/src/utils/util.d.ts +0 -6
- package/dist/table-module/src/constants/svg.d.ts +0 -26
- package/dist/table-module/src/index.d.ts +0 -8
- package/dist/table-module/src/locale/en.d.ts +0 -56
- package/dist/table-module/src/locale/index.d.ts +0 -5
- package/dist/table-module/src/locale/zh-CN.d.ts +0 -56
- package/dist/table-module/src/module/cell-selection.d.ts +0 -11
- package/dist/table-module/src/module/column-resize.d.ts +0 -20
- package/dist/table-module/src/module/custom-types.d.ts +0 -48
- package/dist/table-module/src/module/elem-to-html.d.ts +0 -22
- package/dist/table-module/src/module/helpers.d.ts +0 -37
- package/dist/table-module/src/module/index.d.ts +0 -7
- package/dist/table-module/src/module/menu/CellProperty.d.ts +0 -14
- package/dist/table-module/src/module/menu/DeleteCol.d.ts +0 -15
- package/dist/table-module/src/module/menu/DeleteRow.d.ts +0 -15
- package/dist/table-module/src/module/menu/DeleteTable.d.ts +0 -15
- package/dist/table-module/src/module/menu/FullWidth.d.ts +0 -15
- package/dist/table-module/src/module/menu/InsertCol.d.ts +0 -15
- package/dist/table-module/src/module/menu/InsertRow.d.ts +0 -15
- package/dist/table-module/src/module/menu/InsertTable.d.ts +0 -24
- package/dist/table-module/src/module/menu/MergeCell.d.ts +0 -24
- package/dist/table-module/src/module/menu/SplitCell.d.ts +0 -24
- package/dist/table-module/src/module/menu/TableHeader.d.ts +0 -15
- package/dist/table-module/src/module/menu/TableProperty.d.ts +0 -49
- package/dist/table-module/src/module/menu/index.d.ts +0 -77
- package/dist/table-module/src/module/parse-elem-html.d.ts +0 -24
- package/dist/table-module/src/module/parse-style-html.d.ts +0 -8
- package/dist/table-module/src/module/plugin.d.ts +0 -7
- package/dist/table-module/src/module/pre-parse-html.d.ts +0 -15
- package/dist/table-module/src/module/render-elem/index.d.ts +0 -19
- package/dist/table-module/src/module/render-elem/render-cell.d.ts +0 -9
- package/dist/table-module/src/module/render-elem/render-row.d.ts +0 -9
- package/dist/table-module/src/module/render-elem/render-table.d.ts +0 -9
- package/dist/table-module/src/module/render-elem/selection-overlay.d.ts +0 -21
- package/dist/table-module/src/module/render-style.d.ts +0 -9
- package/dist/table-module/src/module/row-resize.d.ts +0 -15
- package/dist/table-module/src/module/style-to-html.d.ts +0 -6
- package/dist/table-module/src/module/table-cursor.d.ts +0 -20
- package/dist/table-module/src/module/weak-maps.d.ts +0 -6
- package/dist/table-module/src/module/with-selection.d.ts +0 -2
- package/dist/table-module/src/utils/dom.d.ts +0 -31
- package/dist/table-module/src/utils/has-common.d.ts +0 -7
- package/dist/table-module/src/utils/index.d.ts +0 -5
- package/dist/table-module/src/utils/is-of-type.d.ts +0 -6
- package/dist/table-module/src/utils/matrices.d.ts +0 -9
- package/dist/table-module/src/utils/options.d.ts +0 -16
- package/dist/table-module/src/utils/point.d.ts +0 -7
- package/dist/table-module/src/utils/types.d.ts +0 -19
- package/dist/table-module/src/utils/vdom.d.ts +0 -11
- package/dist/upload-image-module/src/constants/svg.d.ts +0 -10
- package/dist/upload-image-module/src/index.d.ts +0 -8
- package/dist/upload-image-module/src/locale/en.d.ts +0 -11
- package/dist/upload-image-module/src/locale/index.d.ts +0 -5
- package/dist/upload-image-module/src/locale/zh-CN.d.ts +0 -11
- package/dist/upload-image-module/src/module/index.d.ts +0 -7
- package/dist/upload-image-module/src/module/menu/UploadImageMenu.d.ts +0 -16
- package/dist/upload-image-module/src/module/menu/config.d.ts +0 -6
- package/dist/upload-image-module/src/module/menu/index.d.ts +0 -10
- package/dist/upload-image-module/src/module/plugin.d.ts +0 -7
- package/dist/upload-image-module/src/module/upload-images.d.ts +0 -11
- package/dist/upload-image-module/src/utils/dom.d.ts +0 -7
- package/dist/video-module/src/constants/svg.d.ts +0 -15
- package/dist/video-module/src/index.d.ts +0 -8
- package/dist/video-module/src/locale/en.d.ts +0 -24
- package/dist/video-module/src/locale/index.d.ts +0 -5
- package/dist/video-module/src/locale/zh-CN.d.ts +0 -24
- package/dist/video-module/src/module/alignment.d.ts +0 -10
- package/dist/video-module/src/module/custom-types.d.ts +0 -24
- package/dist/video-module/src/module/elem-to-html.d.ts +0 -12
- package/dist/video-module/src/module/helper/insert-video.d.ts +0 -12
- package/dist/video-module/src/module/helper/upload-videos.d.ts +0 -6
- package/dist/video-module/src/module/index.d.ts +0 -7
- package/dist/video-module/src/module/menu/EditVideoSizeMenu.d.ts +0 -25
- package/dist/video-module/src/module/menu/EditVideoSrcMenu.d.ts +0 -26
- package/dist/video-module/src/module/menu/InsertVideoMenu.d.ts +0 -25
- package/dist/video-module/src/module/menu/UploadVideoMenu.d.ts +0 -16
- package/dist/video-module/src/module/menu/VideoAlignMenu.d.ts +0 -18
- package/dist/video-module/src/module/menu/config.d.ts +0 -25
- package/dist/video-module/src/module/menu/index.d.ts +0 -43
- package/dist/video-module/src/module/parse-elem-html.d.ts +0 -14
- package/dist/video-module/src/module/plugin.d.ts +0 -7
- package/dist/video-module/src/module/pre-parse-html.d.ts +0 -15
- package/dist/video-module/src/module/render-elem.d.ts +0 -13
- package/dist/video-module/src/utils/dom.d.ts +0 -29
- package/dist/video-module/src/utils/util.d.ts +0 -12
package/dist/core.d.ts
ADDED
|
@@ -0,0 +1,996 @@
|
|
|
1
|
+
import ee from "event-emitter";
|
|
2
|
+
import { Ancestor, Descendant, Descendant as SlateDescendant, Editor, Editor as SlateEditor, Element as Element$1, Element as SlateElement, Location, Location as SlateLocation, Node as Node$1, Node as SlateNode, NodeEntry, Path, Path as SlatePath, Point, Point as SlatePoint, Range, Range as SlateRange, Text as SlateText, Transforms as SlateTransforms } from "slate";
|
|
3
|
+
import { Dom7Array } from "dom7";
|
|
4
|
+
import { VNode } from "snabbdom";
|
|
5
|
+
import * as i18next0 from "i18next";
|
|
6
|
+
|
|
7
|
+
//#region ../core/src/utils/dom.d.ts
|
|
8
|
+
|
|
9
|
+
type DOMPoint = [Node, number];
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region ../core/src/menus/interface.d.ts
|
|
12
|
+
interface IMenuGroup {
|
|
13
|
+
key: string;
|
|
14
|
+
title: string;
|
|
15
|
+
iconSvg?: string;
|
|
16
|
+
menuKeys: string[];
|
|
17
|
+
}
|
|
18
|
+
interface IPositionStyle {
|
|
19
|
+
top: string;
|
|
20
|
+
left: string;
|
|
21
|
+
right: string;
|
|
22
|
+
bottom: string;
|
|
23
|
+
}
|
|
24
|
+
interface IOption {
|
|
25
|
+
value: string;
|
|
26
|
+
text: string;
|
|
27
|
+
selected?: boolean;
|
|
28
|
+
styleForRenderMenuList?: {
|
|
29
|
+
[key: string]: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface IBaseMenu {
|
|
33
|
+
readonly title: string;
|
|
34
|
+
iconSvg?: string;
|
|
35
|
+
readonly hotkey?: string;
|
|
36
|
+
readonly alwaysEnable?: boolean;
|
|
37
|
+
readonly tag: string;
|
|
38
|
+
readonly width?: number;
|
|
39
|
+
getValue: (editor: IDomEditor) => string | boolean;
|
|
40
|
+
getIcon?: (editor: IDomEditor) => string;
|
|
41
|
+
getTitle?: (editor: IDomEditor) => string;
|
|
42
|
+
isActive: (editor: IDomEditor) => boolean;
|
|
43
|
+
isDisabled: (editor: IDomEditor) => boolean;
|
|
44
|
+
exec: (editor: IDomEditor, value: string | boolean) => void;
|
|
45
|
+
}
|
|
46
|
+
interface IButtonMenu extends IBaseMenu {}
|
|
47
|
+
interface ISelectMenu extends IBaseMenu {
|
|
48
|
+
readonly selectPanelWidth?: number;
|
|
49
|
+
getOptions: (editor: IDomEditor) => IOption[];
|
|
50
|
+
}
|
|
51
|
+
interface IDropPanelMenu extends IBaseMenu {
|
|
52
|
+
readonly showDropPanel: boolean;
|
|
53
|
+
getPanelContentElem: (editor: IDomEditor) => DOMElement$1;
|
|
54
|
+
}
|
|
55
|
+
interface IModalMenu extends IBaseMenu {
|
|
56
|
+
readonly showModal: boolean;
|
|
57
|
+
readonly modalWidth: number;
|
|
58
|
+
getModalContentElem: (editor: IDomEditor) => DOMElement$1;
|
|
59
|
+
getModalPositionNode: (editor: IDomEditor) => Node$1 | null;
|
|
60
|
+
}
|
|
61
|
+
type MenuFactoryType = () => IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
62
|
+
interface IRegisterMenuConf {
|
|
63
|
+
key: string;
|
|
64
|
+
factory: MenuFactoryType;
|
|
65
|
+
config?: ISingleMenuConfig;
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region ../core/src/config/interface.d.ts
|
|
69
|
+
type EmptyText = {
|
|
70
|
+
text: '';
|
|
71
|
+
};
|
|
72
|
+
type ImageElement = {
|
|
73
|
+
type: 'image';
|
|
74
|
+
src: string;
|
|
75
|
+
alt?: string;
|
|
76
|
+
href?: string;
|
|
77
|
+
width?: string;
|
|
78
|
+
height?: string;
|
|
79
|
+
style?: {
|
|
80
|
+
width?: string;
|
|
81
|
+
height?: string;
|
|
82
|
+
};
|
|
83
|
+
children: EmptyText[];
|
|
84
|
+
};
|
|
85
|
+
type VideoElement = {
|
|
86
|
+
type: 'video';
|
|
87
|
+
key?: string;
|
|
88
|
+
src: string;
|
|
89
|
+
poster?: string;
|
|
90
|
+
align?: 'left' | 'center' | 'right';
|
|
91
|
+
width?: string;
|
|
92
|
+
height?: string;
|
|
93
|
+
style?: {
|
|
94
|
+
width?: string;
|
|
95
|
+
height?: string;
|
|
96
|
+
};
|
|
97
|
+
children: EmptyText[];
|
|
98
|
+
};
|
|
99
|
+
interface IHoverbarConf {
|
|
100
|
+
[key: string]: {
|
|
101
|
+
match?: (editor: IDomEditor, n: Node$1) => boolean;
|
|
102
|
+
menuKeys: string[];
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
type AlertType = 'success' | 'info' | 'warning' | 'error';
|
|
106
|
+
type TextStyleMode = 'inline' | 'class';
|
|
107
|
+
type ClassStylePolicy = 'preserve-data' | 'fallback-inline' | 'strict';
|
|
108
|
+
type TableWidthExportMode = 'adaptive' | 'explicit';
|
|
109
|
+
type StyleClassTokenType = 'color' | 'bgColor' | 'fontSize' | 'fontFamily' | 'textAlign' | 'lineHeight' | 'indent';
|
|
110
|
+
interface IClassStyleUnsupportedPayload {
|
|
111
|
+
type: string;
|
|
112
|
+
value: string;
|
|
113
|
+
scene: 'render' | 'toHtml';
|
|
114
|
+
fallback: 'preserve-data' | 'inline' | 'throw';
|
|
115
|
+
message: string;
|
|
116
|
+
}
|
|
117
|
+
interface ISingleMenuConfig {
|
|
118
|
+
[key: string]: any;
|
|
119
|
+
iconSvg?: string;
|
|
120
|
+
}
|
|
121
|
+
interface IColorConfig {
|
|
122
|
+
colors: string[];
|
|
123
|
+
}
|
|
124
|
+
interface IFontSizeItem {
|
|
125
|
+
name: string;
|
|
126
|
+
value: string;
|
|
127
|
+
}
|
|
128
|
+
interface IFontSizeConfig {
|
|
129
|
+
fontSizeList: (string | IFontSizeItem)[];
|
|
130
|
+
}
|
|
131
|
+
interface IFontFamilyItem {
|
|
132
|
+
name: string;
|
|
133
|
+
value: string;
|
|
134
|
+
}
|
|
135
|
+
interface IFontFamilyConfig {
|
|
136
|
+
fontFamilyList: (string | IFontFamilyItem)[];
|
|
137
|
+
}
|
|
138
|
+
interface ILineHeightConfig {
|
|
139
|
+
lineHeightList: string[];
|
|
140
|
+
}
|
|
141
|
+
interface IImageMenuBaseConfig {
|
|
142
|
+
checkImage?: (src: string, alt: string, url: string) => boolean | undefined | string;
|
|
143
|
+
parseImageSrc?: (src: string) => string;
|
|
144
|
+
}
|
|
145
|
+
interface IInsertImageConfig extends IImageMenuBaseConfig {
|
|
146
|
+
onInsertedImage?: (imageNode: ImageElement | null) => void;
|
|
147
|
+
}
|
|
148
|
+
interface IEditImageConfig extends IImageMenuBaseConfig {
|
|
149
|
+
onUpdatedImage?: (imageNode: ImageElement | null) => void;
|
|
150
|
+
}
|
|
151
|
+
type ImageResizeUnit = 'px' | '%';
|
|
152
|
+
type ImageResizeSource = 'modal' | 'preset' | 'drag';
|
|
153
|
+
interface IImageResizeCheckPayload {
|
|
154
|
+
width: string;
|
|
155
|
+
height: string;
|
|
156
|
+
rawWidth: string;
|
|
157
|
+
rawHeight: string;
|
|
158
|
+
source: ImageResizeSource;
|
|
159
|
+
}
|
|
160
|
+
interface IImageResizeOption {
|
|
161
|
+
label: string;
|
|
162
|
+
value: string;
|
|
163
|
+
}
|
|
164
|
+
interface IImageResizeConfig {
|
|
165
|
+
/** Resize unit for editor-owned image resize actions. Omit to preserve legacy behavior. */
|
|
166
|
+
resizeUnit?: ImageResizeUnit;
|
|
167
|
+
/** Values for the built-in 30%/50%/100% preset buttons, in their existing order. */
|
|
168
|
+
resizeOptions?: IImageResizeOption[];
|
|
169
|
+
/** Validate normalized image dimensions before they are written to the document. */
|
|
170
|
+
checkImageSize?: (payload: IImageResizeCheckPayload) => boolean | undefined | string;
|
|
171
|
+
}
|
|
172
|
+
interface IEmotionConfig {
|
|
173
|
+
emotions: string[];
|
|
174
|
+
}
|
|
175
|
+
interface IInsertTableConfig {
|
|
176
|
+
minWidth: number;
|
|
177
|
+
minRowHeight: number;
|
|
178
|
+
tableHeader: {
|
|
179
|
+
selected: boolean;
|
|
180
|
+
};
|
|
181
|
+
tableFullWidth: {
|
|
182
|
+
selected: boolean;
|
|
183
|
+
};
|
|
184
|
+
widthExportMode: TableWidthExportMode;
|
|
185
|
+
}
|
|
186
|
+
interface IInsertTableColConfig {
|
|
187
|
+
insertPosition: 'before' | 'after';
|
|
188
|
+
}
|
|
189
|
+
interface ILinkConfig {
|
|
190
|
+
checkLink: (text: string, url: string) => string | boolean | undefined;
|
|
191
|
+
parseLinkUrl: (url: string) => string;
|
|
192
|
+
}
|
|
193
|
+
interface IInsertVideoConfig {
|
|
194
|
+
onInsertedVideo: (videoNode: VideoElement) => NodeEntry | Range;
|
|
195
|
+
checkVideo: (src: string, poster: string) => string | boolean | undefined;
|
|
196
|
+
parseVideoSrc: (url: string) => string;
|
|
197
|
+
}
|
|
198
|
+
type IUploadVideoConfig = IUploadConfig;
|
|
199
|
+
type IUploadImageConfig = IUploadConfig & {
|
|
200
|
+
base64LimitSize: number;
|
|
201
|
+
};
|
|
202
|
+
interface ICodeLangConfig {
|
|
203
|
+
codeLangs: {
|
|
204
|
+
text: string;
|
|
205
|
+
value: string;
|
|
206
|
+
selected?: boolean;
|
|
207
|
+
}[];
|
|
208
|
+
}
|
|
209
|
+
interface ICodeBlockConfig {
|
|
210
|
+
showCopyButton?: boolean;
|
|
211
|
+
}
|
|
212
|
+
interface IMenuConfig {
|
|
213
|
+
bold: ISingleMenuConfig;
|
|
214
|
+
underline: ISingleMenuConfig;
|
|
215
|
+
wavyUnderline: ISingleMenuConfig;
|
|
216
|
+
emphasisDot: ISingleMenuConfig;
|
|
217
|
+
italic: ISingleMenuConfig;
|
|
218
|
+
through: ISingleMenuConfig;
|
|
219
|
+
code: ISingleMenuConfig;
|
|
220
|
+
sub: ISingleMenuConfig;
|
|
221
|
+
sup: ISingleMenuConfig;
|
|
222
|
+
clearStyle: ISingleMenuConfig;
|
|
223
|
+
color: IColorConfig;
|
|
224
|
+
bgColor: IColorConfig;
|
|
225
|
+
fontSize: IFontSizeConfig;
|
|
226
|
+
fontFamily: IFontFamilyConfig;
|
|
227
|
+
indent: ISingleMenuConfig;
|
|
228
|
+
delIndent: ISingleMenuConfig;
|
|
229
|
+
justifyLeft: ISingleMenuConfig;
|
|
230
|
+
justifyRight: ISingleMenuConfig;
|
|
231
|
+
justifyCenter: ISingleMenuConfig;
|
|
232
|
+
justifyJustify: ISingleMenuConfig;
|
|
233
|
+
lineHeight: ILineHeightConfig;
|
|
234
|
+
insertImage: IInsertImageConfig;
|
|
235
|
+
deleteImage: ISingleMenuConfig;
|
|
236
|
+
editImage: IEditImageConfig;
|
|
237
|
+
previewImage: ISingleMenuConfig;
|
|
238
|
+
viewImageLink: ISingleMenuConfig;
|
|
239
|
+
imageWidth30: ISingleMenuConfig;
|
|
240
|
+
imageWidth50: ISingleMenuConfig;
|
|
241
|
+
imageWidth100: ISingleMenuConfig;
|
|
242
|
+
editorImageSizeMenu: ISingleMenuConfig;
|
|
243
|
+
divider: ISingleMenuConfig;
|
|
244
|
+
emotion: IEmotionConfig;
|
|
245
|
+
insertLink: ILinkConfig;
|
|
246
|
+
editLink: ILinkConfig;
|
|
247
|
+
unLink: ISingleMenuConfig;
|
|
248
|
+
viewLink: ISingleMenuConfig;
|
|
249
|
+
codeBlock: ICodeBlockConfig;
|
|
250
|
+
blockquote: ISingleMenuConfig;
|
|
251
|
+
headerSelect: ISingleMenuConfig;
|
|
252
|
+
header1: ISingleMenuConfig;
|
|
253
|
+
header2: ISingleMenuConfig;
|
|
254
|
+
header3: ISingleMenuConfig;
|
|
255
|
+
header4: ISingleMenuConfig;
|
|
256
|
+
header5: ISingleMenuConfig;
|
|
257
|
+
header6: ISingleMenuConfig;
|
|
258
|
+
todo: ISingleMenuConfig;
|
|
259
|
+
formatPainter: ISingleMenuConfig;
|
|
260
|
+
redo: ISingleMenuConfig;
|
|
261
|
+
undo: ISingleMenuConfig;
|
|
262
|
+
fullScreen: ISingleMenuConfig;
|
|
263
|
+
enter: ISingleMenuConfig;
|
|
264
|
+
bulletedList: ISingleMenuConfig;
|
|
265
|
+
numberedList: ISingleMenuConfig;
|
|
266
|
+
numberedListLowerAlpha: ISingleMenuConfig;
|
|
267
|
+
insertTable: ISingleMenuConfig;
|
|
268
|
+
deleteTable: ISingleMenuConfig;
|
|
269
|
+
insertTableRow: IInsertTableConfig;
|
|
270
|
+
deleteTableRow: ISingleMenuConfig;
|
|
271
|
+
insertTableCol: IInsertTableColConfig;
|
|
272
|
+
deleteTableCol: ISingleMenuConfig;
|
|
273
|
+
tableHeader: ISingleMenuConfig;
|
|
274
|
+
tableFullWidth: ISingleMenuConfig;
|
|
275
|
+
mergeTableCell: ISingleMenuConfig;
|
|
276
|
+
splitTableCell: ISingleMenuConfig;
|
|
277
|
+
setTableProperty: ISingleMenuConfig;
|
|
278
|
+
setTableCellProperty: ISingleMenuConfig;
|
|
279
|
+
insertVideo: IInsertVideoConfig;
|
|
280
|
+
uploadVideo: IUploadVideoConfig;
|
|
281
|
+
editVideoSize: ISingleMenuConfig;
|
|
282
|
+
editVideoSrc: ISingleMenuConfig;
|
|
283
|
+
uploadImage: IUploadImageConfig;
|
|
284
|
+
codeSelectLang: ICodeLangConfig;
|
|
285
|
+
}
|
|
286
|
+
type IMenuConfigUpdate = { [K in keyof IMenuConfig]?: Partial<IMenuConfig[K]> };
|
|
287
|
+
/**
|
|
288
|
+
* editor config
|
|
289
|
+
*/
|
|
290
|
+
interface IEditorConfig {
|
|
291
|
+
customAlert: (info: string, type: AlertType) => void;
|
|
292
|
+
onCreated?: (editor: IDomEditor) => void;
|
|
293
|
+
onChange?: (editor: IDomEditor) => void;
|
|
294
|
+
onDestroyed?: (editor: IDomEditor) => void;
|
|
295
|
+
onMaxLength?: (editor: IDomEditor) => void;
|
|
296
|
+
onFocus?: (editor: IDomEditor) => void;
|
|
297
|
+
onBlur?: (editor: IDomEditor) => void;
|
|
298
|
+
/**
|
|
299
|
+
* 自定义粘贴。返回 true 则继续粘贴,返回 false 则自行实现粘贴,阻止默认粘贴
|
|
300
|
+
*/
|
|
301
|
+
customPaste?: (editor: IDomEditor, e: ClipboardEvent) => boolean;
|
|
302
|
+
/**
|
|
303
|
+
* 自定义复制。拦截 event 添加或修改 clipboardData 数据
|
|
304
|
+
*/
|
|
305
|
+
customCopy?: (editor: IDomEditor, e: ClipboardEvent) => void;
|
|
306
|
+
/**
|
|
307
|
+
* 自定义 HTML 清洗逻辑。在 setHtml / 初始化 html / 默认粘贴 HTML 前执行。
|
|
308
|
+
* 返回值会继续进入编辑器的 HTML 解析流程。
|
|
309
|
+
*/
|
|
310
|
+
sanitizeHtml?: (html: string) => string;
|
|
311
|
+
/**
|
|
312
|
+
* 文本/段落样式(color/bgColor/fontSize/fontFamily/textAlign/lineHeight/indent)导出模式。
|
|
313
|
+
* - `inline`: 输出 style 属性(默认)
|
|
314
|
+
* - `class`: 输出 class + data-w-e-*,便于严格 CSP 场景使用
|
|
315
|
+
*/
|
|
316
|
+
textStyleMode?: TextStyleMode;
|
|
317
|
+
/**
|
|
318
|
+
* class 模式遇到“不在受支持样式 token 集合中”的值时的处理策略。
|
|
319
|
+
* - `preserve-data`(默认):保留 data-w-e-*,不输出 class/inline,确保可回读但可能不展示
|
|
320
|
+
* - `fallback-inline`:回退为 inline style,优先保证展示
|
|
321
|
+
* - `strict`:直接抛错,阻止静默降级
|
|
322
|
+
*/
|
|
323
|
+
classStylePolicy?: ClassStylePolicy;
|
|
324
|
+
/**
|
|
325
|
+
* class 模式遇到未知值时的通知回调。
|
|
326
|
+
*/
|
|
327
|
+
onClassStyleUnsupported?: (payload: IClassStyleUnsupportedPayload) => void;
|
|
328
|
+
/**
|
|
329
|
+
* class 模式下允许输出 class 的样式 token 注册表。
|
|
330
|
+
* 用于扩展默认 token(需配合业务方自行提供对应 CSS)。
|
|
331
|
+
*/
|
|
332
|
+
styleClassTokens?: Partial<Record<StyleClassTokenType, string[]>>;
|
|
333
|
+
scroll: boolean;
|
|
334
|
+
placeholder?: string;
|
|
335
|
+
readOnly: boolean;
|
|
336
|
+
autoFocus: boolean;
|
|
337
|
+
decorate?: (nodeEntry: NodeEntry) => Range[];
|
|
338
|
+
maxLength?: number;
|
|
339
|
+
imageResize?: IImageResizeConfig;
|
|
340
|
+
MENU_CONF?: IMenuConfigUpdate;
|
|
341
|
+
hoverbarKeys?: IHoverbarConf;
|
|
342
|
+
EXTEND_CONF?: any;
|
|
343
|
+
skipCacheTypes?: string[];
|
|
344
|
+
}
|
|
345
|
+
interface IInsertKeysConfig {
|
|
346
|
+
index: number;
|
|
347
|
+
keys: string | IToolbarMenuKey[];
|
|
348
|
+
replaceFn?: (config: IToolbarMenuKey) => IToolbarMenuKey;
|
|
349
|
+
}
|
|
350
|
+
interface IToolbarMenuItemConf {
|
|
351
|
+
key: string;
|
|
352
|
+
title?: string;
|
|
353
|
+
iconSvg?: string;
|
|
354
|
+
}
|
|
355
|
+
type IToolbarMenuKey = string | IMenuGroup | IToolbarMenuItemConf;
|
|
356
|
+
/**
|
|
357
|
+
* toolbar config
|
|
358
|
+
*/
|
|
359
|
+
interface IToolbarConfig {
|
|
360
|
+
toolbarKeys: IToolbarMenuKey[];
|
|
361
|
+
insertKeys: IInsertKeysConfig | Array<IInsertKeysConfig>;
|
|
362
|
+
excludeKeys: Array<string>;
|
|
363
|
+
modalAppendToBody: boolean;
|
|
364
|
+
}
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region ../core/src/editor/interface.d.ts
|
|
367
|
+
type ElementWithId = Element$1 & {
|
|
368
|
+
id: string;
|
|
369
|
+
};
|
|
370
|
+
type TableSelectionEntry = [NodeEntry<Element$1 & {
|
|
371
|
+
type: unknown;
|
|
372
|
+
rowSpan?: number;
|
|
373
|
+
colSpan?: number;
|
|
374
|
+
hidden?: boolean;
|
|
375
|
+
}>, {
|
|
376
|
+
rtl: number;
|
|
377
|
+
ltr: number;
|
|
378
|
+
ttb: number;
|
|
379
|
+
btt: number;
|
|
380
|
+
}];
|
|
381
|
+
type MoveOptions = Parameters<Editor['move']>[0];
|
|
382
|
+
type getMenuConfigReturnType<K$1> = K$1 extends keyof IMenuConfig ? IMenuConfig[K$1] : ISingleMenuConfig;
|
|
383
|
+
/**
|
|
384
|
+
* 扩展 slate Editor 接口
|
|
385
|
+
*/
|
|
386
|
+
interface IDomEditor extends Editor {
|
|
387
|
+
insertData: (data: DataTransfer) => void;
|
|
388
|
+
setFragmentData: (data: Pick<DataTransfer, 'getData' | 'setData'>) => void;
|
|
389
|
+
getConfig: () => IEditorConfig;
|
|
390
|
+
getMenuConfig: <K$1 extends string>(menuKey: K$1) => getMenuConfigReturnType<K$1>;
|
|
391
|
+
getAllMenuKeys: () => string[];
|
|
392
|
+
alert: (info: string, type: AlertType) => void;
|
|
393
|
+
handleTab: () => void;
|
|
394
|
+
getHtml: () => string;
|
|
395
|
+
getHtmlWithId?: (idKey?: string) => string;
|
|
396
|
+
getText: () => string;
|
|
397
|
+
getSelectionText: () => string;
|
|
398
|
+
getElemsByTypePrefix: (typePrefix: string) => ElementWithId[];
|
|
399
|
+
getElemsByType: (type: string, isPrefix?: boolean) => ElementWithId[];
|
|
400
|
+
getParentNode: (node: Node$1) => Ancestor | null;
|
|
401
|
+
isEmpty: () => boolean;
|
|
402
|
+
clear: () => void;
|
|
403
|
+
/** Transform loaded content before Core binds node paths and renders the editor. */
|
|
404
|
+
transformInitialContent?: (content: Descendant[]) => Descendant[];
|
|
405
|
+
dangerouslyInsertHtml: (html: string, isRecursive?: boolean) => void;
|
|
406
|
+
setHtml: (html: string) => void;
|
|
407
|
+
id: string;
|
|
408
|
+
isDestroyed: boolean;
|
|
409
|
+
isFullScreen: boolean;
|
|
410
|
+
focus: (isEnd?: boolean) => void;
|
|
411
|
+
isFocused: () => boolean;
|
|
412
|
+
blur: () => void;
|
|
413
|
+
updateView: () => void;
|
|
414
|
+
destroy: () => void;
|
|
415
|
+
scrollToElem: (id: string) => void;
|
|
416
|
+
showProgressBar: (progress: number) => void;
|
|
417
|
+
hidePanelOrModal: () => void;
|
|
418
|
+
enable: () => void;
|
|
419
|
+
disable: () => void;
|
|
420
|
+
isDisabled: () => boolean;
|
|
421
|
+
toDOMNode: (node: Node$1) => HTMLElement;
|
|
422
|
+
fullScreen: () => void;
|
|
423
|
+
unFullScreen: () => void;
|
|
424
|
+
getEditableContainer: () => DOMElement$1;
|
|
425
|
+
select: (at: Location) => void;
|
|
426
|
+
deselect: () => void;
|
|
427
|
+
move(options?: MoveOptions): void;
|
|
428
|
+
move(distance: number, reverse?: boolean): void;
|
|
429
|
+
moveReverse: (distance: number) => void;
|
|
430
|
+
restoreSelection: () => void;
|
|
431
|
+
getTableSelection?: () => TableSelectionEntry[][] | null;
|
|
432
|
+
getSelectionPosition: () => Partial<IPositionStyle>;
|
|
433
|
+
getNodePosition: (node: Node$1) => Partial<IPositionStyle>;
|
|
434
|
+
isSelectedAll: () => boolean;
|
|
435
|
+
selectAll: () => void;
|
|
436
|
+
on: (type: string, listener: ee.EventListener) => void;
|
|
437
|
+
off: (type: string, listener: ee.EventListener) => void;
|
|
438
|
+
once: (type: string, listener: ee.EventListener) => void;
|
|
439
|
+
emit: (type: string, ...args: any[]) => void;
|
|
440
|
+
undo?: () => void;
|
|
441
|
+
redo?: () => void;
|
|
442
|
+
clearHistory?: () => void;
|
|
443
|
+
}
|
|
444
|
+
//#endregion
|
|
445
|
+
//#region ../core/src/upload/interface.d.ts
|
|
446
|
+
type IUploadHeaders = Record<string, string | number>;
|
|
447
|
+
interface IUploadResultFile {
|
|
448
|
+
name: string;
|
|
449
|
+
type?: string;
|
|
450
|
+
size?: number;
|
|
451
|
+
[key: string]: any;
|
|
452
|
+
}
|
|
453
|
+
interface IUploadFile {
|
|
454
|
+
name: string;
|
|
455
|
+
type: string;
|
|
456
|
+
size: number;
|
|
457
|
+
data: Blob | File;
|
|
458
|
+
source?: string;
|
|
459
|
+
}
|
|
460
|
+
interface IUploader {
|
|
461
|
+
addFiles: (files: IUploadFile[]) => void;
|
|
462
|
+
upload: () => Promise<unknown>;
|
|
463
|
+
destroy?: () => void;
|
|
464
|
+
}
|
|
465
|
+
type FilesType = Record<string, any>;
|
|
466
|
+
type InsertFn = (src: string, poster?: string, alt?: string, href?: string) => void | Promise<void>;
|
|
467
|
+
interface IUploadAdapterContext {
|
|
468
|
+
config: IUploadConfig;
|
|
469
|
+
editor?: IDomEditor;
|
|
470
|
+
}
|
|
471
|
+
type IUploadAdapter = (context: IUploadAdapterContext) => IUploader;
|
|
472
|
+
interface IBaseUploadConfig {
|
|
473
|
+
fieldName?: string;
|
|
474
|
+
maxFileSize?: number;
|
|
475
|
+
maxNumberOfFiles?: number;
|
|
476
|
+
meta?: Record<string, unknown>;
|
|
477
|
+
metaWithUrl: boolean;
|
|
478
|
+
headers?: IUploadHeaders | ((file: IUploadResultFile) => IUploadHeaders) | undefined;
|
|
479
|
+
withCredentials?: boolean;
|
|
480
|
+
timeout?: number;
|
|
481
|
+
onBeforeUpload?: (files: FilesType) => boolean | FilesType;
|
|
482
|
+
onSuccess: (file: IUploadResultFile, response: any) => void;
|
|
483
|
+
onProgress?: (progress: number) => void;
|
|
484
|
+
onFailed: (file: IUploadResultFile, response: any) => void;
|
|
485
|
+
onError: (file: IUploadResultFile, error: any, res: any) => void;
|
|
486
|
+
allowedFileTypes?: string[];
|
|
487
|
+
customInsert?: (res: any, insertFn: InsertFn) => void;
|
|
488
|
+
customUpload?: (files: File, insertFn: InsertFn, editor: IDomEditor) => void;
|
|
489
|
+
customBrowseAndUpload?: (insertFn: InsertFn) => void;
|
|
490
|
+
uploadAdapter?: IUploadAdapter;
|
|
491
|
+
uppyConfig?: Record<string, any>;
|
|
492
|
+
xhrConfig?: Record<string, any>;
|
|
493
|
+
}
|
|
494
|
+
interface IUploadConfigWithCustomUpload extends IBaseUploadConfig {
|
|
495
|
+
server?: string;
|
|
496
|
+
customUpload: (files: File, insertFn: InsertFn, editor: IDomEditor) => void;
|
|
497
|
+
}
|
|
498
|
+
interface IUploadConfigWithUploadAdapter extends IBaseUploadConfig {
|
|
499
|
+
server?: string;
|
|
500
|
+
uploadAdapter: IUploadAdapter;
|
|
501
|
+
customUpload?: (files: File, insertFn: InsertFn, editor: IDomEditor) => void;
|
|
502
|
+
}
|
|
503
|
+
interface IUploadConfigWithoutCustomUpload extends IBaseUploadConfig {
|
|
504
|
+
server: string;
|
|
505
|
+
customUpload?: never;
|
|
506
|
+
uploadAdapter?: never;
|
|
507
|
+
}
|
|
508
|
+
/**
|
|
509
|
+
* 配置参考 https://uppy.io/docs/uppy/
|
|
510
|
+
*/
|
|
511
|
+
type IUploadConfig = IUploadConfigWithCustomUpload | IUploadConfigWithUploadAdapter | IUploadConfigWithoutCustomUpload;
|
|
512
|
+
//#endregion
|
|
513
|
+
//#region ../core/src/menus/bar/Toolbar.d.ts
|
|
514
|
+
type MenuType$1 = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
515
|
+
declare class Toolbar {
|
|
516
|
+
$box: Dom7Array;
|
|
517
|
+
private readonly $toolbar;
|
|
518
|
+
private menus;
|
|
519
|
+
private toolbarItems;
|
|
520
|
+
private config;
|
|
521
|
+
private lngListen;
|
|
522
|
+
constructor(boxSelector: string | DOMElement$1, config: Partial<IToolbarConfig>);
|
|
523
|
+
getMenus(): {
|
|
524
|
+
[key: string]: MenuType$1;
|
|
525
|
+
};
|
|
526
|
+
getConfig(): Partial<IToolbarConfig>;
|
|
527
|
+
private initToolbar;
|
|
528
|
+
private registerItems;
|
|
529
|
+
private isMenuGroup;
|
|
530
|
+
private registerSingleMenuByConf;
|
|
531
|
+
private registerGroup;
|
|
532
|
+
private registerSingleItem;
|
|
533
|
+
private getEditorInstance;
|
|
534
|
+
private syncToolbarState;
|
|
535
|
+
/**
|
|
536
|
+
* editor onChange 时触发(涉及 DOM 操作,加防抖)
|
|
537
|
+
*/
|
|
538
|
+
changeToolbarState: any;
|
|
539
|
+
/**
|
|
540
|
+
* 销毁 toolbar
|
|
541
|
+
*/
|
|
542
|
+
destroy(): void;
|
|
543
|
+
}
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region ../core/src/menus/panel-and-modal/Modal.d.ts
|
|
546
|
+
/**
|
|
547
|
+
* 生成 modal input elems
|
|
548
|
+
* @param labelText label text
|
|
549
|
+
* @param inputId input dom id
|
|
550
|
+
* @param placeholder input placeholder
|
|
551
|
+
* @returns [$container, $input]
|
|
552
|
+
*/
|
|
553
|
+
declare function genModalInputElems(labelText: string, inputId: string, placeholder?: string): DOMElement$1[];
|
|
554
|
+
/**
|
|
555
|
+
* 生成 modal textarea elems
|
|
556
|
+
* @param labelText label text
|
|
557
|
+
* @param textareaId input dom id
|
|
558
|
+
* @param placeholder input placeholder
|
|
559
|
+
* @returns [$container, $textarea]
|
|
560
|
+
*/
|
|
561
|
+
declare function genModalTextareaElems(labelText: string, textareaId: string, placeholder?: string): DOMElement$1[];
|
|
562
|
+
/**
|
|
563
|
+
* 生成 modal button elems
|
|
564
|
+
* @param buttonId button dom id
|
|
565
|
+
* @param buttonText button text
|
|
566
|
+
* @returns [ $container, $button ]
|
|
567
|
+
*/
|
|
568
|
+
declare function genModalButtonElems(buttonId: string, buttonText: string): DOMElement$1[];
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region ../core/src/parse-html/index.d.ts
|
|
571
|
+
type PreParseHtmlFnType = ($node: DOMElement$1) => DOMElement$1;
|
|
572
|
+
interface IPreParseHtmlConf {
|
|
573
|
+
selector: string;
|
|
574
|
+
preParseHtml: PreParseHtmlFnType;
|
|
575
|
+
}
|
|
576
|
+
type ParseStyleHtmlFnType = ($node: DOMElement$1, node: Descendant, editor: IDomEditor) => Descendant;
|
|
577
|
+
type ParseElemHtmlFnType = ($elem: DOMElement$1, children: Descendant[], editor: IDomEditor) => Element$1 | Element$1[];
|
|
578
|
+
interface IParseElemHtmlConf {
|
|
579
|
+
selector: string;
|
|
580
|
+
parseElemHtml: ParseElemHtmlFnType;
|
|
581
|
+
}
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region ../core/src/render/index.d.ts
|
|
584
|
+
type RenderStyleFnType = (node: Descendant, vnode: VNode, editor?: IDomEditor) => VNode;
|
|
585
|
+
type RenderElemFnType = (elemNode: Element$1, children: VNode[] | null, editor: IDomEditor) => VNode;
|
|
586
|
+
interface IRenderElemConf {
|
|
587
|
+
type: string;
|
|
588
|
+
renderElem: RenderElemFnType;
|
|
589
|
+
}
|
|
590
|
+
//#endregion
|
|
591
|
+
//#region ../core/src/to-html/node2html.d.ts
|
|
592
|
+
interface INodeToHtmlOptions {
|
|
593
|
+
includeId?: boolean;
|
|
594
|
+
idKey?: string;
|
|
595
|
+
}
|
|
596
|
+
//#endregion
|
|
597
|
+
//#region ../core/src/to-html/index.d.ts
|
|
598
|
+
type styleToHtmlFnType = (node: Descendant, elemHtml: string, editor?: IDomEditor) => string;
|
|
599
|
+
/**
|
|
600
|
+
* Transform the HTML fragments of the document's top-level nodes.
|
|
601
|
+
*
|
|
602
|
+
* Element serializers intentionally stay node-local. Modules that need
|
|
603
|
+
* neighboring blocks to produce valid HTML (for example semantic lists) use
|
|
604
|
+
* this hook after every node has been serialized.
|
|
605
|
+
*/
|
|
606
|
+
type HtmlTransformFnType = (htmlList: string[], nodes: Descendant[], editor: IDomEditor, options: INodeToHtmlOptions) => string[];
|
|
607
|
+
interface IElemToHtmlRes {
|
|
608
|
+
html: string;
|
|
609
|
+
prefix?: string;
|
|
610
|
+
suffix?: string;
|
|
611
|
+
}
|
|
612
|
+
type ElemToHtmlFnType = (elemNode: Element$1, childrenHtml: string, editor?: IDomEditor) => string | IElemToHtmlRes;
|
|
613
|
+
interface IElemToHtmlConf {
|
|
614
|
+
type: string;
|
|
615
|
+
elemToHtml: ElemToHtmlFnType;
|
|
616
|
+
}
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region ../core/src/config/style-mode.d.ts
|
|
619
|
+
declare function getTextStyleMode(editor?: IDomEditor): TextStyleMode;
|
|
620
|
+
declare function getClassStylePolicy(editor?: IDomEditor): ClassStylePolicy;
|
|
621
|
+
declare function reportUnsupportedClassStyle(editor: IDomEditor | undefined, payload: IClassStyleUnsupportedPayload): void;
|
|
622
|
+
//#endregion
|
|
623
|
+
//#region ../core/src/menus/bar/HoverBar.d.ts
|
|
624
|
+
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
625
|
+
declare class HoverBar {
|
|
626
|
+
private readonly $elem;
|
|
627
|
+
private menus;
|
|
628
|
+
private hoverbarItems;
|
|
629
|
+
private prevSelectedNode;
|
|
630
|
+
private isShow;
|
|
631
|
+
private lngListen;
|
|
632
|
+
constructor();
|
|
633
|
+
getMenus(): {
|
|
634
|
+
[key: string]: MenuType;
|
|
635
|
+
};
|
|
636
|
+
hideAndClean(): void;
|
|
637
|
+
/**
|
|
638
|
+
* 判断 hoverbar 是否在网页下部?
|
|
639
|
+
* 如果是,SelectList 和 DropPanel 要显示在 hoverbar 上面
|
|
640
|
+
*/
|
|
641
|
+
private checkPositionBottom;
|
|
642
|
+
private show;
|
|
643
|
+
private changeItemsState;
|
|
644
|
+
private registerItems;
|
|
645
|
+
private registerSingleItem;
|
|
646
|
+
private setPosition;
|
|
647
|
+
/**
|
|
648
|
+
* 获取选中的 node ,以及对应的 menu keys
|
|
649
|
+
*/
|
|
650
|
+
private getSelectedNodeAndMenuKeys;
|
|
651
|
+
/**
|
|
652
|
+
* editor onChange 时触发(涉及 DOM 操作,加防抖)
|
|
653
|
+
*/
|
|
654
|
+
changeHoverbarState: any;
|
|
655
|
+
private getEditorInstance;
|
|
656
|
+
private getHoverbarKeysConf;
|
|
657
|
+
/**
|
|
658
|
+
* 检查两个 node 是否 path 相等
|
|
659
|
+
*/
|
|
660
|
+
private isSamePath;
|
|
661
|
+
/**
|
|
662
|
+
* 销毁 hoverbar
|
|
663
|
+
*/
|
|
664
|
+
destroy(): void;
|
|
665
|
+
}
|
|
666
|
+
//#endregion
|
|
667
|
+
//#region ../core/src/text-area/TextArea.d.ts
|
|
668
|
+
declare class TextArea {
|
|
669
|
+
private selectionChangeRoot;
|
|
670
|
+
private destroyed;
|
|
671
|
+
readonly id: number;
|
|
672
|
+
$box: Dom7Array;
|
|
673
|
+
$textAreaContainer: Dom7Array;
|
|
674
|
+
$scroll: Dom7Array;
|
|
675
|
+
$textArea: Dom7Array | null;
|
|
676
|
+
private readonly $progressBar;
|
|
677
|
+
private readonly $maxLengthInfo;
|
|
678
|
+
isComposing: boolean;
|
|
679
|
+
isUpdatingSelection: boolean;
|
|
680
|
+
isDraggingInternally: boolean;
|
|
681
|
+
latestElement: DOMElement$1 | null;
|
|
682
|
+
showPlaceholder: boolean;
|
|
683
|
+
$placeholder: Dom7Array | null;
|
|
684
|
+
private latestEditorSelection;
|
|
685
|
+
constructor(boxSelector: string | DOMElement$1);
|
|
686
|
+
private get editorInstance();
|
|
687
|
+
private getActiveEditor;
|
|
688
|
+
private bindSelectionChange;
|
|
689
|
+
private onDOMSelectionChange;
|
|
690
|
+
flushDOMSelectionChange(): void;
|
|
691
|
+
/**
|
|
692
|
+
* 绑定事件,如 beforeinput onblur onfocus keydown click copy/paste drag/drop 等
|
|
693
|
+
*/
|
|
694
|
+
private bindEvent;
|
|
695
|
+
private onFocusAndOnBlur;
|
|
696
|
+
/**
|
|
697
|
+
* 修改 maxLength 提示信息
|
|
698
|
+
*/
|
|
699
|
+
private changeMaxLengthInfo;
|
|
700
|
+
/**
|
|
701
|
+
* 修改进度条
|
|
702
|
+
* @param progress 进度
|
|
703
|
+
*/
|
|
704
|
+
changeProgress(progress: number): void;
|
|
705
|
+
/**
|
|
706
|
+
* 修改 view 状态
|
|
707
|
+
*/
|
|
708
|
+
changeViewState(): void;
|
|
709
|
+
/**
|
|
710
|
+
* 销毁 textarea
|
|
711
|
+
*/
|
|
712
|
+
destroy(): void;
|
|
713
|
+
}
|
|
714
|
+
//#endregion
|
|
715
|
+
//#region ../core/src/utils/key.d.ts
|
|
716
|
+
/**
|
|
717
|
+
* An auto-incrementing identifier for keys.
|
|
718
|
+
*/
|
|
719
|
+
/**
|
|
720
|
+
* A class that keeps track of a key string. We use a full class here because we
|
|
721
|
+
* want to be able to use them as keys in `WeakMap` objects.
|
|
722
|
+
*/
|
|
723
|
+
declare class Key {
|
|
724
|
+
id: string;
|
|
725
|
+
constructor();
|
|
726
|
+
}
|
|
727
|
+
//#endregion
|
|
728
|
+
//#region ../core/src/editor/dom-editor.d.ts
|
|
729
|
+
/**
|
|
730
|
+
* 自定义全局 command
|
|
731
|
+
*/
|
|
732
|
+
declare const DomEditor: {
|
|
733
|
+
/**
|
|
734
|
+
* Return the host window of the current editor.
|
|
735
|
+
*/
|
|
736
|
+
getWindow(editor: IDomEditor): Window;
|
|
737
|
+
/**
|
|
738
|
+
* Find a key for a Slate node.
|
|
739
|
+
* key 即一个累加不重复的 id ,每一个 slate node 都对对应一个 key ,意思相当于 node.id
|
|
740
|
+
*/
|
|
741
|
+
findKey(editor: IDomEditor | null, node: Node$1): Key;
|
|
742
|
+
setNewKey(node: Node$1): void;
|
|
743
|
+
/**
|
|
744
|
+
* Find the path of Slate node.
|
|
745
|
+
* path 是一个数组,代表 slate node 的位置 https://docs.slatejs.org/concepts/03-locations#path
|
|
746
|
+
*/
|
|
747
|
+
findPath(editor: IDomEditor | null, node: Node$1): Path;
|
|
748
|
+
/**
|
|
749
|
+
* Find the DOM node that implements DocumentOrShadowRoot for the editor.
|
|
750
|
+
*/
|
|
751
|
+
findDocumentOrShadowRoot(editor: IDomEditor): Document | ShadowRoot;
|
|
752
|
+
/**
|
|
753
|
+
* 获取父节点
|
|
754
|
+
* @param editor editor
|
|
755
|
+
* @param node cur node
|
|
756
|
+
*/
|
|
757
|
+
getParentNode(editor: IDomEditor | null, node: Node$1): Ancestor | null;
|
|
758
|
+
/**
|
|
759
|
+
* 获取当前节点的所有父节点
|
|
760
|
+
* @param editor editor
|
|
761
|
+
* @param node cur node
|
|
762
|
+
*/
|
|
763
|
+
getParentsNodes(editor: IDomEditor, node: Node$1): Ancestor[];
|
|
764
|
+
/**
|
|
765
|
+
* 获取当前节点对应的顶级节点
|
|
766
|
+
* @param editor editor
|
|
767
|
+
* @param curNode cur node
|
|
768
|
+
*/
|
|
769
|
+
getTopNode(editor: IDomEditor, curNode: Node$1): Node$1;
|
|
770
|
+
/**
|
|
771
|
+
* Find the native DOM element from a Slate node or editor.
|
|
772
|
+
*/
|
|
773
|
+
toDOMNode(editor: IDomEditor, node: Node$1): HTMLElement;
|
|
774
|
+
/**
|
|
775
|
+
* Check if a Slate node currently has a mapped DOM node.
|
|
776
|
+
* During IME/composition transitions the Slate tree can update before DOM patching finishes.
|
|
777
|
+
*/
|
|
778
|
+
hasDOMNodeBySlateNode(editor: IDomEditor, node: Node$1): boolean;
|
|
779
|
+
/**
|
|
780
|
+
* Check if both range endpoints can be resolved to DOM nodes right now.
|
|
781
|
+
*/
|
|
782
|
+
canResolveDOMRange(editor: IDomEditor, range: Range): boolean;
|
|
783
|
+
/**
|
|
784
|
+
* Check if a DOM node is within the editor.
|
|
785
|
+
*/
|
|
786
|
+
hasDOMNode(editor: IDomEditor, target: DOMNode, options?: {
|
|
787
|
+
editable?: boolean;
|
|
788
|
+
}): boolean;
|
|
789
|
+
/**
|
|
790
|
+
* Find a native DOM range from a Slate `range`.
|
|
791
|
+
*
|
|
792
|
+
* Notice: the returned range will always be ordinal regardless of the direction of Slate `range` due to DOM API limit.
|
|
793
|
+
*
|
|
794
|
+
* there is no way to create a reverse DOM Range using Range.setStart/setEnd
|
|
795
|
+
* according to https://dom.spec.whatwg.org/#concept-range-bp-set.
|
|
796
|
+
*/
|
|
797
|
+
toDOMRange(editor: IDomEditor, range: Range): DOMRange;
|
|
798
|
+
/**
|
|
799
|
+
* Find a native DOM selection point from a Slate point.
|
|
800
|
+
*/
|
|
801
|
+
toDOMPoint(editor: IDomEditor, point: Point): DOMPoint;
|
|
802
|
+
/**
|
|
803
|
+
* Find a Slate node from a native DOM `element`.
|
|
804
|
+
*/
|
|
805
|
+
toSlateNode(editor: IDomEditor | null, domNode: DOMNode): Node$1;
|
|
806
|
+
/**
|
|
807
|
+
* Get the target range from a DOM `event`.
|
|
808
|
+
*/
|
|
809
|
+
findEventRange(editor: IDomEditor, event: any): Range;
|
|
810
|
+
/**
|
|
811
|
+
* Find a Slate range from a DOM range or selection.
|
|
812
|
+
*/
|
|
813
|
+
toSlateRange<T extends boolean>(editor: IDomEditor, domRange: DOMRange | DOMStaticRange | DOMSelection, options: {
|
|
814
|
+
exactMatch: T;
|
|
815
|
+
suppressThrow: T;
|
|
816
|
+
}): T extends true ? Range | null : Range;
|
|
817
|
+
/**
|
|
818
|
+
* Find a Slate point from a DOM selection's `domNode` and `domOffset`.
|
|
819
|
+
*/
|
|
820
|
+
toSlatePoint<T extends boolean>(editor: IDomEditor, domPoint: DOMPoint, options: {
|
|
821
|
+
exactMatch: T;
|
|
822
|
+
suppressThrow: T;
|
|
823
|
+
searchDirection?: "forward" | "backward";
|
|
824
|
+
}): T extends true ? Point | null : Point;
|
|
825
|
+
hasRange(editor: IDomEditor, range: Range): boolean;
|
|
826
|
+
getNodeType(node: Node$1): string;
|
|
827
|
+
checkNodeType(node: Node$1, type: string): boolean;
|
|
828
|
+
getNodesStr(nodes: Node$1[]): string;
|
|
829
|
+
getSelectedVoidNode(editor: IDomEditor): Element$1 | null;
|
|
830
|
+
getSelectedElems(editor: IDomEditor): Element$1[];
|
|
831
|
+
getSelectedNodeByType(editor: IDomEditor, type: string): Node$1 | null;
|
|
832
|
+
getSelectedTextNode(editor: IDomEditor): Node$1 | null;
|
|
833
|
+
isNodeSelected(editor: IDomEditor, node: Node$1): boolean;
|
|
834
|
+
isSelectionAtLineEnd(editor: IDomEditor, path: Path): boolean;
|
|
835
|
+
getTextarea(editor: IDomEditor): TextArea;
|
|
836
|
+
getToolbar(editor: IDomEditor): Toolbar | null;
|
|
837
|
+
getHoverbar(editor: IDomEditor): HoverBar | null;
|
|
838
|
+
normalizeContent(editor: IDomEditor): void;
|
|
839
|
+
/**
|
|
840
|
+
* 获取:距离触发 maxLength,还可以插入多少字符
|
|
841
|
+
* @param editor editor
|
|
842
|
+
*/
|
|
843
|
+
getLeftLengthOfMaxLength(editor: IDomEditor): number;
|
|
844
|
+
cleanExposedTexNodeInSelectionBlock(editor: IDomEditor): void;
|
|
845
|
+
/**
|
|
846
|
+
* 是否是编辑器里最后一个元素
|
|
847
|
+
* @param editor editor
|
|
848
|
+
* @param node node
|
|
849
|
+
*/
|
|
850
|
+
isLastNode(editor: IDomEditor, node: Node$1): boolean;
|
|
851
|
+
/**
|
|
852
|
+
* 生成空白 paragraph
|
|
853
|
+
*/
|
|
854
|
+
genEmptyParagraph(): Element$1;
|
|
855
|
+
/**
|
|
856
|
+
* 是否选中了 void node
|
|
857
|
+
* @param editor editor
|
|
858
|
+
*/
|
|
859
|
+
isSelectedVoidNode(editor: IDomEditor): boolean;
|
|
860
|
+
/**
|
|
861
|
+
* 选区是否在一个空行
|
|
862
|
+
* @param editor editor
|
|
863
|
+
*/
|
|
864
|
+
isSelectedEmptyParagraph(editor: IDomEditor): boolean | undefined;
|
|
865
|
+
/**
|
|
866
|
+
* 当前 path 指向的 node ,是否是空的(无内容)
|
|
867
|
+
* @param editor editor
|
|
868
|
+
* @param path path
|
|
869
|
+
*/
|
|
870
|
+
isEmptyPath(editor: IDomEditor, path: Path): boolean;
|
|
871
|
+
};
|
|
872
|
+
//#endregion
|
|
873
|
+
//#region ../core/src/i18n/index.d.ts
|
|
874
|
+
/**
|
|
875
|
+
* 添加多语言配置
|
|
876
|
+
* @param lng 语言
|
|
877
|
+
* @param resources 多语言配置
|
|
878
|
+
*/
|
|
879
|
+
declare function i18nAddResources(lng: string, resources: object): void;
|
|
880
|
+
/**
|
|
881
|
+
* 设置语言
|
|
882
|
+
* @param lng 语言
|
|
883
|
+
*/
|
|
884
|
+
declare function i18nChangeLanguage(lng: string): void;
|
|
885
|
+
/**
|
|
886
|
+
* 获取多语言配置
|
|
887
|
+
* @param lng lang
|
|
888
|
+
*/
|
|
889
|
+
declare function i18nGetResources(lng: string): any;
|
|
890
|
+
/**
|
|
891
|
+
* 翻译
|
|
892
|
+
*/
|
|
893
|
+
declare const t: i18next0.TFunction<["translation", ...string[]], undefined>;
|
|
894
|
+
//#endregion
|
|
895
|
+
//#region ../core/src/index.d.ts
|
|
896
|
+
interface IModuleConf {
|
|
897
|
+
menus: Array<IRegisterMenuConf>;
|
|
898
|
+
renderStyle: RenderStyleFnType;
|
|
899
|
+
renderElems: Array<IRenderElemConf>;
|
|
900
|
+
styleToHtml: styleToHtmlFnType;
|
|
901
|
+
htmlTransform?: HtmlTransformFnType;
|
|
902
|
+
elemsToHtml: Array<IElemToHtmlConf>;
|
|
903
|
+
preParseHtml: Array<IPreParseHtmlConf>;
|
|
904
|
+
parseStyleHtml: ParseStyleHtmlFnType;
|
|
905
|
+
parseElemsHtml: Array<IParseElemHtmlConf>;
|
|
906
|
+
editorPlugin: <T extends IDomEditor>(editor: T) => T;
|
|
907
|
+
}
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region src/Boot.d.ts
|
|
910
|
+
type PluginType = <T extends IDomEditor>(editor: T) => T;
|
|
911
|
+
declare class Boot {
|
|
912
|
+
constructor();
|
|
913
|
+
static editorConfig: Partial<IEditorConfig>;
|
|
914
|
+
static setEditorConfig(newConfig?: Partial<IEditorConfig>): void;
|
|
915
|
+
static simpleEditorConfig: Partial<IEditorConfig>;
|
|
916
|
+
static setSimpleEditorConfig(newConfig?: Partial<IEditorConfig>): void;
|
|
917
|
+
static toolbarConfig: Partial<IToolbarConfig>;
|
|
918
|
+
static setToolbarConfig(newConfig?: Partial<IToolbarConfig>): void;
|
|
919
|
+
static simpleToolbarConfig: Partial<IToolbarConfig>;
|
|
920
|
+
static setSimpleToolbarConfig(newConfig?: Partial<IToolbarConfig>): void;
|
|
921
|
+
static plugins: PluginType[];
|
|
922
|
+
static registerPlugin(plugin: PluginType): void;
|
|
923
|
+
static registerMenu(menuConf: IRegisterMenuConf, customConfig?: ISingleMenuConfig): void;
|
|
924
|
+
static registerRenderElem(renderElemConf: IRenderElemConf): void;
|
|
925
|
+
static registerRenderStyle(fn: RenderStyleFnType): void;
|
|
926
|
+
static registerElemToHtml(elemToHtmlConf: IElemToHtmlConf): void;
|
|
927
|
+
static registerStyleToHtml(fn: styleToHtmlFnType): void;
|
|
928
|
+
static registerHtmlTransform(fn: HtmlTransformFnType): void;
|
|
929
|
+
static registerPreParseHtml(preParseHtmlConf: IPreParseHtmlConf): void;
|
|
930
|
+
static registerParseElemHtml(parseElemHtmlConf: IParseElemHtmlConf): void;
|
|
931
|
+
static registerParseStyleHtml(fn: ParseStyleHtmlFnType): void;
|
|
932
|
+
static registerModule(module: Partial<IModuleConf>): void;
|
|
933
|
+
}
|
|
934
|
+
//#endregion
|
|
935
|
+
//#region src/create.d.ts
|
|
936
|
+
interface ICreateEditorOption {
|
|
937
|
+
selector: string | DOMElement;
|
|
938
|
+
config: Partial<IEditorConfig>;
|
|
939
|
+
content?: Descendant[];
|
|
940
|
+
html?: string;
|
|
941
|
+
mode: string;
|
|
942
|
+
}
|
|
943
|
+
interface ICreateToolbarOption {
|
|
944
|
+
editor: IDomEditor | null;
|
|
945
|
+
selector: string | DOMElement;
|
|
946
|
+
config?: Partial<IToolbarConfig>;
|
|
947
|
+
mode?: string;
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* 创建 editor 实例
|
|
951
|
+
*/
|
|
952
|
+
declare function createEditor(option?: Partial<ICreateEditorOption>): IDomEditor;
|
|
953
|
+
/**
|
|
954
|
+
* 创建 toolbar 实例
|
|
955
|
+
*/
|
|
956
|
+
declare function createToolbar(option: ICreateToolbarOption): Toolbar;
|
|
957
|
+
//#endregion
|
|
958
|
+
//#region src/core.d.ts
|
|
959
|
+
interface IEditorExtension {
|
|
960
|
+
key?: string;
|
|
961
|
+
module: Partial<IModuleConf>;
|
|
962
|
+
}
|
|
963
|
+
type EditorExtension = Partial<IModuleConf> | IEditorExtension;
|
|
964
|
+
interface ICreateEditorFactoryOption {
|
|
965
|
+
extensions?: EditorExtension[];
|
|
966
|
+
editorConfig?: Partial<IEditorConfig>;
|
|
967
|
+
toolbarConfig?: Partial<IToolbarConfig>;
|
|
968
|
+
}
|
|
969
|
+
type ICreateToolbarWithEditorOption = Omit<ICreateToolbarOption, 'editor'>;
|
|
970
|
+
interface ICreateWithFactoryOption {
|
|
971
|
+
editor?: Partial<ICreateEditorOption>;
|
|
972
|
+
toolbar?: ICreateToolbarWithEditorOption;
|
|
973
|
+
}
|
|
974
|
+
interface IEditorFactory {
|
|
975
|
+
create: (option?: ICreateWithFactoryOption) => {
|
|
976
|
+
editor: IDomEditor;
|
|
977
|
+
toolbar: Toolbar | null;
|
|
978
|
+
};
|
|
979
|
+
createEditor: (option?: Partial<ICreateEditorOption>) => IDomEditor;
|
|
980
|
+
createToolbar: (option: ICreateToolbarOption) => Toolbar;
|
|
981
|
+
registerExtensions: (extensions: EditorExtension[]) => void;
|
|
982
|
+
}
|
|
983
|
+
/**
|
|
984
|
+
* Register extensions (modules) once.
|
|
985
|
+
* Similar to tiptap's extensions list, this helper avoids duplicate registration
|
|
986
|
+
* when the same module reference (or explicit extension key) is reused.
|
|
987
|
+
*/
|
|
988
|
+
declare function registerExtensions(extensions?: EditorExtension[]): void;
|
|
989
|
+
/**
|
|
990
|
+
* Create a reusable factory for on-demand composition, close to tiptap's setup style.
|
|
991
|
+
*/
|
|
992
|
+
declare function createEditorFactory(option?: ICreateEditorFactoryOption): IEditorFactory;
|
|
993
|
+
declare const _default: {};
|
|
994
|
+
//#endregion
|
|
995
|
+
export { Boot, type ClassStylePolicy, DomEditor, EditorExtension, type IButtonMenu, type IClassStyleUnsupportedPayload, ICreateEditorFactoryOption, ICreateToolbarWithEditorOption, ICreateWithFactoryOption, type IDomEditor, type IDropPanelMenu, type IEditorConfig, IEditorExtension, IEditorFactory, type IModalMenu, type IModuleConf, type IOption, type ISelectMenu, type IToolbarConfig, type SlateDescendant, SlateEditor, SlateElement, type SlateLocation, SlateNode, SlatePath, SlatePoint, SlateRange, SlateText, SlateTransforms, type StyleClassTokenType, type TextStyleMode, Toolbar, createEditor, createEditorFactory, createToolbar, _default as default, genModalButtonElems, genModalInputElems, genModalTextareaElems, getClassStylePolicy, getTextStyleMode, i18nAddResources, i18nChangeLanguage, i18nGetResources, registerExtensions, reportUnsupportedClassStyle, t };
|
|
996
|
+
//# sourceMappingURL=core.d.ts.map
|