@flozy/editor 3.8.9 → 3.9.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/ChatEditor.js +55 -45
- package/dist/Editor/CommonEditor.js +175 -168
- package/dist/Editor/DialogWrapper.js +3 -4
- package/dist/Editor/Editor.css +7 -4
- package/dist/Editor/Elements/AI/AIInput.js +17 -18
- package/dist/Editor/Elements/AI/CustomSelect.js +19 -12
- package/dist/Editor/Elements/AI/PopoverAIInput.js +58 -74
- package/dist/Editor/Elements/AI/Styles.js +2 -1
- package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +73 -0
- package/dist/Editor/Elements/AI/VoiceToText/index.js +177 -0
- package/dist/Editor/Elements/AI/VoiceToText/style.js +40 -0
- package/dist/Editor/Elements/AppHeader/AppHeader.js +49 -40
- package/dist/Editor/Elements/Button/EditorButton.js +38 -33
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -17
- 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 +2 -1
- package/dist/Editor/Elements/Embed/Image.js +14 -15
- package/dist/Editor/Elements/Embed/Video.js +8 -12
- package/dist/Editor/Elements/Emoji/EmojiButton.js +7 -11
- package/dist/Editor/Elements/Emoji/EmojiPicker.js +4 -2
- package/dist/Editor/Elements/Form/Form.js +1 -1
- 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 +34 -14
- package/dist/Editor/Elements/Grid/GridItem.js +23 -31
- 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 +10 -3
- package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +8 -4
- package/dist/Editor/Elements/Redo/RedoButton.js +14 -0
- package/dist/Editor/Elements/Signature/SignaturePopup.js +14 -3
- package/dist/Editor/Elements/SimpleText/index.js +8 -9
- package/dist/Editor/Elements/SimpleText/style.js +0 -37
- 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 -24
- package/dist/Editor/Toolbar/Basic/index.js +4 -2
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +26 -2
- package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +29 -18
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +29 -3
- package/dist/Editor/Toolbar/Mini/Options/Options.js +10 -0
- package/dist/Editor/Toolbar/Mini/Styles.js +7 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +4 -11
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +213 -86
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +22 -16
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +52 -8
- package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
- package/dist/Editor/Toolbar/PopupTool/index.js +7 -25
- package/dist/Editor/Toolbar/Toolbar.js +0 -7
- package/dist/Editor/Toolbar/toolbarGroups.js +48 -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 +25 -9
- package/dist/Editor/common/CustomColorPicker/index.js +106 -0
- package/dist/Editor/common/CustomColorPicker/style.js +53 -0
- package/dist/Editor/common/CustomDialog/index.js +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/Icon.js +41 -8
- 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/MentionsListCard.js +6 -1
- package/dist/Editor/common/MentionsPopup/index.js +8 -12
- package/dist/Editor/common/Section/index.js +69 -28
- package/dist/Editor/common/Section/styles.js +12 -6
- package/dist/Editor/common/Shorthands/elements.js +54 -12
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +19 -16
- 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 +31 -7
- package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +14 -3
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +2 -4
- package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +14 -4
- package/dist/Editor/common/StyleBuilder/index.js +1 -1
- package/dist/Editor/common/StyleBuilder/sectionStyle.js +2 -13
- package/dist/Editor/common/iconslist.js +0 -31
- package/dist/Editor/helper/index.js +0 -139
- package/dist/Editor/helper/theme.js +185 -48
- package/dist/Editor/hooks/useEditorTheme.js +139 -0
- package/dist/Editor/hooks/useMouseMove.js +12 -37
- package/dist/Editor/hooks/useWindowMessage.js +10 -7
- package/dist/Editor/hooks/withCommon.js +1 -2
- 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 +163 -47
- package/dist/Editor/utils/button.js +1 -17
- package/dist/Editor/utils/draftToSlate.js +1 -1
- package/dist/Editor/utils/events.js +54 -7
- package/dist/Editor/utils/font.js +40 -37
- package/dist/Editor/utils/helper.js +31 -31
- package/dist/Editor/utils/table.js +51 -43
- package/package.json +4 -6
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -391
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +0 -193
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +0 -23
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +0 -184
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +0 -36
- package/dist/Editor/Elements/FreeGrid/Options/More.js +0 -24
- package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +0 -47
- package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +0 -11
- package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +0 -75
- package/dist/Editor/Elements/FreeGrid/styles.js +0 -159
- package/dist/Editor/ErrorBoundary.js +0 -30
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +0 -105
- package/dist/Editor/common/RnD/ContextMenu/index.js +0 -38
- package/dist/Editor/common/RnD/ContextMenu/styles.js +0 -21
- package/dist/Editor/common/RnD/DragInfo/index.js +0 -31
- package/dist/Editor/common/RnD/DragInfo/styles.js +0 -15
- package/dist/Editor/common/RnD/DragOver/index.js +0 -46
- package/dist/Editor/common/RnD/DragOver/styles.js +0 -23
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +0 -82
- package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +0 -26
- package/dist/Editor/common/RnD/ElementOptions/index.js +0 -93
- package/dist/Editor/common/RnD/ElementOptions/styles.js +0 -41
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +0 -153
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +0 -58
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +0 -7
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +0 -46
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +0 -46
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +0 -46
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +0 -30
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +0 -46
- package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +0 -13
- package/dist/Editor/common/RnD/ElementSettings/index.js +0 -17
- package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +0 -14
- package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -76
- package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +0 -52
- package/dist/Editor/common/RnD/GuideLines/index.js +0 -33
- package/dist/Editor/common/RnD/GuideLines/styles.js +0 -60
- package/dist/Editor/common/RnD/OptionsPopup/index.js +0 -50
- package/dist/Editor/common/RnD/OptionsPopup/style.js +0 -36
- package/dist/Editor/common/RnD/RnDCopy.js +0 -23
- package/dist/Editor/common/RnD/ShadowElement.js +0 -34
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +0 -40
- package/dist/Editor/common/RnD/SwitchViewport/styles.js +0 -24
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +0 -63
- package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +0 -19
- package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +0 -13
- package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +0 -18
- package/dist/Editor/common/RnD/TransformHandles/index.js +0 -62
- package/dist/Editor/common/RnD/Utils/alignmentDetection.js +0 -26
- package/dist/Editor/common/RnD/Utils/calculateDropItem.js +0 -98
- package/dist/Editor/common/RnD/Utils/collisionDetection.js +0 -52
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +0 -148
- package/dist/Editor/common/RnD/Utils/index.js +0 -251
- package/dist/Editor/common/RnD/VirtualElement/index.js +0 -76
- package/dist/Editor/common/RnD/VirtualElement/styles.js +0 -27
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +0 -28
- package/dist/Editor/common/RnD/index.js +0 -503
- package/dist/Editor/common/RnD/styles.js +0 -4
- package/dist/Editor/common/StyleBuilder/boxStyle.js +0 -30
- package/dist/Editor/helper/RnD/focusOnNewItem.js +0 -39
- package/dist/Editor/helper/RnD/scrollToNewSection.js +0 -24
- package/dist/Editor/helper/breakpoint.js +0 -5
- package/dist/Editor/hooks/useBreakpoints.js +0 -34
- package/dist/Editor/hooks/withErrorHandling.js +0 -14
- package/dist/Editor/utils/RnD/RnDCtrlCmds.js +0 -168
- package/dist/Editor/utils/freegrid.js +0 -49
@@ -1,7 +1,6 @@
|
|
1
1
|
import React, { useRef, useState } from "react";
|
2
2
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
3
3
|
import { Transforms, Editor, Element } from "slate";
|
4
|
-
import { useTheme } from "@mui/material";
|
5
4
|
import AppBar from "@mui/material/AppBar";
|
6
5
|
import Box from "@mui/material/Box";
|
7
6
|
import CssBaseline from "@mui/material/CssBaseline";
|
@@ -17,7 +16,7 @@ import Toolbar from "@mui/material/Toolbar";
|
|
17
16
|
import Typography from "@mui/material/Typography";
|
18
17
|
import Button from "@mui/material/Button";
|
19
18
|
import AppHeaderPopup from "./AppHeaderPopup";
|
20
|
-
import { getTRBLBreakPoints
|
19
|
+
import { getTRBLBreakPoints } from "../../helper/theme";
|
21
20
|
import { handleLinkType } from "../../utils/helper";
|
22
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
23
22
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
@@ -25,7 +24,6 @@ import { createElement as _createElement } from "react";
|
|
25
24
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
26
25
|
const drawerWidth = 240;
|
27
26
|
function AppHeader(props) {
|
28
|
-
const theme = useTheme();
|
29
27
|
const navWrprRef = useRef(null);
|
30
28
|
const [openSetttings, setOpenSettings] = useState(false);
|
31
29
|
const {
|
@@ -64,6 +62,11 @@ function AppHeader(props) {
|
|
64
62
|
const handleDrawerToggle = () => {
|
65
63
|
setMobileOpen(prevState => !prevState);
|
66
64
|
};
|
65
|
+
const closeDrawer = () => {
|
66
|
+
if (mobileOpen) {
|
67
|
+
handleDrawerToggle();
|
68
|
+
}
|
69
|
+
};
|
67
70
|
const onSettings = e => {
|
68
71
|
if (!readOnly) {
|
69
72
|
e.stopPropagation();
|
@@ -123,6 +126,11 @@ function AppHeader(props) {
|
|
123
126
|
}
|
124
127
|
}
|
125
128
|
};
|
129
|
+
|
130
|
+
// const onMenuSettings = (menuItem, i) => (event) => {
|
131
|
+
// event.preventDefault();
|
132
|
+
// };
|
133
|
+
|
126
134
|
const drawer = /*#__PURE__*/_jsxs(Box, {
|
127
135
|
onClick: handleDrawerToggle,
|
128
136
|
sx: {
|
@@ -145,10 +153,27 @@ function AppHeader(props) {
|
|
145
153
|
}), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(List, {
|
146
154
|
children: menus.map((item, i) => {
|
147
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
|
+
};
|
148
173
|
return /*#__PURE__*/_jsx(ListItem, {
|
149
174
|
disablePadding: true,
|
150
175
|
children: /*#__PURE__*/_jsx(ListItemButton, {
|
151
|
-
...
|
176
|
+
...props,
|
152
177
|
sx: {
|
153
178
|
textAlign: "center"
|
154
179
|
},
|
@@ -161,20 +186,15 @@ function AppHeader(props) {
|
|
161
186
|
})]
|
162
187
|
});
|
163
188
|
const container = window !== undefined ? () => window().document.body : undefined;
|
189
|
+
// const elevateStyle = useEleveateScroll({
|
190
|
+
// ...props,
|
191
|
+
// parentRef: navWrprRef,
|
192
|
+
// needElevation: readOnly,
|
193
|
+
// });
|
194
|
+
|
164
195
|
const elevateStyle = {
|
165
196
|
position: "relative"
|
166
197
|
};
|
167
|
-
const appbarSp = groupByBreakpoint({
|
168
|
-
padding: {
|
169
|
-
...getTRBLBreakPoints(bannerSpacing)
|
170
|
-
}
|
171
|
-
}, theme);
|
172
|
-
const toolbarSp = groupByBreakpoint({
|
173
|
-
flexDirection: {
|
174
|
-
xs: "row-reverse !important",
|
175
|
-
lg: "unset"
|
176
|
-
}
|
177
|
-
}, theme);
|
178
198
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
179
199
|
children: [/*#__PURE__*/_jsxs(Box, {
|
180
200
|
sx: {
|
@@ -196,14 +216,13 @@ function AppHeader(props) {
|
|
196
216
|
...elevateStyle,
|
197
217
|
background: bgColor,
|
198
218
|
boxShadow: "none",
|
199
|
-
|
219
|
+
padding: {
|
220
|
+
...getTRBLBreakPoints(bannerSpacing)
|
221
|
+
},
|
200
222
|
zIndex: 999
|
201
223
|
},
|
202
224
|
onClick: onSettings,
|
203
225
|
children: /*#__PURE__*/_jsxs(Toolbar, {
|
204
|
-
sx: {
|
205
|
-
...toolbarSp
|
206
|
-
},
|
207
226
|
style: {
|
208
227
|
flexDirection: isLogoRight ? "row-reverse" : "row",
|
209
228
|
paddingLeft: "0px",
|
@@ -220,11 +239,8 @@ function AppHeader(props) {
|
|
220
239
|
},
|
221
240
|
sx: {
|
222
241
|
mr: 2,
|
223
|
-
|
224
|
-
|
225
|
-
},
|
226
|
-
[theme.breakpoints.between("xs", "md")]: {
|
227
|
-
display: "block"
|
242
|
+
display: {
|
243
|
+
sm: "none"
|
228
244
|
}
|
229
245
|
},
|
230
246
|
children: /*#__PURE__*/_jsx(MenuIcon, {})
|
@@ -235,21 +251,16 @@ function AppHeader(props) {
|
|
235
251
|
style: {
|
236
252
|
display: "inline-flex",
|
237
253
|
alignItems: "center",
|
238
|
-
color: textColor,
|
254
|
+
color: textColor || "#000000",
|
239
255
|
fontSize: logoFontSize,
|
240
256
|
fontFamily: titleFontFamily,
|
241
257
|
justifyContent: isLogoRight ? "end" : "start"
|
242
258
|
},
|
243
259
|
sx: {
|
244
260
|
flexGrow: 1,
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
[theme.breakpoints.between("xs", "md")]: {
|
249
|
-
display: "none"
|
250
|
-
},
|
251
|
-
"& img": {
|
252
|
-
marginRight: "7px"
|
261
|
+
display: {
|
262
|
+
xs: "none",
|
263
|
+
sm: "block"
|
253
264
|
}
|
254
265
|
},
|
255
266
|
className: "app-logo",
|
@@ -263,11 +274,9 @@ function AppHeader(props) {
|
|
263
274
|
}) : null, appTitle]
|
264
275
|
}), /*#__PURE__*/_jsxs(Box, {
|
265
276
|
sx: {
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
[theme.breakpoints.between("xs", "md")]: {
|
270
|
-
display: "none"
|
277
|
+
display: {
|
278
|
+
xs: "none",
|
279
|
+
sm: "block"
|
271
280
|
}
|
272
281
|
},
|
273
282
|
children: [isDrawer ? /*#__PURE__*/_jsx(IconButton, {
|
@@ -290,7 +299,7 @@ function AppHeader(props) {
|
|
290
299
|
fontFamily: fontFamily,
|
291
300
|
textTransform: "none",
|
292
301
|
fontSize: fontSize || "16px",
|
293
|
-
color: textColor || "#
|
302
|
+
color: textColor || "#000",
|
294
303
|
background: bgColor || "none",
|
295
304
|
"& .m-settings": {
|
296
305
|
display: "none",
|
@@ -305,7 +314,7 @@ function AppHeader(props) {
|
|
305
314
|
background: "#FFF"
|
306
315
|
},
|
307
316
|
"&:hover": {
|
308
|
-
color: textColorHover || textColor || "#
|
317
|
+
color: textColorHover || textColor || "#000",
|
309
318
|
background: bgColorHover || bgColor || "none",
|
310
319
|
"& .m-settings": {
|
311
320
|
display: "block"
|
@@ -1,7 +1,8 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { Transforms } from "slate";
|
3
3
|
import { ReactEditor, useSlateStatic } from "slate-react";
|
4
|
-
import { IconButton, Tooltip, Box
|
4
|
+
import { IconButton, Tooltip, Box } from "@mui/material";
|
5
|
+
// import * as fIcons from "@mui/icons-material";
|
5
6
|
import MUIIcon from "../../common/StyleBuilder/fieldTypes/loadIcon";
|
6
7
|
import SettingsIcon from "@mui/icons-material/Settings";
|
7
8
|
import OpenInNewIcon from "@mui/icons-material/OpenInNew";
|
@@ -9,13 +10,15 @@ import LinkIcon from "@mui/icons-material/Link";
|
|
9
10
|
import ButtonPopup from "./ButtonPopup";
|
10
11
|
import { actionButtonRedirect } from "../../service/actionTrigger";
|
11
12
|
import { WorkflowIcon } from "../../common/iconslist";
|
12
|
-
import { getTRBLBreakPoints, getBreakPointsValue
|
13
|
+
import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
|
13
14
|
import { handleLinkType, windowVar } from "../../utils/helper";
|
14
15
|
import LinkSettings from "../../common/LinkSettings";
|
16
|
+
import { useEditorTheme } from "../../hooks/useEditorTheme";
|
17
|
+
import { getTheme } from "../../theme";
|
18
|
+
import { fontFamilyMap } from "../../utils/font";
|
15
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
16
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
17
21
|
const EditorButton = props => {
|
18
|
-
const theme = useTheme();
|
19
22
|
const {
|
20
23
|
attributes,
|
21
24
|
element,
|
@@ -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({}, {
|
@@ -81,6 +92,7 @@ const EditorButton = props => {
|
|
81
92
|
}
|
82
93
|
};
|
83
94
|
const buttonProps = handleLinkType(refURl, linkType, readOnly, openInNewTab, handleTrigger);
|
95
|
+
console.log(openInNewTab);
|
84
96
|
const onMenuClick = val => () => {
|
85
97
|
switch (val) {
|
86
98
|
case "edit":
|
@@ -153,33 +165,21 @@ const EditorButton = props => {
|
|
153
165
|
const onClose = () => {
|
154
166
|
setEdit(false);
|
155
167
|
};
|
156
|
-
const tAlign = alignment || textAlign || "left";
|
157
|
-
const btnSp = groupByBreakpoint({
|
158
|
-
borderRadius: {
|
159
|
-
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
160
|
-
},
|
161
|
-
padding: {
|
162
|
-
...getTRBLBreakPoints(bannerSpacing)
|
163
|
-
}
|
164
|
-
}, theme);
|
165
|
-
const pSp = groupByBreakpoint({
|
166
|
-
display: {
|
167
|
-
xs: xsHidden ? "none" : "inline-block",
|
168
|
-
lg: "inline-block"
|
169
|
-
}
|
170
|
-
}, theme);
|
171
168
|
return /*#__PURE__*/_jsxs("div", {
|
172
|
-
className:
|
169
|
+
className: "editor-btn-wrapper",
|
173
170
|
...attributes,
|
174
171
|
style: {
|
175
|
-
textAlign:
|
172
|
+
textAlign: alignment || textAlign || "left"
|
176
173
|
},
|
177
174
|
contentEditable: false,
|
178
175
|
children: [/*#__PURE__*/_jsx(Box, {
|
179
176
|
component: "div",
|
180
177
|
className: "editor-btn-wrapper-inner",
|
181
178
|
sx: {
|
182
|
-
|
179
|
+
display: {
|
180
|
+
lg: "inline-block",
|
181
|
+
xs: xsHidden ? "none" : "inline-block"
|
182
|
+
},
|
183
183
|
"& .element-toolbar": {
|
184
184
|
display: "none"
|
185
185
|
},
|
@@ -195,18 +195,11 @@ const EditorButton = props => {
|
|
195
195
|
display: "inline-block"
|
196
196
|
},
|
197
197
|
children: [/*#__PURE__*/_jsxs(Box, {
|
198
|
-
className: `btn textAlign-${tAlign}`,
|
199
198
|
sx: {
|
200
199
|
textDecoration: "none",
|
201
|
-
background: bgColor || "rgb(30, 75, 122)",
|
202
200
|
borderBlockStyle: "solid",
|
203
|
-
borderColor: borderColor || "transparent",
|
204
201
|
borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
|
205
|
-
...btnSp,
|
206
202
|
borderStyle: borderStyle || "solid",
|
207
|
-
color: `${textColor || "#FFFFFF"}`,
|
208
|
-
fontSize: textSize || "inherit",
|
209
|
-
fontFamily: fontFamily || "PoppinsRegular",
|
210
203
|
display: "inline-flex",
|
211
204
|
alignItems: "center",
|
212
205
|
position: "relative",
|
@@ -214,14 +207,26 @@ const EditorButton = props => {
|
|
214
207
|
display: "none"
|
215
208
|
},
|
216
209
|
"&:hover": {
|
217
|
-
color: `${textColorHover || textColor
|
218
|
-
background: bgColorHover || bgColor
|
210
|
+
color: `${textColorHover || textColor}`,
|
211
|
+
background: bgColorHover || bgColor,
|
219
212
|
"& .element-toolbar": {
|
220
213
|
display: "flex"
|
221
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 || {})
|
222
226
|
}
|
223
227
|
},
|
224
228
|
...buttonProps,
|
229
|
+
className: "button theme-element",
|
225
230
|
children: [BtnIcon && iconPosition === "start" && /*#__PURE__*/_jsx(MUIIcon, {
|
226
231
|
iconName: buttonIcon,
|
227
232
|
style: {
|
@@ -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) {
|
@@ -31,9 +35,7 @@ const SingleColorButton = ({
|
|
31
35
|
style: {
|
32
36
|
width: "100%",
|
33
37
|
display: "flex",
|
34
|
-
|
35
|
-
padding: padding || "8px",
|
36
|
-
justifyContent: "center"
|
38
|
+
padding: padding || "8px"
|
37
39
|
},
|
38
40
|
children: [crs.map(m => /*#__PURE__*/_jsx(Button, {
|
39
41
|
onClick: handleSelect(m),
|
@@ -109,11 +111,17 @@ const ColorButtons = props => {
|
|
109
111
|
forMiniTool,
|
110
112
|
openColorTool,
|
111
113
|
onClose,
|
112
|
-
onColorPickerClick
|
114
|
+
onColorPickerClick,
|
115
|
+
disableEditTheme
|
113
116
|
} = props;
|
114
117
|
const [row1, ...restRows] = ColorChunks([]);
|
115
118
|
const [anchorEl, setAnchorEl] = useState(null);
|
116
119
|
const open = Boolean(anchorEl);
|
120
|
+
const theme = useTheme();
|
121
|
+
const editor = useSlateStatic();
|
122
|
+
const {
|
123
|
+
setOpenTheme
|
124
|
+
} = useContext(ThemeContext);
|
117
125
|
const handleMore = e => {
|
118
126
|
setAnchorEl(e.currentTarget);
|
119
127
|
};
|
@@ -126,6 +134,7 @@ const ColorButtons = props => {
|
|
126
134
|
const handleSelect = color => () => {
|
127
135
|
onSelect(color);
|
128
136
|
};
|
137
|
+
const colorVars = theme?.vars?.colors || {};
|
129
138
|
return /*#__PURE__*/_jsxs(Box, {
|
130
139
|
component: "span",
|
131
140
|
sx: classes.colorButtons,
|
@@ -142,7 +151,7 @@ const ColorButtons = props => {
|
|
142
151
|
activeColor: activeColor
|
143
152
|
}, `si_btn_row1_${m}_${i}`);
|
144
153
|
})
|
145
|
-
}), /*#__PURE__*/
|
154
|
+
}), /*#__PURE__*/_jsx(Popover, {
|
146
155
|
open: open || openColorTool,
|
147
156
|
anchorEl: anchorEl || openColorTool,
|
148
157
|
onClose: handleClose,
|
@@ -156,9 +165,39 @@ const ColorButtons = props => {
|
|
156
165
|
},
|
157
166
|
sx: classes.colorPopper,
|
158
167
|
className: "colorPopper",
|
159
|
-
children:
|
168
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
160
169
|
sx: classes.colorButtonsInner,
|
161
|
-
children:
|
170
|
+
children: [Object.values(colorVars)?.length ? /*#__PURE__*/_jsxs(_Fragment, {
|
171
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
172
|
+
component: "div",
|
173
|
+
className: "singleColorTitleWrapper",
|
174
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
175
|
+
variant: "subtitle2",
|
176
|
+
children: "Theme colour"
|
177
|
+
}), disableEditTheme ? null : /*#__PURE__*/_jsx("div", {
|
178
|
+
className: "editBtn",
|
179
|
+
onClick: () => {
|
180
|
+
Transforms.deselect(editor, {
|
181
|
+
at: editor.selection
|
182
|
+
});
|
183
|
+
setOpenTheme("editThemeColor");
|
184
|
+
},
|
185
|
+
children: "Edit"
|
186
|
+
})]
|
187
|
+
}), /*#__PURE__*/_jsx(SingleColorButton, {
|
188
|
+
crs: Object.values(colorVars),
|
189
|
+
handleSelect: handleSelect,
|
190
|
+
classes: classes,
|
191
|
+
activeColor: activeColor
|
192
|
+
})]
|
193
|
+
}) : null, /*#__PURE__*/_jsx(Box, {
|
194
|
+
component: "div",
|
195
|
+
className: "singleColorTitleWrapper",
|
196
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
197
|
+
variant: "subtitle2",
|
198
|
+
children: "Custom colour"
|
199
|
+
})
|
200
|
+
}), restRows.map((m, i) => {
|
162
201
|
return /*#__PURE__*/_jsx(SingleColorButton, {
|
163
202
|
id: `p2_${id}`,
|
164
203
|
crs: m,
|
@@ -167,14 +206,18 @@ const ColorButtons = props => {
|
|
167
206
|
classes: classes,
|
168
207
|
activeColor: activeColor
|
169
208
|
}, `si_btn_${m}_${i}`);
|
170
|
-
})
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
209
|
+
}), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
|
210
|
+
onClick: onColorPickerClick,
|
211
|
+
style: {
|
212
|
+
alignSelf: "start",
|
213
|
+
margin: "6px"
|
214
|
+
},
|
215
|
+
children: /*#__PURE__*/_jsx("img", {
|
216
|
+
src: ColorPicker,
|
217
|
+
alt: "color wheel"
|
218
|
+
})
|
219
|
+
}) : null]
|
220
|
+
})
|
178
221
|
})]
|
179
222
|
});
|
180
223
|
};
|
@@ -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
|
});
|
@@ -15,7 +15,8 @@ const ColorPickerStyles = theme => ({
|
|
15
15
|
colorPopper: {
|
16
16
|
"& .MuiPaper-root": {
|
17
17
|
backgroundColor: theme?.palette?.editor?.background,
|
18
|
-
|
18
|
+
padding: "4px 14px",
|
19
|
+
"@media only screen and (max-width: 600px)": {
|
19
20
|
marginTop: "-40px"
|
20
21
|
}
|
21
22
|
}
|
@@ -4,16 +4,15 @@ import { Node, Transforms, Editor } from "slate";
|
|
4
4
|
import AspectRatioIcon from "@mui/icons-material/AspectRatio";
|
5
5
|
import useResize from "../../utils/customHooks/useResize";
|
6
6
|
import EmbedPopup from "./EmbedPopup";
|
7
|
-
import { IconButton, Tooltip, Box
|
7
|
+
import { IconButton, Tooltip, Box } from "@mui/material";
|
8
8
|
import { GridSettingsIcon, LinkIcon } from "../../common/iconslist";
|
9
9
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
10
|
-
import { getTRBLBreakPoints, getBreakPointsValue
|
10
|
+
import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
|
11
11
|
import Icon from "../../common/Icon";
|
12
12
|
import frames from "./Frames";
|
13
13
|
import ImageFrame from "./Frames/ImageFrame";
|
14
14
|
import LinkSettings from "../../common/LinkSettings";
|
15
15
|
import { handleLinkType } from "../../utils/helper";
|
16
|
-
import { wrapThemeBreakpoints } from "../FreeGrid/breakpointConstants";
|
17
16
|
import { jsx as _jsx } from "react/jsx-runtime";
|
18
17
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
19
18
|
const ToolBar = ({
|
@@ -66,7 +65,6 @@ const ImageContent = ({
|
|
66
65
|
objectFit,
|
67
66
|
webAddress
|
68
67
|
} = element;
|
69
|
-
const theme = useTheme();
|
70
68
|
return !url && !readOnly ? /*#__PURE__*/_jsxs(Box, {
|
71
69
|
component: "button",
|
72
70
|
className: "element-empty-btn",
|
@@ -81,7 +79,9 @@ const ImageContent = ({
|
|
81
79
|
component: "img",
|
82
80
|
className: "emb-img",
|
83
81
|
sx: {
|
84
|
-
|
82
|
+
borderRadius: {
|
83
|
+
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
84
|
+
},
|
85
85
|
objectFit: "cover",
|
86
86
|
boxShadow: boxShadow || "none",
|
87
87
|
height: objectFit ? "100%" : "auto",
|
@@ -105,7 +105,6 @@ const Image = ({
|
|
105
105
|
children,
|
106
106
|
customProps
|
107
107
|
}) => {
|
108
|
-
const theme = useTheme();
|
109
108
|
const {
|
110
109
|
url,
|
111
110
|
bannerSpacing,
|
@@ -228,14 +227,12 @@ const Image = ({
|
|
228
227
|
};
|
229
228
|
} else {
|
230
229
|
return {
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
} : "auto"
|
238
|
-
}, theme)
|
230
|
+
width: url ? {
|
231
|
+
...getBreakPointsValue(getSize(), null, "overrideReSize", true)
|
232
|
+
} : "100%",
|
233
|
+
height: objectFit && url ? {
|
234
|
+
...getBreakPointsValue(getSize(), null, "overrideReSizeH", true)
|
235
|
+
} : "auto"
|
239
236
|
};
|
240
237
|
}
|
241
238
|
};
|
@@ -250,7 +247,9 @@ const Image = ({
|
|
250
247
|
},
|
251
248
|
width: `100%`,
|
252
249
|
maxWidth: "100%",
|
253
|
-
|
250
|
+
padding: {
|
251
|
+
...getTRBLBreakPoints(bannerSpacing)
|
252
|
+
},
|
254
253
|
backgroundColor: bgColor,
|
255
254
|
justifyContent: horizantal,
|
256
255
|
alignContent: vertical
|