jodit 4.7.4 → 4.7.6

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 (65) hide show
  1. package/CHANGELOG.md +87 -31
  2. package/README.md +4 -18
  3. package/es2015/jodit.css +1 -1
  4. package/es2015/jodit.fat.min.js +8 -8
  5. package/es2015/jodit.js +103 -148
  6. package/es2015/jodit.min.js +7 -7
  7. package/es2015/plugins/debug/debug.css +1 -1
  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 +9 -3
  12. package/es2015/plugins/speech-recognize/speech-recognize.min.js +2 -2
  13. package/es2018/jodit.fat.min.js +8 -8
  14. package/es2018/jodit.min.js +7 -7
  15. package/es2018/plugins/debug/debug.min.js +1 -1
  16. package/es2018/plugins/speech-recognize/speech-recognize.min.js +2 -2
  17. package/es2021/jodit.css +1 -1
  18. package/es2021/jodit.fat.min.js +11 -11
  19. package/es2021/jodit.js +103 -148
  20. package/es2021/jodit.min.js +10 -10
  21. package/es2021/plugins/debug/debug.css +1 -1
  22. package/es2021/plugins/debug/debug.js +1 -1
  23. package/es2021/plugins/debug/debug.min.js +1 -1
  24. package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
  25. package/es2021/plugins/speech-recognize/speech-recognize.js +9 -3
  26. package/es2021/plugins/speech-recognize/speech-recognize.min.js +2 -2
  27. package/es2021.en/jodit.css +1 -1
  28. package/es2021.en/jodit.fat.min.js +12 -12
  29. package/es2021.en/jodit.js +103 -148
  30. package/es2021.en/jodit.min.js +11 -11
  31. package/es2021.en/plugins/debug/debug.css +1 -1
  32. package/es2021.en/plugins/debug/debug.js +1 -1
  33. package/es2021.en/plugins/debug/debug.min.js +1 -1
  34. package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
  35. package/es2021.en/plugins/speech-recognize/speech-recognize.js +9 -3
  36. package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +2 -2
  37. package/es5/jodit.css +2 -2
  38. package/es5/jodit.fat.min.js +2 -2
  39. package/es5/jodit.js +106 -152
  40. package/es5/jodit.min.css +2 -2
  41. package/es5/jodit.min.js +2 -2
  42. package/es5/plugins/debug/debug.css +1 -1
  43. package/es5/plugins/debug/debug.js +1 -1
  44. package/es5/plugins/debug/debug.min.js +1 -1
  45. package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
  46. package/es5/plugins/speech-recognize/speech-recognize.js +9 -3
  47. package/es5/plugins/speech-recognize/speech-recognize.min.js +2 -2
  48. package/es5/polyfills.fat.min.js +1 -1
  49. package/es5/polyfills.js +1 -1
  50. package/es5/polyfills.min.js +1 -1
  51. package/esm/core/constants.js +1 -1
  52. package/esm/core/decorators/autobind/autobind.d.ts +19 -1
  53. package/esm/core/decorators/autobind/autobind.js +40 -1
  54. package/esm/modules/file-browser/data-provider.js +2 -17
  55. package/esm/modules/uploader/helpers/send.js +17 -11
  56. package/esm/modules/widget/file-selector/file-selector.js +5 -3
  57. package/esm/plugins/resize-handler/resize-handler.js +10 -5
  58. package/esm/plugins/size/size.js +8 -6
  59. package/esm/plugins/speech-recognize/helpers/recognize-manager.js +13 -9
  60. package/esm/tsconfig.json +1 -1
  61. package/esm/types/uploader.d.ts +14 -0
  62. package/package.json +1 -1
  63. package/types/core/decorators/autobind/autobind.d.ts +19 -1
  64. package/types/tsconfig.json +1 -1
  65. package/types/types/uploader.d.ts +14 -0
package/es2021/jodit.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.7.4
4
+ * Version: v4.7.6
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -525,7 +525,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 24 24\">
525
525
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
526
526
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
527
527
  /* harmony import */ var jodit_core_component_statuses__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(69364);
528
- /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(52201);
528
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49574);
529
529
  /* harmony import */ var jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(68616);
530
530
  /* harmony import */ var jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(23211);
531
531
  /* harmony import */ var jodit_core_helpers_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(45664);
