@flozy/editor 9.4.3 → 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.
@@ -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";
|
@@ -449,16 +449,19 @@ const FreeGrid = props => {
|
|
449
449
|
}
|
450
450
|
}, theme);
|
451
451
|
const sectionTypeOptions = (itemOptions?.section || []).filter(f => (hideTools || []).indexOf(f) === -1);
|
452
|
-
const id = useMemo(() => {
|
453
|
-
let eleId = `freegrid_container_${path.join("|")}_${breakpoint}`;
|
454
|
-
if (autoAlign) {
|
455
|
-
eleId += `_${updated_at}`; // re-render component on force auto align
|
456
|
-
}
|
457
452
|
|
458
|
-
|
459
|
-
|
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
|
+
|
460
463
|
return /*#__PURE__*/_jsx(RnD, {
|
461
|
-
id:
|
464
|
+
id: `freegrid_container_${path.join("|")}_${updated_at}_${breakpoint}`,
|
462
465
|
className: `
|
463
466
|
freegrid-section breakpoint-${breakpoint}
|
464
467
|
freegrid-section_${path.join("_")}
|
@@ -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
|
|