jodit 4.15.2 → 4.15.4
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 +5 -5
- package/es2015/jodit.js +95 -31
- 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 +5 -5
- package/es2021/jodit.js +93 -31
- package/es2021/jodit.min.js +5 -5
- 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 +5 -5
- package/es2021.en/jodit.js +93 -31
- package/es2021.en/jodit.min.js +5 -5
- 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 +117 -51
- 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/modules/file-browser/data-provider.d.ts +9 -0
- package/esm/modules/file-browser/data-provider.js +45 -3
- package/esm/plugins/resizer/resizer.js +28 -3
- package/package.json +1 -1
- package/types/modules/file-browser/data-provider.d.ts +9 -0
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.15.
|
|
4
|
+
* Version: v4.15.4
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1785,7 +1785,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1785
1785
|
* ```
|
|
1786
1786
|
* @packageDocumentation
|
|
1787
1787
|
* @module constants
|
|
1788
|
-
*/ const APP_VERSION = "4.15.
|
|
1788
|
+
*/ const APP_VERSION = "4.15.4";
|
|
1789
1789
|
// prettier-ignore
|
|
1790
1790
|
const ES = "es2015";
|
|
1791
1791
|
const IS_ES_MODERN = true;
|
|
@@ -20568,6 +20568,7 @@ jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.filebrowser
|
|
|
20568
20568
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20569
20569
|
/* harmony export */ "default": function() { return /* binding */ DataProvider; }
|
|
20570
20570
|
/* harmony export */ });
|
|
20571
|
+
/* unused harmony export assertSourcesAnswer */
|
|
20571
20572
|
/* harmony import */ var _swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49376);
|
|
20572
20573
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(25045);
|
|
20573
20574
|
/* harmony import */ var _swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(41411);
|
|
@@ -20575,13 +20576,15 @@ jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.filebrowser
|
|
|
20575
20576
|
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31635);
|
|
20576
20577
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(81937);
|
|
20577
20578
|
/* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(49574);
|
|
20578
|
-
/* harmony import */ var
|
|
20579
|
-
/* harmony import */ var
|
|
20580
|
-
/* harmony import */ var
|
|
20581
|
-
/* harmony import */ var
|
|
20582
|
-
/* harmony import */ var
|
|
20583
|
-
/* harmony import */ var
|
|
20584
|
-
/* harmony import */ var
|
|
20579
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(17312);
|
|
20580
|
+
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(91565);
|
|
20581
|
+
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(62101);
|
|
20582
|
+
/* harmony import */ var jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(96340);
|
|
20583
|
+
/* harmony import */ var jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(77483);
|
|
20584
|
+
/* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(33201);
|
|
20585
|
+
/* harmony import */ var jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(52144);
|
|
20586
|
+
/* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(17338);
|
|
20587
|
+
/* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(58664);
|
|
20585
20588
|
/*!
|
|
20586
20589
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
20587
20590
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -20602,6 +20605,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_7__.Config.prototype.controls.filebrowser
|
|
|
20602
20605
|
|
|
20603
20606
|
|
|
20604
20607
|
|
|
20608
|
+
|
|
20609
|
+
|
|
20605
20610
|
const DEFAULT_SOURCE_NAME = 'default';
|
|
20606
20611
|
const possibleRules = new Set([
|
|
20607
20612
|
'allowFiles',
|
|
@@ -20618,6 +20623,38 @@ const possibleRules = new Set([
|
|
|
20618
20623
|
'allowImageResize',
|
|
20619
20624
|
'allowImageCrop'
|
|
20620
20625
|
]);
|
|
20626
|
+
const DOCS_URL = 'https://xdsoft.net/jodit/docs/modules/file_browser.html';
|
|
20627
|
+
/**
|
|
20628
|
+
* Validate the connector answer for the `files` / `folders` actions and
|
|
20629
|
+
* normalise it. A hand-written backend that returns the wrong shape used to
|
|
20630
|
+
* crash deep inside the UI with a bare `TypeError: ... reading 'forEach'`;
|
|
20631
|
+
* now it fails right here with a message that names the action, the option
|
|
20632
|
+
* and the missing field. Missing `files` / `folders` lists are treated as
|
|
20633
|
+
* empty instead of throwing.
|
|
20634
|
+
*/ function assertSourcesAnswer(resp, action, option) {
|
|
20635
|
+
const fail = (what)=>{
|
|
20636
|
+
throw new Error(`File browser: the connector answer for action "${action}" (option "filebrowser.${option}") ${what}. See ${DOCS_URL}`);
|
|
20637
|
+
};
|
|
20638
|
+
if (!(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_9__.isPlainObject)(resp) || !(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_9__.isPlainObject)(resp.data)) {
|
|
20639
|
+
return fail('has no "data" object');
|
|
20640
|
+
}
|
|
20641
|
+
const { sources } = resp.data;
|
|
20642
|
+
if (!(0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_7__.isArray)(sources)) {
|
|
20643
|
+
return fail(sources === undefined ? 'has no "data.sources" array' : `must contain "data.sources" as an array of sources, got ${(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_9__.isPlainObject)(sources) ? 'an object keyed by source name' : typeof sources}`);
|
|
20644
|
+
}
|
|
20645
|
+
sources.forEach((source, index)=>{
|
|
20646
|
+
if (!(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_9__.isPlainObject)(source)) {
|
|
20647
|
+
return fail(`has a non-object entry at "data.sources[${index}]"`);
|
|
20648
|
+
}
|
|
20649
|
+
if (!(0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_7__.isArray)(source.files)) {
|
|
20650
|
+
source.files = [];
|
|
20651
|
+
}
|
|
20652
|
+
if (!(0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_7__.isArray)(source.folders)) {
|
|
20653
|
+
source.folders = [];
|
|
20654
|
+
}
|
|
20655
|
+
});
|
|
20656
|
+
return resp;
|
|
20657
|
+
}
|
|
20621
20658
|
class DataProvider {
|
|
20622
20659
|
/**
|
|
20623
20660
|
* Alias for options
|
|
@@ -20631,13 +20668,13 @@ class DataProvider {
|
|
|
20631
20668
|
ajax === null || ajax === void 0 ? void 0 : ajax.abort();
|
|
20632
20669
|
instances.delete(name);
|
|
20633
20670
|
}
|
|
20634
|
-
const opts = (0,
|
|
20671
|
+
const opts = (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_11__.ConfigProto)(this.options[name] !== undefined ? this.options[name] : {}, (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_11__.ConfigProto)({
|
|
20635
20672
|
onProgress: this.progressHandler
|
|
20636
20673
|
}, this.o.ajax));
|
|
20637
20674
|
if (opts.prepareData) {
|
|
20638
20675
|
opts.data = opts.prepareData.call(this, opts.data);
|
|
20639
20676
|
}
|
|
20640
|
-
const ajax = new
|
|
20677
|
+
const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_14__.Ajax(opts);
|
|
20641
20678
|
instances.set(name, ajax);
|
|
20642
20679
|
const promise = ajax.send();
|
|
20643
20680
|
promise.finally(()=>{
|
|
@@ -20667,15 +20704,18 @@ class DataProvider {
|
|
|
20667
20704
|
if (this.o.permissions.url) {
|
|
20668
20705
|
return this.get('permissions').then((resp)=>{
|
|
20669
20706
|
if (this.parent.isInDestruct) {
|
|
20670
|
-
throw (0,
|
|
20707
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.abort)();
|
|
20671
20708
|
}
|
|
20672
20709
|
let process = this.o.permissions.process;
|
|
20673
20710
|
if (!process) {
|
|
20674
20711
|
process = this.o.ajax.process;
|
|
20675
20712
|
}
|
|
20676
20713
|
if (process) {
|
|
20714
|
+
var _respData_data;
|
|
20677
20715
|
const respData = process.call(self, resp);
|
|
20678
|
-
|
|
20716
|
+
// The permissions answer is optional and may come back without
|
|
20717
|
+
// a `data` object at all from a minimal backend.
|
|
20718
|
+
if (respData === null || respData === void 0 ? void 0 : (_respData_data = respData.data) === null || _respData_data === void 0 ? void 0 : _respData_data.permissions) {
|
|
20679
20719
|
this.parent.events.fire(this, 'changePermissions', this.__currentPermissions, respData.data.permissions);
|
|
20680
20720
|
this.__currentPermissions = respData.data.permissions;
|
|
20681
20721
|
}
|
|
@@ -20690,7 +20730,7 @@ class DataProvider {
|
|
|
20690
20730
|
const rule = 'allow' + action;
|
|
20691
20731
|
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_5__.IS_PROD) {
|
|
20692
20732
|
if (!possibleRules.has(rule)) {
|
|
20693
|
-
throw (0,
|
|
20733
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.error)('Wrong action ' + action);
|
|
20694
20734
|
}
|
|
20695
20735
|
}
|
|
20696
20736
|
const presetValue = this.o.permissionsPresets[rule];
|
|
@@ -20715,7 +20755,7 @@ class DataProvider {
|
|
|
20715
20755
|
if (process) {
|
|
20716
20756
|
resp = process.call(self, resp);
|
|
20717
20757
|
}
|
|
20718
|
-
return onResult(resp);
|
|
20758
|
+
return onResult(assertSourcesAnswer(resp, 'files', 'items'));
|
|
20719
20759
|
});
|
|
20720
20760
|
}
|
|
20721
20761
|
/**
|
|
@@ -20742,12 +20782,12 @@ class DataProvider {
|
|
|
20742
20782
|
sources.forEach((source)=>{
|
|
20743
20783
|
if (source.files && source.files.length) {
|
|
20744
20784
|
const { sort } = this.o;
|
|
20745
|
-
if ((0,
|
|
20785
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_8__.isFunction)(sort) && mods.sortBy) {
|
|
20746
20786
|
source.files.sort((a, b)=>sort(a, b, mods.sortBy));
|
|
20747
20787
|
}
|
|
20748
20788
|
source.files.forEach((item)=>{
|
|
20749
20789
|
if (inFilter(item) && canBeFile(item)) {
|
|
20750
|
-
elements.push(
|
|
20790
|
+
elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_15__.FileBrowserItem.create((0,_swc_helpers_object_spread_props__WEBPACK_IMPORTED_MODULE_3__._)((0,_swc_helpers_object_spread__WEBPACK_IMPORTED_MODULE_2__._)({}, item), {
|
|
20751
20791
|
sourceName: source.name,
|
|
20752
20792
|
source
|
|
20753
20793
|
})));
|
|
@@ -20759,7 +20799,7 @@ class DataProvider {
|
|
|
20759
20799
|
}
|
|
20760
20800
|
tree(path, source) {
|
|
20761
20801
|
return (0,_swc_helpers_async_to_generator__WEBPACK_IMPORTED_MODULE_0__._)(function*() {
|
|
20762
|
-
path = (0,
|
|
20802
|
+
path = (0,jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_10__.normalizeRelativePath)(path);
|
|
20763
20803
|
if (!this.o.folder) {
|
|
20764
20804
|
return Promise.reject(Error('Set Folder Api options'));
|
|
20765
20805
|
}
|
|
@@ -20774,19 +20814,19 @@ class DataProvider {
|
|
|
20774
20814
|
if (process) {
|
|
20775
20815
|
resp = process.call(self, resp);
|
|
20776
20816
|
}
|
|
20777
|
-
return resp.data.sources;
|
|
20817
|
+
return assertSourcesAnswer(resp, 'folders', 'folder').data.sources;
|
|
20778
20818
|
});
|
|
20779
20819
|
}).call(this);
|
|
20780
20820
|
}
|
|
20781
20821
|
/**
|
|
20782
20822
|
* Get path by url. You can use this method in another modules
|
|
20783
20823
|
*/ getPathByUrl(url) {
|
|
20784
|
-
;(0,
|
|
20824
|
+
;(0,jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_13__.set)('options.getLocalFileByUrl.data.url', url, this);
|
|
20785
20825
|
return this.get('getLocalFileByUrl').then((resp)=>{
|
|
20786
20826
|
if (this.isSuccess(resp)) {
|
|
20787
20827
|
return resp.data;
|
|
20788
20828
|
}
|
|
20789
|
-
throw (0,
|
|
20829
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.error)(this.getMessage(resp));
|
|
20790
20830
|
});
|
|
20791
20831
|
}
|
|
20792
20832
|
/**
|
|
@@ -20798,7 +20838,7 @@ class DataProvider {
|
|
|
20798
20838
|
*/ createFolder(name, path, source) {
|
|
20799
20839
|
const { create } = this.o;
|
|
20800
20840
|
if (!create) {
|
|
20801
|
-
throw (0,
|
|
20841
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.error)('Set Create api options');
|
|
20802
20842
|
}
|
|
20803
20843
|
create.data.source = source;
|
|
20804
20844
|
create.data.path = path;
|
|
@@ -20807,7 +20847,7 @@ class DataProvider {
|
|
|
20807
20847
|
if (this.isSuccess(resp)) {
|
|
20808
20848
|
return true;
|
|
20809
20849
|
}
|
|
20810
|
-
throw (0,
|
|
20850
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.error)(this.getMessage(resp));
|
|
20811
20851
|
});
|
|
20812
20852
|
}
|
|
20813
20853
|
/**
|
|
@@ -20819,7 +20859,7 @@ class DataProvider {
|
|
|
20819
20859
|
const mode = isFile ? 'fileMove' : 'folderMove';
|
|
20820
20860
|
const option = this.options[mode];
|
|
20821
20861
|
if (!option) {
|
|
20822
|
-
throw (0,
|
|
20862
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.error)('Set Move api options');
|
|
20823
20863
|
}
|
|
20824
20864
|
option.data.from = filepath;
|
|
20825
20865
|
option.data.path = path;
|
|
@@ -20828,7 +20868,7 @@ class DataProvider {
|
|
|
20828
20868
|
if (this.isSuccess(resp)) {
|
|
20829
20869
|
return true;
|
|
20830
20870
|
}
|
|
20831
|
-
throw (0,
|
|
20871
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.error)(this.getMessage(resp));
|
|
20832
20872
|
});
|
|
20833
20873
|
}
|
|
20834
20874
|
/**
|
|
@@ -20840,7 +20880,7 @@ class DataProvider {
|
|
|
20840
20880
|
*/ __remove(action, path, file, source) {
|
|
20841
20881
|
const fr = this.o[action];
|
|
20842
20882
|
if (!fr) {
|
|
20843
|
-
throw (0,
|
|
20883
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.error)(`Set "${action}" api options`);
|
|
20844
20884
|
}
|
|
20845
20885
|
fr.data.path = path;
|
|
20846
20886
|
fr.data.name = file;
|
|
@@ -20880,7 +20920,7 @@ class DataProvider {
|
|
|
20880
20920
|
*/ __rename(action, path, name, newname, source) {
|
|
20881
20921
|
const fr = this.o[action];
|
|
20882
20922
|
if (!fr) {
|
|
20883
|
-
throw (0,
|
|
20923
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_12__.error)(`Set "${action}" api options`);
|
|
20884
20924
|
}
|
|
20885
20925
|
fr.data.path = path;
|
|
20886
20926
|
fr.data.name = name;
|
|
@@ -39541,11 +39581,23 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
39541
39581
|
|
|
39542
39582
|
|
|
39543
39583
|
const keyBInd = '__jodit-resizer_binded';
|
|
39584
|
+
/**
|
|
39585
|
+
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
39586
|
+
* Relative values such as `100%` are ignored — they cannot be turned into a
|
|
39587
|
+
* fixed pixel box for the wrapper.
|
|
39588
|
+
*/ function attrPixelSize(element, key) {
|
|
39589
|
+
var _attr;
|
|
39590
|
+
const value = (_attr = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key)) === null || _attr === void 0 ? void 0 : _attr.trim();
|
|
39591
|
+
if (!value || !/^\d+(\.\d+)?(px)?$/i.test(value)) {
|
|
39592
|
+
return 0;
|
|
39593
|
+
}
|
|
39594
|
+
return parseFloat(value);
|
|
39595
|
+
}
|
|
39544
39596
|
/**
|
|
39545
39597
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
39546
39598
|
*/ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
|
|
39547
39599
|
/** @override */ afterInit(editor) {
|
|
39548
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('div', this.rect).forEach((resizeHandle)=>{
|
|
39600
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('div', this.rect).forEach((resizeHandle)=>{
|
|
39549
39601
|
editor.e.on(resizeHandle, 'mousedown.resizer touchstart.resizer', this.onStartResizing.bind(this, resizeHandle));
|
|
39550
39602
|
});
|
|
39551
39603
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.on('hideHelpers', this.hide);
|
|
@@ -39767,11 +39819,23 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
39767
39819
|
'data-jodit_iframe_wrapper': 1
|
|
39768
39820
|
});
|
|
39769
39821
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(wrapper, 'style', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'style'));
|
|
39822
|
+
// Inside a hidden container (`display:none` on any ancestor)
|
|
39823
|
+
// offsetWidth/offsetHeight are 0. Writing that into the wrapper
|
|
39824
|
+
// collapsed it to 0x0, the following content painted over the
|
|
39825
|
+
// iframe, and nothing corrected it once the container was shown.
|
|
39826
|
+
// Fall back to the iframe's own size attributes and, when there
|
|
39827
|
+
// is nothing measurable at all, let the wrapper size itself.
|
|
39828
|
+
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
39829
|
+
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
39770
39830
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
|
|
39771
|
-
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
|
|
39772
|
-
width: element.offsetWidth,
|
|
39773
|
-
height: element.offsetHeight
|
|
39831
|
+
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
|
|
39774
39832
|
});
|
|
39833
|
+
if (width) {
|
|
39834
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
|
|
39835
|
+
}
|
|
39836
|
+
if (height) {
|
|
39837
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'height', height);
|
|
39838
|
+
}
|
|
39775
39839
|
if (element.parentNode) {
|
|
39776
39840
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(element, wrapper);
|
|
39777
39841
|
}
|