@wangeditor-next/plugin-float-image 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/basic-modules/src/constants/icon-svg.d.ts +47 -0
- package/dist/basic-modules/src/index.d.ts +9 -0
- package/dist/basic-modules/src/locale/en.d.ts +101 -0
- package/dist/basic-modules/src/locale/index.d.ts +5 -0
- package/dist/basic-modules/src/locale/zh-CN.d.ts +101 -0
- package/dist/basic-modules/src/modules/blockquote/custom-types.d.ts +9 -0
- package/dist/basic-modules/src/modules/blockquote/elem-to-html.d.ts +11 -0
- package/dist/basic-modules/src/modules/blockquote/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/blockquote/menu/BlockquoteMenu.d.ts +20 -0
- package/dist/basic-modules/src/modules/blockquote/menu/index.d.ts +9 -0
- package/dist/basic-modules/src/modules/blockquote/parse-elem-html.d.ts +14 -0
- package/dist/basic-modules/src/modules/blockquote/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/blockquote/render-elem.d.ts +20 -0
- package/dist/basic-modules/src/modules/code-block/custom-types.d.ts +17 -0
- package/dist/basic-modules/src/modules/code-block/elem-to-html.d.ts +16 -0
- package/dist/basic-modules/src/modules/code-block/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/code-block/menu/CodeBlockMenu.d.ts +22 -0
- package/dist/basic-modules/src/modules/code-block/menu/index.d.ts +9 -0
- package/dist/basic-modules/src/modules/code-block/parse-elem-html.d.ts +19 -0
- package/dist/basic-modules/src/modules/code-block/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/code-block/pre-parse-html.d.ts +15 -0
- package/dist/basic-modules/src/modules/code-block/render-elem.d.ts +18 -0
- package/dist/basic-modules/src/modules/color/custom-types.d.ts +9 -0
- package/dist/basic-modules/src/modules/color/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/color/menu/BaseMenu.d.ts +20 -0
- package/dist/basic-modules/src/modules/color/menu/BgColorMenu.d.ts +11 -0
- package/dist/basic-modules/src/modules/color/menu/ColorMenu.d.ts +11 -0
- package/dist/basic-modules/src/modules/color/menu/config.d.ts +6 -0
- package/dist/basic-modules/src/modules/color/menu/index.d.ts +20 -0
- package/dist/basic-modules/src/modules/color/parse-style-html.d.ts +8 -0
- package/dist/basic-modules/src/modules/color/pre-parse-html.d.ts +15 -0
- package/dist/basic-modules/src/modules/color/render-style.d.ts +13 -0
- package/dist/basic-modules/src/modules/color/style-to-html.d.ts +12 -0
- package/dist/basic-modules/src/modules/common/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/common/menu/EnterMenu.d.ts +15 -0
- package/dist/basic-modules/src/modules/common/menu/index.d.ts +9 -0
- package/dist/basic-modules/src/modules/divider/custom-types.d.ts +12 -0
- package/dist/basic-modules/src/modules/divider/elem-to-html.d.ts +11 -0
- package/dist/basic-modules/src/modules/divider/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/divider/menu/InsertDividerMenu.d.ts +15 -0
- package/dist/basic-modules/src/modules/divider/menu/index.d.ts +9 -0
- package/dist/basic-modules/src/modules/divider/parse-elem-html.d.ts +14 -0
- package/dist/basic-modules/src/modules/divider/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/divider/render-elem.d.ts +13 -0
- package/dist/basic-modules/src/modules/emotion/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/emotion/menu/EmotionMenu.d.ts +19 -0
- package/dist/basic-modules/src/modules/emotion/menu/config.d.ts +5 -0
- package/dist/basic-modules/src/modules/emotion/menu/index.d.ts +12 -0
- package/dist/basic-modules/src/modules/font-size-family/custom-types.d.ts +9 -0
- package/dist/basic-modules/src/modules/font-size-family/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/font-size-family/menu/BaseMenu.d.ts +18 -0
- package/dist/basic-modules/src/modules/font-size-family/menu/FontFamilyMenu.d.ts +14 -0
- package/dist/basic-modules/src/modules/font-size-family/menu/FontSizeMenu.d.ts +13 -0
- package/dist/basic-modules/src/modules/font-size-family/menu/config.d.ts +12 -0
- package/dist/basic-modules/src/modules/font-size-family/menu/index.d.ts +26 -0
- package/dist/basic-modules/src/modules/font-size-family/parse-style-html.d.ts +8 -0
- package/dist/basic-modules/src/modules/font-size-family/pre-parse-html.d.ts +15 -0
- package/dist/basic-modules/src/modules/font-size-family/render-style.d.ts +13 -0
- package/dist/basic-modules/src/modules/font-size-family/style-to-html.d.ts +12 -0
- package/dist/basic-modules/src/modules/format-painter/helper.d.ts +3 -0
- package/dist/basic-modules/src/modules/format-painter/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/format-painter/menu/FormatPainter.d.ts +22 -0
- package/dist/basic-modules/src/modules/format-painter/menu/index.d.ts +9 -0
- package/dist/basic-modules/src/modules/format-painter/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/full-screen/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/full-screen/menu/FullScreen.d.ts +18 -0
- package/dist/basic-modules/src/modules/full-screen/menu/index.d.ts +9 -0
- package/dist/basic-modules/src/modules/header/custom-types.d.ts +29 -0
- package/dist/basic-modules/src/modules/header/elem-to-html.d.ts +29 -0
- package/dist/basic-modules/src/modules/header/helper.d.ts +14 -0
- package/dist/basic-modules/src/modules/header/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/header/menu/Header1ButtonMenu.d.ts +10 -0
- package/dist/basic-modules/src/modules/header/menu/Header2ButtonMenu.d.ts +10 -0
- package/dist/basic-modules/src/modules/header/menu/Header3ButtonMenu.d.ts +10 -0
- package/dist/basic-modules/src/modules/header/menu/Header4ButtonMenu.d.ts +10 -0
- package/dist/basic-modules/src/modules/header/menu/Header5ButtonMenu.d.ts +10 -0
- package/dist/basic-modules/src/modules/header/menu/Header6ButtonMenu.d.ts +10 -0
- package/dist/basic-modules/src/modules/header/menu/HeaderButtonMenuBase.d.ts +19 -0
- package/dist/basic-modules/src/modules/header/menu/HeaderSelectMenu.d.ts +26 -0
- package/dist/basic-modules/src/modules/header/menu/index.d.ts +39 -0
- package/dist/basic-modules/src/modules/header/parse-elem-html.d.ts +32 -0
- package/dist/basic-modules/src/modules/header/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/header/render-elem.d.ts +32 -0
- package/dist/basic-modules/src/modules/image/custom-types.d.ts +22 -0
- package/dist/basic-modules/src/modules/image/elem-to-html.d.ts +11 -0
- package/dist/basic-modules/src/modules/image/helper.d.ts +13 -0
- package/dist/basic-modules/src/modules/image/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/image/menu/DeleteImage.d.ts +15 -0
- package/dist/basic-modules/src/modules/image/menu/EditImage.d.ts +28 -0
- package/dist/basic-modules/src/modules/image/menu/EditImageSizeMenu.d.ts +25 -0
- package/dist/basic-modules/src/modules/image/menu/InsertImage.d.ts +27 -0
- package/dist/basic-modules/src/modules/image/menu/ViewImageLink.d.ts +15 -0
- package/dist/basic-modules/src/modules/image/menu/Width100.d.ts +10 -0
- package/dist/basic-modules/src/modules/image/menu/Width30.d.ts +10 -0
- package/dist/basic-modules/src/modules/image/menu/Width50.d.ts +10 -0
- package/dist/basic-modules/src/modules/image/menu/WidthBase.d.ts +16 -0
- package/dist/basic-modules/src/modules/image/menu/config.d.ts +30 -0
- package/dist/basic-modules/src/modules/image/menu/index.d.ts +56 -0
- package/dist/basic-modules/src/modules/image/parse-elem-html.d.ts +14 -0
- package/dist/basic-modules/src/modules/image/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/image/render-elem.d.ts +13 -0
- package/dist/basic-modules/src/modules/indent/custom-types.d.ts +10 -0
- package/dist/basic-modules/src/modules/indent/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/indent/menu/BaseMenu.d.ts +25 -0
- package/dist/basic-modules/src/modules/indent/menu/DecreaseIndentMenu.d.ts +13 -0
- package/dist/basic-modules/src/modules/indent/menu/IncreaseIndentMenu.d.ts +15 -0
- package/dist/basic-modules/src/modules/indent/menu/index.d.ts +14 -0
- package/dist/basic-modules/src/modules/indent/parse-style-html.d.ts +8 -0
- package/dist/basic-modules/src/modules/indent/pre-parse-html.d.ts +15 -0
- package/dist/basic-modules/src/modules/indent/render-style.d.ts +13 -0
- package/dist/basic-modules/src/modules/indent/style-to-html.d.ts +6 -0
- package/dist/basic-modules/src/modules/justify/custom-types.d.ts +10 -0
- package/dist/basic-modules/src/modules/justify/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/justify/menu/BaseMenu.d.ts +15 -0
- package/dist/basic-modules/src/modules/justify/menu/JustifyCenterMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/justify/menu/JustifyJustifyMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/justify/menu/JustifyLeftMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/justify/menu/JustifyRightMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/justify/menu/index.d.ts +24 -0
- package/dist/basic-modules/src/modules/justify/parse-style-html.d.ts +8 -0
- package/dist/basic-modules/src/modules/justify/render-style.d.ts +13 -0
- package/dist/basic-modules/src/modules/justify/style-to-html.d.ts +6 -0
- package/dist/basic-modules/src/modules/line-height/custom-types.d.ts +10 -0
- package/dist/basic-modules/src/modules/line-height/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/line-height/menu/LineHeightMenu.d.ts +26 -0
- package/dist/basic-modules/src/modules/line-height/menu/config.d.ts +5 -0
- package/dist/basic-modules/src/modules/line-height/menu/index.d.ts +12 -0
- package/dist/basic-modules/src/modules/line-height/parse-style-html.d.ts +8 -0
- package/dist/basic-modules/src/modules/line-height/render-style.d.ts +13 -0
- package/dist/basic-modules/src/modules/line-height/style-to-html.d.ts +6 -0
- package/dist/basic-modules/src/modules/link/custom-types.d.ts +11 -0
- package/dist/basic-modules/src/modules/link/elem-to-html.d.ts +11 -0
- package/dist/basic-modules/src/modules/link/helper.d.ts +20 -0
- package/dist/basic-modules/src/modules/link/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/link/menu/EditLink.d.ts +29 -0
- package/dist/basic-modules/src/modules/link/menu/InsertLink.d.ts +25 -0
- package/dist/basic-modules/src/modules/link/menu/UnLink.d.ts +15 -0
- package/dist/basic-modules/src/modules/link/menu/ViewLink.d.ts +16 -0
- package/dist/basic-modules/src/modules/link/menu/config.d.ts +18 -0
- package/dist/basic-modules/src/modules/link/menu/index.d.ts +33 -0
- package/dist/basic-modules/src/modules/link/parse-elem-html.d.ts +14 -0
- package/dist/basic-modules/src/modules/link/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/link/render-elem.d.ts +20 -0
- package/dist/basic-modules/src/modules/paragraph/custom-types.d.ts +9 -0
- package/dist/basic-modules/src/modules/paragraph/elem-to-html.d.ts +11 -0
- package/dist/basic-modules/src/modules/paragraph/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/paragraph/parse-elem-html.d.ts +14 -0
- package/dist/basic-modules/src/modules/paragraph/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/paragraph/render-elem.d.ts +20 -0
- package/dist/basic-modules/src/modules/text-style/custom-types.d.ts +14 -0
- package/dist/basic-modules/src/modules/text-style/helper.d.ts +8 -0
- package/dist/basic-modules/src/modules/text-style/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/text-style/menu/BaseMenu.d.ts +27 -0
- package/dist/basic-modules/src/modules/text-style/menu/BoldMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/text-style/menu/ClearStyleMenu.d.ts +20 -0
- package/dist/basic-modules/src/modules/text-style/menu/CodeMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/text-style/menu/ItalicMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/text-style/menu/SubMenu.d.ts +13 -0
- package/dist/basic-modules/src/modules/text-style/menu/SupMenu.d.ts +13 -0
- package/dist/basic-modules/src/modules/text-style/menu/ThroughMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/text-style/menu/UnderlineMenu.d.ts +12 -0
- package/dist/basic-modules/src/modules/text-style/menu/index.d.ts +44 -0
- package/dist/basic-modules/src/modules/text-style/parse-style-html.d.ts +8 -0
- package/dist/basic-modules/src/modules/text-style/render-style.d.ts +13 -0
- package/dist/basic-modules/src/modules/text-style/style-to-html.d.ts +12 -0
- package/dist/basic-modules/src/modules/todo/custom-types.d.ts +10 -0
- package/dist/basic-modules/src/modules/todo/elem-to-html.d.ts +11 -0
- package/dist/basic-modules/src/modules/todo/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/todo/menu/Todo.d.ts +15 -0
- package/dist/basic-modules/src/modules/todo/menu/index.d.ts +9 -0
- package/dist/basic-modules/src/modules/todo/parse-elem-html.d.ts +14 -0
- package/dist/basic-modules/src/modules/todo/plugin.d.ts +7 -0
- package/dist/basic-modules/src/modules/todo/pre-parse-html.d.ts +15 -0
- package/dist/basic-modules/src/modules/todo/render-elem.d.ts +20 -0
- package/dist/basic-modules/src/modules/undo-redo/index.d.ts +7 -0
- package/dist/basic-modules/src/modules/undo-redo/menu/RedoMenu.d.ts +15 -0
- package/dist/basic-modules/src/modules/undo-redo/menu/UndoMenu.d.ts +15 -0
- package/dist/basic-modules/src/modules/undo-redo/menu/index.d.ts +14 -0
- package/dist/basic-modules/src/utils/dom.d.ts +36 -0
- package/dist/basic-modules/src/utils/util.d.ts +11 -0
- package/dist/basic-modules/src/utils/vdom.d.ts +11 -0
- package/dist/code-highlight/src/constants/svg.d.ts +10 -0
- package/dist/code-highlight/src/custom-types.d.ts +17 -0
- package/dist/code-highlight/src/decorate/index.d.ts +7 -0
- package/dist/code-highlight/src/index.d.ts +9 -0
- package/dist/code-highlight/src/locale/en.d.ts +10 -0
- package/dist/code-highlight/src/locale/index.d.ts +5 -0
- package/dist/code-highlight/src/locale/zh-CN.d.ts +10 -0
- package/dist/code-highlight/src/module/elem-to-html.d.ts +11 -0
- package/dist/code-highlight/src/module/index.d.ts +7 -0
- package/dist/code-highlight/src/module/menu/SelectLangMenu.d.ts +24 -0
- package/dist/code-highlight/src/module/menu/config.d.ts +8 -0
- package/dist/code-highlight/src/module/menu/index.d.ts +15 -0
- package/dist/code-highlight/src/module/parse-style-html.d.ts +8 -0
- package/dist/code-highlight/src/module/render-style.d.ts +13 -0
- package/dist/code-highlight/src/utils/dom.d.ts +15 -0
- package/dist/code-highlight/src/utils/vdom.d.ts +11 -0
- package/dist/code-highlight/src/vendor/prism.d.ts +37 -0
- package/dist/core/src/config/index.d.ts +13 -0
- package/dist/core/src/config/interface.d.ts +219 -0
- package/dist/core/src/config/register.d.ts +12 -0
- package/dist/core/src/constants/index.d.ts +1 -0
- package/dist/core/src/constants/svg.d.ts +12 -0
- package/dist/core/src/create/bind-node-relation.d.ts +15 -0
- package/dist/core/src/create/create-editor.d.ts +10 -0
- package/dist/core/src/create/create-toolbar.d.ts +14 -0
- package/dist/core/src/create/helper.d.ts +37 -0
- package/dist/core/src/create/index.d.ts +7 -0
- package/dist/core/src/editor/dom-editor.d.ts +143 -0
- package/dist/core/src/editor/interface.d.ts +68 -0
- package/dist/core/src/editor/plugins/with-config.d.ts +7 -0
- package/dist/core/src/editor/plugins/with-content.d.ts +7 -0
- package/dist/core/src/editor/plugins/with-dom.d.ts +10 -0
- package/dist/core/src/editor/plugins/with-emitter.d.ts +7 -0
- package/dist/core/src/editor/plugins/with-event-data.d.ts +7 -0
- package/dist/core/src/editor/plugins/with-max-length.d.ts +7 -0
- package/dist/core/src/editor/plugins/with-selection.d.ts +7 -0
- package/dist/core/src/i18n/index.d.ts +32 -0
- package/dist/core/src/index.d.ts +32 -0
- package/dist/core/src/menus/bar/HoverBar.d.ts +48 -0
- package/dist/core/src/menus/bar/Toolbar.d.ts +35 -0
- package/dist/core/src/menus/bar-item/BaseButton.d.ts +26 -0
- package/dist/core/src/menus/bar-item/DropPanelButton.d.ts +14 -0
- package/dist/core/src/menus/bar-item/GroupButton.d.ts +17 -0
- package/dist/core/src/menus/bar-item/ModalButton.d.ts +25 -0
- package/dist/core/src/menus/bar-item/Select.d.ts +22 -0
- package/dist/core/src/menus/bar-item/SimpleButton.d.ts +11 -0
- package/dist/core/src/menus/bar-item/index.d.ts +24 -0
- package/dist/core/src/menus/bar-item/tooltip.d.ts +6 -0
- package/dist/core/src/menus/helpers/helpers.d.ts +18 -0
- package/dist/core/src/menus/helpers/position.d.ts +36 -0
- package/dist/core/src/menus/index.d.ts +9 -0
- package/dist/core/src/menus/interface.d.ts +65 -0
- package/dist/core/src/menus/panel-and-modal/BaseClass.d.ts +26 -0
- package/dist/core/src/menus/panel-and-modal/DropPanel.d.ts +14 -0
- package/dist/core/src/menus/panel-and-modal/Modal.d.ts +44 -0
- package/dist/core/src/menus/panel-and-modal/SelectList.d.ts +20 -0
- package/dist/core/src/menus/register.d.ts +15 -0
- package/dist/core/src/parse-html/helper.d.ts +10 -0
- package/dist/core/src/parse-html/index.d.ts +35 -0
- package/dist/core/src/parse-html/parse-common-elem-html.d.ts +15 -0
- package/dist/core/src/parse-html/parse-elem-html.d.ts +15 -0
- package/dist/core/src/parse-html/parse-text-elem-html.d.ts +15 -0
- package/dist/core/src/render/element/getRenderElem.d.ts +11 -0
- package/dist/core/src/render/element/renderElement.d.ts +9 -0
- package/dist/core/src/render/element/renderStyle.d.ts +13 -0
- package/dist/core/src/render/helper.d.ts +6 -0
- package/dist/core/src/render/index.d.ts +27 -0
- package/dist/core/src/render/node2Vnode.d.ts +15 -0
- package/dist/core/src/render/text/genVnode.d.ts +9 -0
- package/dist/core/src/render/text/renderStyle.d.ts +13 -0
- package/dist/core/src/render/text/renderText.d.ts +9 -0
- package/dist/core/src/text-area/TextArea.d.ts +47 -0
- package/dist/core/src/text-area/event-handlers/beforeInput.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/blur.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/click.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/composition.d.ts +27 -0
- package/dist/core/src/text-area/event-handlers/copy.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/cut.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/drag.d.ts +9 -0
- package/dist/core/src/text-area/event-handlers/drop.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/focus.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/index.d.ts +35 -0
- package/dist/core/src/text-area/event-handlers/keydown.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/keypress.d.ts +8 -0
- package/dist/core/src/text-area/event-handlers/paste.d.ts +8 -0
- package/dist/core/src/text-area/helpers.d.ts +26 -0
- package/dist/core/src/text-area/place-holder.d.ts +18 -0
- package/dist/core/src/text-area/syncSelection.d.ts +19 -0
- package/dist/core/src/text-area/update-view.d.ts +13 -0
- package/dist/core/src/to-html/elem2html.d.ts +8 -0
- package/dist/core/src/to-html/index.d.ts +32 -0
- package/dist/core/src/to-html/node2html.d.ts +8 -0
- package/dist/core/src/to-html/text2html.d.ts +8 -0
- package/dist/core/src/upload/createUploader.d.ts +8 -0
- package/dist/core/src/upload/index.d.ts +7 -0
- package/dist/core/src/upload/interface.d.ts +33 -0
- package/dist/core/src/utils/dom.d.ts +102 -0
- package/dist/core/src/utils/hotkeys.d.ts +35 -0
- package/dist/core/src/utils/key.d.ts +11 -0
- package/dist/core/src/utils/line.d.ts +14 -0
- package/dist/core/src/utils/ua.d.ts +14 -0
- package/dist/core/src/utils/util.d.ts +28 -0
- package/dist/core/src/utils/vdom.d.ts +34 -0
- package/dist/core/src/utils/weak-maps.d.ts +56 -0
- package/dist/css/style.css +29 -0
- package/dist/editor/src/Boot.d.ts +30 -0
- package/dist/editor/src/constants/svg.d.ts +14 -0
- package/dist/editor/src/create.d.ts +28 -0
- package/dist/editor/src/index.d.ts +18 -0
- package/dist/editor/src/init-default-config/config/hoverbar.d.ts +47 -0
- package/dist/editor/src/init-default-config/config/index.d.ts +67 -0
- package/dist/editor/src/init-default-config/config/toolbar.d.ts +16 -0
- package/dist/editor/src/init-default-config/index.d.ts +5 -0
- package/dist/editor/src/locale/en.d.ts +14 -0
- package/dist/editor/src/locale/index.d.ts +5 -0
- package/dist/editor/src/locale/zh-CN.d.ts +14 -0
- package/dist/editor/src/register-builtin-modules/index.d.ts +10 -0
- package/dist/editor/src/register-builtin-modules/register.d.ts +7 -0
- package/dist/editor/src/utils/browser-polyfill.d.ts +6 -0
- package/dist/editor/src/utils/dom.d.ts +6 -0
- package/dist/editor/src/utils/node-polyfill.d.ts +4 -0
- package/dist/index.js +1006 -0
- package/dist/index.mjs +1002 -0
- package/dist/list-module/src/constants/svg.d.ts +11 -0
- package/dist/list-module/src/index.d.ts +8 -0
- package/dist/list-module/src/locale/en.d.ts +11 -0
- package/dist/list-module/src/locale/index.d.ts +5 -0
- package/dist/list-module/src/locale/zh-CN.d.ts +11 -0
- package/dist/list-module/src/module/custom-types.d.ts +11 -0
- package/dist/list-module/src/module/elem-to-html.d.ts +15 -0
- package/dist/list-module/src/module/helpers.d.ts +13 -0
- package/dist/list-module/src/module/index.d.ts +7 -0
- package/dist/list-module/src/module/menu/BaseMenu.d.ts +18 -0
- package/dist/list-module/src/module/menu/BulletedListMenu.d.ts +11 -0
- package/dist/list-module/src/module/menu/NumberedListMenu.d.ts +11 -0
- package/dist/list-module/src/module/menu/index.d.ts +14 -0
- package/dist/list-module/src/module/parse-elem-html.d.ts +19 -0
- package/dist/list-module/src/module/plugin.d.ts +7 -0
- package/dist/list-module/src/module/render-elem.d.ts +13 -0
- package/dist/list-module/src/utils/dom.d.ts +19 -0
- package/dist/list-module/src/utils/maps.d.ts +6 -0
- package/dist/list-module/src/utils/util.d.ts +6 -0
- package/dist/plugin-float-image/src/constants/icon-svg.d.ts +12 -0
- package/dist/plugin-float-image/src/index.d.ts +8 -0
- package/dist/plugin-float-image/src/module/custom-types.d.ts +21 -0
- package/dist/plugin-float-image/src/module/elem-to-html.d.ts +11 -0
- package/dist/plugin-float-image/src/module/index.d.ts +8 -0
- package/dist/plugin-float-image/src/module/local.d.ts +5 -0
- package/dist/plugin-float-image/src/module/menu/FloatBase.d.ts +17 -0
- package/dist/plugin-float-image/src/module/menu/FloatLeft.d.ts +11 -0
- package/dist/plugin-float-image/src/module/menu/FloatNone.d.ts +11 -0
- package/dist/plugin-float-image/src/module/menu/FloatRight.d.ts +11 -0
- package/dist/plugin-float-image/src/module/menu/index.d.ts +19 -0
- package/dist/plugin-float-image/src/module/parse-elem-html.d.ts +13 -0
- package/dist/plugin-float-image/src/module/plugin.d.ts +7 -0
- package/dist/plugin-float-image/src/module/render-elem.d.ts +12 -0
- package/dist/plugin-float-image/src/utils/dom.d.ts +15 -0
- package/dist/table-module/src/constants/svg.d.ts +26 -0
- package/dist/table-module/src/index.d.ts +8 -0
- package/dist/table-module/src/locale/en.d.ts +43 -0
- package/dist/table-module/src/locale/index.d.ts +5 -0
- package/dist/table-module/src/locale/zh-CN.d.ts +43 -0
- package/dist/table-module/src/module/column-resize.d.ts +20 -0
- package/dist/table-module/src/module/custom-types.d.ts +39 -0
- package/dist/table-module/src/module/elem-to-html.d.ts +21 -0
- package/dist/table-module/src/module/helpers.d.ts +22 -0
- package/dist/table-module/src/module/index.d.ts +7 -0
- package/dist/table-module/src/module/menu/CellProperty.d.ts +11 -0
- package/dist/table-module/src/module/menu/DeleteCol.d.ts +15 -0
- package/dist/table-module/src/module/menu/DeleteRow.d.ts +15 -0
- package/dist/table-module/src/module/menu/DeleteTable.d.ts +15 -0
- package/dist/table-module/src/module/menu/FullWidth.d.ts +15 -0
- package/dist/table-module/src/module/menu/InsertCol.d.ts +15 -0
- package/dist/table-module/src/module/menu/InsertRow.d.ts +15 -0
- package/dist/table-module/src/module/menu/InsertTable.d.ts +24 -0
- package/dist/table-module/src/module/menu/MergeCell.d.ts +24 -0
- package/dist/table-module/src/module/menu/SplitCell.d.ts +24 -0
- package/dist/table-module/src/module/menu/TableHeader.d.ts +15 -0
- package/dist/table-module/src/module/menu/TableProperty.d.ts +34 -0
- package/dist/table-module/src/module/menu/index.d.ts +66 -0
- package/dist/table-module/src/module/parse-elem-html.d.ts +24 -0
- package/dist/table-module/src/module/parse-style-html.d.ts +8 -0
- package/dist/table-module/src/module/plugin.d.ts +7 -0
- package/dist/table-module/src/module/pre-parse-html.d.ts +15 -0
- package/dist/table-module/src/module/render-elem/index.d.ts +19 -0
- package/dist/table-module/src/module/render-elem/render-cell.d.ts +9 -0
- package/dist/table-module/src/module/render-elem/render-row.d.ts +9 -0
- package/dist/table-module/src/module/render-elem/render-table.d.ts +9 -0
- package/dist/table-module/src/module/render-style.d.ts +9 -0
- package/dist/table-module/src/module/style-to-html.d.ts +5 -0
- package/dist/table-module/src/module/table-cursor.d.ts +19 -0
- package/dist/table-module/src/module/weak-maps.d.ts +5 -0
- package/dist/table-module/src/module/with-selection.d.ts +2 -0
- package/dist/table-module/src/utils/dom.d.ts +31 -0
- package/dist/table-module/src/utils/has-common.d.ts +7 -0
- package/dist/table-module/src/utils/index.d.ts +5 -0
- package/dist/table-module/src/utils/is-of-type.d.ts +6 -0
- package/dist/table-module/src/utils/matrices.d.ts +9 -0
- package/dist/table-module/src/utils/options.d.ts +25 -0
- package/dist/table-module/src/utils/point.d.ts +7 -0
- package/dist/table-module/src/utils/types.d.ts +19 -0
- package/dist/table-module/src/utils/vdom.d.ts +11 -0
- package/dist/upload-image-module/src/constants/svg.d.ts +10 -0
- package/dist/upload-image-module/src/index.d.ts +8 -0
- package/dist/upload-image-module/src/locale/en.d.ts +11 -0
- package/dist/upload-image-module/src/locale/index.d.ts +5 -0
- package/dist/upload-image-module/src/locale/zh-CN.d.ts +11 -0
- package/dist/upload-image-module/src/module/index.d.ts +7 -0
- package/dist/upload-image-module/src/module/menu/UploadImageMenu.d.ts +16 -0
- package/dist/upload-image-module/src/module/menu/config.d.ts +6 -0
- package/dist/upload-image-module/src/module/menu/index.d.ts +10 -0
- package/dist/upload-image-module/src/module/plugin.d.ts +7 -0
- package/dist/upload-image-module/src/module/upload-images.d.ts +11 -0
- package/dist/upload-image-module/src/utils/dom.d.ts +7 -0
- package/dist/video-module/src/constants/svg.d.ts +12 -0
- package/dist/video-module/src/index.d.ts +8 -0
- package/dist/video-module/src/locale/en.d.ts +21 -0
- package/dist/video-module/src/locale/index.d.ts +5 -0
- package/dist/video-module/src/locale/zh-CN.d.ts +21 -0
- package/dist/video-module/src/module/custom-types.d.ts +23 -0
- package/dist/video-module/src/module/elem-to-html.d.ts +11 -0
- package/dist/video-module/src/module/helper/insert-video.d.ts +12 -0
- package/dist/video-module/src/module/helper/upload-videos.d.ts +6 -0
- package/dist/video-module/src/module/index.d.ts +7 -0
- package/dist/video-module/src/module/menu/EditVideoSizeMenu.d.ts +25 -0
- package/dist/video-module/src/module/menu/EditVideoSrcMenu.d.ts +26 -0
- package/dist/video-module/src/module/menu/InsertVideoMenu.d.ts +25 -0
- package/dist/video-module/src/module/menu/UploadVideoMenu.d.ts +16 -0
- package/dist/video-module/src/module/menu/config.d.ts +25 -0
- package/dist/video-module/src/module/menu/index.d.ts +30 -0
- package/dist/video-module/src/module/parse-elem-html.d.ts +14 -0
- package/dist/video-module/src/module/plugin.d.ts +7 -0
- package/dist/video-module/src/module/pre-parse-html.d.ts +15 -0
- package/dist/video-module/src/module/render-elem.d.ts +13 -0
- package/dist/video-module/src/utils/dom.d.ts +29 -0
- package/dist/video-module/src/utils/util.d.ts +12 -0
- package/package.json +49 -0
package/dist/index.mjs
ADDED
@@ -0,0 +1,1002 @@
|
|
1
|
+
import { i18nAddResources, DomEditor, SlateTransforms, t } from '@wangeditor-next/editor';
|
2
|
+
import { jsx } from 'snabbdom';
|
3
|
+
import $, { css, append, prepend, addClass, removeClass, hasClass, on, off, focus, attr, removeAttr, hide, show, parents, dataset, val, text, html, children, remove, find, width, height, filter, empty } from 'dom7';
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @description 多语言
|
7
|
+
* @author Yanghc
|
8
|
+
*/
|
9
|
+
i18nAddResources('en', {
|
10
|
+
float: {
|
11
|
+
none: 'Default',
|
12
|
+
left: 'Float Left',
|
13
|
+
right: 'Float Right',
|
14
|
+
},
|
15
|
+
});
|
16
|
+
i18nAddResources('zh-CN', {
|
17
|
+
float: {
|
18
|
+
none: '默认',
|
19
|
+
left: '左浮动',
|
20
|
+
right: '右浮动',
|
21
|
+
},
|
22
|
+
});
|
23
|
+
|
24
|
+
/**
|
25
|
+
* @description elem to html
|
26
|
+
* @author Yanghc
|
27
|
+
*/
|
28
|
+
// 生成 html 的函数
|
29
|
+
function imageToHtml(elem, _childrenHtml) {
|
30
|
+
var _a = elem, src = _a.src, _b = _a.alt, alt = _b === void 0 ? '' : _b, _c = _a.href, href = _c === void 0 ? '' : _c, _d = _a.style, style = _d === void 0 ? {} : _d;
|
31
|
+
var _e = style.width, width = _e === void 0 ? '' : _e, _f = style.height, height = _f === void 0 ? '' : _f, _g = style.float, float = _g === void 0 ? '' : _g;
|
32
|
+
var styleStr = '';
|
33
|
+
if (width) {
|
34
|
+
styleStr += "width: ".concat(width, ";");
|
35
|
+
}
|
36
|
+
if (height) {
|
37
|
+
styleStr += "height: ".concat(height, ";");
|
38
|
+
}
|
39
|
+
if (float) {
|
40
|
+
styleStr += "float: ".concat(float, ";");
|
41
|
+
}
|
42
|
+
return "<img src=\"".concat(src, "\" alt=\"").concat(alt, "\" data-href=\"").concat(href, "\" style=\"").concat(styleStr, "\"/>");
|
43
|
+
}
|
44
|
+
// 配置
|
45
|
+
var conf = {
|
46
|
+
type: 'image', // 节点 type ,重要!!!
|
47
|
+
elemToHtml: imageToHtml,
|
48
|
+
};
|
49
|
+
|
50
|
+
/******************************************************************************
|
51
|
+
Copyright (c) Microsoft Corporation.
|
52
|
+
|
53
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
54
|
+
purpose with or without fee is hereby granted.
|
55
|
+
|
56
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
57
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
58
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
59
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
60
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
61
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
62
|
+
PERFORMANCE OF THIS SOFTWARE.
|
63
|
+
***************************************************************************** */
|
64
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
65
|
+
|
66
|
+
var extendStatics = function(d, b) {
|
67
|
+
extendStatics = Object.setPrototypeOf ||
|
68
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
69
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
70
|
+
return extendStatics(d, b);
|
71
|
+
};
|
72
|
+
|
73
|
+
function __extends(d, b) {
|
74
|
+
if (typeof b !== "function" && b !== null)
|
75
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
76
|
+
extendStatics(d, b);
|
77
|
+
function __() { this.constructor = d; }
|
78
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
79
|
+
}
|
80
|
+
|
81
|
+
var __assign = function() {
|
82
|
+
__assign = Object.assign || function __assign(t) {
|
83
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
84
|
+
s = arguments[i];
|
85
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
86
|
+
}
|
87
|
+
return t;
|
88
|
+
};
|
89
|
+
return __assign.apply(this, arguments);
|
90
|
+
};
|
91
|
+
|
92
|
+
function __read(o, n) {
|
93
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
94
|
+
if (!m) return o;
|
95
|
+
var i = m.call(o), r, ar = [], e;
|
96
|
+
try {
|
97
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
98
|
+
}
|
99
|
+
catch (error) { e = { error: error }; }
|
100
|
+
finally {
|
101
|
+
try {
|
102
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
103
|
+
}
|
104
|
+
finally { if (e) throw e.error; }
|
105
|
+
}
|
106
|
+
return ar;
|
107
|
+
}
|
108
|
+
|
109
|
+
function __spreadArray(to, from, pack) {
|
110
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
111
|
+
if (ar || !(i in from)) {
|
112
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
113
|
+
ar[i] = from[i];
|
114
|
+
}
|
115
|
+
}
|
116
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
117
|
+
}
|
118
|
+
|
119
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
120
|
+
var e = new Error(message);
|
121
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
122
|
+
};
|
123
|
+
|
124
|
+
/**
|
125
|
+
* @description icon svg
|
126
|
+
* @author Yanghc
|
127
|
+
*/
|
128
|
+
/**
|
129
|
+
* 【注意】svg 字符串的长度 ,否则会导致代码体积过大
|
130
|
+
* 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
|
131
|
+
* 找不到再从 iconfont.com 搜索
|
132
|
+
*/
|
133
|
+
// 默认不浮动
|
134
|
+
var DEFAULT_FLOAT_SVG = '<svg viewBox="0 0 1024 1024"><path d="M76.73805432 117.83964445m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.4275674l0 68.35162074q0 12.42756741-12.42756741 12.42756741l-845.0745837 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162074q0-12.42756741 12.42756741-12.4275674Z"></path><path d="M76.73805432 801.35585185m12.42756741 0l845.0745837 0q12.42756741 0 12.42756741 12.42756741l0 68.35162074q0 12.42756741-12.42756741 12.42756742l-845.0745837 0q-12.42756741 0-12.42756741-12.42756742l0-68.35162074q0-12.42756741 12.42756741-12.42756741Z"></path><path d="M89.16562173 304.25315556h410.10972444c6.83516208 0 12.42756741 5.59240533 12.42756741 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756741 12.4275674h-410.10972444a12.42756741 12.42756741 0 0 1-12.42756741-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756741-12.42756741z"></path></svg>';
|
135
|
+
// 左浮动
|
136
|
+
var LEFT_FLOAT_SVG = '<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M89.46270815 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.42756742 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.42756742 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.4275674-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.4275674-12.42756741z"></path><path d="M512 552.8045037m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756742l0 68.35162073q0 12.42756741-12.4275674 12.42756741l-410.10972444 0q-12.42756741 0-12.42756741-12.42756741l0-68.35162073q0-12.42756741 12.42756741-12.42756742Z"></path><path d="M512 366.39099259m12.42756741 0l410.10972444 0q12.42756741 0 12.4275674 12.42756741l0 68.35162075q0 12.42756741-12.4275674 12.4275674l-410.10972444 0q-12.42756741 0-12.42756741-12.4275674l0-68.35162075q0-12.42756741 12.42756741-12.42756741Z"></path></svg>';
|
137
|
+
// 右浮动
|
138
|
+
var RIGHT_FLOAT_SVG = '<svg viewBox="0 0 1024 1024"><path d="M77.03514075 117.83964445m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.4275674l0 68.35162074q0 12.42756741-12.4275674 12.42756741l-845.0745837 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162074q0-12.42756741 12.4275674-12.4275674Z"></path><path d="M77.03514075 801.35585185m12.4275674 0l845.0745837 0q12.42756741 0 12.4275674 12.42756741l0 68.35162074q0 12.42756741-12.4275674 12.42756742l-845.0745837 0q-12.42756741 0-12.4275674-12.42756742l0-68.35162074q0-12.42756741 12.4275674-12.42756741Z"></path><path d="M586.56540445 304.25315556h347.9718874c6.83516208 0 12.42756741 5.59240533 12.4275674 12.42756741v410.10972445a12.42756741 12.42756741 0 0 1-12.4275674 12.4275674h-347.9718874a12.42756741 12.42756741 0 0 1-12.42756742-12.4275674v-410.10972445c0-6.83516208 5.59240533-12.42756741 12.42756742-12.42756741z"></path><path d="M77.03514075 552.8045037m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756742l0 68.35162073q0 12.42756741-12.42756741 12.42756741l-410.10972444 0q-12.42756741 0-12.4275674-12.42756741l0-68.35162073q0-12.42756741 12.4275674-12.42756742Z"></path><path d="M77.03514075 366.39099259m12.4275674 0l410.10972444 0q12.42756741 0 12.42756741 12.42756741l0 68.35162075q0 12.42756741-12.42756741 12.4275674l-410.10972444 0q-12.42756741 0-12.4275674-12.4275674l0-68.35162075q0-12.42756741 12.4275674-12.42756741Z"></path></svg>';
|
139
|
+
|
140
|
+
/**
|
141
|
+
* @description image float base class
|
142
|
+
* @author Yanghc
|
143
|
+
*/
|
144
|
+
var ImageFloatBaseClass = /** @class */ (function () {
|
145
|
+
function ImageFloatBaseClass() {
|
146
|
+
this.tag = 'button';
|
147
|
+
}
|
148
|
+
ImageFloatBaseClass.prototype.getValue = function (editor) {
|
149
|
+
// 无需获取 val
|
150
|
+
return '';
|
151
|
+
};
|
152
|
+
ImageFloatBaseClass.prototype.isActive = function (editor) {
|
153
|
+
// 无需 active
|
154
|
+
return false;
|
155
|
+
};
|
156
|
+
ImageFloatBaseClass.prototype.getSelectedNode = function (editor) {
|
157
|
+
return DomEditor.getSelectedNodeByType(editor, 'image');
|
158
|
+
};
|
159
|
+
ImageFloatBaseClass.prototype.isDisabled = function (editor) {
|
160
|
+
if (editor.selection == null) {
|
161
|
+
return true;
|
162
|
+
}
|
163
|
+
var imageNode = this.getSelectedNode(editor);
|
164
|
+
return imageNode == null;
|
165
|
+
};
|
166
|
+
ImageFloatBaseClass.prototype.exec = function (editor, value) {
|
167
|
+
if (this.isDisabled(editor)) {
|
168
|
+
return;
|
169
|
+
}
|
170
|
+
var imageNode = this.getSelectedNode(editor);
|
171
|
+
if (imageNode == null) {
|
172
|
+
return;
|
173
|
+
}
|
174
|
+
// 隐藏 hoverbar
|
175
|
+
var hoverbar = DomEditor.getHoverbar(editor);
|
176
|
+
if (hoverbar) {
|
177
|
+
hoverbar.hideAndClean();
|
178
|
+
}
|
179
|
+
var _a = imageNode.style, style = _a === void 0 ? {} : _a;
|
180
|
+
var props = {
|
181
|
+
style: __assign(__assign({}, style), { float: this.value }),
|
182
|
+
};
|
183
|
+
SlateTransforms.setNodes(editor, props, {
|
184
|
+
match: function (n) { return DomEditor.checkNodeType(n, 'image'); },
|
185
|
+
});
|
186
|
+
};
|
187
|
+
return ImageFloatBaseClass;
|
188
|
+
}());
|
189
|
+
|
190
|
+
/**
|
191
|
+
* @description float image none
|
192
|
+
* @author Yanghc
|
193
|
+
*/
|
194
|
+
var FloatNone = /** @class */ (function (_super) {
|
195
|
+
__extends(FloatNone, _super);
|
196
|
+
function FloatNone() {
|
197
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
198
|
+
_this.title = t('float.none'); // 菜单标题
|
199
|
+
_this.value = 'none'; // css float 的值
|
200
|
+
_this.iconSvg = DEFAULT_FLOAT_SVG;
|
201
|
+
return _this;
|
202
|
+
}
|
203
|
+
return FloatNone;
|
204
|
+
}(ImageFloatBaseClass));
|
205
|
+
|
206
|
+
/**
|
207
|
+
* @description float image left
|
208
|
+
* @author Yanghc
|
209
|
+
*/
|
210
|
+
var FloatLeft = /** @class */ (function (_super) {
|
211
|
+
__extends(FloatLeft, _super);
|
212
|
+
function FloatLeft() {
|
213
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
214
|
+
_this.title = t('float.left'); // 菜单标题
|
215
|
+
_this.value = 'left'; // css float 的值
|
216
|
+
_this.iconSvg = LEFT_FLOAT_SVG;
|
217
|
+
return _this;
|
218
|
+
}
|
219
|
+
return FloatLeft;
|
220
|
+
}(ImageFloatBaseClass));
|
221
|
+
|
222
|
+
/**
|
223
|
+
* @description float image right
|
224
|
+
* @author Yanghc
|
225
|
+
*/
|
226
|
+
var FloatRight = /** @class */ (function (_super) {
|
227
|
+
__extends(FloatRight, _super);
|
228
|
+
function FloatRight() {
|
229
|
+
var _this = _super.apply(this, __spreadArray([], __read(arguments), false)) || this;
|
230
|
+
_this.title = t('float.right'); // 菜单标题
|
231
|
+
_this.value = 'right'; // css float 的值
|
232
|
+
_this.iconSvg = RIGHT_FLOAT_SVG;
|
233
|
+
return _this;
|
234
|
+
}
|
235
|
+
return FloatRight;
|
236
|
+
}(ImageFloatBaseClass));
|
237
|
+
|
238
|
+
/**
|
239
|
+
* @description menu index
|
240
|
+
* @author Yanghc
|
241
|
+
*/
|
242
|
+
var imageFloatNoneMenuConf = {
|
243
|
+
key: 'imageFloatNone',
|
244
|
+
factory: function () {
|
245
|
+
return new FloatNone();
|
246
|
+
},
|
247
|
+
};
|
248
|
+
var imageFloatLeftMenuConf = {
|
249
|
+
key: 'imageFloatLeft',
|
250
|
+
factory: function () {
|
251
|
+
return new FloatLeft();
|
252
|
+
},
|
253
|
+
};
|
254
|
+
var imageFloatRightMenuConf = {
|
255
|
+
key: 'imageFloatRight',
|
256
|
+
factory: function () {
|
257
|
+
return new FloatRight();
|
258
|
+
},
|
259
|
+
};
|
260
|
+
|
261
|
+
/**
|
262
|
+
* @description parse elem html
|
263
|
+
* @author Yanghc
|
264
|
+
*/
|
265
|
+
function parseHtml(elem, _children, _editor) {
|
266
|
+
var href = elem.getAttribute('data-href') || '';
|
267
|
+
href = decodeURIComponent(href); // 兼容 V4
|
268
|
+
return {
|
269
|
+
type: 'image',
|
270
|
+
src: elem.getAttribute('src') || '',
|
271
|
+
alt: elem.getAttribute('alt') || '',
|
272
|
+
href: href,
|
273
|
+
style: {
|
274
|
+
width: elem.getAttribute('width') || '',
|
275
|
+
height: elem.getAttribute('height') || '',
|
276
|
+
float: elem.getAttribute('float') || '',
|
277
|
+
},
|
278
|
+
children: [{ text: '' }], // void node 有一个空白 text
|
279
|
+
};
|
280
|
+
}
|
281
|
+
var parseHtmlConf = {
|
282
|
+
selector: 'img:not([data-w-e-type])', // data-w-e-type 属性,留给自定义元素,保证扩展性
|
283
|
+
parseElemHtml: parseHtml,
|
284
|
+
};
|
285
|
+
|
286
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
287
|
+
|
288
|
+
function getDefaultExportFromCjs (x) {
|
289
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
290
|
+
}
|
291
|
+
|
292
|
+
/**
|
293
|
+
* lodash (Custom Build) <https://lodash.com/>
|
294
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
295
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
296
|
+
* Released under MIT license <https://lodash.com/license>
|
297
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
298
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
299
|
+
*/
|
300
|
+
|
301
|
+
var lodash_throttle;
|
302
|
+
var hasRequiredLodash_throttle;
|
303
|
+
|
304
|
+
function requireLodash_throttle () {
|
305
|
+
if (hasRequiredLodash_throttle) return lodash_throttle;
|
306
|
+
hasRequiredLodash_throttle = 1;
|
307
|
+
/** Used as the `TypeError` message for "Functions" methods. */
|
308
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
309
|
+
|
310
|
+
/** Used as references for various `Number` constants. */
|
311
|
+
var NAN = 0 / 0;
|
312
|
+
|
313
|
+
/** `Object#toString` result references. */
|
314
|
+
var symbolTag = '[object Symbol]';
|
315
|
+
|
316
|
+
/** Used to match leading and trailing whitespace. */
|
317
|
+
var reTrim = /^\s+|\s+$/g;
|
318
|
+
|
319
|
+
/** Used to detect bad signed hexadecimal string values. */
|
320
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
321
|
+
|
322
|
+
/** Used to detect binary string values. */
|
323
|
+
var reIsBinary = /^0b[01]+$/i;
|
324
|
+
|
325
|
+
/** Used to detect octal string values. */
|
326
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
327
|
+
|
328
|
+
/** Built-in method references without a dependency on `root`. */
|
329
|
+
var freeParseInt = parseInt;
|
330
|
+
|
331
|
+
/** Detect free variable `global` from Node.js. */
|
332
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
333
|
+
|
334
|
+
/** Detect free variable `self`. */
|
335
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
336
|
+
|
337
|
+
/** Used as a reference to the global object. */
|
338
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
339
|
+
|
340
|
+
/** Used for built-in method references. */
|
341
|
+
var objectProto = Object.prototype;
|
342
|
+
|
343
|
+
/**
|
344
|
+
* Used to resolve the
|
345
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
346
|
+
* of values.
|
347
|
+
*/
|
348
|
+
var objectToString = objectProto.toString;
|
349
|
+
|
350
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
351
|
+
var nativeMax = Math.max,
|
352
|
+
nativeMin = Math.min;
|
353
|
+
|
354
|
+
/**
|
355
|
+
* Gets the timestamp of the number of milliseconds that have elapsed since
|
356
|
+
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
357
|
+
*
|
358
|
+
* @static
|
359
|
+
* @memberOf _
|
360
|
+
* @since 2.4.0
|
361
|
+
* @category Date
|
362
|
+
* @returns {number} Returns the timestamp.
|
363
|
+
* @example
|
364
|
+
*
|
365
|
+
* _.defer(function(stamp) {
|
366
|
+
* console.log(_.now() - stamp);
|
367
|
+
* }, _.now());
|
368
|
+
* // => Logs the number of milliseconds it took for the deferred invocation.
|
369
|
+
*/
|
370
|
+
var now = function() {
|
371
|
+
return root.Date.now();
|
372
|
+
};
|
373
|
+
|
374
|
+
/**
|
375
|
+
* Creates a debounced function that delays invoking `func` until after `wait`
|
376
|
+
* milliseconds have elapsed since the last time the debounced function was
|
377
|
+
* invoked. The debounced function comes with a `cancel` method to cancel
|
378
|
+
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
379
|
+
* Provide `options` to indicate whether `func` should be invoked on the
|
380
|
+
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
381
|
+
* with the last arguments provided to the debounced function. Subsequent
|
382
|
+
* calls to the debounced function return the result of the last `func`
|
383
|
+
* invocation.
|
384
|
+
*
|
385
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
386
|
+
* invoked on the trailing edge of the timeout only if the debounced function
|
387
|
+
* is invoked more than once during the `wait` timeout.
|
388
|
+
*
|
389
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
390
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
391
|
+
*
|
392
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
393
|
+
* for details over the differences between `_.debounce` and `_.throttle`.
|
394
|
+
*
|
395
|
+
* @static
|
396
|
+
* @memberOf _
|
397
|
+
* @since 0.1.0
|
398
|
+
* @category Function
|
399
|
+
* @param {Function} func The function to debounce.
|
400
|
+
* @param {number} [wait=0] The number of milliseconds to delay.
|
401
|
+
* @param {Object} [options={}] The options object.
|
402
|
+
* @param {boolean} [options.leading=false]
|
403
|
+
* Specify invoking on the leading edge of the timeout.
|
404
|
+
* @param {number} [options.maxWait]
|
405
|
+
* The maximum time `func` is allowed to be delayed before it's invoked.
|
406
|
+
* @param {boolean} [options.trailing=true]
|
407
|
+
* Specify invoking on the trailing edge of the timeout.
|
408
|
+
* @returns {Function} Returns the new debounced function.
|
409
|
+
* @example
|
410
|
+
*
|
411
|
+
* // Avoid costly calculations while the window size is in flux.
|
412
|
+
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
413
|
+
*
|
414
|
+
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
415
|
+
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
416
|
+
* 'leading': true,
|
417
|
+
* 'trailing': false
|
418
|
+
* }));
|
419
|
+
*
|
420
|
+
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
421
|
+
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
422
|
+
* var source = new EventSource('/stream');
|
423
|
+
* jQuery(source).on('message', debounced);
|
424
|
+
*
|
425
|
+
* // Cancel the trailing debounced invocation.
|
426
|
+
* jQuery(window).on('popstate', debounced.cancel);
|
427
|
+
*/
|
428
|
+
function debounce(func, wait, options) {
|
429
|
+
var lastArgs,
|
430
|
+
lastThis,
|
431
|
+
maxWait,
|
432
|
+
result,
|
433
|
+
timerId,
|
434
|
+
lastCallTime,
|
435
|
+
lastInvokeTime = 0,
|
436
|
+
leading = false,
|
437
|
+
maxing = false,
|
438
|
+
trailing = true;
|
439
|
+
|
440
|
+
if (typeof func != 'function') {
|
441
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
442
|
+
}
|
443
|
+
wait = toNumber(wait) || 0;
|
444
|
+
if (isObject(options)) {
|
445
|
+
leading = !!options.leading;
|
446
|
+
maxing = 'maxWait' in options;
|
447
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
448
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
449
|
+
}
|
450
|
+
|
451
|
+
function invokeFunc(time) {
|
452
|
+
var args = lastArgs,
|
453
|
+
thisArg = lastThis;
|
454
|
+
|
455
|
+
lastArgs = lastThis = undefined;
|
456
|
+
lastInvokeTime = time;
|
457
|
+
result = func.apply(thisArg, args);
|
458
|
+
return result;
|
459
|
+
}
|
460
|
+
|
461
|
+
function leadingEdge(time) {
|
462
|
+
// Reset any `maxWait` timer.
|
463
|
+
lastInvokeTime = time;
|
464
|
+
// Start the timer for the trailing edge.
|
465
|
+
timerId = setTimeout(timerExpired, wait);
|
466
|
+
// Invoke the leading edge.
|
467
|
+
return leading ? invokeFunc(time) : result;
|
468
|
+
}
|
469
|
+
|
470
|
+
function remainingWait(time) {
|
471
|
+
var timeSinceLastCall = time - lastCallTime,
|
472
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
473
|
+
result = wait - timeSinceLastCall;
|
474
|
+
|
475
|
+
return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;
|
476
|
+
}
|
477
|
+
|
478
|
+
function shouldInvoke(time) {
|
479
|
+
var timeSinceLastCall = time - lastCallTime,
|
480
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
481
|
+
|
482
|
+
// Either this is the first call, activity has stopped and we're at the
|
483
|
+
// trailing edge, the system time has gone backwards and we're treating
|
484
|
+
// it as the trailing edge, or we've hit the `maxWait` limit.
|
485
|
+
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
486
|
+
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
487
|
+
}
|
488
|
+
|
489
|
+
function timerExpired() {
|
490
|
+
var time = now();
|
491
|
+
if (shouldInvoke(time)) {
|
492
|
+
return trailingEdge(time);
|
493
|
+
}
|
494
|
+
// Restart the timer.
|
495
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
496
|
+
}
|
497
|
+
|
498
|
+
function trailingEdge(time) {
|
499
|
+
timerId = undefined;
|
500
|
+
|
501
|
+
// Only invoke if we have `lastArgs` which means `func` has been
|
502
|
+
// debounced at least once.
|
503
|
+
if (trailing && lastArgs) {
|
504
|
+
return invokeFunc(time);
|
505
|
+
}
|
506
|
+
lastArgs = lastThis = undefined;
|
507
|
+
return result;
|
508
|
+
}
|
509
|
+
|
510
|
+
function cancel() {
|
511
|
+
if (timerId !== undefined) {
|
512
|
+
clearTimeout(timerId);
|
513
|
+
}
|
514
|
+
lastInvokeTime = 0;
|
515
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
516
|
+
}
|
517
|
+
|
518
|
+
function flush() {
|
519
|
+
return timerId === undefined ? result : trailingEdge(now());
|
520
|
+
}
|
521
|
+
|
522
|
+
function debounced() {
|
523
|
+
var time = now(),
|
524
|
+
isInvoking = shouldInvoke(time);
|
525
|
+
|
526
|
+
lastArgs = arguments;
|
527
|
+
lastThis = this;
|
528
|
+
lastCallTime = time;
|
529
|
+
|
530
|
+
if (isInvoking) {
|
531
|
+
if (timerId === undefined) {
|
532
|
+
return leadingEdge(lastCallTime);
|
533
|
+
}
|
534
|
+
if (maxing) {
|
535
|
+
// Handle invocations in a tight loop.
|
536
|
+
timerId = setTimeout(timerExpired, wait);
|
537
|
+
return invokeFunc(lastCallTime);
|
538
|
+
}
|
539
|
+
}
|
540
|
+
if (timerId === undefined) {
|
541
|
+
timerId = setTimeout(timerExpired, wait);
|
542
|
+
}
|
543
|
+
return result;
|
544
|
+
}
|
545
|
+
debounced.cancel = cancel;
|
546
|
+
debounced.flush = flush;
|
547
|
+
return debounced;
|
548
|
+
}
|
549
|
+
|
550
|
+
/**
|
551
|
+
* Creates a throttled function that only invokes `func` at most once per
|
552
|
+
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
553
|
+
* method to cancel delayed `func` invocations and a `flush` method to
|
554
|
+
* immediately invoke them. Provide `options` to indicate whether `func`
|
555
|
+
* should be invoked on the leading and/or trailing edge of the `wait`
|
556
|
+
* timeout. The `func` is invoked with the last arguments provided to the
|
557
|
+
* throttled function. Subsequent calls to the throttled function return the
|
558
|
+
* result of the last `func` invocation.
|
559
|
+
*
|
560
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
561
|
+
* invoked on the trailing edge of the timeout only if the throttled function
|
562
|
+
* is invoked more than once during the `wait` timeout.
|
563
|
+
*
|
564
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
565
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
566
|
+
*
|
567
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
568
|
+
* for details over the differences between `_.throttle` and `_.debounce`.
|
569
|
+
*
|
570
|
+
* @static
|
571
|
+
* @memberOf _
|
572
|
+
* @since 0.1.0
|
573
|
+
* @category Function
|
574
|
+
* @param {Function} func The function to throttle.
|
575
|
+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
576
|
+
* @param {Object} [options={}] The options object.
|
577
|
+
* @param {boolean} [options.leading=true]
|
578
|
+
* Specify invoking on the leading edge of the timeout.
|
579
|
+
* @param {boolean} [options.trailing=true]
|
580
|
+
* Specify invoking on the trailing edge of the timeout.
|
581
|
+
* @returns {Function} Returns the new throttled function.
|
582
|
+
* @example
|
583
|
+
*
|
584
|
+
* // Avoid excessively updating the position while scrolling.
|
585
|
+
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
586
|
+
*
|
587
|
+
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
588
|
+
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
589
|
+
* jQuery(element).on('click', throttled);
|
590
|
+
*
|
591
|
+
* // Cancel the trailing throttled invocation.
|
592
|
+
* jQuery(window).on('popstate', throttled.cancel);
|
593
|
+
*/
|
594
|
+
function throttle(func, wait, options) {
|
595
|
+
var leading = true,
|
596
|
+
trailing = true;
|
597
|
+
|
598
|
+
if (typeof func != 'function') {
|
599
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
600
|
+
}
|
601
|
+
if (isObject(options)) {
|
602
|
+
leading = 'leading' in options ? !!options.leading : leading;
|
603
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
604
|
+
}
|
605
|
+
return debounce(func, wait, {
|
606
|
+
'leading': leading,
|
607
|
+
'maxWait': wait,
|
608
|
+
'trailing': trailing
|
609
|
+
});
|
610
|
+
}
|
611
|
+
|
612
|
+
/**
|
613
|
+
* Checks if `value` is the
|
614
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
615
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
616
|
+
*
|
617
|
+
* @static
|
618
|
+
* @memberOf _
|
619
|
+
* @since 0.1.0
|
620
|
+
* @category Lang
|
621
|
+
* @param {*} value The value to check.
|
622
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
623
|
+
* @example
|
624
|
+
*
|
625
|
+
* _.isObject({});
|
626
|
+
* // => true
|
627
|
+
*
|
628
|
+
* _.isObject([1, 2, 3]);
|
629
|
+
* // => true
|
630
|
+
*
|
631
|
+
* _.isObject(_.noop);
|
632
|
+
* // => true
|
633
|
+
*
|
634
|
+
* _.isObject(null);
|
635
|
+
* // => false
|
636
|
+
*/
|
637
|
+
function isObject(value) {
|
638
|
+
var type = typeof value;
|
639
|
+
return !!value && (type == 'object' || type == 'function');
|
640
|
+
}
|
641
|
+
|
642
|
+
/**
|
643
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
644
|
+
* and has a `typeof` result of "object".
|
645
|
+
*
|
646
|
+
* @static
|
647
|
+
* @memberOf _
|
648
|
+
* @since 4.0.0
|
649
|
+
* @category Lang
|
650
|
+
* @param {*} value The value to check.
|
651
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
652
|
+
* @example
|
653
|
+
*
|
654
|
+
* _.isObjectLike({});
|
655
|
+
* // => true
|
656
|
+
*
|
657
|
+
* _.isObjectLike([1, 2, 3]);
|
658
|
+
* // => true
|
659
|
+
*
|
660
|
+
* _.isObjectLike(_.noop);
|
661
|
+
* // => false
|
662
|
+
*
|
663
|
+
* _.isObjectLike(null);
|
664
|
+
* // => false
|
665
|
+
*/
|
666
|
+
function isObjectLike(value) {
|
667
|
+
return !!value && typeof value == 'object';
|
668
|
+
}
|
669
|
+
|
670
|
+
/**
|
671
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
672
|
+
*
|
673
|
+
* @static
|
674
|
+
* @memberOf _
|
675
|
+
* @since 4.0.0
|
676
|
+
* @category Lang
|
677
|
+
* @param {*} value The value to check.
|
678
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
679
|
+
* @example
|
680
|
+
*
|
681
|
+
* _.isSymbol(Symbol.iterator);
|
682
|
+
* // => true
|
683
|
+
*
|
684
|
+
* _.isSymbol('abc');
|
685
|
+
* // => false
|
686
|
+
*/
|
687
|
+
function isSymbol(value) {
|
688
|
+
return typeof value == 'symbol' ||
|
689
|
+
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
690
|
+
}
|
691
|
+
|
692
|
+
/**
|
693
|
+
* Converts `value` to a number.
|
694
|
+
*
|
695
|
+
* @static
|
696
|
+
* @memberOf _
|
697
|
+
* @since 4.0.0
|
698
|
+
* @category Lang
|
699
|
+
* @param {*} value The value to process.
|
700
|
+
* @returns {number} Returns the number.
|
701
|
+
* @example
|
702
|
+
*
|
703
|
+
* _.toNumber(3.2);
|
704
|
+
* // => 3.2
|
705
|
+
*
|
706
|
+
* _.toNumber(Number.MIN_VALUE);
|
707
|
+
* // => 5e-324
|
708
|
+
*
|
709
|
+
* _.toNumber(Infinity);
|
710
|
+
* // => Infinity
|
711
|
+
*
|
712
|
+
* _.toNumber('3.2');
|
713
|
+
* // => 3.2
|
714
|
+
*/
|
715
|
+
function toNumber(value) {
|
716
|
+
if (typeof value == 'number') {
|
717
|
+
return value;
|
718
|
+
}
|
719
|
+
if (isSymbol(value)) {
|
720
|
+
return NAN;
|
721
|
+
}
|
722
|
+
if (isObject(value)) {
|
723
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
724
|
+
value = isObject(other) ? (other + '') : other;
|
725
|
+
}
|
726
|
+
if (typeof value != 'string') {
|
727
|
+
return value === 0 ? value : +value;
|
728
|
+
}
|
729
|
+
value = value.replace(reTrim, '');
|
730
|
+
var isBinary = reIsBinary.test(value);
|
731
|
+
return (isBinary || reIsOctal.test(value))
|
732
|
+
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
733
|
+
: (reIsBadHex.test(value) ? NAN : +value);
|
734
|
+
}
|
735
|
+
|
736
|
+
lodash_throttle = throttle;
|
737
|
+
return lodash_throttle;
|
738
|
+
}
|
739
|
+
|
740
|
+
var lodash_throttleExports = requireLodash_throttle();
|
741
|
+
var throttle = /*@__PURE__*/getDefaultExportFromCjs(lodash_throttleExports);
|
742
|
+
|
743
|
+
/**
|
744
|
+
* @description DOM 操作
|
745
|
+
* @author Yanghc
|
746
|
+
*/
|
747
|
+
if (css) {
|
748
|
+
$.fn.css = css;
|
749
|
+
}
|
750
|
+
if (append) {
|
751
|
+
$.fn.append = append;
|
752
|
+
}
|
753
|
+
if (prepend) {
|
754
|
+
$.fn.prepend = prepend;
|
755
|
+
}
|
756
|
+
if (addClass) {
|
757
|
+
$.fn.addClass = addClass;
|
758
|
+
}
|
759
|
+
if (removeClass) {
|
760
|
+
$.fn.removeClass = removeClass;
|
761
|
+
}
|
762
|
+
if (hasClass) {
|
763
|
+
$.fn.hasClass = hasClass;
|
764
|
+
}
|
765
|
+
if (on) {
|
766
|
+
$.fn.on = on;
|
767
|
+
}
|
768
|
+
if (off) {
|
769
|
+
$.fn.off = off;
|
770
|
+
}
|
771
|
+
if (focus) {
|
772
|
+
$.fn.focus = focus;
|
773
|
+
}
|
774
|
+
if (attr) {
|
775
|
+
$.fn.attr = attr;
|
776
|
+
}
|
777
|
+
if (removeAttr) {
|
778
|
+
$.fn.removeAttr = removeAttr;
|
779
|
+
}
|
780
|
+
if (hide) {
|
781
|
+
$.fn.hide = hide;
|
782
|
+
}
|
783
|
+
if (show) {
|
784
|
+
$.fn.show = show;
|
785
|
+
}
|
786
|
+
if (parents) {
|
787
|
+
$.fn.parents = parents;
|
788
|
+
}
|
789
|
+
if (dataset) {
|
790
|
+
$.fn.dataset = dataset;
|
791
|
+
}
|
792
|
+
if (val) {
|
793
|
+
$.fn.val = val;
|
794
|
+
}
|
795
|
+
if (text) {
|
796
|
+
$.fn.text = text;
|
797
|
+
}
|
798
|
+
if (html) {
|
799
|
+
$.fn.html = html;
|
800
|
+
}
|
801
|
+
if (children) {
|
802
|
+
$.fn.children = children;
|
803
|
+
}
|
804
|
+
if (remove) {
|
805
|
+
$.fn.remove = remove;
|
806
|
+
}
|
807
|
+
if (find) {
|
808
|
+
$.fn.find = find;
|
809
|
+
}
|
810
|
+
if (width) {
|
811
|
+
$.fn.width = width;
|
812
|
+
}
|
813
|
+
if (height) {
|
814
|
+
$.fn.height = height;
|
815
|
+
}
|
816
|
+
if (filter) {
|
817
|
+
$.fn.filter = filter;
|
818
|
+
}
|
819
|
+
if (empty) {
|
820
|
+
$.fn.empty = empty;
|
821
|
+
}
|
822
|
+
|
823
|
+
/**
|
824
|
+
* @description image render elem
|
825
|
+
* @author wangfupeng
|
826
|
+
*/
|
827
|
+
function genContainerId(editor, elemNode) {
|
828
|
+
var id = DomEditor.findKey(editor, elemNode).id; // node 唯一 id
|
829
|
+
return "w-e-image-container-".concat(id);
|
830
|
+
}
|
831
|
+
/**
|
832
|
+
* 未选中时,渲染 image container
|
833
|
+
*/
|
834
|
+
function renderContainer(editor, elemNode, imageVnode, imageInfo) {
|
835
|
+
var width = imageInfo.width, height = imageInfo.height, float = imageInfo.float;
|
836
|
+
var style = {};
|
837
|
+
if (width) {
|
838
|
+
style.width = width;
|
839
|
+
}
|
840
|
+
if (height) {
|
841
|
+
style.height = height;
|
842
|
+
}
|
843
|
+
if (float) {
|
844
|
+
style.float = float;
|
845
|
+
}
|
846
|
+
var containerId = genContainerId(editor, elemNode);
|
847
|
+
return (jsx("div", { id: containerId, style: style, className: "w-e-image-container" }, imageVnode));
|
848
|
+
}
|
849
|
+
/**
|
850
|
+
* 选中状态下,渲染 image container(渲染拖拽容器,修改图片尺寸)
|
851
|
+
*/
|
852
|
+
function renderResizeContainer(editor, elemNode, imageVnode, imageInfo) {
|
853
|
+
var $body = $('body');
|
854
|
+
var containerId = genContainerId(editor, elemNode);
|
855
|
+
var width = imageInfo.width, height = imageInfo.height, float = imageInfo.float;
|
856
|
+
var originalX = 0;
|
857
|
+
var originalWith = 0;
|
858
|
+
var originalHeight = 0;
|
859
|
+
var revers = false; // 是否反转。如向右拖拽 right-top 需增加宽度(非反转),但向右拖拽 left-top 则需要减少宽度(反转)
|
860
|
+
var $container = null;
|
861
|
+
function getContainerElem() {
|
862
|
+
var $containerFromDom = $("#".concat(containerId));
|
863
|
+
if ($containerFromDom.length === 0) {
|
864
|
+
throw new Error('Cannot find image container elem');
|
865
|
+
}
|
866
|
+
return $containerFromDom;
|
867
|
+
}
|
868
|
+
// mouseover callback (节流)
|
869
|
+
var onMousemove = throttle(function (e) {
|
870
|
+
e.preventDefault();
|
871
|
+
var clientX = e.clientX;
|
872
|
+
var gap = revers ? originalX - clientX : clientX - originalX; // 考虑是否反转
|
873
|
+
var newWidth = originalWith + gap;
|
874
|
+
var newHeight = originalHeight * (newWidth / originalWith); // 根据 width ,按比例计算 height
|
875
|
+
// 实时修改 img 宽高 -【注意】这里只修改 DOM ,mouseup 时再统一不修改 node
|
876
|
+
if ($container == null) {
|
877
|
+
return;
|
878
|
+
}
|
879
|
+
if (newWidth <= 15 || newHeight <= 15) {
|
880
|
+
return;
|
881
|
+
} // 最小就是 15px
|
882
|
+
$container.css('width', "".concat(newWidth, "px"));
|
883
|
+
$container.css('height', "".concat(newHeight, "px"));
|
884
|
+
}, 100);
|
885
|
+
function onMouseup(_e) {
|
886
|
+
// 取消监听 mousemove
|
887
|
+
$body.off('mousemove', onMousemove);
|
888
|
+
if ($container == null) {
|
889
|
+
return;
|
890
|
+
}
|
891
|
+
var newWidth = $container.width().toFixed(2);
|
892
|
+
var newHeight = $container.height().toFixed(2);
|
893
|
+
// 修改 node
|
894
|
+
var props = {
|
895
|
+
style: __assign(__assign({}, elemNode.style), { width: "".concat(newWidth, "px"), height: "".concat(newHeight, "px") }),
|
896
|
+
};
|
897
|
+
SlateTransforms.setNodes(editor, props, { at: DomEditor.findPath(editor, elemNode) });
|
898
|
+
// 取消监听 mouseup
|
899
|
+
$body.off('mouseup', onMouseup);
|
900
|
+
}
|
901
|
+
/**
|
902
|
+
* 初始化。监听事件,记录原始数据
|
903
|
+
*/
|
904
|
+
function init(clientX) {
|
905
|
+
$container = getContainerElem();
|
906
|
+
// 记录当前 x 坐标值
|
907
|
+
originalX = clientX;
|
908
|
+
// 记录 img 原始宽高
|
909
|
+
var $img = $container.find('img');
|
910
|
+
if ($img.length === 0) {
|
911
|
+
throw new Error('Cannot find image elem');
|
912
|
+
}
|
913
|
+
originalWith = $img.width();
|
914
|
+
originalHeight = $img.height();
|
915
|
+
// 监听 mousemove
|
916
|
+
$body.on('mousemove', onMousemove);
|
917
|
+
// 监听 mouseup
|
918
|
+
$body.on('mouseup', onMouseup);
|
919
|
+
// 隐藏 hoverbar
|
920
|
+
var hoverbar = DomEditor.getHoverbar(editor);
|
921
|
+
if (hoverbar) {
|
922
|
+
hoverbar.hideAndClean();
|
923
|
+
}
|
924
|
+
}
|
925
|
+
var style = {};
|
926
|
+
if (width) {
|
927
|
+
style.width = width;
|
928
|
+
}
|
929
|
+
if (height) {
|
930
|
+
style.height = height;
|
931
|
+
}
|
932
|
+
if (float) {
|
933
|
+
style.float = float;
|
934
|
+
}
|
935
|
+
// style.boxShadow = '0 0 0 1px #B4D5FF' // 自定义 selected 样式,因为有拖拽触手
|
936
|
+
return (jsx("div", { id: containerId, style: style, className: "w-e-image-container w-e-selected-image-container", on: {
|
937
|
+
// 统一绑定拖拽触手的 mousedown 事件
|
938
|
+
mousedown: function (e) {
|
939
|
+
var $target = $(e.target);
|
940
|
+
if (!$target.hasClass('w-e-image-dragger')) {
|
941
|
+
// target 不是 .w-e-image-dragger 拖拽触手,则忽略
|
942
|
+
return;
|
943
|
+
}
|
944
|
+
e.preventDefault();
|
945
|
+
if ($target.hasClass('left-top') || $target.hasClass('left-bottom')) {
|
946
|
+
revers = true; // 反转。向右拖拽,减少宽度
|
947
|
+
}
|
948
|
+
init(e.clientX); // 初始化
|
949
|
+
},
|
950
|
+
} },
|
951
|
+
imageVnode,
|
952
|
+
jsx("div", { className: "w-e-image-dragger left-top" }),
|
953
|
+
jsx("div", { className: "w-e-image-dragger right-top" }),
|
954
|
+
jsx("div", { className: "w-e-image-dragger left-bottom" }),
|
955
|
+
jsx("div", { className: "w-e-image-dragger right-bottom" })));
|
956
|
+
}
|
957
|
+
function renderImage(elemNode, children, editor) {
|
958
|
+
var _a = elemNode, src = _a.src, _b = _a.alt, alt = _b === void 0 ? '' : _b, _c = _a.href, href = _c === void 0 ? '' : _c, _d = _a.style, style = _d === void 0 ? {} : _d;
|
959
|
+
var _f = style.width, width = _f === void 0 ? '' : _f, _g = style.height, height = _g === void 0 ? '' : _g, float = style.float;
|
960
|
+
var selected = DomEditor.isNodeSelected(editor, elemNode); // 图片是否选中
|
961
|
+
var imageStyle = {};
|
962
|
+
if (width) {
|
963
|
+
imageStyle.width = '100%';
|
964
|
+
}
|
965
|
+
if (height) {
|
966
|
+
imageStyle.height = '100%';
|
967
|
+
}
|
968
|
+
if (float) {
|
969
|
+
imageStyle.float = float;
|
970
|
+
}
|
971
|
+
// 【注意】void node 中,renderElem 不用处理 children 。core 会统一处理。
|
972
|
+
var vnode = jsx("img", { style: imageStyle, src: src, alt: alt, "data-href": href });
|
973
|
+
var isDisabled = editor.isDisabled();
|
974
|
+
if (selected && !isDisabled) {
|
975
|
+
// 选中,未禁用 - 渲染 resize container
|
976
|
+
return renderResizeContainer(editor, elemNode, vnode, { width: width, height: height, float: float });
|
977
|
+
}
|
978
|
+
// 其他,渲染普通 image container
|
979
|
+
return renderContainer(editor, elemNode, vnode, { width: width, height: height, float: float });
|
980
|
+
}
|
981
|
+
var renderImageConf = {
|
982
|
+
type: 'image', // 和 elemNode.type 一致
|
983
|
+
renderElem: renderImage,
|
984
|
+
};
|
985
|
+
|
986
|
+
/**
|
987
|
+
* @description module entry
|
988
|
+
* @author Yanghc
|
989
|
+
*/
|
990
|
+
var module = {
|
991
|
+
renderElems: [renderImageConf],
|
992
|
+
elemsToHtml: [conf],
|
993
|
+
parseElemsHtml: [parseHtmlConf],
|
994
|
+
menus: [imageFloatLeftMenuConf, imageFloatRightMenuConf, imageFloatNoneMenuConf],
|
995
|
+
};
|
996
|
+
|
997
|
+
/**
|
998
|
+
* @description src entry
|
999
|
+
* @author Yanghc
|
1000
|
+
*/
|
1001
|
+
|
1002
|
+
export { module as default };
|