jodit 4.6.1 → 4.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +2 -2
  4. package/es2015/jodit.js +46 -13
  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 +46 -13
  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 +46 -13
  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 +46 -13
  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/415.fat.min.js +1 -1
  43. package/es5/415.min.js +1 -1
  44. package/es5/5.fat.min.js +1 -1
  45. package/es5/5.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 +51 -14
  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/constants.d.ts +7 -0
  58. package/esm/core/constants.js +31 -11
  59. package/esm/core/helpers/utils/append-script.js +1 -1
  60. package/esm/core/plugin/helpers/load.js +2 -0
  61. package/esm/core/view/view.d.ts +4 -0
  62. package/esm/core/view/view.js +10 -1
  63. package/esm/types/view.d.ts +6 -1
  64. package/package.json +1 -1
  65. package/types/core/constants.d.ts +7 -0
  66. package/types/core/view/view.d.ts +4 -0
  67. package/types/types/view.d.ts +6 -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.6.1
4
+ * Version: v4.6.2
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.6.1
4
+ * Version: v4.6.2
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.6.1
4
+ * Version: v4.6.2
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.6.1
4
+ * Version: v4.6.2
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.6.1
4
+ * Version: v4.6.2
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.6.1
4
+ * Version: v4.6.2
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -130,7 +130,14 @@ export declare const INSERT_ONLY_TEXT = "insert_only_text";
130
130
  export declare const SAFE_COUNT_CHANGE_CALL = 10;
131
131
  export declare const IS_MAC: boolean;
132
132
  export declare const KEY_ALIASES: IDictionary<string>;
133
+ /**
134
+ * Path to the current script
135
+ */
133
136
  export declare const BASE_PATH: string;
137
+ /**
138
+ * Current script is minified
139
+ */
140
+ export declare const BASE_PATH_IS_MIN: boolean;
134
141
  export declare const TEMP_ATTR = "data-jodit-temp";
135
142
  export declare const lang: IDictionary<IDictionary<string>>;
136
143
  export declare const CLIPBOARD_ID = "clipboard";
@@ -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.6.1";
6
+ export const APP_VERSION = "4.6.2";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -175,17 +175,29 @@ export const KEY_ALIASES = {
175
175
  win: 'meta',
176
176
  windows: 'meta'
177
177
  };
