@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,1069 @@
|
|
|
1
|
+
define(["require", "exports", "./../../selection/index", "./nodecutter", "./insert-methods", "./isformatted", "../../common/util", "@syncfusion/ej2-base", "./dom-node", "../../common/user-agent", "./dom-tree"], function (require, exports, index_1, nodecutter_1, insert_methods_1, isformatted_1, util_1, ej2_base_1, dom_node_1, user_agent_1, dom_tree_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
var SelectionCommands = (function () {
|
|
5
|
+
function SelectionCommands() {
|
|
6
|
+
}
|
|
7
|
+
SelectionCommands.applyFormat = function (docElement, format, endNode, enterAction, tableCellSelection, value, selector, painterValues) {
|
|
8
|
+
this.enterAction = enterAction;
|
|
9
|
+
var validFormats = ['bold', 'italic', 'underline', 'strikethrough', 'superscript',
|
|
10
|
+
'subscript', 'uppercase', 'lowercase', 'fontcolor', 'fontname', 'fontsize', 'backgroundcolor', 'inlinecode'];
|
|
11
|
+
if (validFormats.indexOf(format) > -1 || value === 'formatPainter') {
|
|
12
|
+
if (format === 'backgroundcolor' && value === '') {
|
|
13
|
+
value = 'transparent';
|
|
14
|
+
}
|
|
15
|
+
var domSelection = new index_1.NodeSelection(endNode);
|
|
16
|
+
var domNode = new dom_node_1.DOMNode(endNode, docElement);
|
|
17
|
+
var nodeCutter = new nodecutter_1.NodeCutter();
|
|
18
|
+
var isFormatted = new isformatted_1.IsFormatted();
|
|
19
|
+
var range = domSelection.getRange(docElement);
|
|
20
|
+
var counter = 0;
|
|
21
|
+
var currentAnchorNode = range.startContainer.parentElement;
|
|
22
|
+
if (range.collapsed && !ej2_base_1.isNullOrUndefined(currentAnchorNode) &&
|
|
23
|
+
currentAnchorNode.tagName === 'A' &&
|
|
24
|
+
(range.startOffset === currentAnchorNode.textContent.length || range.startOffset === 0)) {
|
|
25
|
+
var emptyTextNode = document.createTextNode('');
|
|
26
|
+
if (range.startOffset === 0) {
|
|
27
|
+
currentAnchorNode.parentNode.insertBefore(emptyTextNode, currentAnchorNode);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
if (!ej2_base_1.isNullOrUndefined(currentAnchorNode.nextSibling)) {
|
|
31
|
+
currentAnchorNode.parentElement.insertBefore(emptyTextNode, currentAnchorNode.nextSibling);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
currentAnchorNode.parentNode.appendChild(emptyTextNode);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
var newRange = docElement.createRange();
|
|
38
|
+
range.setStart(emptyTextNode, 0);
|
|
39
|
+
range.setEnd(emptyTextNode, 0);
|
|
40
|
+
range.collapse(true);
|
|
41
|
+
domSelection.setRange(docElement, newRange);
|
|
42
|
+
}
|
|
43
|
+
if (ej2_base_1.Browser.userAgent.indexOf('Firefox') !== -1 && range.startContainer === range.endContainer && !ej2_base_1.isNullOrUndefined(endNode) && range.startContainer === endNode) {
|
|
44
|
+
var startChildNodes = range.startContainer.childNodes;
|
|
45
|
+
var startNode = ((startChildNodes[(range.startOffset > 0) ? (range.startOffset - 1) :
|
|
46
|
+
range.startOffset]) || range.startContainer);
|
|
47
|
+
var endNode_1 = (range.endContainer.childNodes[(range.endOffset > 0) ? (range.endOffset - 1) :
|
|
48
|
+
range.endOffset] || range.endContainer);
|
|
49
|
+
var lastSelectionNode = (endNode_1.lastChild.nodeName === 'BR' ? (ej2_base_1.isNullOrUndefined(endNode_1.lastChild.previousSibling) ? endNode_1
|
|
50
|
+
: endNode_1.lastChild.previousSibling) : endNode_1.firstChild);
|
|
51
|
+
while (!ej2_base_1.isNullOrUndefined(lastSelectionNode) && lastSelectionNode.nodeName !== '#text' && lastSelectionNode.nodeName !== 'IMG' &&
|
|
52
|
+
lastSelectionNode.nodeName !== 'BR' && lastSelectionNode.nodeName !== 'HR') {
|
|
53
|
+
lastSelectionNode = lastSelectionNode.lastChild;
|
|
54
|
+
}
|
|
55
|
+
domSelection.setSelectionText(docElement, startNode, lastSelectionNode, 0, 0);
|
|
56
|
+
range = domSelection.getRange(docElement);
|
|
57
|
+
}
|
|
58
|
+
var save = domSelection.save(range, docElement);
|
|
59
|
+
var nodes = void 0;
|
|
60
|
+
var isTableSelect = false;
|
|
61
|
+
if (endNode && tableCellSelection && endNode.nodeName !== '#text') {
|
|
62
|
+
nodes = tableCellSelection.getTextNodes();
|
|
63
|
+
}
|
|
64
|
+
if (nodes && nodes.length > 0) {
|
|
65
|
+
isTableSelect = true;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
|
|
69
|
+
domSelection.getSelectionNodeCollectionBr(range);
|
|
70
|
+
}
|
|
71
|
+
var isCollapsed = false;
|
|
72
|
+
var isFormat = false;
|
|
73
|
+
var isCursor = false;
|
|
74
|
+
var preventRestore = false;
|
|
75
|
+
var isFontStyle = (['fontcolor', 'fontname', 'fontsize', 'backgroundcolor'].indexOf(format) > -1);
|
|
76
|
+
var isMACMentionStartEnd = false;
|
|
77
|
+
var mentionPosition = void 0;
|
|
78
|
+
if (SelectionCommands.userAgentData.isSafari()) {
|
|
79
|
+
mentionPosition = SelectionCommands.isMentionStartOrEnd(endNode, nodes[0], nodes[nodes.length - 1]);
|
|
80
|
+
isMACMentionStartEnd = mentionPosition !== 'None';
|
|
81
|
+
}
|
|
82
|
+
if (!isTableSelect && range.collapsed) {
|
|
83
|
+
var currentFormatNode = isFormatted.getFormattedNode(range.startContainer, format, endNode);
|
|
84
|
+
var currentSelector = !ej2_base_1.isNullOrUndefined(currentFormatNode) ?
|
|
85
|
+
(currentFormatNode.getAttribute('style') === null ? currentFormatNode.nodeName :
|
|
86
|
+
currentFormatNode.nodeName + '[style=\'' + currentFormatNode.getAttribute('style') + '\']') : null;
|
|
87
|
+
if (nodes.length > 0) {
|
|
88
|
+
isCollapsed = true;
|
|
89
|
+
range = nodeCutter.GetCursorRange(docElement, range, nodes[0]);
|
|
90
|
+
}
|
|
91
|
+
else if (range.startContainer.nodeType === 3 && ((range.startContainer.parentElement.childElementCount > 0 &&
|
|
92
|
+
range.startOffset > 0 && range.startContainer.parentElement.firstElementChild.tagName.toLowerCase() !== 'br') ||
|
|
93
|
+
!ej2_base_1.isNullOrUndefined(currentFormatNode) && currentFormatNode ===
|
|
94
|
+
(range.startContainer.parentElement.closest(currentSelector)) &&
|
|
95
|
+
((range.startContainer.parentElement.closest(currentSelector)).textContent.replace(new RegExp('\u200B', 'g'), '').trim().length !== 0))) {
|
|
96
|
+
isCollapsed = true;
|
|
97
|
+
range = nodeCutter.GetCursorRange(docElement, range, range.startContainer);
|
|
98
|
+
nodes.push(range.startContainer);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
var cursorNode = this.insertCursorNode(docElement, domSelection, range, isFormatted, nodeCutter, format, value, endNode);
|
|
102
|
+
domSelection.endContainer = domSelection.startContainer = domSelection.getNodeArray(cursorNode, true);
|
|
103
|
+
var childNodes = cursorNode.nodeName === 'BR' && cursorNode.parentNode.childNodes;
|
|
104
|
+
if (!ej2_base_1.isNullOrUndefined(childNodes) && childNodes.length === 1 && childNodes[0].nodeName === 'BR' && nodes.length === 0) {
|
|
105
|
+
domSelection.setSelectionText(docElement, range.startContainer, range.endContainer, 0, 0);
|
|
106
|
+
preventRestore = true;
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
domSelection.endOffset = domSelection.startOffset = 1;
|
|
110
|
+
}
|
|
111
|
+
if (cursorNode.nodeName === 'BR' && cursorNode.parentNode.textContent.length === 0) {
|
|
112
|
+
preventRestore = true;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
isCursor = isTableSelect ? false : range.collapsed;
|
|
117
|
+
var isSubSup = false;
|
|
118
|
+
var formattedCount = 0;
|
|
119
|
+
for (var index = 0; index < nodes.length; index++) {
|
|
120
|
+
var existingFormatNode = isFormatted.getFormattedNode(nodes[index], format, endNode);
|
|
121
|
+
if (existingFormatNode || nodes[index].nodeName === 'BR') {
|
|
122
|
+
formattedCount++;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
var shouldApplyRemoval = formattedCount === nodes.length;
|
|
126
|
+
for (var index = 0; index < nodes.length; index++) {
|
|
127
|
+
var formatNode = isFormatted.getFormattedNode(nodes[index], format, endNode);
|
|
128
|
+
if (formatNode === null) {
|
|
129
|
+
if (format === 'subscript') {
|
|
130
|
+
formatNode = isFormatted.getFormattedNode(nodes[index], 'superscript', endNode);
|
|
131
|
+
isSubSup = formatNode === null ? false : true;
|
|
132
|
+
}
|
|
133
|
+
else if (format === 'superscript') {
|
|
134
|
+
formatNode = isFormatted.getFormattedNode(nodes[index], 'subscript', endNode);
|
|
135
|
+
isSubSup = formatNode === null ? false : true;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (index === 0 && formatNode === null) {
|
|
139
|
+
isFormat = true;
|
|
140
|
+
}
|
|
141
|
+
if (formatNode !== null && (!isFormat || isFontStyle)) {
|
|
142
|
+
nodes[index] = this.removeFormat(nodes, index, formatNode, isCursor, isTableSelect, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode);
|
|
143
|
+
}
|
|
144
|
+
if (formatNode === null && !shouldApplyRemoval) {
|
|
145
|
+
nodes[index] = this.insertFormat(docElement, nodes, index, formatNode, isCursor, isTableSelect, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode);
|
|
146
|
+
counter++;
|
|
147
|
+
}
|
|
148
|
+
if (nodes.length === counter) {
|
|
149
|
+
this.isWrapped = true;
|
|
150
|
+
}
|
|
151
|
+
if (!isTableSelect) {
|
|
152
|
+
if (!isMACMentionStartEnd) {
|
|
153
|
+
domSelection = this.applySelection(nodes, domSelection, nodeCutter, index, isCollapsed);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
if (util_1.isIDevice()) {
|
|
158
|
+
util_1.setEditFrameFocus(endNode, selector);
|
|
159
|
+
}
|
|
160
|
+
if (!preventRestore && !isTableSelect) {
|
|
161
|
+
save.restore();
|
|
162
|
+
}
|
|
163
|
+
if (isSubSup) {
|
|
164
|
+
this.applyFormat(docElement, format, endNode, enterAction, tableCellSelection);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
SelectionCommands.insertCursorNode = function (docElement, domSelection, range, isFormatted, nodeCutter, format, value, endNode) {
|
|
169
|
+
var cursorNodes = domSelection.getNodeCollection(range);
|
|
170
|
+
var domNode = new dom_node_1.DOMNode(endNode, docElement);
|
|
171
|
+
var cursorFormat = (cursorNodes.length > 0) ?
|
|
172
|
+
(cursorNodes.length > 1 && range.startContainer === range.endContainer) ?
|
|
173
|
+
this.getCursorFormat(isFormatted, cursorNodes, format, endNode) :
|
|
174
|
+
((value === '' && format === 'fontsize' && isFormatted.getFormattedNode(cursorNodes[0], format, endNode) == null && cursorNodes[0].parentElement.nodeName === 'SPAN') ? cursorNodes[0].parentElement : isFormatted.getFormattedNode(cursorNodes[0], format, endNode)) : null;
|
|
175
|
+
var cursorNode = null;
|
|
176
|
+
if (cursorFormat) {
|
|
177
|
+
cursorNode = cursorNodes[0];
|
|
178
|
+
if (cursorFormat.firstChild.textContent.charCodeAt(0) === 8203 && cursorFormat.firstChild.nodeType === 3) {
|
|
179
|
+
var regEx = new RegExp('\u200B', 'g');
|
|
180
|
+
var emptySpaceNode = void 0;
|
|
181
|
+
if (cursorNode.nodeName !== '#text') {
|
|
182
|
+
for (var i = 0; i < cursorNodes.length; i++) {
|
|
183
|
+
if (cursorNodes[i].nodeType === Node.TEXT_NODE) {
|
|
184
|
+
cursorNode = cursorNodes[i];
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (cursorFormat.firstChild === cursorNode) {
|
|
189
|
+
cursorNode.textContent = (cursorFormat.parentElement && (domNode.isBlockNode(cursorFormat.parentElement) &&
|
|
190
|
+
cursorFormat.parentElement.textContent.length <= 1 ? cursorFormat.parentElement.childElementCount > 1 :
|
|
191
|
+
cursorFormat.childElementCount === 0) &&
|
|
192
|
+
(cursorFormat.parentElement.textContent.length > 1 ||
|
|
193
|
+
cursorFormat.parentElement.firstChild && cursorFormat.parentElement.firstChild.nodeType === 1) ?
|
|
194
|
+
cursorNode.textContent : cursorNode.textContent.replace(regEx, ''));
|
|
195
|
+
emptySpaceNode = cursorNode;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
cursorFormat.firstChild.textContent = cursorFormat.firstChild.textContent.replace(regEx, '');
|
|
199
|
+
emptySpaceNode = cursorFormat.firstChild;
|
|
200
|
+
}
|
|
201
|
+
var pointer = void 0;
|
|
202
|
+
if (emptySpaceNode.textContent.length === 0) {
|
|
203
|
+
if (!ej2_base_1.isNullOrUndefined(emptySpaceNode.previousSibling)) {
|
|
204
|
+
cursorNode = emptySpaceNode.previousSibling;
|
|
205
|
+
pointer = emptySpaceNode.textContent.length - 1;
|
|
206
|
+
domSelection.setCursorPoint(docElement, emptySpaceNode, pointer);
|
|
207
|
+
}
|
|
208
|
+
else if (!ej2_base_1.isNullOrUndefined(emptySpaceNode.parentElement) && emptySpaceNode.parentElement.textContent.length === 0) {
|
|
209
|
+
var brElem = document.createElement('BR');
|
|
210
|
+
emptySpaceNode.parentElement.appendChild(brElem);
|
|
211
|
+
ej2_base_1.detach(emptySpaceNode);
|
|
212
|
+
cursorNode = brElem;
|
|
213
|
+
domSelection.setCursorPoint(docElement, cursorNode.parentElement, 0);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
if ((['fontcolor', 'fontname', 'fontsize', 'backgroundcolor'].indexOf(format) > -1)) {
|
|
218
|
+
if (format === 'fontcolor') {
|
|
219
|
+
cursorFormat.style.color = value;
|
|
220
|
+
}
|
|
221
|
+
else if (format === 'fontname') {
|
|
222
|
+
cursorFormat.style.fontFamily = value;
|
|
223
|
+
}
|
|
224
|
+
else if (format === 'fontsize') {
|
|
225
|
+
cursorFormat.style.fontSize = value;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
cursorFormat.style.backgroundColor = value;
|
|
229
|
+
}
|
|
230
|
+
cursorNode = cursorFormat;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
insert_methods_1.InsertMethods.unwrap(cursorFormat);
|
|
234
|
+
domSelection.setCursorPoint(docElement, cursorNode, 0);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
if (cursorNodes.length > 1 && range.startOffset > 0 && (cursorNodes[0].firstElementChild &&
|
|
239
|
+
cursorNodes[0].firstElementChild.tagName.toLowerCase() === 'br')) {
|
|
240
|
+
cursorNodes[0].innerHTML = '';
|
|
241
|
+
}
|
|
242
|
+
if (cursorNodes.length === 1 && range.startOffset === 0 && (cursorNodes[0].nodeName === 'BR' || (ej2_base_1.isNullOrUndefined(cursorNodes[0].nextSibling) ? false : cursorNodes[0].nextSibling.nodeName === 'BR'))) {
|
|
243
|
+
ej2_base_1.detach(cursorNodes[0].nodeName === '#text' ? cursorNodes[0].nextSibling : cursorNodes[0]);
|
|
244
|
+
}
|
|
245
|
+
if (!ej2_base_1.isNullOrUndefined(cursorNodes[0] && cursorNodes[0].parentElement) && isformatted_1.IsFormatted.inlineTags.
|
|
246
|
+
indexOf((cursorNodes[0].parentElement).tagName.toLowerCase()) !== -1 && cursorNodes[0].textContent.includes('\u200B')) {
|
|
247
|
+
var element = this.GetFormatNode(format, value);
|
|
248
|
+
var tempNode = cursorNodes[0];
|
|
249
|
+
if (format === 'fontsize') {
|
|
250
|
+
var currentFormatNode = cursorNodes[0];
|
|
251
|
+
while (currentFormatNode) {
|
|
252
|
+
var isSameTextContent = currentFormatNode.parentElement.textContent.trim()
|
|
253
|
+
=== cursorNodes[0].textContent.trim();
|
|
254
|
+
var previousElement = currentFormatNode.parentElement;
|
|
255
|
+
if (!domNode.isBlockNode(previousElement) && isSameTextContent &&
|
|
256
|
+
!(previousElement.nodeName === 'SPAN' && previousElement.classList.contains('e-img-inner'))) {
|
|
257
|
+
currentFormatNode = previousElement;
|
|
258
|
+
}
|
|
259
|
+
else {
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
cursorNodes[0] = currentFormatNode;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
this.applyStyles(cursorNodes, 0, element);
|
|
266
|
+
return tempNode;
|
|
267
|
+
}
|
|
268
|
+
cursorNode = this.getInsertNode(docElement, range, format, value).firstChild;
|
|
269
|
+
}
|
|
270
|
+
return cursorNode;
|
|
271
|
+
};
|
|
272
|
+
SelectionCommands.getCursorFormat = function (isFormatted, cursorNodes, format, endNode) {
|
|
273
|
+
var currentNode;
|
|
274
|
+
for (var index = 0; index < cursorNodes.length; index++) {
|
|
275
|
+
currentNode = cursorNodes[index].lastElementChild ?
|
|
276
|
+
cursorNodes[index].lastElementChild : cursorNodes[index];
|
|
277
|
+
}
|
|
278
|
+
return (format === 'fontsize' && isFormatted.getFormattedNode(currentNode, format, endNode) == null && currentNode.parentElement.nodeName === 'SPAN') ? currentNode.parentElement : isFormatted.getFormattedNode(currentNode, format, endNode);
|
|
279
|
+
};
|
|
280
|
+
SelectionCommands.removeFormat = function (nodes, index, formatNode, isCursor, isTableCell, isFormat, isFontStyle, range, nodeCutter, format, value, domSelection, endNode, domNode) {
|
|
281
|
+
var splitNode = null;
|
|
282
|
+
var startText = range.startContainer.nodeName === '#text' ?
|
|
283
|
+
range.startContainer.textContent.substring(range.startOffset, range.startContainer.textContent.length) :
|
|
284
|
+
range.startContainer.textContent;
|
|
285
|
+
var nodeText = nodes[index].textContent;
|
|
286
|
+
var isParentNodeSameAsParentElement = nodes[0].parentElement.nodeName === nodes[0].parentElement.parentElement.nodeName;
|
|
287
|
+
if (!(range.startContainer === range.endContainer && range.startOffset === 0
|
|
288
|
+
&& range.endOffset === range.startContainer.length
|
|
289
|
+
&& (range.startContainer.textContent === formatNode.textContent || isParentNodeSameAsParentElement))) {
|
|
290
|
+
var nodeIndex = [];
|
|
291
|
+
var cloneNode = nodes[index];
|
|
292
|
+
var clonedElement = cloneNode;
|
|
293
|
+
do {
|
|
294
|
+
nodeIndex.push(domSelection.getIndex(cloneNode));
|
|
295
|
+
cloneNode = cloneNode.parentNode;
|
|
296
|
+
} while (cloneNode && (cloneNode !== formatNode));
|
|
297
|
+
if (nodes[index].nodeName !== 'BR') {
|
|
298
|
+
if (clonedElement.nodeName === '#text' && clonedElement.textContent.includes('\u200B')) {
|
|
299
|
+
clonedElement.remove();
|
|
300
|
+
}
|
|
301
|
+
if (!isTableCell) {
|
|
302
|
+
cloneNode = splitNode = (isCursor && (formatNode.textContent.length - 1) === range.startOffset) ?
|
|
303
|
+
nodeCutter.SplitNode(range, formatNode, true)
|
|
304
|
+
: nodeCutter.GetSpliceNode(range, formatNode);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
if (!isCursor) {
|
|
308
|
+
while (cloneNode && cloneNode.childNodes.length > 0 && ((nodeIndex.length - 1) >= 0)
|
|
309
|
+
&& (cloneNode.childNodes.length > nodeIndex[nodeIndex.length - 1])) {
|
|
310
|
+
if (cloneNode.childNodes.length > 1 && nodeIndex.length > 1) {
|
|
311
|
+
cloneNode = cloneNode.childNodes[nodeIndex[nodeIndex.length - 2]];
|
|
312
|
+
break;
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
cloneNode = cloneNode.childNodes[nodeIndex[nodeIndex.length - 1]];
|
|
316
|
+
nodeIndex.pop();
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (nodes[index].nodeName !== 'BR') {
|
|
320
|
+
while (cloneNode.nodeType === 1 && cloneNode.childNodes.length > 0) {
|
|
321
|
+
cloneNode = cloneNode.childNodes[0];
|
|
322
|
+
}
|
|
323
|
+
if (cloneNode.nodeType === 3 && !(isCursor && cloneNode.nodeValue === '')) {
|
|
324
|
+
nodes[index] = cloneNode;
|
|
325
|
+
}
|
|
326
|
+
else {
|
|
327
|
+
var divNode = document.createElement('div');
|
|
328
|
+
divNode.innerHTML = '​';
|
|
329
|
+
if (cloneNode.nodeType !== 3) {
|
|
330
|
+
cloneNode.insertBefore(divNode.firstChild, cloneNode.firstChild);
|
|
331
|
+
nodes[index] = cloneNode.firstChild;
|
|
332
|
+
}
|
|
333
|
+
else {
|
|
334
|
+
cloneNode.parentNode.insertBefore(divNode.firstChild, cloneNode);
|
|
335
|
+
nodes[index] = cloneNode.previousSibling;
|
|
336
|
+
cloneNode.parentNode.removeChild(cloneNode);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
var lastNode = splitNode;
|
|
343
|
+
for (; lastNode.firstChild !== null && lastNode.firstChild.nodeType !== 3; null) {
|
|
344
|
+
lastNode = lastNode.firstChild;
|
|
345
|
+
}
|
|
346
|
+
lastNode.innerHTML = '​';
|
|
347
|
+
nodes[index] = lastNode.firstChild;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
else if (isFontStyle && !nodes[index].contains(formatNode) && nodes[index].nodeType === 3 &&
|
|
351
|
+
nodes[index].textContent !== formatNode.textContent) {
|
|
352
|
+
var isFullNodeSelected = nodes[index].textContent === nodes[index].wholeText;
|
|
353
|
+
var nodeTraverse = nodes[index];
|
|
354
|
+
var styleElement = this.GetFormatNode(format, value);
|
|
355
|
+
while (nodeTraverse && nodeTraverse.textContent === nodeTraverse.parentElement.textContent) {
|
|
356
|
+
nodeTraverse = nodeTraverse.parentElement;
|
|
357
|
+
}
|
|
358
|
+
if (isFullNodeSelected && formatNode.textContent !== nodeTraverse.textContent) {
|
|
359
|
+
var nodeArray = [];
|
|
360
|
+
var priorityNode = this.getPriorityFormatNode(nodeTraverse, endNode);
|
|
361
|
+
if (priorityNode && priorityNode.textContent === nodeTraverse.textContent) {
|
|
362
|
+
nodeTraverse = priorityNode;
|
|
363
|
+
}
|
|
364
|
+
nodeArray.push(nodeTraverse);
|
|
365
|
+
this.applyStyles(nodeArray, 0, styleElement);
|
|
366
|
+
return nodes[index];
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
var fontStyle;
|
|
370
|
+
if (format === 'backgroundcolor') {
|
|
371
|
+
fontStyle = formatNode.style.fontSize;
|
|
372
|
+
}
|
|
373
|
+
var bgStyle;
|
|
374
|
+
if (format === 'fontsize') {
|
|
375
|
+
var bg = ej2_base_1.closest(nodes[index].parentElement, 'span[style*=' + 'background-color' + ']');
|
|
376
|
+
if (!ej2_base_1.isNullOrUndefined(bg)) {
|
|
377
|
+
bgStyle = bg.style.backgroundColor;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
var formatNodeStyles = formatNode.getAttribute('style');
|
|
381
|
+
var formatNodeTagName = formatNode.tagName;
|
|
382
|
+
var child;
|
|
383
|
+
if (formatNodeTagName === 'A' && format === 'underline') {
|
|
384
|
+
formatNode.style.textDecoration = 'none';
|
|
385
|
+
child = [formatNode];
|
|
386
|
+
}
|
|
387
|
+
else if (isformatted_1.IsFormatted.inlineTags.indexOf(formatNodeTagName.toLowerCase()) !== -1 && isFontStyle && formatNodeTagName.toLocaleLowerCase() !== 'span') {
|
|
388
|
+
var fontNodeStyle = formatNode.style;
|
|
389
|
+
if (fontNodeStyle.color && format === 'fontcolor') {
|
|
390
|
+
if (formatNode.nodeName === 'A') {
|
|
391
|
+
fontNodeStyle.color = value;
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
fontNodeStyle.color = '';
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
else if (fontNodeStyle.backgroundColor && format === 'backgroundcolor') {
|
|
398
|
+
fontNodeStyle.backgroundColor = '';
|
|
399
|
+
}
|
|
400
|
+
else if (fontNodeStyle.fontSize && format === 'fontsize') {
|
|
401
|
+
fontNodeStyle.fontSize = '';
|
|
402
|
+
}
|
|
403
|
+
else if (fontNodeStyle.fontFamily && format === 'fontname') {
|
|
404
|
+
fontNodeStyle.fontFamily = '';
|
|
405
|
+
}
|
|
406
|
+
if (formatNode.getAttribute('style') === '') {
|
|
407
|
+
formatNode.removeAttribute('style');
|
|
408
|
+
}
|
|
409
|
+
child = [formatNode];
|
|
410
|
+
}
|
|
411
|
+
else {
|
|
412
|
+
child = insert_methods_1.InsertMethods.unwrap(formatNode);
|
|
413
|
+
if (index === 0) {
|
|
414
|
+
this.isUnwrapped = true;
|
|
415
|
+
}
|
|
416
|
+
var liElement = nodes[index].parentElement;
|
|
417
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
418
|
+
liElement = ej2_base_1.closest(liElement, 'li');
|
|
419
|
+
}
|
|
420
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
421
|
+
(liElement.textContent.trim() === nodes[index].textContent.trim() ||
|
|
422
|
+
liElement.innerText.split('\n')[0] === nodes[index].textContent.trim())) {
|
|
423
|
+
if (format === 'bold') {
|
|
424
|
+
liElement.style.fontWeight = '';
|
|
425
|
+
}
|
|
426
|
+
else if (format === 'italic') {
|
|
427
|
+
liElement.style.fontStyle = '';
|
|
428
|
+
}
|
|
429
|
+
else if (format === 'fontsize') {
|
|
430
|
+
liElement.style.fontSize = '';
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
else if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li'
|
|
434
|
+
&& liElement.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
435
|
+
if (format === 'bold') {
|
|
436
|
+
liElement.style.fontWeight = '';
|
|
437
|
+
}
|
|
438
|
+
else if (format === 'italic') {
|
|
439
|
+
liElement.style.fontStyle = '';
|
|
440
|
+
}
|
|
441
|
+
SelectionCommands.conCatenateTextNode(liElement, format, '', 'normal', value);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
if (child[0] && !isFontStyle) {
|
|
445
|
+
var nodeTraverse = child[index] ? child[index] : child[0];
|
|
446
|
+
var textNode = nodeTraverse;
|
|
447
|
+
for (; nodeTraverse && nodeTraverse.parentElement && nodeTraverse.parentElement !== endNode; nodeTraverse = nodeTraverse) {
|
|
448
|
+
var nodeTraverseCondition = void 0;
|
|
449
|
+
if (formatNode.nodeName === 'SPAN') {
|
|
450
|
+
nodeTraverseCondition = nodeTraverse.parentElement.tagName.toLocaleLowerCase()
|
|
451
|
+
=== formatNode.tagName.toLocaleLowerCase() && nodeTraverse.parentElement.getAttribute('style') === formatNodeStyles;
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
nodeTraverseCondition = nodeTraverse.parentElement.tagName.toLocaleLowerCase()
|
|
455
|
+
=== formatNode.tagName.toLocaleLowerCase();
|
|
456
|
+
}
|
|
457
|
+
if (nodeTraverse.parentElement && nodeTraverseCondition &&
|
|
458
|
+
(nodeTraverse.parentElement.childElementCount > 1 || range.startOffset > 1)) {
|
|
459
|
+
if (textNode.parentElement && textNode.parentElement.tagName.toLocaleLowerCase()
|
|
460
|
+
=== formatNode.tagName.toLocaleLowerCase()) {
|
|
461
|
+
if ((range.startOffset === range.endOffset) && textNode.nodeType !== 1 &&
|
|
462
|
+
!ej2_base_1.isNullOrUndefined(textNode.textContent) && textNode.parentElement.childElementCount > 1) {
|
|
463
|
+
range.setStart(textNode, 0);
|
|
464
|
+
range.setEnd(textNode, textNode.textContent.length);
|
|
465
|
+
nodeCutter.SplitNode(range, textNode.parentElement, false);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
if (nodeTraverse.parentElement.tagName.toLocaleLowerCase() === 'span') {
|
|
469
|
+
if (formatNode.style.textDecoration === 'underline' &&
|
|
470
|
+
nodeTraverse.parentElement.style.textDecoration !== 'underline') {
|
|
471
|
+
nodeTraverse = nodeTraverse.parentElement;
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
insert_methods_1.InsertMethods.unwrap(nodeTraverse.parentElement);
|
|
476
|
+
nodeTraverse = !ej2_base_1.isNullOrUndefined(nodeTraverse.parentElement) && !domNode.isBlockNode(nodeTraverse.parentElement) ? textNode :
|
|
477
|
+
nodeTraverse.parentElement;
|
|
478
|
+
}
|
|
479
|
+
else {
|
|
480
|
+
nodeTraverse = nodeTraverse.parentElement;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
if (child.length > 0 && isFontStyle) {
|
|
485
|
+
for (var num = 0; num < child.length; num++) {
|
|
486
|
+
if (child[num].nodeType !== 3 || (child[num].textContent &&
|
|
487
|
+
child[num].textContent.trim().length > 0)) {
|
|
488
|
+
if (value !== '' && value !== 'transparent') {
|
|
489
|
+
child[num] = insert_methods_1.InsertMethods.Wrap(child[num], this.GetFormatNode(format, value, formatNodeTagName, formatNodeStyles));
|
|
490
|
+
}
|
|
491
|
+
var liElement = nodes[index].parentElement;
|
|
492
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
493
|
+
liElement = ej2_base_1.closest(liElement, 'li');
|
|
494
|
+
}
|
|
495
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
496
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
497
|
+
if (format === 'fontname') {
|
|
498
|
+
liElement.style.fontFamily = value;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li'
|
|
502
|
+
&& liElement.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
503
|
+
liElement.removeAttribute('style');
|
|
504
|
+
}
|
|
505
|
+
if (child[num].textContent === startText && (range.startContainer.nodeName === '#text' || range.startContainer.nodeName !== '#text'
|
|
506
|
+
&& range.startContainer.classList && !range.startContainer.classList.contains('e-multi-cells-select'))) {
|
|
507
|
+
if (num === 0) {
|
|
508
|
+
range.setStartBefore(child[num]);
|
|
509
|
+
}
|
|
510
|
+
else if (num === child.length - 1) {
|
|
511
|
+
range.setEndAfter(child[num]);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
var currentNodeElem = nodes[index].parentElement;
|
|
517
|
+
if (!ej2_base_1.isNullOrUndefined(fontStyle) && fontStyle !== '') {
|
|
518
|
+
currentNodeElem.style.fontSize = fontStyle;
|
|
519
|
+
}
|
|
520
|
+
if (!ej2_base_1.isNullOrUndefined(bgStyle) && bgStyle !== '') {
|
|
521
|
+
currentNodeElem.style.backgroundColor = bgStyle;
|
|
522
|
+
}
|
|
523
|
+
if (format === 'fontsize' || format === 'fontcolor' || format === 'fontname') {
|
|
524
|
+
var liElement = nodes[index].parentElement;
|
|
525
|
+
var parentElement = nodes[index].parentElement;
|
|
526
|
+
while (!ej2_base_1.isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
|
|
527
|
+
parentElement = parentElement.parentElement;
|
|
528
|
+
liElement = parentElement;
|
|
529
|
+
}
|
|
530
|
+
var num = index;
|
|
531
|
+
var liChildContent = '';
|
|
532
|
+
while (num >= 0 && !ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' && liElement.contains(nodes[num]) &&
|
|
533
|
+
liElement.textContent.replace('/\u200B/g', '').trim().includes(nodes[num].textContent.trim())) {
|
|
534
|
+
liChildContent = nodes[num].textContent + liChildContent;
|
|
535
|
+
num--;
|
|
536
|
+
}
|
|
537
|
+
var isNestedList = false;
|
|
538
|
+
var nestedListCount = 0;
|
|
539
|
+
var isNestedListItem = false;
|
|
540
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.childNodes) {
|
|
541
|
+
for (var num_1 = 0; num_1 < liElement.childNodes.length; num_1++) {
|
|
542
|
+
if (liElement.childNodes[num_1].nodeName === 'OL' || liElement.childNodes[num_1].nodeName === 'UL') {
|
|
543
|
+
nestedListCount++;
|
|
544
|
+
isNestedList = true;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
549
|
+
liElement.textContent.split('\u200B').join('').trim() === liChildContent.split('\u200B').join('').trim()) {
|
|
550
|
+
if (format === 'fontsize') {
|
|
551
|
+
liElement.style.fontSize = value;
|
|
552
|
+
}
|
|
553
|
+
else if (format === 'fontname') {
|
|
554
|
+
liElement.removeAttribute('style');
|
|
555
|
+
}
|
|
556
|
+
else {
|
|
557
|
+
liElement.style.color = value;
|
|
558
|
+
liElement.style.textDecoration = 'inherit';
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
else if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' && isNestedList) {
|
|
562
|
+
if (isNestedList && nestedListCount > 0) {
|
|
563
|
+
for (var num_2 = 0; num_2 < liElement.childNodes.length; num_2++) {
|
|
564
|
+
if (nodes[index].textContent === liElement.childNodes[num_2].textContent && nodes[index].textContent === nodeText && liElement.textContent.replace('/\u200B/g', '').trim().includes(liChildContent.split('\u200B').join('').trim())) {
|
|
565
|
+
isNestedListItem = true;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
if (isNestedListItem) {
|
|
570
|
+
for (var num_3 = 0; num_3 < liElement.childNodes.length; num_3++) {
|
|
571
|
+
if (liElement.childNodes[num_3].nodeName === 'OL' || liElement.childNodes[num_3].nodeName === 'UL') {
|
|
572
|
+
liElement.childNodes[num_3].removeAttribute('style');
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
if (format === 'fontsize') {
|
|
576
|
+
liElement.style.fontSize = value;
|
|
577
|
+
}
|
|
578
|
+
else if (format === 'fontname') {
|
|
579
|
+
liElement.removeAttribute('style');
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
liElement.style.color = value;
|
|
583
|
+
liElement.style.textDecoration = 'inherit';
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
return nodes[index];
|
|
590
|
+
};
|
|
591
|
+
SelectionCommands.insertFormat = function (docElement, nodes, index, formatNode, isCursor, isTableSelect, isFormat, isFontStyle, range, nodeCutter, format, value, painterValues, domNode, endNode) {
|
|
592
|
+
if (!isCursor) {
|
|
593
|
+
if ((formatNode === null && isFormat) || isFontStyle) {
|
|
594
|
+
if (!isTableSelect && nodes[index].nodeName !== 'BR') {
|
|
595
|
+
nodes[index] = nodeCutter.GetSpliceNode(range, nodes[index]);
|
|
596
|
+
nodes[index].textContent = nodeCutter.TrimLineBreak(nodes[index].textContent);
|
|
597
|
+
}
|
|
598
|
+
if (format === 'uppercase' || format === 'lowercase') {
|
|
599
|
+
nodes[index].textContent = (format === 'uppercase') ? nodes[index].textContent.toLocaleUpperCase()
|
|
600
|
+
: nodes[index].textContent.toLocaleLowerCase();
|
|
601
|
+
}
|
|
602
|
+
else if (!(isFontStyle === true && value === '')) {
|
|
603
|
+
var element = this.GetFormatNode(format, value);
|
|
604
|
+
if (value === 'formatPainter' || isFontStyle) {
|
|
605
|
+
var liElement = nodes[index].parentElement;
|
|
606
|
+
var parentElement = nodes[index].parentElement;
|
|
607
|
+
while (!ej2_base_1.isNullOrUndefined(parentElement) && parentElement.tagName.toLowerCase() !== 'li') {
|
|
608
|
+
parentElement = parentElement.parentElement;
|
|
609
|
+
liElement = parentElement;
|
|
610
|
+
}
|
|
611
|
+
if (format === 'fontcolor' || format === 'fontname' || format === 'fontsize') {
|
|
612
|
+
var parentElem = nodes[index].parentElement;
|
|
613
|
+
if (!ej2_base_1.isNullOrUndefined(parentElem) && parentElem.childNodes) {
|
|
614
|
+
for (var i = 0; i < parentElem.childNodes.length; i++) {
|
|
615
|
+
if (this.concatenateTextExcludingList(nodes, index) === nodes[index].textContent) {
|
|
616
|
+
var liElement_1 = void 0;
|
|
617
|
+
if (parentElem.tagName === 'LI') {
|
|
618
|
+
liElement_1 = parentElem;
|
|
619
|
+
}
|
|
620
|
+
else if (parentElem.closest('li')) {
|
|
621
|
+
liElement_1 = parentElem.closest('li');
|
|
622
|
+
}
|
|
623
|
+
if (!ej2_base_1.isNullOrUndefined(liElement_1)) {
|
|
624
|
+
switch (format) {
|
|
625
|
+
case 'fontcolor':
|
|
626
|
+
liElement_1.style.color = value;
|
|
627
|
+
break;
|
|
628
|
+
case 'fontname':
|
|
629
|
+
liElement_1.style.fontFamily = value;
|
|
630
|
+
break;
|
|
631
|
+
case 'fontsize':
|
|
632
|
+
liElement_1.style.fontSize = value;
|
|
633
|
+
break;
|
|
634
|
+
default:
|
|
635
|
+
break;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
var childElement = parentElem.childNodes[i];
|
|
640
|
+
if (childElement.tagName === 'OL' || childElement.tagName === 'UL') {
|
|
641
|
+
switch (format) {
|
|
642
|
+
case 'fontcolor':
|
|
643
|
+
childElement.style.color = 'initial';
|
|
644
|
+
break;
|
|
645
|
+
case 'fontname':
|
|
646
|
+
childElement.style.fontFamily = 'initial';
|
|
647
|
+
break;
|
|
648
|
+
case 'fontsize':
|
|
649
|
+
childElement.style.fontSize = 'initial';
|
|
650
|
+
break;
|
|
651
|
+
default:
|
|
652
|
+
break;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
659
|
+
liElement.textContent.trim() === nodes[index].textContent.trim()) {
|
|
660
|
+
if (format === 'fontsize') {
|
|
661
|
+
liElement.style.fontSize = value;
|
|
662
|
+
}
|
|
663
|
+
else if (format === 'fontcolor') {
|
|
664
|
+
liElement.style.color = value;
|
|
665
|
+
liElement.style.textDecoration = 'inherit';
|
|
666
|
+
}
|
|
667
|
+
else if (format === 'fontname') {
|
|
668
|
+
liElement.style.fontFamily = value;
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
if (value === 'formatPainter') {
|
|
672
|
+
return this.insertFormatPainterElem(nodes, index, range, nodeCutter, painterValues, domNode);
|
|
673
|
+
}
|
|
674
|
+
var currentNode = nodes[index];
|
|
675
|
+
var priorityNode = this.getPriorityFormatNode(currentNode, endNode);
|
|
676
|
+
if (!ej2_base_1.isNullOrUndefined(priorityNode) || isFontStyle) {
|
|
677
|
+
var currentFormatNode = ej2_base_1.isNullOrUndefined(priorityNode) ? currentNode : priorityNode;
|
|
678
|
+
currentFormatNode = !ej2_base_1.isNullOrUndefined(priorityNode) && priorityNode.style.fontSize !== '' ?
|
|
679
|
+
currentFormatNode.firstChild : currentFormatNode;
|
|
680
|
+
if (ej2_base_1.isNullOrUndefined(priorityNode) || format === 'fontsize') {
|
|
681
|
+
while (currentFormatNode) {
|
|
682
|
+
var isSameTextContent = currentFormatNode.parentElement.textContent.trim()
|
|
683
|
+
=== nodes[index].textContent.trim();
|
|
684
|
+
var parent_1 = currentFormatNode.parentElement;
|
|
685
|
+
if (!domNode.isBlockNode(parent_1) && isSameTextContent &&
|
|
686
|
+
!(parent_1.nodeName === 'SPAN' && parent_1.classList.contains('e-img-inner'))) {
|
|
687
|
+
currentFormatNode = parent_1;
|
|
688
|
+
}
|
|
689
|
+
else {
|
|
690
|
+
break;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
var nodeList = [];
|
|
695
|
+
if (isFontStyle) {
|
|
696
|
+
var closestAnchor = ej2_base_1.closest(nodes[index].parentElement, 'A');
|
|
697
|
+
if (!ej2_base_1.isNullOrUndefined(closestAnchor) && closestAnchor.firstChild.textContent.trim()
|
|
698
|
+
=== nodes[index].textContent.trim()) {
|
|
699
|
+
currentFormatNode = nodes[index];
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
if (nodes[index].textContent.trim() !== currentFormatNode.textContent.trim()) {
|
|
703
|
+
currentFormatNode = nodes[index];
|
|
704
|
+
}
|
|
705
|
+
nodeList[0] = currentFormatNode;
|
|
706
|
+
this.applyStyles(nodeList, 0, element);
|
|
707
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li'
|
|
708
|
+
&& liElement.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
709
|
+
SelectionCommands.conCatenateTextNode(liElement, format, liElement.textContent, format, value);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
else {
|
|
713
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
var liElement = nodes[index].parentElement;
|
|
718
|
+
nodes[index] = this.applyStyles(nodes, index, element);
|
|
719
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() !== 'li') {
|
|
720
|
+
liElement = ej2_base_1.closest(liElement, 'li');
|
|
721
|
+
}
|
|
722
|
+
if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li' &&
|
|
723
|
+
(liElement.textContent.trim() === nodes[index].textContent.trim() ||
|
|
724
|
+
liElement.innerText.split('\n')[0] === nodes[index].textContent.trim())) {
|
|
725
|
+
if (format === 'bold') {
|
|
726
|
+
liElement.style.fontWeight = 'bold';
|
|
727
|
+
}
|
|
728
|
+
else if (format === 'italic') {
|
|
729
|
+
liElement.style.fontStyle = 'italic';
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
else if (!ej2_base_1.isNullOrUndefined(liElement) && liElement.tagName.toLowerCase() === 'li'
|
|
733
|
+
&& liElement.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
734
|
+
SelectionCommands.conCatenateTextNode(liElement, format, liElement.textContent, format);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
if (!isTableSelect && nodes[index].isConnected) {
|
|
741
|
+
nodes[index] = nodeCutter.GetSpliceNode(range, nodes[index]);
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
else {
|
|
746
|
+
if (format !== 'uppercase' && format !== 'lowercase') {
|
|
747
|
+
var element = this.getInsertNode(docElement, range, format, value);
|
|
748
|
+
nodes[index] = element.firstChild;
|
|
749
|
+
nodeCutter.position = 1;
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
nodeCutter.position = range.startOffset;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return nodes[index];
|
|
756
|
+
};
|
|
757
|
+
SelectionCommands.applyStyles = function (nodes, index, element) {
|
|
758
|
+
if (!(nodes[index].nodeName === 'BR' && this.enterAction === 'BR')) {
|
|
759
|
+
nodes[index] = (index === (nodes.length - 1)) || nodes[index].nodeName === 'BR' ?
|
|
760
|
+
insert_methods_1.InsertMethods.Wrap(nodes[index], element)
|
|
761
|
+
: insert_methods_1.InsertMethods.WrapBefore(nodes[index], element, true);
|
|
762
|
+
nodes[index] = this.getChildNode(nodes[index], element);
|
|
763
|
+
}
|
|
764
|
+
return nodes[index];
|
|
765
|
+
};
|
|
766
|
+
SelectionCommands.getPriorityFormatNode = function (node, endNode) {
|
|
767
|
+
var isFormatted = new isformatted_1.IsFormatted();
|
|
768
|
+
var fontSizeNode = isFormatted.getFormattedNode(node, 'fontsize', endNode);
|
|
769
|
+
var fontColorNode;
|
|
770
|
+
var backgroundColorNode;
|
|
771
|
+
var fontNameNode;
|
|
772
|
+
if (ej2_base_1.isNullOrUndefined(fontSizeNode)) {
|
|
773
|
+
backgroundColorNode = isFormatted.getFormattedNode(node, 'backgroundcolor', endNode);
|
|
774
|
+
if (ej2_base_1.isNullOrUndefined(backgroundColorNode)) {
|
|
775
|
+
fontNameNode = isFormatted.getFormattedNode(node, 'fontname', endNode);
|
|
776
|
+
if (ej2_base_1.isNullOrUndefined(fontNameNode)) {
|
|
777
|
+
fontColorNode = isFormatted.getFormattedNode(node, 'fontcolor', endNode);
|
|
778
|
+
if (ej2_base_1.isNullOrUndefined(fontColorNode)) {
|
|
779
|
+
return null;
|
|
780
|
+
}
|
|
781
|
+
else {
|
|
782
|
+
return fontColorNode;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
else {
|
|
786
|
+
return fontNameNode;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
return backgroundColorNode;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
else {
|
|
794
|
+
return fontSizeNode;
|
|
795
|
+
}
|
|
796
|
+
};
|
|
797
|
+
SelectionCommands.getInsertNode = function (docElement, range, format, value) {
|
|
798
|
+
var element = this.GetFormatNode(format, value);
|
|
799
|
+
element.innerHTML = '​';
|
|
800
|
+
if (ej2_base_1.Browser.isIE) {
|
|
801
|
+
var frag = docElement.createDocumentFragment();
|
|
802
|
+
frag.appendChild(element);
|
|
803
|
+
range.insertNode(frag);
|
|
804
|
+
}
|
|
805
|
+
else {
|
|
806
|
+
range.insertNode(element);
|
|
807
|
+
}
|
|
808
|
+
return element;
|
|
809
|
+
};
|
|
810
|
+
SelectionCommands.getChildNode = function (node, element) {
|
|
811
|
+
if (node === undefined || node === null) {
|
|
812
|
+
element.innerHTML = '​';
|
|
813
|
+
node = element.firstChild;
|
|
814
|
+
}
|
|
815
|
+
return node;
|
|
816
|
+
};
|
|
817
|
+
SelectionCommands.applySelection = function (nodes, domSelection, nodeCutter, index, isCollapsed) {
|
|
818
|
+
if (nodes.length === 1 && !isCollapsed) {
|
|
819
|
+
domSelection.startContainer = domSelection.getNodeArray(nodes[index], true);
|
|
820
|
+
domSelection.endContainer = domSelection.startContainer;
|
|
821
|
+
domSelection.startOffset = 0;
|
|
822
|
+
domSelection.endOffset = nodes[index].textContent.length;
|
|
823
|
+
}
|
|
824
|
+
else if (nodes.length === 1 && isCollapsed) {
|
|
825
|
+
domSelection.startContainer = domSelection.getNodeArray(nodes[index], true);
|
|
826
|
+
domSelection.endContainer = domSelection.startContainer;
|
|
827
|
+
domSelection.startOffset = nodeCutter.position;
|
|
828
|
+
domSelection.endOffset = nodeCutter.position;
|
|
829
|
+
}
|
|
830
|
+
else if (index === 0) {
|
|
831
|
+
domSelection.startContainer = domSelection.getNodeArray(nodes[index], true);
|
|
832
|
+
domSelection.startOffset = 0;
|
|
833
|
+
}
|
|
834
|
+
else if (index === nodes.length - 1) {
|
|
835
|
+
domSelection.endContainer = domSelection.getNodeArray(nodes[index], false);
|
|
836
|
+
domSelection.endOffset = nodes[index].textContent.length;
|
|
837
|
+
}
|
|
838
|
+
return domSelection;
|
|
839
|
+
};
|
|
840
|
+
SelectionCommands.GetFormatNode = function (format, value, tagName, styles) {
|
|
841
|
+
var node;
|
|
842
|
+
switch (format) {
|
|
843
|
+
case 'bold':
|
|
844
|
+
return document.createElement('strong');
|
|
845
|
+
case 'italic':
|
|
846
|
+
return document.createElement('em');
|
|
847
|
+
case 'underline':
|
|
848
|
+
node = document.createElement('span');
|
|
849
|
+
this.updateStyles(node, tagName, styles);
|
|
850
|
+
node.style.textDecoration = 'underline';
|
|
851
|
+
return node;
|
|
852
|
+
case 'strikethrough':
|
|
853
|
+
node = document.createElement('span');
|
|
854
|
+
this.updateStyles(node, tagName, styles);
|
|
855
|
+
node.style.textDecoration = 'line-through';
|
|
856
|
+
return node;
|
|
857
|
+
case 'superscript':
|
|
858
|
+
return document.createElement('sup');
|
|
859
|
+
case 'subscript':
|
|
860
|
+
return document.createElement('sub');
|
|
861
|
+
case 'fontcolor':
|
|
862
|
+
node = document.createElement('span');
|
|
863
|
+
this.updateStyles(node, tagName, styles);
|
|
864
|
+
node.style.color = value;
|
|
865
|
+
node.style.textDecoration = 'inherit';
|
|
866
|
+
return node;
|
|
867
|
+
case 'fontname':
|
|
868
|
+
node = document.createElement('span');
|
|
869
|
+
this.updateStyles(node, tagName, styles);
|
|
870
|
+
node.style.fontFamily = value;
|
|
871
|
+
return node;
|
|
872
|
+
case 'fontsize':
|
|
873
|
+
node = document.createElement('span');
|
|
874
|
+
this.updateStyles(node, tagName, styles);
|
|
875
|
+
node.style.fontSize = value;
|
|
876
|
+
return node;
|
|
877
|
+
case 'inlinecode':
|
|
878
|
+
return document.createElement('code');
|
|
879
|
+
default:
|
|
880
|
+
node = document.createElement('span');
|
|
881
|
+
this.updateStyles(node, tagName, styles);
|
|
882
|
+
node.style.backgroundColor = value;
|
|
883
|
+
return node;
|
|
884
|
+
}
|
|
885
|
+
};
|
|
886
|
+
SelectionCommands.updateStyles = function (ele, tag, styles) {
|
|
887
|
+
if (styles !== null && tag === 'SPAN') {
|
|
888
|
+
ele.style.cssText = styles;
|
|
889
|
+
}
|
|
890
|
+
};
|
|
891
|
+
SelectionCommands.insertFormatPainterElem = function (nodes, index, range, nodeCutter, painterValues, domNode) {
|
|
892
|
+
var parent = !domNode.isBlockNode(nodes[index].parentElement) ?
|
|
893
|
+
nodes[index].parentElement : nodes[index];
|
|
894
|
+
if (!domNode.isBlockNode(parent)) {
|
|
895
|
+
while (parent.textContent.trim() === parent.parentElement.textContent.trim() && !domNode.isBlockNode(parent.parentElement)) {
|
|
896
|
+
parent = parent.parentElement;
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
if (!ej2_base_1.isNullOrUndefined(parent) && parent.nodeType === 1 && !(parent.classList.contains('e-rte-img-caption') || parent.classList.contains('e-img-inner'))) {
|
|
900
|
+
this.formatPainterCleanup(index, nodes, parent, range, nodeCutter, domNode);
|
|
901
|
+
}
|
|
902
|
+
var elem = painterValues.element;
|
|
903
|
+
if (!ej2_base_1.isNullOrUndefined(elem)) {
|
|
904
|
+
var clonedElement = elem.cloneNode(true);
|
|
905
|
+
var elemList = clonedElement.querySelectorAll(painterValues.lastChild.nodeName);
|
|
906
|
+
var lastElement = void 0;
|
|
907
|
+
if (elemList.length > 0) {
|
|
908
|
+
lastElement = elemList[elemList.length - 1];
|
|
909
|
+
}
|
|
910
|
+
else {
|
|
911
|
+
if (!ej2_base_1.isNullOrUndefined(clonedElement) && clonedElement.nodeName === painterValues.lastChild.nodeName) {
|
|
912
|
+
lastElement = clonedElement;
|
|
913
|
+
}
|
|
914
|
+
}
|
|
915
|
+
lastElement.textContent = nodes[index].textContent;
|
|
916
|
+
var lastChild = lastElement.childNodes[0];
|
|
917
|
+
nodes[index] = insert_methods_1.InsertMethods.Wrap(nodes[index], clonedElement);
|
|
918
|
+
nodes[index].textContent = '';
|
|
919
|
+
nodes[index] = lastChild;
|
|
920
|
+
}
|
|
921
|
+
return nodes[index];
|
|
922
|
+
};
|
|
923
|
+
SelectionCommands.formatPainterCleanup = function (index, nodes, parent, range, nodeCutter, domNode) {
|
|
924
|
+
var INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
|
|
925
|
+
if (index === 0 && parent.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
926
|
+
nodeCutter.SplitNode(range, parent, true);
|
|
927
|
+
var childELemList = nodes[index].parentElement.childNodes;
|
|
928
|
+
for (var i = 0; i < childELemList.length; i++) {
|
|
929
|
+
if (childELemList[i].textContent.trim() === nodes[i].textContent.trim()) {
|
|
930
|
+
parent.parentNode.insertBefore(childELemList[i], parent);
|
|
931
|
+
break;
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
var blockChildNodes = parent.parentElement.childNodes;
|
|
935
|
+
for (var k = 0; k < blockChildNodes.length; k++) {
|
|
936
|
+
if ((blockChildNodes[k].textContent.trim() === '' || blockChildNodes[k].textContent.length === 0) &&
|
|
937
|
+
blockChildNodes[k].textContent.charCodeAt(0) !== 160) {
|
|
938
|
+
ej2_base_1.detach(blockChildNodes[k]);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
else if (parent.textContent.trim() !== nodes[index].textContent.trim()) {
|
|
943
|
+
parent.parentElement.insertBefore(nodes[index], parent);
|
|
944
|
+
}
|
|
945
|
+
else {
|
|
946
|
+
while (!ej2_base_1.isNullOrUndefined(parent) && parent.nodeType !== 3 && !domNode.isBlockNode(parent)) {
|
|
947
|
+
var temp = void 0;
|
|
948
|
+
for (var i = 0; i < parent.childNodes.length; i++) {
|
|
949
|
+
var currentChild = parent.childNodes[i];
|
|
950
|
+
if (currentChild.textContent.trim().length !== 0 && currentChild.nodeType !== 3) {
|
|
951
|
+
temp = parent.childNodes[i];
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
if (INVALID_TAGS.indexOf(parent.tagName) === -1) {
|
|
955
|
+
insert_methods_1.InsertMethods.unwrap(parent);
|
|
956
|
+
}
|
|
957
|
+
parent = temp;
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
};
|
|
961
|
+
SelectionCommands.concatenateTextExcludingList = function (nodes, index) {
|
|
962
|
+
var result = '';
|
|
963
|
+
var parentNode = nodes[index].nodeName === '#text' ? ej2_base_1.closest(nodes[index].parentElement, 'li') : ej2_base_1.closest(nodes[index], 'li');
|
|
964
|
+
if (!ej2_base_1.isNullOrUndefined(parentNode)) {
|
|
965
|
+
for (var i = 0; i < parentNode.childNodes.length; i++) {
|
|
966
|
+
var childNode = parentNode.childNodes[i];
|
|
967
|
+
if ((childNode.nodeType === 3) || (childNode.nodeType === 1 && (childNode.tagName !== 'OL' && childNode.tagName !== 'UL'))) {
|
|
968
|
+
result += childNode.textContent;
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
return result;
|
|
973
|
+
};
|
|
974
|
+
SelectionCommands.conCatenateTextNode = function (liElement, format, value, formatStr, constVal) {
|
|
975
|
+
var result = '';
|
|
976
|
+
var colorStyle = '';
|
|
977
|
+
var fontSize = '';
|
|
978
|
+
var fontFamily = '';
|
|
979
|
+
switch (format) {
|
|
980
|
+
case 'bold':
|
|
981
|
+
liElement.querySelectorAll('strong').forEach(function (e) {
|
|
982
|
+
result = result + e.textContent;
|
|
983
|
+
});
|
|
984
|
+
if (result === value) {
|
|
985
|
+
liElement.style.fontWeight = formatStr;
|
|
986
|
+
}
|
|
987
|
+
break;
|
|
988
|
+
case 'italic':
|
|
989
|
+
liElement.querySelectorAll('em').forEach(function (e) {
|
|
990
|
+
result = result + e.textContent;
|
|
991
|
+
});
|
|
992
|
+
if (result === value) {
|
|
993
|
+
liElement.style.fontStyle = formatStr;
|
|
994
|
+
}
|
|
995
|
+
break;
|
|
996
|
+
case 'fontcolor':
|
|
997
|
+
liElement.querySelectorAll('span').forEach(function (span) {
|
|
998
|
+
colorStyle = span.style.color;
|
|
999
|
+
if (SelectionCommands.hasColorsEqual(colorStyle, constVal)) {
|
|
1000
|
+
result = result + span.textContent;
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
if (!ej2_base_1.isNullOrUndefined(result) && !ej2_base_1.isNullOrUndefined(value) && result !== '' && value !== '' && result.replace(/\s+/g, '') === value.replace(/\s+/g, '')) {
|
|
1004
|
+
liElement.style.color = constVal;
|
|
1005
|
+
liElement.style.textDecoration = 'inherit';
|
|
1006
|
+
}
|
|
1007
|
+
break;
|
|
1008
|
+
case 'fontsize':
|
|
1009
|
+
liElement.querySelectorAll('span').forEach(function (span) {
|
|
1010
|
+
fontSize = span.style.getPropertyValue('font-size');
|
|
1011
|
+
if (fontSize === constVal) {
|
|
1012
|
+
result = result + span.textContent;
|
|
1013
|
+
}
|
|
1014
|
+
});
|
|
1015
|
+
if (!ej2_base_1.isNullOrUndefined(result) && !ej2_base_1.isNullOrUndefined(value) && result !== '' && value !== '' && result.replace(/\s+/g, '') === value.replace(/\s+/g, '')) {
|
|
1016
|
+
liElement.style.fontSize = constVal;
|
|
1017
|
+
}
|
|
1018
|
+
break;
|
|
1019
|
+
case 'fontname':
|
|
1020
|
+
liElement.querySelectorAll('span').forEach(function (span) {
|
|
1021
|
+
fontFamily = span.style.getPropertyValue('font-family');
|
|
1022
|
+
fontFamily = fontFamily.replace(/ /g, '');
|
|
1023
|
+
if (fontFamily === constVal) {
|
|
1024
|
+
result = result + span.textContent;
|
|
1025
|
+
}
|
|
1026
|
+
});
|
|
1027
|
+
if (!ej2_base_1.isNullOrUndefined(result) && !ej2_base_1.isNullOrUndefined(value) && result !== '' && value !== '' && result.replace(/\s+/g, '') === value.replace(/\s+/g, '')) {
|
|
1028
|
+
liElement.style.fontFamily = constVal;
|
|
1029
|
+
}
|
|
1030
|
+
break;
|
|
1031
|
+
}
|
|
1032
|
+
};
|
|
1033
|
+
SelectionCommands.hasColorsEqual = function (color1, color2) {
|
|
1034
|
+
if (ej2_base_1.isNullOrUndefined(color1) || ej2_base_1.isNullOrUndefined(color2) || color1.trim() === '' || color2.trim() === '') {
|
|
1035
|
+
return color1 === color2;
|
|
1036
|
+
}
|
|
1037
|
+
if (color1.startsWith('rgb(')) {
|
|
1038
|
+
color1 = color1.replace('rgb(', 'rgba(').slice(0, -1) + ',1)';
|
|
1039
|
+
}
|
|
1040
|
+
if (color2.startsWith('rgb(')) {
|
|
1041
|
+
color2 = color2.replace('rgb(', 'rgba(').slice(0, -1) + ',1)';
|
|
1042
|
+
}
|
|
1043
|
+
return color1.replace(/\s+/g, '') === color2.replace(/\s+/g, '');
|
|
1044
|
+
};
|
|
1045
|
+
SelectionCommands.isMentionStartOrEnd = function (editableElement, start, end) {
|
|
1046
|
+
var type = 'None';
|
|
1047
|
+
var domTree = new dom_tree_1.DOMMethods(editableElement);
|
|
1048
|
+
var startParent = domTree.getTopMostNode(start);
|
|
1049
|
+
var endParent = domTree.getTopMostNode(end);
|
|
1050
|
+
if ((startParent.nodeType === Node.ELEMENT_NODE && !startParent.isContentEditable) &&
|
|
1051
|
+
(endParent.nodeType === Node.ELEMENT_NODE && !endParent.isContentEditable)) {
|
|
1052
|
+
type = 'Both';
|
|
1053
|
+
}
|
|
1054
|
+
if (startParent.nodeType === Node.ELEMENT_NODE && !startParent.isContentEditable) {
|
|
1055
|
+
type = 'Start';
|
|
1056
|
+
}
|
|
1057
|
+
if (endParent.nodeType === Node.ELEMENT_NODE && !endParent.isContentEditable) {
|
|
1058
|
+
type = 'End';
|
|
1059
|
+
}
|
|
1060
|
+
return type;
|
|
1061
|
+
};
|
|
1062
|
+
SelectionCommands.enterAction = 'P';
|
|
1063
|
+
SelectionCommands.isUnwrapped = false;
|
|
1064
|
+
SelectionCommands.isWrapped = false;
|
|
1065
|
+
SelectionCommands.userAgentData = new user_agent_1.CustomUserAgentData(ej2_base_1.Browser.userAgent, false);
|
|
1066
|
+
return SelectionCommands;
|
|
1067
|
+
}());
|
|
1068
|
+
exports.SelectionCommands = SelectionCommands;
|
|
1069
|
+
});
|