@flozy/editor 9.3.7 → 9.3.9
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 +52 -16
- package/dist/Editor/CommonEditor.js +133 -23
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +19 -9
- package/dist/Editor/Elements/AI/AIInput.js +5 -3
- package/dist/Editor/Elements/AI/CustomSelect.js +9 -5
- package/dist/Editor/Elements/AI/PopoverAIInput.js +4 -2
- package/dist/Editor/Elements/Accordion/Accordion.js +4 -3
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +4 -1
- package/dist/Editor/Elements/Accordion/AccordionButton.js +6 -2
- package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +4 -1
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/AppHeader/AppHeaderButton.js +6 -2
- package/dist/Editor/Elements/AppHeader/AppHeaderPopup.js +4 -1
- package/dist/Editor/Elements/Attachments/AttachmentsButton.js +4 -1
- package/dist/Editor/Elements/Button/ButtonPopup.js +4 -1
- package/dist/Editor/Elements/Button/ButtonToolIcon.js +6 -2
- package/dist/Editor/Elements/Button/EditorButton.js +31 -14
- package/dist/Editor/Elements/Carousel/Carousel.js +5 -4
- package/dist/Editor/Elements/Carousel/CarouselButton.js +6 -2
- package/dist/Editor/Elements/Carousel/CarouselItem.js +3 -2
- package/dist/Editor/Elements/ChipText/ChipTextPopup.js +4 -1
- package/dist/Editor/Elements/CodeToText/CodeToText.js +5 -4
- package/dist/Editor/Elements/CodeToText/HtmlContextMenu.js +6 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -14
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +3 -3
- package/dist/Editor/Elements/Colorbox/ColorboxButton.js +6 -2
- package/dist/Editor/Elements/DataView/DataView.js +5 -2
- package/dist/Editor/Elements/DataView/DataViewButton.js +6 -2
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +422 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/Select.js +4 -3
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +23 -5
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/TextType.js +7 -2
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/ChooseSort.js +13 -12
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/SortOptions/index.js +7 -4
- package/dist/Editor/Elements/DataView/Layouts/FilterSort/index.js +7 -5
- package/dist/Editor/Elements/DataView/Layouts/FilterView.js +9 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +8 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AddProperty.js +5 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/AllProperties.js +6 -5
- package/dist/Editor/Elements/DataView/Layouts/Options/ChangeProperty.js +5 -3
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +9 -7
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +64 -38
- package/dist/Editor/Elements/DataView/Layouts/Options/FilterProperty.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/PropertyList.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +23 -6
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +4 -1
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +6 -4
- package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +5 -2
- package/dist/Editor/Elements/Divider/Divider.js +5 -3
- package/dist/Editor/Elements/Divider/DividerButton.js +6 -2
- package/dist/Editor/Elements/Divider/DividerPopup.js +3 -2
- package/dist/Editor/Elements/Embed/Embed.js +4 -1
- package/dist/Editor/Elements/Embed/EmbedPopup.js +4 -1
- package/dist/Editor/Elements/Embed/Frames/Slider.js +16 -14
- package/dist/Editor/Elements/Embed/Image.js +18 -12
- package/dist/Editor/Elements/Embed/Video.js +10 -7
- package/dist/Editor/Elements/EmbedScript/Code.js +7 -4
- package/dist/Editor/Elements/EmbedScript/EmbedScript.js +6 -2
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +8 -5
- package/dist/Editor/Elements/Emoji/EmojiButton.js +6 -2
- package/dist/Editor/Elements/Form/FieldPopup.js +4 -1
- package/dist/Editor/Elements/Form/Form.js +12 -9
- package/dist/Editor/Elements/Form/FormButton.js +6 -2
- package/dist/Editor/Elements/Form/FormPopup.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +18 -12
- package/dist/Editor/Elements/Form/Workflow/ListWorkflow.js +13 -8
- package/dist/Editor/Elements/Form/Workflow/MoreOptions.js +3 -2
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +4 -2
- package/dist/Editor/Elements/Form/Workflow/index.js +15 -9
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +63 -25
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +23 -4
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +35 -5
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
- package/dist/Editor/Elements/FreeGrid/Options/More.js +10 -4
- package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
- package/dist/Editor/Elements/Grid/Grid.js +13 -10
- package/dist/Editor/Elements/Grid/GridButton.js +9 -5
- package/dist/Editor/Elements/Grid/GridItem.js +14 -8
- package/dist/Editor/Elements/Grid/GridItemPopup.js +4 -1
- package/dist/Editor/Elements/Grid/GridPopup.js +4 -1
- package/dist/Editor/Elements/Grid/SectionPopup.js +4 -1
- package/dist/Editor/Elements/Link/Link.js +14 -7
- package/dist/Editor/Elements/Link/LinkButton.js +4 -1
- package/dist/Editor/Elements/List/CheckList.js +14 -9
- package/dist/Editor/Elements/NewLine/NewLineButton.js +6 -2
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +16 -5
- package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +4 -1
- package/dist/Editor/Elements/Search/SearchButton.js +6 -3
- package/dist/Editor/Elements/Search/SearchList.js +7 -3
- package/dist/Editor/Elements/Signature/SignatureButton.js +6 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +6 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +4 -1
- package/dist/Editor/Elements/Signature/SignaturePopup.js +17 -16
- package/dist/Editor/Elements/SimpleText/index.js +5 -4
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/DragButton.js +4 -2
- package/dist/Editor/Elements/Table/Table.js +48 -25
- package/dist/Editor/Elements/Table/TableCell.js +10 -27
- package/dist/Editor/Elements/Table/TablePopup.js +4 -1
- package/dist/Editor/Elements/Table/TableSelector.js +10 -6
- package/dist/Editor/Elements/Table/TableTool.js +8 -4
- package/dist/Editor/Elements/Title/title.js +10 -0
- package/dist/Editor/Elements/TopBanner/TopBannerButton.js +4 -1
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +10 -3
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- package/dist/Editor/Toolbar/Basic/index.js +2 -1
- package/dist/Editor/Toolbar/FormatTools/BlockButton.js +6 -2
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
- package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +8 -4
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +7 -13
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +20 -15
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +10 -5
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +10 -4
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +10 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +6 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectAlignment.js +42 -35
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectList.js +58 -51
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +29 -22
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +226 -87
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +15 -7
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +8 -4
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -9
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +126 -44
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +441 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +15 -17
- package/dist/Editor/Toolbar/Toolbar.js +20 -10
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/CalenderIconTick.js +1 -0
- package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +45 -10
- package/dist/Editor/common/CustomColorPicker/index.js +125 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +8 -10
- package/dist/Editor/common/CustomDialog/styles.js +1 -1
- package/dist/Editor/common/CustomDialog2/index.js +94 -0
- package/dist/Editor/common/CustomDialog2/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +33 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
- package/dist/Editor/common/Icon.js +46 -1
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/ImageSelector/UploadStyles.js +9 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +14 -10
- package/dist/Editor/common/LinkSettings/index.js +20 -14
- package/dist/Editor/common/LinkSettings/navOptions.js +1 -1
- package/dist/Editor/common/MentionsPopup/Styles.js +111 -73
- package/dist/Editor/common/MentionsPopup/index.js +8 -4
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +22 -22
- package/dist/Editor/common/RnD/ContextMenu/index.js +3 -2
- package/dist/Editor/common/RnD/ElementOptions/index.js +7 -2
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +8 -3
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +7 -3
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +7 -4
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +6 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
- package/dist/Editor/common/RnD/OptionsPopup/index.js +4 -3
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +11 -4
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +20 -8
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +58 -7
- package/dist/Editor/common/RnD/Utils/index.js +48 -0
- package/dist/Editor/common/RnD/VirtualElement/ForceAutoAlignment.js +110 -0
- package/dist/Editor/common/RnD/VirtualElement/VirtualTextElement.js +112 -0
- package/dist/Editor/common/RnD/VirtualElement/helper.js +267 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +186 -104
- package/dist/Editor/common/RnD/VirtualElement/styles.js +95 -8
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +5 -3
- package/dist/Editor/common/RnD/index.js +82 -10
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +98 -10
- package/dist/Editor/common/SnackBar/index.js +43 -0
- 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 +6 -4
- 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 +13 -9
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +11 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +22 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +6 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +27 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +41 -14
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +10 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +19 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +5 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +9 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/metaDataMapping.js +8 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +12 -11
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +6 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +21 -12
- 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 +8 -5
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
- package/dist/Editor/common/Uploader.js +16 -5
- package/dist/Editor/commonStyle.js +13 -23
- package/dist/Editor/helper/index.js +8 -12
- package/dist/Editor/helper/textIndeces.js +58 -0
- package/dist/Editor/helper/theme.js +200 -2
- package/dist/Editor/hooks/useAutoScroll.js +38 -0
- package/dist/Editor/hooks/useDrag.js +17 -11
- package/dist/Editor/hooks/useEditorScroll.js +10 -6
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +28 -13
- package/dist/Editor/hooks/useTable.js +5 -2
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +19 -15
- package/dist/Editor/plugins/withLayout.js +3 -2
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +144 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +285 -0
- package/dist/Editor/themeSettings/buttons/style.js +23 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +297 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +81 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +222 -0
- package/dist/Editor/themeSettings/fonts/style.js +59 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +328 -0
- package/dist/Editor/themeSettings/style.js +193 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +355 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +215 -0
- package/dist/Editor/themeSettingsAI/style.js +250 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +171 -47
- package/dist/Editor/utils/button.js +7 -2
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +23 -0
- package/dist/Editor/utils/dataView.js +5 -2
- package/dist/Editor/utils/divider.js +18 -2
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/embed.js +9 -4
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/freegrid.js +2 -2
- package/dist/Editor/utils/helper.js +136 -29
- package/dist/Editor/utils/signature.js +5 -2
- package/dist/Editor/utils/table.js +53 -37
- package/package.json +2 -2
@@ -1,150 +1,232 @@
|
|
1
|
-
import React, { useEffect, useRef } from "react";
|
1
|
+
import React, { useEffect, useMemo, useRef, useState } from "react";
|
2
2
|
import { Box } from "@mui/material";
|
3
3
|
import useVirtualElementStyles from "./styles";
|
4
4
|
import updateAutoProps from "./updateAutoProps";
|
5
|
-
import { calculateGridArea } from "../Utils/gridDropItem";
|
5
|
+
import { ROW_HEIGHT, 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
|
+
}
|
8
28
|
|
9
29
|
// Function to group items by path and calculate heights
|
10
|
-
function groupByPathAndCalculateHeight(
|
11
|
-
|
12
|
-
|
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
|
-
});
|
30
|
+
// function groupByPathAndCalculateHeight(allData) {
|
31
|
+
// const data = JSON.parse(JSON.stringify([...allData]));
|
32
|
+
// const root = {};
|
33
|
+
// const heightData = {};
|
37
34
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
return node.props.height;
|
43
|
-
}
|
35
|
+
// // Step 1: Group items based on their path
|
36
|
+
// data.forEach((item) => {
|
37
|
+
// const segments = item.path.split("|");
|
38
|
+
// let current = root;
|
44
39
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
});
|
40
|
+
// segments.forEach((segment, index) => {
|
41
|
+
// if (!current[segment]) {
|
42
|
+
// current[segment] = { children: {}, props: { height: 0 } };
|
43
|
+
// }
|
50
44
|
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
}
|
56
|
-
return totalHeight;
|
57
|
-
};
|
45
|
+
// if (index === segments.length - 1) {
|
46
|
+
// // Assign the properties of the item including height
|
47
|
+
// current[segment] = { ...item, children: current[segment].children };
|
48
|
+
// }
|
58
49
|
|
59
|
-
|
60
|
-
|
50
|
+
// current = current[segment].children;
|
51
|
+
// });
|
52
|
+
// });
|
53
|
+
|
54
|
+
// // Step 2: Recursively calculate the height of each parent based on children
|
55
|
+
// const calculateHeight = (node) => {
|
56
|
+
// if (!node.children || Object.keys(node.children).length === 0) {
|
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
|
+
// });
|
66
|
+
|
67
|
+
// // Update the parent's height to be the total height of its children
|
68
|
+
// node.props.height = totalHeight;
|
69
|
+
// if (node?.path) {
|
70
|
+
// heightData[node.path] = totalHeight;
|
71
|
+
// }
|
72
|
+
// return totalHeight;
|
73
|
+
// };
|
74
|
+
|
75
|
+
// // Start calculation from the root
|
76
|
+
// Object.values(root).forEach((node) => calculateHeight(node));
|
77
|
+
|
78
|
+
// return { root, heightData };
|
79
|
+
// }
|
80
|
+
|
81
|
+
const handleGridItem = (dom, lastRow) => {
|
82
|
+
const startRow = getStartRow(dom);
|
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);
|
61
98
|
return {
|
62
|
-
|
63
|
-
|
99
|
+
...gridOccupiedData,
|
100
|
+
fullHeight
|
64
101
|
};
|
65
|
-
}
|
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
|
+
};
|
66
157
|
const VirtualElement = props => {
|
67
158
|
const classes = useVirtualElementStyles();
|
68
159
|
const {
|
69
160
|
editor,
|
70
161
|
path,
|
71
|
-
|
72
|
-
|
162
|
+
updated_at,
|
163
|
+
sectionCls,
|
164
|
+
dataSets
|
73
165
|
} = props;
|
74
|
-
const cloneNode = parentEle?.cloneNode(true);
|
75
166
|
const virtualRef = useRef();
|
167
|
+
const [toggleUpdate, setToggleUpdate] = useState(false);
|
76
168
|
useEffect(() => {
|
77
169
|
if (virtualRef?.current) {
|
78
|
-
|
170
|
+
setTimeout(() => {
|
79
171
|
const allData = calculateProps(path, virtualRef?.current, ROOT_ITEM_CLASS, []);
|
80
|
-
const groupData = groupByPathAndCalculateHeight(allData);
|
172
|
+
// const groupData = groupByPathAndCalculateHeight(allData);
|
173
|
+
// console.log("allData", allData);
|
81
174
|
// it should trigger by auto alignment or on clicking mobile view change
|
82
|
-
updateAutoProps(editor, allData, "xs"
|
175
|
+
updateAutoProps(editor, allData, "xs");
|
83
176
|
}, 100);
|
84
|
-
|
177
|
+
setToggleUpdate(prev => !prev);
|
85
178
|
}
|
86
179
|
}, [updated_at, virtualRef?.current]);
|
87
180
|
const calculateProps = (curPath, dom, domClass, allData) => {
|
88
181
|
const rect = dom?.getBoundingClientRect();
|
89
|
-
|
182
|
+
|
183
|
+
// const sectionRect = virtualRef?.current?.getBoundingClientRect();
|
184
|
+
|
185
|
+
const bufferHeight = 12; // for spacing
|
186
|
+
|
90
187
|
const sectionProps = {
|
91
188
|
path: curPath,
|
92
189
|
props: {
|
93
|
-
height: rect?.height
|
190
|
+
height: rect?.height + bufferHeight
|
94
191
|
}
|
95
192
|
};
|
96
193
|
const itemsData = [];
|
97
|
-
const items = dom.querySelectorAll(domClass);
|
98
|
-
const nextItemPathLength = curPath?.split("|").length + 2;
|
99
|
-
let sectionHeight = 12;
|
194
|
+
const items = dom ? dom.querySelectorAll(domClass) : [];
|
100
195
|
for (let i = 0; i < items.length; i++) {
|
101
|
-
const
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
}
|
117
|
-
|
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;
|
196
|
+
const item = items[i];
|
197
|
+
const itemRect = item?.getBoundingClientRect();
|
198
|
+
const {
|
199
|
+
path
|
200
|
+
} = item?.dataset;
|
201
|
+
const y = Math.abs(rect.top - itemRect?.top);
|
202
|
+
itemsData.push({
|
203
|
+
path,
|
204
|
+
props: {
|
205
|
+
top: y,
|
206
|
+
left: 24,
|
207
|
+
marginTop: 12,
|
208
|
+
width: itemRect?.width,
|
209
|
+
height: itemRect?.height,
|
210
|
+
gridArea: calculateGridArea(y)
|
211
|
+
}
|
212
|
+
});
|
126
213
|
}
|
127
214
|
allData = [sectionProps, [...allData, ...itemsData]]?.flat();
|
128
215
|
return allData;
|
129
216
|
};
|
130
|
-
|
131
|
-
|
132
|
-
|
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
|
-
};
|
217
|
+
useMemo(() => {
|
218
|
+
return appendContainerItems(sectionCls, virtualRef, dataSets);
|
219
|
+
}, [toggleUpdate]);
|
139
220
|
return /*#__PURE__*/_jsx(Box, {
|
140
221
|
className: "mobile-virtual-mode",
|
141
222
|
ref: virtualRef,
|
142
|
-
sx:
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
223
|
+
sx: {
|
224
|
+
display: "grid",
|
225
|
+
gridTemplateColumns: "100%",
|
226
|
+
visibility: "hidden",
|
227
|
+
// height: `${containerHeight}px !important`,
|
228
|
+
// gridTemplateRows: `repeat(${lastRow - 1}, ${ROW_HEIGHT}px)`,
|
229
|
+
...classes.root
|
148
230
|
},
|
149
231
|
"aria-hidden": "true"
|
150
232
|
});
|
@@ -2,20 +2,28 @@ const useVirtualElementStyles = () => ({
|
|
2
2
|
root: {
|
3
3
|
width: "320px",
|
4
4
|
position: "fixed",
|
5
|
-
backgroundColor: "red",
|
6
|
-
height: "
|
5
|
+
// backgroundColor: "red",
|
6
|
+
// height: "fit-content",
|
7
7
|
overflow: "visible",
|
8
|
-
pointerEvents: "none",
|
9
|
-
opacity:
|
8
|
+
// pointerEvents: "none",
|
9
|
+
opacity: 1,
|
10
10
|
right: 0,
|
11
11
|
top: 0,
|
12
12
|
"& .freegrid-item": {
|
13
13
|
position: "relative !important",
|
14
|
-
|
14
|
+
top: "0 !important",
|
15
|
+
gridArea: "var(--gridArea_xs) !important",
|
15
16
|
width: "calc(100% - 48px) !important",
|
16
|
-
height: "
|
17
|
+
height: "var(--height_xs) !important",
|
17
18
|
left: "24px !important",
|
18
|
-
marginTop: "
|
19
|
+
marginTop: "var(--marginTop_xs) !important",
|
20
|
+
outline: "1px solid gray !important",
|
21
|
+
// "&.type_box": {
|
22
|
+
// // display: "grid !important",
|
23
|
+
// // gridTemplateRows: "repeat(auto-fill, 50px) !important",
|
24
|
+
// // height: "min-content !important",
|
25
|
+
// },
|
26
|
+
|
19
27
|
"& .debug-info, & .editor-blocker": {
|
20
28
|
display: "none"
|
21
29
|
},
|
@@ -25,4 +33,83 @@ const useVirtualElementStyles = () => ({
|
|
25
33
|
}
|
26
34
|
}
|
27
35
|
});
|
28
|
-
export default useVirtualElementStyles;
|
36
|
+
export default useVirtualElementStyles;
|
37
|
+
export const useAutoAlignStyles = () => ({
|
38
|
+
root: {
|
39
|
+
width: "320px",
|
40
|
+
position: "fixed",
|
41
|
+
overflow: "visible",
|
42
|
+
opacity: 1,
|
43
|
+
right: 0,
|
44
|
+
top: 0,
|
45
|
+
height: "auto !important",
|
46
|
+
zIndex: 99999999,
|
47
|
+
"& .freegrid-item": {
|
48
|
+
position: "relative !important",
|
49
|
+
top: "0 !important",
|
50
|
+
gridArea: "none !important",
|
51
|
+
width: "calc(100% - 48px) !important",
|
52
|
+
height: "var(--height_xs) !important",
|
53
|
+
left: "24px !important",
|
54
|
+
marginTop: "12px !important",
|
55
|
+
minHeight: "auto",
|
56
|
+
"&.type_box": {
|
57
|
+
height: "auto !important"
|
58
|
+
},
|
59
|
+
// start - default signature classes on free-grid
|
60
|
+
"& .fgi_type_signature": {
|
61
|
+
height: "100%",
|
62
|
+
"& .signature-container": {
|
63
|
+
height: "100%",
|
64
|
+
LineHeight: 1.43,
|
65
|
+
"& .signature-btn-container": {
|
66
|
+
height: "100%",
|
67
|
+
display: "flex",
|
68
|
+
flexDirection: "column",
|
69
|
+
"& .sign-placeholder": {
|
70
|
+
display: "flex",
|
71
|
+
// remove hidden sign placeholder
|
72
|
+
width: "100%",
|
73
|
+
flexGrow: 1
|
74
|
+
},
|
75
|
+
"& button": {
|
76
|
+
margin: "6px 0px"
|
77
|
+
}
|
78
|
+
}
|
79
|
+
}
|
80
|
+
},
|
81
|
+
"& .fgi_type_sign": {
|
82
|
+
width: "100%",
|
83
|
+
height: "100%",
|
84
|
+
"& .signature-signed-wrapper": {
|
85
|
+
width: "100%",
|
86
|
+
height: "100%",
|
87
|
+
"& .signature-signed-span": {
|
88
|
+
width: "100%",
|
89
|
+
height: "100%",
|
90
|
+
"& .signed-btn": {
|
91
|
+
width: "100%",
|
92
|
+
height: "100%",
|
93
|
+
display: "flex",
|
94
|
+
flexDirection: "column",
|
95
|
+
"& img": {
|
96
|
+
width: "100% !important",
|
97
|
+
maxWidth: "none !important",
|
98
|
+
height: "70% !important",
|
99
|
+
flexGrow: 1
|
100
|
+
}
|
101
|
+
}
|
102
|
+
}
|
103
|
+
}
|
104
|
+
},
|
105
|
+
// end - default signature classes on free-grid
|
106
|
+
|
107
|
+
"& .debug-info, & .editor-blocker": {
|
108
|
+
display: "none"
|
109
|
+
},
|
110
|
+
"& .embed": {
|
111
|
+
minHeight: "300px"
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Node, Transforms } from "slate";
|
2
|
-
const updateAutoProps = (editor, datas = [], breakpoint = "",
|
2
|
+
const updateAutoProps = (editor, datas = [], breakpoint = "", updateAll) => {
|
3
3
|
try {
|
4
4
|
// const { heightData } = groupData;
|
5
5
|
for (let i = 0; i < datas.length; i++) {
|
@@ -14,9 +14,11 @@ const updateAutoProps = (editor, datas = [], breakpoint = "", groupData) => {
|
|
14
14
|
return a;
|
15
15
|
}, {});
|
16
16
|
const oldProps = Node.get(editor, int_path);
|
17
|
-
|
17
|
+
const updateNode = !oldProps?.xs_updatedOn || updateAll;
|
18
|
+
if (updateNode) {
|
18
19
|
Transforms.setNodes(editor, {
|
19
|
-
...updatedProps
|
20
|
+
...updatedProps,
|
21
|
+
xs_updatedOn: new Date().getTime()
|
20
22
|
}, {
|
21
23
|
at: int_path
|
22
24
|
});
|
@@ -6,7 +6,7 @@ import Handles from "./TransformHandles";
|
|
6
6
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
7
7
|
import ElementOptions from "./ElementOptions";
|
8
8
|
import ElementSettings from "./ElementSettings";
|
9
|
-
import { getClosestDraggable, getParentSectionPath } from "./Utils";
|
9
|
+
import { getAbsolutePositionX, getAbsolutePositionY, getClosestDraggable, getParentSectionPath } from "./Utils";
|
10
10
|
import DragInfo from "./DragInfo";
|
11
11
|
import GuideLines from "./GuideLines";
|
12
12
|
import ShadowElement from "./ShadowElement";
|
@@ -19,6 +19,10 @@ 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";
|
22
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
23
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
24
28
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
@@ -64,7 +68,10 @@ const RnD = props => {
|
|
64
68
|
editor,
|
65
69
|
breakpoint = "",
|
66
70
|
handleContextMenuClick = () => {},
|
67
|
-
itemData = {}
|
71
|
+
itemData = {},
|
72
|
+
customProps,
|
73
|
+
sectionElement,
|
74
|
+
dataSets
|
68
75
|
} = props;
|
69
76
|
const {
|
70
77
|
isSelectedElement,
|
@@ -72,7 +79,9 @@ const RnD = props => {
|
|
72
79
|
updateDragging,
|
73
80
|
contextMenu,
|
74
81
|
setContextMenu,
|
75
|
-
theme
|
82
|
+
theme,
|
83
|
+
autoAlign,
|
84
|
+
setAutoAlign
|
76
85
|
} = useEditorContext();
|
77
86
|
const str_path = path.join("|");
|
78
87
|
const selectedElementProps = isSelectedElement(str_path, type);
|
@@ -106,6 +115,13 @@ const RnD = props => {
|
|
106
115
|
y: 0
|
107
116
|
});
|
108
117
|
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");
|
109
125
|
useEffect(() => {
|
110
126
|
if (ITEM_TYPES.includes(type)) {
|
111
127
|
if (enable === 1) {
|
@@ -341,6 +357,16 @@ const RnD = props => {
|
|
341
357
|
};
|
342
358
|
const onDrag = e => {
|
343
359
|
e.preventDefault();
|
360
|
+
const {
|
361
|
+
clientY
|
362
|
+
} = e;
|
363
|
+
if (clientY < 50) {
|
364
|
+
startAutoScroll("up");
|
365
|
+
} else if (window.innerHeight - clientY < 50) {
|
366
|
+
startAutoScroll("down");
|
367
|
+
} else {
|
368
|
+
stopAutoScroll();
|
369
|
+
}
|
344
370
|
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)");
|
345
371
|
setAbsPosition({
|
346
372
|
...absPosition,
|
@@ -383,6 +409,7 @@ const RnD = props => {
|
|
383
409
|
const onDragStop = (e, d) => {
|
384
410
|
e.preventDefault();
|
385
411
|
e.stopPropagation();
|
412
|
+
stopAutoScroll();
|
386
413
|
if (dragging?.isDragging === 2 && dragging?.position?.strXY && dragging?.dragOver) {
|
387
414
|
d.x = e.x;
|
388
415
|
d.y = e.y;
|
@@ -425,14 +452,36 @@ const RnD = props => {
|
|
425
452
|
};
|
426
453
|
const onResizeStop = (e, direction, ref, d, position) => {
|
427
454
|
e.preventDefault();
|
455
|
+
let updatedPosition = {};
|
456
|
+
if (type !== "parent") {
|
457
|
+
// update element position while resizing, (for free grid box and item)
|
458
|
+
const {
|
459
|
+
absolutePositionX
|
460
|
+
} = getAbsolutePositionX(ref);
|
461
|
+
const {
|
462
|
+
gridArea,
|
463
|
+
marginTop
|
464
|
+
} = getAbsolutePositionY(ref);
|
465
|
+
updatedPosition = {
|
466
|
+
left: absolutePositionX,
|
467
|
+
gridArea: gridArea,
|
468
|
+
marginTop: marginTop
|
469
|
+
};
|
470
|
+
}
|
428
471
|
const updatedSize = {
|
429
472
|
width: delta?.width + d.width,
|
430
|
-
height:
|
473
|
+
height: ref.offsetHeight,
|
474
|
+
...updatedPosition
|
431
475
|
};
|
432
476
|
onChange({
|
433
477
|
...updatedSize
|
434
478
|
});
|
435
479
|
handleResizeEvent("stop");
|
480
|
+
const parentPath = getParentSectionPath({
|
481
|
+
ref
|
482
|
+
}, ".freegrid-container-parent");
|
483
|
+
const formatParentPath = parentPath?.split("|")?.map(m => parseInt(m));
|
484
|
+
reRenderChildNodes(editor, formatParentPath);
|
436
485
|
};
|
437
486
|
const onCloseSettings = () => {
|
438
487
|
setSelectedElement({
|
@@ -500,12 +549,15 @@ const RnD = props => {
|
|
500
549
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
501
550
|
children: [/*#__PURE__*/_jsxs(Box, {
|
502
551
|
component: Rnd,
|
503
|
-
placeholder: ItemTypes[childType] || "Item",
|
552
|
+
placeholder: translation(ItemTypes[childType]) || translation("Item"),
|
504
553
|
id: eId || "",
|
505
554
|
ref: c => {
|
506
555
|
positionRef.current = c;
|
507
556
|
},
|
508
|
-
className: `${className || ""} ${dragInfoOpen ? "active-drag" : "inactive-drag"} enable-${enable} type_${childType} section_type_${type || "parent"}
|
557
|
+
className: `${className || ""} ${dragInfoOpen ? "active-drag" : "inactive-drag"} enable-${enable} type_${childType} section_type_${type || "parent"} ${Object.keys(absPosition)?.length ? "" : "remove-resize-styles"
|
558
|
+
// Fix rerender issue (remove-resize-styles): After resizing, click close button on a free grid-selected element
|
559
|
+
// doesn't remove the default `transform` style from react-rnd. Removing it manually.
|
560
|
+
}`,
|
509
561
|
"data-path": str_path,
|
510
562
|
style: {
|
511
563
|
position: "relative",
|
@@ -531,6 +583,7 @@ const RnD = props => {
|
|
531
583
|
...DISABLE_RESIZING
|
532
584
|
},
|
533
585
|
...getEventProps(),
|
586
|
+
...(dataSets || {}),
|
534
587
|
children: [/*#__PURE__*/_jsx("div", {
|
535
588
|
id: `opt_ref_${str_path}`,
|
536
589
|
style: {
|
@@ -564,7 +617,9 @@ const RnD = props => {
|
|
564
617
|
optionsProps: optionsProps,
|
565
618
|
selectedAction: currentAction,
|
566
619
|
path: str_path,
|
567
|
-
theme: theme
|
620
|
+
theme: theme,
|
621
|
+
translation: translation,
|
622
|
+
customProps: customProps
|
568
623
|
}) : null, /*#__PURE__*/_jsx(ElementSettings, {
|
569
624
|
open: Boolean(currentAction),
|
570
625
|
currentAction: currentAction,
|
@@ -598,12 +653,29 @@ const RnD = props => {
|
|
598
653
|
open: openContextMenu,
|
599
654
|
contextMenu: contextMenu,
|
600
655
|
handleClose: handleClose,
|
601
|
-
theme: theme
|
656
|
+
theme: theme,
|
657
|
+
translation: translation
|
602
658
|
}), type === "parent" && breakpoint === "lg" && !readOnly ? /*#__PURE__*/_jsx(VirtualElement, {
|
603
|
-
parentEle: positionRef?.current?.resizableElement?.current,
|
604
659
|
updated_at: updated_at,
|
605
660
|
path: str_path,
|
606
|
-
editor: editor
|
661
|
+
editor: editor,
|
662
|
+
sectionElement: sectionElement,
|
663
|
+
sectionCls: `.freegrid-section_${path.join("_")}`,
|
664
|
+
dataSets: dataSets
|
665
|
+
}) : null, childType === "text" && breakpoint === "lg" && !readOnly ? /*#__PURE__*/_jsx(VirtualTextElement, {
|
666
|
+
editor: editor,
|
667
|
+
dataSets: dataSets,
|
668
|
+
getCurrentEle: getCurrentEle,
|
669
|
+
path: path
|
670
|
+
}) : null, type === "parent" && breakpoint === "xs" && !readOnly && autoAlign ? /*#__PURE__*/_jsx(ForceAutoAlignment, {
|
671
|
+
updated_at: updated_at,
|
672
|
+
path: str_path,
|
673
|
+
editor: editor,
|
674
|
+
sectionElement: sectionElement,
|
675
|
+
sectionCls: `.freegrid-section_${path.join("_")}`,
|
676
|
+
dataSets: dataSets,
|
677
|
+
autoAlign: autoAlign,
|
678
|
+
setAutoAlign: setAutoAlign
|
607
679
|
}) : null]
|
608
680
|
});
|
609
681
|
};
|