jodit-pro 4.19.3 → 4.19.5
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/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +20 -7
- package/es2015/jodit.js +853 -154
- package/es2015/jodit.min.js +20 -7
- 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 +1 -1
- package/es2015/plugins/chart/chart.js +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 +1 -1
- package/es2015/plugins/math/math.js +1 -1
- package/es2015/plugins/math/math.min.js +1 -1
- 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.js +20 -7
- package/es2018/jodit.min.js +25 -12
- 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.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.js +1 -1
- 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 +1 -1
- package/es2021/jodit.fat.min.js +21 -8
- package/es2021/jodit.js +853 -154
- package/es2021/jodit.min.js +32 -19
- 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 +1 -1
- package/es2021/plugins/chart/chart.js +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 +1 -1
- package/es2021/plugins/math/math.js +1 -1
- package/es2021/plugins/math/math.min.js +1 -1
- 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 +1 -1
- package/es2021.en/jodit.fat.min.js +21 -8
- package/es2021.en/jodit.js +853 -154
- package/es2021.en/jodit.min.js +31 -18
- 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 +1 -1
- package/es2021.en/plugins/chart/chart.js +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 +1 -1
- package/es2021.en/plugins/math/math.js +1 -1
- package/es2021.en/plugins/math/math.min.js +1 -1
- 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 +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +1003 -159
- package/es5/jodit.min.css +2 -2
- 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 +1 -1
- package/es5/plugins/chart/chart.js +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 +1 -1
- package/es5/plugins/math/math.js +1 -1
- package/es5/plugins/math/math.min.js +1 -1
- 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/package.json +1 -1
package/es2015/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit-pro - PRO Version of Jodit Editor
|
|
3
3
|
* Author: Chupurnov Valerii <chupurnov@gmail.com>
|
|
4
|
-
* Version: v4.19.
|
|
4
|
+
* Version: v4.19.5
|
|
5
5
|
* Url: https://xdsoft.net/jodit/pro/
|
|
6
6
|
* License(s): SEE LICENSE IN LICENSE.md
|
|
7
7
|
*/
|
|
@@ -1816,7 +1816,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1816
1816
|
* ```
|
|
1817
1817
|
* @packageDocumentation
|
|
1818
1818
|
* @module constants
|
|
1819
|
-
*/ const APP_VERSION = "4.19.
|
|
1819
|
+
*/ const APP_VERSION = "4.19.5";
|
|
1820
1820
|
// prettier-ignore
|
|
1821
1821
|
const ES = "es2015";
|
|
1822
1822
|
const IS_ES_MODERN = true;
|
|
@@ -11245,7 +11245,13 @@ function findCorrectCurrentNode(node, range, rightMode, isCollapsed, checkChild,
|
|
|
11245
11245
|
* When the cursor is positioned in its place, it must be inside the element and not outside its border.
|
|
11246
11246
|
* @private
|
|
11247
11247
|
*/ function moveNodeInsideStart(j, node, start) {
|
|
11248
|
-
|
|
11248
|
+
// A text node of non-breaking spaces trims to nothing, but it's text the
|
|
11249
|
+
// node mustn't move past
|
|
11250
|
+
const isContent = (n)=>{
|
|
11251
|
+
var _a;
|
|
11252
|
+
return !_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(n) || Boolean((_a = n.nodeValue) === null || _a === void 0 ? void 0 : _a.includes(_constants_js__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE));
|
|
11253
|
+
};
|
|
11254
|
+
let sibling = _dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(node, start, isContent), anotherSibling = _dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(node, !start, isContent);
|
|
11249
11255
|
while(_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(sibling) && !_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, _constants_js__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS) && _dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(sibling, j.editor) && (!anotherSibling || !_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(node, _dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement, j.editor))){
|
|
11250
11256
|
if (start || !sibling.firstChild) {
|
|
11251
11257
|
_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(sibling, node);
|
|
@@ -13863,9 +13869,11 @@ const WRAP_NODES = new Set([
|
|
|
13863
13869
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
13864
13870
|
/* harmony export */ ApplyStyle: function() { return /* binding */ ApplyStyle; }
|
|
13865
13871
|
/* harmony export */ });
|
|
13866
|
-
/* harmony import */ var
|
|
13867
|
-
/* harmony import */ var
|
|
13868
|
-
/* harmony import */ var
|
|
13872
|
+
/* harmony import */ var _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2748);
|
|
13873
|
+
/* harmony import */ var _helpers_utils_selector_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(76078);
|
|
13874
|
+
/* harmony import */ var _api_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(63687);
|
|
13875
|
+
/* harmony import */ var _constants_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(77361);
|
|
13876
|
+
/* harmony import */ var _transactions_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(55307);
|
|
13869
13877
|
/*!
|
|
13870
13878
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
13871
13879
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -13873,27 +13881,55 @@ const WRAP_NODES = new Set([
|
|
|
13873
13881
|
*/
|
|
13874
13882
|
|
|
13875
13883
|
|
|
13884
|
+
|
|
13885
|
+
|
|
13886
|
+
/**
|
|
13887
|
+
* Take a selected fragment out of the elements its style takes the place
|
|
13888
|
+
* of: one around it is split, so the fragment leaves it, and one in it is
|
|
13889
|
+
* unwrapped
|
|
13890
|
+
*/ function takeOutOf(jodit, font, tags) {
|
|
13891
|
+
const range = jodit.s.createRange();
|
|
13892
|
+
let outer = _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
|
|
13893
|
+
while(outer){
|
|
13894
|
+
range.selectNodeContents(outer);
|
|
13895
|
+
range.setEndBefore(font);
|
|
13896
|
+
const before = range.cloneContents();
|
|
13897
|
+
range.selectNodeContents(outer);
|
|
13898
|
+
range.setStartAfter(font);
|
|
13899
|
+
// Split only when there's more in it, as a split leaves empty copies
|
|
13900
|
+
// of the elements between
|
|
13901
|
+
if (!_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(before) || !_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.isEmpty(range.cloneContents())) {
|
|
13902
|
+
(0,_api_index_js__WEBPACK_IMPORTED_MODULE_2__.extractSelectedPart)(outer, font, jodit);
|
|
13903
|
+
}
|
|
13904
|
+
_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(outer);
|
|
13905
|
+
outer = _dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.closest(font.parentNode, tags, jodit.editor);
|
|
13906
|
+
}
|
|
13907
|
+
;(0,_helpers_utils_selector_js__WEBPACK_IMPORTED_MODULE_1__.$$)(tags.join(','), font).forEach((inner)=>_dom_dom_js__WEBPACK_IMPORTED_MODULE_0__.Dom.unwrap(inner));
|
|
13908
|
+
}
|
|
13876
13909
|
/** @internal */ function ApplyStyle(jodit, cs) {
|
|
13877
|
-
var _a;
|
|
13910
|
+
var _a, _b;
|
|
13878
13911
|
const { s: sel, editor } = jodit;
|
|
13879
13912
|
(_a = editor.firstChild) === null || _a === void 0 ? void 0 : _a.normalize(); // FF fix for test "commandsTest - Exec command "bold"
|
|
13880
13913
|
const fakes = sel.fakes();
|
|
13881
13914
|
const collapsed = sel.isCollapsed();
|
|
13882
|
-
let mode =
|
|
13915
|
+
let mode = _constants_js__WEBPACK_IMPORTED_MODULE_3__.INITIAL;
|
|
13883
13916
|
try {
|
|
13884
13917
|
// for...of closes the generator on an exception, releasing every
|
|
13885
13918
|
// temporary wrapper before the selection is restored in finally.
|
|
13886
13919
|
for (const font of sel.wrapInTagGen(fakes)){
|
|
13920
|
+
if ((_b = cs.options.exclude) === null || _b === void 0 ? void 0 : _b.length) {
|
|
13921
|
+
takeOutOf(jodit, font, cs.options.exclude);
|
|
13922
|
+
}
|
|
13887
13923
|
let state = {
|
|
13888
13924
|
collapsed,
|
|
13889
13925
|
mode,
|
|
13890
13926
|
element: font,
|
|
13891
|
-
next:
|
|
13927
|
+
next: _transactions_js__WEBPACK_IMPORTED_MODULE_4__.states.START,
|
|
13892
13928
|
jodit,
|
|
13893
13929
|
style: cs
|
|
13894
13930
|
};
|
|
13895
|
-
const machine = new
|
|
13896
|
-
while(!jodit.isInDestruct && machine.getState() !==
|
|
13931
|
+
const machine = new _api_index_js__WEBPACK_IMPORTED_MODULE_2__.FiniteStateMachine(_transactions_js__WEBPACK_IMPORTED_MODULE_4__.states.START, _transactions_js__WEBPACK_IMPORTED_MODULE_4__.transactions);
|
|
13932
|
+
while(!jodit.isInDestruct && machine.getState() !== _transactions_js__WEBPACK_IMPORTED_MODULE_4__.states.END){
|
|
13897
13933
|
state = machine.dispatch('exec', state);
|
|
13898
13934
|
}
|
|
13899
13935
|
// The first selected fragment determines how later fragments toggle.
|
|
@@ -18850,6 +18886,20 @@ const FOCUS_EVENTS = new Set([
|
|
|
18850
18886
|
'focusin',
|
|
18851
18887
|
'focusout'
|
|
18852
18888
|
]);
|
|
18889
|
+
const EDITING_KEYS = new Set([
|
|
18890
|
+
_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_ENTER,
|
|
18891
|
+
_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_BACKSPACE,
|
|
18892
|
+
_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_DELETE
|
|
18893
|
+
]);
|
|
18894
|
+
/**
|
|
18895
|
+
* Whether the input method (IME) is using the key. Safari fires the keydown
|
|
18896
|
+
* that ends a composition, as the Enter that confirms Japanese text, after
|
|
18897
|
+
* `compositionend`, and types Korean without one, so `isComposing` is false and
|
|
18898
|
+
* only keyCode 229 tells. Only the keys the editor turns into edits are held
|
|
18899
|
+
* back: the handlers that follow typing still see the rest.
|
|
18900
|
+
*/ function isInputMethodKey(event) {
|
|
18901
|
+
return event.isComposing || event.keyCode === 229 && EDITING_KEYS.has(event.key);
|
|
18902
|
+
}
|
|
18853
18903
|
const __defaultStyleDisplayKey = 'data-jodit-default-style-display';
|
|
18854
18904
|
const __defaultClassesKey = 'data-jodit-default-classes';
|
|
18855
18905
|
const NOEDIT = {
|
|
@@ -19908,7 +19958,7 @@ let Jodit = Jodit_1 = class Jodit extends _modules_index_js__WEBPACK_IMPORTED_MO
|
|
|
19908
19958
|
}
|
|
19909
19959
|
}
|
|
19910
19960
|
const w = this.ew;
|
|
19911
|
-
if (event instanceof w.KeyboardEvent && event
|
|
19961
|
+
if (event instanceof w.KeyboardEvent && isInputMethodKey(event)) {
|
|
19912
19962
|
return;
|
|
19913
19963
|
}
|
|
19914
19964
|
if (this.e && this.e.fire) {
|
|
@@ -35882,6 +35932,13 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
|
|
|
35882
35932
|
if (checkJoinBareText(jodit, fakeNode, backspace)) {
|
|
35883
35933
|
return true;
|
|
35884
35934
|
}
|
|
35935
|
+
// Old content can have an inline element round blocks beside the text:
|
|
35936
|
+
// moved inside them, the line joins the block as it would bare text
|
|
35937
|
+
// (#1781)
|
|
35938
|
+
const inline = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
|
|
35939
|
+
if (joinsBareText(jodit, edgeBlock(inline, backspace)) && moveInlineInside(inline, jodit.editor)) {
|
|
35940
|
+
return joinNeighbors(jodit, fakeNode, backspace, moved);
|
|
35941
|
+
}
|
|
35885
35942
|
let nextBox = fakeNode, mainClosestBox = nextBox;
|
|
35886
35943
|
// Find the main big closest element
|
|
35887
35944
|
while(nextBox && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(nextBox, backspace) && nextBox.parentElement !== jodit.editor){
|
|
@@ -36162,7 +36219,7 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
|
|
|
36162
36219
|
* in `<div>a|<p>b</p>c</div>` gives `<div>a|b<br>c</div>`
|
|
36163
36220
|
*/ function checkJoinBareText(jodit, fakeNode, backspace) {
|
|
36164
36221
|
const block = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptySibling(fakeNode, backspace);
|
|
36165
|
-
if (!
|
|
36222
|
+
if (!joinsBareText(jodit, block)) {
|
|
36166
36223
|
return false;
|
|
36167
36224
|
}
|
|
36168
36225
|
const filter = (0,_helpers_js__WEBPACK_IMPORTED_MODULE_2__.getMoveFilter)(jodit);
|
|
@@ -36189,6 +36246,24 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('backspace', backs
|
|
|
36189
36246
|
jodit.s.setCursorBefore(fakeNode);
|
|
36190
36247
|
return true;
|
|
36191
36248
|
}
|
|
36249
|
+
/**
|
|
36250
|
+
* Whether a block joins the bare text beside it: not a list, a table or a
|
|
36251
|
+
* cell, and holding no block of its own
|
|
36252
|
+
*/ function joinsBareText(jodit, block) {
|
|
36253
|
+
return _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(block) && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(block) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(block) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(block, 'table') && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(block) && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isContentEditable(block, jodit.editor) && !Array.from(block.childNodes).some((node)=>_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(node));
|
|
36254
|
+
}
|
|
36255
|
+
/**
|
|
36256
|
+
* The block an inline element holds on its side facing the caret, through
|
|
36257
|
+
* the inline elements in it: the `<p>` of `<span><strong><p>…</p></strong></span>`
|
|
36258
|
+
*/ function edgeBlock(node, backspace) {
|
|
36259
|
+
var _a;
|
|
36260
|
+
let edge = node;
|
|
36261
|
+
while(_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isElement(edge) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(edge)){
|
|
36262
|
+
const children = Array.from(edge.childNodes).filter((child)=>!_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmptyTextNode(child));
|
|
36263
|
+
edge = (_a = backspace ? children[children.length - 1] : children[0]) !== null && _a !== void 0 ? _a : null;
|
|
36264
|
+
}
|
|
36265
|
+
return edge === node ? null : edge;
|
|
36266
|
+
}
|
|
36192
36267
|
function checkMoveListContent(jodit, mainClosestBox, sibling, backspace) {
|
|
36193
36268
|
// Process UL/LI/OL cases
|
|
36194
36269
|
const siblingIsList = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(sibling, _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.LIST_TAGS);
|
|
@@ -36622,7 +36697,6 @@ function isNotEditable(jodit, node) {
|
|
|
36622
36697
|
if (!prn || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn)) {
|
|
36623
36698
|
return false;
|
|
36624
36699
|
}
|
|
36625
|
-
const neighbor = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
|
|
36626
36700
|
do {
|
|
36627
36701
|
if (prn && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(prn) && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell(prn)) {
|
|
36628
36702
|
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.after(prn, fakeNode);
|
|
@@ -36637,6 +36711,9 @@ function isNotEditable(jodit, node) {
|
|
|
36637
36711
|
if (found && (0,_check_join_two_lists_js__WEBPACK_IMPORTED_MODULE_2__.checkJoinTwoLists)(jodit, fakeNode, backspace)) {
|
|
36638
36712
|
return true;
|
|
36639
36713
|
}
|
|
36714
|
+
// Looked for once the empty elements have gone, as the one beside the
|
|
36715
|
+
// caret can be in them: the `<br>` that Delete in `<p>|<br></p>` leaves
|
|
36716
|
+
const neighbor = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findNotEmptyNeighbor(fakeNode, backspace, jodit.editor);
|
|
36640
36717
|
if (neighbor && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(neighbor) && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(neighbor, _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.INSEPARABLE_TAGS)) {
|
|
36641
36718
|
setCursorIn(neighbor, !backspace);
|
|
36642
36719
|
} else {
|
|
@@ -37097,8 +37174,15 @@ function _object_spread(target) {
|
|
|
37097
37174
|
}
|
|
37098
37175
|
cssRules[key] = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_1__.isArray)(cssOptions[key]) ? cssOptions[key][0] : cssOptions[key];
|
|
37099
37176
|
});
|
|
37177
|
+
const element = control.tags ? control.tags[0] : undefined;
|
|
37100
37178
|
editor.s.commitStyle({
|
|
37101
|
-
element
|
|
37179
|
+
element,
|
|
37180
|
+
// As in the browsers and Word, each takes the other's place
|
|
37181
|
+
exclude: element === 'sub' ? [
|
|
37182
|
+
'sup'
|
|
37183
|
+
] : element === 'sup' ? [
|
|
37184
|
+
'sub'
|
|
37185
|
+
] : []
|
|
37102
37186
|
});
|
|
37103
37187
|
editor.synchronizeValues();
|
|
37104
37188
|
return false;
|
|
@@ -39697,11 +39781,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39697
39781
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
39698
39782
|
|
|
39699
39783
|
/* unused harmony export deleteCommand */
|
|
39700
|
-
/* harmony import */ var
|
|
39701
|
-
/* harmony import */ var
|
|
39702
|
-
/* harmony import */ var
|
|
39703
|
-
/* harmony import */ var
|
|
39704
|
-
/* harmony import */ var
|
|
39784
|
+
/* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82758);
|
|
39785
|
+
/* harmony import */ var _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22732);
|
|
39786
|
+
/* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(580);
|
|
39787
|
+
/* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(21537);
|
|
39788
|
+
/* harmony import */ var _core_helpers_string_trim_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49055);
|
|
39789
|
+
/* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50911);
|
|
39705
39790
|
/*!
|
|
39706
39791
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
39707
39792
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -39712,6 +39797,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
39712
39797
|
|
|
39713
39798
|
|
|
39714
39799
|
|
|
39800
|
+
|
|
39715
39801
|
const NOT_EMPTY_CONTENT_TAGS = new Set([
|
|
39716
39802
|
'img',
|
|
39717
39803
|
'table',
|
|
@@ -39719,7 +39805,19 @@ const NOT_EMPTY_CONTENT_TAGS = new Set([
|
|
|
39719
39805
|
'iframe',
|
|
39720
39806
|
'hr'
|
|
39721
39807
|
]);
|
|
39722
|
-
|
|
39808
|
+
const KEEPS_SPACES = new Set([
|
|
39809
|
+
'pre',
|
|
39810
|
+
'pre-wrap',
|
|
39811
|
+
'break-spaces'
|
|
39812
|
+
]);
|
|
39813
|
+
/**
|
|
39814
|
+
* A plain space beside this neighbor isn't shown: there is none, or it's a
|
|
39815
|
+
* line break, a block or text starting (or ending) with a plain space
|
|
39816
|
+
*/ function hidesSpace(neighbor, edge) {
|
|
39817
|
+
var _a;
|
|
39818
|
+
return !neighbor || _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(neighbor, 'br') || _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(neighbor) || _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(neighbor) && edge.test((_a = neighbor.nodeValue) !== null && _a !== void 0 ? _a : '');
|
|
39819
|
+
}
|
|
39820
|
+
class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
39723
39821
|
afterInit(jodit) {
|
|
39724
39822
|
jodit.e.on('afterCommand.delete', (command)=>{
|
|
39725
39823
|
if (command === 'delete') {
|
|
@@ -39740,11 +39838,11 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
|
|
|
39740
39838
|
*/ __afterDeleteCommand() {
|
|
39741
39839
|
const jodit = this.j;
|
|
39742
39840
|
const current = jodit.s.current();
|
|
39743
|
-
if (current &&
|
|
39841
|
+
if (current && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(current.firstChild, 'br')) {
|
|
39744
39842
|
jodit.s.removeNode(current.firstChild);
|
|
39745
39843
|
}
|
|
39746
|
-
if (!(0,
|
|
39747
|
-
|
|
39844
|
+
if (!(0,_core_helpers_string_trim_js__WEBPACK_IMPORTED_MODULE_4__.trim)(jodit.editor.textContent || '') && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.first(jodit.editor, (node)=>_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(node, NOT_EMPTY_CONTENT_TAGS)) && (!current || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(current, 'table', jodit.editor))) {
|
|
39845
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(jodit.editor);
|
|
39748
39846
|
const node = jodit.s.setCursorIn(jodit.editor);
|
|
39749
39847
|
jodit.s.removeNode(node);
|
|
39750
39848
|
}
|
|
@@ -39764,14 +39862,15 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
|
|
|
39764
39862
|
range.deleteContents();
|
|
39765
39863
|
const fake = jodit.createInside.fake();
|
|
39766
39864
|
range.insertNode(fake);
|
|
39767
|
-
const leftSibling =
|
|
39768
|
-
const rightSibling =
|
|
39865
|
+
const leftSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(fake, true);
|
|
39866
|
+
const rightSibling = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.findSibling(fake, false);
|
|
39769
39867
|
this.__moveContentInLeftSibling(fake, leftSibling, rightSibling);
|
|
39868
|
+
this.__keepSpacesVisible(fake);
|
|
39770
39869
|
range.setStartBefore(fake);
|
|
39771
39870
|
range.collapse(true);
|
|
39772
39871
|
this.__moveCursorInEditableSibling(jodit, leftSibling, fake, range);
|
|
39773
39872
|
this.__addBrInEmptyBlock(fake, range);
|
|
39774
|
-
|
|
39873
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
|
|
39775
39874
|
jodit.s.selectRange(caret !== null && caret !== void 0 ? caret : range);
|
|
39776
39875
|
return false;
|
|
39777
39876
|
}
|
|
@@ -39785,23 +39884,23 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
|
|
|
39785
39884
|
* Returns where the caret goes, or null when no table is involved
|
|
39786
39885
|
*/ __clearSelectedCells(range) {
|
|
39787
39886
|
const { editor, createInside } = this.j;
|
|
39788
|
-
const startCell =
|
|
39789
|
-
const endCell =
|
|
39887
|
+
const startCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.startContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
|
|
39888
|
+
const endCell = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(range.endContainer, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isCell, editor);
|
|
39790
39889
|
if (startCell === endCell) {
|
|
39791
39890
|
return null;
|
|
39792
39891
|
}
|
|
39793
|
-
const startTable =
|
|
39794
|
-
const endTable =
|
|
39892
|
+
const startTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(startCell, 'table', editor);
|
|
39893
|
+
const endTable = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(endCell, 'table', editor);
|
|
39795
39894
|
const caret = range.cloneRange();
|
|
39796
39895
|
caret.collapse(true);
|
|
39797
39896
|
const parts = [];
|
|
39798
39897
|
const addParts = (table)=>{
|
|
39799
|
-
(0,
|
|
39898
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.toArray)(table.rows).flatMap((row)=>(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.toArray)(row.cells)).filter((cell)=>range.intersectsNode(cell)).forEach((cell)=>{
|
|
39800
39899
|
const part = range.cloneRange();
|
|
39801
|
-
if (!
|
|
39900
|
+
if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.startContainer)) {
|
|
39802
39901
|
part.setStart(cell, 0);
|
|
39803
39902
|
}
|
|
39804
|
-
if (!
|
|
39903
|
+
if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isOrContains(cell, range.endContainer)) {
|
|
39805
39904
|
part.setEnd(cell, cell.childNodes.length);
|
|
39806
39905
|
}
|
|
39807
39906
|
parts.push([
|
|
@@ -39824,9 +39923,9 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
|
|
|
39824
39923
|
}
|
|
39825
39924
|
parts.forEach(([cell, part])=>{
|
|
39826
39925
|
part.deleteContents();
|
|
39827
|
-
if (
|
|
39828
|
-
|
|
39829
|
-
|
|
39926
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(cell)) {
|
|
39927
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.detach(cell);
|
|
39928
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(cell, createInside.element('br'));
|
|
39830
39929
|
}
|
|
39831
39930
|
});
|
|
39832
39931
|
return startTable ? caret : null;
|
|
@@ -39834,46 +39933,76 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
|
|
|
39834
39933
|
__moveContentInLeftSibling(fake, leftSibling, rightSibling) {
|
|
39835
39934
|
leftSibling = this.__defineRightLeftBox(leftSibling);
|
|
39836
39935
|
// Nothing is moved into a table, and a block left empty after it goes
|
|
39837
|
-
if (
|
|
39838
|
-
if (
|
|
39839
|
-
|
|
39936
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(leftSibling, 'table')) {
|
|
39937
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
|
|
39938
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
39840
39939
|
}
|
|
39841
39940
|
return;
|
|
39842
39941
|
}
|
|
39843
|
-
if (!
|
|
39844
|
-
|
|
39845
|
-
|
|
39846
|
-
|
|
39942
|
+
if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isTag(rightSibling, 'table') && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
|
|
39943
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
|
|
39944
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.moveContent(rightSibling, leftSibling);
|
|
39945
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
39847
39946
|
}
|
|
39848
|
-
if (
|
|
39947
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(rightSibling) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(rightSibling.firstElementChild)) {
|
|
39849
39948
|
const item = rightSibling.firstElementChild;
|
|
39850
39949
|
// What's left of the right list's first item joins the left block,
|
|
39851
39950
|
// up to a list nested in the item
|
|
39852
|
-
if (!
|
|
39853
|
-
|
|
39854
|
-
while(item.firstChild && !
|
|
39855
|
-
|
|
39951
|
+
if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item) && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(leftSibling)) {
|
|
39952
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, fake);
|
|
39953
|
+
while(item.firstChild && !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(item.firstChild)){
|
|
39954
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, item.firstChild);
|
|
39856
39955
|
}
|
|
39857
39956
|
}
|
|
39858
39957
|
// Remove empty right LI
|
|
39859
|
-
if (
|
|
39860
|
-
|
|
39958
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(item)) {
|
|
39959
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(item);
|
|
39861
39960
|
}
|
|
39862
|
-
if (
|
|
39863
|
-
|
|
39961
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isEmpty(rightSibling)) {
|
|
39962
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(rightSibling);
|
|
39864
39963
|
}
|
|
39865
39964
|
}
|
|
39866
39965
|
}
|
|
39966
|
+
/**
|
|
39967
|
+
* A plain space the deletion leaves at an edge of the block, before a line
|
|
39968
|
+
* break or next to another space isn't shown, and the browser drops it when
|
|
39969
|
+
* the next char is typed. It becomes non-breaking, as in the browsers' own
|
|
39970
|
+
* delete and in Backspace without a selection (#1522)
|
|
39971
|
+
*/ __keepSpacesVisible(fake) {
|
|
39972
|
+
var _a;
|
|
39973
|
+
const { jodit } = this;
|
|
39974
|
+
const block = (_a = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor)) !== null && _a !== void 0 ? _a : jodit.editor;
|
|
39975
|
+
if (KEEPS_SPACES.has(jodit.ew.getComputedStyle(block).whiteSpace)) {
|
|
39976
|
+
return;
|
|
39977
|
+
}
|
|
39978
|
+
const before = this.__findNeighbor(fake, true, block);
|
|
39979
|
+
const after = this.__findNeighbor(fake, false, block);
|
|
39980
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(before) && hidesSpace(after, /^ /)) {
|
|
39981
|
+
before.nodeValue = before.nodeValue.replace(/ +$/, (spaces)=>_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE.repeat(spaces.length));
|
|
39982
|
+
}
|
|
39983
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(after) && hidesSpace(before, / $/)) {
|
|
39984
|
+
after.nodeValue = after.nodeValue.replace(/^ +/, (spaces)=>_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NBSP_SPACE.repeat(spaces.length));
|
|
39985
|
+
}
|
|
39986
|
+
}
|
|
39987
|
+
/**
|
|
39988
|
+
* The text, line break or other element next to the caret in its block,
|
|
39989
|
+
* looking inside inline elements
|
|
39990
|
+
*/ __findNeighbor(fake, left, block) {
|
|
39991
|
+
return (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.call)(left ? _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.prev : _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.next, fake, (node)=>{
|
|
39992
|
+
var _a;
|
|
39993
|
+
return _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(node) ? (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_3__.trimInv)((_a = node.nodeValue) !== null && _a !== void 0 ? _a : '').length > 0 : !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isComment(node) && !(_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isInlineBlock(node) && node.firstChild);
|
|
39994
|
+
}, block);
|
|
39995
|
+
}
|
|
39867
39996
|
/**
|
|
39868
39997
|
* If left sibling is list - return last leaf
|
|
39869
39998
|
*/ __defineRightLeftBox(leftSibling) {
|
|
39870
|
-
if (!
|
|
39999
|
+
if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isList(leftSibling)) {
|
|
39871
40000
|
return leftSibling;
|
|
39872
40001
|
}
|
|
39873
40002
|
let lastLeaf = leftSibling.lastElementChild;
|
|
39874
|
-
if (!
|
|
40003
|
+
if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isLeaf(lastLeaf)) {
|
|
39875
40004
|
lastLeaf = this.j.createInside.element('li');
|
|
39876
|
-
|
|
40005
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.append(leftSibling, lastLeaf);
|
|
39877
40006
|
}
|
|
39878
40007
|
return lastLeaf;
|
|
39879
40008
|
}
|
|
@@ -39881,22 +40010,22 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
|
|
|
39881
40010
|
* Add BR in the empty block left at the caret
|
|
39882
40011
|
*/ __addBrInEmptyBlock(fake, range) {
|
|
39883
40012
|
const jodit = this.j;
|
|
39884
|
-
if (fake.isConnected &&
|
|
40013
|
+
if (fake.isConnected && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock(fake.parentNode) && !fake.nextSibling && !fake.previousSibling) {
|
|
39885
40014
|
const br = jodit.createInside.element('br');
|
|
39886
|
-
|
|
40015
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.after(fake, br);
|
|
39887
40016
|
range.setStartBefore(br);
|
|
39888
40017
|
range.collapse(true);
|
|
39889
40018
|
}
|
|
39890
40019
|
}
|
|
39891
40020
|
__moveCursorInEditableSibling(jodit, leftSibling, fake, range) {
|
|
39892
40021
|
var _a;
|
|
39893
|
-
if (!leftSibling || !
|
|
39894
|
-
const root = (_a =
|
|
39895
|
-
const leftText =
|
|
40022
|
+
if (!leftSibling || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText(leftSibling)) {
|
|
40023
|
+
const root = (_a = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.closest(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isBlock, jodit.editor)) !== null && _a !== void 0 ? _a : jodit.editor;
|
|
40024
|
+
const leftText = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.prev(fake, _core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.isText, root);
|
|
39896
40025
|
if (leftText) {
|
|
39897
40026
|
range.setStartAfter(leftText);
|
|
39898
40027
|
range.collapse(true);
|
|
39899
|
-
|
|
40028
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_1__.Dom.safeRemove(fake);
|
|
39900
40029
|
}
|
|
39901
40030
|
}
|
|
39902
40031
|
}
|
|
@@ -39904,7 +40033,7 @@ class deleteCommand extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_4__.P
|
|
|
39904
40033
|
deleteCommand.requires = [
|
|
39905
40034
|
'backspace'
|
|
39906
40035
|
];
|
|
39907
|
-
|
|
40036
|
+
_core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('deleteCommand', deleteCommand);
|
|
39908
40037
|
|
|
39909
40038
|
|
|
39910
40039
|
/***/ }),
|
|
@@ -48225,6 +48354,16 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.link = {
|
|
|
48225
48354
|
followOnDblClick: false,
|
|
48226
48355
|
processVideoLink: true,
|
|
48227
48356
|
processPastedLink: true,
|
|
48357
|
+
processTypedLink: false,
|
|
48358
|
+
typedLinkTlds: [],
|
|
48359
|
+
typedLinkFileEndings: [
|
|
48360
|
+
'zip',
|
|
48361
|
+
'mov',
|
|
48362
|
+
'md',
|
|
48363
|
+
'py',
|
|
48364
|
+
'sh',
|
|
48365
|
+
'pub'
|
|
48366
|
+
],
|
|
48228
48367
|
deriveUrlFromText: false,
|
|
48229
48368
|
noFollowCheckbox: true,
|
|
48230
48369
|
openInNewTabCheckbox: true,
|
|
@@ -48289,12 +48428,14 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48289
48428
|
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
|
48290
48429
|
|
|
48291
48430
|
/* unused harmony export link */
|
|
48292
|
-
/* harmony import */ var
|
|
48293
|
-
/* harmony import */ var
|
|
48294
|
-
/* harmony import */ var
|
|
48295
|
-
/* harmony import */ var
|
|
48296
|
-
/* harmony import */ var
|
|
48297
|
-
/* harmony import */ var
|
|
48431
|
+
/* harmony import */ var _core_constants_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(82758);
|
|
48432
|
+
/* harmony import */ var _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65478);
|
|
48433
|
+
/* harmony import */ var _core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22732);
|
|
48434
|
+
/* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(580);
|
|
48435
|
+
/* harmony import */ var _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(21537);
|
|
48436
|
+
/* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50911);
|
|
48437
|
+
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5827);
|
|
48438
|
+
/* harmony import */ var _typed_link_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(58970);
|
|
48298
48439
|
/*!
|
|
48299
48440
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
48300
48441
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -48311,9 +48452,11 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48311
48452
|
|
|
48312
48453
|
|
|
48313
48454
|
|
|
48455
|
+
|
|
48456
|
+
|
|
48314
48457
|
/**
|
|
48315
48458
|
* Process link. Insert, dblclick or remove format
|
|
48316
|
-
*/ class link extends
|
|
48459
|
+
*/ class link extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
48317
48460
|
/** @override */ afterInit(jodit) {
|
|
48318
48461
|
if (jodit.o.link.followOnDblClick) {
|
|
48319
48462
|
jodit.e.on('dblclick.link', this.__onDblClickOnLink);
|
|
@@ -48322,6 +48465,14 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48322
48465
|
if (jodit.o.link.processPastedLink) {
|
|
48323
48466
|
jodit.e.on('processPaste.link', this.onProcessPasteLink);
|
|
48324
48467
|
}
|
|
48468
|
+
if (jodit.o.link.processTypedLink) {
|
|
48469
|
+
this.__linkAfterEnter = jodit.async.microDebounce(this.__linkTyped);
|
|
48470
|
+
jodit.e.on('input.link', this.__onTypedSpace).on('beforeEnter.link', this.__onBeforeEnter).on('afterEnter.link', this.__onAfterEnter).on('mousedown.link blur.link beforeCommand.link', this.__forgetLink)// Without a namespace it runs ahead of table navigation,
|
|
48471
|
+
// which moves the caret on Tab, and of the backspace plugin
|
|
48472
|
+
.on('keydown', this.__onKeyDown, {
|
|
48473
|
+
top: true
|
|
48474
|
+
});
|
|
48475
|
+
}
|
|
48325
48476
|
jodit.e.on('generateLinkForm.link', this.__generateForm);
|
|
48326
48477
|
jodit.registerCommand('openLinkDialog', {
|
|
48327
48478
|
exec: ()=>{
|
|
@@ -48335,7 +48486,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48335
48486
|
dialog.setContent(htmlForm);
|
|
48336
48487
|
dialog.open();
|
|
48337
48488
|
jodit.async.requestIdleCallback(()=>{
|
|
48338
|
-
const { url_input } = (0,
|
|
48489
|
+
const { url_input } = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.refs)(htmlForm.container);
|
|
48339
48490
|
url_input === null || url_input === void 0 ? void 0 : url_input.focus();
|
|
48340
48491
|
});
|
|
48341
48492
|
},
|
|
@@ -48343,10 +48494,10 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48343
48494
|
});
|
|
48344
48495
|
}
|
|
48345
48496
|
__onDblClickOnLink(e) {
|
|
48346
|
-
if (!
|
|
48497
|
+
if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(e.target, 'a')) {
|
|
48347
48498
|
return;
|
|
48348
48499
|
}
|
|
48349
|
-
const href = (0,
|
|
48500
|
+
const href = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(e.target, 'href');
|
|
48350
48501
|
if (href) {
|
|
48351
48502
|
location.href = href;
|
|
48352
48503
|
e.preventDefault();
|
|
@@ -48355,23 +48506,23 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48355
48506
|
onProcessPasteLink(ignore, html) {
|
|
48356
48507
|
var _a, _b, _c, _d;
|
|
48357
48508
|
const { jodit } = this;
|
|
48358
|
-
if (!(0,
|
|
48509
|
+
if (!(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.isURL)(html) || !jodit.o.link.processPastedLink) {
|
|
48359
48510
|
return;
|
|
48360
48511
|
}
|
|
48361
48512
|
jodit.e.stopPropagation('processPaste');
|
|
48362
48513
|
if (jodit.o.link.processVideoLink) {
|
|
48363
|
-
const embed = (0,
|
|
48514
|
+
const embed = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.call)((_b = (_a = jodit.o.video) === null || _a === void 0 ? void 0 : _a.parseUrlToVideoEmbed) !== null && _b !== void 0 ? _b : _core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.convertMediaUrlToVideoEmbed, html, {
|
|
48364
48515
|
width: (_c = jodit.o.video) === null || _c === void 0 ? void 0 : _c.defaultWidth,
|
|
48365
48516
|
height: (_d = jodit.o.video) === null || _d === void 0 ? void 0 : _d.defaultHeight
|
|
48366
48517
|
});
|
|
48367
48518
|
if (embed !== html) {
|
|
48368
|
-
const media = (0,
|
|
48369
|
-
return (0,
|
|
48519
|
+
const media = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.prepareEmbedCode)(jodit, embed);
|
|
48520
|
+
return (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.isString)(media) ? jodit.createInside.fromHTML(media) : media;
|
|
48370
48521
|
}
|
|
48371
48522
|
}
|
|
48372
48523
|
if (jodit.s.isCollapsed()) {
|
|
48373
48524
|
const a = jodit.createInside.element('a');
|
|
48374
|
-
(0,
|
|
48525
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'href', html);
|
|
48375
48526
|
a.textContent = html;
|
|
48376
48527
|
jodit.e.fire('applyLink', jodit, a, null);
|
|
48377
48528
|
return a;
|
|
@@ -48389,16 +48540,16 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48389
48540
|
const i18n = jodit.i18n.bind(jodit);
|
|
48390
48541
|
const { openInNewTabCheckbox, openInNewTabCheckboxDefaultChecked, noFollowCheckbox, formTemplate, formClassName, modeClassName } = jodit.o.link;
|
|
48391
48542
|
const html = formTemplate(jodit);
|
|
48392
|
-
const form = (0,
|
|
48543
|
+
const form = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.isString)(html) ? jodit.c.fromHTML(html, {
|
|
48393
48544
|
target_checkbox_box: openInNewTabCheckbox,
|
|
48394
48545
|
nofollow_checkbox_box: noFollowCheckbox
|
|
48395
48546
|
}) : html;
|
|
48396
|
-
const htmlForm =
|
|
48397
|
-
const elements = (0,
|
|
48547
|
+
const htmlForm = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isElement(form) ? form : form.container;
|
|
48548
|
+
const elements = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.refs)(htmlForm);
|
|
48398
48549
|
const { insert, unlink, content_input_box } = elements;
|
|
48399
48550
|
const { target_checkbox, nofollow_checkbox, url_input } = elements;
|
|
48400
48551
|
const currentElement = current;
|
|
48401
|
-
const isImageContent =
|
|
48552
|
+
const isImageContent = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isImage(currentElement);
|
|
48402
48553
|
let { content_input } = elements;
|
|
48403
48554
|
const { className_input } = elements, { className_select } = elements, { aria_label_input } = elements;
|
|
48404
48555
|
if (!content_input) {
|
|
@@ -48411,12 +48562,12 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48411
48562
|
htmlForm.classList.add(formClassName);
|
|
48412
48563
|
}
|
|
48413
48564
|
if (isImageContent) {
|
|
48414
|
-
|
|
48565
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.hide(content_input_box);
|
|
48415
48566
|
}
|
|
48416
48567
|
let link;
|
|
48417
|
-
const getSelectionText = ()=>link ? link.innerText : (0,
|
|
48418
|
-
if (current &&
|
|
48419
|
-
link =
|
|
48568
|
+
const getSelectionText = ()=>link ? link.innerText : (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.stripTags)(jodit.s.range.cloneContents(), jodit.ed);
|
|
48569
|
+
if (current && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(current, 'a', jodit.editor)) {
|
|
48570
|
+
link = _core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(current, 'a', jodit.editor);
|
|
48420
48571
|
} else {
|
|
48421
48572
|
link = false;
|
|
48422
48573
|
}
|
|
@@ -48424,22 +48575,22 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48424
48575
|
content_input.value = getSelectionText();
|
|
48425
48576
|
}
|
|
48426
48577
|
if (aria_label_input) {
|
|
48427
|
-
aria_label_input.value = link ? (0,
|
|
48578
|
+
aria_label_input.value = link ? (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(link, 'aria-label') || '' : '';
|
|
48428
48579
|
}
|
|
48429
48580
|
if (link) {
|
|
48430
|
-
url_input.value = (0,
|
|
48581
|
+
url_input.value = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(link, 'href') || '';
|
|
48431
48582
|
if (modeClassName) {
|
|
48432
48583
|
readClassnames(modeClassName, className_input, link, className_select);
|
|
48433
48584
|
}
|
|
48434
48585
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
48435
|
-
target_checkbox.checked = (0,
|
|
48586
|
+
target_checkbox.checked = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(link, 'target') === '_blank';
|
|
48436
48587
|
}
|
|
48437
48588
|
if (noFollowCheckbox && nofollow_checkbox) {
|
|
48438
|
-
nofollow_checkbox.checked = ((0,
|
|
48589
|
+
nofollow_checkbox.checked = ((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(link, 'rel') || '').split(/\s+/).includes('nofollow');
|
|
48439
48590
|
}
|
|
48440
48591
|
insert.textContent = i18n('Update');
|
|
48441
48592
|
} else {
|
|
48442
|
-
|
|
48593
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.hide(unlink);
|
|
48443
48594
|
if (jodit.o.link.deriveUrlFromText && url_input && !isImageContent && !url_input.value.trim()) {
|
|
48444
48595
|
url_input.value = guessUrlFromText(content_input.value);
|
|
48445
48596
|
}
|
|
@@ -48454,7 +48605,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48454
48605
|
jodit.s.restore();
|
|
48455
48606
|
jodit.history.snapshot.restore(snapshot);
|
|
48456
48607
|
if (link) {
|
|
48457
|
-
|
|
48608
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.unwrap(link);
|
|
48458
48609
|
}
|
|
48459
48610
|
jodit.synchronizeValues();
|
|
48460
48611
|
close();
|
|
@@ -48475,12 +48626,12 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48475
48626
|
const textWasChanged = getSelectionText() !== content_input.value.trim();
|
|
48476
48627
|
const ci = jodit.createInside;
|
|
48477
48628
|
let caretAfter = null;
|
|
48478
|
-
if (!link || !
|
|
48629
|
+
if (!link || !_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(jodit.editor, link)) {
|
|
48479
48630
|
if (!jodit.s.isCollapsed()) {
|
|
48480
48631
|
const node = jodit.s.current();
|
|
48481
|
-
if (
|
|
48632
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(node, 'img')) {
|
|
48482
48633
|
links = [
|
|
48483
|
-
|
|
48634
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.wrap(node, 'a', ci)
|
|
48484
48635
|
];
|
|
48485
48636
|
} else {
|
|
48486
48637
|
links = jodit.s.wrapInTag('a');
|
|
@@ -48500,27 +48651,27 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48500
48651
|
];
|
|
48501
48652
|
}
|
|
48502
48653
|
links.forEach((a)=>{
|
|
48503
|
-
;(0,
|
|
48654
|
+
;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'href', url_input.value);
|
|
48504
48655
|
writeClasses(modeClassName, className_input, className_select, a);
|
|
48505
48656
|
if (!isImageContent) {
|
|
48506
48657
|
writeImage(a, content_input, textWasChanged, url_input);
|
|
48507
48658
|
}
|
|
48508
48659
|
if (openInNewTabCheckbox && target_checkbox) {
|
|
48509
|
-
(0,
|
|
48660
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'target', target_checkbox.checked ? '_blank' : null);
|
|
48510
48661
|
}
|
|
48511
48662
|
if (noFollowCheckbox && nofollow_checkbox) {
|
|
48512
|
-
const relParts = ((0,
|
|
48663
|
+
const relParts = ((0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'rel') || '').split(/\s+/).filter(Boolean);
|
|
48513
48664
|
const hasNofollow = relParts.includes('nofollow');
|
|
48514
48665
|
if (nofollow_checkbox.checked && !hasNofollow) {
|
|
48515
48666
|
relParts.push('nofollow');
|
|
48516
48667
|
} else if (!nofollow_checkbox.checked && hasNofollow) {
|
|
48517
48668
|
relParts.splice(relParts.indexOf('nofollow'), 1);
|
|
48518
48669
|
}
|
|
48519
|
-
;(0,
|
|
48670
|
+
;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'rel', relParts.length ? relParts.join(' ') : null);
|
|
48520
48671
|
}
|
|
48521
48672
|
if (aria_label_input) {
|
|
48522
48673
|
const ariaLabel = aria_label_input.value.trim();
|
|
48523
|
-
(0,
|
|
48674
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'aria-label', ariaLabel || null);
|
|
48524
48675
|
}
|
|
48525
48676
|
jodit.e.fire('applyLink', jodit, a, form);
|
|
48526
48677
|
});
|
|
@@ -48535,7 +48686,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48535
48686
|
close();
|
|
48536
48687
|
return false;
|
|
48537
48688
|
};
|
|
48538
|
-
if (
|
|
48689
|
+
if (_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isElement(form)) {
|
|
48539
48690
|
jodit.e.on(form, 'submit', (event)=>{
|
|
48540
48691
|
event.preventDefault();
|
|
48541
48692
|
event.stopImmediatePropagation();
|
|
@@ -48548,11 +48699,96 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48548
48699
|
return form;
|
|
48549
48700
|
}
|
|
48550
48701
|
/** @override */ beforeDestruct(jodit) {
|
|
48551
|
-
jodit.e.off('generateLinkForm.link', this.__generateForm).off('dblclick.link', this.__onDblClickOnLink).off(jodit.editor, 'click.link', this.__onClickReadOnlyLink).off('processPaste.link', this.onProcessPasteLink);
|
|
48702
|
+
jodit.e.off('generateLinkForm.link', this.__generateForm).off('dblclick.link', this.__onDblClickOnLink).off(jodit.editor, 'click.link', this.__onClickReadOnlyLink).off('processPaste.link', this.onProcessPasteLink).off('input.link', this.__onTypedSpace).off('beforeEnter.link', this.__onBeforeEnter).off('afterEnter.link', this.__onAfterEnter).off('mousedown.link blur.link beforeCommand.link', this.__forgetLink).off('keydown', this.__onKeyDown);
|
|
48703
|
+
}
|
|
48704
|
+
__onTypedSpace(event) {
|
|
48705
|
+
if (event.inputType !== 'insertText' || !event.data || /\S/.test(event.data)) {
|
|
48706
|
+
return;
|
|
48707
|
+
}
|
|
48708
|
+
const { range } = this.j.s;
|
|
48709
|
+
if (range.collapsed) {
|
|
48710
|
+
this.__linkTyped(range.startContainer, range.startOffset - event.data.length);
|
|
48711
|
+
}
|
|
48712
|
+
}
|
|
48713
|
+
__onBeforeEnter() {
|
|
48714
|
+
const { range } = this.j.s;
|
|
48715
|
+
this.__enteredAt = range.collapsed ? [
|
|
48716
|
+
range.startContainer,
|
|
48717
|
+
range.startOffset
|
|
48718
|
+
] : null;
|
|
48719
|
+
}
|
|
48720
|
+
__onAfterEnter() {
|
|
48721
|
+
if (this.__enteredAt) {
|
|
48722
|
+
this.__linkAfterEnter(...this.__enteredAt);
|
|
48723
|
+
this.__enteredAt = null;
|
|
48724
|
+
}
|
|
48725
|
+
}
|
|
48726
|
+
__forgetLink() {
|
|
48727
|
+
this.__justLinked = null;
|
|
48728
|
+
}
|
|
48729
|
+
__onKeyDown(event) {
|
|
48730
|
+
const { jodit } = this;
|
|
48731
|
+
if (jodit.o.readonly) {
|
|
48732
|
+
return;
|
|
48733
|
+
}
|
|
48734
|
+
const link = this.__justLinked;
|
|
48735
|
+
const modified = event.ctrlKey || event.metaKey || event.altKey;
|
|
48736
|
+
if (!MODIFIER_KEYS.has(event.key)) {
|
|
48737
|
+
this.__justLinked = null;
|
|
48738
|
+
}
|
|
48739
|
+
if (event.key === _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_BACKSPACE && !modified && (link === null || link === void 0 ? void 0 : link.isConnected)) {
|
|
48740
|
+
this.__recordStep();
|
|
48741
|
+
jodit.s.save();
|
|
48742
|
+
_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.unwrap(link);
|
|
48743
|
+
jodit.s.restore();
|
|
48744
|
+
this.__recordStep();
|
|
48745
|
+
// Or the backspace plugin takes a character too
|
|
48746
|
+
jodit.e.stopPropagation('keydown');
|
|
48747
|
+
return false;
|
|
48748
|
+
}
|
|
48749
|
+
const { range } = jodit.s;
|
|
48750
|
+
if (event.key === _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB && !modified && range.collapsed) {
|
|
48751
|
+
this.__linkTyped(range.startContainer, range.startOffset);
|
|
48752
|
+
}
|
|
48753
|
+
}
|
|
48754
|
+
/**
|
|
48755
|
+
* Links the address that ends at `end` in a text node, as a step of its
|
|
48756
|
+
* own in the history, so Undo straight after takes the link off and
|
|
48757
|
+
* leaves the text
|
|
48758
|
+
*/ __linkTyped(node, end) {
|
|
48759
|
+
const { jodit } = this;
|
|
48760
|
+
if (!_core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isText(node) || !node.isConnected || end < 0 || end > node.length || _core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, NO_TYPED_LINKS, jodit.editor)) {
|
|
48761
|
+
return;
|
|
48762
|
+
}
|
|
48763
|
+
const found = (0,_typed_link_js__WEBPACK_IMPORTED_MODULE_7__.findTypedLink)(node.data, end, jodit.o.link.typedLinkTlds, jodit.o.link.typedLinkFileEndings);
|
|
48764
|
+
if (!found) {
|
|
48765
|
+
return;
|
|
48766
|
+
}
|
|
48767
|
+
const [start, stop, href] = found;
|
|
48768
|
+
this.__recordStep();
|
|
48769
|
+
// The text round the caret splits, and WebKit doesn't keep the caret
|
|
48770
|
+
// where it was
|
|
48771
|
+
jodit.s.save();
|
|
48772
|
+
const range = jodit.ed.createRange();
|
|
48773
|
+
range.setStart(node, start);
|
|
48774
|
+
range.setEnd(node, stop);
|
|
48775
|
+
const a = jodit.createInside.element('a');
|
|
48776
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'href', href);
|
|
48777
|
+
range.surroundContents(a);
|
|
48778
|
+
jodit.s.restore();
|
|
48779
|
+
jodit.e.fire('applyLink', jodit, a, null);
|
|
48780
|
+
this.__recordStep();
|
|
48781
|
+
this.__justLinked = a;
|
|
48782
|
+
}
|
|
48783
|
+
/**
|
|
48784
|
+
* Reports what's changed and makes it a history step of its own
|
|
48785
|
+
*/ __recordStep() {
|
|
48786
|
+
this.j.setEditorValue();
|
|
48787
|
+
this.j.e.fire('internalChange');
|
|
48552
48788
|
}
|
|
48553
48789
|
__onClickReadOnlyLink(e) {
|
|
48554
48790
|
const { jodit } = this;
|
|
48555
|
-
if (jodit.o.readonly && jodit.o.link.preventReadOnlyNavigation &&
|
|
48791
|
+
if (jodit.o.readonly && jodit.o.link.preventReadOnlyNavigation && _core_dom_index_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(e.target, 'a')) {
|
|
48556
48792
|
e.preventDefault();
|
|
48557
48793
|
}
|
|
48558
48794
|
}
|
|
@@ -48564,21 +48800,61 @@ _config_js__WEBPACK_IMPORTED_MODULE_2__.Config.prototype.controls.link = {
|
|
|
48564
48800
|
group: 'insert'
|
|
48565
48801
|
}
|
|
48566
48802
|
];
|
|
48803
|
+
/**
|
|
48804
|
+
* Where the caret was when Enter was pressed. Enter splits the line in a
|
|
48805
|
+
* history transaction, so the link waits until it's over
|
|
48806
|
+
*/ this.__enteredAt = null;
|
|
48807
|
+
this.__linkAfterEnter = ()=>{};
|
|
48808
|
+
/**
|
|
48809
|
+
* The link just made, which Backspace straight after takes off again, as
|
|
48810
|
+
* in CKEditor 5. Any other key but a modifier, a click or a command
|
|
48811
|
+
* forgets it
|
|
48812
|
+
*/ this.__justLinked = null;
|
|
48567
48813
|
}
|
|
48568
48814
|
}
|
|
48569
48815
|
__decorate([
|
|
48570
|
-
|
|
48816
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48571
48817
|
], link.prototype, "__onDblClickOnLink", null);
|
|
48572
48818
|
__decorate([
|
|
48573
|
-
|
|
48819
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48574
48820
|
], link.prototype, "onProcessPasteLink", null);
|
|
48575
48821
|
__decorate([
|
|
48576
|
-
|
|
48822
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48577
48823
|
], link.prototype, "__generateForm", null);
|
|
48578
48824
|
__decorate([
|
|
48579
|
-
|
|
48825
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48826
|
+
], link.prototype, "__onTypedSpace", null);
|
|
48827
|
+
__decorate([
|
|
48828
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48829
|
+
], link.prototype, "__onBeforeEnter", null);
|
|
48830
|
+
__decorate([
|
|
48831
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48832
|
+
], link.prototype, "__onAfterEnter", null);
|
|
48833
|
+
__decorate([
|
|
48834
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48835
|
+
], link.prototype, "__forgetLink", null);
|
|
48836
|
+
__decorate([
|
|
48837
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48838
|
+
], link.prototype, "__onKeyDown", null);
|
|
48839
|
+
__decorate([
|
|
48840
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48841
|
+
], link.prototype, "__linkTyped", null);
|
|
48842
|
+
__decorate([
|
|
48843
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
48580
48844
|
], link.prototype, "__onClickReadOnlyLink", null);
|
|
48581
|
-
|
|
48845
|
+
const NO_TYPED_LINKS = new Set([
|
|
48846
|
+
'a',
|
|
48847
|
+
'pre',
|
|
48848
|
+
'code'
|
|
48849
|
+
]);
|
|
48850
|
+
const MODIFIER_KEYS = new Set([
|
|
48851
|
+
'Shift',
|
|
48852
|
+
'Control',
|
|
48853
|
+
'Alt',
|
|
48854
|
+
'Meta',
|
|
48855
|
+
'CapsLock'
|
|
48856
|
+
]);
|
|
48857
|
+
_core_global_js__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('link', link);
|
|
48582
48858
|
/**
|
|
48583
48859
|
* Guess a usable `href` from the selected text for the link dialog.
|
|
48584
48860
|
* Returns an empty string when the text is not a plausible URL/email,
|
|
@@ -48593,7 +48869,7 @@ _core_global_js__WEBPACK_IMPORTED_MODULE_2__.pluginSystem.add('link', link);
|
|
|
48593
48869
|
return value;
|
|
48594
48870
|
}
|
|
48595
48871
|
// email address -> mailto:
|
|
48596
|
-
if (
|
|
48872
|
+
if (_typed_link_js__WEBPACK_IMPORTED_MODULE_7__.EMAIL.test(value)) {
|
|
48597
48873
|
return `mailto:${value}`;
|
|
48598
48874
|
}
|
|
48599
48875
|
// bare domain like example.com or www.example.com/path -> https://
|
|
@@ -48607,14 +48883,14 @@ function writeClasses(modeClassName, className_input, className_select, a) {
|
|
|
48607
48883
|
if (modeClassName && (className_input !== null && className_input !== void 0 ? className_input : className_select)) {
|
|
48608
48884
|
if (modeClassName === 'input') {
|
|
48609
48885
|
if (className_input.value === '' && a.hasAttribute('class')) {
|
|
48610
|
-
(0,
|
|
48886
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'class', null);
|
|
48611
48887
|
}
|
|
48612
48888
|
if (className_input.value !== '') {
|
|
48613
|
-
(0,
|
|
48889
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'class', className_input.value);
|
|
48614
48890
|
}
|
|
48615
48891
|
} else if (modeClassName === 'select') {
|
|
48616
48892
|
if (a.hasAttribute('class')) {
|
|
48617
|
-
(0,
|
|
48893
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(a, 'class', null);
|
|
48618
48894
|
}
|
|
48619
48895
|
for(let i = 0; i < className_select.selectedOptions.length; i++){
|
|
48620
48896
|
const className = (_a = className_select.selectedOptions.item(i)) === null || _a === void 0 ? void 0 : _a.value;
|
|
@@ -48631,7 +48907,7 @@ function readClassnames(modeClassName, className_input, link, className_select)
|
|
|
48631
48907
|
switch(modeClassName){
|
|
48632
48908
|
case 'input':
|
|
48633
48909
|
if (className_input) {
|
|
48634
|
-
className_input.value = (0,
|
|
48910
|
+
className_input.value = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(link, 'class') || '';
|
|
48635
48911
|
}
|
|
48636
48912
|
break;
|
|
48637
48913
|
case 'select':
|
|
@@ -48642,7 +48918,7 @@ function readClassnames(modeClassName, className_input, link, className_select)
|
|
|
48642
48918
|
option.selected = false;
|
|
48643
48919
|
}
|
|
48644
48920
|
}
|
|
48645
|
-
const classNames = (0,
|
|
48921
|
+
const classNames = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(link, 'class') || '';
|
|
48646
48922
|
classNames.split(/\s+/).filter((cn)=>cn.trim().length > 0).forEach((className)=>{
|
|
48647
48923
|
if (className) {
|
|
48648
48924
|
for(let i = 0; i < className_select.options.length; i++){
|
|
@@ -48770,6 +49046,154 @@ const formTemplate = (editor)=>{
|
|
|
48770
49046
|
/* harmony export */ ]);
|
|
48771
49047
|
|
|
48772
49048
|
|
|
49049
|
+
/***/ }),
|
|
49050
|
+
|
|
49051
|
+
/***/ 67272:
|
|
49052
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
49053
|
+
|
|
49054
|
+
/*!
|
|
49055
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
49056
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
49057
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
49058
|
+
*/ /**
|
|
49059
|
+
* @module plugins/link
|
|
49060
|
+
*/ /**
|
|
49061
|
+
* The endings a bare domain links with, besides those `link.typedLinkTlds`
|
|
49062
|
+
* adds: the generic ones of at least 1 in 1,000 of the sites in Tranco's top
|
|
49063
|
+
* million (list GQ38K, https://tranco-list.eu/list/GQ38K), then every
|
|
49064
|
+
* two-letter one in IANA's list (version 2026102900,
|
|
49065
|
+
* https://data.iana.org/TLD/tlds-alpha-by-domain.txt). Together they're the
|
|
49066
|
+
* endings of 96% of those sites
|
|
49067
|
+
* @private
|
|
49068
|
+
*/ const TLDS = new Set(`
|
|
49069
|
+
app biz casino click cloud club com dev edu gov info live net online org pro
|
|
49070
|
+
shop site space store tech top vip xyz
|
|
49071
|
+
ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi
|
|
49072
|
+
bj bm bn bo br bs bt bv bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu
|
|
49073
|
+
cv cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga
|
|
49074
|
+
gb gd ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id
|
|
49075
|
+
ie il im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la
|
|
49076
|
+
lb lc li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms
|
|
49077
|
+
mt mu mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph
|
|
49078
|
+
pk pl pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sj sk
|
|
49079
|
+
sl sm sn so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt
|
|
49080
|
+
tv tw tz ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw
|
|
49081
|
+
`.trim().split(/\s+/));
|
|
49082
|
+
|
|
49083
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
49084
|
+
/* harmony export */ "TLDS", 0, /* binding */ TLDS
|
|
49085
|
+
/* harmony export */ ]);
|
|
49086
|
+
|
|
49087
|
+
|
|
49088
|
+
/***/ }),
|
|
49089
|
+
|
|
49090
|
+
/***/ 58970:
|
|
49091
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
49092
|
+
|
|
49093
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
49094
|
+
/* harmony export */ findTypedLink: function() { return /* binding */ findTypedLink; }
|
|
49095
|
+
/* harmony export */ });
|
|
49096
|
+
/* harmony import */ var _core_helpers_checker_is_url_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(26049);
|
|
49097
|
+
/* harmony import */ var _tlds_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(67272);
|
|
49098
|
+
/*!
|
|
49099
|
+
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
49100
|
+
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
49101
|
+
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
49102
|
+
*/ /**
|
|
49103
|
+
* @module plugins/link
|
|
49104
|
+
*/
|
|
49105
|
+
|
|
49106
|
+
/**
|
|
49107
|
+
* An email address, for `mailto:`
|
|
49108
|
+
* @private
|
|
49109
|
+
*/ const EMAIL = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
49110
|
+
const OPENING = new Set([
|
|
49111
|
+
'(',
|
|
49112
|
+
'[',
|
|
49113
|
+
'"',
|
|
49114
|
+
"'",
|
|
49115
|
+
'“',
|
|
49116
|
+
'‘',
|
|
49117
|
+
'<'
|
|
49118
|
+
]);
|
|
49119
|
+
const CLOSING = new Set([
|
|
49120
|
+
'.',
|
|
49121
|
+
',',
|
|
49122
|
+
';',
|
|
49123
|
+
':',
|
|
49124
|
+
'!',
|
|
49125
|
+
'?',
|
|
49126
|
+
'"',
|
|
49127
|
+
"'",
|
|
49128
|
+
'”',
|
|
49129
|
+
'’',
|
|
49130
|
+
'>'
|
|
49131
|
+
]);
|
|
49132
|
+
const BRACKETS = {
|
|
49133
|
+
')': '(',
|
|
49134
|
+
']': '['
|
|
49135
|
+
};
|
|
49136
|
+
const LABEL = /^[a-z\d][a-z\d-]{0,62}$/i;
|
|
49137
|
+
/**
|
|
49138
|
+
* The address that ends at `end` in a line of text typed, back to the
|
|
49139
|
+
* whitespace before it, as `[start, end, href]`. Punctuation round it, such as
|
|
49140
|
+
* a sentence's full stop or a bracket the address doesn't open, stays out.
|
|
49141
|
+
* An address counts with a scheme, with `www.`, as an email address, or as a
|
|
49142
|
+
* bare domain that `isBareDomain` accepts, so `Node.js` or `e.g.` don't
|
|
49143
|
+
* @private
|
|
49144
|
+
*/ function findTypedLink(text, end, tlds, fileEndings) {
|
|
49145
|
+
let start = end;
|
|
49146
|
+
while(start > 0 && !/\s/.test(text[start - 1])){
|
|
49147
|
+
start -= 1;
|
|
49148
|
+
}
|
|
49149
|
+
while(start < end && OPENING.has(text[start])){
|
|
49150
|
+
start += 1;
|
|
49151
|
+
}
|
|
49152
|
+
while(end > start){
|
|
49153
|
+
const char = text[end - 1];
|
|
49154
|
+
const opening = BRACKETS[char];
|
|
49155
|
+
if (CLOSING.has(char) || opening && !text.slice(start, end - 1).includes(opening)) {
|
|
49156
|
+
end -= 1;
|
|
49157
|
+
} else {
|
|
49158
|
+
break;
|
|
49159
|
+
}
|
|
49160
|
+
}
|
|
49161
|
+
const href = typedLinkHref(text.slice(start, end), tlds, fileEndings);
|
|
49162
|
+
return href ? [
|
|
49163
|
+
start,
|
|
49164
|
+
end,
|
|
49165
|
+
href
|
|
49166
|
+
] : null;
|
|
49167
|
+
}
|
|
49168
|
+
function typedLinkHref(address, tlds, fileEndings) {
|
|
49169
|
+
const email = address.replace(/^mailto:/i, '');
|
|
49170
|
+
if (EMAIL.test(email)) {
|
|
49171
|
+
return `mailto:${email}`;
|
|
49172
|
+
}
|
|
49173
|
+
if (/^www\.[^\s.]+\.\S+$/i.test(address) || isBareDomain(address, tlds, fileEndings)) {
|
|
49174
|
+
return `https://${address}`;
|
|
49175
|
+
}
|
|
49176
|
+
return /^[a-z][a-z\d+.-]*:\/\//i.test(address) && (0,_core_helpers_checker_is_url_js__WEBPACK_IMPORTED_MODULE_0__.isURL)(address) ? address : '';
|
|
49177
|
+
}
|
|
49178
|
+
/**
|
|
49179
|
+
* A domain typed without a scheme or `www.`, as `example.com`, `elections.nz`
|
|
49180
|
+
* or `bit.ly/enrol`. Its ending has to be in `TLDS` or `tlds`, typed in lower
|
|
49181
|
+
* case, so `Node.js` and a sentence run on, as in `home.It`, don't count, and
|
|
49182
|
+
* not in `fileEndings`, as in `photos.zip`. The first part has a letter,
|
|
49183
|
+
* which leaves out a time or a numbered step such as `11.am`
|
|
49184
|
+
*/ function isBareDomain(address, tlds, fileEndings) {
|
|
49185
|
+
const cut = address.search(/[/?#]/);
|
|
49186
|
+
const host = cut < 0 ? address : address.slice(0, cut);
|
|
49187
|
+
const labels = host.split('.');
|
|
49188
|
+
const ending = labels[labels.length - 1];
|
|
49189
|
+
return labels.length > 1 && labels.every((label)=>LABEL.test(label) && !label.endsWith('-')) && (_tlds_js__WEBPACK_IMPORTED_MODULE_1__.TLDS.has(ending) || tlds.includes(ending)) && !fileEndings.includes(ending) && /[a-z]/i.test(labels[0]);
|
|
49190
|
+
}
|
|
49191
|
+
|
|
49192
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, [
|
|
49193
|
+
/* harmony export */ "EMAIL", 0, /* binding */ EMAIL
|
|
49194
|
+
/* harmony export */ ]);
|
|
49195
|
+
|
|
49196
|
+
|
|
48773
49197
|
/***/ }),
|
|
48774
49198
|
|
|
48775
49199
|
/***/ 757:
|
|
@@ -50818,7 +51242,7 @@ const key = 'table_processor_observer-resize';
|
|
|
50818
51242
|
/**
|
|
50819
51243
|
* Click on resize handle
|
|
50820
51244
|
*/ onHandleMouseDown(event) {
|
|
50821
|
-
if (this.j.isLocked) {
|
|
51245
|
+
if (this.j.isLocked || this.j.o.readonly) {
|
|
50822
51246
|
return;
|
|
50823
51247
|
}
|
|
50824
51248
|
this.drag = true;
|
|
@@ -50853,10 +51277,15 @@ const key = 'table_processor_observer-resize';
|
|
|
50853
51277
|
let box;
|
|
50854
51278
|
this.minX = 0;
|
|
50855
51279
|
this.maxX = 1000000;
|
|
51280
|
+
this.startTableWidth = this.workTable.offsetWidth;
|
|
50856
51281
|
if (this.wholeTable != null) {
|
|
50857
|
-
const
|
|
51282
|
+
const parent = this.workTable.parentNode;
|
|
51283
|
+
const tableBox = parent.getBoundingClientRect();
|
|
50858
51284
|
this.minX = tableBox.left;
|
|
50859
51285
|
this.maxX = this.minX + tableBox.width;
|
|
51286
|
+
const side = this.isRTL ? 'marginRight' : 'marginLeft';
|
|
51287
|
+
this.startParentWidth = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.getContentWidth)(parent, this.j.ew);
|
|
51288
|
+
this.startMargin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
|
|
50860
51289
|
} else {
|
|
50861
51290
|
// find maximum columns
|
|
50862
51291
|
const coordinate = this.module.formalCoordinate(this.workTable, this.workCell, true);
|
|
@@ -50870,6 +51299,17 @@ const key = 'table_processor_observer-resize';
|
|
|
50870
51299
|
this.maxX = Math.min(box.left + box.width - _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.NEARBY / 2, this.maxX);
|
|
50871
51300
|
}
|
|
50872
51301
|
});
|
|
51302
|
+
const matrix = this.module.formalMatrix(this.workTable);
|
|
51303
|
+
this.startWidths = this.resizedColumns().map((column)=>{
|
|
51304
|
+
const cells = matrix.map((row)=>row[column]);
|
|
51305
|
+
const index = cells.findIndex((td)=>td.colSpan === 1 || cells.length === 1);
|
|
51306
|
+
const cell = cells[index];
|
|
51307
|
+
return [
|
|
51308
|
+
cell,
|
|
51309
|
+
cell ? cell.offsetWidth : 0,
|
|
51310
|
+
cells.slice(Math.max(index, 0) + 1)
|
|
51311
|
+
];
|
|
51312
|
+
});
|
|
50873
51313
|
}
|
|
50874
51314
|
return false;
|
|
50875
51315
|
}
|
|
@@ -50898,8 +51338,11 @@ const key = 'table_processor_observer-resize';
|
|
|
50898
51338
|
x = this.maxX;
|
|
50899
51339
|
}
|
|
50900
51340
|
this.resizeDelta = x - this.startX + (!this.j.o.iframe ? 0 : workplacePosition.left);
|
|
50901
|
-
this.
|
|
50902
|
-
|
|
51341
|
+
if (this.wholeTable == null) {
|
|
51342
|
+
this.setColumnWidths();
|
|
51343
|
+
} else {
|
|
51344
|
+
this.resizeTable();
|
|
51345
|
+
}
|
|
50903
51346
|
const tableBox = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.offset)(this.workTable, this.j, this.j.ed);
|
|
50904
51347
|
Object.assign(this.resizeHandler.style, {
|
|
50905
51348
|
left: this.startLeft + this.columnEdge() - this.startEdge + 'px',
|
|
@@ -51012,21 +51455,49 @@ const key = 'table_processor_observer-resize';
|
|
|
51012
51455
|
};
|
|
51013
51456
|
this.scrollFrame = this.j.async.requestAnimationFrame(scroll);
|
|
51014
51457
|
}
|
|
51458
|
+
/**
|
|
51459
|
+
* The two columns a column drag resizes: the work cell's last, and the
|
|
51460
|
+
* next cell's first
|
|
51461
|
+
*/ resizedColumns() {
|
|
51462
|
+
const nextTD = (0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.call)(this.isRTL ? _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.prev : _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.next, this.workCell, _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell, this.workCell.parentNode);
|
|
51463
|
+
return [
|
|
51464
|
+
this.module.formalCoordinate(this.workTable, this.workCell, true)[1],
|
|
51465
|
+
this.module.formalCoordinate(this.workTable, nextTD)[1]
|
|
51466
|
+
];
|
|
51467
|
+
}
|
|
51015
51468
|
/**
|
|
51016
51469
|
* Resize only one column
|
|
51017
51470
|
*/ resizeColumns() {
|
|
51018
51471
|
const delta = this.resizeDelta;
|
|
51019
51472
|
const marked = [];
|
|
51020
51473
|
const tableModule = this.module;
|
|
51021
|
-
|
|
51022
|
-
|
|
51023
|
-
tableModule.setColumnWidthByDelta(this.workTable,
|
|
51474
|
+
const [column, nextColumn] = this.resizedColumns();
|
|
51475
|
+
tableModule.setColumnWidthByDelta(this.workTable, column, delta, true, marked);
|
|
51476
|
+
tableModule.setColumnWidthByDelta(this.workTable, nextColumn, -delta, false, marked);
|
|
51477
|
+
}
|
|
51478
|
+
/**
|
|
51479
|
+
* Sets the widths `resizeColumns` would while the handle is dragged, from
|
|
51480
|
+
* the widths the drag started with, so that a move doesn't put back every
|
|
51481
|
+
* cell's style and lay the table out again to measure them
|
|
51482
|
+
*/ setColumnWidths() {
|
|
51483
|
+
this.startWidths.forEach(([cell, width, below], index)=>{
|
|
51484
|
+
const delta = index ? -this.resizeDelta : this.resizeDelta;
|
|
51485
|
+
if (cell) {
|
|
51486
|
+
(0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_5__.css)(cell, 'width', ((width + delta) / this.startTableWidth * 100).toFixed(_core_constants_js__WEBPACK_IMPORTED_MODULE_0__.ACCURACY) + '%');
|
|
51487
|
+
}
|
|
51488
|
+
below.forEach((td)=>{
|
|
51489
|
+
td.style.removeProperty('width');
|
|
51490
|
+
if (!(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(td, 'style')) {
|
|
51491
|
+
(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.attr)(td, 'style', null);
|
|
51492
|
+
}
|
|
51493
|
+
});
|
|
51494
|
+
});
|
|
51024
51495
|
}
|
|
51025
51496
|
/**
|
|
51026
51497
|
* Resize whole table
|
|
51027
51498
|
*/ resizeTable() {
|
|
51028
51499
|
const delta = this.resizeDelta * (this.isRTL ? -1 : 1);
|
|
51029
|
-
const width = this.
|
|
51500
|
+
const width = this.startTableWidth, parentWidth = this.startParentWidth;
|
|
51030
51501
|
// for RTL use mirror logic
|
|
51031
51502
|
const rightSide = !this.wholeTable;
|
|
51032
51503
|
const needChangeWidth = this.isRTL ? !rightSide : rightSide;
|
|
@@ -51035,10 +51506,9 @@ const key = 'table_processor_observer-resize';
|
|
|
51035
51506
|
(0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_5__.css)(this.workTable, 'width', (width + delta) / parentWidth * 100 + '%');
|
|
51036
51507
|
} else {
|
|
51037
51508
|
const side = this.isRTL ? 'marginRight' : 'marginLeft';
|
|
51038
|
-
const margin = parseInt(this.j.ew.getComputedStyle(this.workTable)[side] || '0', 10);
|
|
51039
51509
|
(0,_core_helpers_utils_css_js__WEBPACK_IMPORTED_MODULE_5__.css)(this.workTable, {
|
|
51040
51510
|
width: (width - delta) / parentWidth * 100 + '%',
|
|
51041
|
-
[side]: (
|
|
51511
|
+
[side]: (this.startMargin + delta) / parentWidth * 100 + '%'
|
|
51042
51512
|
});
|
|
51043
51513
|
}
|
|
51044
51514
|
}
|
|
@@ -51114,9 +51584,10 @@ const key = 'table_processor_observer-resize';
|
|
|
51114
51584
|
if (!editor.o.tableAllowCellResize) {
|
|
51115
51585
|
return;
|
|
51116
51586
|
}
|
|
51117
|
-
|
|
51587
|
+
const observeTables = ()=>{
|
|
51118
51588
|
;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.$$)('table', editor.editor).forEach(this.observe);
|
|
51119
|
-
}
|
|
51589
|
+
};
|
|
51590
|
+
editor.e.off(this.j.ow, '.resize-cells').off('.resize-cells').on('change.resize-cells afterCommand.resize-cells afterSetMode.resize-cells', observeTables).on(this.j.ow, 'scroll.resize-cells', ()=>{
|
|
51120
51591
|
if (!this.drag || this.workRow) {
|
|
51121
51592
|
return;
|
|
51122
51593
|
}
|
|
@@ -51132,6 +51603,8 @@ const key = 'table_processor_observer-resize';
|
|
|
51132
51603
|
tableModule.normalizeTable(_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(td, 'table', editor.editor));
|
|
51133
51604
|
});
|
|
51134
51605
|
});
|
|
51606
|
+
// None of those events comes with the editor's starting value
|
|
51607
|
+
observeTables();
|
|
51135
51608
|
}
|
|
51136
51609
|
/**
|
|
51137
51610
|
* Add to every Table listeners
|
|
@@ -51145,7 +51618,9 @@ const key = 'table_processor_observer-resize';
|
|
|
51145
51618
|
this.hideResizeHandle();
|
|
51146
51619
|
}
|
|
51147
51620
|
}).on(table, 'mousemove.resize-cells touchmove.resize-cells', this.j.async.throttle((event)=>{
|
|
51148
|
-
|
|
51621
|
+
// A drag from a cell isn't a resize, and the handle on
|
|
51622
|
+
// a border it passes would take its moves (#1778)
|
|
51623
|
+
if (this.j.isLocked || this.j.o.readonly || event.buttons) {
|
|
51149
51624
|
return;
|
|
51150
51625
|
}
|
|
51151
51626
|
const cell = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.up(event.target, _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell, table);
|
|
@@ -51187,10 +51662,21 @@ const key = 'table_processor_observer-resize';
|
|
|
51187
51662
|
this.startX = 0;
|
|
51188
51663
|
/**
|
|
51189
51664
|
* The table's and its cells' styles as a column drag started, put back
|
|
51190
|
-
* before
|
|
51665
|
+
* as it ends, before the final widths
|
|
51191
51666
|
*/ this.startStyles = [];
|
|
51192
51667
|
this.startLeft = 0;
|
|
51193
51668
|
this.startEdge = 0;
|
|
51669
|
+
/**
|
|
51670
|
+
* For each of the two columns a drag resizes, the cell whose width
|
|
51671
|
+
* `setColumnWidthByDelta` sets, with its width as the drag started, and
|
|
51672
|
+
* the cells below it, whose widths it clears
|
|
51673
|
+
*/ this.startWidths = [];
|
|
51674
|
+
/**
|
|
51675
|
+
* The table's width as the drag started, and for a drag of its edge, the
|
|
51676
|
+
* width inside what holds it and its margin on that side
|
|
51677
|
+
*/ this.startTableWidth = 0;
|
|
51678
|
+
this.startParentWidth = 0;
|
|
51679
|
+
this.startMargin = 0;
|
|
51194
51680
|
/**
|
|
51195
51681
|
* The row whose height the handle sets, or null while it sets a width
|
|
51196
51682
|
*/ this.workRow = null;
|
|
@@ -53032,7 +53518,6 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.tableAllowCellSelection
|
|
|
53032
53518
|
|
|
53033
53519
|
|
|
53034
53520
|
const key = 'table_processor_observer';
|
|
53035
|
-
const MOUSE_MOVE_LABEL = 'onMoveTableSelectCell';
|
|
53036
53521
|
class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plugin {
|
|
53037
53522
|
/**
|
|
53038
53523
|
* Shortcut for Jodit.modules.Table
|
|
@@ -53047,6 +53532,8 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
|
|
|
53047
53532
|
// move the caret, as table-keyboard-navigation's do
|
|
53048
53533
|
.on('keydown', this.__onKeyDown, {
|
|
53049
53534
|
top: true
|
|
53535
|
+
}).on('clickEditor', this.__onClickAfterDrag, {
|
|
53536
|
+
top: true
|
|
53050
53537
|
}).on('keydown.select-cells', (event)=>{
|
|
53051
53538
|
if (event.key === _core_constants_js__WEBPACK_IMPORTED_MODULE_0__.KEY_TAB) {
|
|
53052
53539
|
this.unselectCells();
|
|
@@ -53166,18 +53653,36 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
|
|
|
53166
53653
|
}
|
|
53167
53654
|
this.__isSelectionMode = true;
|
|
53168
53655
|
this.__selectedCell = cell;
|
|
53656
|
+
this.__movedTo = cell;
|
|
53169
53657
|
this.__tableModule.addSelection(cell);
|
|
53170
|
-
this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells',
|
|
53171
|
-
|
|
53172
|
-
|
|
53173
|
-
|
|
53174
|
-
|
|
53658
|
+
this.j.e.on(table, 'mousemove.select-cells touchmove.select-cells', this.__onMove.bind(this, table)).on(table, 'mouseup.select-cells touchend.select-cells', this.__onStopSelection.bind(this, table));
|
|
53659
|
+
new Set([
|
|
53660
|
+
this.j.ew,
|
|
53661
|
+
this.j.ow
|
|
53662
|
+
]).forEach((win)=>this.j.e.on(win, 'mouseup.select-cells touchend.select-cells', this.__onRelease.bind(this, table)));
|
|
53175
53663
|
return false;
|
|
53176
53664
|
}
|
|
53177
53665
|
onOutsideClick() {
|
|
53178
53666
|
this.__selectedCell = null;
|
|
53179
53667
|
this.__onRemoveSelection();
|
|
53180
53668
|
}
|
|
53669
|
+
onMouseDown() {
|
|
53670
|
+
this.__keepMarks = false;
|
|
53671
|
+
}
|
|
53672
|
+
/**
|
|
53673
|
+
* The click that ends a drag let go outside the table, and inside the
|
|
53674
|
+
* editor, lands on the editor. Taken on, it would unmark the cells and
|
|
53675
|
+
* close their popup. As for the click on a row after a drag over the
|
|
53676
|
+
* cells, the browser's own selection from the drag goes
|
|
53677
|
+
*/ __onClickAfterDrag() {
|
|
53678
|
+
var _a;
|
|
53679
|
+
if (this.__keepMarks) {
|
|
53680
|
+
this.__keepMarks = false;
|
|
53681
|
+
(_a = this.j.s.sel) === null || _a === void 0 ? void 0 : _a.removeAllRanges();
|
|
53682
|
+
this.j.e.stopPropagation('clickEditor');
|
|
53683
|
+
return false;
|
|
53684
|
+
}
|
|
53685
|
+
}
|
|
53181
53686
|
onChange() {
|
|
53182
53687
|
if (!this.j.isLocked && !this.__isSelectionMode) {
|
|
53183
53688
|
this.__onRemoveSelection();
|
|
@@ -53196,16 +53701,20 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
|
|
|
53196
53701
|
// Inside Shadow DOM `document.elementFromPoint` returns the shadow
|
|
53197
53702
|
// host, so the lookup must start from the shadow root
|
|
53198
53703
|
const node = ((_a = this.j.o.shadowRoot) !== null && _a !== void 0 ? _a : this.j.ed).elementFromPoint(e.clientX, e.clientY);
|
|
53199
|
-
|
|
53200
|
-
return;
|
|
53201
|
-
}
|
|
53202
|
-
const cell = _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, [
|
|
53704
|
+
const cell = node && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(node, [
|
|
53203
53705
|
'td',
|
|
53204
53706
|
'th'
|
|
53205
53707
|
], table);
|
|
53206
53708
|
if (!cell || !this.__selectedCell) {
|
|
53207
53709
|
return;
|
|
53208
53710
|
}
|
|
53711
|
+
// The marks change only when the mouse goes into another cell, and then
|
|
53712
|
+
// at once rather than throttled, as the browser's own selection from
|
|
53713
|
+
// the drag shows in the cells between until they do (#1778)
|
|
53714
|
+
if (cell === this.__movedTo) {
|
|
53715
|
+
return;
|
|
53716
|
+
}
|
|
53717
|
+
this.__movedTo = cell;
|
|
53209
53718
|
if (cell !== this.__selectedCell) {
|
|
53210
53719
|
this.j.lock(key);
|
|
53211
53720
|
}
|
|
@@ -53242,7 +53751,7 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
|
|
|
53242
53751
|
/**
|
|
53243
53752
|
* Stop a selection process
|
|
53244
53753
|
*/ __onStopSelection(table, e) {
|
|
53245
|
-
var _a
|
|
53754
|
+
var _a;
|
|
53246
53755
|
if (!this.__selectedCell) {
|
|
53247
53756
|
return;
|
|
53248
53757
|
}
|
|
@@ -53265,11 +53774,34 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
|
|
|
53265
53774
|
if (ownTable && ownTable !== table) {
|
|
53266
53775
|
return; // Nested tables
|
|
53267
53776
|
}
|
|
53268
|
-
|
|
53777
|
+
this.__showCellsPopup(table, [
|
|
53269
53778
|
cell,
|
|
53270
53779
|
this.__selectedCell
|
|
53271
|
-
])
|
|
53272
|
-
|
|
53780
|
+
]);
|
|
53781
|
+
this.__stopListening();
|
|
53782
|
+
}
|
|
53783
|
+
/**
|
|
53784
|
+
* A drag let go outside the table doesn't reach the table's `mouseup`, so
|
|
53785
|
+
* the window's ends it, leaving the cells marked as they were (#1774)
|
|
53786
|
+
*/ __onRelease(table, e) {
|
|
53787
|
+
if (this.__isSelectionMode) {
|
|
53788
|
+
this.__isSelectionMode = false;
|
|
53789
|
+
if (!this.j.isLockedNotBy(key)) {
|
|
53790
|
+
this.j.unlock();
|
|
53791
|
+
}
|
|
53792
|
+
const cells = this.__tableModule.getAllSelectedCells();
|
|
53793
|
+
// One let go outside the editor clicks outside it, which unmarks them
|
|
53794
|
+
if (cells.length > 1 && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isOrContains(this.j.editor, e.target)) {
|
|
53795
|
+
this.__keepMarks = true;
|
|
53796
|
+
this.__showCellsPopup(table, cells);
|
|
53797
|
+
}
|
|
53798
|
+
}
|
|
53799
|
+
this.__stopListening();
|
|
53800
|
+
}
|
|
53801
|
+
__showCellsPopup(table, cells) {
|
|
53802
|
+
var _a, _b;
|
|
53803
|
+
const bound = this.__tableModule.getSelectedBound(table, cells), box = this.__tableModule.formalMatrix(table);
|
|
53804
|
+
const max = (_a = box[bound[1][0]]) === null || _a === void 0 ? void 0 : _a[bound[1][1]], min = (_b = box[bound[0][0]]) === null || _b === void 0 ? void 0 : _b[bound[0][1]];
|
|
53273
53805
|
// `getSelectedBound` keeps its `Infinity` sentinel when none of the
|
|
53274
53806
|
// selected cells belong to this table's matrix — e.g. after a
|
|
53275
53807
|
// drag-and-drop that moved/removed the cells, leaving a stale anchor and
|
|
@@ -53288,10 +53820,16 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
|
|
|
53288
53820
|
height: maxOffset.top - minOffset.top + maxOffset.height
|
|
53289
53821
|
};
|
|
53290
53822
|
}, 'cells');
|
|
53291
|
-
|
|
53823
|
+
}
|
|
53824
|
+
__stopListening() {
|
|
53825
|
+
;(0,_core_helpers_index_js__WEBPACK_IMPORTED_MODULE_4__.$$)('table', this.j.editor).forEach((table)=>{
|
|
53292
53826
|
this.j.e.off(table, 'mousemove.select-cells touchmove.select-cells mouseup.select-cells touchend.select-cells');
|
|
53293
53827
|
});
|
|
53294
|
-
|
|
53828
|
+
new Set([
|
|
53829
|
+
this.j.ew,
|
|
53830
|
+
this.j.ow
|
|
53831
|
+
]).forEach((win)=>this.j.e.off(win, 'mouseup.select-cells touchend.select-cells'));
|
|
53832
|
+
this.__movedTo = null;
|
|
53295
53833
|
}
|
|
53296
53834
|
/**
|
|
53297
53835
|
* Remove selection for all cells
|
|
@@ -53462,7 +54000,8 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
|
|
|
53462
54000
|
}
|
|
53463
54001
|
/** @override */ beforeDestruct(jodit) {
|
|
53464
54002
|
this.__onRemoveSelection();
|
|
53465
|
-
|
|
54003
|
+
this.__stopListening();
|
|
54004
|
+
jodit.e.off('.select-cells').off('keydown', this.__onKeyDown).off('clickEditor', this.__onClickAfterDrag);
|
|
53466
54005
|
}
|
|
53467
54006
|
constructor(){
|
|
53468
54007
|
super(...arguments);
|
|
@@ -53479,6 +54018,13 @@ class selectCells extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_5__.Plu
|
|
|
53479
54018
|
/**
|
|
53480
54019
|
* User is selecting cells now
|
|
53481
54020
|
*/ this.__isSelectionMode = false;
|
|
54021
|
+
/**
|
|
54022
|
+
* The cell the marks were last drawn to
|
|
54023
|
+
*/ this.__movedTo = null;
|
|
54024
|
+
/**
|
|
54025
|
+
* A drag let go outside the table ends in a click on the editor, which
|
|
54026
|
+
* would unmark its cells
|
|
54027
|
+
*/ this.__keepMarks = false;
|
|
53482
54028
|
}
|
|
53483
54029
|
}
|
|
53484
54030
|
selectCells.requires = [
|
|
@@ -53496,6 +54042,15 @@ __decorate([
|
|
|
53496
54042
|
__decorate([
|
|
53497
54043
|
(0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':outsideClick')
|
|
53498
54044
|
], selectCells.prototype, "onOutsideClick", null);
|
|
54045
|
+
__decorate([
|
|
54046
|
+
(0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)([
|
|
54047
|
+
':mousedown',
|
|
54048
|
+
':touchstart'
|
|
54049
|
+
])
|
|
54050
|
+
], selectCells.prototype, "onMouseDown", null);
|
|
54051
|
+
__decorate([
|
|
54052
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
54053
|
+
], selectCells.prototype, "__onClickAfterDrag", null);
|
|
53499
54054
|
__decorate([
|
|
53500
54055
|
(0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':change')
|
|
53501
54056
|
], selectCells.prototype, "onChange", null);
|
|
@@ -53543,10 +54098,11 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
53543
54098
|
/* harmony import */ var _core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(65478);
|
|
53544
54099
|
/* harmony import */ var _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2748);
|
|
53545
54100
|
/* harmony import */ var _core_global_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(580);
|
|
53546
|
-
/* harmony import */ var
|
|
53547
|
-
/* harmony import */ var
|
|
53548
|
-
/* harmony import */ var
|
|
53549
|
-
/* harmony import */ var
|
|
54101
|
+
/* harmony import */ var _core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4510);
|
|
54102
|
+
/* harmony import */ var _core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(87058);
|
|
54103
|
+
/* harmony import */ var _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(50911);
|
|
54104
|
+
/* harmony import */ var _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(67510);
|
|
54105
|
+
/* harmony import */ var _config_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(67215);
|
|
53550
54106
|
/*!
|
|
53551
54107
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
53552
54108
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -53565,6 +54121,7 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
53565
54121
|
|
|
53566
54122
|
|
|
53567
54123
|
|
|
54124
|
+
|
|
53568
54125
|
/**
|
|
53569
54126
|
* A utility plugin that allows you to subscribe to a click/mousedown/touchstart/mouseup on an element in DOM order
|
|
53570
54127
|
*
|
|
@@ -53575,22 +54132,27 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
53575
54132
|
* console.log(img.src);
|
|
53576
54133
|
* })
|
|
53577
54134
|
* ```
|
|
53578
|
-
*/ class select extends
|
|
54135
|
+
*/ class select extends _core_plugin_index_js__WEBPACK_IMPORTED_MODULE_6__.Plugin {
|
|
53579
54136
|
afterInit(jodit) {
|
|
53580
54137
|
this.proxyEventsList.forEach((eventName)=>{
|
|
53581
54138
|
jodit.e.on(eventName + '.select', this.onStartSelection);
|
|
53582
54139
|
});
|
|
54140
|
+
jodit.e.on('dblclick', this.__onDblClickBesideRow, {
|
|
54141
|
+
top: true
|
|
54142
|
+
});
|
|
53583
54143
|
}
|
|
53584
54144
|
beforeDestruct(jodit) {
|
|
53585
54145
|
this.proxyEventsList.forEach((eventName)=>{
|
|
53586
|
-
jodit.e.
|
|
54146
|
+
jodit.e.off(eventName + '.select', this.onStartSelection);
|
|
53587
54147
|
});
|
|
54148
|
+
this.__endPressBesideRow();
|
|
54149
|
+
jodit.e.off('dblclick', this.__onDblClickBesideRow);
|
|
53588
54150
|
}
|
|
53589
54151
|
onStartSelection(e) {
|
|
53590
54152
|
const { j } = this;
|
|
53591
54153
|
let result, target = e.target;
|
|
53592
54154
|
while(result === undefined && target && target !== j.editor){
|
|
53593
|
-
result = j.e.fire((0,
|
|
54155
|
+
result = j.e.fire((0,_core_helpers_string_camel_case_js__WEBPACK_IMPORTED_MODULE_5__.camelCase)(e.type + '_' + target.nodeName.toLowerCase()), target, e);
|
|
53594
54156
|
target = target.parentElement;
|
|
53595
54157
|
}
|
|
53596
54158
|
if (e.type === 'click' && result === undefined && target === j.editor) {
|
|
@@ -53610,10 +54172,10 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
53610
54172
|
}
|
|
53611
54173
|
// Selecting the text of a popup input with the mouse and releasing
|
|
53612
54174
|
// the button past the popup's edge is not a click outside of it.
|
|
53613
|
-
if (pressed &&
|
|
54175
|
+
if (pressed && _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(pressed, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.Popup)) {
|
|
53614
54176
|
return;
|
|
53615
54177
|
}
|
|
53616
|
-
const box =
|
|
54178
|
+
const box = _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.UIElement.closestElement(node, _core_ui_index_js__WEBPACK_IMPORTED_MODULE_7__.Popup);
|
|
53617
54179
|
if (!box) {
|
|
53618
54180
|
this.j.e.fire('outsideClick', e);
|
|
53619
54181
|
}
|
|
@@ -53659,6 +54221,127 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
53659
54221
|
s.setCursorAfter(text);
|
|
53660
54222
|
}
|
|
53661
54223
|
}
|
|
54224
|
+
/**
|
|
54225
|
+
* The table row the mouse is to the right of
|
|
54226
|
+
*/ __rowBeside(e) {
|
|
54227
|
+
var _a;
|
|
54228
|
+
const { j } = this;
|
|
54229
|
+
const target = e.target;
|
|
54230
|
+
if (j.o.readonly || e.button !== 0 || e.detail > 2 || !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isHTMLElement(target) || _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.closest(target, _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isCell, j.editor)) {
|
|
54231
|
+
return null;
|
|
54232
|
+
}
|
|
54233
|
+
const table = (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(target.children).find((elm)=>{
|
|
54234
|
+
if (!_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(elm, 'table')) {
|
|
54235
|
+
return false;
|
|
54236
|
+
}
|
|
54237
|
+
const box = elm.getBoundingClientRect();
|
|
54238
|
+
return e.clientX >= box.right && e.clientY >= box.top && e.clientY < box.bottom;
|
|
54239
|
+
});
|
|
54240
|
+
const rows = table ? (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(table.rows).filter((row)=>row.cells.length) : [];
|
|
54241
|
+
if (!table || !rows.length) {
|
|
54242
|
+
return null;
|
|
54243
|
+
}
|
|
54244
|
+
const row = (_a = rows.find((row)=>e.clientY < row.getBoundingClientRect().bottom)) !== null && _a !== void 0 ? _a : rows[rows.length - 1];
|
|
54245
|
+
return {
|
|
54246
|
+
table,
|
|
54247
|
+
row
|
|
54248
|
+
};
|
|
54249
|
+
}
|
|
54250
|
+
/**
|
|
54251
|
+
* A press to the right of a table row puts the caret where Word's typing
|
|
54252
|
+
* goes from there: the start of the next row's first cell, or of the block
|
|
54253
|
+
* after the table for the last row (#1770). The browsers put it after the
|
|
54254
|
+
* table, whichever row it's beside, so typing starts a new line below it.
|
|
54255
|
+
* Their own press is stopped, as its drag would start after the table and
|
|
54256
|
+
* take in the rows below first
|
|
54257
|
+
*/ onMouseDownBesideTableRow(e) {
|
|
54258
|
+
const { j } = this;
|
|
54259
|
+
const beside = this.__rowBeside(e);
|
|
54260
|
+
if (!beside) {
|
|
54261
|
+
return;
|
|
54262
|
+
}
|
|
54263
|
+
// A press before the last one was let go must not stack its listeners
|
|
54264
|
+
this.__endPressBesideRow();
|
|
54265
|
+
e.preventDefault();
|
|
54266
|
+
this.__putCaretBesideRow(beside.table, beside.row);
|
|
54267
|
+
this.__pressBesideRow = {
|
|
54268
|
+
row: beside.row,
|
|
54269
|
+
caret: j.s.range.cloneRange()
|
|
54270
|
+
};
|
|
54271
|
+
j.e.on(j.ew, 'mousemove', this.__onDragFromRow);
|
|
54272
|
+
new Set([
|
|
54273
|
+
j.ew,
|
|
54274
|
+
j.ow
|
|
54275
|
+
]).forEach((win)=>j.e.on(win, 'mouseup', this.__onReleaseFromRow));
|
|
54276
|
+
}
|
|
54277
|
+
/**
|
|
54278
|
+
* A drag from beside a row selects from the end of the row to the mouse,
|
|
54279
|
+
* and back beside the row it's the caret again
|
|
54280
|
+
*/ __onDragFromRow(e) {
|
|
54281
|
+
var _a, _b;
|
|
54282
|
+
const { s } = this.j;
|
|
54283
|
+
const press = this.__pressBesideRow;
|
|
54284
|
+
if (!press || !(e.buttons & 1)) {
|
|
54285
|
+
this.__endPressBesideRow();
|
|
54286
|
+
return;
|
|
54287
|
+
}
|
|
54288
|
+
if (((_a = this.__rowBeside(e)) === null || _a === void 0 ? void 0 : _a.row) === press.row) {
|
|
54289
|
+
if (!s.isCollapsed()) {
|
|
54290
|
+
s.selectRange(press.caret.cloneRange());
|
|
54291
|
+
}
|
|
54292
|
+
return;
|
|
54293
|
+
}
|
|
54294
|
+
const { cells } = press.row;
|
|
54295
|
+
const last = cells[cells.length - 1];
|
|
54296
|
+
if (s.insertCursorAtPoint(e.clientX, e.clientY)) {
|
|
54297
|
+
const { startContainer, startOffset } = s.range;
|
|
54298
|
+
(_b = s.sel) === null || _b === void 0 ? void 0 : _b.setBaseAndExtent(last, last.childNodes.length, startContainer, startOffset);
|
|
54299
|
+
}
|
|
54300
|
+
}
|
|
54301
|
+
/**
|
|
54302
|
+
* In iframe mode, a press in an editor without the focus puts the caret at
|
|
54303
|
+
* its end, so a release that selected nothing puts it back
|
|
54304
|
+
*/ __onReleaseFromRow() {
|
|
54305
|
+
const press = this.__pressBesideRow;
|
|
54306
|
+
this.__endPressBesideRow();
|
|
54307
|
+
if (press && this.j.s.isCollapsed()) {
|
|
54308
|
+
this.j.s.selectRange(press.caret);
|
|
54309
|
+
}
|
|
54310
|
+
}
|
|
54311
|
+
__endPressBesideRow() {
|
|
54312
|
+
const { j } = this;
|
|
54313
|
+
this.__pressBesideRow = null;
|
|
54314
|
+
j.e.off(j.ew, 'mousemove', this.__onDragFromRow);
|
|
54315
|
+
new Set([
|
|
54316
|
+
j.ew,
|
|
54317
|
+
j.ow
|
|
54318
|
+
]).forEach((win)=>j.e.off(win, 'mouseup', this.__onReleaseFromRow));
|
|
54319
|
+
}
|
|
54320
|
+
/**
|
|
54321
|
+
* A double click beside a row is two clicks there, so add-new-line,
|
|
54322
|
+
* which adds a line on a double click with a caret, doesn't see it
|
|
54323
|
+
*/ __onDblClickBesideRow(e) {
|
|
54324
|
+
if (this.__rowBeside(e)) {
|
|
54325
|
+
this.j.e.stopPropagation('dblclick');
|
|
54326
|
+
return false;
|
|
54327
|
+
}
|
|
54328
|
+
}
|
|
54329
|
+
__putCaretBesideRow(table, row) {
|
|
54330
|
+
const { j } = this;
|
|
54331
|
+
const rows = (0,_core_helpers_array_to_array_js__WEBPACK_IMPORTED_MODULE_4__.toArray)(table.rows);
|
|
54332
|
+
const next = rows.slice(rows.indexOf(row) + 1).find((row)=>row.cells.length);
|
|
54333
|
+
let after = table.nextSibling;
|
|
54334
|
+
while(after && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isEmptyTextNode(after)){
|
|
54335
|
+
after = after.nextSibling;
|
|
54336
|
+
}
|
|
54337
|
+
if (next) {
|
|
54338
|
+
j.s.setCursorIn(next.cells[0], true);
|
|
54339
|
+
} else if (_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isBlock(after) && !_core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isTag(after, 'table') && _core_dom_dom_js__WEBPACK_IMPORTED_MODULE_2__.Dom.isContentEditable(after, j.editor)) {
|
|
54340
|
+
j.s.setCursorIn(after, true);
|
|
54341
|
+
} else {
|
|
54342
|
+
j.s.setCursorAfter(table);
|
|
54343
|
+
}
|
|
54344
|
+
}
|
|
53662
54345
|
/**
|
|
53663
54346
|
* Keep pending inline formatting after a click. Toggling Bold/Italic/etc. on
|
|
53664
54347
|
* a collapsed cursor leaves empty marker elements with the caret inside; a
|
|
@@ -53724,6 +54407,10 @@ _config_js__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.select = {
|
|
|
53724
54407
|
* element and ends in another as a `click` on their common ancestor, so a
|
|
53725
54408
|
* press inside a popup is remembered to tell such a drag from a real click.
|
|
53726
54409
|
*/ this.__pressTarget = null;
|
|
54410
|
+
/**
|
|
54411
|
+
* The row a press to its right was beside, and the caret it put there,
|
|
54412
|
+
* while the button is down
|
|
54413
|
+
*/ this.__pressBesideRow = null;
|
|
53727
54414
|
}
|
|
53728
54415
|
}
|
|
53729
54416
|
__decorate([
|
|
@@ -53753,6 +54440,18 @@ __decorate([
|
|
|
53753
54440
|
':click'
|
|
53754
54441
|
])
|
|
53755
54442
|
], select.prototype, "onClickRightOfNestedListItem", null);
|
|
54443
|
+
__decorate([
|
|
54444
|
+
(0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)(':mousedown')
|
|
54445
|
+
], select.prototype, "onMouseDownBesideTableRow", null);
|
|
54446
|
+
__decorate([
|
|
54447
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
54448
|
+
], select.prototype, "__onDragFromRow", null);
|
|
54449
|
+
__decorate([
|
|
54450
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
54451
|
+
], select.prototype, "__onReleaseFromRow", null);
|
|
54452
|
+
__decorate([
|
|
54453
|
+
_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.autobind
|
|
54454
|
+
], select.prototype, "__onDblClickBesideRow", null);
|
|
53756
54455
|
__decorate([
|
|
53757
54456
|
(0,_core_decorators_index_js__WEBPACK_IMPORTED_MODULE_1__.watch)([
|
|
53758
54457
|
':click'
|