jodit 4.9.13 → 4.9.14

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 (58) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +13 -13
  4. package/es2015/jodit.js +172 -77
  5. package/es2015/jodit.min.js +5 -5
  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.fat.min.js +5 -5
  13. package/es2018/jodit.min.js +5 -5
  14. package/es2018/plugins/debug/debug.min.js +1 -1
  15. package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
  16. package/es2021/jodit.css +1 -1
  17. package/es2021/jodit.fat.min.js +6 -6
  18. package/es2021/jodit.js +172 -77
  19. package/es2021/jodit.min.js +6 -6
  20. package/es2021/plugins/debug/debug.css +1 -1
  21. package/es2021/plugins/debug/debug.js +1 -1
  22. package/es2021/plugins/debug/debug.min.js +1 -1
  23. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
  26. package/es2021.en/jodit.css +1 -1
  27. package/es2021.en/jodit.fat.min.js +7 -7
  28. package/es2021.en/jodit.js +172 -77
  29. package/es2021.en/jodit.min.js +6 -6
  30. package/es2021.en/plugins/debug/debug.css +1 -1
  31. package/es2021.en/plugins/debug/debug.js +1 -1
  32. package/es2021.en/plugins/debug/debug.min.js +1 -1
  33. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
  36. package/es5/jodit.css +2 -2
  37. package/es5/jodit.fat.min.js +2 -2
  38. package/es5/jodit.js +215 -117
  39. package/es5/jodit.min.css +2 -2
  40. package/es5/jodit.min.js +2 -2
  41. package/es5/plugins/debug/debug.css +1 -1
  42. package/es5/plugins/debug/debug.js +1 -1
  43. package/es5/plugins/debug/debug.min.js +1 -1
  44. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
  47. package/es5/polyfills.fat.min.js +1 -1
  48. package/es5/polyfills.js +1 -1
  49. package/es5/polyfills.min.js +1 -1
  50. package/esm/core/constants.js +1 -1
  51. package/esm/core/helpers/utils/utils.d.ts +10 -0
  52. package/esm/core/helpers/utils/utils.js +12 -0
  53. package/esm/modules/file-browser/data-provider.d.ts +4 -4
  54. package/esm/modules/file-browser/data-provider.js +83 -14
  55. package/esm/modules/image-editor/image-editor.js +13 -2
  56. package/package.json +1 -1
  57. package/types/core/helpers/utils/utils.d.ts +10 -0
  58. package/types/modules/file-browser/data-provider.d.ts +4 -4
@@ -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.9.13
4
+ * Version: v4.9.14
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.9.13
4
+ * Version: v4.9.14
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.9.13
4
+ * Version: v4.9.14
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.9.13
4
+ * Version: v4.9.14
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.9.13
4
+ * Version: v4.9.14
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.9.13
4
+ * Version: v4.9.14
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.9.13
4
+ * Version: v4.9.14
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
package/es5/polyfills.js CHANGED
@@ -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.9.13
4
+ * Version: v4.9.14
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.9.13
4
+ * Version: v4.9.14
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -3,7 +3,7 @@
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
- export const APP_VERSION = "4.9.13";
6
+ export const APP_VERSION = "4.9.14";
7
7
  // prettier-ignore
8
8
  export const ES = "es2020";
9
9
  export const IS_ES_MODERN = true;
