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
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.9.13
4
+ * Version: v4.9.15
5
5
  * Url: https://xdsoft.net/jodit/
6
6
  * License(s): MIT
7
7
  */
@@ -7654,10 +7654,16 @@ class Ajax {
7654
7654
  /* harmony export */ "default": function() { return /* binding */ DataProvider; }
7655
7655
  /* harmony export */ });
7656
7656
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
7657
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(81937);
7658
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(65946);
7659
- /* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(73714);
7660
- /* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(58664);
7657
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
7658
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
7659
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49574);
7660
+ /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91565);
7661
+ /* harmony import */ var jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96340);
7662
+ /* harmony import */ var jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(77483);
7663
+ /* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(33201);
7664
+ /* harmony import */ var jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52144);
7665
+ /* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(17338);
7666
+ /* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(58664);
7661
7667
  /*!
7662
7668
  * Jodit Editor (https://xdsoft.net/jodit/)
7663
7669
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -7669,6 +7675,12 @@ class Ajax {
7669
7675
 
7670
7676
 
7671
7677
 
7678
+
7679
+
7680
+
7681
+
7682
+
7683
+
7672
7684
  const DEFAULT_SOURCE_NAME = 'default';
7673
7685
  const possibleRules = new Set([
7674
7686
  'allowFiles',
@@ -7698,13 +7710,13 @@ class DataProvider {
7698
7710
  ajax?.abort();
7699
7711
  instances.delete(name);
7700
7712
  }
7701
- 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)({
7713
+ const opts = (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_6__.ConfigProto)(this.options[name] !== undefined ? this.options[name] : {}, (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_6__.ConfigProto)({
7702
7714
  onProgress: this.progressHandler
7703
7715
  }, this.o.ajax));
7704
7716
  if (opts.prepareData) {
7705
7717
  opts.data = opts.prepareData.call(this, opts.data);
7706
7718
  }
7707
- const ajax = new jodit_core_request__WEBPACK_IMPORTED_MODULE_3__.Ajax(opts);
7719
+ const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_9__.Ajax(opts);
7708
7720
  instances.set(name, ajax);
7709
7721
  const promise = ajax.send();
7710
7722
  promise.finally(()=>{
@@ -7733,7 +7745,7 @@ class DataProvider {
7733
7745
  if (this.o.permissions.url) {
7734
7746
  return this.get('permissions').then((resp)=>{
7735
7747
  if (this.parent.isInDestruct) {
7736
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.abort)();
7748
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.abort)();
7737
7749
  }
7738
7750
  let process = this.o.permissions.process;
7739
7751
  if (!process) {
@@ -7753,9 +7765,9 @@ class DataProvider {
7753
7765
  }
7754
7766
  canI(action) {
7755
7767
  const rule = 'allow' + action;
7756
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_1__.IS_PROD) {
7768
+ if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.IS_PROD) {
7757
7769
  if (!possibleRules.has(rule)) {
7758
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Wrong action ' + action);
7770
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)('Wrong action ' + action);
7759
7771
  }
7760
7772
  }
7761
7773
  const presetValue = this.o.permissionsPresets[rule];
@@ -7786,30 +7798,30 @@ class DataProvider {
7786
7798
  /**
7787
7799
  * Load items list by path and source
7788
7800
  */ items(path, source, mods = {}) {
7789
- return this.__items(path, source, mods, (resp)=>this.generateItemsList(resp.data.sources, mods));
7801
+ return this.__items(path, source, mods, (resp)=>this.__generateItemsList(resp.data.sources, mods));
7790
7802
  }
7791
7803
  /**
7792
7804
  * Load items list by path and source
7793
7805
  */ itemsEx(path, source, mods = {}) {
7794
7806
  const calcTotal = (sources)=>sources.reduce((acc, source)=>acc + source.files.length, 0);
7795
7807
  return this.__items(path, source, mods, (resp)=>({
7796
- items: this.generateItemsList(resp.data.sources, mods),
7808
+ items: this.__generateItemsList(resp.data.sources, mods),
7797
7809
  loadedTotal: calcTotal(resp.data.sources)
7798
7810
  }));
7799
7811
  }
