@flozy/editor 10.6.2 → 10.6.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.
@@ -32,12 +32,17 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
32
32
  function getTextElementHeight(textElement) {
33
33
  let totalHeight = 0;
34
34
  if (textElement) {
35
- textElement.childNodes.forEach(node => {
36
- if (node.textContent.trim()) {
37
- const el = node;
35
+ const {
36
+ childNodes
37
+ } = textElement || {};
38
+ for (let i = childNodes.length - 1; i >= 0; i--) {
39
+ const el = childNodes[i];
40
+ const text = el.textContent?.replace(/\n/g, "")?.trim();
41
+ if (text || totalHeight) {
42
+ // remove last empty spaces
38
43
  totalHeight += el.offsetHeight || el.getBoundingClientRect().height;
39
44
  }
40
- });
45
+ }
41
46
  }
42
47
  return totalHeight;
43
48
  }
@@ -158,11 +163,8 @@ const RnD = props => {
158
163
  const textElement = currElement?.querySelector(".fgi_type_text");
159
164
  if (breakpoint && textElement && childType === "text" && !enable) {
160
165
  timerId.current = setTimeout(() => {
161
- const {
162
- clientHeight
163
- } = textElement;
164
- // const clientHeight = getTextElementHeight(textElement);
165
-
166
+ // const { clientHeight } = textElement;
167
+ const clientHeight = getTextElementHeight(textElement);
166
168
  const {
167
169
  height
168
170
  } = delta || {};
@@ -14,7 +14,7 @@ export const getThumbnailImage = async (dom, options = {}) => {
14
14
  windowWidth: 1440,
15
15
  windowHeight: 768,
16
16
  ...options,
17
- backgroundColor: null,
17
+ backgroundColor: '#FFFFFF',
18
18
  allowTaint: true,
19
19
  useCORS: false,
20
20
  scale: 0.5,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "10.6.2",
3
+ "version": "10.6.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"