jodit 4.9.13 → 4.9.15

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 (64) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es2015/jodit.css +1 -1
  3. package/es2015/jodit.fat.min.js +13 -13
  4. package/es2015/jodit.js +184 -84
  5. package/es2015/jodit.min.js +6 -6
  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 +6 -6
  13. package/es2018/jodit.min.js +23 -23
  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 +7 -7
  18. package/es2021/jodit.js +184 -84
  19. package/es2021/jodit.min.js +7 -7
  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 +8 -8
  28. package/es2021.en/jodit.js +184 -84
  29. package/es2021.en/jodit.min.js +7 -7
  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 +227 -124
  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 +6 -6
  54. package/esm/modules/file-browser/data-provider.js +85 -16
  55. package/esm/modules/image-editor/image-editor.d.ts +1 -1
  56. package/esm/modules/image-editor/image-editor.js +16 -5
  57. package/esm/plugins/image-properties/utils/open-image-editor.js +4 -3
  58. package/esm/plugins/inline-popup/inline-popup.js +7 -1
  59. package/esm/types/file-browser.d.ts +3 -2
  60. package/package.json +1 -1
  61. package/types/core/helpers/utils/utils.d.ts +10 -0
  62. package/types/modules/file-browser/data-provider.d.ts +6 -6
  63. package/types/modules/image-editor/image-editor.d.ts +1 -1
  64. package/types/types/file-browser.d.ts +3 -2
@@ -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.15
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.15
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.15
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.15
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.15
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.15
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.15
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.15
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.15
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.15";
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,15 +97,15 @@ 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
  */