@@ -654,7 +654,7 @@ class ViewWithToolbar extends jodit_core_view_view__WEBPACK_IMPORTED_MODULE_11__
654
654
  (0,jodit_core_decorators_watch_watch__WEBPACK_IMPORTED_MODULE_4__.watch)(':rebuildToolbar')
655
655
  ], ViewWithToolbar.prototype, "buildToolbar", null);
656
656
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
657
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__["default"]
657
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
658
658
  ], ViewWithToolbar.prototype, "beforeToolbarBuild", null);
659
659
 
660
660
 
@@ -7142,7 +7142,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.iframeSandbox = null;
7142
7142
  /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
7143
7143
  /* harmony import */ var jodit_core_async__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(91231);
7144
7144
  /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(81937);
7145
- /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(52201);
7145
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(49574);
7146
7146
  /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
7147
7147
  /* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(33201);
7148
7148
  /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5266);
@@ -7308,7 +7308,7 @@ class Ajax {
7308
7308
  }
7309
7309
  (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(Ajax, "log", []);
7310
7310
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
7311
- jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__["default"]
7311
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_4__.autobind
7312
7312
  ], Ajax.prototype, "destruct", null);
7313
7313
 
7314
7314
 
@@ -7455,12 +7455,10 @@ class Ajax {
7455
7455
  /* harmony export */ "default": function() { return /* binding */ DataProvider; }
7456
7456
  /* harmony export */ });
7457
7457
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
7458
- /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
7459
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
7460
- /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
7461
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(65946);
7462
- /* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(73714);
7463
- /* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(58664);
7458
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
7459
+ /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
7460
+ /* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(73714);
7461
+ /* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58664);
7464
7462
  /*!
7465
7463
  * Jodit Editor (https://xdsoft.net/jodit/)
7466
7464
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -7472,8 +7470,6 @@ class Ajax {
7472
7470
 
7473
7471
 
7474
7472
 
7475
-
7476
-
7477
7473
  const DEFAULT_SOURCE_NAME = 'default';
7478
7474
  const possibleRules = new Set([
7479
7475
  'allowFiles',
@@ -7503,13 +7499,13 @@ class DataProvider {
7503
7499
  ajax?.abort();
7504
7500
  instances.delete(name);
7505
7501
  }
7506
- const opts = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)(this.options[name] !== undefined ? this.options[name] : {}, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.ConfigProto)({
7502
+ const opts = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.ConfigProto)(this.options[name] !== undefined ? this.options[name] : {}, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.ConfigProto)({
7507
7503
  onProgress: this.progressHandler
7508
7504
  }, this.o.ajax));
7509
7505
  if (opts.prepareData) {
7510
7506
  opts.data = opts.prepareData.call(this, opts.data);
7511
7507
  }
7512
- const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_5__.Ajax(opts);
7508
+ const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_3__.Ajax(opts);
7513
7509
  instances.set(name, ajax);
7514
7510
  const promise = ajax.send();
7515
7511
  promise.finally(()=>{
@@ -7538,7 +7534,7 @@ class DataProvider {
7538
7534
  if (this.o.permissions.url) {
7539
7535
  return this.get('permissions').then((resp)=>{
7540
7536
  if (this.parent.isInDestruct) {
7541
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.abort)();
7537
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
7542
7538
  }
7543
7539
  let process = this.o.permissions.process;
7544
7540
  if (!process) {
@@ -7558,9 +7554,9 @@ class DataProvider {
7558
7554
  }
7559
7555
  canI(action) {
7560
7556
  const rule = 'allow' + action;
7561
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.IS_PROD) {
7557
+ if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
7562
7558
  if (!possibleRules.has(rule)) {
7563
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)('Wrong action ' + action);
7559
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Wrong action ' + action);
7564
7560
  }
7565
7561
  }
7566
7562
  const presetValue = this.o.permissionsPresets[rule];
@@ -7609,12 +7605,12 @@ class DataProvider {
7609
7605
  sources.forEach((source)=>{
7610
7606
  if (source.files && source.files.length) {
7611
7607
  const { sort } = this.o;
7612
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.isFunction)(sort) && mods.sortBy) {
7608
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isFunction)(sort) && mods.sortBy) {
7613
7609
  source.files.sort((a, b)=>sort(a, b, mods.sortBy));
7614
7610
  }
7615
7611
  source.files.forEach((item)=>{
7616
7612
  if (inFilter(item) && canBeFile(item)) {
7617
- elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_6__.FileBrowserItem.create({
7613
+ elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_4__.FileBrowserItem.create({
7618
7614
  ...item,
7619
7615
  sourceName: source.name,
7620
7616
  source
@@ -7626,7 +7622,7 @@ class DataProvider {
7626
7622
  return elements;
7627
7623
  }
7628
7624
  async tree(path, source) {
7629
- path = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.normalizeRelativePath)(path);
7625
+ path = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.normalizeRelativePath)(path);
7630
7626
  if (!this.o.folder) {
7631
7627
  return Promise.reject(Error('Set Folder Api options'));
7632
7628
  }
@@ -7647,12 +7643,12 @@ class DataProvider {
7647
7643
  /**
7648
7644
  * Get path by url. You can use this method in another modules
7649
7645
  */ getPathByUrl(url) {
7650
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.set)('options.getLocalFileByUrl.data.url', url, this);
7646
+ (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.set)('options.getLocalFileByUrl.data.url', url, this);
7651
7647
  return this.get('getLocalFileByUrl').then((resp)=>{
7652
7648
  if (this.isSuccess(resp)) {
7653
7649
  return resp.data;
7654
7650
  }
7655
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)(this.getMessage(resp));
7651
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(this.getMessage(resp));
7656
7652
  });
