jodit 4.5.3 → 4.5.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 (158) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +2 -2
  5. package/es2015/jodit.min.js +2 -2
  6. package/es2015/plugins/debug/debug.css +1 -1
  7. package/es2015/plugins/debug/debug.js +1 -1
  8. package/es2015/plugins/debug/debug.min.js +1 -1
  9. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  12. package/es2018/jodit.css +1 -1
  13. package/es2018/jodit.fat.min.js +2 -2
  14. package/es2018/jodit.js +2 -2
  15. package/es2018/jodit.min.js +2 -2
  16. package/es2018/plugins/debug/debug.css +1 -1
  17. package/es2018/plugins/debug/debug.js +1 -1
  18. package/es2018/plugins/debug/debug.min.js +1 -1
  19. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  20. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  22. package/es2021/jodit.css +1 -1
  23. package/es2021/jodit.fat.min.js +2 -2
  24. package/es2021/jodit.js +2 -2
  25. package/es2021/jodit.min.js +2 -2
  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 +1 -1
  33. package/es2021.en/jodit.fat.min.js +2 -2
  34. package/es2021.en/jodit.js +2 -2
  35. package/es2021.en/jodit.min.js +2 -2
  36. package/es2021.en/plugins/debug/debug.css +1 -1
  37. package/es2021.en/plugins/debug/debug.js +1 -1
  38. package/es2021.en/plugins/debug/debug.min.js +1 -1
  39. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  40. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  41. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  42. package/es5/5.fat.min.js +1 -1
  43. package/es5/5.min.js +1 -1
  44. package/es5/975.fat.min.js +1 -1
  45. package/es5/975.min.js +1 -1
  46. package/es5/jodit.css +2 -2
  47. package/es5/jodit.fat.min.js +2 -2
  48. package/es5/jodit.js +2 -2
  49. package/es5/jodit.min.css +2 -2
  50. package/es5/jodit.min.js +2 -2
  51. package/es5/plugins/debug/debug.css +1 -1
  52. package/es5/plugins/debug/debug.js +1 -1
  53. package/es5/plugins/debug/debug.min.js +1 -1
  54. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  55. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  56. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  57. package/esm/core/async/async.js +15 -16
  58. package/esm/core/component/component.js +1 -1
  59. package/esm/core/constants.js +1 -1
  60. package/esm/core/create/create.js +2 -1
  61. package/esm/core/decorators/cache/cache.js +2 -1
  62. package/esm/core/decorators/persistent/persistent.js +2 -1
  63. package/esm/core/decorators/watch/watch.js +3 -2
  64. package/esm/core/dom/dom.js +15 -11
  65. package/esm/core/dom/lazy-walker.js +6 -3
  66. package/esm/core/event-emitter/event-emitter.js +8 -6
  67. package/esm/core/event-emitter/eventify.js +6 -3
  68. package/esm/core/event-emitter/observable.js +1 -1
  69. package/esm/core/global.js +4 -6
  70. package/esm/core/helpers/array/to-array.js +2 -1
  71. package/esm/core/helpers/html/apply-styles.js +1 -1
  72. package/esm/core/helpers/size/position.js +3 -2
  73. package/esm/core/helpers/string/i18n.js +3 -3
  74. package/esm/core/helpers/utils/get-class-name.js +2 -1
  75. package/esm/core/helpers/utils/get.js +1 -1
  76. package/esm/core/helpers/utils/print.js +4 -3
  77. package/esm/core/helpers/utils/reset.js +3 -2
  78. package/esm/core/helpers/utils/selector.js +1 -1
  79. package/esm/core/helpers/utils/utils.js +6 -5
  80. package/esm/core/plugin/plugin-system.js +1 -1
  81. package/esm/core/plugin/plugin.js +3 -2
  82. package/esm/core/request/ajax.js +7 -4
  83. package/esm/core/selection/helpers/index.js +2 -1
  84. package/esm/core/selection/selection.js +27 -20
  85. package/esm/core/selection/style/api/is-suit-element.js +5 -3
  86. package/esm/core/selection/style/api/list/wrap-list.js +2 -2
  87. package/esm/core/selection/style/api/toggle-attributes.js +2 -1
  88. package/esm/core/selection/style/api/unwrap-children.js +2 -1
  89. package/esm/core/selection/style/apply-style.js +2 -1
  90. package/esm/core/selection/style/commit-style.js +2 -1
  91. package/esm/core/storage/engines/local-storage-provider.js +5 -5
  92. package/esm/core/traits/mods.js +2 -1
  93. package/esm/core/ui/button/group/group.js +5 -3
  94. package/esm/core/ui/element.js +3 -2
  95. package/esm/core/ui/form/form.js +3 -2
  96. package/esm/core/ui/form/inputs/area/area.js +1 -1
  97. package/esm/core/ui/form/inputs/input/input.js +8 -5
  98. package/esm/core/ui/form/inputs/select/select.js +2 -1
  99. package/esm/core/ui/group/group.js +2 -2
  100. package/esm/core/ui/group/list.js +5 -2
  101. package/esm/core/ui/helpers/buttons.js +2 -1
  102. package/esm/core/ui/icon.js +6 -5
  103. package/esm/core/view/view-with-toolbar.js +6 -6
  104. package/esm/core/view/view.js +7 -5
  105. package/esm/index.js +2 -1
  106. package/esm/jodit.js +6 -5
  107. package/esm/modules/context-menu/context-menu.js +2 -1
  108. package/esm/modules/file-browser/builders/context-menu.js +2 -1
  109. package/esm/modules/file-browser/data-provider.js +7 -4
  110. package/esm/modules/file-browser/file-browser.js +16 -9
  111. package/esm/modules/history/history.js +2 -1
  112. package/esm/modules/image-editor/image-editor.js +1 -1
  113. package/esm/modules/status-bar/status-bar.js +4 -2
  114. package/esm/modules/table/table.js +4 -2
  115. package/esm/modules/toolbar/button/button.js +26 -15
  116. package/esm/modules/toolbar/button/select/select.js +2 -1
  117. package/esm/modules/uploader/helpers/send.js +1 -1
  118. package/esm/modules/uploader/uploader.js +1 -1
  119. package/esm/plugins/ai-assistant/ai-assistant.js +3 -2
  120. package/esm/plugins/backspace/backspace.js +2 -1
  121. package/esm/plugins/backspace/cases/check-remove-char.js +6 -4
  122. package/esm/plugins/backspace/cases/check-unwrap-first-list-item.js +2 -1
  123. package/esm/plugins/clipboard/clipboard.js +7 -4
  124. package/esm/plugins/delete/delete.js +2 -1
  125. package/esm/plugins/drag-and-drop-element/drag-and-drop-element.js +3 -2
  126. package/esm/plugins/enter/enter.js +2 -2
  127. package/esm/plugins/font/config.js +7 -4
  128. package/esm/plugins/format-block/config.js +4 -2
  129. package/esm/plugins/fullsize/fullsize.js +4 -2
  130. package/esm/plugins/iframe/iframe.js +2 -1
  131. package/esm/plugins/image-processor/image-processor.js +3 -2
  132. package/esm/plugins/image-properties/image-properties.js +4 -3
  133. package/esm/plugins/inline-popup/inline-popup.js +1 -1
  134. package/esm/plugins/key-arrow-outside/key-arrow-outside.js +2 -1
  135. package/esm/plugins/link/link.js +9 -8
  136. package/esm/plugins/mobile/config.js +2 -2
  137. package/esm/plugins/mobile/mobile.js +3 -4
  138. package/esm/plugins/ordered-list/config.js +2 -1
  139. package/esm/plugins/ordered-list/ordered-list.js +1 -1
  140. package/esm/plugins/paste/paste.js +4 -4
  141. package/esm/plugins/paste-from-word/paste-from-word.js +2 -1
  142. package/esm/plugins/placeholder/placeholder.js +2 -1
  143. package/esm/plugins/print/lib/generate-critical-css.js +3 -3
  144. package/esm/plugins/search/helpers/highlight-text-ranges.js +1 -1
  145. package/esm/plugins/search/helpers/sentence-finder.js +2 -1
  146. package/esm/plugins/search/search.js +13 -7
  147. package/esm/plugins/search/ui/search.js +1 -1
  148. package/esm/plugins/select-cells/select-cells.js +8 -4
  149. package/esm/plugins/size/size.js +3 -2
  150. package/esm/plugins/source/editor/engines/ace.js +2 -1
  151. package/esm/plugins/source/editor/sourceEditor.js +2 -1
  152. package/esm/plugins/source/source.js +31 -18
  153. package/esm/plugins/speech-recognize/config.js +5 -3
  154. package/esm/plugins/symbols/symbols.js +1 -1
  155. package/esm/plugins/video/config.js +4 -4
  156. package/esm/plugins/wrap-nodes/wrap-nodes.js +9 -6
  157. package/esm/plugins/xpath/xpath.js +1 -1
  158. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.5.3
