@flozy/editor 10.1.1 → 10.1.3
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 +17 -16
- package/dist/Editor/CommonEditor.js +115 -15
- package/dist/Editor/DialogWrapper.js +31 -25
- package/dist/Editor/Editor.css +16 -8
- package/dist/Editor/Elements/AI/PopoverAIInput.js +11 -3
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +25 -9
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +61 -14
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +10 -7
- package/dist/Editor/Elements/Color Picker/Styles.js +15 -13
- package/dist/Editor/Elements/DataView/Layouts/ColumnView.js +4 -2
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/Components/MultiSelect.js +454 -0
- package/dist/Editor/Elements/DataView/Layouts/DataTypes/MultiSelectType.js +21 -6
- package/dist/Editor/Elements/DataView/Layouts/Options/AddOptions.js +5 -1
- package/dist/Editor/Elements/DataView/Layouts/Options/EditOption.js +3 -2
- package/dist/Editor/Elements/DataView/Layouts/Options/index.js +11 -0
- package/dist/Editor/Elements/DataView/Layouts/ViewData.js +8 -4
- package/dist/Editor/Elements/Embed/Image.js +3 -2
- package/dist/Editor/Elements/Embed/Video.js +1 -1
- package/dist/Editor/Elements/EmbedScript/Code.js +14 -2
- package/dist/Editor/Elements/EmbedScript/EmbedScriptPopup.js +57 -28
- package/dist/Editor/Elements/EmbedScript/styles.js +89 -0
- package/dist/Editor/Elements/Form/Form.js +181 -168
- package/dist/Editor/Elements/Form/FormElements/FormText.js +23 -6
- package/dist/Editor/Elements/Form/FormElements/FormTextArea.js +3 -2
- package/dist/Editor/Elements/Form/FormField.js +13 -6
- package/dist/Editor/Elements/Form/Workflow/Styles.js +24 -22
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +6 -24
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +7 -4
- package/dist/Editor/Elements/FreeGrid/Options/More.js +8 -8
- package/dist/Editor/Elements/FreeGrid/styles.js +67 -7
- package/dist/Editor/Elements/Grid/GridItem.js +1 -1
- package/dist/Editor/Elements/List/CheckList.js +4 -1
- package/dist/Editor/Elements/Search/SearchAttachment.js +40 -9
- package/dist/Editor/Elements/Search/SearchButton.js +9 -8
- package/dist/Editor/Elements/Search/SearchList.js +9 -7
- package/dist/Editor/Elements/SimpleText/index.js +6 -1
- package/dist/Editor/Elements/SimpleText/style.js +2 -2
- package/dist/Editor/Elements/Table/Table.js +3 -3
- package/dist/Editor/Elements/Title/title.js +6 -6
- package/dist/Editor/Elements/Variables/VariableButton.js +10 -1
- package/dist/Editor/MiniEditor.js +2 -1
- package/dist/Editor/Styles/EditorStyles.js +5 -5
- 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 +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +10 -13
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/MiniColorPicker.js +4 -2
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +167 -42
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +7 -4
- package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +72 -12
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +100 -27
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +439 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +1 -1
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
- package/dist/Editor/assets/svg/BackIcon.js +18 -0
- package/dist/Editor/assets/svg/ClearAllRounded.js +31 -0
- package/dist/Editor/assets/svg/ResetIconNew.js +23 -0
- package/dist/Editor/assets/svg/SettingsIcon.js +1 -0
- package/dist/Editor/assets/svg/ThemeIcons.js +293 -0
- package/dist/Editor/common/ColorPickerButton.js +38 -16
- package/dist/Editor/common/CustomColorPicker/index.js +130 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -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 +43 -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 +31 -1
- package/dist/Editor/common/ImageSelector/Styles.js +3 -9
- package/dist/Editor/common/LinkSettings/NavComponents.js +34 -8
- package/dist/Editor/common/LinkSettings/index.js +84 -68
- package/dist/Editor/common/LinkSettings/style.js +245 -30
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +13 -14
- package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +1 -0
- package/dist/Editor/common/RnD/ElementOptions/index.js +2 -2
- package/dist/Editor/common/RnD/ElementOptions/styles.js +28 -1
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +6 -5
- 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 +4 -2
- 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 +3 -1
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
- package/dist/Editor/common/RnD/ElementSettings/styles.js +147 -12
- package/dist/Editor/common/RnD/OptionsPopup/index.js +8 -5
- package/dist/Editor/common/RnD/OptionsPopup/style.js +121 -19
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -5
- package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +1 -2
- package/dist/Editor/common/RnD/index.js +6 -7
- package/dist/Editor/common/Select/index.js +2 -0
- package/dist/Editor/common/Shorthands/elements.js +54 -0
- package/dist/Editor/common/SnackBar/index.js +43 -0
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +16 -8
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +36 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +16 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/lineSpacing.js +7 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +13 -6
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +5 -7
- package/dist/Editor/common/Uploader.js +8 -0
- package/dist/Editor/common/iconListV2.js +101 -6
- package/dist/Editor/common/iconslist.js +24 -0
- package/dist/Editor/commonStyle.js +165 -61
- package/dist/Editor/helper/textIndeces.js +58 -0
- package/dist/Editor/helper/theme.js +203 -2
- package/dist/Editor/hooks/useEditorTheme.js +153 -0
- package/dist/Editor/hooks/useMouseMove.js +8 -5
- package/dist/Editor/hooks/useThemeValues.js +63 -0
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +3 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +50 -173
- package/dist/Editor/theme/index.js +149 -0
- package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
- package/dist/Editor/themeSettings/buttons/index.js +290 -0
- package/dist/Editor/themeSettings/buttons/style.js +23 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +309 -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 +240 -0
- package/dist/Editor/themeSettings/fonts/style.js +62 -0
- package/dist/Editor/themeSettings/icons.js +60 -0
- package/dist/Editor/themeSettings/index.js +361 -0
- package/dist/Editor/themeSettings/style.js +292 -0
- package/dist/Editor/themeSettingsAI/icons.js +96 -0
- package/dist/Editor/themeSettingsAI/index.js +355 -0
- package/dist/Editor/themeSettingsAI/saveTheme.js +202 -0
- package/dist/Editor/themeSettingsAI/style.js +324 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +166 -43
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/draftToSlate.js +3 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/form.js +4 -4
- package/dist/Editor/utils/formfield.js +8 -2
- package/dist/Editor/utils/helper.js +90 -19
- package/package.json +4 -4
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import { Box } from "@mui/material";
|
3
|
-
import { getTRBLBreakPoints, getBreakPointsValue } from "../../../helper/theme";
|
3
|
+
import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../../helper/theme";
|
4
|
+
import { useTheme } from "@emotion/react";
|
4
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
5
6
|
const FormText = props => {
|
6
7
|
const {
|
@@ -19,11 +20,26 @@ const FormText = props => {
|
|
19
20
|
textSize,
|
20
21
|
fontFamily,
|
21
22
|
fontWeight,
|
23
|
+
marginSpacing,
|
22
24
|
...rest
|
23
25
|
} = fieldProps;
|
24
26
|
const onChange = e => {
|
25
27
|
e.preventDefault();
|
26
28
|
};
|
29
|
+
const theme = useTheme();
|
30
|
+
const buttonSX = {
|
31
|
+
...groupByBreakpoint({
|
32
|
+
borderRadius: {
|
33
|
+
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
34
|
+
},
|
35
|
+
padding: {
|
36
|
+
...getTRBLBreakPoints(bannerSpacing)
|
37
|
+
},
|
38
|
+
margin: {
|
39
|
+
...getTRBLBreakPoints(marginSpacing)
|
40
|
+
}
|
41
|
+
}, theme)
|
42
|
+
};
|
27
43
|
return /*#__PURE__*/_jsx("div", {
|
28
44
|
style: {
|
29
45
|
width: "100%",
|
@@ -40,16 +56,17 @@ const FormText = props => {
|
|
40
56
|
padding: {
|
41
57
|
...getTRBLBreakPoints(bannerSpacing)
|
42
58
|
},
|
43
|
-
height: height
|
44
|
-
borderColor: borderColor
|
59
|
+
height: height && `${height} !important`,
|
60
|
+
borderColor: borderColor && `${borderColor} !important`,
|
45
61
|
borderWidth: borderWidth || "1px",
|
46
62
|
borderRadius: {
|
47
63
|
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
48
64
|
},
|
65
|
+
...buttonSX,
|
49
66
|
borderStyle: borderStyle || "solid",
|
50
|
-
color: textColor
|
51
|
-
background: bgColor
|
52
|
-
fontSize: textSize
|
67
|
+
color: textColor && `${textColor} !important`,
|
68
|
+
background: bgColor && `${bgColor} !important`,
|
69
|
+
fontSize: textSize && `${textSize} !important`,
|
53
70
|
fontFamily: fontFamily || "PoppinsRegular",
|
54
71
|
fontWeight: `${fontWeight} !important` || "400 !important"
|
55
72
|
}
|
@@ -35,12 +35,13 @@ const FormTextArea = props => {
|
|
35
35
|
onChange: onChange,
|
36
36
|
sx: {
|
37
37
|
width: "100%",
|
38
|
-
|
38
|
+
borderWidth: "1px",
|
39
|
+
borderBlockStyle: "solid",
|
39
40
|
padding: {
|
40
41
|
...getTRBLBreakPoints(bannerSpacing)
|
41
42
|
},
|
42
43
|
height: height || "150px",
|
43
|
-
borderColor: `${borderColor
|
44
|
+
borderColor: borderColor && `${borderColor} !important`,
|
44
45
|
borderWidth: borderWidth || "1px",
|
45
46
|
borderRadius: {
|
46
47
|
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
@@ -1,12 +1,15 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
|
-
import { Transforms
|
2
|
+
import { Transforms } from "slate";
|
3
3
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
4
4
|
import { IconButton, Tooltip, Grid, useTheme } from "@mui/material";
|
5
|
-
import DeleteIcon from "@mui/icons-material/Delete";
|
6
|
-
import SettingsIcon from "@mui/icons-material/Settings";
|
7
5
|
import FormElements from "./FormElements";
|
8
6
|
import FieldPopup from "./FieldPopup";
|
9
7
|
import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
8
|
+
import { DeleteIcon } from "../../assets/svg/AIIcons";
|
9
|
+
import { SettingsIcon } from "../../assets/svg/TableIcons";
|
10
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
11
|
+
import useCommonStyle from "../../commonStyle";
|
12
|
+
import { getNode } from "../../utils/helper";
|
10
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
11
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
15
|
const FormField = props => {
|
@@ -33,11 +36,15 @@ const FormField = props => {
|
|
33
36
|
const formPath = path.slice(0, path.length - 1);
|
34
37
|
const {
|
35
38
|
metadatamapping
|
36
|
-
} =
|
39
|
+
} = getNode(editor, formPath) || {};
|
37
40
|
const updatedElement = {
|
38
41
|
...element,
|
39
42
|
metadatamapping
|
40
43
|
};
|
44
|
+
const {
|
45
|
+
theme: appTheme
|
46
|
+
} = useEditorContext();
|
47
|
+
const classes = useCommonStyle(appTheme);
|
41
48
|
const [openSetttings, setOpenSettings] = useState(false);
|
42
49
|
const onSettings = () => {
|
43
50
|
setOpenSettings(true);
|
@@ -77,7 +84,6 @@ const FormField = props => {
|
|
77
84
|
top: "24px",
|
78
85
|
bottom: 0,
|
79
86
|
margin: "auto",
|
80
|
-
height: "42px",
|
81
87
|
zIndex: 101
|
82
88
|
},
|
83
89
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
@@ -110,7 +116,8 @@ const FormField = props => {
|
|
110
116
|
className: "form-field",
|
111
117
|
sx: {
|
112
118
|
position: "relative",
|
113
|
-
...fieldSX
|
119
|
+
...fieldSX,
|
120
|
+
...classes?.fieldBtnSettings
|
114
121
|
},
|
115
122
|
children: [!readOnly && /*#__PURE__*/_jsx(FieldToolbar, {}), /*#__PURE__*/_jsx(FormElement, {
|
116
123
|
fieldProps: elementProps
|
@@ -9,20 +9,20 @@ const FormStyles = theme => ({
|
|
9
9
|
color: "#94A3B8"
|
10
10
|
},
|
11
11
|
bodyTextArea: {
|
12
|
-
|
13
|
-
padding:
|
14
|
-
|
15
|
-
outline:
|
16
|
-
border:
|
12
|
+
"& .mini-editor-cls": {
|
13
|
+
padding: "12px",
|
14
|
+
"&:focus-visible": {
|
15
|
+
outline: "none",
|
16
|
+
border: "none"
|
17
17
|
}
|
18
18
|
},
|
19
19
|
"& .editorWorkflow": {
|
20
|
-
minHeight:
|
21
|
-
padding:
|
20
|
+
minHeight: "130px",
|
21
|
+
padding: "12px",
|
22
22
|
paddingBottom: 0,
|
23
|
-
|
24
|
-
outline:
|
25
|
-
border:
|
23
|
+
"&:focus-visible": {
|
24
|
+
outline: "none",
|
25
|
+
border: "none"
|
26
26
|
}
|
27
27
|
}
|
28
28
|
},
|
@@ -105,7 +105,7 @@ const FormStyles = theme => ({
|
|
105
105
|
padding: "4px 22px",
|
106
106
|
textTransform: "none",
|
107
107
|
border: "1px solid #D8DDE1",
|
108
|
-
minWidth:
|
108
|
+
minWidth: "126px",
|
109
109
|
"& svg": {
|
110
110
|
"& path": {
|
111
111
|
stroke: "#64748B"
|
@@ -169,17 +169,19 @@ const FormStyles = theme => ({
|
|
169
169
|
}
|
170
170
|
},
|
171
171
|
colorButtonSingle: {
|
172
|
+
border: "1.5px solid #DCE4EC !important",
|
172
173
|
"&.active": {
|
173
|
-
"&:before": {
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
}
|
174
|
+
// "&:before": {
|
175
|
+
// content: '" "',
|
176
|
+
// position: "absolute",
|
177
|
+
// top: "-5px",
|
178
|
+
// left: "-5px",
|
179
|
+
// width: "calc(100% + 4px)",
|
180
|
+
// height: "calc(100% + 4px)",
|
181
|
+
// border: "3px solid blue",
|
182
|
+
// borderRadius: "50%",
|
183
|
+
// },
|
184
|
+
outline: "2px solid #2563EB"
|
183
185
|
}
|
184
186
|
},
|
185
187
|
colorButtonsInner: {
|
@@ -249,7 +251,7 @@ const FormStyles = theme => ({
|
|
249
251
|
}
|
250
252
|
},
|
251
253
|
root: {
|
252
|
-
padding:
|
254
|
+
padding: "10px"
|
253
255
|
}
|
254
256
|
});
|
255
257
|
export default FormStyles;
|
@@ -21,7 +21,6 @@ import { FORM_NODE } from "../../utils/form";
|
|
21
21
|
import { DEFAULT_TABLE_NODE } from "../../utils/table";
|
22
22
|
import itemOptions from "./Options/sectionItemOptions";
|
23
23
|
import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
24
|
-
import { useDebouncedCallback } from "use-debounce";
|
25
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
26
25
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
27
26
|
const MAX_DEVICE_WIDTH = {
|
@@ -35,11 +34,15 @@ export const useFreeGrid = () => {
|
|
35
34
|
return useContext(FreeGridContext);
|
36
35
|
};
|
37
36
|
const FreeGrid = props => {
|
37
|
+
const {
|
38
|
+
theme: appTheme
|
39
|
+
} = useEditorContext();
|
38
40
|
const theme = useTheme();
|
39
41
|
const breakpoint = useBreakpoints(theme);
|
40
42
|
const classes = useFreeGridStyles({
|
41
43
|
theme,
|
42
|
-
MAX_DEVICE_WIDTH: MAX_DEVICE_WIDTH[breakpoint]
|
44
|
+
MAX_DEVICE_WIDTH: MAX_DEVICE_WIDTH[breakpoint],
|
45
|
+
appTheme
|
43
46
|
});
|
44
47
|
const editor = useSlateStatic();
|
45
48
|
const {
|
@@ -76,9 +79,6 @@ const FreeGrid = props => {
|
|
76
79
|
const count = useRef(2);
|
77
80
|
const childrenCountRef = useRef(element?.children?.length);
|
78
81
|
const [isInteracting, setIsInteracting] = useState(false);
|
79
|
-
const debouncedStopInteraction = useDebouncedCallback(() => {
|
80
|
-
setIsInteracting(false);
|
81
|
-
}, 500);
|
82
82
|
const onChange = data => {
|
83
83
|
const append = breakpoint === "lg" ? "" : `_${breakpoint}`;
|
84
84
|
const updateData = {
|
@@ -210,20 +210,6 @@ const FreeGrid = props => {
|
|
210
210
|
linkType: "webAddress"
|
211
211
|
},
|
212
212
|
iconPosition: "start",
|
213
|
-
bgColor: "#2563EB",
|
214
|
-
textColor: "#FFF",
|
215
|
-
borderRadius: {
|
216
|
-
topLeft: 30,
|
217
|
-
topRight: 30,
|
218
|
-
bottomLeft: 30,
|
219
|
-
bottomRight: 30
|
220
|
-
},
|
221
|
-
bannerSpacing: {
|
222
|
-
left: 12,
|
223
|
-
top: 12,
|
224
|
-
right: 12,
|
225
|
-
bottom: 12
|
226
|
-
},
|
227
213
|
textAlign: "center",
|
228
214
|
label: "Get Started"
|
229
215
|
}],
|
@@ -494,11 +480,7 @@ const FreeGrid = props => {
|
|
494
480
|
return /*#__PURE__*/_jsx(FreeGridContext.Provider, {
|
495
481
|
value: {
|
496
482
|
isInteracting,
|
497
|
-
|
498
|
-
setIsInteracting(true);
|
499
|
-
debouncedStopInteraction.cancel();
|
500
|
-
},
|
501
|
-
handleStop: debouncedStopInteraction
|
483
|
+
setIsInteracting
|
502
484
|
},
|
503
485
|
children: /*#__PURE__*/_jsx(RnD, {
|
504
486
|
id: `freegrid_container_${path.join("|")}_${updated_at}_${breakpoint}`,
|
@@ -8,7 +8,7 @@ import { onDropItem, ROW_HEIGHT } from "../../common/RnD/Utils/gridDropItem";
|
|
8
8
|
import useBreakpoints from "../../hooks/useBreakpoints";
|
9
9
|
import { breakpointValues, formatBreakpointValues } from "./breakpointConstants";
|
10
10
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
11
|
-
import { getBreakPointsValue } from "../../helper/theme";
|
11
|
+
import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
12
12
|
import focusOnNewItem from "../../helper/RnD/focusOnNewItem";
|
13
13
|
import { bringItemToFB } from "../../helper";
|
14
14
|
import itemOptions from "./Options/sectionItemOptions";
|
@@ -160,6 +160,11 @@ const FreeGridBox = props => {
|
|
160
160
|
const isBoxHeader = useMemo(() => {
|
161
161
|
return element?.children?.some(c => c.childType === "appHeader" && !c.xs_updatedOn);
|
162
162
|
}, [element]);
|
163
|
+
const boxSp = groupByBreakpoint({
|
164
|
+
borderRadius: {
|
165
|
+
...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
|
166
|
+
}
|
167
|
+
}, theme);
|
163
168
|
return /*#__PURE__*/_jsx(RnD, {
|
164
169
|
id: `freegrid_box_item_${path.join("|")}_${updated_at}_${breakpoint}`,
|
165
170
|
className: `freegrid-item path-${path.length} breakpoint-${breakpoint} freegrid-box_${path.join("_")}`,
|
@@ -226,9 +231,7 @@ const FreeGridBox = props => {
|
|
226
231
|
"--rows": `repeat(${repeatTimes}, ${ROW_HEIGHT}px)`
|
227
232
|
},
|
228
233
|
sx: {
|
229
|
-
|
230
|
-
...getBreakPointsValue(sectionBorderRadius || {}, null, "overrideBorderRadius", true)
|
231
|
-
},
|
234
|
+
...boxSp,
|
232
235
|
background: sectionBgColor,
|
233
236
|
backgroundImage: sectionBackgroundImage ? `url('${sectionBackgroundImage}')` : "",
|
234
237
|
borderColor: borderColor || "transparent",
|
@@ -5,12 +5,12 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
5
|
const More = props => {
|
6
6
|
const {
|
7
7
|
handleClick,
|
8
|
-
|
9
|
-
|
8
|
+
translation,
|
9
|
+
breakpoint
|
10
10
|
} = props;
|
11
11
|
return /*#__PURE__*/_jsx(Box, {
|
12
12
|
children: /*#__PURE__*/_jsxs(List, {
|
13
|
-
className: "item-list-wrpr",
|
13
|
+
className: "item-list-wrpr sectionMoreOption",
|
14
14
|
children: [/*#__PURE__*/_jsx(ListItemButton, {
|
15
15
|
className: "item-wrapper",
|
16
16
|
onClick: handleClick("addSection"),
|
@@ -19,15 +19,15 @@ const More = props => {
|
|
19
19
|
className: "item-wrapper",
|
20
20
|
onClick: handleClick("duplicateSection"),
|
21
21
|
children: translation?.translation("Duplicate Section")
|
22
|
-
}), /*#__PURE__*/_jsx(ListItemButton, {
|
23
|
-
className: "item-wrapper",
|
24
|
-
onClick: handleClick("deleteSection"),
|
25
|
-
children: "Delete Section"
|
26
22
|
}), breakpoint === "xs" ? /*#__PURE__*/_jsx(ListItemButton, {
|
27
23
|
className: "item-wrapper",
|
28
24
|
onClick: handleClick("forceAutoAlignment"),
|
29
25
|
children: "Force Auto Alignment"
|
30
|
-
}) : null
|
26
|
+
}) : null, /*#__PURE__*/_jsx(ListItemButton, {
|
27
|
+
className: "item-wrapper",
|
28
|
+
onClick: handleClick("deleteSection"),
|
29
|
+
children: "Delete Section"
|
30
|
+
})]
|
31
31
|
})
|
32
32
|
});
|
33
33
|
};
|
@@ -1,6 +1,7 @@
|
|
1
1
|
const useFreeGridStyles = ({
|
2
2
|
theme,
|
3
|
-
MAX_DEVICE_WIDTH
|
3
|
+
MAX_DEVICE_WIDTH,
|
4
|
+
appTheme
|
4
5
|
}) => ({
|
5
6
|
root: {
|
6
7
|
"&.freegrid-container": {
|
@@ -47,6 +48,9 @@ const useFreeGridStyles = ({
|
|
47
48
|
"&.type_text": {
|
48
49
|
// minHeight: "fit-content !important",
|
49
50
|
// wordBreak: "break-all",
|
51
|
+
"& .placeholder-simple-text": {
|
52
|
+
display: "none"
|
53
|
+
}
|
50
54
|
},
|
51
55
|
"&.enable-1, &.enable-2": {
|
52
56
|
"&.type_text": {
|
@@ -243,6 +247,9 @@ const useFreeGridStyles = ({
|
|
243
247
|
},
|
244
248
|
"& > .simple-text": {
|
245
249
|
display: "none"
|
250
|
+
},
|
251
|
+
"& > .edt-paragraphs": {
|
252
|
+
display: "none"
|
246
253
|
}
|
247
254
|
},
|
248
255
|
"& .fgi_type_form": {
|
@@ -313,9 +320,42 @@ const useFreeGridStyles = ({
|
|
313
320
|
backgroundColor: "#FFF",
|
314
321
|
overflow: "hidden"
|
315
322
|
},
|
323
|
+
"& .fgi_type_embedScript:not(:has(.has-code))": {
|
324
|
+
background: appTheme?.palette?.editor?.sectionSettingIconHover,
|
325
|
+
color: appTheme?.palette?.editor?.textColor,
|
326
|
+
fontSize: "14px",
|
327
|
+
borderRadius: "12px",
|
328
|
+
display: "flex",
|
329
|
+
flexDirection: "column",
|
330
|
+
justifyContent: "center",
|
331
|
+
alignItems: "center",
|
332
|
+
height: "100%",
|
333
|
+
textAlign: "center",
|
334
|
+
"& svg": {
|
335
|
+
width: "20px",
|
336
|
+
height: "20px",
|
337
|
+
"& path": {
|
338
|
+
stroke: appTheme?.palette?.editor?.closeButtonSvgStroke
|
339
|
+
}
|
340
|
+
},
|
341
|
+
"& .code-icon": {
|
342
|
+
display: "flex",
|
343
|
+
marginRight: "5px"
|
344
|
+
},
|
345
|
+
"& .empty-code": {
|
346
|
+
display: "flex"
|
347
|
+
},
|
348
|
+
"& .code-name": {
|
349
|
+
display: "flex",
|
350
|
+
alignItems: "anchor-center"
|
351
|
+
}
|
352
|
+
},
|
316
353
|
"& .fgi_type_text": {
|
317
354
|
"& .edt-headings": {
|
318
355
|
margin: "0px"
|
356
|
+
},
|
357
|
+
"& .edt-paragraphs": {
|
358
|
+
margin: "0px"
|
319
359
|
}
|
320
360
|
},
|
321
361
|
/** element toolbar hide */
|
@@ -356,21 +396,41 @@ const useFreeGridStyles = ({
|
|
356
396
|
sectionPopper: {
|
357
397
|
zIndex: 1200,
|
358
398
|
width: "40px",
|
359
|
-
left: "-
|
399
|
+
left: "-63px !important",
|
360
400
|
borderRadius: "8px",
|
401
|
+
marginRight: "5px !important",
|
361
402
|
"& .papper-root": {
|
362
403
|
fontFamily: "sans-serif",
|
363
404
|
boxShadow: "-4px -3px 12px 4px rgba(0, 0, 0, 0.12)",
|
364
|
-
background:
|
405
|
+
background: `${appTheme?.palette?.editor?.miniToolBarBackground} !important`,
|
406
|
+
border: `1px solid ${appTheme?.palette?.editor?.miniToolBarBorder}`,
|
407
|
+
borderRadius: "10px",
|
365
408
|
"& .MuiIconButton-root": {
|
366
|
-
padding: "
|
409
|
+
padding: "9px",
|
367
410
|
color: "#000",
|
368
|
-
background:
|
411
|
+
background: `${appTheme?.palette?.editor?.miniToolBarBackground} !important`,
|
369
412
|
"& svg": {
|
370
413
|
width: "20px",
|
371
|
-
height: "20px"
|
414
|
+
height: "20px",
|
415
|
+
color: appTheme?.palette?.editor?.closeButtonSvgStroke
|
372
416
|
},
|
373
|
-
"
|
417
|
+
"& .settingsIcon": {
|
418
|
+
"& path": {
|
419
|
+
stroke: appTheme?.palette?.editor?.closeButtonSvgStroke
|
420
|
+
}
|
421
|
+
},
|
422
|
+
"&.active": {
|
423
|
+
"& svg": {
|
424
|
+
width: "20px",
|
425
|
+
height: "20px",
|
426
|
+
color: "#2563EB"
|
427
|
+
},
|
428
|
+
"& .settingsIcon": {
|
429
|
+
"& path": {
|
430
|
+
stroke: "#2563EB"
|
431
|
+
}
|
432
|
+
}
|
433
|
+
}
|
374
434
|
}
|
375
435
|
}
|
376
436
|
},
|
@@ -292,7 +292,7 @@ const GridItem = props => {
|
|
292
292
|
...getBRProps,
|
293
293
|
display: "flex",
|
294
294
|
flexDirection: flexDirection || "column",
|
295
|
-
background: bgColor
|
295
|
+
background: bgColor,
|
296
296
|
borderColor: getBorderColor(),
|
297
297
|
borderWidth: borderWidth || "1px",
|
298
298
|
borderStyle: borderStyle || "solid",
|
@@ -27,6 +27,9 @@ const CheckList = props => {
|
|
27
27
|
checked
|
28
28
|
} = element;
|
29
29
|
const path = ReactEditor.findPath(editor, element);
|
30
|
+
const {
|
31
|
+
customLineHeight
|
32
|
+
} = customProps || {};
|
30
33
|
const handleCheck = e => {
|
31
34
|
Transforms.setNodes(editor, {
|
32
35
|
checked: e.target.checked
|
@@ -45,7 +48,7 @@ const CheckList = props => {
|
|
45
48
|
justifyContent: "center",
|
46
49
|
alignItems: "center",
|
47
50
|
...(style || {}),
|
48
|
-
lineHeight:
|
51
|
+
lineHeight: `${customLineHeight} !important`
|
49
52
|
},
|
50
53
|
children: [/*#__PURE__*/_jsxs("div", {
|
51
54
|
contentEditable: false,
|
@@ -1,5 +1,10 @@
|
|
1
|
-
import React from "react";
|
2
|
-
import
|
1
|
+
import React, { useEffect, useState } from "react";
|
2
|
+
import Box from "@mui/material/Box";
|
3
|
+
import Card from "@mui/material/Card";
|
4
|
+
import CardMedia from "@mui/material/CardMedia";
|
5
|
+
import CardContent from "@mui/material/CardContent";
|
6
|
+
import Typography from "@mui/material/Typography";
|
7
|
+
import Skeleton from "@mui/material/Skeleton";
|
3
8
|
import Icon from "../../common/Icon";
|
4
9
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
5
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -15,13 +20,26 @@ const SearchAttachment = props => {
|
|
15
20
|
metadata
|
16
21
|
} = customProps;
|
17
22
|
const {
|
18
|
-
|
19
|
-
|
23
|
+
type,
|
24
|
+
id
|
20
25
|
} = element;
|
21
26
|
const {
|
22
27
|
theme
|
23
28
|
} = useEditorContext();
|
29
|
+
const [title, setTitle] = useState("");
|
30
|
+
const [showSkeleton, setShowSkeleton] = useState(false);
|
24
31
|
const label = Boolean(title?.trim()) ? title : 'Untitled';
|
32
|
+
useEffect(() => {
|
33
|
+
const fetchTitle = async id => {
|
34
|
+
setShowSkeleton(true);
|
35
|
+
const title = await customProps?.services('getDocTitle', id);
|
36
|
+
setTitle(title?.data);
|
37
|
+
setShowSkeleton(false);
|
38
|
+
};
|
39
|
+
if (id) {
|
40
|
+
fetchTitle(id);
|
41
|
+
}
|
42
|
+
}, []);
|
25
43
|
const handleClick = () => {
|
26
44
|
if (metadata && metadata?.actionHandler) {
|
27
45
|
metadata?.actionHandler(type, element);
|
@@ -38,15 +56,15 @@ const SearchAttachment = props => {
|
|
38
56
|
children: /*#__PURE__*/_jsxs(Card, {
|
39
57
|
sx: {
|
40
58
|
display: "flex",
|
41
|
-
justifyContent: "flex-start",
|
42
|
-
alignItems: "flex-end",
|
59
|
+
justifyContent: showSkeleton ? "center" : "flex-start",
|
60
|
+
alignItems: showSkeleton ? "center" : "flex-end",
|
43
61
|
width: "fit-content",
|
44
62
|
maxWidth: '250px',
|
45
63
|
padding: "0px 10px",
|
46
64
|
boxShadow: "none",
|
47
65
|
border: `1px solid ${theme?.palette?.primary?.slashBrainBorder} !important`,
|
48
66
|
borderRadius: "7px !important",
|
49
|
-
background: `${theme?.palette?.containers?.slashBrainCardBg} !important`,
|
67
|
+
background: showSkeleton ? `${theme?.palette?.editor?.menuOptionHoverBackground} !important` : `${theme?.palette?.containers?.slashBrainCardBg} !important`,
|
50
68
|
cursor: 'pointer',
|
51
69
|
margin: '4px 0px',
|
52
70
|
lineHeight: 1.43,
|
@@ -76,7 +94,12 @@ const SearchAttachment = props => {
|
|
76
94
|
width: "unset !important"
|
77
95
|
}
|
78
96
|
},
|
79
|
-
children: /*#__PURE__*/_jsx(
|
97
|
+
children: showSkeleton ? /*#__PURE__*/_jsx(Skeleton, {
|
98
|
+
variant: "circular",
|
99
|
+
width: 14,
|
100
|
+
height: 14,
|
101
|
+
animation: "wave"
|
102
|
+
}) : /*#__PURE__*/_jsx(Icon, {
|
80
103
|
icon: "docsIcon"
|
81
104
|
})
|
82
105
|
}), /*#__PURE__*/_jsx(CardContent, {
|
@@ -94,7 +117,15 @@ const SearchAttachment = props => {
|
|
94
117
|
width: "unset !important"
|
95
118
|
}
|
96
119
|
},
|
97
|
-
children: /*#__PURE__*/
|
120
|
+
children: showSkeleton ? /*#__PURE__*/_jsx(Skeleton, {
|
121
|
+
variant: "text",
|
122
|
+
width: 140,
|
123
|
+
height: 20,
|
124
|
+
animation: "wave",
|
125
|
+
sx: {
|
126
|
+
borderRadius: "4px"
|
127
|
+
}
|
128
|
+
}) : /*#__PURE__*/_jsxs(Typography, {
|
98
129
|
sx: {
|
99
130
|
fontWeight: "500",
|
100
131
|
background: theme?.palette?.text?.slashBrainText,
|
@@ -30,6 +30,7 @@ const SearchButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
30
30
|
const [skip, setSkip] = useState(0);
|
31
31
|
const [search, setSearch] = useState("");
|
32
32
|
const [isLoading, setIsLoading] = useState(false);
|
33
|
+
const [total, setTotal] = useState(0);
|
33
34
|
const [debouncedSearch] = useDebounce(search, 300);
|
34
35
|
const limit = 20;
|
35
36
|
const observer = useRef();
|
@@ -63,24 +64,24 @@ const SearchButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
63
64
|
}
|
64
65
|
};
|
65
66
|
useEffect(() => {
|
66
|
-
getDocs(
|
67
|
-
debouncedSearch,
|
68
|
-
skip,
|
69
|
-
limit,
|
70
|
-
current_doc_id: currentId
|
71
|
-
});
|
67
|
+
getDocs();
|
72
68
|
}, [skip, debouncedSearch]);
|
73
69
|
const getDocs = async () => {
|
70
|
+
if (isLoading) return;
|
71
|
+
if (total > 0 && mapData?.length >= total) return;
|
74
72
|
setIsLoading(true);
|
75
73
|
try {
|
76
74
|
if (otherProps?.services) {
|
77
75
|
const result = await otherProps?.services("getDocs", {
|
78
76
|
skip,
|
79
77
|
limit,
|
80
|
-
search,
|
78
|
+
search: debouncedSearch,
|
81
79
|
current_doc_id: currentId
|
82
80
|
});
|
83
|
-
|
81
|
+
const docs = result?.data?.docs || [];
|
82
|
+
const totalCount = result?.data?.total || 0;
|
83
|
+
setMapData(prev => skip === 0 ? docs : [...prev, ...docs]);
|
84
|
+
setTotal(totalCount);
|
84
85
|
}
|
85
86
|
} catch (error) {
|
86
87
|
console.error("Error fetching documents:", error);
|
@@ -259,7 +259,7 @@ const SearchAndDocList = ({
|
|
259
259
|
xs: 12,
|
260
260
|
children: /*#__PURE__*/_jsx(Typography, {
|
261
261
|
sx: {
|
262
|
-
display: mapData?.length === 0 ? 'flex' : 'none',
|
262
|
+
display: mapData?.length === 0 && !isLoading ? 'flex' : 'none',
|
263
263
|
alignItems: "center",
|
264
264
|
justifyContent: "center",
|
265
265
|
color: theme?.palette?.text?.secondary,
|
@@ -269,15 +269,17 @@ const SearchAndDocList = ({
|
|
269
269
|
},
|
270
270
|
children: "No docs"
|
271
271
|
})
|
272
|
-
}),
|
272
|
+
}), /*#__PURE__*/_jsx(Grid, {
|
273
273
|
item: true,
|
274
|
+
xs: 12,
|
274
275
|
sx: {
|
275
|
-
display:
|
276
|
+
display: isLoading ? 'flex' : 'none',
|
277
|
+
alignItems: "center",
|
276
278
|
justifyContent: "center",
|
277
|
-
|
278
|
-
|
279
|
-
padding: '
|
280
|
-
|
279
|
+
color: theme?.palette?.text?.secondary,
|
280
|
+
fontSize: '12px',
|
281
|
+
padding: '20px',
|
282
|
+
fontWeight: 700
|
281
283
|
},
|
282
284
|
children: /*#__PURE__*/_jsx(CircularProgress, {})
|
283
285
|
})]
|