jodit 4.15.2 → 4.15.3
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 +4 -4
- package/es2015/jodit.js +30 -6
- package/es2015/jodit.min.js +4 -4
- 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 +4 -4
- package/es2018/jodit.min.js +4 -4
- 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 +4 -4
- package/es2021/jodit.js +29 -6
- package/es2021/jodit.min.js +4 -4
- 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 +4 -4
- package/es2021.en/jodit.js +29 -6
- package/es2021.en/jodit.min.js +4 -4
- 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 +29 -5
- 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/plugins/resizer/resizer.js +28 -3
- package/package.json +1 -1
package/es5/polyfills.fat.min.js
CHANGED
package/es5/polyfills.js
CHANGED
package/es5/polyfills.min.js
CHANGED
package/esm/core/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Released under MIT see LICENSE.txt in the project root for license information.
|
|
4
4
|
* Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net
|
|
5
5
|
*/
|
|
6
|
-
export const APP_VERSION = "4.15.
|
|
6
|
+
export const APP_VERSION = "4.15.3";
|
|
7
7
|
// prettier-ignore
|
|
8
8
|
export const ES = "es2020";
|
|
9
9
|
export const IS_ES_MODERN = true;
|
|
@@ -23,6 +23,19 @@ import { cssInline } from "../../core/helpers/utils/css.js";
|
|
|
23
23
|
import { Plugin } from "../../core/plugin/plugin.js";
|
|
24
24
|
import "./config.js";
|
|
25
25
|
const keyBInd = '__jodit-resizer_binded';
|
|
26
|
+
/**
|
|
27
|
+
* Reads a plain pixel value out of a `width`/`height` attribute.
|
|
28
|
+
* Relative values such as `100%` are ignored — they cannot be turned into a
|
|
29
|
+
* fixed pixel box for the wrapper.
|
|
30
|
+
*/
|
|
31
|
+
function attrPixelSize(element, key) {
|
|
32
|
+
var _a;
|
|
33
|
+
const value = (_a = attr(element, key)) === null || _a === void 0 ? void 0 : _a.trim();
|
|
34
|
+
if (!value || !/^\d+(\.\d+)?(px)?$/i.test(value)) {
|
|
35
|
+
return 0;
|
|
36
|
+
}
|
|
37
|
+
return parseFloat(value);
|
|
38
|
+
}
|
|
26
39
|
/**
|
|
27
40
|
* The module creates a supporting frame for resizing of the elements img and table
|
|
28
41
|
*/
|
|
@@ -348,13 +361,25 @@ export class resizer extends Plugin {
|
|
|
348
361
|
'data-jodit_iframe_wrapper': 1
|
|
349
362
|
});
|
|
350
363
|
attr(wrapper, 'style', attr(element, 'style'));
|
|
364
|
+
// Inside a hidden container (`display:none` on any ancestor)
|
|
365
|
+
// offsetWidth/offsetHeight are 0. Writing that into the wrapper
|
|
366
|
+
// collapsed it to 0x0, the following content painted over the
|
|
367
|
+
// iframe, and nothing corrected it once the container was shown.
|
|
368
|
+
// Fall back to the iframe's own size attributes and, when there
|
|
369
|
+
// is nothing measurable at all, let the wrapper size itself.
|
|
370
|
+
const width = element.offsetWidth || attrPixelSize(element, 'width');
|
|
371
|
+
const height = element.offsetHeight || attrPixelSize(element, 'height');
|
|
351
372
|
css(wrapper, {
|
|
352
373
|
display: cssInline(element, 'display') === 'inline-block'
|
|
353
374
|
? 'inline-block'
|
|
354
|
-
: 'block'
|
|
355
|
-
width: element.offsetWidth,
|
|
356
|
-
height: element.offsetHeight
|
|
375
|
+
: 'block'
|
|
357
376
|
});
|
|
377
|
+
if (width) {
|
|
378
|
+
css(wrapper, 'width', width);
|
|
379
|
+
}
|
|
380
|
+
if (height) {
|
|
381
|
+
css(wrapper, 'height', height);
|
|
382
|
+
}
|
|
358
383
|
if (element.parentNode) {
|
|
359
384
|
Dom.before(element, wrapper);
|
|
360
385
|
}
|