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