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