jodit 4.9.13 → 4.9.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +13 -13
- package/es2015/jodit.js +172 -77
- package/es2015/jodit.min.js +5 -5
- package/es2015/plugins/debug/debug.css +1 -1
- package/es2015/plugins/debug/debug.js +1 -1
- package/es2015/plugins/debug/debug.min.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2015/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2018/jodit.fat.min.js +5 -5
- package/es2018/jodit.min.js +5 -5
- package/es2018/plugins/debug/debug.min.js +1 -1
- package/es2018/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021/jodit.css +1 -1
- package/es2021/jodit.fat.min.js +6 -6
- package/es2021/jodit.js +172 -77
- package/es2021/jodit.min.js +6 -6
- package/es2021/plugins/debug/debug.css +1 -1
- package/es2021/plugins/debug/debug.js +1 -1
- package/es2021/plugins/debug/debug.min.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es2021.en/jodit.css +1 -1
- package/es2021.en/jodit.fat.min.js +7 -7
- package/es2021.en/jodit.js +172 -77
- package/es2021.en/jodit.min.js +6 -6
- package/es2021.en/plugins/debug/debug.css +1 -1
- package/es2021.en/plugins/debug/debug.js +1 -1
- package/es2021.en/plugins/debug/debug.min.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es2021.en/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/jodit.css +2 -2
- package/es5/jodit.fat.min.js +2 -2
- package/es5/jodit.js +215 -117
- package/es5/jodit.min.css +2 -2
- package/es5/jodit.min.js +2 -2
- package/es5/plugins/debug/debug.css +1 -1
- package/es5/plugins/debug/debug.js +1 -1
- package/es5/plugins/debug/debug.min.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.css +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.js +1 -1
- package/es5/plugins/speech-recognize/speech-recognize.min.js +1 -1
- package/es5/polyfills.fat.min.js +1 -1
- package/es5/polyfills.js +1 -1
- package/es5/polyfills.min.js +1 -1
- package/esm/core/constants.js +1 -1
- package/esm/core/helpers/utils/utils.d.ts +10 -0
- package/esm/core/helpers/utils/utils.js +12 -0
- package/esm/modules/file-browser/data-provider.d.ts +4 -4
- package/esm/modules/file-browser/data-provider.js +83 -14
- package/esm/modules/image-editor/image-editor.js +13 -2
- package/package.json +1 -1
- package/types/core/helpers/utils/utils.d.ts +10 -0
- package/types/modules/file-browser/data-provider.d.ts +4 -4
package/es2021.en/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.
|
|
4
|
+
* Version: v4.9.14
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -7353,10 +7353,16 @@ class Ajax {
|
|
|
7353
7353
|
/* harmony export */ "default": function() { return /* binding */ DataProvider; }
|
|
7354
7354
|
/* harmony export */ });
|
|
7355
7355
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
7356
|
-
/* harmony import */ var
|
|
7357
|
-
/* harmony import */ var
|
|
7358
|
-
/* harmony import */ var
|
|
7359
|
-
/* harmony import */ var
|
|
7356
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
7357
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
|
|
7358
|
+
/* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49574);
|
|
7359
|
+
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(91565);
|
|
7360
|
+
/* harmony import */ var jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(96340);
|
|
7361
|
+
/* harmony import */ var jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(77483);
|
|
7362
|
+
/* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(33201);
|
|
7363
|
+
/* harmony import */ var jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(52144);
|
|
7364
|
+
/* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(17338);
|
|
7365
|
+
/* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(58664);
|
|
7360
7366
|
/*!
|
|
7361
7367
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
7362
7368
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -7368,6 +7374,12 @@ class Ajax {
|
|
|
7368
7374
|
|
|
7369
7375
|
|
|
7370
7376
|
|
|
7377
|
+
|
|
7378
|
+
|
|
7379
|
+
|
|
7380
|
+
|
|
7381
|
+
|
|
7382
|
+
|
|
7371
7383
|
const DEFAULT_SOURCE_NAME = 'default';
|
|
7372
7384
|
const possibleRules = new Set([
|
|
7373
7385
|
'allowFiles',
|
|
@@ -7397,13 +7409,13 @@ class DataProvider {
|
|
|
7397
7409
|
ajax?.abort();
|
|
7398
7410
|
instances.delete(name);
|
|
7399
7411
|
}
|
|
7400
|
-
const opts = (0,
|
|
7412
|
+
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)({
|
|
7401
7413
|
onProgress: this.progressHandler
|
|
7402
7414
|
}, this.o.ajax));
|
|
7403
7415
|
if (opts.prepareData) {
|
|
7404
7416
|
opts.data = opts.prepareData.call(this, opts.data);
|
|
7405
7417
|
}
|
|
7406
|
-
const ajax = new
|
|
7418
|
+
const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_9__.Ajax(opts);
|
|
7407
7419
|
instances.set(name, ajax);
|
|
7408
7420
|
const promise = ajax.send();
|
|
7409
7421
|
promise.finally(()=>{
|
|
@@ -7432,7 +7444,7 @@ class DataProvider {
|
|
|
7432
7444
|
if (this.o.permissions.url) {
|
|
7433
7445
|
return this.get('permissions').then((resp)=>{
|
|
7434
7446
|
if (this.parent.isInDestruct) {
|
|
7435
|
-
throw (0,
|
|
7447
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.abort)();
|
|
7436
7448
|
}
|
|
7437
7449
|
let process = this.o.permissions.process;
|
|
7438
7450
|
if (!process) {
|
|
@@ -7452,9 +7464,9 @@ class DataProvider {
|
|
|
7452
7464
|
}
|
|
7453
7465
|
canI(action) {
|
|
7454
7466
|
const rule = 'allow' + action;
|
|
7455
|
-
if (!
|
|
7467
|
+
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.IS_PROD) {
|
|
7456
7468
|
if (!possibleRules.has(rule)) {
|
|
7457
|
-
throw (0,
|
|
7469
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)('Wrong action ' + action);
|
|
7458
7470
|
}
|
|
7459
7471
|
}
|
|
7460
7472
|
const presetValue = this.o.permissionsPresets[rule];
|
|
@@ -7485,30 +7497,30 @@ class DataProvider {
|
|
|
7485
7497
|
/**
|
|
7486
7498
|
* Load items list by path and source
|
|
7487
7499
|
*/ items(path, source, mods = {}) {
|
|
7488
|
-
return this.__items(path, source, mods, (resp)=>this.
|
|
7500
|
+
return this.__items(path, source, mods, (resp)=>this.__generateItemsList(resp.data.sources, mods));
|
|
7489
7501
|
}
|
|
7490
7502
|
/**
|
|
7491
7503
|
* Load items list by path and source
|
|
7492
7504
|
*/ itemsEx(path, source, mods = {}) {
|
|
7493
7505
|
const calcTotal = (sources)=>sources.reduce((acc, source)=>acc + source.files.length, 0);
|
|
7494
7506
|
return this.__items(path, source, mods, (resp)=>({
|
|
7495
|
-
items: this.
|
|
7507
|
+
items: this.__generateItemsList(resp.data.sources, mods),
|
|
7496
7508
|
loadedTotal: calcTotal(resp.data.sources)
|
|
7497
7509
|
}));
|
|
7498
7510
|
}
|
|
7499
|
-
|
|
7511
|
+
__generateItemsList(sources, mods = {}) {
|
|
7500
7512
|
const elements = [];
|
|
7501
7513
|
const canBeFile = (item)=>item.type === 'folder' || !mods.onlyImages || item.isImage === undefined || item.isImage;
|
|
7502
7514
|
const inFilter = (item)=>!mods.filterWord?.length || this.o.filter === undefined || this.o.filter(item, mods.filterWord);
|
|
7503
7515
|
sources.forEach((source)=>{
|
|
7504
7516
|
if (source.files && source.files.length) {
|
|
7505
7517
|
const { sort } = this.o;
|
|
7506
|
-
if ((0,
|
|
7518
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_4__.isFunction)(sort) && mods.sortBy) {
|
|
7507
7519
|
source.files.sort((a, b)=>sort(a, b, mods.sortBy));
|
|
7508
7520
|
}
|
|
7509
7521
|
source.files.forEach((item)=>{
|
|
7510
7522
|
if (inFilter(item) && canBeFile(item)) {
|
|
7511
|
-
elements.push(
|
|
7523
|
+
elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_10__.FileBrowserItem.create({
|
|
7512
7524
|
...item,
|
|
7513
7525
|
sourceName: source.name,
|
|
7514
7526
|
source
|
|
@@ -7520,7 +7532,7 @@ class DataProvider {
|
|
|
7520
7532
|
return elements;
|
|
7521
7533
|
}
|
|
7522
7534
|
async tree(path, source) {
|
|
7523
|
-
path = (0,
|
|
7535
|
+
path = (0,jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_5__.normalizeRelativePath)(path);
|
|
7524
7536
|
if (!this.o.folder) {
|
|
7525
7537
|
return Promise.reject(Error('Set Folder Api options'));
|
|
7526
7538
|
}
|
|
@@ -7541,12 +7553,12 @@ class DataProvider {
|
|
|
7541
7553
|
/**
|
|
7542
7554
|
* Get path by url. You can use this method in another modules
|
|
7543
7555
|
*/ getPathByUrl(url) {
|
|
7544
|
-
(0,
|
|
7556
|
+
(0,jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_8__.set)('options.getLocalFileByUrl.data.url', url, this);
|
|
7545
7557
|
return this.get('getLocalFileByUrl').then((resp)=>{
|
|
7546
7558
|
if (this.isSuccess(resp)) {
|
|
7547
7559
|
return resp.data;
|
|
7548
7560
|
}
|
|
7549
|
-
throw (0,
|
|
7561
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(this.getMessage(resp));
|
|
7550
7562
|
});
|
|
7551
7563
|
}
|
|
7552
7564
|
/**
|
|
@@ -7558,7 +7570,7 @@ class DataProvider {
|
|
|
7558
7570
|
*/ createFolder(name, path, source) {
|
|
7559
7571
|
const { create } = this.o;
|
|
7560
7572
|
if (!create) {
|
|
7561
|
-
throw (0,
|
|
7573
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)('Set Create api options');
|
|
7562
7574
|
}
|
|
7563
7575
|
create.data.source = source;
|
|
7564
7576
|
create.data.path = path;
|
|
@@ -7567,7 +7579,7 @@ class DataProvider {
|
|
|
7567
7579
|
if (this.isSuccess(resp)) {
|
|
7568
7580
|
return true;
|
|
7569
7581
|
}
|
|
7570
|
-
throw (0,
|
|
7582
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(this.getMessage(resp));
|
|
7571
7583
|
});
|
|
7572
7584
|
}
|
|
7573
7585
|
/**
|
|
@@ -7579,7 +7591,7 @@ class DataProvider {
|
|
|
7579
7591
|
const mode = isFile ? 'fileMove' : 'folderMove';
|
|
7580
7592
|
const option = this.options[mode];
|
|
7581
7593
|
if (!option) {
|
|
7582
|
-
throw (0,
|
|
7594
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)('Set Move api options');
|
|
7583
7595
|
}
|
|
7584
7596
|
option.data.from = filepath;
|
|
7585
7597
|
option.data.path = path;
|
|
@@ -7588,7 +7600,7 @@ class DataProvider {
|
|
|
7588
7600
|
if (this.isSuccess(resp)) {
|
|
7589
7601
|
return true;
|
|
7590
7602
|
}
|
|
7591
|
-
throw (0,
|
|
7603
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(this.getMessage(resp));
|
|
7592
7604
|
});
|
|
7593
7605
|
}
|
|
7594
7606
|
/**
|
|
@@ -7597,10 +7609,10 @@ class DataProvider {
|
|
|
7597
7609
|
* @param path - Relative path
|
|
7598
7610
|
* @param file - The filename
|
|
7599
7611
|
* @param source - Source
|
|
7600
|
-
*/
|
|
7612
|
+
*/ __remove(action, path, file, source) {
|
|
7601
7613
|
const fr = this.o[action];
|
|
7602
7614
|
if (!fr) {
|
|
7603
|
-
throw (0,
|
|
7615
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(`Set "${action}" api options`);
|
|
7604
7616
|
}
|
|
7605
7617
|
fr.data.path = path;
|
|
7606
7618
|
fr.data.name = file;
|
|
@@ -7619,7 +7631,7 @@ class DataProvider {
|
|
|
7619
7631
|
* @param file - The filename
|
|
7620
7632
|
* @param source - Source
|
|
7621
7633
|
*/ fileRemove(path, file, source) {
|
|
7622
|
-
return this.
|
|
7634
|
+
return this.__remove('fileRemove', path, file, source);
|
|
7623
7635
|
}
|
|
7624
7636
|
/**
|
|
7625
7637
|
* Deleting a folder
|
|
@@ -7628,7 +7640,7 @@ class DataProvider {
|
|
|
7628
7640
|
* @param file - The filename
|
|
7629
7641
|
* @param source - Source
|
|
7630
7642
|
*/ folderRemove(path, file, source) {
|
|
7631
|
-
return this.
|
|
7643
|
+
return this.__remove('folderRemove', path, file, source);
|
|
7632
7644
|
}
|
|
7633
7645
|
/**
|
|
7634
7646
|
* Rename action
|
|
@@ -7637,10 +7649,10 @@ class DataProvider {
|
|
|
7637
7649
|
* @param name - Old name
|
|
7638
7650
|
* @param newname - New name
|
|
7639
7651
|
* @param source - Source
|
|
7640
|
-
*/
|
|
7652
|
+
*/ __rename(action, path, name, newname, source) {
|
|
7641
7653
|
const fr = this.o[action];
|
|
7642
7654
|
if (!fr) {
|
|
7643
|
-
throw (0,
|
|
7655
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_7__.error)(`Set "${action}" api options`);
|
|
7644
7656
|
}
|
|
7645
7657
|
fr.data.path = path;
|
|
7646
7658
|
fr.data.name = name;
|
|
@@ -7656,14 +7668,14 @@ class DataProvider {
|
|
|
7656
7668
|
/**
|
|
7657
7669
|
* Rename folder
|
|
7658
7670
|
*/ folderRename(path, name, newname, source) {
|
|
7659
|
-
return this.
|
|
7671
|
+
return this.__rename('folderRename', path, name, newname, source);
|
|
7660
7672
|
}
|
|
7661
7673
|
/**
|
|
7662
7674
|
* Rename file
|
|
7663
7675
|
*/ fileRename(path, name, newname, source) {
|
|
7664
|
-
return this.
|
|
7676
|
+
return this.__rename('fileRename', path, name, newname, source);
|
|
7665
7677
|
}
|
|
7666
|
-
|
|
7678
|
+
__changeImage(type, path, source, name, newname, box) {
|
|
7667
7679
|
if (!this.o[type]) {
|
|
7668
7680
|
this.o[type] = {
|
|
7669
7681
|
data: {}
|
|
@@ -7689,12 +7701,12 @@ class DataProvider {
|
|
|
7689
7701
|
/**
|
|
7690
7702
|
* Send command to server to crop image
|
|
7691
7703
|
*/ crop(path, source, name, newname, box) {
|
|
7692
|
-
return this.
|
|
7704
|
+
return this.__changeImage('crop', path, source, name, newname, box);
|
|
7693
7705
|
}
|
|
7694
7706
|
/**
|
|
7695
7707
|
* Send command to server to resize image
|
|
7696
7708
|
*/ resize(path, source, name, newname, box) {
|
|
7697
|
-
return this.
|
|
7709
|
+
return this.__changeImage('resize', path, source, name, newname, box);
|
|
7698
7710
|
}
|
|
7699
7711
|
getMessage(resp) {
|
|
7700
7712
|
return this.options.getMessage(resp);
|
|
@@ -7720,6 +7732,60 @@ class DataProvider {
|
|
|
7720
7732
|
}
|
|
7721
7733
|
}
|
|
7722
7734
|
|
|
7735
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7736
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7737
|
+
], DataProvider.prototype, "onProgress", null);
|
|
7738
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7739
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7740
|
+
], DataProvider.prototype, "permissions", null);
|
|
7741
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7742
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7743
|
+
], DataProvider.prototype, "canI", null);
|
|
7744
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7745
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7746
|
+
], DataProvider.prototype, "items", null);
|
|
7747
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7748
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7749
|
+
], DataProvider.prototype, "itemsEx", null);
|
|
7750
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7751
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7752
|
+
], DataProvider.prototype, "tree", null);
|
|
7753
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7754
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7755
|
+
], DataProvider.prototype, "getPathByUrl", null);
|
|
7756
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7757
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7758
|
+
], DataProvider.prototype, "createFolder", null);
|
|
7759
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7760
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7761
|
+
], DataProvider.prototype, "move", null);
|
|
7762
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7763
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7764
|
+
], DataProvider.prototype, "fileRemove", null);
|
|
7765
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7766
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7767
|
+
], DataProvider.prototype, "folderRemove", null);
|
|
7768
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7769
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7770
|
+
], DataProvider.prototype, "folderRename", null);
|
|
7771
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7772
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7773
|
+
], DataProvider.prototype, "fileRename", null);
|
|
7774
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7775
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7776
|
+
], DataProvider.prototype, "crop", null);
|
|
7777
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7778
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7779
|
+
], DataProvider.prototype, "resize", null);
|
|
7780
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7781
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7782
|
+
], DataProvider.prototype, "getMessage", null);
|
|
7783
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7784
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7785
|
+
], DataProvider.prototype, "isSuccess", null);
|
|
7786
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorate)([
|
|
7787
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__.autobind
|
|
7788
|
+
], DataProvider.prototype, "destruct", null);
|
|
7723
7789
|
|
|
7724
7790
|
|
|
7725
7791
|
/***/ }),
|
|
@@ -17667,11 +17733,16 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
17667
17733
|
/* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16964);
|
|
17668
17734
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
17669
17735
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27795);
|
|
17670
|
-
/* harmony import */ var
|
|
17671
|
-
/* harmony import */ var
|
|
17672
|
-
/* harmony import */ var
|
|
17673
|
-
/* harmony import */ var
|
|
17674
|
-
/* harmony import */ var
|
|
17736
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88475);
|
|
17737
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4040);
|
|
17738
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
|
|
17739
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
17740
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28723);
|
|
17741
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(71125);
|
|
17742
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(59400);
|
|
17743
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5266);
|
|
17744
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(54500);
|
|
17745
|
+
/* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(8908);
|
|
17675
17746
|
/*!
|
|
17676
17747
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
17677
17748
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -17691,6 +17762,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
17691
17762
|
|
|
17692
17763
|
|
|
17693
17764
|
|
|
17765
|
+
|
|
17766
|
+
|
|
17767
|
+
|
|
17768
|
+
|
|
17769
|
+
|
|
17694
17770
|
const jie = 'jodit-image-editor';
|
|
17695
17771
|
const TABS = {
|
|
17696
17772
|
resize: 'resize',
|
|
@@ -17735,9 +17811,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17735
17811
|
return this.j.async.promise((resolve)=>{
|
|
17736
17812
|
const timestamp = new Date().getTime();
|
|
17737
17813
|
this.image = this.j.c.element('img');
|
|
17738
|
-
(0,
|
|
17739
|
-
(0,
|
|
17740
|
-
(0,
|
|
17814
|
+
(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);
|
|
17815
|
+
(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);
|
|
17816
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'background', 'transparent');
|
|
17741
17817
|
this.onSave = save;
|
|
17742
17818
|
this.resize_box.appendChild(this.j.c.element('i', {
|
|
17743
17819
|
class: 'jodit-icon_loader'
|
|
@@ -17752,7 +17828,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17752
17828
|
}
|
|
17753
17829
|
this.image.setAttribute('src', url);
|
|
17754
17830
|
this._dialog.open();
|
|
17755
|
-
const { widthInput, heightInput } = (0,
|
|
17831
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
17756
17832
|
const onload = ()=>{
|
|
17757
17833
|
if (this.isDestructed) {
|
|
17758
17834
|
return;
|
|
@@ -17766,7 +17842,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17766
17842
|
this.resize_box.appendChild(this.image);
|
|
17767
17843
|
this.cropImage = this.image.cloneNode(true);
|
|
17768
17844
|
this.crop_box.appendChild(this.cropImage);
|
|
17769
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove.apply(null, (0,
|
|
17845
|
+
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));
|
|
17770
17846
|
if (this.activeTab === TABS.crop) {
|
|
17771
17847
|
this.showCrop();
|
|
17772
17848
|
}
|
|
@@ -17788,9 +17864,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17788
17864
|
if (!slide) {
|
|
17789
17865
|
return;
|
|
17790
17866
|
}
|
|
17791
|
-
(0,
|
|
17867
|
+
(0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.$$)(`.${jie}__slider,.${jie}__area`, self.editor).forEach((elm)=>elm.classList.remove(`${jie}_active`));
|
|
17792
17868
|
slide.classList.add(`${jie}_active`);
|
|
17793
|
-
this.activeTab = (0,
|
|
17869
|
+
this.activeTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(slide, '-area') || TABS.resize;
|
|
17794
17870
|
const tab = self.editor.querySelector(`.${jie}__area.${jie}__area_` + self.activeTab);
|
|
17795
17871
|
if (tab) {
|
|
17796
17872
|
tab.classList.add(`${jie}_active`);
|
|
@@ -17800,14 +17876,14 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17800
17876
|
}
|
|
17801
17877
|
}
|
|
17802
17878
|
onChangeSizeInput(e) {
|
|
17803
|
-
const self = this, input = e.target, { widthInput, heightInput } = (0,
|
|
17879
|
+
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;
|
|
17804
17880
|
let y;
|
|
17805
17881
|
if (x > minX) {
|
|
17806
|
-
(0,
|
|
17882
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, isWidth ? 'width' : 'height', x);
|
|
17807
17883
|
if (self.resizeUseRatio) {
|
|
17808
17884
|
y = isWidth ? Math.round(x / self.ratio) : Math.round(x * self.ratio);
|
|
17809
17885
|
if (y > minY) {
|
|
17810
|
-
(0,
|
|
17886
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, !isWidth ? 'width' : 'height', y);
|
|
17811
17887
|
if (isWidth) {
|
|
17812
17888
|
heightInput.value = y.toString();
|
|
17813
17889
|
} else {
|
|
@@ -17827,8 +17903,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17827
17903
|
self.start_x = e.clientX;
|
|
17828
17904
|
self.start_y = e.clientY;
|
|
17829
17905
|
if (self.activeTab === TABS.crop) {
|
|
17830
|
-
self.top_x = (0,
|
|
17831
|
-
self.top_y = (0,
|
|
17906
|
+
self.top_x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left');
|
|
17907
|
+
self.top_y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top');
|
|
17832
17908
|
self.width = self.cropHandler.offsetWidth;
|
|
17833
17909
|
self.height = self.cropHandler.offsetHeight;
|
|
17834
17910
|
} else {
|
|
@@ -17849,7 +17925,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17849
17925
|
if (!self.clicked) {
|
|
17850
17926
|
return;
|
|
17851
17927
|
}
|
|
17852
|
-
const { widthInput, heightInput } = (0,
|
|
17928
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
17853
17929
|
self.diff_x = e.clientX - self.start_x;
|
|
17854
17930
|
self.diff_y = e.clientY - self.start_y;
|
|
17855
17931
|
if (self.activeTab === TABS.resize && self.resizeUseRatio || self.activeTab === TABS.crop && self.cropUseRatio) {
|
|
@@ -17866,11 +17942,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17866
17942
|
}
|
|
17867
17943
|
if (self.activeTab === TABS.resize) {
|
|
17868
17944
|
if (self.new_w > self.o.resizeMinWidth) {
|
|
17869
|
-
(0,
|
|
17945
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'width', self.new_w + 'px');
|
|
17870
17946
|
widthInput.value = self.new_w.toString();
|
|
17871
17947
|
}
|
|
17872
17948
|
if (self.new_h > self.o.resizeMinHeight) {
|
|
17873
|
-
(0,
|
|
17949
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'height', self.new_h + 'px');
|
|
17874
17950
|
heightInput.value = self.new_h.toString();
|
|
17875
17951
|
}
|
|
17876
17952
|
this.j.e.fire(self.resizeHandler, 'updatesize');
|
|
@@ -17882,7 +17958,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17882
17958
|
if (self.top_y + self.new_h > self.cropImage.offsetHeight) {
|
|
17883
17959
|
self.new_h = self.cropImage.offsetHeight - self.top_y;
|
|
17884
17960
|
}
|
|
17885
|
-
(0,
|
|
17961
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
|
|
17886
17962
|
width: self.new_w,
|
|
17887
17963
|
height: self.new_h
|
|
17888
17964
|
});
|
|
@@ -17890,11 +17966,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17890
17966
|
if (self.top_x + self.diff_x + self.cropHandler.offsetWidth > self.cropImage.offsetWidth) {
|
|
17891
17967
|
self.diff_x = self.cropImage.offsetWidth - self.top_x - self.cropHandler.offsetWidth;
|
|
17892
17968
|
}
|
|
17893
|
-
(0,
|
|
17969
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left', self.top_x + self.diff_x);
|
|
17894
17970
|
if (self.top_y + self.diff_y + self.cropHandler.offsetHeight > self.cropImage.offsetHeight) {
|
|
17895
17971
|
self.diff_y = self.cropImage.offsetHeight - self.top_y - self.cropHandler.offsetHeight;
|
|
17896
17972
|
}
|
|
17897
|
-
(0,
|
|
17973
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top', self.top_y + self.diff_y);
|
|
17898
17974
|
}
|
|
17899
17975
|
this.j.e.fire(self.cropHandler, 'updatesize');
|
|
17900
17976
|
}
|
|
@@ -17935,7 +18011,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17935
18011
|
wn = nw * (h / nh);
|
|
17936
18012
|
hn = h;
|
|
17937
18013
|
}
|
|
17938
|
-
(0,
|
|
18014
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.crop_box, {
|
|
17939
18015
|
width: wn,
|
|
17940
18016
|
height: hn
|
|
17941
18017
|
});
|
|
@@ -17952,8 +18028,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17952
18028
|
} else {
|
|
17953
18029
|
this.new_h = ImageEditor.calcValueByPercent(h, this.o.cropDefaultHeight);
|
|
17954
18030
|
}
|
|
17955
|
-
(0,
|
|
17956
|
-
backgroundImage: 'url(' + (0,
|
|
18031
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, {
|
|
18032
|
+
backgroundImage: 'url(' + (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(this.cropImage, 'src') + ')',
|
|
17957
18033
|
width: this.new_w,
|
|
17958
18034
|
height: this.new_h,
|
|
17959
18035
|
left: w / 2 - this.new_w / 2,
|
|
@@ -17965,8 +18041,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17965
18041
|
return;
|
|
17966
18042
|
}
|
|
17967
18043
|
const ratioX = this.cropImage.offsetWidth / this.naturalWidth, ratioY = this.cropImage.offsetHeight / this.naturalHeight;
|
|
17968
|
-
this.cropBox.x = (0,
|
|
17969
|
-
this.cropBox.y = (0,
|
|
18044
|
+
this.cropBox.x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'left') / ratioX;
|
|
18045
|
+
this.cropBox.y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'top') / ratioY;
|
|
17970
18046
|
this.cropBox.w = this.cropHandler.offsetWidth / ratioX;
|
|
17971
18047
|
this.cropBox.h = this.cropHandler.offsetHeight / ratioY;
|
|
17972
18048
|
this.sizes.textContent = this.cropBox.w.toFixed(0) + 'x' + this.cropBox.h.toFixed(0);
|
|
@@ -17975,7 +18051,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17975
18051
|
this.resizeBox.h = this.image.offsetHeight || this.naturalHeight;
|
|
17976
18052
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "setHandlers", ()=>{
|
|
17977
18053
|
const self = this;
|
|
17978
|
-
const { widthInput, heightInput } = (0,
|
|
18054
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
17979
18055
|
self.j.e.on([
|
|
17980
18056
|
self.editor.querySelector('.jodit_bottomright'),
|
|
17981
18057
|
self.cropHandler
|
|
@@ -17984,11 +18060,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17984
18060
|
self.showCrop();
|
|
17985
18061
|
this.j.e.fire(self.cropHandler, 'updatesize');
|
|
17986
18062
|
});
|
|
17987
|
-
self.j.e.on((0,
|
|
18063
|
+
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([
|
|
17988
18064
|
widthInput,
|
|
17989
18065
|
heightInput
|
|
17990
18066
|
], 'input', this.onChangeSizeInput);
|
|
17991
|
-
const { keepAspectRatioResize, keepAspectRatioCrop } = (0,
|
|
18067
|
+
const { keepAspectRatioResize, keepAspectRatioCrop } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
17992
18068
|
if (keepAspectRatioResize) {
|
|
17993
18069
|
keepAspectRatioResize.addEventListener('change', ()=>{
|
|
17994
18070
|
this.resizeUseRatio = keepAspectRatioResize.checked;
|
|
@@ -18000,7 +18076,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18000
18076
|
});
|
|
18001
18077
|
}
|
|
18002
18078
|
self.j.e.on(self.resizeHandler, 'updatesize', ()=>{
|
|
18003
|
-
(0,
|
|
18079
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.resizeHandler, {
|
|
18004
18080
|
top: 0,
|
|
18005
18081
|
left: 0,
|
|
18006
18082
|
width: self.image.offsetWidth || self.naturalWidth,
|
|
@@ -18011,7 +18087,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18011
18087
|
if (!self.cropImage) {
|
|
18012
18088
|
return;
|
|
18013
18089
|
}
|
|
18014
|
-
let new_x = (0,
|
|
18090
|
+
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;
|
|
18015
18091
|
if (new_x < 0) {
|
|
18016
18092
|
new_x = 0;
|
|
18017
18093
|
}
|
|
@@ -18030,7 +18106,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18030
18106
|
new_width = new_height * self.ratio;
|
|
18031
18107
|
}
|
|
18032
18108
|
}
|
|
18033
|
-
(0,
|
|
18109
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
|
|
18034
18110
|
width: new_width,
|
|
18035
18111
|
height: new_height,
|
|
18036
18112
|
left: new_x,
|
|
@@ -18049,7 +18125,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18049
18125
|
switch(button){
|
|
18050
18126
|
case self.buttons.saveas:
|
|
18051
18127
|
self.j.prompt('Enter new name', 'Save in new file', (name)=>{
|
|
18052
|
-
if (!(0,
|
|
18128
|
+
if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__.trim)(name)) {
|
|
18053
18129
|
self.j.alert('The name should not be empty');
|
|
18054
18130
|
return false;
|
|
18055
18131
|
}
|
|
@@ -18065,7 +18141,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18065
18141
|
break;
|
|
18066
18142
|
case self.buttons.reset:
|
|
18067
18143
|
if (self.activeTab === TABS.resize) {
|
|
18068
|
-
(0,
|
|
18144
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, {
|
|
18069
18145
|
width: null,
|
|
18070
18146
|
height: null
|
|
18071
18147
|
});
|
|
@@ -18080,18 +18156,24 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18080
18156
|
});
|
|
18081
18157
|
});
|
|
18082
18158
|
});
|
|
18083
|
-
this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor :
|
|
18159
|
+
this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor : jodit_config__WEBPACK_IMPORTED_MODULE_12__.Config.defaultOptions.imageeditor;
|
|
18084
18160
|
const o = this.options;
|
|
18085
18161
|
this.resizeUseRatio = o.resizeUseRatio;
|
|
18086
18162
|
this.cropUseRatio = o.cropUseRatio;
|
|
18087
18163
|
this.buttons = {
|
|
18088
|
-
reset: (0,
|
|
18089
|
-
save: (0,
|
|
18090
|
-
saveas: (0,
|
|
18164
|
+
reset: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'update', 'Reset'),
|
|
18165
|
+
save: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'save', 'Save'),
|
|
18166
|
+
saveas: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, {
|
|
18167
|
+
icon: {
|
|
18168
|
+
name: 'save'
|
|
18169
|
+
},
|
|
18170
|
+
name: 'save-as',
|
|
18171
|
+
text: 'Save as ...'
|
|
18172
|
+
})
|
|
18091
18173
|
};
|
|
18092
18174
|
this.activeTab = o.resize ? TABS.resize : TABS.crop;
|
|
18093
|
-
this.editor = (0,
|
|
18094
|
-
const { resizeBox, cropBox } = (0,
|
|
18175
|
+
this.editor = (0,_templates_form__WEBPACK_IMPORTED_MODULE_14__.form)(this.j, this.options);
|
|
18176
|
+
const { resizeBox, cropBox } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18095
18177
|
this.resize_box = resizeBox;
|
|
18096
18178
|
this.crop_box = cropBox;
|
|
18097
18179
|
this.sizes = this.editor.querySelector(`.${jie}__area.${jie}__area_crop .jodit-image-editor__sizes`);
|
|
@@ -18155,7 +18237,7 @@ ImageEditor = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorat
|
|
|
18155
18237
|
/**
|
|
18156
18238
|
* Open Image Editor
|
|
18157
18239
|
*/ function openImageEditor(href, name, path, source, onSuccess, onFailed) {
|
|
18158
|
-
return this.getInstance('ImageEditor', this.o).open(href, (newname, box, success, failed)=>(0,
|
|
18240
|
+
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((ok)=>{
|
|
18159
18241
|
if (ok) {
|
|
18160
18242
|
success();
|
|
18161
18243
|
if (onSuccess) {
|
|
@@ -27930,6 +28012,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
27930
28012
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
27931
28013
|
/* harmony export */ call: function() { return /* binding */ call; },
|
|
27932
28014
|
/* harmony export */ callPromise: function() { return /* binding */ callPromise; },
|
|
28015
|
+
/* harmony export */ callThis: function() { return /* binding */ callThis; },
|
|
27933
28016
|
/* harmony export */ getDataTransfer: function() { return /* binding */ getDataTransfer; },
|
|
27934
28017
|
/* harmony export */ getPropertyDescriptor: function() { return /* binding */ getPropertyDescriptor; },
|
|
27935
28018
|
/* harmony export */ keys: function() { return /* binding */ keys; },
|
|
@@ -27962,6 +28045,17 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
27962
28045
|
*/ function call(func, ...args) {
|
|
27963
28046
|
return func(...args);
|
|
27964
28047
|
}
|
|
28048
|
+
/**
|
|
28049
|
+
* Call function with parameters
|
|
28050
|
+
*
|
|
28051
|
+
* @example
|
|
28052
|
+
* ```js
|
|
28053
|
+
* const f = Math.random();
|
|
28054
|
+
* Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
|
|
28055
|
+
* ```
|
|
28056
|
+
*/ function callThis(func, thisArg, ...args) {
|
|
28057
|
+
return func.apply(thisArg, args);
|
|
28058
|
+
}
|
|
27965
28059
|
/**
|
|
27966
28060
|
* Mark element for debugging
|
|
27967
28061
|
*/ function markOwner(jodit, elm) {
|
|
@@ -33429,7 +33523,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33429
33523
|
* ```
|
|
33430
33524
|
* @packageDocumentation
|
|
33431
33525
|
* @module constants
|
|
33432
|
-
*/ const APP_VERSION = "4.9.
|
|
33526
|
+
*/ const APP_VERSION = "4.9.14";
|
|
33433
33527
|
// prettier-ignore
|
|
33434
33528
|
const ES = "es2021";
|
|
33435
33529
|
const IS_ES_MODERN = true;
|
|
@@ -37071,6 +37165,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
37071
37165
|
/* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
|
|
37072
37166
|
/* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.call; },
|
|
37073
37167
|
/* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callPromise; },
|
|
37168
|
+
/* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callThis; },
|
|
37074
37169
|
/* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
|
|
37075
37170
|
/* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
|
|
37076
37171
|
/* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_18__.cns; },
|