178
- export const BASE_PATH = (() => {
179
- if (typeof document === 'undefined') {
180
- return '';
178
+ const removeScriptName = (src) => {
179
+ const parts = src.split('/');
180
+ const isMin = typeof false === 'boolean'
181
+ ? false : /\.min\.js/.test(src);
182
+ if (/\.js/.test(parts[parts.length - 1])) {
183
+ return {
184
+ basePath: parts.slice(0, parts.length - 1).join('/') + '/',
185
+ isMin
186
+ };
181
187
  }
182
- const script = globalDocument.currentScript, removeScriptName = (s) => {
183
- const parts = s.split('/');
184
- if (/\.js/.test(parts[parts.length - 1])) {
185
- return parts.slice(0, parts.length - 1).join('/') + '/';
186
- }
187
- return s;
188
+ return {
189
+ basePath: src,
190
+ isMin
188
191
  };
192
+ };
193
+ const { basePath, isMin } = (() => {
194
+ if (typeof document === 'undefined') {
195
+ return {
196
+ basePath: '',
197
+ isMin: Boolean(false)
198
+ };
199
+ }
200
+ const script = globalDocument.currentScript;
189
201
  if (script) {
190
202
  return removeScriptName(script.src);
191
203
  }
@@ -193,8 +205,16 @@ export const BASE_PATH = (() => {
193
205
  if (scripts && scripts.length) {
194
206
  return removeScriptName(scripts[scripts.length - 1].src);
195
207
  }
196
- return globalWindow.location.href;
208
+ return removeScriptName(globalWindow.location.href);
197
209
  })();
210
+ /**
211
+ * Path to the current script
212
+ */
213
+ export const BASE_PATH = basePath;
214
+ /**
215
+ * Current script is minified
216
+ */
217
+ export const BASE_PATH_IS_MIN = isMin;
198
218
  export const TEMP_ATTR = 'data-jodit-temp';
199
219
  export const lang = {};
200
220
  export const CLIPBOARD_ID = 'clipboard';
@@ -31,8 +31,8 @@ export const appendScriptAsync = cacheLoaders((jodit, url) => {
31
31
  async: true,
32
32
  src: completeUrl(url)
33
33
  });
34
+ jodit.e.one(script, 'error', reject).one(script, 'load', resolve);
34
35
  jodit.od.body.appendChild(script);
35
- jodit.e.on(script, 'error', reject).on(script, 'load', resolve);
36
36
  });
37
37
  });
38
38
  /**
@@ -25,11 +25,13 @@ export async function loadStyle(jodit, pluginName) {
25
25
  */
26
26
  function getFullUrl(jodit, name, js) {
27
27
  name = kebabCase(name);
28
+ const min = jodit.minified ? '.min' : '';
28
29
  return (jodit.basePath +
29
30
  'plugins/' +
30
31
  name +
31
32
  '/' +
32
33
  name +
34
+ min +
33
35
  '.' +
34
36
  (js ? 'js' : 'css'));
35
37
  }
@@ -31,6 +31,10 @@ export declare abstract class View extends Component implements IViewBased, Mods
31
31
  * Get a path for loading extra staff
32
32
  */
33
33
  get basePath(): string;
34
+ /**
35
+ * Plugin autoloader should load minified version of the file
36
+ */
37
+ get minified(): boolean;
34
38
  static readonly ES: 'es5' | 'es2015' | 'es2018' | 'es2021';
35
39
  static readonly version: string;
36
40
  static readonly esNext: boolean;
@@ -17,7 +17,7 @@ var View_1;
17
17
  import { ViewComponent } from "../component/index.js";
18
18
  import { Component } from "../component/component.js";
19
19
  import { STATUSES } from "../component/statuses.js";
20
- import { APP_VERSION, BASE_PATH, ES, IS_ES_MODERN, IS_ES_NEXT } from "../constants.js";
20
+ import { APP_VERSION, BASE_PATH, BASE_PATH_IS_MIN, ES, IS_ES_MODERN, IS_ES_NEXT } from "../constants.js";
21
21
  import { Create } from "../create/create.js";
22
22
  import { cache, cached } from "../decorators/cache/cache.js";
23
23
  import { derive } from "../decorators/derive/derive.js";
@@ -41,6 +41,15 @@ let View = View_1 = class View extends Component {
41
41
  }
42
42
  return BASE_PATH;
43
43
  }
44
+ /**
45
+ * Plugin autoloader should load minified version of the file
46
+ */
47
+ get minified() {
48
+ if (this.o.minified !== undefined) {
49
+ return this.o.minified;
50
+ }
51
+ return BASE_PATH_IS_MIN;
52
+ }
44
53
  /**
45
54
  * Return a default timeout period in milliseconds for some debounce or throttle functions.
46
55
  * By default, `{history.timeout}` options
@@ -42,7 +42,11 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
42
42
  cache?: boolean;
43
43
  getIcon?: (name: string, clearName: string) => CanUndef<string>;
44
44
  headerButtons?: string | Array<IControlType | string | ButtonsGroup>;
45
- basePath?: string;
45
+ readonly basePath?: string;
46
+ /**
47
+ * Plugin autoloader should load minified version of the file
48
+ */
49
+ readonly minified?: boolean;
46
50
  theme?: string;
47
51
  defaultTimeout?: number;
48
52
  disabled?: boolean;
@@ -71,6 +75,7 @@ interface IViewBased<T = IViewOptions> extends IContainer, IComponent, IMods, IE
71
75
  */
72
76
  readonly id: string;
73
77
  readonly basePath: string;
78
+ readonly minified: boolean;
74
79
  readonly isLocked: boolean;
75
80
  isLockedNotBy(name: string): boolean;
76
81
  lock(name?: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.6.1",
3
+ "version": "4.6.2",
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",
@@ -130,7 +130,14 @@ export declare const INSERT_ONLY_TEXT = "insert_only_text";
130
130
  export declare const SAFE_COUNT_CHANGE_CALL = 10;
131
131
  export declare const IS_MAC: boolean;
132
132
  export declare const KEY_ALIASES: IDictionary<string>;
133
+ /**
134
+ * Path to the current script
135
+ */
133
136
  export declare const BASE_PATH: string;
137
+ /**
138
+ * Current script is minified
139
+ */
140
+ export declare const BASE_PATH_IS_MIN: boolean;
134
141
  export declare const TEMP_ATTR = "data-jodit-temp";
135
142
  export declare const lang: IDictionary<IDictionary<string>>;
136
143
  export declare const CLIPBOARD_ID = "clipboard";
@@ -31,6 +31,10 @@ export declare abstract class View extends Component implements IViewBased, Mods
31
31
  * Get a path for loading extra staff
32
32
  */
33
33
  get basePath(): string;
34
+ /**
35
+ * Plugin autoloader should load minified version of the file
36
+ */
37
+ get minified(): boolean;
34
38
  static readonly ES: 'es5' | 'es2015' | 'es2018' | 'es2021';
35
39
  static readonly version: string;
36
40
  static readonly esNext: boolean;
@@ -42,7 +42,11 @@ interface IViewOptions extends ILanguageOptions, IToolbarOptions {
42
42
  cache?: boolean;
43
43
  getIcon?: (name: string, clearName: string) => CanUndef<string>;
44
44
  headerButtons?: string | Array<IControlType | string | ButtonsGroup>;
45
- basePath?: string;
45
+ readonly basePath?: string;
46
+ /**
47
+ * Plugin autoloader should load minified version of the file
48
+ */
49
+ readonly minified?: boolean;
46
50
  theme?: string;
47
51
  defaultTimeout?: number;
48
52
  disabled?: boolean;
@@ -71,6 +75,7 @@ interface IViewBased<T = IViewOptions> extends IContainer, IComponent, IMods, IE
71
75
  */
72
76
  readonly id: string;
73
77
  readonly basePath: string;
78
+ readonly minified: boolean;
74
79
  readonly isLocked: boolean;
75
80
  isLockedNotBy(name: string): boolean;
76
81
  lock(name?: string): boolean;