7800
- generateItemsList(sources, mods = {}) {
7812
+ __generateItemsList(sources, mods = {}) {
7801
7813
  const elements = [];
7802
7814
  const canBeFile = (item)=>item.type === 'folder' || !mods.onlyImages || item.isImage === undefined || item.isImage;
7803
7815
  const inFilter = (item)=>!mods.filterWord?.length || this.o.filter === undefined || this.o.filter(item, mods.filterWord);
7804
7816
  sources.forEach((source)=>{
7805
7817
  if (source.files && source.files.length) {
7806
7818
  const { sort } = this.o;
7807
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.isFunction)(sort) && mods.sortBy) {
7819
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__.isFunction)(sort) && mods.sortBy) {
7808
7820
  source.files.sort((a, b)=>sort(a, b, mods.sortBy));
7809
7821
  }
7810
7822
  source.files.forEach((item)=>{
7811
7823
  if (inFilter(item) && canBeFile(item)) {
7812
- elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_4__.FileBrowserItem.create({
7824
+ elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_10__.FileBrowserItem.create({
7813
7825
  ...item,
7814
7826
  sourceName: source.name,
7815
7827
  source
@@ -7821,7 +7833,7 @@ class DataProvider {
7821
7833
  return elements;
7822
7834
  }
7823
7835
  async tree(path, source) {
7824
- path = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.normalizeRelativePath)(path);
7836
+ path = (0,jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_5__.normalizeRelativePath)(path);
7825
7837
  if (!this.o.folder) {
7826
7838
  return Promise.reject(Error('Set Folder Api options'));
7827
7839
  }
@@ -7842,12 +7854,12 @@ class DataProvider {
7842
7854
  /**
7843
7855
  * Get path by url. You can use this method in another modules
7844
7856
  */ getPathByUrl(url) {
7845
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.set)('options.getLocalFileByUrl.data.url', url, this);
7857
+ (0,jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_8__.set)('options.getLocalFileByUrl.data.url', url, this);
7846
7858
  return this.get('getLocalFileByUrl').then((resp)=>{
7847
7859
  if (this.isSuccess(resp)) {
7848
7860
  return resp.data;
7849
7861
  }
7850
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(this.getMessage(resp));
7862
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(this.getMessage(resp));
7851
7863
  });
7852
7864
  }
7853
7865
  /**
@@ -7859,7 +7871,7 @@ class DataProvider {
7859
7871
  */ createFolder(name, path, source) {
7860
7872
  const { create } = this.o;
7861
7873
  if (!create) {
7862
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Set Create api options');
7874
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)('Set Create api options');
7863
7875
  }
7864
7876
  create.data.source = source;
7865
7877
  create.data.path = path;
@@ -7868,7 +7880,7 @@ class DataProvider {
7868
7880
  if (this.isSuccess(resp)) {
7869
7881
  return true;
7870
7882
  }
7871
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(this.getMessage(resp));
7883
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(this.getMessage(resp));
7872
7884
  });
7873
7885
  }
7874
7886
  /**
@@ -7880,7 +7892,7 @@ class DataProvider {
7880
7892
  const mode = isFile ? 'fileMove' : 'folderMove';
7881
7893
  const option = this.options[mode];
7882
7894
  if (!option) {
7883
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)('Set Move api options');
7895
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)('Set Move api options');
7884
7896
  }
7885
7897
  option.data.from = filepath;
7886
7898
  option.data.path = path;
@@ -7889,7 +7901,7 @@ class DataProvider {
7889
7901
  if (this.isSuccess(resp)) {
7890
7902
  return true;
7891
7903
  }
7892
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(this.getMessage(resp));
7904
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(this.getMessage(resp));
7893
7905
  });
7894
7906
  }
7895
7907
  /**
@@ -7898,10 +7910,10 @@ class DataProvider {
7898
7910
  * @param path - Relative path
7899
7911
  * @param file - The filename
7900
7912
  * @param source - Source
7901
- */ remove(action, path, file, source) {
7913
+ */ __remove(action, path, file, source) {
7902
7914
  const fr = this.o[action];
7903
7915
  if (!fr) {
7904
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(`Set "${action}" api options`);
7916
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(`Set "${action}" api options`);
7905
7917
  }
7906
7918
  fr.data.path = path;
7907
7919
  fr.data.name = file;
@@ -7920,7 +7932,7 @@ class DataProvider {
7920
7932
  * @param file - The filename
7921
7933
  * @param source - Source
7922
7934
  */ fileRemove(path, file, source) {
7923
- return this.remove('fileRemove', path, file, source);
7935
+ return this.__remove('fileRemove', path, file, source);
7924
7936
  }
7925
7937
  /**
7926
7938
  * Deleting a folder
@@ -7929,7 +7941,7 @@ class DataProvider {
7929
7941
  * @param file - The filename
7930
7942
  * @param source - Source
7931
7943
  */ folderRemove(path, file, source) {
7932
- return this.remove('folderRemove', path, file, source);
7944
+ return this.__remove('folderRemove', path, file, source);
7933
7945
  }
7934
7946
  /**
7935
7947
  * Rename action
@@ -7938,10 +7950,10 @@ class DataProvider {
7938
7950
  * @param name - Old name
7939
7951
  * @param newname - New name
7940
7952
  * @param source - Source
7941
- */ rename(action, path, name, newname, source) {
7953
+ */ __rename(action, path, name, newname, source) {
7942
7954
  const fr = this.o[action];
7943
7955
  if (!fr) {
7944
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_2__.error)(`Set "${action}" api options`);
7956
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(`Set "${action}" api options`);
7945
7957
  }
7946
7958
  fr.data.path = path;
7947
7959
  fr.data.name = name;
@@ -7957,14 +7969,14 @@ class DataProvider {
7957
7969
  /**
7958
7970
  * Rename folder
7959
7971
  */ folderRename(path, name, newname, source) {
7960
- return this.rename('folderRename', path, name, newname, source);
7972
+ return this.__rename('folderRename', path, name, newname, source);
7961
7973
  }
7962
7974
  /**
7963
7975
  * Rename file
7964
7976
  */ fileRename(path, name, newname, source) {
7965
- return this.rename('fileRename', path, name, newname, source);
7977
+ return this.__rename('fileRename', path, name, newname, source);
7966
7978
  }
7967
- changeImage(type, path, source, name, newname, box) {
7979
+ __changeImage(type, path, source, name, newname, box) {
7968
7980
  if (!this.o[type]) {
7969
7981
  this.o[type] = {
7970
7982
  data: {}
@@ -7983,19 +7995,19 @@ class DataProvider {
7983
7995
  query.data.path = path;
7984
7996
  query.data.name = name;
7985
7997
  query.data.source = source;
7986
- return this.get(type).then(()=>{
7987
- return true;
7998
+ return this.get(type).then((resp)=>{
7999
+ return resp.data.newPath || true;
7988
8000
  });
7989
8001
  }
7990
8002
  /**
7991
8003
  * Send command to server to crop image
7992
8004
  */ crop(path, source, name, newname, box) {
7993
- return this.changeImage('crop', path, source, name, newname, box);
8005
+ return this.__changeImage('crop', path, source, name, newname, box);
7994
8006
  }
7995
8007
  /**
7996
8008
  * Send command to server to resize image
7997
8009
  */ resize(path, source, name, newname, box) {
7998
- return this.changeImage('resize', path, source, name, newname, box);
8010
+ return this.__changeImage('resize', path, source, name, newname, box);
7999
8011
  }
8000
8012
  getMessage(resp) {
8001
8013
  return this.options.getMessage(resp);
@@ -8021,6 +8033,60 @@ class DataProvider {
8021
8033
  }
8022
8034
  }
8023
8035
 
8036
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8037
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8038
+ ], DataProvider.prototype, "onProgress", null);
8039
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8040
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8041
+ ], DataProvider.prototype, "permissions", null);
8042
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8043
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8044
+ ], DataProvider.prototype, "canI", null);
8045
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8046
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8047
+ ], DataProvider.prototype, "items", null);
8048
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8049
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8050
+ ], DataProvider.prototype, "itemsEx", null);
8051
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8052
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8053
+ ], DataProvider.prototype, "tree", null);
8054
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8055
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8056
+ ], DataProvider.prototype, "getPathByUrl", null);
8057
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8058
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8059
+ ], DataProvider.prototype, "createFolder", null);
8060
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8061
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8062
+ ], DataProvider.prototype, "move", null);
8063
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8064
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8065
+ ], DataProvider.prototype, "fileRemove", null);
8066
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8067
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8068
+ ], DataProvider.prototype, "folderRemove", null);
8069
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8070
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8071
+ ], DataProvider.prototype, "folderRename", null);
8072
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8073
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8074
+ ], DataProvider.prototype, "fileRename", null);
8075
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8076
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8077
+ ], DataProvider.prototype, "crop", null);
8078
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8079
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8080
+ ], DataProvider.prototype, "resize", null);
8081
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8082
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8083
+ ], DataProvider.prototype, "getMessage", null);
8084
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8085
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8086
+ ], DataProvider.prototype, "isSuccess", null);
8087
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
8088
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
8089
+ ], DataProvider.prototype, "destruct", null);
8024
8090
 
