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.
- package/CHANGELOG.md +12 -0
- package/es2015/jodit.css +1 -1
- package/es2015/jodit.fat.min.js +13 -13
- package/es2015/jodit.js +184 -84
- package/es2015/jodit.min.js +6 -6
- 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 +6 -6
- package/es2018/jodit.min.js +23 -23
- 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 +7 -7
- package/es2021/jodit.js +184 -84
- package/es2021/jodit.min.js +7 -7
- 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 +8 -8
- package/es2021.en/jodit.js +184 -84
- package/es2021.en/jodit.min.js +7 -7
- 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 +227 -124
- 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 +6 -6
- package/esm/modules/file-browser/data-provider.js +85 -16
- package/esm/modules/image-editor/image-editor.d.ts +1 -1
- package/esm/modules/image-editor/image-editor.js +16 -5
- package/esm/plugins/image-properties/utils/open-image-editor.js +4 -3
- package/esm/plugins/inline-popup/inline-popup.js +7 -1
- package/esm/types/file-browser.d.ts +3 -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 +6 -6
- package/types/modules/image-editor/image-editor.d.ts +1 -1
- package/types/types/file-browser.d.ts +3 -2
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.15
|
|
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: {}
|
|
@@ -7682,19 +7694,19 @@ class DataProvider {
|
|
|
7682
7694
|
query.data.path = path;
|
|
7683
7695
|
query.data.name = name;
|
|
7684
7696
|
query.data.source = source;
|
|
7685
|
-
return this.get(type).then(()=>{
|
|
7686
|
-
return true;
|
|
7697
|
+
return this.get(type).then((resp)=>{
|
|
7698
|
+
return resp.data.newPath || true;
|
|
7687
7699
|
});
|
|
7688
7700
|
}
|
|
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
|
/***/ }),
|
|
@@ -12743,9 +12809,10 @@ const $$temp = ()=>{
|
|
|
12743
12809
|
};
|
|
12744
12810
|
a.href = url;
|
|
12745
12811
|
j.filebrowser.dataProvider.getPathByUrl(a.href.toString()).then((resp)=>{
|
|
12746
|
-
jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_2__.openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, ()=>{
|
|
12812
|
+
jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_2__.openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, (newPath)=>{
|
|
12747
12813
|
const timestamp = new Date().getTime();
|
|
12748
|
-
|
|
12814
|
+
const newUrl = newPath || url;
|
|
12815
|
+
state.values.imageSrc = newUrl + (newUrl.indexOf('?') !== -1 ? '' : '?') + '&_tmp=' + timestamp.toString();
|
|
12749
12816
|
}, (error)=>{
|
|
12750
12817
|
j.alert(error.message);
|
|
12751
12818
|
});
|
|
@@ -17667,11 +17734,16 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
17667
17734
|
/* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16964);
|
|
17668
17735
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
17669
17736
|
/* 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
|
|
17737
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88475);
|
|
17738
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4040);
|
|
17739
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
|
|
17740
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
17741
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28723);
|
|
17742
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(71125);
|
|
17743
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(59400);
|
|
17744
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5266);
|
|
17745
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(54500);
|
|
17746
|
+
/* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(8908);
|
|
17675
17747
|
/*!
|
|
17676
17748
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
17677
17749
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -17691,6 +17763,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
17691
17763
|
|
|
17692
17764
|
|
|
17693
17765
|
|
|
17766
|
+
|
|
17767
|
+
|
|
17768
|
+
|
|
17769
|
+
|
|
17770
|
+
|
|
17694
17771
|
const jie = 'jodit-image-editor';
|
|
17695
17772
|
const TABS = {
|
|
17696
17773
|
resize: 'resize',
|
|
@@ -17735,9 +17812,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17735
17812
|
return this.j.async.promise((resolve)=>{
|
|
17736
17813
|
const timestamp = new Date().getTime();
|
|
17737
17814
|
this.image = this.j.c.element('img');
|
|
17738
|
-
(0,
|
|
17739
|
-
(0,
|
|
17740
|
-
(0,
|
|
17815
|
+
(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);
|
|
17816
|
+
(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);
|
|
17817
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'background', 'transparent');
|
|
17741
17818
|
this.onSave = save;
|
|
17742
17819
|
this.resize_box.appendChild(this.j.c.element('i', {
|
|
17743
17820
|
class: 'jodit-icon_loader'
|
|
@@ -17752,7 +17829,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17752
17829
|
}
|
|
17753
17830
|
this.image.setAttribute('src', url);
|
|
17754
17831
|
this._dialog.open();
|
|
17755
|
-
const { widthInput, heightInput } = (0,
|
|
17832
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
17756
17833
|
const onload = ()=>{
|
|
17757
17834
|
if (this.isDestructed) {
|
|
17758
17835
|
return;
|
|
@@ -17766,7 +17843,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17766
17843
|
this.resize_box.appendChild(this.image);
|
|
17767
17844
|
this.cropImage = this.image.cloneNode(true);
|
|
17768
17845
|
this.crop_box.appendChild(this.cropImage);
|
|
17769
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove.apply(null, (0,
|
|
17846
|
+
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
17847
|
if (this.activeTab === TABS.crop) {
|
|
17771
17848
|
this.showCrop();
|
|
17772
17849
|
}
|
|
@@ -17788,9 +17865,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17788
17865
|
if (!slide) {
|
|
17789
17866
|
return;
|
|
17790
17867
|
}
|
|
17791
|
-
(0,
|
|
17868
|
+
(0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.$$)(`.${jie}__slider,.${jie}__area`, self.editor).forEach((elm)=>elm.classList.remove(`${jie}_active`));
|
|
17792
17869
|
slide.classList.add(`${jie}_active`);
|
|
17793
|
-
this.activeTab = (0,
|
|
17870
|
+
this.activeTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(slide, '-area') || TABS.resize;
|
|
17794
17871
|
const tab = self.editor.querySelector(`.${jie}__area.${jie}__area_` + self.activeTab);
|
|
17795
17872
|
if (tab) {
|
|
17796
17873
|
tab.classList.add(`${jie}_active`);
|
|
@@ -17800,14 +17877,14 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17800
17877
|
}
|
|
17801
17878
|
}
|
|
17802
17879
|
onChangeSizeInput(e) {
|
|
17803
|
-
const self = this, input = e.target, { widthInput, heightInput } = (0,
|
|
17880
|
+
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
17881
|
let y;
|
|
17805
17882
|
if (x > minX) {
|
|
17806
|
-
(0,
|
|
17883
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, isWidth ? 'width' : 'height', x);
|
|
17807
17884
|
if (self.resizeUseRatio) {
|
|
17808
17885
|
y = isWidth ? Math.round(x / self.ratio) : Math.round(x * self.ratio);
|
|
17809
17886
|
if (y > minY) {
|
|
17810
|
-
(0,
|
|
17887
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, !isWidth ? 'width' : 'height', y);
|
|
17811
17888
|
if (isWidth) {
|
|
17812
17889
|
heightInput.value = y.toString();
|
|
17813
17890
|
} else {
|
|
@@ -17827,8 +17904,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17827
17904
|
self.start_x = e.clientX;
|
|
17828
17905
|
self.start_y = e.clientY;
|
|
17829
17906
|
if (self.activeTab === TABS.crop) {
|
|
17830
|
-
self.top_x = (0,
|
|
17831
|
-
self.top_y = (0,
|
|
17907
|
+
self.top_x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left');
|
|
17908
|
+
self.top_y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top');
|
|
17832
17909
|
self.width = self.cropHandler.offsetWidth;
|
|
17833
17910
|
self.height = self.cropHandler.offsetHeight;
|
|
17834
17911
|
} else {
|
|
@@ -17849,7 +17926,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17849
17926
|
if (!self.clicked) {
|
|
17850
17927
|
return;
|
|
17851
17928
|
}
|
|
17852
|
-
const { widthInput, heightInput } = (0,
|
|
17929
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
17853
17930
|
self.diff_x = e.clientX - self.start_x;
|
|
17854
17931
|
self.diff_y = e.clientY - self.start_y;
|
|
17855
17932
|
if (self.activeTab === TABS.resize && self.resizeUseRatio || self.activeTab === TABS.crop && self.cropUseRatio) {
|
|
@@ -17866,11 +17943,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17866
17943
|
}
|
|
17867
17944
|
if (self.activeTab === TABS.resize) {
|
|
17868
17945
|
if (self.new_w > self.o.resizeMinWidth) {
|
|
17869
|
-
(0,
|
|
17946
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'width', self.new_w + 'px');
|
|
17870
17947
|
widthInput.value = self.new_w.toString();
|
|
17871
17948
|
}
|
|
17872
17949
|
if (self.new_h > self.o.resizeMinHeight) {
|
|
17873
|
-
(0,
|
|
17950
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'height', self.new_h + 'px');
|
|
17874
17951
|
heightInput.value = self.new_h.toString();
|
|
17875
17952
|
}
|
|
17876
17953
|
this.j.e.fire(self.resizeHandler, 'updatesize');
|
|
@@ -17882,7 +17959,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17882
17959
|
if (self.top_y + self.new_h > self.cropImage.offsetHeight) {
|
|
17883
17960
|
self.new_h = self.cropImage.offsetHeight - self.top_y;
|
|
17884
17961
|
}
|
|
17885
|
-
(0,
|
|
17962
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
|
|
17886
17963
|
width: self.new_w,
|
|
17887
17964
|
height: self.new_h
|
|
17888
17965
|
});
|
|
@@ -17890,11 +17967,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17890
17967
|
if (self.top_x + self.diff_x + self.cropHandler.offsetWidth > self.cropImage.offsetWidth) {
|
|
17891
17968
|
self.diff_x = self.cropImage.offsetWidth - self.top_x - self.cropHandler.offsetWidth;
|
|
17892
17969
|
}
|
|
17893
|
-
(0,
|
|
17970
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left', self.top_x + self.diff_x);
|
|
17894
17971
|
if (self.top_y + self.diff_y + self.cropHandler.offsetHeight > self.cropImage.offsetHeight) {
|
|
17895
17972
|
self.diff_y = self.cropImage.offsetHeight - self.top_y - self.cropHandler.offsetHeight;
|
|
17896
17973
|
}
|
|
17897
|
-
(0,
|
|
17974
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top', self.top_y + self.diff_y);
|
|
17898
17975
|
}
|
|
17899
17976
|
this.j.e.fire(self.cropHandler, 'updatesize');
|
|
17900
17977
|
}
|
|
@@ -17935,7 +18012,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17935
18012
|
wn = nw * (h / nh);
|
|
17936
18013
|
hn = h;
|
|
17937
18014
|
}
|
|
17938
|
-
(0,
|
|
18015
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.crop_box, {
|
|
17939
18016
|
width: wn,
|
|
17940
18017
|
height: hn
|
|
17941
18018
|
});
|
|
@@ -17952,8 +18029,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17952
18029
|
} else {
|
|
17953
18030
|
this.new_h = ImageEditor.calcValueByPercent(h, this.o.cropDefaultHeight);
|
|
17954
18031
|
}
|
|
17955
|
-
(0,
|
|
17956
|
-
backgroundImage: 'url(' + (0,
|
|
18032
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, {
|
|
18033
|
+
backgroundImage: 'url(' + (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(this.cropImage, 'src') + ')',
|
|
17957
18034
|
width: this.new_w,
|
|
17958
18035
|
height: this.new_h,
|
|
17959
18036
|
left: w / 2 - this.new_w / 2,
|
|
@@ -17965,8 +18042,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17965
18042
|
return;
|
|
17966
18043
|
}
|
|
17967
18044
|
const ratioX = this.cropImage.offsetWidth / this.naturalWidth, ratioY = this.cropImage.offsetHeight / this.naturalHeight;
|
|
17968
|
-
this.cropBox.x = (0,
|
|
17969
|
-
this.cropBox.y = (0,
|
|
18045
|
+
this.cropBox.x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'left') / ratioX;
|
|
18046
|
+
this.cropBox.y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'top') / ratioY;
|
|
17970
18047
|
this.cropBox.w = this.cropHandler.offsetWidth / ratioX;
|
|
17971
18048
|
this.cropBox.h = this.cropHandler.offsetHeight / ratioY;
|
|
17972
18049
|
this.sizes.textContent = this.cropBox.w.toFixed(0) + 'x' + this.cropBox.h.toFixed(0);
|
|
@@ -17975,7 +18052,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17975
18052
|
this.resizeBox.h = this.image.offsetHeight || this.naturalHeight;
|
|
17976
18053
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "setHandlers", ()=>{
|
|
17977
18054
|
const self = this;
|
|
17978
|
-
const { widthInput, heightInput } = (0,
|
|
18055
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
17979
18056
|
self.j.e.on([
|
|
17980
18057
|
self.editor.querySelector('.jodit_bottomright'),
|
|
17981
18058
|
self.cropHandler
|
|
@@ -17984,11 +18061,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
17984
18061
|
self.showCrop();
|
|
17985
18062
|
this.j.e.fire(self.cropHandler, 'updatesize');
|
|
17986
18063
|
});
|
|
17987
|
-
self.j.e.on((0,
|
|
18064
|
+
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
18065
|
widthInput,
|
|
17989
18066
|
heightInput
|
|
17990
18067
|
], 'input', this.onChangeSizeInput);
|
|
17991
|
-
const { keepAspectRatioResize, keepAspectRatioCrop } = (0,
|
|
18068
|
+
const { keepAspectRatioResize, keepAspectRatioCrop } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
17992
18069
|
if (keepAspectRatioResize) {
|
|
17993
18070
|
keepAspectRatioResize.addEventListener('change', ()=>{
|
|
17994
18071
|
this.resizeUseRatio = keepAspectRatioResize.checked;
|
|
@@ -18000,7 +18077,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18000
18077
|
});
|
|
18001
18078
|
}
|
|
18002
18079
|
self.j.e.on(self.resizeHandler, 'updatesize', ()=>{
|
|
18003
|
-
(0,
|
|
18080
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.resizeHandler, {
|
|
18004
18081
|
top: 0,
|
|
18005
18082
|
left: 0,
|
|
18006
18083
|
width: self.image.offsetWidth || self.naturalWidth,
|
|
@@ -18011,7 +18088,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18011
18088
|
if (!self.cropImage) {
|
|
18012
18089
|
return;
|
|
18013
18090
|
}
|
|
18014
|
-
let new_x = (0,
|
|
18091
|
+
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
18092
|
if (new_x < 0) {
|
|
18016
18093
|
new_x = 0;
|
|
18017
18094
|
}
|
|
@@ -18030,7 +18107,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18030
18107
|
new_width = new_height * self.ratio;
|
|
18031
18108
|
}
|
|
18032
18109
|
}
|
|
18033
|
-
(0,
|
|
18110
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
|
|
18034
18111
|
width: new_width,
|
|
18035
18112
|
height: new_height,
|
|
18036
18113
|
left: new_x,
|
|
@@ -18049,7 +18126,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18049
18126
|
switch(button){
|
|
18050
18127
|
case self.buttons.saveas:
|
|
18051
18128
|
self.j.prompt('Enter new name', 'Save in new file', (name)=>{
|
|
18052
|
-
if (!(0,
|
|
18129
|
+
if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__.trim)(name)) {
|
|
18053
18130
|
self.j.alert('The name should not be empty');
|
|
18054
18131
|
return false;
|
|
18055
18132
|
}
|
|
@@ -18065,7 +18142,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18065
18142
|
break;
|
|
18066
18143
|
case self.buttons.reset:
|
|
18067
18144
|
if (self.activeTab === TABS.resize) {
|
|
18068
|
-
(0,
|
|
18145
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, {
|
|
18069
18146
|
width: null,
|
|
18070
18147
|
height: null
|
|
18071
18148
|
});
|
|
@@ -18080,18 +18157,24 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18080
18157
|
});
|
|
18081
18158
|
});
|
|
18082
18159
|
});
|
|
18083
|
-
this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor :
|
|
18160
|
+
this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor : jodit_config__WEBPACK_IMPORTED_MODULE_12__.Config.defaultOptions.imageeditor;
|
|
18084
18161
|
const o = this.options;
|
|
18085
18162
|
this.resizeUseRatio = o.resizeUseRatio;
|
|
18086
18163
|
this.cropUseRatio = o.cropUseRatio;
|
|
18087
18164
|
this.buttons = {
|
|
18088
|
-
reset: (0,
|
|
18089
|
-
save: (0,
|
|
18090
|
-
saveas: (0,
|
|
18165
|
+
reset: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'update', 'Reset'),
|
|
18166
|
+
save: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'save', 'Save'),
|
|
18167
|
+
saveas: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, {
|
|
18168
|
+
icon: {
|
|
18169
|
+
name: 'save'
|
|
18170
|
+
},
|
|
18171
|
+
name: 'save-as',
|
|
18172
|
+
text: 'Save as ...'
|
|
18173
|
+
})
|
|
18091
18174
|
};
|
|
18092
18175
|
this.activeTab = o.resize ? TABS.resize : TABS.crop;
|
|
18093
|
-
this.editor = (0,
|
|
18094
|
-
const { resizeBox, cropBox } = (0,
|
|
18176
|
+
this.editor = (0,_templates_form__WEBPACK_IMPORTED_MODULE_14__.form)(this.j, this.options);
|
|
18177
|
+
const { resizeBox, cropBox } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18095
18178
|
this.resize_box = resizeBox;
|
|
18096
18179
|
this.crop_box = cropBox;
|
|
18097
18180
|
this.sizes = this.editor.querySelector(`.${jie}__area.${jie}__area_crop .jodit-image-editor__sizes`);
|
|
@@ -18155,11 +18238,11 @@ ImageEditor = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorat
|
|
|
18155
18238
|
/**
|
|
18156
18239
|
* Open Image Editor
|
|
18157
18240
|
*/ function openImageEditor(href, name, path, source, onSuccess, onFailed) {
|
|
18158
|
-
return this.getInstance('ImageEditor', this.o).open(href, (newname, box, success, failed)=>(0,
|
|
18159
|
-
if (
|
|
18241
|
+
return this.getInstance('ImageEditor', this.o).open(href, (newname, box, success, failed)=>(0,jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_10__.call)(box.action === 'resize' ? this.dataProvider.resize : this.dataProvider.crop, path, source, name, newname, box.box).then((result)=>{
|
|
18242
|
+
if (result) {
|
|
18160
18243
|
success();
|
|
18161
18244
|
if (onSuccess) {
|
|
18162
|
-
onSuccess();
|
|
18245
|
+
onSuccess(typeof result === 'string' ? result : undefined);
|
|
18163
18246
|
}
|
|
18164
18247
|
}
|
|
18165
18248
|
}).catch((error)=>{
|
|
@@ -27930,6 +28013,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
27930
28013
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
27931
28014
|
/* harmony export */ call: function() { return /* binding */ call; },
|
|
27932
28015
|
/* harmony export */ callPromise: function() { return /* binding */ callPromise; },
|
|
28016
|
+
/* harmony export */ callThis: function() { return /* binding */ callThis; },
|
|
27933
28017
|
/* harmony export */ getDataTransfer: function() { return /* binding */ getDataTransfer; },
|
|
27934
28018
|
/* harmony export */ getPropertyDescriptor: function() { return /* binding */ getPropertyDescriptor; },
|
|
27935
28019
|
/* harmony export */ keys: function() { return /* binding */ keys; },
|
|
@@ -27962,6 +28046,17 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
27962
28046
|
*/ function call(func, ...args) {
|
|
27963
28047
|
return func(...args);
|
|
27964
28048
|
}
|
|
28049
|
+
/**
|
|
28050
|
+
* Call function with parameters
|
|
28051
|
+
*
|
|
28052
|
+
* @example
|
|
28053
|
+
* ```js
|
|
28054
|
+
* const f = Math.random();
|
|
28055
|
+
* Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
|
|
28056
|
+
* ```
|
|
28057
|
+
*/ function callThis(func, thisArg, ...args) {
|
|
28058
|
+
return func.apply(thisArg, args);
|
|
28059
|
+
}
|
|
27965
28060
|
/**
|
|
27966
28061
|
* Mark element for debugging
|
|
27967
28062
|
*/ function markOwner(jodit, elm) {
|
|
@@ -33429,7 +33524,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
33429
33524
|
* ```
|
|
33430
33525
|
* @packageDocumentation
|
|
33431
33526
|
* @module constants
|
|
33432
|
-
*/ const APP_VERSION = "4.9.
|
|
33527
|
+
*/ const APP_VERSION = "4.9.15";
|
|
33433
33528
|
// prettier-ignore
|
|
33434
33529
|
const ES = "es2021";
|
|
33435
33530
|
const IS_ES_MODERN = true;
|
|
@@ -35023,7 +35118,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.showWordsCounter = tr
|
|
|
35023
35118
|
content = data;
|
|
35024
35119
|
}
|
|
35025
35120
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isArray)(content)) {
|
|
35026
|
-
this.
|
|
35121
|
+
const disabled = this.j.o.toolbarInlineDisabledButtons;
|
|
35122
|
+
this.toolbar.build(disabled.length ? content.filter((item)=>{
|
|
35123
|
+
const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(item) ? item : item.name;
|
|
35124
|
+
return !disabled.includes(name ?? '');
|
|
35125
|
+
}) : content, target);
|
|
35027
35126
|
this.toolbar.buttonSize = this.j.o.toolbarButtonSize;
|
|
35028
35127
|
content = this.toolbar.container;
|
|
35029
35128
|
}
|
|
@@ -37071,6 +37170,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
37071
37170
|
/* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
|
|
37072
37171
|
/* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.call; },
|
|
37073
37172
|
/* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callPromise; },
|
|
37173
|
+
/* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callThis; },
|
|
37074
37174
|
/* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
|
|
37075
37175
|
/* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
|
|
37076
37176
|
/* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_18__.cns; },
|