@ckeditor/ckeditor5-widget 41.4.0-alpha.0 → 41.4.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/translations/ar.umd.js +11 -0
- package/dist/translations/az.umd.js +11 -0
- package/dist/translations/bg.umd.js +11 -0
- package/dist/translations/bn.umd.js +11 -0
- package/dist/translations/ca.umd.js +11 -0
- package/dist/translations/cs.umd.js +11 -0
- package/dist/translations/da.umd.js +11 -0
- package/dist/translations/de-ch.umd.js +11 -0
- package/dist/translations/de.umd.js +11 -0
- package/dist/translations/el.umd.js +11 -0
- package/dist/translations/en-au.umd.js +11 -0
- package/dist/translations/en.umd.js +11 -0
- package/dist/translations/es.umd.js +11 -0
- package/dist/translations/et.umd.js +11 -0
- package/dist/translations/fa.umd.js +11 -0
- package/dist/translations/fi.umd.js +11 -0
- package/dist/translations/fr.umd.js +11 -0
- package/dist/translations/gl.umd.js +11 -0
- package/dist/translations/he.umd.js +11 -0
- package/dist/translations/hi.umd.js +11 -0
- package/dist/translations/hr.umd.js +11 -0
- package/dist/translations/hu.umd.js +11 -0
- package/dist/translations/id.umd.js +11 -0
- package/dist/translations/it.umd.js +11 -0
- package/dist/translations/ja.umd.js +11 -0
- package/dist/translations/ko.umd.js +11 -0
- package/dist/translations/ku.umd.js +11 -0
- package/dist/translations/lt.umd.js +11 -0
- package/dist/translations/lv.umd.js +11 -0
- package/dist/translations/ms.umd.js +11 -0
- package/dist/translations/nl.umd.js +11 -0
- package/dist/translations/no.umd.js +11 -0
- package/dist/translations/pl.umd.js +11 -0
- package/dist/translations/pt-br.umd.js +11 -0
- package/dist/translations/pt.umd.js +11 -0
- package/dist/translations/ro.umd.js +11 -0
- package/dist/translations/ru.umd.js +11 -0
- package/dist/translations/sk.umd.js +11 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/types/utils.d.ts +1 -1
- package/package.json +7 -7
- package/src/utils.d.ts +1 -1
- package/src/utils.js +7 -3
package/dist/index.js
CHANGED
@@ -447,17 +447,21 @@ var dragHandleIcon = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/
|
|
447
447
|
* Starting from a DOM resize host element (an element that receives dimensions as a result of resizing),
|
448
448
|
* this helper returns the width of the found ancestor element.
|
449
449
|
*
|
450
|
-
*
|
450
|
+
* * It searches up to 5 levels of ancestors only.
|
451
451
|
*
|
452
452
|
* @param domResizeHost Resize host DOM element that receives dimensions as a result of resizing.
|
453
453
|
* @returns Width of ancestor element in pixels or 0 if no ancestor with a computed width has been found.
|
454
454
|
*/ function calculateResizeHostAncestorWidth(domResizeHost) {
|
455
|
+
const getElementComputedWidth = (element)=>{
|
456
|
+
const { width, paddingLeft, paddingRight } = element.ownerDocument.defaultView.getComputedStyle(element);
|
457
|
+
return parseFloat(width) - (parseFloat(paddingLeft) || 0) - (parseFloat(paddingRight) || 0);
|
458
|
+
};
|
455
459
|
const domResizeHostParent = domResizeHost.parentElement;
|
456
460
|
if (!domResizeHostParent) {
|
457
461
|
return 0;
|
458
462
|
}
|
459
463
|
// Need to use computed style as it properly excludes parent's paddings from the returned value.
|
460
|
-
let parentWidth =
|
464
|
+
let parentWidth = getElementComputedWidth(domResizeHostParent);
|
461
465
|
// Sometimes parent width cannot be accessed. If that happens we should go up in the elements tree
|
462
466
|
// and try to get width from next ancestor.
|
463
467
|
// https://github.com/ckeditor/ckeditor5/issues/10776
|
@@ -469,7 +473,7 @@ var dragHandleIcon = "<svg viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/
|
|
469
473
|
if (++currentLevel > ancestorLevelLimit) {
|
470
474
|
return 0;
|
471
475
|
}
|
472
|
-
parentWidth =
|
476
|
+
parentWidth = getElementComputedWidth(checkedElement);
|
473
477
|
}
|
474
478
|
return parentWidth;
|
475
479
|
}
|