@@ -17,6 +17,16 @@ import type { CanPromise, CanUndef, IControlType, IJodit, IViewBased, Nullable,
17
17
  * ```
18
18
  */
19
19
  export declare function call<T extends any[], R>(func: (...args: T) => R, ...args: T): R;
20
+ /**
21
+ * Call function with parameters
22
+ *
23
+ * @example
24
+ * ```js
25
+ * const f = Math.random();
26
+ * Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
27
+ * ```
28
+ */
29
+ export declare function callThis<This, T extends any[], R>(func: (this: This, ...args: T) => R, thisArg: This, ...args: T): R;
20
30
  /**
21
31
  * Mark element for debugging
22
32
  */
@@ -19,6 +19,18 @@ import { dataBind } from "./data-bind.js";
19
19
  export function call(func, ...args) {
20
20
  return func(...args);
21
21
  }
22
+ /**
23
+ * Call function with parameters
24
+ *
25
+ * @example
26
+ * ```js
27
+ * const f = Math.random();
28
+ * Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
29
+ * ```
30
+ */
31
+ export function callThis(func, thisArg, ...args) {
32
+ return func.apply(thisArg, args);
33
+ }
22
34
  /**
23
35
  * Mark element for debugging
24
36
  */
@@ -35,7 +35,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
35
35
  * Load items list by path and source
36
36
  */
37
37
  itemsEx(path: string, source: string, mods?: IFileBrowserDataProviderItemsMods): ReturnType<IFileBrowserDataProvider['itemsEx']>;
38
- private generateItemsList;
38
+ private __generateItemsList;
39
39
  tree(path: string, source: string): Promise<ISourcesFiles>;
40
40
  /**
41
41
  * Get path by url. You can use this method in another modules
@@ -63,7 +63,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
63
63
  * @param file - The filename
64
64
  * @param source - Source
65
65
  */
66
- private remove;
66
+ private __remove;
67
67
  /**
68
68
  * Deleting a file
69
69
  *
@@ -88,7 +88,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
88
88
  * @param newname - New name
89
89
  * @param source - Source
90
90
  */
91
- private rename;
91
+ private __rename;
92
92
  /**
93
93
  * Rename folder
94
94
  */
@@ -97,7 +97,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
97
97
  * Rename file
98
98
  */
99
99
  fileRename(path: string, name: string, newname: string, source: string): Promise<string>;
100
- private changeImage;
100
+ private __changeImage;
101
101
  /**
102
102
  * Send command to server to crop image
103
103
  */
@@ -3,9 +3,24 @@
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
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
7
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
9
+ r = Reflect.decorate(decorators, target, key, desc);
10
+ else
11
+ for (var i = decorators.length - 1; i >= 0; i--)
12
+ if (d = decorators[i])
13
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
14
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
15
+ };
6
16
  import { IS_PROD } from "../../core/constants.js";
7
- import { abort, ConfigProto, error, isFunction, normalizeRelativePath, set } from "../../core/helpers/index.js";
8
- import { Ajax } from "../../core/request/index.js";
17
+ import { autobind } from "../../core/decorators/autobind/autobind.js";
18
+ import { isFunction } from "../../core/helpers/checker/is-function.js";
19
+ import { normalizeRelativePath } from "../../core/helpers/normalize/normalize-relative-path.js";
20
+ import { ConfigProto } from "../../core/helpers/utils/config-proto.js";
21
+ import { abort, error } from "../../core/helpers/utils/error/index.js";
22
+ import { set } from "../../core/helpers/utils/set.js";
23
+ import { Ajax } from "../../core/request/ajax.js";
9
24
  import { FileBrowserItem } from "./builders/item.js";
10
25
  export const DEFAULT_SOURCE_NAME = 'default';
11
26
  const possibleRules = new Set([
@@ -142,7 +157,7 @@ export default class DataProvider {
142
157
  * Load items list by path and source
143
158
  */
144
159
  items(path, source, mods = {}) {
145
- return this.__items(path, source, mods, resp => this.generateItemsList(resp.data.sources, mods));
160
+ return this.__items(path, source, mods, resp => this.__generateItemsList(resp.data.sources, mods));
146
161
  }
147
162
  /**
148
163
  * Load items list by path and source
@@ -150,11 +165,11 @@ export default class DataProvider {
150
165
  itemsEx(path, source, mods = {}) {
151
166
  const calcTotal = (sources) => sources.reduce((acc, source) => acc + source.files.length, 0);
152
167
  return this.__items(path, source, mods, resp => ({
153
- items: this.generateItemsList(resp.data.sources, mods),
168
+ items: this.__generateItemsList(resp.data.sources, mods),
154
169
  loadedTotal: calcTotal(resp.data.sources)
155
170
  }));
156
171
  }
157
- generateItemsList(sources, mods = {}) {
172
+ __generateItemsList(sources, mods = {}) {
158
173
  const elements = [];
159
174
  const canBeFile = (item) => item.type === 'folder' ||
160
175
  !mods.onlyImages ||
@@ -269,7 +284,7 @@ export default class DataProvider {
269
284
  * @param file - The filename
270
285
  * @param source - Source
271
286
  */
272
- remove(action, path, file, source) {
287
+ __remove(action, path, file, source) {
273
288
  const fr = this.o[action];
274
289
  if (!fr) {
275
290
  throw error(`Set "${action}" api options`);
@@ -292,7 +307,7 @@ export default class DataProvider {
292
307
  * @param source - Source
293
308
  */
294
309
  fileRemove(path, file, source) {
295
- return this.remove('fileRemove', path, file, source);
310
+ return this.__remove('fileRemove', path, file, source);
296
311
  }
297
312
  /**
298
313
  * Deleting a folder
@@ -302,7 +317,7 @@ export default class DataProvider {
302
317
  * @param source - Source
303
318
  */
304
319
  folderRemove(path, file, source) {
305
- return this.remove('folderRemove', path, file, source);
320
+ return this.__remove('folderRemove', path, file, source);
306
321
  }
307
322
  /**
308
323
  * Rename action
@@ -312,7 +327,7 @@ export default class DataProvider {
312
327
  * @param newname - New name
313
328
  * @param source - Source
314
329
  */
315
- rename(action, path, name, newname, source) {
330
+ __rename(action, path, name, newname, source) {
316
331
  const fr = this.o[action];
317
332
  if (!fr) {
318
333
  throw error(`Set "${action}" api options`);
@@ -332,15 +347,15 @@ export default class DataProvider {
332
347
  * Rename folder
333
348
  */
334
349
  folderRename(path, name, newname, source) {
335
- return this.rename('folderRename', path, name, newname, source);
350
+ return this.__rename('folderRename', path, name, newname, source);
336
351
  }
337
352
  /**
338
353
  * Rename file
339
354
  */
340
355
  fileRename(path, name, newname, source) {
341
- return this.rename('fileRename', path, name, newname, source);
356
+ return this.__rename('fileRename', path, name, newname, source);
342
357
  }
343
- changeImage(type, path, source, name, newname, box) {
358
+ __changeImage(type, path, source, name, newname, box) {
344
359
  if (!this.o[type]) {
345
360
  this.o[type] = {
346
361
  data: {}
@@ -367,13 +382,13 @@ export default class DataProvider {
367
382
  * Send command to server to crop image
368
383
  */
369
384
  crop(path, source, name, newname, box) {
370
- return this.changeImage('crop', path, source, name, newname, box);
385
+ return this.__changeImage('crop', path, source, name, newname, box);
371
386
  }
372
387
  /**
373
388
  * Send command to server to resize image
374
389
  */
375
390
  resize(path, source, name, newname, box) {
376
- return this.changeImage('resize', path, source, name, newname, box);
391
+ return this.__changeImage('resize', path, source, name, newname, box);
377
392
  }
378
393
  getMessage(resp) {
379
394
  return this.options.getMessage(resp);
@@ -386,3 +401,57 @@ export default class DataProvider {
386
401
  this.__ajaxInstances.clear();
387
402
  }
388
403
  }
404
+ __decorate([
405
+ autobind
406
+ ], DataProvider.prototype, "onProgress", null);
407
+ __decorate([
408
+ autobind
409
+ ], DataProvider.prototype, "permissions", null);
410
+ __decorate([
411
+ autobind
412
+ ], DataProvider.prototype, "canI", null);
413
+ __decorate([
414
+ autobind
415
+ ], DataProvider.prototype, "items", null);
416
+ __decorate([
417
+ autobind
418
+ ], DataProvider.prototype, "itemsEx", null);
419
+ __decorate([
420
+ autobind
421
+ ], DataProvider.prototype, "tree", null);
422
+ __decorate([
423
+ autobind
424
+ ], DataProvider.prototype, "getPathByUrl", null);
425
+ __decorate([
426
+ autobind
427
+ ], DataProvider.prototype, "createFolder", null);
428
+ __decorate([
429
+ autobind
430
+ ], DataProvider.prototype, "move", null);
431
+ __decorate([
432
+ autobind
433
+ ], DataProvider.prototype, "fileRemove", null);
434
+ __decorate([
435
+ autobind
436
+ ], DataProvider.prototype, "folderRemove", null);
437
+ __decorate([
438
+ autobind
439
+ ], DataProvider.prototype, "folderRename", null);
440
+ __decorate([
441
+ autobind
442
+ ], DataProvider.prototype, "fileRename", null);
443
+ __decorate([
444
+ autobind
445
+ ], DataProvider.prototype, "crop", null);
446
+ __decorate([
447
+ autobind
448
+ ], DataProvider.prototype, "resize", null);
449
+ __decorate([
450
+ autobind
451
+ ], DataProvider.prototype, "getMessage", null);
452
+ __decorate([
453
+ autobind
454
+ ], DataProvider.prototype, "isSuccess", null);
455
+ __decorate([
456
+ autobind
457
+ ], DataProvider.prototype, "destruct", null);
@@ -17,7 +17,12 @@ var ImageEditor_1;
17
17
  import { ViewComponent } from "../../core/component/index.js";
18
18
  import { autobind, component, debounce, throttle } from "../../core/decorators/index.js";
19
19
  import { Dom } from "../../core/dom/index.js";
20
- import { $$, attr, call, css, refs, toArray, trim } from "../../core/helpers/index.js";
20
+ import { toArray } from "../../core/helpers/array/to-array.js";
21
+ import { trim } from "../../core/helpers/string/trim.js";
22
+ import { attr } from "../../core/helpers/utils/attr.js";
23
+ import { css } from "../../core/helpers/utils/css.js";
24
+ import { $$, refs } from "../../core/helpers/utils/selector.js";
25
+ import { call } from "../../core/helpers/utils/utils.js";
21
26
  import { Button } from "../../core/ui/button/index.js";
22
27
  import { Config } from "../../config.js";
23
28
  import "./config.js";
@@ -472,7 +477,13 @@ let ImageEditor = ImageEditor_1 = class ImageEditor extends ViewComponent {
472
477
  this.buttons = {
473
478
  reset: Button(this.j, 'update', 'Reset'),
474
479
  save: Button(this.j, 'save', 'Save'),
475
- saveas: Button(this.j, 'save', 'Save as ...')
480
+ saveas: Button(this.j, {
481
+ icon: {
482
+ name: 'save'
483
+ },
484
+ name: 'save-as',
485
+ text: 'Save as ...'
486
+ })
476
487
  };
477
488
  this.activeTab = o.resize ? TABS.resize : TABS.crop;
478
489
  this.editor = form(this.j, this.options);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.9.13",
3
+ "version": "4.9.14",
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",
@@ -17,6 +17,16 @@ import type { CanPromise, CanUndef, IControlType, IJodit, IViewBased, Nullable,
17
17
  * ```
18
18
  */
19
19
  export declare function call<T extends any[], R>(func: (...args: T) => R, ...args: T): R;
20
+ /**
21
+ * Call function with parameters
22
+ *
23
+ * @example
24
+ * ```js
25
+ * const f = Math.random();
26
+ * Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
27
+ * ```
28
+ */
29
+ export declare function callThis<This, T extends any[], R>(func: (this: This, ...args: T) => R, thisArg: This, ...args: T): R;
20
30
  /**
21
31
  * Mark element for debugging
22
32
  */
@@ -35,7 +35,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
35
35
  * Load items list by path and source
36
36
  */
37
37
  itemsEx(path: string, source: string, mods?: IFileBrowserDataProviderItemsMods): ReturnType<IFileBrowserDataProvider['itemsEx']>;
38
- private generateItemsList;
38
+ private __generateItemsList;
39
39
  tree(path: string, source: string): Promise<ISourcesFiles>;
40
40
  /**
41
41
  * Get path by url. You can use this method in another modules
@@ -63,7 +63,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
63
63
  * @param file - The filename
64
64
  * @param source - Source
65
65
  */
66
- private remove;
66
+ private __remove;
67
67
  /**
68
68
  * Deleting a file
69
69
  *
@@ -88,7 +88,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
88
88
  * @param newname - New name
89
89
  * @param source - Source
90
90
  */
91
- private rename;
91
+ private __rename;
92
92
  /**
93
93
  * Rename folder
94
94
  */
@@ -97,7 +97,7 @@ export default class DataProvider implements IFileBrowserDataProvider {
97
97
  * Rename file
98
98
  */
99
99
  fileRename(path: string, name: string, newname: string, source: string): Promise<string>;
100
- private changeImage;
100
+ private __changeImage;
101
101
  /**
102
102
  * Send command to server to crop image
103
103
  */