7657
7653
  }
7658
7654
  /**
@@ -7664,7 +7660,7 @@ class DataProvider {
7664
7660
  */ createFolder(name, path, source) {
7665
7661
  const { create } = this.o;
7666
7662
  if (!create) {
7667
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)('Set Create api options');
7663
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Set Create api options');
7668
7664
  }
7669
7665
  create.data.source = source;
7670
7666
  create.data.path = path;
@@ -7673,7 +7669,7 @@ class DataProvider {
7673
7669
  if (this.isSuccess(resp)) {
7674
7670
  return true;
7675
7671
  }
7676
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)(this.getMessage(resp));
7672
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(this.getMessage(resp));
7677
7673
  });
7678
7674
  }
7679
7675
  /**
@@ -7685,7 +7681,7 @@ class DataProvider {
7685
7681
  const mode = isFile ? 'fileMove' : 'folderMove';
7686
7682
  const option = this.options[mode];
7687
7683
  if (!option) {
7688
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)('Set Move api options');
7684
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Set Move api options');
7689
7685
  }
7690
7686
  option.data.from = filepath;
7691
7687
  option.data.path = path;
@@ -7694,7 +7690,7 @@ class DataProvider {
7694
7690
  if (this.isSuccess(resp)) {
7695
7691
  return true;
7696
7692
  }
7697
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)(this.getMessage(resp));
7693
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(this.getMessage(resp));
7698
7694
  });
7699
7695
  }
7700
7696
  /**
@@ -7706,7 +7702,7 @@ class DataProvider {
7706
7702
  */ remove(action, path, file, source) {
7707
7703
  const fr = this.o[action];
7708
7704
  if (!fr) {
7709
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)(`Set "${action}" api options`);
7705
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(`Set "${action}" api options`);
7710
7706
  }
7711
7707
  fr.data.path = path;
7712
7708
  fr.data.name = file;
@@ -7746,7 +7742,7 @@ class DataProvider {
7746
7742
  */ rename(action, path, name, newname, source) {
7747
7743
  const fr = this.o[action];
7748
7744
  if (!fr) {
7749
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_4__.error)(`Set "${action}" api options`);
7745
+ throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(`Set "${action}" api options`);
7750
7746
  }
7751
7747
  fr.data.path = path;
7752
7748
  fr.data.name = name;
@@ -7826,9 +7822,6 @@ class DataProvider {
7826
7822
  }
7827
7823
  }
7828
7824
 
7829
- DataProvider = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
7830
- jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__.autobind
7831
- ], DataProvider);
7832
7825
 
7833
7826
 
7834
7827
  /***/ }),