4
+ * Version: v4.5.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.5.3
4
+ * Version: v4.5.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.5.3
4
+ * Version: v4.5.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.5.3
4
+ * Version: v4.5.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.5.3
4
+ * Version: v4.5.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
3
3
  * Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
4
- * Version: v4.5.3
4
+ * Version: v4.5.4
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -16,27 +16,26 @@ import { assert } from "../helpers/utils/assert.js";
16
16
  import { abort } from "../helpers/utils/error/errors/abort-error.js";
17
17
  export class Async {
18
18
  constructor() {
19
+ var _a, _b, _c, _d, _e;
19
20
  this.timers = new Map();
20
21
  this.__callbacks = new Map();
21
- this.__queueMicrotaskNative = queueMicrotask?.bind(window) ??
22
- Promise.resolve().then.bind(Promise.resolve());
22
+ this.__queueMicrotaskNative = (_a = queueMicrotask === null || queueMicrotask === void 0 ? void 0 : queueMicrotask.bind(window)) !== null && _a !== void 0 ? _a : Promise.resolve().then.bind(Promise.resolve());
23
23
  this.promisesRejections = new Set();
24
24
  this.requestsIdle = new Set();
25
25
  this.requestsRaf = new Set();
26
- this.requestIdleCallbackNative = window['requestIdleCallback']?.bind(window) ??
27
- ((callback, options) => {
28
- const start = Date.now();
29
- return this.setTimeout(() => {
30
- callback({
31
- didTimeout: false,
32
- timeRemaining: () => Math.max(0, 50 - (Date.now() - start))
33
- });
34
- }, options?.timeout ?? 1);
35
- });
36
- this.__cancelIdleCallbackNative = window['cancelIdleCallback']?.bind(window) ??
37
- ((request) => {
38
- this.clearTimeout(request);
39
- });
26
+ this.requestIdleCallbackNative = (_c = (_b = window['requestIdleCallback']) === null || _b === void 0 ? void 0 : _b.bind(window)) !== null && _c !== void 0 ? _c : ((callback, options) => {
27
+ var _a;
28
+ const start = Date.now();
29
+ return this.setTimeout(() => {
30
+ callback({
31
+ didTimeout: false,
32
+ timeRemaining: () => Math.max(0, 50 - (Date.now() - start))
33
+ });
34
+ }, (_a = options === null || options === void 0 ? void 0 : options.timeout) !== null && _a !== void 0 ? _a : 1);
35
+ });
36
+ this.__cancelIdleCallbackNative = (_e = (_d = window['cancelIdleCallback']) === null || _d === void 0 ? void 0 : _d.bind(window)) !== null && _e !== void 0 ? _e : ((request) => {
37
+ this.clearTimeout(request);
38
+ });
40
39
  this.isDestructed = false;
41
40
  }
42
41
  delay(timeout) {
@@ -161,7 +161,7 @@ export class Component {
161
161
  if (proto && isFunction(proto.setStatusComponent)) {
162
162
  proto.setStatusComponent(componentStatus, component);
163
163
  }
164
- const statuses = StatusListHandlers.get(this), list = statuses?.[componentStatus];
164
+ const statuses = StatusListHandlers.get(this), list = statuses === null || statuses === void 0 ? void 0 : statuses[componentStatus];
165
165
  if (list && list.length) {
166
166
  list.forEach(cb => cb(component));
167
167
  }
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.5.3";
6
+ export const APP_VERSION = "4.5.4";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -40,9 +40,10 @@ export class Create {
40
40
  return div;
41
41
  }
42
42
  sandbox() {
43
+ var _a;
43
44
  const iframe = this.element('iframe', { sandbox: 'allow-same-origin' });
44
45
  this.doc.body.appendChild(iframe);
45
- const doc = iframe.contentWindow?.document;
46
+ const doc = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document;
46
47
  assert(doc, 'iframe.contentWindow.document');
47
48
  if (!doc) {
48
49
  throw Error('Iframe error');
@@ -147,8 +147,9 @@ export function cacheHTML(target, _, descriptor) {
147
147
  let useCache = true;
148
148
  const cached = new WeakMap();
149
149
  descriptor.value = function (...attrs) {
150
+ var _a;
150
151
  if (useCache && cached.has(this.constructor)) {
151
- return cached.get(this.constructor)?.cloneNode(true);
152
+ return (_a = cached.get(this.constructor)) === null || _a === void 0 ? void 0 : _a.cloneNode(true);
152
153
  }
153
154
  const value = fn.apply(this, attrs);
154
155
  if (useCache && Dom.isElement(value)) {
@@ -12,7 +12,8 @@ export function persistent(target, propertyKey) {
12
12
  : component.jodit, storageKey = `${jodit.options.namespace}${component.componentName}_prop_${propertyKey}`, initialValue = component[propertyKey];
13
13
  Object.defineProperty(component, propertyKey, {
14
14
  get() {
15
- return jodit.storage.get(storageKey) ?? initialValue;
15
+ var _a;
16
+ return (_a = jodit.storage.get(storageKey)) !== null && _a !== void 0 ? _a : initialValue;
16
17
  },
17
18
  set(value) {
18
19
  jodit.storage.set(storageKey, value);
@@ -23,11 +23,12 @@ export function getPropertyDescriptor(obj, prop) {
23
23
  */
24
24
  export function watch(observeFields, opts) {
25
25
  return (target, propertyKey) => {
26
+ var _a;
26
27
  if (!isFunction(target[propertyKey])) {
27
28
  throw error('Handler must be a Function');
28
29
  }
29
- const immediately = opts?.immediately ?? true;
30
- const context = opts?.context;
30
+ const immediately = (_a = opts === null || opts === void 0 ? void 0 : opts.immediately) !== null && _a !== void 0 ? _a : true;
31
+ const context = opts === null || opts === void 0 ? void 0 : opts.context;
31
32
  const process = (component) => {
32
33
  const view = isViewObject(component)
33
34
  ? component
@@ -132,7 +132,7 @@ export class Dom {
132
132
  while (next && !next.nextSibling) {
133
133
  next = next.parentNode;
134
134
  }
135
- step = next?.nextSibling;
135
+ step = next === null || next === void 0 ? void 0 : next.nextSibling;
136
136
  }
137
137
  next = step;
138
138
  }
@@ -273,30 +273,33 @@ export class Dom {
273
273
  * Check if element is element node
274
274
  */
275
275
  static isElement(node) {
276
+ var _a;
276
277
  if (!Dom.isNode(node)) {
277
278
  return false;
278
279
  }
279
- const win = node.ownerDocument?.defaultView;
280
+ const win = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
280
281
  return Boolean(win && node.nodeType === Node.ELEMENT_NODE);
281
282
  }
282
283
  /**
283
284
  * Check if element is document fragment
284
285
  */
285
286
  static isFragment(node) {
287
+ var _a;
286
288
  if (!Dom.isNode(node)) {
287
289
  return false;
288
290
  }
289
- const win = node.ownerDocument?.defaultView;
291
+ const win = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
290
292
  return Boolean(win && node.nodeType === Node.DOCUMENT_FRAGMENT_NODE);
291
293
  }
292
294
  /**
293
295
  * Check if element is HTMLElement node
294
296
  */
295
297
  static isHTMLElement(node) {
298
+ var _a;
296
299
  if (!Dom.isNode(node)) {
297
300
  return false;
298
301
  }
299
- const win = node.ownerDocument?.defaultView;
302
+ const win = (_a = node.ownerDocument) === null || _a === void 0 ? void 0 : _a.defaultView;
300
303
  return Boolean(win && node instanceof win.HTMLElement);
301
304
  }
302
305
  /**
@@ -322,7 +325,7 @@ export class Dom {
322
325
  * Get last matched node inside root
323
326
  */
324
327
  static last(root, condition) {
325
- let last = root?.lastChild;
328
+ let last = root === null || root === void 0 ? void 0 : root.lastChild;
326
329
  if (!last) {
327
330
  return null;
328
331
  }
@@ -338,9 +341,9 @@ export class Dom {
338
341
  do {
339
342
  last = last.parentNode;
340
343
  } while (last &&
341
- !last?.previousSibling &&
344
+ !(last === null || last === void 0 ? void 0 : last.previousSibling) &&
342
345
  last.parentNode !== root);
343
- next = last?.previousSibling;
346
+ next = last === null || last === void 0 ? void 0 : last.previousSibling;
344
347
  }
345
348
  last = next;
346
349
  } while (last);
@@ -483,8 +486,9 @@ export class Dom {
483
486
  */
484
487
  static findNotEmptySibling(node, left) {
485
488
  return Dom.findSibling(node, left, n => {
489
+ var _a;
486
490
  return (!Dom.isEmptyTextNode(n) &&
487
- Boolean(!Dom.isText(n) || (n.nodeValue?.length && trim(n.nodeValue))));
491
+ Boolean(!Dom.isText(n) || (((_a = n.nodeValue) === null || _a === void 0 ? void 0 : _a.length) && trim(n.nodeValue))));
488
492
  });
489
493
  }
490
494
  /**
@@ -493,7 +497,7 @@ export class Dom {
493
497
  static findNotEmptyNeighbor(node, left, root) {
494
498
  return call(left ? Dom.prev : Dom.next, node, n => Boolean(n &&
495
499
  (!(Dom.isText(n) || Dom.isComment(n)) ||
496
- trim(n?.nodeValue || '').length)), root);
500
+ trim((n === null || n === void 0 ? void 0 : n.nodeValue) || '').length)), root);
497
501
  }
498
502
  static sibling(node, left) {
499
503
  return left ? node.previousSibling : node.nextSibling;
@@ -541,12 +545,12 @@ export class Dom {
541
545
  * Furthest parent node matching condition
542
546
  */
543
547
  static furthest(node, condition, root) {
544
- let matchedParent = null, current = node?.parentElement;
548
+ let matchedParent = null, current = node === null || node === void 0 ? void 0 : node.parentElement;
545
549
  while (current && current !== root) {
546
550
  if (condition(current)) {
547
551
  matchedParent = current;
548
552
  }
549
- current = current?.parentElement;
553
+ current = current === null || current === void 0 ? void 0 : current.parentElement;
550
554
  }
551
555
  return matchedParent;
552
556
  }
@@ -37,8 +37,9 @@ export class LazyWalker extends Eventify {
37
37
  this.idleId = 0;
38
38
  }
39
39
  startIdleRequest() {
40
+ var _a;
40
41
  this.idleId = this.async.requestIdleCallback(this.workPerform, {
41
- timeout: this.options.timeout ?? 10
42
+ timeout: (_a = this.options.timeout) !== null && _a !== void 0 ? _a : 10
42
43
  });
43
44
  }
44
45
  break(reason) {
@@ -65,10 +66,11 @@ export class LazyWalker extends Eventify {
65
66
  this.stop();
66
67
  }
67
68
  workPerform(deadline) {
69
+ var _a;
68
70
  if (this.workNodes) {
69
71
  this.isWorked = true;
70
72
  let count = 0;
71
- const chunkSize = this.options.timeoutChunkSize ?? 50;
73
+ const chunkSize = (_a = this.options.timeoutChunkSize) !== null && _a !== void 0 ? _a : 50;
72
74
  while (!this.isFinished &&
73
75
  (deadline.timeRemaining() > 0 ||
74
76
  (deadline.didTimeout && count <= chunkSize))) {
@@ -91,12 +93,13 @@ export class LazyWalker extends Eventify {
91
93
  }
92
94
  }
93
95
  visitNode(nodeElm) {
96
+ var _a;
94
97
  if (!nodeElm ||
95
98
  (this.options.whatToShow !== undefined &&
96
99
  nodeElm.nodeType !== this.options.whatToShow)) {
97
100
  return false;
98
101
  }
99
- return this.emit('visit', nodeElm) ?? false;
102
+ return (_a = this.emit('visit', nodeElm)) !== null && _a !== void 0 ? _a : false;
100
103
  }
101
104
  }
102
105
  __decorate([
@@ -15,7 +15,7 @@ import { defaultNameSpace, EventHandlersStore } from "./store.js";
15
15
  */
16
16
  export class EventEmitter {
17
17
  mute(event) {
18
- this.__mutedEvents.add(event ?? '*');
18
+ this.__mutedEvents.add(event !== null && event !== void 0 ? event : '*');
19
19
  return this;
20
20
  }
21
21
  isMuted(event) {
@@ -25,7 +25,7 @@ export class EventEmitter {
25
25
  return this.__mutedEvents.has('*');
26
26
  }
27
27
  unmute(event) {
28
- this.__mutedEvents.delete(event ?? '*');
28
+ this.__mutedEvents.delete(event !== null && event !== void 0 ? event : '*');
29
29
  return this;
30
30
  }
31
31
  __eachEvent(events, callback) {
@@ -163,6 +163,7 @@ export class EventEmitter {
163
163
  };
164
164
  }
165
165
  this.__eachEvent(events, (event, namespace) => {
166
+ var _a, _b;
166
167
  if (event.length === 0) {
167
168
  throw error('Need event name');
168
169
  }
@@ -172,14 +173,14 @@ export class EventEmitter {
172
173
  originalCallback: callback,
173
174
  syntheticCallback
174
175
  };
175
- store.set(event, namespace, block, options?.top);
176
+ store.set(event, namespace, block, options === null || options === void 0 ? void 0 : options.top);
176
177
  if (isDOMElement(subject)) {
177
178
  const eOpts = PASSIVE_EVENTS.has(event)
178
179
  ? {
179
180
  passive: true,
180
- capture: options?.capture ?? false
181
+ capture: (_a = options === null || options === void 0 ? void 0 : options.capture) !== null && _a !== void 0 ? _a : false
181
182
  }
182
- : (options?.capture ?? false);
183
+ : ((_b = options === null || options === void 0 ? void 0 : options.capture) !== null && _b !== void 0 ? _b : false);
183
184
  syntheticCallback.options = eOpts;
184
185
  subject.addEventListener(event, syntheticCallback, eOpts);
185
186
  this.__memoryDOMSubjectToHandler(subject, syntheticCallback);
@@ -259,8 +260,9 @@ export class EventEmitter {
259
260
  return this;
260
261
  }
261
262
  const removeEventListener = (block) => {
263
+ var _a;
262
264
  if (isDOMElement(subject)) {
263
- subject.removeEventListener(block.event, block.syntheticCallback, block.syntheticCallback.options ?? false);
265
+ subject.removeEventListener(block.event, block.syntheticCallback, (_a = block.syntheticCallback.options) !== null && _a !== void 0 ? _a : false);
264
266
  this.__unmemoryDOMSubjectToHandler(subject, block.syntheticCallback);
265
267
  }
266
268
  }, removeCallbackFromNameSpace = (event, namespace) => {
@@ -30,15 +30,17 @@ export class Eventify {
30
30
  this.__map = new Map();
31
31
  }
32
32
  on(name, func) {
33
+ var _a;
33
34
  if (!this.__map.has(name)) {
34
35
  this.__map.set(name, new Set());
35
36
  }
36
- this.__map.get(name)?.add(func);
37
+ (_a = this.__map.get(name)) === null || _a === void 0 ? void 0 : _a.add(func);
37
38
  return this;
38
39
  }
39
40
  off(name, func) {
41
+ var _a;
40
42
  if (this.__map.has(name)) {
41
- this.__map.get(name)?.delete(func);
43
+ (_a = this.__map.get(name)) === null || _a === void 0 ? void 0 : _a.delete(func);
42
44
  }
43
45
  return this;
44
46
  }
@@ -46,9 +48,10 @@ export class Eventify {
46
48
  this.__map.clear();
47
49
  }
48
50
  emit(name, ...args) {
51
+ var _a;
49
52
  let result;
50
53
  if (this.__map.has(name)) {
51
- this.__map.get(name)?.forEach(cb => {
54
+ (_a = this.__map.get(name)) === null || _a === void 0 ? void 0 : _a.forEach(cb => {
52
55
  result = cb(...args);
53
56
  });
54
57
  }
@@ -117,7 +117,7 @@ export function observable(obj) {
117
117
  rs.push(`change.${sum.join('.')}`);
118
118
  return rs;
119
119
  }, [])
120
- ], prefix.join('.'), oldValue, value?.valueOf
120
+ ], prefix.join('.'), oldValue, (value === null || value === void 0 ? void 0 : value.valueOf)
121
121
  ? value.valueOf()
122
122
  : value);
123
123
  }
@@ -95,12 +95,10 @@ export function getContainer(jodit, classFunc, tag = 'div', createInsideEditor =
95
95
  * @internal
96
96
  */
97
97
  export function getPopupViewRoot(o, container, defaultRoot) {
98
- return (o.popupRoot ??
99
- o.shadowRoot ??
100
- Dom.closest(container, parentElement => Dom.isHTMLElement(parentElement) &&
101
- (Dom.isTag(parentElement, 'dialog') ||
102
- ['fixed', 'absolute'].includes(css(parentElement, 'position'))), defaultRoot) ??
103
- defaultRoot);
98
+ var _a, _b, _c;
99
+ return ((_c = (_b = (_a = o.popupRoot) !== null && _a !== void 0 ? _a : o.shadowRoot) !== null && _b !== void 0 ? _b : Dom.closest(container, parentElement => Dom.isHTMLElement(parentElement) &&
100
+ (Dom.isTag(parentElement, 'dialog') ||
101
+ ['fixed', 'absolute'].includes(css(parentElement, 'position'))), defaultRoot)) !== null && _c !== void 0 ? _c : defaultRoot);
104
102
  }
105
103
  /**
106
104
  * Global event emitter
@@ -18,8 +18,9 @@ import { reset } from "../utils/reset.js";
18
18
  * ```
19
19
  */
20
20
  export const toArray = function toArray(...args) {
21
+ var _a;
21
22
  const func = isNativeFunction(Array.from)
22
23
  ? Array.from
23
- : (reset('Array.from') ?? Array.from);
24
+ : ((_a = reset('Array.from')) !== null && _a !== void 0 ? _a : Array.from);
24
25
  return func.apply(Array, args);
25
26
  };
@@ -86,7 +86,7 @@ export function applyStyles(html) {
86
86
  : '';
87
87
  }
88
88
  }
89
- catch {
89
+ catch (_a) {
90
90
  }
91
91
  finally {
92
92
  Dom.safeRemove(iframe);
@@ -8,6 +8,7 @@ import { isJoditObject } from "../checker/is-jodit-object.js";
8
8
  * Calculate screen element position
9
9
  */
10
10
  export function position(elm, jodit, recurse = false) {
11
+ var _a, _b;
11
12
  const rect = elm.getBoundingClientRect();
12
13
  let xPos = rect.left, yPos = rect.top;
13
14
  if (isJoditObject(jodit) &&
@@ -21,7 +22,7 @@ export function position(elm, jodit, recurse = false) {
21
22
  return {
22
23
  left: Math.round(xPos),
23
24
  top: Math.round(yPos),
24
- width: Math.round(elm.offsetWidth ?? rect.width),
25
- height: Math.round(elm.offsetHeight ?? rect.height)
25
+ width: Math.round((_a = elm.offsetWidth) !== null && _a !== void 0 ? _a : rect.width),
26
+ height: Math.round((_b = elm.offsetHeight) !== null && _b !== void 0 ? _b : rect.height)
26
27
  };
27
28
  }
@@ -57,9 +57,9 @@ export function i18n(key, params, options) {
57
57
  if (!key.length) {
58
58
  return key;
59
59
  }
60
- const debug = Boolean(options?.debugLanguage);
60
+ const debug = Boolean(options === null || options === void 0 ? void 0 : options.debugLanguage);
61
61
  let store = {};
62
- const parse = (value) => params && params.length ? sprintf(value, params) : value, defaultLanguage = defineLanguage(Config.defaultOptions.language, Config.defaultOptions.language), language = defineLanguage(options?.language, defaultLanguage), tryGet = (store) => {
62
+ const parse = (value) => params && params.length ? sprintf(value, params) : value, defaultLanguage = defineLanguage(Config.defaultOptions.language, Config.defaultOptions.language), language = defineLanguage(options === null || options === void 0 ? void 0 : options.language, defaultLanguage), tryGet = (store) => {
63
63
  if (!store) {
64
64
  return;
65
65
  }
@@ -87,7 +87,7 @@ export function i18n(key, params, options) {
87
87
  store = lang.en;
88
88
  }
89
89
  }
90
- const i18nOvr = options?.i18n;
90
+ const i18nOvr = options === null || options === void 0 ? void 0 : options.i18n;
91
91
  if (i18nOvr && i18nOvr[language]) {
92
92
  const result = tryGet(i18nOvr[language]);
93
93
  if (result) {
@@ -6,10 +6,11 @@
6
6
  import { isFunction } from "../checker/is-function.js";
7
7
  export const keepNames = new Map();
8
8
  export const getClassName = (obj) => {
9
+ var _a;
9
10
  if (isFunction(obj.className)) {
10
11
  return obj.className();
11
12
  }
12
- const constructor = obj.constructor?.originalConstructor || obj.constructor;
13
+ const constructor = ((_a = obj.constructor) === null || _a === void 0 ? void 0 : _a.originalConstructor) || obj.constructor;
13
14
  if (keepNames.has(constructor)) {
14
15
  return keepNames.get(constructor);
15
16
  }
@@ -38,7 +38,7 @@ export function get(chain, obj) {
38
38
  result = result[part];
39
39
  }
40
40
  }
41
- catch {
41
+ catch (_a) {
42
42
  return null; // permission denied ore another access exception
43
43
  }
44
44
  if (isVoid(result)) {
@@ -30,7 +30,8 @@ function fixedAssetsSizeAndAbsoluteLinks(editor, points) {
30
30
  item.src = a.href;
31
31
  Dom.safeRemove(a);
32
32
  restoreAttributes.push(() => {
33
- item.src = previousAttrs[2] ?? '';
33
+ var _a;
34
+ item.src = (_a = previousAttrs[2]) !== null && _a !== void 0 ? _a : '';
34
35
  attr(item, {
35
36
  width: previousAttrs[0] || null,
36
37
  height: previousAttrs[1] || null
@@ -141,13 +142,13 @@ export function previewBox(editor, defaultValue, points = 'px', container = null
141
142
  try {
142
143
  box.appendChild(newNode);
143
144
  }
144
- catch { }
145
+ catch (_a) { }
145
146
  }
146
147
  else {
147
148
  try {
148
149
  box.appendChild(c.cloneNode(true));
149
150
  }
150
- catch { }
151
+ catch (_b) { }
151
152
  }
152
153
  }
153
154
  };
@@ -16,6 +16,7 @@ const map = {};
16
16
  * You must use the function derived from the method immediately as its iframe is being removed
17
17
  */
18
18
  export function reset(key) {
19
+ var _a, _b;
19
20
  if (!(key in map)) {
20
21
  const iframe = globalDocument.createElement('iframe');
21
22
  try {
@@ -35,8 +36,8 @@ export function reset(key) {
35
36
  }
36
37
  }
37
38
  finally {
38
- iframe.parentNode?.removeChild(iframe);
39
+ (_a = iframe.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(iframe);
39
40
  }
40
41
  }
41
- return map[key] ?? null;
42
+ return (_b = map[key]) !== null && _b !== void 0 ? _b : null;
42
43
  }
@@ -114,7 +114,7 @@ export function resolveElement(element, od) {
114
114
  try {
115
115
  resolved = od.querySelector(element);
116
116
  }
117
- catch {
117
+ catch (_a) {
118
118
  throw error('String "' + element + '" should be valid HTML selector');
119
119
  }
120
120
  }
@@ -35,7 +35,7 @@ export function callPromise(condition, callback) {
35
35
  .then(resp => resp, () => null)
36
36
  .finally(callback);
37
37
  }
38
- return callback?.();
38
+ return callback === null || callback === void 0 ? void 0 : callback();
39
39
  }
40
40
  /**
41
41
  * Allow load image in promise
@@ -43,7 +43,7 @@ export function callPromise(condition, callback) {
43
43
  export const loadImage = (src, jodit) => jodit.async.promise((res, rej) => {
44
44
  const image = new Image(), onError = () => {
45
45
  jodit.e.off(image);
46
- rej?.();
46
+ rej === null || rej === void 0 ? void 0 : rej();
47
47
  }, onSuccess = () => {
48
48
  jodit.e.off(image);
49
49
  res(image);
@@ -71,8 +71,9 @@ export const keys = (obj, own = true) => {
71
71
  * Memorize last user chose
72
72
  */
73
73
  export const memorizeExec = (editor, _, { control }, preProcessValue) => {
74
+ var _a;
74
75
  const key = `button${control.command}`;
75
- let value = (control.args && control.args[0]) ?? dataBind(editor, key);
76
+ let value = (_a = (control.args && control.args[0])) !== null && _a !== void 0 ? _a : dataBind(editor, key);
76
77
  if (isVoid(value)) {
77
78
  return false;
78
79
  }
@@ -80,7 +81,7 @@ export const memorizeExec = (editor, _, { control }, preProcessValue) => {
80
81
  if (preProcessValue) {
81
82
  value = preProcessValue(value);
82
83
  }
83
- editor.execCommand(control.command, false, value ?? undefined);
84
+ editor.execCommand(control.command, false, value !== null && value !== void 0 ? value : undefined);
84
85
  };
85
86
  /**
86
87
  * Get DataTransfer from different event types
@@ -92,7 +93,7 @@ export const getDataTransfer = (event) => {
92
93
  try {
93
94
  return event.dataTransfer || new DataTransfer();
94
95
  }
95
- catch {
96
+ catch (_a) {
96
97
  return null;
97
98
  }
98
99
  };
@@ -77,7 +77,7 @@ export class PluginSystem {
77
77
  if (disableList.has(name) || doneList.has(name)) {
78
78
  return;
79
79
  }
80
- const requires = plugin?.requires;
80
+ const requires = plugin === null || plugin === void 0 ? void 0 : plugin.requires;
81
81
  if (requires && isArray(requires) && requires.length) {
82
82
  if (requires.some(req => disableList.has(req))) {
83
83
  return;