@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,462 @@
|
|
|
1
|
+
define(["require", "exports", "./../base/constant", "@syncfusion/ej2-base", "./../../common/constant", "@syncfusion/ej2-base"], function (require, exports, CONSTANT, ej2_base_1, EVENTS, ej2_base_2) {
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
var MDLists = (function () {
|
|
5
|
+
function MDLists(options) {
|
|
6
|
+
ej2_base_1.extend(this, this, options, true);
|
|
7
|
+
this.selection = this.parent.markdownSelection;
|
|
8
|
+
this.addEventListener();
|
|
9
|
+
}
|
|
10
|
+
MDLists.prototype.addEventListener = function () {
|
|
11
|
+
this.parent.observer.on(CONSTANT.LISTS_COMMAND, this.applyListsHandler, this);
|
|
12
|
+
this.parent.observer.on(EVENTS.KEY_DOWN_HANDLER, this.keyDownHandler, this);
|
|
13
|
+
this.parent.observer.on(EVENTS.KEY_UP_HANDLER, this.keyUpHandler, this);
|
|
14
|
+
this.parent.observer.on(EVENTS.INTERNAL_DESTROY, this.destroy, this);
|
|
15
|
+
};
|
|
16
|
+
MDLists.prototype.removeEventListener = function () {
|
|
17
|
+
this.parent.observer.off(CONSTANT.LISTS_COMMAND, this.applyListsHandler);
|
|
18
|
+
this.parent.observer.off(EVENTS.KEY_DOWN_HANDLER, this.keyDownHandler);
|
|
19
|
+
this.parent.observer.off(EVENTS.KEY_UP_HANDLER, this.keyUpHandler);
|
|
20
|
+
this.parent.observer.off(EVENTS.INTERNAL_DESTROY, this.destroy);
|
|
21
|
+
};
|
|
22
|
+
MDLists.prototype.keyDownHandler = function (event) {
|
|
23
|
+
switch (event.event.which) {
|
|
24
|
+
case 9:
|
|
25
|
+
this.tabKey(event);
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
switch (event.event.action) {
|
|
29
|
+
case 'ordered-list':
|
|
30
|
+
this.applyListsHandler({ subCommand: 'OL', callBack: event.callBack });
|
|
31
|
+
event.event.preventDefault();
|
|
32
|
+
break;
|
|
33
|
+
case 'unordered-list':
|
|
34
|
+
this.applyListsHandler({ subCommand: 'UL', callBack: event.callBack });
|
|
35
|
+
event.event.preventDefault();
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
MDLists.prototype.keyUpHandler = function (event) {
|
|
40
|
+
switch (event.event.which) {
|
|
41
|
+
case 13:
|
|
42
|
+
this.enterKey(event);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
MDLists.prototype.tabKey = function (event) {
|
|
47
|
+
var textArea = this.parent.element;
|
|
48
|
+
this.selection.save(textArea.selectionStart, textArea.selectionEnd);
|
|
49
|
+
var start = textArea.selectionStart;
|
|
50
|
+
var end = textArea.selectionEnd;
|
|
51
|
+
var parents = this.selection.getSelectedParentPoints(textArea);
|
|
52
|
+
var addedLength = 0;
|
|
53
|
+
var isNotFirst = this.isNotFirstLine(textArea, parents[0]);
|
|
54
|
+
if (!isNotFirst && !event.event.shiftKey) {
|
|
55
|
+
this.restore(textArea, start, end + addedLength, event);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
var listFormat = this.olListType();
|
|
59
|
+
var regex = this.getListRegex();
|
|
60
|
+
this.currentAction = this.getAction(parents[0].text);
|
|
61
|
+
for (var i = 0; i < parents.length; i++) {
|
|
62
|
+
var prevIndex = event.event.shiftKey ? parents[i].line - 1 : parents[i].line - 1;
|
|
63
|
+
var prevLine = this.selection.getLine(textArea, prevIndex);
|
|
64
|
+
if (prevLine && (!event.event.shiftKey && isNotFirst || (event.event.shiftKey))) {
|
|
65
|
+
var prevLineSplit = prevLine.split('. ');
|
|
66
|
+
var tabSpace = '\t';
|
|
67
|
+
var tabSpaceLength = event.event.shiftKey ? -tabSpace.length : tabSpace.length;
|
|
68
|
+
var splitTab = parents[i].text.split('\t');
|
|
69
|
+
if (event.event.shiftKey && splitTab.length === 1) {
|
|
70
|
+
break;
|
|
71
|
+
}
|
|
72
|
+
if (this.currentAction === 'OL' && /^\d+$/.test(prevLineSplit[0].trim()) && listFormat) {
|
|
73
|
+
event.event.preventDefault();
|
|
74
|
+
parents[i].text = event.event.shiftKey ? splitTab.splice(1, splitTab.length).join('\t') : tabSpace + parents[i].text;
|
|
75
|
+
var curTabSpace = this.getTabSpace(parents[i].text);
|
|
76
|
+
var prevTabSpace = this.getTabSpace(prevLine);
|
|
77
|
+
var splitText = parents[i].text.split('. ');
|
|
78
|
+
if (curTabSpace === prevTabSpace) {
|
|
79
|
+
this.changeTextAreaValue(splitText, this.nextOrderedListValue(prevLineSplit[0].trim()), event, textArea, parents, i, end);
|
|
80
|
+
}
|
|
81
|
+
else if (prevTabSpace < curTabSpace) {
|
|
82
|
+
this.changeTextAreaValue(splitText, '1. ', event, textArea, parents, i, end);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
for (; prevTabSpace.length > curTabSpace.length; null) {
|
|
86
|
+
prevIndex = prevIndex - 1;
|
|
87
|
+
prevLine = this.selection.getLine(textArea, prevIndex);
|
|
88
|
+
var prevLineSplit_1 = prevLine.trim().split('. ');
|
|
89
|
+
if (/^\d+$/.test(prevLineSplit_1[0])) {
|
|
90
|
+
prevTabSpace = this.getTabSpace(prevLine);
|
|
91
|
+
if (prevTabSpace.length <= curTabSpace.length) {
|
|
92
|
+
this.changeTextAreaValue(splitText, this.nextOrderedListValue(prevLineSplit_1[0]), event, textArea, parents, i, end);
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else if (this.currentAction === 'UL' && regex.test(prevLine.trim()) || !listFormat) {
|
|
100
|
+
event.event.preventDefault();
|
|
101
|
+
parents[i].text = event.event.shiftKey ? splitTab.splice(1, splitTab.length).join('\t') : tabSpace + parents[i].text;
|
|
102
|
+
textArea.value = textArea.value.substr(0, parents[i].start) + parents[i].text + '\n' +
|
|
103
|
+
textArea.value.substr(parents[i].end, textArea.value.length);
|
|
104
|
+
}
|
|
105
|
+
start = i === 0 ? start + tabSpaceLength : start;
|
|
106
|
+
addedLength += tabSpaceLength;
|
|
107
|
+
if (parents.length !== 1) {
|
|
108
|
+
for (var j = i; j < parents.length; j++) {
|
|
109
|
+
parents[j].start = j !== 0 ? parents[j].start + tabSpaceLength : parents[j].start;
|
|
110
|
+
parents[j].end = parents[j].end + tabSpaceLength;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
this.restore(textArea, start, end + addedLength, event);
|
|
116
|
+
};
|
|
117
|
+
MDLists.prototype.changeTextAreaValue = function (splitText, prefixValue, event, textArea, parents, k, end) {
|
|
118
|
+
var prefix = prefixValue;
|
|
119
|
+
splitText.splice(0, 1);
|
|
120
|
+
var textAreaLength = this.selection.getAllParents(textArea.value).length;
|
|
121
|
+
var changedList = '';
|
|
122
|
+
var curTabSpace = this.getTabSpace(parents[k].text);
|
|
123
|
+
var prefixNumber = parseInt(prefix.split('.')[0], null);
|
|
124
|
+
var nestedTabSpace = this.getTabSpace(parents[k].text);
|
|
125
|
+
var nestedlistorder = true;
|
|
126
|
+
var nestedListStart = true;
|
|
127
|
+
var curTabSpaceLength;
|
|
128
|
+
var nextPrefixValue = -1;
|
|
129
|
+
var traversIncreased = true;
|
|
130
|
+
var nextLineLength = 0;
|
|
131
|
+
var lineBreak = '';
|
|
132
|
+
changedList = (this.selection.getLine(textArea, parents[0].line + 1) !== '') ?
|
|
133
|
+
'' : changedList + textArea.value.substr(parents[0].end, textArea.value.length);
|
|
134
|
+
for (var i = 1; i < textAreaLength &&
|
|
135
|
+
!ej2_base_2.isNullOrUndefined(this.selection.getLine(textArea, parents[0].line + i))
|
|
136
|
+
&& this.selection.getLine(textArea, parents[0].line + i) !== ''; i++) {
|
|
137
|
+
var nextLine = this.selection.getLine(textArea, parents[0].line + i);
|
|
138
|
+
var nextTabSpace = this.getTabSpace(nextLine);
|
|
139
|
+
var nextLineSplit = nextLine.split('. ');
|
|
140
|
+
if (nextLineSplit.length === 1) {
|
|
141
|
+
changedList += textArea.value.substr(parents[0].end + nextLineLength, textArea.value.length);
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
nextLineLength += nextLine.length;
|
|
146
|
+
var shiftTabTargetList = false;
|
|
147
|
+
curTabSpaceLength = event.event.shiftKey ? curTabSpace.length + 1 : curTabSpace.length - 1;
|
|
148
|
+
if (nextTabSpace.length > nestedTabSpace.length) {
|
|
149
|
+
traversIncreased = false;
|
|
150
|
+
}
|
|
151
|
+
if (curTabSpace.length !== nextTabSpace.length && nextTabSpace.length < nestedTabSpace.length) {
|
|
152
|
+
nestedListStart = true;
|
|
153
|
+
nestedlistorder = false;
|
|
154
|
+
shiftTabTargetList = event.event.shiftKey &&
|
|
155
|
+
curTabSpace.length === nextTabSpace.length ? (nestedListStart = false, true) : false;
|
|
156
|
+
}
|
|
157
|
+
else if (traversIncreased && event.event.shiftKey &&
|
|
158
|
+
curTabSpace.length === nextTabSpace.length && nextTabSpace.length === nestedTabSpace.length) {
|
|
159
|
+
nestedListStart = false;
|
|
160
|
+
shiftTabTargetList = true;
|
|
161
|
+
}
|
|
162
|
+
lineBreak = changedList === '' ? '' : '\n';
|
|
163
|
+
if (curTabSpaceLength === nextTabSpace.length && nestedListStart) {
|
|
164
|
+
var nextPrefix = event.event.shiftKey ?
|
|
165
|
+
(nextPrefixValue++, this.nextOrderedListValue(nextPrefixValue.toString()))
|
|
166
|
+
: this.previousOrderedListValue(nextLineSplit[0]);
|
|
167
|
+
nextLineSplit.splice(0, 1);
|
|
168
|
+
changedList = changedList + lineBreak + nextTabSpace + nextPrefix + nextLineSplit.join('. ');
|
|
169
|
+
}
|
|
170
|
+
else if (curTabSpace.length === nextTabSpace.length && nestedlistorder || shiftTabTargetList) {
|
|
171
|
+
var nextPrefix = this.nextOrderedListValue(prefixNumber.toString());
|
|
172
|
+
prefixNumber++;
|
|
173
|
+
nextLineSplit.splice(0, 1);
|
|
174
|
+
changedList = changedList + lineBreak + nextTabSpace + nextPrefix + nextLineSplit.join('. ');
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
changedList = changedList + lineBreak + nextLine;
|
|
178
|
+
nestedListStart = false;
|
|
179
|
+
}
|
|
180
|
+
nestedTabSpace = this.getTabSpace(nextLine);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
parents[k].text = this.getTabSpace(parents[k].text) + prefix + splitText.join('. ') + '\n';
|
|
184
|
+
textArea.value = textArea.value.substr(0, parents[k].start) + parents[k].text + changedList;
|
|
185
|
+
};
|
|
186
|
+
MDLists.prototype.getTabSpace = function (line) {
|
|
187
|
+
var split = line.split('\t');
|
|
188
|
+
var tabs = '';
|
|
189
|
+
for (var i = 0; i < split.length; i++) {
|
|
190
|
+
if (split[i] === '') {
|
|
191
|
+
tabs += '\t';
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return tabs;
|
|
198
|
+
};
|
|
199
|
+
MDLists.prototype.isNotFirstLine = function (textArea, points) {
|
|
200
|
+
var currentLine = points.text;
|
|
201
|
+
var prevIndex = points.line - 1;
|
|
202
|
+
var prevLine = this.selection.getLine(textArea, prevIndex);
|
|
203
|
+
var regex = this.getListRegex();
|
|
204
|
+
var isNotFirst = false;
|
|
205
|
+
var regexFirstCondition;
|
|
206
|
+
if (prevLine) {
|
|
207
|
+
this.currentAction = this.getAction(prevLine);
|
|
208
|
+
var prevLineSplit = prevLine.split('. ');
|
|
209
|
+
regexFirstCondition = this.currentAction === 'OL' ? /^\d+$/.test(prevLineSplit[0].trim()) : regex.test(prevLine.trim());
|
|
210
|
+
}
|
|
211
|
+
if (prevLine && regexFirstCondition) {
|
|
212
|
+
var curTabSpace = this.getTabSpace(currentLine);
|
|
213
|
+
var prevTabSpace = this.getTabSpace(prevLine);
|
|
214
|
+
isNotFirst = curTabSpace === prevTabSpace ? true : isNotFirst;
|
|
215
|
+
for (; prevTabSpace.length > curTabSpace.length; null) {
|
|
216
|
+
prevIndex = prevIndex - 1;
|
|
217
|
+
prevLine = this.selection.getLine(textArea, prevIndex);
|
|
218
|
+
var prevLineSplit = prevLine.trim().split('. ');
|
|
219
|
+
var regexSecondCondition = this.currentAction === 'OL' ?
|
|
220
|
+
/^\d+$/.test(prevLineSplit[0]) : regex.test(prevLine.trim());
|
|
221
|
+
if (regexSecondCondition) {
|
|
222
|
+
prevTabSpace = this.getTabSpace(prevLine);
|
|
223
|
+
if (prevTabSpace.length <= curTabSpace.length) {
|
|
224
|
+
isNotFirst = true;
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return isNotFirst;
|
|
231
|
+
};
|
|
232
|
+
MDLists.prototype.getAction = function (line) {
|
|
233
|
+
var ol = line.split('. ')[0];
|
|
234
|
+
var currentState = /^\d+$/.test(ol.trim());
|
|
235
|
+
var ul = line.trim().split(new RegExp('^(' + this.selection.replaceSpecialChar(this.syntax.UL).trim() + ')'))[1];
|
|
236
|
+
return (currentState ? 'OL' : ul ? 'UL' : 'NOTLIST');
|
|
237
|
+
};
|
|
238
|
+
MDLists.prototype.nextOrderedListValue = function (previousLine) {
|
|
239
|
+
var currentValue = parseInt(previousLine, null);
|
|
240
|
+
var nextValue = currentValue + 1;
|
|
241
|
+
return nextValue.toString() + '. ';
|
|
242
|
+
};
|
|
243
|
+
MDLists.prototype.previousOrderedListValue = function (previousLine) {
|
|
244
|
+
var currentValue = parseInt(previousLine, null);
|
|
245
|
+
var nextValue = currentValue - 1;
|
|
246
|
+
return nextValue.toString() + '. ';
|
|
247
|
+
};
|
|
248
|
+
MDLists.prototype.enterKey = function (event) {
|
|
249
|
+
var textArea = this.parent.element;
|
|
250
|
+
this.selection.save(textArea.selectionStart, textArea.selectionEnd);
|
|
251
|
+
var start = textArea.selectionStart;
|
|
252
|
+
var end = textArea.selectionEnd;
|
|
253
|
+
var parents = this.selection.getSelectedParentPoints(textArea);
|
|
254
|
+
var prevLine = this.selection.getLine(textArea, parents[0].line - 1);
|
|
255
|
+
var listFormat = this.olListType();
|
|
256
|
+
var regex = this.getListRegex();
|
|
257
|
+
var prevLineSplit = [];
|
|
258
|
+
if (!ej2_base_2.isNullOrUndefined(prevLine)) {
|
|
259
|
+
prevLineSplit = prevLine.split('. ');
|
|
260
|
+
this.currentAction = this.getAction(prevLine);
|
|
261
|
+
}
|
|
262
|
+
var addedLength = 0;
|
|
263
|
+
if (this.currentAction === 'OL' && prevLineSplit.length > 1 && /^\d+$/.test(prevLineSplit[0].trim()) && listFormat
|
|
264
|
+
&& prevLineSplit[1] !== '') {
|
|
265
|
+
var tabSpace = this.getTabSpace(prevLine);
|
|
266
|
+
this.currentAction = this.getAction(prevLine);
|
|
267
|
+
var prefix = this.nextOrderedListValue(prevLineSplit[0]);
|
|
268
|
+
parents[0].text = tabSpace + prefix + parents[0].text;
|
|
269
|
+
var textAreaLength = this.selection.getAllParents(textArea.value).length;
|
|
270
|
+
var changedList = '\n';
|
|
271
|
+
var curTabSpace = this.getTabSpace(prevLine);
|
|
272
|
+
var nestedTabSpace = this.getTabSpace(parents[0].text);
|
|
273
|
+
var nestedListOrder = true;
|
|
274
|
+
for (var i = 1; i < textAreaLength &&
|
|
275
|
+
textArea.value.substr(parents[0].end, textArea.value.length) !== ''; i++) {
|
|
276
|
+
var nextLine = this.selection.getLine(textArea, parents[0].line + i);
|
|
277
|
+
if (ej2_base_2.isNullOrUndefined(nextLine)) {
|
|
278
|
+
changedList = changedList + '';
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
var nextLineSplit = nextLine.split('. ');
|
|
282
|
+
var nextTabSpace = this.getTabSpace(nextLine);
|
|
283
|
+
if (nextTabSpace.length < nestedTabSpace.length) {
|
|
284
|
+
nestedListOrder = false;
|
|
285
|
+
}
|
|
286
|
+
if (nextLineSplit.length > 1 && /^\d+$/.test(nextLineSplit[0].trim()) &&
|
|
287
|
+
curTabSpace.length === nextTabSpace.length && nestedListOrder) {
|
|
288
|
+
var nextPrefix = this.nextOrderedListValue(nextLineSplit[0]);
|
|
289
|
+
nextLineSplit.splice(0, 1);
|
|
290
|
+
changedList = changedList + nextTabSpace + nextPrefix + nextLineSplit.join('. ') + '\n';
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
changedList = changedList + nextLine + '\n';
|
|
294
|
+
nestedTabSpace = this.getTabSpace(nextLine);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
textArea.value = textArea.value.substr(0, parents[0].start) + curTabSpace +
|
|
299
|
+
prefix + this.selection.getLine(textArea, parents[0].line) + changedList;
|
|
300
|
+
start = start + prefix.length + tabSpace.length;
|
|
301
|
+
addedLength += prefix.length + tabSpace.length;
|
|
302
|
+
}
|
|
303
|
+
else if (this.currentAction === 'UL' && (prevLine && regex.test(prevLine.trim())) &&
|
|
304
|
+
prevLine.trim().replace(regex, '') !== '' || this.currentAction === 'OL' && !listFormat && prevLineSplit[1] !== '') {
|
|
305
|
+
var tabSpace = this.getTabSpace(prevLine);
|
|
306
|
+
var prefix = this.syntax[this.currentAction];
|
|
307
|
+
parents[0].text = tabSpace + prefix + parents[0].text +
|
|
308
|
+
(parents[0].text.trim().length > 0 ? '\n' : '');
|
|
309
|
+
textArea.value = textArea.value.substr(0, parents[0].start) + parents[0].text +
|
|
310
|
+
textArea.value.substr(parents[0].end, textArea.value.length);
|
|
311
|
+
start = start + prefix.length + tabSpace.length;
|
|
312
|
+
addedLength += prefix.length + tabSpace.length;
|
|
313
|
+
}
|
|
314
|
+
this.restore(textArea, start, end + addedLength, event);
|
|
315
|
+
};
|
|
316
|
+
MDLists.prototype.olListType = function () {
|
|
317
|
+
var olSyntaxList = this.syntax.OL.split('.,');
|
|
318
|
+
var listType = olSyntaxList.length === 1 ? null :
|
|
319
|
+
parseInt(olSyntaxList[2].trim(), null) - parseInt(olSyntaxList[0].trim(), null);
|
|
320
|
+
if (listType) {
|
|
321
|
+
return 1;
|
|
322
|
+
}
|
|
323
|
+
else {
|
|
324
|
+
return 0;
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
MDLists.prototype.applyListsHandler = function (e) {
|
|
328
|
+
var textArea = this.parent.element;
|
|
329
|
+
this.selection.save(textArea.selectionStart, textArea.selectionEnd);
|
|
330
|
+
this.currentAction = e.subCommand;
|
|
331
|
+
var start = textArea.selectionStart;
|
|
332
|
+
var end = textArea.selectionEnd;
|
|
333
|
+
var addedLength = 0;
|
|
334
|
+
var startLength = 0;
|
|
335
|
+
var endLength = 0;
|
|
336
|
+
var parents = this.selection.getSelectedParentPoints(textArea);
|
|
337
|
+
var prefix = '';
|
|
338
|
+
var listFormat = this.olListType();
|
|
339
|
+
var regex;
|
|
340
|
+
var perfixObj = {};
|
|
341
|
+
for (var i = 0; i < parents.length; i++) {
|
|
342
|
+
if (listFormat) {
|
|
343
|
+
regex = this.currentAction === 'OL' ? i + listFormat + '. ' : this.syntax[this.currentAction];
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
regex = this.currentAction === 'OL' ? this.syntax.OL : this.syntax[this.currentAction];
|
|
347
|
+
}
|
|
348
|
+
if (!this.selection.isStartWith(parents[i].text, regex)) {
|
|
349
|
+
if (parents[i].text === '' && i === 0) {
|
|
350
|
+
this.selection.save(start, end);
|
|
351
|
+
if (parents.length !== 1) {
|
|
352
|
+
for (var j = i; j < parents.length; j++) {
|
|
353
|
+
parents[j].start = j !== 0 ? 1 + parents[j].start : parents[j].start;
|
|
354
|
+
parents[j].end = 1 + parents[j].end;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
var preLineTabSpaceLength = !ej2_base_2.isNullOrUndefined(parents[i - 1]) ?
|
|
359
|
+
this.getTabSpace(parents[i - 1].text).length : 0;
|
|
360
|
+
var replace = this.appliedLine(parents[i].text, regex, perfixObj, preLineTabSpaceLength);
|
|
361
|
+
prefix = replace.line ? prefix : regex;
|
|
362
|
+
parents[i].text = replace.line ? replace.line : prefix + parents[i].text;
|
|
363
|
+
replace.space = replace.space ? replace.space : 0;
|
|
364
|
+
textArea.value = textArea.value.substr(0, parents[i].start + endLength) + parents[i].text + '\n' +
|
|
365
|
+
textArea.value.substr(parents[i].end, textArea.value.length);
|
|
366
|
+
start = i === 0 ? (start + prefix.length + replace.space) > 0 ?
|
|
367
|
+
start + prefix.length + replace.space : 0 : start;
|
|
368
|
+
addedLength += prefix.length + replace.space;
|
|
369
|
+
if (parents.length !== 1) {
|
|
370
|
+
for (var j = i; j < parents.length; j++) {
|
|
371
|
+
parents[j].start = j !== 0 ? prefix.length +
|
|
372
|
+
parents[j].start + replace.space : parents[j].start;
|
|
373
|
+
parents[j].end = prefix.length + parents[j].end + replace.space;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
this.restore(textArea, start <= regex.length ? 0 : start, end + addedLength, null);
|
|
377
|
+
}
|
|
378
|
+
else {
|
|
379
|
+
parents[i].text = parents[i].text.replace(regex, '');
|
|
380
|
+
textArea.value = textArea.value.substr(0, parents[i].start + endLength) + parents[i].text + '\n' +
|
|
381
|
+
textArea.value.substr(parents[i].end + endLength, textArea.value.length);
|
|
382
|
+
endLength -= regex.length;
|
|
383
|
+
startLength = regex.length;
|
|
384
|
+
this.restore(textArea, start - startLength, end + endLength, null);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
this.restore(textArea, null, null, e);
|
|
388
|
+
};
|
|
389
|
+
MDLists.prototype.appliedLine = function (line, prefixPattern, perfixObj, preTabSpaceLength) {
|
|
390
|
+
var points = {};
|
|
391
|
+
var regex = new RegExp('^[' + this.syntax.UL.trim() + ']');
|
|
392
|
+
var lineSplit = line.split('. ');
|
|
393
|
+
var currentPrefix = lineSplit[0] + '. ';
|
|
394
|
+
var isExist = regex.test(line.trim()) || line.trim() === this.syntax.OL.trim()
|
|
395
|
+
|| line.trim() === this.syntax.UL.trim() || /^\d+$/.test(lineSplit[0].trim());
|
|
396
|
+
var listFormat = this.olListType();
|
|
397
|
+
var curTabSpaceLength = this.getTabSpace(line).length;
|
|
398
|
+
if (this.currentAction === 'OL' && listFormat) {
|
|
399
|
+
perfixObj[curTabSpaceLength.toString()] = !ej2_base_2.isNullOrUndefined(perfixObj[curTabSpaceLength.toString()]) ?
|
|
400
|
+
perfixObj[curTabSpaceLength.toString()].valueOf() + 1 : 1;
|
|
401
|
+
prefixPattern = perfixObj[curTabSpaceLength.toString()].valueOf().toString() + '. ';
|
|
402
|
+
if (!ej2_base_2.isNullOrUndefined(preTabSpaceLength) && preTabSpaceLength > curTabSpaceLength) {
|
|
403
|
+
perfixObj[preTabSpaceLength.toString()] = 0;
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
if (isExist) {
|
|
407
|
+
var replace = void 0;
|
|
408
|
+
var pattern = void 0;
|
|
409
|
+
var space = 0;
|
|
410
|
+
if (regex.test(line.trim())) {
|
|
411
|
+
pattern = this.syntax.UL;
|
|
412
|
+
replace = prefixPattern;
|
|
413
|
+
points.space = prefixPattern.trim().length - this.syntax.UL.trim().length;
|
|
414
|
+
}
|
|
415
|
+
else if (/^\d+$/.test(lineSplit[0].trim()) && listFormat) {
|
|
416
|
+
pattern = lineSplit[0].trim() + '. ';
|
|
417
|
+
replace = prefixPattern;
|
|
418
|
+
points.space = this.syntax.UL.trim().length - currentPrefix.trim().length;
|
|
419
|
+
}
|
|
420
|
+
else if (/^\d+$/.test(lineSplit[0].trim())) {
|
|
421
|
+
pattern = lineSplit[0].trim() + '. ';
|
|
422
|
+
replace = this.syntax.UL;
|
|
423
|
+
points.space = this.syntax.UL.trim().length - currentPrefix.trim().length;
|
|
424
|
+
}
|
|
425
|
+
points.line = line.replace(pattern, replace);
|
|
426
|
+
}
|
|
427
|
+
return points;
|
|
428
|
+
};
|
|
429
|
+
MDLists.prototype.restore = function (textArea, start, end, event) {
|
|
430
|
+
if (!ej2_base_2.isNullOrUndefined(start) && !ej2_base_2.isNullOrUndefined(start)) {
|
|
431
|
+
this.selection.save(start, end);
|
|
432
|
+
}
|
|
433
|
+
if (!ej2_base_2.isNullOrUndefined(event)) {
|
|
434
|
+
this.selection.restore(textArea);
|
|
435
|
+
}
|
|
436
|
+
if (event && event.callBack) {
|
|
437
|
+
event.callBack({
|
|
438
|
+
requestType: this.currentAction,
|
|
439
|
+
selectedText: this.selection.getSelectedText(textArea),
|
|
440
|
+
editorMode: 'Markdown',
|
|
441
|
+
event: event.event
|
|
442
|
+
});
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
MDLists.prototype.getListRegex = function () {
|
|
446
|
+
var regex = '';
|
|
447
|
+
var configKey = Object.keys(this.syntax);
|
|
448
|
+
var regExp = RegExp;
|
|
449
|
+
for (var j = 0; j < configKey.length; j++) {
|
|
450
|
+
var syntax = this.selection.replaceSpecialChar(this.syntax[configKey[j]]);
|
|
451
|
+
regex += regex === '' ? '^(' + syntax + ')|^(' + syntax.trim() + ')' :
|
|
452
|
+
'|^(' + syntax + ')|^(' + syntax.trim() + ')';
|
|
453
|
+
}
|
|
454
|
+
return new regExp(regex);
|
|
455
|
+
};
|
|
456
|
+
MDLists.prototype.destroy = function () {
|
|
457
|
+
this.removeEventListener();
|
|
458
|
+
};
|
|
459
|
+
return MDLists;
|
|
460
|
+
}());
|
|
461
|
+
exports.MDLists = MDLists;
|
|
462
|
+
});
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MarkdownSelection internal module
|
|
3
|
+
*
|
|
4
|
+
* @hidden
|
|
5
|
+
* @deprecated
|
|
6
|
+
*/
|
|
7
|
+
export declare class MarkdownSelection {
|
|
8
|
+
selectionStart: number;
|
|
9
|
+
selectionEnd: number;
|
|
10
|
+
/**
|
|
11
|
+
* markdown getLineNumber method
|
|
12
|
+
*
|
|
13
|
+
* @param {HTMLTextAreaElement} textarea - specifies the text area element
|
|
14
|
+
* @param {number} point - specifies the number value
|
|
15
|
+
* @returns {number} - returns the value
|
|
16
|
+
* @hidden
|
|
17
|
+
* @deprecated
|
|
18
|
+
*/
|
|
19
|
+
getLineNumber(textarea: HTMLTextAreaElement, point: number): number;
|
|
20
|
+
/**
|
|
21
|
+
* markdown getSelectedText method
|
|
22
|
+
*
|
|
23
|
+
* @param {HTMLTextAreaElement} textarea - specifies the text area element
|
|
24
|
+
* @returns {string} - specifies the string value
|
|
25
|
+
* @hidden
|
|
26
|
+
* @deprecated
|
|
27
|
+
*/
|
|
28
|
+
getSelectedText(textarea: HTMLTextAreaElement): string;
|
|
29
|
+
/**
|
|
30
|
+
* markdown getAllParents method
|
|
31
|
+
*
|
|
32
|
+
* @param {string} value - specifies the string value
|
|
33
|
+
* @returns {string[]} - returns the string value
|
|
34
|
+
* @hidden
|
|
35
|
+
* @deprecated
|
|
36
|
+
*/
|
|
37
|
+
getAllParents(value: string): string[];
|
|
38
|
+
/**
|
|
39
|
+
* markdown getSelectedLine method
|
|
40
|
+
*
|
|
41
|
+
* @param {HTMLTextAreaElement} textarea - specifies the text area element
|
|
42
|
+
* @returns {string} - returns the string value
|
|
43
|
+
* @hidden
|
|
44
|
+
* @deprecated
|
|
45
|
+
*/
|
|
46
|
+
getSelectedLine(textarea: HTMLTextAreaElement): string;
|
|
47
|
+
/**
|
|
48
|
+
* markdown getLine method
|
|
49
|
+
*
|
|
50
|
+
* @param {HTMLTextAreaElement} textarea - specifies the text area element
|
|
51
|
+
* @param {number} index - specifies the number value
|
|
52
|
+
* @returns {string} - returns the string value
|
|
53
|
+
* @hidden
|
|
54
|
+
* @deprecated
|
|
55
|
+
*/
|
|
56
|
+
getLine(textarea: HTMLTextAreaElement, index: number): string;
|
|
57
|
+
/**
|
|
58
|
+
* markdown getSelectedParentPoints method
|
|
59
|
+
*
|
|
60
|
+
* @param {HTMLTextAreaElement} textarea - specifies the text area element
|
|
61
|
+
* @returns {string} - returns the string value
|
|
62
|
+
* @hidden
|
|
63
|
+
* @deprecated
|
|
64
|
+
*/
|
|
65
|
+
getSelectedParentPoints(textarea: HTMLTextAreaElement): {
|
|
66
|
+
[key: string]: string | number;
|
|
67
|
+
}[];
|
|
68
|
+
/**
|
|
69
|
+
* markdown setSelection method
|
|
70
|
+
*
|
|
71
|
+
* @param {HTMLTextAreaElement} textarea - specifies the text area element
|
|
72
|
+
* @param {number} start - specifies the start vaulue
|
|
73
|
+
* @param {number} end - specifies the end value
|
|
74
|
+
* @returns {void}
|
|
75
|
+
* @hidden
|
|
76
|
+
* @deprecated
|
|
77
|
+
*/
|
|
78
|
+
setSelection(textarea: HTMLTextAreaElement, start: number, end: number): void;
|
|
79
|
+
/**
|
|
80
|
+
* markdown save method
|
|
81
|
+
*
|
|
82
|
+
* @param {number} start - specifies the start vaulue
|
|
83
|
+
* @param {number} end - specifies the end value
|
|
84
|
+
* @returns {void}
|
|
85
|
+
* @hidden
|
|
86
|
+
* @deprecated
|
|
87
|
+
*/
|
|
88
|
+
save(start: number, end: number): void;
|
|
89
|
+
/**
|
|
90
|
+
* markdown restore method
|
|
91
|
+
*
|
|
92
|
+
* @param {HTMLTextAreaElement} textArea - specifies the text area element
|
|
93
|
+
* @returns {void}
|
|
94
|
+
* @hidden
|
|
95
|
+
* @deprecated
|
|
96
|
+
*/
|
|
97
|
+
restore(textArea: HTMLTextAreaElement): void;
|
|
98
|
+
/**
|
|
99
|
+
* markdown isStartWith method
|
|
100
|
+
*
|
|
101
|
+
* @param {string} line - specifies the string value
|
|
102
|
+
* @param {string} command - specifies the string value
|
|
103
|
+
* @returns {boolean} - returns the boolean value
|
|
104
|
+
* @hidden
|
|
105
|
+
* @deprecated
|
|
106
|
+
*/
|
|
107
|
+
isStartWith(line: string, command: string): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* markdown replaceSpecialChar method
|
|
110
|
+
*
|
|
111
|
+
* @param {string} value - specifies the string value
|
|
112
|
+
* @returns {string} - returns the value
|
|
113
|
+
* @hidden
|
|
114
|
+
* @deprecated
|
|
115
|
+
*/
|
|
116
|
+
replaceSpecialChar(value: string): string;
|
|
117
|
+
/**
|
|
118
|
+
* markdown isClear method
|
|
119
|
+
*
|
|
120
|
+
* @param {string} parents - specifies the parent element
|
|
121
|
+
* @param {string} regex - specifies the regex value
|
|
122
|
+
* @returns {boolean} - returns the boolean value
|
|
123
|
+
* @hidden
|
|
124
|
+
* @deprecated
|
|
125
|
+
*/
|
|
126
|
+
isClear(parents: {
|
|
127
|
+
[key: string]: string | number;
|
|
128
|
+
}[], regex: string): boolean;
|
|
129
|
+
/**
|
|
130
|
+
* markdown getSelectedInlinePoints method
|
|
131
|
+
*
|
|
132
|
+
* @param {HTMLTextAreaElement} textarea - specifies the text area
|
|
133
|
+
* @returns {void}
|
|
134
|
+
* @hidden
|
|
135
|
+
* @deprecated
|
|
136
|
+
*/
|
|
137
|
+
getSelectedInlinePoints(textarea: HTMLTextAreaElement): {
|
|
138
|
+
[key: string]: string | number;
|
|
139
|
+
};
|
|
140
|
+
}
|