8025
8091
 
8026
8092
  /***/ }),
@@ -13128,9 +13194,10 @@ const $$temp = ()=>{
13128
13194
  };
13129
13195
  a.href = url;
13130
13196
  j.filebrowser.dataProvider.getPathByUrl(a.href.toString()).then((resp)=>{
13131
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_2__.openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, ()=>{
13197
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_2__.openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, (newPath)=>{
13132
13198
  const timestamp = new Date().getTime();
13133
- state.values.imageSrc = url + (url.indexOf('?') !== -1 ? '' : '?') + '&_tmp=' + timestamp.toString();
13199
+ const newUrl = newPath || url;
13200
+ state.values.imageSrc = newUrl + (newUrl.indexOf('?') !== -1 ? '' : '?') + '&_tmp=' + timestamp.toString();
13134
13201
  }, (error)=>{
13135
13202
  j.alert(error.message);
13136
13203
  });
@@ -18402,11 +18469,16 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
18402
18469
  /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16964);
18403
18470
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
18404
18471
  /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27795);
18405
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(65946);
18406
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(59400);
18407
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5266);
18408
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(54500);
18409
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(8908);
18472
+ /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88475);
18473
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4040);
18474
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
18475
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
18476
+ /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28723);
18477
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(71125);
18478
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(59400);
18479
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5266);
18480
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(54500);
18481
+ /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(8908);
18410
18482
  /*!
18411
18483
  * Jodit Editor (https://xdsoft.net/jodit/)
18412
18484
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -18426,6 +18498,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
18426
18498
 
18427
18499
 
18428
18500
 
18501
+
18502
+
18503
+
18504
+
18505
+
18429
18506
  const jie = 'jodit-image-editor';
18430
18507
  const TABS = {
18431
18508
  resize: 'resize',
@@ -18470,9 +18547,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18470
18547
  return this.j.async.promise((resolve)=>{
18471
18548
  const timestamp = new Date().getTime();
18472
18549
  this.image = this.j.c.element('img');
18473
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.$$)('img,.jodit-icon_loader', this.resize_box).forEach(jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove);
18474
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.$$)('img,.jodit-icon_loader', this.crop_box).forEach(jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove);
18475
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(this.cropHandler, 'background', 'transparent');
18550
+ (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.$$)('img,.jodit-icon_loader', this.resize_box).forEach(jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove);
18551
+ (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.$$)('img,.jodit-icon_loader', this.crop_box).forEach(jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove);
18552
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'background', 'transparent');
18476
18553
  this.onSave = save;
18477
18554
  this.resize_box.appendChild(this.j.c.element('i', {
18478
18555
  class: 'jodit-icon_loader'
@@ -18487,7 +18564,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18487
18564
  }
18488
18565
  this.image.setAttribute('src', url);
18489
18566
  this._dialog.open();
18490
- const { widthInput, heightInput } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.refs)(this.editor);
18567
+ const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
18491
18568
  const onload = ()=>{
18492
18569
  if (this.isDestructed) {
18493
18570
  return;
@@ -18501,7 +18578,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18501
18578
  this.resize_box.appendChild(this.image);
18502
18579
  this.cropImage = this.image.cloneNode(true);
18503
18580
  this.crop_box.appendChild(this.cropImage);
18504
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove.apply(null, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.$$)('.jodit-icon_loader', this.editor));
18581
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove.apply(null, (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.$$)('.jodit-icon_loader', this.editor));
18505
18582
  if (this.activeTab === TABS.crop) {
18506
18583
  this.showCrop();
18507
18584
  }
@@ -18523,9 +18600,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18523
18600
  if (!slide) {
18524
18601
  return;
18525
18602
  }
18526
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.$$)(`.${jie}__slider,.${jie}__area`, self.editor).forEach((elm)=>elm.classList.remove(`${jie}_active`));
18603
+ (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.$$)(`.${jie}__slider,.${jie}__area`, self.editor).forEach((elm)=>elm.classList.remove(`${jie}_active`));
18527
18604
  slide.classList.add(`${jie}_active`);
18528
- this.activeTab = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(slide, '-area') || TABS.resize;
18605
+ this.activeTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(slide, '-area') || TABS.resize;
18529
18606
  const tab = self.editor.querySelector(`.${jie}__area.${jie}__area_` + self.activeTab);
18530
18607
  if (tab) {
18531
18608
  tab.classList.add(`${jie}_active`);
@@ -18535,14 +18612,14 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18535
18612
  }
18536
18613
  }
18537
18614
  onChangeSizeInput(e) {
18538
- const self = this, input = e.target, { widthInput, heightInput } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.refs)(this.editor), isWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(input, 'data-ref') === 'widthInput', x = parseInt(input.value, 10), minX = isWidth ? self.o.min_width : self.o.min_height, minY = !isWidth ? self.o.min_width : self.o.min_height;
18615
+ const self = this, input = e.target, { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor), isWidth = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(input, 'data-ref') === 'widthInput', x = parseInt(input.value, 10), minX = isWidth ? self.o.min_width : self.o.min_height, minY = !isWidth ? self.o.min_width : self.o.min_height;
18539
18616
  let y;
18540
18617
  if (x > minX) {
18541
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.image, isWidth ? 'width' : 'height', x);
18618
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, isWidth ? 'width' : 'height', x);
18542
18619
  if (self.resizeUseRatio) {
18543
18620
  y = isWidth ? Math.round(x / self.ratio) : Math.round(x * self.ratio);
18544
18621
  if (y > minY) {
18545
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.image, !isWidth ? 'width' : 'height', y);
18622
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, !isWidth ? 'width' : 'height', y);
18546
18623
  if (isWidth) {
18547
18624
  heightInput.value = y.toString();
18548
18625
  } else {
@@ -18562,8 +18639,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18562
18639
  self.start_x = e.clientX;
18563
18640
  self.start_y = e.clientY;
18564
18641
  if (self.activeTab === TABS.crop) {
18565
- self.top_x = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.cropHandler, 'left');
18566
- self.top_y = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.cropHandler, 'top');
18642
+ self.top_x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left');
18643
+ self.top_y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top');
18567
18644
  self.width = self.cropHandler.offsetWidth;
18568
18645
  self.height = self.cropHandler.offsetHeight;
18569
18646
  } else {
@@ -18584,7 +18661,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18584
18661
  if (!self.clicked) {
18585
18662
  return;
18586
18663
  }
18587
- const { widthInput, heightInput } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.refs)(this.editor);
18664
+ const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
18588
18665
  self.diff_x = e.clientX - self.start_x;
18589
18666
  self.diff_y = e.clientY - self.start_y;
18590
18667
  if (self.activeTab === TABS.resize && self.resizeUseRatio || self.activeTab === TABS.crop && self.cropUseRatio) {
@@ -18601,11 +18678,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18601
18678
  }
18602
18679
  if (self.activeTab === TABS.resize) {
18603
18680
  if (self.new_w > self.o.resizeMinWidth) {
18604
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.image, 'width', self.new_w + 'px');
18681
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'width', self.new_w + 'px');
18605
18682
  widthInput.value = self.new_w.toString();
18606
18683
  }
18607
18684
  if (self.new_h > self.o.resizeMinHeight) {
18608
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.image, 'height', self.new_h + 'px');
18685
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'height', self.new_h + 'px');
18609
18686
  heightInput.value = self.new_h.toString();
18610
18687
  }
18611
18688
  this.j.e.fire(self.resizeHandler, 'updatesize');
@@ -18617,7 +18694,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18617
18694
  if (self.top_y + self.new_h > self.cropImage.offsetHeight) {
18618
18695
  self.new_h = self.cropImage.offsetHeight - self.top_y;
18619
18696
  }
18620
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.cropHandler, {
18697
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
18621
18698
  width: self.new_w,
18622
18699
  height: self.new_h
18623
18700
  });
@@ -18625,11 +18702,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18625
18702
  if (self.top_x + self.diff_x + self.cropHandler.offsetWidth > self.cropImage.offsetWidth) {
18626
18703
  self.diff_x = self.cropImage.offsetWidth - self.top_x - self.cropHandler.offsetWidth;
18627
18704
  }
18628
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.cropHandler, 'left', self.top_x + self.diff_x);
18705
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left', self.top_x + self.diff_x);
18629
18706
  if (self.top_y + self.diff_y + self.cropHandler.offsetHeight > self.cropImage.offsetHeight) {
18630
18707
  self.diff_y = self.cropImage.offsetHeight - self.top_y - self.cropHandler.offsetHeight;
18631
18708
  }
18632
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.cropHandler, 'top', self.top_y + self.diff_y);
18709
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top', self.top_y + self.diff_y);
18633
18710
  }
18634
18711
  this.j.e.fire(self.cropHandler, 'updatesize');
18635
18712
  }
@@ -18670,7 +18747,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18670
18747
  wn = nw * (h / nh);
18671
18748
  hn = h;
18672
18749
  }
18673
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(this.crop_box, {
18750
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.crop_box, {
18674
18751
  width: wn,
18675
18752
  height: hn
18676
18753
  });
@@ -18687,8 +18764,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18687
18764
  } else {
18688
18765
  this.new_h = ImageEditor.calcValueByPercent(h, this.o.cropDefaultHeight);
18689
18766
  }
18690
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(this.cropHandler, {
18691
- backgroundImage: 'url(' + (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.attr)(this.cropImage, 'src') + ')',
18767
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, {
18768
+ backgroundImage: 'url(' + (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(this.cropImage, 'src') + ')',
18692
18769
  width: this.new_w,
18693
18770
  height: this.new_h,
18694
18771
  left: w / 2 - this.new_w / 2,
@@ -18700,8 +18777,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18700
18777
  return;
18701
18778
  }
18702
18779
  const ratioX = this.cropImage.offsetWidth / this.naturalWidth, ratioY = this.cropImage.offsetHeight / this.naturalHeight;
18703
- this.cropBox.x = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(this.cropHandler, 'left') / ratioX;
18704
- this.cropBox.y = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(this.cropHandler, 'top') / ratioY;
18780
+ this.cropBox.x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'left') / ratioX;
18781
+ this.cropBox.y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'top') / ratioY;
18705
18782
  this.cropBox.w = this.cropHandler.offsetWidth / ratioX;
18706
18783
  this.cropBox.h = this.cropHandler.offsetHeight / ratioY;
18707
18784
  this.sizes.textContent = this.cropBox.w.toFixed(0) + 'x' + this.cropBox.h.toFixed(0);
@@ -18710,7 +18787,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18710
18787
  this.resizeBox.h = this.image.offsetHeight || this.naturalHeight;
18711
18788
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "setHandlers", ()=>{
18712
18789
  const self = this;
18713
- const { widthInput, heightInput } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.refs)(this.editor);
18790
+ const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
18714
18791
  self.j.e.on([
18715
18792
  self.editor.querySelector('.jodit_bottomright'),
18716
18793
  self.cropHandler
@@ -18719,11 +18796,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18719
18796
  self.showCrop();
18720
18797
  this.j.e.fire(self.cropHandler, 'updatesize');
18721
18798
  });
18722
- self.j.e.on((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.toArray)(this.editor.querySelectorAll(`.${jie}__slider-title`)), 'click', this.onTitleModeClick).on([
18799
+ self.j.e.on((0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_5__.toArray)(this.editor.querySelectorAll(`.${jie}__slider-title`)), 'click', this.onTitleModeClick).on([
18723
18800
  widthInput,
18724
18801
  heightInput
18725
18802
  ], 'input', this.onChangeSizeInput);
18726
- const { keepAspectRatioResize, keepAspectRatioCrop } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.refs)(this.editor);
18803
+ const { keepAspectRatioResize, keepAspectRatioCrop } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
18727
18804
  if (keepAspectRatioResize) {
18728
18805
  keepAspectRatioResize.addEventListener('change', ()=>{
18729
18806
  this.resizeUseRatio = keepAspectRatioResize.checked;
@@ -18735,7 +18812,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18735
18812
  });
18736
18813
  }
18737
18814
  self.j.e.on(self.resizeHandler, 'updatesize', ()=>{
18738
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.resizeHandler, {
18815
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.resizeHandler, {
18739
18816
  top: 0,
18740
18817
  left: 0,
18741
18818
  width: self.image.offsetWidth || self.naturalWidth,
@@ -18746,7 +18823,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18746
18823
  if (!self.cropImage) {
18747
18824
  return;
18748
18825
  }
18749
- let new_x = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.cropHandler, 'left'), new_y = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.cropHandler, 'top'), new_width = self.cropHandler.offsetWidth, new_height = self.cropHandler.offsetHeight;
18826
+ let new_x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left'), new_y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top'), new_width = self.cropHandler.offsetWidth, new_height = self.cropHandler.offsetHeight;
18750
18827
  if (new_x < 0) {
18751
18828
  new_x = 0;
18752
18829
  }
@@ -18765,7 +18842,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18765
18842
  new_width = new_height * self.ratio;
18766
18843
  }
18767
18844
  }
18768
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.cropHandler, {
18845
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
18769
18846
  width: new_width,
18770
18847
  height: new_height,
18771
18848
  left: new_x,
@@ -18784,7 +18861,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18784
18861
  switch(button){
18785
18862
  case self.buttons.saveas:
18786
18863
  self.j.prompt('Enter new name', 'Save in new file', (name)=>{
18787
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.trim)(name)) {
18864
+ if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__.trim)(name)) {
18788
18865
  self.j.alert('The name should not be empty');
18789
18866
  return false;
18790
18867
  }
@@ -18800,7 +18877,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18800
18877
  break;
18801
18878
  case self.buttons.reset:
18802
18879
  if (self.activeTab === TABS.resize) {
18803
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.css)(self.image, {
18880
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, {
18804
18881
  width: null,
18805
18882
  height: null
18806
18883
  });
@@ -18815,18 +18892,24 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
18815
18892
  });
18816
18893
  });
18817
18894
  });
18818
- this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor : jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.defaultOptions.imageeditor;
18895
+ this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor : jodit_config__WEBPACK_IMPORTED_MODULE_12__.Config.defaultOptions.imageeditor;
18819
18896
  const o = this.options;
18820
18897
  this.resizeUseRatio = o.resizeUseRatio;
18821
18898
  this.cropUseRatio = o.cropUseRatio;
18822
18899
  this.buttons = {
18823
- reset: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.Button)(this.j, 'update', 'Reset'),
18824
- save: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.Button)(this.j, 'save', 'Save'),
18825
- saveas: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_6__.Button)(this.j, 'save', 'Save as ...')
18900
+ reset: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'update', 'Reset'),
18901
+ save: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'save', 'Save'),
18902
+ saveas: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, {
18903
+ icon: {
18904
+ name: 'save'
18905
+ },
18906
+ name: 'save-as',
18907
+ text: 'Save as ...'
18908
+ })
18826
18909
  };
18827
18910
  this.activeTab = o.resize ? TABS.resize : TABS.crop;
18828
- this.editor = (0,_templates_form__WEBPACK_IMPORTED_MODULE_9__.form)(this.j, this.options);
18829
- const { resizeBox, cropBox } = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.refs)(this.editor);
18911
+ this.editor = (0,_templates_form__WEBPACK_IMPORTED_MODULE_14__.form)(this.j, this.options);
18912
+ const { resizeBox, cropBox } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
18830
18913
  this.resize_box = resizeBox;
18831
18914
  this.crop_box = cropBox;
18832
18915
  this.sizes = this.editor.querySelector(`.${jie}__area.${jie}__area_crop .jodit-image-editor__sizes`);
@@ -18890,11 +18973,11 @@ ImageEditor = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorat
18890
18973
  /**
18891
18974
  * Open Image Editor
18892
18975
  */ function openImageEditor(href, name, path, source, onSuccess, onFailed) {
18893
- return this.getInstance('ImageEditor', this.o).open(href, (newname, box, success, failed)=>(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.call)(box.action === 'resize' ? this.dataProvider.resize : this.dataProvider.crop, path, source, name, newname, box.box).then((ok)=>{
18894
- if (ok) {
18976
+ return this.getInstance('ImageEditor', this.o).open(href, (newname, box, success, failed)=>(0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_10__.call)(box.action === 'resize' ? this.dataProvider.resize : this.dataProvider.crop, path, source, name, newname, box.box).then((result)=>{
18977
+ if (result) {
18895
18978
  success();
18896
18979
  if (onSuccess) {
18897
- onSuccess();
18980
+ onSuccess(typeof result === 'string' ? result : undefined);
18898
18981
  }
18899
18982
  }
18900
18983
  }).catch((error)=>{
@@ -29120,6 +29203,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
29120
29203
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
29121
29204
  /* harmony export */ call: function() { return /* binding */ call; },
29122
29205
  /* harmony export */ callPromise: function() { return /* binding */ callPromise; },
29206
+ /* harmony export */ callThis: function() { return /* binding */ callThis; },
29123
29207
  /* harmony export */ getDataTransfer: function() { return /* binding */ getDataTransfer; },
29124
29208
  /* harmony export */ getPropertyDescriptor: function() { return /* binding */ getPropertyDescriptor; },
29125
29209
  /* harmony export */ keys: function() { return /* binding */ keys; },
@@ -29152,6 +29236,17 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
29152
29236
  */ function call(func, ...args) {
29153
29237
  return func(...args);
29154
29238
  }
29239
+ /**
29240
+ * Call function with parameters
29241
+ *
29242
+ * @example
29243
+ * ```js
29244
+ * const f = Math.random();
29245
+ * Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
29246
+ * ```
29247
+ */ function callThis(func, thisArg, ...args) {
29248
+ return func.apply(thisArg, args);
29249
+ }
29155
29250
  /**
29156
29251
  * Mark element for debugging
29157
29252
  */ function markOwner(jodit, elm) {
@@ -34682,7 +34777,7 @@ __webpack_require__.r(__webpack_exports__);
34682
34777
  * ```
34683
34778
  * @packageDocumentation
34684
34779
  * @module constants
34685
- */ const APP_VERSION = "4.9.13";
34780
+ */ const APP_VERSION = "4.9.15";
34686
34781
  // prettier-ignore
34687
34782
  const ES = "es2021";
34688
34783
  const IS_ES_MODERN = true;
@@ -36409,7 +36504,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.showWordsCounter = tr
36409
36504
  content = data;
36410
36505
  }
36411
36506
  if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isArray)(content)) {
36412
- this.toolbar.build(content, target);
36507
+ const disabled = this.j.o.toolbarInlineDisabledButtons;
36508
+ this.toolbar.build(disabled.length ? content.filter((item)=>{
36509
+ const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(item) ? item : item.name;
36510
+ return !disabled.includes(name ?? '');
36511
+ }) : content, target);
36413
36512
  this.toolbar.buttonSize = this.j.o.toolbarButtonSize;
36414
36513
  content = this.toolbar.container;
36415
36514
  }
@@ -38575,6 +38674,7 @@ __webpack_require__.r(__webpack_exports__);
38575
38674
  /* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
38576
38675
  /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.call; },
38577
38676
  /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callPromise; },
38677
+ /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callThis; },
38578
38678
  /* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
38579
38679
  /* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
38580
38680
  /* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_18__.cns; },