@flozy/editor 4.0.2 → 4.0.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 +14 -9
- package/dist/Editor/CommonEditor.js +110 -167
- package/dist/Editor/Editor.css +3 -43
- package/dist/Editor/Elements/AI/AIInput.js +33 -31
- package/dist/Editor/Elements/AI/CustomSelect.js +12 -19
- package/dist/Editor/Elements/AI/PopoverAIInput.js +97 -73
- package/dist/Editor/Elements/AI/Styles.js +2 -2
- package/dist/Editor/Elements/AI/helper.js +3 -5
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +4 -15
- package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
- package/dist/Editor/Elements/Button/EditorButton.js +16 -28
- package/dist/Editor/Elements/Carousel/CarouselButton.js +1 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +15 -60
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -3
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +3 -12
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +1 -2
- package/dist/Editor/Elements/Grid/Grid.js +0 -2
- package/dist/Editor/Elements/Grid/GridItem.js +1 -3
- package/dist/Editor/Elements/Link/Link.js +1 -6
- package/dist/Editor/Elements/Link/LinkButton.js +2 -4
- package/dist/Editor/Elements/Link/LinkPopup.js +14 -73
- package/dist/Editor/Elements/NewLine/NewLineButton.js +1 -2
- package/dist/Editor/Elements/Signature/Signature.css +6 -13
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +1 -2
- package/dist/Editor/Elements/Signature/SignaturePopup.js +30 -185
- package/dist/Editor/Elements/SimpleText/index.js +1 -11
- package/dist/Editor/Elements/SimpleText/style.js +1 -1
- package/dist/Editor/MiniEditor.js +1 -3
- package/dist/Editor/Toolbar/Basic/index.js +2 -4
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +3 -27
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +13 -7
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -34
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +13 -12
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +13 -12
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/CustomSelectTool.js +0 -3
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +11 -4
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +86 -213
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -4
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +44 -123
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +44 -106
- package/dist/Editor/Toolbar/PopupTool/index.js +3 -5
- package/dist/Editor/Toolbar/toolbarGroups.js +11 -53
- package/dist/Editor/assets/svg/AIIcons.js +1 -153
- package/dist/Editor/common/ColorPickerButton.js +9 -25
- package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
- package/dist/Editor/common/EditorIcons.js +7 -7
- package/dist/Editor/common/Icon.js +24 -51
- package/dist/Editor/common/ImageList.js +3 -16
- package/dist/Editor/common/ImageSelector/ImageSelector.js +9 -30
- package/dist/Editor/common/ImageSelector/Styles.js +1 -2
- package/dist/Editor/common/LinkSettings/NavComponents.js +2 -5
- package/dist/Editor/common/LinkSettings/index.js +2 -4
- package/dist/Editor/common/LinkSettings/navOptions.js +2 -7
- package/dist/Editor/common/LinkSettings/style.js +8 -11
- package/dist/Editor/common/MentionsPopup/Styles.js +1 -1
- package/dist/Editor/common/Shorthands/elements.js +9 -63
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +23 -39
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +23 -33
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -31
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +4 -14
- package/dist/Editor/common/StyleBuilder/index.js +1 -1
- package/dist/Editor/commonStyle.js +0 -6
- package/dist/Editor/helper/theme.js +4 -191
- package/dist/Editor/hooks/useMouseMove.js +1 -4
- package/dist/Editor/hooks/useWindowMessage.js +7 -10
- package/dist/Editor/plugins/withEmbeds.js +1 -1
- package/dist/Editor/plugins/withHTML.js +1 -1
- package/dist/Editor/plugins/withTable.js +1 -1
- package/dist/Editor/theme/ThemeList.js +173 -50
- package/dist/Editor/utils/SlateUtilityFunctions.js +25 -161
- package/dist/Editor/utils/button.js +17 -1
- package/dist/Editor/utils/font.js +37 -40
- package/dist/Editor/utils/helper.js +1 -30
- package/package.json +1 -2
- package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +0 -73
- package/dist/Editor/Elements/AI/VoiceToText/index.js +0 -184
- package/dist/Editor/Elements/AI/VoiceToText/style.js +0 -40
- package/dist/Editor/Elements/Link/LinkPopupStyles.js +0 -28
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +0 -59
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
- package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
- package/dist/Editor/common/CustomColorPicker/index.js +0 -106
- package/dist/Editor/common/CustomColorPicker/style.js +0 -53
- package/dist/Editor/common/CustomDialog/index.js +0 -94
- package/dist/Editor/common/CustomDialog/style.js +0 -67
- package/dist/Editor/common/CustomSelect.js +0 -33
- package/dist/Editor/common/iconListV2.js +0 -843
- package/dist/Editor/hooks/useEditorTheme.js +0 -139
- package/dist/Editor/theme/index.js +0 -144
- package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
- package/dist/Editor/themeSettings/buttons/index.js +0 -290
- package/dist/Editor/themeSettings/buttons/style.js +0 -21
- package/dist/Editor/themeSettings/colorTheme/index.js +0 -290
- package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -123
- package/dist/Editor/themeSettings/fonts/index.js +0 -213
- package/dist/Editor/themeSettings/fonts/style.js +0 -44
- package/dist/Editor/themeSettings/icons.js +0 -60
- package/dist/Editor/themeSettings/index.js +0 -320
- package/dist/Editor/themeSettings/style.js +0 -152
- package/dist/Editor/themeSettingsAI/icons.js +0 -96
- package/dist/Editor/themeSettingsAI/index.js +0 -356
- package/dist/Editor/themeSettingsAI/saveTheme.js +0 -190
- package/dist/Editor/themeSettingsAI/style.js +0 -247
|
@@ -134,13 +134,10 @@ export const SelectPage = props => {
|
|
|
134
134
|
});
|
|
135
135
|
};
|
|
136
136
|
export const Trigger = props => {
|
|
137
|
-
|
|
138
|
-
nav
|
|
139
|
-
} = props;
|
|
140
|
-
return /*#__PURE__*/_jsxs(Typography, {
|
|
137
|
+
return /*#__PURE__*/_jsx(Typography, {
|
|
141
138
|
variant: "subtitle1",
|
|
142
139
|
gutterBottom: true,
|
|
143
|
-
children:
|
|
140
|
+
children: "Choosing this will trigger the next step"
|
|
144
141
|
});
|
|
145
142
|
};
|
|
146
143
|
const scrollToOptions = [{
|
|
@@ -18,8 +18,7 @@ const MAP_COMPONENT = {
|
|
|
18
18
|
webAddress: TextInput,
|
|
19
19
|
email: TextInput,
|
|
20
20
|
phone: TextInput,
|
|
21
|
-
|
|
22
|
-
prevTrigger: Trigger,
|
|
21
|
+
actionTrigger: Trigger,
|
|
23
22
|
scrollTopOrBottom: ScrollTopBottom,
|
|
24
23
|
page: SelectPage
|
|
25
24
|
};
|
|
@@ -36,12 +35,11 @@ export default function LinkSettings(props) {
|
|
|
36
35
|
customProps,
|
|
37
36
|
navType
|
|
38
37
|
} = props;
|
|
39
|
-
const themeType = localStorage.getItem("themeType");
|
|
40
38
|
const {
|
|
41
39
|
isMobile
|
|
42
40
|
} = customProps;
|
|
43
41
|
const navOptions = getNavOptions(customProps.hideTools);
|
|
44
|
-
const classes = LinkSettingsStyles(
|
|
42
|
+
const classes = LinkSettingsStyles();
|
|
45
43
|
const [nav, setNav] = useState(getNav(navType, navOptions));
|
|
46
44
|
const [navValue, setNavValue] = useState(props?.navValue || "");
|
|
47
45
|
const [openInNewTab, setOpenInNewTab] = useState(props.openInNewTab || false);
|
|
@@ -3,13 +3,8 @@ export const getNavOptions = (hideTools = []) => {
|
|
|
3
3
|
label: "None",
|
|
4
4
|
value: ""
|
|
5
5
|
}, {
|
|
6
|
-
label: "
|
|
7
|
-
value: "
|
|
8
|
-
type: "next"
|
|
9
|
-
}, {
|
|
10
|
-
label: "Previous Trigger",
|
|
11
|
-
value: "prevTrigger",
|
|
12
|
-
type: "previous"
|
|
6
|
+
label: "Trigger",
|
|
7
|
+
value: "actionTrigger"
|
|
13
8
|
}, {
|
|
14
9
|
label: "Web Address",
|
|
15
10
|
value: "webAddress",
|
|
@@ -1,35 +1,32 @@
|
|
|
1
|
-
const ButtonNavSettingsStyles =
|
|
1
|
+
const ButtonNavSettingsStyles = () => ({
|
|
2
2
|
dialogContainer: {
|
|
3
|
-
|
|
4
|
-
background: themeType === "dark" ? "#141720 !important" : "#ffffff !important"
|
|
5
|
-
},
|
|
6
|
-
"& .MuiDialogContent-root": {
|
|
3
|
+
'& .MuiDialogContent-root': {
|
|
7
4
|
padding: "0px 20px"
|
|
8
5
|
},
|
|
9
|
-
|
|
6
|
+
'& .MuiDialogActions-root': {
|
|
10
7
|
padding: "10px"
|
|
11
8
|
},
|
|
12
|
-
|
|
9
|
+
'& .MuiTypography-h6': {
|
|
13
10
|
fontWeight: 600,
|
|
14
11
|
fontSize: "16px",
|
|
15
12
|
paddingRight: "20px"
|
|
16
13
|
},
|
|
17
14
|
"& .MuiGrid-container": {
|
|
18
|
-
marginTop:
|
|
15
|
+
marginTop: '0px'
|
|
19
16
|
},
|
|
20
17
|
"& .MuiGrid-item": {
|
|
21
18
|
padding: "14px"
|
|
22
19
|
}
|
|
23
20
|
},
|
|
24
21
|
saveBtn: {
|
|
25
|
-
color:
|
|
22
|
+
color: '#fff',
|
|
26
23
|
background: "#2563EB",
|
|
27
24
|
fontSize: "14px",
|
|
28
25
|
fontWeight: 500,
|
|
29
26
|
padding: "4px 24px",
|
|
30
27
|
textTransform: "none",
|
|
31
28
|
"&:hover": {
|
|
32
|
-
color:
|
|
29
|
+
color: '#fff',
|
|
33
30
|
background: "#2563EB"
|
|
34
31
|
}
|
|
35
32
|
},
|
|
@@ -46,7 +43,7 @@ const ButtonNavSettingsStyles = themeType => ({
|
|
|
46
43
|
}
|
|
47
44
|
},
|
|
48
45
|
closeIcon: {
|
|
49
|
-
position:
|
|
46
|
+
position: 'absolute',
|
|
50
47
|
right: 8,
|
|
51
48
|
top: 8,
|
|
52
49
|
color: theme => theme.palette.grey[500]
|
|
@@ -40,60 +40,6 @@ const ELEMENTS_LIST = [{
|
|
|
40
40
|
icon: "headingThree"
|
|
41
41
|
}),
|
|
42
42
|
onInsert: editor => toggleBlock(editor, "headingThree", false)
|
|
43
|
-
}, {
|
|
44
|
-
name: "Heading 4",
|
|
45
|
-
desc: "",
|
|
46
|
-
group: "Text",
|
|
47
|
-
type: "headingFour",
|
|
48
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
|
49
|
-
icon: "headingFour"
|
|
50
|
-
}),
|
|
51
|
-
onInsert: editor => toggleBlock(editor, "headingFour", false)
|
|
52
|
-
}, {
|
|
53
|
-
name: "Heading 5",
|
|
54
|
-
desc: "",
|
|
55
|
-
group: "Text",
|
|
56
|
-
type: "headingFive",
|
|
57
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
|
58
|
-
icon: "headingFive"
|
|
59
|
-
}),
|
|
60
|
-
onInsert: editor => toggleBlock(editor, "headingFive", false)
|
|
61
|
-
}, {
|
|
62
|
-
name: "Heading 6",
|
|
63
|
-
desc: "",
|
|
64
|
-
group: "Text",
|
|
65
|
-
type: "headingSix",
|
|
66
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
|
67
|
-
icon: "headingSix"
|
|
68
|
-
}),
|
|
69
|
-
onInsert: editor => toggleBlock(editor, "headingSix", false)
|
|
70
|
-
}, {
|
|
71
|
-
name: "Paragraph 1",
|
|
72
|
-
desc: "",
|
|
73
|
-
group: "Text",
|
|
74
|
-
type: "paragraphOne",
|
|
75
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
|
76
|
-
icon: "paragraphOne"
|
|
77
|
-
}),
|
|
78
|
-
onInsert: editor => toggleBlock(editor, "paragraphOne", false)
|
|
79
|
-
}, {
|
|
80
|
-
name: "Paragraph 2",
|
|
81
|
-
desc: "",
|
|
82
|
-
group: "Text",
|
|
83
|
-
type: "paragraphTwo",
|
|
84
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
|
85
|
-
icon: "paragraphTwo"
|
|
86
|
-
}),
|
|
87
|
-
onInsert: editor => toggleBlock(editor, "paragraphTwo", false)
|
|
88
|
-
}, {
|
|
89
|
-
name: "Paragraph 3",
|
|
90
|
-
desc: "",
|
|
91
|
-
group: "Text",
|
|
92
|
-
type: "paragraphThree",
|
|
93
|
-
icon: /*#__PURE__*/_jsx(Icon, {
|
|
94
|
-
icon: "paragraphThree"
|
|
95
|
-
}),
|
|
96
|
-
onInsert: editor => toggleBlock(editor, "paragraphThree", false)
|
|
97
43
|
}, {
|
|
98
44
|
name: "Quote",
|
|
99
45
|
desc: "",
|
|
@@ -179,6 +125,15 @@ const ELEMENTS_LIST = [{
|
|
|
179
125
|
icon: "calenderNewIcon"
|
|
180
126
|
}),
|
|
181
127
|
onInsert: editor => insertDefaultEmbed(editor, "calendly", "")
|
|
128
|
+
}, {
|
|
129
|
+
name: "Emoji",
|
|
130
|
+
group: "Elements",
|
|
131
|
+
desc: "",
|
|
132
|
+
type: "emoji",
|
|
133
|
+
renderComponent: rest => /*#__PURE__*/_jsx(EmojiButton, {
|
|
134
|
+
...rest,
|
|
135
|
+
icoBtnType: "cmd"
|
|
136
|
+
})
|
|
182
137
|
}, {
|
|
183
138
|
name: "Table",
|
|
184
139
|
group: "Elements",
|
|
@@ -191,15 +146,6 @@ const ELEMENTS_LIST = [{
|
|
|
191
146
|
const table = new TableUtil(editor);
|
|
192
147
|
table.insertTable(3, 3);
|
|
193
148
|
}
|
|
194
|
-
}, {
|
|
195
|
-
name: "Emoji",
|
|
196
|
-
group: "Elements",
|
|
197
|
-
desc: "",
|
|
198
|
-
type: "emoji",
|
|
199
|
-
renderComponent: rest => /*#__PURE__*/_jsx(EmojiButton, {
|
|
200
|
-
...rest,
|
|
201
|
-
icoBtnType: "cmd"
|
|
202
|
-
})
|
|
203
149
|
}, {
|
|
204
150
|
name: "Divider",
|
|
205
151
|
group: "Elements",
|
|
@@ -20,8 +20,7 @@ const buttonStyle = [{
|
|
|
20
20
|
},
|
|
21
21
|
children: option.text
|
|
22
22
|
});
|
|
23
|
-
}
|
|
24
|
-
themeEnabled: true
|
|
23
|
+
}
|
|
25
24
|
}, {
|
|
26
25
|
label: "Font Size",
|
|
27
26
|
key: "textSize",
|
|
@@ -45,8 +44,7 @@ const buttonStyle = [{
|
|
|
45
44
|
}, {
|
|
46
45
|
label: "Button Color",
|
|
47
46
|
key: "bgColor",
|
|
48
|
-
type: "color"
|
|
49
|
-
themeEnabled: true
|
|
47
|
+
type: "color"
|
|
50
48
|
}, {
|
|
51
49
|
label: "Border Color",
|
|
52
50
|
key: "borderColor",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Checkbox, FormControlLabel, Grid, Slider, Typography, Box } from "@mui/material";
|
|
3
3
|
import { squreStyle } from "./radiusStyle";
|
|
4
|
-
import { getBreakPointsValue
|
|
4
|
+
import { getBreakPointsValue } from "../../../helper/theme";
|
|
5
5
|
import useWindowResize from "../../../hooks/useWindowResize";
|
|
6
|
-
import { useEditorTheme } from "../../../hooks/useEditorTheme";
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
8
|
const BANNER_SPACING_KEYS = ["top", "left", "right", "bottom"];
|
|
10
9
|
const BannerSpacing = props => {
|
|
11
10
|
const {
|
|
11
|
+
value: val,
|
|
12
12
|
data,
|
|
13
13
|
onChange,
|
|
14
14
|
elementProps,
|
|
@@ -18,21 +18,11 @@ const BannerSpacing = props => {
|
|
|
18
18
|
key
|
|
19
19
|
} = data;
|
|
20
20
|
const lockKeyVal = `lock${key}`;
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
selectedTheme
|
|
24
|
-
} = useEditorTheme();
|
|
25
|
-
const {
|
|
26
|
-
bannerSpacing,
|
|
27
|
-
lockbannerSpacing
|
|
28
|
-
} = selectedTheme?.elementProps?.button || {};
|
|
29
|
-
const isUserValue = Object.keys(props?.value || {})?.length;
|
|
30
|
-
const isUserLockedSpacing = typeof elementProps[lockKeyVal] === "boolean";
|
|
31
|
-
const val = isUserValue ? props?.value : bannerSpacing;
|
|
32
|
-
let lockSpacing = isUserLockedSpacing ? elementProps[lockKeyVal] : lockbannerSpacing;
|
|
21
|
+
let lockSpacing = elementProps[lockKeyVal];
|
|
33
22
|
if (lockSpacing === undefined) {
|
|
34
23
|
lockSpacing = true;
|
|
35
24
|
}
|
|
25
|
+
const [size] = useWindowResize();
|
|
36
26
|
const value = getBreakPointsValue(val, size?.device);
|
|
37
27
|
const handleChange = e => {
|
|
38
28
|
let changeAll = {};
|
|
@@ -88,12 +78,10 @@ const BannerSpacing = props => {
|
|
|
88
78
|
component: "input",
|
|
89
79
|
sx: classes.sapcingInput,
|
|
90
80
|
name: "top",
|
|
91
|
-
value: !lockSpacing ? "" :
|
|
92
|
-
className: "sliderInput
|
|
81
|
+
value: !lockSpacing ? "" : value?.top || 0,
|
|
82
|
+
className: "sliderInput",
|
|
93
83
|
disabled: !lockSpacing,
|
|
94
|
-
onChange: handleChange
|
|
95
|
-
type: "number",
|
|
96
|
-
placeholder: "0"
|
|
84
|
+
onChange: handleChange
|
|
97
85
|
})]
|
|
98
86
|
}), /*#__PURE__*/_jsx(FormControlLabel, {
|
|
99
87
|
className: "ccheckbox-primary",
|
|
@@ -135,54 +123,50 @@ const BannerSpacing = props => {
|
|
|
135
123
|
children: [/*#__PURE__*/_jsx("div", {
|
|
136
124
|
className: "bannerSpaceBoxTop",
|
|
137
125
|
children: /*#__PURE__*/_jsx("input", {
|
|
138
|
-
type: "
|
|
126
|
+
type: "text",
|
|
139
127
|
name: "top",
|
|
140
|
-
value:
|
|
141
|
-
className: "borderInput
|
|
128
|
+
value: value?.top,
|
|
129
|
+
className: "borderInput",
|
|
142
130
|
style: {
|
|
143
131
|
...squreStyle.topRight
|
|
144
132
|
},
|
|
145
|
-
onChange: handleChange
|
|
146
|
-
placeholder: "0"
|
|
133
|
+
onChange: handleChange
|
|
147
134
|
})
|
|
148
135
|
}), /*#__PURE__*/_jsx("div", {
|
|
149
136
|
className: "bannerSpaceBoxRight",
|
|
150
137
|
children: /*#__PURE__*/_jsx("input", {
|
|
151
|
-
type: "
|
|
138
|
+
type: "text",
|
|
152
139
|
name: "right",
|
|
153
|
-
value:
|
|
154
|
-
className: "borderInput
|
|
140
|
+
value: value?.right,
|
|
141
|
+
className: "borderInput",
|
|
155
142
|
style: {
|
|
156
143
|
...squreStyle.bottomLeft
|
|
157
144
|
},
|
|
158
|
-
onChange: handleChange
|
|
159
|
-
placeholder: "0"
|
|
145
|
+
onChange: handleChange
|
|
160
146
|
})
|
|
161
147
|
}), /*#__PURE__*/_jsx("div", {
|
|
162
148
|
className: "bannerSpaceBoxBottom",
|
|
163
149
|
children: /*#__PURE__*/_jsx("input", {
|
|
164
|
-
type: "
|
|
150
|
+
type: "text",
|
|
165
151
|
name: "bottom",
|
|
166
|
-
value:
|
|
167
|
-
className: "borderInput
|
|
152
|
+
value: value?.bottom,
|
|
153
|
+
className: "borderInput",
|
|
168
154
|
style: {
|
|
169
155
|
...squreStyle.bottomRight
|
|
170
156
|
},
|
|
171
|
-
onChange: handleChange
|
|
172
|
-
placeholder: "0"
|
|
157
|
+
onChange: handleChange
|
|
173
158
|
})
|
|
174
159
|
}), /*#__PURE__*/_jsx("div", {
|
|
175
160
|
className: "bannerSpaceBoxLeft",
|
|
176
161
|
children: /*#__PURE__*/_jsx("input", {
|
|
177
|
-
type: "
|
|
162
|
+
type: "text",
|
|
178
163
|
name: "left",
|
|
179
|
-
className: "borderInput
|
|
180
|
-
value:
|
|
164
|
+
className: "borderInput",
|
|
165
|
+
value: value?.left,
|
|
181
166
|
style: {
|
|
182
167
|
...squreStyle.topLeft
|
|
183
168
|
},
|
|
184
|
-
onChange: handleChange
|
|
185
|
-
placeholder: "0"
|
|
169
|
+
onChange: handleChange
|
|
186
170
|
})
|
|
187
171
|
})]
|
|
188
172
|
})
|
|
@@ -2,36 +2,28 @@ import React from "react";
|
|
|
2
2
|
import { Grid, Typography, Slider, FormControlLabel, Checkbox, Box } from "@mui/material";
|
|
3
3
|
import { radiusStyle } from "./radiusStyle";
|
|
4
4
|
import useWindowResize from "../../../hooks/useWindowResize";
|
|
5
|
-
import {
|
|
6
|
-
import { getBreakPointsValue, getCustomizationValue } from "../../../helper/theme";
|
|
5
|
+
import { getBreakPointsValue } from "../../../helper/theme";
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
8
|
const BORDER_RADIUS_KEYS = ["topLeft", "topRight", "bottomLeft", "bottomRight"];
|
|
10
9
|
const BorderRadius = props => {
|
|
11
10
|
const {
|
|
11
|
+
value: val,
|
|
12
12
|
data,
|
|
13
13
|
onChange,
|
|
14
14
|
elementProps,
|
|
15
15
|
classes
|
|
16
16
|
} = props;
|
|
17
|
+
let {
|
|
18
|
+
lockRadius
|
|
19
|
+
} = elementProps;
|
|
20
|
+
if (lockRadius === undefined) {
|
|
21
|
+
lockRadius = true;
|
|
22
|
+
}
|
|
17
23
|
const {
|
|
18
24
|
key
|
|
19
25
|
} = data;
|
|
20
26
|
const [size] = useWindowResize();
|
|
21
|
-
const {
|
|
22
|
-
selectedTheme
|
|
23
|
-
} = useEditorTheme();
|
|
24
|
-
const {
|
|
25
|
-
borderRadius,
|
|
26
|
-
lockRadius: themeLockRadius
|
|
27
|
-
} = selectedTheme?.elementProps?.button || {};
|
|
28
|
-
const isUserValue = Object.keys(props?.value || {})?.length;
|
|
29
|
-
const isUserLockedRadius = typeof elementProps?.lockRadius === "boolean";
|
|
30
|
-
const val = isUserValue ? props?.value : borderRadius;
|
|
31
|
-
let lockRadius = isUserLockedRadius ? elementProps?.lockRadius : themeLockRadius;
|
|
32
|
-
if (lockRadius === undefined) {
|
|
33
|
-
lockRadius = true;
|
|
34
|
-
}
|
|
35
27
|
const value = getBreakPointsValue(val, size?.device);
|
|
36
28
|
const handleChange = e => {
|
|
37
29
|
let changeAll = {};
|
|
@@ -88,13 +80,11 @@ const BorderRadius = props => {
|
|
|
88
80
|
}), /*#__PURE__*/_jsx(Box, {
|
|
89
81
|
sx: classes.sapcingInput,
|
|
90
82
|
component: "input",
|
|
91
|
-
value: !lockRadius ? "" :
|
|
92
|
-
className: "sliderInput
|
|
83
|
+
value: !lockRadius ? "" : value?.topLeft || 0,
|
|
84
|
+
className: "sliderInput",
|
|
93
85
|
name: "topLeft",
|
|
94
86
|
disabled: !lockRadius,
|
|
95
|
-
onChange: handleChange
|
|
96
|
-
type: "number",
|
|
97
|
-
placeholder: "0"
|
|
87
|
+
onChange: handleChange
|
|
98
88
|
})]
|
|
99
89
|
}), /*#__PURE__*/_jsx(FormControlLabel, {
|
|
100
90
|
className: "ccheckbox-primary",
|
|
@@ -135,10 +125,10 @@ const BorderRadius = props => {
|
|
|
135
125
|
borderRadius: `${value?.topLeft}px ${value?.topRight}px ${value?.bottomLeft}px ${value?.bottomRight}px`
|
|
136
126
|
},
|
|
137
127
|
children: [/*#__PURE__*/_jsx("input", {
|
|
138
|
-
type: "
|
|
128
|
+
type: "text",
|
|
139
129
|
name: "topLeft",
|
|
140
|
-
value:
|
|
141
|
-
className: "borderInput
|
|
130
|
+
value: value?.topLeft,
|
|
131
|
+
className: "borderInput",
|
|
142
132
|
placeholder: "0",
|
|
143
133
|
style: {
|
|
144
134
|
...radiusStyle.topLeft,
|
|
@@ -146,10 +136,10 @@ const BorderRadius = props => {
|
|
|
146
136
|
},
|
|
147
137
|
onChange: handleChange
|
|
148
138
|
}), /*#__PURE__*/_jsx("input", {
|
|
149
|
-
type: "
|
|
139
|
+
type: "text",
|
|
150
140
|
name: "topRight",
|
|
151
|
-
value:
|
|
152
|
-
className: "borderInput
|
|
141
|
+
value: value?.topRight,
|
|
142
|
+
className: "borderInput",
|
|
153
143
|
placeholder: "0",
|
|
154
144
|
style: {
|
|
155
145
|
...radiusStyle.topRight,
|
|
@@ -158,10 +148,10 @@ const BorderRadius = props => {
|
|
|
158
148
|
},
|
|
159
149
|
onChange: handleChange
|
|
160
150
|
}), /*#__PURE__*/_jsx("input", {
|
|
161
|
-
type: "
|
|
151
|
+
type: "text",
|
|
162
152
|
name: "bottomLeft",
|
|
163
|
-
value:
|
|
164
|
-
className: "borderInput
|
|
153
|
+
value: value?.bottomLeft,
|
|
154
|
+
className: "borderInput",
|
|
165
155
|
placeholder: "0",
|
|
166
156
|
style: {
|
|
167
157
|
...radiusStyle.bottomLeft,
|
|
@@ -170,10 +160,10 @@ const BorderRadius = props => {
|
|
|
170
160
|
},
|
|
171
161
|
onChange: handleChange
|
|
172
162
|
}), /*#__PURE__*/_jsx("input", {
|
|
173
|
-
type: "
|
|
163
|
+
type: "text",
|
|
174
164
|
name: "bottomRight",
|
|
175
|
-
value:
|
|
176
|
-
className: "borderInput
|
|
165
|
+
value: value?.bottomRight,
|
|
166
|
+
className: "borderInput",
|
|
177
167
|
placeholder: "0",
|
|
178
168
|
style: {
|
|
179
169
|
...radiusStyle.bottomRight,
|
|
@@ -1,44 +1,22 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useState } from "react";
|
|
2
2
|
import { Grid, TextField, InputAdornment, Typography } from "@mui/material";
|
|
3
3
|
import ColorPickerButton from "../../ColorPickerButton";
|
|
4
|
-
import { useSlateStatic } from "slate-react";
|
|
5
|
-
import { getElementStyle, getVariableValue } from "../../../helper/theme";
|
|
6
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
5
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
|
-
const MAP_STYLE_PROPS = {
|
|
9
|
-
bgColor: "background-color",
|
|
10
|
-
textColor: "color"
|
|
11
|
-
};
|
|
12
6
|
const Color = props => {
|
|
13
7
|
const {
|
|
14
|
-
value
|
|
8
|
+
value,
|
|
15
9
|
data,
|
|
16
10
|
onChange,
|
|
17
|
-
classes
|
|
18
|
-
elementProps,
|
|
19
|
-
handleClose,
|
|
20
|
-
customProps
|
|
11
|
+
classes
|
|
21
12
|
} = props;
|
|
22
13
|
const {
|
|
23
14
|
key,
|
|
24
15
|
label
|
|
25
16
|
} = data;
|
|
26
17
|
const [recentColors, setRecentColors] = useState({});
|
|
27
|
-
const editor = useSlateStatic();
|
|
28
|
-
const {
|
|
29
|
-
value,
|
|
30
|
-
inputValue
|
|
31
|
-
} = useMemo(() => {
|
|
32
|
-
const isVariable = val && val.startsWith("var");
|
|
33
|
-
const value = isVariable ? val : getElementStyle(editor, elementProps, MAP_STYLE_PROPS[key]);
|
|
34
|
-
const inputValue = isVariable ? getVariableValue(val) : getElementStyle(editor, elementProps, MAP_STYLE_PROPS[key]);
|
|
35
|
-
return {
|
|
36
|
-
value: value || val,
|
|
37
|
-
inputValue: inputValue || val
|
|
38
|
-
};
|
|
39
|
-
}, [editor, val]);
|
|
40
18
|
useEffect(() => {
|
|
41
|
-
const storedColors = JSON.parse(localStorage.getItem(
|
|
19
|
+
const storedColors = JSON.parse(localStorage.getItem('recentColors'));
|
|
42
20
|
if (storedColors) {
|
|
43
21
|
setRecentColors(storedColors);
|
|
44
22
|
}
|
|
@@ -61,7 +39,7 @@ const Color = props => {
|
|
|
61
39
|
[key]: updatedColors
|
|
62
40
|
};
|
|
63
41
|
setRecentColors(updatedColors);
|
|
64
|
-
localStorage.setItem(
|
|
42
|
+
localStorage.setItem('recentColors', JSON.stringify(updatedColors));
|
|
65
43
|
};
|
|
66
44
|
return /*#__PURE__*/_jsxs(Grid, {
|
|
67
45
|
item: true,
|
|
@@ -78,7 +56,7 @@ const Color = props => {
|
|
|
78
56
|
children: label
|
|
79
57
|
}), /*#__PURE__*/_jsx(TextField, {
|
|
80
58
|
fullWidth: true,
|
|
81
|
-
value:
|
|
59
|
+
value: value,
|
|
82
60
|
placeholder: `${label} color code`,
|
|
83
61
|
InputLabelProps: {
|
|
84
62
|
shrink: true
|
|
@@ -90,9 +68,7 @@ const Color = props => {
|
|
|
90
68
|
classes: classes,
|
|
91
69
|
value: value,
|
|
92
70
|
onSave: onSave,
|
|
93
|
-
recentColors: recentColors[key]
|
|
94
|
-
handleClose: handleClose,
|
|
95
|
-
disableEditTheme: customProps?.disableEditTheme
|
|
71
|
+
recentColors: recentColors[key]
|
|
96
72
|
})
|
|
97
73
|
})
|
|
98
74
|
}
|
|
@@ -1,26 +1,19 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { TextField, IconButton, Grid, Typography } from "@mui/material";
|
|
3
3
|
import { sizeMap } from "../../../utils/font.js";
|
|
4
4
|
import { TextMinusIcon, TextPlusIcon } from "../../../common/iconslist.js";
|
|
5
|
-
import { getElementStyle } from "../../../helper/theme.js";
|
|
6
|
-
import { useSlateStatic } from "slate-react";
|
|
7
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
7
|
const FontSize = props => {
|
|
10
8
|
const {
|
|
11
|
-
value
|
|
9
|
+
value,
|
|
12
10
|
data,
|
|
13
|
-
onChange
|
|
14
|
-
elementProps
|
|
11
|
+
onChange
|
|
15
12
|
} = props;
|
|
16
13
|
const {
|
|
17
14
|
key,
|
|
18
15
|
width
|
|
19
16
|
} = data;
|
|
20
|
-
const editor = useSlateStatic();
|
|
21
|
-
const value = useMemo(() => {
|
|
22
|
-
return getElementStyle(editor, elementProps, "font-size") || val;
|
|
23
|
-
}, [editor, val]);
|
|
24
17
|
const handleChange = e => {
|
|
25
18
|
let inc = parseInt(e.target.value) || 16;
|
|
26
19
|
inc = inc > 200 ? 200 : inc;
|
|
@@ -31,9 +24,7 @@ const FontSize = props => {
|
|
|
31
24
|
const getSizeVal = () => {
|
|
32
25
|
try {
|
|
33
26
|
const size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
|
|
34
|
-
|
|
35
|
-
const val = parseInt(size || defaultSize);
|
|
36
|
-
return isNaN(val) ? defaultSize : val;
|
|
27
|
+
return parseInt(size || 16);
|
|
37
28
|
} catch (err) {
|
|
38
29
|
return "";
|
|
39
30
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { FormControl, Grid, ListItemIcon, ListSubheader, MenuItem, Select, Typography } from "@mui/material";
|
|
3
|
-
import { getBreakPointsValue
|
|
3
|
+
import { getBreakPointsValue } from "../../../helper/theme";
|
|
4
4
|
import useWindowResize from "../../../hooks/useWindowResize";
|
|
5
|
-
import { useSlateStatic } from "slate-react";
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
6
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
8
7
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -23,19 +22,10 @@ const TextOptions = props => {
|
|
|
23
22
|
isBreakpoint,
|
|
24
23
|
options,
|
|
25
24
|
renderOption,
|
|
26
|
-
width
|
|
27
|
-
themeEnabled
|
|
25
|
+
width
|
|
28
26
|
} = data;
|
|
29
27
|
const [size] = useWindowResize();
|
|
30
|
-
const
|
|
31
|
-
const value = useMemo(() => {
|
|
32
|
-
const userValue = isBreakpoint ? getBreakPointsValue(val, size?.device) : val;
|
|
33
|
-
if (themeEnabled) {
|
|
34
|
-
// editor takes a little amount of time to update the new style in element, in that case userValue will be returned
|
|
35
|
-
return getElementStyle(editor, elementProps, key) || userValue;
|
|
36
|
-
}
|
|
37
|
-
return userValue;
|
|
38
|
-
}, [editor, isBreakpoint, val, size?.device]);
|
|
28
|
+
const value = isBreakpoint ? getBreakPointsValue(val, size?.device) : val;
|
|
39
29
|
const metaDataMappingOptions = metaMappings?.boards || [];
|
|
40
30
|
const updatedOption = elementProps?.metadatamapping ? [...options, ...metaDataMappingOptions] : options;
|
|
41
31
|
const handleChange = (e, d) => {
|
|
@@ -99,12 +99,6 @@ const useCommonStyle = theme => ({
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
},
|
|
102
|
-
popupTitle2: {
|
|
103
|
-
fontWeight: "600 !important",
|
|
104
|
-
fontSize: "20px",
|
|
105
|
-
display: "flex",
|
|
106
|
-
alignItems: "center"
|
|
107
|
-
},
|
|
108
102
|
textOptions: {
|
|
109
103
|
"& .MuiPopover-root": {
|
|
110
104
|
backgroundColor: theme?.palette?.editor?.background
|