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/es5/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
  */
@@ -8991,11 +8991,17 @@ var Ajax = /*#__PURE__*/ function() {
8991
8991
  /* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25045);
8992
8992
  /* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(41411);
8993
8993
  /* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15366);
8994
- /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3233);
8995
- /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(81937);
8996
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(65946);
8997
- /* harmony import */ var jodit_core_request__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(73714);
8998
- /* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(58664);
8994
+ /* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31635);
8995
+ /* harmony import */ var _swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3233);
8996
+ /* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(81937);
8997
+ /* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(49574);
8998
+ /* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(91565);
8999
+ /* harmony import */ var jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(96340);
9000
+ /* harmony import */ var jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(77483);
9001
+ /* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(33201);
9002
+ /* harmony import */ var jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(52144);
9003
+ /* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(17338);
9004
+ /* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(58664);
8999
9005
  /*!
9000
9006
  * Jodit Editor (https://xdsoft.net/jodit/)
9001
9007
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -9013,6 +9019,12 @@ var Ajax = /*#__PURE__*/ function() {
9013
9019
 
9014
9020
 
9015
9021
 
9022
+
9023
+
9024
+
9025
+
9026
+
9027
+
9016
9028
  var DEFAULT_SOURCE_NAME = 'default';
9017
9029
  var possibleRules = new Set([
9018
9030
  'allowFiles',
@@ -9063,13 +9075,13 @@ var DataProvider = /*#__PURE__*/ function() {
9063
9075
  ajax === null || ajax === void 0 ? void 0 : ajax.abort();
9064
9076
  instances.delete(name);
9065
9077
  }
9066
- var opts = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.ConfigProto)(this.options[name] !== undefined ? this.options[name] : {}, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.ConfigProto)({
9078
+ var opts = (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_12__.ConfigProto)(this.options[name] !== undefined ? this.options[name] : {}, (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_12__.ConfigProto)({
9067
9079
  onProgress: this.progressHandler
9068
9080
  }, this.o.ajax));
9069
9081
  if (opts.prepareData) {
9070
9082
  opts.data = opts.prepareData.call(this, opts.data);
9071
9083
  }
9072
- var ajax1 = new jodit_core_request__WEBPACK_IMPORTED_MODULE_9__.Ajax(opts);
9084
+ var ajax1 = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_15__.Ajax(opts);
9073
9085
  instances.set(name, ajax1);
9074
9086
  var promise = ajax1.send();
9075
9087
  promise.finally(function() {
@@ -9102,7 +9114,7 @@ var DataProvider = /*#__PURE__*/ function() {
9102
9114
  */ function permissions(path, source) {
9103
9115
  return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
9104
9116
  var _this;
9105
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_6__._)(this, function(_state) {
9117
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_7__._)(this, function(_state) {
9106
9118
  _this = this;
9107
9119
  if (!this.o.permissions) {
9108
9120
  return [
@@ -9117,7 +9129,7 @@ var DataProvider = /*#__PURE__*/ function() {
9117
9129
  2,
9118
9130
  this.get('permissions').then(function(resp) {
9119
9131
  if (_this.parent.isInDestruct) {
9120
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.abort)();
9132
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.abort)();
9121
9133
  }
9122
9134
  var process = _this.o.permissions.process;
9123
9135
  if (!process) {
@@ -9146,9 +9158,9 @@ var DataProvider = /*#__PURE__*/ function() {
9146
9158
  key: "canI",
9147
9159
  value: function canI(action) {
9148
9160
  var rule = 'allow' + action;
9149
- if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_7__.IS_PROD) {
9161
+ if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_8__.IS_PROD) {
9150
9162
  if (!possibleRules.has(rule)) {
9151
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.error)('Wrong action ' + action);
9163
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)('Wrong action ' + action);
9152
9164
  }
9153
9165
  }
9154
9166
  var presetValue = this.o.permissionsPresets[rule];
@@ -9182,22 +9194,22 @@ var DataProvider = /*#__PURE__*/ function() {
9182
9194
  }
9183
9195
  },
9184
9196
  {
9185
- /**
9197
+ key: "items",
9198
+ value: /**
9186
9199
  * Load items list by path and source
9187
- */ key: "items",
9188
- value: function items(path, source) {
9200
+ */ function items(path, source) {
9189
9201
  var _this = this;
9190
9202
  var mods = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
9191
9203
  return this.__items(path, source, mods, function(resp) {
9192
- return _this.generateItemsList(resp.data.sources, mods);
9204
+ return _this.__generateItemsList(resp.data.sources, mods);
9193
9205
  });
9194
9206
  }
9195
9207
  },
9196
9208
  {
9197
- /**
9209
+ key: "itemsEx",
9210
+ value: /**
9198
9211
  * Load items list by path and source
9199
- */ key: "itemsEx",
9200
- value: function itemsEx(path, source) {
9212
+ */ function itemsEx(path, source) {
9201
9213
  var _this = this;
9202
9214
  var mods = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
9203
9215
  var calcTotal = function calcTotal(sources) {
@@ -9207,15 +9219,15 @@ var DataProvider = /*#__PURE__*/ function() {
9207
9219
  };
9208
9220
  return this.__items(path, source, mods, function(resp) {
9209
9221
  return {
9210
- items: _this.generateItemsList(resp.data.sources, mods),
9222
+ items: _this.__generateItemsList(resp.data.sources, mods),
9211
9223
  loadedTotal: calcTotal(resp.data.sources)
9212
9224
  };
9213
9225
  });
9214
9226
  }
9215
9227
  },
9216
9228
  {
9217
- key: "generateItemsList",
9218
- value: function generateItemsList(sources) {
9229
+ key: "__generateItemsList",
9230
+ value: function __generateItemsList(sources) {
9219
9231
  var _this = this;
9220
9232
  var mods = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
9221
9233
  var elements = [];
@@ -9229,14 +9241,14 @@ var DataProvider = /*#__PURE__*/ function() {
9229
9241
  sources.forEach(function(source) {
9230
9242
  if (source.files && source.files.length) {
9231
9243
  var sort = _this.o.sort;
9232
- if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.isFunction)(sort) && mods.sortBy) {
9244
+ if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_10__.isFunction)(sort) && mods.sortBy) {
9233
9245
  source.files.sort(function(a, b) {
9234
9246
  return sort(a, b, mods.sortBy);
9235
9247
  });
9236
9248
  }
9237
9249
  source.files.forEach(function(item) {
9238
9250
  if (inFilter(item) && canBeFile(item)) {
9239
- elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_10__.FileBrowserItem.create((0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_5__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__._)({}, item), {
9251
+ elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_16__.FileBrowserItem.create((0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_5__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_4__._)({}, item), {
9240
9252
  sourceName: source.name,
9241
9253
  source: source
9242
9254
  })));
@@ -9252,11 +9264,11 @@ var DataProvider = /*#__PURE__*/ function() {
9252
9264
  value: function tree(path, source) {
9253
9265
  return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function() {
9254
9266
  var _this;
9255
- return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_6__._)(this, function(_state) {
9267
+ return (0,_swc_helpers_ts_generator__WEBPACK_IMPORTED_MODULE_7__._)(this, function(_state) {
9256
9268
  switch(_state.label){
9257
9269
  case 0:
9258
9270
  _this = this;
9259
- path = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.normalizeRelativePath)(path);
9271
+ path = (0,jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_11__.normalizeRelativePath)(path);
9260
9272
  if (!this.o.folder) {
9261
9273
  return [
9262
9274
  2,
@@ -9290,33 +9302,33 @@ var DataProvider = /*#__PURE__*/ function() {
9290
9302
  }
9291
9303
  },
9292
9304
  {
9293
- /**
9305
+ key: "getPathByUrl",
9306
+ value: /**
9294
9307
  * Get path by url. You can use this method in another modules
9295
- */ key: "getPathByUrl",
9296
- value: function getPathByUrl(url) {
9308
+ */ function getPathByUrl(url) {
9297
9309
  var _this = this;
9298
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.set)('options.getLocalFileByUrl.data.url', url, this);
9310
+ (0,jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_14__.set)('options.getLocalFileByUrl.data.url', url, this);
9299
9311
  return this.get('getLocalFileByUrl').then(function(resp) {
9300
9312
  if (_this.isSuccess(resp)) {
9301
9313
  return resp.data;
9302
9314
  }
9303
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.error)(_this.getMessage(resp));
9315
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)(_this.getMessage(resp));
9304
9316
  });
9305
9317
  }
9306
9318
  },
9307
9319
  {
9308
- /**
9320
+ key: "createFolder",
9321
+ value: /**
9309
9322
  * Create a directory on the server
9310
9323
  *
9311
9324
  * @param name - Name the new folder
9312
9325
  * @param path - Relative directory in which you want create a folder
9313
9326
  * @param source - Server source key
9314
- */ key: "createFolder",
9315
- value: function createFolder(name, path, source) {
9327
+ */ function createFolder(name, path, source) {
9316
9328
  var _this = this;
9317
9329
  var create = this.o.create;
9318
9330
  if (!create) {
9319
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.error)('Set Create api options');
9331
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)('Set Create api options');
9320
9332
  }
9321
9333
  create.data.source = source;
9322
9334
  create.data.path = path;
@@ -9325,23 +9337,23 @@ var DataProvider = /*#__PURE__*/ function() {
9325
9337
  if (_this.isSuccess(resp)) {
9326
9338
  return true;
9327
9339
  }
9328
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.error)(_this.getMessage(resp));
9340
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)(_this.getMessage(resp));
9329
9341
  });
9330
9342
  }
9331
9343
  },
9332
9344
  {
9333
- /**
9345
+ key: "move",
9346
+ value: /**
9334
9347
  * Move a file / directory on the server
9335
9348
  *
9336
9349
  * @param filepath - The relative path to the file / folder source
9337
9350
  * @param path - Relative to the directory where you want to move the file / folder
9338
- */ key: "move",
9339
- value: function move(filepath, path, source, isFile) {
9351
+ */ function move(filepath, path, source, isFile) {
9340
9352
  var _this = this;
9341
9353
  var mode = isFile ? 'fileMove' : 'folderMove';
9342
9354
  var option = this.options[mode];
9343
9355
  if (!option) {
9344
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.error)('Set Move api options');
9356
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)('Set Move api options');
9345
9357
  }
9346
9358
  option.data.from = filepath;
9347
9359
  option.data.path = path;
@@ -9350,23 +9362,23 @@ var DataProvider = /*#__PURE__*/ function() {
9350
9362
  if (_this.isSuccess(resp)) {
9351
9363
  return true;
9352
9364
  }
9353
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.error)(_this.getMessage(resp));
9365
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)(_this.getMessage(resp));
9354
9366
  });
9355
9367
  }
9356
9368
  },
9357
9369
  {
9358
- key: "remove",
9370
+ key: "__remove",
9359
9371
  value: /**
9360
9372
  * Deleting item
9361
9373
  *
9362
9374
  * @param path - Relative path
9363
9375
  * @param file - The filename
9364
9376
  * @param source - Source
9365
- */ function remove(action, path, file, source) {
9377
+ */ function __remove(action, path, file, source) {
9366
9378
  var _this = this;
9367
9379
  var fr = this.o[action];
9368
9380
  if (!fr) {
9369
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.error)('Set "'.concat(action, '" api options'));
9381
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)('Set "'.concat(action, '" api options'));
9370
9382
  }
9371
9383
  fr.data.path = path;
9372
9384
  fr.data.name = file;
@@ -9380,31 +9392,31 @@ var DataProvider = /*#__PURE__*/ function() {
9380
9392
  }
9381
9393
  },
9382
9394
  {
9383
- /**
9395
+ key: "fileRemove",
9396
+ value: /**
9384
9397
  * Deleting a file
9385
9398
  *
9386
9399
  * @param path - Relative path
9387
9400
  * @param file - The filename
9388
9401
  * @param source - Source
9389
- */ key: "fileRemove",
9390
- value: function fileRemove(path, file, source) {
9391
- return this.remove('fileRemove', path, file, source);
9402
+ */ function fileRemove(path, file, source) {
9403
+ return this.__remove('fileRemove', path, file, source);
9392
9404
  }
9393
9405
  },
9394
9406
  {
9395
- /**
9407
+ key: "folderRemove",
9408
+ value: /**
9396
9409
  * Deleting a folder
9397
9410
  *
9398
9411
  * @param path - Relative path
9399
9412
  * @param file - The filename
9400
9413
  * @param source - Source
9401
- */ key: "folderRemove",
9402
- value: function folderRemove(path, file, source) {
9403
- return this.remove('folderRemove', path, file, source);
9414
+ */ function folderRemove(path, file, source) {
9415
+ return this.__remove('folderRemove', path, file, source);
9404
9416
  }
9405
9417
  },
9406
9418
  {
9407
- key: "rename",
9419
+ key: "__rename",
9408
9420
  value: /**
9409
9421
  * Rename action
9410
9422
  *
@@ -9412,11 +9424,11 @@ var DataProvider = /*#__PURE__*/ function() {
9412
9424
  * @param name - Old name
9413
9425
  * @param newname - New name
9414
9426
  * @param source - Source
9415
- */ function rename(action, path, name, newname, source) {
9427
+ */ function __rename(action, path, name, newname, source) {
9416
9428
  var _this = this;
9417
9429
  var fr = this.o[action];
9418
9430
  if (!fr) {
9419
- throw (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_8__.error)('Set "'.concat(action, '" api options'));
9431
+ throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_13__.error)('Set "'.concat(action, '" api options'));
9420
9432
  }
9421
9433
  fr.data.path = path;
9422
9434
  fr.data.name = name;
@@ -9431,24 +9443,24 @@ var DataProvider = /*#__PURE__*/ function() {
9431
9443
  }
9432
9444
  },
9433
9445
  {
9434
- /**
9446
+ key: "folderRename",
9447
+ value: /**
9435
9448
  * Rename folder
9436
- */ key: "folderRename",
9437
- value: function folderRename(path, name, newname, source) {
9438
- return this.rename('folderRename', path, name, newname, source);
9449
+ */ function folderRename(path, name, newname, source) {
9450
+ return this.__rename('folderRename', path, name, newname, source);
9439
9451
  }
9440
9452
  },
9441
9453
  {
9442
- /**
9454
+ key: "fileRename",
9455
+ value: /**
9443
9456
  * Rename file
9444
- */ key: "fileRename",
9445
- value: function fileRename(path, name, newname, source) {
9446
- return this.rename('fileRename', path, name, newname, source);
9457
+ */ function fileRename(path, name, newname, source) {
9458
+ return this.__rename('fileRename', path, name, newname, source);
9447
9459
  }
9448
9460
  },
9449
9461
  {
9450
- key: "changeImage",
9451
- value: function changeImage(type, path, source, name, newname, box) {
9462
+ key: "__changeImage",
9463
+ value: function __changeImage(type, path, source, name, newname, box) {
9452
9464
  if (!this.o[type]) {
9453
9465
  this.o[type] = {
9454
9466
  data: {}
@@ -9467,25 +9479,25 @@ var DataProvider = /*#__PURE__*/ function() {
9467
9479
  query.data.path = path;
9468
9480
  query.data.name = name;
9469
9481
  query.data.source = source;
9470
- return this.get(type).then(function() {
9471
- return true;
9482
+ return this.get(type).then(function(resp) {
9483
+ return resp.data.newPath || true;
9472
9484
  });
9473
9485
  }
9474
9486
  },
9475
9487
  {
9476
- /**
9488
+ key: "crop",
9489
+ value: /**
9477
9490
  * Send command to server to crop image
9478
- */ key: "crop",
9479
- value: function crop(path, source, name, newname, box) {
9480
- return this.changeImage('crop', path, source, name, newname, box);
9491
+ */ function crop(path, source, name, newname, box) {
9492
+ return this.__changeImage('crop', path, source, name, newname, box);
9481
9493
  }
9482
9494
  },
9483
9495
  {
9484
- /**
9496
+ key: "resize",
9497
+ value: /**
9485
9498
  * Send command to server to resize image
9486
- */ key: "resize",
9487
- value: function resize(path, source, name, newname, box) {
9488
- return this.changeImage('resize', path, source, name, newname, box);
9499
+ */ function resize(path, source, name, newname, box) {
9500
+ return this.__changeImage('resize', path, source, name, newname, box);
9489
9501
  }
9490
9502
  },
9491
9503
  {
@@ -9513,6 +9525,60 @@ var DataProvider = /*#__PURE__*/ function() {
9513
9525
  return DataProvider;
9514
9526
  }();
9515
9527
 
9528
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9529
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9530
+ ], DataProvider.prototype, "onProgress", null);
9531
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9532
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9533
+ ], DataProvider.prototype, "permissions", null);
9534
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9535
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9536
+ ], DataProvider.prototype, "canI", null);
9537
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9538
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9539
+ ], DataProvider.prototype, "items", null);
9540
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9541
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9542
+ ], DataProvider.prototype, "itemsEx", null);
9543
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9544
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9545
+ ], DataProvider.prototype, "tree", null);
9546
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9547
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9548
+ ], DataProvider.prototype, "getPathByUrl", null);
9549
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9550
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9551
+ ], DataProvider.prototype, "createFolder", null);
9552
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9553
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9554
+ ], DataProvider.prototype, "move", null);
9555
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9556
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9557
+ ], DataProvider.prototype, "fileRemove", null);
9558
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9559
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9560
+ ], DataProvider.prototype, "folderRemove", null);
9561
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9562
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9563
+ ], DataProvider.prototype, "folderRename", null);
9564
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9565
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9566
+ ], DataProvider.prototype, "fileRename", null);
9567
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9568
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9569
+ ], DataProvider.prototype, "crop", null);
9570
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9571
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9572
+ ], DataProvider.prototype, "resize", null);
9573
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9574
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9575
+ ], DataProvider.prototype, "getMessage", null);
9576
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9577
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9578
+ ], DataProvider.prototype, "isSuccess", null);
9579
+ (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_6__.__decorate)([
9580
+ jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_9__.autobind
9581
+ ], DataProvider.prototype, "destruct", null);
9516
9582
 
