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/es2021.en/jodit.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* jodit - Jodit is an awesome and useful wysiwyg editor with filebrowser
|
|
3
3
|
* Author: Chupurnov <chupurnov@gmail.com> (https://xdsoft.net/jodit/)
|
|
4
|
-
* Version: v4.15.
|
|
4
|
+
* Version: v4.15.4
|
|
5
5
|
* Url: https://xdsoft.net/jodit/
|
|
6
6
|
* License(s): MIT
|
|
7
7
|
*/
|
|
@@ -1779,7 +1779,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
1779
1779
|
* ```
|
|
1780
1780
|
* @packageDocumentation
|
|
1781
1781
|
* @module constants
|
|
1782
|
-
*/ const APP_VERSION = "4.15.
|
|
1782
|
+
*/ const APP_VERSION = "4.15.4";
|
|
1783
1783
|
// prettier-ignore
|
|
1784
1784
|
const ES = "es2021";
|
|
1785
1785
|
const IS_ES_MODERN = true;
|
|
@@ -20392,17 +20392,20 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.filebrowser
|
|
|
20392
20392
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
20393
20393
|
/* harmony export */ "default": function() { return /* binding */ DataProvider; }
|
|
20394
20394
|
/* harmony export */ });
|
|
20395
|
+
/* unused harmony export assertSourcesAnswer */
|
|
20395
20396
|
/* harmony import */ var _swc_helpers_define_property__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25045);
|
|
20396
20397
|
/* harmony import */ var _swc_helpers_ts_decorate__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(31635);
|
|
20397
20398
|
/* harmony import */ var jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81937);
|
|
20398
20399
|
/* harmony import */ var jodit_core_decorators_autobind_autobind__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49574);
|
|
20399
|
-
/* harmony import */ var
|
|
20400
|
-
/* harmony import */ var
|
|
20401
|
-
/* harmony import */ var
|
|
20402
|
-
/* harmony import */ var
|
|
20403
|
-
/* harmony import */ var
|
|
20404
|
-
/* harmony import */ var
|
|
20405
|
-
/* harmony import */ var
|
|
20400
|
+
/* harmony import */ var jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(17312);
|
|
20401
|
+
/* harmony import */ var jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(91565);
|
|
20402
|
+
/* harmony import */ var jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(62101);
|
|
20403
|
+
/* harmony import */ var jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(96340);
|
|
20404
|
+
/* harmony import */ var jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(77483);
|
|
20405
|
+
/* harmony import */ var jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(33201);
|
|
20406
|
+
/* harmony import */ var jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(52144);
|
|
20407
|
+
/* harmony import */ var jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(17338);
|
|
20408
|
+
/* harmony import */ var jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(58664);
|
|
20406
20409
|
/*!
|
|
20407
20410
|
* Jodit Editor (https://xdsoft.net/jodit/)
|
|
20408
20411
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
@@ -20420,6 +20423,8 @@ jodit_config__WEBPACK_IMPORTED_MODULE_5__.Config.prototype.controls.filebrowser
|
|
|
20420
20423
|
|
|
20421
20424
|
|
|
20422
20425
|
|
|
20426
|
+
|
|
20427
|
+
|
|
20423
20428
|
const DEFAULT_SOURCE_NAME = 'default';
|
|
20424
20429
|
const possibleRules = new Set([
|
|
20425
20430
|
'allowFiles',
|
|
@@ -20436,6 +20441,38 @@ const possibleRules = new Set([
|
|
|
20436
20441
|
'allowImageResize',
|
|
20437
20442
|
'allowImageCrop'
|
|
20438
20443
|
]);
|
|
20444
|
+
const DOCS_URL = 'https://xdsoft.net/jodit/docs/modules/file_browser.html';
|
|
20445
|
+
/**
|
|
20446
|
+
* Validate the connector answer for the `files` / `folders` actions and
|
|
20447
|
+
* normalise it. A hand-written backend that returns the wrong shape used to
|
|
20448
|
+
* crash deep inside the UI with a bare `TypeError: ... reading 'forEach'`;
|
|
20449
|
+
* now it fails right here with a message that names the action, the option
|
|
20450
|
+
* and the missing field. Missing `files` / `folders` lists are treated as
|
|
20451
|
+
* empty instead of throwing.
|
|
20452
|
+
*/ function assertSourcesAnswer(resp, action, option) {
|
|
20453
|
+
const fail = (what)=>{
|
|
20454
|
+
throw new Error(`File browser: the connector answer for action "${action}" (option "filebrowser.${option}") ${what}. See ${DOCS_URL}`);
|
|
20455
|
+
};
|
|
20456
|
+
if (!(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_6__.isPlainObject)(resp) || !(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_6__.isPlainObject)(resp.data)) {
|
|
20457
|
+
return fail('has no "data" object');
|
|
20458
|
+
}
|
|
20459
|
+
const { sources } = resp.data;
|
|
20460
|
+
if (!(0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_4__.isArray)(sources)) {
|
|
20461
|
+
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_6__.isPlainObject)(sources) ? 'an object keyed by source name' : typeof sources}`);
|
|
20462
|
+
}
|
|
20463
|
+
sources.forEach((source, index)=>{
|
|
20464
|
+
if (!(0,jodit_core_helpers_checker_is_plain_object__WEBPACK_IMPORTED_MODULE_6__.isPlainObject)(source)) {
|
|
20465
|
+
return fail(`has a non-object entry at "data.sources[${index}]"`);
|
|
20466
|
+
}
|
|
20467
|
+
if (!(0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_4__.isArray)(source.files)) {
|
|
20468
|
+
source.files = [];
|
|
20469
|
+
}
|
|
20470
|
+
if (!(0,jodit_core_helpers_checker_is_array__WEBPACK_IMPORTED_MODULE_4__.isArray)(source.folders)) {
|
|
20471
|
+
source.folders = [];
|
|
20472
|
+
}
|
|
20473
|
+
});
|
|
20474
|
+
return resp;
|
|
20475
|
+
}
|
|
20439
20476
|
class DataProvider {
|
|
20440
20477
|
/**
|
|
20441
20478
|
* Alias for options
|
|
@@ -20449,13 +20486,13 @@ class DataProvider {
|
|
|
20449
20486
|
ajax?.abort();
|
|
20450
20487
|
instances.delete(name);
|
|
20451
20488
|
}
|
|
20452
|
-
const opts = (0,
|
|
20489
|
+
const opts = (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_8__.ConfigProto)(this.options[name] !== undefined ? this.options[name] : {}, (0,jodit_core_helpers_utils_config_proto__WEBPACK_IMPORTED_MODULE_8__.ConfigProto)({
|
|
20453
20490
|
onProgress: this.progressHandler
|
|
20454
20491
|
}, this.o.ajax));
|
|
20455
20492
|
if (opts.prepareData) {
|
|
20456
20493
|
opts.data = opts.prepareData.call(this, opts.data);
|
|
20457
20494
|
}
|
|
20458
|
-
const ajax = new
|
|
20495
|
+
const ajax = new jodit_core_request_ajax__WEBPACK_IMPORTED_MODULE_11__.Ajax(opts);
|
|
20459
20496
|
instances.set(name, ajax);
|
|
20460
20497
|
const promise = ajax.send();
|
|
20461
20498
|
promise.finally(()=>{
|
|
@@ -20484,7 +20521,7 @@ class DataProvider {
|
|
|
20484
20521
|
if (this.o.permissions.url) {
|
|
20485
20522
|
return this.get('permissions').then((resp)=>{
|
|
20486
20523
|
if (this.parent.isInDestruct) {
|
|
20487
|
-
throw (0,
|
|
20524
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.abort)();
|
|
20488
20525
|
}
|
|
20489
20526
|
let process = this.o.permissions.process;
|
|
20490
20527
|
if (!process) {
|
|
@@ -20492,7 +20529,9 @@ class DataProvider {
|
|
|
20492
20529
|
}
|
|
20493
20530
|
if (process) {
|
|
20494
20531
|
const respData = process.call(self, resp);
|
|
20495
|
-
|
|
20532
|
+
// The permissions answer is optional and may come back without
|
|
20533
|
+
// a `data` object at all from a minimal backend.
|
|
20534
|
+
if (respData?.data?.permissions) {
|
|
20496
20535
|
this.parent.events.fire(this, 'changePermissions', this.__currentPermissions, respData.data.permissions);
|
|
20497
20536
|
this.__currentPermissions = respData.data.permissions;
|
|
20498
20537
|
}
|
|
@@ -20506,7 +20545,7 @@ class DataProvider {
|
|
|
20506
20545
|
const rule = 'allow' + action;
|
|
20507
20546
|
if (!jodit_core_constants__WEBPACK_IMPORTED_MODULE_2__.IS_PROD) {
|
|
20508
20547
|
if (!possibleRules.has(rule)) {
|
|
20509
|
-
throw (0,
|
|
20548
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.error)('Wrong action ' + action);
|
|
20510
20549
|
}
|
|
20511
20550
|
}
|
|
20512
20551
|
const presetValue = this.o.permissionsPresets[rule];
|
|
@@ -20531,7 +20570,7 @@ class DataProvider {
|
|
|
20531
20570
|
if (process) {
|
|
20532
20571
|
resp = process.call(self, resp);
|
|
20533
20572
|
}
|
|
20534
|
-
return onResult(resp);
|
|
20573
|
+
return onResult(assertSourcesAnswer(resp, 'files', 'items'));
|
|
20535
20574
|
});
|
|
20536
20575
|
}
|
|
20537
20576
|
/**
|
|
@@ -20555,12 +20594,12 @@ class DataProvider {
|
|
|
20555
20594
|
sources.forEach((source)=>{
|
|
20556
20595
|
if (source.files && source.files.length) {
|
|
20557
20596
|
const { sort } = this.o;
|
|
20558
|
-
if ((0,
|
|
20597
|
+
if ((0,jodit_core_helpers_checker_is_function__WEBPACK_IMPORTED_MODULE_5__.isFunction)(sort) && mods.sortBy) {
|
|
20559
20598
|
source.files.sort((a, b)=>sort(a, b, mods.sortBy));
|
|
20560
20599
|
}
|
|
20561
20600
|
source.files.forEach((item)=>{
|
|
20562
20601
|
if (inFilter(item) && canBeFile(item)) {
|
|
20563
|
-
elements.push(
|
|
20602
|
+
elements.push(jodit_modules_file_browser_builders_item__WEBPACK_IMPORTED_MODULE_12__.FileBrowserItem.create({
|
|
20564
20603
|
...item,
|
|
20565
20604
|
sourceName: source.name,
|
|
20566
20605
|
source
|
|
@@ -20572,7 +20611,7 @@ class DataProvider {
|
|
|
20572
20611
|
return elements;
|
|
20573
20612
|
}
|
|
20574
20613
|
async tree(path, source) {
|
|
20575
|
-
path = (0,
|
|
20614
|
+
path = (0,jodit_core_helpers_normalize_normalize_relative_path__WEBPACK_IMPORTED_MODULE_7__.normalizeRelativePath)(path);
|
|
20576
20615
|
if (!this.o.folder) {
|
|
20577
20616
|
return Promise.reject(Error('Set Folder Api options'));
|
|
20578
20617
|
}
|
|
@@ -20587,18 +20626,18 @@ class DataProvider {
|
|
|
20587
20626
|
if (process) {
|
|
20588
20627
|
resp = process.call(self, resp);
|
|
20589
20628
|
}
|
|
20590
|
-
return resp.data.sources;
|
|
20629
|
+
return assertSourcesAnswer(resp, 'folders', 'folder').data.sources;
|
|
20591
20630
|
});
|
|
20592
20631
|
}
|
|
20593
20632
|
/**
|
|
20594
20633
|
* Get path by url. You can use this method in another modules
|
|
20595
20634
|
*/ getPathByUrl(url) {
|
|
20596
|
-
;(0,
|
|
20635
|
+
;(0,jodit_core_helpers_utils_set__WEBPACK_IMPORTED_MODULE_10__.set)('options.getLocalFileByUrl.data.url', url, this);
|
|
20597
20636
|
return this.get('getLocalFileByUrl').then((resp)=>{
|
|
20598
20637
|
if (this.isSuccess(resp)) {
|
|
20599
20638
|
return resp.data;
|
|
20600
20639
|
}
|
|
20601
|
-
throw (0,
|
|
20640
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.error)(this.getMessage(resp));
|
|
20602
20641
|
});
|
|
20603
20642
|
}
|
|
20604
20643
|
/**
|
|
@@ -20610,7 +20649,7 @@ class DataProvider {
|
|
|
20610
20649
|
*/ createFolder(name, path, source) {
|
|
20611
20650
|
const { create } = this.o;
|
|
20612
20651
|
if (!create) {
|
|
20613
|
-
throw (0,
|
|
20652
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.error)('Set Create api options');
|
|
20614
20653
|
}
|
|
20615
20654
|
create.data.source = source;
|
|
20616
20655
|
create.data.path = path;
|
|
@@ -20619,7 +20658,7 @@ class DataProvider {
|
|
|
20619
20658
|
if (this.isSuccess(resp)) {
|
|
20620
20659
|
return true;
|
|
20621
20660
|
}
|
|
20622
|
-
throw (0,
|
|
20661
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.error)(this.getMessage(resp));
|
|
20623
20662
|
});
|
|
20624
20663
|
}
|
|
20625
20664
|
/**
|
|
@@ -20631,7 +20670,7 @@ class DataProvider {
|
|
|
20631
20670
|
const mode = isFile ? 'fileMove' : 'folderMove';
|
|
20632
20671
|
const option = this.options[mode];
|
|
20633
20672
|
if (!option) {
|
|
20634
|
-
throw (0,
|
|
20673
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.error)('Set Move api options');
|
|
20635
20674
|
}
|
|
20636
20675
|
option.data.from = filepath;
|
|
20637
20676
|
option.data.path = path;
|
|
@@ -20640,7 +20679,7 @@ class DataProvider {
|
|
|
20640
20679
|
if (this.isSuccess(resp)) {
|
|
20641
20680
|
return true;
|
|
20642
20681
|
}
|
|
20643
|
-
throw (0,
|
|
20682
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.error)(this.getMessage(resp));
|
|
20644
20683
|
});
|
|
20645
20684
|
}
|
|
20646
20685
|
/**
|
|
@@ -20652,7 +20691,7 @@ class DataProvider {
|
|
|
20652
20691
|
*/ __remove(action, path, file, source) {
|
|
20653
20692
|
const fr = this.o[action];
|
|
20654
20693
|
if (!fr) {
|
|
20655
|
-
throw (0,
|
|
20694
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.error)(`Set "${action}" api options`);
|
|
20656
20695
|
}
|
|
20657
20696
|
fr.data.path = path;
|
|
20658
20697
|
fr.data.name = file;
|
|
@@ -20692,7 +20731,7 @@ class DataProvider {
|
|
|
20692
20731
|
*/ __rename(action, path, name, newname, source) {
|
|
20693
20732
|
const fr = this.o[action];
|
|
20694
20733
|
if (!fr) {
|
|
20695
|
-
throw (0,
|
|
20734
|
+
throw (0,jodit_core_helpers_utils_error__WEBPACK_IMPORTED_MODULE_9__.error)(`Set "${action}" api options`);
|
|
20696
20735
|
}
|
|
20697
20736
|
fr.data.path = path;
|
|
20698
20737
|
fr.data.name = name;
|
|
@@ -38513,11 +38552,22 @@ jodit_config__WEBPACK_IMPORTED_MODULE_0__.Config.prototype.resizer = {
|
|
|
38513
38552
|
|
|
38514
38553
|
|
|
38515
38554
|
const keyBInd = '__jodit-resizer_binded';
|
|
38555
|
+
/**
|
|
38556
|
+
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
38557
|
+
* Relative values such as `100%` are ignored — they cannot be turned into a
|
|
38558
|
+
* fixed pixel box for the wrapper.
|
|
38559
|
+
*/ function attrPixelSize(element, key) {
|
|
38560
|
+
const value = (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, key)?.trim();
|
|
38561
|
+
if (!value || !/^\d+(\.\d+)?(px)?$/i.test(value)) {
|
|
38562
|
+
return 0;
|
|
38563
|
+
}
|
|
38564
|
+
return parseFloat(value);
|
|
38565
|
+
}
|
|
38516
38566
|
/**
|
|
38517
38567
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
38518
38568
|
*/ class resizer extends jodit_core_plugin_plugin__WEBPACK_IMPORTED_MODULE_8__.Plugin {
|
|
38519
38569
|
/** @override */ afterInit(editor) {
|
|
38520
|
-
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('div', this.rect).forEach((resizeHandle)=>{
|
|
38570
|
+
;(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.$$)('div', this.rect).forEach((resizeHandle)=>{
|
|
38521
38571
|
editor.e.on(resizeHandle, 'mousedown.resizer touchstart.resizer', this.onStartResizing.bind(this, resizeHandle));
|
|
38522
38572
|
});
|
|
38523
38573
|
jodit_core_global__WEBPACK_IMPORTED_MODULE_5__.eventEmitter.on('hideHelpers', this.hide);
|
|
@@ -38739,11 +38789,23 @@ const keyBInd = '__jodit-resizer_binded';
|
|
|
38739
38789
|
'data-jodit_iframe_wrapper': 1
|
|
38740
38790
|
});
|
|
38741
38791
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(wrapper, 'style', (0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.attr)(element, 'style'));
|
|
38792
|
+
// Inside a hidden container (`display:none` on any ancestor)
|
|
38793
|
+
// offsetWidth/offsetHeight are 0. Writing that into the wrapper
|
|
38794
|
+
// collapsed it to 0x0, the following content painted over the
|
|
38795
|
+
// iframe, and nothing corrected it once the container was shown.
|
|
38796
|
+
// Fall back to the iframe's own size attributes and, when there
|
|
38797
|
+
// is nothing measurable at all, let the wrapper size itself.
|
|
38798
|
+
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
38799
|
+
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
38742
38800
|
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, {
|
|
38743
|
-
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
|
|
38744
|
-
width: element.offsetWidth,
|
|
38745
|
-
height: element.offsetHeight
|
|
38801
|
+
display: (0,jodit_core_helpers_utils_css__WEBPACK_IMPORTED_MODULE_7__.cssInline)(element, 'display') === 'inline-block' ? 'inline-block' : 'block'
|
|
38746
38802
|
});
|
|
38803
|
+
if (width) {
|
|
38804
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'width', width);
|
|
38805
|
+
}
|
|
38806
|
+
if (height) {
|
|
38807
|
+
(0,jodit_core_helpers__WEBPACK_IMPORTED_MODULE_6__.css)(wrapper, 'height', height);
|
|
38808
|
+
}
|
|
38747
38809
|
if (element.parentNode) {
|
|
38748
38810
|
jodit_core_dom_dom__WEBPACK_IMPORTED_MODULE_4__.Dom.before(element, wrapper);
|
|
38749
38811
|
}
|