@syncfusion/ej2-richtexteditor 29.2.4-738301 → 29.2.4-760237
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/.eslintrc.json +262 -260
- package/aceconfig.js +17 -0
- package/blazorGlobalSrc/common/config.d.ts +63 -0
- package/blazorGlobalSrc/common/config.js +123 -0
- package/blazorGlobalSrc/common/constant.d.ts +117 -0
- package/blazorGlobalSrc/common/constant.js +23 -0
- package/blazorGlobalSrc/common/editor-styles.d.ts +1 -0
- package/blazorGlobalSrc/common/editor-styles.js +5 -0
- package/blazorGlobalSrc/common/index.d.ts +7 -0
- package/blazorGlobalSrc/common/index.js +9 -0
- package/blazorGlobalSrc/common/interface.d.ts +119 -0
- package/blazorGlobalSrc/common/interface.js +4 -0
- package/blazorGlobalSrc/common/types.d.ts +25 -0
- package/blazorGlobalSrc/common/types.js +4 -0
- package/blazorGlobalSrc/common/user-agent.d.ts +41 -0
- package/blazorGlobalSrc/common/user-agent.js +71 -0
- package/blazorGlobalSrc/common/util.d.ts +70 -0
- package/blazorGlobalSrc/common/util.js +222 -0
- package/blazorGlobalSrc/components.d.ts +8 -0
- package/blazorGlobalSrc/components.js +12 -0
- package/blazorGlobalSrc/editor-manager/base/classes.d.ts +31 -0
- package/blazorGlobalSrc/editor-manager/base/classes.js +28 -0
- package/blazorGlobalSrc/editor-manager/base/constant.d.ts +97 -0
- package/blazorGlobalSrc/editor-manager/base/constant.js +41 -0
- package/blazorGlobalSrc/editor-manager/base/editor-manager.d.ts +95 -0
- package/blazorGlobalSrc/editor-manager/base/editor-manager.js +339 -0
- package/blazorGlobalSrc/editor-manager/base/enum.d.ts +17 -0
- package/blazorGlobalSrc/editor-manager/base/enum.js +4 -0
- package/blazorGlobalSrc/editor-manager/base/interface.d.ts +263 -0
- package/blazorGlobalSrc/editor-manager/base/interface.js +4 -0
- package/blazorGlobalSrc/editor-manager/base/types.d.ts +7 -0
- package/blazorGlobalSrc/editor-manager/base/types.js +4 -0
- package/blazorGlobalSrc/editor-manager/base.d.ts +8 -0
- package/blazorGlobalSrc/editor-manager/base.js +10 -0
- package/blazorGlobalSrc/editor-manager/index.d.ts +5 -0
- package/blazorGlobalSrc/editor-manager/index.js +9 -0
- package/blazorGlobalSrc/editor-manager/plugin/alignments.d.ts +26 -0
- package/blazorGlobalSrc/editor-manager/plugin/alignments.js +105 -0
- package/blazorGlobalSrc/editor-manager/plugin/audio.d.ts +34 -0
- package/blazorGlobalSrc/editor-manager/plugin/audio.js +145 -0
- package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.d.ts +24 -0
- package/blazorGlobalSrc/editor-manager/plugin/clearformat-exec.js +47 -0
- package/blazorGlobalSrc/editor-manager/plugin/clearformat.d.ts +29 -0
- package/blazorGlobalSrc/editor-manager/plugin/clearformat.js +249 -0
- package/blazorGlobalSrc/editor-manager/plugin/dom-node.d.ts +351 -0
- package/blazorGlobalSrc/editor-manager/plugin/dom-node.js +737 -0
- package/blazorGlobalSrc/editor-manager/plugin/dom-tree.d.ts +84 -0
- package/blazorGlobalSrc/editor-manager/plugin/dom-tree.js +164 -0
- package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.d.ts +10 -0
- package/blazorGlobalSrc/editor-manager/plugin/emoji-picker-action.js +86 -0
- package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.d.ts +47 -0
- package/blazorGlobalSrc/editor-manager/plugin/format-painter-actions.js +622 -0
- package/blazorGlobalSrc/editor-manager/plugin/formats.d.ts +43 -0
- package/blazorGlobalSrc/editor-manager/plugin/formats.js +597 -0
- package/blazorGlobalSrc/editor-manager/plugin/image.d.ts +48 -0
- package/blazorGlobalSrc/editor-manager/plugin/image.js +399 -0
- package/blazorGlobalSrc/editor-manager/plugin/indents.d.ts +24 -0
- package/blazorGlobalSrc/editor-manager/plugin/indents.js +106 -0
- package/blazorGlobalSrc/editor-manager/plugin/insert-methods.d.ts +48 -0
- package/blazorGlobalSrc/editor-manager/plugin/insert-methods.js +37 -0
- package/blazorGlobalSrc/editor-manager/plugin/insert-text.d.ts +22 -0
- package/blazorGlobalSrc/editor-manager/plugin/insert-text.js +36 -0
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.d.ts +22 -0
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml-exec.js +49 -0
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml.d.ts +51 -0
- package/blazorGlobalSrc/editor-manager/plugin/inserthtml.js +985 -0
- package/blazorGlobalSrc/editor-manager/plugin/isformatted.d.ts +89 -0
- package/blazorGlobalSrc/editor-manager/plugin/isformatted.js +199 -0
- package/blazorGlobalSrc/editor-manager/plugin/link.d.ts +41 -0
- package/blazorGlobalSrc/editor-manager/plugin/link.js +550 -0
- package/blazorGlobalSrc/editor-manager/plugin/lists.d.ts +74 -0
- package/blazorGlobalSrc/editor-manager/plugin/lists.js +1503 -0
- package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.d.ts +61 -0
- package/blazorGlobalSrc/editor-manager/plugin/ms-word-clean-up.js +1136 -0
- package/blazorGlobalSrc/editor-manager/plugin/nodecutter.d.ts +64 -0
- package/blazorGlobalSrc/editor-manager/plugin/nodecutter.js +167 -0
- package/blazorGlobalSrc/editor-manager/plugin/selection-commands.d.ts +41 -0
- package/blazorGlobalSrc/editor-manager/plugin/selection-commands.js +1069 -0
- package/blazorGlobalSrc/editor-manager/plugin/selection-exec.d.ts +24 -0
- package/blazorGlobalSrc/editor-manager/plugin/selection-exec.js +49 -0
- package/blazorGlobalSrc/editor-manager/plugin/table-selection.d.ts +26 -0
- package/blazorGlobalSrc/editor-manager/plugin/table-selection.js +210 -0
- package/blazorGlobalSrc/editor-manager/plugin/table.d.ts +56 -0
- package/blazorGlobalSrc/editor-manager/plugin/table.js +1100 -0
- package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.d.ts +39 -0
- package/blazorGlobalSrc/editor-manager/plugin/toolbar-status.js +384 -0
- package/blazorGlobalSrc/editor-manager/plugin/undo.d.ts +85 -0
- package/blazorGlobalSrc/editor-manager/plugin/undo.js +216 -0
- package/blazorGlobalSrc/editor-manager/plugin/video.d.ts +38 -0
- package/blazorGlobalSrc/editor-manager/plugin/video.js +311 -0
- package/blazorGlobalSrc/editor-manager/plugin.d.ts +27 -0
- package/blazorGlobalSrc/editor-manager/plugin.js +31 -0
- package/blazorGlobalSrc/global.d.ts +1 -0
- package/blazorGlobalSrc/global.js +3 -0
- package/blazorGlobalSrc/index.d.ts +8 -0
- package/blazorGlobalSrc/index.js +12 -0
- package/blazorGlobalSrc/markdown-parser/base/constant.d.ts +39 -0
- package/blazorGlobalSrc/markdown-parser/base/constant.js +10 -0
- package/blazorGlobalSrc/markdown-parser/base/interface.d.ts +169 -0
- package/blazorGlobalSrc/markdown-parser/base/interface.js +4 -0
- package/blazorGlobalSrc/markdown-parser/base/markdown-parser.d.ts +69 -0
- package/blazorGlobalSrc/markdown-parser/base/markdown-parser.js +87 -0
- package/blazorGlobalSrc/markdown-parser/base/types.d.ts +7 -0
- package/blazorGlobalSrc/markdown-parser/base/types.js +4 -0
- package/blazorGlobalSrc/markdown-parser/base.d.ts +7 -0
- package/blazorGlobalSrc/markdown-parser/base.js +9 -0
- package/blazorGlobalSrc/markdown-parser/index.d.ts +5 -0
- package/blazorGlobalSrc/markdown-parser/index.js +9 -0
- package/blazorGlobalSrc/markdown-parser/plugin/clearformat.d.ts +28 -0
- package/blazorGlobalSrc/markdown-parser/plugin/clearformat.js +110 -0
- package/blazorGlobalSrc/markdown-parser/plugin/formats.d.ts +32 -0
- package/blazorGlobalSrc/markdown-parser/plugin/formats.js +225 -0
- package/blazorGlobalSrc/markdown-parser/plugin/insert-text.d.ts +24 -0
- package/blazorGlobalSrc/markdown-parser/plugin/insert-text.js +49 -0
- package/blazorGlobalSrc/markdown-parser/plugin/link.d.ts +24 -0
- package/blazorGlobalSrc/markdown-parser/plugin/link.js +50 -0
- package/blazorGlobalSrc/markdown-parser/plugin/lists.d.ts +39 -0
- package/blazorGlobalSrc/markdown-parser/plugin/lists.js +462 -0
- package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.d.ts +140 -0
- package/blazorGlobalSrc/markdown-parser/plugin/markdown-selection.js +104 -0
- package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.d.ts +31 -0
- package/blazorGlobalSrc/markdown-parser/plugin/md-selection-formats.js +335 -0
- package/blazorGlobalSrc/markdown-parser/plugin/table.d.ts +52 -0
- package/blazorGlobalSrc/markdown-parser/plugin/table.js +216 -0
- package/blazorGlobalSrc/markdown-parser/plugin/undo.d.ts +83 -0
- package/blazorGlobalSrc/markdown-parser/plugin/undo.js +147 -0
- package/blazorGlobalSrc/markdown-parser/plugin.d.ts +11 -0
- package/blazorGlobalSrc/markdown-parser/plugin.js +15 -0
- package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.d.ts +114 -0
- package/blazorGlobalSrc/rich-text-editor/actions/base-quick-toolbar.js +465 -0
- package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.d.ts +58 -0
- package/blazorGlobalSrc/rich-text-editor/actions/base-toolbar.js +216 -0
- package/blazorGlobalSrc/rich-text-editor/actions/color-picker.d.ts +52 -0
- package/blazorGlobalSrc/rich-text-editor/actions/color-picker.js +241 -0
- package/blazorGlobalSrc/rich-text-editor/actions/count.d.ts +55 -0
- package/blazorGlobalSrc/rich-text-editor/actions/count.js +117 -0
- package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.d.ts +72 -0
- package/blazorGlobalSrc/rich-text-editor/actions/dropdown-buttons.js +552 -0
- package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.d.ts +51 -0
- package/blazorGlobalSrc/rich-text-editor/actions/emoji-picker.js +853 -0
- package/blazorGlobalSrc/rich-text-editor/actions/enter-key.d.ts +28 -0
- package/blazorGlobalSrc/rich-text-editor/actions/enter-key.js +821 -0
- package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.d.ts +11 -0
- package/blazorGlobalSrc/rich-text-editor/actions/execute-command-callback.js +28 -0
- package/blazorGlobalSrc/rich-text-editor/actions/file-manager.d.ts +45 -0
- package/blazorGlobalSrc/rich-text-editor/actions/file-manager.js +249 -0
- package/blazorGlobalSrc/rich-text-editor/actions/format-painter.d.ts +25 -0
- package/blazorGlobalSrc/rich-text-editor/actions/format-painter.js +156 -0
- package/blazorGlobalSrc/rich-text-editor/actions/full-screen.d.ts +40 -0
- package/blazorGlobalSrc/rich-text-editor/actions/full-screen.js +148 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.d.ts +15 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-attributes.js +50 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-editor.d.ts +120 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-editor.js +1244 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.d.ts +14 -0
- package/blazorGlobalSrc/rich-text-editor/actions/html-toolbar-status.js +47 -0
- package/blazorGlobalSrc/rich-text-editor/actions/import-export.d.ts +21 -0
- package/blazorGlobalSrc/rich-text-editor/actions/import-export.js +117 -0
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard-model.d.ts +30 -0
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard.d.ts +110 -0
- package/blazorGlobalSrc/rich-text-editor/actions/keyboard.js +163 -0
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.d.ts +66 -0
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-editor.js +142 -0
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.d.ts +23 -0
- package/blazorGlobalSrc/rich-text-editor/actions/markdown-toolbar-status.js +124 -0
- package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.d.ts +86 -0
- package/blazorGlobalSrc/rich-text-editor/actions/paste-clean-up.js +1071 -0
- package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.d.ts +151 -0
- package/blazorGlobalSrc/rich-text-editor/actions/quick-toolbar.js +548 -0
- package/blazorGlobalSrc/rich-text-editor/actions/resize.d.ts +37 -0
- package/blazorGlobalSrc/rich-text-editor/actions/resize.js +188 -0
- package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.d.ts +11 -0
- package/blazorGlobalSrc/rich-text-editor/actions/sanitize-helper.js +168 -0
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.d.ts +18 -0
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar-action.js +76 -0
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar.d.ts +185 -0
- package/blazorGlobalSrc/rich-text-editor/actions/toolbar.js +512 -0
- package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.d.ts +25 -0
- package/blazorGlobalSrc/rich-text-editor/actions/xhtml-validation.js +166 -0
- package/blazorGlobalSrc/rich-text-editor/actions.d.ts +26 -0
- package/blazorGlobalSrc/rich-text-editor/actions.js +30 -0
- package/blazorGlobalSrc/rich-text-editor/audio.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/audio.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/base/classes.d.ts +628 -0
- package/blazorGlobalSrc/rich-text-editor/base/classes.js +129 -0
- package/blazorGlobalSrc/rich-text-editor/base/constant.d.ts +808 -0
- package/blazorGlobalSrc/rich-text-editor/base/constant.js +334 -0
- package/blazorGlobalSrc/rich-text-editor/base/enum.d.ts +81 -0
- package/blazorGlobalSrc/rich-text-editor/base/enum.js +37 -0
- package/blazorGlobalSrc/rich-text-editor/base/interface.d.ts +1577 -0
- package/blazorGlobalSrc/rich-text-editor/base/interface.js +194 -0
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor-model.d.ts +1032 -0
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.d.ts +1699 -0
- package/blazorGlobalSrc/rich-text-editor/base/rich-text-editor.js +2645 -0
- package/blazorGlobalSrc/rich-text-editor/base/util.d.ts +212 -0
- package/blazorGlobalSrc/rich-text-editor/base/util.js +610 -0
- package/blazorGlobalSrc/rich-text-editor/base.d.ts +10 -0
- package/blazorGlobalSrc/rich-text-editor/base.js +13 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/formatter.d.ts +87 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/formatter.js +223 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.d.ts +34 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/html-formatter.js +44 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.d.ts +39 -0
- package/blazorGlobalSrc/rich-text-editor/formatter/markdown-formatter.js +48 -0
- package/blazorGlobalSrc/rich-text-editor/formatter.d.ts +6 -0
- package/blazorGlobalSrc/rich-text-editor/formatter.js +10 -0
- package/blazorGlobalSrc/rich-text-editor/html-editor.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/html-editor.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/image.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/image.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/index.d.ts +9 -0
- package/blazorGlobalSrc/rich-text-editor/index.js +12 -0
- package/blazorGlobalSrc/rich-text-editor/link.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/link.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/markdown-editor.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/markdown-editor.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/models/default-locale.d.ts +25 -0
- package/blazorGlobalSrc/rich-text-editor/models/default-locale.js +391 -0
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings-model.d.ts +68 -0
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.d.ts +61 -0
- package/blazorGlobalSrc/rich-text-editor/models/iframe-settings.js +60 -0
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode-model.d.ts +24 -0
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode.d.ts +20 -0
- package/blazorGlobalSrc/rich-text-editor/models/inline-mode.js +37 -0
- package/blazorGlobalSrc/rich-text-editor/models/items.d.ts +36 -0
- package/blazorGlobalSrc/rich-text-editor/models/items.js +1011 -0
- package/blazorGlobalSrc/rich-text-editor/models/models.d.ts +7 -0
- package/blazorGlobalSrc/rich-text-editor/models/models.js +4 -0
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings-model.d.ts +40 -0
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.d.ts +50 -0
- package/blazorGlobalSrc/rich-text-editor/models/slash-menu-settings.js +143 -0
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings-model.d.ts +1130 -0
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.d.ts +992 -0
- package/blazorGlobalSrc/rich-text-editor/models/toolbar-settings.js +510 -0
- package/blazorGlobalSrc/rich-text-editor/models.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/models.js +4 -0
- package/blazorGlobalSrc/rich-text-editor/quick-toolbar.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/quick-toolbar.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.d.ts +82 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/audio-module.js +886 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.d.ts +65 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/content-renderer.js +49 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.d.ts +39 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/dialog-renderer.js +111 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.d.ts +33 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/iframe-content-renderer.js +101 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/image-module.d.ts +199 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/image-module.js +2494 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/link-module.d.ts +63 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/link-module.js +596 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.d.ts +65 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/markdown-renderer.js +38 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.d.ts +54 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/popup-renderer.js +35 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/render.d.ts +46 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/render.js +70 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.d.ts +20 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/slash-menu.js +224 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/table-module.d.ts +155 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/table-module.js +2206 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.d.ts +131 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/toolbar-renderer.js +747 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/video-module.d.ts +120 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/video-module.js +1507 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/view-source.d.ts +74 -0
- package/blazorGlobalSrc/rich-text-editor/renderer/view-source.js +225 -0
- package/blazorGlobalSrc/rich-text-editor/renderer.d.ts +17 -0
- package/blazorGlobalSrc/rich-text-editor/renderer.js +21 -0
- package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.d.ts +33 -0
- package/blazorGlobalSrc/rich-text-editor/services/renderer-factory.js +29 -0
- package/blazorGlobalSrc/rich-text-editor/services/service-locator.d.ts +29 -0
- package/blazorGlobalSrc/rich-text-editor/services/service-locator.js +25 -0
- package/blazorGlobalSrc/rich-text-editor/services.d.ts +5 -0
- package/blazorGlobalSrc/rich-text-editor/services.js +9 -0
- package/blazorGlobalSrc/rich-text-editor/toolbar.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/toolbar.js +8 -0
- package/blazorGlobalSrc/rich-text-editor/video.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor/video.js +8 -0
- package/blazorGlobalSrc/rich-text-editor.d.ts +4 -0
- package/blazorGlobalSrc/rich-text-editor.js +8 -0
- package/blazorGlobalSrc/selection/index.d.ts +4 -0
- package/blazorGlobalSrc/selection/index.js +8 -0
- package/blazorGlobalSrc/selection/selection.d.ts +244 -0
- package/blazorGlobalSrc/selection/selection.js +309 -0
- package/dist/ej2-richtexteditor.umd.min.js +1 -1
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +6 -4
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +6 -4
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/helpers/e2e/index.d.ts +1 -0
- package/helpers/e2e/index.js +8 -0
- package/helpers/e2e/rte-helper.d.ts +79 -0
- package/helpers/e2e/rte-helper.js +81 -0
- package/package.json +1 -1
- package/src/editor-manager/plugin/dom-tree.js +6 -4
- package/src/global.d.ts +1 -0
- package/styles/bds-lite.css +7 -17
- package/styles/bds.css +11 -22
- package/styles/bootstrap-dark-lite.css +3 -13
- package/styles/bootstrap-dark.css +3 -14
- package/styles/bootstrap-lite.css +3 -13
- package/styles/bootstrap.css +3 -14
- package/styles/bootstrap4-lite.css +3 -13
- package/styles/bootstrap4.css +3 -14
- package/styles/bootstrap5-dark-lite.css +3 -13
- package/styles/bootstrap5-dark.css +3 -14
- package/styles/bootstrap5-lite.css +3 -13
- package/styles/bootstrap5.3-lite.css +3 -13
- package/styles/bootstrap5.3.css +3 -14
- package/styles/bootstrap5.css +3 -14
- package/styles/fabric-dark-lite.css +3 -13
- package/styles/fabric-dark.css +3 -14
- package/styles/fabric-lite.css +3 -13
- package/styles/fabric.css +3 -14
- package/styles/fluent-dark-lite.css +3 -13
- package/styles/fluent-dark.css +3 -14
- package/styles/fluent-lite.css +3 -13
- package/styles/fluent.css +3 -14
- package/styles/fluent2-lite.css +3 -13
- package/styles/fluent2.css +3 -14
- package/styles/highcontrast-light-lite.css +3 -13
- package/styles/highcontrast-light.css +3 -14
- package/styles/highcontrast-lite.css +3 -13
- package/styles/highcontrast.css +3 -14
- package/styles/material-dark-lite.css +3 -13
- package/styles/material-dark.css +3 -14
- package/styles/material-lite.css +3 -13
- package/styles/material.css +3 -14
- package/styles/material3-dark-lite.css +3 -13
- package/styles/material3-dark.css +3 -14
- package/styles/material3-lite.css +3 -13
- package/styles/material3.css +3 -14
- package/styles/rich-text-editor/_bds-definition.scss +2 -2
- package/styles/rich-text-editor/_bigger.scss +0 -1
- package/styles/rich-text-editor/_layout.scss +0 -9
- package/styles/rich-text-editor/_theme.scss +3 -0
- package/styles/rich-text-editor/bds.css +11 -22
- package/styles/rich-text-editor/bootstrap-dark.css +3 -14
- package/styles/rich-text-editor/bootstrap.css +3 -14
- package/styles/rich-text-editor/bootstrap4.css +3 -14
- package/styles/rich-text-editor/bootstrap5-dark.css +3 -14
- package/styles/rich-text-editor/bootstrap5.3.css +3 -14
- package/styles/rich-text-editor/bootstrap5.css +3 -14
- package/styles/rich-text-editor/fabric-dark.css +3 -14
- package/styles/rich-text-editor/fabric.css +3 -14
- package/styles/rich-text-editor/fluent-dark.css +3 -14
- package/styles/rich-text-editor/fluent.css +3 -14
- package/styles/rich-text-editor/fluent2.css +3 -14
- package/styles/rich-text-editor/highcontrast-light.css +3 -14
- package/styles/rich-text-editor/highcontrast.css +3 -14
- package/styles/rich-text-editor/material-dark.css +3 -14
- package/styles/rich-text-editor/material.css +3 -14
- package/styles/rich-text-editor/material3-dark.css +3 -14
- package/styles/rich-text-editor/material3.css +3 -14
- package/styles/rich-text-editor/tailwind-dark.css +3 -14
- package/styles/rich-text-editor/tailwind.css +3 -14
- package/styles/rich-text-editor/tailwind3.css +3 -14
- package/styles/tailwind-dark-lite.css +3 -13
- package/styles/tailwind-dark.css +3 -14
- package/styles/tailwind-lite.css +3 -13
- package/styles/tailwind.css +3 -14
- package/styles/tailwind3-lite.css +3 -13
- package/styles/tailwind3.css +3 -14
- package/tslint.json +111 -0
|
@@ -0,0 +1,737 @@
|
|
|
1
|
+
define(["require", "exports", "./../base/constant", "@syncfusion/ej2-base", "./../../selection/index", "../../common/config", "../../common/util", "./table-selection"], function (require, exports, CONSTANT, ej2_base_1, index_1, config_1, util_1, table_selection_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.markerClassName = {
|
|
5
|
+
startSelection: 'e-editor-select-start',
|
|
6
|
+
endSelection: 'e-editor-select-end'
|
|
7
|
+
};
|
|
8
|
+
var DOMNode = (function () {
|
|
9
|
+
function DOMNode(parent, currentDocument) {
|
|
10
|
+
this.parent = parent;
|
|
11
|
+
this.nodeSelection = new index_1.NodeSelection(parent);
|
|
12
|
+
this.currentDocument = currentDocument;
|
|
13
|
+
this.tableSelection = new table_selection_1.TableSelection(parent, currentDocument);
|
|
14
|
+
}
|
|
15
|
+
DOMNode.prototype.contents = function (element) {
|
|
16
|
+
return (element && 'IFRAME' !== element.tagName ? Array.prototype.slice.call(element.childNodes || []) : []);
|
|
17
|
+
};
|
|
18
|
+
DOMNode.prototype.isBlockNode = function (element) {
|
|
19
|
+
return (!!element && (element.nodeType === Node.ELEMENT_NODE && CONSTANT.BLOCK_TAGS.indexOf(element.tagName.toLowerCase()) >= 0));
|
|
20
|
+
};
|
|
21
|
+
DOMNode.prototype.isLink = function (element) {
|
|
22
|
+
return (!!element && (element.nodeType === Node.ELEMENT_NODE && 'a' === element.tagName.toLowerCase()));
|
|
23
|
+
};
|
|
24
|
+
DOMNode.prototype.blockParentNode = function (element) {
|
|
25
|
+
for (; element && element.parentNode !== this.parent && ((!element.parentNode ||
|
|
26
|
+
!this.hasClass(element.parentNode, 'e-node-inner'))); null) {
|
|
27
|
+
element = element.parentNode;
|
|
28
|
+
if (this.isBlockNode(element)) {
|
|
29
|
+
return element;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return element;
|
|
33
|
+
};
|
|
34
|
+
DOMNode.prototype.rawAttributes = function (element) {
|
|
35
|
+
var rawAttr = {};
|
|
36
|
+
var attributes = element.attributes;
|
|
37
|
+
if (attributes.length > 0) {
|
|
38
|
+
for (var d = 0; d < attributes.length; d++) {
|
|
39
|
+
var e = attributes[d];
|
|
40
|
+
rawAttr[e.nodeName] = e.value;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return rawAttr;
|
|
44
|
+
};
|
|
45
|
+
DOMNode.prototype.attributes = function (element) {
|
|
46
|
+
if (!element) {
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
49
|
+
var attr = '';
|
|
50
|
+
var rawAttr = this.rawAttributes(element);
|
|
51
|
+
var orderRawAttr = Object.keys(rawAttr).sort();
|
|
52
|
+
for (var e = 0; e < orderRawAttr.length; e++) {
|
|
53
|
+
var attrKey = orderRawAttr[e];
|
|
54
|
+
var attrValue = rawAttr["" + attrKey];
|
|
55
|
+
if (attrValue.indexOf("'") < 0 && attrValue.indexOf('"') >= 0) {
|
|
56
|
+
attr += ' ' + attrKey + "='" + attrValue + "'";
|
|
57
|
+
}
|
|
58
|
+
else if (attrValue.indexOf('"') >= 0 && attrValue.indexOf("'") >= 0) {
|
|
59
|
+
attrValue = attrValue.replace(/"/g, '"');
|
|
60
|
+
attr += ' ' + attrKey + '="' + attrValue + '"';
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
attr += ' ' + attrKey + '="' + attrValue + '"';
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return attr;
|
|
67
|
+
};
|
|
68
|
+
DOMNode.prototype.clearAttributes = function (element) {
|
|
69
|
+
for (var attr = element.attributes, c = attr.length - 1; c >= 0; c--) {
|
|
70
|
+
var key = attr[c];
|
|
71
|
+
element.removeAttribute(key.nodeName);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
DOMNode.prototype.openTagString = function (element) {
|
|
75
|
+
return '<' + element.tagName.toLowerCase() + this.attributes(element) + '>';
|
|
76
|
+
};
|
|
77
|
+
DOMNode.prototype.closeTagString = function (element) {
|
|
78
|
+
return '</' + element.tagName.toLowerCase() + '>';
|
|
79
|
+
};
|
|
80
|
+
DOMNode.prototype.createTagString = function (tagName, relativeElement, innerHTML) {
|
|
81
|
+
return '<' + tagName.toLowerCase() + this.attributes(relativeElement) + '>' + innerHTML + '</' + tagName.toLowerCase() + '>';
|
|
82
|
+
};
|
|
83
|
+
DOMNode.prototype.isList = function (element) {
|
|
84
|
+
return !!element && ['UL', 'OL'].indexOf(element.tagName) >= 0;
|
|
85
|
+
};
|
|
86
|
+
DOMNode.prototype.isElement = function (element) {
|
|
87
|
+
return element === this.parent;
|
|
88
|
+
};
|
|
89
|
+
DOMNode.prototype.isEditable = function (element) {
|
|
90
|
+
return ((!element.getAttribute || element.getAttribute('contenteditable') === 'true')
|
|
91
|
+
&& ['STYLE', 'SCRIPT'].indexOf(element.tagName) < 0);
|
|
92
|
+
};
|
|
93
|
+
DOMNode.prototype.hasClass = function (element, className) {
|
|
94
|
+
return element && element.classList && element.classList.contains(className);
|
|
95
|
+
};
|
|
96
|
+
DOMNode.prototype.replaceWith = function (element, value) {
|
|
97
|
+
var parentNode = element.parentNode;
|
|
98
|
+
parentNode.insertBefore(this.parseHTMLFragment(value), element);
|
|
99
|
+
ej2_base_1.detach(element);
|
|
100
|
+
};
|
|
101
|
+
DOMNode.prototype.parseHTMLFragment = function (value) {
|
|
102
|
+
var temp = ej2_base_1.createElement('template');
|
|
103
|
+
temp.innerHTML = value;
|
|
104
|
+
if (temp.content instanceof DocumentFragment) {
|
|
105
|
+
return temp.content;
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
return document.createRange().createContextualFragment(value);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
DOMNode.prototype.wrap = function (element, wrapper) {
|
|
112
|
+
element.parentNode.insertBefore(wrapper, element);
|
|
113
|
+
wrapper = element.previousSibling;
|
|
114
|
+
wrapper.appendChild(element);
|
|
115
|
+
return wrapper;
|
|
116
|
+
};
|
|
117
|
+
DOMNode.prototype.insertAfter = function (newNode, referenceNode) {
|
|
118
|
+
referenceNode.parentNode.insertBefore(newNode, referenceNode.nextSibling);
|
|
119
|
+
};
|
|
120
|
+
DOMNode.prototype.wrapInner = function (parent, wrapper) {
|
|
121
|
+
parent.appendChild(wrapper);
|
|
122
|
+
wrapper = parent.querySelector('.e-rte-wrap-inner');
|
|
123
|
+
wrapper.classList.remove('e-rte-wrap-inner');
|
|
124
|
+
if (wrapper.classList.length === 0) {
|
|
125
|
+
wrapper.removeAttribute('class');
|
|
126
|
+
}
|
|
127
|
+
while (parent.firstChild !== wrapper) {
|
|
128
|
+
wrapper.appendChild(parent.firstChild);
|
|
129
|
+
}
|
|
130
|
+
return wrapper;
|
|
131
|
+
};
|
|
132
|
+
DOMNode.prototype.unWrap = function (element) {
|
|
133
|
+
var parent = element && element.parentNode;
|
|
134
|
+
if (!parent) {
|
|
135
|
+
return [];
|
|
136
|
+
}
|
|
137
|
+
var unWrapNode = [];
|
|
138
|
+
while (element.firstChild && (element.textContent !== ' ')) {
|
|
139
|
+
unWrapNode.push(element.firstChild);
|
|
140
|
+
parent.insertBefore(element.firstChild, element);
|
|
141
|
+
}
|
|
142
|
+
unWrapNode = unWrapNode.length > 0 ? unWrapNode : [element.parentNode];
|
|
143
|
+
parent.removeChild(element);
|
|
144
|
+
return unWrapNode;
|
|
145
|
+
};
|
|
146
|
+
DOMNode.prototype.getSelectedNode = function (element, index) {
|
|
147
|
+
if (element.nodeType === Node.ELEMENT_NODE && element.childNodes.length > 0 &&
|
|
148
|
+
element.childNodes[index - 1] && element.childNodes[index - 1].nodeType === Node.ELEMENT_NODE &&
|
|
149
|
+
(element.childNodes[index - 1].classList.contains(exports.markerClassName.startSelection) ||
|
|
150
|
+
element.childNodes[index - 1].classList.contains(exports.markerClassName.endSelection))) {
|
|
151
|
+
element = element.childNodes[index - 1];
|
|
152
|
+
}
|
|
153
|
+
else if (element.nodeType === Node.ELEMENT_NODE && element.childNodes.length > 0 && element.childNodes[index]) {
|
|
154
|
+
element = element.childNodes[index];
|
|
155
|
+
}
|
|
156
|
+
if (element.nodeType === Node.TEXT_NODE) {
|
|
157
|
+
element = element.parentNode;
|
|
158
|
+
}
|
|
159
|
+
return element;
|
|
160
|
+
};
|
|
161
|
+
DOMNode.prototype.nodeFinds = function (element, elements) {
|
|
162
|
+
var existNodes = [];
|
|
163
|
+
for (var i = 0; i < elements.length; i++) {
|
|
164
|
+
if (element.contains(elements[i]) && element !== elements[i]) {
|
|
165
|
+
existNodes.push(elements[i]);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return existNodes;
|
|
169
|
+
};
|
|
170
|
+
DOMNode.prototype.isEditorArea = function () {
|
|
171
|
+
var range = this.getRangePoint(0);
|
|
172
|
+
var element;
|
|
173
|
+
for (element = range.commonAncestorContainer; element && !this.isElement(element); null) {
|
|
174
|
+
element = element.parentNode;
|
|
175
|
+
}
|
|
176
|
+
return !!this.isElement(element);
|
|
177
|
+
};
|
|
178
|
+
DOMNode.prototype.getRangePoint = function (point) {
|
|
179
|
+
var selection = this.getSelection();
|
|
180
|
+
var ranges = [];
|
|
181
|
+
if (selection && selection.getRangeAt && selection.rangeCount) {
|
|
182
|
+
ranges = [];
|
|
183
|
+
for (var f = 0; f < selection.rangeCount; f++) {
|
|
184
|
+
ranges.push(selection.getRangeAt(f));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
ranges = [this.currentDocument.createRange()];
|
|
189
|
+
}
|
|
190
|
+
return 'undefined' !== typeof point ? ranges[point] : ranges;
|
|
191
|
+
};
|
|
192
|
+
DOMNode.prototype.getSelection = function () {
|
|
193
|
+
return this.nodeSelection.get(this.currentDocument);
|
|
194
|
+
};
|
|
195
|
+
DOMNode.prototype.getPreviousNode = function (element) {
|
|
196
|
+
element = element.previousElementSibling;
|
|
197
|
+
for (; element && element.textContent === '\n'; null) {
|
|
198
|
+
element = element.previousElementSibling;
|
|
199
|
+
}
|
|
200
|
+
return element;
|
|
201
|
+
};
|
|
202
|
+
DOMNode.prototype.encode = function (value) {
|
|
203
|
+
var divNode = document.createElement('div');
|
|
204
|
+
divNode.innerText = value;
|
|
205
|
+
return divNode.innerHTML.replace(/<br\s*[\/]?>/gi, '\n');
|
|
206
|
+
};
|
|
207
|
+
DOMNode.prototype.saveMarker = function (save) {
|
|
208
|
+
var start = this.parent.querySelector('.' + exports.markerClassName.startSelection);
|
|
209
|
+
var end = this.parent.querySelector('.' + exports.markerClassName.endSelection);
|
|
210
|
+
var startTextNode;
|
|
211
|
+
var endTextNode;
|
|
212
|
+
if (this.hasClass(start, exports.markerClassName.startSelection) && start.classList.length > 1) {
|
|
213
|
+
var replace = this.createTagString(CONSTANT.DEFAULT_TAG, start, this.encode(start.textContent));
|
|
214
|
+
this.replaceWith(start, replace);
|
|
215
|
+
start = this.parent.querySelector('.' + exports.markerClassName.startSelection);
|
|
216
|
+
start.classList.remove(exports.markerClassName.startSelection);
|
|
217
|
+
startTextNode = start.childNodes[0];
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
startTextNode = this.unWrap(start)[0];
|
|
221
|
+
}
|
|
222
|
+
if (this.hasClass(end, exports.markerClassName.endSelection) && end.classList.length > 1) {
|
|
223
|
+
var replace = this.createTagString(CONSTANT.DEFAULT_TAG, end, this.encode(end.textContent));
|
|
224
|
+
this.replaceWith(end, replace);
|
|
225
|
+
end = this.parent.querySelector('.' + exports.markerClassName.endSelection);
|
|
226
|
+
end.classList.remove(exports.markerClassName.endSelection);
|
|
227
|
+
endTextNode = end.childNodes[0];
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
endTextNode = end ? this.unWrap(end)[0] : startTextNode;
|
|
231
|
+
}
|
|
232
|
+
save.startContainer = save.getNodeArray(startTextNode, true);
|
|
233
|
+
save.endContainer = save.getNodeArray(endTextNode, false);
|
|
234
|
+
return save;
|
|
235
|
+
};
|
|
236
|
+
DOMNode.prototype.marker = function (className, textContent) {
|
|
237
|
+
return '<span class="' + className + '">' + textContent + '</span>';
|
|
238
|
+
};
|
|
239
|
+
DOMNode.prototype.setMarker = function (save) {
|
|
240
|
+
var range = save.range;
|
|
241
|
+
var startChildNodes = range.startContainer.childNodes;
|
|
242
|
+
var isTableStart = startChildNodes.length > 1 && startChildNodes[0].nodeName === 'TABLE' && range.startOffset === 0;
|
|
243
|
+
var isImgOnlySelected = startChildNodes.length > 1 && startChildNodes[0].nodeName === 'IMAGE' &&
|
|
244
|
+
range.endOffset === 1 && range.endContainer.nodeName === '#text' && range.endContainer.textContent.length === 0;
|
|
245
|
+
var start = ((isTableStart ? util_1.getLastTextNode(startChildNodes[range.startOffset + 1]) :
|
|
246
|
+
startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) : range.startOffset]) || range.startContainer);
|
|
247
|
+
var end = (range.endContainer.childNodes[(range.endOffset > 0) ? (isImgOnlySelected ? range.endOffset :
|
|
248
|
+
(range.endOffset - 1)) : range.endOffset] || range.endContainer);
|
|
249
|
+
if ((start.nodeType === Node.ELEMENT_NODE && end.nodeType === Node.ELEMENT_NODE) && (start.contains(end) || end.contains(start))) {
|
|
250
|
+
var existNode = start.contains(end) ? start : end;
|
|
251
|
+
var isElement = existNode.nodeType !== Node.TEXT_NODE;
|
|
252
|
+
if (isElement) {
|
|
253
|
+
var nodes = [];
|
|
254
|
+
var textNodes = [];
|
|
255
|
+
for (var node = existNode; existNode.contains(node); null) {
|
|
256
|
+
if (nodes.indexOf(node) < 0 && node.childNodes && node.childNodes.length) {
|
|
257
|
+
nodes.push(node);
|
|
258
|
+
node = node.childNodes[0];
|
|
259
|
+
}
|
|
260
|
+
else if (node.nextSibling) {
|
|
261
|
+
node = node.nextSibling;
|
|
262
|
+
}
|
|
263
|
+
else if (node.parentNode) {
|
|
264
|
+
node = node.parentNode;
|
|
265
|
+
nodes.push(node);
|
|
266
|
+
}
|
|
267
|
+
if (textNodes.indexOf(node) < 0 && (node.nodeType === Node.TEXT_NODE ||
|
|
268
|
+
(CONSTANT.IGNORE_BLOCK_TAGS.indexOf(node.parentNode.tagName.toLocaleLowerCase()) >= 0
|
|
269
|
+
&& (node.tagName === 'BR' || node.tagName === 'IMG')))) {
|
|
270
|
+
textNodes.push(node);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (textNodes.length) {
|
|
274
|
+
start = start.contains(end) ? textNodes[0] : start;
|
|
275
|
+
end = textNodes[textNodes.length - 1];
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (start !== end) {
|
|
280
|
+
if (start.nodeType !== Node.TEXT_NODE && ((start.tagName === 'BR' &&
|
|
281
|
+
CONSTANT.IGNORE_BLOCK_TAGS.indexOf(start.parentNode.tagName.toLocaleLowerCase()) >= 0) ||
|
|
282
|
+
start.tagName === 'IMG')) {
|
|
283
|
+
this.replaceWith(start, this.marker(exports.markerClassName.startSelection, this.encode(start.textContent)));
|
|
284
|
+
var markerStart = range.startContainer.querySelector('.' + exports.markerClassName.startSelection);
|
|
285
|
+
markerStart.appendChild(start);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
if (start.nodeType !== 3 && start.nodeName !== '#text' && start.nodeName !== 'BR') {
|
|
289
|
+
var marker = this.marker(exports.markerClassName.startSelection, '');
|
|
290
|
+
ej2_base_1.append([this.parseHTMLFragment(marker)], start);
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
this.replaceWith(start, this.marker(exports.markerClassName.startSelection, this.encode(start.textContent)));
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
if (end.nodeType !== Node.TEXT_NODE && end.tagName === 'BR' &&
|
|
297
|
+
CONSTANT.IGNORE_BLOCK_TAGS.indexOf(end.parentNode.tagName.toLocaleLowerCase()) >= 0) {
|
|
298
|
+
this.replaceWith(end, this.marker(exports.markerClassName.endSelection, this.encode(end.textContent)));
|
|
299
|
+
var markerEnd = range.endContainer.querySelector('.' + exports.markerClassName.endSelection);
|
|
300
|
+
markerEnd.appendChild(end);
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
this.ensureSelfClosingTag(end, exports.markerClassName.endSelection, range);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
this.ensureSelfClosingTag(start, exports.markerClassName.startSelection, range);
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
DOMNode.prototype.ensureSelfClosingTag = function (start, className, range) {
|
|
311
|
+
var isTable = false;
|
|
312
|
+
if (start.nodeType === 3) {
|
|
313
|
+
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
314
|
+
}
|
|
315
|
+
else if (start.tagName === 'BR') {
|
|
316
|
+
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
317
|
+
var markerStart = range.startContainer.querySelector('.' + className);
|
|
318
|
+
if (markerStart) {
|
|
319
|
+
markerStart.parentElement.appendChild(start);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
else {
|
|
323
|
+
var tagName = !ej2_base_1.isNullOrUndefined(start.parentElement) ? start.parentElement.tagName.toLocaleLowerCase() : '';
|
|
324
|
+
if (start.tagName === 'IMG' && tagName !== 'p' && tagName !== 'div') {
|
|
325
|
+
var parNode = document.createElement('p');
|
|
326
|
+
start.parentElement.insertBefore(parNode, start);
|
|
327
|
+
parNode.appendChild(start);
|
|
328
|
+
start = parNode.children[0];
|
|
329
|
+
}
|
|
330
|
+
if (start.tagName === 'TABLE') {
|
|
331
|
+
isTable = true;
|
|
332
|
+
if (start.textContent === '') {
|
|
333
|
+
var tdNode = start.querySelectorAll('td');
|
|
334
|
+
start = tdNode[tdNode.length - 1];
|
|
335
|
+
start = !ej2_base_1.isNullOrUndefined(start.childNodes[0]) ? start.childNodes[0] : start;
|
|
336
|
+
}
|
|
337
|
+
else {
|
|
338
|
+
var lastNode = start.lastChild;
|
|
339
|
+
while (lastNode.nodeType !== 3 && lastNode.nodeName !== '#text' &&
|
|
340
|
+
lastNode.nodeName !== 'BR') {
|
|
341
|
+
lastNode = lastNode.lastChild;
|
|
342
|
+
}
|
|
343
|
+
start = lastNode;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
for (var i = 0; i < config_1.selfClosingTags.length; i++) {
|
|
347
|
+
start = (start.tagName === config_1.selfClosingTags[i] && !isTable) ? start.parentNode : start;
|
|
348
|
+
}
|
|
349
|
+
if (start.nodeType === 3 && start.nodeName === '#text') {
|
|
350
|
+
this.replaceWith(start, this.marker(className, this.encode(start.textContent)));
|
|
351
|
+
}
|
|
352
|
+
else if (start.nodeName === 'BR') {
|
|
353
|
+
this.replaceWith(start, this.marker(exports.markerClassName.endSelection, this.encode(start.textContent)));
|
|
354
|
+
var markerEnd = range.endContainer.querySelector('.' + exports.markerClassName.endSelection);
|
|
355
|
+
markerEnd.appendChild(start);
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
var marker = this.marker(className, '');
|
|
359
|
+
ej2_base_1.append([this.parseHTMLFragment(marker)], start);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
};
|
|
363
|
+
DOMNode.prototype.createTempNode = function (element) {
|
|
364
|
+
var textContent = element.textContent;
|
|
365
|
+
if (element.tagName === 'BR') {
|
|
366
|
+
var wrapper = '<' + CONSTANT.DEFAULT_TAG + '></' + CONSTANT.DEFAULT_TAG + '>';
|
|
367
|
+
var node = element.parentNode;
|
|
368
|
+
if (CONSTANT.IGNORE_BLOCK_TAGS.indexOf(node.tagName.toLocaleLowerCase()) >= 0) {
|
|
369
|
+
element = this.wrap(element, this.parseHTMLFragment(wrapper));
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
else if (((element.nodeType !== Node.TEXT_NODE &&
|
|
373
|
+
(element.classList.contains(exports.markerClassName.startSelection) ||
|
|
374
|
+
element.classList.contains(exports.markerClassName.endSelection))) ||
|
|
375
|
+
textContent.replace(/\n/g, '').replace(/(^ *)|( *$)/g, '').length > 0 ||
|
|
376
|
+
textContent.length && textContent.indexOf('\n') < 0)) {
|
|
377
|
+
var wrapper = '<' + CONSTANT.DEFAULT_TAG + '></' + CONSTANT.DEFAULT_TAG + '>';
|
|
378
|
+
var target = element;
|
|
379
|
+
element = this.wrap(element, this.parseHTMLFragment(wrapper));
|
|
380
|
+
var ignoreBr = target.nodeType === Node.ELEMENT_NODE && target.firstChild && target.firstChild.nodeName === 'BR'
|
|
381
|
+
&& (target.classList.contains(exports.markerClassName.startSelection) ||
|
|
382
|
+
target.classList.contains(exports.markerClassName.endSelection));
|
|
383
|
+
if (!ignoreBr && element.nextElementSibling && element.nextElementSibling.tagName === 'BR') {
|
|
384
|
+
element.appendChild(element.nextElementSibling);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return element;
|
|
388
|
+
};
|
|
389
|
+
DOMNode.prototype.getImageTagInSelection = function () {
|
|
390
|
+
var selection = this.getSelection();
|
|
391
|
+
if (this.isEditorArea() && selection.rangeCount) {
|
|
392
|
+
return selection.focusNode.querySelectorAll('img');
|
|
393
|
+
}
|
|
394
|
+
return null;
|
|
395
|
+
};
|
|
396
|
+
DOMNode.prototype.gatherElementsAround = function (node, wrapperElement) {
|
|
397
|
+
var newWrapElem = ej2_base_1.createElement(wrapperElement);
|
|
398
|
+
var currentNode = node.previousSibling;
|
|
399
|
+
var currentNodeParent = node.parentElement;
|
|
400
|
+
if (currentNodeParent.className === 'e-editor-select-start') {
|
|
401
|
+
currentNodeParent.parentNode.insertBefore(newWrapElem, currentNodeParent);
|
|
402
|
+
}
|
|
403
|
+
else if (currentNodeParent) {
|
|
404
|
+
currentNodeParent.insertBefore(newWrapElem, node);
|
|
405
|
+
}
|
|
406
|
+
var i = 0;
|
|
407
|
+
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
408
|
+
!this.isBlockNode(currentNode)) {
|
|
409
|
+
var prevSibling = currentNode.previousSibling;
|
|
410
|
+
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
411
|
+
if (i === 0) {
|
|
412
|
+
newWrapElem.appendChild(currentNode);
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
newWrapElem.insertBefore(currentNode, newWrapElem.firstChild);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
currentNode = prevSibling;
|
|
419
|
+
i++;
|
|
420
|
+
}
|
|
421
|
+
newWrapElem.appendChild(node);
|
|
422
|
+
currentNode = newWrapElem.nextSibling ? newWrapElem.nextSibling :
|
|
423
|
+
newWrapElem.parentElement.nextSibling;
|
|
424
|
+
while (currentNode !== null && currentNode.nodeName !== 'BR' &&
|
|
425
|
+
!this.isBlockNode(currentNode)) {
|
|
426
|
+
var nextSibling = currentNode.nextSibling ?
|
|
427
|
+
currentNode.nextSibling : currentNode.parentElement.nextSibling;
|
|
428
|
+
if (currentNode.nodeType === 3 || currentNode.nodeType === 1) {
|
|
429
|
+
newWrapElem.appendChild(currentNode);
|
|
430
|
+
}
|
|
431
|
+
currentNode = nextSibling;
|
|
432
|
+
}
|
|
433
|
+
return newWrapElem;
|
|
434
|
+
};
|
|
435
|
+
DOMNode.prototype.convertToBlockNodes = function (selectedNodes, fromList) {
|
|
436
|
+
if (selectedNodes.length > 1) {
|
|
437
|
+
var i = 0;
|
|
438
|
+
var currentSelectedNode = selectedNodes[0];
|
|
439
|
+
while (!ej2_base_1.isNullOrUndefined(currentSelectedNode)) {
|
|
440
|
+
if (currentSelectedNode.nodeName === 'BR') {
|
|
441
|
+
var nextNode = currentSelectedNode.nextSibling;
|
|
442
|
+
ej2_base_1.detach(currentSelectedNode);
|
|
443
|
+
currentSelectedNode = nextNode;
|
|
444
|
+
}
|
|
445
|
+
if (!ej2_base_1.isNullOrUndefined(currentSelectedNode)) {
|
|
446
|
+
if (fromList) {
|
|
447
|
+
selectedNodes[i] = currentSelectedNode.nodeName === 'LI' || this.isBlockNode(currentSelectedNode) ?
|
|
448
|
+
currentSelectedNode :
|
|
449
|
+
this.gatherElementsAround(currentSelectedNode, (fromList ? 'p' : 'div'));
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
selectedNodes[i] = !this.isBlockNode(selectedNodes[i]) ?
|
|
453
|
+
this.gatherElementsAround(currentSelectedNode, (fromList ? 'p' : 'div')) :
|
|
454
|
+
selectedNodes[i];
|
|
455
|
+
}
|
|
456
|
+
var currentProcessNode = selectedNodes[i].nodeName === 'LI' ? selectedNodes[i].parentElement : selectedNodes[i];
|
|
457
|
+
var currentElementCheckNode = currentProcessNode.nodeName === '#text' ? currentProcessNode.parentElement : currentProcessNode;
|
|
458
|
+
currentSelectedNode = !ej2_base_1.isNullOrUndefined(currentElementCheckNode.querySelector('.e-editor-select-end')) ||
|
|
459
|
+
!ej2_base_1.isNullOrUndefined(ej2_base_1.closest(currentSelectedNode, '.e-editor-select-end')) ?
|
|
460
|
+
null : currentProcessNode.nextSibling;
|
|
461
|
+
if (currentSelectedNode === null && !ej2_base_1.isNullOrUndefined(currentProcessNode.nextSibling) && currentProcessNode.nextSibling.nodeName === 'BR') {
|
|
462
|
+
ej2_base_1.detach(currentProcessNode.nextSibling);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
i++;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
if (!this.isBlockNode(selectedNodes[0])) {
|
|
470
|
+
selectedNodes[0] = this.gatherElementsAround(selectedNodes[0], (fromList ? 'p' : 'div'));
|
|
471
|
+
if (!ej2_base_1.isNullOrUndefined(selectedNodes[0].nextSibling) && (selectedNodes[0].nextSibling.nodeName === 'BR')) {
|
|
472
|
+
ej2_base_1.detach(selectedNodes[0].nextSibling);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return selectedNodes;
|
|
477
|
+
};
|
|
478
|
+
DOMNode.prototype.blockNodes = function (action) {
|
|
479
|
+
var collectionNodes = [];
|
|
480
|
+
var selection = this.getSelection();
|
|
481
|
+
var tableBlockNodes = this.tableSelection.getBlockNodes();
|
|
482
|
+
if (tableBlockNodes.length > 0) {
|
|
483
|
+
return tableBlockNodes;
|
|
484
|
+
}
|
|
485
|
+
if (this.isEditorArea() && selection.rangeCount) {
|
|
486
|
+
var ranges = this.getRangePoint();
|
|
487
|
+
var _loop_1 = function (j) {
|
|
488
|
+
var parentNode = void 0;
|
|
489
|
+
var range = ranges[j];
|
|
490
|
+
var startNode = this_1.getSelectedNode(range.startContainer, range.startOffset);
|
|
491
|
+
var endNode = this_1.getSelectedNode(range.endContainer, range.endOffset);
|
|
492
|
+
if (this_1.isBlockNode(startNode) && collectionNodes.indexOf(startNode) < 0) {
|
|
493
|
+
collectionNodes.push(startNode);
|
|
494
|
+
}
|
|
495
|
+
parentNode = this_1.blockParentNode(startNode);
|
|
496
|
+
var endParentNode = this_1.blockParentNode(endNode);
|
|
497
|
+
if (parentNode && collectionNodes.indexOf(parentNode) < 0) {
|
|
498
|
+
if (!ej2_base_1.isNullOrUndefined(action) && action) {
|
|
499
|
+
var tableCellNodeNames_1 = ['TD', 'TH'];
|
|
500
|
+
var nodesToCheck = [range.commonAncestorContainer, parentNode, endParentNode];
|
|
501
|
+
if (nodesToCheck.some(function (node) { return tableCellNodeNames_1.indexOf(node.nodeName) !== -1; })) {
|
|
502
|
+
var processedNodes = this_1.getPreBlockNodeCollection(range);
|
|
503
|
+
if (processedNodes.length > 1) {
|
|
504
|
+
this_1.wrapWithBlockNode(processedNodes, collectionNodes);
|
|
505
|
+
}
|
|
506
|
+
else if (processedNodes.length > 0) {
|
|
507
|
+
if (startNode !== endNode && startNode.nodeName !== 'BR') {
|
|
508
|
+
collectionNodes.push(this_1.createTempNode(startNode));
|
|
509
|
+
}
|
|
510
|
+
else if (startNode === endNode && startNode.nodeName === 'SPAN' && (startNode.classList.contains(exports.markerClassName.startSelection)
|
|
511
|
+
|| startNode.classList.contains(exports.markerClassName.endSelection))) {
|
|
512
|
+
collectionNodes.push(this_1.createTempNode(startNode));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
collectionNodes.push(parentNode);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
else {
|
|
521
|
+
if (CONSTANT.IGNORE_BLOCK_TAGS.indexOf(parentNode.tagName.toLocaleLowerCase()) >= 0 && (startNode.tagName === 'BR' ||
|
|
522
|
+
startNode.nodeType === Node.TEXT_NODE ||
|
|
523
|
+
startNode.classList.contains(exports.markerClassName.startSelection) ||
|
|
524
|
+
startNode.classList.contains(exports.markerClassName.endSelection))) {
|
|
525
|
+
var tempNode = startNode.previousSibling &&
|
|
526
|
+
startNode.previousSibling.nodeType === Node.TEXT_NODE ?
|
|
527
|
+
startNode.previousSibling : startNode;
|
|
528
|
+
if (!startNode.nextSibling && !startNode.previousSibling && startNode.tagName === 'BR') {
|
|
529
|
+
collectionNodes.push(tempNode);
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
collectionNodes.push(this_1.createTempNode(tempNode));
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
else {
|
|
536
|
+
collectionNodes.push(parentNode);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
var nodes = [];
|
|
541
|
+
for (var node = startNode; node !== endNode && node !== this_1.parent; null) {
|
|
542
|
+
if (nodes.indexOf(node) < 0 && node.childNodes && node.childNodes.length) {
|
|
543
|
+
nodes.push(node);
|
|
544
|
+
node = node.childNodes[0];
|
|
545
|
+
}
|
|
546
|
+
else if (node && node.nodeType !== 8 && (node.tagName === 'BR' || (node.nodeType === Node.TEXT_NODE &&
|
|
547
|
+
node.textContent.trim() !== '') || (node.nodeType !== Node.TEXT_NODE &&
|
|
548
|
+
(node.classList.contains(exports.markerClassName.startSelection) ||
|
|
549
|
+
node.classList.contains(exports.markerClassName.endSelection)))) &&
|
|
550
|
+
CONSTANT.IGNORE_BLOCK_TAGS.indexOf(node.parentNode.tagName.toLocaleLowerCase()) >= 0) {
|
|
551
|
+
node = this_1.createTempNode(node);
|
|
552
|
+
}
|
|
553
|
+
else if (node.nextSibling && node.nextSibling.nodeType !== 8 &&
|
|
554
|
+
(node.nextSibling.tagName === 'BR' ||
|
|
555
|
+
node.nextSibling.nodeType === Node.TEXT_NODE ||
|
|
556
|
+
node.nextSibling.classList.contains(exports.markerClassName.startSelection) ||
|
|
557
|
+
node.nextSibling.classList.contains(exports.markerClassName.endSelection)) &&
|
|
558
|
+
CONSTANT.IGNORE_BLOCK_TAGS.indexOf(node.nextSibling.parentNode.tagName.toLocaleLowerCase()) >= 0) {
|
|
559
|
+
node = this_1.createTempNode(node.nextSibling);
|
|
560
|
+
}
|
|
561
|
+
else if (node.nextSibling) {
|
|
562
|
+
node = node.nextSibling;
|
|
563
|
+
}
|
|
564
|
+
else if (node.parentNode) {
|
|
565
|
+
node = node.parentNode;
|
|
566
|
+
nodes.push(node);
|
|
567
|
+
}
|
|
568
|
+
if (collectionNodes.indexOf(node) < 0 && node.nodeType === Node.ELEMENT_NODE &&
|
|
569
|
+
CONSTANT.IGNORE_BLOCK_TAGS.indexOf(node.parentNode.tagName.toLocaleLowerCase()) >= 0 &&
|
|
570
|
+
(node.classList.contains(exports.markerClassName.startSelection) ||
|
|
571
|
+
node.classList.contains(exports.markerClassName.endSelection))) {
|
|
572
|
+
collectionNodes.push(this_1.createTempNode(node));
|
|
573
|
+
}
|
|
574
|
+
if (this_1.isBlockNode(node) && this_1.ignoreTableTag(node) && nodes.indexOf(node) < 0 &&
|
|
575
|
+
collectionNodes.indexOf(node) < 0 && (node !== endNode || range.endOffset > 0)) {
|
|
576
|
+
collectionNodes.push(node);
|
|
577
|
+
}
|
|
578
|
+
if (node.nodeName === 'IMG' && node.parentElement.contentEditable === 'true') {
|
|
579
|
+
collectionNodes.push(node);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
parentNode = this_1.blockParentNode(endNode);
|
|
583
|
+
if (parentNode && this_1.ignoreTableTag(parentNode) && collectionNodes.indexOf(parentNode) < 0 &&
|
|
584
|
+
(!ej2_base_1.isNullOrUndefined(parentNode.previousElementSibling) && parentNode.previousElementSibling.tagName !== 'IMG')) {
|
|
585
|
+
collectionNodes.push(parentNode);
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
var this_1 = this;
|
|
589
|
+
for (var j = 0; j < ranges.length; j++) {
|
|
590
|
+
_loop_1(j);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
for (var i = collectionNodes.length - 1; i > 0; i--) {
|
|
594
|
+
var nodes = this.nodeFinds(collectionNodes[i], collectionNodes);
|
|
595
|
+
if (nodes.length) {
|
|
596
|
+
var listNodes = collectionNodes[i].querySelectorAll('ul, ol');
|
|
597
|
+
if (collectionNodes[i].tagName === 'LI' && listNodes.length > 0) {
|
|
598
|
+
continue;
|
|
599
|
+
}
|
|
600
|
+
else {
|
|
601
|
+
collectionNodes.splice(i, 1);
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
return collectionNodes;
|
|
606
|
+
};
|
|
607
|
+
DOMNode.prototype.ignoreTableTag = function (element) {
|
|
608
|
+
return !(CONSTANT.TABLE_BLOCK_TAGS.indexOf(element.tagName.toLocaleLowerCase()) >= 0);
|
|
609
|
+
};
|
|
610
|
+
DOMNode.prototype.getPreBlockNodeCollection = function (range) {
|
|
611
|
+
var startNode = this.getSelectedNode(range.startContainer, range.startOffset);
|
|
612
|
+
var endNode = this.getSelectedNode(range.endContainer, range.endOffset);
|
|
613
|
+
var nodes = [];
|
|
614
|
+
var rootNode = startNode.closest('td, th');
|
|
615
|
+
if (ej2_base_1.isNullOrUndefined(rootNode)) {
|
|
616
|
+
return nodes;
|
|
617
|
+
}
|
|
618
|
+
var rootChildNode = Array.from(rootNode.childNodes);
|
|
619
|
+
var isContinue = true;
|
|
620
|
+
var processedStart = this.getClosestInlineParent(startNode, rootNode, true);
|
|
621
|
+
var processedEnd = this.getClosestInlineParent(endNode, rootNode, false);
|
|
622
|
+
for (var i = 0; i < rootChildNode.length; i++) {
|
|
623
|
+
var child = rootChildNode[i];
|
|
624
|
+
if (processedStart === processedEnd && child === processedStart) {
|
|
625
|
+
nodes.push(child);
|
|
626
|
+
isContinue = true;
|
|
627
|
+
}
|
|
628
|
+
else if (child === processedStart) {
|
|
629
|
+
isContinue = false;
|
|
630
|
+
}
|
|
631
|
+
else if (child === processedEnd) {
|
|
632
|
+
nodes.push(child);
|
|
633
|
+
isContinue = true;
|
|
634
|
+
}
|
|
635
|
+
if (isContinue) {
|
|
636
|
+
continue;
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
nodes.push(child);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
return nodes;
|
|
643
|
+
};
|
|
644
|
+
DOMNode.prototype.getClosestInlineParent = function (node, rootNode, isStart) {
|
|
645
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
646
|
+
return node;
|
|
647
|
+
}
|
|
648
|
+
if (this.isBlockNode(node)) {
|
|
649
|
+
return node;
|
|
650
|
+
}
|
|
651
|
+
var currentNode = node;
|
|
652
|
+
var rootFlag = false;
|
|
653
|
+
while (currentNode) {
|
|
654
|
+
var previousNode = currentNode;
|
|
655
|
+
if (rootFlag) {
|
|
656
|
+
if (this.isBlockNode(currentNode)) {
|
|
657
|
+
return previousNode;
|
|
658
|
+
}
|
|
659
|
+
if (isStart && currentNode.previousSibling) {
|
|
660
|
+
if (this.isBlockNode(currentNode.previousSibling) || currentNode.previousSibling.nodeName === 'BR') {
|
|
661
|
+
return previousNode;
|
|
662
|
+
}
|
|
663
|
+
else {
|
|
664
|
+
currentNode = currentNode.previousSibling;
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
else if (!isStart && currentNode.nextSibling) {
|
|
668
|
+
if (this.isBlockNode(currentNode.nextSibling) || currentNode.nextSibling.nodeName === 'BR') {
|
|
669
|
+
return previousNode;
|
|
670
|
+
}
|
|
671
|
+
else {
|
|
672
|
+
currentNode = currentNode.nextSibling;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
else {
|
|
676
|
+
return currentNode;
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
else {
|
|
680
|
+
currentNode = currentNode.parentElement;
|
|
681
|
+
if (currentNode === rootNode) {
|
|
682
|
+
currentNode = previousNode;
|
|
683
|
+
rootFlag = true;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
return null;
|
|
688
|
+
};
|
|
689
|
+
DOMNode.prototype.wrapWithBlockNode = function (nodes, collectionNodes) {
|
|
690
|
+
var wrapperElement = ej2_base_1.createElement('p');
|
|
691
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
692
|
+
var child = nodes[i];
|
|
693
|
+
if (child.nodeName === 'BR') {
|
|
694
|
+
child.parentNode.insertBefore(wrapperElement, child);
|
|
695
|
+
wrapperElement.appendChild(child);
|
|
696
|
+
if (wrapperElement.childNodes.length > 0) {
|
|
697
|
+
collectionNodes.push(wrapperElement);
|
|
698
|
+
}
|
|
699
|
+
wrapperElement = ej2_base_1.createElement('p');
|
|
700
|
+
}
|
|
701
|
+
else {
|
|
702
|
+
if (!this.isBlockNode(child)) {
|
|
703
|
+
if (child.nodeName === '#text' && child.textContent.trim() === '') {
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
if (wrapperElement.childElementCount === 0) {
|
|
707
|
+
child.parentNode.insertBefore(wrapperElement, child);
|
|
708
|
+
wrapperElement.appendChild(child);
|
|
709
|
+
}
|
|
710
|
+
else {
|
|
711
|
+
wrapperElement.appendChild(child);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
else {
|
|
715
|
+
collectionNodes.push(child);
|
|
716
|
+
}
|
|
717
|
+
if ((i === nodes.length - 1) && wrapperElement.nextElementSibling &&
|
|
718
|
+
wrapperElement.querySelectorAll('br').length === 0 &&
|
|
719
|
+
wrapperElement.nextElementSibling.nodeName === 'BR') {
|
|
720
|
+
wrapperElement.appendChild(wrapperElement.nextElementSibling);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
if (wrapperElement.childNodes.length > 0 && collectionNodes.indexOf(wrapperElement) < 0) {
|
|
725
|
+
collectionNodes.push(wrapperElement);
|
|
726
|
+
}
|
|
727
|
+
};
|
|
728
|
+
DOMNode.prototype.getImmediateBlockNode = function (node) {
|
|
729
|
+
while (node && CONSTANT.BLOCK_TAGS.indexOf(node.nodeName.toLocaleLowerCase()) < 0) {
|
|
730
|
+
node = node.parentNode;
|
|
731
|
+
}
|
|
732
|
+
return node;
|
|
733
|
+
};
|
|
734
|
+
return DOMNode;
|
|
735
|
+
}());
|
|
736
|
+
exports.DOMNode = DOMNode;
|
|
737
|
+
});
|