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/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.15
|
|
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: {}
|
|
@@ -8095,19 +8107,19 @@ class DataProvider {
|
|
|
8095
8107
|
query.data.path = path;
|
|
8096
8108
|
query.data.name = name;
|
|
8097
8109
|
query.data.source = source;
|
|
8098
|
-
return this.get(type).then(()=>{
|
|
8099
|
-
return true;
|
|
8110
|
+
return this.get(type).then((resp)=>{
|
|
8111
|
+
return resp.data.newPath || true;
|
|
8100
8112
|
});
|
|
8101
8113
|
}
|
|
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
|
/***/ }),
|
|
@@ -13273,9 +13339,10 @@ const $$temp = ()=>{
|
|
|
13273
13339
|
};
|
|
13274
13340
|
a.href = url;
|
|
13275
13341
|
j.filebrowser.dataProvider.getPathByUrl(a.href.toString()).then((resp)=>{
|
|
13276
|
-
jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_2__.openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, ()=>{
|
|
13342
|
+
jodit_modules_image_editor_image_editor__WEBPACK_IMPORTED_MODULE_2__.openImageEditor.call(j.filebrowser, a.href, resp.name, resp.path, resp.source, (newPath)=>{
|
|
13277
13343
|
const timestamp = new Date().getTime();
|
|
13278
|
-
|
|
13344
|
+
const newUrl = newPath || url;
|
|
13345
|
+
state.values.imageSrc = newUrl + (newUrl.indexOf('?') !== -1 ? '' : '?') + '&_tmp=' + timestamp.toString();
|
|
13279
13346
|
}, (error)=>{
|
|
13280
13347
|
j.alert(error.message);
|
|
13281
13348
|
});
|
|
@@ -18629,11 +18696,16 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
18629
18696
|
/* harmony import */ var jodit_core_component__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(16964);
|
|
18630
18697
|
/* harmony import */ var jodit_core_decorators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(84839);
|
|
18631
18698
|
/* 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
|
|
18699
|
+
/* harmony import */ var jodit_core_helpers_array_to_array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(88475);
|
|
18700
|
+
/* harmony import */ var jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(4040);
|
|
18701
|
+
/* harmony import */ var jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(7909);
|
|
18702
|
+
/* harmony import */ var jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(80991);
|
|
18703
|
+
/* harmony import */ var jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(28723);
|
|
18704
|
+
/* harmony import */ var jodit_core_helpers_utils_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(71125);
|
|
18705
|
+
/* harmony import */ var jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(59400);
|
|
18706
|
+
/* harmony import */ var jodit_config__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(5266);
|
|
18707
|
+
/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(54500);
|
|
18708
|
+
/* harmony import */ var _templates_form__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(8908);
|
|
18637
18709
|
/*!
|
|
18638
18710
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
18639
18711
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -18653,6 +18725,11 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
18653
18725
|
|
|
18654
18726
|
|
|
18655
18727
|
|
|
18728
|
+
|
|
18729
|
+
|
|
18730
|
+
|
|
18731
|
+
|
|
18732
|
+
|
|
18656
18733
|
const jie = 'jodit-image-editor';
|
|
18657
18734
|
const TABS = {
|
|
18658
18735
|
resize: 'resize',
|
|
@@ -18697,9 +18774,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18697
18774
|
return this.j.async.promise((resolve)=>{
|
|
18698
18775
|
const timestamp = new Date().getTime();
|
|
18699
18776
|
this.image = this.j.c.element('img');
|
|
18700
|
-
(0,
|
|
18701
|
-
(0,
|
|
18702
|
-
(0,
|
|
18777
|
+
(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);
|
|
18778
|
+
(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);
|
|
18779
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'background', 'transparent');
|
|
18703
18780
|
this.onSave = save;
|
|
18704
18781
|
this.resize_box.appendChild(this.j.c.element('i', {
|
|
18705
18782
|
class: 'jodit-icon_loader'
|
|
@@ -18714,7 +18791,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18714
18791
|
}
|
|
18715
18792
|
this.image.setAttribute('src', url);
|
|
18716
18793
|
this._dialog.open();
|
|
18717
|
-
const { widthInput, heightInput } = (0,
|
|
18794
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18718
18795
|
const onload = ()=>{
|
|
18719
18796
|
if (this.isDestructed) {
|
|
18720
18797
|
return;
|
|
@@ -18728,7 +18805,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18728
18805
|
this.resize_box.appendChild(this.image);
|
|
18729
18806
|
this.cropImage = this.image.cloneNode(true);
|
|
18730
18807
|
this.crop_box.appendChild(this.cropImage);
|
|
18731
|
-
jodit_core_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.safeRemove.apply(null, (0,
|
|
18808
|
+
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
18809
|
if (this.activeTab === TABS.crop) {
|
|
18733
18810
|
this.showCrop();
|
|
18734
18811
|
}
|
|
@@ -18750,9 +18827,9 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18750
18827
|
if (!slide) {
|
|
18751
18828
|
return;
|
|
18752
18829
|
}
|
|
18753
|
-
(0,
|
|
18830
|
+
(0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.$$)(`.${jie}__slider,.${jie}__area`, self.editor).forEach((elm)=>elm.classList.remove(`${jie}_active`));
|
|
18754
18831
|
slide.classList.add(`${jie}_active`);
|
|
18755
|
-
this.activeTab = (0,
|
|
18832
|
+
this.activeTab = (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(slide, '-area') || TABS.resize;
|
|
18756
18833
|
const tab = self.editor.querySelector(`.${jie}__area.${jie}__area_` + self.activeTab);
|
|
18757
18834
|
if (tab) {
|
|
18758
18835
|
tab.classList.add(`${jie}_active`);
|
|
@@ -18762,14 +18839,14 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18762
18839
|
}
|
|
18763
18840
|
}
|
|
18764
18841
|
onChangeSizeInput(e) {
|
|
18765
|
-
const self = this, input = e.target, { widthInput, heightInput } = (0,
|
|
18842
|
+
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
18843
|
let y;
|
|
18767
18844
|
if (x > minX) {
|
|
18768
|
-
(0,
|
|
18845
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, isWidth ? 'width' : 'height', x);
|
|
18769
18846
|
if (self.resizeUseRatio) {
|
|
18770
18847
|
y = isWidth ? Math.round(x / self.ratio) : Math.round(x * self.ratio);
|
|
18771
18848
|
if (y > minY) {
|
|
18772
|
-
(0,
|
|
18849
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, !isWidth ? 'width' : 'height', y);
|
|
18773
18850
|
if (isWidth) {
|
|
18774
18851
|
heightInput.value = y.toString();
|
|
18775
18852
|
} else {
|
|
@@ -18789,8 +18866,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18789
18866
|
self.start_x = e.clientX;
|
|
18790
18867
|
self.start_y = e.clientY;
|
|
18791
18868
|
if (self.activeTab === TABS.crop) {
|
|
18792
|
-
self.top_x = (0,
|
|
18793
|
-
self.top_y = (0,
|
|
18869
|
+
self.top_x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left');
|
|
18870
|
+
self.top_y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top');
|
|
18794
18871
|
self.width = self.cropHandler.offsetWidth;
|
|
18795
18872
|
self.height = self.cropHandler.offsetHeight;
|
|
18796
18873
|
} else {
|
|
@@ -18811,7 +18888,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18811
18888
|
if (!self.clicked) {
|
|
18812
18889
|
return;
|
|
18813
18890
|
}
|
|
18814
|
-
const { widthInput, heightInput } = (0,
|
|
18891
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18815
18892
|
self.diff_x = e.clientX - self.start_x;
|
|
18816
18893
|
self.diff_y = e.clientY - self.start_y;
|
|
18817
18894
|
if (self.activeTab === TABS.resize && self.resizeUseRatio || self.activeTab === TABS.crop && self.cropUseRatio) {
|
|
@@ -18828,11 +18905,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18828
18905
|
}
|
|
18829
18906
|
if (self.activeTab === TABS.resize) {
|
|
18830
18907
|
if (self.new_w > self.o.resizeMinWidth) {
|
|
18831
|
-
(0,
|
|
18908
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'width', self.new_w + 'px');
|
|
18832
18909
|
widthInput.value = self.new_w.toString();
|
|
18833
18910
|
}
|
|
18834
18911
|
if (self.new_h > self.o.resizeMinHeight) {
|
|
18835
|
-
(0,
|
|
18912
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, 'height', self.new_h + 'px');
|
|
18836
18913
|
heightInput.value = self.new_h.toString();
|
|
18837
18914
|
}
|
|
18838
18915
|
this.j.e.fire(self.resizeHandler, 'updatesize');
|
|
@@ -18844,7 +18921,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18844
18921
|
if (self.top_y + self.new_h > self.cropImage.offsetHeight) {
|
|
18845
18922
|
self.new_h = self.cropImage.offsetHeight - self.top_y;
|
|
18846
18923
|
}
|
|
18847
|
-
(0,
|
|
18924
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
|
|
18848
18925
|
width: self.new_w,
|
|
18849
18926
|
height: self.new_h
|
|
18850
18927
|
});
|
|
@@ -18852,11 +18929,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18852
18929
|
if (self.top_x + self.diff_x + self.cropHandler.offsetWidth > self.cropImage.offsetWidth) {
|
|
18853
18930
|
self.diff_x = self.cropImage.offsetWidth - self.top_x - self.cropHandler.offsetWidth;
|
|
18854
18931
|
}
|
|
18855
|
-
(0,
|
|
18932
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'left', self.top_x + self.diff_x);
|
|
18856
18933
|
if (self.top_y + self.diff_y + self.cropHandler.offsetHeight > self.cropImage.offsetHeight) {
|
|
18857
18934
|
self.diff_y = self.cropImage.offsetHeight - self.top_y - self.cropHandler.offsetHeight;
|
|
18858
18935
|
}
|
|
18859
|
-
(0,
|
|
18936
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, 'top', self.top_y + self.diff_y);
|
|
18860
18937
|
}
|
|
18861
18938
|
this.j.e.fire(self.cropHandler, 'updatesize');
|
|
18862
18939
|
}
|
|
@@ -18897,7 +18974,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18897
18974
|
wn = nw * (h / nh);
|
|
18898
18975
|
hn = h;
|
|
18899
18976
|
}
|
|
18900
|
-
(0,
|
|
18977
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.crop_box, {
|
|
18901
18978
|
width: wn,
|
|
18902
18979
|
height: hn
|
|
18903
18980
|
});
|
|
@@ -18914,8 +18991,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18914
18991
|
} else {
|
|
18915
18992
|
this.new_h = ImageEditor.calcValueByPercent(h, this.o.cropDefaultHeight);
|
|
18916
18993
|
}
|
|
18917
|
-
(0,
|
|
18918
|
-
backgroundImage: 'url(' + (0,
|
|
18994
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, {
|
|
18995
|
+
backgroundImage: 'url(' + (0,jodit_core_helpers_utils_attr__WEBPACK_IMPORTED_MODULE_7__.attr)(this.cropImage, 'src') + ')',
|
|
18919
18996
|
width: this.new_w,
|
|
18920
18997
|
height: this.new_h,
|
|
18921
18998
|
left: w / 2 - this.new_w / 2,
|
|
@@ -18927,8 +19004,8 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18927
19004
|
return;
|
|
18928
19005
|
}
|
|
18929
19006
|
const ratioX = this.cropImage.offsetWidth / this.naturalWidth, ratioY = this.cropImage.offsetHeight / this.naturalHeight;
|
|
18930
|
-
this.cropBox.x = (0,
|
|
18931
|
-
this.cropBox.y = (0,
|
|
19007
|
+
this.cropBox.x = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'left') / ratioX;
|
|
19008
|
+
this.cropBox.y = (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(this.cropHandler, 'top') / ratioY;
|
|
18932
19009
|
this.cropBox.w = this.cropHandler.offsetWidth / ratioX;
|
|
18933
19010
|
this.cropBox.h = this.cropHandler.offsetHeight / ratioY;
|
|
18934
19011
|
this.sizes.textContent = this.cropBox.w.toFixed(0) + 'x' + this.cropBox.h.toFixed(0);
|
|
@@ -18937,7 +19014,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18937
19014
|
this.resizeBox.h = this.image.offsetHeight || this.naturalHeight;
|
|
18938
19015
|
}), (0,_swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__._)(this, "setHandlers", ()=>{
|
|
18939
19016
|
const self = this;
|
|
18940
|
-
const { widthInput, heightInput } = (0,
|
|
19017
|
+
const { widthInput, heightInput } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18941
19018
|
self.j.e.on([
|
|
18942
19019
|
self.editor.querySelector('.jodit_bottomright'),
|
|
18943
19020
|
self.cropHandler
|
|
@@ -18946,11 +19023,11 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18946
19023
|
self.showCrop();
|
|
18947
19024
|
this.j.e.fire(self.cropHandler, 'updatesize');
|
|
18948
19025
|
});
|
|
18949
|
-
self.j.e.on((0,
|
|
19026
|
+
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
19027
|
widthInput,
|
|
18951
19028
|
heightInput
|
|
18952
19029
|
], 'input', this.onChangeSizeInput);
|
|
18953
|
-
const { keepAspectRatioResize, keepAspectRatioCrop } = (0,
|
|
19030
|
+
const { keepAspectRatioResize, keepAspectRatioCrop } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
18954
19031
|
if (keepAspectRatioResize) {
|
|
18955
19032
|
keepAspectRatioResize.addEventListener('change', ()=>{
|
|
18956
19033
|
this.resizeUseRatio = keepAspectRatioResize.checked;
|
|
@@ -18962,7 +19039,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18962
19039
|
});
|
|
18963
19040
|
}
|
|
18964
19041
|
self.j.e.on(self.resizeHandler, 'updatesize', ()=>{
|
|
18965
|
-
(0,
|
|
19042
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.resizeHandler, {
|
|
18966
19043
|
top: 0,
|
|
18967
19044
|
left: 0,
|
|
18968
19045
|
width: self.image.offsetWidth || self.naturalWidth,
|
|
@@ -18973,7 +19050,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18973
19050
|
if (!self.cropImage) {
|
|
18974
19051
|
return;
|
|
18975
19052
|
}
|
|
18976
|
-
let new_x = (0,
|
|
19053
|
+
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
19054
|
if (new_x < 0) {
|
|
18978
19055
|
new_x = 0;
|
|
18979
19056
|
}
|
|
@@ -18992,7 +19069,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
18992
19069
|
new_width = new_height * self.ratio;
|
|
18993
19070
|
}
|
|
18994
19071
|
}
|
|
18995
|
-
(0,
|
|
19072
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.cropHandler, {
|
|
18996
19073
|
width: new_width,
|
|
18997
19074
|
height: new_height,
|
|
18998
19075
|
left: new_x,
|
|
@@ -19011,7 +19088,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
19011
19088
|
switch(button){
|
|
19012
19089
|
case self.buttons.saveas:
|
|
19013
19090
|
self.j.prompt('Enter new name', 'Save in new file', (name)=>{
|
|
19014
|
-
if (!(0,
|
|
19091
|
+
if (!(0,jodit_core_helpers_string_trim__WEBPACK_IMPORTED_MODULE_6__.trim)(name)) {
|
|
19015
19092
|
self.j.alert('The name should not be empty');
|
|
19016
19093
|
return false;
|
|
19017
19094
|
}
|
|
@@ -19027,7 +19104,7 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
19027
19104
|
break;
|
|
19028
19105
|
case self.buttons.reset:
|
|
19029
19106
|
if (self.activeTab === TABS.resize) {
|
|
19030
|
-
(0,
|
|
19107
|
+
(0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_8__.css)(self.image, {
|
|
19031
19108
|
width: null,
|
|
19032
19109
|
height: null
|
|
19033
19110
|
});
|
|
@@ -19042,18 +19119,24 @@ class ImageEditor extends jodit_core_component__WEBPACK_IMPORTED_MODULE_2__.View
|
|
|
19042
19119
|
});
|
|
19043
19120
|
});
|
|
19044
19121
|
});
|
|
19045
|
-
this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor :
|
|
19122
|
+
this.options = editor && editor.o && editor.o.imageeditor ? editor.o.imageeditor : jodit_config__WEBPACK_IMPORTED_MODULE_12__.Config.defaultOptions.imageeditor;
|
|
19046
19123
|
const o = this.options;
|
|
19047
19124
|
this.resizeUseRatio = o.resizeUseRatio;
|
|
19048
19125
|
this.cropUseRatio = o.cropUseRatio;
|
|
19049
19126
|
this.buttons = {
|
|
19050
|
-
reset: (0,
|
|
19051
|
-
save: (0,
|
|
19052
|
-
saveas: (0,
|
|
19127
|
+
reset: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'update', 'Reset'),
|
|
19128
|
+
save: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, 'save', 'Save'),
|
|
19129
|
+
saveas: (0,jodit_core_ui_button__WEBPACK_IMPORTED_MODULE_11__.Button)(this.j, {
|
|
19130
|
+
icon: {
|
|
19131
|
+
name: 'save'
|
|
19132
|
+
},
|
|
19133
|
+
name: 'save-as',
|
|
19134
|
+
text: 'Save as ...'
|
|
19135
|
+
})
|
|
19053
19136
|
};
|
|
19054
19137
|
this.activeTab = o.resize ? TABS.resize : TABS.crop;
|
|
19055
|
-
this.editor = (0,
|
|
19056
|
-
const { resizeBox, cropBox } = (0,
|
|
19138
|
+
this.editor = (0,_templates_form__WEBPACK_IMPORTED_MODULE_14__.form)(this.j, this.options);
|
|
19139
|
+
const { resizeBox, cropBox } = (0,jodit_core_helpers_utils_selector__WEBPACK_IMPORTED_MODULE_9__.refs)(this.editor);
|
|
19057
19140
|
this.resize_box = resizeBox;
|
|
19058
19141
|
this.crop_box = cropBox;
|
|
19059
19142
|
this.sizes = this.editor.querySelector(`.${jie}__area.${jie}__area_crop .jodit-image-editor__sizes`);
|
|
@@ -19117,11 +19200,11 @@ ImageEditor = (0,_swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__.__decorat
|
|
|
19117
19200
|
/**
|
|
19118
19201
|
* Open Image Editor
|
|
19119
19202
|
*/ function openImageEditor(href, name, path, source, onSuccess, onFailed) {
|
|
19120
|
-
return this.getInstance('ImageEditor', this.o).open(href, (newname, box, success, failed)=>(0,
|
|
19121
|
-
if (
|
|
19203
|
+
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)=>{
|
|
19204
|
+
if (result) {
|
|
19122
19205
|
success();
|
|
19123
19206
|
if (onSuccess) {
|
|
19124
|
-
onSuccess();
|
|
19207
|
+
onSuccess(typeof result === 'string' ? result : undefined);
|
|
19125
19208
|
}
|
|
19126
19209
|
}
|
|
19127
19210
|
}).catch((error)=>{
|
|
@@ -29453,6 +29536,7 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
29453
29536
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
29454
29537
|
/* harmony export */ call: function() { return /* binding */ call; },
|
|
29455
29538
|
/* harmony export */ callPromise: function() { return /* binding */ callPromise; },
|
|
29539
|
+
/* harmony export */ callThis: function() { return /* binding */ callThis; },
|
|
29456
29540
|
/* harmony export */ getDataTransfer: function() { return /* binding */ getDataTransfer; },
|
|
29457
29541
|
/* harmony export */ getPropertyDescriptor: function() { return /* binding */ getPropertyDescriptor; },
|
|
29458
29542
|
/* harmony export */ keys: function() { return /* binding */ keys; },
|
|
@@ -29485,6 +29569,17 @@ module.exports = "<svg xmlns='http://www.w3.org/2000/svg' viewBox=\"0 0 1792 179
|
|
|
29485
29569
|
*/ function call(func, ...args) {
|
|
29486
29570
|
return func(...args);
|
|
29487
29571
|
}
|
|
29572
|
+
/**
|
|
29573
|
+
* Call function with parameters
|
|
29574
|
+
*
|
|
29575
|
+
* @example
|
|
29576
|
+
* ```js
|
|
29577
|
+
* const f = Math.random();
|
|
29578
|
+
* Jodit.modules.Helpers.call(f > 0.5 ? Math.ceil : Math.floor, f);
|
|
29579
|
+
* ```
|
|
29580
|
+
*/ function callThis(func, thisArg, ...args) {
|
|
29581
|
+
return func.apply(thisArg, args);
|
|
29582
|
+
}
|
|
29488
29583
|
/**
|
|
29489
29584
|
* Mark element for debugging
|
|
29490
29585
|
*/ function markOwner(jodit, elm) {
|
|
@@ -35015,7 +35110,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
35015
35110
|
* ```
|
|
35016
35111
|
* @packageDocumentation
|
|
35017
35112
|
* @module constants
|
|
35018
|
-
*/ const APP_VERSION = "4.9.
|
|
35113
|
+
*/ const APP_VERSION = "4.9.15";
|
|
35019
35114
|
// prettier-ignore
|
|
35020
35115
|
const ES = "es2015";
|
|
35021
35116
|
const IS_ES_MODERN = true;
|
|
@@ -36747,7 +36842,11 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.showWordsCounter = tr
|
|
|
36747
36842
|
content = data;
|
|
36748
36843
|
}
|
|
36749
36844
|
if ((0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isArray)(content)) {
|
|
36750
|
-
this.
|
|
36845
|
+
const disabled = this.j.o.toolbarInlineDisabledButtons;
|
|
36846
|
+
this.toolbar.build(disabled.length ? content.filter((item)=>{
|
|
36847
|
+
const name = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_5__.isString)(item) ? item : item.name;
|
|
36848
|
+
return !disabled.includes(name !== null && name !== void 0 ? name : '');
|
|
36849
|
+
}) : content, target);
|
|
36751
36850
|
this.toolbar.buttonSize = this.j.o.toolbarButtonSize;
|
|
36752
36851
|
content = this.toolbar.container;
|
|
36753
36852
|
}
|
|
@@ -38946,6 +39045,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
38946
39045
|
/* harmony export */ buildQuery: function() { return /* reexport safe */ _build_query__WEBPACK_IMPORTED_MODULE_5__.buildQuery; },
|
|
38947
39046
|
/* harmony export */ call: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.call; },
|
|
38948
39047
|
/* harmony export */ callPromise: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callPromise; },
|
|
39048
|
+
/* harmony export */ callThis: function() { return /* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_26__.callThis; },
|
|
38949
39049
|
/* harmony export */ clearAlign: function() { return /* reexport safe */ _align__WEBPACK_IMPORTED_MODULE_0__.clearAlign; },
|
|
38950
39050
|
/* harmony export */ clearCenterAlign: function() { return /* reexport safe */ _css__WEBPACK_IMPORTED_MODULE_9__.clearCenterAlign; },
|
|
38951
39051
|
/* harmony export */ cns: function() { return /* reexport safe */ _mark_deprecated__WEBPACK_IMPORTED_MODULE_18__.cns; },
|