9517
9583
 
9518
9584
  /***/ }),
@@ -15770,9 +15836,10 @@ var $$temp = function $$temp() {
15770
15836
  };
15771
15837
  a.href = url;
15772
15838
  j.filebrowser.dataProvider.getPathByUrl(a.href.toString()).then(function(resp) {
15773
- jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_2__.openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, function() {
15839
+ jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_2__.openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, function(newPath) {
15774
15840
  var timestamp = new Date().getTime();
15775
- state.values.imageSrc = url + (url.indexOf('?') !== -1 ? '' : '?') + '&_tmp=' + timestamp.toString();
15841
+ var newUrl = newPath || url;
15842
+ state.values.imageSrc = newUrl + (newUrl.indexOf('?') !== -1 ? '' : '?') + '&_tmp=' + timestamp.toString();
15776
15843
  }, function(error) {
15777
15844
  j.alert(error.message);
15778
15845
  });
@@ -22251,11 +22318,16 @@ function _iterable_to_array(iter) {
22251
22318
  /* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(16964);
22252
22319
  /* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(84839);
22253
22320
  /* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(27795);
22254
- /* harmony import */ var jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(65946);
22255
- /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(59400);
22256
- /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(5266);
22257
- /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(54500);
22258
- /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(8908);
22321
+ /* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(88475);
22322
+ /* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(4040);
22323
+ /* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7909);
22324
+ /* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(80991);
22325
+ /* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28723);
22326
+ /* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(71125);
22327
+ /* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(59400);
22328
+ /* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(5266);
22329
+ /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(54500);
22330
+ /* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(8908);
22259
22331
  /*!
22260
22332
  * Jodit Editor (https://xdsoft.net/jodit/)
22261
22333
  * Released under MIT see LICENSE.txt in the project root for license information.
@@ -22280,6 +22352,11 @@ function _iterable_to_array(iter) {
22280
22352
 
22281
22353
 
22282
22354
 
22355
+
22356
+
22357
+
22358
+
22359
+
22283
22360
 
22284
22361
  var jie = 'jodit-image-editor';
22285
22362
  var TABS = {
@@ -22316,7 +22393,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22316
22393
  wn = nw * (h / nh);
22317
22394
  hn = h;
22318
22395
  }
22319
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(_this.crop_box, {
22396
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(_this.crop_box, {
22320
22397
  width: wn,
22321
22398
  height: hn
22322
22399
  });
@@ -22333,8 +22410,8 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22333
22410
  } else {
22334
22411
  _this.new_h = ImageEditor.calcValueByPercent(h, _this.o.cropDefaultHeight);
22335
22412
  }
22336
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(_this.cropHandler, {
22337
- backgroundImage: 'url(' + (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(_this.cropImage, 'src') + ')',
22413
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(_this.cropHandler, {
22414
+ backgroundImage: 'url(' + (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_13__.attr)(_this.cropImage, 'src') + ')',
22338
22415
  width: _this.new_w,
22339
22416
  height: _this.new_h,
22340
22417
  left: w / 2 - _this.new_w / 2,
@@ -22346,8 +22423,8 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22346
22423
  return;
22347
22424
  }
22348
22425
  var ratioX = _this.cropImage.offsetWidth / _this.naturalWidth, ratioY = _this.cropImage.offsetHeight / _this.naturalHeight;
22349
- _this.cropBox.x = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(_this.cropHandler, 'left') / ratioX;
22350
- _this.cropBox.y = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(_this.cropHandler, 'top') / ratioY;
22426
+ _this.cropBox.x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(_this.cropHandler, 'left') / ratioX;
22427
+ _this.cropBox.y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(_this.cropHandler, 'top') / ratioY;
22351
22428
  _this.cropBox.w = _this.cropHandler.offsetWidth / ratioX;
22352
22429
  _this.cropBox.h = _this.cropHandler.offsetHeight / ratioY;
22353
22430
  _this.sizes.textContent = _this.cropBox.w.toFixed(0) + 'x' + _this.cropBox.h.toFixed(0);
@@ -22356,7 +22433,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22356
22433
  _this.resizeBox.h = _this.image.offsetHeight || _this.naturalHeight;
22357
22434
  }), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_3__._)(_this, "setHandlers", function() {
22358
22435
  var self = _this;
22359
- var _refs = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.refs)(_this.editor), widthInput = _refs.widthInput, heightInput = _refs.heightInput;
22436
+ var _refs = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.refs)(_this.editor), widthInput = _refs.widthInput, heightInput = _refs.heightInput;
22360
22437
  self.j.e.on([
22361
22438
  self.editor.querySelector('.jodit_bottomright'),
22362
22439
  self.cropHandler
@@ -22365,11 +22442,11 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22365
22442
  self.showCrop();
22366
22443
  _this.j.e.fire(self.cropHandler, 'updatesize');
22367
22444
  });
22368
- self.j.e.on((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.toArray)(_this.editor.querySelectorAll(".".concat(jie, "__slider-title"))), 'click', _this.onTitleModeClick).on([
22445
+ self.j.e.on((0,jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_11__.toArray)(_this.editor.querySelectorAll(".".concat(jie, "__slider-title"))), 'click', _this.onTitleModeClick).on([
22369
22446
  widthInput,
22370
22447
  heightInput
22371
22448
  ], 'input', _this.onChangeSizeInput);
22372
- var _refs1 = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.refs)(_this.editor), keepAspectRatioResize = _refs1.keepAspectRatioResize, keepAspectRatioCrop = _refs1.keepAspectRatioCrop;
22449
+ var _refs1 = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.refs)(_this.editor), keepAspectRatioResize = _refs1.keepAspectRatioResize, keepAspectRatioCrop = _refs1.keepAspectRatioCrop;
22373
22450
  if (keepAspectRatioResize) {
22374
22451
  keepAspectRatioResize.addEventListener('change', function() {
22375
22452
  _this.resizeUseRatio = keepAspectRatioResize.checked;
@@ -22381,7 +22458,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22381
22458
  });
22382
22459
  }
22383
22460
  self.j.e.on(self.resizeHandler, 'updatesize', function() {
22384
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.resizeHandler, {
22461
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.resizeHandler, {
22385
22462
  top: 0,
22386
22463
  left: 0,
22387
22464
  width: self.image.offsetWidth || self.naturalWidth,
@@ -22392,7 +22469,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22392
22469
  if (!self.cropImage) {
22393
22470
  return;
22394
22471
  }
22395
- var new_x = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.cropHandler, 'left'), new_y = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.cropHandler, 'top'), new_width = self.cropHandler.offsetWidth, new_height = self.cropHandler.offsetHeight;
22472
+ var new_x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.cropHandler, 'left'), new_y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.cropHandler, 'top'), new_width = self.cropHandler.offsetWidth, new_height = self.cropHandler.offsetHeight;
22396
22473
  if (new_x < 0) {
22397
22474
  new_x = 0;
22398
22475
  }
@@ -22411,7 +22488,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22411
22488
  new_width = new_height * self.ratio;
22412
22489
  }
22413
22490
  }
22414
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.cropHandler, {
22491
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.cropHandler, {
22415
22492
  width: new_width,
22416
22493
  height: new_height,
22417
22494
  left: new_x,
@@ -22430,7 +22507,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22430
22507
  switch(button){
22431
22508
  case self.buttons.saveas:
22432
22509
  self.j.prompt('Enter new name', 'Save in new file', function(name) {
22433
- if (!(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.trim)(name)) {
22510
+ if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_12__.trim)(name)) {
22434
22511
  self.j.alert('The name should not be empty');
22435
22512
  return false;
22436
22513
  }
@@ -22446,7 +22523,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22446
22523
  break;
22447
22524
  case self.buttons.reset:
22448
22525
  if (self.activeTab === TABS.resize) {
22449
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.image, {
22526
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.image, {
22450
22527
  width: null,
22451
22528
  height: null
22452
22529
  });
@@ -22461,18 +22538,24 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22461
22538
  });
22462
22539
  });
22463
22540
  });
22464
- _this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor : jodit_config__WEBPACK_IMPORTED_MODULE_13__.Config.defaultOptions.imageeditor;
22541
+ _this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor : jodit_config__WEBPACK_IMPORTED_MODULE_18__.Config.defaultOptions.imageeditor;
22465
22542
  var o = _this.options;
22466
22543
  _this.resizeUseRatio = o.resizeUseRatio;
22467
22544
  _this.cropUseRatio = o.cropUseRatio;
22468
22545
  _this.buttons = {
22469
- reset: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_12__.Button)(_this.j, 'update', 'Reset'),
22470
- save: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_12__.Button)(_this.j, 'save', 'Save'),
22471
- saveas: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_12__.Button)(_this.j, 'save', 'Save as ...')
22546
+ reset: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_17__.Button)(_this.j, 'update', 'Reset'),
22547
+ save: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_17__.Button)(_this.j, 'save', 'Save'),
22548
+ saveas: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_17__.Button)(_this.j, {
22549
+ icon: {
22550
+ name: 'save'
22551
+ },
22552
+ name: 'save-as',
22553
+ text: 'Save as ...'
22554
+ })
22472
22555
  };
22473
22556
  _this.activeTab = o.resize ? TABS.resize : TABS.crop;
22474
- _this.editor = (0,_templates_form__WEBPACK_IMPORTED_MODULE_15__.form)(_this.j, _this.options);
22475
- var _refs = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.refs)(_this.editor), resizeBox = _refs.resizeBox, cropBox = _refs.cropBox;
22557
+ _this.editor = (0,_templates_form__WEBPACK_IMPORTED_MODULE_20__.form)(_this.j, _this.options);
22558
+ var _refs = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.refs)(_this.editor), resizeBox = _refs.resizeBox, cropBox = _refs.cropBox;
22476
22559
  _this.resize_box = resizeBox;
22477
22560
  _this.crop_box = cropBox;
22478
22561
  _this.sizes = _this.editor.querySelector(".".concat(jie, "__area.").concat(jie, "__area_crop .jodit-image-editor__sizes"));
@@ -22545,9 +22628,9 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22545
22628
  return this.j.async.promise(function(resolve) {
22546
22629
  var timestamp = new Date().getTime();
22547
22630
  _this.image = _this.j.c.element('img');
22548
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.$$)('img,.jodit-icon_loader', _this.resize_box).forEach(jodit_core_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove);
22549
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.$$)('img,.jodit-icon_loader', _this.crop_box).forEach(jodit_core_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove);
22550
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(_this.cropHandler, 'background', 'transparent');
22631
+ (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.$$)('img,.jodit-icon_loader', _this.resize_box).forEach(jodit_core_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove);
22632
+ (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.$$)('img,.jodit-icon_loader', _this.crop_box).forEach(jodit_core_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove);
22633
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(_this.cropHandler, 'background', 'transparent');
22551
22634
  _this.onSave = save;
22552
22635
  _this.resize_box.appendChild(_this.j.c.element('i', {
22553
22636
  class: 'jodit-icon_loader'
@@ -22562,7 +22645,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22562
22645
  }
22563
22646
  _this.image.setAttribute('src', url);
22564
22647
  _this._dialog.open();
22565
- var _refs = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.refs)(_this.editor), widthInput = _refs.widthInput, heightInput = _refs.heightInput;
22648
+ var _refs = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.refs)(_this.editor), widthInput = _refs.widthInput, heightInput = _refs.heightInput;
22566
22649
  var onload = function onload1() {
22567
22650
  if (_this.isDestructed) {
22568
22651
  return;
@@ -22576,7 +22659,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22576
22659
  _this.resize_box.appendChild(_this.image);
22577
22660
  _this.cropImage = _this.image.cloneNode(true);
22578
22661
  _this.crop_box.appendChild(_this.cropImage);
22579
- jodit_core_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove.apply(null, (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.$$)('.jodit-icon_loader', _this.editor));
22662
+ jodit_core_dom__WEBPACK_IMPORTED_MODULE_10__.Dom.safeRemove.apply(null, (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.$$)('.jodit-icon_loader', _this.editor));
22580
22663
  if (_this.activeTab === TABS.crop) {
22581
22664
  _this.showCrop();
22582
22665
  }
@@ -22601,11 +22684,11 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22601
22684
  if (!slide) {
22602
22685
  return;
22603
22686
  }
22604
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.$$)(".".concat(jie, "__slider,.").concat(jie, "__area"), self.editor).forEach(function(elm) {
22687
+ (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.$$)(".".concat(jie, "__slider,.").concat(jie, "__area"), self.editor).forEach(function(elm) {
22605
22688
  return elm.classList.remove("".concat(jie, "_active"));
22606
22689
  });
22607
22690
  slide.classList.add("".concat(jie, "_active"));
22608
- this.activeTab = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.attr)(slide, '-area') || TABS.resize;
22691
+ this.activeTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_13__.attr)(slide, '-area') || TABS.resize;
22609
22692
  var tab = self.editor.querySelector(".".concat(jie, "__area.").concat(jie, "__area_") + self.activeTab);
22610
22693
  if (tab) {
22611
22694
  tab.classList.add("".concat(jie, "_active"));
@@ -22618,14 +22701,14 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22618
22701
  {
22619
22702
  key: "onChangeSizeInput",
22620
22703
  value: function onChangeSizeInput(e) {
22621
- var self = this, input = e.target, _refs = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.refs)(this.editor), widthInput = _refs.widthInput, heightInput = _refs.heightInput, isWidth = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.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;
22704
+ var self = this, input = e.target, _refs = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.refs)(this.editor), widthInput = _refs.widthInput, heightInput = _refs.heightInput, isWidth = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_13__.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;
22622
22705
  var y;
22623
22706
  if (x > minX) {
22624
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.image, isWidth ? 'width' : 'height', x);
22707
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.image, isWidth ? 'width' : 'height', x);
22625
22708
  if (self.resizeUseRatio) {
22626
22709
  y = isWidth ? Math.round(x / self.ratio) : Math.round(x * self.ratio);
22627
22710
  if (y > minY) {
22628
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.image, !isWidth ? 'width' : 'height', y);
22711
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.image, !isWidth ? 'width' : 'height', y);
22629
22712
  if (isWidth) {
22630
22713
  heightInput.value = y.toString();
22631
22714
  } else {
@@ -22648,8 +22731,8 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22648
22731
  self.start_x = e.clientX;
22649
22732
  self.start_y = e.clientY;
22650
22733
  if (self.activeTab === TABS.crop) {
22651
- self.top_x = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.cropHandler, 'left');
22652
- self.top_y = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.cropHandler, 'top');
22734
+ self.top_x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.cropHandler, 'left');
22735
+ self.top_y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.cropHandler, 'top');
22653
22736
  self.width = self.cropHandler.offsetWidth;
22654
22737
  self.height = self.cropHandler.offsetHeight;
22655
22738
  } else {
@@ -22676,7 +22759,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22676
22759
  if (!self.clicked) {
22677
22760
  return;
22678
22761
  }
22679
- var _refs = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.refs)(this.editor), widthInput = _refs.widthInput, heightInput = _refs.heightInput;
22762
+ var _refs = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_15__.refs)(this.editor), widthInput = _refs.widthInput, heightInput = _refs.heightInput;
22680
22763
  self.diff_x = e.clientX - self.start_x;
22681
22764
  self.diff_y = e.clientY - self.start_y;
22682
22765
  if (self.activeTab === TABS.resize && self.resizeUseRatio || self.activeTab === TABS.crop && self.cropUseRatio) {
@@ -22693,11 +22776,11 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22693
22776
  }
22694
22777
  if (self.activeTab === TABS.resize) {
22695
22778
  if (self.new_w > self.o.resizeMinWidth) {
22696
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.image, 'width', self.new_w + 'px');
22779
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.image, 'width', self.new_w + 'px');
22697
22780
  widthInput.value = self.new_w.toString();
22698
22781
  }
22699
22782
  if (self.new_h > self.o.resizeMinHeight) {
22700
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.image, 'height', self.new_h + 'px');
22783
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.image, 'height', self.new_h + 'px');
22701
22784
  heightInput.value = self.new_h.toString();
22702
22785
  }
22703
22786
  this.j.e.fire(self.resizeHandler, 'updatesize');
@@ -22709,7 +22792,7 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22709
22792
  if (self.top_y + self.new_h > self.cropImage.offsetHeight) {
22710
22793
  self.new_h = self.cropImage.offsetHeight - self.top_y;
22711
22794
  }
22712
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.cropHandler, {
22795
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.cropHandler, {
22713
22796
  width: self.new_w,
22714
22797
  height: self.new_h
22715
22798
  });
@@ -22717,11 +22800,11 @@ var ImageEditor = /*#__PURE__*/ function(ViewComponent) {
22717
22800
  if (self.top_x + self.diff_x + self.cropHandler.offsetWidth > self.cropImage.offsetWidth) {
22718
22801
  self.diff_x = self.cropImage.offsetWidth - self.top_x - self.cropHandler.offsetWidth;
22719
22802
  }
22720
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.cropHandler, 'left', self.top_x + self.diff_x);
22803
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.cropHandler, 'left', self.top_x + self.diff_x);
22721
22804
  if (self.top_y + self.diff_y + self.cropHandler.offsetHeight > self.cropImage.offsetHeight) {
22722
22805
  self.diff_y = self.cropImage.offsetHeight - self.top_y - self.cropHandler.offsetHeight;
22723
22806
  }
22724
- (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.css)(self.cropHandler, 'top', self.top_y + self.diff_y);
22807
+ (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_14__.css)(self.cropHandler, 'top', self.top_y + self.diff_y);
22725
22808
  }
22726
22809
  this.j.e.fire(self.cropHandler, 'updatesize');
22727
22810
  }
