@flozy/editor 4.0.3 → 4.0.5
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/CommonEditor.js +85 -13
- package/dist/Editor/DialogWrapper.js +4 -3
- package/dist/Editor/Editor.css +28 -2
- 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 +124 -133
- 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/AppHeader/AppHeader.js +36 -23
- package/dist/Editor/Elements/Button/EditorButton.js +23 -16
- package/dist/Editor/Elements/Carousel/CarouselButton.js +2 -2
- package/dist/Editor/Elements/Color Picker/ColorButtons.js +1 -1
- package/dist/Editor/Elements/Color Picker/Styles.js +1 -0
- package/dist/Editor/Elements/Embed/Image.js +15 -14
- package/dist/Editor/Elements/Embed/Video.js +12 -8
- package/dist/Editor/Elements/Emoji/EmojiButton.js +11 -7
- package/dist/Editor/Elements/Form/Form.js +43 -27
- package/dist/Editor/Elements/Form/FormField.js +21 -10
- package/dist/Editor/Elements/Form/Workflow/index.js +5 -2
- package/dist/Editor/Elements/FreeGrid/FreeGrid.js +437 -0
- package/dist/Editor/Elements/FreeGrid/FreeGridBox.js +206 -0
- package/dist/Editor/Elements/FreeGrid/FreeGridButton.js +23 -0
- package/dist/Editor/Elements/FreeGrid/FreeGridItem.js +236 -0
- package/dist/Editor/Elements/FreeGrid/Options/AddElement.js +44 -0
- package/dist/Editor/Elements/FreeGrid/Options/More.js +24 -0
- package/dist/Editor/Elements/FreeGrid/Options/SectionSettings.js +47 -0
- package/dist/Editor/Elements/FreeGrid/Options/sectionItemOptions.js +19 -0
- package/dist/Editor/Elements/FreeGrid/breakpointConstants.js +75 -0
- package/dist/Editor/Elements/FreeGrid/styles.js +214 -0
- package/dist/Editor/Elements/Grid/Grid.js +12 -8
- package/dist/Editor/Elements/Grid/GridItem.js +31 -21
- package/dist/Editor/Elements/Link/LinkPopup.js +69 -13
- package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
- package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -2
- 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 +186 -31
- package/dist/Editor/Elements/SimpleText/index.js +19 -7
- package/dist/Editor/Elements/SimpleText/style.js +44 -1
- package/dist/Editor/ErrorBoundary.js +30 -0
- package/dist/Editor/Styles/EditorStyles.js +28 -0
- package/dist/Editor/Toolbar/FormatTools/Dropdown.js +1 -1
- package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -2
- package/dist/Editor/Toolbar/Mini/MiniToolbar.js +33 -5
- 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/SelectSuperSubscript.js +59 -0
- package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
- package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +107 -40
- package/dist/Editor/Toolbar/PopupTool/TextFormat.js +57 -61
- package/dist/Editor/Toolbar/PopupTool/index.js +13 -3
- package/dist/Editor/Toolbar/Toolbar.js +7 -0
- package/dist/Editor/Toolbar/toolbarGroups.js +15 -5
- package/dist/Editor/assets/svg/AIIcons.js +153 -1
- package/dist/Editor/common/EditorCmds.js +0 -3
- package/dist/Editor/common/EditorIcons.js +7 -7
- package/dist/Editor/common/Icon.js +39 -30
- 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/index.js +2 -1
- package/dist/Editor/common/LinkSettings/style.js +11 -8
- package/dist/Editor/common/MentionsPopup/Styles.js +1 -1
- package/dist/Editor/common/MentionsPopup/index.js +12 -8
- package/dist/Editor/common/RnD/ContextMenu/CMenus.js +142 -0
- package/dist/Editor/common/RnD/ContextMenu/index.js +38 -0
- package/dist/Editor/common/RnD/ContextMenu/styles.js +21 -0
- package/dist/Editor/common/RnD/DragInfo/index.js +31 -0
- package/dist/Editor/common/RnD/DragInfo/styles.js +15 -0
- package/dist/Editor/common/RnD/DragOver/index.js +55 -0
- package/dist/Editor/common/RnD/DragOver/styles.js +23 -0
- package/dist/Editor/common/RnD/ElementOptions/Actions.js +102 -0
- package/dist/Editor/common/RnD/ElementOptions/Icons/LinkIcon.js +26 -0
- package/dist/Editor/common/RnD/ElementOptions/index.js +95 -0
- package/dist/Editor/common/RnD/ElementOptions/styles.js +41 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Link.js +153 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/SaveAsTemplate.js +36 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +60 -0
- package/dist/Editor/common/RnD/ElementSettings/OtherSettings/index.js +9 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +48 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/TextSettings.js +30 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +47 -0
- package/dist/Editor/common/RnD/ElementSettings/Settings/index.js +17 -0
- package/dist/Editor/common/RnD/ElementSettings/index.js +17 -0
- package/dist/Editor/common/RnD/ElementSettings/settingsConstants.js +18 -0
- package/dist/Editor/common/RnD/ElementSettings/styles.js +94 -0
- package/dist/Editor/common/RnD/GuideLines/BoundaryLine.js +52 -0
- package/dist/Editor/common/RnD/GuideLines/index.js +33 -0
- package/dist/Editor/common/RnD/GuideLines/styles.js +62 -0
- package/dist/Editor/common/RnD/OptionsPopup/index.js +50 -0
- package/dist/Editor/common/RnD/OptionsPopup/style.js +36 -0
- package/dist/Editor/common/RnD/RnDCopy.js +23 -0
- package/dist/Editor/common/RnD/ShadowElement.js +34 -0
- package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +40 -0
- package/dist/Editor/common/RnD/SwitchViewport/styles.js +24 -0
- package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +63 -0
- package/dist/Editor/common/RnD/TransformHandles/CornerHandle.js +19 -0
- package/dist/Editor/common/RnD/TransformHandles/Icons/BottomRightIcon.js +13 -0
- package/dist/Editor/common/RnD/TransformHandles/SizeHandle.js +20 -0
- package/dist/Editor/common/RnD/TransformHandles/index.js +67 -0
- package/dist/Editor/common/RnD/Utils/alignmentDetection.js +26 -0
- package/dist/Editor/common/RnD/Utils/calculateDropItem.js +98 -0
- package/dist/Editor/common/RnD/Utils/collisionDetection.js +52 -0
- package/dist/Editor/common/RnD/Utils/gridDropItem.js +181 -0
- package/dist/Editor/common/RnD/Utils/index.js +251 -0
- package/dist/Editor/common/RnD/VirtualElement/index.js +77 -0
- package/dist/Editor/common/RnD/VirtualElement/styles.js +27 -0
- package/dist/Editor/common/RnD/VirtualElement/updateAutoProps.js +28 -0
- package/dist/Editor/common/RnD/index.js +567 -0
- package/dist/Editor/common/RnD/styles.js +4 -0
- package/dist/Editor/common/Section/index.js +21 -12
- package/dist/Editor/common/Section/styles.js +7 -4
- package/dist/Editor/common/Shorthands/elements.js +21 -9
- package/dist/Editor/common/StyleBuilder/boxStyle.js +30 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +18 -10
- package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +18 -5
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +4 -2
- package/dist/Editor/common/StyleBuilder/index.js +6 -4
- package/dist/Editor/common/StyleBuilder/sectionStyle.js +13 -2
- package/dist/Editor/common/iconListV2.js +843 -0
- package/dist/Editor/commonStyle.js +6 -0
- package/dist/Editor/helper/RnD/focusOnNewItem.js +39 -0
- package/dist/Editor/helper/RnD/scrollToNewSection.js +24 -0
- package/dist/Editor/helper/breakpoint.js +5 -0
- package/dist/Editor/helper/index.js +139 -0
- package/dist/Editor/helper/theme.js +50 -1
- package/dist/Editor/hooks/useBreakpoints.js +34 -0
- package/dist/Editor/hooks/useMouseMove.js +36 -8
- package/dist/Editor/hooks/useWindowMessage.js +10 -7
- package/dist/Editor/hooks/withCommon.js +2 -1
- package/dist/Editor/hooks/withErrorHandling.js +14 -0
- package/dist/Editor/utils/RnD/RnDCtrlCmds.js +197 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +36 -4
- package/dist/Editor/utils/events.js +5 -0
- package/dist/Editor/utils/form.js +7 -2
- package/dist/Editor/utils/formfield.js +1 -1
- package/dist/Editor/utils/freegrid.js +91 -0
- package/dist/Editor/utils/helper.js +43 -0
- package/dist/Editor/utils/insertAppHeader.js +47 -40
- package/package.json +6 -2
|
@@ -47,10 +47,12 @@ export const newContentOptions = [{
|
|
|
47
47
|
groupLabel: "",
|
|
48
48
|
options: [
|
|
49
49
|
// improveWriting,
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
{
|
|
51
|
+
label: "Done",
|
|
52
|
+
value: "done",
|
|
53
|
+
Icon: CheckIcon,
|
|
52
54
|
replace: true
|
|
53
|
-
}
|
|
55
|
+
}, ...commonOptions, {
|
|
54
56
|
label: "Close",
|
|
55
57
|
value: "close",
|
|
56
58
|
Icon: CloseIcon,
|
|
@@ -1,6 +1,7 @@
|
|
|
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";
|
|
4
5
|
import AppBar from "@mui/material/AppBar";
|
|
5
6
|
import Box from "@mui/material/Box";
|
|
6
7
|
import CssBaseline from "@mui/material/CssBaseline";
|
|
@@ -16,7 +17,7 @@ import Toolbar from "@mui/material/Toolbar";
|
|
|
16
17
|
import Typography from "@mui/material/Typography";
|
|
17
18
|
import Button from "@mui/material/Button";
|
|
18
19
|
import AppHeaderPopup from "./AppHeaderPopup";
|
|
19
|
-
import { getTRBLBreakPoints } from "../../helper/theme";
|
|
20
|
+
import { getTRBLBreakPoints, groupByBreakpoint } from "../../helper/theme";
|
|
20
21
|
import { handleLinkType } from "../../utils/helper";
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -24,6 +25,7 @@ import { createElement as _createElement } from "react";
|
|
|
24
25
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
25
26
|
const drawerWidth = 240;
|
|
26
27
|
function AppHeader(props) {
|
|
28
|
+
const theme = useTheme();
|
|
27
29
|
const navWrprRef = useRef(null);
|
|
28
30
|
const [openSetttings, setOpenSettings] = useState(false);
|
|
29
31
|
const {
|
|
@@ -126,11 +128,6 @@ function AppHeader(props) {
|
|
|
126
128
|
}
|
|
127
129
|
}
|
|
128
130
|
};
|
|
129
|
-
|
|
130
|
-
// const onMenuSettings = (menuItem, i) => (event) => {
|
|
131
|
-
// event.preventDefault();
|
|
132
|
-
// };
|
|
133
|
-
|
|
134
131
|
const drawer = /*#__PURE__*/_jsxs(Box, {
|
|
135
132
|
onClick: handleDrawerToggle,
|
|
136
133
|
sx: {
|
|
@@ -186,15 +183,20 @@ function AppHeader(props) {
|
|
|
186
183
|
})]
|
|
187
184
|
});
|
|
188
185
|
const container = window !== undefined ? () => window().document.body : undefined;
|
|
189
|
-
// const elevateStyle = useEleveateScroll({
|
|
190
|
-
// ...props,
|
|
191
|
-
// parentRef: navWrprRef,
|
|
192
|
-
// needElevation: readOnly,
|
|
193
|
-
// });
|
|
194
|
-
|
|
195
186
|
const elevateStyle = {
|
|
196
187
|
position: "relative"
|
|
197
188
|
};
|
|
189
|
+
const appbarSp = groupByBreakpoint({
|
|
190
|
+
padding: {
|
|
191
|
+
...getTRBLBreakPoints(bannerSpacing)
|
|
192
|
+
}
|
|
193
|
+
}, theme);
|
|
194
|
+
const toolbarSp = groupByBreakpoint({
|
|
195
|
+
flexDirection: {
|
|
196
|
+
xs: "row-reverse !important",
|
|
197
|
+
lg: "unset"
|
|
198
|
+
}
|
|
199
|
+
}, theme);
|
|
198
200
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
199
201
|
children: [/*#__PURE__*/_jsxs(Box, {
|
|
200
202
|
sx: {
|
|
@@ -216,13 +218,14 @@ function AppHeader(props) {
|
|
|
216
218
|
...elevateStyle,
|
|
217
219
|
background: bgColor,
|
|
218
220
|
boxShadow: "none",
|
|
219
|
-
|
|
220
|
-
...getTRBLBreakPoints(bannerSpacing)
|
|
221
|
-
},
|
|
221
|
+
...appbarSp,
|
|
222
222
|
zIndex: 999
|
|
223
223
|
},
|
|
224
224
|
onClick: onSettings,
|
|
225
225
|
children: /*#__PURE__*/_jsxs(Toolbar, {
|
|
226
|
+
sx: {
|
|
227
|
+
...toolbarSp
|
|
228
|
+
},
|
|
226
229
|
style: {
|
|
227
230
|
flexDirection: isLogoRight ? "row-reverse" : "row",
|
|
228
231
|
paddingLeft: "0px",
|
|
@@ -239,8 +242,11 @@ function AppHeader(props) {
|
|
|
239
242
|
},
|
|
240
243
|
sx: {
|
|
241
244
|
mr: 2,
|
|
242
|
-
|
|
243
|
-
|
|
245
|
+
[theme.breakpoints.up("sm")]: {
|
|
246
|
+
display: "none"
|
|
247
|
+
},
|
|
248
|
+
[theme.breakpoints.between("xs", "md")]: {
|
|
249
|
+
display: "block"
|
|
244
250
|
}
|
|
245
251
|
},
|
|
246
252
|
children: /*#__PURE__*/_jsx(MenuIcon, {})
|
|
@@ -258,9 +264,14 @@ function AppHeader(props) {
|
|
|
258
264
|
},
|
|
259
265
|
sx: {
|
|
260
266
|
flexGrow: 1,
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
267
|
+
[theme.breakpoints.up("sm")]: {
|
|
268
|
+
display: "block"
|
|
269
|
+
},
|
|
270
|
+
[theme.breakpoints.between("xs", "md")]: {
|
|
271
|
+
display: "none"
|
|
272
|
+
},
|
|
273
|
+
"& img": {
|
|
274
|
+
marginRight: "7px"
|
|
264
275
|
}
|
|
265
276
|
},
|
|
266
277
|
className: "app-logo",
|
|
@@ -274,9 +285,11 @@ function AppHeader(props) {
|
|
|
274
285
|
}) : null, appTitle]
|
|
275
286
|
}), /*#__PURE__*/_jsxs(Box, {
|
|
276
287
|
sx: {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
288
|
+
[theme.breakpoints.up("sm")]: {
|
|
289
|
+
display: "block"
|
|
290
|
+
},
|
|
291
|
+
[theme.breakpoints.between("xs", "md")]: {
|
|
292
|
+
display: "none"
|
|
280
293
|
}
|
|
281
294
|
},
|
|
282
295
|
children: [isDrawer ? /*#__PURE__*/_jsx(IconButton, {
|
|
@@ -1,8 +1,7 @@
|
|
|
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 } from "@mui/material";
|
|
5
|
-
// import * as fIcons from "@mui/icons-material";
|
|
4
|
+
import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
|
|
6
5
|
import MUIIcon from "../../common/StyleBuilder/fieldTypes/loadIcon";
|
|
7
6
|
import SettingsIcon from "@mui/icons-material/Settings";
|
|
8
7
|
import OpenInNewIcon from "@mui/icons-material/OpenInNew";
|
|
@@ -10,12 +9,13 @@ import LinkIcon from "@mui/icons-material/Link";
|
|
|
10
9
|
import ButtonPopup from "./ButtonPopup";
|
|
11
10
|
import { actionButtonRedirect } from "../../service/actionTrigger";
|
|
12
11
|
import { WorkflowIcon } from "../../common/iconslist";
|
|
13
|
-
import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
|
|
12
|
+
import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
|
14
13
|
import { handleLinkType, windowVar } from "../../utils/helper";
|
|
15
14
|
import LinkSettings from "../../common/LinkSettings";
|
|
16
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
16
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
17
|
const EditorButton = props => {
|
|
18
|
+
const theme = useTheme();
|
|
19
19
|
const {
|
|
20
20
|
attributes,
|
|
21
21
|
element,
|
|
@@ -81,7 +81,6 @@ const EditorButton = props => {
|
|
|
81
81
|
}
|
|
82
82
|
};
|
|
83
83
|
const buttonProps = handleLinkType(refURl, linkType, readOnly, openInNewTab, handleTrigger);
|
|
84
|
-
console.log(openInNewTab);
|
|
85
84
|
const onMenuClick = val => () => {
|
|
86
85
|
switch (val) {
|
|
87
86
|
case "edit":
|
|
@@ -154,21 +153,33 @@ const EditorButton = props => {
|
|
|
154
153
|
const onClose = () => {
|
|
155
154
|
setEdit(false);
|
|
156
155
|
};
|
|
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);
|
|
157
171
|
return /*#__PURE__*/_jsxs("div", {
|
|
158
|
-
className:
|
|
172
|
+
className: `editor-btn-wrapper`,
|
|
159
173
|
...attributes,
|
|
160
174
|
style: {
|
|
161
|
-
textAlign:
|
|
175
|
+
textAlign: tAlign
|
|
162
176
|
},
|
|
163
177
|
contentEditable: false,
|
|
164
178
|
children: [/*#__PURE__*/_jsx(Box, {
|
|
165
179
|
component: "div",
|
|
166
180
|
className: "editor-btn-wrapper-inner",
|
|
167
181
|
sx: {
|
|
168
|
-
|
|
169
|
-
lg: "inline-block",
|
|
170
|
-
xs: xsHidden ? "none" : "inline-block"
|
|
171
|
-
},
|
|
182
|
+
...pSp,
|
|
172
183
|
"& .element-toolbar": {
|
|
173
184
|
display: "none"
|
|
174
185
|
},
|
|
@@ -184,19 +195,15 @@ const EditorButton = props => {
|
|
|
184
195
|
display: "inline-block"
|
|
185
196
|
},
|
|
186
197
|
children: [/*#__PURE__*/_jsxs(Box, {
|
|
198
|
+
className: `btn textAlign-${tAlign}`,
|
|
187
199
|
sx: {
|
|
188
200
|
textDecoration: "none",
|
|
189
201
|
background: bgColor || "rgb(30, 75, 122)",
|
|
190
202
|
borderBlockStyle: "solid",
|
|
191
203
|
borderColor: borderColor || "transparent",
|
|
192
204
|
borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
|
|
193
|
-
|
|
194
|
-
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
|
195
|
-
},
|
|
205
|
+
...btnSp,
|
|
196
206
|
borderStyle: borderStyle || "solid",
|
|
197
|
-
padding: {
|
|
198
|
-
...getTRBLBreakPoints(bannerSpacing)
|
|
199
|
-
},
|
|
200
207
|
color: `${textColor || "#FFFFFF"}`,
|
|
201
208
|
fontSize: textSize || "inherit",
|
|
202
209
|
fontFamily: fontFamily || "PoppinsRegular",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { insertCarousel } from "../../utils/carousel";
|
|
3
|
-
import { Carousal } from "../../common/iconslist";
|
|
4
3
|
import ToolbarIcon from "../../common/ToolbarIcon";
|
|
4
|
+
import { CarouselElementIcon } from "../../common/iconListV2";
|
|
5
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
6
|
const CarouselButton = props => {
|
|
7
7
|
const {
|
|
@@ -14,7 +14,7 @@ const CarouselButton = props => {
|
|
|
14
14
|
return /*#__PURE__*/_jsx(ToolbarIcon, {
|
|
15
15
|
title: "Carousel",
|
|
16
16
|
onClick: handleClick,
|
|
17
|
-
icon: /*#__PURE__*/_jsx(
|
|
17
|
+
icon: /*#__PURE__*/_jsx(CarouselElementIcon, {}),
|
|
18
18
|
icoBtnType: icoBtnType
|
|
19
19
|
});
|
|
20
20
|
};
|
|
@@ -4,15 +4,16 @@ 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 } from "@mui/material";
|
|
7
|
+
import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
|
|
8
8
|
import { GridSettingsIcon, LinkIcon } from "../../common/iconslist";
|
|
9
9
|
import { useEditorContext } from "../../hooks/useMouseMove";
|
|
10
|
-
import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
|
|
10
|
+
import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } 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";
|
|
16
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
const ToolBar = ({
|
|
@@ -65,6 +66,7 @@ const ImageContent = ({
|
|
|
65
66
|
objectFit,
|
|
66
67
|
webAddress
|
|
67
68
|
} = element;
|
|
69
|
+
const theme = useTheme();
|
|
68
70
|
return !url && !readOnly ? /*#__PURE__*/_jsxs(Box, {
|
|
69
71
|
component: "button",
|
|
70
72
|
className: "element-empty-btn",
|
|
@@ -79,9 +81,7 @@ const ImageContent = ({
|
|
|
79
81
|
component: "img",
|
|
80
82
|
className: "emb-img",
|
|
81
83
|
sx: {
|
|
82
|
-
borderRadius
|
|
83
|
-
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
|
84
|
-
},
|
|
84
|
+
...wrapThemeBreakpoints(getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true), "borderRadius", theme),
|
|
85
85
|
objectFit: "cover",
|
|
86
86
|
boxShadow: boxShadow || "none",
|
|
87
87
|
height: objectFit ? "100%" : "auto",
|
|
@@ -105,6 +105,7 @@ const Image = ({
|
|
|
105
105
|
children,
|
|
106
106
|
customProps
|
|
107
107
|
}) => {
|
|
108
|
+
const theme = useTheme();
|
|
108
109
|
const {
|
|
109
110
|
url,
|
|
110
111
|
bannerSpacing,
|
|
@@ -227,12 +228,14 @@ const Image = ({
|
|
|
227
228
|
};
|
|
228
229
|
} else {
|
|
229
230
|
return {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
231
|
+
...groupByBreakpoint({
|
|
232
|
+
width: url ? {
|
|
233
|
+
...getBreakPointsValue(getSize(), null, "overrideReSize", true)
|
|
234
|
+
} : "100%",
|
|
235
|
+
height: objectFit && url ? {
|
|
236
|
+
...getBreakPointsValue(getSize(), null, "overrideReSizeH", true)
|
|
237
|
+
} : "auto"
|
|
238
|
+
}, theme)
|
|
236
239
|
};
|
|
237
240
|
}
|
|
238
241
|
};
|
|
@@ -247,9 +250,7 @@ const Image = ({
|
|
|
247
250
|
},
|
|
248
251
|
width: `100%`,
|
|
249
252
|
maxWidth: "100%",
|
|
250
|
-
padding
|
|
251
|
-
...getTRBLBreakPoints(bannerSpacing)
|
|
252
|
-
},
|
|
253
|
+
...wrapThemeBreakpoints(getTRBLBreakPoints(bannerSpacing), "padding", theme),
|
|
253
254
|
backgroundColor: bgColor,
|
|
254
255
|
justifyContent: horizantal,
|
|
255
256
|
alignContent: vertical
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect } from "react";
|
|
2
2
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
|
3
3
|
import { Node, Transforms } from "slate";
|
|
4
|
-
import { IconButton, Tooltip, Box } from "@mui/material";
|
|
4
|
+
import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
|
|
5
5
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
6
6
|
import AspectRatioIcon from "@mui/icons-material/AspectRatio";
|
|
7
7
|
import Icon from "../../common/Icon";
|
|
@@ -10,7 +10,7 @@ import EmbedPopup from "./EmbedPopup";
|
|
|
10
10
|
import { GridSettingsIcon } from "../../common/iconslist";
|
|
11
11
|
import { gradientBorder } from "../../utils/helper";
|
|
12
12
|
import { getEmbedURL } from "../../helper";
|
|
13
|
-
import { getBreakPointsValue } from "../../helper/theme";
|
|
13
|
+
import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
|
14
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
15
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const Video = ({
|
|
@@ -19,6 +19,7 @@ const Video = ({
|
|
|
19
19
|
children,
|
|
20
20
|
customProps
|
|
21
21
|
}) => {
|
|
22
|
+
const theme = useTheme();
|
|
22
23
|
const {
|
|
23
24
|
alt,
|
|
24
25
|
alignment,
|
|
@@ -126,12 +127,14 @@ const Video = ({
|
|
|
126
127
|
};
|
|
127
128
|
} else {
|
|
128
129
|
return {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
130
|
+
...groupByBreakpoint({
|
|
131
|
+
width: {
|
|
132
|
+
...getBreakPointsValue(getSize(), null, "overrideReSize", true)
|
|
133
|
+
},
|
|
134
|
+
height: url ? {
|
|
135
|
+
...getBreakPointsValue(getSize(), null, "overrideReSizeH", true)
|
|
136
|
+
} : "auto"
|
|
137
|
+
}, theme)
|
|
135
138
|
};
|
|
136
139
|
}
|
|
137
140
|
};
|
|
@@ -205,6 +208,7 @@ const Video = ({
|
|
|
205
208
|
onDelete: onDelete
|
|
206
209
|
}) : null, /*#__PURE__*/_jsxs(Box, {
|
|
207
210
|
component: "div",
|
|
211
|
+
className: "embed-video-wrpr-in",
|
|
208
212
|
contentEditable: false,
|
|
209
213
|
sx: {
|
|
210
214
|
position: "relative",
|
|
@@ -25,13 +25,17 @@ const EmojiButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
25
25
|
}
|
|
26
26
|
}));
|
|
27
27
|
const onClick = () => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
try {
|
|
29
|
+
if (editor.selection) {
|
|
30
|
+
const domRange = ReactEditor.toDOMRange(editor, editor.selection);
|
|
31
|
+
const rect = domRange.getBoundingClientRect();
|
|
32
|
+
setAnchorEl({
|
|
33
|
+
getBoundingClientRect: () => rect,
|
|
34
|
+
nodeType: 1
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
console.log(err);
|
|
35
39
|
}
|
|
36
40
|
};
|
|
37
41
|
const onEmojiSelect = emoji => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect } from "react";
|
|
2
2
|
import { Transforms } from "slate";
|
|
3
3
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
|
4
|
-
import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress, Box, Typography } from "@mui/material";
|
|
4
|
+
import { IconButton, Tooltip, Grid, Menu, MenuItem, CircularProgress, Box, Typography, useTheme } from "@mui/material";
|
|
5
5
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
6
6
|
import BackupIcon from "@mui/icons-material/Backup";
|
|
7
7
|
import { GridSettingsIcon, GridAddSectionIcon, WorkflowIcon } from "../../common/iconslist";
|
|
@@ -11,12 +11,13 @@ import { formField } from "../../utils/formfield";
|
|
|
11
11
|
import { formSubmit } from "../../service/formSubmit";
|
|
12
12
|
import formButtonStyle from "../../common/StyleBuilder/formButtonStyle";
|
|
13
13
|
import Workflow from "./Workflow";
|
|
14
|
-
import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
|
|
14
|
+
import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
|
15
15
|
import { validation } from "./FormElements/validations";
|
|
16
16
|
import Icon from "../../common/Icon";
|
|
17
17
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
18
18
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
const Form = props => {
|
|
20
|
+
const theme = useTheme();
|
|
20
21
|
const {
|
|
21
22
|
attributes,
|
|
22
23
|
children,
|
|
@@ -309,6 +310,39 @@ const Form = props => {
|
|
|
309
310
|
})]
|
|
310
311
|
});
|
|
311
312
|
};
|
|
313
|
+
const formSX = {
|
|
314
|
+
...groupByBreakpoint({
|
|
315
|
+
borderRadius: {
|
|
316
|
+
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
|
317
|
+
},
|
|
318
|
+
padding: {
|
|
319
|
+
...getTRBLBreakPoints(bannerSpacing)
|
|
320
|
+
}
|
|
321
|
+
}, theme)
|
|
322
|
+
};
|
|
323
|
+
const buttonSX = {
|
|
324
|
+
...groupByBreakpoint({
|
|
325
|
+
borderRadius: {
|
|
326
|
+
...getBreakPointsValue(btnR || {}, null, "overrideBorderRadius", true)
|
|
327
|
+
},
|
|
328
|
+
padding: {
|
|
329
|
+
...getTRBLBreakPoints(btnSpacing)
|
|
330
|
+
},
|
|
331
|
+
margin: {
|
|
332
|
+
...getTRBLBreakPoints(btnM)
|
|
333
|
+
}
|
|
334
|
+
}, theme)
|
|
335
|
+
};
|
|
336
|
+
const formTypoSX = {
|
|
337
|
+
...groupByBreakpoint({
|
|
338
|
+
borderRadius: {
|
|
339
|
+
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
|
340
|
+
},
|
|
341
|
+
padding: {
|
|
342
|
+
...getTRBLBreakPoints(bannerSpacing)
|
|
343
|
+
}
|
|
344
|
+
}, theme)
|
|
345
|
+
};
|
|
312
346
|
return /*#__PURE__*/_jsxs("div", {
|
|
313
347
|
...attributes,
|
|
314
348
|
className: "form-wrapper element-root",
|
|
@@ -327,16 +361,11 @@ const Form = props => {
|
|
|
327
361
|
color: textColor || "#FFF",
|
|
328
362
|
borderColor: borderColor || "transparent",
|
|
329
363
|
borderWidth: borderWidth || "1px",
|
|
330
|
-
display: submittedSuccessfully ?
|
|
331
|
-
borderRadius: {
|
|
332
|
-
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
|
333
|
-
},
|
|
364
|
+
display: submittedSuccessfully ? "none" : "block",
|
|
334
365
|
borderStyle: borderStyle || "solid",
|
|
335
366
|
background: bgColor || "transparent",
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
},
|
|
339
|
-
position: "relative"
|
|
367
|
+
position: "relative",
|
|
368
|
+
...formSX
|
|
340
369
|
},
|
|
341
370
|
ref: formEle,
|
|
342
371
|
children: [/*#__PURE__*/_jsx(Grid, {
|
|
@@ -376,15 +405,7 @@ const Form = props => {
|
|
|
376
405
|
borderWidth: "1px",
|
|
377
406
|
borderBlockStyle: "solid",
|
|
378
407
|
...btnBorderStyle,
|
|
379
|
-
|
|
380
|
-
...getBreakPointsValue(btnR || {}, null, "overrideBorderRadius", true)
|
|
381
|
-
},
|
|
382
|
-
padding: {
|
|
383
|
-
...getTRBLBreakPoints(btnSpacing)
|
|
384
|
-
},
|
|
385
|
-
margin: {
|
|
386
|
-
...getTRBLBreakPoints(btnM)
|
|
387
|
-
},
|
|
408
|
+
...buttonSX,
|
|
388
409
|
color: `${buttonProps?.textColor || "#FFFFFF"}`,
|
|
389
410
|
fontSize: buttonProps?.textSize || "inherit",
|
|
390
411
|
height: "fit-content",
|
|
@@ -418,7 +439,7 @@ const Form = props => {
|
|
|
418
439
|
}), /*#__PURE__*/_jsx(Grid, {
|
|
419
440
|
item: true,
|
|
420
441
|
sx: {
|
|
421
|
-
display: submittedSuccessfully ?
|
|
442
|
+
display: submittedSuccessfully ? "flex" : "none"
|
|
422
443
|
},
|
|
423
444
|
contentEditable: false,
|
|
424
445
|
children: /*#__PURE__*/_jsx(Grid, {
|
|
@@ -433,21 +454,16 @@ const Form = props => {
|
|
|
433
454
|
color: textColor || "#A2A9B4",
|
|
434
455
|
borderColor: borderColor || "transparent",
|
|
435
456
|
borderWidth: borderWidth || "1px",
|
|
436
|
-
borderRadius: {
|
|
437
|
-
...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
|
|
438
|
-
},
|
|
439
457
|
borderStyle: borderStyle || "solid",
|
|
440
458
|
background: bgColor || "transparent",
|
|
441
|
-
padding: {
|
|
442
|
-
...getTRBLBreakPoints(bannerSpacing)
|
|
443
|
-
},
|
|
444
459
|
minHeight: `${formHeight}px`,
|
|
445
460
|
minWidth: `${formWidth}px`,
|
|
446
461
|
display: "flex",
|
|
447
462
|
alignItems: "center",
|
|
448
463
|
justifyContent: "center",
|
|
449
464
|
textAlign: "center",
|
|
450
|
-
position: "relative"
|
|
465
|
+
position: "relative",
|
|
466
|
+
...formTypoSX
|
|
451
467
|
},
|
|
452
468
|
children: ["Form Submitted Successfully...!", /*#__PURE__*/_jsx("span", {
|
|
453
469
|
style: {
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
2
|
import { Transforms, Node } from "slate";
|
|
3
3
|
import { useSlateStatic, ReactEditor } from "slate-react";
|
|
4
|
-
import { IconButton, Tooltip, Grid } from "@mui/material";
|
|
4
|
+
import { IconButton, Tooltip, Grid, useTheme } from "@mui/material";
|
|
5
5
|
import DeleteIcon from "@mui/icons-material/Delete";
|
|
6
6
|
import SettingsIcon from "@mui/icons-material/Settings";
|
|
7
7
|
import FormElements from "./FormElements";
|
|
8
8
|
import FieldPopup from "./FieldPopup";
|
|
9
|
-
import { getBreakPointsValue } from "../../helper/theme";
|
|
9
|
+
import { getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const FormField = props => {
|
|
13
|
+
const theme = useTheme();
|
|
13
14
|
const {
|
|
14
15
|
attributes,
|
|
15
16
|
element,
|
|
@@ -25,7 +26,7 @@ const FormField = props => {
|
|
|
25
26
|
children,
|
|
26
27
|
...elementProps
|
|
27
28
|
} = element;
|
|
28
|
-
const et = elementType?.split(
|
|
29
|
+
const et = elementType?.split(":");
|
|
29
30
|
const FormElement = FormElements[et[0]];
|
|
30
31
|
const editor = useSlateStatic();
|
|
31
32
|
const path = ReactEditor.findPath(editor, element);
|
|
@@ -54,16 +55,21 @@ const FormField = props => {
|
|
|
54
55
|
onClose();
|
|
55
56
|
};
|
|
56
57
|
const onDelete = () => {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
try {
|
|
59
|
+
const deletePath = ReactEditor.findPath(editor, element);
|
|
60
|
+
Transforms.removeNodes(editor, {
|
|
61
|
+
at: deletePath
|
|
62
|
+
});
|
|
63
|
+
} catch (err) {
|
|
64
|
+
console.log(err);
|
|
65
|
+
}
|
|
60
66
|
};
|
|
61
67
|
const onClose = () => {
|
|
62
68
|
setOpenSettings(false);
|
|
63
69
|
};
|
|
64
70
|
const FieldToolbar = () => {
|
|
65
71
|
return /*#__PURE__*/_jsxs("div", {
|
|
66
|
-
className: "element-toolbar hr",
|
|
72
|
+
className: "element-toolbar hr default-toolbar",
|
|
67
73
|
contentEditable: false,
|
|
68
74
|
style: {
|
|
69
75
|
position: "absolute",
|
|
@@ -91,15 +97,20 @@ const FormField = props => {
|
|
|
91
97
|
})]
|
|
92
98
|
});
|
|
93
99
|
};
|
|
100
|
+
const fieldSX = {
|
|
101
|
+
...groupByBreakpoint({
|
|
102
|
+
width: {
|
|
103
|
+
...getBreakPointsValue(grid, null, "overrideGridSize", true)
|
|
104
|
+
}
|
|
105
|
+
}, theme)
|
|
106
|
+
};
|
|
94
107
|
return /*#__PURE__*/_jsxs(Grid, {
|
|
95
108
|
item: true,
|
|
96
109
|
...attributes,
|
|
97
110
|
className: "form-field",
|
|
98
111
|
sx: {
|
|
99
112
|
position: "relative",
|
|
100
|
-
|
|
101
|
-
...getBreakPointsValue(grid, null, "overrideGridSize", true)
|
|
102
|
-
}
|
|
113
|
+
...fieldSX
|
|
103
114
|
},
|
|
104
115
|
children: [!readOnly && /*#__PURE__*/_jsx(FieldToolbar, {}), /*#__PURE__*/_jsx(FormElement, {
|
|
105
116
|
fieldProps: elementProps
|
|
@@ -14,10 +14,13 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
14
14
|
const Workflow = props => {
|
|
15
15
|
const {
|
|
16
16
|
openWorkflow,
|
|
17
|
-
element,
|
|
17
|
+
element: propElement,
|
|
18
18
|
closeWorkflow,
|
|
19
|
-
onSave
|
|
19
|
+
onSave,
|
|
20
|
+
customWorkflowElement = null
|
|
20
21
|
} = props;
|
|
22
|
+
// replacing element for forms in DND
|
|
23
|
+
const element = customWorkflowElement ? customWorkflowElement : propElement;
|
|
21
24
|
const {
|
|
22
25
|
workflow
|
|
23
26
|
} = element;
|