@flozy/editor 10.2.3 → 10.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.
- package/dist/Editor/ChatEditor.js +16 -17
- package/dist/Editor/CommonEditor.js +24 -128
- package/dist/Editor/DialogWrapper.js +25 -31
- package/dist/Editor/Editor.css +8 -46
- package/dist/Editor/Elements/AI/PopoverAIInput.js +3 -11
- package/dist/Editor/Elements/Accordion/Accordion.js +2 -6
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +9 -25
- package/dist/Editor/Elements/Carousel/CarouselItem.js +1 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -61
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +7 -10
- package/dist/Editor/Elements/Color Picker/Styles.js +13 -15
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +2 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +6 -21
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +2 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +2 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +0 -11
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +4 -8
- package/dist/Editor/Elements/Embed/Image.js +2 -3
- package/dist/Editor/Elements/Embed/Video.js +1 -1
- package/dist/Editor/Elements/EmbedScript/Code.js +2 -14
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +28 -57
- package/dist/Editor/Elements/Form/Form.js +168 -181
- package/dist/Editor/Elements/Form/FormElements/FormText.js +6 -23
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +2 -3
- package/dist/Editor/Elements/Form/FormField.js +6 -13
- package/dist/Editor/Elements/Form/Workflow/Styles.js +22 -24
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +31 -36
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -7
- package/dist/Editor/Elements/FreeGrid/Options/More.js +8 -8
- package/dist/Editor/Elements/FreeGrid/styles.js +7 -75
- package/dist/Editor/Elements/Grid/Grid.js +2 -14
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- package/dist/Editor/Elements/List/CheckList.js +2 -3
- package/dist/Editor/Elements/Search/SearchAttachment.js +9 -40
- package/dist/Editor/Elements/Search/SearchButton.js +8 -9
- package/dist/Editor/Elements/Search/SearchList.js +7 -9
- package/dist/Editor/Elements/Signature/Signature.css +1 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +5 -18
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +3 -16
- package/dist/Editor/Elements/SimpleText/index.js +1 -6
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/DragButton.js +1 -0
- package/dist/Editor/Elements/Table/Draggable.js +2 -6
- package/dist/Editor/Elements/Table/Styles.js +0 -7
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Table/TableCell.js +5 -24
- package/dist/Editor/Elements/Title/title.js +6 -6
- package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
- package/dist/Editor/MiniEditor.js +1 -2
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +3 -4
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -10
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +1 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +2 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +42 -167
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -7
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +1 -2
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +12 -72
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +27 -100
- package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
- package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
- package/dist/Editor/assets/svg/SettingsIcon.js +0 -1
- package/dist/Editor/common/ColorPickerButton.js +16 -38
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +15 -31
- package/dist/Editor/common/Icon.js +1 -31
- package/dist/Editor/common/ImageSelector/Styles.js +9 -3
- package/dist/Editor/common/LinkSettings/NavComponents.js +8 -34
- package/dist/Editor/common/LinkSettings/index.js +68 -84
- package/dist/Editor/common/LinkSettings/style.js +30 -245
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +14 -13
- package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +0 -1
- package/dist/Editor/common/RnD/ElementOptions/index.js +2 -2
- package/dist/Editor/common/RnD/ElementOptions/styles.js +1 -28
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +5 -6
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Signature.js +3 -4
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +2 -4
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +1 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
- package/dist/Editor/common/RnD/ElementSettings/styles.js +12 -147
- package/dist/Editor/common/RnD/OptionsPopup/index.js +5 -8
- package/dist/Editor/common/RnD/OptionsPopup/style.js +19 -121
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +5 -8
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +3 -6
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +19 -28
- package/dist/Editor/common/RnD/Utils/index.js +1 -3
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +54 -48
- package/dist/Editor/common/RnD/VirtualElement/helper.js +131 -143
- package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -16
- package/dist/Editor/common/RnD/index.js +11 -6
- package/dist/Editor/common/Select/index.js +0 -2
- package/dist/Editor/common/Shorthands/elements.js +11 -65
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +0 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +2 -12
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +8 -16
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +10 -36
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +7 -16
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +6 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +6 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +7 -15
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
- package/dist/Editor/common/Uploader.js +0 -8
- package/dist/Editor/common/iconListV2.js +6 -156
- package/dist/Editor/common/iconslist.js +0 -24
- package/dist/Editor/commonStyle.js +62 -168
- package/dist/Editor/helper/index.js +0 -4
- package/dist/Editor/helper/theme.js +2 -203
- package/dist/Editor/hooks/useMouseMove.js +5 -8
- package/dist/Editor/hooks/useTable.js +4 -5
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +1 -3
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +45 -169
- package/dist/Editor/utils/accordion.js +4 -14
- package/dist/Editor/utils/button.js +17 -1
- package/dist/Editor/utils/customHooks/useTableResize.js +9 -49
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/events.js +6 -50
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/form.js +4 -4
- package/dist/Editor/utils/formfield.js +2 -8
- package/dist/Editor/utils/helper.js +19 -109
- package/dist/Editor/utils/signature.js +9 -2
- package/package.json +4 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -454
- package/dist/Editor/Elements/EmbedScript/styles.js +0 -89
- package/dist/Editor/Elements/FreeGrid/helper.js +0 -113
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -439
- package/dist/Editor/assets/svg/BackIcon.js +0 -18
- package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
- package/dist/Editor/assets/svg/ResetIconNew.js +0 -23
- package/dist/Editor/assets/svg/ThemeIcons.js +0 -293
- package/dist/Editor/common/CustomColorPicker/index.js +0 -130
- package/dist/Editor/common/CustomColorPicker/style.js +0 -53
- package/dist/Editor/common/CustomDialog2/index.js +0 -94
- package/dist/Editor/common/CustomDialog2/style.js +0 -67
- package/dist/Editor/common/CustomSelect.js +0 -43
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +0 -17
- package/dist/Editor/common/SnackBar/index.js +0 -43
- package/dist/Editor/helper/textIndeces.js +0 -58
- package/dist/Editor/hooks/useEditorTheme.js +0 -153
- package/dist/Editor/hooks/useThemeValues.js +0 -63
- package/dist/Editor/theme/index.js +0 -149
- package/dist/Editor/themeSettings/ActiveTheme.js +0 -82
- package/dist/Editor/themeSettings/buttons/index.js +0 -300
- package/dist/Editor/themeSettings/buttons/style.js +0 -23
- package/dist/Editor/themeSettings/colorTheme/index.js +0 -310
- package/dist/Editor/themeSettings/colorTheme/style.js +0 -81
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -121
- package/dist/Editor/themeSettings/fonts/index.js +0 -240
- package/dist/Editor/themeSettings/fonts/style.js +0 -62
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -361
- package/dist/Editor/themeSettings/style.js +0 -299
- package/dist/Editor/themeSettingsAI/icons.js +0 -96
- package/dist/Editor/themeSettingsAI/index.js +0 -355
- package/dist/Editor/themeSettingsAI/saveTheme.js +0 -202
- package/dist/Editor/themeSettingsAI/style.js +0 -332
@@ -1,6 +1,5 @@
|
|
1
1
|
import { ROW_HEIGHT, calculateGridArea } from "../Utils/gridDropItem";
|
2
2
|
import { Transforms, Editor } from "slate";
|
3
|
-
import { getElementOffset } from "./VirtualTextElement";
|
4
3
|
const isBulletOrTickIcon = (width, itemStartRow, startRow) => {
|
5
4
|
return width <= 40 && itemStartRow === startRow;
|
6
5
|
};
|
@@ -40,83 +39,106 @@ export const getGridArea = gridArea => {
|
|
40
39
|
const getBoxToAutoAlign = (editor, sectionPath) => {
|
41
40
|
const [boxData] = Editor.nodes(editor, {
|
42
41
|
at: sectionPath,
|
43
|
-
match: node =>
|
42
|
+
match: node => node.type === "freegridBox" && node.autoAlign
|
44
43
|
});
|
45
44
|
return boxData || [];
|
46
45
|
};
|
46
|
+
const handleGridItems = (gridItems, lastRow) => {
|
47
|
+
// to find the previously occupied rows
|
48
|
+
gridItems.forEach(item => {
|
49
|
+
const {
|
50
|
+
gridArea_xs: gridArea,
|
51
|
+
marginTop_xs,
|
52
|
+
height_xs,
|
53
|
+
type
|
54
|
+
} = item;
|
55
|
+
if (type === "paragraph") {
|
56
|
+
// non-freegridItem,
|
57
|
+
// some "paragraph" node is defaulty coming inside in box's children
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
const [startRow] = getGridArea(gridArea);
|
61
|
+
const marginTop = marginTop_xs ? Number(marginTop_xs) : 0;
|
62
|
+
const fullHeight = Number(height_xs) + marginTop;
|
63
|
+
const endRow = startRow + Math.floor(fullHeight / ROW_HEIGHT) + 1;
|
64
|
+
lastRow = Math.max(endRow, lastRow);
|
65
|
+
});
|
66
|
+
return {
|
67
|
+
lastRow
|
68
|
+
};
|
69
|
+
};
|
70
|
+
const handleNonGridItems = (nonGridItems, lastRow, editor, boxPath) => {
|
71
|
+
let containerHeight = (lastRow - 1) * ROW_HEIGHT;
|
72
|
+
let newlyAddedHeight = 0;
|
47
73
|
|
48
|
-
//
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
//
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
// newlyAddedHeight,
|
117
|
-
// };
|
118
|
-
// };
|
119
|
-
|
74
|
+
//place it on the next rows that are available
|
75
|
+
nonGridItems.forEach((item, index) => {
|
76
|
+
const {
|
77
|
+
height_xs,
|
78
|
+
type,
|
79
|
+
itemIndex
|
80
|
+
} = item;
|
81
|
+
if (type === "paragraph") {
|
82
|
+
// non-freegridItem
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
const startRow = lastRow || 1;
|
86
|
+
const DEFAULT_NEW_ELEMENT_MARGIN_TOP = 12;
|
87
|
+
let fullHeight = height_xs + DEFAULT_NEW_ELEMENT_MARGIN_TOP;
|
88
|
+
const endRow = startRow + Math.floor(fullHeight / ROW_HEIGHT) + 1;
|
89
|
+
const newGridArea = `${startRow} / 1 / ${startRow + 1} / 2`;
|
90
|
+
const currentElementPath = [...boxPath, itemIndex];
|
91
|
+
Transforms.setNodes(editor, {
|
92
|
+
gridArea_xs: newGridArea,
|
93
|
+
marginTop_xs: 12,
|
94
|
+
left_xs: 12,
|
95
|
+
xs_updatedOn: new Date().getTime()
|
96
|
+
}, {
|
97
|
+
at: currentElementPath
|
98
|
+
});
|
99
|
+
lastRow = Math.max(endRow, lastRow);
|
100
|
+
containerHeight += fullHeight;
|
101
|
+
newlyAddedHeight += fullHeight;
|
102
|
+
});
|
103
|
+
return {
|
104
|
+
lastRow,
|
105
|
+
containerHeight,
|
106
|
+
newlyAddedHeight
|
107
|
+
};
|
108
|
+
};
|
109
|
+
const alignNewElementInContainer = (editor, boxPath, containerItems) => {
|
110
|
+
let lastRow = 1;
|
111
|
+
const gridItems = [];
|
112
|
+
const nonGridItems = [];
|
113
|
+
containerItems.forEach((item, index) => {
|
114
|
+
if (item?.gridArea_xs) {
|
115
|
+
gridItems.push({
|
116
|
+
...item,
|
117
|
+
itemIndex: index
|
118
|
+
});
|
119
|
+
} else {
|
120
|
+
nonGridItems.push({
|
121
|
+
...item,
|
122
|
+
itemIndex: index
|
123
|
+
});
|
124
|
+
}
|
125
|
+
});
|
126
|
+
const {
|
127
|
+
lastRow: lastRowOccupied
|
128
|
+
} = handleGridItems(gridItems, lastRow);
|
129
|
+
lastRow = lastRowOccupied;
|
130
|
+
const {
|
131
|
+
lastRow: lastRowTaken,
|
132
|
+
containerHeight,
|
133
|
+
newlyAddedHeight
|
134
|
+
} = handleNonGridItems(nonGridItems, lastRow, editor, boxPath);
|
135
|
+
lastRow = lastRowTaken;
|
136
|
+
return {
|
137
|
+
lastRow,
|
138
|
+
containerHeight,
|
139
|
+
newlyAddedHeight
|
140
|
+
};
|
141
|
+
};
|
120
142
|
const getAncestorFreeGridContainers = (editor, path) => {
|
121
143
|
const containers = [...Editor.nodes(editor, {
|
122
144
|
at: path,
|
@@ -129,12 +151,6 @@ const getAncestorFreeGridContainers = (editor, path) => {
|
|
129
151
|
})].filter(([node, nodePath]) => nodePath.length <= path.length);
|
130
152
|
return containers;
|
131
153
|
};
|
132
|
-
export const handleTextAlignment = (editor, textNode, heightDiff) => {
|
133
|
-
const [, textPath] = textNode;
|
134
|
-
let containers = getAncestorFreeGridContainers(editor, textPath);
|
135
|
-
containers = [...containers, textNode];
|
136
|
-
handleContainersAlignment(editor, containers, heightDiff, 0);
|
137
|
-
};
|
138
154
|
export const handleContainers = (editor, boxPath, extraHeight) => {
|
139
155
|
const containers = getAncestorFreeGridContainers(editor, boxPath);
|
140
156
|
let lastChildStartRow;
|
@@ -197,7 +213,6 @@ export const moveOverlappedItems = (editor, moveRows, containerItems, containerP
|
|
197
213
|
return;
|
198
214
|
}
|
199
215
|
if (gridItem.type === "paragraph") {
|
200
|
-
// some empty paragraph node is inserted default'ly inside box, to avoid that
|
201
216
|
return;
|
202
217
|
}
|
203
218
|
const {
|
@@ -220,61 +235,7 @@ export const moveOverlappedItems = (editor, moveRows, containerItems, containerP
|
|
220
235
|
}
|
221
236
|
});
|
222
237
|
};
|
223
|
-
export const
|
224
|
-
for (let i = containers.length - 1; i >= 0; i--) {
|
225
|
-
const container = containers[i];
|
226
|
-
const childContainer = containers[i + 1];
|
227
|
-
const [containerNode, containerPath] = container;
|
228
|
-
const [childContainerNode, childContainerPath] = childContainer || [];
|
229
|
-
if (childContainer) {
|
230
|
-
const {
|
231
|
-
bottom
|
232
|
-
} = getElementOffset(childContainerNode);
|
233
|
-
containerNode.children.forEach((item, index) => {
|
234
|
-
const currPath = [...containerPath, index];
|
235
|
-
if (currPath.toString() === childContainerPath.toString()) {
|
236
|
-
return;
|
237
|
-
}
|
238
|
-
if (item.type === "paragraph") {
|
239
|
-
return;
|
240
|
-
}
|
241
|
-
const {
|
242
|
-
top: itemTop
|
243
|
-
} = getElementOffset(item);
|
244
|
-
if (itemTop >= bottom) {
|
245
|
-
const {
|
246
|
-
gridArea_xs,
|
247
|
-
marginTop_xs
|
248
|
-
} = item;
|
249
|
-
const [startRow] = getGridArea(gridArea_xs);
|
250
|
-
const y = (startRow - 1) * ROW_HEIGHT + marginTop_xs + heightDiff;
|
251
|
-
|
252
|
-
// Calculate grid position
|
253
|
-
const row = Math.floor(y / ROW_HEIGHT) + 1;
|
254
|
-
|
255
|
-
// to calculate difference inside the grid
|
256
|
-
const marginTop = Math.abs((row - 1) * ROW_HEIGHT - y);
|
257
|
-
|
258
|
-
// Update grid area
|
259
|
-
const gridArea = `${row} / 1 / ${row + 1} / 2`;
|
260
|
-
Transforms.setNodes(editor, {
|
261
|
-
gridArea_xs: gridArea,
|
262
|
-
marginTop_xs: marginTop + bufferSpace
|
263
|
-
}, {
|
264
|
-
at: currPath
|
265
|
-
});
|
266
|
-
}
|
267
|
-
});
|
268
|
-
}
|
269
|
-
Transforms.setNodes(editor, {
|
270
|
-
height_xs: containerNode?.height_xs + heightDiff + bufferSpace,
|
271
|
-
xs_updatedOn: new Date().getTime()
|
272
|
-
}, {
|
273
|
-
at: containerPath
|
274
|
-
});
|
275
|
-
}
|
276
|
-
};
|
277
|
-
export const handleBoxAlignment = (editor, sectionPath, heightDiff) => {
|
238
|
+
export const handleBoxAlignment = (editor, sectionNode, sectionPath) => {
|
278
239
|
const [boxNode, boxPath] = getBoxToAutoAlign(editor, sectionPath);
|
279
240
|
Transforms.setNodes(editor, {
|
280
241
|
autoAlign: false
|
@@ -284,11 +245,39 @@ export const handleBoxAlignment = (editor, sectionPath, heightDiff) => {
|
|
284
245
|
if (!boxNode) {
|
285
246
|
return;
|
286
247
|
}
|
287
|
-
|
288
|
-
|
248
|
+
const containerItems = boxNode?.children || [];
|
249
|
+
const {
|
250
|
+
containerHeight
|
251
|
+
} = alignNewElementInContainer(editor, boxPath, containerItems);
|
252
|
+
const bufferHeight = 12;
|
253
|
+
const newHeight = containerHeight + bufferHeight;
|
254
|
+
const {
|
255
|
+
height_xs
|
256
|
+
} = boxNode;
|
257
|
+
const oldHeight = Number(height_xs);
|
258
|
+
const extraHeight = newHeight - oldHeight;
|
259
|
+
if (extraHeight > 0) {
|
260
|
+
const containerData = handleContainers(editor, boxPath, extraHeight);
|
261
|
+
containerData.forEach(container => {
|
262
|
+
const {
|
263
|
+
moveRows,
|
264
|
+
containerNode,
|
265
|
+
containerPath,
|
266
|
+
newHeight,
|
267
|
+
childIndex,
|
268
|
+
lastChildStartRow
|
269
|
+
} = container;
|
270
|
+
if (moveRows) {
|
271
|
+
moveOverlappedItems(editor, moveRows, containerNode?.children, containerPath, childIndex, lastChildStartRow);
|
272
|
+
}
|
273
|
+
Transforms.setNodes(editor, {
|
274
|
+
height_xs: newHeight,
|
275
|
+
xs_updatedOn: new Date().getTime()
|
276
|
+
}, {
|
277
|
+
at: containerPath
|
278
|
+
});
|
279
|
+
});
|
289
280
|
}
|
290
|
-
let containers = getAncestorFreeGridContainers(editor, boxPath);
|
291
|
-
handleContainersAlignment(editor, containers, heightDiff, 12);
|
292
281
|
};
|
293
282
|
export const getMarginTop = y => {
|
294
283
|
const calcMargin = y % ROW_HEIGHT;
|
@@ -306,7 +295,7 @@ export const calculateProps = (curPath, dom, domClass, allData, parentDom, isBox
|
|
306
295
|
const itemsData = [];
|
307
296
|
const items = dom.querySelectorAll(domClass);
|
308
297
|
const nextItemPathLength = curPath?.split("|").length + 2;
|
309
|
-
|
298
|
+
let sectionHeight = 12;
|
310
299
|
for (let i = 0; i < items.length; i++) {
|
311
300
|
const itemRect = items[i]?.getBoundingClientRect();
|
312
301
|
if (items[i]?.classList.contains("type_box")) {
|
@@ -326,10 +315,9 @@ export const calculateProps = (curPath, dom, domClass, allData, parentDom, isBox
|
|
326
315
|
gridArea: calculateGridArea(y)
|
327
316
|
}
|
328
317
|
});
|
329
|
-
|
318
|
+
sectionHeight += itemRect?.height;
|
330
319
|
}
|
331
320
|
}
|
332
|
-
|
333
321
|
if (dom?.classList.contains("type_box") && parentDom) {
|
334
322
|
const parentDomRect = parentDom?.getBoundingClientRect();
|
335
323
|
const isAppHeader = isBoxHeader || dom?.classList.contains("appHeaderBox");
|
@@ -18,14 +18,6 @@ const useVirtualElementStyles = () => ({
|
|
18
18
|
"& .editor-blocker": {
|
19
19
|
display: "none"
|
20
20
|
},
|
21
|
-
"& .fgi_type_text": {
|
22
|
-
"& .edt-headings": {
|
23
|
-
margin: "0px"
|
24
|
-
},
|
25
|
-
"& .edt-paragraphs": {
|
26
|
-
margin: "0px"
|
27
|
-
}
|
28
|
-
},
|
29
21
|
"& .freegrid-item": {
|
30
22
|
position: "relative !important",
|
31
23
|
top: "0 !important",
|
@@ -105,14 +97,6 @@ export const useAutoAlignStyles = () => ({
|
|
105
97
|
"&.type_text": {
|
106
98
|
height: "auto !important"
|
107
99
|
},
|
108
|
-
"& .fgi_type_text": {
|
109
|
-
"& .edt-headings": {
|
110
|
-
margin: "0px"
|
111
|
-
},
|
112
|
-
"& .edt-paragraphs": {
|
113
|
-
margin: "0px"
|
114
|
-
}
|
115
|
-
},
|
116
100
|
// start - default signature classes on free-grid
|
117
101
|
"& .fgi_type_signature": {
|
118
102
|
height: "100%",
|
@@ -12,7 +12,7 @@ import GuideLines from "./GuideLines";
|
|
12
12
|
import ShadowElement from "./ShadowElement";
|
13
13
|
import BoundaryLine from "./GuideLines/BoundaryLine";
|
14
14
|
import ContextMenu from "./ContextMenu";
|
15
|
-
|
15
|
+
import VirtualElement from "./VirtualElement";
|
16
16
|
import { ItemTypes } from "./ElementSettings/settingsConstants";
|
17
17
|
import { selectText } from "../../utils/helper";
|
18
18
|
import { removeSign } from "./ElementSettings/OtherSettings";
|
@@ -127,7 +127,7 @@ const RnD = props => {
|
|
127
127
|
isInteracting,
|
128
128
|
handleStart,
|
129
129
|
handleStop
|
130
|
-
} = useFreeGrid();
|
130
|
+
} = useFreeGrid() || {};
|
131
131
|
const {
|
132
132
|
translation
|
133
133
|
} = customProps;
|
@@ -499,9 +499,7 @@ const RnD = props => {
|
|
499
499
|
ref
|
500
500
|
}, ".freegrid-container-parent");
|
501
501
|
const formatParentPath = parentPath?.split("|")?.map(m => parseInt(m));
|
502
|
-
|
503
|
-
reRenderChildNodes(editor, formatParentPath);
|
504
|
-
}
|
502
|
+
reRenderChildNodes(editor, formatParentPath);
|
505
503
|
};
|
506
504
|
const onCloseSettings = () => {
|
507
505
|
setSelectedElement({
|
@@ -683,7 +681,14 @@ const RnD = props => {
|
|
683
681
|
handleClose: handleClose,
|
684
682
|
theme: theme,
|
685
683
|
translation: translation
|
686
|
-
}),
|
684
|
+
}), type === "parent" && breakpoint === "lg" && !readOnly ? /*#__PURE__*/_jsx(VirtualElement, {
|
685
|
+
updated_at: updated_at,
|
686
|
+
path: str_path,
|
687
|
+
editor: editor,
|
688
|
+
sectionElement: sectionElement,
|
689
|
+
sectionCls: `.freegrid-section_${path.join("_")}`,
|
690
|
+
dataSets: dataSets
|
691
|
+
}) : null, childType === "text" && breakpoint === "lg" && !readOnly && enable ? /*#__PURE__*/_jsx(VirtualTextElement, {
|
687
692
|
editor: editor,
|
688
693
|
dataSets: dataSets,
|
689
694
|
getCurrentEle: getCurrentEle,
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Select as Core } from "@mui/material";
|
2
2
|
import SelectStyles from "./styles";
|
3
3
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
4
|
-
import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
5
|
function Select(props) {
|
7
6
|
const {
|
@@ -14,7 +13,6 @@ function Select(props) {
|
|
14
13
|
const classes = SelectStyles(theme);
|
15
14
|
return /*#__PURE__*/_jsx(Core, {
|
16
15
|
MenuProps: classes.MenuProps,
|
17
|
-
IconComponent: KeyboardArrowDownRoundedIcon,
|
18
16
|
...rest,
|
19
17
|
children: children
|
20
18
|
});
|
@@ -18,17 +18,6 @@ import SearchButton from "../../Elements/Search/SearchButton";
|
|
18
18
|
import canOpen from "../../helper/canOpen";
|
19
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
20
20
|
const ELEMENTS_LIST = [{
|
21
|
-
name: "Ask AI to write anything",
|
22
|
-
group: "Infinity AI",
|
23
|
-
desc: "",
|
24
|
-
type: "infinityAI",
|
25
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
26
|
-
icon: "infinityIcon"
|
27
|
-
}),
|
28
|
-
onInsert: editor => {
|
29
|
-
insertInfinityAI(editor);
|
30
|
-
}
|
31
|
-
}, {
|
32
21
|
name: "Heading 1",
|
33
22
|
desc: "",
|
34
23
|
group: "Text",
|
@@ -55,60 +44,6 @@ const ELEMENTS_LIST = [{
|
|
55
44
|
icon: "headingThree"
|
56
45
|
}),
|
57
46
|
onInsert: editor => toggleBlock(editor, "headingThree", false)
|
58
|
-
}, {
|
59
|
-
name: "Heading 4",
|
60
|
-
desc: "",
|
61
|
-
group: "Text",
|
62
|
-
type: "headingFour",
|
63
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
64
|
-
icon: "headingFour"
|
65
|
-
}),
|
66
|
-
onInsert: editor => toggleBlock(editor, "headingFour", false)
|
67
|
-
}, {
|
68
|
-
name: "Heading 5",
|
69
|
-
desc: "",
|
70
|
-
group: "Text",
|
71
|
-
type: "headingFive",
|
72
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
73
|
-
icon: "headingFive"
|
74
|
-
}),
|
75
|
-
onInsert: editor => toggleBlock(editor, "headingFive", false)
|
76
|
-
}, {
|
77
|
-
name: "Heading 6",
|
78
|
-
desc: "",
|
79
|
-
group: "Text",
|
80
|
-
type: "headingSix",
|
81
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
82
|
-
icon: "headingSix"
|
83
|
-
}),
|
84
|
-
onInsert: editor => toggleBlock(editor, "headingSix", false)
|
85
|
-
}, {
|
86
|
-
name: "Paragraph 1",
|
87
|
-
desc: "",
|
88
|
-
group: "Text",
|
89
|
-
type: "paragraphOne",
|
90
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
91
|
-
icon: "paragraphOne"
|
92
|
-
}),
|
93
|
-
onInsert: editor => toggleBlock(editor, "paragraphOne", false)
|
94
|
-
}, {
|
95
|
-
name: "Paragraph 2",
|
96
|
-
desc: "",
|
97
|
-
group: "Text",
|
98
|
-
type: "paragraphTwo",
|
99
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
100
|
-
icon: "paragraphTwo"
|
101
|
-
}),
|
102
|
-
onInsert: editor => toggleBlock(editor, "paragraphTwo", false)
|
103
|
-
}, {
|
104
|
-
name: "Paragraph 3",
|
105
|
-
desc: "",
|
106
|
-
group: "Text",
|
107
|
-
type: "paragraphThree",
|
108
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
109
|
-
icon: "paragraphThree"
|
110
|
-
}),
|
111
|
-
onInsert: editor => toggleBlock(editor, "paragraphThree", false)
|
112
47
|
}, {
|
113
48
|
name: "Quote",
|
114
49
|
desc: "",
|
@@ -341,6 +276,17 @@ const ELEMENTS_LIST = [{
|
|
341
276
|
onInsert: editor => {
|
342
277
|
insertForm(editor);
|
343
278
|
}
|
279
|
+
}, {
|
280
|
+
name: "Ask AI to write anything",
|
281
|
+
group: "Infinity AI",
|
282
|
+
desc: "",
|
283
|
+
type: "infinityAI",
|
284
|
+
icon: /*#__PURE__*/_jsx(Icon, {
|
285
|
+
icon: "infinityIcon"
|
286
|
+
}),
|
287
|
+
onInsert: editor => {
|
288
|
+
insertInfinityAI(editor);
|
289
|
+
}
|
344
290
|
}, {
|
345
291
|
name: "Dynamic Table",
|
346
292
|
group: "Dynamic Table",
|
@@ -21,8 +21,7 @@ const buttonStyle = [{
|
|
21
21
|
},
|
22
22
|
children: option.text
|
23
23
|
});
|
24
|
-
}
|
25
|
-
themeEnabled: true
|
24
|
+
}
|
26
25
|
}, {
|
27
26
|
label: "Font Size",
|
28
27
|
key: "textSize",
|
@@ -46,8 +45,7 @@ const buttonStyle = [{
|
|
46
45
|
}, {
|
47
46
|
label: "Button Color",
|
48
47
|
key: "bgColor",
|
49
|
-
type: "color"
|
50
|
-
themeEnabled: true
|
48
|
+
type: "color"
|
51
49
|
}, {
|
52
50
|
label: "Border Color",
|
53
51
|
key: "borderColor",
|
@@ -76,11 +76,6 @@ const BackgroundImage = props => {
|
|
76
76
|
children: translation("REMOVE")
|
77
77
|
}) : /*#__PURE__*/_jsx(Grid, {
|
78
78
|
className: "uploadImageText",
|
79
|
-
sx: {
|
80
|
-
padding: 0,
|
81
|
-
background: `${theme?.palette?.editor?.inputFieldBgColor}`,
|
82
|
-
border: `1px solid ${theme?.palette?.editor?.inputFieldBorder}`
|
83
|
-
},
|
84
79
|
children: /*#__PURE__*/_jsxs(Button, {
|
85
80
|
component: "label",
|
86
81
|
variant: "text",
|
@@ -3,13 +3,13 @@ import { Checkbox, FormControlLabel, Grid, Slider, Typography, Box, IconButton }
|
|
3
3
|
import { squreStyle } from "./radiusStyle";
|
4
4
|
import { getBreakPointsValue } from "../../../helper/theme";
|
5
5
|
import useWindowResize from "../../../hooks/useWindowResize";
|
6
|
-
import { useEditorTheme } from "../../../hooks/useEditorTheme";
|
7
6
|
import { CheckedBoxCheckIcon } from "../../iconListV2";
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
9
|
const BANNER_SPACING_KEYS = ["top", "left", "right", "bottom"];
|
11
10
|
const BannerSpacing = props => {
|
12
11
|
const {
|
12
|
+
value: val,
|
13
13
|
data,
|
14
14
|
onChange,
|
15
15
|
elementProps,
|
@@ -23,17 +23,7 @@ const BannerSpacing = props => {
|
|
23
23
|
key
|
24
24
|
} = data;
|
25
25
|
const lockKeyVal = `lock${key}`;
|
26
|
-
|
27
|
-
selectedTheme
|
28
|
-
} = useEditorTheme();
|
29
|
-
const {
|
30
|
-
bannerSpacing,
|
31
|
-
lockbannerSpacing
|
32
|
-
} = selectedTheme?.elementProps?.button || {};
|
33
|
-
const isUserValue = Object.keys(props?.value || {})?.length;
|
34
|
-
const isUserLockedSpacing = typeof elementProps[lockKeyVal] === "boolean";
|
35
|
-
const val = isUserValue ? props?.value : bannerSpacing;
|
36
|
-
let lockSpacing = isUserLockedSpacing ? elementProps[lockKeyVal] : lockbannerSpacing;
|
26
|
+
let lockSpacing = elementProps[lockKeyVal];
|
37
27
|
if (lockSpacing === undefined) {
|
38
28
|
lockSpacing = true;
|
39
29
|
}
|
@@ -3,13 +3,13 @@ import { Grid, Typography, Slider, FormControlLabel, Checkbox, Box, IconButton }
|
|
3
3
|
import { radiusStyle } from "./radiusStyle";
|
4
4
|
import useWindowResize from "../../../hooks/useWindowResize";
|
5
5
|
import { getBreakPointsValue, getCustomizationValue } from "../../../helper/theme";
|
6
|
-
import { useEditorTheme } from "../../../hooks/useEditorTheme";
|
7
6
|
import { CheckedBoxCheckIcon } from "../../iconListV2";
|
8
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
9
8
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
9
|
const BORDER_RADIUS_KEYS = ["topLeft", "topRight", "bottomLeft", "bottomRight"];
|
11
10
|
const BorderRadius = props => {
|
12
11
|
const {
|
12
|
+
value: val,
|
13
13
|
data,
|
14
14
|
onChange,
|
15
15
|
elementProps,
|
@@ -19,24 +19,16 @@ const BorderRadius = props => {
|
|
19
19
|
const {
|
20
20
|
translation
|
21
21
|
} = customProps;
|
22
|
+
let {
|
23
|
+
lockRadius
|
24
|
+
} = elementProps;
|
25
|
+
if (lockRadius === undefined) {
|
26
|
+
lockRadius = true;
|
27
|
+
}
|
22
28
|
const {
|
23
29
|
key
|
24
30
|
} = data;
|
25
31
|
const [size] = useWindowResize();
|
26
|
-
const {
|
27
|
-
selectedTheme
|
28
|
-
} = useEditorTheme();
|
29
|
-
const {
|
30
|
-
borderRadius,
|
31
|
-
lockRadius: themeLockRadius
|
32
|
-
} = selectedTheme?.elementProps?.button || {};
|
33
|
-
const isUserValue = Object.keys(props?.value || {})?.length;
|
34
|
-
const isUserLockedRadius = typeof elementProps?.lockRadius === "boolean";
|
35
|
-
const val = isUserValue ? props?.value : borderRadius;
|
36
|
-
let lockRadius = isUserLockedRadius ? elementProps?.lockRadius : themeLockRadius;
|
37
|
-
if (lockRadius === undefined) {
|
38
|
-
lockRadius = true;
|
39
|
-
}
|
40
32
|
const value = getBreakPointsValue(val, size?.device);
|
41
33
|
const handleChange = e => {
|
42
34
|
let changeAll = {};
|