@flozy/editor 9.5.9 → 9.6.1
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 +19 -26
- package/dist/Editor/CommonEditor.js +22 -139
- package/dist/Editor/DialogWrapper.js +25 -31
- package/dist/Editor/Editor.css +7 -11
- package/dist/Editor/Elements/AI/AIInput.js +3 -5
- package/dist/Editor/Elements/AI/CustomSelect.js +5 -9
- package/dist/Editor/Elements/AI/PopoverAIInput.js +2 -4
- package/dist/Editor/Elements/Accordion/Accordion.js +3 -4
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +1 -4
- package/dist/Editor/Elements/Accordion/AccordionButton.js +2 -6
- package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +1 -4
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +2 -6
- package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +1 -4
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +1 -4
- package/dist/Editor/Elements/Button/ButtonPopup.js +1 -4
- package/dist/Editor/Elements/Button/ButtonToolIcon.js +2 -6
- package/dist/Editor/Elements/Button/EditorButton.js +14 -31
- package/dist/Editor/Elements/Carousel/Carousel.js +4 -5
- package/dist/Editor/Elements/Carousel/CarouselButton.js +2 -6
- package/dist/Editor/Elements/Carousel/CarouselItem.js +2 -3
- package/dist/Editor/Elements/ChipText/ChipTextPopup.js +1 -4
- package/dist/Editor/Elements/CodeToText/CodeToText.js +4 -5
- package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +2 -6
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +14 -60
- 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/Colorbox/ColorboxButton.js +2 -6
- package/dist/Editor/Elements/DataView/DataView.js +2 -5
- package/dist/Editor/Elements/DataView/DataViewButton.js +2 -6
- 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/FilterSort/SortOptions/ChooseSort.js +12 -13
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +4 -7
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +5 -7
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +7 -9
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +3 -8
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +3 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +5 -6
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +3 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +7 -9
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +12 -15
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +2 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +2 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +6 -23
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +4 -6
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +4 -8
- package/dist/Editor/Elements/DataView/Layouts/index.js +1 -3
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +2 -5
- package/dist/Editor/Elements/Divider/Divider.js +3 -5
- package/dist/Editor/Elements/Divider/DividerButton.js +2 -6
- package/dist/Editor/Elements/Divider/DividerPopup.js +2 -3
- package/dist/Editor/Elements/Embed/Embed.js +1 -4
- package/dist/Editor/Elements/Embed/EmbedPopup.js +1 -4
- package/dist/Editor/Elements/Embed/Image.js +11 -16
- package/dist/Editor/Elements/Embed/Video.js +6 -9
- package/dist/Editor/Elements/EmbedScript/Code.js +4 -7
- package/dist/Editor/Elements/EmbedScript/EmbedScript.js +2 -6
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +5 -8
- package/dist/Editor/Elements/Emoji/EmojiButton.js +2 -6
- package/dist/Editor/Elements/Form/FieldPopup.js +1 -4
- package/dist/Editor/Elements/Form/Form.js +9 -12
- package/dist/Editor/Elements/Form/FormButton.js +2 -6
- package/dist/Editor/Elements/Form/FormPopup.js +2 -3
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -18
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +8 -13
- package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +2 -3
- package/dist/Editor/Elements/Form/Workflow/Styles.js +22 -24
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -4
- package/dist/Editor/Elements/Form/Workflow/index.js +9 -15
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +23 -67
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +4 -23
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +2 -6
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +5 -36
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +2 -3
- package/dist/Editor/Elements/FreeGrid/Options/More.js +4 -10
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -3
- package/dist/Editor/Elements/Grid/Grid.js +10 -13
- package/dist/Editor/Elements/Grid/GridButton.js +5 -9
- package/dist/Editor/Elements/Grid/GridItem.js +8 -14
- package/dist/Editor/Elements/Grid/GridItemPopup.js +1 -4
- package/dist/Editor/Elements/Grid/GridPopup.js +1 -4
- package/dist/Editor/Elements/Grid/SectionPopup.js +1 -4
- package/dist/Editor/Elements/Link/Link.js +5 -8
- package/dist/Editor/Elements/Link/LinkButton.js +1 -4
- package/dist/Editor/Elements/List/CheckList.js +9 -14
- package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -6
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +1 -4
- package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +1 -4
- package/dist/Editor/Elements/Search/SearchButton.js +3 -6
- package/dist/Editor/Elements/Search/SearchList.js +3 -7
- package/dist/Editor/Elements/Signature/SignatureButton.js +2 -6
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -6
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +1 -4
- package/dist/Editor/Elements/Signature/SignaturePopup.js +16 -17
- package/dist/Editor/Elements/SimpleText/index.js +4 -5
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/DragButton.js +2 -4
- package/dist/Editor/Elements/Table/Table.js +11 -23
- package/dist/Editor/Elements/Table/TableCell.js +24 -2
- package/dist/Editor/Elements/Table/TablePopup.js +1 -4
- package/dist/Editor/Elements/Table/TableSelector.js +6 -10
- package/dist/Editor/Elements/Table/TableTool.js +4 -8
- package/dist/Editor/Elements/Title/title.js +0 -10
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +1 -4
- package/dist/Editor/Elements/Variables/VariableButton.js +1 -10
- package/dist/Editor/MiniEditor.js +3 -10
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/Basic/index.js +1 -2
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +2 -6
- 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 +4 -8
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -10
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +3 -5
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +5 -10
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +4 -10
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +4 -10
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +3 -9
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +35 -42
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +13 -6
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +51 -58
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +22 -29
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +87 -226
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +10 -20
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +5 -10
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +11 -71
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +5 -11
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +42 -122
- package/dist/Editor/Toolbar/PopupTool/index.js +8 -18
- package/dist/Editor/Toolbar/Toolbar.js +10 -20
- package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
- package/dist/Editor/common/ColorPickerButton.js +14 -39
- package/dist/Editor/common/CustomDialog/index.js +10 -8
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +0 -3
- package/dist/Editor/common/Icon.js +0 -28
- package/dist/Editor/common/ImageSelector/ImageSelector.js +8 -10
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +4 -6
- package/dist/Editor/common/ImageSelector/Styles.js +9 -3
- package/dist/Editor/common/LinkSettings/NavComponents.js +10 -14
- package/dist/Editor/common/LinkSettings/index.js +14 -20
- package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
- package/dist/Editor/common/MentionsPopup/index.js +2 -6
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
- package/dist/Editor/common/RnD/ContextMenu/index.js +2 -3
- package/dist/Editor/common/RnD/ElementOptions/index.js +2 -7
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +3 -8
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +3 -7
- 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 +4 -7
- 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 +2 -6
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +2 -3
- package/dist/Editor/common/RnD/OptionsPopup/index.js +3 -4
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +4 -11
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +8 -20
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +7 -56
- package/dist/Editor/common/RnD/Utils/index.js +0 -3
- package/dist/Editor/common/RnD/VirtualElement/index.js +105 -188
- package/dist/Editor/common/RnD/VirtualElement/styles.js +7 -123
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +3 -5
- package/dist/Editor/common/RnD/index.js +7 -59
- package/dist/Editor/common/Section/index.js +4 -7
- package/dist/Editor/common/Shorthands/elements.js +3 -74
- package/dist/Editor/common/StyleBuilder/appHeaderStyle.js +4 -4
- package/dist/Editor/common/StyleBuilder/boxStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -6
- package/dist/Editor/common/StyleBuilder/dividerStyles.js +2 -2
- package/dist/Editor/common/StyleBuilder/embedVideoStyle.js +6 -6
- package/dist/Editor/common/StyleBuilder/fieldStyle.js +2 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +9 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +3 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +5 -19
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +10 -22
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +3 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +13 -27
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +14 -43
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +6 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +6 -19
- package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +2 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +2 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +6 -9
- package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +2 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +11 -12
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +2 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +2 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +12 -21
- package/dist/Editor/common/StyleBuilder/formStyle.js +7 -7
- package/dist/Editor/common/StyleBuilder/gridItemStyle.js +6 -6
- package/dist/Editor/common/StyleBuilder/gridStyle.js +5 -5
- package/dist/Editor/common/StyleBuilder/index.js +5 -8
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +7 -5
- package/dist/Editor/common/Uploader.js +5 -16
- package/dist/Editor/commonStyle.js +57 -68
- package/dist/Editor/helper/index.js +15 -35
- package/dist/Editor/helper/theme.js +2 -202
- package/dist/Editor/hooks/useDrag.js +10 -16
- package/dist/Editor/hooks/useEditorScroll.js +5 -10
- package/dist/Editor/hooks/useMouseMove.js +13 -25
- package/dist/Editor/hooks/useTable.js +1 -1
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +7 -10
- package/dist/Editor/plugins/withLayout.js +2 -3
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +48 -167
- package/dist/Editor/utils/draftToSlate.js +2 -3
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/freegrid.js +2 -2
- package/dist/Editor/utils/helper.js +19 -90
- package/package.json +2 -2
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +0 -425
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -436
- package/dist/Editor/assets/svg/ClearAllRounded.js +0 -31
- package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
- package/dist/Editor/common/CustomColorPicker/index.js +0 -131
- 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/RnD/VirtualElement/ForceAutoAlignment.js +0 -117
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +0 -134
- package/dist/Editor/common/RnD/VirtualElement/helper.js +0 -281
- package/dist/Editor/common/SnackBar/index.js +0 -43
- package/dist/Editor/helper/textIndeces.js +0 -58
- package/dist/Editor/hooks/useAutoScroll.js +0 -38
- 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 -72
- package/dist/Editor/themeSettings/buttons/index.js +0 -290
- 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 -61
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -351
- package/dist/Editor/themeSettings/style.js +0 -220
- package/dist/Editor/themeSettingsAI/icons.js +0 -96
- package/dist/Editor/themeSettingsAI/index.js +0 -355
- package/dist/Editor/themeSettingsAI/saveTheme.js +0 -205
- package/dist/Editor/themeSettingsAI/style.js +0 -259
|
@@ -1,235 +1,152 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
2
|
import { Box } from "@mui/material";
|
|
3
3
|
import useVirtualElementStyles from "./styles";
|
|
4
4
|
import updateAutoProps from "./updateAutoProps";
|
|
5
|
-
import {
|
|
5
|
+
import { calculateGridArea } from "../Utils/gridDropItem";
|
|
6
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
7
|
const ROOT_ITEM_CLASS = ".freegrid-item.path-3";
|
|
8
|
-
export function getStartRow(el) {
|
|
9
|
-
const gridArea = el.dataset.gridAreaXs;
|
|
10
|
-
if (gridArea) {
|
|
11
|
-
const [startRow] = gridArea.split("/").map(num => parseInt(num));
|
|
12
|
-
return startRow;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
function appendGridOccupied(domItem, startRow, fullHeight, lastRow) {
|
|
16
|
-
const endRow = startRow + Math.floor(fullHeight / ROW_HEIGHT) + 1;
|
|
17
|
-
lastRow = Math.max(endRow, lastRow);
|
|
18
|
-
const gridArea = `${startRow}/1/${endRow}/2`;
|
|
19
|
-
domItem.style.setProperty("--gridArea_xs", gridArea);
|
|
20
|
-
domItem.dataset.gridAreaXs = gridArea;
|
|
21
|
-
domItem.classList.add("exclude-virtual");
|
|
22
|
-
return {
|
|
23
|
-
domItem,
|
|
24
|
-
updatedLastRow: lastRow,
|
|
25
|
-
gridArea
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
8
|
|
|
29
9
|
// Function to group items by path and calculate heights
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// // Base case: If there are no children, return the node's height
|
|
58
|
-
// return node.props.height;
|
|
59
|
-
// }
|
|
60
|
-
|
|
61
|
-
// // Calculate the height by summing the heights of all children
|
|
62
|
-
// let totalHeight = 0;
|
|
63
|
-
// Object.values(node.children).forEach((child) => {
|
|
64
|
-
// totalHeight += calculateHeight(child);
|
|
65
|
-
// });
|
|
10
|
+
function groupByPathAndCalculateHeight(data) {
|
|
11
|
+
const root = {};
|
|
12
|
+
const heightData = {};
|
|
13
|
+
|
|
14
|
+
// Step 1: Group items based on their path
|
|
15
|
+
data.forEach(item => {
|
|
16
|
+
const segments = item.path.split("|");
|
|
17
|
+
let current = root;
|
|
18
|
+
segments.forEach((segment, index) => {
|
|
19
|
+
if (!current[segment]) {
|
|
20
|
+
current[segment] = {
|
|
21
|
+
children: {},
|
|
22
|
+
props: {
|
|
23
|
+
height: 0
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
if (index === segments.length - 1) {
|
|
28
|
+
// Assign the properties of the item including height
|
|
29
|
+
current[segment] = {
|
|
30
|
+
...item,
|
|
31
|
+
children: current[segment].children
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
current = current[segment].children;
|
|
35
|
+
});
|
|
36
|
+
});
|
|
66
37
|
|
|
67
|
-
//
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
// };
|
|
38
|
+
// Step 2: Recursively calculate the height of each parent based on children
|
|
39
|
+
const calculateHeight = node => {
|
|
40
|
+
if (!node.children || Object.keys(node.children).length === 0) {
|
|
41
|
+
// Base case: If there are no children, return the node's height
|
|
42
|
+
return node.props.height;
|
|
43
|
+
}
|
|
74
44
|
|
|
75
|
-
//
|
|
76
|
-
|
|
45
|
+
// Calculate the height by summing the heights of all children
|
|
46
|
+
let totalHeight = 0;
|
|
47
|
+
Object.values(node.children).forEach(child => {
|
|
48
|
+
totalHeight += calculateHeight(child);
|
|
49
|
+
});
|
|
77
50
|
|
|
78
|
-
//
|
|
79
|
-
|
|
51
|
+
// Update the parent's height to be the total height of its children
|
|
52
|
+
node.props.height = totalHeight;
|
|
53
|
+
if (node?.path) {
|
|
54
|
+
heightData[node.path] = totalHeight;
|
|
55
|
+
}
|
|
56
|
+
return totalHeight;
|
|
57
|
+
};
|
|
80
58
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const {
|
|
84
|
-
marginTopXs,
|
|
85
|
-
heightXs
|
|
86
|
-
} = dom.dataset;
|
|
87
|
-
const marginTop = marginTopXs ? Number(marginTopXs) : 0;
|
|
88
|
-
const fullHeight = Number(heightXs) + marginTop;
|
|
89
|
-
return appendGridOccupied(dom, startRow, fullHeight, lastRow);
|
|
90
|
-
};
|
|
91
|
-
const handleNonGridItem = (dom, lastRow) => {
|
|
92
|
-
const rect = dom.getBoundingClientRect();
|
|
93
|
-
dom.style.setProperty("--height_xs", rect.height + "px"); // assign the auto height that taken
|
|
94
|
-
const startRow = lastRow || 1;
|
|
95
|
-
const DEFAULT_NEW_ELEMENT_MARGIN_TOP = 12;
|
|
96
|
-
let fullHeight = rect.height + DEFAULT_NEW_ELEMENT_MARGIN_TOP;
|
|
97
|
-
const gridOccupiedData = appendGridOccupied(dom, startRow, fullHeight, lastRow);
|
|
59
|
+
// Start calculation from the root
|
|
60
|
+
Object.values(root).forEach(node => calculateHeight(node));
|
|
98
61
|
return {
|
|
99
|
-
|
|
100
|
-
|
|
62
|
+
root,
|
|
63
|
+
heightData
|
|
101
64
|
};
|
|
102
|
-
}
|
|
103
|
-
const appendContainerItems = async (sectionCls, virtualRef, dataSets) => {
|
|
104
|
-
const cloneNode = document.querySelector(sectionCls)?.cloneNode(true);
|
|
105
|
-
const items = cloneNode?.querySelectorAll(ROOT_ITEM_CLASS) || [];
|
|
106
|
-
if (!cloneNode || !items?.length || !virtualRef.current) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// Remove all existing elements inside virtualRef.current
|
|
111
|
-
virtualRef.current.innerHTML = "";
|
|
112
|
-
virtualRef.current.style.height = `auto`;
|
|
113
|
-
virtualRef.current.style.gridTemplateRows = `unset`;
|
|
114
|
-
|
|
115
|
-
// temporary append section items to get the dom styles
|
|
116
|
-
virtualRef.current.append(...items);
|
|
117
|
-
let itemsHTML = "";
|
|
118
|
-
let lastRow = 0;
|
|
119
|
-
const gridItems = [];
|
|
120
|
-
const nonGridItems = [];
|
|
121
|
-
items.forEach(item => {
|
|
122
|
-
if (getStartRow(item)) {
|
|
123
|
-
gridItems.push(item);
|
|
124
|
-
} else {
|
|
125
|
-
nonGridItems.push(item);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
// to find the previously occupied rows
|
|
130
|
-
gridItems.forEach(item => {
|
|
131
|
-
const {
|
|
132
|
-
updatedLastRow,
|
|
133
|
-
domItem
|
|
134
|
-
} = handleGridItem(item, lastRow);
|
|
135
|
-
lastRow = updatedLastRow;
|
|
136
|
-
itemsHTML += domItem.outerHTML;
|
|
137
|
-
});
|
|
138
|
-
let containerHeight = lastRow ? (lastRow - 1) * ROW_HEIGHT : 0;
|
|
139
|
-
|
|
140
|
-
//place it on the next rows that are available
|
|
141
|
-
nonGridItems.forEach(item => {
|
|
142
|
-
const {
|
|
143
|
-
domItem,
|
|
144
|
-
updatedLastRow,
|
|
145
|
-
fullHeight
|
|
146
|
-
} = handleNonGridItem(item, lastRow);
|
|
147
|
-
lastRow = updatedLastRow;
|
|
148
|
-
itemsHTML += domItem.outerHTML;
|
|
149
|
-
containerHeight += fullHeight;
|
|
150
|
-
});
|
|
151
|
-
const oldSectionHeight = dataSets["data-height-xs"];
|
|
152
|
-
const newHeight = oldSectionHeight && oldSectionHeight > containerHeight ? oldSectionHeight : containerHeight;
|
|
153
|
-
virtualRef.current.style.height = `${newHeight}px`;
|
|
154
|
-
virtualRef.current.style.gridTemplateRows = `repeat(${lastRow - 1}, ${ROW_HEIGHT}px)`;
|
|
155
|
-
virtualRef.current.innerHTML = itemsHTML;
|
|
156
|
-
};
|
|
65
|
+
}
|
|
157
66
|
const VirtualElement = props => {
|
|
158
67
|
const classes = useVirtualElementStyles();
|
|
159
68
|
const {
|
|
160
69
|
editor,
|
|
161
70
|
path,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
dataSets
|
|
71
|
+
parentEle,
|
|
72
|
+
updated_at
|
|
165
73
|
} = props;
|
|
74
|
+
const cloneNode = parentEle?.cloneNode(true);
|
|
166
75
|
const virtualRef = useRef();
|
|
167
|
-
const [toggleUpdate, setToggleUpdate] = useState(false);
|
|
168
76
|
useEffect(() => {
|
|
169
77
|
if (virtualRef?.current) {
|
|
170
|
-
setTimeout(() => {
|
|
78
|
+
const timeoutId = setTimeout(() => {
|
|
171
79
|
const allData = calculateProps(path, virtualRef?.current, ROOT_ITEM_CLASS, []);
|
|
172
|
-
|
|
173
|
-
// console.log("allData", allData);
|
|
80
|
+
const groupData = groupByPathAndCalculateHeight(allData);
|
|
174
81
|
// it should trigger by auto alignment or on clicking mobile view change
|
|
175
|
-
updateAutoProps(editor, allData, "xs");
|
|
82
|
+
updateAutoProps(editor, allData, "xs", groupData);
|
|
176
83
|
}, 100);
|
|
177
|
-
|
|
84
|
+
return () => clearTimeout(timeoutId);
|
|
178
85
|
}
|
|
179
86
|
}, [updated_at, virtualRef?.current]);
|
|
180
87
|
const calculateProps = (curPath, dom, domClass, allData) => {
|
|
181
88
|
const rect = dom?.getBoundingClientRect();
|
|
182
|
-
|
|
183
|
-
// const sectionRect = virtualRef?.current?.getBoundingClientRect();
|
|
184
|
-
|
|
185
|
-
const bufferHeight = 12; // for spacing
|
|
186
|
-
|
|
89
|
+
const sectionRect = virtualRef?.current?.getBoundingClientRect();
|
|
187
90
|
const sectionProps = {
|
|
188
91
|
path: curPath,
|
|
189
92
|
props: {
|
|
190
|
-
height: rect?.height
|
|
93
|
+
height: rect?.height
|
|
191
94
|
}
|
|
192
95
|
};
|
|
193
96
|
const itemsData = [];
|
|
194
|
-
const items = dom
|
|
97
|
+
const items = dom.querySelectorAll(domClass);
|
|
98
|
+
const nextItemPathLength = curPath?.split("|").length + 2;
|
|
99
|
+
let sectionHeight = 12;
|
|
195
100
|
for (let i = 0; i < items.length; i++) {
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
212
|
-
|
|
101
|
+
const itemRect = items[i]?.getBoundingClientRect();
|
|
102
|
+
if (items[i]?.classList.contains("type_box")) {
|
|
103
|
+
allData = calculateProps(items[i]?.dataset.path, items[i], `.freegrid-item.path-${nextItemPathLength}`, allData);
|
|
104
|
+
} else {
|
|
105
|
+
const y = Math.abs(rect.top - itemRect?.top);
|
|
106
|
+
itemsData.push({
|
|
107
|
+
path: items[i]?.dataset.path,
|
|
108
|
+
props: {
|
|
109
|
+
top: y,
|
|
110
|
+
left: 24,
|
|
111
|
+
marginTop: 12,
|
|
112
|
+
width: itemRect?.width,
|
|
113
|
+
height: itemRect?.height,
|
|
114
|
+
gridArea: calculateGridArea(y)
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
sectionHeight += itemRect?.height;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (dom?.classList.contains("type_box")) {
|
|
121
|
+
const y = Math.abs(sectionRect.top - rect?.top);
|
|
122
|
+
sectionProps.props.gridArea = calculateGridArea(y);
|
|
123
|
+
}
|
|
124
|
+
if (sectionHeight > sectionProps?.props?.height) {
|
|
125
|
+
sectionProps.props.height = sectionHeight;
|
|
213
126
|
}
|
|
214
127
|
allData = [sectionProps, [...allData, ...itemsData]]?.flat();
|
|
215
128
|
return allData;
|
|
216
129
|
};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
130
|
+
const getItems = () => {
|
|
131
|
+
const items = cloneNode?.querySelectorAll(ROOT_ITEM_CLASS) || [];
|
|
132
|
+
let itemsHTML = "";
|
|
133
|
+
for (let i = 0; i < items?.length; i++) {
|
|
134
|
+
items[i].classList.add("exclude-virtual");
|
|
135
|
+
itemsHTML += items[i].outerHTML;
|
|
136
|
+
}
|
|
137
|
+
return itemsHTML;
|
|
138
|
+
};
|
|
220
139
|
return /*#__PURE__*/_jsx(Box, {
|
|
221
140
|
className: "mobile-virtual-mode",
|
|
222
141
|
ref: virtualRef,
|
|
223
|
-
sx:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
...classes.root
|
|
142
|
+
sx: classes.root,
|
|
143
|
+
dangerouslySetInnerHTML: {
|
|
144
|
+
__html: getItems()
|
|
145
|
+
},
|
|
146
|
+
style: {
|
|
147
|
+
visibility: "hidden"
|
|
230
148
|
},
|
|
231
|
-
"aria-hidden": "true"
|
|
232
|
-
contentEditable: false
|
|
149
|
+
"aria-hidden": "true"
|
|
233
150
|
});
|
|
234
151
|
};
|
|
235
152
|
export default VirtualElement;
|
|
@@ -2,137 +2,20 @@ const useVirtualElementStyles = () => ({
|
|
|
2
2
|
root: {
|
|
3
3
|
width: "320px",
|
|
4
4
|
position: "fixed",
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
backgroundColor: "red",
|
|
6
|
+
height: "auto",
|
|
7
7
|
overflow: "visible",
|
|
8
8
|
pointerEvents: "none",
|
|
9
|
-
opacity:
|
|
9
|
+
opacity: 0,
|
|
10
10
|
right: 0,
|
|
11
11
|
top: 0,
|
|
12
|
-
"& .leaf-item": {
|
|
13
|
-
fontSize: "var(--fontSize_xs) !important",
|
|
14
|
-
"& span": {
|
|
15
|
-
fontSize: "var(--fontSize_xs) !important"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"& .editor-blocker": {
|
|
19
|
-
display: "none"
|
|
20
|
-
},
|
|
21
12
|
"& .freegrid-item": {
|
|
22
13
|
position: "relative !important",
|
|
23
|
-
top: "0 !important",
|
|
24
|
-
gridArea: "var(--gridArea_xs) !important",
|
|
25
|
-
width: "calc(100% - 48px) !important",
|
|
26
|
-
height: "var(--height_xs) !important",
|
|
27
|
-
left: "24px !important",
|
|
28
|
-
marginTop: "var(--marginTop_xs) !important",
|
|
29
|
-
outline: "1px solid gray !important",
|
|
30
|
-
"&.type_text": {
|
|
31
|
-
height: "auto !important"
|
|
32
|
-
},
|
|
33
|
-
// "&.type_box": {
|
|
34
|
-
// // display: "grid !important",
|
|
35
|
-
// // gridTemplateRows: "repeat(auto-fill, 50px) !important",
|
|
36
|
-
// // height: "min-content !important",
|
|
37
|
-
// },
|
|
38
|
-
|
|
39
|
-
"& .debug-info, & .editor-blocker": {
|
|
40
|
-
display: "none"
|
|
41
|
-
},
|
|
42
|
-
"& .embed": {
|
|
43
|
-
minHeight: "300px"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
export default useVirtualElementStyles;
|
|
49
|
-
export const useAutoAlignStyles = () => ({
|
|
50
|
-
root: {
|
|
51
|
-
width: "320px",
|
|
52
|
-
position: "fixed",
|
|
53
|
-
overflow: "visible",
|
|
54
|
-
opacity: 1,
|
|
55
|
-
right: 0,
|
|
56
|
-
top: 0,
|
|
57
|
-
height: "auto !important",
|
|
58
|
-
pointerEvents: "none",
|
|
59
|
-
"& .leaf-item": {
|
|
60
|
-
fontSize: "var(--fontSize_xs) !important",
|
|
61
|
-
"& span": {
|
|
62
|
-
fontSize: "var(--fontSize_xs) !important"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"& .editor-blocker": {
|
|
66
|
-
display: "none"
|
|
67
|
-
},
|
|
68
|
-
"& .freegrid-item": {
|
|
69
|
-
position: "relative !important",
|
|
70
|
-
top: "0 !important",
|
|
71
14
|
gridArea: "none !important",
|
|
72
15
|
width: "calc(100% - 48px) !important",
|
|
73
|
-
height: "
|
|
16
|
+
height: "auto !important",
|
|
74
17
|
left: "24px !important",
|
|
75
|
-
marginTop: "
|
|
76
|
-
minHeight: "auto",
|
|
77
|
-
display: "inherit !important",
|
|
78
|
-
"&.type_box": {
|
|
79
|
-
height: "auto !important"
|
|
80
|
-
},
|
|
81
|
-
"&.type_image": {
|
|
82
|
-
width: "var(--width_xs) !important",
|
|
83
|
-
height: "var(--height_xs) !important"
|
|
84
|
-
},
|
|
85
|
-
"&.type_text": {
|
|
86
|
-
height: "auto !important"
|
|
87
|
-
},
|
|
88
|
-
// start - default signature classes on free-grid
|
|
89
|
-
"& .fgi_type_signature": {
|
|
90
|
-
height: "100%",
|
|
91
|
-
"& .signature-container": {
|
|
92
|
-
height: "100%",
|
|
93
|
-
LineHeight: 1.43,
|
|
94
|
-
"& .signature-btn-container": {
|
|
95
|
-
height: "100%",
|
|
96
|
-
display: "flex",
|
|
97
|
-
flexDirection: "column",
|
|
98
|
-
"& .sign-placeholder": {
|
|
99
|
-
display: "flex",
|
|
100
|
-
// remove hidden sign placeholder
|
|
101
|
-
width: "100%",
|
|
102
|
-
flexGrow: 1
|
|
103
|
-
},
|
|
104
|
-
"& button": {
|
|
105
|
-
margin: "6px 0px"
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
"& .fgi_type_sign": {
|
|
111
|
-
width: "100%",
|
|
112
|
-
height: "100%",
|
|
113
|
-
"& .signature-signed-wrapper": {
|
|
114
|
-
width: "100%",
|
|
115
|
-
height: "100%",
|
|
116
|
-
"& .signature-signed-span": {
|
|
117
|
-
width: "100%",
|
|
118
|
-
height: "100%",
|
|
119
|
-
"& .signed-btn": {
|
|
120
|
-
width: "100%",
|
|
121
|
-
height: "100%",
|
|
122
|
-
display: "flex",
|
|
123
|
-
flexDirection: "column",
|
|
124
|
-
"& img": {
|
|
125
|
-
width: "100% !important",
|
|
126
|
-
maxWidth: "none !important",
|
|
127
|
-
height: "70% !important",
|
|
128
|
-
flexGrow: 1
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
// end - default signature classes on free-grid
|
|
135
|
-
|
|
18
|
+
marginTop: "24px !important",
|
|
136
19
|
"& .debug-info, & .editor-blocker": {
|
|
137
20
|
display: "none"
|
|
138
21
|
},
|
|
@@ -141,4 +24,5 @@ export const useAutoAlignStyles = () => ({
|
|
|
141
24
|
}
|
|
142
25
|
}
|
|
143
26
|
}
|
|
144
|
-
});
|
|
27
|
+
});
|
|
28
|
+
export default useVirtualElementStyles;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Node, Transforms } from "slate";
|
|
2
|
-
const updateAutoProps = (editor, datas = [], breakpoint = "",
|
|
2
|
+
const updateAutoProps = (editor, datas = [], breakpoint = "", groupData) => {
|
|
3
3
|
try {
|
|
4
4
|
// const { heightData } = groupData;
|
|
5
5
|
for (let i = 0; i < datas.length; i++) {
|
|
@@ -14,11 +14,9 @@ const updateAutoProps = (editor, datas = [], breakpoint = "", updateAll) => {
|
|
|
14
14
|
return a;
|
|
15
15
|
}, {});
|
|
16
16
|
const oldProps = Node.get(editor, int_path);
|
|
17
|
-
|
|
18
|
-
if (updateNode) {
|
|
17
|
+
if (!oldProps?.xs_updatedOn) {
|
|
19
18
|
Transforms.setNodes(editor, {
|
|
20
|
-
...updatedProps
|
|
21
|
-
xs_updatedOn: new Date().getTime()
|
|
19
|
+
...updatedProps
|
|
22
20
|
}, {
|
|
23
21
|
at: int_path
|
|
24
22
|
});
|
|
@@ -19,10 +19,6 @@ import { removeSign } from "./ElementSettings/OtherSettings";
|
|
|
19
19
|
import useDragging from "../../hooks/useDragging";
|
|
20
20
|
import { dragOverOn } from "../../helper/RnD/focusNode";
|
|
21
21
|
import { focusSelection, clearSelection, clearSelectionOnly } from "../../helper";
|
|
22
|
-
import { reRenderChildNodes } from "./Utils/gridDropItem";
|
|
23
|
-
import VirtualTextElement from "./VirtualElement/VirtualTextElement";
|
|
24
|
-
import useAutoScroll from "../../hooks/useAutoScroll";
|
|
25
|
-
import ForceAutoAlignment from "./VirtualElement/ForceAutoAlignment";
|
|
26
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
24
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -68,12 +64,7 @@ const RnD = props => {
|
|
|
68
64
|
editor,
|
|
69
65
|
breakpoint = "",
|
|
70
66
|
handleContextMenuClick = () => {},
|
|
71
|
-
itemData = {}
|
|
72
|
-
customProps,
|
|
73
|
-
sectionElement,
|
|
74
|
-
dataSets,
|
|
75
|
-
autoAlign,
|
|
76
|
-
setAutoAlign
|
|
67
|
+
itemData = {}
|
|
77
68
|
} = props;
|
|
78
69
|
const {
|
|
79
70
|
isSelectedElement,
|
|
@@ -115,13 +106,6 @@ const RnD = props => {
|
|
|
115
106
|
y: 0
|
|
116
107
|
});
|
|
117
108
|
const parentSectionPath = str_path?.split("|").slice(0, 2).join("_");
|
|
118
|
-
const {
|
|
119
|
-
translation
|
|
120
|
-
} = customProps;
|
|
121
|
-
const {
|
|
122
|
-
startAutoScroll,
|
|
123
|
-
stopAutoScroll
|
|
124
|
-
} = useAutoScroll(10, "slate-wrapper-scroll-container");
|
|
125
109
|
useEffect(() => {
|
|
126
110
|
if (ITEM_TYPES.includes(type)) {
|
|
127
111
|
if (enable === 1) {
|
|
@@ -363,16 +347,6 @@ const RnD = props => {
|
|
|
363
347
|
};
|
|
364
348
|
const onDrag = e => {
|
|
365
349
|
e.preventDefault();
|
|
366
|
-
const {
|
|
367
|
-
clientY
|
|
368
|
-
} = e;
|
|
369
|
-
if (clientY < 50) {
|
|
370
|
-
startAutoScroll("up");
|
|
371
|
-
} else if (window.innerHeight - clientY < 50) {
|
|
372
|
-
startAutoScroll("down");
|
|
373
|
-
} else {
|
|
374
|
-
stopAutoScroll();
|
|
375
|
-
}
|
|
376
350
|
const lines = getClosestDraggable(e.clientX, e.clientY, `.freegrid-section_${parentSectionPath} .freegrid-container .freegrid-item.inactive-drag`.replace(/\|/g, "\\|"), ".freegrid-item.active-drag:not(.exclude-virtual)");
|
|
377
351
|
setAbsPosition({
|
|
378
352
|
...absPosition,
|
|
@@ -415,7 +389,6 @@ const RnD = props => {
|
|
|
415
389
|
const onDragStop = (e, d) => {
|
|
416
390
|
e.preventDefault();
|
|
417
391
|
e.stopPropagation();
|
|
418
|
-
stopAutoScroll();
|
|
419
392
|
if (dragging?.isDragging === 2 && dragging?.position?.strXY && dragging?.dragOver) {
|
|
420
393
|
d.x = e.x;
|
|
421
394
|
d.y = e.y;
|
|
@@ -476,18 +449,13 @@ const RnD = props => {
|
|
|
476
449
|
}
|
|
477
450
|
const updatedSize = {
|
|
478
451
|
width: delta?.width + d.width,
|
|
479
|
-
height:
|
|
452
|
+
height: delta?.height + d.height,
|
|
480
453
|
...updatedPosition
|
|
481
454
|
};
|
|
482
455
|
onChange({
|
|
483
456
|
...updatedSize
|
|
484
457
|
});
|
|
485
458
|
handleResizeEvent("stop");
|
|
486
|
-
const parentPath = getParentSectionPath({
|
|
487
|
-
ref
|
|
488
|
-
}, ".freegrid-container-parent");
|
|
489
|
-
const formatParentPath = parentPath?.split("|")?.map(m => parseInt(m));
|
|
490
|
-
reRenderChildNodes(editor, formatParentPath);
|
|
491
459
|
};
|
|
492
460
|
const onCloseSettings = () => {
|
|
493
461
|
setSelectedElement({
|
|
@@ -555,7 +523,7 @@ const RnD = props => {
|
|
|
555
523
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
556
524
|
children: [/*#__PURE__*/_jsxs(Box, {
|
|
557
525
|
component: Rnd,
|
|
558
|
-
placeholder:
|
|
526
|
+
placeholder: ItemTypes[childType] || "Item",
|
|
559
527
|
id: eId || "",
|
|
560
528
|
ref: c => {
|
|
561
529
|
positionRef.current = c;
|
|
@@ -589,7 +557,6 @@ const RnD = props => {
|
|
|
589
557
|
...DISABLE_RESIZING
|
|
590
558
|
},
|
|
591
559
|
...getEventProps(),
|
|
592
|
-
...(dataSets || {}),
|
|
593
560
|
children: [/*#__PURE__*/_jsx("div", {
|
|
594
561
|
id: `opt_ref_${str_path}`,
|
|
595
562
|
style: {
|
|
@@ -623,9 +590,7 @@ const RnD = props => {
|
|
|
623
590
|
optionsProps: optionsProps,
|
|
624
591
|
selectedAction: currentAction,
|
|
625
592
|
path: str_path,
|
|
626
|
-
theme: theme
|
|
627
|
-
translation: translation,
|
|
628
|
-
customProps: customProps
|
|
593
|
+
theme: theme
|
|
629
594
|
}) : null, /*#__PURE__*/_jsx(ElementSettings, {
|
|
630
595
|
open: Boolean(currentAction),
|
|
631
596
|
currentAction: currentAction,
|
|
@@ -659,29 +624,12 @@ const RnD = props => {
|
|
|
659
624
|
open: openContextMenu,
|
|
660
625
|
contextMenu: contextMenu,
|
|
661
626
|
handleClose: handleClose,
|
|
662
|
-
theme: theme
|
|
663
|
-
translation: translation
|
|
627
|
+
theme: theme
|
|
664
628
|
}), type === "parent" && breakpoint === "lg" && !readOnly ? /*#__PURE__*/_jsx(VirtualElement, {
|
|
629
|
+
parentEle: positionRef?.current?.resizableElement?.current,
|
|
665
630
|
updated_at: updated_at,
|
|
666
631
|
path: str_path,
|
|
667
|
-
editor: editor
|
|
668
|
-
sectionElement: sectionElement,
|
|
669
|
-
sectionCls: `.freegrid-section_${path.join("_")}`,
|
|
670
|
-
dataSets: dataSets
|
|
671
|
-
}) : null, childType === "text" && breakpoint === "lg" && !readOnly && enable ? /*#__PURE__*/_jsx(VirtualTextElement, {
|
|
672
|
-
editor: editor,
|
|
673
|
-
dataSets: dataSets,
|
|
674
|
-
getCurrentEle: getCurrentEle,
|
|
675
|
-
path: path
|
|
676
|
-
}) : null, type === "parent" && breakpoint === "xs" && !readOnly && autoAlign ? /*#__PURE__*/_jsx(ForceAutoAlignment, {
|
|
677
|
-
updated_at: updated_at,
|
|
678
|
-
path: str_path,
|
|
679
|
-
editor: editor,
|
|
680
|
-
sectionElement: sectionElement,
|
|
681
|
-
sectionCls: `.freegrid-section_${path.join("_")}`,
|
|
682
|
-
dataSets: dataSets,
|
|
683
|
-
autoAlign: autoAlign,
|
|
684
|
-
setAutoAlign: setAutoAlign
|
|
632
|
+
editor: editor
|
|
685
633
|
}) : null]
|
|
686
634
|
});
|
|
687
635
|
};
|