jodit 3.12.3 → 3.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/stylesheetLinters/stylelint.xml +6 -0
- package/.idea/workspace.xml +306 -288
- package/CHANGELOG.MD +82 -10
- package/README.md +107 -78
- package/build/jodit.css +112 -70
- package/build/jodit.es2018.css +107 -64
- package/build/jodit.es2018.en.css +107 -64
- package/build/jodit.es2018.en.js +1065 -892
- package/build/jodit.es2018.en.min.css +1 -1
- package/build/jodit.es2018.en.min.js +1 -1
- package/build/jodit.es2018.js +1101 -928
- package/build/jodit.es2018.min.css +1 -1
- package/build/jodit.es2018.min.js +1 -1
- package/build/jodit.js +4886 -2306
- package/build/jodit.min.css +2 -2
- package/build/jodit.min.js +1 -1
- package/index.html +1 -0
- package/package.json +35 -35
- package/src/config.ts +18 -0
- package/src/core/async/async.ts +2 -2
- package/src/core/component/README.md +2 -2
- package/src/core/component/component.ts +16 -6
- package/src/core/component/view-component.ts +1 -1
- package/src/core/constants.ts +45 -1
- package/src/core/create/create.ts +4 -4
- package/src/core/decorators/cache/cache.ts +2 -2
- package/src/core/decorators/component/component.ts +1 -1
- package/src/core/decorators/debounce/debounce.ts +4 -4
- package/src/core/decorators/hook/hook.ts +4 -4
- package/src/core/decorators/idle/idle.ts +3 -3
- package/src/core/decorators/persistent/persistent.ts +3 -3
- package/src/core/decorators/wait/wait.ts +3 -3
- package/src/core/decorators/watch/watch.ts +48 -45
- package/src/core/dom/README.md +2 -0
- package/src/core/dom/dom.ts +5 -5
- package/src/core/event-emitter/event-emitter.ts +5 -5
- package/src/core/event-emitter/index.ts +1 -1
- package/src/core/event-emitter/observable.ts +192 -0
- package/src/core/event-emitter/store.ts +1 -1
- package/src/core/global.ts +1 -1
- package/src/core/helpers/README.md +31 -1
- package/src/core/helpers/checker/is-equal.ts +1 -1
- package/src/core/helpers/checker/is-imp-interface.ts +2 -2
- package/src/core/helpers/checker/is-jodit-object.ts +1 -1
- package/src/core/helpers/checker/is-plain-object.ts +1 -1
- package/src/core/helpers/html/apply-styles.ts +2 -2
- package/src/core/helpers/html/clean-from-word.ts +3 -3
- package/src/core/helpers/html/nl2br.ts +1 -1
- package/src/core/helpers/html/strip-tags.ts +5 -5
- package/src/core/helpers/normalize/normalize-key-aliases.ts +3 -3
- package/src/core/helpers/normalize/normalize-node.ts +2 -2
- package/src/core/helpers/size/get-scroll-parent.ts +3 -3
- package/src/core/helpers/size/object-size.ts +1 -1
- package/src/core/helpers/size/offset.ts +1 -1
- package/src/core/helpers/size/position.ts +1 -1
- package/src/core/helpers/string/i18n.ts +10 -6
- package/src/core/helpers/string/stringify.ts +1 -1
- package/src/core/helpers/string/trim.ts +1 -1
- package/src/core/helpers/utils/append-script.ts +1 -1
- package/src/core/helpers/utils/assert.ts +25 -0
- package/src/core/helpers/utils/build-query.ts +1 -1
- package/src/core/helpers/utils/config-proto.ts +2 -2
- package/src/core/helpers/utils/css.ts +1 -1
- package/src/core/helpers/utils/data-bind.ts +2 -2
- package/src/core/helpers/utils/get-class-name.ts +1 -1
- package/src/core/helpers/utils/get.ts +1 -1
- package/src/core/helpers/utils/index.ts +1 -0
- package/src/core/helpers/utils/parse-query.ts +1 -1
- package/src/core/helpers/utils/selector.ts +8 -9
- package/src/core/helpers/utils/set.ts +1 -1
- package/src/core/helpers/utils/stack.ts +1 -1
- package/src/core/helpers/utils/utils.ts +1 -1
- package/src/core/plugin/README.md +13 -0
- package/src/core/plugin/plugin-system.ts +58 -17
- package/src/core/plugin/plugin.ts +3 -3
- package/src/core/request/ajax.ts +3 -3
- package/src/core/request/config.ts +3 -3
- package/src/core/request/response.ts +1 -1
- package/src/core/selection/select.ts +6 -6
- package/src/core/selection/style/api/element-has-same-style.ts +3 -3
- package/src/core/selection/style/api/extract.ts +3 -3
- package/src/core/selection/style/api/finite-state-machine.ts +1 -1
- package/src/core/selection/style/api/get-suit-child.ts +2 -2
- package/src/core/selection/style/api/get-suit-parent.ts +2 -2
- package/src/core/selection/style/api/is-inside-invisible-element.ts +1 -1
- package/src/core/selection/style/api/is-normal-node.ts +2 -2
- package/src/core/selection/style/api/is-suit-element.ts +3 -3
- package/src/core/selection/style/api/toggle/toggle-css.ts +6 -6
- package/src/core/selection/style/api/toggle/toggle-ordered-list.ts +2 -2
- package/src/core/selection/style/api/toggle-commit-styles.ts +1 -1
- package/src/core/selection/style/api/unwrap-children.ts +3 -3
- package/src/core/selection/style/api/wrap-and-commit-style.ts +3 -3
- package/src/core/selection/style/api/wrap-ordered-list.ts +2 -2
- package/src/core/selection/style/api/wrap-unwrapped-text.ts +2 -2
- package/src/core/selection/style/apply-style.ts +3 -3
- package/src/core/selection/style/commit-style.ts +2 -2
- package/src/core/storage/engines/local-storage-provider.ts +1 -5
- package/src/core/storage/engines/memory-storage-provider.ts +1 -1
- package/src/core/storage/storage.ts +1 -1
- package/src/core/traits/elms.ts +6 -7
- package/src/core/traits/mods.ts +11 -14
- package/src/core/ui/button/button/button.ts +8 -8
- package/src/core/ui/button/group/group.ts +6 -3
- package/src/core/ui/element.ts +12 -12
- package/src/core/ui/form/block/block.ts +4 -4
- package/src/core/ui/form/form.ts +4 -5
- package/src/core/ui/form/inputs/area/area.ts +3 -3
- package/src/core/ui/form/inputs/checkbox/checkbox.ts +5 -5
- package/src/core/ui/form/inputs/file/file.ts +4 -4
- package/src/core/ui/form/inputs/input/input.ts +8 -8
- package/src/core/ui/form/inputs/select/select.ts +8 -5
- package/src/core/ui/form/validators/input.ts +2 -2
- package/src/core/ui/form/validators/select.ts +2 -2
- package/src/core/ui/group/group.ts +8 -6
- package/src/core/ui/group/list.less +1 -1
- package/src/core/ui/group/list.ts +15 -11
- package/src/core/ui/group/separator.ts +3 -4
- package/src/core/ui/group/spacer.ts +3 -3
- package/src/core/ui/helpers/buttons.ts +2 -2
- package/src/core/ui/helpers/get-control-type.ts +3 -3
- package/src/core/ui/helpers/get-strong-control-types.ts +4 -4
- package/src/core/ui/icon.ts +2 -2
- package/src/core/ui/popup/popup.ts +7 -7
- package/src/core/ui/progress-bar/progress-bar.ts +2 -2
- package/src/core/view/view-with-toolbar.ts +5 -5
- package/src/core/view/view.ts +6 -6
- package/src/langs/README.md +124 -1
- package/src/langs/index.ts +1 -1
- package/src/modules/context-menu/context-menu.less +1 -1
- package/src/modules/context-menu/context-menu.ts +4 -4
- package/src/modules/dialog/alert.ts +3 -3
- package/src/modules/dialog/confirm.ts +3 -3
- package/src/modules/dialog/dialog.less +5 -0
- package/src/modules/dialog/dialog.ts +49 -32
- package/src/modules/dialog/prompt.ts +3 -3
- package/src/modules/file-browser/builders/context-menu.ts +22 -14
- package/src/modules/file-browser/builders/elements-map.ts +31 -0
- package/src/modules/file-browser/builders/item.ts +2 -2
- package/src/modules/file-browser/config.ts +5 -5
- package/src/modules/file-browser/data-provider.ts +5 -5
- package/src/modules/file-browser/factories.ts +1 -1
- package/src/modules/file-browser/fetch/delete-file.ts +27 -0
- package/src/modules/file-browser/fetch/load-items.ts +32 -0
- package/src/modules/file-browser/fetch/load-tree.ts +49 -0
- package/src/modules/file-browser/file-browser.ts +59 -120
- package/src/modules/file-browser/listeners/native-listeners.ts +14 -14
- package/src/modules/file-browser/listeners/self-listeners.ts +23 -18
- package/src/modules/file-browser/listeners/state-listeners.ts +17 -12
- package/src/modules/file-browser/styles/file-browser.less +24 -18
- package/src/modules/file-browser/ui/files/files.less +5 -0
- package/src/modules/file-browser/ui/files/files.ts +1 -1
- package/src/modules/file-browser/ui/tree/tree.less +16 -6
- package/src/modules/file-browser/ui/tree/tree.ts +1 -1
- package/src/modules/image-editor/image-editor.ts +9 -52
- package/src/modules/image-editor/templates/form.ts +4 -4
- package/src/modules/observer/command.ts +1 -1
- package/src/modules/observer/observer.ts +5 -5
- package/src/modules/observer/snapshot.ts +3 -3
- package/src/modules/observer/stack.ts +1 -1
- package/src/modules/status-bar/status-bar.ts +7 -7
- package/src/modules/table/table.ts +8 -8
- package/src/modules/toolbar/button/button.less +1 -1
- package/src/modules/toolbar/button/button.ts +57 -15
- package/src/modules/toolbar/button/content.less +1 -1
- package/src/modules/toolbar/button/content.ts +5 -5
- package/src/modules/toolbar/collection/collection.less +1 -1
- package/src/modules/toolbar/collection/collection.ts +5 -31
- package/src/modules/toolbar/collection/editor-collection.ts +5 -9
- package/src/modules/toolbar/factory.ts +2 -2
- package/src/modules/uploader/uploader.ts +9 -9
- package/src/modules/widget/color-picker/color-picker.ts +4 -4
- package/src/modules/widget/file-selector/file-selector.ts +4 -4
- package/src/modules/widget/tabs/tabs.ts +3 -3
- package/src/plugins/about/about.ts +5 -5
- package/src/plugins/add-new-line/add-new-line.ts +5 -5
- package/src/plugins/bold/bold.ts +3 -3
- package/src/plugins/class-span/class-span.ts +5 -5
- package/src/plugins/clipboard/clipboard.ts +4 -4
- package/src/plugins/clipboard/config.ts +29 -5
- package/src/plugins/clipboard/copy-format.ts +4 -4
- package/src/plugins/clipboard/drag-and-drop-element.ts +6 -6
- package/src/plugins/clipboard/drag-and-drop.ts +7 -7
- package/src/plugins/clipboard/paste/CHANGELOG.md +17 -0
- package/src/plugins/clipboard/paste/README.md +8 -0
- package/src/plugins/clipboard/paste/helpers.ts +5 -5
- package/src/plugins/clipboard/paste/paste.ts +24 -20
- package/src/plugins/clipboard/paste-storage/paste-storage.ts +6 -6
- package/src/plugins/color/color.ts +5 -5
- package/src/plugins/error-messages/error-messages.ts +5 -5
- package/src/plugins/fix/clean-html.ts +10 -10
- package/src/plugins/fix/wrap-text-nodes.ts +5 -5
- package/src/plugins/focus/focus.ts +4 -4
- package/src/plugins/font/font.ts +5 -5
- package/src/plugins/format-block/CHANGELOG.md +16 -0
- package/src/plugins/format-block/README.md +40 -0
- package/src/plugins/format-block/format-block.ts +8 -5
- package/src/plugins/fullsize/fullsize.ts +5 -5
- package/src/plugins/iframe/iframe.ts +6 -6
- package/src/plugins/image/helpers.ts +1 -1
- package/src/plugins/image/image-processor.ts +2 -2
- package/src/plugins/image/image-properties/image-properties.ts +12 -9
- package/src/plugins/image/image-properties/templates/form.ts +1 -1
- package/src/plugins/image/image-properties/templates/main-tab.ts +1 -1
- package/src/plugins/image/image-properties/templates/position-tab.ts +1 -1
- package/src/plugins/image/image.ts +5 -5
- package/src/plugins/indent/indent.ts +6 -6
- package/src/plugins/inline-popup/config/config.ts +3 -3
- package/src/plugins/inline-popup/config/items/a.ts +1 -1
- package/src/plugins/inline-popup/config/items/cells.ts +1 -1
- package/src/plugins/inline-popup/config/items/iframe.ts +1 -1
- package/src/plugins/inline-popup/config/items/img.ts +1 -1
- package/src/plugins/inline-popup/inline-popup.ts +6 -6
- package/src/plugins/insert/hr.ts +3 -3
- package/src/plugins/justify/justify.ts +4 -4
- package/src/plugins/keyboard/backspace/backspace.ts +6 -6
- package/src/plugins/keyboard/backspace/cases/check-join-neighbors.ts +3 -3
- package/src/plugins/keyboard/backspace/cases/check-join-two-lists.ts +1 -1
- package/src/plugins/keyboard/backspace/cases/check-not-collapsed.ts +1 -1
- package/src/plugins/keyboard/backspace/cases/check-remove-char.ts +9 -6
- package/src/plugins/keyboard/backspace/cases/check-remove-content-not-editable.ts +4 -4
- package/src/plugins/keyboard/backspace/cases/check-remove-empty-neighbor.ts +3 -3
- package/src/plugins/keyboard/backspace/cases/check-remove-empty-parent.ts +5 -5
- package/src/plugins/keyboard/backspace/cases/check-remove-unbreakable-element.ts +1 -1
- package/src/plugins/keyboard/backspace/cases/check-table-cell.ts +1 -1
- package/src/plugins/keyboard/backspace/cases/check-unwrap-first-list-item.ts +3 -3
- package/src/plugins/keyboard/backspace/config.ts +2 -2
- package/src/plugins/keyboard/enter.ts +6 -6
- package/src/plugins/keyboard/helpers.ts +5 -5
- package/src/plugins/keyboard/hotkeys.ts +6 -6
- package/src/plugins/keyboard/key-arrow-outside.ts +5 -5
- package/src/plugins/limit/limit.ts +7 -7
- package/src/plugins/link/link.ts +7 -7
- package/src/plugins/link/template.ts +3 -3
- package/src/plugins/media/file.ts +4 -4
- package/src/plugins/media/media.ts +6 -6
- package/src/plugins/media/video/config.ts +6 -6
- package/src/plugins/media/video/index.ts +1 -1
- package/src/plugins/mobile/mobile.ts +9 -9
- package/src/plugins/ordered-list/ordered-list.ts +6 -6
- package/src/plugins/placeholder/placeholder.ts +9 -9
- package/src/plugins/powered-by-jodit/powered-by-jodit.ts +2 -2
- package/src/plugins/print/preview.ts +4 -4
- package/src/plugins/print/print.ts +6 -6
- package/src/plugins/redo-undo/redo-undo.ts +4 -4
- package/src/plugins/resizer/resizer.ts +18 -16
- package/src/plugins/search/search.ts +11 -11
- package/src/plugins/select/select.ts +6 -6
- package/src/plugins/size/config.ts +2 -2
- package/src/plugins/size/resize-handler.ts +5 -5
- package/src/plugins/size/size.ts +4 -4
- package/src/plugins/source/config.ts +5 -5
- package/src/plugins/source/editor/engines/ace.ts +1 -1
- package/src/plugins/source/editor/engines/area.ts +1 -1
- package/src/plugins/source/editor/engines/custom.ts +1 -1
- package/src/plugins/source/editor/factory.ts +2 -2
- package/src/plugins/source/editor/sourceEditor.ts +1 -1
- package/src/plugins/source/source.ts +8 -8
- package/src/plugins/stat/stat.ts +6 -6
- package/src/plugins/sticky/sticky.ts +6 -6
- package/src/plugins/symbols/config.ts +4 -4
- package/src/plugins/symbols/symbols.ts +3 -3
- package/src/plugins/table/config.ts +5 -5
- package/src/plugins/table/resize-cells.ts +4 -4
- package/src/plugins/table/select-cells.ts +5 -5
- package/src/plugins/table/table-keyboard-navigation.ts +3 -3
- package/src/plugins/table/table.ts +1 -1
- package/src/plugins/tooltip/tooltip.ts +6 -6
- package/src/plugins/xpath/xpath.ts +10 -10
- package/src/polyfills.ts +9 -1
- package/src/styles/form.less +1 -1
- package/src/styles/icons/README.md +151 -1
- package/src/types/file-browser.d.ts +1 -10
- package/src/types/jodit.d.ts +1 -1
- package/src/types/observer.d.ts +1 -2
- package/src/types/traits.d.ts +10 -5
- package/src/types/types.d.ts +39 -0
- package/src/types/ui.d.ts +8 -17
- package/tsconfig.json +8 -2
- package/types/config.d.ts +16 -0
- package/types/core/async/async.d.ts +1 -1
- package/types/core/component/component.d.ts +1 -1
- package/types/core/component/view-component.d.ts +1 -1
- package/types/core/constants.d.ts +42 -1
- package/types/core/create/create.d.ts +1 -1
- package/types/core/decorators/debounce/debounce.d.ts +1 -1
- package/types/core/decorators/hook/hook.d.ts +2 -2
- package/types/core/decorators/idle/idle.d.ts +1 -1
- package/types/core/decorators/persistent/persistent.d.ts +1 -1
- package/types/core/decorators/wait/wait.d.ts +1 -1
- package/types/core/decorators/watch/watch.d.ts +1 -1
- package/types/core/dom/dom.d.ts +1 -1
- package/types/core/event-emitter/event-emitter.d.ts +1 -1
- package/types/core/event-emitter/index.d.ts +1 -1
- package/types/core/event-emitter/observable.d.ts +45 -0
- package/types/core/event-emitter/store.d.ts +1 -1
- package/types/core/global.d.ts +1 -1
- package/types/core/helpers/checker/is-imp-interface.d.ts +1 -1
- package/types/core/helpers/checker/is-jodit-object.d.ts +1 -1
- package/types/core/helpers/checker/is-plain-object.d.ts +1 -1
- package/types/core/helpers/size/get-scroll-parent.d.ts +1 -1
- package/types/core/helpers/size/object-size.d.ts +1 -1
- package/types/core/helpers/size/offset.d.ts +1 -1
- package/types/core/helpers/size/position.d.ts +1 -1
- package/types/core/helpers/string/i18n.d.ts +2 -2
- package/types/core/helpers/utils/append-script.d.ts +1 -1
- package/types/core/helpers/utils/assert.d.ts +8 -0
- package/types/core/helpers/utils/build-query.d.ts +1 -1
- package/types/core/helpers/utils/config-proto.d.ts +1 -1
- package/types/core/helpers/utils/css.d.ts +1 -1
- package/types/core/helpers/utils/data-bind.d.ts +1 -1
- package/types/core/helpers/utils/get-class-name.d.ts +1 -1
- package/types/core/helpers/utils/get.d.ts +1 -1
- package/types/core/helpers/utils/index.d.ts +1 -0
- package/types/core/helpers/utils/parse-query.d.ts +1 -1
- package/types/core/helpers/utils/selector.d.ts +1 -1
- package/types/core/helpers/utils/set.d.ts +1 -1
- package/types/core/helpers/utils/stack.d.ts +1 -1
- package/types/core/helpers/utils/utils.d.ts +2 -2
- package/types/core/plugin/plugin-system.d.ts +3 -2
- package/types/core/plugin/plugin.d.ts +1 -1
- package/types/core/request/ajax.d.ts +1 -1
- package/types/core/request/config.d.ts +2 -2
- package/types/core/request/response.d.ts +1 -1
- package/types/core/selection/select.d.ts +1 -1
- package/types/core/selection/style/api/element-has-same-style.d.ts +1 -1
- package/types/core/selection/style/api/extract.d.ts +1 -1
- package/types/core/selection/style/api/finite-state-machine.d.ts +1 -1
- package/types/core/selection/style/api/get-suit-child.d.ts +1 -1
- package/types/core/selection/style/api/get-suit-parent.d.ts +1 -1
- package/types/core/selection/style/api/is-normal-node.d.ts +1 -1
- package/types/core/selection/style/api/is-suit-element.d.ts +2 -2
- package/types/core/selection/style/api/toggle/toggle-css.d.ts +2 -2
- package/types/core/selection/style/api/toggle/toggle-ordered-list.d.ts +1 -1
- package/types/core/selection/style/api/wrap-and-commit-style.d.ts +1 -1
- package/types/core/selection/style/api/wrap-ordered-list.d.ts +1 -1
- package/types/core/selection/style/api/wrap-unwrapped-text.d.ts +1 -1
- package/types/core/selection/style/apply-style.d.ts +1 -1
- package/types/core/selection/style/commit-style.d.ts +1 -1
- package/types/core/storage/engines/local-storage-provider.d.ts +1 -1
- package/types/core/storage/engines/memory-storage-provider.d.ts +1 -1
- package/types/core/storage/storage.d.ts +1 -1
- package/types/core/traits/elms.d.ts +3 -3
- package/types/core/traits/mods.d.ts +6 -6
- package/types/core/ui/button/button/button.d.ts +2 -2
- package/types/core/ui/button/group/group.d.ts +1 -1
- package/types/core/ui/element.d.ts +7 -7
- package/types/core/ui/form/block/block.d.ts +2 -2
- package/types/core/ui/form/form.d.ts +2 -2
- package/types/core/ui/form/inputs/area/area.d.ts +2 -2
- package/types/core/ui/form/inputs/checkbox/checkbox.d.ts +2 -2
- package/types/core/ui/form/inputs/file/file.d.ts +2 -2
- package/types/core/ui/form/inputs/input/input.d.ts +2 -2
- package/types/core/ui/form/inputs/select/select.d.ts +2 -2
- package/types/core/ui/form/validators/input.d.ts +1 -1
- package/types/core/ui/form/validators/select.d.ts +2 -2
- package/types/core/ui/group/group.d.ts +2 -2
- package/types/core/ui/group/list.d.ts +2 -2
- package/types/core/ui/group/separator.d.ts +1 -2
- package/types/core/ui/group/spacer.d.ts +1 -1
- package/types/core/ui/helpers/buttons.d.ts +1 -1
- package/types/core/ui/helpers/get-control-type.d.ts +1 -1
- package/types/core/ui/helpers/get-strong-control-types.d.ts +1 -1
- package/types/core/ui/icon.d.ts +1 -1
- package/types/core/ui/popup/popup.d.ts +2 -2
- package/types/core/ui/progress-bar/progress-bar.d.ts +1 -1
- package/types/core/view/view-with-toolbar.d.ts +1 -1
- package/types/core/view/view.d.ts +4 -4
- package/types/langs/index.d.ts +1 -1
- package/types/modules/context-menu/context-menu.d.ts +2 -2
- package/types/modules/dialog/confirm.d.ts +1 -1
- package/types/modules/dialog/dialog.d.ts +3 -3
- package/types/modules/dialog/prompt.d.ts +1 -1
- package/types/modules/file-browser/builders/context-menu.d.ts +1 -1
- package/types/modules/file-browser/builders/elements-map.d.ts +18 -0
- package/types/modules/file-browser/builders/item.d.ts +1 -1
- package/types/modules/file-browser/config.d.ts +2 -2
- package/types/modules/file-browser/data-provider.d.ts +1 -1
- package/types/modules/file-browser/factories.d.ts +1 -1
- package/types/modules/file-browser/fetch/delete-file.d.ts +13 -0
- package/types/modules/file-browser/fetch/load-items.d.ts +13 -0
- package/types/modules/file-browser/fetch/load-tree.d.ts +13 -0
- package/types/modules/file-browser/file-browser.d.ts +5 -12
- package/types/modules/file-browser/listeners/native-listeners.d.ts +1 -1
- package/types/modules/file-browser/listeners/self-listeners.d.ts +1 -1
- package/types/modules/file-browser/listeners/state-listeners.d.ts +1 -1
- package/types/modules/file-browser/ui/files/files.d.ts +1 -1
- package/types/modules/file-browser/ui/tree/tree.d.ts +1 -1
- package/types/modules/image-editor/image-editor.d.ts +4 -6
- package/types/modules/image-editor/templates/form.d.ts +1 -1
- package/types/modules/observer/command.d.ts +1 -1
- package/types/modules/observer/observer.d.ts +3 -3
- package/types/modules/observer/snapshot.d.ts +2 -2
- package/types/modules/observer/stack.d.ts +1 -1
- package/types/modules/status-bar/status-bar.d.ts +5 -5
- package/types/modules/table/table.d.ts +3 -3
- package/types/modules/toolbar/button/button.d.ts +13 -5
- package/types/modules/toolbar/button/content.d.ts +2 -2
- package/types/modules/toolbar/collection/collection.d.ts +3 -3
- package/types/modules/toolbar/collection/editor-collection.d.ts +1 -1
- package/types/modules/toolbar/factory.d.ts +1 -1
- package/types/modules/uploader/uploader.d.ts +3 -3
- package/types/modules/widget/color-picker/color-picker.d.ts +1 -1
- package/types/modules/widget/file-selector/file-selector.d.ts +1 -1
- package/types/modules/widget/tabs/tabs.d.ts +2 -2
- package/types/plugins/about/about.d.ts +1 -1
- package/types/plugins/add-new-line/add-new-line.d.ts +3 -3
- package/types/plugins/bold/bold.d.ts +1 -1
- package/types/plugins/class-span/class-span.d.ts +2 -2
- package/types/plugins/clipboard/clipboard.d.ts +2 -2
- package/types/plugins/clipboard/config.d.ts +22 -2
- package/types/plugins/clipboard/copy-format.d.ts +1 -1
- package/types/plugins/clipboard/drag-and-drop-element.d.ts +1 -1
- package/types/plugins/clipboard/drag-and-drop.d.ts +1 -1
- package/types/plugins/clipboard/paste/helpers.d.ts +2 -2
- package/types/plugins/clipboard/paste/paste.d.ts +6 -10
- package/types/plugins/clipboard/paste-storage/paste-storage.d.ts +1 -1
- package/types/plugins/color/color.d.ts +1 -1
- package/types/plugins/error-messages/error-messages.d.ts +2 -2
- package/types/plugins/fix/clean-html.d.ts +3 -3
- package/types/plugins/fix/wrap-text-nodes.d.ts +2 -2
- package/types/plugins/focus/focus.d.ts +2 -2
- package/types/plugins/font/font.d.ts +2 -2
- package/types/plugins/format-block/format-block.d.ts +3 -1
- package/types/plugins/fullsize/fullsize.d.ts +2 -2
- package/types/plugins/iframe/iframe.d.ts +2 -2
- package/types/plugins/image/image-processor.d.ts +1 -1
- package/types/plugins/image/image-properties/image-properties.d.ts +2 -2
- package/types/plugins/image/image-properties/templates/form.d.ts +1 -1
- package/types/plugins/image/image-properties/templates/main-tab.d.ts +1 -1
- package/types/plugins/image/image-properties/templates/position-tab.d.ts +1 -1
- package/types/plugins/image/image.d.ts +1 -1
- package/types/plugins/indent/indent.d.ts +2 -2
- package/types/plugins/inline-popup/config/config.d.ts +2 -2
- package/types/plugins/inline-popup/inline-popup.d.ts +2 -2
- package/types/plugins/insert/hr.d.ts +1 -1
- package/types/plugins/justify/justify.d.ts +1 -1
- package/types/plugins/keyboard/backspace/backspace.d.ts +2 -2
- package/types/plugins/keyboard/backspace/cases/check-join-neighbors.d.ts +1 -1
- package/types/plugins/keyboard/backspace/cases/check-join-two-lists.d.ts +1 -1
- package/types/plugins/keyboard/backspace/cases/check-not-collapsed.d.ts +1 -1
- package/types/plugins/keyboard/backspace/cases/check-remove-char.d.ts +2 -2
- package/types/plugins/keyboard/backspace/cases/check-remove-content-not-editable.d.ts +1 -1
- package/types/plugins/keyboard/backspace/cases/check-remove-empty-neighbor.d.ts +1 -1
- package/types/plugins/keyboard/backspace/cases/check-remove-empty-parent.d.ts +1 -1
- package/types/plugins/keyboard/backspace/cases/check-remove-unbreakable-element.d.ts +1 -1
- package/types/plugins/keyboard/backspace/cases/check-table-cell.d.ts +1 -1
- package/types/plugins/keyboard/backspace/cases/check-unwrap-first-list-item.d.ts +1 -1
- package/types/plugins/keyboard/backspace/config.d.ts +1 -1
- package/types/plugins/keyboard/enter.d.ts +2 -2
- package/types/plugins/keyboard/helpers.d.ts +1 -1
- package/types/plugins/keyboard/hotkeys.d.ts +3 -3
- package/types/plugins/keyboard/key-arrow-outside.d.ts +2 -2
- package/types/plugins/limit/limit.d.ts +3 -3
- package/types/plugins/link/link.d.ts +3 -3
- package/types/plugins/link/template.d.ts +1 -1
- package/types/plugins/media/file.d.ts +1 -1
- package/types/plugins/media/media.d.ts +2 -2
- package/types/plugins/media/video/index.d.ts +1 -1
- package/types/plugins/mobile/mobile.d.ts +2 -2
- package/types/plugins/ordered-list/ordered-list.d.ts +2 -2
- package/types/plugins/placeholder/placeholder.d.ts +3 -3
- package/types/plugins/powered-by-jodit/powered-by-jodit.d.ts +2 -2
- package/types/plugins/print/preview.d.ts +1 -1
- package/types/plugins/print/print.d.ts +1 -1
- package/types/plugins/redo-undo/redo-undo.d.ts +2 -2
- package/types/plugins/resizer/resizer.d.ts +4 -4
- package/types/plugins/search/search.d.ts +3 -3
- package/types/plugins/select/select.d.ts +2 -2
- package/types/plugins/size/config.d.ts +1 -1
- package/types/plugins/size/resize-handler.d.ts +2 -2
- package/types/plugins/size/size.d.ts +2 -2
- package/types/plugins/source/config.d.ts +2 -2
- package/types/plugins/source/editor/engines/ace.d.ts +1 -1
- package/types/plugins/source/editor/engines/area.d.ts +1 -1
- package/types/plugins/source/editor/factory.d.ts +1 -1
- package/types/plugins/source/editor/sourceEditor.d.ts +1 -1
- package/types/plugins/source/source.d.ts +2 -2
- package/types/plugins/stat/stat.d.ts +2 -2
- package/types/plugins/sticky/sticky.d.ts +2 -2
- package/types/plugins/symbols/config.d.ts +1 -1
- package/types/plugins/symbols/symbols.d.ts +1 -1
- package/types/plugins/table/resize-cells.d.ts +1 -1
- package/types/plugins/table/select-cells.d.ts +2 -2
- package/types/plugins/table/table-keyboard-navigation.d.ts +1 -1
- package/types/plugins/table/table.d.ts +1 -1
- package/types/plugins/tooltip/tooltip.d.ts +2 -2
- package/types/plugins/xpath/xpath.d.ts +3 -3
- package/types/types/{types/ajax.d.ts → ajax.d.ts} +0 -0
- package/types/types/{types/async.d.ts → async.d.ts} +0 -0
- package/types/types/{types/context.d.ts → context.d.ts} +0 -0
- package/types/types/{types/core.ts → core.ts} +0 -0
- package/types/types/{types/create.d.ts → create.d.ts} +0 -0
- package/types/types/{types/dialog.d.ts → dialog.d.ts} +0 -0
- package/types/types/{types/events.d.ts → events.d.ts} +0 -0
- package/types/types/{types/file-browser.d.ts → file-browser.d.ts} +1 -10
- package/types/types/{types/form.d.ts → form.d.ts} +0 -0
- package/types/types/{types/index.d.ts → index.d.ts} +0 -0
- package/types/types/{types/jodit.d.ts → jodit.d.ts} +1 -1
- package/types/types/{types/observer.d.ts → observer.d.ts} +1 -2
- package/types/types/{types/plugin.d.ts → plugin.d.ts} +0 -0
- package/types/types/{types/popup.d.ts → popup.d.ts} +0 -0
- package/types/types/{types/select.d.ts → select.d.ts} +0 -0
- package/types/types/{types/source.d.ts → source.d.ts} +0 -0
- package/types/types/{types/storage.ts → storage.ts} +0 -0
- package/types/types/{types/style.d.ts → style.d.ts} +0 -0
- package/types/types/{types/toolbar.d.ts → toolbar.d.ts} +0 -0
- package/types/types/{types/traits.d.ts → traits.d.ts} +10 -5
- package/types/types/{types/types.d.ts → types.d.ts} +39 -0
- package/types/types/{types/ui.d.ts → ui.d.ts} +8 -17
- package/types/types/{types/uploader.d.ts → uploader.d.ts} +0 -0
- package/types/types/{types/view.d.ts → view.d.ts} +0 -0
- package/src/core/event-emitter/observe-object.ts +0 -157
- package/types/core/event-emitter/observe-object.d.ts +0 -24
package/index.html
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jodit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.2",
|
|
4
4
|
"description": "Jodit is awesome and usefully wysiwyg editor with filebrowser",
|
|
5
5
|
"main": "build/jodit.min.js",
|
|
6
6
|
"types": "./types/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"coverage": "npx type-coverage ./src --detail --ignore-files 'build/**' --ignore-files 'test/**' --ignore-files 'examples/**'",
|
|
9
|
-
"newversion": "npm run lint && npm run clean && npm test && npm version patch --no-git-tag-version && npm run build && npm run newversiongit && npm publish ./",
|
|
9
|
+
"newversion": "npm run lint && npm run clean && npm test && npm version patch --no-git-tag-version && npm run build && npm run newversiongit && npm publish ./ && rm -rf types/",
|
|
10
10
|
"newversiongit": "git add --all && git commit -m \"New version $npm_package_version. Read more https://github.com/xdan/jodit/blob/master/CHANGELOG.MD \" && git tag $npm_package_version && git push --tags origin HEAD:master",
|
|
11
11
|
"start": "node server.js --port=2000",
|
|
12
12
|
"clean": "rm -rf build/*",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test-chrome": "karma start --browsers Chrome karma.conf.js",
|
|
23
23
|
"test-only-run": "karma start --browsers FirefoxHeadless karma.conf.js",
|
|
24
24
|
"jodit": "cd ../jodit-react/ && npm update && npm run newversion && cd ../jodit-pro && npm run newversion && cd ../jodit-joomla && npm run newversion && cd ../jodit-master && npm run newversion",
|
|
25
|
-
"types": "rm -rf types
|
|
25
|
+
"types": "rm -rf types && mkdir -p ./types && cp -r ./src/types ./types && tsc --project . --declaration --declarationDir types --outDir types --emitDeclarationOnly --removeComments false",
|
|
26
26
|
"pretty": "npx prettier --write ./src/*.{ts,less} ./src/**/*.{ts,less} ./src/**/**/*.{ts,less} ./src/**/**/**/*.{ts,less} ./src/**/**/**/**/*.{ts,less}",
|
|
27
27
|
"fix": "npx eslint ./src/ ./test/ --fix && npm run pretty",
|
|
28
28
|
"lint": "npx eslint ./src/ ./test/ && stylelint ./src/**/**.less"
|
|
@@ -55,70 +55,70 @@
|
|
|
55
55
|
"homepage": "https://xdsoft.net/jodit/",
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"autobind-decorator": "^2.4.0",
|
|
58
|
-
"
|
|
59
|
-
"postcss-less": "^5.0.0"
|
|
58
|
+
"core-js": "^3.20.3"
|
|
60
59
|
},
|
|
61
60
|
"devDependencies": {
|
|
61
|
+
"eslint-plugin-tsdoc": "^0.2.14",
|
|
62
|
+
"postcss-less": "^6.0.0",
|
|
62
63
|
"@types/ace": "^0.0.47",
|
|
63
|
-
"@types/node": "^
|
|
64
|
-
"@typescript-eslint/eslint-plugin": "^5.1
|
|
65
|
-
"@typescript-eslint/parser": "^5.1
|
|
66
|
-
"autoprefixer": "^10.
|
|
67
|
-
"chai": "^4.3.
|
|
64
|
+
"@types/node": "^17.0.12",
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
66
|
+
"@typescript-eslint/parser": "^5.10.1",
|
|
67
|
+
"autoprefixer": "^10.4.2",
|
|
68
|
+
"chai": "^4.3.5",
|
|
68
69
|
"classlist-polyfill": "^1.2.0",
|
|
69
70
|
"compression": "^1.7.4",
|
|
70
71
|
"cross-env": "^7.0.3",
|
|
71
|
-
"css-loader": "^6.
|
|
72
|
-
"css-minimizer-webpack-plugin": "^3.
|
|
73
|
-
"cssnano-preset-advanced": "^5.1.
|
|
72
|
+
"css-loader": "^6.5.1",
|
|
73
|
+
"css-minimizer-webpack-plugin": "^3.4.1",
|
|
74
|
+
"cssnano-preset-advanced": "^5.1.11",
|
|
74
75
|
"es6-promise": "^4.2.8",
|
|
75
|
-
"eslint": "^8.
|
|
76
|
+
"eslint": "^8.7.0",
|
|
76
77
|
"eslint-config-prettier": "^8.3.0",
|
|
77
78
|
"eslint-plugin-header": "^3.1.1",
|
|
78
79
|
"eslint-plugin-prettier": "^4.0.0",
|
|
79
|
-
"express": "^4.17.
|
|
80
|
+
"express": "^4.17.2",
|
|
80
81
|
"file-loader": "^6.2.0",
|
|
81
82
|
"husky": "^7.0.4",
|
|
82
|
-
"karma": "^6.3.
|
|
83
|
+
"karma": "^6.3.12",
|
|
83
84
|
"karma-chai": "^0.1.0",
|
|
84
85
|
"karma-chrome-launcher": "^3.1.0",
|
|
85
|
-
"karma-firefox-launcher": "^2.1.
|
|
86
|
+
"karma-firefox-launcher": "^2.1.2",
|
|
86
87
|
"karma-mocha": "^2.0.1",
|
|
87
88
|
"karma-sourcemap-loader": "^0.3.8",
|
|
88
89
|
"karma-webpack": "^5.0.0",
|
|
89
90
|
"less": "^4.1.2",
|
|
90
91
|
"less-loader": "^10.2.0",
|
|
91
|
-
"lint-staged": "^
|
|
92
|
+
"lint-staged": "^12.3.1",
|
|
92
93
|
"merge-stream": "^2.0.0",
|
|
93
|
-
"mini-css-extract-plugin": "^2.
|
|
94
|
-
"mocha": "^9.
|
|
94
|
+
"mini-css-extract-plugin": "^2.5.3",
|
|
95
|
+
"mocha": "^9.2.0",
|
|
95
96
|
"open": "^8.4.0",
|
|
96
|
-
"postcss": "^8.
|
|
97
|
+
"postcss": "^8.4.5",
|
|
97
98
|
"postcss-css-variables": "^0.18.0",
|
|
98
|
-
"postcss-loader": "^6.2.
|
|
99
|
-
"prettier": "^2.
|
|
99
|
+
"postcss-loader": "^6.2.1",
|
|
100
|
+
"prettier": "^2.5.1",
|
|
100
101
|
"raw-loader": "^4.0.2",
|
|
101
102
|
"style-loader": "^3.3.1",
|
|
102
|
-
"stylelint": "^
|
|
103
|
-
"stylelint-config-idiomatic-order": "
|
|
103
|
+
"stylelint": "^14.3.0",
|
|
104
|
+
"stylelint-config-idiomatic-order": "v8.1.0",
|
|
104
105
|
"stylelint-config-prettier": "^9.0.3",
|
|
105
|
-
"stylelint-config-standard": "^
|
|
106
|
-
"stylelint-prettier": "^
|
|
106
|
+
"stylelint-config-standard": "^24.0.0",
|
|
107
|
+
"stylelint-prettier": "^2.0.0",
|
|
107
108
|
"synchronous-promise": "^2.0.15",
|
|
108
|
-
"terser-webpack-plugin": "^5.
|
|
109
|
+
"terser-webpack-plugin": "^5.3.0",
|
|
109
110
|
"ts-loader": "^9.2.6",
|
|
110
111
|
"ts-private-uglifier": "^1.0.2",
|
|
111
112
|
"tslib": "^2.3.1",
|
|
112
|
-
"
|
|
113
|
-
"typescript": "^4.5.2",
|
|
113
|
+
"typescript": "^4.5.5",
|
|
114
114
|
"url-loader": "^4.1.1",
|
|
115
|
-
"webpack": "^5.
|
|
116
|
-
"webpack-cli": "^4.9.
|
|
117
|
-
"webpack-dev-middleware": "^5.
|
|
118
|
-
"webpack-dev-server": "^4.3
|
|
115
|
+
"webpack": "^5.67.0",
|
|
116
|
+
"webpack-cli": "^4.9.2",
|
|
117
|
+
"webpack-dev-middleware": "^5.3.0",
|
|
118
|
+
"webpack-dev-server": "^4.7.3",
|
|
119
119
|
"webpack-hot-middleware": "^2.25.1",
|
|
120
120
|
"webpack-stream": "^7.0.0",
|
|
121
|
-
"yargs": "^17.
|
|
121
|
+
"yargs": "^17.3.1"
|
|
122
122
|
},
|
|
123
123
|
"husky": {
|
|
124
124
|
"hooks": {}
|
package/src/config.ts
CHANGED
|
@@ -28,6 +28,24 @@ import * as consts from './core/constants';
|
|
|
28
28
|
export class Config implements IViewOptions {
|
|
29
29
|
namespace: string = '';
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Editor loads completely without plugins. Useful when debugging your own plugin.
|
|
33
|
+
*/
|
|
34
|
+
safeMode: boolean = false;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* List of plugins that will be initialized in safe mode.
|
|
38
|
+
*
|
|
39
|
+
* ```js
|
|
40
|
+
* Jodit.make('#editor', {
|
|
41
|
+
* safeMode: true,
|
|
42
|
+
* safePluginsList: ['about'],
|
|
43
|
+
* extraPlugins: ['yourPluginDev']
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
safePluginsList: string[] = ['about', 'enter', 'backspace'];
|
|
48
|
+
|
|
31
49
|
/**
|
|
32
50
|
* When this option is enabled, the editor's content will be placed in an iframe and isolated from the rest of the page.
|
|
33
51
|
*
|
package/src/core/async/async.ts
CHANGED
|
@@ -16,7 +16,7 @@ import type {
|
|
|
16
16
|
IAsyncParams,
|
|
17
17
|
ITimeout,
|
|
18
18
|
RejectablePromise
|
|
19
|
-
} from '
|
|
19
|
+
} from 'jodit/types';
|
|
20
20
|
import {
|
|
21
21
|
setTimeout,
|
|
22
22
|
clearTimeout,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
isPromise,
|
|
26
26
|
isString,
|
|
27
27
|
isNumber
|
|
28
|
-
} from '
|
|
28
|
+
} from 'jodit/core/helpers/';
|
|
29
29
|
|
|
30
30
|
export class Async implements IAsync {
|
|
31
31
|
private timers: Map<number | string | Function, number> = new Map();
|
|
@@ -18,7 +18,7 @@ console.log(jodit.componentStatus)
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
You can work on changes in the status of a component through the decorator [[decorators/hook]]
|
|
21
|
-
either through the method [[Component.
|
|
21
|
+
either through the method [[Component.hookStatus]]
|
|
22
22
|
|
|
23
23
|
```ts
|
|
24
24
|
import { Component } from 'jodit/src/core/component'
|
|
@@ -31,7 +31,7 @@ cmp.hookStatus('ready', () => {
|
|
|
31
31
|
})
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
To set the status, it is enough to call the method [[Component.
|
|
34
|
+
To set the status, it is enough to call the method [[Component.setStatus]]
|
|
35
35
|
|
|
36
36
|
```ts
|
|
37
37
|
import { Component } from 'jodit/src/core/component'
|
|
@@ -15,11 +15,17 @@ import type {
|
|
|
15
15
|
IComponent,
|
|
16
16
|
IDictionary,
|
|
17
17
|
Nullable
|
|
18
|
-
} from '
|
|
19
|
-
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
} from 'jodit/types';
|
|
19
|
+
|
|
20
|
+
import {
|
|
21
|
+
kebabCase,
|
|
22
|
+
get,
|
|
23
|
+
getClassName,
|
|
24
|
+
isFunction,
|
|
25
|
+
isVoid
|
|
26
|
+
} from 'jodit/core/helpers';
|
|
27
|
+
import { uniqueUid } from 'jodit/core/global';
|
|
28
|
+
import { STATUSES } from 'jodit/core/component/statuses';
|
|
23
29
|
|
|
24
30
|
const StatusListHandlers: Map<
|
|
25
31
|
Component,
|
|
@@ -37,7 +43,11 @@ export abstract class Component implements IComponent {
|
|
|
37
43
|
get componentName(): string {
|
|
38
44
|
if (!this.__componentName) {
|
|
39
45
|
this.__componentName =
|
|
40
|
-
'jodit-' +
|
|
46
|
+
'jodit-' +
|
|
47
|
+
kebabCase(
|
|
48
|
+
(isFunction(this.className) ? this.className() : '') ||
|
|
49
|
+
getClassName(this)
|
|
50
|
+
);
|
|
41
51
|
}
|
|
42
52
|
|
|
43
53
|
return this.__componentName;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module component
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { IViewBased, IViewComponent } from '
|
|
11
|
+
import type { IViewBased, IViewComponent } from 'jodit/types';
|
|
12
12
|
import { Component } from './component';
|
|
13
13
|
|
|
14
14
|
export abstract class ViewComponent<T extends IViewBased = IViewBased>
|
package/src/core/constants.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module constants
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { IDictionary } from '
|
|
11
|
+
import type { IDictionary } from 'jodit/types';
|
|
12
12
|
|
|
13
13
|
export const INVISIBLE_SPACE = '\uFEFF';
|
|
14
14
|
export const NBSP_SPACE = '\u00A0';
|
|
@@ -111,9 +111,53 @@ export const MARKER_CLASS = 'jodit-selection_marker';
|
|
|
111
111
|
|
|
112
112
|
export const EMULATE_DBLCLICK_TIMEOUT = 300;
|
|
113
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Paste the copied text as HTML, all content will be pasted exactly as it was on the clipboard.
|
|
116
|
+
* So how would you copy its code directly into the source document.
|
|
117
|
+
* ```
|
|
118
|
+
* <h1 style="color:red">test</h1>
|
|
119
|
+
* ```
|
|
120
|
+
* Will be inserted into the document as
|
|
121
|
+
* ```
|
|
122
|
+
* <h1 style="color:red">test</h1>
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
114
125
|
export const INSERT_AS_HTML = 'insert_as_html';
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Same as [[INSERT_AS_HTML]], but content will be stripped of extra styles and empty tags
|
|
129
|
+
* ```
|
|
130
|
+
* <h1 style="color:red">test</h1>
|
|
131
|
+
* ```
|
|
132
|
+
* Will be inserted into the document as
|
|
133
|
+
* ```
|
|
134
|
+
* <h1>test</h1>
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
115
137
|
export const INSERT_CLEAR_HTML = 'insert_clear_html';
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The contents of the clipboard will be pasted into the document as plain text, i.e. all tags will be displayed as text.
|
|
141
|
+
* ```
|
|
142
|
+
* <h1>test</h1>
|
|
143
|
+
* ```
|
|
144
|
+
* Will be inserted into the document as
|
|
145
|
+
* ```
|
|
146
|
+
* ><h1>test</h1>
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
116
149
|
export const INSERT_AS_TEXT = 'insert_as_text';
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* All tags will be stripped:
|
|
153
|
+
* ```
|
|
154
|
+
* <h1>test</h1>
|
|
155
|
+
* ```
|
|
156
|
+
* Will be inserted into the document as
|
|
157
|
+
* ```
|
|
158
|
+
* test
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
117
161
|
export const INSERT_ONLY_TEXT = 'insert_only_text';
|
|
118
162
|
|
|
119
163
|
export const SAFE_COUNT_CHANGE_CALL = 10;
|
|
@@ -17,7 +17,7 @@ import type {
|
|
|
17
17
|
ICreate,
|
|
18
18
|
CanUndef,
|
|
19
19
|
NodeFunction
|
|
20
|
-
} from '
|
|
20
|
+
} from 'jodit/types';
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
23
|
isPlainObject,
|
|
@@ -26,10 +26,10 @@ import {
|
|
|
26
26
|
refs,
|
|
27
27
|
isString,
|
|
28
28
|
attr
|
|
29
|
-
} from '
|
|
29
|
+
} from 'jodit/core/helpers/';
|
|
30
30
|
|
|
31
|
-
import { Dom } from '
|
|
32
|
-
import { INVISIBLE_SPACE } from '
|
|
31
|
+
import { Dom } from 'jodit/core/dom';
|
|
32
|
+
import { INVISIBLE_SPACE } from 'jodit/core/constants';
|
|
33
33
|
|
|
34
34
|
export class Create implements ICreate {
|
|
35
35
|
private get doc(): Document {
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* @module decorators/cache
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { error } from '
|
|
14
|
-
import type { IDictionary } from '
|
|
13
|
+
import { error } from 'jodit/core/helpers';
|
|
14
|
+
import type { IDictionary } from 'jodit/types';
|
|
15
15
|
|
|
16
16
|
export interface CachePropertyDescriptor<T, R> extends PropertyDescriptor {
|
|
17
17
|
get?: (this: T) => R;
|
|
@@ -16,15 +16,15 @@ import type {
|
|
|
16
16
|
IViewComponent,
|
|
17
17
|
IAsyncParams,
|
|
18
18
|
DecoratorHandler
|
|
19
|
-
} from '
|
|
19
|
+
} from 'jodit/types';
|
|
20
20
|
import {
|
|
21
21
|
isFunction,
|
|
22
22
|
isNumber,
|
|
23
23
|
isPlainObject,
|
|
24
24
|
isViewObject
|
|
25
|
-
} from '
|
|
26
|
-
import { Component, STATUSES } from '
|
|
27
|
-
import { error } from '
|
|
25
|
+
} from 'jodit/core/helpers/checker';
|
|
26
|
+
import { Component, STATUSES } from 'jodit/core/component';
|
|
27
|
+
import { error } from 'jodit/core/helpers/utils/error';
|
|
28
28
|
|
|
29
29
|
export function debounce<V = IViewComponent | IViewBased>(
|
|
30
30
|
timeout?: number | ((ctx: V) => number | IAsyncParams) | IAsyncParams,
|
|
@@ -15,10 +15,10 @@ import type {
|
|
|
15
15
|
IDictionary,
|
|
16
16
|
IViewBased,
|
|
17
17
|
IViewComponent
|
|
18
|
-
} from '
|
|
19
|
-
import type { Component } from '
|
|
20
|
-
import { isFunction } from '
|
|
21
|
-
import { error } from '
|
|
18
|
+
} from 'jodit/types';
|
|
19
|
+
import type { Component } from 'jodit/core/component';
|
|
20
|
+
import { isFunction } from 'jodit/core/helpers/checker';
|
|
21
|
+
import { error } from 'jodit/core/helpers/utils/error';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Call on some component status
|
|
@@ -15,9 +15,9 @@ import type {
|
|
|
15
15
|
IDictionary,
|
|
16
16
|
IViewBased,
|
|
17
17
|
IViewComponent
|
|
18
|
-
} from '
|
|
19
|
-
import { Component, STATUSES } from '
|
|
20
|
-
import { error, isFunction, isViewObject } from '
|
|
18
|
+
} from 'jodit/types';
|
|
19
|
+
import { Component, STATUSES } from 'jodit/core/component';
|
|
20
|
+
import { error, isFunction, isViewObject } from 'jodit/core/helpers';
|
|
21
21
|
|
|
22
22
|
export function idle<V = IViewComponent | IViewBased>(): DecoratorHandler {
|
|
23
23
|
return <T extends Component & IDictionary>(
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* @module decorators/persistent
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type { IComponent, IDictionary, IViewComponent } from '
|
|
14
|
-
import { STATUSES } from '
|
|
15
|
-
import { isViewObject } from '
|
|
13
|
+
import type { IComponent, IDictionary, IViewComponent } from 'jodit/types';
|
|
14
|
+
import { STATUSES } from 'jodit/core/component';
|
|
15
|
+
import { isViewObject } from 'jodit/core/helpers';
|
|
16
16
|
|
|
17
17
|
export function persistent<T extends IComponent>(
|
|
18
18
|
target: T,
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* @module decorators/wait
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type { IViewBased, IViewComponent } from '
|
|
14
|
-
import { error, isFunction, isViewObject } from '
|
|
15
|
-
import { STATUSES } from '
|
|
13
|
+
import type { IViewBased, IViewComponent } from 'jodit/types';
|
|
14
|
+
import { error, isFunction, isViewObject } from 'jodit/core/helpers';
|
|
15
|
+
import { STATUSES } from 'jodit/core/component';
|
|
16
16
|
|
|
17
17
|
export function wait<T extends IViewBased>(
|
|
18
18
|
condition: (ctx: T) => boolean
|
|
@@ -16,12 +16,16 @@ import type {
|
|
|
16
16
|
IComponent,
|
|
17
17
|
IDictionary,
|
|
18
18
|
IViewComponent
|
|
19
|
-
} from '
|
|
20
|
-
import {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
} from 'jodit/types';
|
|
20
|
+
import {
|
|
21
|
+
isFunction,
|
|
22
|
+
isPlainObject,
|
|
23
|
+
isViewObject
|
|
24
|
+
} from 'jodit/core/helpers/checker';
|
|
25
|
+
import { observable } from 'jodit/core/event-emitter';
|
|
26
|
+
import { STATUSES } from 'jodit/core/component';
|
|
27
|
+
import { splitArray } from 'jodit/core/helpers/array/split-array';
|
|
28
|
+
import { error } from 'jodit/core/helpers/utils/error';
|
|
25
29
|
|
|
26
30
|
export function getPropertyDescriptor(
|
|
27
31
|
obj: unknown,
|
|
@@ -92,49 +96,48 @@ export function watch(
|
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
const parts = field.split('.'),
|
|
95
|
-
[key] = parts as unknown as Array<keyof IComponent
|
|
99
|
+
[key] = parts as unknown as Array<keyof IComponent>,
|
|
100
|
+
teil = parts.slice(1);
|
|
96
101
|
|
|
97
102
|
let value: any = component[key];
|
|
98
103
|
|
|
99
|
-
if (value
|
|
100
|
-
value
|
|
101
|
-
|
|
102
|
-
const observe = ObservableObject.create(value, [key]);
|
|
103
|
-
observe.on(`change.${field}`, callback);
|
|
104
|
-
(component as any)[key] = observe;
|
|
105
|
-
} else {
|
|
106
|
-
const descriptor = getPropertyDescriptor(target, key);
|
|
107
|
-
|
|
108
|
-
Object.defineProperty(component, key, {
|
|
109
|
-
configurable: true,
|
|
110
|
-
set(v: any): void {
|
|
111
|
-
const oldValue = value;
|
|
112
|
-
|
|
113
|
-
if (oldValue === v) {
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
value = v;
|
|
118
|
-
if (descriptor && descriptor.set) {
|
|
119
|
-
descriptor.set.call(component, v);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
if (isPlainObject(value)) {
|
|
123
|
-
value = ObservableObject.create(value, [key]);
|
|
124
|
-
value.on('change.' + field, callback);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
callback(key, oldValue, value);
|
|
128
|
-
},
|
|
129
|
-
get(): any {
|
|
130
|
-
if (descriptor && descriptor.get) {
|
|
131
|
-
return descriptor.get.call(component);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return value;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
104
|
+
if (isPlainObject(value)) {
|
|
105
|
+
const observableValue = observable(value);
|
|
106
|
+
observableValue.on(`change.${teil.join('.')}`, callback);
|
|
137
107
|
}
|
|
108
|
+
|
|
109
|
+
const descriptor = getPropertyDescriptor(target, key);
|
|
110
|
+
|
|
111
|
+
Object.defineProperty(component, key, {
|
|
112
|
+
configurable: true,
|
|
113
|
+
set(v: any): void {
|
|
114
|
+
const oldValue = value;
|
|
115
|
+
|
|
116
|
+
if (oldValue === v) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
value = v;
|
|
121
|
+
if (descriptor && descriptor.set) {
|
|
122
|
+
descriptor.set.call(component, v);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (isPlainObject(value)) {
|
|
126
|
+
value = observable(value);
|
|
127
|
+
value.on(`change.${teil.join('.')}`, callback);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
callback(key, oldValue, value);
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
get(): any {
|
|
134
|
+
if (descriptor && descriptor.get) {
|
|
135
|
+
return descriptor.get.call(component);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return value;
|
|
139
|
+
}
|
|
140
|
+
});
|
|
138
141
|
});
|
|
139
142
|
};
|
|
140
143
|
|
package/src/core/dom/README.md
CHANGED
package/src/core/dom/dom.ts
CHANGED
|
@@ -18,8 +18,8 @@ import type {
|
|
|
18
18
|
NodeCondition,
|
|
19
19
|
Nullable,
|
|
20
20
|
IDictionary
|
|
21
|
-
} from '
|
|
22
|
-
import * as consts from '
|
|
21
|
+
} from 'jodit/types';
|
|
22
|
+
import * as consts from 'jodit/core/constants';
|
|
23
23
|
import {
|
|
24
24
|
$$,
|
|
25
25
|
asArray,
|
|
@@ -35,9 +35,9 @@ import {
|
|
|
35
35
|
isVoid,
|
|
36
36
|
toArray,
|
|
37
37
|
trim
|
|
38
|
-
} from '
|
|
39
|
-
import { Select } from '
|
|
40
|
-
import { TEMP_ATTR } from '
|
|
38
|
+
} from 'jodit/core/helpers';
|
|
39
|
+
import { Select } from 'jodit/core/selection';
|
|
40
|
+
import { TEMP_ATTR } from 'jodit/core/constants';
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Module for working with DOM
|
|
@@ -14,12 +14,12 @@ import type {
|
|
|
14
14
|
CallbackFunction,
|
|
15
15
|
EventHandlerBlock,
|
|
16
16
|
IEventEmitter
|
|
17
|
-
} from '
|
|
17
|
+
} from 'jodit/types';
|
|
18
18
|
import { defaultNameSpace, EventHandlersStore } from './store';
|
|
19
|
-
import { isString } from '
|
|
20
|
-
import { isFunction } from '
|
|
21
|
-
import { isArray } from '
|
|
22
|
-
import { error } from '
|
|
19
|
+
import { isString } from 'jodit/core/helpers/checker/is-string';
|
|
20
|
+
import { isFunction } from 'jodit/core/helpers/checker/is-function';
|
|
21
|
+
import { isArray } from 'jodit/core/helpers/checker/is-array';
|
|
22
|
+
import { error } from 'jodit/core/helpers/utils/error';
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* The module editor's event manager
|