@flozy/editor 9.2.8 → 9.3.0
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 +46 -11
- package/dist/Editor/CommonEditor.js +165 -29
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +19 -1
- 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 +57 -12
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +5 -5
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
- 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/Select.js +3 -4
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/styles.js +6 -1
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/DateType.js +19 -9
- 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 +3 -2
- 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 +7 -6
- package/dist/Editor/Elements/DataView/Layouts/Options/EditProperty.js +15 -12
- 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 +12 -6
- package/dist/Editor/Elements/DataView/Layouts/TableStyles.js +32 -2
- package/dist/Editor/Elements/DataView/Layouts/TableView.js +132 -33
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +3 -3
- package/dist/Editor/Elements/DataView/Layouts/index.js +3 -1
- package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +6 -3
- package/dist/Editor/Elements/DataView/styles.js +8 -8
- 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/Image.js +16 -11
- 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 +21 -18
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +6 -2
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +8 -3
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +3 -2
- package/dist/Editor/Elements/FreeGrid/Options/More.js +4 -3
- 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 +15 -10
- 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 +79 -45
- 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 -5
- 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 +6 -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/Style.js +28 -2
- package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
- package/dist/Editor/MiniEditor.js +9 -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 -15
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +20 -15
- package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +19 -13
- 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 -12
- package/dist/Editor/Toolbar/PopupTool/TemplateCard.js +11 -5
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +120 -41
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +3 -8
- 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/ThemeIcons.js +291 -0
- package/dist/Editor/common/ColorPickerButton.js +35 -9
- package/dist/Editor/common/CustomColorPicker/index.js +106 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +88 -0
- package/dist/Editor/common/CustomDialog/styles.js +80 -0
- 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/DnD/Draggable.js +0 -1
- package/dist/Editor/common/FontLoader/FontLoader.js +3 -0
- package/dist/Editor/common/Icon.js +28 -0
- package/dist/Editor/common/ImageSelector/ImageSelector.js +10 -8
- package/dist/Editor/common/ImageSelector/Options/AddLink.js +6 -4
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/ImageSelector/UploadStyles.js +0 -1
- 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 +109 -71
- 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 +4 -2
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- 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 +5 -4
- package/dist/Editor/common/RnD/Utils/index.js +45 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +1 -2
- package/dist/Editor/common/RnD/index.js +34 -7
- package/dist/Editor/common/Section/index.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +93 -10
- 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 +114 -69
- 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/useDrag.js +16 -10
- package/dist/Editor/hooks/useEditorScroll.js +10 -5
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +25 -13
- package/dist/Editor/hooks/useTable.js +1 -1
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +19 -14
- 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 +283 -0
- package/dist/Editor/themeSettings/buttons/style.js +21 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +292 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
- package/dist/Editor/themeSettings/fonts/index.js +220 -0
- package/dist/Editor/themeSettings/fonts/style.js +44 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +320 -0
- package/dist/Editor/themeSettings/style.js +152 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +356 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +197 -0
- package/dist/Editor/themeSettingsAI/style.js +250 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +162 -45
- package/dist/Editor/utils/button.js +0 -14
- package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +23 -0
- package/dist/Editor/utils/divider.js +8 -0
- 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/helper.js +77 -19
- package/dist/Editor/utils/link.js +1 -1
- package/dist/Editor/utils/table.js +8 -0
- package/package.json +5 -2
@@ -8,7 +8,8 @@ const BoxSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path];
|
@@ -27,7 +28,7 @@ const BoxSettings = props => {
|
|
27
28
|
});
|
28
29
|
};
|
29
30
|
const handleClose = () => {
|
30
|
-
|
31
|
+
onClose();
|
31
32
|
};
|
32
33
|
return /*#__PURE__*/_jsx(Box, {
|
33
34
|
component: "div",
|
@@ -8,7 +8,8 @@ const ButtonSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -28,7 +29,7 @@ const ButtonSettings = props => {
|
|
28
29
|
});
|
29
30
|
};
|
30
31
|
const handleClose = () => {
|
31
|
-
|
32
|
+
onClose();
|
32
33
|
};
|
33
34
|
return /*#__PURE__*/_jsx(Box, {
|
34
35
|
component: "div",
|
@@ -8,7 +8,8 @@ const CodeSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -27,7 +28,7 @@ const CodeSettings = props => {
|
|
27
28
|
});
|
28
29
|
};
|
29
30
|
const handleClose = () => {
|
30
|
-
|
31
|
+
onClose();
|
31
32
|
};
|
32
33
|
return /*#__PURE__*/_jsx(Box, {
|
33
34
|
component: "div",
|
@@ -12,14 +12,16 @@ const FormSettings = props => {
|
|
12
12
|
const {
|
13
13
|
editor,
|
14
14
|
path,
|
15
|
-
customProps
|
15
|
+
customProps,
|
16
|
+
onClose
|
16
17
|
} = props;
|
17
18
|
const item_path = path?.split("|").map(m => parseInt(m));
|
18
19
|
const element_path = [...item_path];
|
19
20
|
const element = Node.get(editor, element_path);
|
20
21
|
const styleMaps = formStyle;
|
21
22
|
const {
|
22
|
-
hideTools
|
23
|
+
hideTools,
|
24
|
+
translation
|
23
25
|
} = customProps || {};
|
24
26
|
const {
|
25
27
|
theme
|
@@ -55,13 +57,14 @@ const FormSettings = props => {
|
|
55
57
|
}
|
56
58
|
};
|
57
59
|
const handleClose = () => {
|
58
|
-
|
60
|
+
onClose();
|
59
61
|
};
|
60
62
|
const muiTheme = createTheme({
|
61
63
|
components: {
|
62
64
|
MuiAccordion: {
|
63
65
|
styleOverrides: {
|
64
66
|
root: {
|
67
|
+
background: theme?.palette?.editor?.miniToolBarBackground,
|
65
68
|
"& .MuiAccordionSummary-root": {
|
66
69
|
flexDirection: "row-reverse",
|
67
70
|
"& .MuiSvgIcon-root": {
|
@@ -107,7 +110,7 @@ const FormSettings = props => {
|
|
107
110
|
fontSize: "14px !important",
|
108
111
|
fontWeight: "400"
|
109
112
|
},
|
110
|
-
children: m?.tab
|
113
|
+
children: translation(m?.tab)
|
111
114
|
})
|
112
115
|
}), /*#__PURE__*/_jsx(AccordionDetails, {
|
113
116
|
sx: {
|
@@ -8,7 +8,8 @@ const ImageSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -27,7 +28,7 @@ const ImageSettings = props => {
|
|
27
28
|
});
|
28
29
|
};
|
29
30
|
const handleClose = () => {
|
30
|
-
|
31
|
+
onClose();
|
31
32
|
};
|
32
33
|
return /*#__PURE__*/_jsx(Box, {
|
33
34
|
component: "div",
|
@@ -9,7 +9,8 @@ const TableSettings = props => {
|
|
9
9
|
const {
|
10
10
|
editor,
|
11
11
|
path,
|
12
|
-
customProps
|
12
|
+
customProps,
|
13
|
+
onClose
|
13
14
|
} = props;
|
14
15
|
const item_path = path?.split("|").map(m => parseInt(m));
|
15
16
|
const element_path = [...item_path, 0];
|
@@ -57,7 +58,7 @@ const TableSettings = props => {
|
|
57
58
|
}
|
58
59
|
};
|
59
60
|
const handleClose = () => {
|
60
|
-
|
61
|
+
onClose();
|
61
62
|
};
|
62
63
|
return /*#__PURE__*/_jsx(Box, {
|
63
64
|
component: "div",
|
@@ -8,7 +8,8 @@ const TextSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
theme
|
11
|
+
theme,
|
12
|
+
customProps
|
12
13
|
} = props;
|
13
14
|
const item_path = path.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -25,7 +26,8 @@ const TextSettings = props => {
|
|
25
26
|
}, []);
|
26
27
|
return /*#__PURE__*/_jsx(TextFormat, {
|
27
28
|
classes: classes,
|
28
|
-
editor: editor
|
29
|
+
editor: editor,
|
30
|
+
customProps: customProps
|
29
31
|
});
|
30
32
|
};
|
31
33
|
export default TextSettings;
|
@@ -8,7 +8,8 @@ const VideoSettings = props => {
|
|
8
8
|
const {
|
9
9
|
editor,
|
10
10
|
path,
|
11
|
-
customProps
|
11
|
+
customProps,
|
12
|
+
onClose
|
12
13
|
} = props;
|
13
14
|
const item_path = path?.split("|").map(m => parseInt(m));
|
14
15
|
const element_path = [...item_path, 0];
|
@@ -28,7 +29,7 @@ const VideoSettings = props => {
|
|
28
29
|
});
|
29
30
|
};
|
30
31
|
const handleClose = () => {
|
31
|
-
|
32
|
+
onClose();
|
32
33
|
};
|
33
34
|
return /*#__PURE__*/_jsx(Box, {
|
34
35
|
component: "div",
|
@@ -17,7 +17,8 @@ const OptionsPopup = props => {
|
|
17
17
|
open,
|
18
18
|
anchorEl,
|
19
19
|
placement,
|
20
|
-
handleClose
|
20
|
+
handleClose,
|
21
|
+
translation
|
21
22
|
} = props;
|
22
23
|
return anchorEl ? /*#__PURE__*/_jsx(Popper, {
|
23
24
|
sx: classes.root,
|
@@ -30,10 +31,10 @@ const OptionsPopup = props => {
|
|
30
31
|
children: [/*#__PURE__*/_jsxs(Typography, {
|
31
32
|
variant: "div",
|
32
33
|
className: "item-wrapper title",
|
33
|
-
children: [title, /*#__PURE__*/_jsx(Box, {
|
34
|
+
children: [translation(title), /*#__PURE__*/_jsx(Box, {
|
34
35
|
component: "div",
|
35
36
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
36
|
-
title: "Close",
|
37
|
+
title: translation("Close"),
|
37
38
|
arrow: true,
|
38
39
|
children: /*#__PURE__*/_jsx(IconButton, {
|
39
40
|
onClick: handleClose,
|
@@ -9,19 +9,26 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
9
|
const SwitchViewport = props => {
|
10
10
|
const {
|
11
11
|
breakpoint,
|
12
|
-
onChange
|
12
|
+
onChange,
|
13
|
+
translation,
|
14
|
+
show
|
13
15
|
} = props;
|
14
16
|
const classes = useSwitchViewport();
|
15
17
|
const {
|
18
|
+
setSelectedElement,
|
16
19
|
setActiveBreakPoint
|
17
20
|
} = useEditorContext();
|
18
21
|
useEffect(() => {
|
19
|
-
|
22
|
+
// to reset selection on viewport changes - FS-6589
|
23
|
+
setSelectedElement({});
|
20
24
|
}, [breakpoint]);
|
21
25
|
return /*#__PURE__*/_jsxs(Box, {
|
22
26
|
sx: classes.root,
|
27
|
+
style: {
|
28
|
+
display: show ? "block" : "none"
|
29
|
+
},
|
23
30
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
24
|
-
title: "Desktop View",
|
31
|
+
title: translation("Desktop View"),
|
25
32
|
children: /*#__PURE__*/_jsx(IconButton, {
|
26
33
|
className: `${!breakpoint || breakpoint === "lg" ? "active" : ""}`,
|
27
34
|
onClick: () => {
|
@@ -31,7 +38,7 @@ const SwitchViewport = props => {
|
|
31
38
|
children: /*#__PURE__*/_jsx(PersonalVideoIcon, {})
|
32
39
|
})
|
33
40
|
}), /*#__PURE__*/_jsx(Tooltip, {
|
34
|
-
title: "Mobile View",
|
41
|
+
title: translation("Mobile View"),
|
35
42
|
children: /*#__PURE__*/_jsx(IconButton, {
|
36
43
|
className: `${breakpoint === "xs" ? "active" : ""}`,
|
37
44
|
onClick: () => {
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { Experimental_CssVarsProvider as CssVarsProvider, experimental_extendTheme as extendTheme } from "@mui/material/styles";
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
3
|
+
function MainThemeProvider({
|
4
|
+
children,
|
5
|
+
userSelectedTheme,
|
6
|
+
theme = {}
|
7
|
+
}) {
|
8
|
+
const themeVars = extendTheme(userSelectedTheme?.theme?.cssVars || {});
|
9
|
+
return /*#__PURE__*/_jsx(CssVarsProvider, {
|
10
|
+
theme: {
|
11
|
+
...themeVars,
|
12
|
+
...theme
|
13
|
+
},
|
14
|
+
children: children
|
15
|
+
});
|
16
|
+
}
|
17
|
+
export default MainThemeProvider;
|
@@ -1,9 +1,20 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { useTheme,
|
2
|
+
import { useTheme, createTheme } from "@mui/material";
|
3
3
|
import { isStimulator, STIMULATOR_MOCK } from "../../../hooks/useBreakpoints";
|
4
|
+
import MainThemeProvider from "./MainThemeProvider";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const isPdf = () => {
|
7
|
+
try {
|
8
|
+
const hash = window.location.hash;
|
9
|
+
const queryString = hash.split("?")[1]; // Get part after "?"
|
10
|
+
const params = new URLSearchParams(queryString);
|
11
|
+
return params.get("isPdf");
|
12
|
+
} catch (err) {
|
13
|
+
console.log(err);
|
14
|
+
}
|
15
|
+
};
|
4
16
|
|
5
17
|
// Custom breakpoints functions
|
6
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
7
18
|
const customUp = (key, breakpoints) => {
|
8
19
|
const MOCK_BREAKPOINT = isStimulator();
|
9
20
|
if (key === "xs") {
|
@@ -49,9 +60,9 @@ const getBreakPoints = prevTheme => {
|
|
49
60
|
};
|
50
61
|
|
51
62
|
// Extend the existing theme with custom breakpoint functions
|
52
|
-
const extendedTheme =
|
63
|
+
const extendedTheme = prevTheme => createTheme({
|
53
64
|
...prevTheme,
|
54
|
-
breakpoints:
|
65
|
+
breakpoints: isPdf() ? {
|
55
66
|
values: {
|
56
67
|
...prevTheme.breakpoints.values,
|
57
68
|
md: 400 // To resolve, while taking pdf on A4 size, it is getting mobile view because of breakpoint
|
@@ -59,13 +70,14 @@ const extendedTheme = (prevTheme, isPrintMode) => createTheme({
|
|
59
70
|
} : getBreakPoints(prevTheme)
|
60
71
|
});
|
61
72
|
const ViewportStimulator = ({
|
62
|
-
children
|
73
|
+
children,
|
74
|
+
selectedTheme
|
63
75
|
}) => {
|
64
76
|
const theme = useTheme();
|
65
|
-
const
|
66
|
-
|
67
|
-
return /*#__PURE__*/_jsx(ThemeProvider, {
|
77
|
+
const viewportTheme = extendedTheme(theme);
|
78
|
+
return /*#__PURE__*/_jsx(MainThemeProvider, {
|
68
79
|
theme: viewportTheme,
|
80
|
+
userSelectedTheme: selectedTheme,
|
69
81
|
children: children
|
70
82
|
});
|
71
83
|
};
|
@@ -2,10 +2,11 @@ import { Transforms, Node, Path } from "slate";
|
|
2
2
|
import { ReactEditor } from "slate-react";
|
3
3
|
import { handleNegativeInteger } from "../../../utils/helper";
|
4
4
|
export const ROW_HEIGHT = 50;
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
|
6
|
+
// const MARGIN_OF = {
|
7
|
+
// xs: 160,
|
8
|
+
// lg: 490,
|
9
|
+
// };
|
9
10
|
|
10
11
|
/**
|
11
12
|
* This method will update the grid template rows of parent section based on height
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import { Transforms, Node } from "slate";
|
2
2
|
import { ReactEditor } from "slate-react";
|
3
3
|
import { getNearestItem } from "./calculateDropItem";
|
4
|
+
import { ROW_HEIGHT, getBorderWidth } from "./gridDropItem";
|
5
|
+
import { handleNegativeInteger } from "../../../utils/helper";
|
6
|
+
import { getDevice } from "../../../helper/theme";
|
4
7
|
const GUIDE_LINE_THRESHOLD = 5;
|
5
8
|
const GUIDE_LINE_OVERLAP_THRESHOLD = 5;
|
6
9
|
const handleMoveNode = (editor, path, newPath, {
|
@@ -248,4 +251,46 @@ export function getParentSectionPath(props, closestClass) {
|
|
248
251
|
} catch (err) {
|
249
252
|
console.log(err);
|
250
253
|
}
|
254
|
+
}
|
255
|
+
export function getAbsolutePositionX(currentEle) {
|
256
|
+
const isMobile = getDevice(window.innerWidth) === "xs";
|
257
|
+
const {
|
258
|
+
left: currElementLeft
|
259
|
+
} = currentEle?.getBoundingClientRect() || {};
|
260
|
+
let parentBoxDom = currentEle?.closest(".fgi_type_box");
|
261
|
+
if (isMobile && !parentBoxDom) {
|
262
|
+
parentBoxDom = currentEle?.closest(".freegrid-section");
|
263
|
+
}
|
264
|
+
const relativeElementX = parentBoxDom || document.querySelector(".rnd-guideline-lv");
|
265
|
+
const {
|
266
|
+
left
|
267
|
+
} = relativeElementX?.getBoundingClientRect() || {};
|
268
|
+
const borderLeftWidth = getBorderWidth(relativeElementX, "borderLeftWidth");
|
269
|
+
const absolutePositionX = parseInt(currElementLeft - left - borderLeftWidth);
|
270
|
+
return {
|
271
|
+
absolutePositionX
|
272
|
+
};
|
273
|
+
}
|
274
|
+
export function getAbsolutePositionY(currentEle) {
|
275
|
+
const {
|
276
|
+
top: currElementTop
|
277
|
+
} = currentEle?.getBoundingClientRect() || {};
|
278
|
+
const relativeElementY = currentEle?.closest(".freegrid-container-parent");
|
279
|
+
const borderTopWidth = getBorderWidth(relativeElementY, "borderTopWidth");
|
280
|
+
const rect = relativeElementY.getBoundingClientRect();
|
281
|
+
const absolutePositionY = handleNegativeInteger(currElementTop - rect.top - borderTopWidth);
|
282
|
+
|
283
|
+
// Calculate grid position
|
284
|
+
const row = Math.floor(absolutePositionY / ROW_HEIGHT) + 1;
|
285
|
+
|
286
|
+
// Update grid area
|
287
|
+
const gridArea = `${row} / 1 / ${row + 1} / 2`;
|
288
|
+
|
289
|
+
// to calculate difference inside the grid
|
290
|
+
const marginTop = Math.abs((row - 1) * ROW_HEIGHT - absolutePositionY);
|
291
|
+
return {
|
292
|
+
absolutePositionY,
|
293
|
+
gridArea,
|
294
|
+
marginTop
|
295
|
+
};
|
251
296
|
}
|
@@ -75,13 +75,12 @@ const VirtualElement = props => {
|
|
75
75
|
const virtualRef = useRef();
|
76
76
|
useEffect(() => {
|
77
77
|
if (virtualRef?.current) {
|
78
|
-
|
78
|
+
setTimeout(() => {
|
79
79
|
const allData = calculateProps(path, virtualRef?.current, ROOT_ITEM_CLASS, []);
|
80
80
|
const groupData = groupByPathAndCalculateHeight(allData);
|
81
81
|
// it should trigger by auto alignment or on clicking mobile view change
|
82
82
|
updateAutoProps(editor, allData, "xs", groupData);
|
83
83
|
}, 100);
|
84
|
-
return () => clearTimeout(timeoutId);
|
85
84
|
}
|
86
85
|
}, [updated_at, virtualRef?.current]);
|
87
86
|
const calculateProps = (curPath, dom, domClass, allData) => {
|
@@ -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";
|
@@ -64,7 +64,8 @@ const RnD = props => {
|
|
64
64
|
editor,
|
65
65
|
breakpoint = "",
|
66
66
|
handleContextMenuClick = () => {},
|
67
|
-
itemData = {}
|
67
|
+
itemData = {},
|
68
|
+
customProps
|
68
69
|
} = props;
|
69
70
|
const {
|
70
71
|
isSelectedElement,
|
@@ -106,6 +107,9 @@ const RnD = props => {
|
|
106
107
|
y: 0
|
107
108
|
});
|
108
109
|
const parentSectionPath = str_path?.split("|").slice(0, 2).join("_");
|
110
|
+
const {
|
111
|
+
translation
|
112
|
+
} = customProps;
|
109
113
|
useEffect(() => {
|
110
114
|
if (ITEM_TYPES.includes(type)) {
|
111
115
|
if (enable === 1) {
|
@@ -425,9 +429,26 @@ const RnD = props => {
|
|
425
429
|
};
|
426
430
|
const onResizeStop = (e, direction, ref, d, position) => {
|
427
431
|
e.preventDefault();
|
432
|
+
let updatedPosition = {};
|
433
|
+
if (type !== "parent") {
|
434
|
+
// update element position while resizing, (for free grid box and item)
|
435
|
+
const {
|
436
|
+
absolutePositionX
|
437
|
+
} = getAbsolutePositionX(ref);
|
438
|
+
const {
|
439
|
+
gridArea,
|
440
|
+
marginTop
|
441
|
+
} = getAbsolutePositionY(ref);
|
442
|
+
updatedPosition = {
|
443
|
+
left: absolutePositionX,
|
444
|
+
gridArea: gridArea,
|
445
|
+
marginTop: marginTop
|
446
|
+
};
|
447
|
+
}
|
428
448
|
const updatedSize = {
|
429
449
|
width: delta?.width + d.width,
|
430
|
-
height: delta?.height + d.height
|
450
|
+
height: delta?.height + d.height,
|
451
|
+
...updatedPosition
|
431
452
|
};
|
432
453
|
onChange({
|
433
454
|
...updatedSize
|
@@ -500,12 +521,15 @@ const RnD = props => {
|
|
500
521
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
501
522
|
children: [/*#__PURE__*/_jsxs(Box, {
|
502
523
|
component: Rnd,
|
503
|
-
placeholder: ItemTypes[childType] || "Item",
|
524
|
+
placeholder: translation(ItemTypes[childType]) || translation("Item"),
|
504
525
|
id: eId || "",
|
505
526
|
ref: c => {
|
506
527
|
positionRef.current = c;
|
507
528
|
},
|
508
|
-
className: `${className || ""} ${dragInfoOpen ? "active-drag" : "inactive-drag"} enable-${enable} type_${childType} section_type_${type || "parent"}
|
529
|
+
className: `${className || ""} ${dragInfoOpen ? "active-drag" : "inactive-drag"} enable-${enable} type_${childType} section_type_${type || "parent"} ${Object.keys(absPosition)?.length ? "" : "remove-resize-styles"
|
530
|
+
// Fix rerender issue (remove-resize-styles): After resizing, click close button on a free grid-selected element
|
531
|
+
// doesn't remove the default `transform` style from react-rnd. Removing it manually.
|
532
|
+
}`,
|
509
533
|
"data-path": str_path,
|
510
534
|
style: {
|
511
535
|
position: "relative",
|
@@ -564,7 +588,9 @@ const RnD = props => {
|
|
564
588
|
optionsProps: optionsProps,
|
565
589
|
selectedAction: currentAction,
|
566
590
|
path: str_path,
|
567
|
-
theme: theme
|
591
|
+
theme: theme,
|
592
|
+
translation: translation,
|
593
|
+
customProps: customProps
|
568
594
|
}) : null, /*#__PURE__*/_jsx(ElementSettings, {
|
569
595
|
open: Boolean(currentAction),
|
570
596
|
currentAction: currentAction,
|
@@ -598,7 +624,8 @@ const RnD = props => {
|
|
598
624
|
open: openContextMenu,
|
599
625
|
contextMenu: contextMenu,
|
600
626
|
handleClose: handleClose,
|
601
|
-
theme: theme
|
627
|
+
theme: theme,
|
628
|
+
translation: translation
|
602
629
|
}), type === "parent" && breakpoint === "lg" && !readOnly ? /*#__PURE__*/_jsx(VirtualElement, {
|
603
630
|
parentEle: positionRef?.current?.resizableElement?.current,
|
604
631
|
updated_at: updated_at,
|
@@ -18,7 +18,8 @@ const Toolbar = ({
|
|
18
18
|
readOnly,
|
19
19
|
showTool,
|
20
20
|
onSettings,
|
21
|
-
isSectionFullWidth
|
21
|
+
isSectionFullWidth,
|
22
|
+
translation
|
22
23
|
}) => {
|
23
24
|
return !readOnly && !showTool ? /*#__PURE__*/_jsx(Box, {
|
24
25
|
component: "div",
|
@@ -32,7 +33,7 @@ const Toolbar = ({
|
|
32
33
|
}
|
33
34
|
},
|
34
35
|
children: /*#__PURE__*/_jsx(Tooltip, {
|
35
|
-
title: "Section Settings",
|
36
|
+
title: translation("Section Settings"),
|
36
37
|
children: /*#__PURE__*/_jsx(IconButton, {
|
37
38
|
onClick: onSettings,
|
38
39
|
children: /*#__PURE__*/_jsx(SectionSettingIcon, {})
|
@@ -50,7 +51,8 @@ const Section = props => {
|
|
50
51
|
customProps
|
51
52
|
} = props;
|
52
53
|
const {
|
53
|
-
readOnly
|
54
|
+
readOnly,
|
55
|
+
translation
|
54
56
|
} = customProps;
|
55
57
|
const editor = useSlateStatic();
|
56
58
|
// const [isHovering, setIsHovering] = useState(false);
|
@@ -160,7 +162,8 @@ const Section = props => {
|
|
160
162
|
isSectionFullWidth: isSectionFullWidth,
|
161
163
|
readOnly: readOnly,
|
162
164
|
showTool: false,
|
163
|
-
onSettings: onSettings
|
165
|
+
onSettings: onSettings,
|
166
|
+
translation: translation
|
164
167
|
}), children]
|
165
168
|
}), openSetttings ? /*#__PURE__*/_jsx(SectionPopup, {
|
166
169
|
element: {
|