@@ -22790,11 +22873,11 @@ ImageEditor = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_7__.__decorat
22790
22873
  */ function openImageEditor(href, name, path, source, onSuccess, onFailed) {
22791
22874
  var _this = this;
22792
22875
  return this.getInstance('ImageEditor', this.o).open(href, function(newname, box, success, failed) {
22793
- return (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_11__.call)(box.action === 'resize' ? _this.dataProvider.resize : _this.dataProvider.crop, path, source, name, newname, box.box).then(function(ok) {
22794
- if (ok) {
22876
+ return (0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_16__.call)(box.action === 'resize' ? _this.dataProvider.resize : _this.dataProvider.crop, path, source, name, newname, box.box).then(function(result) {
22877
+ if (result) {
22795
22878
  success();
22796
22879
  if (onSuccess) {
22797
- onSuccess();
22880
+ onSuccess(typeof result === 'string' ? result : undefined);
22798
22881
  }
22799
22882
  }
22800
22883
  }).catch(function(error) {
@@ -34983,6 +35066,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
34983
35066
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
34984
35067
  /* harmony export */ call: function() { return /* binding */ call; },
34985
35068
  /* harmony export */ callPromise: function() { return /* binding */ callPromise; },
35069
+ /* harmony export */ callThis: function() { return /* binding */ callThis; },
34986
35070
  /* harmony export */ getDataTransfer: function() { return /* binding */ getDataTransfer; },
34987
35071
  /* harmony export */ getPropertyDescriptor: function() { return /* binding */ getPropertyDescriptor; },
34988
35072
  /* harmony export */ keys: function() { return /* binding */ keys; },
@@ -35020,6 +35104,20 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
35020
35104
  }
35021
35105
  return func.apply(void 0, (0,_swc_helpers_to_consumable_array__WEBPACK_IMPORTED_MODULE_0__._)(args));
35022
35106
  }
35107
+ /**
35108
+ * Call function with parameters
35109
+ *
35110
+ * @example
35111
+ * ```js
35112
+ * const f = Math.random();
35113
+ * Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
35114
+ * ```
35115
+ */ function callThis(func, thisArg) {
35116
+ for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
35117
+ args[_key - 2] = arguments[_key];
35118
+ }
35119
+ return func.apply(thisArg, args);
35120
+ }
35023
35121
  /**
35024
35122
  * Mark element for debugging
35025
35123
  */ function markOwner(jodit, elm) {
@@ -41376,7 +41474,7 @@ __webpack_require__.r(__webpack_exports__);
41376
41474
  * @packageDocumentation
41377
41475
  * @module constants
41378
41476
  */
41379
- var APP_VERSION = "4.9.13";
41477
+ var APP_VERSION = "4.9.15";
41380
41478
  // prettier-ignore
41381
41479
  var ES = "es5";
41382
41480
  var IS_ES_MODERN = false;
@@ -43361,7 +43459,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.showWordsCounter = tr
43361
43459
  content = data;
43362
43460
  }
43363
43461
  if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isArray)(content)) {
43364
- this.toolbar.build(content, target);
43462
+ var disabled = this.j.o.toolbarInlineDisabledButtons;
43463
+ this.toolbar.build(disabled.length ? content.filter(function(item) {
43464
+ var name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_10__.isString)(item) ? item : item.name;
43465
+ return !disabled.includes(name !== null && name !== void 0 ? name : '');
43466
+ }) : content, target);
43365
43467
  this.toolbar.buttonSize = this.j.o.toolbarButtonSize;
43366
43468
  content = this.toolbar.container;
43367
43469
  }
@@ -46239,6 +46341,7 @@ __webpack_require__.r(__webpack_exports__);
46239
46341
  /* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
46240
46342
  /* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.call; },
46241
46343
  /* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callPromise; },
46344
+ /* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callThis; },
46242
46345
  /* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
46243
46346
  /* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
46244
46347
  /* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_18__.cns; },