@flozy/editor 9.2.3 → 9.2.5
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.
@@ -12,9 +12,30 @@ import TablePopup from "./TablePopup";
|
|
12
12
|
import { Droppable } from "./Droppable";
|
13
13
|
import { useDndContext } from "@dnd-kit/core";
|
14
14
|
import { getNodeWithType } from "../../utils/helper";
|
15
|
+
import { isEmptyTextNode } from "../../helper";
|
16
|
+
import SimpleText from "../SimpleText";
|
15
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
18
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
17
19
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
20
|
+
const withOldTableData = WrappedComponent => {
|
21
|
+
// to prevent old table data issues, ("table-cell" node is coming without parent "table" node (FS-9330))
|
22
|
+
return function TableHOC(props) {
|
23
|
+
const tableData = useTable();
|
24
|
+
if (!tableData) {
|
25
|
+
const {
|
26
|
+
element
|
27
|
+
} = props;
|
28
|
+
const isEmpty = isEmptyTextNode(element);
|
29
|
+
return /*#__PURE__*/_jsx(SimpleText, {
|
30
|
+
...props,
|
31
|
+
isEmpty: isEmpty
|
32
|
+
});
|
33
|
+
}
|
34
|
+
return /*#__PURE__*/_jsx(WrappedComponent, {
|
35
|
+
...props
|
36
|
+
});
|
37
|
+
};
|
38
|
+
};
|
18
39
|
const Resizer = ({
|
19
40
|
classes,
|
20
41
|
onMouseDown,
|
@@ -455,4 +476,4 @@ const TableCell = props => {
|
|
455
476
|
}) : null]
|
456
477
|
});
|
457
478
|
};
|
458
|
-
export default TableCell;
|
479
|
+
export default withOldTableData(TableCell);
|