@flozy/editor 10.3.3 → 10.3.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.
- package/dist/Editor/Elements/Form/Form.js +3 -1
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +1 -0
- package/dist/Editor/Elements/FreeGrid/helper.js +3 -1
- package/dist/Editor/common/RnD/VirtualElement/helper.js +6 -5
- package/dist/Editor/common/RnD/index.js +32 -28
- package/dist/Editor/helper/index.js +1 -1
- package/dist/Editor/utils/formfield.js +1 -0
- package/package.json +1 -1
@@ -159,7 +159,8 @@ const Form = props => {
|
|
159
159
|
[pair[0]]: pair[1],
|
160
160
|
placeholder: placeholder,
|
161
161
|
form_name: formName,
|
162
|
-
tagName: tagName
|
162
|
+
tagName: tagName,
|
163
|
+
uid: fieldData?.uid
|
163
164
|
});
|
164
165
|
}
|
165
166
|
let params = {
|
@@ -414,6 +415,7 @@ const Form = props => {
|
|
414
415
|
lineHeight: 1.43,
|
415
416
|
...formSX
|
416
417
|
},
|
418
|
+
ref: formEle,
|
417
419
|
children: [/*#__PURE__*/_jsx(Grid, {
|
418
420
|
className: "form-grid",
|
419
421
|
item: true,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { ROW_HEIGHT } from "../../common/RnD/Utils/gridDropItem";
|
2
2
|
import { getElementOffset } from "../../common/RnD/VirtualElement/VirtualTextElement";
|
3
|
+
import { RND_ITEMS } from "../../helper";
|
3
4
|
export const ELEMENT_CASE = {
|
4
5
|
ADD_TEXT: "addText",
|
5
6
|
ADD_BUTTON: "addButton",
|
@@ -69,7 +70,8 @@ const elementXsValues = {
|
|
69
70
|
export const findMaxYValue = (sectionItems, breakpoint) => {
|
70
71
|
let maxY = 0;
|
71
72
|
sectionItems.forEach(item => {
|
72
|
-
|
73
|
+
const isHidden = breakpoint === "xs" && item.children.some(c => c.xsHidden);
|
74
|
+
if (item?.type && RND_ITEMS.includes(item.type) && !isHidden) {
|
73
75
|
const {
|
74
76
|
bottom
|
75
77
|
} = getElementOffset(item, breakpoint === "lg" ? "lg" : "xs");
|
@@ -3,6 +3,7 @@ import { Transforms, Editor } from "slate";
|
|
3
3
|
import { getElementOffset } from "./VirtualTextElement";
|
4
4
|
import { getNode } from "../../../utils/helper";
|
5
5
|
import { findMaxYValue } from "../../../Elements/FreeGrid/helper";
|
6
|
+
import { RND_ITEMS } from "../../../helper";
|
6
7
|
const isBulletOrTickIcon = (width, itemStartRow, startRow) => {
|
7
8
|
return width <= 40 && itemStartRow === startRow;
|
8
9
|
};
|
@@ -223,8 +224,7 @@ export const moveOverlappedItems = (editor, moveRows, containerItems, containerP
|
|
223
224
|
if (isChildEle) {
|
224
225
|
return;
|
225
226
|
}
|
226
|
-
if (gridItem.type
|
227
|
-
// some empty paragraph node is inserted default'ly inside box, to avoid that
|
227
|
+
if (!RND_ITEMS.includes(gridItem.type)) {
|
228
228
|
return;
|
229
229
|
}
|
230
230
|
const {
|
@@ -251,7 +251,7 @@ export const causeOverlap = (container, currElementPath, updateBreakpoint, newTo
|
|
251
251
|
const [containerNode, containerPath] = container;
|
252
252
|
let isOverlapped = false;
|
253
253
|
containerNode.children.forEach((item, index) => {
|
254
|
-
if (item.type
|
254
|
+
if (!RND_ITEMS.includes(item.type)) {
|
255
255
|
return;
|
256
256
|
}
|
257
257
|
const currPath = [...containerPath, index];
|
@@ -286,7 +286,7 @@ export const alignElementsInsideContainer = (container, currentElement, heightDi
|
|
286
286
|
|
287
287
|
// find the elements present after the current element
|
288
288
|
containerNode.children.forEach((item, index) => {
|
289
|
-
if (item.type
|
289
|
+
if (!RND_ITEMS.includes(item.type)) {
|
290
290
|
return;
|
291
291
|
}
|
292
292
|
const currPath = [...containerPath, index];
|
@@ -378,6 +378,7 @@ export const updateContainer = (editor, alignElements, container, updateBreakpoi
|
|
378
378
|
}, {
|
379
379
|
at: containerPath
|
380
380
|
});
|
381
|
+
currHeightDiff += 12;
|
381
382
|
}
|
382
383
|
return currHeightDiff;
|
383
384
|
};
|
@@ -396,7 +397,7 @@ export const handleContainersAlignment = (editor, containers, heightDiff, buffer
|
|
396
397
|
if (currPath.toString() === childContainerPath.toString()) {
|
397
398
|
return;
|
398
399
|
}
|
399
|
-
if (item.type
|
400
|
+
if (!RND_ITEMS.includes(item.type)) {
|
400
401
|
return;
|
401
402
|
}
|
402
403
|
const {
|
@@ -77,7 +77,8 @@ const RnD = props => {
|
|
77
77
|
autoAlign,
|
78
78
|
setAutoAlign,
|
79
79
|
isBoxHeader,
|
80
|
-
customProps
|
80
|
+
customProps,
|
81
|
+
xsHidden
|
81
82
|
} = props;
|
82
83
|
const {
|
83
84
|
isSelectedElement,
|
@@ -141,7 +142,8 @@ const RnD = props => {
|
|
141
142
|
setAbsPosition({});
|
142
143
|
}
|
143
144
|
}
|
144
|
-
const
|
145
|
+
const currElement = getCurrentEle();
|
146
|
+
const textElement = currElement?.querySelector(".fgi_type_text > .simple-text, .fgi_type_text");
|
145
147
|
if (breakpoint && textElement && childType === "text" && !enable) {
|
146
148
|
timerId.current = setTimeout(() => {
|
147
149
|
const {
|
@@ -653,32 +655,34 @@ const RnD = props => {
|
|
653
655
|
"data-dragoverid": str_path,
|
654
656
|
"data-dragovertype": type
|
655
657
|
}) : null]
|
656
|
-
}, eId),
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
658
|
+
}, eId), xsHidden && breakpoint === "xs" ? null : /*#__PURE__*/_jsxs(_Fragment, {
|
659
|
+
children: [/*#__PURE__*/_jsx(ElementSettings, {
|
660
|
+
open: Boolean(currentAction),
|
661
|
+
currentAction: currentAction,
|
662
|
+
anchorEl: rndRef?.current,
|
663
|
+
placement: "right-start",
|
664
|
+
onClose: onCloseSettings,
|
665
|
+
childType: childType,
|
666
|
+
editor: editor,
|
667
|
+
path: sp,
|
668
|
+
...settingsProps,
|
669
|
+
elementProps: elementProps,
|
670
|
+
theme: theme
|
671
|
+
}), !active && rndRef?.current && open && !isInteracting ? /*#__PURE__*/_jsx(ElementOptions, {
|
672
|
+
id: `opt_ref_${str_path}`,
|
673
|
+
open: open,
|
674
|
+
anchorEl: rndRef?.current,
|
675
|
+
enable: enable,
|
676
|
+
handleAction: handleAction,
|
677
|
+
actions: actions,
|
678
|
+
actionsMap: actionsMap,
|
679
|
+
optionsProps: optionsProps,
|
680
|
+
selectedAction: currentAction,
|
681
|
+
path: str_path,
|
682
|
+
theme: theme,
|
683
|
+
translation: translation,
|
684
|
+
customProps: customProps
|
685
|
+
}) : null]
|
682
686
|
}), dragInfoOpen ? /*#__PURE__*/_jsx(DragInfo, {
|
683
687
|
anchorEl: rndRef?.current,
|
684
688
|
open: dragInfoOpen,
|
@@ -7,7 +7,7 @@ import { Node } from "slate";
|
|
7
7
|
const HIDE_PLACHOLDERS = ["grid", "grid-item", "table"];
|
8
8
|
const TEXT_NODES = ["paragraph", "headingOne", "headingTwo", "headingThree"];
|
9
9
|
const PREVIEW_IMAGE_HIDE_CLASS = ["grid-container-toolbar", "grid-item-toolbar", "element-toolbar", "mini-tool-wrpr-ei", "element-selector", "element-selector-ctrl"];
|
10
|
-
const RND_ITEMS = ["freegridItem", "freegridBox"];
|
10
|
+
export const RND_ITEMS = ["freegridItem", "freegridBox"];
|
11
11
|
export const getThumbnailImage = async (dom, options = {}) => {
|
12
12
|
try {
|
13
13
|
const canvas = await html2canvas(dom, {
|