104
- crop(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean>;
104
+ crop(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean | string>;
105
105
  /**
106
106
  * Send command to server to resize image
107
107
  */
108
- resize(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean>;
108
+ resize(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean | string>;
109
109
  getMessage(resp: IFileBrowserAnswer): string;
110
110
  isSuccess(resp: IFileBrowserAnswer): boolean;
111
111
  destruct(): any;
@@ -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: {}
@@ -359,21 +374,21 @@ export default class DataProvider {
359
374
  query.data.path = path;
360
375
  query.data.name = name;
361
376
  query.data.source = source;
362
- return this.get(type).then(() => {
363
- return true;
377
+ return this.get(type).then(resp => {
378
+ return resp.data.newPath || true;
364
379
  });
365
380
  }
366
381
  /**
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);
@@ -115,5 +115,5 @@ export declare class ImageEditor extends ViewComponent<IViewWithToolbar & IDlgs>
115
115
  */
116
116
  export declare function openImageEditor(this: IViewWithToolbar & {
117
117
  dataProvider: IFileBrowserDataProvider;
118
- }, href: string, name: string, path: string, source: string, onSuccess?: () => void, onFailed?: (error: Error) => void): Promise<IDialog>;
118
+ }, href: string, name: string, path: string, source: string, onSuccess?: (newPath?: string) => void, onFailed?: (error: Error) => void): Promise<IDialog>;
119
119
  export {};
@@ -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);
@@ -560,11 +571,11 @@ export function openImageEditor(href, name, path, source, onSuccess, onFailed) {
560
571
  return this.getInstance('ImageEditor', this.o).open(href, (newname, box, success, failed) => call(box.action === 'resize'
561
572
  ? this.dataProvider.resize
562
573
  : this.dataProvider.crop, path, source, name, newname, box.box)
563
- .then(ok => {
564
- if (ok) {
574
+ .then(result => {
575
+ if (result) {
565
576
  success();
566
577
  if (onSuccess) {
567
- onSuccess();
578
+ onSuccess(typeof result === 'string' ? result : undefined);
568
579
  }
569
580
  }
570
581
  })
@@ -35,11 +35,12 @@ export function openImageEditorDialog(j, state) {
35
35
  j.filebrowser.dataProvider
36
36
  .getPathByUrl(a.href.toString())
37
37
  .then(resp => {
38
- openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, () => {
38
+ openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, (newPath) => {
39
39
  const timestamp = new Date().getTime();
40
+ const newUrl = newPath || url;
40
41
  state.values.imageSrc =
41
- url +
42
- (url.indexOf('?') !== -1 ? '' : '?') +
42
+ newUrl +
43
+ (newUrl.indexOf('?') !== -1 ? '' : '?') +
43
44
  '&_tmp=' +
44
45
  timestamp.toString();
45
46
  }, error => {
@@ -68,7 +68,13 @@ export class inlinePopup extends Plugin {
68
68
  content = data;
69
69
  }
70
70
  if (isArray(content)) {
71
- this.toolbar.build(content, target);
71
+ const disabled = this.j.o.toolbarInlineDisabledButtons;
72
+ this.toolbar.build(disabled.length
73
+ ? content.filter(item => {
74
+ const name = isString(item) ? item : item.name;
75
+ return !disabled.includes(name !== null && name !== void 0 ? name : '');
76
+ })
77
+ : content, target);
72
78
  this.toolbar.buttonSize = this.j.o.toolbarButtonSize;
73
79
  content = this.toolbar.container;
74
80
  }
@@ -48,6 +48,7 @@ export interface IFileBrowserAnswer {
48
48
  title?: string;
49
49
  source: string;
50
50
  permissions?: IPermissions | null;
51
+ newPath?: string;
51
52
  };
52
53
  }
53
54
  export interface IFileBrowserProcessor {
@@ -170,8 +171,8 @@ export interface IFileBrowserDataProvider extends IDestructible {
170
171
  folderRemove(path: string, file: string, source: string): Promise<string>;
171
172
  folderRename(path: string, name: string, newname: string, source: string): Promise<string>;
172
173
  fileRename(path: string, name: string, newname: string, source: string): Promise<string>;
173
- resize(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean>;
174
- crop(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean>;
174
+ resize(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean | string>;
175
+ crop(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean | string>;
175
176
  canI(action: string): boolean;
176
177
  isSuccess: (resp: IFileBrowserAnswer) => boolean;
177
178
  getMessage: (resp: IFileBrowserAnswer) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jodit",
3
- "version": "4.9.13",
3
+ "version": "4.9.15",
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,15 +97,15 @@ 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
  */
104
- crop(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean>;
104
+ crop(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean | string>;
105
105
  /**
106
106
  * Send command to server to resize image
107
107
  */
108
- resize(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean>;
108
+ resize(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean | string>;
109
109
  getMessage(resp: IFileBrowserAnswer): string;
110
110
  isSuccess(resp: IFileBrowserAnswer): boolean;
111
111
  destruct(): any;
@@ -115,5 +115,5 @@ export declare class ImageEditor extends ViewComponent<IViewWithToolbar & IDlgs>
115
115
  */
116
116
  export declare function openImageEditor(this: IViewWithToolbar & {
117
117
  dataProvider: IFileBrowserDataProvider;
118
- }, href: string, name: string, path: string, source: string, onSuccess?: () => void, onFailed?: (error: Error) => void): Promise<IDialog>;
118
+ }, href: string, name: string, path: string, source: string, onSuccess?: (newPath?: string) => void, onFailed?: (error: Error) => void): Promise<IDialog>;
119
119
  export {};
@@ -48,6 +48,7 @@ export interface IFileBrowserAnswer {
48
48
  title?: string;
49
49
  source: string;
50
50
  permissions?: IPermissions | null;
51
+ newPath?: string;
51
52
  };
52
53
  }
53
54
  export interface IFileBrowserProcessor {
@@ -170,8 +171,8 @@ export interface IFileBrowserDataProvider extends IDestructible {
170
171
  folderRemove(path: string, file: string, source: string): Promise<string>;
171
172
  folderRename(path: string, name: string, newname: string, source: string): Promise<string>;
172
173
  fileRename(path: string, name: string, newname: string, source: string): Promise<string>;
173
- resize(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean>;
174
- crop(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean>;
174
+ resize(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean | string>;
175
+ crop(path: string, source: string, name: string, newname: string | void, box: ImageBox | void): Promise<boolean | string>;
175
176
  canI(action: string): boolean;
176
177
  isSuccess: (resp: IFileBrowserAnswer) => boolean;
177
178
  getMessage: (resp: IFileBrowserAnswer) => string;