From e71e679e0e6df62a54bdaf94ac91816b6c127caf Mon Sep 17 00:00:00 2001 From: xdan Date: Wed, 19 Jan 2022 20:28:13 +0300 Subject: [PATCH] Removed relative paths --- build-system/index.js | 5 +++- build-system/minimizer/js.js | 3 +++ src/core/async/async.ts | 2 +- src/core/component/component.ts | 2 +- src/core/component/view-component.ts | 2 +- src/core/create/create.ts | 2 +- src/core/decorators/cache/cache.ts | 2 +- src/core/decorators/component/component.ts | 2 +- src/core/decorators/debounce/debounce.ts | 6 ++--- src/core/decorators/hook/hook.ts | 8 +++--- src/core/decorators/idle/idle.ts | 2 +- src/core/decorators/persistent/persistent.ts | 2 +- src/core/decorators/wait/wait.ts | 2 +- src/core/decorators/watch/watch.ts | 8 +++--- src/core/dom/dom.ts | 2 +- src/core/event-emitter/event-emitter.ts | 2 +- src/core/event-emitter/observe-object.ts | 2 +- src/core/event-emitter/store.ts | 2 +- src/core/helpers/checker/is-imp-interface.ts | 2 +- src/core/helpers/checker/is-jodit-object.ts | 2 +- src/core/helpers/checker/is-plain-object.ts | 2 +- .../normalize/normalize-key-aliases.ts | 2 +- src/core/helpers/size/get-scroll-parent.ts | 2 +- src/core/helpers/size/object-size.ts | 2 +- src/core/helpers/size/offset.ts | 2 +- src/core/helpers/size/position.ts | 2 +- src/core/helpers/string/i18n.ts | 2 +- src/core/helpers/string/stringify.ts | 2 +- src/core/helpers/utils/append-script.ts | 2 +- src/core/helpers/utils/assert.ts | 21 +++++++++++++++ src/core/helpers/utils/build-query.ts | 2 +- src/core/helpers/utils/config-proto.ts | 2 +- src/core/helpers/utils/css.ts | 2 +- src/core/helpers/utils/data-bind.ts | 2 +- src/core/helpers/utils/get-class-name.ts | 2 +- src/core/helpers/utils/get.ts | 2 +- src/core/helpers/utils/index.ts | 1 + src/core/helpers/utils/parse-query.ts | 2 +- src/core/helpers/utils/set.ts | 2 +- src/core/helpers/utils/stack.ts | 2 +- src/core/helpers/utils/utils.ts | 2 +- src/core/plugin/plugin-system.ts | 2 +- src/core/plugin/plugin.ts | 2 +- src/core/request/ajax.ts | 4 +-- src/core/request/config.ts | 6 ++--- src/core/request/response.ts | 2 +- src/core/selection/select.ts | 2 +- .../selection/style/api/toggle/toggle-css.ts | 6 ++--- .../style/api/toggle/toggle-ordered-list.ts | 4 +-- src/core/selection/style/apply-style.ts | 2 +- src/core/selection/style/commit-style.ts | 2 +- .../storage/engines/local-storage-provider.ts | 2 +- .../engines/memory-storage-provider.ts | 2 +- src/core/storage/storage.ts | 2 +- src/core/traits/elms.ts | 2 +- src/core/traits/mods.ts | 2 +- src/core/ui/element.ts | 2 +- src/core/ui/form/block/block.ts | 2 +- src/core/ui/form/form.ts | 4 +-- src/core/ui/form/inputs/area/area.ts | 4 +-- src/core/ui/form/inputs/checkbox/checkbox.ts | 6 ++--- src/core/ui/form/inputs/file/file.ts | 4 +-- src/core/ui/form/inputs/input/input.ts | 14 +++++----- src/core/ui/form/inputs/select/select.ts | 6 ++--- src/core/ui/group/group.ts | 4 +-- src/core/ui/group/list.ts | 2 +- src/core/ui/helpers/buttons.ts | 4 +-- src/core/ui/helpers/get-control-type.ts | 2 +- .../ui/helpers/get-strong-control-types.ts | 4 +-- src/core/ui/icon.ts | 2 +- src/core/ui/popup/popup.ts | 2 +- src/core/ui/progress-bar/progress-bar.ts | 2 +- src/core/view/view-with-toolbar.ts | 4 +-- src/core/view/view.ts | 2 +- src/index.ts | 3 +++ src/modules/context-menu/context-menu.less | 2 +- src/modules/context-menu/context-menu.ts | 8 +++--- src/modules/dialog/alert.ts | 6 ++--- src/modules/dialog/confirm.ts | 4 +-- src/modules/dialog/dialog.ts | 26 +++++++++---------- src/modules/dialog/prompt.ts | 4 +-- .../file-browser/builders/context-menu.ts | 8 +++--- .../file-browser/builders/elements-map.ts | 2 +- src/modules/file-browser/builders/item.ts | 4 +-- src/modules/file-browser/config.ts | 10 +++---- src/modules/file-browser/data-provider.ts | 8 +++--- src/modules/file-browser/factories.ts | 2 +- src/modules/file-browser/fetch/delete-file.ts | 2 +- src/modules/file-browser/fetch/load-items.ts | 2 +- src/modules/file-browser/fetch/load-tree.ts | 6 ++--- src/modules/file-browser/file-browser.ts | 20 +++++++------- .../listeners/native-listeners.ts | 6 ++--- .../file-browser/listeners/self-listeners.ts | 6 ++--- .../file-browser/listeners/state-listeners.ts | 8 +++--- src/modules/image-editor/image-editor.ts | 16 ++++++------ src/modules/image-editor/templates/form.ts | 4 +-- src/modules/observer/command.ts | 2 +- src/modules/observer/observer.ts | 10 +++---- src/modules/observer/snapshot.ts | 6 ++--- src/modules/observer/stack.ts | 2 +- src/modules/status-bar/status-bar.ts | 8 +++--- src/modules/table/table.ts | 16 ++++++------ src/modules/toolbar/button/button.less | 2 +- src/modules/toolbar/button/button.ts | 20 +++++++------- src/modules/toolbar/button/content.less | 2 +- src/modules/toolbar/button/content.ts | 10 +++---- .../toolbar/collection/collection.less | 2 +- src/modules/toolbar/collection/collection.ts | 6 ++--- .../toolbar/collection/editor-collection.ts | 10 +++---- src/modules/toolbar/factory.ts | 4 +-- src/modules/uploader/uploader.ts | 18 ++++++------- .../widget/color-picker/color-picker.ts | 8 +++--- .../widget/file-selector/file-selector.ts | 8 +++--- src/modules/widget/tabs/tabs.ts | 6 ++--- src/plugins/about/about.ts | 10 +++---- src/plugins/add-new-line/add-new-line.ts | 10 +++---- src/plugins/bold/bold.ts | 6 ++--- src/plugins/class-span/class-span.ts | 10 +++---- src/plugins/clipboard/clipboard.ts | 8 +++--- src/plugins/clipboard/config.ts | 10 +++---- src/plugins/clipboard/copy-format.ts | 8 +++--- .../clipboard/drag-and-drop-element.ts | 12 ++++----- src/plugins/clipboard/drag-and-drop.ts | 14 +++++----- .../clipboard/paste-storage/paste-storage.ts | 12 ++++----- src/plugins/clipboard/paste/helpers.ts | 8 +++--- src/plugins/clipboard/paste/paste.ts | 16 ++++++------ src/plugins/color/color.ts | 10 +++---- src/plugins/error-messages/error-messages.ts | 10 +++---- src/plugins/fix/clean-html.ts | 14 +++++----- src/plugins/fix/wrap-text-nodes.ts | 10 +++---- src/plugins/focus/focus.ts | 8 +++--- src/plugins/font/font.ts | 10 +++---- src/plugins/format-block/format-block.ts | 8 +++--- src/plugins/fullsize/fullsize.ts | 10 +++---- src/plugins/iframe/iframe.ts | 12 ++++----- src/plugins/image/helpers.ts | 2 +- src/plugins/image/image-processor.ts | 4 +-- .../image-properties/image-properties.ts | 12 ++++----- src/plugins/image/image.ts | 10 +++---- src/plugins/indent/indent.ts | 12 ++++----- src/plugins/inline-popup/config/config.ts | 2 +- src/plugins/inline-popup/inline-popup.ts | 12 ++++----- src/plugins/insert/hr.ts | 6 ++--- src/plugins/justify/justify.ts | 8 +++--- src/plugins/keyboard/backspace/backspace.ts | 10 +++---- src/plugins/keyboard/enter.ts | 12 ++++----- src/plugins/keyboard/helpers.ts | 10 +++---- src/plugins/keyboard/hotkeys.ts | 12 ++++----- src/plugins/keyboard/key-arrow-outside.ts | 10 +++---- src/plugins/limit/limit.ts | 14 +++++----- src/plugins/link/link.ts | 14 +++++----- src/plugins/link/template.ts | 6 ++--- src/plugins/media/file.ts | 8 +++--- src/plugins/media/media.ts | 10 +++---- src/plugins/media/video/config.ts | 10 +++---- src/plugins/media/video/index.ts | 2 +- src/plugins/mobile/mobile.ts | 18 ++++++------- src/plugins/ordered-list/ordered-list.ts | 12 ++++----- src/plugins/placeholder/placeholder.ts | 18 ++++++------- .../powered-by-jodit/powered-by-jodit.ts | 4 +-- src/plugins/print/preview.ts | 8 +++--- src/plugins/print/print.ts | 12 ++++----- src/plugins/redo-undo/redo-undo.ts | 8 +++--- src/plugins/resizer/resizer.ts | 22 ++++++++-------- src/plugins/search/search.ts | 22 ++++++++-------- src/plugins/select/select.ts | 12 ++++----- src/plugins/size/config.ts | 4 +-- src/plugins/size/resize-handler.ts | 10 +++---- src/plugins/size/size.ts | 8 +++--- src/plugins/source/config.ts | 10 +++---- src/plugins/source/editor/factory.ts | 4 +-- src/plugins/source/editor/sourceEditor.ts | 2 +- src/plugins/source/source.ts | 14 +++++----- src/plugins/stat/stat.ts | 12 ++++----- src/plugins/sticky/sticky.ts | 12 ++++----- src/plugins/symbols/config.ts | 8 +++--- src/plugins/symbols/symbols.ts | 6 ++--- src/plugins/table/config.ts | 10 +++---- src/plugins/table/resize-cells.ts | 8 +++--- src/plugins/table/select-cells.ts | 10 +++---- .../table/table-keyboard-navigation.ts | 6 ++--- src/plugins/table/table.ts | 2 +- src/plugins/tooltip/tooltip.ts | 12 ++++----- src/plugins/xpath/xpath.ts | 20 +++++++------- src/polyfills.ts | 1 + tsconfig.json | 9 +++++-- 186 files changed, 636 insertions(+), 599 deletions(-) create mode 100644 src/core/helpers/utils/assert.ts diff --git a/build-system/index.js b/build-system/index.js index d2bf49092..1dc10e401 100644 --- a/build-system/index.js +++ b/build-system/index.js @@ -55,7 +55,10 @@ module.exports = (env, argv, dir = process.cwd(), onlyTS = false) => { }, resolve: { - extensions: ['.js', '.ts', '.d.ts', '.json', '.less', '.svg'] + extensions: ['.js', '.ts', '.d.ts', '.json', '.less', '.svg'], + alias: { + jodit: path.resolve(__dirname, '../src/') + } }, optimization: { diff --git a/build-system/minimizer/js.js b/build-system/minimizer/js.js index 501d7363f..ba42eafaa 100644 --- a/build-system/minimizer/js.js +++ b/build-system/minimizer/js.js @@ -29,6 +29,9 @@ module.exports = ({ ESNext, isTest, banner }) => pure_getters: true, unsafe_comps: true, + + pure_funcs: ['assert'], + passes: 7 }, diff --git a/src/core/async/async.ts b/src/core/async/async.ts index 2c85b6193..88230d3a6 100644 --- a/src/core/async/async.ts +++ b/src/core/async/async.ts @@ -16,7 +16,7 @@ import type { IAsyncParams, ITimeout, RejectablePromise -} from '../../types'; +} from 'jodit/types'; import { setTimeout, clearTimeout, diff --git a/src/core/component/component.ts b/src/core/component/component.ts index 63c9293fa..c654b6eab 100644 --- a/src/core/component/component.ts +++ b/src/core/component/component.ts @@ -15,7 +15,7 @@ import type { IComponent, IDictionary, Nullable -} from '../../types'; +} from 'jodit/types'; import { kebabCase, get, getClassName, isFunction, isVoid } from '../helpers'; import { uniqueUid } from '../global'; diff --git a/src/core/component/view-component.ts b/src/core/component/view-component.ts index 57b4d1e40..b2051f097 100644 --- a/src/core/component/view-component.ts +++ b/src/core/component/view-component.ts @@ -8,7 +8,7 @@ * @module component */ -import type { IViewBased, IViewComponent } from '../../types'; +import type { IViewBased, IViewComponent } from 'jodit/types'; import { Component } from './component'; export abstract class ViewComponent diff --git a/src/core/create/create.ts b/src/core/create/create.ts index ef9089232..b10e520f6 100644 --- a/src/core/create/create.ts +++ b/src/core/create/create.ts @@ -17,7 +17,7 @@ import type { ICreate, CanUndef, NodeFunction -} from '../../types'; +} from 'jodit/types'; import { isPlainObject, diff --git a/src/core/decorators/cache/cache.ts b/src/core/decorators/cache/cache.ts index 429ae36bd..c647a850e 100644 --- a/src/core/decorators/cache/cache.ts +++ b/src/core/decorators/cache/cache.ts @@ -11,7 +11,7 @@ */ import { error } from '../../helpers'; -import type { IDictionary } from '../../../types'; +import type { IDictionary } from 'jodit/types'; export interface CachePropertyDescriptor extends PropertyDescriptor { get?: (this: T) => R; diff --git a/src/core/decorators/component/component.ts b/src/core/decorators/component/component.ts index a2fd7f235..74006fd12 100644 --- a/src/core/decorators/component/component.ts +++ b/src/core/decorators/component/component.ts @@ -10,7 +10,7 @@ * @module decorators/component */ -import { isFunction } from '../../helpers'; +import { isFunction } from 'jodit/core/helpers'; interface ComponentCompatible { className?: () => string; diff --git a/src/core/decorators/debounce/debounce.ts b/src/core/decorators/debounce/debounce.ts index 2ef850e02..296fad417 100644 --- a/src/core/decorators/debounce/debounce.ts +++ b/src/core/decorators/debounce/debounce.ts @@ -16,15 +16,15 @@ import type { IViewComponent, IAsyncParams, DecoratorHandler -} from '../../../types'; +} from 'jodit/types'; import { isFunction, isNumber, isPlainObject, isViewObject -} from '../../helpers/checker'; +} from 'jodit/core/helpers/checker'; import { Component, STATUSES } from '../../component'; -import { error } from '../../helpers/utils/error'; +import { error } from 'jodit/core/helpers/utils/error'; export function debounce( timeout?: number | ((ctx: V) => number | IAsyncParams) | IAsyncParams, diff --git a/src/core/decorators/hook/hook.ts b/src/core/decorators/hook/hook.ts index 1d65fdc89..a66b6dbfb 100644 --- a/src/core/decorators/hook/hook.ts +++ b/src/core/decorators/hook/hook.ts @@ -15,10 +15,10 @@ import type { IDictionary, IViewBased, IViewComponent -} from '../../../types'; -import type { Component } from '../../component'; -import { isFunction } from '../../helpers/checker'; -import { error } from '../../helpers/utils/error'; +} from 'jodit/types'; +import type { Component } from 'jodit/core/component'; +import { isFunction } from 'jodit/core/helpers/checker'; +import { error } from 'jodit/core/helpers/utils/error'; /** * Call on some component status diff --git a/src/core/decorators/idle/idle.ts b/src/core/decorators/idle/idle.ts index 297b24381..28216beea 100644 --- a/src/core/decorators/idle/idle.ts +++ b/src/core/decorators/idle/idle.ts @@ -15,7 +15,7 @@ import type { IDictionary, IViewBased, IViewComponent -} from '../../../types'; +} from 'jodit/types'; import { Component, STATUSES } from '../../component'; import { error, isFunction, isViewObject } from '../../helpers'; diff --git a/src/core/decorators/persistent/persistent.ts b/src/core/decorators/persistent/persistent.ts index cdbc47dca..c958d770f 100644 --- a/src/core/decorators/persistent/persistent.ts +++ b/src/core/decorators/persistent/persistent.ts @@ -10,7 +10,7 @@ * @module decorators/persistent */ -import type { IComponent, IDictionary, IViewComponent } from '../../../types'; +import type { IComponent, IDictionary, IViewComponent } from 'jodit/types'; import { STATUSES } from '../../component'; import { isViewObject } from '../../helpers'; diff --git a/src/core/decorators/wait/wait.ts b/src/core/decorators/wait/wait.ts index f045674d0..967104b61 100644 --- a/src/core/decorators/wait/wait.ts +++ b/src/core/decorators/wait/wait.ts @@ -10,7 +10,7 @@ * @module decorators/wait */ -import type { IViewBased, IViewComponent } from '../../../types'; +import type { IViewBased, IViewComponent } from 'jodit/types'; import { error, isFunction, isViewObject } from '../../helpers'; import { STATUSES } from '../../component'; diff --git a/src/core/decorators/watch/watch.ts b/src/core/decorators/watch/watch.ts index 47b2eca5e..d46d3bcc7 100644 --- a/src/core/decorators/watch/watch.ts +++ b/src/core/decorators/watch/watch.ts @@ -16,12 +16,12 @@ import type { IComponent, IDictionary, IViewComponent -} from '../../../types'; -import { isFunction, isPlainObject, isViewObject } from '../../helpers/checker'; +} from 'jodit/types'; +import { isFunction, isPlainObject, isViewObject } from 'jodit/core/helpers/checker'; import { ObservableObject } from '../../event-emitter'; import { STATUSES } from '../../component'; -import { splitArray } from '../../helpers/array/split-array'; -import { error } from '../../helpers/utils/error'; +import { splitArray } from 'jodit/core/helpers/array/split-array'; +import { error } from 'jodit/core/helpers/utils/error'; export function getPropertyDescriptor( obj: unknown, diff --git a/src/core/dom/dom.ts b/src/core/dom/dom.ts index 215094536..63a18fcd3 100644 --- a/src/core/dom/dom.ts +++ b/src/core/dom/dom.ts @@ -18,7 +18,7 @@ import type { NodeCondition, Nullable, IDictionary -} from '../../types'; +} from 'jodit/types'; import * as consts from '../constants'; import { $$, diff --git a/src/core/event-emitter/event-emitter.ts b/src/core/event-emitter/event-emitter.ts index cecb68e02..f40a5a9a1 100644 --- a/src/core/event-emitter/event-emitter.ts +++ b/src/core/event-emitter/event-emitter.ts @@ -14,7 +14,7 @@ import type { CallbackFunction, EventHandlerBlock, IEventEmitter -} from '../../types'; +} from 'jodit/types'; import { defaultNameSpace, EventHandlersStore } from './store'; import { isString } from '../helpers/checker/is-string'; import { isFunction } from '../helpers/checker/is-function'; diff --git a/src/core/event-emitter/observe-object.ts b/src/core/event-emitter/observe-object.ts index fe2acd0f4..733e7d366 100644 --- a/src/core/event-emitter/observe-object.ts +++ b/src/core/event-emitter/observe-object.ts @@ -13,7 +13,7 @@ import type { CanUndef, IDictionary, IObservable -} from '../../types'; +} from 'jodit/types'; import { isPlainObject, isFastEqual, isArray } from '../helpers'; import { nonenumerable } from '../decorators'; diff --git a/src/core/event-emitter/store.ts b/src/core/event-emitter/store.ts index 17d571fd6..23d6f6cee 100644 --- a/src/core/event-emitter/store.ts +++ b/src/core/event-emitter/store.ts @@ -12,7 +12,7 @@ import type { CallbackFunction, EventHandlerBlock, IDictionary -} from '../../types'; +} from 'jodit/types'; export const defaultNameSpace = 'JoditEventDefaultNamespace'; diff --git a/src/core/helpers/checker/is-imp-interface.ts b/src/core/helpers/checker/is-imp-interface.ts index 8a4ea1a33..e92bea57b 100644 --- a/src/core/helpers/checker/is-imp-interface.ts +++ b/src/core/helpers/checker/is-imp-interface.ts @@ -8,7 +8,7 @@ * @module helpers/checker */ -import type { IContainer, IDestructible, IInitable } from '../../../types'; +import type { IContainer, IDestructible, IInitable } from 'jodit/types'; import { isFunction } from './is-function'; import { Dom } from '../../dom'; import { isVoid } from './is-void'; diff --git a/src/core/helpers/checker/is-jodit-object.ts b/src/core/helpers/checker/is-jodit-object.ts index f084c19e7..c9ee6aaf8 100644 --- a/src/core/helpers/checker/is-jodit-object.ts +++ b/src/core/helpers/checker/is-jodit-object.ts @@ -8,7 +8,7 @@ * @module helpers/checker */ -import type { IJodit, IViewBased } from '../../../types'; +import type { IJodit, IViewBased } from 'jodit/types'; import { isFunction } from './is-function'; import { modules } from '../../global'; diff --git a/src/core/helpers/checker/is-plain-object.ts b/src/core/helpers/checker/is-plain-object.ts index 863c56fb6..6c36ca11e 100644 --- a/src/core/helpers/checker/is-plain-object.ts +++ b/src/core/helpers/checker/is-plain-object.ts @@ -8,7 +8,7 @@ * @module helpers/checker */ -import type { IDictionary } from '../../../types'; +import type { IDictionary } from 'jodit/types'; import { isWindow } from './is-window'; /** diff --git a/src/core/helpers/normalize/normalize-key-aliases.ts b/src/core/helpers/normalize/normalize-key-aliases.ts index 2d6135b3a..cc963387d 100644 --- a/src/core/helpers/normalize/normalize-key-aliases.ts +++ b/src/core/helpers/normalize/normalize-key-aliases.ts @@ -8,7 +8,7 @@ * @module helpers/normalize */ -import type { IDictionary } from '../../../types'; +import type { IDictionary } from 'jodit/types'; import { trim } from '../string'; import { KEY_ALIASES } from '../../constants'; diff --git a/src/core/helpers/size/get-scroll-parent.ts b/src/core/helpers/size/get-scroll-parent.ts index e1dbb18fb..14a583116 100644 --- a/src/core/helpers/size/get-scroll-parent.ts +++ b/src/core/helpers/size/get-scroll-parent.ts @@ -8,7 +8,7 @@ * @module helpers/size */ -import type { Nullable } from '../../../types'; +import type { Nullable } from 'jodit/types'; import { css } from '../utils'; import { Dom } from '../../dom'; diff --git a/src/core/helpers/size/object-size.ts b/src/core/helpers/size/object-size.ts index cc4724c52..3b9ff5c2c 100644 --- a/src/core/helpers/size/object-size.ts +++ b/src/core/helpers/size/object-size.ts @@ -9,7 +9,7 @@ */ import { isArray, isPlainObject, isString } from '../checker'; -import type { CanUndef } from '../../../types'; +import type { CanUndef } from 'jodit/types'; export function size( subject: CanUndef> diff --git a/src/core/helpers/size/offset.ts b/src/core/helpers/size/offset.ts index e2f611966..2e46c3e9f 100644 --- a/src/core/helpers/size/offset.ts +++ b/src/core/helpers/size/offset.ts @@ -13,7 +13,7 @@ * @returns returns an object containing the properties top and left. */ -import type { IBound, IHasScroll, IJodit, IViewBased } from '../../../types'; +import type { IBound, IHasScroll, IJodit, IViewBased } from 'jodit/types'; export const offset = ( elm: HTMLElement | Range, diff --git a/src/core/helpers/size/position.ts b/src/core/helpers/size/position.ts index 0690bbb45..28f29e60a 100644 --- a/src/core/helpers/size/position.ts +++ b/src/core/helpers/size/position.ts @@ -8,7 +8,7 @@ * @module helpers/size */ -import type { IBound, IViewBased } from '../../../types'; +import type { IBound, IViewBased } from 'jodit/types'; import { isJoditObject } from '../checker'; export function position(elm: HTMLElement): IBound; diff --git a/src/core/helpers/string/i18n.ts b/src/core/helpers/string/i18n.ts index 61d86f762..97071f23d 100644 --- a/src/core/helpers/string/i18n.ts +++ b/src/core/helpers/string/i18n.ts @@ -8,7 +8,7 @@ * @module helpers/string */ -import type { IDictionary, ILanguageOptions } from '../../../types'; +import type { IDictionary, ILanguageOptions } from 'jodit/types'; import { Config } from '../../../config'; import { defaultLanguage as defineLanguage } from '../utils'; import { ucfirst, isString, error } from '../'; diff --git a/src/core/helpers/string/stringify.ts b/src/core/helpers/string/stringify.ts index 8c07324ae..b6ab2201c 100644 --- a/src/core/helpers/string/stringify.ts +++ b/src/core/helpers/string/stringify.ts @@ -8,7 +8,7 @@ * @module helpers/string */ -import type { CanUndef } from '../../../types'; +import type { CanUndef } from 'jodit/types'; /** * Safe stringify circular object diff --git a/src/core/helpers/utils/append-script.ts b/src/core/helpers/utils/append-script.ts index 11abeb9a2..d0571f87f 100644 --- a/src/core/helpers/utils/append-script.ts +++ b/src/core/helpers/utils/append-script.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IViewBased } from '../../../types'; +import type { IViewBased } from 'jodit/types'; import { completeUrl } from './complete-url'; import { isFunction, isString } from '../checker'; diff --git a/src/core/helpers/utils/assert.ts b/src/core/helpers/utils/assert.ts new file mode 100644 index 000000000..bdfa5a385 --- /dev/null +++ b/src/core/helpers/utils/assert.ts @@ -0,0 +1,21 @@ +/*! + * Jodit Editor (https://xdsoft.net/jodit/) + * Released under MIT see LICENSE.txt in the project root for license information. + * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net + */ + +class AssertionError extends Error { + constructor(message: string) { + super(message); + this.name = 'AssertionError'; + } +} + +/** Asserts that condition is truthy (or evaluates to true). */ +function assert(condition: boolean, message: string): asserts condition { + if (!condition) { + throw new AssertionError(`Assertion failed: ${message}`); + } +} + +export { assert }; diff --git a/src/core/helpers/utils/build-query.ts b/src/core/helpers/utils/build-query.ts index 85283dd96..e9c631ae7 100644 --- a/src/core/helpers/utils/build-query.ts +++ b/src/core/helpers/utils/build-query.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IDictionary } from '../../../types'; +import type { IDictionary } from 'jodit/types'; import { isPlainObject } from '../checker'; /** diff --git a/src/core/helpers/utils/config-proto.ts b/src/core/helpers/utils/config-proto.ts index 23763bcd3..20e2203da 100644 --- a/src/core/helpers/utils/config-proto.ts +++ b/src/core/helpers/utils/config-proto.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IDictionary } from '../../../types'; +import type { IDictionary } from 'jodit/types'; import { isAtom } from './extend'; import { isArray, isPlainObject, isString, isVoid } from '../checker'; import { Config } from '../../../config'; diff --git a/src/core/helpers/utils/css.ts b/src/core/helpers/utils/css.ts index 6b5bd6729..bba5b2a8a 100644 --- a/src/core/helpers/utils/css.ts +++ b/src/core/helpers/utils/css.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IStyle, StyleValue } from '../../../types'; +import type { IStyle, StyleValue } from 'jodit/types'; import { isPlainObject, isNumeric, isVoid, isBoolean } from '../checker/'; import { normalizeCssValue } from '../normalize/'; import { camelCase, kebabCase } from '../string/'; diff --git a/src/core/helpers/utils/data-bind.ts b/src/core/helpers/utils/data-bind.ts index 2caaee7a5..6cc04ab35 100644 --- a/src/core/helpers/utils/data-bind.ts +++ b/src/core/helpers/utils/data-bind.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IEventEmitter, IViewComponent, Nullable } from '../../../types'; +import type { IEventEmitter, IViewComponent, Nullable } from 'jodit/types'; import { ViewComponent } from '../../component'; import { isViewObject } from '../checker'; diff --git a/src/core/helpers/utils/get-class-name.ts b/src/core/helpers/utils/get-class-name.ts index dc055a61d..360e2a32f 100644 --- a/src/core/helpers/utils/get-class-name.ts +++ b/src/core/helpers/utils/get-class-name.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IDictionary } from '../../../types'; +import type { IDictionary } from 'jodit/types'; import { isFunction } from '../checker/is-function'; export const keepNames = new Map(); diff --git a/src/core/helpers/utils/get.ts b/src/core/helpers/utils/get.ts index 196930da1..4f3155d69 100644 --- a/src/core/helpers/utils/get.ts +++ b/src/core/helpers/utils/get.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IDictionary, Nullable } from '../../../types'; +import type { IDictionary, Nullable } from 'jodit/types'; import { isString } from '../checker/is-string'; import { isVoid } from '../checker/is-void'; diff --git a/src/core/helpers/utils/index.ts b/src/core/helpers/utils/index.ts index 45bbb0c37..5a793146d 100644 --- a/src/core/helpers/utils/index.ts +++ b/src/core/helpers/utils/index.ts @@ -8,6 +8,7 @@ * @module helpers/utils */ +export * from './assert'; export * from './mark-deprecated'; export * from './utils'; export * from './get'; diff --git a/src/core/helpers/utils/parse-query.ts b/src/core/helpers/utils/parse-query.ts index ba08ede82..f754ca441 100644 --- a/src/core/helpers/utils/parse-query.ts +++ b/src/core/helpers/utils/parse-query.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IDictionary } from '../../../types'; +import type { IDictionary } from 'jodit/types'; /** * Parse query string diff --git a/src/core/helpers/utils/set.ts b/src/core/helpers/utils/set.ts index dd289b258..b06acc76e 100644 --- a/src/core/helpers/utils/set.ts +++ b/src/core/helpers/utils/set.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { IDictionary } from '../../../types'; +import type { IDictionary } from 'jodit/types'; import { isString } from '../checker/is-string'; import { isNumeric } from '../checker/is-numeric'; import { isArray } from '../checker/is-array'; diff --git a/src/core/helpers/utils/stack.ts b/src/core/helpers/utils/stack.ts index 554248416..f5405303a 100644 --- a/src/core/helpers/utils/stack.ts +++ b/src/core/helpers/utils/stack.ts @@ -8,7 +8,7 @@ * @module helpers/utils */ -import type { CanUndef } from '../../../types'; +import type { CanUndef } from 'jodit/types'; export class LimitedStack { private stack: T[] = []; diff --git a/src/core/helpers/utils/utils.ts b/src/core/helpers/utils/utils.ts index d7354793b..786ac4a29 100644 --- a/src/core/helpers/utils/utils.ts +++ b/src/core/helpers/utils/utils.ts @@ -16,7 +16,7 @@ import type { Nullable, IJodit, RejectablePromise -} from '../../../types'; +} from 'jodit/types'; import { isFunction } from '../checker/is-function'; import { isPromise } from '../checker/is-promise'; import { get } from './get'; diff --git a/src/core/plugin/plugin-system.ts b/src/core/plugin/plugin-system.ts index ce7c5672a..7b58a0afd 100644 --- a/src/core/plugin/plugin-system.ts +++ b/src/core/plugin/plugin-system.ts @@ -18,7 +18,7 @@ import type { PluginType, CanPromise, CanUndef -} from '../../types'; +} from 'jodit/types'; import { isInitable, diff --git a/src/core/plugin/plugin.ts b/src/core/plugin/plugin.ts index 608c9b685..67600655e 100644 --- a/src/core/plugin/plugin.ts +++ b/src/core/plugin/plugin.ts @@ -10,7 +10,7 @@ * @module plugin */ -import type { IJodit, IPlugin, IViewBased } from '../../types'; +import type { IJodit, IPlugin, IViewBased } from 'jodit/types'; import { ViewComponent, STATUSES } from '../component'; import { autobind } from '../decorators'; import { isJoditObject } from '../helpers'; diff --git a/src/core/request/ajax.ts b/src/core/request/ajax.ts index 26774f4f7..4bf630ebe 100644 --- a/src/core/request/ajax.ts +++ b/src/core/request/ajax.ts @@ -18,9 +18,9 @@ import type { IAjax, RejectablePromise, IResponse -} from '../../types'; +} from 'jodit/types'; -import { Config } from '../../config'; +import { Config } from 'jodit/config'; import { error, diff --git a/src/core/request/config.ts b/src/core/request/config.ts index d4e2389f9..845c25f8d 100644 --- a/src/core/request/config.ts +++ b/src/core/request/config.ts @@ -8,10 +8,10 @@ * @module request */ -import type { AjaxOptions } from '../../types'; -import { Config } from '../../config'; +import type { AjaxOptions } from 'jodit/types'; +import { Config } from 'jodit/config'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * A set of key/value pairs that configure the Ajax request. All settings are optional diff --git a/src/core/request/response.ts b/src/core/request/response.ts index 5b3e29302..db424970c 100644 --- a/src/core/request/response.ts +++ b/src/core/request/response.ts @@ -8,7 +8,7 @@ * @module request */ -import type { IRequest, IResponse } from '../../types'; +import type { IRequest, IResponse } from 'jodit/types'; export class Response implements IResponse { readonly status: number; diff --git a/src/core/selection/select.ts b/src/core/selection/select.ts index ab4d75ba2..298259d0d 100644 --- a/src/core/selection/select.ts +++ b/src/core/selection/select.ts @@ -19,7 +19,7 @@ import type { IStyle, MarkerInfo, Nullable -} from '../../types'; +} from 'jodit/types'; import * as consts from '../constants'; diff --git a/src/core/selection/style/api/toggle/toggle-css.ts b/src/core/selection/style/api/toggle/toggle-css.ts index 6ab42ee7a..dfad5fc5b 100644 --- a/src/core/selection/style/api/toggle/toggle-css.ts +++ b/src/core/selection/style/api/toggle/toggle-css.ts @@ -4,7 +4,7 @@ * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net */ -import type { CommitMode, IJodit } from '../../../../../types'; +import type { CommitMode, IJodit } from 'jodit/types'; import type { CommitStyle } from '../../commit-style'; import { attr, @@ -13,8 +13,8 @@ import { kebabCase, normalizeCssValue, size -} from '../../../../helpers'; -import { Dom } from '../../../../dom'; +} from 'jodit/core/helpers'; +import { Dom } from 'jodit/core/dom'; import { CHANGE, UNSET, UNWRAP } from '../../commit-style'; import { getContainer } from '../../../../global'; diff --git a/src/core/selection/style/api/toggle/toggle-ordered-list.ts b/src/core/selection/style/api/toggle/toggle-ordered-list.ts index d975dd6ca..cac7d695b 100644 --- a/src/core/selection/style/api/toggle/toggle-ordered-list.ts +++ b/src/core/selection/style/api/toggle/toggle-ordered-list.ts @@ -4,9 +4,9 @@ * Copyright (c) 2013-2022 Valeriy Chupurnov. All rights reserved. https://xdsoft.net */ -import type { IJodit, CommitMode } from '../../../../../types'; +import type { IJodit, CommitMode } from 'jodit/types'; import type { CommitStyle } from '../../commit-style'; -import { Dom } from '../../../../dom'; +import { Dom } from 'jodit/core/dom'; import { extractSelectedPart } from '../extract'; import { CHANGE, INITIAL, REPLACE } from '../../commit-style'; import { toggleCSS } from './toggle-css'; diff --git a/src/core/selection/style/apply-style.ts b/src/core/selection/style/apply-style.ts index d3983eec8..42ed36a81 100644 --- a/src/core/selection/style/apply-style.ts +++ b/src/core/selection/style/apply-style.ts @@ -8,7 +8,7 @@ * @module selection */ -import type { IJodit, Nullable, CanUndef, CommitMode } from '../../../types'; +import type { IJodit, Nullable, CanUndef, CommitMode } from 'jodit/types'; import type { CommitStyle } from './commit-style'; import { normalizeNode } from '../../helpers'; import { diff --git a/src/core/selection/style/commit-style.ts b/src/core/selection/style/commit-style.ts index 09e74be19..1bb10e09f 100644 --- a/src/core/selection/style/commit-style.ts +++ b/src/core/selection/style/commit-style.ts @@ -8,7 +8,7 @@ * @module selection */ -import type { HTMLTagNames, IJodit, IStyleOptions } from '../../../types'; +import type { HTMLTagNames, IJodit, IStyleOptions } from 'jodit/types'; import { IS_BLOCK } from '../../constants'; import { ApplyStyle } from './apply-style'; diff --git a/src/core/storage/engines/local-storage-provider.ts b/src/core/storage/engines/local-storage-provider.ts index af2a739a9..129409b0a 100644 --- a/src/core/storage/engines/local-storage-provider.ts +++ b/src/core/storage/engines/local-storage-provider.ts @@ -12,7 +12,7 @@ import type { BooleanFunction, IStorage, StorageValueType -} from '../../../types'; +} from 'jodit/types'; /** * Check if user disable local storages/cookie etc. diff --git a/src/core/storage/engines/memory-storage-provider.ts b/src/core/storage/engines/memory-storage-provider.ts index 2f2808a5f..ccc0043c9 100644 --- a/src/core/storage/engines/memory-storage-provider.ts +++ b/src/core/storage/engines/memory-storage-provider.ts @@ -8,7 +8,7 @@ * @module storage/memory */ -import type { IStorage, StorageValueType } from '../../../types'; +import type { IStorage, StorageValueType } from 'jodit/types'; export class MemoryStorageProvider implements IStorage diff --git a/src/core/storage/storage.ts b/src/core/storage/storage.ts index 0a5634f82..c82c95644 100644 --- a/src/core/storage/storage.ts +++ b/src/core/storage/storage.ts @@ -10,7 +10,7 @@ * @module storage */ -import type { IStorage, StorageValueType } from '../../types'; +import type { IStorage, StorageValueType } from 'jodit/types'; import { camelCase } from '../helpers/'; import { canUsePersistentStorage, diff --git a/src/core/traits/elms.ts b/src/core/traits/elms.ts index 6fcfba9b2..d2ce32372 100644 --- a/src/core/traits/elms.ts +++ b/src/core/traits/elms.ts @@ -8,7 +8,7 @@ * @module traits */ -import type { IComponent, IContainer, IElms } from '../../types'; +import type { IComponent, IContainer, IElms } from 'jodit/types'; import { toArray } from '../helpers/array/to-array'; export abstract class Elms implements IElms { diff --git a/src/core/traits/mods.ts b/src/core/traits/mods.ts index eced08362..8bfc1e9b5 100644 --- a/src/core/traits/mods.ts +++ b/src/core/traits/mods.ts @@ -8,7 +8,7 @@ * @module traits */ -import type { IComponent, IContainer, IDictionary, IMods } from '../../types'; +import type { IComponent, IContainer, IDictionary, IMods } from 'jodit/types'; import { toArray } from '../helpers/array/to-array'; export abstract class Mods implements IMods { diff --git a/src/core/ui/element.ts b/src/core/ui/element.ts index 2b43213ab..96172bb26 100644 --- a/src/core/ui/element.ts +++ b/src/core/ui/element.ts @@ -13,7 +13,7 @@ import type { IUIElement, IViewBased, Nullable -} from '../../types'; +} from 'jodit/types'; import { ViewComponent } from '../component'; import { Dom } from '../dom'; import { Elms, Mods } from '../traits'; diff --git a/src/core/ui/form/block/block.ts b/src/core/ui/form/block/block.ts index a9480cbb0..57f0a6794 100644 --- a/src/core/ui/form/block/block.ts +++ b/src/core/ui/form/block/block.ts @@ -12,7 +12,7 @@ import './block.less'; import type { IUIElement, IViewBased } from '../../../../types'; import { UIGroup } from '../../group'; -import { attr } from '../../../helpers/utils'; +import { attr } from 'jodit/core/helpers/utils'; import { component } from '../../../decorators'; @component diff --git a/src/core/ui/form/form.ts b/src/core/ui/form/form.ts index 54a88b3f9..692250be5 100644 --- a/src/core/ui/form/form.ts +++ b/src/core/ui/form/form.ts @@ -10,10 +10,10 @@ * @module ui/form */ -import type { IDictionary, IUIForm, IUIInput, IUISelect } from '../../../types'; +import type { IDictionary, IUIForm, IUIInput, IUISelect } from 'jodit/types'; import { UIGroup } from '../group'; import { UIInput, UISelect } from './inputs'; -import { attr } from '../../helpers/utils'; +import { attr } from 'jodit/core/helpers/utils'; import { component } from '../../decorators'; @component diff --git a/src/core/ui/form/inputs/area/area.ts b/src/core/ui/form/inputs/area/area.ts index 6c1a6cf4a..a4311a536 100644 --- a/src/core/ui/form/inputs/area/area.ts +++ b/src/core/ui/form/inputs/area/area.ts @@ -10,9 +10,9 @@ import './area.less'; -import type { IUITextArea, IViewBased } from '../../../../../types'; +import type { IUITextArea, IViewBased } from 'jodit/types'; import { UIInput } from '../input/input'; -import { component } from '../../../../decorators'; +import { component } from 'jodit/core/decorators'; @component export class UITextArea extends UIInput implements IUITextArea { diff --git a/src/core/ui/form/inputs/checkbox/checkbox.ts b/src/core/ui/form/inputs/checkbox/checkbox.ts index 5f00d0f38..a80f75bc7 100644 --- a/src/core/ui/form/inputs/checkbox/checkbox.ts +++ b/src/core/ui/form/inputs/checkbox/checkbox.ts @@ -10,10 +10,10 @@ import './checkbox.less'; -import type { IViewBased, IUICheckBox } from '../../../../../types'; +import type { IViewBased, IUICheckBox } from 'jodit/types'; import { UIInput } from '../input/input'; -import { component, watch, hook } from '../../../../decorators'; -import { Dom } from '../../../../dom'; +import { component, watch, hook } from 'jodit/core/decorators'; +import { Dom } from 'jodit/core/dom'; @component export class UICheckbox extends UIInput implements IUICheckBox { diff --git a/src/core/ui/form/inputs/file/file.ts b/src/core/ui/form/inputs/file/file.ts index 6d492f305..b4f0b25f1 100644 --- a/src/core/ui/form/inputs/file/file.ts +++ b/src/core/ui/form/inputs/file/file.ts @@ -10,9 +10,9 @@ import './file.less'; -import type { IUIButton, IUIInput, IViewBased } from '../../../../../types'; +import type { IUIButton, IUIInput, IViewBased } from 'jodit/types'; import { UIInput } from '../input/input'; -import { component } from '../../../../decorators'; +import { component } from 'jodit/core/decorators'; import { UIButton } from '../../../button'; @component diff --git a/src/core/ui/form/inputs/input/input.ts b/src/core/ui/form/inputs/input/input.ts index 1760fc97e..d13a3002d 100644 --- a/src/core/ui/form/inputs/input/input.ts +++ b/src/core/ui/form/inputs/input/input.ts @@ -15,13 +15,13 @@ import type { IUIInput, IUIInputValidator, IViewBased -} from '../../../../../types'; -import { UIElement } from '../../../element'; -import { attr, toArray } from '../../../../helpers'; -import { Dom } from '../../../../dom'; -import { autobind, component, debounce, watch } from '../../../../decorators'; -import { Icon } from '../../../icon'; -import { inputValidators } from '../../validators'; +} from 'jodit/types'; +import { UIElement } from 'jodit/core/ui/element'; +import { attr, toArray } from 'jodit/core/helpers'; +import { Dom } from 'jodit/core/dom'; +import { autobind, component, debounce, watch } from 'jodit/core/decorators'; +import { Icon } from 'jodit/core/ui/icon'; +import { inputValidators } from 'jodit/core/ui/form/validators'; @component export class UIInput extends UIElement implements IUIInput { diff --git a/src/core/ui/form/inputs/select/select.ts b/src/core/ui/form/inputs/select/select.ts index 5bb41a843..ec707b0ab 100644 --- a/src/core/ui/form/inputs/select/select.ts +++ b/src/core/ui/form/inputs/select/select.ts @@ -10,9 +10,9 @@ import './select.less'; -import type { IUISelect, IViewBased } from '../../../../../types'; -import { attr } from '../../../../helpers'; -import { component } from '../../../../decorators'; +import type { IUISelect, IViewBased } from 'jodit/types'; +import { attr } from 'jodit/core/helpers'; +import { component } from 'jodit/core/decorators'; import { UIInput } from '../input/input'; import { inputValidators, selectValidators } from '../../validators'; diff --git a/src/core/ui/group/group.ts b/src/core/ui/group/group.ts index 9d7139102..bc3907683 100644 --- a/src/core/ui/group/group.ts +++ b/src/core/ui/group/group.ts @@ -17,8 +17,8 @@ import type { IUIElement, IUIGroup, IViewBased -} from '../../../types'; -import type { IDictionary } from '../../../types'; +} from 'jodit/types'; +import type { IDictionary } from 'jodit/types'; import { UIElement } from '../element'; import { component, watch } from '../../decorators'; import { isArray } from '../../helpers'; diff --git a/src/core/ui/group/list.ts b/src/core/ui/group/list.ts index 40bd457fa..542e65a95 100644 --- a/src/core/ui/group/list.ts +++ b/src/core/ui/group/list.ts @@ -19,7 +19,7 @@ import type { IViewBased, Nullable, ButtonsOption -} from '../../../types'; +} from 'jodit/types'; import { UIButton } from '../button'; import { getStrongControlTypes } from '../helpers/get-strong-control-types'; diff --git a/src/core/ui/helpers/buttons.ts b/src/core/ui/helpers/buttons.ts index 65afb0658..55454e45d 100644 --- a/src/core/ui/helpers/buttons.ts +++ b/src/core/ui/helpers/buttons.ts @@ -14,8 +14,8 @@ import type { ButtonsGroups, IControlType, IJodit -} from '../../../types'; -import { isArray } from '../../helpers/checker'; +} from 'jodit/types'; +import { isArray } from 'jodit/core/helpers/checker'; export const isButtonGroup = ( item: ButtonsGroup | string | IControlType diff --git a/src/core/ui/helpers/get-control-type.ts b/src/core/ui/helpers/get-control-type.ts index dc362039b..0367ad66b 100644 --- a/src/core/ui/helpers/get-control-type.ts +++ b/src/core/ui/helpers/get-control-type.ts @@ -14,7 +14,7 @@ import type { IControlType, IControlTypeStrong, IDictionary -} from '../../../types'; +} from 'jodit/types'; import { ConfigFlatten, isString } from '../../helpers'; import { Config } from '../../../config'; diff --git a/src/core/ui/helpers/get-strong-control-types.ts b/src/core/ui/helpers/get-strong-control-types.ts index 4c57a8246..ed302d5a1 100644 --- a/src/core/ui/helpers/get-strong-control-types.ts +++ b/src/core/ui/helpers/get-strong-control-types.ts @@ -13,10 +13,10 @@ import type { Controls, IControlTypeStrong, IDictionary -} from '../../../types'; +} from 'jodit/types'; import { getControlType } from './get-control-type'; import { Config } from '../../../config'; -import { isArray } from '../../helpers/checker'; +import { isArray } from 'jodit/core/helpers/checker'; import { ConfigProto, keys } from '../../helpers'; export function getStrongControlTypes( diff --git a/src/core/ui/icon.ts b/src/core/ui/icon.ts index a0a0bc564..1093cf0f9 100644 --- a/src/core/ui/icon.ts +++ b/src/core/ui/icon.ts @@ -13,7 +13,7 @@ import type { IDictionary, IUIIconState, IViewBased -} from '../../types'; +} from 'jodit/types'; import { css } from '../helpers'; export class Icon { diff --git a/src/core/ui/popup/popup.ts b/src/core/ui/popup/popup.ts index aaaf13535..fc4986d41 100644 --- a/src/core/ui/popup/popup.ts +++ b/src/core/ui/popup/popup.ts @@ -22,7 +22,7 @@ import type { IViewBased, Nullable, PopupStrategy -} from '../../../types'; +} from 'jodit/types'; import { Dom } from '../../dom'; import { attr, diff --git a/src/core/ui/progress-bar/progress-bar.ts b/src/core/ui/progress-bar/progress-bar.ts index cafbc6752..893d83f14 100644 --- a/src/core/ui/progress-bar/progress-bar.ts +++ b/src/core/ui/progress-bar/progress-bar.ts @@ -12,7 +12,7 @@ import './progress-bar.less'; -import type { IJodit, IProgressBar } from '../../../types'; +import type { IJodit, IProgressBar } from 'jodit/types'; import { Dom } from '../../dom'; import { UIElement } from '../element'; diff --git a/src/core/view/view-with-toolbar.ts b/src/core/view/view-with-toolbar.ts index e89809514..4f0f6b75d 100644 --- a/src/core/view/view-with-toolbar.ts +++ b/src/core/view/view-with-toolbar.ts @@ -18,11 +18,11 @@ import type { IPluginButton, IViewOptions, ButtonsGroups -} from '../../types'; +} from 'jodit/types'; import { View } from './view'; import { isString, resolveElement, splitArray } from '../helpers'; import { Dom } from '../dom'; -import { makeCollection } from '../../modules/toolbar/factory'; +import { makeCollection } from 'jodit/modules/toolbar/factory'; import { STATUSES } from '../component'; import { isButtonGroup } from '../ui/helpers/buttons'; import { autobind } from '../decorators'; diff --git a/src/core/view/view.ts b/src/core/view/view.ts index 9429f0264..246983651 100644 --- a/src/core/view/view.ts +++ b/src/core/view/view.ts @@ -21,7 +21,7 @@ import type { Nullable, IDictionary, IEventEmitter -} from '../../types'; +} from 'jodit/types'; import { Storage } from '../storage'; import { camelCase, diff --git a/src/index.ts b/src/index.ts index 3a1f9664e..6f3934f85 100644 --- a/src/index.ts +++ b/src/index.ts @@ -27,6 +27,9 @@ import * as consts from './core/constants'; import * as Modules from './modules/'; import * as Plugins from './plugins/'; import * as Icons from './styles/icons/'; +import { assert } from './core/helpers/utils/assert'; + +assert(false, 'yo'); // copy constants in Jodit Object.keys(consts).forEach((key: string) => { diff --git a/src/modules/context-menu/context-menu.less b/src/modules/context-menu/context-menu.less index 0372ac90f..0b7ec6b47 100644 --- a/src/modules/context-menu/context-menu.less +++ b/src/modules/context-menu/context-menu.less @@ -6,7 +6,7 @@ @import (reference) '../../styles/variables'; @import (reference) '../../styles/mixins'; -@import (reference) '../../core/ui/popup/popup'; +@import (reference) 'jodit/core/ui/popup/popup'; .jodit-context-menu { .jodit-popup(); diff --git a/src/modules/context-menu/context-menu.ts b/src/modules/context-menu/context-menu.ts index 97a23dc2a..facdbe387 100644 --- a/src/modules/context-menu/context-menu.ts +++ b/src/modules/context-menu/context-menu.ts @@ -12,10 +12,10 @@ import './context-menu.less'; -import type { IContextMenu, IContextMenuAction } from '../../types'; -import { Popup } from '../../core/ui/popup'; -import { Button } from '../../core/ui/button'; -import { isArray } from '../../core/helpers/checker'; +import type { IContextMenu, IContextMenuAction } from 'jodit/types'; +import { Popup } from 'jodit/core/ui/popup'; +import { Button } from 'jodit/core/ui/button'; +import { isArray } from 'jodit/core/helpers/checker'; /** * Module to generate context menu diff --git a/src/modules/dialog/alert.ts b/src/modules/dialog/alert.ts index 286e34b11..7d42b38c9 100644 --- a/src/modules/dialog/alert.ts +++ b/src/modules/dialog/alert.ts @@ -9,9 +9,9 @@ */ import { Dialog } from './dialog'; -import { asArray, isFunction } from '../../core/helpers/'; -import { Dom } from '../../core/dom'; -import { Button } from '../../core/ui'; +import { asArray, isFunction } from 'jodit/core/helpers/'; +import { Dom } from 'jodit/core/dom'; +import { Button } from 'jodit/core/ui'; /** * Show `alert` dialog. Work without Jodit object diff --git a/src/modules/dialog/confirm.ts b/src/modules/dialog/confirm.ts index 1a22ef8e3..95302290c 100644 --- a/src/modules/dialog/confirm.ts +++ b/src/modules/dialog/confirm.ts @@ -9,8 +9,8 @@ */ import { Dialog } from './dialog'; -import { isFunction } from '../../core/helpers'; -import { Button } from '../../core/ui'; +import { isFunction } from 'jodit/core/helpers'; +import { Button } from 'jodit/core/ui'; /** * Show `confirm` dialog. Work without Jodit object diff --git a/src/modules/dialog/dialog.ts b/src/modules/dialog/dialog.ts index a84418a3d..9944af4aa 100644 --- a/src/modules/dialog/dialog.ts +++ b/src/modules/dialog/dialog.ts @@ -19,9 +19,9 @@ import type { ContentItem, Content, IDialogOptions -} from '../../types/'; -import { Config } from '../../config'; -import { KEY_ESC } from '../../core/constants'; +} from 'jodit/types'; +import { Config } from 'jodit/config'; +import { KEY_ESC } from 'jodit/core/constants'; import { $$, asArray, @@ -36,16 +36,16 @@ import { isVoid, splitArray, toArray -} from '../../core/helpers/'; -import { ViewWithToolbar } from '../../core/view/view-with-toolbar'; -import { Dom } from '../../core/dom'; -import { STATUSES } from '../../core/component'; -import { eventEmitter, pluginSystem } from '../../core/global'; -import { component, autobind, hook } from '../../core/decorators'; -import { View } from '../../core/view/view'; -import { Icon } from '../../core/ui'; - -declare module '../../config' { +} from 'jodit/core/helpers/'; +import { ViewWithToolbar } from 'jodit/core/view/view-with-toolbar'; +import { Dom } from 'jodit/core/dom'; +import { STATUSES } from 'jodit/core/component'; +import { eventEmitter, pluginSystem } from 'jodit/core/global'; +import { component, autobind, hook } from 'jodit/core/decorators'; +import { View } from 'jodit/core/view/view'; +import { Icon } from 'jodit/core/ui'; + +declare module 'jodit/config' { interface Config { dialog: IDialogOptions; } diff --git a/src/modules/dialog/prompt.ts b/src/modules/dialog/prompt.ts index 696157db4..797aa74b1 100644 --- a/src/modules/dialog/prompt.ts +++ b/src/modules/dialog/prompt.ts @@ -9,8 +9,8 @@ */ import { Dialog } from './dialog'; -import { Button } from '../../core/ui'; -import { attr, isFunction } from '../../core/helpers'; +import { Button } from 'jodit/core/ui'; +import { attr, isFunction } from 'jodit/core/helpers'; /** * Show `Prompt` dialog. Work without Jodit object diff --git a/src/modules/file-browser/builders/context-menu.ts b/src/modules/file-browser/builders/context-menu.ts index 285c07499..149feadd1 100644 --- a/src/modules/file-browser/builders/context-menu.ts +++ b/src/modules/file-browser/builders/context-menu.ts @@ -8,13 +8,13 @@ * @module modules/file-browser */ -import type { IFileBrowser } from '../../../types'; +import type { IFileBrowser } from 'jodit/types'; import { Dialog } from '../../dialog'; -import { Dom } from '../../../core/dom'; -import { attr, error } from '../../../core/helpers'; +import { Dom } from 'jodit/core/dom'; +import { attr, error } from 'jodit/core/helpers'; import { makeContextMenu } from '../factories'; -import { Icon } from '../../../core/ui'; +import { Icon } from 'jodit/core/ui'; import { elementToItem, getItem } from '../listeners/native-listeners'; import { openImageEditor } from '../../image-editor/image-editor'; import { elementsMap } from './elements-map'; diff --git a/src/modules/file-browser/builders/elements-map.ts b/src/modules/file-browser/builders/elements-map.ts index b3ee2d7af..6aeec400e 100644 --- a/src/modules/file-browser/builders/elements-map.ts +++ b/src/modules/file-browser/builders/elements-map.ts @@ -8,7 +8,7 @@ * @module modules/file-browser */ -import type { IDictionary, IFileBrowserItem, IViewBased } from '../../../types'; +import type { IDictionary, IFileBrowserItem, IViewBased } from 'jodit/types'; type ElementsMap = IDictionary<{ elm: HTMLElement; diff --git a/src/modules/file-browser/builders/item.ts b/src/modules/file-browser/builders/item.ts index 2761b6dbe..ec1dca69d 100644 --- a/src/modules/file-browser/builders/item.ts +++ b/src/modules/file-browser/builders/item.ts @@ -13,8 +13,8 @@ import type { IFileBrowserItemElement, IFileBrowserItemWrapper, ISource -} from '../../../types'; -import { normalizePath, normalizeUrl } from '../../../core/helpers/'; +} from 'jodit/types'; +import { normalizePath, normalizeUrl } from 'jodit/core/helpers/'; export class FileBrowserItem implements IFileBrowserItemWrapper { source!: ISource; diff --git a/src/modules/file-browser/config.ts b/src/modules/file-browser/config.ts index ac38abee1..6c88fa32c 100644 --- a/src/modules/file-browser/config.ts +++ b/src/modules/file-browser/config.ts @@ -8,7 +8,7 @@ * @module modules/file-browser */ -import { Config } from '../../config'; +import { Config } from 'jodit/config'; import type { IFileBrowser, @@ -21,12 +21,12 @@ import type { IDictionary, IUploader, IViewBased -} from '../../types/'; +} from 'jodit/types'; -import { humanSizeToBytes, isArray, isString } from '../../core/helpers'; -import { UIFileInput } from '../../core/ui'; +import { humanSizeToBytes, isArray, isString } from 'jodit/core/helpers'; +import { UIFileInput } from 'jodit/core/ui'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { filebrowser: IFileBrowserOptions; } diff --git a/src/modules/file-browser/data-provider.ts b/src/modules/file-browser/data-provider.ts index e50ddaa8a..29247deea 100644 --- a/src/modules/file-browser/data-provider.ts +++ b/src/modules/file-browser/data-provider.ts @@ -24,7 +24,7 @@ import type { IFileBrowserItem, ISourceFile, ISourcesFiles -} from '../../types'; +} from 'jodit/types'; import { ConfigProto, @@ -32,9 +32,9 @@ import { isFunction, normalizeRelativePath, set -} from '../../core/helpers'; -import { Ajax } from '../../core/request'; -import { autobind } from '../../core/decorators'; +} from 'jodit/core/helpers'; +import { Ajax } from 'jodit/core/request'; +import { autobind } from 'jodit/core/decorators'; import { FileBrowserItem } from './builders/item'; export const DEFAULT_SOURCE_NAME = 'default'; diff --git a/src/modules/file-browser/factories.ts b/src/modules/file-browser/factories.ts index 49f1b20f2..732784e14 100644 --- a/src/modules/file-browser/factories.ts +++ b/src/modules/file-browser/factories.ts @@ -14,7 +14,7 @@ import type { IFileBrowserOptions, IUIElement, IViewBased -} from '../../types'; +} from 'jodit/types'; import DataProvider from './data-provider'; import { ContextMenu } from '../context-menu/context-menu'; diff --git a/src/modules/file-browser/fetch/delete-file.ts b/src/modules/file-browser/fetch/delete-file.ts index 91f529ee3..78278229a 100644 --- a/src/modules/file-browser/fetch/delete-file.ts +++ b/src/modules/file-browser/fetch/delete-file.ts @@ -8,7 +8,7 @@ * @module modules/file-browser */ -import type { IFileBrowser } from '../../../types'; +import type { IFileBrowser } from 'jodit/types'; /** * Removes a file from the server diff --git a/src/modules/file-browser/fetch/load-items.ts b/src/modules/file-browser/fetch/load-items.ts index 2a97deaf2..e89e4e877 100644 --- a/src/modules/file-browser/fetch/load-items.ts +++ b/src/modules/file-browser/fetch/load-items.ts @@ -8,7 +8,7 @@ * @module modules/file-browser */ -import type { IFileBrowser } from '../../../types'; +import type { IFileBrowser } from 'jodit/types'; /** * Loads a list of files and adds them to the state diff --git a/src/modules/file-browser/fetch/load-tree.ts b/src/modules/file-browser/fetch/load-tree.ts index 74a02842f..384372b7d 100644 --- a/src/modules/file-browser/fetch/load-tree.ts +++ b/src/modules/file-browser/fetch/load-tree.ts @@ -8,9 +8,9 @@ * @module modules/file-browser */ -import type { IFileBrowser } from '../../../types'; -import { error } from '../../../core/helpers/utils/error'; -import { Dom } from '../../../core/dom'; +import type { IFileBrowser } from 'jodit/types'; +import { error } from 'jodit/core/helpers/utils/error'; +import { Dom } from 'jodit/core/dom'; import { loadItems } from './load-items'; /** diff --git a/src/modules/file-browser/file-browser.ts b/src/modules/file-browser/file-browser.ts index 737879bfe..7dac6b102 100644 --- a/src/modules/file-browser/file-browser.ts +++ b/src/modules/file-browser/file-browser.ts @@ -10,8 +10,8 @@ import './styles'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; import { Dialog } from '../dialog/'; import type { @@ -30,32 +30,32 @@ import type { CanUndef, IViewOptions, IObservable -} from '../../types/'; +} from 'jodit/types'; -import { Storage } from '../../core/storage/'; +import { Storage } from 'jodit/core/storage/'; import { error, isFunction, isString, ConfigProto, trim -} from '../../core/helpers/'; -import { ViewWithToolbar } from '../../core/view/view-with-toolbar'; +} from 'jodit/core/helpers/'; +import { ViewWithToolbar } from 'jodit/core/view/view-with-toolbar'; import './config'; -import { Dom } from '../../core/dom'; +import { Dom } from 'jodit/core/dom'; import { makeDataProvider } from './factories'; import { stateListeners } from './listeners/state-listeners'; import { nativeListeners } from './listeners/native-listeners'; import { selfListeners } from './listeners/self-listeners'; import { DEFAULT_SOURCE_NAME } from './data-provider'; -import { autobind } from '../../core/decorators'; +import { autobind } from 'jodit/core/decorators'; import { FileBrowserFiles, FileBrowserTree } from './ui'; -import { ObservableObject } from '../../core/event-emitter'; +import { ObservableObject } from 'jodit/core/event-emitter'; import { loadTree } from './fetch/load-tree'; import { loadItems } from './fetch/load-items'; -import { STATUSES } from '../../core/component'; +import { STATUSES } from 'jodit/core/component'; /** * @module modules/file-browser diff --git a/src/modules/file-browser/listeners/native-listeners.ts b/src/modules/file-browser/listeners/native-listeners.ts index 45a0c3c93..decbf39a1 100644 --- a/src/modules/file-browser/listeners/native-listeners.ts +++ b/src/modules/file-browser/listeners/native-listeners.ts @@ -14,10 +14,10 @@ import type { Nullable, IDictionary, IFileBrowser -} from '../../../types'; -import { ctrlKey, attr } from '../../../core/helpers'; +} from 'jodit/types'; +import { ctrlKey, attr } from 'jodit/core/helpers'; import contextMenu from '../builders/context-menu'; -import { Dom } from '../../../core/dom'; +import { Dom } from 'jodit/core/dom'; import { elementsMap } from '../builders/elements-map'; import { loadTree } from '../fetch/load-tree'; diff --git a/src/modules/file-browser/listeners/self-listeners.ts b/src/modules/file-browser/listeners/self-listeners.ts index f4cfa5630..71a3c4f49 100644 --- a/src/modules/file-browser/listeners/self-listeners.ts +++ b/src/modules/file-browser/listeners/self-listeners.ts @@ -8,10 +8,10 @@ * @module modules/file-browser */ -import type { IDictionary, IFileBrowser } from '../../../types'; +import type { IDictionary, IFileBrowser } from 'jodit/types'; import { Confirm, Prompt } from '../../dialog'; -import { isValidName } from '../../../core/helpers/checker'; -import { normalizePath } from '../../../core/helpers'; +import { isValidName } from 'jodit/core/helpers/checker'; +import { normalizePath } from 'jodit/core/helpers'; import { DEFAULT_SOURCE_NAME } from '../data-provider'; import { openImageEditor } from '../../image-editor/image-editor'; import { loadTree } from '../fetch/load-tree'; diff --git a/src/modules/file-browser/listeners/state-listeners.ts b/src/modules/file-browser/listeners/state-listeners.ts index 63bf6c56b..a11e9eb52 100644 --- a/src/modules/file-browser/listeners/state-listeners.ts +++ b/src/modules/file-browser/listeners/state-listeners.ts @@ -8,10 +8,10 @@ * @module modules/file-browser */ -import type { IFileBrowser, IFileBrowserItem } from '../../../types'; -import { Dom } from '../../../core/dom'; -import { normalizePath } from '../../../core/helpers/normalize'; -import { Button } from '../../../core/ui'; +import type { IFileBrowser, IFileBrowserItem } from 'jodit/types'; +import { Dom } from 'jodit/core/dom'; +import { normalizePath } from 'jodit/core/helpers/normalize'; +import { Button } from 'jodit/core/ui'; import { elementsMap } from '../builders/elements-map'; import { loadTree } from '../fetch/load-tree'; diff --git a/src/modules/image-editor/image-editor.ts b/src/modules/image-editor/image-editor.ts index 8a04a3cf3..7b9fe0806 100644 --- a/src/modules/image-editor/image-editor.ts +++ b/src/modules/image-editor/image-editor.ts @@ -21,17 +21,17 @@ import type { IUIButton, IDictionary, IFileBrowserDataProvider -} from '../../types'; -import { Config } from '../../config'; -import { ViewComponent } from '../../core/component'; +} from 'jodit/types'; +import { Config } from 'jodit/config'; +import { ViewComponent } from 'jodit/core/component'; import { Alert, Dialog, Prompt } from '../dialog'; -import { $$, attr, css, refs, toArray, trim } from '../../core/helpers'; -import { Dom } from '../../core/dom'; -import { Button } from '../../core/ui/button'; +import { $$, attr, css, refs, toArray, trim } from 'jodit/core/helpers'; +import { Dom } from 'jodit/core/dom'; +import { Button } from 'jodit/core/ui/button'; import { form } from './templates/form'; -import { component, debounce, throttle, autobind } from '../../core/decorators'; +import { component, debounce, throttle, autobind } from 'jodit/core/decorators'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { imageeditor: ImageEditorOptions; } diff --git a/src/modules/image-editor/templates/form.ts b/src/modules/image-editor/templates/form.ts index b2624f686..8ab2b43a3 100644 --- a/src/modules/image-editor/templates/form.ts +++ b/src/modules/image-editor/templates/form.ts @@ -8,8 +8,8 @@ * @module modules/image-editor */ -import type { ImageEditorOptions, IViewBased } from '../../../types'; -import { Icon } from '../../../core/ui'; +import type { ImageEditorOptions, IViewBased } from 'jodit/types'; +import { Icon } from 'jodit/core/ui'; const jie = 'jodit-image-editor'; const gi = Icon.get.bind(Icon); diff --git a/src/modules/observer/command.ts b/src/modules/observer/command.ts index 7b912dab1..78695e00b 100644 --- a/src/modules/observer/command.ts +++ b/src/modules/observer/command.ts @@ -8,7 +8,7 @@ * @module modules/observer */ -import type { SnapshotType } from '../../types'; +import type { SnapshotType } from 'jodit/types'; import type { Observer } from './observer'; export class Command { diff --git a/src/modules/observer/observer.ts b/src/modules/observer/observer.ts index 9fb726657..5b28450b2 100644 --- a/src/modules/observer/observer.ts +++ b/src/modules/observer/observer.ts @@ -10,15 +10,15 @@ * @module modules/observer */ -import type { IJodit, SnapshotType, IObserver } from '../../types'; -import { Config } from '../../config'; -import { ViewComponent } from '../../core/component'; +import type { IJodit, SnapshotType, IObserver } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { ViewComponent } from 'jodit/core/component'; import { Snapshot } from './snapshot'; import { Stack } from './stack'; import { Command } from './command'; -import { debounce } from '../../core/decorators'; +import { debounce } from 'jodit/core/decorators'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { observer: { /** diff --git a/src/modules/observer/snapshot.ts b/src/modules/observer/snapshot.ts index 52be2f8e4..5777fbe1d 100644 --- a/src/modules/observer/snapshot.ts +++ b/src/modules/observer/snapshot.ts @@ -8,9 +8,9 @@ * @module modules/observer */ -import type { IJodit, ISnapshot, SnapshotType } from '../../types'; -import { ViewComponent } from '../../core/component'; -import { Dom } from '../../core/dom'; +import type { IJodit, ISnapshot, SnapshotType } from 'jodit/types'; +import { ViewComponent } from 'jodit/core/component'; +import { Dom } from 'jodit/core/dom'; // declare const isProd: boolean; /** diff --git a/src/modules/observer/stack.ts b/src/modules/observer/stack.ts index cae66374a..d978512ff 100644 --- a/src/modules/observer/stack.ts +++ b/src/modules/observer/stack.ts @@ -8,7 +8,7 @@ * @module modules/observer */ -import type { CanUndef, IStack } from '../../types'; +import type { CanUndef, IStack } from 'jodit/types'; import type { Command } from './command'; export class Stack implements IStack { diff --git a/src/modules/status-bar/status-bar.ts b/src/modules/status-bar/status-bar.ts index 10c29cca1..fea6887ab 100644 --- a/src/modules/status-bar/status-bar.ts +++ b/src/modules/status-bar/status-bar.ts @@ -12,10 +12,10 @@ import './status-bar.less'; -import type { IJodit, IStatusBar, IDictionary } from '../../types'; -import { ViewComponent, STATUSES } from '../../core/component'; -import { Dom } from '../../core/dom'; -import { Mods } from '../../core/traits'; +import type { IJodit, IStatusBar, IDictionary } from 'jodit/types'; +import { ViewComponent, STATUSES } from 'jodit/core/component'; +import { Dom } from 'jodit/core/dom'; +import { Mods } from 'jodit/core/traits'; export class StatusBar extends ViewComponent implements IStatusBar { className(): string { diff --git a/src/modules/table/table.ts b/src/modules/table/table.ts index b876b2938..74b7cf896 100644 --- a/src/modules/table/table.ts +++ b/src/modules/table/table.ts @@ -10,9 +10,9 @@ * @module modules/table */ -import type { ICreate, IDictionary, IJodit } from '../../types'; -import * as consts from '../../core/constants'; -import { Dom } from '../../core/dom'; +import type { ICreate, IDictionary, IJodit } from 'jodit/types'; +import * as consts from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; import { $$, attr, @@ -20,12 +20,12 @@ import { isNumber, toArray, trim -} from '../../core/helpers/'; -import { ViewComponent } from '../../core/component'; -import { getContainer } from '../../core/global'; -import { debounce } from '../../core/decorators'; +} from 'jodit/core/helpers/'; +import { ViewComponent } from 'jodit/core/component'; +import { getContainer } from 'jodit/core/global'; +import { debounce } from 'jodit/core/decorators'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { table: { allowCellSelection: boolean; diff --git a/src/modules/toolbar/button/button.less b/src/modules/toolbar/button/button.less index 6efa9c553..c88040507 100644 --- a/src/modules/toolbar/button/button.less +++ b/src/modules/toolbar/button/button.less @@ -6,7 +6,7 @@ @import (reference) '../../../styles/variables'; @import (reference) '../../../styles/mixins'; -@import (reference) '../../../core/ui/button/button/button'; +@import (reference) 'jodit/core/ui/button/button/button'; .trigger-size(@size) { width: @size; diff --git a/src/modules/toolbar/button/button.ts b/src/modules/toolbar/button/button.ts index c6acfae31..46a566361 100644 --- a/src/modules/toolbar/button/button.ts +++ b/src/modules/toolbar/button/button.ts @@ -21,11 +21,11 @@ import type { IToolbarCollection, IViewBased, Nullable -} from '../../../types'; -import { UIButton, UIButtonState } from '../../../core/ui/button'; -import { component, watch } from '../../../core/decorators'; -import { Dom } from '../../../core/dom'; -import { Popup } from '../../../core/ui/popup/'; +} from 'jodit/types'; +import { UIButton, UIButtonState } from 'jodit/core/ui/button'; +import { component, watch } from 'jodit/core/decorators'; +import { Dom } from 'jodit/core/dom'; +import { Popup } from 'jodit/core/ui/popup/'; import { makeCollection } from '../factory'; import { isFunction, @@ -37,11 +37,11 @@ import { call, isArray, keys -} from '../../../core/helpers/'; -import { Icon } from '../../../core/ui'; -import { ToolbarCollection } from '../../../modules/toolbar/collection/collection'; -import { STATUSES } from '../../../core/component'; -import { findControlType } from '../../../core/ui/helpers/get-control-type'; +} from 'jodit/core/helpers/'; +import { Icon } from 'jodit/core/ui'; +import { ToolbarCollection } from 'jodit/modules/toolbar/collection/collection'; +import { STATUSES } from 'jodit/core/component'; +import { findControlType } from 'jodit/core/ui/helpers/get-control-type'; @component export class ToolbarButton diff --git a/src/modules/toolbar/button/content.less b/src/modules/toolbar/button/content.less index 59f4ee935..7841b700b 100644 --- a/src/modules/toolbar/button/content.less +++ b/src/modules/toolbar/button/content.less @@ -6,7 +6,7 @@ @import (reference) '../../../styles/variables'; @import (reference) '../../../styles/mixins'; -@import (reference) '../../../core/ui/button/button/button'; +@import (reference) 'jodit/core/ui/button/button/button'; .jodit-toolbar-content { .jodit-ui-button(); diff --git a/src/modules/toolbar/button/content.ts b/src/modules/toolbar/button/content.ts index 859cffd3e..330a07f31 100644 --- a/src/modules/toolbar/button/content.ts +++ b/src/modules/toolbar/button/content.ts @@ -15,11 +15,11 @@ import type { IToolbarButton, IViewBased, Nullable -} from '../../../types'; -import { UIButton } from '../../../core/ui/button'; -import { Dom } from '../../../core/dom'; -import { isString, attr } from '../../../core/helpers'; -import { component } from '../../../core/decorators'; +} from 'jodit/types'; +import { UIButton } from 'jodit/core/ui/button'; +import { Dom } from 'jodit/core/dom'; +import { isString, attr } from 'jodit/core/helpers'; +import { component } from 'jodit/core/decorators'; @component export class ToolbarContent diff --git a/src/modules/toolbar/collection/collection.less b/src/modules/toolbar/collection/collection.less index 3cd4615e5..a9f070f47 100644 --- a/src/modules/toolbar/collection/collection.less +++ b/src/modules/toolbar/collection/collection.less @@ -5,7 +5,7 @@ */ @import (reference) '../../../styles/variables'; -@import (reference) '../../../core/ui/group/list'; +@import (reference) 'jodit/core/ui/group/list'; .gradient(@icon-size) { --button-icon-size: @icon-size; diff --git a/src/modules/toolbar/collection/collection.ts b/src/modules/toolbar/collection/collection.ts index 0ffb9ff94..3f50a3bf0 100644 --- a/src/modules/toolbar/collection/collection.ts +++ b/src/modules/toolbar/collection/collection.ts @@ -25,11 +25,11 @@ import type { IBound } from '../../../types/'; -import { error, isFunction } from '../../../core/helpers/'; +import { error, isFunction } from 'jodit/core/helpers/'; -import { UIList } from '../../../core/ui'; +import { UIList } from 'jodit/core/ui'; import { makeButton } from '../factory'; -import { component, autobind } from '../../../core/decorators'; +import { component, autobind } from 'jodit/core/decorators'; @component export class ToolbarCollection diff --git a/src/modules/toolbar/collection/editor-collection.ts b/src/modules/toolbar/collection/editor-collection.ts index 9b6c71e46..4d5e4cc77 100644 --- a/src/modules/toolbar/collection/editor-collection.ts +++ b/src/modules/toolbar/collection/editor-collection.ts @@ -9,17 +9,17 @@ */ import { ToolbarCollection } from './collection'; -import * as consts from '../../../core/constants'; -import { Dom } from '../../../core/dom'; +import * as consts from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; import type { IDictionary, IToolbarButton, IViewBased, IJodit, IBound -} from '../../../types'; -import { css, isFunction, isJoditObject } from '../../../core/helpers'; -import { component } from '../../../core/decorators'; +} from 'jodit/types'; +import { css, isFunction, isJoditObject } from 'jodit/core/helpers'; +import { component } from 'jodit/core/decorators'; @component export class ToolbarEditorCollection extends ToolbarCollection { diff --git a/src/modules/toolbar/factory.ts b/src/modules/toolbar/factory.ts index a1640c6c3..623feeb01 100644 --- a/src/modules/toolbar/factory.ts +++ b/src/modules/toolbar/factory.ts @@ -18,8 +18,8 @@ import type { IUIElement, IViewBased, Nullable -} from '../../types'; -import { isFunction, isJoditObject } from '../../core/helpers'; +} from 'jodit/types'; +import { isFunction, isJoditObject } from 'jodit/core/helpers'; import { ToolbarCollection } from './collection/collection'; import { ToolbarEditorCollection } from './collection/editor-collection'; import { ToolbarButton } from './button/button'; diff --git a/src/modules/uploader/uploader.ts b/src/modules/uploader/uploader.ts index 0a47a60a2..6aa32a256 100644 --- a/src/modules/uploader/uploader.ts +++ b/src/modules/uploader/uploader.ts @@ -25,10 +25,10 @@ import type { IUploaderOptions, IViewBased, Nullable -} from '../../types'; -import { Config } from '../../config'; -import { IS_IE, TEXT_PLAIN } from '../../core/constants'; -import { Ajax } from '../../core/request'; +} from 'jodit/types'; +import { Config } from 'jodit/config'; +import { IS_IE, TEXT_PLAIN } from 'jodit/core/constants'; +import { Ajax } from 'jodit/core/request'; import { attr, error, @@ -39,12 +39,12 @@ import { toArray, isString, ConfigProto -} from '../../core/helpers'; -import { Dom } from '../../core/dom'; -import { ViewComponent, STATUSES } from '../../core/component/'; -import { getContainer } from '../../core/global'; +} from 'jodit/core/helpers'; +import { Dom } from 'jodit/core/dom'; +import { ViewComponent, STATUSES } from 'jodit/core/component/'; +import { getContainer } from 'jodit/core/global'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * Enable drag and drop file editor diff --git a/src/modules/widget/color-picker/color-picker.ts b/src/modules/widget/color-picker/color-picker.ts index 06a204d59..fa9d9fd71 100644 --- a/src/modules/widget/color-picker/color-picker.ts +++ b/src/modules/widget/color-picker/color-picker.ts @@ -12,7 +12,7 @@ import './color-picker.less'; -import type { IDictionary, IJodit } from '../../../types'; +import type { IDictionary, IJodit } from 'jodit/types'; import { normalizeColor, hasBrowserColorPicker, @@ -21,9 +21,9 @@ import { isFunction, isArray, refs -} from '../../../core/helpers/'; -import { Icon } from '../../../core/ui'; -import { Dom } from '../../../core/dom'; +} from 'jodit/core/helpers/'; +import { Icon } from 'jodit/core/ui'; +import { Dom } from 'jodit/core/dom'; /** * Build color picker diff --git a/src/modules/widget/file-selector/file-selector.ts b/src/modules/widget/file-selector/file-selector.ts index 31c490813..73054f796 100644 --- a/src/modules/widget/file-selector/file-selector.ts +++ b/src/modules/widget/file-selector/file-selector.ts @@ -14,11 +14,11 @@ import type { IFileBrowserCallBackData, IJodit, IUploaderData -} from '../../../types'; -import { isFunction, $$, attr, val } from '../../../core/helpers'; -import { Dom } from '../../../core/dom'; +} from 'jodit/types'; +import { isFunction, $$, attr, val } from 'jodit/core/helpers'; +import { Dom } from 'jodit/core/dom'; import { TabOption, TabsWidget } from '../tabs/tabs'; -import { UIBlock, UIForm, UIInput, UIButton } from '../../../core/ui'; +import { UIBlock, UIForm, UIInput, UIButton } from 'jodit/core/ui'; interface ImageSelectorCallbacks { /** diff --git a/src/modules/widget/tabs/tabs.ts b/src/modules/widget/tabs/tabs.ts index 8f45f6207..f51df49a1 100644 --- a/src/modules/widget/tabs/tabs.ts +++ b/src/modules/widget/tabs/tabs.ts @@ -12,9 +12,9 @@ import './tabs.less'; -import type { IDictionary, IJodit, IUIButton } from '../../../types'; -import { $$, isFunction } from '../../../core/helpers'; -import { Button, UIElement } from '../../../core/ui'; +import type { IDictionary, IJodit, IUIButton } from 'jodit/types'; +import { $$, isFunction } from 'jodit/core/helpers'; +import { Button, UIElement } from 'jodit/core/ui'; export interface TabOption { icon?: string; diff --git a/src/plugins/about/about.ts b/src/plugins/about/about.ts index 1353d24d3..a7a8bb633 100644 --- a/src/plugins/about/about.ts +++ b/src/plugins/about/about.ts @@ -10,11 +10,11 @@ import './about.less'; -import type { IControlType, IJodit } from '../../types'; -import { Config } from '../../config'; -import { css, isLicense, normalizeLicense } from '../../core/helpers/'; -import * as constants from '../../core/constants'; -import { Dialog } from '../../modules/dialog'; +import type { IControlType, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { css, isLicense, normalizeLicense } from 'jodit/core/helpers/'; +import * as constants from 'jodit/core/constants'; +import { Dialog } from 'jodit/modules/dialog'; Config.prototype.controls.about = { exec: (editor: IJodit) => { diff --git a/src/plugins/add-new-line/add-new-line.ts b/src/plugins/add-new-line/add-new-line.ts index 6a2eed4ab..12ce23679 100644 --- a/src/plugins/add-new-line/add-new-line.ts +++ b/src/plugins/add-new-line/add-new-line.ts @@ -12,17 +12,17 @@ import './add-new-line.less'; -import type { IBound, IJodit, HTMLTagNames, Nullable } from '../../types'; -import { Config } from '../../config'; -import { Dom, Icon, Plugin } from '../../modules'; +import type { IBound, IJodit, HTMLTagNames, Nullable } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom, Icon, Plugin } from 'jodit/modules'; import { offset, position, call, scrollIntoViewIfNeeded -} from '../../core/helpers'; +} from 'jodit/core/helpers'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * Create helper diff --git a/src/plugins/bold/bold.ts b/src/plugins/bold/bold.ts index 907120973..0799ff040 100644 --- a/src/plugins/bold/bold.ts +++ b/src/plugins/bold/bold.ts @@ -8,9 +8,9 @@ * @module plugins/bold */ -import type { IDictionary, IJodit, IControlType } from '../../types'; -import { Config } from '../../config'; -import { isArray } from '../../core/helpers'; +import type { IDictionary, IJodit, IControlType } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { isArray } from 'jodit/core/helpers'; Config.prototype.controls.subscript = { tags: ['sub'], diff --git a/src/plugins/class-span/class-span.ts b/src/plugins/class-span/class-span.ts index 303f61586..f29825efe 100644 --- a/src/plugins/class-span/class-span.ts +++ b/src/plugins/class-span/class-span.ts @@ -8,11 +8,11 @@ * @module plugins/class-span */ -import type { IControlType, IJodit } from '../../types'; -import { Plugin } from '../../core/plugin'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; -import { memorizeExec } from '../../core/helpers'; +import type { IControlType, IJodit } from 'jodit/types'; +import { Plugin } from 'jodit/core/plugin'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; +import { memorizeExec } from 'jodit/core/helpers'; Config.prototype.controls.classSpan = { command: 'applyClassName', diff --git a/src/plugins/clipboard/clipboard.ts b/src/plugins/clipboard/clipboard.ts index 8a7b6da2a..3169f287b 100644 --- a/src/plugins/clipboard/clipboard.ts +++ b/src/plugins/clipboard/clipboard.ts @@ -8,10 +8,10 @@ * @module plugins/clipboard */ -import type { IJodit, IPlugin } from '../../types'; -import type { Plugin } from '../../core/plugin'; -import { TEXT_HTML, TEXT_PLAIN } from '../../core/constants'; -import { stripTags } from '../../core/helpers'; +import type { IJodit, IPlugin } from 'jodit/types'; +import type { Plugin } from 'jodit/core/plugin'; +import { TEXT_HTML, TEXT_PLAIN } from 'jodit/core/constants'; +import { stripTags } from 'jodit/core/helpers'; import { getDataTransfer } from './paste/helpers'; export const pluginKey = 'clipboard'; diff --git a/src/plugins/clipboard/config.ts b/src/plugins/clipboard/config.ts index 2bac8fd6b..6788ad238 100644 --- a/src/plugins/clipboard/config.ts +++ b/src/plugins/clipboard/config.ts @@ -8,16 +8,16 @@ * @module plugins/clipboard */ -import type { IControlType, IJodit } from '../../types'; -import { Config } from '../../config'; +import type { IControlType, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; import { INSERT_AS_HTML, INSERT_CLEAR_HTML, INSERT_ONLY_TEXT, INSERT_AS_TEXT, TEXT_PLAIN -} from '../../core/constants'; -import { Alert } from '../../modules/dialog'; +} from 'jodit/core/constants'; +import { Alert } from 'jodit/modules/dialog'; import { pasteInsertHtml } from './paste/helpers'; import { pluginKey as clipboardPluginKey } from './clipboard'; @@ -29,7 +29,7 @@ export type InsertMode = | typeof INSERT_ONLY_TEXT | typeof INSERT_AS_TEXT; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * Ask before paste HTML in WYSIWYG mode diff --git a/src/plugins/clipboard/copy-format.ts b/src/plugins/clipboard/copy-format.ts index 9fd20518b..99832bb39 100644 --- a/src/plugins/clipboard/copy-format.ts +++ b/src/plugins/clipboard/copy-format.ts @@ -8,10 +8,10 @@ * @module plugins/clipboard */ -import type { IDictionary, IJodit, IControlType } from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; -import { css } from '../../core/helpers/'; +import type { IDictionary, IJodit, IControlType } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; +import { css } from 'jodit/core/helpers/'; const pluginKey = 'copyformat'; diff --git a/src/plugins/clipboard/drag-and-drop-element.ts b/src/plugins/clipboard/drag-and-drop-element.ts index d8eedd9e4..b4066109b 100644 --- a/src/plugins/clipboard/drag-and-drop-element.ts +++ b/src/plugins/clipboard/drag-and-drop-element.ts @@ -8,12 +8,12 @@ * @module plugins/clipboard */ -import type { IViewComponent, Nullable } from '../../types'; -import { css, ctrlKey, dataBind, splitArray } from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; -import { Dom } from '../../core/dom'; -import { getContainer } from '../../core/global'; -import { autobind, throttle } from '../../core/decorators'; +import type { IViewComponent, Nullable } from 'jodit/types'; +import { css, ctrlKey, dataBind, splitArray } from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import { Dom } from 'jodit/core/dom'; +import { getContainer } from 'jodit/core/global'; +import { autobind, throttle } from 'jodit/core/decorators'; /** * Process drag and drop image or another element inside the editor diff --git a/src/plugins/clipboard/drag-and-drop.ts b/src/plugins/clipboard/drag-and-drop.ts index d6385c4f9..4ebd07ea0 100644 --- a/src/plugins/clipboard/drag-and-drop.ts +++ b/src/plugins/clipboard/drag-and-drop.ts @@ -12,14 +12,14 @@ * TODO: need remove `drag-and-drop-element` plugin and use full custom moving inside this plugin. */ -import type { IPoint, IViewComponent } from '../../types'; -import { TEXT_HTML, TEXT_PLAIN } from '../../core/constants'; -import { Dom } from '../../core/dom'; -import { attr, ctrlKey, dataBind } from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; +import type { IPoint, IViewComponent } from 'jodit/types'; +import { TEXT_HTML, TEXT_PLAIN } from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; +import { attr, ctrlKey, dataBind } from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; import { getDataTransfer } from './paste/helpers'; -import { autobind, throttle } from '../../core/decorators'; -import { isFileBrowserFilesItem } from '../../modules/file-browser'; +import { autobind, throttle } from 'jodit/core/decorators'; +import { isFileBrowserFilesItem } from 'jodit/modules/file-browser'; /** * Process drag and drop image from FileBrowser and movev image inside the editor diff --git a/src/plugins/clipboard/paste-storage/paste-storage.ts b/src/plugins/clipboard/paste-storage/paste-storage.ts index 097a5538a..e77d3a851 100644 --- a/src/plugins/clipboard/paste-storage/paste-storage.ts +++ b/src/plugins/clipboard/paste-storage/paste-storage.ts @@ -15,12 +15,12 @@ import { KEY_ENTER, KEY_UP, SPACE_REG_EXP -} from '../../../core/constants'; -import { Dialog } from '../../../modules/dialog'; -import { Plugin } from '../../../core/plugin'; -import { Dom } from '../../../core/dom'; -import { attr, toArray } from '../../../core/helpers'; -import { Button } from '../../../core/ui'; +} from 'jodit/core/constants'; +import { Dialog } from 'jodit/modules/dialog'; +import { Plugin } from 'jodit/core/plugin'; +import { Dom } from 'jodit/core/dom'; +import { attr, toArray } from 'jodit/core/helpers'; +import { Button } from 'jodit/core/ui'; /** * Show dialog choose content to paste diff --git a/src/plugins/clipboard/paste/helpers.ts b/src/plugins/clipboard/paste/helpers.ts index 3d02afd5e..931ff5e64 100644 --- a/src/plugins/clipboard/paste/helpers.ts +++ b/src/plugins/clipboard/paste/helpers.ts @@ -8,11 +8,11 @@ * @module plugins/clipboard/paste */ -import type { IJodit, Nullable } from '../../../types'; +import type { IJodit, Nullable } from 'jodit/types'; import type { PasteEvent } from '../config'; -import { isArray, isNumber, isString, isVoid } from '../../../core/helpers'; -import { Dom } from '../../../core/dom'; -import { TEXT_PLAIN } from '../../../core/constants'; +import { isArray, isNumber, isString, isVoid } from 'jodit/core/helpers'; +import { Dom } from 'jodit/core/dom'; +import { TEXT_PLAIN } from 'jodit/core/constants'; /** * Get DataTransfer from different event types diff --git a/src/plugins/clipboard/paste/paste.ts b/src/plugins/clipboard/paste/paste.ts index 18963a2cc..770410597 100644 --- a/src/plugins/clipboard/paste/paste.ts +++ b/src/plugins/clipboard/paste/paste.ts @@ -11,8 +11,8 @@ */ import type { InsertMode, PasteEvent } from '../config'; -import type { IJodit } from '../../../types'; -import { Plugin } from '../../../core/plugin'; +import type { IJodit } from 'jodit/types'; +import { Plugin } from 'jodit/core/plugin'; import { getAllTypes, getDataTransfer, pasteInsertHtml } from './helpers'; import { @@ -22,7 +22,7 @@ import { INSERT_ONLY_TEXT, TEXT_HTML, TEXT_PLAIN -} from '../../../core/constants'; +} from 'jodit/core/constants'; import { isHTML, @@ -36,13 +36,13 @@ import { markOwner, nl2br, stripTags -} from '../../../core/helpers'; +} from 'jodit/core/helpers'; import { pluginKey as clipboardPluginKey } from '../clipboard'; -import { Dom } from '../../../core/dom'; -import { Confirm, Dialog } from '../../../modules/dialog'; -import { Button } from '../../../core/ui/button'; -import { autobind } from '../../../core/decorators'; +import { Dom } from 'jodit/core/dom'; +import { Confirm, Dialog } from 'jodit/modules/dialog'; +import { Button } from 'jodit/core/ui/button'; +import { autobind } from 'jodit/core/decorators'; type PastedValue = { html: string | Node; diff --git a/src/plugins/color/color.ts b/src/plugins/color/color.ts index 3b38c8ad5..5b192844d 100644 --- a/src/plugins/color/color.ts +++ b/src/plugins/color/color.ts @@ -8,11 +8,11 @@ * @module plugins/color */ -import type { IJodit, IControlType } from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../modules/'; -import { css, dataBind, normalizeColor } from '../../core/helpers/'; -import { ColorPickerWidget, TabOption, TabsWidget } from '../../modules/widget'; +import type { IJodit, IControlType } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/modules/'; +import { css, dataBind, normalizeColor } from 'jodit/core/helpers/'; +import { ColorPickerWidget, TabOption, TabsWidget } from 'jodit/modules/widget'; Config.prototype.controls.brush = { update(button): void { diff --git a/src/plugins/error-messages/error-messages.ts b/src/plugins/error-messages/error-messages.ts index f4b599c80..c181deae5 100644 --- a/src/plugins/error-messages/error-messages.ts +++ b/src/plugins/error-messages/error-messages.ts @@ -10,12 +10,12 @@ import './errors-messages.less'; -import type { IJodit } from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; -import { css, toArray } from '../../core/helpers'; +import type { IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; +import { css, toArray } from 'jodit/core/helpers'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { showMessageErrors: boolean; diff --git a/src/plugins/fix/clean-html.ts b/src/plugins/fix/clean-html.ts index f66b89744..3c8de752d 100644 --- a/src/plugins/fix/clean-html.ts +++ b/src/plugins/fix/clean-html.ts @@ -14,20 +14,20 @@ import type { IJodit, Nullable, IPlugin -} from '../../types'; -import { Config } from '../../config'; +} from 'jodit/types'; +import { Config } from 'jodit/config'; import { INVISIBLE_SPACE_REG_EXP as INV_REG, IS_INLINE, INSEPARABLE_TAGS -} from '../../core/constants'; +} from 'jodit/core/constants'; import { Dom } from '../../modules'; -import { attr, isString, keys, safeHTML, trim } from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; -import { watch, autobind, debounce } from '../../core/decorators'; +import { attr, isString, keys, safeHTML, trim } from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import { watch, autobind, debounce } from 'jodit/core/decorators'; import { findNotEmptySibling } from '../keyboard/helpers'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { cleanHTML: { timeout: number; diff --git a/src/plugins/fix/wrap-text-nodes.ts b/src/plugins/fix/wrap-text-nodes.ts index 56b78f7b2..8dd266f16 100644 --- a/src/plugins/fix/wrap-text-nodes.ts +++ b/src/plugins/fix/wrap-text-nodes.ts @@ -8,11 +8,11 @@ * @module plugins/fix */ -import type { IJodit, Nullable } from '../../types'; -import { Plugin } from '../../core/plugin'; -import { Dom } from '../../core/dom'; -import { isString } from '../../core/helpers/checker'; -import { autobind } from '../../core/decorators'; +import type { IJodit, Nullable } from 'jodit/types'; +import { Plugin } from 'jodit/core/plugin'; +import { Dom } from 'jodit/core/dom'; +import { isString } from 'jodit/core/helpers/checker'; +import { autobind } from 'jodit/core/decorators'; /** * Wrap single text nodes in block wrapper diff --git a/src/plugins/focus/focus.ts b/src/plugins/focus/focus.ts index d401db9a2..322117cce 100644 --- a/src/plugins/focus/focus.ts +++ b/src/plugins/focus/focus.ts @@ -10,11 +10,11 @@ * @module plugins/focus */ -import type { IJodit } from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; +import type { IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { autofocus: boolean; cursorAfterAutofocus: 'start' | 'end'; diff --git a/src/plugins/font/font.ts b/src/plugins/font/font.ts index 992b6a507..7309cced0 100644 --- a/src/plugins/font/font.ts +++ b/src/plugins/font/font.ts @@ -8,12 +8,12 @@ * @module plugins/font */ -import type { IControlType, IJodit } from '../../types/'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; -import { css, memorizeExec, normalizeSize } from '../../core/helpers/'; +import type { IControlType, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; +import { css, memorizeExec, normalizeSize } from 'jodit/core/helpers/'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { defaultFontSizePoints: 'px' | 'pt'; } diff --git a/src/plugins/format-block/format-block.ts b/src/plugins/format-block/format-block.ts index 6d50c1191..19ec6a5a4 100644 --- a/src/plugins/format-block/format-block.ts +++ b/src/plugins/format-block/format-block.ts @@ -15,10 +15,10 @@ import type { IJodit, IControlType, IDictionary -} from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../modules/'; -import { memorizeExec } from '../../core/helpers'; +} from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/modules/'; +import { memorizeExec } from 'jodit/core/helpers'; Config.prototype.controls.paragraph = { command: 'formatBlock', diff --git a/src/plugins/fullsize/fullsize.ts b/src/plugins/fullsize/fullsize.ts index 86675efbc..41b247da2 100644 --- a/src/plugins/fullsize/fullsize.ts +++ b/src/plugins/fullsize/fullsize.ts @@ -10,12 +10,12 @@ import './fullsize.less'; -import type { IViewWithToolbar, IControlType, IViewBased } from '../../types'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; -import { css, isJoditObject } from '../../core/helpers'; +import type { IViewWithToolbar, IControlType, IViewBased } from 'jodit/types'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; +import { css, isJoditObject } from 'jodit/core/helpers'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * Open WYSIWYG in full screen diff --git a/src/plugins/iframe/iframe.ts b/src/plugins/iframe/iframe.ts index a0b851fa4..c3ee613c0 100644 --- a/src/plugins/iframe/iframe.ts +++ b/src/plugins/iframe/iframe.ts @@ -8,13 +8,13 @@ * @module plugins/iframe */ -import type { IJodit } from '../../types'; -import { Config } from '../../config'; -import { css, defaultLanguage, attr, callPromise } from '../../core/helpers/'; -import { error } from '../../core/helpers'; -import { MODE_SOURCE } from '../../core/constants'; +import type { IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { css, defaultLanguage, attr, callPromise } from 'jodit/core/helpers/'; +import { error } from 'jodit/core/helpers'; +import { MODE_SOURCE } from 'jodit/core/constants'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { editHTMLDocumentMode: boolean; iframeDefaultSrc: string; diff --git a/src/plugins/image/helpers.ts b/src/plugins/image/helpers.ts index 7b7f8bfff..ce285f391 100644 --- a/src/plugins/image/helpers.ts +++ b/src/plugins/image/helpers.ts @@ -8,7 +8,7 @@ * @module plugins/image */ -import { clearCenterAlign, css } from '../../core/helpers'; +import { clearCenterAlign, css } from 'jodit/core/helpers'; /** * Align image diff --git a/src/plugins/image/image-processor.ts b/src/plugins/image/image-processor.ts index 6c17f6b78..cb0057789 100644 --- a/src/plugins/image/image-processor.ts +++ b/src/plugins/image/image-processor.ts @@ -8,8 +8,8 @@ * @module plugins/image */ -import type { IJodit } from '../../types'; -import { $$ } from '../../core/helpers'; +import type { IJodit } from 'jodit/types'; +import { $$ } from 'jodit/core/helpers'; const JODIT_IMAGE_PROCESSOR_BINDED = '__jodit_imageprocessor_binded'; diff --git a/src/plugins/image/image-properties/image-properties.ts b/src/plugins/image/image-properties/image-properties.ts index 8a362dff6..78bc02015 100644 --- a/src/plugins/image/image-properties/image-properties.ts +++ b/src/plugins/image/image-properties/image-properties.ts @@ -15,7 +15,7 @@ import type { IFileBrowserCallBackData, IJodit, IUploaderData -} from '../../../types'; +} from 'jodit/types'; import { Config } from '../../../config'; import { @@ -39,12 +39,12 @@ import { refs, kebabCase, isNumeric -} from '../../../core/helpers'; -import { FileSelectorWidget, TabsWidget } from '../../../modules/widget'; -import { Button } from '../../../core/ui/button'; +} from 'jodit/core/helpers'; +import { FileSelectorWidget, TabsWidget } from 'jodit/modules/widget'; +import { Button } from 'jodit/core/ui/button'; import { form, mainTab, positionTab } from './templates/'; -import { watch, autobind } from '../../../core/decorators'; -import { openImageEditor } from '../../../modules/image-editor/image-editor'; +import { watch, autobind } from 'jodit/core/decorators'; +import { openImageEditor } from 'jodit/modules/image-editor/image-editor'; import { hAlignElement } from '../helpers'; /** diff --git a/src/plugins/image/image.ts b/src/plugins/image/image.ts index d277d61c8..63f699e57 100644 --- a/src/plugins/image/image.ts +++ b/src/plugins/image/image.ts @@ -12,11 +12,11 @@ import type { IControlType, IFileBrowserCallBackData, IJodit -} from '../../types'; -import { Dom } from '../../core/dom'; -import { $$ } from '../../core/helpers'; -import { FileSelectorWidget } from '../../modules/widget'; -import { Config } from '../../config'; +} from 'jodit/types'; +import { Dom } from 'jodit/core/dom'; +import { $$ } from 'jodit/core/helpers'; +import { FileSelectorWidget } from 'jodit/modules/widget'; +import { Config } from 'jodit/config'; Config.prototype.controls.image = { popup: (editor: IJodit, current, self, close) => { diff --git a/src/plugins/indent/indent.ts b/src/plugins/indent/indent.ts index 5d8a9e849..7fabef679 100644 --- a/src/plugins/indent/indent.ts +++ b/src/plugins/indent/indent.ts @@ -8,11 +8,11 @@ * @module plugins/indent */ -import type { IControlType, IJodit } from '../../types/'; -import { Config } from '../../config'; -import { BR, PARAGRAPH } from '../../core/constants'; -import { Dom } from '../../core/dom'; -import { attr } from '../../core/helpers'; +import type { IControlType, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { BR, PARAGRAPH } from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; +import { attr } from 'jodit/core/helpers'; Config.prototype.controls.indent = { tooltip: 'Increase Indent' @@ -50,7 +50,7 @@ Config.prototype.controls.outdent = { tooltip: 'Decrease Indent' } as IControlType; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * The number of pixels to use for indenting the current line. diff --git a/src/plugins/inline-popup/config/config.ts b/src/plugins/inline-popup/config/config.ts index 1a887c550..a37513d45 100644 --- a/src/plugins/inline-popup/config/config.ts +++ b/src/plugins/inline-popup/config/config.ts @@ -8,7 +8,7 @@ * @module plugins/inline-popup */ -import type { IControlType, IDictionary, IJodit } from '../../../types'; +import type { IControlType, IDictionary, IJodit } from 'jodit/types'; import { Config } from '../../../config'; declare module '../../../config' { diff --git a/src/plugins/inline-popup/inline-popup.ts b/src/plugins/inline-popup/inline-popup.ts index 2ba289b27..1381da6a5 100644 --- a/src/plugins/inline-popup/inline-popup.ts +++ b/src/plugins/inline-popup/inline-popup.ts @@ -20,10 +20,10 @@ import type { IToolbarCollection, IViewComponent, Nullable -} from '../../types'; -import { Plugin } from '../../core/plugin'; -import { makeCollection } from '../../modules/toolbar/factory'; -import { Popup } from '../../core/ui/popup'; +} from 'jodit/types'; +import { Plugin } from 'jodit/core/plugin'; +import { makeCollection } from 'jodit/modules/toolbar/factory'; +import { Popup } from 'jodit/core/ui/popup'; import { splitArray, isString, @@ -33,9 +33,9 @@ import { toArray, keys, camelCase -} from '../../core/helpers'; +} from 'jodit/core/helpers'; import { Dom, Table, ToolbarCollection, UIElement } from '../../modules'; -import { debounce, wait, autobind, watch } from '../../core/decorators'; +import { debounce, wait, autobind, watch } from 'jodit/core/decorators'; /** * Plugin for show inline popup dialog diff --git a/src/plugins/insert/hr.ts b/src/plugins/insert/hr.ts index 52ee3025c..ecaca812b 100644 --- a/src/plugins/insert/hr.ts +++ b/src/plugins/insert/hr.ts @@ -8,9 +8,9 @@ * @module plugins/insert */ -import type { IControlType, IJodit } from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; +import type { IControlType, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; Config.prototype.controls.hr = { command: 'insertHorizontalRule', diff --git a/src/plugins/justify/justify.ts b/src/plugins/justify/justify.ts index 23beeb188..73279e019 100644 --- a/src/plugins/justify/justify.ts +++ b/src/plugins/justify/justify.ts @@ -8,10 +8,10 @@ * @module plugins/justify */ -import type { IJodit, IControlType } from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../modules/'; -import { css } from '../../core/helpers/'; +import type { IJodit, IControlType } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/modules/'; +import { css } from 'jodit/core/helpers/'; Config.prototype.controls.align = { name: 'left', diff --git a/src/plugins/keyboard/backspace/backspace.ts b/src/plugins/keyboard/backspace/backspace.ts index 1f1f28877..038c27950 100644 --- a/src/plugins/keyboard/backspace/backspace.ts +++ b/src/plugins/keyboard/backspace/backspace.ts @@ -8,11 +8,11 @@ * @module plugins/keyboard/backspace */ -import { Plugin } from '../../../core/plugin'; -import type { IJodit } from '../../../types'; -import { Dom } from '../../../core/dom'; -import { INVISIBLE_SPACE } from '../../../core/constants'; -import { isFunction, trim } from '../../../core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import type { IJodit } from 'jodit/types'; +import { Dom } from 'jodit/core/dom'; +import { INVISIBLE_SPACE } from 'jodit/core/constants'; +import { isFunction, trim } from 'jodit/core/helpers'; import { normalizeCursorPosition } from '../helpers'; import { cases } from './cases'; import type { DeleteMode } from './interface'; diff --git a/src/plugins/keyboard/enter.ts b/src/plugins/keyboard/enter.ts index 6e85e44e6..1506e11f8 100644 --- a/src/plugins/keyboard/enter.ts +++ b/src/plugins/keyboard/enter.ts @@ -8,12 +8,12 @@ * @module plugins/keyboard */ -import type { HTMLTagNames, IJodit, Nullable } from '../../types'; -import * as consts from '../../core/constants'; -import { Dom } from '../../core/dom'; -import { $$, scrollIntoViewIfNeeded } from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; -import { INVISIBLE_SPACE } from '../../core/constants'; +import type { HTMLTagNames, IJodit, Nullable } from 'jodit/types'; +import * as consts from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; +import { $$, scrollIntoViewIfNeeded } from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import { INVISIBLE_SPACE } from 'jodit/core/constants'; /** * Insert default paragraph diff --git a/src/plugins/keyboard/helpers.ts b/src/plugins/keyboard/helpers.ts index a2e047930..f1cf3635d 100644 --- a/src/plugins/keyboard/helpers.ts +++ b/src/plugins/keyboard/helpers.ts @@ -8,11 +8,11 @@ * @module plugins/keyboard */ -import type { IJodit, Nullable } from '../../types'; -import { call } from '../../core/helpers/utils'; -import { Dom } from '../../core/dom'; -import { INSEPARABLE_TAGS } from '../../core/constants'; -import { trim } from '../../core/helpers/string'; +import type { IJodit, Nullable } from 'jodit/types'; +import { call } from 'jodit/core/helpers/utils'; +import { Dom } from 'jodit/core/dom'; +import { INSEPARABLE_TAGS } from 'jodit/core/constants'; +import { trim } from 'jodit/core/helpers/string'; export function getSibling(node: Node, backspace: boolean): Nullable { return backspace ? node.previousSibling : node.nextSibling; diff --git a/src/plugins/keyboard/hotkeys.ts b/src/plugins/keyboard/hotkeys.ts index 589a9f96d..aab572a3f 100644 --- a/src/plugins/keyboard/hotkeys.ts +++ b/src/plugins/keyboard/hotkeys.ts @@ -8,18 +8,18 @@ * @module plugins/keyboard */ -import type { IDictionary, IJodit } from '../../types'; -import { Config } from '../../config'; -import { Plugin } from '../../core/plugin'; +import type { IDictionary, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Plugin } from 'jodit/core/plugin'; import { isArray, isString, keys, normalizeKeyAliases -} from '../../core/helpers'; -import { KEY_ESC } from '../../core/constants'; +} from 'jodit/core/helpers'; +import { KEY_ESC } from 'jodit/core/constants'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { commandToHotkeys: IDictionary; } diff --git a/src/plugins/keyboard/key-arrow-outside.ts b/src/plugins/keyboard/key-arrow-outside.ts index b5788f885..9f7bc7aa3 100644 --- a/src/plugins/keyboard/key-arrow-outside.ts +++ b/src/plugins/keyboard/key-arrow-outside.ts @@ -8,11 +8,11 @@ * @module plugins/keyboard */ -import type { IJodit } from '../../types'; -import { Plugin } from '../../core/plugin'; -import { watch } from '../../core/decorators'; -import { KEY_RIGHT, NBSP_SPACE } from '../../core/constants'; -import { Dom } from '../../core/dom'; +import type { IJodit } from 'jodit/types'; +import { Plugin } from 'jodit/core/plugin'; +import { watch } from 'jodit/core/decorators'; +import { KEY_RIGHT, NBSP_SPACE } from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; import { findNotEmptyNeighbor } from './helpers'; /** diff --git a/src/plugins/limit/limit.ts b/src/plugins/limit/limit.ts index 86ae7e60a..3c6a22b86 100644 --- a/src/plugins/limit/limit.ts +++ b/src/plugins/limit/limit.ts @@ -8,18 +8,18 @@ * @module plugins/limit */ -import type { IJodit, SnapshotType } from '../../types'; -import { Config } from '../../config'; -import { Plugin } from '../../core/plugin'; +import type { IJodit, SnapshotType } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Plugin } from 'jodit/core/plugin'; import { COMMAND_KEYS, INVISIBLE_SPACE_REG_EXP, SPACE_REG_EXP -} from '../../core/constants'; -import { stripTags } from '../../core/helpers'; -import { autobind } from '../../core/decorators'; +} from 'jodit/core/constants'; +import { stripTags } from 'jodit/core/helpers'; +import { autobind } from 'jodit/core/decorators'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * limit words count diff --git a/src/plugins/link/link.ts b/src/plugins/link/link.ts index 8e84f38e9..235aa84e9 100644 --- a/src/plugins/link/link.ts +++ b/src/plugins/link/link.ts @@ -15,9 +15,9 @@ import type { IUIForm, IUIOption, Nullable -} from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; +} from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; import { attr, convertMediaUrlToVideoEmbed, @@ -25,13 +25,13 @@ import { isURL, refs, stripTags -} from '../../core/helpers'; +} from 'jodit/core/helpers'; import { formTemplate } from './template'; -import { Plugin } from '../../core/plugin'; -import { autobind } from '../../core/decorators'; +import { Plugin } from 'jodit/core/plugin'; +import { autobind } from 'jodit/core/decorators'; import { Dialog, UIForm } from '../../modules'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { link: { /** diff --git a/src/plugins/link/template.ts b/src/plugins/link/template.ts index 9485ed805..aec687279 100644 --- a/src/plugins/link/template.ts +++ b/src/plugins/link/template.ts @@ -8,15 +8,15 @@ * @module plugins/link */ -import type { IJodit, IUIForm } from '../../types'; +import type { IJodit, IUIForm } from 'jodit/types'; import { UIBlock, UICheckbox, UIForm, UIInput, UISelect -} from '../../core/ui/form'; -import { UIButton } from '../../core/ui/button'; +} from 'jodit/core/ui/form'; +import { UIButton } from 'jodit/core/ui/button'; export const formTemplate = (editor: IJodit): IUIForm => { const { diff --git a/src/plugins/media/file.ts b/src/plugins/media/file.ts index 05c2f28fe..bdd66d242 100644 --- a/src/plugins/media/file.ts +++ b/src/plugins/media/file.ts @@ -12,10 +12,10 @@ import type { IControlType, IFileBrowserCallBackData, IJodit -} from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; -import { FileSelectorWidget } from '../../modules/widget'; +} from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; +import { FileSelectorWidget } from 'jodit/modules/widget'; Config.prototype.controls.file = { popup: ( diff --git a/src/plugins/media/media.ts b/src/plugins/media/media.ts index 11ae5d6c4..d07c9443c 100644 --- a/src/plugins/media/media.ts +++ b/src/plugins/media/media.ts @@ -8,12 +8,12 @@ * @module plugins/media */ -import type { IJodit } from '../../types'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; -import { $$, attr, dataBind } from '../../core/helpers/'; +import type { IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; +import { $$, attr, dataBind } from 'jodit/core/helpers/'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * Decorate media elements diff --git a/src/plugins/media/video/config.ts b/src/plugins/media/video/config.ts index 1cc96994e..de052b803 100644 --- a/src/plugins/media/video/config.ts +++ b/src/plugins/media/video/config.ts @@ -8,12 +8,12 @@ * @module plugins/media/video */ -import type { IControlType, IJodit, IUIForm } from '../../../types'; +import type { IControlType, IJodit, IUIForm } from 'jodit/types'; import { Config } from '../../../config'; -import { TabOption, TabsWidget } from '../../../modules/widget'; -import { convertMediaUrlToVideoEmbed } from '../../../core/helpers'; -import { UIForm, UIInput, UITextArea, UIBlock } from '../../../core/ui/form'; -import { Button } from '../../../core/ui/button'; +import { TabOption, TabsWidget } from 'jodit/modules/widget'; +import { convertMediaUrlToVideoEmbed } from 'jodit/core/helpers'; +import { UIForm, UIInput, UITextArea, UIBlock } from 'jodit/core/ui/form'; +import { Button } from 'jodit/core/ui/button'; Config.prototype.controls.video = { popup: (editor: IJodit, current, control, close) => { diff --git a/src/plugins/media/video/index.ts b/src/plugins/media/video/index.ts index c666e0299..6e4730803 100644 --- a/src/plugins/media/video/index.ts +++ b/src/plugins/media/video/index.ts @@ -8,7 +8,7 @@ * @module plugins/media/video */ -import type { IJodit } from '../../../types'; +import type { IJodit } from 'jodit/types'; import './config'; export function video(editor: IJodit): void { diff --git a/src/plugins/mobile/mobile.ts b/src/plugins/mobile/mobile.ts index 70c4d6282..254eec3f7 100644 --- a/src/plugins/mobile/mobile.ts +++ b/src/plugins/mobile/mobile.ts @@ -14,15 +14,15 @@ import type { IJodit, CanUndef, ButtonsGroups -} from '../../types/'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; -import { splitArray, toArray } from '../../core/helpers/'; -import { makeCollection } from '../../modules/toolbar/factory'; -import { UIList } from '../../core/ui'; -import { flatButtonsSet } from '../../core/ui/helpers/buttons'; - -declare module '../../config' { +} from 'jodit/types'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; +import { splitArray, toArray } from 'jodit/core/helpers/'; +import { makeCollection } from 'jodit/modules/toolbar/factory'; +import { UIList } from 'jodit/core/ui'; +import { flatButtonsSet } from 'jodit/core/ui/helpers/buttons'; + +declare module 'jodit/config' { interface Config { /** * Mobile timeout for CLICK emulation diff --git a/src/plugins/ordered-list/ordered-list.ts b/src/plugins/ordered-list/ordered-list.ts index e21193d54..832f42f24 100644 --- a/src/plugins/ordered-list/ordered-list.ts +++ b/src/plugins/ordered-list/ordered-list.ts @@ -8,12 +8,12 @@ * @module plugins/ordered-list */ -import type { IControlType, IJodit, Nullable } from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; -import { dataBind, toArray } from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; -import { autobind } from '../../core/decorators'; +import type { IControlType, IJodit, Nullable } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; +import { dataBind, toArray } from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import { autobind } from 'jodit/core/decorators'; const exec: IControlType['exec'] = (jodit, _, { control }): void => { const key = `button${control.command}`; diff --git a/src/plugins/placeholder/placeholder.ts b/src/plugins/placeholder/placeholder.ts index 805cf3048..a00913306 100644 --- a/src/plugins/placeholder/placeholder.ts +++ b/src/plugins/placeholder/placeholder.ts @@ -10,19 +10,19 @@ import './placeholder.less'; -import type { IJodit } from '../../types'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; -import { css, attr } from '../../core/helpers'; -import { Dom } from '../../core/dom'; -import { Plugin } from '../../core/plugin'; -import { MAY_BE_REMOVED_WITH_KEY } from '../../core/constants'; -import { debounce } from '../../core/decorators'; +import type { IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; +import { css, attr } from 'jodit/core/helpers'; +import { Dom } from 'jodit/core/dom'; +import { Plugin } from 'jodit/core/plugin'; +import { MAY_BE_REMOVED_WITH_KEY } from 'jodit/core/constants'; +import { debounce } from 'jodit/core/decorators'; /** * Show placeholder */ -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * Show placeholder diff --git a/src/plugins/powered-by-jodit/powered-by-jodit.ts b/src/plugins/powered-by-jodit/powered-by-jodit.ts index 5fe418655..96c62d8fc 100644 --- a/src/plugins/powered-by-jodit/powered-by-jodit.ts +++ b/src/plugins/powered-by-jodit/powered-by-jodit.ts @@ -8,9 +8,9 @@ * @module plugins/powered-by-jodit */ -import type { IJodit } from '../../types'; +import type { IJodit } from 'jodit/types'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * Hide the link to the Jodit site at the bottom of the editor diff --git a/src/plugins/print/preview.ts b/src/plugins/print/preview.ts index 065244174..548a6a7ef 100644 --- a/src/plugins/print/preview.ts +++ b/src/plugins/print/preview.ts @@ -8,10 +8,10 @@ * @module plugins/print */ -import type { IControlType, IDialog, IJodit } from '../../types'; -import { Config } from '../../config'; -import { attr, css } from '../../core/helpers'; -import * as consts from '../../core/constants'; +import type { IControlType, IDialog, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { attr, css } from 'jodit/core/helpers'; +import * as consts from 'jodit/core/constants'; Config.prototype.controls.preview = { icon: 'eye', diff --git a/src/plugins/print/print.ts b/src/plugins/print/print.ts index 3e9352387..b39bd2c22 100644 --- a/src/plugins/print/print.ts +++ b/src/plugins/print/print.ts @@ -8,12 +8,12 @@ * @module plugins/print */ -import type { IControlType, IJodit } from '../../types'; -import { Config } from '../../config'; -import { getContainer } from '../../core/global'; -import { Dom } from '../../core/dom'; -import { defaultLanguage } from '../../core/helpers'; -import * as consts from '../../core/constants'; +import type { IControlType, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { getContainer } from 'jodit/core/global'; +import { Dom } from 'jodit/core/dom'; +import { defaultLanguage } from 'jodit/core/helpers'; +import * as consts from 'jodit/core/constants'; Config.prototype.controls.print = { exec: (editor: IJodit) => { diff --git a/src/plugins/redo-undo/redo-undo.ts b/src/plugins/redo-undo/redo-undo.ts index de8490e71..3983ec007 100644 --- a/src/plugins/redo-undo/redo-undo.ts +++ b/src/plugins/redo-undo/redo-undo.ts @@ -8,10 +8,10 @@ * @module plugins/redo-undo */ -import type { IControlType, IJodit, IPlugin } from '../../types/'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; -import { Plugin } from '../../core/plugin'; +import type { IControlType, IJodit, IPlugin } from 'jodit/types'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; +import { Plugin } from 'jodit/core/plugin'; Config.prototype.controls.redo = { mode: consts.MODE_SPLIT, diff --git a/src/plugins/resizer/resizer.ts b/src/plugins/resizer/resizer.ts index 40b8373be..20a65bc94 100644 --- a/src/plugins/resizer/resizer.ts +++ b/src/plugins/resizer/resizer.ts @@ -10,12 +10,12 @@ import './resizer.less'; -import type { HTMLTagNames, IBound, Nullable } from '../../types'; -import type { IJodit } from '../../types'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; -import { IS_IE } from '../../core/constants'; -import { Dom } from '../../core/dom'; +import type { HTMLTagNames, IBound, Nullable } from 'jodit/types'; +import type { IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; +import { IS_IE } from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; import { $$, attr, @@ -23,16 +23,16 @@ import { offset, innerWidth, markOwner -} from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; -import { eventEmitter } from '../../core/global'; -import { autobind, debounce, watch } from '../../core/decorators'; +} from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import { eventEmitter } from 'jodit/core/global'; +import { autobind, debounce, watch } from 'jodit/core/decorators'; /** * The module creates a supporting frame for resizing of the elements img and table */ -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * Use true frame for editing iframe size diff --git a/src/plugins/search/search.ts b/src/plugins/search/search.ts index bc8ac9a29..414baf055 100644 --- a/src/plugins/search/search.ts +++ b/src/plugins/search/search.ts @@ -17,17 +17,17 @@ import type { Nullable, IControlType, IPlugin -} from '../../types'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; -import { MODE_WYSIWYG } from '../../core/constants'; -import { Dom } from '../../core/dom'; -import { Plugin } from '../../core/plugin'; -import { Icon } from '../../core/ui'; -import { css, position, refs, trim } from '../../core/helpers'; -import { autobind } from '../../core/decorators'; - -declare module '../../config' { +} from 'jodit/types'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; +import { MODE_WYSIWYG } from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; +import { Plugin } from 'jodit/core/plugin'; +import { Icon } from 'jodit/core/ui'; +import { css, position, refs, trim } from 'jodit/core/helpers'; +import { autobind } from 'jodit/core/decorators'; + +declare module 'jodit/config' { interface Config { /** * Enable custom search plugin diff --git a/src/plugins/select/select.ts b/src/plugins/select/select.ts index b32455d07..48cb5c97e 100644 --- a/src/plugins/select/select.ts +++ b/src/plugins/select/select.ts @@ -8,12 +8,12 @@ * @module plugins/select */ -import type { IJodit, Nullable } from '../../types'; -import { Plugin } from '../../core/plugin'; -import { autobind, watch } from '../../core/decorators'; -import { camelCase } from '../../core/helpers'; -import { Dom } from '../../core/dom'; -import { Popup, UIElement } from '../../core/ui'; +import type { IJodit, Nullable } from 'jodit/types'; +import { Plugin } from 'jodit/core/plugin'; +import { autobind, watch } from 'jodit/core/decorators'; +import { camelCase } from 'jodit/core/helpers'; +import { Dom } from 'jodit/core/dom'; +import { Popup, UIElement } from 'jodit/core/ui'; /* eslint-disable tsdoc/syntax */ diff --git a/src/plugins/size/config.ts b/src/plugins/size/config.ts index 7e5c2f0e1..21dfda212 100644 --- a/src/plugins/size/config.ts +++ b/src/plugins/size/config.ts @@ -8,9 +8,9 @@ * @module plugins/size */ -import { Config } from '../../config'; +import { Config } from 'jodit/config'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { allowResizeX: boolean; allowResizeY: boolean; diff --git a/src/plugins/size/resize-handler.ts b/src/plugins/size/resize-handler.ts index c9ac582f8..042d9ed9b 100644 --- a/src/plugins/size/resize-handler.ts +++ b/src/plugins/size/resize-handler.ts @@ -8,11 +8,11 @@ * @module plugins/size */ -import type { IJodit, IPointBound } from '../../types'; -import { Plugin } from '../../core/plugin'; -import { Dom } from '../../core/dom'; -import { autobind } from '../../core/decorators'; -import { Icon } from '../../core/ui'; +import type { IJodit, IPointBound } from 'jodit/types'; +import { Plugin } from 'jodit/core/plugin'; +import { Dom } from 'jodit/core/dom'; +import { autobind } from 'jodit/core/decorators'; +import { Icon } from 'jodit/core/ui'; @autobind export class resizeHandler extends Plugin { diff --git a/src/plugins/size/size.ts b/src/plugins/size/size.ts index 6bb7804dc..1638ecdf5 100644 --- a/src/plugins/size/size.ts +++ b/src/plugins/size/size.ts @@ -10,10 +10,10 @@ import './size.less'; -import type { IJodit } from '../../types'; -import { css, isNumber } from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; -import { autobind } from '../../core/decorators'; +import type { IJodit } from 'jodit/types'; +import { css, isNumber } from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import { autobind } from 'jodit/core/decorators'; /** * Calculate sizes for editor workspace and handle setHeight and setWidth events diff --git a/src/plugins/source/config.ts b/src/plugins/source/config.ts index 8d83621d8..05c9cecd4 100644 --- a/src/plugins/source/config.ts +++ b/src/plugins/source/config.ts @@ -8,12 +8,12 @@ * @module plugins/source */ -import type { IControlType, IJodit, ISourceEditor } from '../../types'; -import { Config } from '../../config'; -import * as consts from '../../core/constants'; -import { IS_IE } from '../../core/constants'; +import type { IControlType, IJodit, ISourceEditor } from 'jodit/types'; +import { Config } from 'jodit/config'; +import * as consts from 'jodit/core/constants'; +import { IS_IE } from 'jodit/core/constants'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { sourceEditor: 'area' | 'ace' | ((jodit: IJodit) => ISourceEditor); diff --git a/src/plugins/source/editor/factory.ts b/src/plugins/source/editor/factory.ts index 2851c80cd..b19132310 100644 --- a/src/plugins/source/editor/factory.ts +++ b/src/plugins/source/editor/factory.ts @@ -8,9 +8,9 @@ * @module plugins/source */ -import type { CallbackFunction, IJodit, ISourceEditor } from '../../../types'; +import type { CallbackFunction, IJodit, ISourceEditor } from 'jodit/types'; import { AceEditor, TextAreaEditor } from './engines'; -import { isFunction } from '../../../core/helpers'; +import { isFunction } from 'jodit/core/helpers'; export function createSourceEditor( type: 'ace' | 'mirror' | 'area' | ((jodit: IJodit) => ISourceEditor), diff --git a/src/plugins/source/editor/sourceEditor.ts b/src/plugins/source/editor/sourceEditor.ts index 6db521cbd..1e850ec93 100644 --- a/src/plugins/source/editor/sourceEditor.ts +++ b/src/plugins/source/editor/sourceEditor.ts @@ -8,7 +8,7 @@ * @module plugins/source */ -import type { CallbackFunction, IJodit } from '../../../types'; +import type { CallbackFunction, IJodit } from 'jodit/types'; export abstract class SourceEditor { instance!: T; diff --git a/src/plugins/source/source.ts b/src/plugins/source/source.ts index ecb25f706..4f07ec17f 100644 --- a/src/plugins/source/source.ts +++ b/src/plugins/source/source.ts @@ -10,14 +10,14 @@ import './source.less'; -import type { IJodit, ISourceEditor } from '../../types'; -import * as consts from '../../core/constants'; -import { INVISIBLE_SPACE, MODE_SOURCE, MODE_SPLIT } from '../../core/constants'; -import { Plugin } from '../../core/plugin'; -import { Dom } from '../../core/dom'; -import { isString, loadNext } from '../../core/helpers'; +import type { IJodit, ISourceEditor } from 'jodit/types'; +import * as consts from 'jodit/core/constants'; +import { INVISIBLE_SPACE, MODE_SOURCE, MODE_SPLIT } from 'jodit/core/constants'; +import { Plugin } from 'jodit/core/plugin'; +import { Dom } from 'jodit/core/dom'; +import { isString, loadNext } from 'jodit/core/helpers'; import { createSourceEditor } from './editor/factory'; -import { autobind, watch } from '../../core/decorators'; +import { autobind, watch } from 'jodit/core/decorators'; import { SOURCE_CONSUMER } from './const'; /** diff --git a/src/plugins/stat/stat.ts b/src/plugins/stat/stat.ts index a23bd3d89..bb08c66d2 100644 --- a/src/plugins/stat/stat.ts +++ b/src/plugins/stat/stat.ts @@ -8,13 +8,13 @@ * @module plugins/stat */ -import type { Nullable } from '../../types'; -import { Config } from '../../config'; -import { INVISIBLE_SPACE_REG_EXP, SPACE_REG_EXP } from '../../core/constants'; -import { Plugin } from '../../core/plugin'; -import { Dom } from '../../core/dom'; +import type { Nullable } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { INVISIBLE_SPACE_REG_EXP, SPACE_REG_EXP } from 'jodit/core/constants'; +import { Plugin } from 'jodit/core/plugin'; +import { Dom } from 'jodit/core/dom'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { showCharsCounter: boolean; countHTMLChars: boolean; diff --git a/src/plugins/sticky/sticky.ts b/src/plugins/sticky/sticky.ts index 8f571d9ce..67e3ce83e 100644 --- a/src/plugins/sticky/sticky.ts +++ b/src/plugins/sticky/sticky.ts @@ -10,14 +10,14 @@ import './sticky.less'; -import type { IBound, IJodit } from '../../types'; -import { Config } from '../../config'; -import { IS_IE, MODE_WYSIWYG } from '../../core/constants'; +import type { IBound, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { IS_IE, MODE_WYSIWYG } from 'jodit/core/constants'; import { Plugin, Dom } from '../../modules'; -import { css, offset } from '../../core/helpers'; -import { throttle } from '../../core/decorators'; +import { css, offset } from 'jodit/core/helpers'; +import { throttle } from 'jodit/core/decorators'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { /** * @example diff --git a/src/plugins/symbols/config.ts b/src/plugins/symbols/config.ts index e5f4e66b7..d0943379b 100644 --- a/src/plugins/symbols/config.ts +++ b/src/plugins/symbols/config.ts @@ -8,11 +8,11 @@ * @module plugins/symbols */ -import type { IControlType, IJodit } from '../../types'; -import { Config } from '../../config'; -import { Alert } from '../../modules/dialog'; +import type { IControlType, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Alert } from 'jodit/modules/dialog'; -declare module '../../config' { +declare module 'jodit/config' { interface Config { specialCharacters: string[]; usePopupForSpecialCharacters: boolean; diff --git a/src/plugins/symbols/symbols.ts b/src/plugins/symbols/symbols.ts index 53ed53b7d..8278a91c1 100644 --- a/src/plugins/symbols/symbols.ts +++ b/src/plugins/symbols/symbols.ts @@ -12,16 +12,16 @@ import './symbols.less'; import './config'; -import type { IJodit } from '../../types'; +import type { IJodit } from 'jodit/types'; import { KEY_DOWN, KEY_ENTER, KEY_LEFT, KEY_RIGHT, KEY_UP -} from '../../core/constants'; +} from 'jodit/core/constants'; import { Dom, Plugin } from '../../modules'; -import { attr } from '../../core/helpers/utils'; +import { attr } from 'jodit/core/helpers/utils'; /** * The plugin inserts characters that are not part of the standard keyboard. diff --git a/src/plugins/table/config.ts b/src/plugins/table/config.ts index 09745cc2d..cdf198350 100644 --- a/src/plugins/table/config.ts +++ b/src/plugins/table/config.ts @@ -8,11 +8,11 @@ * @module plugins/table */ -import type { IControlType, IDictionary, IJodit } from '../../types'; -import { Config } from '../../config'; -import { Dom } from '../../core/dom'; -import { attr } from '../../core/helpers/utils'; -import { $$, css, scrollIntoViewIfNeeded } from '../../core/helpers'; +import type { IControlType, IDictionary, IJodit } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { Dom } from 'jodit/core/dom'; +import { attr } from 'jodit/core/helpers/utils'; +import { $$, css, scrollIntoViewIfNeeded } from 'jodit/core/helpers'; Config.prototype.table = { allowCellSelection: true, diff --git a/src/plugins/table/resize-cells.ts b/src/plugins/table/resize-cells.ts index 3d1332a84..1f084ec42 100644 --- a/src/plugins/table/resize-cells.ts +++ b/src/plugins/table/resize-cells.ts @@ -10,8 +10,8 @@ import './table.less'; -import type { IBound, IJodit } from '../../types'; -import * as consts from '../../core/constants'; +import type { IBound, IJodit } from 'jodit/types'; +import * as consts from 'jodit/core/constants'; import { Plugin, Dom, Table } from '../../modules'; import { $$, @@ -19,8 +19,8 @@ import { dataBind, getContentWidth, offset -} from '../../core/helpers'; -import { autobind } from '../../core/decorators'; +} from 'jodit/core/helpers'; +import { autobind } from 'jodit/core/decorators'; const key = 'table_processor_observer-resize'; diff --git a/src/plugins/table/select-cells.ts b/src/plugins/table/select-cells.ts index 4c677c4a0..e15d5afb7 100644 --- a/src/plugins/table/select-cells.ts +++ b/src/plugins/table/select-cells.ts @@ -8,13 +8,13 @@ * @module plugins/table */ -import type { IBound, IJodit, Nullable } from '../../types'; -import { Plugin } from '../../core/plugin'; +import type { IBound, IJodit, Nullable } from 'jodit/types'; +import { Plugin } from 'jodit/core/plugin'; import { Dom, Table } from '../../modules'; -import { $$, position } from '../../core/helpers'; +import { $$, position } from 'jodit/core/helpers'; import { alignElement } from '../justify/justify'; -import { KEY_TAB } from '../../core/constants'; -import { autobind, watch } from '../../core/decorators'; +import { KEY_TAB } from 'jodit/core/constants'; +import { autobind, watch } from 'jodit/core/decorators'; const key = 'table_processor_observer'; const MOUSE_MOVE_LABEL = 'onMoveTableSelectCell'; diff --git a/src/plugins/table/table-keyboard-navigation.ts b/src/plugins/table/table-keyboard-navigation.ts index 09002a56e..cfc7a8ab4 100644 --- a/src/plugins/table/table-keyboard-navigation.ts +++ b/src/plugins/table/table-keyboard-navigation.ts @@ -8,9 +8,9 @@ * @module plugins/table */ -import type { IJodit } from '../../types'; -import * as consts from '../../core/constants'; -import { Dom } from '../../core/dom'; +import type { IJodit } from 'jodit/types'; +import * as consts from 'jodit/core/constants'; +import { Dom } from 'jodit/core/dom'; import { Table } from '../../modules'; /** diff --git a/src/plugins/table/table.ts b/src/plugins/table/table.ts index 242f0f5da..38498e553 100644 --- a/src/plugins/table/table.ts +++ b/src/plugins/table/table.ts @@ -8,7 +8,7 @@ * @module plugins/table */ -import type { IJodit } from '../../types'; +import type { IJodit } from 'jodit/types'; export function table(editor: IJodit): void { editor.registerButton({ diff --git a/src/plugins/tooltip/tooltip.ts b/src/plugins/tooltip/tooltip.ts index 4b0df3f79..1d6d1e9b3 100644 --- a/src/plugins/tooltip/tooltip.ts +++ b/src/plugins/tooltip/tooltip.ts @@ -10,12 +10,12 @@ import './tooltip.less'; -import type { IJodit, IPoint } from '../../types'; -import { css } from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; -import { Dom } from '../../core/dom'; -import { getContainer } from '../../core/global'; -import { autobind } from '../../core/decorators'; +import type { IJodit, IPoint } from 'jodit/types'; +import { css } from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import { Dom } from 'jodit/core/dom'; +import { getContainer } from 'jodit/core/global'; +import { autobind } from 'jodit/core/decorators'; export class tooltip extends Plugin { private isOpened = false; diff --git a/src/plugins/xpath/xpath.ts b/src/plugins/xpath/xpath.ts index 08c31434c..81458dd3f 100644 --- a/src/plugins/xpath/xpath.ts +++ b/src/plugins/xpath/xpath.ts @@ -10,16 +10,16 @@ import './xpath.less'; -import type { IControlTypeStrong, IToolbarButton } from '../../types'; -import { Config } from '../../config'; -import { INVISIBLE_SPACE, MODE_WYSIWYG } from '../../core/constants'; -import { ContextMenu } from '../../modules/context-menu/context-menu'; -import { Dom } from '../../core/dom'; -import { getXPathByElement, trim, attr } from '../../core/helpers'; -import { Plugin } from '../../core/plugin'; -import { makeButton } from '../../modules/toolbar/factory'; - -declare module '../../config' { +import type { IControlTypeStrong, IToolbarButton } from 'jodit/types'; +import { Config } from 'jodit/config'; +import { INVISIBLE_SPACE, MODE_WYSIWYG } from 'jodit/core/constants'; +import { ContextMenu } from 'jodit/modules/context-menu/context-menu'; +import { Dom } from 'jodit/core/dom'; +import { getXPathByElement, trim, attr } from 'jodit/core/helpers'; +import { Plugin } from 'jodit/core/plugin'; +import { makeButton } from 'jodit/modules/toolbar/factory'; + +declare module 'jodit/config' { interface Config { showXPathInStatusbar: boolean; } diff --git a/src/polyfills.ts b/src/polyfills.ts index 966f7d953..f0d365b9e 100644 --- a/src/polyfills.ts +++ b/src/polyfills.ts @@ -5,6 +5,7 @@ */ import type { IDictionary } from './types'; + import 'classlist-polyfill'; import 'es6-promise/auto'; diff --git a/tsconfig.json b/tsconfig.json index 6ab6504e1..a7e252837 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -31,8 +31,13 @@ "importHelpers": true, - "lib": ["es5", "esnext", "dom", "scripthost", "es2015.iterable"] - }, + "lib": ["es5", "esnext", "dom", "scripthost", "es2015.iterable"], + + "baseUrl": ".", + "paths": { + "jodit/*": ["./src/*"] + } + }, "include": [ "./src/types/" ],