@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,622 @@
|
|
|
1
|
+
define(["require", "exports", "@syncfusion/ej2-base", "../../common/constant", "../plugin"], function (require, exports, ej2_base_1, EVENTS, plugin_1) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
var FormatPainterActions = (function () {
|
|
5
|
+
function FormatPainterActions(parent, options) {
|
|
6
|
+
this.INVALID_TAGS = ['A', 'AUDIO', 'IMG', 'VIDEO', 'IFRAME'];
|
|
7
|
+
this.parent = parent;
|
|
8
|
+
this.settings = options;
|
|
9
|
+
this.addEventListener();
|
|
10
|
+
this.setDeniedFormats();
|
|
11
|
+
}
|
|
12
|
+
FormatPainterActions.prototype.addEventListener = function () {
|
|
13
|
+
this.parent.observer.on(EVENTS.FORMAT_PAINTER_ACTIONS, this.actionHandler, this);
|
|
14
|
+
this.parent.observer.on(EVENTS.MODEL_CHANGED_PLUGIN, this.onPropertyChanged, this);
|
|
15
|
+
this.parent.observer.on(EVENTS.INTERNAL_DESTROY, this.destroy, this);
|
|
16
|
+
};
|
|
17
|
+
FormatPainterActions.prototype.onPropertyChanged = function (prop) {
|
|
18
|
+
if (prop && prop.module === 'formatPainter') {
|
|
19
|
+
if (!ej2_base_1.isNullOrUndefined(prop.newProp.formatPainterSettings.allowedFormats)) {
|
|
20
|
+
this.settings.allowedFormats = prop.newProp.formatPainterSettings.allowedFormats;
|
|
21
|
+
}
|
|
22
|
+
if (!ej2_base_1.isNullOrUndefined(prop.newProp.formatPainterSettings.deniedFormats)) {
|
|
23
|
+
this.settings.deniedFormats = prop.newProp.formatPainterSettings.deniedFormats;
|
|
24
|
+
this.setDeniedFormats();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
FormatPainterActions.prototype.removeEventListener = function () {
|
|
29
|
+
this.parent.observer.off(EVENTS.FORMAT_PAINTER_ACTIONS, this.actionHandler);
|
|
30
|
+
this.parent.observer.off(EVENTS.MODEL_CHANGED_PLUGIN, this.onPropertyChanged);
|
|
31
|
+
this.parent.observer.off(EVENTS.INTERNAL_DESTROY, this.destroy);
|
|
32
|
+
};
|
|
33
|
+
FormatPainterActions.prototype.destroy = function () {
|
|
34
|
+
this.removeEventListener();
|
|
35
|
+
this.INVALID_TAGS = null;
|
|
36
|
+
this.copyCollection = null;
|
|
37
|
+
this.deniedFormatsCollection = null;
|
|
38
|
+
this.newElem = null;
|
|
39
|
+
this.newElemLastChild = null;
|
|
40
|
+
this.settings = null;
|
|
41
|
+
this.parent = null;
|
|
42
|
+
};
|
|
43
|
+
FormatPainterActions.prototype.actionHandler = function (args) {
|
|
44
|
+
this.settings.allowedContext = ['Text', 'List', 'Table'];
|
|
45
|
+
if (!ej2_base_1.isNullOrUndefined(args) && !ej2_base_1.isNullOrUndefined(args.item) && !ej2_base_1.isNullOrUndefined(args.item.formatPainterAction)) {
|
|
46
|
+
switch (args.item.formatPainterAction) {
|
|
47
|
+
case 'format-copy':
|
|
48
|
+
this.copyAction();
|
|
49
|
+
break;
|
|
50
|
+
case 'format-paste':
|
|
51
|
+
this.pasteAction();
|
|
52
|
+
break;
|
|
53
|
+
case 'escape':
|
|
54
|
+
this.escapeAction();
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
this.callBack(args);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
FormatPainterActions.prototype.callBack = function (event) {
|
|
61
|
+
if (event.callBack) {
|
|
62
|
+
event.callBack({
|
|
63
|
+
requestType: 'FormatPainter',
|
|
64
|
+
action: event.item.formatPainterAction,
|
|
65
|
+
event: event.event,
|
|
66
|
+
editorMode: 'HTML',
|
|
67
|
+
range: this.parent.nodeSelection.getRange(this.parent.currentDocument),
|
|
68
|
+
elements: this.parent.nodeSelection.getSelectedNodes(this.parent.currentDocument)
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
FormatPainterActions.prototype.generateElement = function () {
|
|
73
|
+
var copyCollection = this.copyCollection.slice();
|
|
74
|
+
copyCollection.reverse();
|
|
75
|
+
var length = copyCollection.length;
|
|
76
|
+
var elemCollection = ej2_base_1.createElement('div', { className: 'e-format-paste-wrapper' });
|
|
77
|
+
var lastAppendChild;
|
|
78
|
+
for (var i = 0; i < length; i++) {
|
|
79
|
+
var _a = copyCollection[i], attrs = _a.attrs, className = _a.className, styles = _a.styles, tagName = _a.tagName;
|
|
80
|
+
var elem = ej2_base_1.createElement(tagName);
|
|
81
|
+
if (className !== '') {
|
|
82
|
+
elem.className = className;
|
|
83
|
+
}
|
|
84
|
+
for (var i_1 = 0; i_1 < attrs.length; i_1++) {
|
|
85
|
+
var property = attrs[i_1].name;
|
|
86
|
+
var value = attrs[i_1].value;
|
|
87
|
+
elem.setAttribute(property, value);
|
|
88
|
+
}
|
|
89
|
+
for (var i_2 = 0; i_2 < styles.length; i_2++) {
|
|
90
|
+
var property = styles[i_2].property;
|
|
91
|
+
var value = styles[i_2].value;
|
|
92
|
+
var priority = styles[i_2].priority;
|
|
93
|
+
elem.style.setProperty(property, value, priority);
|
|
94
|
+
}
|
|
95
|
+
if (elemCollection.childElementCount === 0) {
|
|
96
|
+
elemCollection.append(elem);
|
|
97
|
+
lastAppendChild = elem;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
lastAppendChild.append(elem);
|
|
101
|
+
lastAppendChild = elem;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
var elemChild = this.removeDeniedFormats(elemCollection);
|
|
105
|
+
var currentElem = elemChild;
|
|
106
|
+
while (currentElem) {
|
|
107
|
+
if (currentElem.firstChild === null) {
|
|
108
|
+
lastAppendChild = currentElem;
|
|
109
|
+
currentElem = undefined;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
currentElem = currentElem.firstChild;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
this.newElem = elemChild;
|
|
116
|
+
this.newElemLastChild = lastAppendChild;
|
|
117
|
+
};
|
|
118
|
+
FormatPainterActions.prototype.pasteAction = function () {
|
|
119
|
+
if (ej2_base_1.isNullOrUndefined(this.copyCollection) || this.copyCollection.length === 0) {
|
|
120
|
+
this.paintPlainTextFormat();
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.insertFormatNode(this.newElem, this.newElemLastChild);
|
|
124
|
+
};
|
|
125
|
+
FormatPainterActions.prototype.removeDeniedFormats = function (parentElement) {
|
|
126
|
+
if (!ej2_base_1.isNullOrUndefined(this.deniedFormatsCollection) && this.deniedFormatsCollection.length > 0) {
|
|
127
|
+
var deniedPropArray = this.deniedFormatsCollection;
|
|
128
|
+
var length_1 = deniedPropArray.length;
|
|
129
|
+
for (var i = 0; i < length_1; i++) {
|
|
130
|
+
var tag = deniedPropArray[i].tag;
|
|
131
|
+
if (deniedPropArray[i].tag) {
|
|
132
|
+
var elementsList = parentElement.querySelectorAll(tag);
|
|
133
|
+
for (var j = 0; j < elementsList.length; j++) {
|
|
134
|
+
if (deniedPropArray[i].classes.length > 0) {
|
|
135
|
+
var classes = deniedPropArray[i].classes;
|
|
136
|
+
var classLength = classes.length;
|
|
137
|
+
for (var k = 0; k < classLength; k++) {
|
|
138
|
+
if (elementsList[j].classList.contains(classes[k])) {
|
|
139
|
+
ej2_base_1.removeClass([elementsList[j]], classes[k].trim());
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
if (elementsList[j].classList.length === 0) {
|
|
143
|
+
elementsList[j].removeAttribute('class');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (deniedPropArray[i].styles.length > 0) {
|
|
147
|
+
var styles = deniedPropArray[i].styles;
|
|
148
|
+
var styleLength = styles.length;
|
|
149
|
+
for (var k = 0; k < styleLength; k++) {
|
|
150
|
+
elementsList[j].style.removeProperty(styles[k].trim());
|
|
151
|
+
}
|
|
152
|
+
if (elementsList[j].style.length === 0) {
|
|
153
|
+
elementsList[j].removeAttribute('style');
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
if (deniedPropArray[i].attributes.length > 0) {
|
|
157
|
+
var attributes = deniedPropArray[i].attributes;
|
|
158
|
+
var attributeLength = attributes.length;
|
|
159
|
+
for (var k = 0; k < attributeLength; k++) {
|
|
160
|
+
elementsList[j].removeAttribute(attributes[k].trim());
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return parentElement.firstElementChild;
|
|
168
|
+
};
|
|
169
|
+
FormatPainterActions.prototype.copyAction = function () {
|
|
170
|
+
var copyCollection = [];
|
|
171
|
+
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
172
|
+
var domSelection = this.parent.nodeSelection;
|
|
173
|
+
var nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
|
|
174
|
+
domSelection.getSelectionNodeCollectionBr(range);
|
|
175
|
+
if (nodes.length === 0 && domSelection.getSelectionNodeCollectionBr(range).length === 0) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
nodes = nodes.length === 0 ? domSelection.getSelectionNodeCollectionBr(range) : nodes;
|
|
180
|
+
}
|
|
181
|
+
var parentElem = nodes[0].parentElement;
|
|
182
|
+
var currentContext = this.findCurrentContext(parentElem);
|
|
183
|
+
var allowedRulesArray = this.settings.allowedFormats.indexOf(';') > -1 ? this.settings.allowedFormats.split(';') :
|
|
184
|
+
[this.settings.allowedFormats];
|
|
185
|
+
for (var i = 0; i < allowedRulesArray.length; i++) {
|
|
186
|
+
allowedRulesArray[i] = allowedRulesArray[i].trim();
|
|
187
|
+
}
|
|
188
|
+
var _a = this.getRangeParentElem(currentContext, parentElem), rangeParentElem = _a[0], context = _a[1];
|
|
189
|
+
if (currentContext === null) {
|
|
190
|
+
currentContext = context;
|
|
191
|
+
}
|
|
192
|
+
if (!ej2_base_1.isNullOrUndefined(currentContext) && this.settings.allowedContext.indexOf(currentContext) > -1) {
|
|
193
|
+
if (range.startContainer.nodeName === '#text') {
|
|
194
|
+
parentElem = range.startContainer.parentElement;
|
|
195
|
+
}
|
|
196
|
+
var lastElement = parentElem;
|
|
197
|
+
do {
|
|
198
|
+
if (allowedRulesArray.indexOf(parentElem.nodeName.toLowerCase()) > -1) {
|
|
199
|
+
var allAttributes = parentElem.attributes;
|
|
200
|
+
var attribute = [];
|
|
201
|
+
for (var i = 0; i < allAttributes.length; i++) {
|
|
202
|
+
if (allAttributes[i].name !== 'class' && allAttributes[i].name !== 'style') {
|
|
203
|
+
attribute.push(allAttributes[i]);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
var classes = parentElem.className;
|
|
207
|
+
var allStyles = parentElem.style;
|
|
208
|
+
var styleProp = [];
|
|
209
|
+
for (var i = 0; i < allStyles.length; i++) {
|
|
210
|
+
var property = allStyles[i];
|
|
211
|
+
var value = allStyles.getPropertyValue(property);
|
|
212
|
+
var priority = allStyles.getPropertyPriority(property);
|
|
213
|
+
styleProp.push({ property: property, value: value, priority: priority });
|
|
214
|
+
}
|
|
215
|
+
copyCollection.push({
|
|
216
|
+
attrs: attribute, className: classes, styles: styleProp, tagName: parentElem.nodeName
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
if (rangeParentElem === parentElem) {
|
|
220
|
+
parentElem = undefined;
|
|
221
|
+
}
|
|
222
|
+
else if (!ej2_base_1.isNullOrUndefined(parentElem.parentElement)) {
|
|
223
|
+
parentElem = parentElem.parentElement;
|
|
224
|
+
}
|
|
225
|
+
if (lastElement === parentElem) {
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
} while (!ej2_base_1.isNullOrUndefined(parentElem) || parentElem === this.parent.editableElement);
|
|
229
|
+
this.copyCollection = copyCollection;
|
|
230
|
+
}
|
|
231
|
+
this.generateElement();
|
|
232
|
+
};
|
|
233
|
+
FormatPainterActions.prototype.getRangeParentElem = function (currentContext, rangeParent) {
|
|
234
|
+
var startContainer = rangeParent;
|
|
235
|
+
var rangeParentELem;
|
|
236
|
+
if (startContainer.nodeType === 3) {
|
|
237
|
+
startContainer = startContainer.parentElement;
|
|
238
|
+
}
|
|
239
|
+
switch (currentContext) {
|
|
240
|
+
case 'Table':
|
|
241
|
+
rangeParentELem = ej2_base_1.closest(startContainer, 'td');
|
|
242
|
+
if (ej2_base_1.isNullOrUndefined(rangeParentELem)) {
|
|
243
|
+
rangeParentELem = ej2_base_1.closest(startContainer, 'th');
|
|
244
|
+
}
|
|
245
|
+
break;
|
|
246
|
+
case 'List':
|
|
247
|
+
rangeParentELem = ej2_base_1.closest(startContainer, 'li');
|
|
248
|
+
break;
|
|
249
|
+
case 'Text':
|
|
250
|
+
rangeParentELem = ej2_base_1.closest(startContainer, 'p');
|
|
251
|
+
break;
|
|
252
|
+
}
|
|
253
|
+
if (ej2_base_1.isNullOrUndefined(rangeParentELem)) {
|
|
254
|
+
var nearBlockParentName = this.getNearestBlockParentElement(rangeParent);
|
|
255
|
+
if (!ej2_base_1.isNullOrUndefined(nearBlockParentName) && nearBlockParentName !== 'UL' &&
|
|
256
|
+
nearBlockParentName !== 'OL' && nearBlockParentName !== 'LI') {
|
|
257
|
+
rangeParentELem = ej2_base_1.closest(startContainer, nearBlockParentName);
|
|
258
|
+
currentContext = 'Text';
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
if (currentContext === 'List') {
|
|
262
|
+
rangeParentELem = rangeParentELem.parentElement;
|
|
263
|
+
}
|
|
264
|
+
return [rangeParentELem, currentContext];
|
|
265
|
+
};
|
|
266
|
+
FormatPainterActions.prototype.getNearestBlockParentElement = function (rangeParent) {
|
|
267
|
+
var node = rangeParent;
|
|
268
|
+
if (node.nodeType === 3) {
|
|
269
|
+
node = node.parentNode;
|
|
270
|
+
}
|
|
271
|
+
while (node && node !== this.parent.editableElement) {
|
|
272
|
+
if (!ej2_base_1.isNullOrUndefined(node) && this.isBlockElement(node)) {
|
|
273
|
+
return node.nodeName;
|
|
274
|
+
}
|
|
275
|
+
node = node.parentNode;
|
|
276
|
+
}
|
|
277
|
+
return null;
|
|
278
|
+
};
|
|
279
|
+
FormatPainterActions.prototype.isBlockElement = function (node) {
|
|
280
|
+
var blockTags = ['P', 'DIV', 'UL', 'OL', 'LI', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
|
|
281
|
+
'ADDRESS', 'ARTICLE', 'ASIDE', 'BLOCKQUOTE', 'FIGCAPTION', 'FIGURE', 'FOOTER', 'HEADER',
|
|
282
|
+
'HR', 'MAIN', 'NAV', 'SECTION', 'SUMMARY', 'PRE'];
|
|
283
|
+
return blockTags.indexOf(node.nodeName) > -1;
|
|
284
|
+
};
|
|
285
|
+
FormatPainterActions.prototype.escapeAction = function () {
|
|
286
|
+
this.copyCollection = [];
|
|
287
|
+
};
|
|
288
|
+
FormatPainterActions.prototype.paintPlainTextFormat = function () {
|
|
289
|
+
var range = this.parent.nodeSelection.getRange(this.parent.currentDocument);
|
|
290
|
+
var domSelection = this.parent.nodeSelection;
|
|
291
|
+
var nodes = range.collapsed ? domSelection.getSelectionNodeCollection(range) :
|
|
292
|
+
domSelection.getSelectionNodeCollectionBr(range);
|
|
293
|
+
var isInValid;
|
|
294
|
+
if (nodes.length > 1) {
|
|
295
|
+
for (var i = 0; i < nodes.length; i++) {
|
|
296
|
+
isInValid = this.validateELementTag(nodes[i]);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
isInValid = this.validateELementTag(range.startContainer) && this.validateELementTag(range.endContainer);
|
|
301
|
+
}
|
|
302
|
+
if (!isInValid) {
|
|
303
|
+
this.parent.execCommand('Clear', 'ClearFormat', null, null);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
FormatPainterActions.prototype.validateELementTag = function (node) {
|
|
307
|
+
if (node.nodeType === 3) {
|
|
308
|
+
node = node.parentElement;
|
|
309
|
+
}
|
|
310
|
+
return this.INVALID_TAGS.indexOf(node.tagName) > -1;
|
|
311
|
+
};
|
|
312
|
+
FormatPainterActions.prototype.findCurrentContext = function (parentElem) {
|
|
313
|
+
var closestParagraph = ej2_base_1.closest(parentElem, 'p');
|
|
314
|
+
var closestList = ej2_base_1.closest(parentElem, 'li');
|
|
315
|
+
if (closestParagraph && !closestList) {
|
|
316
|
+
return 'Text';
|
|
317
|
+
}
|
|
318
|
+
else if (ej2_base_1.closest(parentElem, 'li')) {
|
|
319
|
+
if (!ej2_base_1.isNullOrUndefined(closestParagraph) && !ej2_base_1.isNullOrUndefined(closestList) && closestParagraph.textContent.trim() !== closestList.textContent.trim()) {
|
|
320
|
+
return 'Text';
|
|
321
|
+
}
|
|
322
|
+
return 'List';
|
|
323
|
+
}
|
|
324
|
+
else if (ej2_base_1.closest(parentElem, 'td') || ej2_base_1.closest(parentElem, 'tr') || ej2_base_1.closest(parentElem, 'th')) {
|
|
325
|
+
return 'Table';
|
|
326
|
+
}
|
|
327
|
+
return null;
|
|
328
|
+
};
|
|
329
|
+
FormatPainterActions.prototype.insertFormatNode = function (elem, lastChild) {
|
|
330
|
+
var clonedElem = elem.cloneNode(true);
|
|
331
|
+
if (!this.isBlockElement(elem)) {
|
|
332
|
+
var newBlockElem = ej2_base_1.createElement('P');
|
|
333
|
+
newBlockElem.appendChild(elem);
|
|
334
|
+
clonedElem = newBlockElem.cloneNode(true);
|
|
335
|
+
}
|
|
336
|
+
var endNode = this.parent.editableElement;
|
|
337
|
+
var docElement = this.parent.currentDocument;
|
|
338
|
+
var childElem = clonedElem.firstChild;
|
|
339
|
+
var inlineElement;
|
|
340
|
+
while (childElem) {
|
|
341
|
+
if (this.isBlockElement(childElem)) {
|
|
342
|
+
childElem = childElem.firstChild;
|
|
343
|
+
}
|
|
344
|
+
else {
|
|
345
|
+
inlineElement = childElem.parentNode.removeChild(childElem);
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
var formatValues = {
|
|
350
|
+
element: inlineElement,
|
|
351
|
+
lastChild: lastChild
|
|
352
|
+
};
|
|
353
|
+
plugin_1.SelectionCommands.applyFormat(docElement, null, endNode, 'P', null, 'formatPainter', null, formatValues);
|
|
354
|
+
var range = this.parent.nodeSelection.getRange(docElement);
|
|
355
|
+
var isCollapsed = range.collapsed;
|
|
356
|
+
var blockNodes = this.parent.domNode.blockNodes();
|
|
357
|
+
var isListCopied = this.isListCopied();
|
|
358
|
+
if (isListCopied) {
|
|
359
|
+
for (var i = 0; i < blockNodes.length; i++) {
|
|
360
|
+
if (ej2_base_1.closest(blockNodes[i], 'li')) {
|
|
361
|
+
blockNodes[i] = ej2_base_1.closest(blockNodes[i], 'li');
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
var isFullNodeSelected = false;
|
|
366
|
+
if (blockNodes.length === 1) {
|
|
367
|
+
isFullNodeSelected = blockNodes[0].textContent.trim() === range.toString().trim();
|
|
368
|
+
}
|
|
369
|
+
if (this.isBlockElement(clonedElem) && isCollapsed || blockNodes.length > 1 || isFullNodeSelected) {
|
|
370
|
+
this.insertBlockNode(clonedElem, range, docElement, blockNodes);
|
|
371
|
+
}
|
|
372
|
+
};
|
|
373
|
+
FormatPainterActions.prototype.isListCopied = function () {
|
|
374
|
+
var isListCopied = false;
|
|
375
|
+
for (var i = 0; i < this.copyCollection.length; i++) {
|
|
376
|
+
if (this.copyCollection[i].tagName === 'OL' || this.copyCollection[i].tagName === 'UL') {
|
|
377
|
+
isListCopied = true;
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return isListCopied;
|
|
382
|
+
};
|
|
383
|
+
FormatPainterActions.prototype.insertBlockNode = function (element, range, docElement, nodes) {
|
|
384
|
+
var domSelection = this.parent.nodeSelection;
|
|
385
|
+
var saveSelection = domSelection.save(range, docElement);
|
|
386
|
+
this.parent.domNode.setMarker(saveSelection);
|
|
387
|
+
var listElement;
|
|
388
|
+
var cloneListParentNode;
|
|
389
|
+
var sameListType = false;
|
|
390
|
+
if (element.nodeName === 'UL' || element.nodeName === 'OL') {
|
|
391
|
+
cloneListParentNode = element.cloneNode(true);
|
|
392
|
+
listElement = cloneListParentNode.firstChild;
|
|
393
|
+
}
|
|
394
|
+
var cloneElementNode = ej2_base_1.isNullOrUndefined(cloneListParentNode) ? element : element.firstChild;
|
|
395
|
+
for (var index = 0; index < nodes.length; index++) {
|
|
396
|
+
if (this.INVALID_TAGS.indexOf(nodes[index].nodeName) > -1 ||
|
|
397
|
+
nodes[index].querySelectorAll('img,audio,video,iframe').length > 0) {
|
|
398
|
+
continue;
|
|
399
|
+
}
|
|
400
|
+
var cloneParentNode = cloneElementNode.cloneNode(false);
|
|
401
|
+
while (nodes[index].firstChild) {
|
|
402
|
+
if (nodes[index].textContent.trim().length !== 0) {
|
|
403
|
+
cloneParentNode.appendChild(nodes[index].firstChild);
|
|
404
|
+
}
|
|
405
|
+
else {
|
|
406
|
+
nodes[index].removeChild(nodes[index].firstChild);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (nodes[index].nodeName === 'TD' || nodes[index].nodeName === 'TH') {
|
|
410
|
+
if (ej2_base_1.isNullOrUndefined(cloneListParentNode)) {
|
|
411
|
+
nodes[index].appendChild(cloneParentNode);
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
else if (index === 0 && !ej2_base_1.isNullOrUndefined(cloneListParentNode)) {
|
|
415
|
+
nodes[index].appendChild(cloneListParentNode);
|
|
416
|
+
cloneListParentNode.appendChild(cloneParentNode);
|
|
417
|
+
continue;
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
nodes[index].appendChild(cloneParentNode);
|
|
421
|
+
continue;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
if (!ej2_base_1.isNullOrUndefined(cloneListParentNode)) {
|
|
425
|
+
sameListType = this.isSameListType(element, nodes[index]);
|
|
426
|
+
}
|
|
427
|
+
if (cloneParentNode.nodeName === 'LI' && !sameListType) {
|
|
428
|
+
this.insertNewList(range, nodes, index, cloneListParentNode, cloneParentNode);
|
|
429
|
+
}
|
|
430
|
+
else if (sameListType) {
|
|
431
|
+
this.insertSameList(nodes, index, cloneListParentNode, cloneParentNode);
|
|
432
|
+
}
|
|
433
|
+
else {
|
|
434
|
+
nodes[index].parentNode.replaceChild(cloneParentNode, nodes[index]);
|
|
435
|
+
}
|
|
436
|
+
if (cloneParentNode.nodeName !== 'LI' && (cloneParentNode.parentElement.nodeName === 'OL' ||
|
|
437
|
+
cloneParentNode.parentElement.nodeName === 'UL')) {
|
|
438
|
+
var parent_1 = cloneParentNode.parentElement;
|
|
439
|
+
this.parent.nodeCutter.SplitNode(range, parent_1, true);
|
|
440
|
+
if (!ej2_base_1.isNullOrUndefined(parent_1.previousElementSibling)) {
|
|
441
|
+
parent_1.previousElementSibling.after(cloneParentNode);
|
|
442
|
+
if (cloneParentNode.childNodes.length > 1) {
|
|
443
|
+
for (var j = 0; j < cloneParentNode.childNodes.length; j++) {
|
|
444
|
+
var currentChild = cloneParentNode.childNodes[j];
|
|
445
|
+
if (currentChild.nodeName === 'OL' || currentChild.nodeName === 'UL') {
|
|
446
|
+
cloneParentNode.after(currentChild);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
parent_1.parentElement.prepend(cloneParentNode);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
!ej2_base_1.isNullOrUndefined(listElement) ? ej2_base_1.detach(listElement) : false;
|
|
457
|
+
this.cleanEmptyLists();
|
|
458
|
+
var save = this.parent.domNode.saveMarker(saveSelection);
|
|
459
|
+
save.restore();
|
|
460
|
+
};
|
|
461
|
+
FormatPainterActions.prototype.insertNewList = function (range, nodes, index, cloneListParentNode, cloneParentNode) {
|
|
462
|
+
if (index === 0) {
|
|
463
|
+
var nodeName = nodes[index].nodeName;
|
|
464
|
+
nodes[index] = nodes[index].parentNode.replaceChild(cloneListParentNode, nodes[index]);
|
|
465
|
+
var parent_2 = nodeName === 'LI' ? cloneListParentNode.parentElement
|
|
466
|
+
: cloneListParentNode;
|
|
467
|
+
this.parent.nodeCutter.SplitNode(range, parent_2, true);
|
|
468
|
+
if (nodes[index].nodeName === 'LI' && !ej2_base_1.isNullOrUndefined(parent_2)) {
|
|
469
|
+
cloneListParentNode.append(cloneParentNode);
|
|
470
|
+
if (!ej2_base_1.isNullOrUndefined(parent_2.parentNode)) {
|
|
471
|
+
parent_2.parentNode.insertBefore(cloneListParentNode, parent_2);
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
else {
|
|
475
|
+
if (!ej2_base_1.isNullOrUndefined(parent_2)) {
|
|
476
|
+
if (!ej2_base_1.isNullOrUndefined(parent_2.previousElementSibling) && parent_2.previousElementSibling.nodeName === cloneListParentNode.nodeName) {
|
|
477
|
+
var currentParent = parent_2.previousElementSibling;
|
|
478
|
+
currentParent.append(cloneParentNode);
|
|
479
|
+
while (currentParent.firstChild) {
|
|
480
|
+
cloneListParentNode.append(currentParent.firstChild);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
else if (!ej2_base_1.isNullOrUndefined(parent_2.nextElementSibling) && parent_2.nextElementSibling.nodeName === cloneListParentNode.nodeName) {
|
|
484
|
+
var currentParent = parent_2.nextElementSibling;
|
|
485
|
+
currentParent.prepend(cloneParentNode);
|
|
486
|
+
while (currentParent.firstChild) {
|
|
487
|
+
cloneListParentNode.append(currentParent.firstChild);
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
else {
|
|
491
|
+
cloneListParentNode.append(cloneParentNode);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
cloneListParentNode.append(cloneParentNode);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
else {
|
|
500
|
+
cloneListParentNode.append(cloneParentNode);
|
|
501
|
+
}
|
|
502
|
+
this.detachEmptyBlockNodes(nodes[index]);
|
|
503
|
+
};
|
|
504
|
+
FormatPainterActions.prototype.insertSameList = function (nodes, index, cloneListParentNode, cloneParentNode) {
|
|
505
|
+
if (index === 0) {
|
|
506
|
+
if (!ej2_base_1.isNullOrUndefined(nodes[index].parentNode) && (nodes[index].parentNode.nodeName === 'UL' || nodes[index].parentNode.nodeName === 'OL')) {
|
|
507
|
+
if (nodes.length === 1) {
|
|
508
|
+
while (cloneParentNode.firstChild) {
|
|
509
|
+
nodes[index].append(cloneParentNode.firstChild);
|
|
510
|
+
}
|
|
511
|
+
for (var i = 0; i < nodes[index].parentNode.childNodes.length; i++) {
|
|
512
|
+
var currentChild = nodes[index].parentNode.childNodes[i];
|
|
513
|
+
cloneListParentNode.append(currentChild.cloneNode(true));
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
cloneListParentNode.append(cloneParentNode);
|
|
518
|
+
}
|
|
519
|
+
nodes[index].parentNode.parentNode.replaceChild(cloneListParentNode, nodes[index].parentNode);
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
cloneListParentNode.append(cloneParentNode);
|
|
524
|
+
}
|
|
525
|
+
this.detachEmptyBlockNodes(nodes[index]);
|
|
526
|
+
};
|
|
527
|
+
FormatPainterActions.prototype.isSameListType = function (element, node) {
|
|
528
|
+
var isSameListType = false;
|
|
529
|
+
var nearestListNode = ej2_base_1.closest(node, 'ol, ul');
|
|
530
|
+
if (!ej2_base_1.isNullOrUndefined(nearestListNode) && nearestListNode.querySelectorAll('li').length > 0) {
|
|
531
|
+
if (nearestListNode.nodeName === element.nodeName) {
|
|
532
|
+
isSameListType = true;
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
isSameListType = false;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return isSameListType;
|
|
539
|
+
};
|
|
540
|
+
FormatPainterActions.prototype.cleanEmptyLists = function () {
|
|
541
|
+
var listElem = this.parent.editableElement.querySelectorAll('ol, ul');
|
|
542
|
+
for (var i = 0; i < listElem.length; i++) {
|
|
543
|
+
if (listElem[i].textContent.trim() === '') {
|
|
544
|
+
ej2_base_1.detach(listElem[i]);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
};
|
|
548
|
+
FormatPainterActions.prototype.setDeniedFormats = function () {
|
|
549
|
+
var deniedFormatsCollection = [];
|
|
550
|
+
if (ej2_base_1.isNullOrUndefined(this.settings) || ej2_base_1.isNullOrUndefined(this.settings.deniedFormats)) {
|
|
551
|
+
return;
|
|
552
|
+
}
|
|
553
|
+
var deniedFormats = this.settings.deniedFormats.indexOf(';') > -1 ? this.settings.deniedFormats.split(';') :
|
|
554
|
+
[this.settings.deniedFormats];
|
|
555
|
+
var length = deniedFormats.length;
|
|
556
|
+
for (var i = 0; i < length; i++) {
|
|
557
|
+
var formatString = deniedFormats[i];
|
|
558
|
+
if (formatString !== '') {
|
|
559
|
+
formatString.trim();
|
|
560
|
+
var collection = this.makeDeniedFormatsCollection(formatString);
|
|
561
|
+
if (!ej2_base_1.isNullOrUndefined(collection)) {
|
|
562
|
+
deniedFormatsCollection.push(collection);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
this.deniedFormatsCollection = deniedFormatsCollection;
|
|
567
|
+
};
|
|
568
|
+
FormatPainterActions.prototype.detachEmptyBlockNodes = function (node) {
|
|
569
|
+
if (!ej2_base_1.isNullOrUndefined(node) && node.textContent.trim() === '') {
|
|
570
|
+
ej2_base_1.detach(node);
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
FormatPainterActions.prototype.makeDeniedFormatsCollection = function (value) {
|
|
574
|
+
var openParenIndex = value.indexOf('(');
|
|
575
|
+
var closeParenIndex = value.indexOf(')');
|
|
576
|
+
var openBracketIndex = value.indexOf('[');
|
|
577
|
+
var closeBracketIndex = value.indexOf(']');
|
|
578
|
+
var openBraceIndex = value.indexOf('{');
|
|
579
|
+
var closeBraceIndex = value.indexOf('}');
|
|
580
|
+
var classes = [];
|
|
581
|
+
var attributes = '';
|
|
582
|
+
var styles = '';
|
|
583
|
+
var tagName = '';
|
|
584
|
+
var classList = [];
|
|
585
|
+
var attributesList = [];
|
|
586
|
+
var stylesList = [];
|
|
587
|
+
if (openParenIndex > -1 && closeParenIndex > -1) {
|
|
588
|
+
classes = value.substring(openParenIndex + 1, closeParenIndex).split(' ');
|
|
589
|
+
classList = classes[0].split(')')[0].split(',');
|
|
590
|
+
}
|
|
591
|
+
if (openBracketIndex > -1 && closeBracketIndex > -1) {
|
|
592
|
+
attributes = value.substring(openBracketIndex + 1, closeBracketIndex);
|
|
593
|
+
attributesList = attributes.split(',');
|
|
594
|
+
}
|
|
595
|
+
if (openBraceIndex > -1 && closeBraceIndex > -1) {
|
|
596
|
+
styles = value.substring(openBraceIndex + 1, closeBraceIndex);
|
|
597
|
+
stylesList = styles.split(',');
|
|
598
|
+
}
|
|
599
|
+
var openIndexArray = [openParenIndex, openBracketIndex, openBraceIndex];
|
|
600
|
+
openIndexArray = openIndexArray.filter(function (index) { return index > -1; });
|
|
601
|
+
var len = openIndexArray.length;
|
|
602
|
+
var min;
|
|
603
|
+
if (len === 1) {
|
|
604
|
+
min = openIndexArray[0];
|
|
605
|
+
}
|
|
606
|
+
else if (len === 2) {
|
|
607
|
+
min = Math.min(openIndexArray[0], openIndexArray[1]);
|
|
608
|
+
}
|
|
609
|
+
else if (len === 3) {
|
|
610
|
+
min = Math.min(openIndexArray[0], openIndexArray[1], openIndexArray[2]);
|
|
611
|
+
}
|
|
612
|
+
tagName = value.substring(0, min);
|
|
613
|
+
tagName = tagName.trim();
|
|
614
|
+
return ({
|
|
615
|
+
tag: tagName, styles: stylesList, classes: classList,
|
|
616
|
+
attributes: attributesList
|
|
617
|
+
});
|
|
618
|
+
};
|
|
619
|
+
return FormatPainterActions;
|
|
620
|
+
}());
|
|
621
|
+
exports.FormatPainterActions = FormatPainterActions;
|
|
622
|
+
});
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { EditorManager } from './../base/editor-manager';
|
|
2
|
+
/**
|
|
3
|
+
* Formats internal component
|
|
4
|
+
*
|
|
5
|
+
* @hidden
|
|
6
|
+
* @deprecated
|
|
7
|
+
*/
|
|
8
|
+
export declare class Formats {
|
|
9
|
+
private parent;
|
|
10
|
+
private blockquotePrevent;
|
|
11
|
+
/**
|
|
12
|
+
* Constructor for creating the Formats plugin
|
|
13
|
+
*
|
|
14
|
+
* @param {EditorManager} parent - specifies the parent element.
|
|
15
|
+
* @hidden
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
18
|
+
constructor(parent: EditorManager);
|
|
19
|
+
private addEventListener;
|
|
20
|
+
private removeEventListener;
|
|
21
|
+
private getParentNode;
|
|
22
|
+
private blockQuotesHandled;
|
|
23
|
+
private onKeyUp;
|
|
24
|
+
private getBlockParent;
|
|
25
|
+
private onKeyDown;
|
|
26
|
+
private removeCodeContent;
|
|
27
|
+
private deleteContent;
|
|
28
|
+
private paraFocus;
|
|
29
|
+
private isNotEndCursor;
|
|
30
|
+
private setCursorPosition;
|
|
31
|
+
private focusSelectionParent;
|
|
32
|
+
private insertMarker;
|
|
33
|
+
private applyFormats;
|
|
34
|
+
private hasOnlyBlockquotes;
|
|
35
|
+
private getNode;
|
|
36
|
+
private createBlockquoteSpan;
|
|
37
|
+
private setSelectionBRConfig;
|
|
38
|
+
private preFormatMerge;
|
|
39
|
+
private blockquotesFormatMerge;
|
|
40
|
+
private cleanFormats;
|
|
41
|
+
private applyTableSidesFormat;
|
|
42
|
+
destroy(): void;
|
|
43
|
+
}
|