@flozy/editor 4.0.1 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/ChatEditor.js +3 -19
- package/dist/Editor/CommonEditor.js +181 -109
- package/dist/Editor/Editor.css +31 -3
- package/dist/Editor/Elements/AI/AIInput.js +31 -33
- package/dist/Editor/Elements/AI/CustomSelect.js +19 -12
- package/dist/Editor/Elements/AI/PopoverAIInput.js +73 -97
- package/dist/Editor/Elements/AI/Styles.js +2 -2
- package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +73 -0
- package/dist/Editor/Elements/AI/VoiceToText/index.js +184 -0
- package/dist/Editor/Elements/AI/VoiceToText/style.js +40 -0
- package/dist/Editor/Elements/AI/helper.js +5 -3
- package/dist/Editor/Elements/Accordion/Accordion.js +1 -1
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +5 -10
- package/dist/Editor/Elements/AppHeader/AppHeader.js +26 -4
- package/dist/Editor/Elements/Button/EditorButton.js +28 -16
- package/dist/Editor/Elements/Carousel/CarouselButton.js +2 -1
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -15
- package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
- package/dist/Editor/Elements/Color Picker/Styles.js +3 -1
- package/dist/Editor/Elements/Emoji/EmojiPicker.js +2 -4
- package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -3
- package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -1
- package/dist/Editor/Elements/Grid/Grid.js +27 -3
- package/dist/Editor/Elements/Grid/GridItem.js +3 -1
- package/dist/Editor/Elements/Link/Link.js +6 -1
- package/dist/Editor/Elements/Link/LinkButton.js +4 -2
- package/dist/Editor/Elements/Link/LinkPopup.js +73 -14
- package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
- package/dist/Editor/Elements/List/CheckList.js +1 -2
- package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -1
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +3 -3
- package/dist/Editor/Elements/Redo/RedoButton.js +14 -0
- package/dist/Editor/Elements/Signature/Signature.css +13 -6
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +2 -1
- package/dist/Editor/Elements/Signature/SignaturePopup.js +185 -30
- package/dist/Editor/Elements/SimpleText/index.js +11 -1
- package/dist/Editor/Elements/SimpleText/style.js +1 -1
- package/dist/Editor/Elements/Table/Styles.js +23 -1
- package/dist/Editor/Elements/Table/Table.js +2 -1
- package/dist/Editor/Elements/Table/TableCell.js +69 -7
- package/dist/Editor/Elements/TableContextMenu/TableContextMenu.js +1 -0
- package/dist/Editor/Elements/Undo/UndoButton.js +14 -0
- package/dist/Editor/MiniEditor.js +3 -1
- package/dist/Editor/Styles/EditorStyles.js +1 -1
- package/dist/Editor/Toolbar/Basic/index.js +4 -2
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +31 -20
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +36 -5
- package/dist/Editor/Toolbar/Mini/Options/Options.js +10 -0
- package/dist/Editor/Toolbar/Mini/Styles.js +7 -0
- package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +12 -13
- package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +12 -13
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/CustomSelectTool.js +3 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +4 -11
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectSuperSubscript.js +59 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +213 -86
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +4 -2
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +123 -44
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +106 -44
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +7 -6
- package/dist/Editor/Toolbar/toolbarGroups.js +53 -11
- package/dist/Editor/assets/svg/AIIcons.js +153 -1
- package/dist/Editor/assets/svg/AddTemplateIcon.js +13 -10
- package/dist/Editor/assets/svg/RedoIcon.js +27 -0
- package/dist/Editor/assets/svg/SettingsIcon.js +28 -0
- package/dist/Editor/assets/svg/TextIcon.js +8 -5
- package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
- package/dist/Editor/assets/svg/UndoIcon.js +27 -0
- package/dist/Editor/common/ColorPickerButton.js +26 -18
- 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 +94 -0
- package/dist/Editor/common/CustomDialog/style.js +67 -0
- package/dist/Editor/common/CustomSelect.js +33 -0
- package/dist/Editor/common/DnD/DragHandleButton.js +56 -47
- package/dist/Editor/common/EditorIcons.js +7 -7
- package/dist/Editor/common/Icon.js +64 -25
- package/dist/Editor/common/ImageList.js +16 -3
- package/dist/Editor/common/ImageSelector/ImageSelector.js +30 -9
- package/dist/Editor/common/ImageSelector/Styles.js +2 -1
- package/dist/Editor/common/LinkSettings/NavComponents.js +5 -2
- package/dist/Editor/common/LinkSettings/index.js +4 -2
- package/dist/Editor/common/LinkSettings/navOptions.js +7 -2
- package/dist/Editor/common/LinkSettings/style.js +11 -8
- package/dist/Editor/common/MentionsPopup/Styles.js +1 -1
- package/dist/Editor/common/Section/index.js +57 -7
- package/dist/Editor/common/Section/styles.js +11 -0
- package/dist/Editor/common/Shorthands/elements.js +63 -9
- package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +1 -2
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +13 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +29 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +14 -4
- package/dist/Editor/common/StyleBuilder/index.js +1 -1
- package/dist/Editor/common/iconListV2.js +843 -0
- package/dist/Editor/common/iconslist.js +0 -31
- package/dist/Editor/commonStyle.js +6 -0
- package/dist/Editor/helper/index.js +0 -22
- package/dist/Editor/helper/theme.js +189 -3
- package/dist/Editor/hooks/useEditorTheme.js +139 -0
- package/dist/Editor/hooks/useMouseMove.js +4 -1
- package/dist/Editor/hooks/useWindowMessage.js +10 -7
- 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 +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 +290 -0
- package/dist/Editor/themeSettings/buttons/style.js +21 -0
- package/dist/Editor/themeSettings/colorTheme/index.js +290 -0
- package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
- package/dist/Editor/themeSettings/fonts/PreviewElement.js +123 -0
- package/dist/Editor/themeSettings/fonts/index.js +213 -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 +190 -0
- package/dist/Editor/themeSettingsAI/style.js +247 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +169 -27
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/events.js +54 -2
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +31 -2
- package/dist/Editor/utils/table.js +51 -43
- package/package.json +4 -3
@@ -1,5 +1,4 @@
|
|
1
1
|
import React from "react";
|
2
|
-
import { getBorderColor, getTextColor } from "../../helper";
|
3
2
|
import { Box } from "@mui/material";
|
4
3
|
import { getBreakPointsValue, getTRBLBreakPoints } from "../../helper/theme";
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
@@ -16,25 +15,21 @@ const AccordionSummary = props => {
|
|
16
15
|
borderRadius,
|
17
16
|
bannerSpacing
|
18
17
|
} = element;
|
19
|
-
const textStyles = getTextColor(textColor);
|
20
|
-
const borderStyle = getBorderColor(borderColor);
|
21
18
|
return /*#__PURE__*/_jsx(Box, {
|
22
19
|
className: `accordion-summary-container`,
|
23
20
|
...attributes,
|
24
|
-
|
21
|
+
sx: {
|
25
22
|
width: "100%",
|
26
23
|
position: "relative",
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
sx: {
|
24
|
+
backgroundColor: bgColor,
|
25
|
+
border: `1px solid ${borderColor}`,
|
26
|
+
color: textColor,
|
31
27
|
borderRadius: {
|
32
28
|
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
33
29
|
},
|
34
30
|
padding: {
|
35
31
|
...getTRBLBreakPoints(bannerSpacing)
|
36
|
-
}
|
37
|
-
'& span[data-slate-string="true"]': textStyles
|
32
|
+
}
|
38
33
|
},
|
39
34
|
component: "div",
|
40
35
|
children: children
|
@@ -62,6 +62,11 @@ function AppHeader(props) {
|
|
62
62
|
const handleDrawerToggle = () => {
|
63
63
|
setMobileOpen(prevState => !prevState);
|
64
64
|
};
|
65
|
+
const closeDrawer = () => {
|
66
|
+
if (mobileOpen) {
|
67
|
+
handleDrawerToggle();
|
68
|
+
}
|
69
|
+
};
|
65
70
|
const onSettings = e => {
|
66
71
|
if (!readOnly) {
|
67
72
|
e.stopPropagation();
|
@@ -148,10 +153,27 @@ function AppHeader(props) {
|
|
148
153
|
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(List, {
|
149
154
|
children: menus.map((item, i) => {
|
150
155
|
const buttonProps = handleLinkType(item.url, item.linkType, true, item.target === "_blank");
|
156
|
+
const onTouchEnd = e => {
|
157
|
+
if (buttonProps?.onTouchEnd) {
|
158
|
+
buttonProps?.onTouchEnd(e);
|
159
|
+
closeDrawer();
|
160
|
+
}
|
161
|
+
};
|
162
|
+
const onClick = e => {
|
163
|
+
if (buttonProps?.onClick) {
|
164
|
+
buttonProps?.onClick(e);
|
165
|
+
closeDrawer();
|
166
|
+
}
|
167
|
+
};
|
168
|
+
const props = {
|
169
|
+
...buttonProps,
|
170
|
+
onTouchEnd,
|
171
|
+
onClick
|
172
|
+
};
|
151
173
|
return /*#__PURE__*/_jsx(ListItem, {
|
152
174
|
disablePadding: true,
|
153
175
|
children: /*#__PURE__*/_jsx(ListItemButton, {
|
154
|
-
...
|
176
|
+
...props,
|
155
177
|
sx: {
|
156
178
|
textAlign: "center"
|
157
179
|
},
|
@@ -229,7 +251,7 @@ function AppHeader(props) {
|
|
229
251
|
style: {
|
230
252
|
display: "inline-flex",
|
231
253
|
alignItems: "center",
|
232
|
-
color: textColor,
|
254
|
+
color: textColor || "#000000",
|
233
255
|
fontSize: logoFontSize,
|
234
256
|
fontFamily: titleFontFamily,
|
235
257
|
justifyContent: isLogoRight ? "end" : "start"
|
@@ -277,7 +299,7 @@ function AppHeader(props) {
|
|
277
299
|
fontFamily: fontFamily,
|
278
300
|
textTransform: "none",
|
279
301
|
fontSize: fontSize || "16px",
|
280
|
-
color: textColor || "#
|
302
|
+
color: textColor || "#000",
|
281
303
|
background: bgColor || "none",
|
282
304
|
"& .m-settings": {
|
283
305
|
display: "none",
|
@@ -292,7 +314,7 @@ function AppHeader(props) {
|
|
292
314
|
background: "#FFF"
|
293
315
|
},
|
294
316
|
"&:hover": {
|
295
|
-
color: textColorHover || textColor || "#
|
317
|
+
color: textColorHover || textColor || "#000",
|
296
318
|
background: bgColorHover || bgColor || "none",
|
297
319
|
"& .m-settings": {
|
298
320
|
display: "block"
|
@@ -13,6 +13,9 @@ import { WorkflowIcon } from "../../common/iconslist";
|
|
13
13
|
import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
|
14
14
|
import { handleLinkType, windowVar } from "../../utils/helper";
|
15
15
|
import LinkSettings from "../../common/LinkSettings";
|
16
|
+
import { useEditorTheme } from "../../hooks/useEditorTheme";
|
17
|
+
import { getTheme } from "../../theme";
|
18
|
+
import { fontFamilyMap } from "../../utils/font";
|
16
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
17
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
18
21
|
const EditorButton = props => {
|
@@ -30,6 +33,12 @@ const EditorButton = props => {
|
|
30
33
|
const path = ReactEditor.findPath(editor, element);
|
31
34
|
const [edit, setEdit] = useState(false);
|
32
35
|
const [openNav, setOpenNav] = useState(false);
|
36
|
+
const {
|
37
|
+
theme
|
38
|
+
} = useEditorTheme();
|
39
|
+
const {
|
40
|
+
buttonTheme
|
41
|
+
} = getTheme(theme);
|
33
42
|
const {
|
34
43
|
label,
|
35
44
|
bgColor,
|
@@ -43,7 +52,7 @@ const EditorButton = props => {
|
|
43
52
|
fontFamily,
|
44
53
|
textColorHover,
|
45
54
|
bgColorHover,
|
46
|
-
buttonIcon,
|
55
|
+
// buttonIcon,
|
47
56
|
iconPosition = "start",
|
48
57
|
borderStyle,
|
49
58
|
borderWidth,
|
@@ -62,13 +71,15 @@ const EditorButton = props => {
|
|
62
71
|
} = actionTrigger || {
|
63
72
|
options: []
|
64
73
|
};
|
65
|
-
const isTrigger = linkType === "
|
74
|
+
const isTrigger = linkType === "nextTrigger" || linkType === "prevTrigger";
|
66
75
|
const refURl = isTrigger ? buttonLink?.url : url;
|
76
|
+
const buttonIcon = element?.buttonIcon || buttonTheme?.buttonIcon;
|
67
77
|
const BtnIcon = buttonIcon ? buttonIcon : null;
|
68
78
|
windowVar.lastButtonProps = element;
|
69
79
|
const handleTrigger = async () => {
|
70
80
|
if (metadata?.buttonLink?.handler) {
|
71
|
-
|
81
|
+
const response = isTrigger ? linkType : "click";
|
82
|
+
metadata.buttonLink.handler(response);
|
72
83
|
} else if (redirectOnURLResult) {
|
73
84
|
// call api and redirect based on api result
|
74
85
|
const apiResult = await actionButtonRedirect({}, {
|
@@ -186,20 +197,9 @@ const EditorButton = props => {
|
|
186
197
|
children: [/*#__PURE__*/_jsxs(Box, {
|
187
198
|
sx: {
|
188
199
|
textDecoration: "none",
|
189
|
-
background: bgColor || "rgb(30, 75, 122)",
|
190
200
|
borderBlockStyle: "solid",
|
191
|
-
borderColor: borderColor || "transparent",
|
192
201
|
borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
|
193
|
-
borderRadius: {
|
194
|
-
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
195
|
-
},
|
196
202
|
borderStyle: borderStyle || "solid",
|
197
|
-
padding: {
|
198
|
-
...getTRBLBreakPoints(bannerSpacing)
|
199
|
-
},
|
200
|
-
color: `${textColor || "#FFFFFF"}`,
|
201
|
-
fontSize: textSize || "inherit",
|
202
|
-
fontFamily: fontFamily || "PoppinsRegular",
|
203
203
|
display: "inline-flex",
|
204
204
|
alignItems: "center",
|
205
205
|
position: "relative",
|
@@ -207,14 +207,26 @@ const EditorButton = props => {
|
|
207
207
|
display: "none"
|
208
208
|
},
|
209
209
|
"&:hover": {
|
210
|
-
color: `${textColorHover || textColor
|
211
|
-
background: bgColorHover || bgColor
|
210
|
+
color: `${textColorHover || textColor}`,
|
211
|
+
background: bgColorHover || bgColor,
|
212
212
|
"& .element-toolbar": {
|
213
213
|
display: "flex"
|
214
214
|
}
|
215
|
+
},
|
216
|
+
color: `${textColor} !important`,
|
217
|
+
fontSize: `${textSize}px !important`,
|
218
|
+
fontFamily: `${fontFamilyMap[fontFamily] || ""} !important`,
|
219
|
+
background: `${bgColor} !important`,
|
220
|
+
borderColor: `${borderColor} !important`,
|
221
|
+
borderRadius: {
|
222
|
+
...getBreakPointsValue(borderRadius || buttonTheme?.borderRadius || {}, null, "overrideBorderRadius", true)
|
223
|
+
},
|
224
|
+
padding: {
|
225
|
+
...getTRBLBreakPoints(bannerSpacing || buttonTheme?.bannerSpacing || {})
|
215
226
|
}
|
216
227
|
},
|
217
228
|
...buttonProps,
|
229
|
+
className: "button theme-element",
|
218
230
|
children: [BtnIcon && iconPosition === "start" && /*#__PURE__*/_jsx(MUIIcon, {
|
219
231
|
iconName: buttonIcon,
|
220
232
|
style: {
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
2
2
|
import { insertCarousel } from "../../utils/carousel";
|
3
3
|
import { Carousal } from "../../common/iconslist";
|
4
4
|
import ToolbarIcon from "../../common/ToolbarIcon";
|
5
|
+
import { CarouselElementIcon } from "../../common/iconListV2";
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
6
7
|
const CarouselButton = props => {
|
7
8
|
const {
|
@@ -14,7 +15,7 @@ const CarouselButton = props => {
|
|
14
15
|
return /*#__PURE__*/_jsx(ToolbarIcon, {
|
15
16
|
title: "Carousel",
|
16
17
|
onClick: handleClick,
|
17
|
-
icon: /*#__PURE__*/_jsx(
|
18
|
+
icon: /*#__PURE__*/_jsx(CarouselElementIcon, {}),
|
18
19
|
icoBtnType: icoBtnType
|
19
20
|
});
|
20
21
|
};
|
@@ -1,11 +1,15 @@
|
|
1
|
-
import React, { useState } from "react";
|
2
|
-
import { Box, IconButton, Popover } from "@mui/material";
|
1
|
+
import React, { useContext, useState } from "react";
|
2
|
+
import { Box, IconButton, Popover, Typography, useTheme } from "@mui/material";
|
3
3
|
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
|
4
4
|
import Button from "../../common/Button";
|
5
5
|
import { colors } from "./defaultColors";
|
6
6
|
import ColorPicker from "./colorPicker.svg";
|
7
|
+
import { ThemeContext } from "../../CommonEditor";
|
8
|
+
import { useSlateStatic } from "slate-react";
|
9
|
+
import { Transforms } from "slate";
|
7
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
8
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
12
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
9
13
|
let c = [];
|
10
14
|
const ColorChunks = (recentColors = []) => [...recentColors, ...colors].reduce((a, b, i) => {
|
11
15
|
if (i % 7 === 0) {
|
@@ -32,7 +36,7 @@ const SingleColorButton = ({
|
|
32
36
|
width: "100%",
|
33
37
|
display: "flex",
|
34
38
|
alignItems: "center",
|
35
|
-
padding: padding || "8px",
|
39
|
+
padding: padding || "8px 0px",
|
36
40
|
justifyContent: "center"
|
37
41
|
},
|
38
42
|
children: [crs.map(m => /*#__PURE__*/_jsx(Button, {
|
@@ -109,11 +113,17 @@ const ColorButtons = props => {
|
|
109
113
|
forMiniTool,
|
110
114
|
openColorTool,
|
111
115
|
onClose,
|
112
|
-
onColorPickerClick
|
116
|
+
onColorPickerClick,
|
117
|
+
disableEditTheme
|
113
118
|
} = props;
|
114
119
|
const [row1, ...restRows] = ColorChunks([]);
|
115
120
|
const [anchorEl, setAnchorEl] = useState(null);
|
116
121
|
const open = Boolean(anchorEl);
|
122
|
+
const theme = useTheme();
|
123
|
+
const editor = useSlateStatic();
|
124
|
+
const {
|
125
|
+
setOpenTheme
|
126
|
+
} = useContext(ThemeContext);
|
117
127
|
const handleMore = e => {
|
118
128
|
setAnchorEl(e.currentTarget);
|
119
129
|
};
|
@@ -126,6 +136,7 @@ const ColorButtons = props => {
|
|
126
136
|
const handleSelect = color => () => {
|
127
137
|
onSelect(color);
|
128
138
|
};
|
139
|
+
const colorVars = theme?.vars?.colors || {};
|
129
140
|
return /*#__PURE__*/_jsxs(Box, {
|
130
141
|
component: "span",
|
131
142
|
sx: classes.colorButtons,
|
@@ -142,7 +153,7 @@ const ColorButtons = props => {
|
|
142
153
|
activeColor: activeColor
|
143
154
|
}, `si_btn_row1_${m}_${i}`);
|
144
155
|
})
|
145
|
-
}), /*#__PURE__*/
|
156
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
146
157
|
open: open || openColorTool,
|
147
158
|
anchorEl: anchorEl || openColorTool,
|
148
159
|
onClose: handleClose,
|
@@ -156,9 +167,39 @@ const ColorButtons = props => {
|
|
156
167
|
},
|
157
168
|
sx: classes.colorPopper,
|
158
169
|
className: "colorPopper",
|
159
|
-
children:
|
170
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
160
171
|
sx: classes.colorButtonsInner,
|
161
|
-
children:
|
172
|
+
children: [Object.values(colorVars)?.length ? /*#__PURE__*/_jsxs(_Fragment, {
|
173
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
174
|
+
component: "div",
|
175
|
+
className: "singleColorTitleWrapper",
|
176
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
177
|
+
variant: "subtitle2",
|
178
|
+
children: "Theme colour"
|
179
|
+
}), disableEditTheme ? null : /*#__PURE__*/_jsx("div", {
|
180
|
+
className: "editBtn",
|
181
|
+
onClick: () => {
|
182
|
+
Transforms.deselect(editor, {
|
183
|
+
at: editor.selection
|
184
|
+
});
|
185
|
+
setOpenTheme("editThemeColor");
|
186
|
+
},
|
187
|
+
children: "Edit"
|
188
|
+
})]
|
189
|
+
}), /*#__PURE__*/_jsx(SingleColorButton, {
|
190
|
+
crs: Object.values(colorVars),
|
191
|
+
handleSelect: handleSelect,
|
192
|
+
classes: classes,
|
193
|
+
activeColor: activeColor
|
194
|
+
})]
|
195
|
+
}) : null, /*#__PURE__*/_jsx(Box, {
|
196
|
+
component: "div",
|
197
|
+
className: "singleColorTitleWrapper",
|
198
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
199
|
+
variant: "subtitle2",
|
200
|
+
children: "Custom colour"
|
201
|
+
})
|
202
|
+
}), restRows.map((m, i) => {
|
162
203
|
return /*#__PURE__*/_jsx(SingleColorButton, {
|
163
204
|
id: `p2_${id}`,
|
164
205
|
crs: m,
|
@@ -167,14 +208,18 @@ const ColorButtons = props => {
|
|
167
208
|
classes: classes,
|
168
209
|
activeColor: activeColor
|
169
210
|
}, `si_btn_${m}_${i}`);
|
170
|
-
})
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
211
|
+
}), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
|
212
|
+
onClick: onColorPickerClick,
|
213
|
+
style: {
|
214
|
+
alignSelf: "start",
|
215
|
+
margin: "6px"
|
216
|
+
},
|
217
|
+
children: /*#__PURE__*/_jsx("img", {
|
218
|
+
src: ColorPicker,
|
219
|
+
alt: "color wheel"
|
220
|
+
})
|
221
|
+
}) : null]
|
222
|
+
})
|
178
223
|
})]
|
179
224
|
});
|
180
225
|
};
|
@@ -60,4 +60,28 @@
|
|
60
60
|
padding: 0 15px !important;
|
61
61
|
width: 60px !important;
|
62
62
|
flex-shrink: 0;
|
63
|
-
}
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
.singleColorTitleWrapper {
|
67
|
+
display: flex;
|
68
|
+
justify-content: space-between;
|
69
|
+
align-items: center;
|
70
|
+
padding: 10px;
|
71
|
+
width: 100%;
|
72
|
+
border-bottom: 1px solid #DCE4EC;
|
73
|
+
}
|
74
|
+
|
75
|
+
.singleColorTitleWrapper .MuiTypography-root {
|
76
|
+
font-weight: 600;
|
77
|
+
}
|
78
|
+
|
79
|
+
.singleColorTitleWrapper .editBtn {
|
80
|
+
text-transform: none;
|
81
|
+
color: #2563EB;
|
82
|
+
text-decoration: underline;
|
83
|
+
padding: 0px;
|
84
|
+
min-width: unset;
|
85
|
+
cursor: pointer;
|
86
|
+
font-size: 14px;
|
87
|
+
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { ReactEditor } from "slate-react";
|
3
3
|
import { Transforms } from "slate";
|
4
|
-
import ColorPickerTool from "react-gcolor-picker";
|
5
4
|
import { IconButton, Tooltip, Box, Popover } from "@mui/material";
|
6
5
|
import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions";
|
7
6
|
import ColorButtons from "./ColorButtons";
|
@@ -9,6 +8,7 @@ import ColorPickerStyles from "./Styles";
|
|
9
8
|
import colorWheel from "./colorWheel.png";
|
10
9
|
import "./ColorPicker.css";
|
11
10
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
11
|
+
import CustomColorPicker from "../../common/CustomColorPicker";
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
13
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
14
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -95,10 +95,10 @@ const ColorPicker = props => {
|
|
95
95
|
horizontal: "top"
|
96
96
|
},
|
97
97
|
sx: classes.colorPickerPopup,
|
98
|
-
children: /*#__PURE__*/_jsx(
|
98
|
+
children: /*#__PURE__*/_jsx(CustomColorPicker, {
|
99
99
|
gradient: true,
|
100
|
-
|
101
|
-
|
100
|
+
onChange: handleFormSubmit,
|
101
|
+
color: activeColor
|
102
102
|
})
|
103
103
|
})]
|
104
104
|
});
|
@@ -13,9 +13,11 @@ const ColorPickerStyles = theme => ({
|
|
13
13
|
}
|
14
14
|
},
|
15
15
|
colorPopper: {
|
16
|
+
marginTop: "20px",
|
16
17
|
"& .MuiPaper-root": {
|
17
18
|
backgroundColor: theme?.palette?.editor?.background,
|
18
|
-
|
19
|
+
padding: "4px 14px",
|
20
|
+
"@media only screen and (max-width: 600px)": {
|
19
21
|
marginTop: "-40px"
|
20
22
|
}
|
21
23
|
}
|
@@ -5,15 +5,13 @@ import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
5
5
|
const EmojiPicker = props => {
|
6
6
|
const {
|
7
7
|
onEmojiSelect,
|
8
|
-
onClose
|
9
|
-
theme = 'dark'
|
8
|
+
onClose
|
10
9
|
} = props;
|
11
10
|
return /*#__PURE__*/_jsx(_Fragment, {
|
12
11
|
children: /*#__PURE__*/_jsx(Picker, {
|
13
12
|
data: data,
|
14
13
|
onEmojiSelect: onEmojiSelect,
|
15
|
-
onClickOutside: onClose
|
16
|
-
theme: theme
|
14
|
+
onClickOutside: onClose
|
17
15
|
})
|
18
16
|
});
|
19
17
|
};
|
@@ -71,11 +71,11 @@ const FormWorkflow = props => {
|
|
71
71
|
children: [/*#__PURE__*/_jsx(Grid, {
|
72
72
|
item: true,
|
73
73
|
sx: classes.radioBtn,
|
74
|
-
children: /*#__PURE__*/
|
74
|
+
children: /*#__PURE__*/_jsxs(RadioGroup, {
|
75
75
|
name: "set timing",
|
76
76
|
value: schedule,
|
77
77
|
defaultValue: 1,
|
78
|
-
children: /*#__PURE__*/_jsx(FormControlLabel, {
|
78
|
+
children: [/*#__PURE__*/_jsx(FormControlLabel, {
|
79
79
|
value: "immediately",
|
80
80
|
label: "Immediately",
|
81
81
|
onChange: () => {
|
@@ -84,7 +84,16 @@ const FormWorkflow = props => {
|
|
84
84
|
control: /*#__PURE__*/_jsx(Radio, {
|
85
85
|
size: "small"
|
86
86
|
})
|
87
|
-
})
|
87
|
+
}), /*#__PURE__*/_jsx(FormControlLabel, {
|
88
|
+
value: "after",
|
89
|
+
label: "After",
|
90
|
+
onChange: () => {
|
91
|
+
setSchedule("after");
|
92
|
+
},
|
93
|
+
control: /*#__PURE__*/_jsx(Radio, {
|
94
|
+
size: "small"
|
95
|
+
})
|
96
|
+
})]
|
88
97
|
})
|
89
98
|
}), schedule === "after" && /*#__PURE__*/_jsx(Grid, {
|
90
99
|
item: true,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-unused-vars */
|
2
2
|
import React, { useState } from "react";
|
3
|
-
import { Transforms, Path } from "slate";
|
3
|
+
import { Transforms, Path, Node } from "slate";
|
4
4
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
5
5
|
import { IconButton, Tooltip, Grid as GridContainer } from "@mui/material";
|
6
6
|
import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward";
|
@@ -15,6 +15,7 @@ import { gridItem } from "../../utils/gridItem";
|
|
15
15
|
import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
|
16
16
|
import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
|
17
17
|
import useWindowResize from "../../hooks/useWindowResize";
|
18
|
+
import { useTheme } from "@emotion/react";
|
18
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
19
20
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
20
21
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -29,11 +30,16 @@ const GridToolBar = ({
|
|
29
30
|
onAddGridItem,
|
30
31
|
onAddSection,
|
31
32
|
onMoveSection,
|
32
|
-
path
|
33
|
+
path,
|
34
|
+
isSectionFullWidth
|
33
35
|
}) => {
|
34
36
|
return selected && !showTool ? /*#__PURE__*/_jsxs("div", {
|
35
37
|
className: "grid-container-toolbar",
|
36
38
|
contentEditable: false,
|
39
|
+
style: isSectionFullWidth ? {
|
40
|
+
right: "4px",
|
41
|
+
top: "4px"
|
42
|
+
} : {},
|
37
43
|
children: [/*#__PURE__*/_jsx(Tooltip, {
|
38
44
|
title: "Grid Settings",
|
39
45
|
arrow: true,
|
@@ -74,7 +80,19 @@ const GridToolBar = ({
|
|
74
80
|
}) : null]
|
75
81
|
}) : null;
|
76
82
|
};
|
83
|
+
const getParentEl = (editor, path) => {
|
84
|
+
try {
|
85
|
+
if (path?.length) {
|
86
|
+
return Node.parent(editor, path);
|
87
|
+
} else {
|
88
|
+
return null;
|
89
|
+
}
|
90
|
+
} catch (err) {
|
91
|
+
return null;
|
92
|
+
}
|
93
|
+
};
|
77
94
|
const Grid = props => {
|
95
|
+
const theme = useTheme();
|
78
96
|
const {
|
79
97
|
attributes,
|
80
98
|
children,
|
@@ -113,6 +131,11 @@ const Grid = props => {
|
|
113
131
|
const selected = hoverPath === path.join(",");
|
114
132
|
const [showTool] = useEditorSelection(editor);
|
115
133
|
const [size] = useWindowResize();
|
134
|
+
const parentElement = getParentEl(editor, path);
|
135
|
+
const {
|
136
|
+
sectionGridSize
|
137
|
+
} = parentElement || {};
|
138
|
+
const isSectionFullWidth = sectionGridSize && sectionGridSize[size?.device] >= 12;
|
116
139
|
const onAddGridItem = () => {
|
117
140
|
const currentPath = editor.selection?.anchor?.path;
|
118
141
|
const ancestorsPath = Path.ancestors(currentPath, {
|
@@ -327,7 +350,8 @@ const Grid = props => {
|
|
327
350
|
onAddGridItem: onAddGridItem,
|
328
351
|
onAddSection: onAddSection,
|
329
352
|
onMoveSection: onMoveSection,
|
330
|
-
path: path
|
353
|
+
path: path,
|
354
|
+
isSectionFullWidth: isSectionFullWidth
|
331
355
|
})]
|
332
356
|
}), openSetttings ? /*#__PURE__*/_jsx(PoupComp, {
|
333
357
|
element: element,
|
@@ -8,6 +8,7 @@ import { GridSettingsIcon } from "../../common/iconslist";
|
|
8
8
|
import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
|
9
9
|
import { getBreakPointsValue, getTRBLBreakPoints } from "../../helper/theme";
|
10
10
|
import { isEmptyNode } from "../../utils/helper";
|
11
|
+
import { useTheme } from "@emotion/react";
|
11
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
12
13
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
13
14
|
const GridItemToolbar = ({
|
@@ -34,6 +35,7 @@ const GridItemToolbar = ({
|
|
34
35
|
}) : null;
|
35
36
|
};
|
36
37
|
const GridItem = props => {
|
38
|
+
const theme = useTheme();
|
37
39
|
const {
|
38
40
|
attributes,
|
39
41
|
children,
|
@@ -119,7 +121,7 @@ const GridItem = props => {
|
|
119
121
|
xs: xsHidden ? "none" : "flex"
|
120
122
|
},
|
121
123
|
flexDirection: flexDirection || "column",
|
122
|
-
background: bgColor
|
124
|
+
background: bgColor,
|
123
125
|
borderColor: getBorderColor(),
|
124
126
|
borderWidth: borderWidth || "1px",
|
125
127
|
borderRadius: {
|
@@ -9,6 +9,7 @@ import { removeLink } from "../../utils/link";
|
|
9
9
|
import LinkPopup from "./LinkPopup";
|
10
10
|
import "./styles.css";
|
11
11
|
import { absoluteLink } from "../../utils/helper";
|
12
|
+
import { useEditorContext } from "../../hooks/useMouseMove";
|
12
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
13
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
14
15
|
const Link = props => {
|
@@ -29,6 +30,9 @@ const Link = props => {
|
|
29
30
|
const path = ReactEditor.findPath(editor, element);
|
30
31
|
const urlPath = element.url || element.href;
|
31
32
|
const absLink = absoluteLink(urlPath);
|
33
|
+
const {
|
34
|
+
theme
|
35
|
+
} = useEditorContext();
|
32
36
|
const updateLink = () => {
|
33
37
|
Transforms.setNodes(editor, {
|
34
38
|
href: linkData?.url,
|
@@ -107,7 +111,8 @@ const Link = props => {
|
|
107
111
|
linkData: linkData,
|
108
112
|
handleClose: handleClose,
|
109
113
|
handleInputChange: handleInputChange,
|
110
|
-
handleInsertLink: updateLink
|
114
|
+
handleInsertLink: updateLink,
|
115
|
+
theme: theme
|
111
116
|
})]
|
112
117
|
});
|
113
118
|
};
|
@@ -9,7 +9,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
10
|
const LinkButton = props => {
|
11
11
|
const {
|
12
|
-
editor
|
12
|
+
editor,
|
13
|
+
theme
|
13
14
|
} = props;
|
14
15
|
const linkInputRef = useRef(null);
|
15
16
|
const [showInput, setShowInput] = useState(false);
|
@@ -77,7 +78,8 @@ const LinkButton = props => {
|
|
77
78
|
linkData: linkData,
|
78
79
|
handleClose: handleClose,
|
79
80
|
handleInputChange: handleInputChange,
|
80
|
-
handleInsertLink: handleInsertLink
|
81
|
+
handleInsertLink: handleInsertLink,
|
82
|
+
theme: theme
|
81
83
|
})]
|
82
84
|
});
|
83
85
|
};
|