jodit 4.1.7 → 4.1.10

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 (75) hide show
  1. package/CHANGELOG.md +21 -5
  2. package/es2015/jodit.css +11 -2
  3. package/es2015/jodit.fat.min.css +1 -1
  4. package/es2015/jodit.fat.min.js +2 -2
  5. package/es2015/jodit.js +112 -82
  6. package/es2015/jodit.min.css +1 -1
  7. package/es2015/jodit.min.js +2 -2
  8. package/es2015/plugins/debug/debug.js +1 -1
  9. package/es2015/plugins/debug/debug.min.js +1 -1
  10. package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
  11. package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
  13. package/es2018/jodit.css +11 -2
  14. package/es2018/jodit.fat.min.css +1 -1
  15. package/es2018/jodit.fat.min.js +2 -2
  16. package/es2018/jodit.js +115 -85
  17. package/es2018/jodit.min.css +1 -1
  18. package/es2018/jodit.min.js +2 -2
  19. package/es2018/plugins/debug/debug.js +1 -1
  20. package/es2018/plugins/debug/debug.min.js +1 -1
  21. package/es2018/plugins/speech-recognize/speech-recognize.css +1 -1
  22. package/es2018/plugins/speech-recognize/speech-recognize.js +1 -1
  23. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  24. package/es2021/jodit.css +11 -2
  25. package/es2021/jodit.fat.min.css +1 -1
  26. package/es2021/jodit.fat.min.js +2 -2
  27. package/es2021/jodit.js +115 -85
  28. package/es2021/jodit.min.css +1 -1
  29. package/es2021/jodit.min.js +2 -2
  30. package/es2021/plugins/debug/debug.js +1 -1
  31. package/es2021/plugins/debug/debug.min.js +1 -1
  32. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  33. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  34. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  35. package/es2021.en/jodit.css +11 -2
  36. package/es2021.en/jodit.fat.min.css +1 -1
  37. package/es2021.en/jodit.fat.min.js +2 -2
  38. package/es2021.en/jodit.js +115 -85
  39. package/es2021.en/jodit.min.css +1 -1
  40. package/es2021.en/jodit.min.js +2 -2
  41. package/es2021.en/plugins/debug/debug.js +1 -1
  42. package/es2021.en/plugins/debug/debug.min.js +1 -1
  43. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  44. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  45. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  46. package/es5/jodit.css +12 -3
  47. package/es5/jodit.fat.min.css +1 -1
  48. package/es5/jodit.fat.min.js +2 -2
  49. package/es5/jodit.js +113 -88
  50. package/es5/jodit.min.css +3 -3
  51. package/es5/jodit.min.js +2 -2
  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 +4 -3
  58. package/esm/core/constants.js +1 -1
  59. package/esm/core/helpers/checker/index.d.ts +1 -0
  60. package/esm/core/helpers/checker/index.js +1 -0
  61. package/esm/core/helpers/checker/is-abort-error.d.ts +10 -0
  62. package/esm/core/helpers/checker/is-abort-error.js +10 -0
  63. package/esm/core/helpers/utils/error/error.d.ts +0 -2
  64. package/esm/core/helpers/utils/error/error.js +1 -7
  65. package/esm/core/helpers/utils/error/errors/abort-error.d.ts +13 -3
  66. package/esm/core/helpers/utils/error/errors/abort-error.js +7 -5
  67. package/esm/modules/file-browser/file-browser.js +3 -3
  68. package/esm/modules/messages/messages.js +3 -0
  69. package/esm/plugins/ai-assistant/ai-assistant.js +7 -3
  70. package/esm/plugins/ai-assistant/ui/ui-ai-assistant.js +1 -1
  71. package/package.json +1 -1
  72. package/types/core/helpers/checker/index.d.ts +1 -0
  73. package/types/core/helpers/checker/is-abort-error.d.ts +10 -0
  74. package/types/core/helpers/utils/error/error.d.ts +0 -2
  75. package/types/core/helpers/utils/error/errors/abort-error.d.ts +13 -3
@@ -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.1.7
4
+ * Version: v4.1.10
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.1.7
4
+ * Version: v4.1.10
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.1.7
4
+ * Version: v4.1.10
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.1.7
4
+ * Version: v4.1.10
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.1.7
4
+ * Version: v4.1.10
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -12,6 +12,7 @@ import { isPromise } from "jodit/esm/core/helpers/checker/is-promise.js";
12
12
  import { isString } from "jodit/esm/core/helpers/checker/is-string.js";
13
13
  import { isVoid } from "jodit/esm/core/helpers/checker/is-void.js";
14
14
  import { assert } from "jodit/esm/core/helpers/utils/assert.js";
