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/es2015/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
|
*/
|
|
@@ -7757,10 +7757,16 @@ class Ajax {
|
|
|
7757
7757
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25045);
|
|
7758
7758
|
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41411);
|
|
7759
7759
|
/* harmony import */ var _swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15366);
|
|
7760
|
-
/* harmony import */ var
|
|
7761
|
-
/* harmony import */ var
|
|
7762
|
-
/* harmony import */ var
|
|
7763
|
-
/* harmony import */ var
|
|
7760
|
+
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
|
|
7761
|
+
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81937);
|
|
7762
|
+
/* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(49574);
|
|
7763
|
+
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(91565);
|
|
7764
|
+
/* harmony import */ var jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(96340);
|
|
7765
|
+
/* harmony import */ var jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(77483);
|
|
7766
|
+
/* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(33201);
|
|
7767
|
+
/* harmony import */ var jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(52144);
|
|
7768
|
+
/* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(17338);
|
|
7769
|
+
/* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(58664);
|
|
7764
7770
|
/*!
|
|
7765
7771
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
7766
7772
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -7775,6 +7781,12 @@ class Ajax {
|
|
|
7775
7781
|
|
|
7776
7782
|
|
|
7777
7783
|
|
|
7784
|
+
|
|
7785
|
+
|
|
7786
|
+
|
|
7787
|
+
|
|
7788
|
+
|
|
7789
|
+
|
|
7778
7790
|
const DEFAULT_SOURCE_NAME = 'default';
|
|
7779
7791
|
const possibleRules = new Set([
|
|
7780
7792
|
'allowFiles',
|
|
@@ -7804,13 +7816,13 @@ class DataProvider {
|
|
|
7804
7816
|
ajax === null || ajax === void 0 ? void 0 : ajax.abort();
|
|
7805
7817
|
instances.delete(name);
|
|
7806
7818
|
}
|
|
7807
|
-
const opts = (0,
|
|
7819
|
+
const opts = (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_9__.ConfigProto)(this.options[name] !== undefined ? this.options[name] : {}, (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_9__.ConfigProto)({
|
|
7808
7820
|
onProgress: this.progressHandler
|
|
7809
7821
|
}, this.o.ajax));
|
|
7810
7822
|
if (opts.prepareData) {
|
|
7811
7823
|
opts.data = opts.prepareData.call(this, opts.data);
|
|
7812
7824
|
}
|
|
7813
|
-
const ajax = new
|
|
7825
|
+
const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_12__.Ajax(opts);
|
|
7814
7826
|
instances.set(name, ajax);
|
|
7815
7827
|
const promise = ajax.send();
|
|
7816
7828
|
promise.finally(()=>{
|
|
@@ -7840,7 +7852,7 @@ class DataProvider {
|
|
|
7840
7852
|
if (this.o.permissions.url) {
|
|
7841
7853
|
return this.get('permissions').then((resp)=>{
|
|
7842
7854
|
if (this.parent.isInDestruct) {
|
|
7843
|
-
throw (0,
|
|
7855
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.abort)();
|
|
7844
7856
|
}
|
|
7845
7857
|
let process = this.o.permissions.process;
|
|
7846
7858
|
if (!process) {
|
|
@@ -7861,9 +7873,9 @@ class DataProvider {
|
|
|
7861
7873
|
}
|
|
7862
7874
|
canI(action) {
|
|
7863
7875
|
const rule = 'allow' + action;
|
|
7864
|
-
if (!
|
|
7876
|
+
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__.IS_PROD) {
|
|
7865
7877
|
if (!possibleRules.has(rule)) {
|
|
7866
|
-
throw (0,
|
|
7878
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.error)('Wrong action ' + action);
|
|
7867
7879
|
}
|
|
7868
7880
|
}
|
|
7869
7881
|
const presetValue = this.o.permissionsPresets[rule];
|
|
@@ -7894,18 +7906,18 @@ class DataProvider {
|
|
|
7894
7906
|
/**
|
|
7895
7907
|
* Load items list by path and source
|
|
7896
7908
|
*/ items(path, source, mods = {}) {
|
|
7897
|
-
return this.__items(path, source, mods, (resp)=>this.
|
|
7909
|
+
return this.__items(path, source, mods, (resp)=>this.__generateItemsList(resp.data.sources, mods));
|
|
7898
7910
|
}
|
|
7899
7911
|
/**
|
|
7900
7912
|
* Load items list by path and source
|
|
7901
7913
|
*/ itemsEx(path, source, mods = {}) {
|
|
7902
7914
|
const calcTotal = (sources)=>sources.reduce((acc, source)=>acc + source.files.length, 0);
|
|
7903
7915
|
return this.__items(path, source, mods, (resp)=>({
|
|
7904
|
-
items: this.
|
|
7916
|
+
items: this.__generateItemsList(resp.data.sources, mods),
|
|
7905
7917
|
loadedTotal: calcTotal(resp.data.sources)
|
|
7906
7918
|
}));
|
|
7907
7919
|
}
|
|
7908
|
-
|
|
7920
|
+
__generateItemsList(sources, mods = {}) {
|
|
7909
7921
|
const elements = [];
|
|
7910
7922
|
const canBeFile = (item)=>item.type === 'folder' || !mods.onlyImages || item.isImage === undefined || item.isImage;
|
|
7911
7923
|
const inFilter = (item)=>{
|
|
@@ -7915,12 +7927,12 @@ class DataProvider {
|
|
|
7915
7927
|
sources.forEach((source)=>{
|
|
7916
7928
|
if (source.files && source.files.length) {
|
|
7917
7929
|
const { sort } = this.o;
|
|
7918
|
-
if ((0,
|
|
7930
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_7__.isFunction)(sort) && mods.sortBy) {
|
|
7919
7931
|
source.files.sort((a, b)=>sort(a, b, mods.sortBy));
|
|
7920
7932
|
}
|
|
7921
7933
|
source.files.forEach((item)=>{
|
|
7922
7934
|
if (inFilter(item) && canBeFile(item)) {
|
|
7923
|
-
elements.push(
|
|
7935
|
+
elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_13__.FileBrowserItem.create((0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_3__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_2__._)({}, item), {
|
|
7924
7936
|
sourceName: source.name,
|
|
7925
7937
|
source
|
|
7926
7938
|
})));
|
|
@@ -7932,7 +7944,7 @@ class DataProvider {
|
|
|
7932
7944
|
}
|
|
7933
7945
|
tree(path, source) {
|
|
7934
7946
|
return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function*() {
|
|
7935
|
-
path = (0,
|
|
7947
|
+
path = (0,jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_8__.normalizeRelativePath)(path);
|
|
7936
7948
|
if (!this.o.folder) {
|
|
7937
7949
|
return Promise.reject(Error('Set Folder Api options'));
|
|
7938
7950
|
}
|
|
@@ -7954,12 +7966,12 @@ class DataProvider {
|
|
|
7954
7966
|
/**
|
|
7955
7967
|
* Get path by url. You can use this method in another modules
|
|
7956
7968
|
*/ getPathByUrl(url) {
|
|
7957
|
-
(0,
|
|
7969
|
+
(0,jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_11__.set)('options.getLocalFileByUrl.data.url', url, this);
|
|
7958
7970
|
return this.get('getLocalFileByUrl').then((resp)=>{
|
|
7959
7971
|
if (this.isSuccess(resp)) {
|
|
7960
7972
|
return resp.data;
|
|
7961
7973
|
}
|
|
7962
|
-
throw (0,
|
|
7974
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.error)(this.getMessage(resp));
|
|
7963
7975
|
});
|
|
7964
7976
|
}
|
|
7965
7977
|
/**
|
|
@@ -7971,7 +7983,7 @@ class DataProvider {
|
|
|
7971
7983
|
*/ createFolder(name, path, source) {
|
|
7972
7984
|
const { create } = this.o;
|
|
7973
7985
|
if (!create) {
|
|
7974
|
-
throw (0,
|
|
7986
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.error)('Set Create api options');
|
|
7975
7987
|
}
|
|
7976
7988
|
create.data.source = source;
|
|
7977
7989
|
create.data.path = path;
|
|
@@ -7980,7 +7992,7 @@ class DataProvider {
|
|
|
7980
7992
|
if (this.isSuccess(resp)) {
|
|
7981
7993
|
return true;
|
|
7982
7994
|
}
|
|
7983
|
-
throw (0,
|
|
7995
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.error)(this.getMessage(resp));
|
|
7984
7996
|
});
|
|
7985
7997
|
}
|
|
7986
7998
|
/**
|
|
@@ -7992,7 +8004,7 @@ class DataProvider {
|
|
|
7992
8004
|
const mode = isFile ? 'fileMove' : 'folderMove';
|
|
7993
8005
|
const option = this.options[mode];
|
|
7994
8006
|
if (!option) {
|
|
7995
|
-
throw (0,
|
|
8007
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.error)('Set Move api options');
|
|
7996
8008
|
}
|
|
7997
8009
|
option.data.from = filepath;
|
|
7998
8010
|
option.data.path = path;
|
|
@@ -8001,7 +8013,7 @@ class DataProvider {
|
|
|
8001
8013
|
if (this.isSuccess(resp)) {
|
|
8002
8014
|
return true;
|
|
8003
8015
|
}
|
|
8004
|
-
throw (0,
|
|
8016
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.error)(this.getMessage(resp));
|
|
8005
8017
|
});
|
|
8006
8018
|
}
|
|
8007
8019
|
/**
|
|
@@ -8010,10 +8022,10 @@ class DataProvider {
|
|
|
8010
8022
|
* @param path - Relative path
|
|
8011
8023
|
* @param file - The filename
|
|
8012
8024
|
* @param source - Source
|
|
8013
|
-
*/
|
|
8025
|
+
*/ __remove(action, path, file, source) {
|
|
8014
8026
|
const fr = this.o[action];
|
|
8015
8027
|
if (!fr) {
|
|
8016
|
-
throw (0,
|
|
8028
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.error)(`Set "${action}" api options`);
|
|
8017
8029
|
}
|
|
8018
8030
|
fr.data.path = path;
|
|
8019
8031
|
fr.data.name = file;
|
|
@@ -8032,7 +8044,7 @@ class DataProvider {
|
|
|
8032
8044
|
* @param file - The filename
|
|
8033
8045
|
* @param source - Source
|
|
8034
8046
|
*/ fileRemove(path, file, source) {
|
|
8035
|
-
return this.
|
|
8047
|
+
return this.__remove('fileRemove', path, file, source);
|
|
8036
8048
|
}
|
|
8037
8049
|
/**
|
|
8038
8050
|
* Deleting a folder
|
|
@@ -8041,7 +8053,7 @@ class DataProvider {
|
|
|
8041
8053
|
* @param file - The filename
|
|
8042
8054
|
* @param source - Source
|
|
8043
8055
|
*/ folderRemove(path, file, source) {
|
|
8044
|
-
return this.
|
|
8056
|
+
return this.__remove('folderRemove', path, file, source);
|
|
8045
8057
|
}
|
|
8046
8058
|
/**
|
|
8047
8059
|
* Rename action
|
|
@@ -8050,10 +8062,10 @@ class DataProvider {
|
|
|
8050
8062
|
* @param name - Old name
|
|
8051
8063
|
* @param newname - New name
|
|
8052
8064
|
* @param source - Source
|
|
8053
|
-
*/
|
|
8065
|
+
*/ __rename(action, path, name, newname, source) {
|
|
8054
8066
|
const fr = this.o[action];
|
|
8055
8067
|
if (!fr) {
|
|
8056
|
-
throw (0,
|
|
8068
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_10__.error)(`Set "${action}" api options`);
|
|
8057
8069
|
}
|
|
8058
8070
|
fr.data.path = path;
|
|
8059
8071
|
fr.data.name = name;
|
|
@@ -8069,14 +8081,14 @@ class DataProvider {
|
|
|
8069
8081
|
/**
|
|
8070
8082
|
* Rename folder
|
|
8071
8083
|
*/ folderRename(path, name, newname, source) {
|
|
8072
|
-
return this.
|
|
8084
|
+
return this.__rename('folderRename', path, name, newname, source);
|
|
8073
8085
|
}
|
|
8074
8086
|
/**
|
|
8075
8087
|
* Rename file
|
|
8076
8088
|
*/ fileRename(path, name, newname, source) {
|
|
8077
|
-
return this.
|
|
8089
|
+
return this.__rename('fileRename', path, name, newname, source);
|
|
8078
8090
|
}
|
|
8079
|
-
|
|
8091
|
+
__changeImage(type, path, source, name, newname, box) {
|
|
8080
8092
|
if (!this.o[type]) {
|
|
8081
8093
|
this.o[type] = {
|
|
8082
8094
|
data: {}
|
|
@@ -8102,12 +8114,12 @@ class DataProvider {
|
|
|
8102
8114
|
/**
|
|
8103
8115
|
* Send command to server to crop image
|
|
8104
8116
|
*/ crop(path, source, name, newname, box) {
|
|
8105
|
-
return this.
|
|
8117
|
+
return this.__changeImage('crop', path, source, name, newname, box);
|
|
8106
8118
|
}
|
|
8107
8119
|
/**
|
|
8108
8120
|
* Send command to server to resize image
|
|
8109
8121
|
*/ resize(path, source, name, newname, box) {
|
|
8110
|
-
return this.
|
|
8122
|
+
return this.__changeImage('resize', path, source, name, newname, box);
|
|
8111
8123
|
}
|
|
8112
8124
|
getMessage(resp) {
|
|
8113
8125
|
return this.options.getMessage(resp);
|
|
@@ -8133,6 +8145,60 @@ class DataProvider {
|
|
|
8133
8145
|
}
|
|
8134
8146
|
}
|
|
8135
8147
|
|
|
8148
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8149
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8150
|
+
], DataProvider.prototype, "onProgress", null);
|
|
8151
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8152
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8153
|
+
], DataProvider.prototype, "permissions", null);
|
|
8154
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8155
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8156
|
+
], DataProvider.prototype, "canI", null);
|
|
8157
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8158
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8159
|
+
], DataProvider.prototype, "items", null);
|
|
8160
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8161
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8162
|
+
], DataProvider.prototype, "itemsEx", null);
|
|
8163
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8164
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8165
|
+
], DataProvider.prototype, "tree", null);
|
|
8166
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8167
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8168
|
+
], DataProvider.prototype, "getPathByUrl", null);
|
|
8169
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8170
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8171
|
+
], DataProvider.prototype, "createFolder", null);
|
|
8172
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8173
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8174
|
+
], DataProvider.prototype, "move", null);
|
|
8175
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8176
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8177
|
+
], DataProvider.prototype, "fileRemove", null);
|
|
8178
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8179
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8180
|
+
], DataProvider.prototype, "folderRemove", null);
|
|
8181
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8182
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8183
|
+
], DataProvider.prototype, "folderRename", null);
|
|
8184
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8185
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8186
|
+
], DataProvider.prototype, "fileRename", null);
|
|
8187
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8188
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8189
|
+
], DataProvider.prototype, "crop", null);
|
|
8190
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8191
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8192
|
+
], DataProvider.prototype, "resize", null);
|
|
8193
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8194
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8195
|
+
], DataProvider.prototype, "getMessage", null);
|
|
8196
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8197
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8198
|
+
], DataProvider.prototype, "isSuccess", null);
|
|
8199
|
+
(0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__.__decorate)([
|
|
8200
|
+
jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__.autobind
|
|
8201
|
+
], DataProvider.prototype, "destruct", null);
|
|
8136
8202
|
|
|
8137
8203
|
|
|
8138
8204
|
/***/ }),
|
|
@@ -18629,11 +18695,16 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
18629
18695
|
/* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16964);
|
|
18630
18696
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
18631
18697
|
/* harmony import */ var jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(27795);
|
|
18632
|
-
/* harmony import */ var
|
|
18633
|
-
/* harmony import */ var
|
|
18634
|
-
/* harmony import */ var
|
|
18635
|
-
/* harmony import */ var
|
|
18636
|
-
/* harmony import */ var
|
|
18698
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88475);
|
|
18699
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4040);
|
|
18700
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
|
|
18701
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
18702
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28723);
|
|
18703
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(71125);
|
|
18704
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(59400);
|
|
18705
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5266);
|
|
18706
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(54500);
|
|
18707
|
+
/* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(8908);
|
|
18637
18708
|
/*!
|
|
18638
18709
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
18639
18710
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -18653,6 +18724,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
18653
18724
|
|
|
18654
18725
|
|
|
18655
18726
|
|
|
18727
|
+
|
|
18728
|
+
|
|
18729
|
+
|
|
18730
|
+
|
|
18731
|
+
|
|
18656
18732
|
const jie = 'jodit-image-editor';
|
|
18657
18733
|
const TABS = {
|
|
18658
18734
|
resize: 'resize',
|
|
@@ -18697,9 +18773,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18697
18773
|
return this.j.async.promise((resolve)=>{
|
|
18698
18774
|
const timestamp = new Date().getTime();
|
|
18699
18775
|
this.image = this.j.c.element('img');
|
|
18700
|
-
(0,
|
|
18701
|
-
(0,
|
|
18702
|
-
(0,
|
|
18776
|
+
(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);
|
|
18777
|
+
(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);
|
|
18778
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'background', 'transparent');
|
|
18703
18779
|
this.onSave = save;
|
|
18704
18780
|
this.resize_box.appendChild(this.j.c.element('i', {
|
|
18705
18781
|
class: 'jodit-icon_loader'
|
|
@@ -18714,7 +18790,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18714
18790
|
}
|
|
18715
18791
|
this.image.setAttribute('src', url);
|
|
18716
18792
|
this._dialog.open();
|
|
18717
|
-
const { widthInput, heightInput } = (0,
|
|
18793
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18718
18794
|
const onload = ()=>{
|
|
18719
18795
|
if (this.isDestructed) {
|
|
18720
18796
|
return;
|
|
@@ -18728,7 +18804,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18728
18804
|
this.resize_box.appendChild(this.image);
|
|
18729
18805
|
this.cropImage = this.image.cloneNode(true);
|
|
18730
18806
|
this.crop_box.appendChild(this.cropImage);
|
|
18731
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove.apply(null, (0,
|
|
18807
|
+
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));
|
|
18732
18808
|
if (this.activeTab === TABS.crop) {
|
|
18733
18809
|
this.showCrop();
|
|
18734
18810
|
}
|
|
@@ -18750,9 +18826,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18750
18826
|
if (!slide) {
|
|
18751
18827
|
return;
|
|
18752
18828
|
}
|
|
18753
|
-
(0,
|
|
18829
|
+
(0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.$$)(`.${jie}__slider,.${jie}__area`, self.editor).forEach((elm)=>elm.classList.remove(`${jie}_active`));
|
|
18754
18830
|
slide.classList.add(`${jie}_active`);
|
|
18755
|
-
this.activeTab = (0,
|
|
18831
|
+
this.activeTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(slide, '-area') || TABS.resize;
|
|
18756
18832
|
const tab = self.editor.querySelector(`.${jie}__area.${jie}__area_` + self.activeTab);
|
|
18757
18833
|
if (tab) {
|
|
18758
18834
|
tab.classList.add(`${jie}_active`);
|
|
@@ -18762,14 +18838,14 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18762
18838
|
}
|
|
18763
18839
|
}
|
|
18764
18840
|
onChangeSizeInput(e) {
|
|
18765
|
-
const self = this, input = e.target, { widthInput, heightInput } = (0,
|
|
18841
|
+
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;
|
|
18766
18842
|
let y;
|
|
18767
18843
|
if (x > minX) {
|
|
18768
|
-
(0,
|
|
18844
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, isWidth ? 'width' : 'height', x);
|
|
18769
18845
|
if (self.resizeUseRatio) {
|
|
18770
18846
|
y = isWidth ? Math.round(x / self.ratio) : Math.round(x * self.ratio);
|
|
18771
18847
|
if (y > minY) {
|
|
18772
|
-
(0,
|
|
18848
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, !isWidth ? 'width' : 'height', y);
|
|
18773
18849
|
if (isWidth) {
|
|
18774
18850
|
heightInput.value = y.toString();
|
|
18775
18851
|
} else {
|
|
@@ -18789,8 +18865,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18789
18865
|
self.start_x = e.clientX;
|
|
18790
18866
|
self.start_y = e.clientY;
|
|
18791
18867
|
if (self.activeTab === TABS.crop) {
|
|
18792
|
-
self.top_x = (0,
|
|
18793
|
-
self.top_y = (0,
|
|
18868
|
+
self.top_x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left');
|
|
18869
|
+
self.top_y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top');
|
|
18794
18870
|
self.width = self.cropHandler.offsetWidth;
|
|
18795
18871
|
self.height = self.cropHandler.offsetHeight;
|
|
18796
18872
|
} else {
|
|
@@ -18811,7 +18887,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18811
18887
|
if (!self.clicked) {
|
|
18812
18888
|
return;
|
|
18813
18889
|
}
|
|
18814
|
-
const { widthInput, heightInput } = (0,
|
|
18890
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18815
18891
|
self.diff_x = e.clientX - self.start_x;
|
|
18816
18892
|
self.diff_y = e.clientY - self.start_y;
|
|
18817
18893
|
if (self.activeTab === TABS.resize && self.resizeUseRatio || self.activeTab === TABS.crop && self.cropUseRatio) {
|
|
@@ -18828,11 +18904,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18828
18904
|
}
|
|
18829
18905
|
if (self.activeTab === TABS.resize) {
|
|
18830
18906
|
if (self.new_w > self.o.resizeMinWidth) {
|
|
18831
|
-
(0,
|
|
18907
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'width', self.new_w + 'px');
|
|
18832
18908
|
widthInput.value = self.new_w.toString();
|
|
18833
18909
|
}
|
|
18834
18910
|
if (self.new_h > self.o.resizeMinHeight) {
|
|
18835
|
-
(0,
|
|
18911
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'height', self.new_h + 'px');
|
|
18836
18912
|
heightInput.value = self.new_h.toString();
|
|
18837
18913
|
}
|
|
18838
18914
|
this.j.e.fire(self.resizeHandler, 'updatesize');
|
|
@@ -18844,7 +18920,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18844
18920
|
if (self.top_y + self.new_h > self.cropImage.offsetHeight) {
|
|
18845
18921
|
self.new_h = self.cropImage.offsetHeight - self.top_y;
|
|
18846
18922
|
}
|
|
18847
|
-
(0,
|
|
18923
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
|
|
18848
18924
|
width: self.new_w,
|
|
18849
18925
|
height: self.new_h
|
|
18850
18926
|
});
|
|
@@ -18852,11 +18928,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18852
18928
|
if (self.top_x + self.diff_x + self.cropHandler.offsetWidth > self.cropImage.offsetWidth) {
|
|
18853
18929
|
self.diff_x = self.cropImage.offsetWidth - self.top_x - self.cropHandler.offsetWidth;
|
|
18854
18930
|
}
|
|
18855
|
-
(0,
|
|
18931
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left', self.top_x + self.diff_x);
|
|
18856
18932
|
if (self.top_y + self.diff_y + self.cropHandler.offsetHeight > self.cropImage.offsetHeight) {
|
|
18857
18933
|
self.diff_y = self.cropImage.offsetHeight - self.top_y - self.cropHandler.offsetHeight;
|
|
18858
18934
|
}
|
|
18859
|
-
(0,
|
|
18935
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top', self.top_y + self.diff_y);
|
|
18860
18936
|
}
|
|
18861
18937
|
this.j.e.fire(self.cropHandler, 'updatesize');
|
|
18862
18938
|
}
|
|
@@ -18897,7 +18973,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18897
18973
|
wn = nw * (h / nh);
|
|
18898
18974
|
hn = h;
|
|
18899
18975
|
}
|
|
18900
|
-
(0,
|
|
18976
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.crop_box, {
|
|
18901
18977
|
width: wn,
|
|
18902
18978
|
height: hn
|
|
18903
18979
|
});
|
|
@@ -18914,8 +18990,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18914
18990
|
} else {
|
|
18915
18991
|
this.new_h = ImageEditor.calcValueByPercent(h, this.o.cropDefaultHeight);
|
|
18916
18992
|
}
|
|
18917
|
-
(0,
|
|
18918
|
-
backgroundImage: 'url(' + (0,
|
|
18993
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, {
|
|
18994
|
+
backgroundImage: 'url(' + (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(this.cropImage, 'src') + ')',
|
|
18919
18995
|
width: this.new_w,
|
|
18920
18996
|
height: this.new_h,
|
|
18921
18997
|
left: w / 2 - this.new_w / 2,
|
|
@@ -18927,8 +19003,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18927
19003
|
return;
|
|
18928
19004
|
}
|
|
18929
19005
|
const ratioX = this.cropImage.offsetWidth / this.naturalWidth, ratioY = this.cropImage.offsetHeight / this.naturalHeight;
|
|
18930
|
-
this.cropBox.x = (0,
|
|
18931
|
-
this.cropBox.y = (0,
|
|
19006
|
+
this.cropBox.x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'left') / ratioX;
|
|
19007
|
+
this.cropBox.y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'top') / ratioY;
|
|
18932
19008
|
this.cropBox.w = this.cropHandler.offsetWidth / ratioX;
|
|
18933
19009
|
this.cropBox.h = this.cropHandler.offsetHeight / ratioY;
|
|
18934
19010
|
this.sizes.textContent = this.cropBox.w.toFixed(0) + 'x' + this.cropBox.h.toFixed(0);
|
|
@@ -18937,7 +19013,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18937
19013
|
this.resizeBox.h = this.image.offsetHeight || this.naturalHeight;
|
|
18938
19014
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "setHandlers", ()=>{
|
|
18939
19015
|
const self = this;
|
|
18940
|
-
const { widthInput, heightInput } = (0,
|
|
19016
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18941
19017
|
self.j.e.on([
|
|
18942
19018
|
self.editor.querySelector('.jodit_bottomright'),
|
|
18943
19019
|
self.cropHandler
|
|
@@ -18946,11 +19022,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18946
19022
|
self.showCrop();
|
|
18947
19023
|
this.j.e.fire(self.cropHandler, 'updatesize');
|
|
18948
19024
|
});
|
|
18949
|
-
self.j.e.on((0,
|
|
19025
|
+
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([
|
|
18950
19026
|
widthInput,
|
|
18951
19027
|
heightInput
|
|
18952
19028
|
], 'input', this.onChangeSizeInput);
|
|
18953
|
-
const { keepAspectRatioResize, keepAspectRatioCrop } = (0,
|
|
19029
|
+
const { keepAspectRatioResize, keepAspectRatioCrop } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18954
19030
|
if (keepAspectRatioResize) {
|
|
18955
19031
|
keepAspectRatioResize.addEventListener('change', ()=>{
|
|
18956
19032
|
this.resizeUseRatio = keepAspectRatioResize.checked;
|
|
@@ -18962,7 +19038,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18962
19038
|
});
|
|
18963
19039
|
}
|
|
18964
19040
|
self.j.e.on(self.resizeHandler, 'updatesize', ()=>{
|
|
18965
|
-
(0,
|
|
19041
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.resizeHandler, {
|
|
18966
19042
|
top: 0,
|
|
18967
19043
|
left: 0,
|
|
18968
19044
|
width: self.image.offsetWidth || self.naturalWidth,
|
|
@@ -18973,7 +19049,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18973
19049
|
if (!self.cropImage) {
|
|
18974
19050
|
return;
|
|
18975
19051
|
}
|
|
18976
|
-
let new_x = (0,
|
|
19052
|
+
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;
|
|
18977
19053
|
if (new_x < 0) {
|
|
18978
19054
|
new_x = 0;
|
|
18979
19055
|
}
|
|
@@ -18992,7 +19068,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18992
19068
|
new_width = new_height * self.ratio;
|
|
18993
19069
|
}
|
|
18994
19070
|
}
|
|
18995
|
-
(0,
|
|
19071
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
|
|
18996
19072
|
width: new_width,
|
|
18997
19073
|
height: new_height,
|
|
18998
19074
|
left: new_x,
|
|
@@ -19011,7 +19087,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
19011
19087
|
switch(button){
|
|
19012
19088
|
case self.buttons.saveas:
|
|
19013
19089
|
self.j.prompt('Enter new name', 'Save in new file', (name)=>{
|
|
19014
|
-
if (!(0,
|
|
19090
|
+
if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__.trim)(name)) {
|
|
19015
19091
|
self.j.alert('The name should not be empty');
|
|
19016
19092
|
return false;
|
|
19017
19093
|
}
|
|
@@ -19027,7 +19103,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
19027
19103
|
break;
|
|
19028
19104
|
case self.buttons.reset:
|
|
19029
19105
|
if (self.activeTab === TABS.resize) {
|
|
19030
|
-
(0,
|
|
19106
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, {
|
|
19031
19107
|
width: null,
|
|
19032
19108
|
height: null
|
|
19033
19109
|
});
|
|
@@ -19042,18 +19118,24 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
19042
19118
|
});
|
|
19043
19119
|
});
|
|
19044
19120
|
});
|
|
19045
|
-
this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor :
|
|
19121
|
+
this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor : jodit_config__WEBPACK_IMPORTED_MODULE_12__.Config.defaultOptions.imageeditor;
|
|
19046
19122
|
const o = this.options;
|
|
19047
19123
|
this.resizeUseRatio = o.resizeUseRatio;
|
|
19048
19124
|
this.cropUseRatio = o.cropUseRatio;
|
|
19049
19125
|
this.buttons = {
|
|
19050
|
-
reset: (0,
|
|
19051
|
-
save: (0,
|
|
19052
|
-
saveas: (0,
|
|
19126
|
+
reset: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'update', 'Reset'),
|
|
19127
|
+
save: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'save', 'Save'),
|
|
19128
|
+
saveas: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, {
|
|
19129
|
+
icon: {
|
|
19130
|
+
name: 'save'
|
|
19131
|
+
},
|
|
19132
|
+
name: 'save-as',
|
|
19133
|
+
text: 'Save as ...'
|
|
19134
|
+
})
|
|
19053
19135
|
};
|
|
19054
19136
|
this.activeTab = o.resize ? TABS.resize : TABS.crop;
|
|
19055
|
-
this.editor = (0,
|
|
19056
|
-
const { resizeBox, cropBox } = (0,
|
|
19137
|
+
this.editor = (0,_templates_form__WEBPACK_IMPORTED_MODULE_14__.form)(this.j, this.options);
|
|
19138
|
+
const { resizeBox, cropBox } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
19057
19139
|
this.resize_box = resizeBox;
|
|
19058
19140
|
this.crop_box = cropBox;
|
|
19059
19141
|
this.sizes = this.editor.querySelector(`.${jie}__area.${jie}__area_crop .jodit-image-editor__sizes`);
|
|
@@ -19117,7 +19199,7 @@ ImageEditor = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorat
|
|
|
19117
19199
|
/**
|
|
19118
19200
|
* Open Image Editor
|
|
19119
19201
|
*/ function openImageEditor(href, name, path, source, onSuccess, onFailed) {
|
|
19120
|
-
return this.getInstance('ImageEditor', this.o).open(href, (newname, box, success, failed)=>(0,
|
|
19202
|
+
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)=>{
|
|
19121
19203
|
if (ok) {
|
|
19122
19204
|
success();
|
|
19123
19205
|
if (onSuccess) {
|
|
@@ -29453,6 +29535,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
29453
29535
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29454
29536
|
/* harmony export */ call: function() { return /* binding */ call; },
|
|
29455
29537
|
/* harmony export */ callPromise: function() { return /* binding */ callPromise; },
|
|
29538
|
+
/* harmony export */ callThis: function() { return /* binding */ callThis; },
|
|
29456
29539
|
/* harmony export */ getDataTransfer: function() { return /* binding */ getDataTransfer; },
|
|
29457
29540
|
/* harmony export */ getPropertyDescriptor: function() { return /* binding */ getPropertyDescriptor; },
|
|
29458
29541
|
/* harmony export */ keys: function() { return /* binding */ keys; },
|
|
@@ -29485,6 +29568,17 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
29485
29568
|
*/ function call(func, ...args) {
|
|
29486
29569
|
return func(...args);
|
|
29487
29570
|
}
|
|
29571
|
+
/**
|
|
29572
|
+
* Call function with parameters
|
|
29573
|
+
*
|
|
29574
|
+
* @example
|
|
29575
|
+
* ```js
|
|
29576
|
+
* const f = Math.random();
|
|
29577
|
+
* Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
|
|
29578
|
+
* ```
|
|
29579
|
+
*/ function callThis(func, thisArg, ...args) {
|
|
29580
|
+
return func.apply(thisArg, args);
|
|
29581
|
+
}
|
|
29488
29582
|
/**
|
|
29489
29583
|
* Mark element for debugging
|
|
29490
29584
|
*/ function markOwner(jodit, elm) {
|
|
@@ -35015,7 +35109,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
35015
35109
|
* ```
|
|
35016
35110
|
* @packageDocumentation
|
|
35017
35111
|
* @module constants
|
|
35018
|
-
*/ const APP_VERSION = "4.9.
|
|
35112
|
+
*/ const APP_VERSION = "4.9.14";
|
|
35019
35113
|
// prettier-ignore
|
|
35020
35114
|
const ES = "es2015";
|
|
35021
35115
|
const IS_ES_MODERN = true;
|
|
@@ -38946,6 +39040,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38946
39040
|
/* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
|
|
38947
39041
|
/* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.call; },
|
|
38948
39042
|
/* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callPromise; },
|
|
39043
|
+
/* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callThis; },
|
|
38949
39044
|
/* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
|
|
38950
39045
|
/* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
|
|
38951
39046
|
/* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_18__.cns; },
|