@@ -8364,10 +8357,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
8364
8357
  */ const FileSelectorWidget = (editor, callbacks, elm, close, isImage = true)=>{
8365
8358
  let currentImage;
8366
8359
  const tabs = [];
8367
- if (callbacks.upload && editor.o.uploader && (editor.o.uploader.url || editor.o.uploader.insertImageAsBase64URI)) {
8360
+ const options = editor.o.uploader;
8361
+ if (callbacks.upload && (options.url || options.insertImageAsBase64URI || options.customUploadFunction)) {
8368
8362
  const dragBox = editor.c.fromHTML('<div class="jodit-drag-and-drop__file-box">' + `<strong>${editor.i18n(isImage ? 'Drop image' : 'Drop file')}</strong>` + `<span><br>${editor.i18n('or click')}</span>` + `<input type="file" accept="${isImage ? 'image/*' : '*'}" tabindex="-1" dir="auto" multiple=""/>` + '</div>');
8369
8363
  editor.uploader.bind(dragBox, (resp)=>{
8370
- const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload : editor.o.uploader.defaultHandlerSuccess;
8364
+ const handler = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(callbacks.upload) ? callbacks.upload : options.defaultHandlerSuccess;
8371
8365
  if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_1__.isFunction)(handler)) {
8372
8366
  handler.call(editor, resp);
8373
8367
  }
@@ -18785,7 +18779,9 @@ const map = {};
18785
18779
 
18786
18780
 
18787
18781
 
18788
- class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
18782
+ /**
18783
+ * Calculate sizes for editor workspace and handle setHeight and setWidth events
18784
+ */ class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin {
18789
18785
  afterInit(editor) {
18790
18786
  editor.e.on('setHeight.size', this.__setHeight).on('setWidth.size', this.__setWidth).on('afterInit.size changePlace.size', this.__initialize, {
18791
18787
  top: true
@@ -18919,10 +18915,13 @@ class size extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_6__.Plugin
18919
18915
  ], size.prototype, "__initialize", null);
18920
18916
  (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
18921
18917
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
18922
- ], size.prototype, "__resizeWorkspaceImd", null);
18923
- size = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
18918
+ ], size.prototype, "__setHeight", null);
18919
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
18924
18920
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
18925
- ], size);
18921
+ ], size.prototype, "__setWidth", null);
18922
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
18923
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
18924
+ ], size.prototype, "__resizeWorkspaceImd", null);
18926
18925
  jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('size', size);
18927
18926
 
18928
18927
 
@@ -20538,18 +20537,56 @@ jodit_config__WEBPACK_IMPORTED_MODULE_4__.Config.prototype.controls.video = {
20538
20537
 
20539
20538
  "use strict";
20540
20539
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
20541
- /* harmony export */ autobind: function() { return /* reexport safe */ autobind_decorator__WEBPACK_IMPORTED_MODULE_0__["default"]; }
20540
+ /* harmony export */ autobind: function() { return /* binding */ autobind; }
20542
20541
  /* harmony export */ });
20543
- /* harmony import */ var autobind_decorator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(52201);
20542
+ /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(91565);
20544
20543
  /*!
20545
20544
  * Jodit Editor (https://xdsoft.net/jodit/)
20546
20545
  * Released under MIT see LICENSE.txt in the project root for license information.
20547
20546
  * Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
20548
- */ /**
20547
+ */
20548
+ /**
20549
20549
  * [[include:core/decorators/autobind/README.md]]
20550
20550
  * @packageDocumentation
20551
20551
  * @module decorators/autobind
20552
- */
20552
+ */ /**
20553
+ * Decorator that automatically binds a method to its class instance.
20554
+ * This is useful when passing methods as callbacks to preserve the correct `this` context.
20555
+ *
20556
+ * @example
20557
+ * ```typescript
20558
+ * class MyComponent {
20559
+ * @autobind
20560
+ * handleClick() {
20561
+ * console.log(this); // Always refers to MyComponent instance
20562
+ * }
20563
+ * }
20564
+ *
20565
+ * const component = new MyComponent();
20566
+ * const button = document.createElement('button');
20567
+ * button.addEventListener('click', component.handleClick); // `this` is correctly bound
20568
+ * ```
20569
+ */ function autobind(_target, propertyKey, descriptor) {
20570
+ if (!(0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_0__.isFunction)(descriptor.value)) {
20571
+ throw new TypeError(`@autobind can only be applied to methods, but "${propertyKey}" is not a function`);
20572
+ }
20573
+ const originalMethod = descriptor.value;
20574
+ return {
20575
+ configurable: true,
20576
+ get () {
20577
+ // Create a bound version of the method and cache it on the instance
20578
+ const boundMethod = originalMethod.bind(this);
20579
+ // Define the bound method as a property on the instance
20580
+ // This ensures the same bound function is returned on subsequent accesses
20581
+ Object.defineProperty(this, propertyKey, {
20582
+ value: boundMethod,
20583
+ configurable: true,
20584
+ writable: true
20585
+ });
20586
+ return boundMethod;
20587
+ }
20588
+ };
20589
+ }
20553
20590
 
