jodit 4.8.9 → 4.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/es2015/jodit.css +1663 -1663
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +14 -14
  5. package/es2015/jodit.js +496 -381
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +14 -14
  8. package/es2015/plugins/debug/debug.css +1 -1
  9. package/es2015/plugins/debug/debug.js +1 -1
  10. package/es2015/plugins/debug/debug.min.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  13. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +25 -25
  16. package/es2018/jodit.min.css +1 -1
  17. package/es2018/jodit.min.js +14 -14
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  20. package/es2021/jodit.css +1663 -1663
  21. package/es2021/jodit.fat.min.css +1 -1
  22. package/es2021/jodit.fat.min.js +19 -19
  23. package/es2021/jodit.js +496 -381
  24. package/es2021/jodit.min.css +1 -1
  25. package/es2021/jodit.min.js +19 -19
  26. package/es2021/plugins/debug/debug.css +1 -1
  27. package/es2021/plugins/debug/debug.js +1 -1
  28. package/es2021/plugins/debug/debug.min.js +1 -1
  29. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  30. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  31. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  32. package/es2021.en/jodit.css +1663 -1663
  33. package/es2021.en/jodit.fat.min.css +1 -1
  34. package/es2021.en/jodit.fat.min.js +19 -19
  35. package/es2021.en/jodit.js +496 -381
  36. package/es2021.en/jodit.min.css +1 -1
  37. package/es2021.en/jodit.min.js +29 -29
  38. package/es2021.en/plugins/debug/debug.css +1 -1
  39. package/es2021.en/plugins/debug/debug.js +1 -1
  40. package/es2021.en/plugins/debug/debug.min.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  42. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  44. package/es5/jodit.css +2009 -2009
  45. package/es5/jodit.fat.min.css +1 -1
  46. package/es5/jodit.fat.min.js +2 -2
  47. package/es5/jodit.js +506 -390
  48. package/es5/jodit.min.css +3 -3
  49. package/es5/jodit.min.js +2 -2
  50. package/es5/plugins/debug/debug.css +1 -1
  51. package/es5/plugins/debug/debug.js +1 -1
  52. package/es5/plugins/debug/debug.min.js +1 -1
  53. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  56. package/es5/polyfills.fat.min.js +1 -1
  57. package/es5/polyfills.js +1 -1
  58. package/es5/polyfills.min.js +1 -1
  59. package/esm/core/constants.js +1 -1
  60. package/esm/core/decorators/component/component.d.ts +4 -3
  61. package/esm/core/decorators/component/component.js +11 -0
  62. package/esm/core/decorators/watch/watch.d.ts +1 -2
  63. package/esm/core/decorators/watch/watch.js +1 -8
  64. package/esm/core/dom/dom.d.ts +5 -0
  65. package/esm/core/dom/dom.js +24 -5
  66. package/esm/core/dom/lazy-walker.js +1 -1
  67. package/esm/core/event-emitter/global.d.ts +2 -0
  68. package/esm/core/event-emitter/global.js +2 -0
  69. package/esm/core/event-emitter/observable.js +1 -1
  70. package/esm/core/global.d.ts +2 -2
  71. package/esm/core/global.js +7 -4
  72. package/esm/core/helpers/checker/is-marker.d.ts +1 -0
  73. package/esm/core/helpers/checker/is-marker.js +2 -4
  74. package/esm/core/helpers/utils/attr.js +3 -1
  75. package/esm/core/helpers/utils/error/errors/abort-error.d.ts +0 -5
  76. package/esm/core/helpers/utils/error/errors/abort-error.js +0 -8
  77. package/esm/core/helpers/utils/selector.js +2 -1
  78. package/esm/core/helpers/utils/utils.d.ts +2 -1
  79. package/esm/core/helpers/utils/utils.js +8 -0
  80. package/esm/core/plugin/helpers/init-instance.d.ts +2 -2
  81. package/esm/core/plugin/helpers/init-instance.js +2 -3
  82. package/esm/core/plugin/plugin-system.d.ts +5 -1
  83. package/esm/core/plugin/plugin-system.js +8 -5
  84. package/esm/core/selection/style/api/list/wrap-list.js +3 -2
  85. package/esm/core/selection/style/transactions.js +1 -1
  86. package/esm/core/ui/button/button/button.js +6 -3
  87. package/esm/core/ui/element.d.ts +2 -3
  88. package/esm/core/ui/group/list.d.ts +0 -1
  89. package/esm/core/ui/group/list.js +8 -6
  90. package/esm/modules/file-browser/builders/context-menu.js +3 -2
  91. package/esm/modules/file-browser/builders/utils.d.ts +12 -0
  92. package/esm/modules/file-browser/builders/utils.js +12 -0
  93. package/esm/modules/file-browser/listeners/native-listeners.d.ts +1 -12
  94. package/esm/modules/file-browser/listeners/native-listeners.js +3 -13
  95. package/esm/modules/history/command.d.ts +2 -3
  96. package/esm/modules/history/history.d.ts +1 -1
  97. package/esm/modules/history/history.js +2 -2
  98. package/esm/modules/toolbar/button/button.d.ts +0 -5
  99. package/esm/modules/toolbar/button/button.js +21 -11
  100. package/esm/modules/toolbar/collection/collection.d.ts +1 -2
  101. package/esm/modules/toolbar/collection/collection.js +6 -3
  102. package/esm/modules/toolbar/factory.js +8 -6
  103. package/esm/plugins/about/about.js +2 -2
  104. package/package.json +1 -1
  105. package/types/core/decorators/component/component.d.ts +4 -3
  106. package/types/core/decorators/watch/watch.d.ts +1 -2
  107. package/types/core/dom/dom.d.ts +5 -0
  108. package/types/core/event-emitter/global.d.ts +2 -0
  109. package/types/core/global.d.ts +2 -2
  110. package/types/core/helpers/checker/is-marker.d.ts +1 -0
  111. package/types/core/helpers/utils/error/errors/abort-error.d.ts +0 -5
  112. package/types/core/helpers/utils/utils.d.ts +2 -1
  113. package/types/core/plugin/helpers/init-instance.d.ts +2 -2
  114. package/types/core/plugin/plugin-system.d.ts +5 -1
  115. package/types/core/ui/element.d.ts +2 -3
  116. package/types/core/ui/group/list.d.ts +0 -1
  117. package/types/modules/file-browser/builders/utils.d.ts +12 -0
  118. package/types/modules/file-browser/listeners/native-listeners.d.ts +1 -12
  119. package/types/modules/history/command.d.ts +2 -3
  120. package/types/modules/history/history.d.ts +1 -1
  121. package/types/modules/toolbar/button/button.d.ts +0 -5
  122. package/types/modules/toolbar/collection/collection.d.ts +1 -2
