@ckeditor/ckeditor5-widget 41.4.0-alpha.0 → 41.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/dist/index.js +7 -3
  2. package/dist/index.js.map +1 -1
  3. package/dist/translations/ar.umd.js +11 -0
  4. package/dist/translations/az.umd.js +11 -0
  5. package/dist/translations/bg.umd.js +11 -0
  6. package/dist/translations/bn.umd.js +11 -0
  7. package/dist/translations/ca.umd.js +11 -0
  8. package/dist/translations/cs.umd.js +11 -0
  9. package/dist/translations/da.umd.js +11 -0
  10. package/dist/translations/de-ch.umd.js +11 -0
  11. package/dist/translations/de.umd.js +11 -0
  12. package/dist/translations/el.umd.js +11 -0
  13. package/dist/translations/en-au.umd.js +11 -0
  14. package/dist/translations/en.umd.js +11 -0
  15. package/dist/translations/es.umd.js +11 -0
  16. package/dist/translations/et.umd.js +11 -0
  17. package/dist/translations/fa.umd.js +11 -0
  18. package/dist/translations/fi.umd.js +11 -0
  19. package/dist/translations/fr.umd.js +11 -0
  20. package/dist/translations/gl.umd.js +11 -0
  21. package/dist/translations/he.umd.js +11 -0
  22. package/dist/translations/hi.umd.js +11 -0
  23. package/dist/translations/hr.umd.js +11 -0
  24. package/dist/translations/hu.umd.js +11 -0
  25. package/dist/translations/id.umd.js +11 -0
  26. package/dist/translations/it.umd.js +11 -0
  27. package/dist/translations/ja.umd.js +11 -0
  28. package/dist/translations/ko.umd.js +11 -0
  29. package/dist/translations/ku.umd.js +11 -0
  30. package/dist/translations/lt.umd.js +11 -0
  31. package/dist/translations/lv.umd.js +11 -0
  32. package/dist/translations/ms.umd.js +11 -0
  33. package/dist/translations/nl.umd.js +11 -0
  34. package/dist/translations/no.umd.js +11 -0
  35. package/dist/translations/pl.umd.js +11 -0
  36. package/dist/translations/pt-br.umd.js +11 -0
  37. package/dist/translations/pt.umd.js +11 -0
  38. package/dist/translations/ro.umd.js +11 -0
  39. package/dist/translations/ru.umd.js +11 -0
  40. package/dist/translations/sk.umd.js +11 -0
  41. package/dist/translations/sq.umd.js +11 -0
  42. package/dist/translations/sr-latn.umd.js +11 -0
  43. package/dist/translations/sr.umd.js +11 -0
  44. package/dist/translations/sv.umd.js +11 -0
  45. package/dist/translations/th.umd.js +11 -0
  46. package/dist/translations/tk.umd.js +11 -0
  47. package/dist/translations/tr.umd.js +11 -0
  48. package/dist/translations/uk.umd.js +11 -0
  49. package/dist/translations/ur.umd.js +11 -0
  50. package/dist/translations/uz.umd.js +11 -0
  51. package/dist/translations/vi.umd.js +11 -0
  52. package/dist/translations/zh-cn.umd.js +11 -0
  53. package/dist/translations/zh.umd.js +11 -0
  54. package/dist/types/utils.d.ts +1 -1
  55. package/package.json +7 -7
  56. package/src/utils.d.ts +1 -1
  57. 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
- * **Note**: This helper searches up to 5 levels of ancestors only.
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 = parseFloat(domResizeHostParent.ownerDocument.defaultView.getComputedStyle(domResizeHostParent).width);
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 = parseFloat(domResizeHostParent.ownerDocument.defaultView.getComputedStyle(checkedElement).width);
476
+ parentWidth = getElementComputedWidth(checkedElement);
473
477
  }
474
478
  return parentWidth;
475
479
  }