20554
20591
 
20555
20592
  /***/ }),
@@ -22023,100 +22060,6 @@ jodit_core_global__WEBPACK_IMPORTED_MODULE_3__.pluginSystem.add('xpath', xpath);
22023
22060
  }
22024
22061
 
22025
22062
 
22026
- /***/ }),
22027
-
22028
- /***/ 52201:
22029
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
22030
-
22031
- "use strict";
22032
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22033
- /* harmony export */ "default": function() { return /* binding */ autobind; }
22034
- /* harmony export */ });
22035
- /* unused harmony exports boundMethod, boundClass */
22036
- function _typeof(obj) {
22037
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
22038
- _typeof = function _typeof(obj) {
22039
- return typeof obj;
22040
- };
22041
- } else {
22042
- _typeof = function _typeof(obj) {
22043
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
22044
- };
22045
- }
22046
- return _typeof(obj);
22047
- }
22048
- /**
22049
- * Return a descriptor removing the value and returning a getter
22050
- * The getter will return a .bind version of the function
22051
- * and memoize the result against a symbol on the instance
22052
- */ function boundMethod(target, key, descriptor) {
22053
- var fn = descriptor.value;
22054
- if (typeof fn !== 'function') {
22055
- throw new TypeError("@boundMethod decorator can only be applied to methods not: ".concat(_typeof(fn)));
22056
- } // In IE11 calling Object.defineProperty has a side-effect of evaluating the
22057
- // getter for the property which is being replaced. This causes infinite
22058
- // recursion and an "Out of stack space" error.
22059
- var definingProperty = false;
22060
- return {
22061
- configurable: true,
22062
- get: function get() {
22063
- // eslint-disable-next-line no-prototype-builtins
22064
- if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {
22065
- return fn;
22066
- }
22067
- var boundFn = fn.bind(this);
22068
- definingProperty = true;
22069
- Object.defineProperty(this, key, {
22070
- configurable: true,
22071
- get: function get() {
22072
- return boundFn;
22073
- },
22074
- set: function set(value) {
22075
- fn = value;
22076
- delete this[key];
22077
- }
22078
- });
22079
- definingProperty = false;
22080
- return boundFn;
22081
- },
22082
- set: function set(value) {
22083
- fn = value;
22084
- }
22085
- };
22086
- }
22087
- /**
22088
- * Use boundMethod to bind all methods on the target.prototype
22089
- */ function boundClass(target) {
22090
- // (Using reflect to get all keys including symbols)
22091
- var keys; // Use Reflect if exists
22092
- if (typeof Reflect !== 'undefined' && typeof Reflect.ownKeys === 'function') {
22093
- keys = Reflect.ownKeys(target.prototype);
22094
- } else {
22095
- keys = Object.getOwnPropertyNames(target.prototype); // Use symbols if support is provided
22096
- if (typeof Object.getOwnPropertySymbols === 'function') {
22097
- keys = keys.concat(Object.getOwnPropertySymbols(target.prototype));
22098
- }
22099
- }
22100
- keys.forEach(function(key) {
22101
- // Ignore special case target method
22102
- if (key === 'constructor') {
22103
- return;
22104
- }
22105
- var descriptor = Object.getOwnPropertyDescriptor(target.prototype, key); // Only methods need binding
22106
- if (typeof descriptor.value === 'function') {
22107
- Object.defineProperty(target.prototype, key, boundMethod(target, key, descriptor));
22108
- }
22109
- });
22110
- return target;
22111
- }
22112
- function autobind() {
22113
- if (arguments.length === 1) {
22114
- return boundClass.apply(void 0, arguments);
22115
- }
22116
- return boundMethod.apply(void 0, arguments);
22117
- }
22118
-
22119
-
22120
22063
  /***/ }),