15
+ import { abort } from "jodit/esm/core/helpers/utils/error/errors/abort-error.js";
15
16
  export class Async {
16
17
  constructor() {
17
18
  this.timers = new Map();
@@ -202,9 +203,9 @@ export class Async {
202
203
  promise(executor) {
203
204
  let rejectCallback = () => { };
204
205
  const promise = new Promise((resolve, reject) => {
205
- this.promisesRejections.add(reject);
206
- rejectCallback = () => reject(Error('Reject promise'));
207
- return executor(resolve, reject);
206
+ rejectCallback = () => reject(abort());
207
+ this.promisesRejections.add(rejectCallback);
208
+ executor(resolve, reject);
208
209
  });
209
210
  if (!promise.finally && typeof process !== 'undefined' && !IS_ES_NEXT) {
210
211
  promise.finally = (onfinally) => {
@@ -3,7 +3,7 @@
3
3
  * Released under MIT see LICENSE.txt in the project root for license information.
4
4
  * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
5
  */
6
- export const APP_VERSION = "4.1.7";
6
+ export const APP_VERSION = "4.1.10";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -7,6 +7,7 @@
7
7
  * @module helpers/checker
8
8
  */
9
9
  export * from "./has-browser-color-picker";
10
+ export * from "./is-abort-error";
10
11
  export * from "./is-array";
11
12
  export * from "./is-boolean";
12
13
  export * from "./is-equal";
@@ -7,6 +7,7 @@
7
7
  * @module helpers/checker
8
8
  */
9
9
  export * from "./has-browser-color-picker";
10
+ export * from "./is-abort-error";
10
11
  export * from "./is-array";
11
12
  export * from "./is-boolean";
12
13
  export * from "./is-equal";
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module helpers/checker
8
+ */
9
+ import type { AbortError } from "../utils/error/errors/abort-error";
10
+ export declare function isAbortError(error: unknown): error is AbortError;
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ export function isAbortError(error) {
7
+ return (Boolean(error) &&
8
+ error instanceof DOMException &&
9
+ error.name === 'AbortError');
10
+ }
@@ -9,5 +9,3 @@
9
9
  export declare function error(message: string): Error;
10
10
  export declare function connection(message: string): Error;
11
11
  export declare function options(message: string): Error;
12
- export declare function abort(message: string): Error;
13
- export declare function isAbort(error: unknown): boolean;
@@ -6,7 +6,7 @@
6
6
  /**
7
7
  * @module helpers/utils
8
8
  */
9
- import { AbortError, ConnectionError, OptionsError } from "./errors";
9
+ import { ConnectionError, OptionsError } from "./errors";
10
10
  /**
11
11
  * Helper for create Error object
12
12
  */
@@ -19,9 +19,3 @@ export function connection(message) {
19
19
  export function options(message) {
20
20
  return new OptionsError(message);
21
21
  }
22
- export function abort(message) {
23
- return new AbortError(message);
24
- }
25
- export function isAbort(error) {
26
- return error instanceof AbortError;
27
- }
@@ -6,6 +6,16 @@
6
6
  /**
7
7
  * @module helpers/utils
8
8
  */
9
- export declare class AbortError extends Error {
10
- constructor(m: string);
11
- }
9
+ import { isAbortError } from "jodit/esm/core/helpers/checker/is-abort-error";
10
+ /**
11
+ * `AbortError` is not a separate exception, but rather a {@link DOMException} with a special `name`.
12
+ * https://webidl.spec.whatwg.org/#aborterror
13
+ */
14
+ export type AbortError = DOMException & {
15
+ name: 'AbortError';
16
+ };
17
+ export declare function abort(message?: string): Error;
18
+ /**
19
+ * @deprecated use `isAbortError` instead
20
+ */
21
+ export declare const isAbort: typeof isAbortError;
@@ -6,9 +6,11 @@
6
6
  /**
7
7
  * @module helpers/utils
8
8
  */
9
- export class AbortError extends Error {
10
- constructor(m) {
11
- super(m);
12
- Object.setPrototypeOf(this, AbortError.prototype);
13
- }
9
+ import { isAbortError } from "jodit/esm/core/helpers/checker/is-abort-error.js";
10
+ export function abort(message = 'Aborted') {
11
+ return new DOMException(message, 'AbortError');
14
12
  }
13
+ /**
14
+ * @deprecated use `isAbortError` instead
15
+ */
16
+ export const isAbort = isAbortError;
@@ -18,7 +18,7 @@ import * as consts from "jodit/esm/core/constants.js";
18
18
  import { IS_PROD } from "jodit/esm/core/constants.js";
19
19
  import { autobind, cache, derive } from "jodit/esm/core/decorators/index.js";
20
20
  import { observable } from "jodit/esm/core/event-emitter/index.js";
21
- import { ConfigProto, error, isAbort, isFunction, isString, trim } from "jodit/esm/core/helpers/index.js";
21
+ import { ConfigProto, error, isAbortError, isFunction, isString, trim } from "jodit/esm/core/helpers/index.js";
22
22
  import { Storage } from "jodit/esm/core/storage/index.js";
23
23
  import { Dlgs } from "jodit/esm/core/traits/dlgs.js";
24
24
  import { ViewWithToolbar } from "jodit/esm/core/view/view-with-toolbar.js";
@@ -97,7 +97,7 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
97
97
  * ```
98
98
  */
99
99
  status(message, success) {
100
- if (!message || isAbort(message)) {
100
+ if (!message || isAbortError(message)) {
101
101
  return;
102
102
  }
103
103
  if (!isString(message)) {
@@ -212,7 +212,7 @@ let FileBrowser = class FileBrowser extends ViewWithToolbar {
212
212
  onlyImages: false
213
213
  });
214
214
  this.errorHandler = (resp) => {
215
- if (isAbort(resp)) {
215
+ if (isAbortError(resp)) {
216
216
  return;
217
217
  }
218
218
  if (resp instanceof Error) {
@@ -79,6 +79,9 @@ let UIMessages = class UIMessages extends UIGroup {
79
79
  this.async.updateTimeout(key, timeout || this.options.defaultTimeout);
80
80
  return;
81
81
  }
82
+ if (!this.__box) {
83
+ throw new Error('Container is not defined: ' + key);
84
+ }
82
85
  this.__box.appendChild(this.container);
83
86
  const msg = new UIMessage(this.j, { text, variant });
84
87
  this.append(msg);
@@ -15,6 +15,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
15
15
  };
16
16
  import watch from "jodit/esm/core/decorators/watch/watch.js";
17
17
  import { extendLang, pluginSystem } from "jodit/esm/core/global.js";
18
+ import { isAbortError } from "jodit/esm/core/helpers/checker/is-abort-error.js";
18
19
  import { Plugin } from "jodit/esm/core/plugin/plugin.js";
19
20
  import "./config";
20
21
  import { UiAiAssistant } from "./ui/ui-ai-assistant";
@@ -47,9 +48,9 @@ export class aiAssistant extends Plugin {
47
48
  closeOnClickOverlay: true,
48
49
  closeOnEsc: true,
49
50
  resizable: false,
50
- draggable: true,
51
- minWidth: 460,
52
- maxWidth: 460
51
+ draggable: true
52
+ // minWidth: 460,
53
+ // maxWidth: 460
53
54
  });
54
55
  dialog.bindDestruct(jodit);
55
56
  const container = new UiAiAssistant(jodit, {
@@ -88,6 +89,9 @@ export class aiAssistant extends Plugin {
88
89
  jodit.e.fire('ai-assistant-response', htmlFragment);
89
90
  })
90
91
  .catch(error => {
92
+ if (isAbortError(error)) {
93
+ return;
94
+ }
91
95
  jodit.message.error(error.message);
92
96
  jodit.e.fire('ai-assistant-error', error.message);
93
97
  });
@@ -144,7 +144,7 @@ __decorate([
144
144
  watch(':ai-assistant-error')
145
145
  ], UiAiAssistant.prototype, "onAiAssistentError", null);
146
146
  __decorate([
147
- watch('promptInput.nativeInput:input')
147
+ watch('promptInput:change')
148
148
  ], UiAiAssistant.prototype, "onChangePromptValue", null);
149
149
  UiAiAssistant = __decorate([
150
150
  component
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.1.7",
3
+ "version": "4.1.10",
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",
@@ -7,6 +7,7 @@
7
7
  * @module helpers/checker
8
8
  */
9
9
  export * from "./has-browser-color-picker";
10
+ export * from "./is-abort-error";
10
11
  export * from "./is-array";
11
12
  export * from "./is-boolean";
12
13
  export * from "./is-equal";
@@ -0,0 +1,10 @@
1
+ /*!
2
+ * Jodit Editor (https://xdsoft.net/jodit/)
3
+ * Released under MIT see LICENSE.txt in the project root for license information.
4
+ * Copyright (c) 2013-2024 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
5
+ */
6
+ /**
7
+ * @module helpers/checker
8
+ */
9
+ import type { AbortError } from "../utils/error/errors/abort-error";
10
+ export declare function isAbortError(error: unknown): error is AbortError;
@@ -9,5 +9,3 @@
9
9
  export declare function error(message: string): Error;
10
10
  export declare function connection(message: string): Error;
11
11
  export declare function options(message: string): Error;
12
- export declare function abort(message: string): Error;
13
- export declare function isAbort(error: unknown): boolean;
@@ -6,6 +6,16 @@
6
6
  /**
7
7
  * @module helpers/utils
8
8
  */
9
- export declare class AbortError extends Error {
10
- constructor(m: string);
11
- }
9
+ import { isAbortError } from "jodit/esm/core/helpers/checker/is-abort-error";
10
+ /**
11
+ * `AbortError` is not a separate exception, but rather a {@link DOMException} with a special `name`.
12
+ * https://webidl.spec.whatwg.org/#aborterror
13
+ */
14
+ export type AbortError = DOMException & {
15
+ name: 'AbortError';
16
+ };
17
+ export declare function abort(message?: string): Error;
18
+ /**
19
+ * @deprecated use `isAbortError` instead
20
+ */
21
+ export declare const isAbort: typeof isAbortError;