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
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
@import (reference) '../../../../styles/variables';
|
|
2
2
|
@import (reference) '../../../../styles/mixins';
|
|
3
|
+
@import (reference) '../../styles/file-browser';
|
|
4
|
+
|
|
5
|
+
:root {
|
|
6
|
+
--color-folder-title: #b1b1b1;
|
|
7
|
+
}
|
|
3
8
|
|
|
4
9
|
.jodit-filebrowser-tree {
|
|
5
10
|
position: relative;
|
|
@@ -15,6 +20,10 @@
|
|
|
15
20
|
display: flex;
|
|
16
21
|
}
|
|
17
22
|
|
|
23
|
+
&_loading_true {
|
|
24
|
+
.file-browser-loader();
|
|
25
|
+
}
|
|
26
|
+
|
|
18
27
|
.scrollbarSlim();
|
|
19
28
|
|
|
20
29
|
&_active_true {
|
|
@@ -45,8 +54,6 @@
|
|
|
45
54
|
background-color: rgba(127, 127, 127, 0.5);
|
|
46
55
|
outline: 1px solid slategrey;
|
|
47
56
|
}
|
|
48
|
-
|
|
49
|
-
--text-color: #b1b1b1;
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
&__item {
|
|
@@ -57,13 +64,14 @@
|
|
|
57
64
|
justify-content: space-between;
|
|
58
65
|
padding: calc(var(--padding-default) / 2) var(--padding-default);
|
|
59
66
|
border-bottom: 1px solid #474747;
|
|
60
|
-
color: var(--
|
|
67
|
+
color: var(--color-folder-title);
|
|
61
68
|
text-decoration: none;
|
|
62
69
|
transition: background-color 0.2s ease 0s;
|
|
63
70
|
word-break: break-all;
|
|
64
71
|
|
|
65
72
|
&-title {
|
|
66
73
|
flex: 1;
|
|
74
|
+
color: var(--color-folder-title);
|
|
67
75
|
}
|
|
68
76
|
|
|
69
77
|
.jodit-icon_folder {
|
|
@@ -81,8 +89,8 @@
|
|
|
81
89
|
& svg {
|
|
82
90
|
width: var(--icon-size);
|
|
83
91
|
height: var(--icon-size);
|
|
84
|
-
fill: var(--
|
|
85
|
-
stroke: var(--
|
|
92
|
+
fill: var(--color-folder-title) !important;
|
|
93
|
+
stroke: var(--color-folder-title) !important;
|
|
86
94
|
}
|
|
87
95
|
|
|
88
96
|
&:hover {
|
|
@@ -92,7 +100,9 @@
|
|
|
92
100
|
|
|
93
101
|
&:hover {
|
|
94
102
|
background-color: var(--color-background-button-hover);
|
|
95
|
-
|
|
103
|
+
&-title {
|
|
104
|
+
color: var(--color-text);
|
|
105
|
+
}
|
|
96
106
|
|
|
97
107
|
i.jodit-icon_folder {
|
|
98
108
|
opacity: 0.6;
|
|
@@ -21,17 +21,17 @@ import type {
|
|
|
21
21
|
IUIButton,
|
|
22
22
|
IDictionary,
|
|
23
23
|
IFileBrowserDataProvider
|
|
24
|
-
} from '
|
|
25
|
-
import { Config } from '
|
|
26
|
-
import { ViewComponent } from '
|
|
27
|
-
import { Alert, Dialog, Prompt } from '
|
|
28
|
-
import { $$, attr, css, refs, toArray, trim } from '
|
|
29
|
-
import { Dom } from '
|
|
30
|
-
import { Button } from '
|
|
24
|
+
} from 'jodit/types';
|
|
25
|
+
import { Config } from 'jodit/config';
|
|
26
|
+
import { ViewComponent } from 'jodit/core/component';
|
|
27
|
+
import { Alert, Dialog, Prompt } from 'jodit/modules/dialog';
|
|
28
|
+
import { $$, attr, css, refs, toArray, trim } from 'jodit/core/helpers';
|
|
29
|
+
import { Dom } from 'jodit/core/dom';
|
|
30
|
+
import { Button } from 'jodit/core/ui/button';
|
|
31
31
|
import { form } from './templates/form';
|
|
32
|
-
import { component, debounce, throttle, autobind } from '
|
|
32
|
+
import { component, debounce, throttle, autobind } from 'jodit/core/decorators';
|
|
33
33
|
|
|
34
|
-
declare module '
|
|
34
|
+
declare module 'jodit/config' {
|
|
35
35
|
interface Config {
|
|
36
36
|
imageeditor: ImageEditorOptions;
|
|
37
37
|
}
|
|
@@ -40,56 +40,15 @@ declare module '../../config' {
|
|
|
40
40
|
Config.prototype.imageeditor = {
|
|
41
41
|
min_width: 20,
|
|
42
42
|
min_height: 20,
|
|
43
|
-
/**
|
|
44
|
-
* @property {boolean} imageeditor.closeAfterSave=false Close editor after save image
|
|
45
|
-
*/
|
|
46
43
|
closeAfterSave: false,
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @property {string|int} imageeditor.width=85% Default dialog width by screen
|
|
50
|
-
*/
|
|
51
44
|
width: '85%',
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @property {string|int} imageeditor.height=85% Default dialog height by screen
|
|
55
|
-
*/
|
|
56
45
|
height: '85%',
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* @property {boolean} imageeditor.crop=true Show tab cropping
|
|
60
|
-
*/
|
|
61
46
|
crop: true,
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* @property {boolean} imageeditor.resize=true Show tab resizing
|
|
65
|
-
*/
|
|
66
47
|
resize: true,
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* @property {boolean} imageeditor.resizeUseRatio=true Keep aspect ratio on resize
|
|
70
|
-
*/
|
|
71
48
|
resizeUseRatio: true,
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* @property {int} imageeditor.resizeMinWidth=20 minimal width on resize
|
|
75
|
-
*/
|
|
76
49
|
resizeMinWidth: 20,
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* @property {boolean} imageeditor.resizeMinHeight=20 minimal height on resize
|
|
80
|
-
*/
|
|
81
50
|
resizeMinHeight: 20,
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @property {boolean} imageeditor.cropUseRatio=true Keep aspect ratio on crop
|
|
85
|
-
*/
|
|
86
51
|
cropUseRatio: true,
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* @property {string} imageeditor.cropDefaultWidth=70% In the tab, crop the image is displayed not in real size.
|
|
90
|
-
* Boxing default size for it
|
|
91
|
-
* @property {string} imageeditor.cropDefaultHeight=70%
|
|
92
|
-
*/
|
|
93
52
|
cropDefaultWidth: '70%',
|
|
94
53
|
cropDefaultHeight: '70%'
|
|
95
54
|
};
|
|
@@ -645,8 +604,6 @@ export class ImageEditor extends ViewComponent {
|
|
|
645
604
|
|
|
646
605
|
/**
|
|
647
606
|
* Hide image editor
|
|
648
|
-
*
|
|
649
|
-
* @method hide
|
|
650
607
|
*/
|
|
651
608
|
@autobind
|
|
652
609
|
hide(): void {
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @module modules/image-editor
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { ImageEditorOptions, IViewBased } from '
|
|
12
|
-
import { Icon } from '
|
|
11
|
+
import type { ImageEditorOptions, IViewBased } from 'jodit/types';
|
|
12
|
+
import { Icon } from 'jodit/core/ui';
|
|
13
13
|
|
|
14
14
|
const jie = 'jodit-image-editor';
|
|
15
15
|
const gi = Icon.get.bind(Icon);
|
|
@@ -30,9 +30,9 @@ export const form = (
|
|
|
30
30
|
) => `<div class="jodit-form__group">
|
|
31
31
|
<label>${i(label)}</label>
|
|
32
32
|
|
|
33
|
-
<label class='
|
|
33
|
+
<label class='jodit-switcher'>
|
|
34
34
|
<input ${act(active, 'checked')} data-ref="${ref}" type="checkbox"/>
|
|
35
|
-
<span class="
|
|
35
|
+
<span class="jodit-switcher__slider"></span>
|
|
36
36
|
</label>
|
|
37
37
|
</div>`;
|
|
38
38
|
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
* @module modules/observer
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type { IJodit, SnapshotType, IObserver } from '
|
|
14
|
-
import { Config } from '
|
|
15
|
-
import { ViewComponent } from '
|
|
13
|
+
import type { IJodit, SnapshotType, IObserver } from 'jodit/types';
|
|
14
|
+
import { Config } from 'jodit/config';
|
|
15
|
+
import { ViewComponent } from 'jodit/core/component';
|
|
16
16
|
import { Snapshot } from './snapshot';
|
|
17
17
|
import { Stack } from './stack';
|
|
18
18
|
import { Command } from './command';
|
|
19
|
-
import { debounce } from '
|
|
19
|
+
import { debounce } from 'jodit/core/decorators';
|
|
20
20
|
|
|
21
|
-
declare module '
|
|
21
|
+
declare module 'jodit/config' {
|
|
22
22
|
interface Config {
|
|
23
23
|
observer: {
|
|
24
24
|
/**
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
* @module modules/observer
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import type { IJodit, ISnapshot, SnapshotType } from '
|
|
12
|
-
import { ViewComponent } from '
|
|
13
|
-
import { Dom } from '
|
|
11
|
+
import type { IJodit, ISnapshot, SnapshotType } from 'jodit/types';
|
|
12
|
+
import { ViewComponent } from 'jodit/core/component';
|
|
13
|
+
import { Dom } from 'jodit/core/dom';
|
|
14
14
|
|
|
15
15
|
// declare const isProd: boolean;
|
|
16
16
|
/**
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
|
|
13
13
|
import './status-bar.less';
|
|
14
14
|
|
|
15
|
-
import type { IJodit, IStatusBar, IDictionary } from '
|
|
16
|
-
import { ViewComponent, STATUSES } from '
|
|
17
|
-
import { Dom } from '
|
|
18
|
-
import { Mods } from '
|
|
15
|
+
import type { IJodit, IStatusBar, IDictionary, ModType } from 'jodit/types';
|
|
16
|
+
import { ViewComponent, STATUSES } from 'jodit/core/component';
|
|
17
|
+
import { Dom } from 'jodit/core/dom';
|
|
18
|
+
import { Mods } from 'jodit/core/traits';
|
|
19
19
|
|
|
20
20
|
export class StatusBar extends ViewComponent<IJodit> implements IStatusBar {
|
|
21
21
|
className(): string {
|
|
@@ -45,16 +45,16 @@ export class StatusBar extends ViewComponent<IJodit> implements IStatusBar {
|
|
|
45
45
|
return !this.container.classList.contains('jodit_hidden');
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
readonly mods: IDictionary<
|
|
48
|
+
readonly mods: IDictionary<ModType> = {};
|
|
49
49
|
|
|
50
50
|
/** @see [[Mods.setMod]] */
|
|
51
|
-
setMod(name: string, value:
|
|
51
|
+
setMod(name: string, value: ModType): this {
|
|
52
52
|
Mods.setMod.call(this, name, value);
|
|
53
53
|
return this;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
/** @see [[Mods.getMod]] */
|
|
57
|
-
getMod(name: string):
|
|
57
|
+
getMod(name: string): ModType {
|
|
58
58
|
return Mods.getMod.call(this, name);
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* @module modules/table
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import type { ICreate, IDictionary, IJodit } from '
|
|
14
|
-
import * as consts from '
|
|
15
|
-
import { Dom } from '
|
|
13
|
+
import type { ICreate, IDictionary, IJodit } from 'jodit/types';
|
|
14
|
+
import * as consts from 'jodit/core/constants';
|
|
15
|
+
import { Dom } from 'jodit/core/dom';
|
|
16
16
|
import {
|
|
17
17
|
$$,
|
|
18
18
|
attr,
|
|
@@ -20,12 +20,12 @@ import {
|
|
|
20
20
|
isNumber,
|
|
21
21
|
toArray,
|
|
22
22
|
trim
|
|
23
|
-
} from '
|
|
24
|
-
import { ViewComponent } from '
|
|
25
|
-
import { getContainer } from '
|
|
26
|
-
import { debounce } from '
|
|
23
|
+
} from 'jodit/core/helpers/';
|
|
24
|
+
import { ViewComponent } from 'jodit/core/component';
|
|
25
|
+
import { getContainer } from 'jodit/core/global';
|
|
26
|
+
import { debounce } from 'jodit/core/decorators';
|
|
27
27
|
|
|
28
|
-
declare module '
|
|
28
|
+
declare module 'jodit/config' {
|
|
29
29
|
interface Config {
|
|
30
30
|
table: {
|
|
31
31
|
allowCellSelection: boolean;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
@import (reference) '../../../styles/variables';
|
|
8
8
|
@import (reference) '../../../styles/mixins';
|
|
9
|
-
@import (reference) '
|
|
9
|
+
@import (reference) 'jodit/core/ui/button/button/button';
|
|
10
10
|
|
|
11
11
|
.trigger-size(@size) {
|
|
12
12
|
width: @size;
|
|
@@ -21,12 +21,12 @@ import type {
|
|
|
21
21
|
IToolbarCollection,
|
|
22
22
|
IViewBased,
|
|
23
23
|
Nullable
|
|
24
|
-
} from '
|
|
25
|
-
import { UIButton, UIButtonState } from '
|
|
26
|
-
import { component, watch } from '
|
|
27
|
-
import { Dom } from '
|
|
28
|
-
import { Popup } from '
|
|
29
|
-
import { makeCollection } from '
|
|
24
|
+
} from 'jodit/types';
|
|
25
|
+
import { UIButton, UIButtonState } from 'jodit/core/ui/button';
|
|
26
|
+
import { component, watch } from 'jodit/core/decorators';
|
|
27
|
+
import { Dom } from 'jodit/core/dom';
|
|
28
|
+
import { Popup } from 'jodit/core/ui/popup/';
|
|
29
|
+
import { makeCollection } from 'jodit/modules/toolbar/factory';
|
|
30
30
|
import {
|
|
31
31
|
isFunction,
|
|
32
32
|
isString,
|
|
@@ -37,11 +37,11 @@ import {
|
|
|
37
37
|
call,
|
|
38
38
|
isArray,
|
|
39
39
|
keys
|
|
40
|
-
} from '
|
|
41
|
-
import { Icon } from '
|
|
42
|
-
import { ToolbarCollection } from '
|
|
43
|
-
import { STATUSES } from '
|
|
44
|
-
import { findControlType } from '
|
|
40
|
+
} from 'jodit/core/helpers';
|
|
41
|
+
import { Icon } from 'jodit/core/ui';
|
|
42
|
+
import { ToolbarCollection } from 'jodit/modules/toolbar/collection/collection';
|
|
43
|
+
import { STATUSES } from 'jodit/core/component';
|
|
44
|
+
import { findControlType } from 'jodit/core/ui/helpers/get-control-type';
|
|
45
45
|
|
|
46
46
|
@component
|
|
47
47
|
export class ToolbarButton<T extends IViewBased = IViewBased>
|
|
@@ -83,10 +83,8 @@ export class ToolbarButton<T extends IViewBased = IViewBased>
|
|
|
83
83
|
const { control, state } = this,
|
|
84
84
|
tc = this.closest(ToolbarCollection) as ToolbarCollection;
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
state.activated = Boolean(tc.shouldBeActive(this));
|
|
89
|
-
}
|
|
86
|
+
state.disabled = this.calculateDisabledStatus(tc);
|
|
87
|
+
state.activated = this.calculateActivatedStatus(tc);
|
|
90
88
|
|
|
91
89
|
if (isFunction(control.update)) {
|
|
92
90
|
control.update(this);
|
|
@@ -95,6 +93,50 @@ export class ToolbarButton<T extends IViewBased = IViewBased>
|
|
|
95
93
|
super.update();
|
|
96
94
|
}
|
|
97
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Calculates whether the button is active
|
|
98
|
+
*/
|
|
99
|
+
private calculateActivatedStatus(tc?: ToolbarCollection): boolean {
|
|
100
|
+
if (isJoditObject(this.j) && !this.j.editorIsActive) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (
|
|
105
|
+
isFunction(this.control.isActive) &&
|
|
106
|
+
this.control.isActive(this.j, this.control, this)
|
|
107
|
+
) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return Boolean(tc && tc.shouldBeActive(this));
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Calculates whether an element is blocked for the user
|
|
116
|
+
*/
|
|
117
|
+
private calculateDisabledStatus(tc?: ToolbarCollection): boolean {
|
|
118
|
+
if (this.j.o.disabled) {
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (
|
|
123
|
+
this.j.o.readonly &&
|
|
124
|
+
(!this.j.o.activeButtonsInReadOnly ||
|
|
125
|
+
!this.j.o.activeButtonsInReadOnly.includes(this.control.name))
|
|
126
|
+
) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (
|
|
131
|
+
isFunction(this.control.isDisabled) &&
|
|
132
|
+
this.control.isDisabled(this.j, this.control, this)
|
|
133
|
+
) {
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
return Boolean(tc && tc.shouldBeDisabled(this));
|
|
138
|
+
}
|
|
139
|
+
|
|
98
140
|
/** @override */
|
|
99
141
|
protected override onChangeActivated(): void {
|
|
100
142
|
attr(this.button, 'aria-pressed', this.state.activated);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
@import (reference) '../../../styles/variables';
|
|
8
8
|
@import (reference) '../../../styles/mixins';
|
|
9
|
-
@import (reference) '
|
|
9
|
+
@import (reference) 'jodit/core/ui/button/button/button';
|
|
10
10
|
|
|
11
11
|
.jodit-toolbar-content {
|
|
12
12
|
.jodit-ui-button();
|
|
@@ -15,11 +15,11 @@ import type {
|
|
|
15
15
|
IToolbarButton,
|
|
16
16
|
IViewBased,
|
|
17
17
|
Nullable
|
|
18
|
-
} from '
|
|
19
|
-
import { UIButton } from '
|
|
20
|
-
import { Dom } from '
|
|
21
|
-
import { isString, attr } from '
|
|
22
|
-
import { component } from '
|
|
18
|
+
} from 'jodit/types';
|
|
19
|
+
import { UIButton } from 'jodit/core/ui/button';
|
|
20
|
+
import { Dom } from 'jodit/core/dom';
|
|
21
|
+
import { isString, attr } from 'jodit/core/helpers';
|
|
22
|
+
import { component } from 'jodit/core/decorators';
|
|
23
23
|
|
|
24
24
|
@component
|
|
25
25
|
export class ToolbarContent<T extends IViewBased = IViewBased>
|
|
@@ -23,13 +23,13 @@ import type {
|
|
|
23
23
|
CanUndef,
|
|
24
24
|
IViewWithToolbar,
|
|
25
25
|
IBound
|
|
26
|
-
} from '
|
|
26
|
+
} from 'jodit/types';
|
|
27
27
|
|
|
28
|
-
import { error
|
|
28
|
+
import { error } from 'jodit/core/helpers';
|
|
29
29
|
|
|
30
|
-
import { UIList } from '
|
|
30
|
+
import { UIList } from 'jodit/core/ui';
|
|
31
31
|
import { makeButton } from '../factory';
|
|
32
|
-
import { component, autobind } from '
|
|
32
|
+
import { component, autobind } from 'jodit/core/decorators';
|
|
33
33
|
|
|
34
34
|
@component
|
|
35
35
|
export class ToolbarCollection<T extends IViewWithToolbar = IViewWithToolbar>
|
|
@@ -66,10 +66,6 @@ export class ToolbarCollection<T extends IViewWithToolbar = IViewWithToolbar>
|
|
|
66
66
|
* Button should be active
|
|
67
67
|
*/
|
|
68
68
|
shouldBeActive(button: IToolbarButton): boolean | undefined {
|
|
69
|
-
if (isFunction(button.control.isActive)) {
|
|
70
|
-
return button.control.isActive(this.j, button.control, button);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
69
|
return undefined;
|
|
74
70
|
}
|
|
75
71
|
|
|
@@ -77,29 +73,7 @@ export class ToolbarCollection<T extends IViewWithToolbar = IViewWithToolbar>
|
|
|
77
73
|
* Button should be disabled
|
|
78
74
|
*/
|
|
79
75
|
shouldBeDisabled(button: IToolbarButton): boolean | undefined {
|
|
80
|
-
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (
|
|
85
|
-
this.j.o.readonly &&
|
|
86
|
-
(!this.j.o.activeButtonsInReadOnly ||
|
|
87
|
-
!this.j.o.activeButtonsInReadOnly.includes(button.control.name))
|
|
88
|
-
) {
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
let isDisabled: boolean | undefined;
|
|
93
|
-
|
|
94
|
-
if (isFunction(button.control.isDisabled)) {
|
|
95
|
-
isDisabled = button.control.isDisabled(
|
|
96
|
-
this.j,
|
|
97
|
-
button.control,
|
|
98
|
-
button
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
return isDisabled;
|
|
76
|
+
return undefined;
|
|
103
77
|
}
|
|
104
78
|
|
|
105
79
|
/**
|
|
@@ -9,17 +9,17 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { ToolbarCollection } from './collection';
|
|
12
|
-
import * as consts from '
|
|
13
|
-
import { Dom } from '
|
|
12
|
+
import * as consts from 'jodit/core/constants';
|
|
13
|
+
import { Dom } from 'jodit/core/dom';
|
|
14
14
|
import type {
|
|
15
15
|
IDictionary,
|
|
16
16
|
IToolbarButton,
|
|
17
17
|
IViewBased,
|
|
18
18
|
IJodit,
|
|
19
19
|
IBound
|
|
20
|
-
} from '
|
|
21
|
-
import { css, isFunction
|
|
22
|
-
import { component } from '
|
|
20
|
+
} from 'jodit/types';
|
|
21
|
+
import { css, isFunction } from 'jodit/core/helpers';
|
|
22
|
+
import { component } from 'jodit/core/decorators';
|
|
23
23
|
|
|
24
24
|
@component
|
|
25
25
|
export class ToolbarEditorCollection extends ToolbarCollection<IJodit> {
|
|
@@ -46,10 +46,6 @@ export class ToolbarEditorCollection extends ToolbarCollection<IJodit> {
|
|
|
46
46
|
|
|
47
47
|
/** @override */
|
|
48
48
|
override shouldBeActive(button: IToolbarButton): boolean {
|
|
49
|
-
if (isJoditObject(this.j) && !this.j.editorIsActive) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
49
|
const active = super.shouldBeActive(button);
|
|
54
50
|
|
|
55
51
|
if (active !== undefined) {
|
|
@@ -18,8 +18,8 @@ import type {
|
|
|
18
18
|
IUIElement,
|
|
19
19
|
IViewBased,
|
|
20
20
|
Nullable
|
|
21
|
-
} from '
|
|
22
|
-
import { isFunction, isJoditObject } from '
|
|
21
|
+
} from 'jodit/types';
|
|
22
|
+
import { isFunction, isJoditObject } from 'jodit/core/helpers';
|
|
23
23
|
import { ToolbarCollection } from './collection/collection';
|
|
24
24
|
import { ToolbarEditorCollection } from './collection/editor-collection';
|
|
25
25
|
import { ToolbarButton } from './button/button';
|
|
@@ -25,10 +25,10 @@ import type {
|
|
|
25
25
|
IUploaderOptions,
|
|
26
26
|
IViewBased,
|
|
27
27
|
Nullable
|
|
28
|
-
} from '
|
|
29
|
-
import { Config } from '
|
|
30
|
-
import { IS_IE, TEXT_PLAIN } from '
|
|
31
|
-
import { Ajax } from '
|
|
28
|
+
} from 'jodit/types';
|
|
29
|
+
import { Config } from 'jodit/config';
|
|
30
|
+
import { IS_IE, TEXT_PLAIN } from 'jodit/core/constants';
|
|
31
|
+
import { Ajax } from 'jodit/core/request';
|
|
32
32
|
import {
|
|
33
33
|
attr,
|
|
34
34
|
error,
|
|
@@ -39,12 +39,12 @@ import {
|
|
|
39
39
|
toArray,
|
|
40
40
|
isString,
|
|
41
41
|
ConfigProto
|
|
42
|
-
} from '
|
|
43
|
-
import { Dom } from '
|
|
44
|
-
import { ViewComponent, STATUSES } from '
|
|
45
|
-
import { getContainer } from '
|
|
42
|
+
} from 'jodit/core/helpers';
|
|
43
|
+
import { Dom } from 'jodit/core/dom';
|
|
44
|
+
import { ViewComponent, STATUSES } from 'jodit/core/component/';
|
|
45
|
+
import { getContainer } from 'jodit/core/global';
|
|
46
46
|
|
|
47
|
-
declare module '
|
|
47
|
+
declare module 'jodit/config' {
|
|
48
48
|
interface Config {
|
|
49
49
|
/**
|
|
50
50
|
* Enable drag and drop file editor
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import './color-picker.less';
|
|
14
14
|
|
|
15
|
-
import type { IDictionary, IJodit } from '
|
|
15
|
+
import type { IDictionary, IJodit } from 'jodit/types';
|
|
16
16
|
import {
|
|
17
17
|
normalizeColor,
|
|
18
18
|
hasBrowserColorPicker,
|
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
isFunction,
|
|
22
22
|
isArray,
|
|
23
23
|
refs
|
|
24
|
-
} from '
|
|
25
|
-
import { Icon } from '
|
|
26
|
-
import { Dom } from '
|
|
24
|
+
} from 'jodit/core/helpers/';
|
|
25
|
+
import { Icon } from 'jodit/core/ui';
|
|
26
|
+
import { Dom } from 'jodit/core/dom';
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Build color picker
|
|
@@ -14,11 +14,11 @@ import type {
|
|
|
14
14
|
IFileBrowserCallBackData,
|
|
15
15
|
IJodit,
|
|
16
16
|
IUploaderData
|
|
17
|
-
} from '
|
|
18
|
-
import { isFunction, $$, attr, val } from '
|
|
19
|
-
import { Dom } from '
|
|
17
|
+
} from 'jodit/types';
|
|
18
|
+
import { isFunction, $$, attr, val } from 'jodit/core/helpers';
|
|
19
|
+
import { Dom } from 'jodit/core/dom';
|
|
20
20
|
import { TabOption, TabsWidget } from '../tabs/tabs';
|
|
21
|
-
import { UIBlock, UIForm, UIInput, UIButton } from '
|
|
21
|
+
import { UIBlock, UIForm, UIInput, UIButton } from 'jodit/core/ui';
|
|
22
22
|
|
|
23
23
|
interface ImageSelectorCallbacks {
|
|
24
24
|
/**
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
import './tabs.less';
|
|
14
14
|
|
|
15
|
-
import type { IDictionary, IJodit, IUIButton } from '
|
|
16
|
-
import { $$, isFunction } from '
|
|
17
|
-
import { Button, UIElement } from '
|
|
15
|
+
import type { IDictionary, IJodit, IUIButton } from 'jodit/types';
|
|
16
|
+
import { $$, isFunction } from 'jodit/core/helpers';
|
|
17
|
+
import { Button, UIElement } from 'jodit/core/ui';
|
|
18
18
|
|
|
19
19
|
export interface TabOption {
|
|
20
20
|
icon?: string;
|