22121
22064
 
22122
22065
  /***/ 52433:
@@ -29125,9 +29068,15 @@ class resizeHandler extends jodit_core_plugin__WEBPACK_IMPORTED_MODULE_5__.Plugi
29125
29068
  /** @override **/ (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(resizeHandler, "requires", [
29126
29069
  'size'
29127
29070
  ]);
29128
- resizeHandler = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29071
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29072
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29073
+ ], resizeHandler.prototype, "onHandleResizeStart", null);
29074
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29075
+ jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29076
+ ], resizeHandler.prototype, "onHandleResize", null);
29077
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
29129
29078
  jodit_core_decorators__WEBPACK_IMPORTED_MODULE_2__.autobind
29130
- ], resizeHandler);
29079
+ ], resizeHandler.prototype, "onHandleResizeEnd", null);
29131
29080
  jodit_core_global__WEBPACK_IMPORTED_MODULE_4__.pluginSystem.add('resizeHandler', resizeHandler);
29132
29081
 
29133
29082
 
@@ -32718,24 +32667,27 @@ function ConfigFlatten(obj) {
32718
32667
  const ajaxInstances = new WeakMap();
32719
32668
  function send(uploader, data) {
32720
32669
  const requestData = (0,jodit_modules_uploader_helpers_build_data__WEBPACK_IMPORTED_MODULE_2__.buildData)(uploader, data);
32721
- const sendData = (request)=>{
32670
+ const showProgress = (progress)=>{
32671
+ uploader.j.progressbar.show().progress(progress);
32672
+ if (progress >= 100) {
32673
+ uploader.j.progressbar.hide();
32674
+ }
32675
+ };
32676
+ let sendData = (request, showProgress)=>{
32722
32677
  const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_1__.Ajax({
32723
32678
  xhr: ()=>{
32724
32679
  const xhr = new XMLHttpRequest();
32725
32680
  if (uploader.j.ow.FormData !== undefined && xhr.upload) {
32726
- uploader.j.progressbar.show().progress(10);
32681
+ showProgress(10);
32727
32682
  xhr.upload.addEventListener('progress', (evt)=>{
32728
32683
  if (evt.lengthComputable) {
32729
32684
  let percentComplete = evt.loaded / evt.total;
32730
32685
  percentComplete *= 100;
32731
- uploader.j.progressbar.show().progress(percentComplete);
32732
- if (percentComplete >= 100) {
32733
- uploader.j.progressbar.hide();
32734
- }
32686
+ showProgress(percentComplete);
32735
32687
  }
32736
32688
  }, false);
32737
32689
  } else {
32738
- uploader.j.progressbar.hide();
32690
+ showProgress(100);
32739
32691
  }
32740
32692
  return xhr;
32741
32693
  },
@@ -32768,12 +32720,15 @@ function send(uploader, data) {
32768
32720
  instances?.delete(ajax);
32769
32721
  });
32770
32722
  };
32723
+ if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isFunction)(uploader.o.customUploadFunction)) {
32724
+ sendData = uploader.o.customUploadFunction;
32725
+ }
32771
32726
  if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_0__.isPromise)(requestData)) {
32772
- return requestData.then(sendData).catch((error)=>{
32727
+ return requestData.then((data)=>sendData(data, showProgress)).catch((error)=>{
32773
32728
  uploader.o.error.call(uploader, error);
32774
32729
  });
32775
32730
  }
32776
- return sendData(requestData);
32731
+ return sendData(requestData, showProgress);
32777
32732
  }
32778
32733
 
32779
32734
 
@@ -34305,7 +34260,7 @@ __webpack_require__.r(__webpack_exports__);
34305
34260
  * ```
34306
34261
  * @packageDocumentation
34307
34262
  * @module constants
34308
- */ const APP_VERSION = "4.7.4";
34263
+ */ const APP_VERSION = "4.7.6";
34309
34264
  // prettier-ignore
34310
34265
  const ES = "es2021";
34311
34266
  const IS_ES_MODERN = true;