jodit 3.18.8 → 3.19.2
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/README.md +29 -2
- package/build/jodit.es2018.en.css +125 -124
- package/build/jodit.es2018.en.js +28267 -23413
- package/build/plugins/{speech/speech-recognize → speech-recognize}/speech-recognize.es2018.en.css +1 -1
- package/build/plugins/{speech/speech-recognize/speech-recognize.js → speech-recognize/speech-recognize.es2018.en.js} +139 -128
- package/package.json +22 -22
- package/src/config.ts +75 -0
- package/src/core/constants.ts +3 -0
- package/src/core/dom/dom.ts +34 -0
- package/src/core/helpers/helpers.test.js +31 -25
- package/src/core/helpers/string/i18n.ts +4 -6
- package/src/core/helpers/utils/align.ts +83 -0
- package/src/core/helpers/utils/default-language.ts +1 -1
- package/src/core/helpers/utils/index.ts +11 -9
- package/src/core/helpers/utils/mark-deprecated.ts +1 -1
- package/src/core/helpers/utils/parse-query.ts +1 -1
- package/src/{plugins/print/helpers.ts → core/helpers/utils/print.ts} +6 -2
- package/src/core/helpers/utils/utils.ts +19 -1
- package/src/core/plugin/plugin-system.ts +23 -7
- package/src/core/request/ajax.ts +9 -3
- package/src/core/ui/icon.ts +11 -3
- package/src/index.ts +2 -8
- package/src/langs/ar.js +0 -4
- package/src/langs/cs_cz.js +0 -4
- package/src/langs/de.js +0 -4
- package/src/langs/es.js +0 -4
- package/src/langs/fa.js +0 -4
- package/src/langs/fr.js +0 -4
- package/src/langs/he.js +0 -4
- package/src/langs/hu.js +0 -4
- package/src/langs/id.js +0 -4
- package/src/langs/index.ts +24 -25
- package/src/langs/it.js +0 -4
- package/src/langs/ja.js +0 -4
- package/src/langs/ko.js +0 -4
- package/src/langs/nl.js +0 -4
- package/src/langs/pl.js +0 -4
- package/src/langs/pt_br.js +0 -4
- package/src/langs/ru.js +0 -4
- package/src/langs/tr.js +0 -4
- package/src/langs/zh_cn.js +0 -4
- package/src/langs/zh_tw.js +0 -4
- package/src/modules/dialog/dialog.test.js +2 -0
- package/src/modules/file-browser/config.ts +3 -2
- package/src/modules/file-browser/file-browser.ts +2 -7
- package/src/modules/image-editor/config.ts +6 -0
- package/src/{styles → modules/image-editor}/icons/crop.svg +0 -0
- package/src/{styles → modules/image-editor}/icons/resize.svg +0 -0
- package/src/modules/table/table.test.js +0 -906
- package/src/modules/widget/color-picker/color-picker.ts +2 -0
- package/src/{styles/icons → modules/widget/color-picker}/palette.svg +0 -0
- package/src/modules/widget/file-selector/file-selector.ts +1 -1
- package/src/{styles/icons → plugins/about}/about.svg +0 -0
- package/src/plugins/about/about.ts +6 -1
- package/src/plugins/add-new-line/add-new-line.test.js +219 -0
- package/src/plugins/add-new-line/add-new-line.ts +3 -0
- package/src/plugins/add-new-line/config.ts +3 -0
- package/src/{styles/icons → plugins/add-new-line}/enter.svg +0 -0
- package/src/plugins/{keyboard/backspace → backspace}/backspace.test.js +0 -0
- package/src/plugins/{keyboard/backspace → backspace}/backspace.ts +10 -9
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-join-neighbors.ts +7 -4
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-join-two-lists.ts +6 -2
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-not-collapsed.ts +4 -0
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-remove-char.ts +7 -2
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-remove-content-not-editable.ts +5 -0
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-remove-empty-neighbor.ts +6 -3
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-remove-empty-parent.ts +11 -3
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-remove-unbreakable-element.ts +7 -2
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-table-cell.ts +5 -1
- package/src/plugins/{keyboard/backspace → backspace}/cases/check-unwrap-first-list-item.ts +5 -1
- package/src/plugins/{keyboard/backspace → backspace}/cases/index.ts +4 -0
- package/src/plugins/{keyboard/backspace → backspace}/config.ts +0 -0
- package/src/plugins/{keyboard → backspace}/helpers.ts +1 -36
- package/src/plugins/{keyboard/backspace → backspace}/interface.d.ts +0 -0
- package/src/plugins/bold/bold.ts +11 -0
- package/src/{styles → plugins/bold}/icons/bold.svg +0 -0
- package/src/{styles → plugins/bold}/icons/italic.svg +0 -0
- package/src/{styles → plugins/bold}/icons/strikethrough.svg +0 -0
- package/src/{styles → plugins/bold}/icons/subscript.svg +0 -0
- package/src/{styles → plugins/bold}/icons/superscript.svg +0 -0
- package/src/{styles → plugins/bold}/icons/underline.svg +0 -0
- package/src/plugins/class-span/{icon.svg → class-span.svg} +0 -0
- package/src/plugins/class-span/class-span.ts +5 -2
- package/src/plugins/{fix/clean-html → clean-html}/README.md +0 -0
- package/src/plugins/{fix/clean-html → clean-html}/clean-html.test.js +0 -0
- package/src/plugins/{fix/clean-html → clean-html}/clean-html.ts +7 -3
- package/src/plugins/{fix/clean-html → clean-html}/config.ts +4 -1
- package/src/{styles/icons → plugins/clean-html}/eraser.svg +0 -0
- package/src/plugins/{fix/clean-html → clean-html}/helpers/get-hash.ts +3 -2
- package/src/plugins/{fix/clean-html → clean-html}/helpers/index.ts +1 -1
- package/src/plugins/{fix/clean-html → clean-html}/helpers/remove-format/remove-format-for-collapsed-selection.ts +1 -1
- package/src/plugins/{fix/clean-html → clean-html}/helpers/remove-format/remove-format-for-selection.ts +3 -3
- package/src/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/allow-attributes.ts +1 -1
- package/src/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/fill-empty-paragraph.ts +1 -1
- package/src/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/index.ts +1 -1
- package/src/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/remove-inv-text-nodes.ts +1 -1
- package/src/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/replace-old-tags.ts +1 -1
- package/src/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/sanitize-attributes.ts +2 -2
- package/src/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/try-remove-node.ts +7 -36
- package/src/plugins/{fix/clean-html → clean-html}/helpers/visitor/visit-node-walker.ts +3 -2
- package/src/plugins/clipboard/clipboard.ts +19 -10
- package/src/plugins/clipboard/config.ts +6 -0
- package/src/{styles → plugins/clipboard}/icons/copy.svg +0 -0
- package/src/{styles → plugins/clipboard}/icons/cut.svg +0 -0
- package/src/{styles → plugins/clipboard}/icons/paste.svg +0 -0
- package/src/{styles → plugins/clipboard}/icons/select-all.svg +0 -0
- package/src/{styles/icons → plugins/color}/brush.svg +0 -0
- package/src/plugins/color/color.ts +6 -169
- package/src/plugins/color/config.ts +183 -0
- package/src/{styles/icons/copyformat.svg → plugins/copy-format/copy-format.svg} +0 -0
- package/src/plugins/copy-format/copy-format.test.js +223 -0
- package/src/plugins/{clipboard → copy-format}/copy-format.ts +10 -3
- package/src/plugins/copy-format/langs/ar.js +9 -0
- package/src/plugins/copy-format/langs/cs_cz.js +9 -0
- package/src/plugins/copy-format/langs/de.js +9 -0
- package/src/plugins/copy-format/langs/es.js +9 -0
- package/src/plugins/copy-format/langs/fa.js +9 -0
- package/src/plugins/copy-format/langs/fr.js +9 -0
- package/src/plugins/copy-format/langs/he.js +9 -0
- package/src/plugins/{speech/speech-recognize → copy-format}/langs/hu.js +1 -3
- package/src/plugins/{speech/speech-recognize → copy-format}/langs/id.js +1 -3
- package/src/plugins/{speech/speech-recognize → copy-format}/langs/index.ts +0 -0
- package/src/plugins/copy-format/langs/it.js +9 -0
- package/src/plugins/copy-format/langs/ja.js +9 -0
- package/src/plugins/copy-format/langs/ko.js +9 -0
- package/src/plugins/copy-format/langs/nl.js +9 -0
- package/src/plugins/copy-format/langs/pl.js +9 -0
- package/src/plugins/{speech/speech-recognize → copy-format}/langs/pt_br.js +1 -3
- package/src/plugins/copy-format/langs/ru.js +9 -0
- package/src/plugins/copy-format/langs/tr.js +9 -0
- package/src/plugins/{speech/speech-recognize → copy-format}/langs/zh_cn.js +1 -3
- package/src/plugins/copy-format/langs/zh_tw.js +9 -0
- package/src/plugins/{clipboard/drag-and-drop → drag-and-drop}/drag-and-drop.ts +6 -4
- package/src/plugins/drag-and-drop-element/config.ts +22 -0
- package/src/plugins/{clipboard/drag-and-drop-element → drag-and-drop-element}/drag-and-drop-element.test.js +0 -0
- package/src/plugins/{clipboard/drag-and-drop-element → drag-and-drop-element}/drag-and-drop-element.ts +7 -3
- package/src/plugins/{keyboard/enter → enter}/README.md +0 -0
- package/src/plugins/{keyboard/enter → enter}/enter.test.js +0 -0
- package/src/plugins/{keyboard/enter → enter}/enter.ts +7 -3
- package/src/plugins/{keyboard/enter → enter}/helpers/check-br.ts +1 -1
- package/src/plugins/{keyboard/enter → enter}/helpers/check-unsplittable-box.ts +1 -1
- package/src/plugins/{keyboard/enter → enter}/helpers/get-block-wrapper.ts +1 -1
- package/src/plugins/{keyboard/enter → enter}/helpers/has-previous-block.ts +1 -1
- package/src/plugins/{keyboard/enter → enter}/helpers/index.ts +1 -1
- package/src/plugins/{keyboard/enter → enter}/helpers/insert-paragraph.ts +1 -1
- package/src/plugins/{keyboard/enter → enter}/helpers/process-empty-li-leaf.ts +2 -1
- package/src/plugins/{keyboard/enter → enter}/helpers/split-fragment.ts +3 -2
- package/src/plugins/{keyboard/enter → enter}/helpers/wrap-text.ts +1 -1
- package/src/plugins/error-messages/error-messages.ts +3 -0
- package/src/plugins/{media → file}/file.ts +5 -2
- package/src/plugins/focus/focus.ts +3 -0
- package/src/plugins/font/config.ts +151 -0
- package/src/plugins/font/font.ts +6 -134
- package/src/{styles → plugins/font}/icons/font.svg +0 -0
- package/src/{styles → plugins/font}/icons/fontsize.svg +0 -0
- package/src/plugins/format-block/format-block.ts +6 -0
- package/src/{styles/icons → plugins/format-block}/paragraph.svg +0 -0
- package/src/plugins/fullsize/config.ts +73 -0
- package/src/plugins/fullsize/fullsize.test.js +35 -0
- package/src/plugins/fullsize/fullsize.ts +5 -54
- package/src/{styles → plugins/fullsize}/icons/fullsize.svg +0 -0
- package/src/{styles → plugins/fullsize}/icons/shrink.svg +0 -0
- package/src/plugins/hotkeys/config.ts +38 -0
- package/src/plugins/hotkeys/hotkeys.test.js +136 -0
- package/src/plugins/{keyboard → hotkeys}/hotkeys.ts +6 -28
- package/src/{styles/icons → plugins/hr}/hr.svg +0 -0
- package/src/plugins/{insert/insert.test.js → hr/hr.test.js} +0 -0
- package/src/plugins/{insert → hr}/hr.ts +7 -1
- package/src/plugins/iframe/config.ts +0 -21
- package/src/plugins/iframe/iframe.ts +3 -0
- package/src/{styles/icons → plugins/image}/image.svg +0 -0
- package/src/plugins/image/image.ts +6 -0
- package/src/plugins/{image/image-processor → image-processor}/README.md +0 -0
- package/src/plugins/{image/image-processor → image-processor}/config.ts +0 -0
- package/src/plugins/{image/image-processor → image-processor}/image-processor.ts +5 -2
- package/src/plugins/{image/image-properties → image-properties}/config.ts +1 -1
- package/src/plugins/{image/image-properties → image-properties}/image-properties.less +1 -1
- package/src/plugins/image-properties/image-properties.test.js +548 -0
- package/src/plugins/{image/image-properties → image-properties}/image-properties.ts +23 -15
- package/src/plugins/{image/image-properties → image-properties}/templates/form.ts +2 -2
- package/src/plugins/{image/image-properties → image-properties}/templates/main-tab.ts +2 -2
- package/src/plugins/{image/image-properties → image-properties}/templates/position-tab.ts +2 -2
- package/src/plugins/indent/config.ts +57 -0
- package/src/plugins/indent/helpers.ts +23 -0
- package/src/{styles → plugins/indent}/icons/indent.svg +0 -0
- package/src/{styles → plugins/indent}/icons/outdent.svg +0 -0
- package/src/plugins/indent/indent.ts +6 -48
- package/src/plugins/index.ts +61 -53
- package/src/plugins/inline-popup/config/config.ts +9 -0
- package/src/plugins/inline-popup/config/items/img.ts +10 -7
- package/src/{styles → plugins/inline-popup}/icons/addcolumn.svg +0 -0
- package/src/{styles → plugins/inline-popup}/icons/addrow.svg +0 -0
- package/src/{styles → plugins/inline-popup}/icons/merge.svg +0 -0
- package/src/{styles → plugins/inline-popup}/icons/splitg.svg +0 -0
- package/src/{styles → plugins/inline-popup}/icons/splitv.svg +0 -0
- package/src/{styles → plugins/inline-popup}/icons/th-list.svg +0 -0
- package/src/{styles → plugins/inline-popup}/icons/th.svg +0 -0
- package/src/plugins/inline-popup/inline-popup.ts +5 -1
- package/src/{styles/icons → plugins/justify}/justify.svg +0 -0
- package/src/plugins/justify/justify.ts +9 -46
- package/src/plugins/{keyboard → key-arrow-outside}/key-arrow-outside.ts +6 -4
- package/src/plugins/limit/config.ts +30 -0
- package/src/plugins/limit/limit.ts +4 -23
- package/src/plugins/line-height/config.ts +3 -1
- package/src/plugins/line-height/langs/ar.js +9 -0
- package/src/plugins/line-height/langs/cs_cz.js +9 -0
- package/src/plugins/line-height/langs/de.js +9 -0
- package/src/plugins/line-height/langs/es.js +9 -0
- package/src/plugins/line-height/langs/fa.js +9 -0
- package/src/plugins/line-height/langs/fr.js +9 -0
- package/src/plugins/line-height/langs/he.js +9 -0
- package/src/plugins/line-height/langs/hu.js +9 -0
- package/src/plugins/line-height/langs/id.js +9 -0
- package/src/plugins/line-height/langs/index.ts +47 -0
- package/src/plugins/line-height/langs/it.js +9 -0
- package/src/plugins/line-height/langs/ja.js +9 -0
- package/src/plugins/line-height/langs/ko.js +9 -0
- package/src/plugins/line-height/langs/nl.js +9 -0
- package/src/plugins/line-height/langs/pl.js +9 -0
- package/src/plugins/line-height/langs/pt_br.js +9 -0
- package/src/plugins/line-height/langs/ru.js +9 -0
- package/src/plugins/line-height/langs/tr.js +9 -0
- package/src/plugins/line-height/langs/zh_cn.js +9 -0
- package/src/plugins/line-height/langs/zh_tw.js +9 -0
- package/src/{styles/icons → plugins/line-height}/line-height.svg +0 -0
- package/src/plugins/line-height/line-height.ts +12 -3
- package/src/plugins/link/config.ts +6 -0
- package/src/{styles → plugins/link}/icons/link.svg +0 -0
- package/src/{styles → plugins/link}/icons/unlink.svg +0 -0
- package/src/plugins/link/link.ts +5 -1
- package/src/plugins/media/config.ts +30 -0
- package/src/plugins/media/media.ts +5 -24
- package/src/plugins/mobile/mobile.ts +3 -0
- package/src/plugins/ordered-list/config.ts +4 -1
- package/src/{styles → plugins/ordered-list}/icons/ol.svg +0 -0
- package/src/{styles → plugins/ordered-list}/icons/ul.svg +0 -0
- package/src/plugins/ordered-list/ordered-list.ts +3 -0
- package/src/plugins/{clipboard/paste → paste}/README.md +0 -0
- package/src/plugins/{clipboard/paste → paste}/config.ts +5 -12
- package/src/plugins/{clipboard/paste → paste}/helpers.ts +6 -25
- package/src/plugins/{clipboard/paste → paste}/interface.ts +3 -14
- package/src/plugins/{clipboard/paste → paste}/paste.test.js +0 -0
- package/src/plugins/{clipboard/paste → paste}/paste.ts +20 -23
- package/src/plugins/{clipboard/paste-from-word → paste-from-word}/README.md +0 -0
- package/src/plugins/{clipboard/paste-from-word → paste-from-word}/config.ts +2 -3
- package/src/plugins/{clipboard/paste-from-word → paste-from-word}/paste-from-word.ts +15 -16
- package/src/plugins/{clipboard/paste-storage → paste-storage}/paste-storage.less +1 -1
- package/src/plugins/paste-storage/paste-storage.test.js +231 -0
- package/src/plugins/{clipboard/paste-storage → paste-storage}/paste-storage.ts +8 -5
- package/src/plugins/placeholder/placeholder.ts +4 -1
- package/src/plugins/plugins.test.js +0 -2141
- package/src/plugins/powered-by-jodit/powered-by-jodit.ts +9 -5
- package/src/plugins/{print/preview → preview}/preview.less +1 -1
- package/src/plugins/{print/preview → preview}/preview.test.js +0 -0
- package/src/plugins/{print/preview → preview}/preview.ts +4 -1
- package/src/plugins/print/lib/generate-critical-css.ts +3 -0
- package/src/{styles/icons → plugins/print}/print.svg +0 -0
- package/src/plugins/print/print.ts +10 -3
- package/src/{styles → plugins/redo-undo}/icons/redo.svg +0 -0
- package/src/{styles → plugins/redo-undo}/icons/undo.svg +0 -0
- package/src/plugins/redo-undo/redo-undo.ts +10 -1
- package/src/plugins/resize-cells/config.ts +19 -0
- package/src/plugins/resize-cells/resize-cells.less +27 -0
- package/src/plugins/resize-cells/resize-cells.test.js +890 -0
- package/src/plugins/{table → resize-cells}/resize-cells.ts +10 -4
- package/src/plugins/resize-handler/config.ts +21 -0
- package/src/plugins/{size → resize-handler}/resize-handler.ts +5 -0
- package/src/plugins/resizer/config.ts +1 -1
- package/src/plugins/resizer/resizer.ts +6 -2
- package/src/plugins/search/config.ts +3 -0
- package/src/plugins/search/helpers/sentence-finder.ts +1 -1
- package/src/plugins/search/helpers/wrap-ranges-texts-in-tmp-span.ts +1 -1
- package/src/{styles/icons → plugins/search}/search.svg +0 -0
- package/src/plugins/search/search.ts +7 -3
- package/src/plugins/select/config.ts +1 -1
- package/src/plugins/select/select.ts +6 -7
- package/src/plugins/select-cells/config.ts +19 -0
- package/src/plugins/{table → select-cells}/select-cells.ts +10 -5
- package/src/plugins/size/config.ts +0 -56
- package/src/plugins/size/size.test.js +27 -0
- package/src/plugins/size/size.ts +6 -1
- package/src/plugins/source/config.ts +9 -7
- package/src/plugins/source/editor/engines/ace.ts +8 -5
- package/src/plugins/source/editor/engines/area.ts +3 -2
- package/src/plugins/source/editor/engines/custom.ts +1 -0
- package/src/plugins/source/editor/factory.ts +2 -1
- package/src/{styles/icons → plugins/source}/source.svg +0 -0
- package/src/plugins/source/source.ts +9 -4
- package/src/plugins/{speech/speech-recognize → speech-recognize}/README.md +4 -4
- package/src/plugins/{speech/speech-recognize → speech-recognize}/config.ts +5 -3
- package/src/plugins/{speech/speech-recognize → speech-recognize}/constants.ts +2 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/helpers/api.ts +1 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/helpers/exec-spell-command.ts +1 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/helpers/recognize-manager.ts +5 -7
- package/src/plugins/{speech/speech-recognize → speech-recognize}/helpers/sound.ts +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/interface.ts +1 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/ar.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/cs_cz.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/de.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/es.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/fa.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/fr.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/he.js +4 -1
- package/src/plugins/speech-recognize/langs/hu.js +14 -0
- package/src/plugins/speech-recognize/langs/id.js +14 -0
- package/src/plugins/speech-recognize/langs/index.ts +47 -0
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/it.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/ja.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/ko.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/nl.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/pl.js +4 -1
- package/src/plugins/speech-recognize/langs/pt_br.js +14 -0
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/ru.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/tr.js +4 -1
- package/src/plugins/speech-recognize/langs/zh_cn.js +14 -0
- package/src/plugins/{speech/speech-recognize → speech-recognize}/langs/zh_tw.js +4 -1
- package/src/plugins/{speech/speech-recognize → speech-recognize}/speech-recognize.less +2 -2
- package/src/plugins/{speech/speech-recognize/icon.svg → speech-recognize/speech-recognize.svg} +0 -0
- package/src/plugins/{speech/speech-recognize → speech-recognize}/speech-recognize.ts +2 -2
- package/src/plugins/spellcheck/config.ts +4 -1
- package/src/plugins/spellcheck/langs/ar.js +9 -0
- package/src/plugins/spellcheck/langs/cs_cz.js +9 -0
- package/src/plugins/spellcheck/langs/de.js +9 -0
- package/src/plugins/spellcheck/langs/es.js +9 -0
- package/src/plugins/spellcheck/langs/fa.js +9 -0
- package/src/plugins/spellcheck/langs/fr.js +9 -0
- package/src/plugins/spellcheck/langs/he.js +9 -0
- package/src/plugins/spellcheck/langs/hu.js +9 -0
- package/src/plugins/spellcheck/langs/id.js +9 -0
- package/src/plugins/spellcheck/langs/index.ts +47 -0
- package/src/plugins/spellcheck/langs/it.js +9 -0
- package/src/plugins/spellcheck/langs/ja.js +9 -0
- package/src/plugins/spellcheck/langs/ko.js +9 -0
- package/src/plugins/spellcheck/langs/nl.js +9 -0
- package/src/plugins/spellcheck/langs/pl.js +9 -0
- package/src/plugins/spellcheck/langs/pt_br.js +9 -0
- package/src/plugins/spellcheck/langs/ru.js +9 -0
- package/src/plugins/spellcheck/langs/tr.js +9 -0
- package/src/plugins/spellcheck/langs/zh_cn.js +9 -0
- package/src/plugins/spellcheck/langs/zh_tw.js +9 -0
- package/src/plugins/spellcheck/spellcheck.ts +8 -0
- package/src/plugins/stat/config.ts +23 -0
- package/src/plugins/stat/stat.ts +6 -14
- package/src/plugins/sticky/config.ts +44 -0
- package/src/plugins/sticky/sticky.test.js +201 -0
- package/src/plugins/sticky/sticky.ts +6 -34
- package/src/plugins/symbols/config.ts +4 -2
- package/src/plugins/symbols/langs/ar.js +9 -0
- package/src/plugins/symbols/langs/cs_cz.js +9 -0
- package/src/plugins/symbols/langs/de.js +9 -0
- package/src/plugins/symbols/langs/es.js +9 -0
- package/src/plugins/symbols/langs/fa.js +9 -0
- package/src/plugins/symbols/langs/fr.js +9 -0
- package/src/plugins/symbols/langs/he.js +9 -0
- package/src/plugins/symbols/langs/hu.js +9 -0
- package/src/plugins/symbols/langs/id.js +9 -0
- package/src/plugins/symbols/langs/index.ts +47 -0
- package/src/plugins/symbols/langs/it.js +9 -0
- package/src/plugins/symbols/langs/ja.js +9 -0
- package/src/plugins/symbols/langs/ko.js +9 -0
- package/src/plugins/symbols/langs/nl.js +9 -0
- package/src/plugins/symbols/langs/pl.js +9 -0
- package/src/plugins/symbols/langs/pt_br.js +9 -0
- package/src/plugins/symbols/langs/ru.js +9 -0
- package/src/plugins/symbols/langs/tr.js +9 -0
- package/src/plugins/symbols/langs/zh_cn.js +9 -0
- package/src/plugins/symbols/langs/zh_tw.js +9 -0
- package/src/{styles/icons/omega.svg → plugins/symbols/symbols.svg} +0 -0
- package/src/plugins/symbols/symbols.test.js +280 -0
- package/src/plugins/symbols/symbols.ts +13 -4
- package/src/plugins/{keyboard/tab → tab}/README.md +0 -0
- package/src/plugins/{keyboard/tab → tab}/cases/index.ts +1 -1
- package/src/plugins/{keyboard/tab → tab}/cases/on-tab-inside-li.ts +3 -2
- package/src/plugins/{keyboard/tab → tab}/config.ts +1 -1
- package/src/plugins/{keyboard/tab → tab}/tab.test.js +0 -0
- package/src/plugins/{keyboard/tab → tab}/tab.ts +7 -4
- package/src/plugins/table/config.ts +3 -4
- package/src/plugins/table/table.less +0 -26
- package/src/{styles/icons → plugins/table}/table.svg +0 -0
- package/src/plugins/table/table.ts +7 -0
- package/src/plugins/{table → table-keyboard-navigation}/table-keyboard-navigation.ts +5 -2
- package/src/plugins/tooltip/tooltip.ts +4 -2
- package/src/plugins/{media/video → video}/config.ts +4 -1
- package/src/{styles/icons → plugins/video}/video.svg +0 -0
- package/src/plugins/{media/video/index.ts → video/video.ts} +6 -2
- package/src/plugins/{fix/wrap-nodes → wrap-nodes}/README.md +0 -0
- package/src/plugins/{fix/wrap-nodes → wrap-nodes}/config.ts +1 -1
- package/src/plugins/{fix/wrap-nodes → wrap-nodes}/wrap-nodes.test.js +0 -0
- package/src/plugins/{fix/wrap-nodes → wrap-nodes}/wrap-nodes.ts +6 -3
- package/src/plugins/xpath/config.ts +19 -0
- package/src/plugins/xpath/xpath.test.js +182 -0
- package/src/plugins/xpath/xpath.ts +9 -13
- package/src/styles/icons/index.ts +2 -114
- package/src/types/ajax.d.ts +7 -4
- package/src/types/file-browser.d.ts +5 -1
- package/src/types/index.d.ts +1 -1
- package/src/types/plugin.d.ts +1 -1
- package/src/types/types.d.ts +7 -0
- package/src/types/uploader.d.ts +6 -2
- package/tsconfig.json +8 -12
- package/types/config.d.ts +69 -1
- package/types/core/constants.d.ts +2 -0
- package/types/core/dom/dom.d.ts +8 -0
- package/types/core/helpers/utils/align.d.ts +18 -0
- package/types/core/helpers/utils/index.d.ts +11 -9
- package/types/core/helpers/utils/mark-deprecated.d.ts +1 -1
- package/types/{plugins/print/helpers.d.ts → core/helpers/utils/print.d.ts} +0 -0
- package/types/core/helpers/utils/utils.d.ts +5 -1
- package/types/index.d.ts +1 -0
- package/types/modules/file-browser/file-browser.d.ts +1 -4
- package/types/plugins/about/about.d.ts +0 -2
- package/types/plugins/{keyboard/backspace → backspace}/backspace.d.ts +2 -5
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-join-neighbors.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-join-two-lists.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-not-collapsed.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-remove-char.d.ts +4 -1
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-remove-content-not-editable.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-remove-empty-neighbor.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-remove-empty-parent.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-remove-unbreakable-element.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-table-cell.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/check-unwrap-first-list-item.d.ts +3 -0
- package/types/plugins/{keyboard/backspace → backspace}/cases/index.d.ts +0 -0
- package/types/plugins/{keyboard/backspace → backspace}/config.d.ts +0 -0
- package/types/plugins/{keyboard → backspace}/helpers.d.ts +0 -8
- package/types/plugins/{fix/clean-html → clean-html}/clean-html.d.ts +2 -2
- package/types/plugins/{fix/clean-html → clean-html}/config.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/get-hash.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/index.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/remove-format/remove-format-for-collapsed-selection.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/remove-format/remove-format-for-selection.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/allow-attributes.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/fill-empty-paragraph.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/index.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/remove-inv-text-nodes.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/replace-old-tags.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/sanitize-attributes.d.ts +1 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/visitor/filters/try-remove-node.d.ts +4 -1
- package/types/plugins/{fix/clean-html → clean-html}/helpers/visitor/visit-node-walker.d.ts +1 -1
- package/types/plugins/clipboard/clipboard.d.ts +1 -1
- package/types/plugins/color/color.d.ts +1 -0
- package/types/plugins/{media/video → color}/config.d.ts +0 -0
- package/types/plugins/{clipboard → copy-format}/copy-format.d.ts +0 -0
- package/types/plugins/{clipboard/drag-and-drop → drag-and-drop}/drag-and-drop.d.ts +1 -1
- package/types/plugins/drag-and-drop-element/config.d.ts +14 -0
- package/types/plugins/{clipboard/drag-and-drop-element → drag-and-drop-element}/drag-and-drop-element.d.ts +2 -1
- package/types/plugins/{keyboard/enter → enter}/enter.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/check-br.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/check-unsplittable-box.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/get-block-wrapper.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/has-previous-block.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/index.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/insert-paragraph.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/process-empty-li-leaf.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/split-fragment.d.ts +1 -1
- package/types/plugins/{keyboard/enter → enter}/helpers/wrap-text.d.ts +1 -1
- package/types/plugins/{media → file}/file.d.ts +1 -1
- package/types/plugins/font/config.d.ts +11 -0
- package/types/plugins/font/font.d.ts +1 -5
- package/types/plugins/fullsize/config.d.ts +34 -0
- package/types/plugins/fullsize/fullsize.d.ts +1 -25
- package/types/plugins/hotkeys/config.d.ts +14 -0
- package/types/plugins/{keyboard → hotkeys}/hotkeys.d.ts +3 -7
- package/types/plugins/{insert → hr}/hr.d.ts +1 -1
- package/types/plugins/iframe/config.d.ts +0 -17
- package/types/plugins/{image/image-processor → image-processor}/config.d.ts +0 -0
- package/types/plugins/{image/image-processor → image-processor}/image-processor.d.ts +1 -1
- package/types/plugins/{image/image-properties → image-properties}/config.d.ts +0 -0
- package/types/plugins/{image/image-properties → image-properties}/image-properties.d.ts +5 -5
- package/types/plugins/{image/image-properties → image-properties}/templates/form.d.ts +1 -1
- package/types/plugins/{image/image-properties → image-properties}/templates/main-tab.d.ts +1 -1
- package/types/plugins/{image/image-properties → image-properties}/templates/position-tab.d.ts +1 -1
- package/types/plugins/indent/config.d.ts +14 -0
- package/types/plugins/{image → indent}/helpers.d.ts +3 -2
- package/types/plugins/indent/indent.d.ts +1 -8
- package/types/plugins/index.d.ts +61 -45
- package/types/plugins/inline-popup/inline-popup.d.ts +1 -1
- package/types/plugins/justify/justify.d.ts +0 -8
- package/types/plugins/{keyboard → key-arrow-outside}/key-arrow-outside.d.ts +1 -1
- package/types/plugins/limit/config.d.ts +22 -0
- package/types/plugins/limit/limit.d.ts +1 -16
- package/types/plugins/line-height/line-height.d.ts +1 -0
- package/types/plugins/media/config.d.ts +22 -0
- package/types/plugins/media/media.d.ts +1 -16
- package/types/plugins/{clipboard/paste → paste}/config.d.ts +1 -7
- package/types/plugins/{clipboard/paste → paste}/helpers.d.ts +3 -7
- package/types/plugins/{clipboard/paste → paste}/interface.d.ts +2 -3
- package/types/plugins/{clipboard/paste → paste}/paste.d.ts +5 -5
- package/types/plugins/{clipboard/paste-from-word → paste-from-word}/config.d.ts +2 -3
- package/types/plugins/{clipboard/paste-from-word → paste-from-word}/paste-from-word.d.ts +5 -5
- package/types/plugins/{clipboard/paste-storage → paste-storage}/paste-storage.d.ts +2 -2
- package/types/plugins/placeholder/placeholder.d.ts +1 -1
- package/types/plugins/{print/preview → preview}/preview.d.ts +0 -0
- package/types/plugins/print/lib/generate-critical-css.d.ts +3 -0
- package/types/plugins/redo-undo/redo-undo.d.ts +1 -1
- package/types/plugins/resize-cells/config.d.ts +11 -0
- package/types/plugins/{table → resize-cells}/resize-cells.d.ts +4 -3
- package/types/plugins/resize-handler/config.d.ts +12 -0
- package/types/plugins/{size → resize-handler}/resize-handler.d.ts +1 -0
- package/types/plugins/resizer/resizer.d.ts +1 -1
- package/types/plugins/select/select.d.ts +0 -2
- package/types/plugins/select-cells/config.d.ts +11 -0
- package/types/plugins/{table → select-cells}/select-cells.d.ts +2 -1
- package/types/plugins/size/config.d.ts +0 -4
- package/types/plugins/size/size.d.ts +2 -1
- package/types/plugins/source/source.d.ts +1 -0
- package/types/plugins/spellcheck/spellcheck.d.ts +1 -0
- package/types/plugins/stat/config.d.ts +16 -0
- package/types/plugins/stat/stat.d.ts +2 -8
- package/types/plugins/sticky/config.d.ts +32 -0
- package/types/plugins/sticky/sticky.d.ts +2 -27
- package/types/plugins/symbols/symbols.d.ts +3 -2
- package/types/plugins/{keyboard/tab → tab}/cases/index.d.ts +1 -1
- package/types/plugins/{keyboard/tab → tab}/cases/on-tab-inside-li.d.ts +2 -1
- package/types/plugins/{keyboard/tab → tab}/config.d.ts +0 -0
- package/types/plugins/{insert/index.d.ts → tab/tab.d.ts} +1 -4
- package/types/plugins/table/config.d.ts +0 -2
- package/types/plugins/table/table.d.ts +2 -0
- package/types/plugins/{table → table-keyboard-navigation}/table-keyboard-navigation.d.ts +0 -0
- package/types/plugins/tooltip/tooltip.d.ts +0 -13
- package/{src/plugins/insert/index.ts → types/plugins/video/config.d.ts} +1 -6
- package/types/plugins/video/video.d.ts +6 -0
- package/types/plugins/{fix/wrap-nodes → wrap-nodes}/config.d.ts +1 -1
- package/types/plugins/wrap-nodes/wrap-nodes.d.ts +6 -0
- package/types/plugins/xpath/config.d.ts +11 -0
- package/types/plugins/xpath/xpath.d.ts +1 -24
- package/types/styles/icons/index.d.ts +1 -57
- package/types/types/ajax.d.ts +7 -4
- package/types/types/file-browser.d.ts +5 -1
- package/types/types/index.d.ts +1 -1
- package/types/types/plugin.d.ts +1 -1
- package/types/types/types.d.ts +7 -0
- package/types/types/uploader.d.ts +6 -2
- package/.github/ISSUE_TEMPLATE.md +0 -18
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -14
- package/.github/workflows/docs.yml +0 -16
- package/.github/workflows/tests.yml +0 -22
- package/.idea/codeStyles/Project.xml +0 -68
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/dictionaries/v_chupurnov.xml +0 -12
- package/.idea/encodings.xml +0 -4
- package/.idea/inspectionProfiles/Project_Default.xml +0 -118
- package/.idea/jodit.iml +0 -12
- package/.idea/jsLibraryMappings.xml +0 -6
- package/.idea/markdown-navigator-enh.xml +0 -29
- package/.idea/markdown-navigator.xml +0 -55
- package/.idea/misc.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/stylesheetLinters/stylelint.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/.idea/watcherTasks.xml +0 -4
- package/.idea/workspace.xml +0 -1521
- package/CHANGELOG.MD +0 -3280
- package/CONTRIBUTING.md +0 -100
- package/SECURITY.md +0 -10
- package/build/jodit.css +0 -5866
- package/build/jodit.es2018.css +0 -4822
- package/build/jodit.es2018.en.min.css +0 -1
- package/build/jodit.es2018.en.min.js +0 -1
- package/build/jodit.es2018.js +0 -34937
- package/build/jodit.es2018.min.css +0 -1
- package/build/jodit.es2018.min.js +0 -1
- package/build/jodit.js +0 -42539
- package/build/jodit.min.css +0 -8
- package/build/jodit.min.js +0 -1
- package/build/plugins/speech/speech-recognize/speech-recognize.css +0 -39
- package/build/plugins/speech/speech-recognize/speech-recognize.es2018.css +0 -39
- package/build/plugins/speech/speech-recognize/speech-recognize.es2018.en.js +0 -920
- package/build/plugins/speech/speech-recognize/speech-recognize.es2018.en.min.css +0 -1
- package/build/plugins/speech/speech-recognize/speech-recognize.es2018.en.min.js +0 -1
- package/build/plugins/speech/speech-recognize/speech-recognize.es2018.js +0 -920
- package/build/plugins/speech/speech-recognize/speech-recognize.es2018.min.css +0 -1
- package/build/plugins/speech/speech-recognize/speech-recognize.es2018.min.js +0 -1
- package/build/plugins/speech/speech-recognize/speech-recognize.min.css +0 -1
- package/build/plugins/speech/speech-recognize/speech-recognize.min.js +0 -1
- package/build/vdom.css +0 -18
- package/build/vdom.js +0 -1297
- package/src/plugins/clipboard/index.ts +0 -18
- package/src/plugins/clipboard/paste/CHANGELOG.md +0 -21
- package/src/plugins/fix/index.ts +0 -12
- package/src/plugins/format-block/CHANGELOG.md +0 -16
- package/src/plugins/image/helpers.ts +0 -44
- package/src/plugins/image/image-properties/templates/index.ts +0 -13
- package/src/plugins/image/index.ts +0 -13
- package/src/plugins/media/index.ts +0 -13
- package/src/plugins/print/index.ts +0 -12
- package/src/plugins/size/index.ts +0 -13
- package/src/plugins/source/const.ts +0 -11
- package/src/plugins/source/index.ts +0 -14
- package/src/plugins/table/index.ts +0 -15
- package/src/styles/icons/arrows-alt.svg +0 -4
- package/src/styles/icons/arrows-h.svg +0 -4
- package/src/styles/icons/attachment.svg +0 -4
- package/src/styles/icons/chain-broken.svg +0 -4
- package/src/styles/icons/check-square.svg +0 -1
- package/src/styles/icons/dedent.svg +0 -4
- package/src/styles/icons/menu.svg +0 -1
- package/src/styles/icons/resizer.svg +0 -4
- package/tsdoc.json +0 -30
- package/types/core/decorators/spy/spy.d.ts +0 -9
- package/types/plugins/clipboard/index.d.ts +0 -16
- package/types/plugins/fix/index.d.ts +0 -10
- package/types/plugins/fix/wrap-nodes/wrap-nodes.d.ts +0 -39
- package/types/plugins/image/image-properties/templates/index.d.ts +0 -11
- package/types/plugins/image/index.d.ts +0 -11
- package/types/plugins/keyboard/tab/tab.d.ts +0 -18
- package/types/plugins/media/index.d.ts +0 -11
- package/types/plugins/media/video/index.d.ts +0 -11
- package/types/plugins/print/index.d.ts +0 -10
- package/types/plugins/size/index.d.ts +0 -11
- package/types/plugins/source/const.d.ts +0 -9
- package/types/plugins/source/index.d.ts +0 -12
- package/types/plugins/speech/speech-recognize/config.d.ts +0 -60
- package/types/plugins/speech/speech-recognize/constants.d.ts +0 -10
- package/types/plugins/speech/speech-recognize/helpers/api.d.ts +0 -10
- package/types/plugins/speech/speech-recognize/helpers/exec-spell-command.d.ts +0 -10
- package/types/plugins/speech/speech-recognize/helpers/recognize-manager.d.ts +0 -48
- package/types/plugins/speech/speech-recognize/helpers/sound.d.ts +0 -11
- package/types/plugins/speech/speech-recognize/interface.d.ts +0 -42
- package/types/plugins/speech/speech-recognize/speech-recognize.d.ts +0 -24
- package/types/plugins/table/index.d.ts +0 -13
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
describe('Path plugin', function () {
|
|
8
|
+
describe('After init', function () {
|
|
9
|
+
describe('With showXPathInStatusbar=true', function () {
|
|
10
|
+
it('Should show status bar', function () {
|
|
11
|
+
const editor = getJodit({
|
|
12
|
+
language: 'en',
|
|
13
|
+
showXPathInStatusbar: true,
|
|
14
|
+
showCharsCounter: false,
|
|
15
|
+
showWordsCounter: false,
|
|
16
|
+
history: {
|
|
17
|
+
timeout: 0
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
editor.value = '<p>Simple text</p>';
|
|
22
|
+
|
|
23
|
+
const statusbar =
|
|
24
|
+
editor.container.querySelector('.jodit-status-bar');
|
|
25
|
+
|
|
26
|
+
expect(
|
|
27
|
+
editor.ownerWindow.getComputedStyle(statusbar).display
|
|
28
|
+
).equals('flex');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it('Should show path to selection element', function () {
|
|
32
|
+
const editor = getJodit({
|
|
33
|
+
language: 'en',
|
|
34
|
+
showXPathInStatusbar: true,
|
|
35
|
+
history: {
|
|
36
|
+
timeout: 0
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
editor.value = '<p>Simple text <a href="#">sss</a></p>';
|
|
41
|
+
editor.s.setCursorIn(editor.editor.querySelector('a'));
|
|
42
|
+
|
|
43
|
+
const statusbar = editor.container.querySelector(
|
|
44
|
+
'.jodit-status-bar .jodit-xpath'
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
expect(statusbar).is.not.null;
|
|
48
|
+
expect(statusbar.firstChild.textContent.trim()).equals('');
|
|
49
|
+
expect(statusbar.childNodes[1].textContent).equals('p');
|
|
50
|
+
expect(statusbar.childNodes[2].textContent).equals('a');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
describe('After change selection', function () {
|
|
54
|
+
it('Should change path to selection element', function () {
|
|
55
|
+
const editor = getJodit({
|
|
56
|
+
language: 'en',
|
|
57
|
+
showXPathInStatusbar: true,
|
|
58
|
+
history: {
|
|
59
|
+
timeout: 0
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
editor.value =
|
|
64
|
+
'<p>Simple text <a href="#">sss</a><span>s</span></p>';
|
|
65
|
+
editor.s.setCursorIn(editor.editor.querySelector('a'));
|
|
66
|
+
|
|
67
|
+
const statusbar = editor.container.querySelector(
|
|
68
|
+
'.jodit-status-bar .jodit-xpath'
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
expect(statusbar).is.not.null;
|
|
72
|
+
expect(statusbar.firstChild.innerText).equals('');
|
|
73
|
+
expect(statusbar.childNodes[1].textContent).equals('p');
|
|
74
|
+
expect(statusbar.childNodes[2].textContent).equals('a');
|
|
75
|
+
|
|
76
|
+
editor.s.setCursorIn(editor.editor.querySelector('span'));
|
|
77
|
+
|
|
78
|
+
expect(statusbar.firstChild.innerText).equals('');
|
|
79
|
+
expect(statusbar.childNodes[1].textContent).equals('p');
|
|
80
|
+
expect(statusbar.childNodes[2].textContent).equals('span');
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe('After click on element of path', function () {
|
|
85
|
+
it('Should select this element', function () {
|
|
86
|
+
const editor = getJodit({
|
|
87
|
+
language: 'en',
|
|
88
|
+
showXPathInStatusbar: true,
|
|
89
|
+
history: {
|
|
90
|
+
timeout: 0
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
editor.value =
|
|
95
|
+
'<p>Simple text <a href="#">sss</a><span>s</span></p>';
|
|
96
|
+
editor.s.setCursorIn(editor.editor.querySelector('a'));
|
|
97
|
+
|
|
98
|
+
const statusbar = editor.container.querySelector(
|
|
99
|
+
'.jodit-status-bar .jodit-xpath'
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
expect(statusbar).is.not.null;
|
|
103
|
+
expect(statusbar.firstChild.innerText).equals('');
|
|
104
|
+
expect(statusbar.childNodes[1].textContent).equals('p');
|
|
105
|
+
expect(statusbar.childNodes[2].textContent).equals('a');
|
|
106
|
+
|
|
107
|
+
simulateEvent(
|
|
108
|
+
'click',
|
|
109
|
+
0,
|
|
110
|
+
statusbar.childNodes[2].firstChild
|
|
111
|
+
); // click on A
|
|
112
|
+
|
|
113
|
+
expect(
|
|
114
|
+
Jodit.modules.Helpers.trim(editor.s.sel.toString())
|
|
115
|
+
).equals('sss');
|
|
116
|
+
expect(statusbar.childNodes[2].textContent).equals('a');
|
|
117
|
+
|
|
118
|
+
simulateEvent(
|
|
119
|
+
'click',
|
|
120
|
+
0,
|
|
121
|
+
statusbar.childNodes[1].firstChild
|
|
122
|
+
); // click on P
|
|
123
|
+
|
|
124
|
+
expect(
|
|
125
|
+
Jodit.modules.Helpers.trim(editor.s.sel.toString())
|
|
126
|
+
).equals('Simple text ssss');
|
|
127
|
+
expect(statusbar.childNodes.length).equals(3);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
describe('Context menu on element of path', function () {
|
|
132
|
+
it('Should open context menu', function () {
|
|
133
|
+
const editor = getJodit({
|
|
134
|
+
language: 'en',
|
|
135
|
+
showXPathInStatusbar: true,
|
|
136
|
+
history: {
|
|
137
|
+
timeout: 0
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
editor.value =
|
|
142
|
+
'<p>Simple text <a href="#">sss</a><span>s</span></p>';
|
|
143
|
+
|
|
144
|
+
editor.s.setCursorIn(editor.editor.querySelector('a'));
|
|
145
|
+
|
|
146
|
+
const statusbar = editor.container.querySelector(
|
|
147
|
+
'.jodit-status-bar .jodit-xpath'
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
expect(statusbar).is.not.null;
|
|
151
|
+
expect(statusbar.firstChild.innerText).equals('');
|
|
152
|
+
expect(statusbar.childNodes[1].textContent).equals('p');
|
|
153
|
+
expect(statusbar.childNodes[2].textContent).equals('a');
|
|
154
|
+
|
|
155
|
+
const elm = statusbar.childNodes[2].querySelector('a'),
|
|
156
|
+
pos = Jodit.modules.Helpers.position(elm);
|
|
157
|
+
|
|
158
|
+
simulateEvent('contextmenu', 0, elm, function (o) {
|
|
159
|
+
Object.assign(o, {
|
|
160
|
+
clientX: pos.left + 10,
|
|
161
|
+
clientY: pos.top + 10
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const context = getOpenedPopup(editor);
|
|
166
|
+
|
|
167
|
+
expect(context).is.not.null;
|
|
168
|
+
expect(
|
|
169
|
+
editor.ownerWindow.getComputedStyle(context).display
|
|
170
|
+
).equals('block');
|
|
171
|
+
|
|
172
|
+
simulateEvent('click', 0, context.querySelector('button'));
|
|
173
|
+
expect(editor.value).equals(
|
|
174
|
+
'<p>Simple text <span>s</span></p>'
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
expect(context.parentNode).is.null;
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
});
|
|
181
|
+
});
|
|
182
|
+
});
|
|
@@ -11,26 +11,20 @@
|
|
|
11
11
|
import './xpath.less';
|
|
12
12
|
|
|
13
13
|
import type { IControlTypeStrong, IToolbarButton } from 'jodit/types';
|
|
14
|
-
import { Config } from 'jodit/config';
|
|
15
14
|
import { INVISIBLE_SPACE, MODE_WYSIWYG } from 'jodit/core/constants';
|
|
16
15
|
import { ContextMenu } from 'jodit/modules/context-menu/context-menu';
|
|
17
16
|
import { Dom } from 'jodit/core/dom';
|
|
18
17
|
import { getXPathByElement, trim, attr } from 'jodit/core/helpers';
|
|
19
18
|
import { Plugin } from 'jodit/core/plugin';
|
|
20
19
|
import { makeButton } from 'jodit/modules/toolbar/factory';
|
|
20
|
+
import { pluginSystem } from 'jodit/core/global';
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
interface Config {
|
|
24
|
-
showXPathInStatusbar: boolean;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
Config.prototype.showXPathInStatusbar = true;
|
|
22
|
+
import './config';
|
|
29
23
|
|
|
30
24
|
/**
|
|
31
25
|
* Show path to current element in status bar
|
|
32
26
|
*/
|
|
33
|
-
|
|
27
|
+
class xpath extends Plugin {
|
|
34
28
|
private onContext = (bindElement: Node, event: MouseEvent): boolean => {
|
|
35
29
|
if (!this.menu) {
|
|
36
30
|
this.menu = new ContextMenu(this.j);
|
|
@@ -183,10 +177,10 @@ export class xpath extends Plugin {
|
|
|
183
177
|
this.j.defaultTimeout * 2
|
|
184
178
|
);
|
|
185
179
|
|
|
186
|
-
container?: HTMLElement;
|
|
187
|
-
menu?: ContextMenu;
|
|
180
|
+
protected container?: HTMLElement;
|
|
181
|
+
protected menu?: ContextMenu;
|
|
188
182
|
|
|
189
|
-
afterInit(): void {
|
|
183
|
+
protected afterInit(): void {
|
|
190
184
|
if (this.j.o.showXPathInStatusbar) {
|
|
191
185
|
this.container = this.j.c.div('jodit-xpath');
|
|
192
186
|
|
|
@@ -220,7 +214,7 @@ export class xpath extends Plugin {
|
|
|
220
214
|
}
|
|
221
215
|
}
|
|
222
216
|
|
|
223
|
-
beforeDestruct(): void {
|
|
217
|
+
protected beforeDestruct(): void {
|
|
224
218
|
if (this.j && this.j.events) {
|
|
225
219
|
this.j.e.off('.xpath');
|
|
226
220
|
}
|
|
@@ -234,3 +228,5 @@ export class xpath extends Plugin {
|
|
|
234
228
|
delete this.container;
|
|
235
229
|
}
|
|
236
230
|
}
|
|
231
|
+
|
|
232
|
+
pluginSystem.add('xpath', xpath);
|
|
@@ -10,172 +10,60 @@
|
|
|
10
10
|
* @module icons
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import * as about from './about.svg';
|
|
14
|
-
import * as addcolumn from './addcolumn.svg';
|
|
15
|
-
import * as addrow from './addrow.svg';
|
|
16
13
|
import * as angle_down from './angle-down.svg';
|
|
17
14
|
import * as angle_left from './angle-left.svg';
|
|
18
15
|
import * as angle_right from './angle-right.svg';
|
|
19
16
|
import * as angle_up from './angle-up.svg';
|
|
20
|
-
import * as arrows_alt from './arrows-alt.svg';
|
|
21
|
-
import * as arrows_h from './arrows-h.svg';
|
|
22
|
-
import * as attachment from './attachment.svg';
|
|
23
17
|
import * as bin from './bin.svg';
|
|
24
|
-
import * as bold from './bold.svg';
|
|
25
|
-
import * as brush from './brush.svg';
|
|
26
18
|
import * as cancel from './cancel.svg';
|
|
27
19
|
import * as center from './center.svg';
|
|
28
|
-
import * as chain_broken from './chain-broken.svg';
|
|
29
20
|
import * as check from './check.svg';
|
|
30
|
-
import * as check_square from './check-square.svg';
|
|
31
21
|
import * as chevron from './chevron.svg';
|
|
32
|
-
import * as copyformat from './copyformat.svg';
|
|
33
|
-
import * as crop from './crop.svg';
|
|
34
|
-
import * as copy from './copy.svg';
|
|
35
|
-
import * as cut from './cut.svg';
|
|
36
|
-
import * as dedent from './dedent.svg';
|
|
37
22
|
import * as dots from './dots.svg';
|
|
38
|
-
import * as enter from './enter.svg';
|
|
39
|
-
import * as eraser from './eraser.svg';
|
|
40
23
|
import * as eye from './eye.svg';
|
|
41
24
|
import * as file from './file.svg';
|
|
42
25
|
import * as folder from './folder.svg';
|
|
43
|
-
import * as font from './font.svg';
|
|
44
|
-
import * as fontsize from './fontsize.svg';
|
|
45
|
-
import * as fullsize from './fullsize.svg';
|
|
46
|
-
import * as hr from './hr.svg';
|
|
47
|
-
import * as image from './image.svg';
|
|
48
|
-
import * as indent from './indent.svg';
|
|
49
26
|
import * as info_circle from './info-circle.svg';
|
|
50
|
-
import * as italic from './italic.svg';
|
|
51
|
-
import * as justify from './justify.svg';
|
|
52
27
|
import * as left from './left.svg';
|
|
53
|
-
import * as line_height from './line-height.svg';
|
|
54
|
-
import * as link from './link.svg';
|
|
55
28
|
import * as lock from './lock.svg';
|
|
56
|
-
import * as menu from './menu.svg';
|
|
57
|
-
import * as merge from './merge.svg';
|
|
58
29
|
import * as ok from './ok.svg';
|
|
59
|
-
import * as ol from './ol.svg';
|
|
60
|
-
import * as omega from './omega.svg';
|
|
61
|
-
import * as outdent from './outdent.svg';
|
|
62
|
-
import * as palette from './palette.svg';
|
|
63
|
-
import * as paragraph from './paragraph.svg';
|
|
64
|
-
import * as paste from './paste.svg';
|
|
65
30
|
import * as pencil from './pencil.svg';
|
|
66
31
|
import * as plus from './plus.svg';
|
|
67
|
-
import * as print from './print.svg';
|
|
68
|
-
import * as redo from './redo.svg';
|
|
69
|
-
import * as resize from './resize.svg';
|
|
70
32
|
import * as resize_handler from './resize-handler.svg';
|
|
71
|
-
import * as resizer from './resizer.svg';
|
|
72
33
|
import * as right from './right.svg';
|
|
73
34
|
import * as save from './save.svg';
|
|
74
|
-
import * as search from './search.svg';
|
|
75
35
|
import * as settings from './settings.svg';
|
|
76
|
-
import * as select_all from './select-all.svg';
|
|
77
|
-
import * as shrink from './shrink.svg';
|
|
78
|
-
import * as source from './source.svg';
|
|
79
|
-
import * as splitg from './splitg.svg';
|
|
80
|
-
import * as splitv from './splitv.svg';
|
|
81
|
-
import * as strikethrough from './strikethrough.svg';
|
|
82
|
-
import * as subscript from './subscript.svg';
|
|
83
|
-
import * as superscript from './superscript.svg';
|
|
84
|
-
import * as table from './table.svg';
|
|
85
|
-
import * as th from './th.svg';
|
|
86
|
-
import * as th_list from './th-list.svg';
|
|
87
|
-
import * as ul from './ul.svg';
|
|
88
|
-
import * as underline from './underline.svg';
|
|
89
|
-
import * as undo from './undo.svg';
|
|
90
|
-
import * as unlink from './unlink.svg';
|
|
91
36
|
import * as unlock from './unlock.svg';
|
|
92
37
|
import * as update from './update.svg';
|
|
93
38
|
import * as upload from './upload.svg';
|
|
94
39
|
import * as valign from './valign.svg';
|
|
95
|
-
import * as video from './video.svg';
|
|
96
40
|
|
|
97
41
|
export {
|
|
98
|
-
about,
|
|
99
|
-
addcolumn,
|
|
100
|
-
addrow,
|
|
101
42
|
angle_down,
|
|
102
43
|
angle_left,
|
|
103
44
|
angle_right,
|
|
104
45
|
angle_up,
|
|
105
|
-
arrows_alt,
|
|
106
|
-
arrows_h,
|
|
107
|
-
attachment,
|
|
108
46
|
bin,
|
|
109
|
-
bold,
|
|
110
|
-
brush,
|
|
111
47
|
cancel,
|
|
112
48
|
center,
|
|
113
|
-
chain_broken,
|
|
114
49
|
check,
|
|
115
|
-
check_square,
|
|
116
|
-
copyformat,
|
|
117
|
-
copy,
|
|
118
|
-
crop,
|
|
119
|
-
cut,
|
|
120
|
-
dedent,
|
|
121
|
-
dots,
|
|
122
50
|
chevron,
|
|
123
|
-
|
|
124
|
-
eraser,
|
|
51
|
+
dots,
|
|
125
52
|
eye,
|
|
126
53
|
file,
|
|
127
54
|
folder,
|
|
128
|
-
font,
|
|
129
|
-
fontsize,
|
|
130
|
-
fullsize,
|
|
131
|
-
hr,
|
|
132
|
-
image,
|
|
133
|
-
indent,
|
|
134
55
|
info_circle,
|
|
135
|
-
italic,
|
|
136
|
-
justify,
|
|
137
56
|
left,
|
|
138
|
-
line_height,
|
|
139
|
-
link,
|
|
140
57
|
lock,
|
|
141
|
-
menu,
|
|
142
|
-
merge,
|
|
143
58
|
ok,
|
|
144
|
-
ol,
|
|
145
|
-
omega,
|
|
146
|
-
outdent,
|
|
147
|
-
palette,
|
|
148
|
-
paragraph,
|
|
149
|
-
paste,
|
|
150
59
|
pencil,
|
|
151
60
|
plus,
|
|
152
|
-
print,
|
|
153
|
-
redo,
|
|
154
|
-
resize,
|
|
155
61
|
resize_handler,
|
|
156
|
-
resizer,
|
|
157
62
|
right,
|
|
158
63
|
save,
|
|
159
|
-
search,
|
|
160
|
-
select_all,
|
|
161
64
|
settings,
|
|
162
|
-
shrink,
|
|
163
|
-
source,
|
|
164
|
-
splitg,
|
|
165
|
-
splitv,
|
|
166
|
-
strikethrough,
|
|
167
|
-
subscript,
|
|
168
|
-
superscript,
|
|
169
|
-
table,
|
|
170
|
-
th,
|
|
171
|
-
th_list,
|
|
172
|
-
ul,
|
|
173
|
-
underline,
|
|
174
|
-
undo,
|
|
175
|
-
unlink,
|
|
176
65
|
unlock,
|
|
177
66
|
update,
|
|
178
67
|
upload,
|
|
179
|
-
valign
|
|
180
|
-
video
|
|
68
|
+
valign
|
|
181
69
|
};
|
package/src/types/ajax.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @module types
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { IDestructible, IDictionary } from './types';
|
|
12
|
-
import { IViewBased } from './view';
|
|
11
|
+
import type { CanPromise, IDestructible, IDictionary } from './types';
|
|
12
|
+
import type { IViewBased } from './view';
|
|
13
13
|
|
|
14
14
|
export type DataVariant =
|
|
15
15
|
| IDictionary<string>
|
|
@@ -81,11 +81,14 @@ export interface AjaxOptions {
|
|
|
81
81
|
contentType?: string | false;
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
* An object of additional header key/value pairs to send along
|
|
84
|
+
* An object (or a function which returns an object) of additional header key/value pairs to send along
|
|
85
85
|
* with requests using the XMLHttpRequest transport. Uses in {@link FileBrowser|FileBrowser}
|
|
86
86
|
* and {@link Uploader|Uploader}
|
|
87
87
|
*/
|
|
88
|
-
headers?:
|
|
88
|
+
headers?:
|
|
89
|
+
| IDictionary<string>
|
|
90
|
+
| null
|
|
91
|
+
| ((this: IAjax<any>) => CanPromise<IDictionary<string> | null>);
|
|
89
92
|
|
|
90
93
|
responseType?: XMLHttpRequestResponseType;
|
|
91
94
|
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {
|
|
12
|
+
CanPromise,
|
|
12
13
|
IDestructible,
|
|
13
14
|
IDictionary,
|
|
14
15
|
ImageBox,
|
|
@@ -19,6 +20,7 @@ import type { IUploader, IUploaderOptions } from './uploader';
|
|
|
19
20
|
import type { IViewBased, IViewOptions } from './view';
|
|
20
21
|
import type { IUIGroup } from './ui';
|
|
21
22
|
import type { IObservable } from './events';
|
|
23
|
+
import type { IAjax } from './ajax';
|
|
22
24
|
|
|
23
25
|
/**
|
|
24
26
|
* The module creates a web browser dialog box. In a Web browser ,you can select an image, remove, drag it. Upload new
|
|
@@ -77,7 +79,9 @@ export interface IFileBrowserAjaxOptions {
|
|
|
77
79
|
processData?: boolean;
|
|
78
80
|
dataType?: string;
|
|
79
81
|
|
|
80
|
-
headers?:
|
|
82
|
+
headers?:
|
|
83
|
+
| IDictionary<string>
|
|
84
|
+
| ((this: IAjax<any>) => CanPromise<IDictionary<string>>);
|
|
81
85
|
|
|
82
86
|
prepareData?: (data: IDictionary<string>) => IDictionary<string>;
|
|
83
87
|
process?: IFileBrowserProcessor;
|
package/src/types/index.d.ts
CHANGED
package/src/types/plugin.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ interface PluginFunction {
|
|
|
44
44
|
constructor(jodit: IViewBased): void;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export type PluginType = typeof IPlugin | IPlugin | PluginFunction;
|
|
47
|
+
export type PluginType = typeof IPlugin | IPlugin | PluginFunction | Function;
|
|
48
48
|
export type PluginInstance = IPlugin | object;
|
|
49
49
|
|
|
50
50
|
export interface IExtraPlugin {
|
package/src/types/types.d.ts
CHANGED
|
@@ -241,7 +241,14 @@ export interface ImageEditorOptions {
|
|
|
241
241
|
cropDefaultHeight: string | number;
|
|
242
242
|
}
|
|
243
243
|
|
|
244
|
+
export type InsertMode =
|
|
245
|
+
| 'insert_as_html'
|
|
246
|
+
| 'insert_as_text'
|
|
247
|
+
| 'insert_clear_html'
|
|
248
|
+
| 'insert_only_text';
|
|
249
|
+
|
|
244
250
|
export type ImageAction = 'resize' | 'crop';
|
|
251
|
+
export type ImageHAlign = 'normal' | 'left' | 'right' | 'center' | '';
|
|
245
252
|
|
|
246
253
|
export interface ImageBox {
|
|
247
254
|
w: number;
|
package/src/types/uploader.d.ts
CHANGED
|
@@ -8,8 +8,9 @@
|
|
|
8
8
|
* @module types
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { IDictionary, IViewComponent } from './types';
|
|
11
|
+
import type { CanPromise, IDictionary, IViewComponent } from './types';
|
|
12
12
|
import type { IViewBased } from 'jodit/types/view';
|
|
13
|
+
import type { IAjax } from './ajax';
|
|
13
14
|
|
|
14
15
|
interface IUploaderData {
|
|
15
16
|
messages?: string[];
|
|
@@ -40,7 +41,10 @@ export interface IUploaderOptions<T> {
|
|
|
40
41
|
| ((request: FormData | IDictionary<string> | string) => string);
|
|
41
42
|
insertImageAsBase64URI: boolean;
|
|
42
43
|
imagesExtensions: string[];
|
|
43
|
-
headers?:
|
|
44
|
+
headers?:
|
|
45
|
+
| IDictionary<string>
|
|
46
|
+
| null
|
|
47
|
+
| ((this: IAjax<any>) => CanPromise<IDictionary<string> | null>);
|
|
44
48
|
data: null | object;
|
|
45
49
|
format: string;
|
|
46
50
|
method: string;
|
package/tsconfig.json
CHANGED
|
@@ -33,21 +33,17 @@
|
|
|
33
33
|
|
|
34
34
|
"lib": ["es5", "esnext", "dom", "scripthost", "es2015.iterable"],
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"include": [
|
|
43
|
-
"./src/types/"
|
|
44
|
-
],
|
|
36
|
+
"baseUrl": ".",
|
|
37
|
+
"paths": {
|
|
38
|
+
"jodit/src/*": ["./src/*"],
|
|
39
|
+
"jodit/*": ["./src/*"]
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"include": ["./src/types/"],
|
|
45
43
|
"files": [
|
|
46
44
|
"./index.d.ts",
|
|
47
45
|
"./src/index.ts",
|
|
48
46
|
"./src/typings.d.ts",
|
|
49
|
-
"./src/types/index.d.ts"
|
|
50
|
-
"./src/types/async.d.ts",
|
|
51
|
-
"./src/plugins/speech/speech-recognize/speech-recognize.ts",
|
|
47
|
+
"./src/types/index.d.ts"
|
|
52
48
|
]
|
|
53
49
|
}
|
package/types/config.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* @module config
|
|
8
8
|
*/
|
|
9
|
-
import type { IExtraPlugin, IDictionary, IViewOptions, NodeFunction, Attributes, ButtonsOption, Controls, IControlType, IUIButtonState, Nullable } from './types';
|
|
9
|
+
import type { IExtraPlugin, IDictionary, IViewOptions, NodeFunction, Attributes, ButtonsOption, Controls, IControlType, IUIButtonState, InsertMode, Nullable } from './types';
|
|
10
10
|
/**
|
|
11
11
|
* Default Editor's Configuration
|
|
12
12
|
*/
|
|
@@ -20,6 +20,52 @@ export declare class Config implements IViewOptions {
|
|
|
20
20
|
* Editor loads completely without plugins. Useful when debugging your own plugin.
|
|
21
21
|
*/
|
|
22
22
|
safeMode: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Editor's width
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```javascript
|
|
28
|
+
* Jodit.make('.editor', {
|
|
29
|
+
* width: '100%',
|
|
30
|
+
* })
|
|
31
|
+
* ```
|
|
32
|
+
* @example
|
|
33
|
+
* ```javascript
|
|
34
|
+
* Jodit.make('.editor', {
|
|
35
|
+
* width: 600, // equivalent for '600px'
|
|
36
|
+
* })
|
|
37
|
+
* ```
|
|
38
|
+
* @example
|
|
39
|
+
* ```javascript
|
|
40
|
+
* Jodit.make('.editor', {
|
|
41
|
+
* width: 'auto', // autosize
|
|
42
|
+
* })
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
width: number | string;
|
|
46
|
+
/**
|
|
47
|
+
* Editor's height
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```javascript
|
|
51
|
+
* Jodit.make('.editor', {
|
|
52
|
+
* height: '100%',
|
|
53
|
+
* })
|
|
54
|
+
* ```
|
|
55
|
+
* @example
|
|
56
|
+
* ```javascript
|
|
57
|
+
* Jodit.make('.editor', {
|
|
58
|
+
* height: 600, // equivalent for '600px'
|
|
59
|
+
* })
|
|
60
|
+
* ```
|
|
61
|
+
* @example
|
|
62
|
+
* ```javascript
|
|
63
|
+
* Jodit.make('.editor', {
|
|
64
|
+
* height: 'auto', // default - autosize
|
|
65
|
+
* })
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
height: number | string;
|
|
23
69
|
/**
|
|
24
70
|
* List of plugins that will be initialized in safe mode.
|
|
25
71
|
*
|
|
@@ -239,10 +285,32 @@ export declare class Config implements IViewOptions {
|
|
|
239
285
|
* Instead of create custop tooltip - use native title tooltips
|
|
240
286
|
*/
|
|
241
287
|
useNativeTooltip: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* Default insert method
|
|
290
|
+
* @default insert_as_html
|
|
291
|
+
*/
|
|
292
|
+
defaultActionOnPaste: InsertMode;
|
|
242
293
|
/**
|
|
243
294
|
* Element that will be created when you press Enter
|
|
244
295
|
*/
|
|
245
296
|
enter: 'p' | 'div' | 'br';
|
|
297
|
+
/**
|
|
298
|
+
* When this option is enabled, the editor's content will be placed in an iframe and isolated from the rest of the page.
|
|
299
|
+
*
|
|
300
|
+
* @example
|
|
301
|
+
* ```javascript
|
|
302
|
+
* Jodit.make('#editor', {
|
|
303
|
+
* iframe: true,
|
|
304
|
+
* iframeStyle: 'html{margin: 0px;}body{padding:10px;background:transparent;color:#000;position:relative;z-index:2;\
|
|
305
|
+
* user-select:auto;margin:0px;overflow:hidden;}body:after{content:"";clear:both;display:block}';
|
|
306
|
+
* });
|
|
307
|
+
* ```
|
|
308
|
+
*/
|
|
309
|
+
iframe: boolean;
|
|
310
|
+
/**
|
|
311
|
+
* Allow editing the entire HTML document(html, head)
|
|
312
|
+
*/
|
|
313
|
+
editHTMLDocumentMode: boolean;
|
|
246
314
|
/**
|
|
247
315
|
* Use when you need insert new block element
|
|
248
316
|
* use enter option if not set
|
|
@@ -112,3 +112,5 @@ export declare const KEY_ALIASES: IDictionary<string>;
|
|
|
112
112
|
export declare const BASE_PATH: string;
|
|
113
113
|
export declare const TEMP_ATTR = "data-jodit-temp";
|
|
114
114
|
export declare const lang: IDictionary<IDictionary<string>>;
|
|
115
|
+
export declare const CLIPBOARD_ID = "clipboard";
|
|
116
|
+
export declare const SOURCE_CONSUMER = "source-consumer";
|
package/types/core/dom/dom.d.ts
CHANGED
|
@@ -149,6 +149,14 @@ export declare class Dom {
|
|
|
149
149
|
* Get not empty sibling
|
|
150
150
|
*/
|
|
151
151
|
static findSibling(node: Node, left?: boolean, cond?: (n: Node) => boolean): Nullable<Node>;
|
|
152
|
+
/**
|
|
153
|
+
* Returns the nearest non-empty sibling
|
|
154
|
+
*/
|
|
155
|
+
static findNotEmptySibling(node: Node, backspace: boolean): Nullable<Node>;
|
|
156
|
+
/**
|
|
157
|
+
* Returns the nearest non-empty neighbor
|
|
158
|
+
*/
|
|
159
|
+
static findNotEmptyNeighbor(node: Node, left: boolean, root: HTMLElement): Nullable<Node>;
|
|
152
160
|
static sibling(node: Node, left?: boolean): Nullable<Node>;
|
|
153
161
|
/**
|
|
154
162
|
* It goes through all the elements in ascending order, and checks to see if they meet the predetermined condition
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
3
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
|
+
*/
|
|
6
|
+
import type { ImageHAlign } from 'jodit/types';
|
|
7
|
+
/**
|
|
8
|
+
* Align image
|
|
9
|
+
*/
|
|
10
|
+
export declare function hAlignElement(image: HTMLElement, align: ImageHAlign): void;
|
|
11
|
+
/**
|
|
12
|
+
* Remove text-align style for all selected children
|
|
13
|
+
*/
|
|
14
|
+
export declare function clearAlign(node: Node): void;
|
|
15
|
+
/**
|
|
16
|
+
* Apply align for element
|
|
17
|
+
*/
|
|
18
|
+
export declare function alignElement(command: string, box: HTMLElement): void;
|