@@ -14,7 +14,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
14
14
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15
15
  };
16
16
  import { Component } from "../../component/component.js";
17
- import { component, hook, watch } from "../../decorators/index.js";
17
+ import { component } from "../../decorators/component/component.js";
18
+ import { hook } from "../../decorators/hook/hook.js";
19
+ import { watch } from "../../decorators/watch/watch.js";
18
20
  import { splitArray } from "../../helpers/array/split-array.js";
19
21
  import { UIButton } from "../button/button/button.js";
20
22
  import { UIGroup } from "./group.js";
@@ -24,6 +26,11 @@ import { isButtonGroup } from "../helpers/buttons.js";
24
26
  import { getControlType } from "../helpers/get-control-type.js";
25
27
  import { getStrongControlTypes } from "../helpers/get-strong-control-types.js";
26
28
  let UIList = class UIList extends UIGroup {
29
+ constructor() {
30
+ super(...arguments);
31
+ this.mode = 'horizontal';
32
+ this.removeButtons = [];
33
+ }
27
34
  /** @override */
28
35
  className() {
29
36
  return 'UIList';
@@ -31,11 +38,6 @@ let UIList = class UIList extends UIGroup {
31
38
  __onChangeMode() {
32
39
  this.setMod('mode', this.mode);
33
40
  }
34
- constructor(jodit) {
35
- super(jodit);
36
- this.mode = 'horizontal';
37
- this.removeButtons = [];
38
- }
39
41
  /**
40
42
  * Make new group and append it in list of elements
41
43
  */
@@ -4,13 +4,14 @@
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
6
  import { Dom } from "../../../core/dom/index.js";
7
- import { attr, error } from "../../../core/helpers/utils/index.js";
7
+ import { attr } from "../../../core/helpers/utils/attr.js";
8
+ import { error } from "../../../core/helpers/utils/error/index.js";
8
9
  import { Icon } from "../../../core/ui/icon.js";
9
10
  import { elementsMap } from "./elements-map.js";
11
+ import { elementToItem, getItem } from "./utils.js";
10
12
  import { makeContextMenu } from "../factories.js";
11
13
  import { deleteFile } from "../fetch/delete-file.js";
12
14
  import { loadTree } from "../fetch/load-tree.js";
13
- import { elementToItem, getItem } from "../listeners/native-listeners.js";
14
15
  import { openImageEditor } from "../../image-editor/image-editor.js";
15
16
  const CLASS_PREVIEW = 'jodit-file-browser-preview', preview_tpl_next = (next = 'next', right = 'right') => `<div class="${CLASS_PREVIEW}__navigation ${CLASS_PREVIEW}__navigation_arrow_${next}">` +
16
17
  '' +
@@ -0,0 +1,12 @@
1
+ import type { HTMLTagNames, IDictionary, IFileBrowserItem, Nullable } from "../../../types/index";
2
+ /**
3
+ * @private
4
+ */
5
+ export declare const getItem: (node: Nullable<EventTarget>, root: HTMLElement, tag?: HTMLTagNames) => Nullable<HTMLElement>;
6
+ /**
7
+ * @private
8
+ */
9
+ export declare const elementToItem: (elm: HTMLElement, elementsMap: IDictionary<{
10
+ elm: HTMLElement;
11
+ item: IFileBrowserItem;
12
+ }>) => IFileBrowserItem | void;
@@ -0,0 +1,12 @@
1
+ import { Dom } from "../../../core/dom/dom.js";
2
+ /**
3
+ * @private
4
+ */
5
+ export const getItem = (node, root, tag = 'a') => Dom.closest(node, elm => Dom.isTag(elm, tag), root);
6
+ /**
7
+ * @private
8
+ */
9
+ export const elementToItem = (elm, elementsMap) => {
10
+ const { key } = elm.dataset, { item } = elementsMap[key || ''];
11
+ return item;
12
+ };
@@ -6,18 +6,7 @@
6
6
  /**
7
7
  * @module modules/file-browser
8
8
  */
9
- import type { HTMLTagNames, IDictionary, IFileBrowser, IFileBrowserItem, Nullable } from "../../../types/index";
10
- /**
11
- * @private
12
- */
13
- export declare const getItem: (node: Nullable<EventTarget>, root: HTMLElement, tag?: HTMLTagNames) => Nullable<HTMLElement>;
14
- /**
15
- * @private
16
- */
17
- export declare const elementToItem: (elm: HTMLElement, elementsMap: IDictionary<{
18
- elm: HTMLElement;
19
- item: IFileBrowserItem;
20
- }>) => IFileBrowserItem | void;
9
+ import type { IFileBrowser } from "../../../types/index";
21
10
  /**
22
11
  * @private
23
12
  */
@@ -3,22 +3,12 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- import { Dom } from "../../../core/dom/index.js";
7
- import { attr, ctrlKey } from "../../../core/helpers/index.js";
6
+ import { attr } from "../../../core/helpers/utils/attr.js";
7
+ import { ctrlKey } from "../../../core/helpers/utils/ctrl-key.js";
8
8
  import contextMenu from "../builders/context-menu.js";
9
9
  import { elementsMap } from "../builders/elements-map.js";
10
+ import { elementToItem, getItem } from "../builders/utils.js";
10
11
  import { loadTree } from "../fetch/load-tree.js";
11
- /**
12
- * @private
13
- */
14
- export const getItem = (node, root, tag = 'a') => Dom.closest(node, elm => Dom.isTag(elm, tag), root);
15
- /**
16
- * @private
17
- */
18
- export const elementToItem = (elm, elementsMap) => {
19
- const { key } = elm.dataset, { item } = elementsMap[key || ''];
20
- return item;
21
- };
22
12
  /**
23
13
  * @private
24
14
  */
@@ -6,8 +6,7 @@
6
6
  /**
7
7
  * @module modules/history
8
8
  */
9
- import type { SnapshotType } from "../../types/index";
10
- import type { History } from "./history";
9
+ import type { IHistory, SnapshotType } from "../../types/index";
11
10
  export declare class Command {
12
11
  readonly oldValue: SnapshotType;
13
12
  readonly newValue: SnapshotType;
@@ -15,5 +14,5 @@ export declare class Command {
15
14
  readonly tick: number;
16
15
  undo(): void;
17
16
  redo(): void;
18
- constructor(oldValue: SnapshotType, newValue: SnapshotType, history: History, tick: number);
17
+ constructor(oldValue: SnapshotType, newValue: SnapshotType, history: IHistory, tick: number);
19
18
  }
@@ -9,7 +9,7 @@
9
9
  * @module modules/history
10
10
  */
11
11
  import type { IDestructible, IHistory, IJodit, ISnapshot, SnapshotType } from "../../types/index";
12
- import { ViewComponent } from "../../core/component/index";
12
+ import { ViewComponent } from "../../core/component/view-component";
13
13
  import { Snapshot } from "./snapshot";
14
14
  import { Stack } from "./stack";
15
15
  declare module 'jodit/config' {
@@ -13,8 +13,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
13
13
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
14
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15
15
  };
16
- import { ViewComponent } from "../../core/component/index.js";
17
- import { debounce } from "../../core/decorators/index.js";
16
+ import { ViewComponent } from "../../core/component/view-component.js";
17
+ import { debounce } from "../../core/decorators/debounce/debounce.js";
18
18
  import { Config } from "../../config.js";
19
19
  import { Command } from "./command.js";
20
20
  import { Snapshot } from "./snapshot.js";
@@ -13,7 +13,6 @@ import { UIButton } from "../../../core/ui/button/index";
13
13
  export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UIButton implements IToolbarButton {
14
14
  readonly control: IControlTypeStrong;
15
15
  readonly target: Nullable<HTMLElement>;
16
- /** @override */
17
16
  className(): string;
18
17
  readonly state: {
19
18
  theme: string;
@@ -37,7 +36,6 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
37
36
  * Get parent toolbar
38
37
  */
39
38
  protected get toolbar(): Nullable<IToolbarCollection>;
40
- /** @override **/
41
39
  update(): void;
42
40
  /**
43
41
  * Calculates whether the button is active
@@ -47,11 +45,8 @@ export declare class ToolbarButton<T extends IViewBased = IViewBased> extends UI
47
45
  * Calculates whether an element is blocked for the user
48
46
  */
49
47
  private __calculateDisabledStatus;
50
- /** @override */
51
48
  protected onChangeActivated(): void;
52
- /** @override */
53
49
  protected onChangeText(): void;
54
- /** @override */
55
50
  protected onChangeTabIndex(): void;
56
51
  protected createContainer(): HTMLElement;
57
52
  /** @override */
@@ -14,17 +14,27 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
14
14
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15
15
  };
16
16
  import { STATUSES } from "../../../core/component/statuses.js";
17
- import { autobind, cacheHTML, component, watch } from "../../../core/decorators/index.js";
18
- import { Dom } from "../../../core/dom/index.js";
19
- import { assert, attr, call, camelCase, isArray, isFunction, isJoditObject, isPlainObject, isString, keys, position } from "../../../core/helpers/index.js";
17
+ import { autobind } from "../../../core/decorators/autobind/autobind.js";
18
+ import { cacheHTML } from "../../../core/decorators/cache/cache.js";
19
+ import { component, getComponentClass } from "../../../core/decorators/component/component.js";
20
+ import { watch } from "../../../core/decorators/watch/watch.js";
21
+ import { Dom } from "../../../core/dom/dom.js";
22
+ import { isArray } from "../../../core/helpers/checker/is-array.js";
23
+ import { isFunction } from "../../../core/helpers/checker/is-function.js";
24
+ import { isJoditObject } from "../../../core/helpers/checker/is-jodit-object.js";
25
+ import { isPlainObject } from "../../../core/helpers/checker/is-plain-object.js";
26
+ import { isString } from "../../../core/helpers/checker/is-string.js";
27
+ import { position } from "../../../core/helpers/size/index.js";
28
+ import { camelCase } from "../../../core/helpers/string/camel-case.js";
29
+ import { assert } from "../../../core/helpers/utils/assert.js";
30
+ import { attr } from "../../../core/helpers/utils/attr.js";
31
+ import { call, keys } from "../../../core/helpers/utils/utils.js";
20
32
  import { UIButton, UIButtonState } from "../../../core/ui/button/index.js";
21
33
  import { findControlType } from "../../../core/ui/helpers/get-control-type.js";
22
34
  import { Icon } from "../../../core/ui/icon.js";
23
35
  import { Popup } from "../../../core/ui/popup/popup.js";
24
- import { ToolbarCollection } from "../collection/collection.js";
25
36
  import { makeCollection } from "../factory.js";
26
37
  let ToolbarButton = class ToolbarButton extends UIButton {
27
- /** @override */
28
38
  className() {
29
39
  return 'ToolbarButton';
30
40
  }
@@ -32,12 +42,13 @@ let ToolbarButton = class ToolbarButton extends UIButton {
32
42
  * Get parent toolbar
33
43
  */
34
44
  get toolbar() {
45
+ const ToolbarCollection = getComponentClass('ToolbarCollection');
35
46
  return this.closest(ToolbarCollection);
36
47
  }
37
- /** @override **/
38
48
  update() {
39
49
  var _a, _b;
40
- const { control, state } = this, tc = this.closest(ToolbarCollection);
50
+ const { control, state } = this;
51
+ const tc = this.toolbar;
41
52
  if (!tc) {
42
53
  return;
43
54
  }
@@ -80,12 +91,10 @@ let ToolbarButton = class ToolbarButton extends UIButton {
80
91
  }
81
92
  return Boolean(tc && tc.shouldBeDisabled(this));
82
93
  }
83
- /** @override */
84
94
  onChangeActivated() {
85
95
  attr(this.button, 'aria-pressed', this.state.activated);
86
96
  super.onChangeActivated();
87
97
  }
88
- /** @override */
89
98
  onChangeText() {
90
99
  if (isFunction(this.control.template)) {
91
100
  this.text.innerHTML = this.control.template(this.j, this.control.name, this.j.i18n(this.state.text));
@@ -95,7 +104,6 @@ let ToolbarButton = class ToolbarButton extends UIButton {
95
104
  }
96
105
  this.setMod('text-icons', Boolean(this.text.innerText.trim().length));
97
106
  }
98
- /** @override */
99
107
  onChangeTabIndex() {
100
108
  attr(this.button, 'tabindex', this.state.tabIndex);
101
109
  }
@@ -262,7 +270,9 @@ let ToolbarButton = class ToolbarButton extends UIButton {
262
270
  __openControlList(control) {
263
271
  var _a;
264
272
  const controls = (_a = this.jodit.options.controls) !== null && _a !== void 0 ? _a : {}, getControl = (key) => findControlType(key, controls);
265
- const list = control.list, menu = this.openPopup(), toolbar = makeCollection(this.j);
273
+ const list = control.list;
274
+ const menu = this.openPopup();
275
+ const toolbar = makeCollection(this.j);
266
276
  menu.parentElement = this;
267
277
  toolbar.parentElement = menu;
268
278
  toolbar.mode = 'vertical';
@@ -9,9 +9,8 @@
9
9
  * @module modules/toolbar/collection
10
10
  */
11
11
  import type { ButtonsGroups, IBound, IControlTypeStrong, IToolbarButton, IToolbarCollection, IUIButton, IViewBased, IViewWithToolbar, Nullable } from "../../../types/index";
12
- import { UIList } from "../../../core/ui/index";
12
+ import { UIList } from "../../../core/ui/group/list";
13
13
  export declare class ToolbarCollection<T extends IViewWithToolbar = IViewWithToolbar> extends UIList<T> implements IToolbarCollection {
14
- /** @override */
15
14
  className(): string;
16
15
  private readonly __listenEvents;
17
16
  /**
@@ -13,12 +13,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
13
13
  r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
14
  return c > 3 && r && Object.defineProperty(target, key, r), r;
15
15
  };
16
- import { autobind, component, debounce, hook, watch } from "../../../core/decorators/index.js";
16
+ import { debounce } from "../../../core/decorators/index.js";
17
+ import { autobind } from "../../../core/decorators/autobind/autobind.js";
18
+ import { component } from "../../../core/decorators/component/component.js";
19
+ import { hook } from "../../../core/decorators/hook/hook.js";
20
+ import { watch } from "../../../core/decorators/watch/watch.js";
17
21
  import { error } from "../../../core/helpers/utils/error/error.js";
18
- import { UIList } from "../../../core/ui/index.js";
22
+ import { UIList } from "../../../core/ui/group/list.js";
19
23
  import { makeButton, makeSelect } from "../factory.js";
20
24
  let ToolbarCollection = class ToolbarCollection extends UIList {
21
- /** @override */
22
25
  className() {
23
26
  return 'ToolbarCollection';
24
27
  }
@@ -3,16 +3,15 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- import { isFunction, isJoditObject } from "../../core/helpers/index.js";
7
- import { ToolbarButton } from "./button/button.js";
8
- import { ToolbarContent } from "./button/content.js";
9
- import { ToolbarSelect } from "./button/select/select.js";
10
- import { ToolbarCollection } from "./collection/collection.js";
11
- import { ToolbarEditorCollection } from "./collection/editor-collection.js";
6
+ import { getComponentClass } from "../../core/decorators/component/component.js";
7
+ import { isFunction } from "../../core/helpers/checker/is-function.js";
8
+ import { isJoditObject } from "../../core/helpers/checker/is-jodit-object.js";
12
9
  /**
13
10
  * Collection factory
14
11
  */
15
12
  export function makeCollection(jodit, parentElement) {
13
+ const ToolbarCollection = getComponentClass('ToolbarCollection');
14
+ const ToolbarEditorCollection = getComponentClass('ToolbarEditorCollection');
16
15
  const collection = isJoditObject(jodit)
17
16
  ? new ToolbarEditorCollection(jodit)
18
17
  : new ToolbarCollection(jodit);
@@ -32,12 +31,15 @@ export function makeCollection(jodit, parentElement) {
32
31
  */
33
32
  export function makeButton(jodit, control, target = null) {
34
33
  if (isFunction(control.getContent)) {
34
+ const ToolbarContent = getComponentClass('ToolbarContent');
35
35
  return new ToolbarContent(jodit, control, target);
36
36
  }
37
+ const ToolbarButton = getComponentClass('ToolbarButton');
37
38
  const button = new ToolbarButton(jodit, control, target);
38
39
  button.state.tabIndex = jodit.o.allowTabNavigation ? 0 : -1;
39
40
  return button;
40
41
  }
41
42
  export function makeSelect(view, control, target = null) {
43
+ const ToolbarSelect = getComponentClass('ToolbarSelect');
42
44
  return new ToolbarSelect(view, control, target);
43
45
  }
@@ -19,7 +19,7 @@ Config.prototype.controls.about = {
19
19
  .setContent(`<div class="jodit-about">
20
20
  <div>${i('Jodit Editor')} v.${editor.getVersion()}</div>
21
21
  <div>${i('License: %s', !isLicense(editor.o.license)
22
- ? 'MIT'
22
+ ? editor.o.license || 'MIT'
23
23
  : normalizeLicense(editor.o.license))}</div>
24
24
  <div>
25
25
  <a href="${HOMEPAGE}" target="_blank">${HOMEPAGE}</a>
@@ -28,7 +28,7 @@ Config.prototype.controls.about = {
28
28
  <a href="https://xdsoft.net/jodit/docs/" target="_blank">${i("Jodit User's Guide")}</a>
29
29
  ${i('contains detailed help for using')}
30
30
  </div>
31
- <div>${i('Copyright © XDSoft.net - Chupurnov Valeriy. All rights reserved.')}</div>
31
+ <div>${i('Copyright © XDSoft.net - Chupurnov Valerii. All rights reserved.')}</div>
32
32
  </div>`);
33
33
  css(dialog.dialog, {
34
34
  minHeight: 200,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.8.9",
3
+ "version": "4.9.4",
4
4
  "description": "Jodit is an awesome and useful wysiwyg editor with filebrowser",
5
5
  "main": "esm/index.js",
6
6
  "types": "types/index.d.ts",
@@ -3,17 +3,18 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
+ import type { IComponent } from "../../../types/index";
6
7
  /**
7
8
  * [[include:core/decorators/component/README.md]]
8
9
  * @packageDocumentation
9
10
  * @module decorators/component
10
11
  */
11
- interface ComponentCompatible {
12
- new (...constructorArgs: any[]): any;
12
+ export interface ComponentCompatible<T = IComponent> {
13
+ new (...constructorArgs: any[]): T;
13
14
  }
14
15
  /**
15
16
  * Decorate components and set status isReady after constructor
16
17
  * @param constructorFunction - Component constructor class
17
18
  */
18
19
  export declare function component<T extends ComponentCompatible>(constructorFunction: T): T;
19
- export {};
20
+ export declare function getComponentClass<T extends IComponent>(name: string): ComponentCompatible<T>;
@@ -8,8 +8,7 @@
8
8
  * @packageDocumentation
9
9
  * @module decorators/watch
10
10
  */
11
- import type { CanUndef, DecoratorHandler, IDictionary } from "../../../types/index";
12
- export declare function getPropertyDescriptor(obj: unknown, prop: string): CanUndef<PropertyDescriptor>;
11
+ import type { DecoratorHandler, IDictionary } from "../../../types/index";
13
12
  /**
14
13
  * Watch decorator. Added observer for some change in field value
15
14
  */
@@ -249,12 +249,17 @@ export declare class Dom {
249
249
  * Check if element is temporary
250
250
  */
251
251
  static isTemporary(element: unknown): boolean;
252
+ /**
253
+ * Define element is selection helper
254
+ */
255
+ static isMarker(elm: Nullable<Node>): elm is HTMLElement;
252
256
  /**
253
257
  * Replace temporary elements from string
254
258
  */
255
259
  static replaceTemporaryFromString(value: string): string;
256
260
  /**
257
261
  * Get temporary list
262
+ * @deprecated
258
263
  */
259
264
  static temporaryList(root: HTMLElement): HTMLElement[];
260
265
  }
@@ -0,0 +1,2 @@
1
+ import { EventEmitter } from "./event-emitter";
2
+ export declare const eventEmitter: EventEmitter;
@@ -8,7 +8,6 @@
8
8
  */
9
9
  import type { HTMLTagNames, IDictionary, IJodit, IViewBased, IViewComponent, IViewOptions } from "../types/index";
10
10
  import { PluginSystem } from "./plugin/plugin-system";
11
- import { EventEmitter } from "./event-emitter/index";
12
11
  export declare const instances: IDictionary<IJodit>;
13
12
  /**
14
13
  * Generate global unique uid
@@ -28,5 +27,6 @@ export declare function getContainer<T extends HTMLTagNames = HTMLTagNames>(jodi
28
27
  export declare function getPopupViewRoot(o: IViewOptions, container: HTMLElement, defaultRoot: HTMLElement): HTMLElement;
29
28
  /**
30
29
  * Global event emitter
30
+ * @deprecated use `import { eventEmitter } from 'jodit/core/event-emitter/global';`
31
31
  */
32
- export declare const eventEmitter: EventEmitter;
32
+ export declare const eventEmitter: import("./event-emitter/index").EventEmitter;
@@ -9,5 +9,6 @@
9
9
  import type { Nullable } from "../../../types/index";
10
10
  /**
11
11
  * Define element is selection helper
12
+ * @deprecated use Dom.isMarker instead
12
13
  */
13
14
  export declare function isMarker(elm: Nullable<Node>): elm is HTMLElement;
@@ -6,7 +6,6 @@
6
6
  /**
7
7
  * @module helpers/utils
8
8
  */
9
- import { isAbortError } from "../../../checker/is-abort-error";
10
9
  /**
11
10
  * `AbortError` is not a separate exception, but rather a {@link DOMException} with a special `name`.
12
11
  * https://webidl.spec.whatwg.org/#aborterror
@@ -15,7 +14,3 @@ export type AbortError = DOMException & {
15
14
  name: 'AbortError';
16
15
  };
17
16
  export declare function abort(message?: string): Error;
18
- /**
19
- * @deprecated use `isAbortError` instead
20
- */
21
- export declare const isAbort: typeof isAbortError;
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * @module helpers/utils
8
8
  */
9
- import type { CanPromise, IControlType, IJodit, IViewBased, Nullable, RejectablePromise } from "../../../types/index";
9
+ import type { CanPromise, CanUndef, IControlType, IJodit, IViewBased, Nullable, RejectablePromise } from "../../../types/index";
10
10
  /**
11
11
  * Call function with parameters
12
12
  *
@@ -37,3 +37,4 @@ export declare const memorizeExec: <T extends IJodit = IJodit>(editor: T, _: unk
37
37
  * Get DataTransfer from different event types
38
38
  */
39
39
  export declare const getDataTransfer: (event: ClipboardEvent | DragEvent) => Nullable<DataTransfer>;
40
+ export declare function getPropertyDescriptor(obj: unknown, prop: string): CanUndef<PropertyDescriptor>;
@@ -6,9 +6,9 @@
6
6
  /**
7
7
  * @module plugin
8
8
  */
9
- import type { IJodit, Nullable, PluginInstance, PluginType } from "../../../types/index";
9
+ import type { HTMLTagNames, IJodit, IViewBased, IViewComponent, Nullable, PluginInstance, PluginType } from "../../../types/index";
10
10
  /**
11
11
  * Init plugin if it has no dependencies, in another case wait requires plugins will be init
12
12
  * @private
13
13
  */
14
- export declare function init(jodit: IJodit, pluginName: string, plugin: PluginType, instance: PluginInstance, doneList: Map<string, Nullable<PluginInstance>>, waitingList: Set<string>): void;
14
+ export declare function init(jodit: IJodit, pluginName: string, plugin: PluginType, instance: PluginInstance, doneList: Map<string, Nullable<PluginInstance>>, waitingList: Set<string>, getContainer: <T extends HTMLTagNames = HTMLTagNames>(jodit: IViewBased | IViewComponent, classFunc?: Function | string, tag?: T, createInsideEditor?: boolean) => HTMLElementTagNameMap[T]): void;
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * @module plugin
8
8
  */
9
- import type { IJodit, IPluginSystem, PluginType } from "../../types/index";
9
+ import type { HTMLTagNames, IJodit, IPluginSystem, IViewBased, IViewComponent, PluginType } from "../../types/index";
10
10
  import "./interface";
11
11
  /**
12
12
  * Jodit plugin system
@@ -21,6 +21,10 @@ import "./interface";
21
21
  * ```
22
22
  */
23
23
  export declare class PluginSystem implements IPluginSystem {
24
+ private readonly opts;
25
+ constructor(opts: {
26
+ getContainer<T extends HTMLTagNames = HTMLTagNames>(jodit: IViewBased | IViewComponent, classFunc?: Function | string, tag?: T, createInsideEditor?: boolean): HTMLElementTagNameMap[T];
27
+ });
24
28
  private __items;
25
29
  get size(): number;
26
30
  /**
@@ -7,6 +7,7 @@
7
7
  * @module ui
8
8
  */
9
9
  import type { IDictionary, IUIElement, IViewBased, Nullable } from "../../types/index";
10
+ import type { ComponentCompatible } from "../decorators/component/component";
10
11
  import { ViewComponent } from "../component/index";
11
12
  import { Elms } from "../traits/elms";
12
13
  import { Mods } from "../traits/mods";
@@ -22,9 +23,7 @@ export declare abstract class UIElement<T extends IViewBased = IViewBased> exten
22
23
  updateParentElement(target: IUIElement): this;
23
24
  /** @override */
24
25
  get<T>(chain: string, obj?: IDictionary): Nullable<T>;
25
- /**
26
- * Find match parent
27
- */
26
+ closest<T>(ctor: ComponentCompatible<T>): Nullable<T>;
28
27
  closest<T extends UIElement | typeof UIElement>(type: UIElement | Function): Nullable<T extends typeof UIElement ? InstanceType<T> : T>;
29
28
  /**
30
29
  * Find closest UIElement in DOM
@@ -14,7 +14,6 @@ export declare class UIList<T extends IViewBased = IViewBased> extends UIGroup<T
14
14
  jodit: T;
15
15
  mode: IUIList['mode'];
16
16
  protected __onChangeMode(): void;
17
- constructor(jodit: T);
18
17
  /**
19
18
  * Make new group and append it in list of elements
20
19
  */
@@ -0,0 +1,12 @@
1
+ import type { HTMLTagNames, IDictionary, IFileBrowserItem, Nullable } from "../../../types/index";
2
+ /**
3
+ * @private
4
+ */
5
+ export declare const getItem: (node: Nullable<EventTarget>, root: HTMLElement, tag?: HTMLTagNames) => Nullable<HTMLElement>;
6
+ /**
7
+ * @private
8
+ */
9
+ export declare const elementToItem: (elm: HTMLElement, elementsMap: IDictionary<{
10
+ elm: HTMLElement;
11
+ item: IFileBrowserItem;
12
+ }>) => IFileBrowserItem | void;
@@ -6,18 +6,7 @@
6
6
  /**
7
7
  * @module modules/file-browser
8
8
  */
9
- import type { HTMLTagNames, IDictionary, IFileBrowser, IFileBrowserItem, Nullable } from "../../../types/index";
10
- /**
11
- * @private
12
- */
13
- export declare const getItem: (node: Nullable<EventTarget>, root: HTMLElement, tag?: HTMLTagNames) => Nullable<HTMLElement>;
14
- /**
15
- * @private
16
- */
17
- export declare const elementToItem: (elm: HTMLElement, elementsMap: IDictionary<{
18
- elm: HTMLElement;
19
- item: IFileBrowserItem;
20
- }>) => IFileBrowserItem | void;
9
+ import type { IFileBrowser } from "../../../types/index";
21
10
  /**
22
11
  * @private
23
12
  */
@@ -6,8 +6,7 @@
6
6
  /**
7
7
  * @module modules/history
8
8
  */
9
- import type { SnapshotType } from "../../types/index";
10
- import type { History } from "./history";
9
+ import type { IHistory, SnapshotType } from "../../types/index";
11
10
  export declare class Command {
12
11
  readonly oldValue: SnapshotType;
13
12
  readonly newValue: SnapshotType;
@@ -15,5 +14,5 @@ export declare class Command {
15
14
  readonly tick: number;
16
15
  undo(): void;
17
16
  redo(): void;
18
- constructor(oldValue: SnapshotType, newValue: SnapshotType, history: History, tick: number);
17
+ constructor(oldValue: SnapshotType, newValue: SnapshotType, history: IHistory, tick: number);
19
18
  }
@@ -9,7 +9,7 @@
9
9
  * @module modules/history
10
10
  */
11
11
  import type { IDestructible, IHistory, IJodit, ISnapshot, SnapshotType } from "../../types/index";
12
- import { ViewComponent } from "../../core/component/index";
12
+ import { ViewComponent } from "../../core/component/view-component";
13
13
  import { Snapshot } from "./snapshot";
14
14
  import { Stack } from "./stack";
15
15
  declare module 'jodit/config' {