@flozy/editor 9.4.2 → 9.4.4
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/dist/Editor/CommonEditor.js +3 -1
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +14 -9
- package/dist/Editor/Elements/Table/Table.js +10 -6
- package/dist/Editor/Elements/Table/TableCell.js +1 -1
- package/dist/Editor/Toolbar/PopupTool/index.js +6 -0
- package/dist/Editor/utils/helper.js +4 -1
- package/package.json +1 -1
@@ -357,7 +357,9 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
|
|
357
357
|
const handleEditorChange = newValue => {
|
358
358
|
if (JSON.stringify(newValue) !== JSON.stringify(debouncedValue?.current)) {
|
359
359
|
updateTopBanner(newValue, setTopBanner);
|
360
|
-
|
360
|
+
if (onSave && !readOnly) {
|
361
|
+
debounced(newValue);
|
362
|
+
}
|
361
363
|
if (!isInteracted) {
|
362
364
|
// setIsInteracted(true);
|
363
365
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, { useEffect,
|
1
|
+
import React, { useEffect, useRef } from "react";
|
2
2
|
import { Path, Transforms, Node } from "slate";
|
3
3
|
import { ReactEditor, useSlateStatic } from "slate-react";
|
4
4
|
import { Box, useTheme } from "@mui/material";
|
@@ -366,6 +366,8 @@ const FreeGrid = props => {
|
|
366
366
|
default:
|
367
367
|
}
|
368
368
|
if (breakpoint === "lg") {
|
369
|
+
setSelectedElement({});
|
370
|
+
|
369
371
|
// auto align in mobile
|
370
372
|
Transforms.setNodes(editor, {
|
371
373
|
xs_updatedOn: null,
|
@@ -447,16 +449,19 @@ const FreeGrid = props => {
|
|
447
449
|
}
|
448
450
|
}, theme);
|
449
451
|
const sectionTypeOptions = (itemOptions?.section || []).filter(f => (hideTools || []).indexOf(f) === -1);
|
450
|
-
const id = useMemo(() => {
|
451
|
-
let eleId = `freegrid_container_${path.join("|")}_${breakpoint}`;
|
452
|
-
if (autoAlign) {
|
453
|
-
eleId += `_${updated_at}`; // re-render component on force auto align
|
454
|
-
}
|
455
452
|
|
456
|
-
|
457
|
-
|
453
|
+
// const id = useMemo(() => {
|
454
|
+
// let eleId = `freegrid_container_${path.join("|")}_${breakpoint}`;
|
455
|
+
|
456
|
+
// if (autoAlign) {
|
457
|
+
// eleId += `_${updated_at}`; // re-render component on force auto align
|
458
|
+
// }
|
459
|
+
|
460
|
+
// return eleId;
|
461
|
+
// }, [autoAlign, updated_at, breakpoint, path]);
|
462
|
+
|
458
463
|
return /*#__PURE__*/_jsx(RnD, {
|
459
|
-
id:
|
464
|
+
id: `freegrid_container_${path.join("|")}_${updated_at}_${breakpoint}`,
|
460
465
|
className: `
|
461
466
|
freegrid-section breakpoint-${breakpoint}
|
462
467
|
freegrid-section_${path.join("_")}
|
@@ -67,7 +67,8 @@ const MoreTableSettings = props => {
|
|
67
67
|
sx: classes.mobileToolDrawer,
|
68
68
|
children: /*#__PURE__*/_jsx(ToolTableComponent, {
|
69
69
|
handleAction: handleAction,
|
70
|
-
editorTheme: editorTheme
|
70
|
+
editorTheme: editorTheme,
|
71
|
+
translation: translation
|
71
72
|
})
|
72
73
|
})
|
73
74
|
}) : /*#__PURE__*/_jsx(Popper, {
|
@@ -99,7 +100,8 @@ const ToolBar = props => {
|
|
99
100
|
handleAction,
|
100
101
|
exandTools,
|
101
102
|
openSetttings,
|
102
|
-
hideTools
|
103
|
+
hideTools,
|
104
|
+
translation
|
103
105
|
} = props;
|
104
106
|
const {
|
105
107
|
getSelectedCells
|
@@ -112,7 +114,7 @@ const ToolBar = props => {
|
|
112
114
|
sx: classes.tableToolBar,
|
113
115
|
children: !hideTools.includes("settings") ? /*#__PURE__*/_jsxs(_Fragment, {
|
114
116
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
115
|
-
title: "Settings",
|
117
|
+
title: translation("Settings"),
|
116
118
|
arrow: true,
|
117
119
|
onClick: () => handleAction("settings"),
|
118
120
|
children: /*#__PURE__*/_jsx(IconButton, {
|
@@ -120,7 +122,7 @@ const ToolBar = props => {
|
|
120
122
|
children: /*#__PURE__*/_jsx(SettingsIcon, {})
|
121
123
|
})
|
122
124
|
}), /*#__PURE__*/_jsx(Tooltip, {
|
123
|
-
title: "Show Tools",
|
125
|
+
title: translation("Show Tools"),
|
124
126
|
arrow: true,
|
125
127
|
onClick: handleExpand,
|
126
128
|
children: /*#__PURE__*/_jsx(IconButton, {
|
@@ -154,7 +156,8 @@ const Table = props => {
|
|
154
156
|
const {
|
155
157
|
readOnly,
|
156
158
|
isMobile,
|
157
|
-
hideTools = []
|
159
|
+
hideTools = [],
|
160
|
+
translation
|
158
161
|
} = customProps;
|
159
162
|
const [openSetttings, setOpenSettings] = useState(false);
|
160
163
|
const [exandTools, setExpandTools] = useState(null);
|
@@ -342,7 +345,8 @@ const Table = props => {
|
|
342
345
|
handleAction: handleAction,
|
343
346
|
exandTools: exandTools,
|
344
347
|
openSetttings: openSetttings,
|
345
|
-
hideTools: hideTools
|
348
|
+
hideTools: hideTools,
|
349
|
+
translation: translation
|
346
350
|
}), /*#__PURE__*/_jsx(MoreTableSettings, {
|
347
351
|
exandTools: exandTools,
|
348
352
|
handleAction: handleAction,
|
@@ -287,7 +287,7 @@ const TableCell = props => {
|
|
287
287
|
minWidth: width,
|
288
288
|
maxWidth: width
|
289
289
|
};
|
290
|
-
const cellBorderColor = borderColor || rowProps?.borderColor || parentProps?.borderColor
|
290
|
+
const cellBorderColor = borderColor || entireBorderColor || rowProps?.borderColor || parentProps?.borderColor;
|
291
291
|
const selectCurrentCell = () => {
|
292
292
|
const cellPath = Editor.start(editor, path);
|
293
293
|
const selection = {
|
@@ -11,6 +11,9 @@ import useEditorScroll from "../../hooks/useEditorScroll";
|
|
11
11
|
import { isCarouselSelected } from "../../helper";
|
12
12
|
import { hideSlateSelection } from "../../utils/helper";
|
13
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
14
|
+
const isSlateDOM = event => {
|
15
|
+
return event.target.getAttribute("data-slate-string") === "true";
|
16
|
+
};
|
14
17
|
const PopupTool = props => {
|
15
18
|
const {
|
16
19
|
theme,
|
@@ -100,6 +103,9 @@ const PopupTool = props => {
|
|
100
103
|
onClickAway: e => {
|
101
104
|
// close the mini toolbar, if user clicks outside the editor (in Flozy app.)
|
102
105
|
|
106
|
+
if (isSlateDOM(e)) {
|
107
|
+
return;
|
108
|
+
}
|
103
109
|
const wrapper = document.getElementById("slate-wrapper-scroll-container");
|
104
110
|
const isInsideWrapper = wrapper && wrapper.contains(e.target);
|
105
111
|
if (isInsideWrapper) {
|
@@ -691,7 +691,10 @@ export const isRestrictedNode = (event, editor) => {
|
|
691
691
|
});
|
692
692
|
|
693
693
|
// Move focus to the modified paragraph (same path)
|
694
|
-
|
694
|
+
const startPoint = Editor.start(editor, path);
|
695
|
+
if (startPoint) {
|
696
|
+
Transforms.select(editor, startPoint);
|
697
|
+
}
|
695
698
|
} else if (isRestricted(previousNode)) {
|
696
699
|
event.preventDefault(); // stops deleting backward
|
697
700
|
|