jodit-pro 4.18.7 → 4.18.9
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/CHANGELOG.md +5 -0
- package/README.md +2 -0
- package/config.js +1 -0
- package/es2015/jodit.css +2 -2
- package/es2015/jodit.fat.min.css +1 -1
- package/es2015/jodit.fat.min.js +41 -26
- package/es2015/jodit.js +1117 -197
- package/es2015/jodit.min.css +1 -1
- package/es2015/jodit.min.js +11 -11
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2015/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.css +1 -1
- package/es2015/plugins/autocomplete/autocomplete.js +1 -1
- package/es2015/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2015/plugins/backup/backup.css +1 -1
- package/es2015/plugins/backup/backup.js +1 -1
- package/es2015/plugins/backup/backup.min.js +1 -1
- package/es2015/plugins/button-generator/button-generator.css +1 -1
- package/es2015/plugins/button-generator/button-generator.js +1 -1
- package/es2015/plugins/button-generator/button-generator.min.js +1 -1
- package/es2015/plugins/change-case/change-case.js +1 -1
- package/es2015/plugins/change-case/change-case.min.js +1 -1
- package/es2015/plugins/chart/chart.css +3 -3
- package/es2015/plugins/chart/chart.js +1 -1
- package/es2015/plugins/chart/chart.min.css +1 -1
- package/es2015/plugins/chart/chart.min.js +1 -1
- package/es2015/plugins/color-picker/color-picker.css +1 -1
- package/es2015/plugins/color-picker/color-picker.js +1 -1
- package/es2015/plugins/color-picker/color-picker.min.js +1 -1
- package/es2015/plugins/emoji/emoji.css +1 -1
- package/es2015/plugins/emoji/emoji.js +1 -1
- package/es2015/plugins/emoji/emoji.min.js +1 -1
- package/es2015/plugins/export-docs/export-docs.js +1 -1
- package/es2015/plugins/export-docs/export-docs.min.js +1 -1
- package/es2015/plugins/finder/finder.css +1 -1
- package/es2015/plugins/finder/finder.js +1 -1
- package/es2015/plugins/finder/finder.min.js +1 -1
- package/es2015/plugins/google-maps/google-maps.css +1 -1
- package/es2015/plugins/google-maps/google-maps.js +1 -1
- package/es2015/plugins/google-maps/google-maps.min.js +1 -1
- package/es2015/plugins/google-search/google-search.js +1 -1
- package/es2015/plugins/google-search/google-search.min.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2015/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2015/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2015/plugins/image-editor-pro/image-editor-pro.css +1 -1
- package/es2015/plugins/image-editor-pro/image-editor-pro.js +1 -1
- package/es2015/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es2015/plugins/keyboard/keyboard.css +1 -1
- package/es2015/plugins/keyboard/keyboard.js +1 -1
- package/es2015/plugins/keyboard/keyboard.min.js +1 -1
- package/es2015/plugins/math/math.css +196 -0
- package/es2015/plugins/math/math.js +1472 -0
- package/es2015/plugins/math/math.min.css +1 -0
- package/es2015/plugins/math/math.min.js +23 -0
- package/es2015/plugins/mobile-view/mobile-view.js +1 -1
- package/es2015/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2015/plugins/page-break/page-break.js +1 -1
- package/es2015/plugins/page-break/page-break.min.js +1 -1
- package/es2015/plugins/paste-code/paste-code.css +1 -1
- package/es2015/plugins/paste-code/paste-code.js +1 -1
- package/es2015/plugins/paste-code/paste-code.min.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2015/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.js +1 -1
- package/es2015/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2015/plugins/style/style.css +1 -1
- package/es2015/plugins/style/style.js +1 -1
- package/es2015/plugins/style/style.min.js +1 -1
- package/es2015/plugins/templates/templates.css +1 -1
- package/es2015/plugins/templates/templates.js +1 -1
- package/es2015/plugins/templates/templates.min.js +1 -1
- package/es2015/plugins/todo-list/todo-list.css +1 -1
- package/es2015/plugins/todo-list/todo-list.js +1 -1
- package/es2015/plugins/todo-list/todo-list.min.js +1 -1
- package/es2015/plugins/translate/translate.css +1 -1
- package/es2015/plugins/translate/translate.js +1 -1
- package/es2015/plugins/translate/translate.min.js +1 -1
- package/es2015/plugins/tune-block/tune-block.css +1 -1
- package/es2015/plugins/tune-block/tune-block.js +1 -1
- package/es2015/plugins/tune-block/tune-block.min.js +1 -1
- package/es2018/jodit.fat.min.css +1 -1
- package/es2018/jodit.fat.min.js +57 -42
- package/es2018/jodit.min.css +1 -1
- package/es2018/jodit.min.js +21 -21
- package/es2018/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2018/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2018/plugins/backup/backup.min.js +1 -1
- package/es2018/plugins/button-generator/button-generator.min.js +1 -1
- package/es2018/plugins/change-case/change-case.min.js +1 -1
- package/es2018/plugins/chart/chart.min.css +1 -1
- package/es2018/plugins/chart/chart.min.js +1 -1
- package/es2018/plugins/color-picker/color-picker.min.js +1 -1
- package/es2018/plugins/emoji/emoji.min.js +1 -1
- package/es2018/plugins/export-docs/export-docs.min.js +1 -1
- package/es2018/plugins/finder/finder.min.js +1 -1
- package/es2018/plugins/google-maps/google-maps.min.js +1 -1
- package/es2018/plugins/google-search/google-search.min.js +1 -1
- package/es2018/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2018/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2018/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es2018/plugins/keyboard/keyboard.min.js +1 -1
- package/es2018/plugins/math/math.min.css +1 -0
- package/es2018/plugins/math/math.min.js +23 -0
- package/es2018/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2018/plugins/page-break/page-break.min.js +1 -1
- package/es2018/plugins/paste-code/paste-code.min.js +1 -1
- package/es2018/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2018/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2018/plugins/style/style.min.js +1 -1
- package/es2018/plugins/templates/templates.min.js +1 -1
- package/es2018/plugins/todo-list/todo-list.min.js +1 -1
- package/es2018/plugins/translate/translate.min.js +1 -1
- package/es2018/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021/jodit.css +2 -2
- package/es2021/jodit.fat.min.css +1 -1
- package/es2021/jodit.fat.min.js +69 -54
- package/es2021/jodit.js +1092 -197
- package/es2021/jodit.min.css +1 -1
- package/es2021/jodit.min.js +14 -14
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2021/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.css +1 -1
- package/es2021/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021/plugins/backup/backup.css +1 -1
- package/es2021/plugins/backup/backup.js +1 -1
- package/es2021/plugins/backup/backup.min.js +1 -1
- package/es2021/plugins/button-generator/button-generator.css +1 -1
- package/es2021/plugins/button-generator/button-generator.js +1 -1
- package/es2021/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021/plugins/change-case/change-case.js +1 -1
- package/es2021/plugins/change-case/change-case.min.js +1 -1
- package/es2021/plugins/chart/chart.css +3 -3
- package/es2021/plugins/chart/chart.js +1 -1
- package/es2021/plugins/chart/chart.min.css +1 -1
- package/es2021/plugins/chart/chart.min.js +1 -1
- package/es2021/plugins/color-picker/color-picker.css +1 -1
- package/es2021/plugins/color-picker/color-picker.js +1 -1
- package/es2021/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021/plugins/emoji/emoji.css +1 -1
- package/es2021/plugins/emoji/emoji.js +1 -1
- package/es2021/plugins/emoji/emoji.min.js +1 -1
- package/es2021/plugins/export-docs/export-docs.js +1 -1
- package/es2021/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021/plugins/finder/finder.css +1 -1
- package/es2021/plugins/finder/finder.js +1 -1
- package/es2021/plugins/finder/finder.min.js +1 -1
- package/es2021/plugins/google-maps/google-maps.css +1 -1
- package/es2021/plugins/google-maps/google-maps.js +1 -1
- package/es2021/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021/plugins/google-search/google-search.js +1 -1
- package/es2021/plugins/google-search/google-search.min.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021/plugins/image-editor-pro/image-editor-pro.css +1 -1
- package/es2021/plugins/image-editor-pro/image-editor-pro.js +1 -1
- package/es2021/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es2021/plugins/keyboard/keyboard.css +1 -1
- package/es2021/plugins/keyboard/keyboard.js +1 -1
- package/es2021/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021/plugins/math/math.css +196 -0
- package/es2021/plugins/math/math.js +1414 -0
- package/es2021/plugins/math/math.min.css +1 -0
- package/es2021/plugins/math/math.min.js +23 -0
- package/es2021/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021/plugins/page-break/page-break.js +1 -1
- package/es2021/plugins/page-break/page-break.min.js +1 -1
- package/es2021/plugins/paste-code/paste-code.css +1 -1
- package/es2021/plugins/paste-code/paste-code.js +1 -1
- package/es2021/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021/plugins/style/style.css +1 -1
- package/es2021/plugins/style/style.js +1 -1
- package/es2021/plugins/style/style.min.js +1 -1
- package/es2021/plugins/templates/templates.css +1 -1
- package/es2021/plugins/templates/templates.js +1 -1
- package/es2021/plugins/templates/templates.min.js +1 -1
- package/es2021/plugins/todo-list/todo-list.css +1 -1
- package/es2021/plugins/todo-list/todo-list.js +1 -1
- package/es2021/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021/plugins/translate/translate.css +1 -1
- package/es2021/plugins/translate/translate.js +1 -1
- package/es2021/plugins/translate/translate.min.js +1 -1
- package/es2021/plugins/tune-block/tune-block.css +1 -1
- package/es2021/plugins/tune-block/tune-block.js +1 -1
- package/es2021/plugins/tune-block/tune-block.min.js +1 -1
- package/es2021.en/jodit.css +2 -2
- package/es2021.en/jodit.fat.min.css +1 -1
- package/es2021.en/jodit.fat.min.js +69 -54
- package/es2021.en/jodit.js +1092 -197
- package/es2021.en/jodit.min.css +1 -1
- package/es2021.en/jodit.min.js +30 -30
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es2021.en/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.css +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.js +1 -1
- package/es2021.en/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es2021.en/plugins/backup/backup.css +1 -1
- package/es2021.en/plugins/backup/backup.js +1 -1
- package/es2021.en/plugins/backup/backup.min.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.css +1 -1
- package/es2021.en/plugins/button-generator/button-generator.js +1 -1
- package/es2021.en/plugins/button-generator/button-generator.min.js +1 -1
- package/es2021.en/plugins/change-case/change-case.js +1 -1
- package/es2021.en/plugins/change-case/change-case.min.js +1 -1
- package/es2021.en/plugins/chart/chart.css +3 -3
- package/es2021.en/plugins/chart/chart.js +1 -1
- package/es2021.en/plugins/chart/chart.min.css +1 -1
- package/es2021.en/plugins/chart/chart.min.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.css +1 -1
- package/es2021.en/plugins/color-picker/color-picker.js +1 -1
- package/es2021.en/plugins/color-picker/color-picker.min.js +1 -1
- package/es2021.en/plugins/emoji/emoji.css +1 -1
- package/es2021.en/plugins/emoji/emoji.js +1 -1
- package/es2021.en/plugins/emoji/emoji.min.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.js +1 -1
- package/es2021.en/plugins/export-docs/export-docs.min.js +1 -1
- package/es2021.en/plugins/finder/finder.css +1 -1
- package/es2021.en/plugins/finder/finder.js +1 -1
- package/es2021.en/plugins/finder/finder.min.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.css +1 -1
- package/es2021.en/plugins/google-maps/google-maps.js +1 -1
- package/es2021.en/plugins/google-maps/google-maps.min.js +1 -1
- package/es2021.en/plugins/google-search/google-search.js +1 -1
- package/es2021.en/plugins/google-search/google-search.min.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es2021.en/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es2021.en/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.css +1 -1
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.js +1 -1
- package/es2021.en/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.css +1 -1
- package/es2021.en/plugins/keyboard/keyboard.js +1 -1
- package/es2021.en/plugins/keyboard/keyboard.min.js +1 -1
- package/es2021.en/plugins/math/math.css +196 -0
- package/es2021.en/plugins/math/math.js +1414 -0
- package/es2021.en/plugins/math/math.min.css +1 -0
- package/es2021.en/plugins/math/math.min.js +23 -0
- package/es2021.en/plugins/mobile-view/mobile-view.js +1 -1
- package/es2021.en/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es2021.en/plugins/page-break/page-break.js +1 -1
- package/es2021.en/plugins/page-break/page-break.min.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.css +1 -1
- package/es2021.en/plugins/paste-code/paste-code.js +1 -1
- package/es2021.en/plugins/paste-code/paste-code.min.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es2021.en/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.js +1 -1
- package/es2021.en/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es2021.en/plugins/style/style.css +1 -1
- package/es2021.en/plugins/style/style.js +1 -1
- package/es2021.en/plugins/style/style.min.js +1 -1
- package/es2021.en/plugins/templates/templates.css +1 -1
- package/es2021.en/plugins/templates/templates.js +1 -1
- package/es2021.en/plugins/templates/templates.min.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.css +1 -1
- package/es2021.en/plugins/todo-list/todo-list.js +1 -1
- package/es2021.en/plugins/todo-list/todo-list.min.js +1 -1
- package/es2021.en/plugins/translate/translate.css +1 -1
- package/es2021.en/plugins/translate/translate.js +1 -1
- package/es2021.en/plugins/translate/translate.min.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.css +1 -1
- package/es2021.en/plugins/tune-block/tune-block.js +1 -1
- package/es2021.en/plugins/tune-block/tune-block.min.js +1 -1
- package/es5/jodit.css +3 -3
- package/es5/jodit.fat.min.css +1 -1
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +1254 -207
- package/es5/jodit.min.css +3 -3
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.css +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.js +1 -1
- package/es5/plugins/ai-assistant-pro/ai-assistant-pro.min.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.css +1 -1
- package/es5/plugins/autocomplete/autocomplete.js +1 -1
- package/es5/plugins/autocomplete/autocomplete.min.js +1 -1
- package/es5/plugins/backup/backup.css +1 -1
- package/es5/plugins/backup/backup.js +1 -1
- package/es5/plugins/backup/backup.min.js +1 -1
- package/es5/plugins/button-generator/button-generator.css +1 -1
- package/es5/plugins/button-generator/button-generator.js +1 -1
- package/es5/plugins/button-generator/button-generator.min.js +1 -1
- package/es5/plugins/change-case/change-case.js +1 -1
- package/es5/plugins/change-case/change-case.min.js +1 -1
- package/es5/plugins/chart/chart.css +3 -3
- package/es5/plugins/chart/chart.js +1 -1
- package/es5/plugins/chart/chart.min.css +1 -1
- package/es5/plugins/chart/chart.min.js +1 -1
- package/es5/plugins/color-picker/color-picker.css +1 -1
- package/es5/plugins/color-picker/color-picker.js +1 -1
- package/es5/plugins/color-picker/color-picker.min.js +1 -1
- package/es5/plugins/emoji/emoji.css +1 -1
- package/es5/plugins/emoji/emoji.js +1 -1
- package/es5/plugins/emoji/emoji.min.js +1 -1
- package/es5/plugins/export-docs/export-docs.js +1 -1
- package/es5/plugins/export-docs/export-docs.min.js +1 -1
- package/es5/plugins/finder/finder.css +1 -1
- package/es5/plugins/finder/finder.js +1 -1
- package/es5/plugins/finder/finder.min.js +1 -1
- package/es5/plugins/google-maps/google-maps.css +1 -1
- package/es5/plugins/google-maps/google-maps.js +1 -1
- package/es5/plugins/google-maps/google-maps.min.js +1 -1
- package/es5/plugins/google-search/google-search.js +1 -1
- package/es5/plugins/google-search/google-search.min.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.js +1 -1
- package/es5/plugins/highlight-signature/highlight-signature.min.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.css +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.js +1 -1
- package/es5/plugins/iframe-editor/iframe-editor.min.js +1 -1
- package/es5/plugins/image-editor-pro/image-editor-pro.css +1 -1
- package/es5/plugins/image-editor-pro/image-editor-pro.js +1 -1
- package/es5/plugins/image-editor-pro/image-editor-pro.min.js +1 -1
- package/es5/plugins/keyboard/keyboard.css +1 -1
- package/es5/plugins/keyboard/keyboard.js +1 -1
- package/es5/plugins/keyboard/keyboard.min.js +1 -1
- package/es5/plugins/math/math.css +196 -0
- package/es5/plugins/math/math.js +1624 -0
- package/es5/plugins/math/math.min.css +1 -0
- package/es5/plugins/math/math.min.js +8 -0
- package/es5/plugins/mobile-view/mobile-view.js +1 -1
- package/es5/plugins/mobile-view/mobile-view.min.js +1 -1
- package/es5/plugins/page-break/page-break.js +1 -1
- package/es5/plugins/page-break/page-break.min.js +1 -1
- package/es5/plugins/paste-code/paste-code.css +1 -1
- package/es5/plugins/paste-code/paste-code.js +1 -1
- package/es5/plugins/paste-code/paste-code.min.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.js +1 -1
- package/es5/plugins/paste-from-word/paste-from-word.min.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.js +1 -1
- package/es5/plugins/show-blocks/show-blocks.min.js +1 -1
- package/es5/plugins/style/style.css +1 -1
- package/es5/plugins/style/style.js +1 -1
- package/es5/plugins/style/style.min.js +1 -1
- package/es5/plugins/templates/templates.css +1 -1
- package/es5/plugins/templates/templates.js +1 -1
- package/es5/plugins/templates/templates.min.js +1 -1
- package/es5/plugins/todo-list/todo-list.css +1 -1
- package/es5/plugins/todo-list/todo-list.js +1 -1
- package/es5/plugins/todo-list/todo-list.min.js +1 -1
- package/es5/plugins/translate/translate.css +1 -1
- package/es5/plugins/translate/translate.js +1 -1
- package/es5/plugins/translate/translate.min.js +1 -1
- package/es5/plugins/tune-block/tune-block.css +1 -1
- package/es5/plugins/tune-block/tune-block.js +1 -1
- package/es5/plugins/tune-block/tune-block.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/config.d.ts +30 -0
- package/esm/plugins/all.js +1 -1
- package/esm/plugins/math/assets/math-block.svg.js +1 -0
- package/esm/plugins/math/assets/math-inline.svg.js +1 -0
- package/esm/plugins/math/assets/math.svg.js +1 -0
- package/esm/plugins/math/config.d.ts +34 -0
- package/esm/plugins/math/config.js +1 -0
- package/esm/plugins/math/helpers.d.ts +33 -0
- package/esm/plugins/math/helpers.js +1 -0
- package/esm/plugins/math/interface.d.ts +45 -0
- package/esm/plugins/math/interface.js +0 -0
- package/esm/plugins/math/math.d.ts +66 -0
- package/esm/plugins/math/math.js +1 -0
- package/esm/plugins/math/mathjax.d.ts +17 -0
- package/esm/plugins/math/mathjax.js +1 -0
- package/esm/plugins/math/ui/editor/editor.d.ts +56 -0
- package/esm/plugins/math/ui/editor/editor.js +16 -0
- package/package.json +1 -1
- package/types/config.d.ts +30 -0
- package/types/plugins/math/config.d.ts +34 -0
- package/types/plugins/math/helpers.d.ts +33 -0
- package/types/plugins/math/interface.d.ts +45 -0
- package/types/plugins/math/math.d.ts +66 -0
- package/types/plugins/math/mathjax.d.ts +17 -0
- package/types/plugins/math/ui/editor/editor.d.ts +56 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
export type MathFormat = 'latex' | 'mathml';
|
|
7
|
+
export type MathDisplay = 'block' | 'inline';
|
|
8
|
+
export type MathAlign = 'left' | 'center' | 'right';
|
|
9
|
+
export interface IMathData {
|
|
10
|
+
format: MathFormat;
|
|
11
|
+
display: MathDisplay;
|
|
12
|
+
source: string;
|
|
13
|
+
background?: string;
|
|
14
|
+
textColor?: string;
|
|
15
|
+
borderColor?: string;
|
|
16
|
+
align?: MathAlign;
|
|
17
|
+
wrap?: boolean;
|
|
18
|
+
width?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface IMathSymbol {
|
|
21
|
+
label: string;
|
|
22
|
+
latex: string;
|
|
23
|
+
mathml: string;
|
|
24
|
+
}
|
|
25
|
+
export interface IMathTemplate {
|
|
26
|
+
title: string;
|
|
27
|
+
latex: string;
|
|
28
|
+
mathml: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IMathRenderResult {
|
|
31
|
+
svg: string;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IMathJax {
|
|
35
|
+
tex2svg(tex: string, options?: {
|
|
36
|
+
display?: boolean;
|
|
37
|
+
}): HTMLElement;
|
|
38
|
+
mathml2svg(mml: string, options?: {
|
|
39
|
+
display?: boolean;
|
|
40
|
+
}): HTMLElement;
|
|
41
|
+
startup: {
|
|
42
|
+
promise: Promise<unknown>;
|
|
43
|
+
};
|
|
44
|
+
texReset?: () => void;
|
|
45
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
import type { IJodit, Nullable } from "jodit/esm/types/index";
|
|
7
|
+
import "./config";
|
|
8
|
+
import { Plugin } from "jodit/esm/core/plugin/index";
|
|
9
|
+
/**
|
|
10
|
+
* Inserts LaTeX / MathML formulas rendered by MathJax as standalone SVG,
|
|
11
|
+
* either as a block or inline, and lets the user edit or remove them.
|
|
12
|
+
*/
|
|
13
|
+
export declare class MathPlugin extends Plugin {
|
|
14
|
+
static requires: string[];
|
|
15
|
+
buttons: Plugin['buttons'];
|
|
16
|
+
private __dialog;
|
|
17
|
+
private __editor;
|
|
18
|
+
private __saveButton;
|
|
19
|
+
private __popup;
|
|
20
|
+
private __toolbar;
|
|
21
|
+
private __target;
|
|
22
|
+
protected afterInit(jodit: IJodit): void;
|
|
23
|
+
protected beforeDestruct(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Opens the editor dialog for a new formula or for an existing one.
|
|
26
|
+
*/
|
|
27
|
+
openEditor(target?: Nullable<Node>, display?: unknown): void;
|
|
28
|
+
/**
|
|
29
|
+
* Removes the formula that owns the given node.
|
|
30
|
+
*/
|
|
31
|
+
removeMath(target?: Nullable<Node>): void;
|
|
32
|
+
private __submit;
|
|
33
|
+
private __save;
|
|
34
|
+
/**
|
|
35
|
+
* A block formula must not stay inside a paragraph, an inline one is
|
|
36
|
+
* inserted at the caret.
|
|
37
|
+
*/
|
|
38
|
+
private __insert;
|
|
39
|
+
private __getDialog;
|
|
40
|
+
protected onClick(e: MouseEvent): void;
|
|
41
|
+
protected onDblClick(e: MouseEvent): void;
|
|
42
|
+
protected onOutsideClick(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Shows the contextual popup (edit / delete) at the formula.
|
|
45
|
+
*/
|
|
46
|
+
openPopup(element: HTMLElement): void;
|
|
47
|
+
closePopup(): void;
|
|
48
|
+
/**
|
|
49
|
+
* An inline formula that carries data but no SVG is an empty `<span>`,
|
|
50
|
+
* which the core cleaner drops before MathJax can fill it. The source is
|
|
51
|
+
* written into such elements as a placeholder; the render replaces it.
|
|
52
|
+
*/
|
|
53
|
+
protected onBeforeSetValue(value: unknown): string | void;
|
|
54
|
+
/**
|
|
55
|
+
* Decorates formulas that arrived with the value and renders the ones
|
|
56
|
+
* that carry data but no SVG yet.
|
|
57
|
+
*/
|
|
58
|
+
protected onChange(): void;
|
|
59
|
+
private __decorateAll;
|
|
60
|
+
/**
|
|
61
|
+
* The core resizer sets a pixel box on the figure; the width goes into
|
|
62
|
+
* the data and the explicit height is dropped so the SVG keeps its ratio.
|
|
63
|
+
*/
|
|
64
|
+
private __syncResized;
|
|
65
|
+
private __renderMissing;
|
|
66
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var p=(u,t)=>w(u,"name",{value:t,configurable:!0});var h=function(u,t,o,i){var s=arguments.length,e=s<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(u,t,o,i);else for(var a=u.length-1;a>=0;a--)(n=u[a])&&(e=(s<3?n(e):s>3?n(t,o,e):n(t,o))||e);return s>3&&e&&Object.defineProperty(t,o,e),e};import"./config.js";import{UIMathEditor as S}from"./ui/editor/editor.js";import{applyMathData as f,createMath as D,decorateMath as A,defaultMathData as P,findMath as _,isMathDisplay as k,isMathElement as R,MATH_ATTR as g,mathTag as y,pixels as b,readMathData as d}from"./helpers.js";import{loadMathJax as B,renderMath as M}from"./mathjax.js";import{autobind as C,debounce as T,watch as c}from"jodit/esm/core/decorators/index.js";import{Dom as l}from"jodit/esm/core/dom/dom.js";import{toArray as E}from"jodit/esm/core/helpers/array/to-array.js";import{isString as q}from"jodit/esm/core/helpers/checker/is-string.js";import{position as O}from"jodit/esm/core/helpers/size/position.js";import{Plugin as x}from"jodit/esm/core/plugin/index.js";import{Button as j}from"jodit/esm/core/ui/button/button/button.js";import{Popup as z}from"jodit/esm/core/ui/popup/popup.js";import{Dialog as V}from"jodit/esm/modules/dialog/dialog.js";import{makeCollection as H}from"jodit/esm/modules/toolbar/factory.js";import{JoditPro as I}from"../../jodit-pro.js";const v=class v extends x{constructor(){super(...arguments),this.buttons=[{name:"math",group:"insert"}],this.__dialog=null,this.__editor=null,this.__saveButton=null,this.__popup=null,this.__toolbar=null,this.__target=null}afterInit(t){t.e.on("openMathEditor",this.openEditor).on("removeMath",this.removeMath).on("isMathEditorOpened",()=>{var o;return!!(!((o=this.__dialog)===null||o===void 0)&&o.isOpened)}),t.registerCommand("insertMath",(o,i,s)=>(this.openEditor(null,s),!1)),this.__decorateAll()}beforeDestruct(){var t,o;this.closePopup(),(t=this.__popup)===null||t===void 0||t.destruct(),(o=this.__dialog)===null||o===void 0||o.destruct()}openEditor(t,o){const i=_(this.j,t??null),s=i&&d(this.j,i)||P(this.j,k(o)?o:void 0);this.closePopup(),this.j.s.save(),B(this.j).catch(()=>null);const e=this.__getDialog(),n=this.__editor;if(!n)return;n.setData(s);const a=j(e,"ok","Save","primary").onAction(()=>this.__submit(i));this.__saveButton=a,a.setState({disabled:!s.source});const m=[j(e,"cancel","Cancel","default").onAction(()=>e.close())];i&&m.unshift(j(e,"bin","","default").onAction(()=>{e.close(),this.removeMath(i)})),e.setHeader(this.j.i18n(i?"Edit equation":"Insert equation")).setFooter([m,a]).open(),n.focus()}removeMath(t){const o=_(this.j,t??this.__target);this.closePopup(),o&&(this.j.s.setCursorAfter(o),l.safeRemove(o),this.j.synchronizeValues())}__submit(t){const o=this.__editor,i=this.__dialog;if(!o||!i)return;const s=o.getData();s.source&&M(this.j,s).then(e=>{if(e.error)throw new Error(e.error);i.close(),this.__save(t,s,e.svg)}).catch(e=>{this.j.message.error(e.message)})}__save(t,o,i){t&&!l.isTag(t,y(o.display))&&(t=l.replace(t,y(o.display),this.j.createInside)),t?f(this.j,t,o,i):(t=D(this.j,o,i),this.j.s.restore(),this.__insert(t,o.display)),this.j.s.setCursorAfter(t),this.j.synchronizeValues()}__insert(t,o){if(this.j.s.insertNode(t,!1,!1),o!=="block")return;let i=t.parentElement;for(;i&&i!==this.j.editor;){if(l.after(i,t),l.isBlock(i)){l.isEmpty(i)&&l.safeRemove(i);break}i=t.parentElement}}__getDialog(){if(!this.__dialog){const{dialog:t}=this.j.o.math;this.__dialog=new V({language:this.j.o.language,theme:this.j.o.theme,shadowRoot:this.j.o.shadowRoot,events:this.j.o.events}),this.__editor=new S(this.j,{onSubmit:p(()=>{var o;(o=this.__saveButton)===null||o===void 0||o.container.click()},"onSubmit"),onChange:p(o=>{var i;(i=this.__saveButton)===null||i===void 0||i.setState({disabled:!o.source})},"onChange")}),this.__dialog.setContent(this.__editor).setSize(t.width,t.height),this.__dialog.e.on("beforeClose",()=>{this.j.s.restore()})}return this.__dialog}onClick(t){const o=_(this.j,t.target);o?this.openPopup(o):this.closePopup()}onDblClick(t){const o=_(this.j,t.target);o&&this.openEditor(o)}onOutsideClick(){this.closePopup()}openPopup(t){if(this.j.o.readonly||!this.j.o.math.popup.length)return;this.__popup||(this.__popup=new z(this.j,!1),this.__toolbar=H(this.j,this.__popup));const o=this.__popup,i=this.__toolbar;i&&(this.__target=t,i.build(this.j.o.math.popup,t),o.setContent(i.container),o.isOpened?o.updatePosition():o.open(()=>O(t,this.j)))}closePopup(){var t;this.__target=null,(t=this.__popup)===null||t===void 0||t.close()}onBeforeSetValue(t){if(!q(t)||!t.includes(g))return;const o=this.j.c.div();o.innerHTML=t;let i=!1;return E(o.querySelectorAll(`[${g}]`)).forEach(s=>{const e=d(this.j,s);e&&!s.querySelector("svg")&&!s.textContent&&(s.textContent=e.source,i=!0)}),i?o.innerHTML:void 0}onChange(){this.__decorateAll(),this.__target&&!this.j.editor.contains(this.__target)&&this.closePopup()}__decorateAll(){let t=!1;E(this.j.editor.querySelectorAll(`[${g}]`)).forEach(o=>{R(o,this.j.o.math.className)&&(A(this.j,o),o.querySelector("svg")?t=this.__syncResized(o)||t:this.__renderMissing(o))}),t&&this.j.synchronizeValues()}__syncResized(t){const o=d(this.j,t);if(!o||o.display!=="block")return!1;const i=b(t.style.width),s=b(t.style.height);if((!i||i===o.width)&&!s)return!1;const e=t.querySelector("svg");return e?(f(this.j,t,{...o,width:i||o.width},e.outerHTML),!0):!1}__renderMissing(t){const o=d(this.j,t);!o||!o.source||M(this.j,o).then(i=>{this.j.editor.contains(t)&&(f(this.j,t,o,i.svg),this.j.synchronizeValues())}).catch(()=>null)}};p(v,"MathPlugin");let r=v;r.requires=["license"],h([C],r.prototype,"openEditor",null),h([C],r.prototype,"removeMath",null),h([c(":click")],r.prototype,"onClick",null),h([c(":dblclick")],r.prototype,"onDblClick",null),h([c(":outsideClick")],r.prototype,"onOutsideClick",null),h([c(":beforeSetValueToEditor")],r.prototype,"onBeforeSetValue",null),h([c([":change",":afterSetMode"]),T()],r.prototype,"onChange",null),I.plugins.add("math",r);export{r as MathPlugin};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
import type { IJodit } from "jodit/esm/types/index";
|
|
7
|
+
import type { IMathData, IMathJax, IMathRenderResult } from "./interface";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the MathJax instance of the owner window, loading it from
|
|
10
|
+
* `math.mathJaxUrl` on first use. A MathJax that the host page already
|
|
11
|
+
* loaded is reused as is.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadMathJax(jodit: IJodit): Promise<IMathJax>;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the formula to a standalone SVG string.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderMath(jodit: IJodit, data: IMathData): Promise<IMathRenderResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var v=Object.defineProperty;var i=(e,r)=>v(e,"name",{value:r,configurable:!0});import{wrapMathML as c}from"./helpers.js";import{appendScriptAsync as h}from"jodit/esm/core/helpers/utils/append-script.js";import{attr as s}from"jodit/esm/core/helpers/utils/attr.js";function d(e){var r;const t=e.ow;return!((r=t.MathJax)===null||r===void 0)&&r.tex2svg?Promise.resolve(t.MathJax):(t.MathJax||(t.MathJax={svg:{fontCache:"local"},startup:{typeset:!1}}),h(e,e.o.math.mathJaxUrl).then(()=>{var o,a;return(a=(o=t.MathJax)===null||o===void 0?void 0:o.startup)===null||a===void 0?void 0:a.promise}).then(()=>{var o;if(!(!((o=t.MathJax)===null||o===void 0)&&o.tex2svg))throw new Error("MathJax did not initialize");return t.MathJax}))}i(d,"loadMathJax");function g(e,r){return d(e).then(t=>{var o;const a=r.display==="block";(o=t.texReset)===null||o===void 0||o.call(t);const n=(r.format==="mathml"?t.mathml2svg(c(r.source,r.display),{display:a}):t.tex2svg(r.source,{display:a})).querySelector("svg");if(!n)throw new Error("MathJax did not return an SVG");const l=n.querySelector("[data-mjx-error]"),u=l?s(l,"data-mjx-error")||"Syntax error":void 0;return s(n,{role:"img","aria-label":r.source,focusable:null}),{svg:n.outerHTML,error:u}})}i(g,"renderMath");export{d as loadMathJax,g as renderMath};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
import type { IJodit } from "jodit/esm/types/index";
|
|
7
|
+
import type { IMathData } from "../../interface";
|
|
8
|
+
import { UIElement } from "jodit/esm/core/ui/index";
|
|
9
|
+
interface IMathEditorOptions {
|
|
10
|
+
onSubmit: () => void;
|
|
11
|
+
onChange: (data: IMathData) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Dialog body of the equation editor: format tabs, a symbol palette, the
|
|
15
|
+
* source textarea and a live preview rendered by MathJax.
|
|
16
|
+
*/
|
|
17
|
+
export declare class UIMathEditor extends UIElement<IJodit> {
|
|
18
|
+
private readonly handlers;
|
|
19
|
+
className(): string;
|
|
20
|
+
state: IMathData;
|
|
21
|
+
private tabs;
|
|
22
|
+
private source;
|
|
23
|
+
private templates;
|
|
24
|
+
private colorInputs;
|
|
25
|
+
private alignButtons;
|
|
26
|
+
private alignBox;
|
|
27
|
+
private wrapButton;
|
|
28
|
+
private drafts;
|
|
29
|
+
private renderId;
|
|
30
|
+
protected render(): string;
|
|
31
|
+
constructor(jodit: IJodit, handlers: IMathEditorOptions);
|
|
32
|
+
/**
|
|
33
|
+
* Color swatches and the alignment switch shown in the preview corner.
|
|
34
|
+
*/
|
|
35
|
+
private buildAppearance;
|
|
36
|
+
private colorField;
|
|
37
|
+
/**
|
|
38
|
+
* Mirrors the appearance part of the state into the controls.
|
|
39
|
+
*/
|
|
40
|
+
private syncAppearance;
|
|
41
|
+
/**
|
|
42
|
+
* Loads a copy of the data into the form and renders the preview.
|
|
43
|
+
*/
|
|
44
|
+
setData(data: IMathData): void;
|
|
45
|
+
getData(): IMathData;
|
|
46
|
+
focus(): void;
|
|
47
|
+
private setFormat;
|
|
48
|
+
/**
|
|
49
|
+
* Replaces the source with a predefined formula in the active format.
|
|
50
|
+
*/
|
|
51
|
+
private applyTemplate;
|
|
52
|
+
private insertSymbol;
|
|
53
|
+
private refresh;
|
|
54
|
+
private __render;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var b=Object.defineProperty;var u=(h,t)=>b(h,"name",{value:t,configurable:!0});var o,g=function(h,t,e,s){var n=arguments.length,i=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,e):s,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(h,t,e,s);else for(var a=h.length-1;a>=0;a--)(l=h[a])&&(i=(n<3?l(i):n>3?l(t,e,i):l(t,e))||i);return n>3&&i&&Object.defineProperty(t,e,i),i};import{FORMAT_TITLES as v,mathStyle as x}from"../../helpers.js";import{renderMath as y}from"../../mathjax.js";import{component as E,debounce as w}from"jodit/esm/core/decorators/index.js";import{assert as c}from"jodit/esm/core/helpers/utils/assert.js";import{attr as p}from"jodit/esm/core/helpers/utils/attr.js";import{Button as d,UIElement as C,UISelect as B,UITextArea as A}from"jodit/esm/core/ui/index.js";const f=["latex","mathml"],_={latex:"e.g. x^2 + y^2 = r^2",mathml:"e.g. <msup><mi>x</mi><mn>2</mn></msup>"};let m=(o=class extends C{className(){return"UIMathEditor"}render(){return`<div>
|
|
2
|
+
<div class="&__head">
|
|
3
|
+
<div class="&__tabs"></div>
|
|
4
|
+
<div class="&__templates"></div>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="&__symbols"></div>
|
|
7
|
+
<div class="&__source"></div>
|
|
8
|
+
<div class="&__preview-title">~Preview~</div>
|
|
9
|
+
<div class="&__preview">
|
|
10
|
+
<div class="&__appearance"></div>
|
|
11
|
+
<div class="&__canvas">
|
|
12
|
+
<span class="&__placeholder">~Your equation will render here~</span>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="&__error"></div>
|
|
16
|
+
</div>`}constructor(t,e){super(t),this.handlers=e,this.tabs={},this.templates=null,this.colorInputs={},this.alignButtons={},this.alignBox=null,this.wrapButton=null,this.drafts={latex:"",mathml:""},this.renderId=0;const s=this.getElm("tabs");c(s!=null,"tabs element does not exist"),f.forEach(a=>{const r=d(t,"",v[a]).onAction(()=>this.setFormat(a));p(r.container,"data-format",a),this.tabs[a]=r,s.appendChild(r.container)});const n=this.getElm("templates");c(n!=null,"templates element does not exist"),t.o.math.templates.length&&(this.templates=new B(t,{name:"template",options:[{value:"",text:t.i18n("Templates")},...t.o.math.templates.map((a,r)=>({value:String(r),text:t.i18n(a.title)}))],onChange:u(a=>this.applyTemplate(a),"onChange")}),n.appendChild(this.templates.container));const i=this.getElm("symbols");c(i!=null,"symbols element does not exist"),t.o.math.symbols.forEach(a=>{const r=d(t,"",a.label).onAction(()=>this.insertSymbol(this.state.format==="mathml"?a.mathml:a.latex));r.container.classList.add(this.getFullElName("symbol")),p(r.container,"title",a.latex),i.appendChild(r.container)}),this.source=new A(t,{name:"source",label:v.latex,placeholder:_.latex,resizable:!0,size:4,onChange:u(a=>{this.state.source=a,this.drafts[this.state.format]=a,this.handlers.onChange(this.getData()),this.refresh()},"onChange")}),t.e.on(this.source.nativeInput,"keydown",a=>{a.key==="Enter"&&(a.ctrlKey||a.metaKey)&&(a.preventDefault(),this.handlers.onSubmit())});const l=this.getElm("source");c(l!=null,"source element does not exist"),l.appendChild(this.source.container),this.buildAppearance()}buildAppearance(){const{j:t}=this,{math:e}=t.o,s=this.getElm("appearance");c(s!=null,"appearance element does not exist"),[["background","Background",e.allowChangeBackground],["textColor","Text",e.allowChangeTextColor],["borderColor","Border",e.allowChangeBorderColor]].forEach(([i,l,a])=>{a&&s.appendChild(this.colorField(i,l))}),e.allowChangeAlign&&(this.alignBox=t.c.div(this.getFullElName("align")),["left","center","right"].forEach(i=>{var l;const a=d(t,i,"","initial").onAction(()=>{this.state.align=i,this.syncAppearance(),this.__render()});p(a.container,"data-align",i),this.alignButtons[i]=a,(l=this.alignBox)===null||l===void 0||l.appendChild(a.container)}),e.allowChangeWrap&&(this.wrapButton=d(t,"","Wrap text","initial").onAction(()=>{this.state.wrap=!this.state.wrap,this.syncAppearance(),this.__render()}),p(this.wrapButton.container,"name","wrap"),this.alignBox.appendChild(this.wrapButton.container)),s.appendChild(this.alignBox)),s.childNodes.length||s.remove()}colorField(t,e){const{j:s}=this,n=s.c.element("input",{type:"color",name:t,class:this.getFullElName("color-input")});s.e.on(n,"input",()=>{this.state[t]=n.value,this.syncAppearance(),this.__render()});const i=s.c.element("button",{type:"button",name:`${t}Reset`,title:s.i18n("None"),class:this.getFullElName("color-reset")});return i.textContent="\xD7",s.e.on(i,"click",()=>{this.state[t]="",this.syncAppearance(),this.__render()}),this.colorInputs[t]=n,s.c.element("label",{class:this.getFullElName("color-field")},[n,s.c.span(this.getFullElName("color-label"),s.i18n(e)),i])}syncAppearance(){if(Object.keys(this.colorInputs).forEach(t=>{const e=this.colorInputs[t];if(!e)return;const s=this.state[t]||"";e.classList.toggle(this.getFullElName("color-input","empty"),!s),s&&(e.value=s)}),Object.keys(this.alignButtons).forEach(t=>{var e;(e=this.alignButtons[t])===null||e===void 0||e.setState({variant:this.state.align===t?"primary":"initial"})}),this.alignBox&&(this.alignBox.style.display=this.state.display==="block"?"":"none"),this.wrapButton){const t=this.state.align!=="center";this.wrapButton.container.style.display=t?"":"none",this.wrapButton.setState({variant:this.state.wrap&&t?"primary":"initial"})}}setData(t){this.state={...t},this.drafts={latex:"",mathml:""},this.drafts[t.format]=t.source,this.syncAppearance(),this.setFormat(t.format)}getData(){return{...this.state,source:this.state.source.trim()}}focus(){this.source.focus()}setFormat(t){this.state.format=t,this.state.source=this.drafts[t],f.forEach(e=>{var s,n;(s=this.tabs[e])===null||s===void 0||s.setMod("active",e===t),(n=this.tabs[e])===null||n===void 0||n.setState({variant:e===t?"primary":"initial"})}),this.source.state.label=v[t],this.source.state.placeholder=_[t],this.source.value=this.state.source,this.handlers.onChange(this.getData()),this.__render()}applyTemplate(t){const e=this.j.o.math.templates[Number(t)];t===""||!e||!this.templates||(this.source.value=this.state.format==="mathml"?e.mathml:e.latex,this.templates.value="",this.source.focus())}insertSymbol(t){var e,s;const n=this.source.nativeInput,i=(e=n.selectionStart)!==null&&e!==void 0?e:n.value.length,l=(s=n.selectionEnd)!==null&&s!==void 0?s:i;n.setRangeText(t,i,l,"end"),n.focus(),this.j.e.fire(n,"input")}refresh(){this.__render()}__render(){const t=this.getElm("canvas"),e=this.getElm("error"),s=this.getData(),n=++this.renderId;if(!(!t||!e)){if(e.textContent="",p(t,"style",x(s)||null),!s.source){t.innerHTML=`<span class="${this.getFullElName("placeholder")}">${this.j.i18n("Your equation will render here")}</span>`;return}y(this.j,s).then(i=>{var l;n===this.renderId&&(t.innerHTML=i.svg,e.textContent=(l=i.error)!==null&&l!==void 0?l:"")}).catch(i=>{n===this.renderId&&(e.textContent=i.message)})}}},u(o,"UIMathEditor"),o);g([w(300)],m.prototype,"refresh",null),m=g([E],m);export{m as UIMathEditor};
|
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
|
@@ -21,6 +21,11 @@ import type { IJodit } from "jodit/esm/types/index";
|
|
|
21
21
|
import type { IKeys } from "./plugins/keyboard/interface";
|
|
22
22
|
import type { ButtonGroup } from "jodit/esm/types/index";
|
|
23
23
|
import type { ILayoutKeys } from "./plugins/keyboard/interface";
|
|
24
|
+
import type { MathFormat } from "./plugins/math/interface";
|
|
25
|
+
import type { MathDisplay } from "./plugins/math/interface";
|
|
26
|
+
import type { MathAlign } from "./plugins/math/interface";
|
|
27
|
+
import type { IMathSymbol } from "./plugins/math/interface";
|
|
28
|
+
import type { IMathTemplate } from "./plugins/math/interface";
|
|
24
29
|
import type { CanPromise } from "jodit/esm/types/index";
|
|
25
30
|
import type { IUIOption } from "jodit/esm/types/index";
|
|
26
31
|
import type { IStyleDefinition } from "./plugins/style/interface";
|
|
@@ -199,6 +204,31 @@ interface Config {
|
|
|
199
204
|
periodKeyRepeat: number;
|
|
200
205
|
};
|
|
201
206
|
}
|
|
207
|
+
interface Config {
|
|
208
|
+
math: {
|
|
209
|
+
className: string;
|
|
210
|
+
mathJaxUrl: string;
|
|
211
|
+
defaultFormat: MathFormat;
|
|
212
|
+
defaultDisplay: MathDisplay;
|
|
213
|
+
defaultBackground: string;
|
|
214
|
+
defaultTextColor: string;
|
|
215
|
+
defaultBorderColor: string;
|
|
216
|
+
defaultAlign: MathAlign;
|
|
217
|
+
defaultWrap: boolean;
|
|
218
|
+
allowChangeBackground: boolean;
|
|
219
|
+
allowChangeTextColor: boolean;
|
|
220
|
+
allowChangeBorderColor: boolean;
|
|
221
|
+
allowChangeAlign: boolean;
|
|
222
|
+
allowChangeWrap: boolean;
|
|
223
|
+
symbols: IMathSymbol[];
|
|
224
|
+
templates: IMathTemplate[];
|
|
225
|
+
popup: Array<IControlType | string>;
|
|
226
|
+
dialog: {
|
|
227
|
+
width: number;
|
|
228
|
+
height: number;
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
}
|
|
202
232
|
interface Config {
|
|
203
233
|
mobileView: {
|
|
204
234
|
mode: string | number;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
import type { IControlType } from "jodit/esm/types/index";
|
|
7
|
+
import type { IMathSymbol, IMathTemplate, MathAlign, MathDisplay, MathFormat } from "./interface";
|
|
8
|
+
declare module 'jodit/esm/config' {
|
|
9
|
+
interface Config {
|
|
10
|
+
math: {
|
|
11
|
+
className: string;
|
|
12
|
+
mathJaxUrl: string;
|
|
13
|
+
defaultFormat: MathFormat;
|
|
14
|
+
defaultDisplay: MathDisplay;
|
|
15
|
+
defaultBackground: string;
|
|
16
|
+
defaultTextColor: string;
|
|
17
|
+
defaultBorderColor: string;
|
|
18
|
+
defaultAlign: MathAlign;
|
|
19
|
+
defaultWrap: boolean;
|
|
20
|
+
allowChangeBackground: boolean;
|
|
21
|
+
allowChangeTextColor: boolean;
|
|
22
|
+
allowChangeBorderColor: boolean;
|
|
23
|
+
allowChangeAlign: boolean;
|
|
24
|
+
allowChangeWrap: boolean;
|
|
25
|
+
symbols: IMathSymbol[];
|
|
26
|
+
templates: IMathTemplate[];
|
|
27
|
+
popup: Array<IControlType | string>;
|
|
28
|
+
dialog: {
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
import type { IJodit, Nullable } from "jodit/esm/types/index";
|
|
7
|
+
import type { IMathData, MathAlign, MathDisplay, MathFormat } from "./interface";
|
|
8
|
+
export declare const MATH_ATTR = "data-jodit-math";
|
|
9
|
+
export declare const MATHML_NS = "http://www.w3.org/1998/Math/MathML";
|
|
10
|
+
export declare const FORMAT_TITLES: Record<MathFormat, string>;
|
|
11
|
+
export declare function isMathFormat(value: unknown): value is MathFormat;
|
|
12
|
+
export declare function isMathDisplay(value: unknown): value is MathDisplay;
|
|
13
|
+
export declare function isMathAlign(value: unknown): value is MathAlign;
|
|
14
|
+
export declare function normalizeMathData(raw: Partial<IMathData>, defaults: IMathData): IMathData;
|
|
15
|
+
export declare function defaultMathData(jodit: IJodit, display?: MathDisplay): IMathData;
|
|
16
|
+
/**
|
|
17
|
+
* Inline style of the formula element: colors and alignment live on the
|
|
18
|
+
* element itself so they survive outside the editor. The SVG uses
|
|
19
|
+
* `currentColor`, so `color` paints the formula.
|
|
20
|
+
*/
|
|
21
|
+
export declare function mathStyle(data: IMathData): string;
|
|
22
|
+
/**
|
|
23
|
+
* MathJax expects a `<math>` root; bare MathML children are wrapped into one.
|
|
24
|
+
*/
|
|
25
|
+
export declare function wrapMathML(source: string, display: MathDisplay): string;
|
|
26
|
+
export declare function isMathElement(node: Nullable<Node>, className: string): node is HTMLElement;
|
|
27
|
+
export declare function findMath(jodit: IJodit, node: Nullable<Node>): Nullable<HTMLElement>;
|
|
28
|
+
export declare function readMathData(jodit: IJodit, element: HTMLElement): Nullable<IMathData>;
|
|
29
|
+
export declare function decorateMath(jodit: IJodit, element: HTMLElement): void;
|
|
30
|
+
export declare function applyMathData(jodit: IJodit, element: HTMLElement, data: IMathData, svg: string): void;
|
|
31
|
+
export declare function pixels(value: string): number;
|
|
32
|
+
export declare function mathTag(display: MathDisplay): 'figure' | 'span';
|
|
33
|
+
export declare function createMath(jodit: IJodit, data: IMathData, svg: string): HTMLElement;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
export type MathFormat = 'latex' | 'mathml';
|
|
7
|
+
export type MathDisplay = 'block' | 'inline';
|
|
8
|
+
export type MathAlign = 'left' | 'center' | 'right';
|
|
9
|
+
export interface IMathData {
|
|
10
|
+
format: MathFormat;
|
|
11
|
+
display: MathDisplay;
|
|
12
|
+
source: string;
|
|
13
|
+
background?: string;
|
|
14
|
+
textColor?: string;
|
|
15
|
+
borderColor?: string;
|
|
16
|
+
align?: MathAlign;
|
|
17
|
+
wrap?: boolean;
|
|
18
|
+
width?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface IMathSymbol {
|
|
21
|
+
label: string;
|
|
22
|
+
latex: string;
|
|
23
|
+
mathml: string;
|
|
24
|
+
}
|
|
25
|
+
export interface IMathTemplate {
|
|
26
|
+
title: string;
|
|
27
|
+
latex: string;
|
|
28
|
+
mathml: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IMathRenderResult {
|
|
31
|
+
svg: string;
|
|
32
|
+
error?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IMathJax {
|
|
35
|
+
tex2svg(tex: string, options?: {
|
|
36
|
+
display?: boolean;
|
|
37
|
+
}): HTMLElement;
|
|
38
|
+
mathml2svg(mml: string, options?: {
|
|
39
|
+
display?: boolean;
|
|
40
|
+
}): HTMLElement;
|
|
41
|
+
startup: {
|
|
42
|
+
promise: Promise<unknown>;
|
|
43
|
+
};
|
|
44
|
+
texReset?: () => void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
import type { IJodit, Nullable } from "jodit/esm/types/index";
|
|
7
|
+
import "./config";
|
|
8
|
+
import { Plugin } from "jodit/esm/core/plugin/index";
|
|
9
|
+
/**
|
|
10
|
+
* Inserts LaTeX / MathML formulas rendered by MathJax as standalone SVG,
|
|
11
|
+
* either as a block or inline, and lets the user edit or remove them.
|
|
12
|
+
*/
|
|
13
|
+
export declare class MathPlugin extends Plugin {
|
|
14
|
+
static requires: string[];
|
|
15
|
+
buttons: Plugin['buttons'];
|
|
16
|
+
private __dialog;
|
|
17
|
+
private __editor;
|
|
18
|
+
private __saveButton;
|
|
19
|
+
private __popup;
|
|
20
|
+
private __toolbar;
|
|
21
|
+
private __target;
|
|
22
|
+
protected afterInit(jodit: IJodit): void;
|
|
23
|
+
protected beforeDestruct(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Opens the editor dialog for a new formula or for an existing one.
|
|
26
|
+
*/
|
|
27
|
+
openEditor(target?: Nullable<Node>, display?: unknown): void;
|
|
28
|
+
/**
|
|
29
|
+
* Removes the formula that owns the given node.
|
|
30
|
+
*/
|
|
31
|
+
removeMath(target?: Nullable<Node>): void;
|
|
32
|
+
private __submit;
|
|
33
|
+
private __save;
|
|
34
|
+
/**
|
|
35
|
+
* A block formula must not stay inside a paragraph, an inline one is
|
|
36
|
+
* inserted at the caret.
|
|
37
|
+
*/
|
|
38
|
+
private __insert;
|
|
39
|
+
private __getDialog;
|
|
40
|
+
protected onClick(e: MouseEvent): void;
|
|
41
|
+
protected onDblClick(e: MouseEvent): void;
|
|
42
|
+
protected onOutsideClick(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Shows the contextual popup (edit / delete) at the formula.
|
|
45
|
+
*/
|
|
46
|
+
openPopup(element: HTMLElement): void;
|
|
47
|
+
closePopup(): void;
|
|
48
|
+
/**
|
|
49
|
+
* An inline formula that carries data but no SVG is an empty `<span>`,
|
|
50
|
+
* which the core cleaner drops before MathJax can fill it. The source is
|
|
51
|
+
* written into such elements as a placeholder; the render replaces it.
|
|
52
|
+
*/
|
|
53
|
+
protected onBeforeSetValue(value: unknown): string | void;
|
|
54
|
+
/**
|
|
55
|
+
* Decorates formulas that arrived with the value and renders the ones
|
|
56
|
+
* that carry data but no SVG yet.
|
|
57
|
+
*/
|
|
58
|
+
protected onChange(): void;
|
|
59
|
+
private __decorateAll;
|
|
60
|
+
/**
|
|
61
|
+
* The core resizer sets a pixel box on the figure; the width goes into
|
|
62
|
+
* the data and the explicit height is dropped so the SVG keeps its ratio.
|
|
63
|
+
*/
|
|
64
|
+
private __syncResized;
|
|
65
|
+
private __renderMissing;
|
|
66
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
import type { IJodit } from "jodit/esm/types/index";
|
|
7
|
+
import type { IMathData, IMathJax, IMathRenderResult } from "./interface";
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the MathJax instance of the owner window, loading it from
|
|
10
|
+
* `math.mathJaxUrl` on first use. A MathJax that the host page already
|
|
11
|
+
* loaded is reused as is.
|
|
12
|
+
*/
|
|
13
|
+
export declare function loadMathJax(jodit: IJodit): Promise<IMathJax>;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the formula to a standalone SVG string.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderMath(jodit: IJodit, data: IMathData): Promise<IMathRenderResult>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Jodit Editor PRO (https://xdsoft.net/jodit/)
|
|
3
|
+
* See LICENSE.md in the project root for license information.
|
|
4
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net/jodit/pro/
|
|
5
|
+
*/
|
|
6
|
+
import type { IJodit } from "jodit/esm/types/index";
|
|
7
|
+
import type { IMathData } from "../../interface";
|
|
8
|
+
import { UIElement } from "jodit/esm/core/ui/index";
|
|
9
|
+
interface IMathEditorOptions {
|
|
10
|
+
onSubmit: () => void;
|
|
11
|
+
onChange: (data: IMathData) => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Dialog body of the equation editor: format tabs, a symbol palette, the
|
|
15
|
+
* source textarea and a live preview rendered by MathJax.
|
|
16
|
+
*/
|
|
17
|
+
export declare class UIMathEditor extends UIElement<IJodit> {
|
|
18
|
+
private readonly handlers;
|
|
19
|
+
className(): string;
|
|
20
|
+
state: IMathData;
|
|
21
|
+
private tabs;
|
|
22
|
+
private source;
|
|
23
|
+
private templates;
|
|
24
|
+
private colorInputs;
|
|
25
|
+
private alignButtons;
|
|
26
|
+
private alignBox;
|
|
27
|
+
private wrapButton;
|
|
28
|
+
private drafts;
|
|
29
|
+
private renderId;
|
|
30
|
+
protected render(): string;
|
|
31
|
+
constructor(jodit: IJodit, handlers: IMathEditorOptions);
|
|
32
|
+
/**
|
|
33
|
+
* Color swatches and the alignment switch shown in the preview corner.
|
|
34
|
+
*/
|
|
35
|
+
private buildAppearance;
|
|
36
|
+
private colorField;
|
|
37
|
+
/**
|
|
38
|
+
* Mirrors the appearance part of the state into the controls.
|
|
39
|
+
*/
|
|
40
|
+
private syncAppearance;
|
|
41
|
+
/**
|
|
42
|
+
* Loads a copy of the data into the form and renders the preview.
|
|
43
|
+
*/
|
|
44
|
+
setData(data: IMathData): void;
|
|
45
|
+
getData(): IMathData;
|
|
46
|
+
focus(): void;
|
|
47
|
+
private setFormat;
|
|
48
|
+
/**
|
|
49
|
+
* Replaces the source with a predefined formula in the active format.
|
|
50
|
+
*/
|
|
51
|
+
private applyTemplate;
|
|
52
|
+
private insertSymbol;
|
|
53
|
+
private refresh;
|
|
54
|
+
private __render;
|
|
55
|
+
}
|
|
56
|
+
export {};
|