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,22 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* @module plugins/drag-and-drop-element
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Config } from 'jodit/config';
|
|
12
|
+
|
|
13
|
+
declare module 'jodit/config' {
|
|
14
|
+
interface Config {
|
|
15
|
+
/**
|
|
16
|
+
* Draggable elements
|
|
17
|
+
*/
|
|
18
|
+
draggableTags: string | string[];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Config.prototype.draggableTags = ['img', 'jodit-media', 'jodit'];
|
|
File without changes
|
|
@@ -12,9 +12,11 @@ import type { IViewComponent, Nullable } from 'jodit/types';
|
|
|
12
12
|
import { css, ctrlKey, dataBind, splitArray } from 'jodit/core/helpers';
|
|
13
13
|
import { Plugin } from 'jodit/core/plugin';
|
|
14
14
|
import { Dom } from 'jodit/core/dom';
|
|
15
|
-
import { getContainer } from 'jodit/core/global';
|
|
15
|
+
import { getContainer, pluginSystem } from 'jodit/core/global';
|
|
16
16
|
import { autobind, throttle } from 'jodit/core/decorators';
|
|
17
17
|
|
|
18
|
+
import './config';
|
|
19
|
+
|
|
18
20
|
enum DragState {
|
|
19
21
|
IDLE = 0,
|
|
20
22
|
WAIT_DRAGGING = 1,
|
|
@@ -24,7 +26,7 @@ enum DragState {
|
|
|
24
26
|
/**
|
|
25
27
|
* Process drag and drop image or another element inside the editor
|
|
26
28
|
*/
|
|
27
|
-
export class
|
|
29
|
+
export class dragAndDropElement extends Plugin {
|
|
28
30
|
private dragList: string[] = [];
|
|
29
31
|
|
|
30
32
|
private draggable: Nullable<HTMLElement> = null;
|
|
@@ -151,7 +153,7 @@ export class DragAndDropElement extends Plugin {
|
|
|
151
153
|
height: target?.offsetHeight ?? 100
|
|
152
154
|
});
|
|
153
155
|
|
|
154
|
-
getContainer(this.j,
|
|
156
|
+
getContainer(this.j, dragAndDropElement).appendChild(
|
|
155
157
|
this.draggable
|
|
156
158
|
);
|
|
157
159
|
}
|
|
@@ -249,3 +251,5 @@ export class DragAndDropElement extends Plugin {
|
|
|
249
251
|
this.removeDragListeners();
|
|
250
252
|
}
|
|
251
253
|
}
|
|
254
|
+
|
|
255
|
+
pluginSystem.add('dragAndDropElement', dragAndDropElement);
|
|
File without changes
|
|
File without changes
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* [[include:plugins/keyboard/enter/README.md]]
|
|
9
9
|
* @packageDocumentation
|
|
10
|
-
* @module plugins/
|
|
10
|
+
* @module plugins/enter
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type { IJodit } from 'jodit/types';
|
|
@@ -19,6 +19,8 @@ import {
|
|
|
19
19
|
PARAGRAPH,
|
|
20
20
|
KEY_ENTER
|
|
21
21
|
} from 'jodit/core/constants';
|
|
22
|
+
import { watch } from 'jodit/core/decorators';
|
|
23
|
+
|
|
22
24
|
import {
|
|
23
25
|
checkBR,
|
|
24
26
|
checkUnsplittableBox,
|
|
@@ -28,8 +30,8 @@ import {
|
|
|
28
30
|
insertParagraph,
|
|
29
31
|
splitFragment,
|
|
30
32
|
wrapText
|
|
31
|
-
} from '
|
|
32
|
-
import {
|
|
33
|
+
} from './helpers';
|
|
34
|
+
import { pluginSystem } from 'jodit/core/global';
|
|
33
35
|
|
|
34
36
|
/**
|
|
35
37
|
* One of most important core plugins. It is responsible for all the browsers to have the same effect when the Enter
|
|
@@ -140,3 +142,5 @@ export class enter extends Plugin {
|
|
|
140
142
|
editor.e.off('keydown.enter');
|
|
141
143
|
}
|
|
142
144
|
}
|
|
145
|
+
|
|
146
|
+
pluginSystem.add('enter', enter);
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @module plugins/
|
|
8
|
+
* @module plugins/enter
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { IJodit, Nullable } from 'jodit/types';
|
|
12
12
|
import { Dom } from 'jodit/core/dom/dom';
|
|
13
13
|
import { $$ } from 'jodit/core/helpers/utils/selector';
|
|
14
|
+
|
|
14
15
|
import { insertParagraph } from './insert-paragraph';
|
|
15
16
|
|
|
16
17
|
/**
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @module plugins/
|
|
8
|
+
* @module plugins/enter
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { IJodit, Nullable } from 'jodit/types';
|
|
12
|
-
import { insertParagraph } from './insert-paragraph';
|
|
13
12
|
import { scrollIntoViewIfNeeded } from 'jodit/core/helpers/utils/scroll-into-view';
|
|
14
13
|
import { Dom } from 'jodit/core/dom/dom';
|
|
15
14
|
|
|
15
|
+
import { insertParagraph } from './insert-paragraph';
|
|
16
|
+
|
|
16
17
|
/**
|
|
17
18
|
* Splits a block element into two parts
|
|
18
19
|
* and adds a new default block in the middle/start/end
|
|
@@ -15,6 +15,7 @@ import { Config } from 'jodit/config';
|
|
|
15
15
|
import { Dom } from 'jodit/core/dom';
|
|
16
16
|
import { css } from 'jodit/core/helpers/utils/css';
|
|
17
17
|
import { toArray } from 'jodit/core/helpers/array/to-array';
|
|
18
|
+
import { pluginSystem } from 'jodit/core/global';
|
|
18
19
|
|
|
19
20
|
declare module 'jodit/config' {
|
|
20
21
|
interface Config {
|
|
@@ -102,3 +103,5 @@ export function errorMessages(editor: IJodit): void {
|
|
|
102
103
|
);
|
|
103
104
|
}
|
|
104
105
|
}
|
|
106
|
+
|
|
107
|
+
pluginSystem.add('errorMessages', errorMessages);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* @module plugins/
|
|
8
|
+
* @module plugins/file
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type {
|
|
@@ -14,8 +14,9 @@ import type {
|
|
|
14
14
|
IJodit
|
|
15
15
|
} from 'jodit/types';
|
|
16
16
|
import { Config } from 'jodit/config';
|
|
17
|
-
import { Dom } from 'jodit/core/dom';
|
|
17
|
+
import { Dom } from 'jodit/core/dom/dom';
|
|
18
18
|
import { FileSelectorWidget } from 'jodit/modules/widget';
|
|
19
|
+
import { pluginSystem } from 'jodit/core/global';
|
|
19
20
|
|
|
20
21
|
Config.prototype.controls.file = {
|
|
21
22
|
popup: (
|
|
@@ -83,3 +84,5 @@ export function file(editor: IJodit): void {
|
|
|
83
84
|
group: 'media'
|
|
84
85
|
});
|
|
85
86
|
}
|
|
87
|
+
|
|
88
|
+
pluginSystem.add('file', file);
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
import type { IJodit } from 'jodit/types';
|
|
14
14
|
import { Config } from 'jodit/config';
|
|
15
15
|
import { Dom } from 'jodit/core/dom';
|
|
16
|
+
import { pluginSystem } from 'jodit/core/global';
|
|
16
17
|
|
|
17
18
|
declare module 'jodit/config' {
|
|
18
19
|
interface Config {
|
|
@@ -93,3 +94,5 @@ export function focus(editor: IJodit): void {
|
|
|
93
94
|
});
|
|
94
95
|
});
|
|
95
96
|
}
|
|
97
|
+
|
|
98
|
+
pluginSystem.add('focus', focus);
|
|
@@ -0,0 +1,151 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* @module plugins/font
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { Config } from 'jodit/config';
|
|
12
|
+
import type { IControlType, IJodit } from 'jodit/types';
|
|
13
|
+
import { Dom } from 'jodit/core/dom/dom';
|
|
14
|
+
import { css, memorizeExec } from 'jodit/core/helpers/utils';
|
|
15
|
+
import { Icon } from 'jodit/core/ui/icon';
|
|
16
|
+
|
|
17
|
+
declare module 'jodit/config' {
|
|
18
|
+
interface Config {
|
|
19
|
+
defaultFontSizePoints: 'px' | 'pt';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Default font-size points
|
|
25
|
+
*/
|
|
26
|
+
Config.prototype.defaultFontSizePoints = 'px';
|
|
27
|
+
|
|
28
|
+
Icon.set('font', require('./icons/font.svg')).set(
|
|
29
|
+
'fontsize',
|
|
30
|
+
require('./icons/fontsize.svg')
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
Config.prototype.controls.fontsize = {
|
|
34
|
+
command: 'fontsize',
|
|
35
|
+
|
|
36
|
+
data: {
|
|
37
|
+
cssRule: 'font-size'
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
list: [
|
|
41
|
+
'8',
|
|
42
|
+
'9',
|
|
43
|
+
'10',
|
|
44
|
+
'11',
|
|
45
|
+
'12',
|
|
46
|
+
'14',
|
|
47
|
+
'16',
|
|
48
|
+
'18',
|
|
49
|
+
'24',
|
|
50
|
+
'30',
|
|
51
|
+
'36',
|
|
52
|
+
'48',
|
|
53
|
+
'60',
|
|
54
|
+
'72',
|
|
55
|
+
'96'
|
|
56
|
+
],
|
|
57
|
+
|
|
58
|
+
exec: (editor, event, { control }): void | false =>
|
|
59
|
+
memorizeExec(editor, event, { control }, (value: string) => {
|
|
60
|
+
if (control.command?.toLowerCase() === 'fontsize') {
|
|
61
|
+
return `${value}${editor.o.defaultFontSizePoints}`;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return value;
|
|
65
|
+
}),
|
|
66
|
+
|
|
67
|
+
childTemplate: (editor, key: string, value: string) => {
|
|
68
|
+
return `${value}${editor.o.defaultFontSizePoints}`;
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
tooltip: 'Font size',
|
|
72
|
+
|
|
73
|
+
isChildActive: (editor, control: IControlType): boolean => {
|
|
74
|
+
const current = editor.s.current(),
|
|
75
|
+
cssKey = control.data?.cssRule || 'font-size',
|
|
76
|
+
normalize =
|
|
77
|
+
control.data?.normalize ||
|
|
78
|
+
((v: string): string => {
|
|
79
|
+
if (
|
|
80
|
+
/pt$/i.test(v) &&
|
|
81
|
+
editor.o.defaultFontSizePoints === 'pt'
|
|
82
|
+
) {
|
|
83
|
+
return v.replace(/pt$/i, '');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
return v;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
if (current) {
|
|
90
|
+
const currentBpx: HTMLElement =
|
|
91
|
+
(Dom.closest(
|
|
92
|
+
current,
|
|
93
|
+
Dom.isElement,
|
|
94
|
+
editor.editor
|
|
95
|
+
) as HTMLElement) || editor.editor;
|
|
96
|
+
|
|
97
|
+
const value = css(currentBpx, cssKey) as number;
|
|
98
|
+
|
|
99
|
+
return Boolean(
|
|
100
|
+
value &&
|
|
101
|
+
control.args &&
|
|
102
|
+
normalize(control.args[0].toString()) ===
|
|
103
|
+
normalize(value.toString())
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
} as IControlType<IJodit> as IControlType;
|
|
110
|
+
|
|
111
|
+
Config.prototype.controls.font = {
|
|
112
|
+
...Config.prototype.controls.fontsize,
|
|
113
|
+
command: 'fontname',
|
|
114
|
+
|
|
115
|
+
list: {
|
|
116
|
+
'': 'Default',
|
|
117
|
+
'Helvetica,sans-serif': 'Helvetica',
|
|
118
|
+
'Arial,Helvetica,sans-serif': 'Arial',
|
|
119
|
+
'Georgia,serif': 'Georgia',
|
|
120
|
+
'Impact,Charcoal,sans-serif': 'Impact',
|
|
121
|
+
'Tahoma,Geneva,sans-serif': 'Tahoma',
|
|
122
|
+
'Times New Roman,Times,serif': 'Times New Roman',
|
|
123
|
+
'Verdana,Geneva,sans-serif': 'Verdana'
|
|
124
|
+
},
|
|
125
|
+
|
|
126
|
+
childTemplate: (editor, key: string, value: string) => {
|
|
127
|
+
let isAvailable = false;
|
|
128
|
+
|
|
129
|
+
try {
|
|
130
|
+
isAvailable =
|
|
131
|
+
key.indexOf('dings') === -1 &&
|
|
132
|
+
document.fonts.check(`16px ${key}`, value);
|
|
133
|
+
} catch {}
|
|
134
|
+
|
|
135
|
+
return `<span style="${
|
|
136
|
+
isAvailable ? `font-family: ${key}!important;` : ''
|
|
137
|
+
}">${value}</span>`;
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
data: {
|
|
141
|
+
cssRule: 'font-family',
|
|
142
|
+
normalize: (v: string): string => {
|
|
143
|
+
return v
|
|
144
|
+
.toLowerCase()
|
|
145
|
+
.replace(/['"]+/g, '')
|
|
146
|
+
.replace(/[^a-z0-9]+/g, ',');
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
|
|
150
|
+
tooltip: 'Font family'
|
|
151
|
+
} as IControlType<IJodit> as IControlType;
|
package/src/plugins/font/font.ts
CHANGED
|
@@ -8,141 +8,11 @@
|
|
|
8
8
|
* @module plugins/font
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { css, memorizeExec, normalizeSize } from 'jodit/core/helpers/';
|
|
11
|
+
import type { IJodit } from 'jodit/types';
|
|
12
|
+
import { normalizeSize } from 'jodit/core/helpers/';
|
|
13
|
+
import { pluginSystem } from 'jodit/core/global';
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
interface Config {
|
|
18
|
-
defaultFontSizePoints: 'px' | 'pt';
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Default font-size points
|
|
24
|
-
*/
|
|
25
|
-
Config.prototype.defaultFontSizePoints = 'px';
|
|
26
|
-
|
|
27
|
-
Config.prototype.controls.fontsize = {
|
|
28
|
-
command: 'fontSize',
|
|
29
|
-
|
|
30
|
-
data: {
|
|
31
|
-
cssRule: 'font-size'
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
list: [
|
|
35
|
-
'8',
|
|
36
|
-
'9',
|
|
37
|
-
'10',
|
|
38
|
-
'11',
|
|
39
|
-
'12',
|
|
40
|
-
'14',
|
|
41
|
-
'16',
|
|
42
|
-
'18',
|
|
43
|
-
'24',
|
|
44
|
-
'30',
|
|
45
|
-
'36',
|
|
46
|
-
'48',
|
|
47
|
-
'60',
|
|
48
|
-
'72',
|
|
49
|
-
'96'
|
|
50
|
-
],
|
|
51
|
-
|
|
52
|
-
exec: (editor, event, { control }): void | false =>
|
|
53
|
-
memorizeExec(editor, event, { control }, (value: string) => {
|
|
54
|
-
if (control.command?.toLowerCase() === 'fontsize') {
|
|
55
|
-
return `${value}${editor.o.defaultFontSizePoints}`;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return value;
|
|
59
|
-
}),
|
|
60
|
-
|
|
61
|
-
childTemplate: (editor, key: string, value: string) => {
|
|
62
|
-
return `${value}${editor.o.defaultFontSizePoints}`;
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
-
tooltip: 'Font size',
|
|
66
|
-
|
|
67
|
-
isChildActive: (editor, control: IControlType): boolean => {
|
|
68
|
-
const current = editor.s.current(),
|
|
69
|
-
cssKey = control.data?.cssRule || 'font-size',
|
|
70
|
-
normalize =
|
|
71
|
-
control.data?.normalize ||
|
|
72
|
-
((v: string): string => {
|
|
73
|
-
if (
|
|
74
|
-
/pt$/i.test(v) &&
|
|
75
|
-
editor.o.defaultFontSizePoints === 'pt'
|
|
76
|
-
) {
|
|
77
|
-
return v.replace(/pt$/i, '');
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return v;
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
if (current) {
|
|
84
|
-
const currentBpx: HTMLElement =
|
|
85
|
-
(Dom.closest(
|
|
86
|
-
current,
|
|
87
|
-
Dom.isElement,
|
|
88
|
-
editor.editor
|
|
89
|
-
) as HTMLElement) || editor.editor;
|
|
90
|
-
|
|
91
|
-
const value = css(currentBpx, cssKey) as number;
|
|
92
|
-
|
|
93
|
-
return Boolean(
|
|
94
|
-
value &&
|
|
95
|
-
control.args &&
|
|
96
|
-
normalize(control.args[0].toString()) ===
|
|
97
|
-
normalize(value.toString())
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
|
-
} as IControlType<IJodit> as IControlType;
|
|
104
|
-
|
|
105
|
-
Config.prototype.controls.font = {
|
|
106
|
-
...Config.prototype.controls.fontsize,
|
|
107
|
-
command: 'fontname',
|
|
108
|
-
|
|
109
|
-
list: {
|
|
110
|
-
'': 'Default',
|
|
111
|
-
'Helvetica,sans-serif': 'Helvetica',
|
|
112
|
-
'Arial,Helvetica,sans-serif': 'Arial',
|
|
113
|
-
'Georgia,serif': 'Georgia',
|
|
114
|
-
'Impact,Charcoal,sans-serif': 'Impact',
|
|
115
|
-
'Tahoma,Geneva,sans-serif': 'Tahoma',
|
|
116
|
-
'Times New Roman,Times,serif': 'Times New Roman',
|
|
117
|
-
'Verdana,Geneva,sans-serif': 'Verdana'
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
childTemplate: (editor, key: string, value: string) => {
|
|
121
|
-
let isAvailable = false;
|
|
122
|
-
|
|
123
|
-
try {
|
|
124
|
-
isAvailable =
|
|
125
|
-
key.indexOf('dings') === -1 &&
|
|
126
|
-
document.fonts.check(`16px ${key}`, value);
|
|
127
|
-
} catch {}
|
|
128
|
-
|
|
129
|
-
return `<span style="${
|
|
130
|
-
isAvailable ? `font-family: ${key}!important;` : ''
|
|
131
|
-
}">${value}</span>`;
|
|
132
|
-
},
|
|
133
|
-
|
|
134
|
-
data: {
|
|
135
|
-
cssRule: 'font-family',
|
|
136
|
-
normalize: (v: string): string => {
|
|
137
|
-
return v
|
|
138
|
-
.toLowerCase()
|
|
139
|
-
.replace(/['"]+/g, '')
|
|
140
|
-
.replace(/[^a-z0-9]+/g, ',');
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
tooltip: 'Font family'
|
|
145
|
-
} as IControlType<IJodit> as IControlType;
|
|
15
|
+
import './config';
|
|
146
16
|
|
|
147
17
|
/**
|
|
148
18
|
* Process commands `fontsize` and `fontname`
|
|
@@ -186,3 +56,5 @@ export function font(editor: IJodit): void {
|
|
|
186
56
|
.registerCommand('fontsize', callback)
|
|
187
57
|
.registerCommand('fontname', callback);
|
|
188
58
|
}
|
|
59
|
+
|
|
60
|
+
pluginSystem.add('font', font);
|
|
File without changes
|
|
File without changes
|
|
@@ -19,6 +19,10 @@ import type {
|
|
|
19
19
|
import { Config } from 'jodit/config';
|
|
20
20
|
import { Dom } from 'jodit/modules/';
|
|
21
21
|
import { memorizeExec } from 'jodit/core/helpers';
|
|
22
|
+
import { pluginSystem } from 'jodit/core/global';
|
|
23
|
+
import { Icon } from 'jodit/core/ui/icon';
|
|
24
|
+
|
|
25
|
+
Icon.set('paragraph', require('./paragraph.svg'));
|
|
22
26
|
|
|
23
27
|
Config.prototype.controls.paragraph = {
|
|
24
28
|
command: 'formatBlock',
|
|
@@ -136,3 +140,5 @@ export function formatBlock(editor: IJodit): void {
|
|
|
136
140
|
}
|
|
137
141
|
);
|
|
138
142
|
}
|
|
143
|
+
|
|
144
|
+
pluginSystem.add('formatBlock', formatBlock);
|
|
File without changes
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
/**
|
|
8
|
+
* @module plugins/fullsize
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import './fullsize.less';
|
|
12
|
+
|
|
13
|
+
import type { IControlType, IViewBased } from 'jodit/types';
|
|
14
|
+
import { Config } from 'jodit/config';
|
|
15
|
+
import * as consts from 'jodit/core/constants';
|
|
16
|
+
import { Icon } from 'jodit/core/ui/icon';
|
|
17
|
+
|
|
18
|
+
declare module 'jodit/config' {
|
|
19
|
+
interface Config {
|
|
20
|
+
/**
|
|
21
|
+
* Open WYSIWYG in full screen
|
|
22
|
+
* @example
|
|
23
|
+
* ```javascript
|
|
24
|
+
* var editor = Jodit.make({
|
|
25
|
+
* fullsize: true // fullsize editor
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
* @example
|
|
29
|
+
* ```javascript
|
|
30
|
+
* var editor = Jodit.make();
|
|
31
|
+
* editor.e.fire('toggleFullSize');
|
|
32
|
+
* editor.e.fire('toggleFullSize', true); // fullsize
|
|
33
|
+
* editor.e.fire('toggleFullSize', false); // usual mode
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
fullsize: boolean;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* True, after `fullsize` - all editors elements above jodit will get `jodit_fullsize-box_true` class (z-index: 100000 !important;)
|
|
40
|
+
*/
|
|
41
|
+
globalFullSize: boolean;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
Config.prototype.fullsize = false;
|
|
46
|
+
Config.prototype.globalFullSize = true;
|
|
47
|
+
|
|
48
|
+
Icon.set('fullsize', require('./icons/fullsize.svg')).set(
|
|
49
|
+
'shrink',
|
|
50
|
+
require('./icons/shrink.svg')
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
Config.prototype.controls.fullsize = {
|
|
54
|
+
exec: (editor: IViewBased) => {
|
|
55
|
+
editor.toggleFullSize();
|
|
56
|
+
},
|
|
57
|
+
|
|
58
|
+
update(button, editor) {
|
|
59
|
+
const mode = editor.isFullSize ? 'shrink' : 'fullsize';
|
|
60
|
+
|
|
61
|
+
button.state.activated = editor.isFullSize;
|
|
62
|
+
|
|
63
|
+
if (editor.o.textIcons) {
|
|
64
|
+
button.state.text = mode;
|
|
65
|
+
} else {
|
|
66
|
+
button.state.icon.name = mode;
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
tooltip: 'Open editor in fullsize',
|
|
71
|
+
|
|
72
|
+
mode: consts.MODE_SOURCE + consts.MODE_WYSIWYG
|
|
73
|
+
} as IControlType;
|