@flozy/editor 3.9.8 → 3.9.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. package/dist/Editor/ChatEditor.js +55 -45
  2. package/dist/Editor/CommonEditor.js +180 -111
  3. package/dist/Editor/Editor.css +9 -2
  4. package/dist/Editor/Elements/AI/AIInput.js +18 -24
  5. package/dist/Editor/Elements/AI/CustomSelect.js +19 -12
  6. package/dist/Editor/Elements/AI/PopoverAIInput.js +66 -89
  7. package/dist/Editor/Elements/AI/Styles.js +2 -1
  8. package/dist/Editor/Elements/AI/VoiceToText/AudioWave.js +73 -0
  9. package/dist/Editor/Elements/AI/VoiceToText/index.js +184 -0
  10. package/dist/Editor/Elements/AI/VoiceToText/style.js +40 -0
  11. package/dist/Editor/Elements/AI/helper.js +5 -3
  12. package/dist/Editor/Elements/Accordion/Accordion.js +74 -7
  13. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +3 -2
  14. package/dist/Editor/Elements/Accordion/AccordionSummary.js +4 -60
  15. package/dist/Editor/Elements/AppHeader/AppHeader.js +26 -4
  16. package/dist/Editor/Elements/Button/EditorButton.js +28 -16
  17. package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -17
  18. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  19. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  20. package/dist/Editor/Elements/Color Picker/Styles.js +2 -1
  21. package/dist/Editor/Elements/Embed/Image.js +29 -21
  22. package/dist/Editor/Elements/Embed/Video.js +15 -11
  23. package/dist/Editor/Elements/Emoji/EmojiPicker.js +4 -2
  24. package/dist/Editor/Elements/Form/Form.js +1 -1
  25. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +12 -3
  26. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -1
  27. package/dist/Editor/Elements/Grid/Grid.js +33 -16
  28. package/dist/Editor/Elements/Grid/GridItem.js +3 -1
  29. package/dist/Editor/Elements/Link/Link.js +6 -1
  30. package/dist/Editor/Elements/Link/LinkButton.js +4 -2
  31. package/dist/Editor/Elements/Link/LinkPopup.js +10 -3
  32. package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
  33. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +8 -4
  34. package/dist/Editor/Elements/Redo/RedoButton.js +14 -0
  35. package/dist/Editor/Elements/Signature/SignaturePopup.js +20 -5
  36. package/dist/Editor/Elements/Table/Styles.js +23 -1
  37. package/dist/Editor/Elements/Table/Table.js +3 -2
  38. package/dist/Editor/Elements/Table/TableCell.js +70 -8
  39. package/dist/Editor/Elements/TableContextMenu/TableContextMenu.js +1 -0
  40. package/dist/Editor/Elements/Undo/UndoButton.js +14 -0
  41. package/dist/Editor/MiniEditor.js +3 -1
  42. package/dist/Editor/Styles/EditorStyles.js +1 -1
  43. package/dist/Editor/Toolbar/Basic/index.js +4 -2
  44. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +26 -2
  45. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  46. package/dist/Editor/Toolbar/FormatTools/TextSize.js +29 -18
  47. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +29 -3
  48. package/dist/Editor/Toolbar/Mini/Options/Options.js +10 -0
  49. package/dist/Editor/Toolbar/Mini/Styles.js +7 -0
  50. package/dist/Editor/Toolbar/PopupTool/ButtonTemplatesCard.js +12 -13
  51. package/dist/Editor/Toolbar/PopupTool/FullViewCard.js +12 -13
  52. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +4 -11
  53. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +213 -86
  54. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
  55. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +40 -33
  56. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +52 -7
  57. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
  58. package/dist/Editor/Toolbar/PopupTool/index.js +4 -5
  59. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  60. package/dist/Editor/assets/svg/AIIcons.js +153 -1
  61. package/dist/Editor/assets/svg/AddTemplateIcon.js +13 -10
  62. package/dist/Editor/assets/svg/RedoIcon.js +27 -0
  63. package/dist/Editor/assets/svg/SettingsIcon.js +28 -0
  64. package/dist/Editor/assets/svg/TextIcon.js +8 -5
  65. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  66. package/dist/Editor/assets/svg/UndoIcon.js +27 -0
  67. package/dist/Editor/common/ColorPickerButton.js +25 -9
  68. package/dist/Editor/common/CustomColorPicker/index.js +106 -0
  69. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  70. package/dist/Editor/common/CustomDialog/index.js +94 -0
  71. package/dist/Editor/common/CustomDialog/style.js +67 -0
  72. package/dist/Editor/common/CustomSelect.js +33 -0
  73. package/dist/Editor/common/DnD/DragHandleButton.js +56 -47
  74. package/dist/Editor/common/EditorCmds.js +35 -0
  75. package/dist/Editor/common/Icon.js +43 -3
  76. package/dist/Editor/common/LinkSettings/NavComponents.js +5 -2
  77. package/dist/Editor/common/LinkSettings/index.js +4 -2
  78. package/dist/Editor/common/LinkSettings/navOptions.js +7 -2
  79. package/dist/Editor/common/LinkSettings/style.js +11 -8
  80. package/dist/Editor/common/MentionsPopup/MentionsListCard.js +6 -1
  81. package/dist/Editor/common/MentionsPopup/Styles.js +5 -2
  82. package/dist/Editor/common/Section/index.js +57 -7
  83. package/dist/Editor/common/Section/styles.js +11 -0
  84. package/dist/Editor/common/Shorthands/elements.js +54 -0
  85. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +7 -7
  86. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +16 -16
  87. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  88. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +13 -3
  89. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  90. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +1 -1
  91. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +31 -7
  92. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
  93. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +14 -3
  94. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +14 -4
  95. package/dist/Editor/common/StyleBuilder/index.js +1 -1
  96. package/dist/Editor/common/iconslist.js +0 -31
  97. package/dist/Editor/helper/deserialize/index.js +14 -9
  98. package/dist/Editor/helper/theme.js +190 -4
  99. package/dist/Editor/hooks/useEditorTheme.js +139 -0
  100. package/dist/Editor/hooks/useMouseMove.js +4 -2
  101. package/dist/Editor/hooks/useWindowMessage.js +10 -7
  102. package/dist/Editor/plugins/withEmbeds.js +1 -1
  103. package/dist/Editor/plugins/withHTML.js +47 -5
  104. package/dist/Editor/plugins/withLayout.js +15 -10
  105. package/dist/Editor/plugins/withTable.js +2 -2
  106. package/dist/Editor/theme/ThemeList.js +50 -173
  107. package/dist/Editor/theme/index.js +144 -0
  108. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  109. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  110. package/dist/Editor/themeSettings/buttons/style.js +21 -0
  111. package/dist/Editor/themeSettings/colorTheme/index.js +290 -0
  112. package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
  113. package/dist/Editor/themeSettings/fonts/PreviewElement.js +123 -0
  114. package/dist/Editor/themeSettings/fonts/index.js +213 -0
  115. package/dist/Editor/themeSettings/fonts/style.js +44 -0
  116. package/dist/Editor/themeSettings/icons.js +60 -0
  117. package/dist/Editor/themeSettings/index.js +320 -0
  118. package/dist/Editor/themeSettings/style.js +152 -0
  119. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  120. package/dist/Editor/themeSettingsAI/index.js +356 -0
  121. package/dist/Editor/themeSettingsAI/saveTheme.js +190 -0
  122. package/dist/Editor/themeSettingsAI/style.js +247 -0
  123. package/dist/Editor/utils/SlateUtilityFunctions.js +161 -25
  124. package/dist/Editor/utils/button.js +1 -17
  125. package/dist/Editor/utils/draftToSlate.js +1 -1
  126. package/dist/Editor/utils/events.js +65 -6
  127. package/dist/Editor/utils/font.js +40 -37
  128. package/dist/Editor/utils/helper.js +74 -14
  129. package/dist/Editor/utils/table.js +51 -43
  130. package/package.json +3 -2
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from "react";
2
2
  import { Grid, Button, Popover } from "@mui/material";
3
- import ColorPickerTool from "react-gcolor-picker";
4
3
  import { colors } from "../Elements/Color Picker/defaultColors";
4
+ import CustomColorPicker from "./CustomColorPicker";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
7
  import { Fragment as _Fragment } from "react/jsx-runtime";
@@ -9,9 +9,12 @@ const ColorPickerButton = props => {
9
9
  const {
10
10
  value,
11
11
  onSave,
12
- defaultColors = [],
13
12
  classes = {},
14
- recentColors = []
13
+ recentColors = [],
14
+ children,
15
+ handleClose: closeDrawer,
16
+ hideThemeColors,
17
+ disableEditTheme
15
18
  } = props;
16
19
  const [anchorEl, setAnchorEl] = useState(null);
17
20
  const [color, setColor] = useState(value);
@@ -30,7 +33,13 @@ const ColorPickerButton = props => {
30
33
  setColor(color);
31
34
  };
32
35
  return /*#__PURE__*/_jsxs(_Fragment, {
33
- children: [/*#__PURE__*/_jsx(Button, {
36
+ children: [children ? /*#__PURE__*/_jsx("div", {
37
+ onClick: handleColorPicker,
38
+ style: {
39
+ cursor: "pointer"
40
+ },
41
+ children: children
42
+ }) : /*#__PURE__*/_jsx(Button, {
34
43
  style: {
35
44
  background: value,
36
45
  height: "22px",
@@ -60,17 +69,24 @@ const ColorPickerButton = props => {
60
69
  item: true,
61
70
  xs: 12,
62
71
  children: [/*#__PURE__*/_jsx("div", {
63
- children: /*#__PURE__*/_jsx(ColorPickerTool, {
72
+ children: /*#__PURE__*/_jsx(CustomColorPicker, {
64
73
  gradient: true,
65
- value: color,
74
+ color: color,
66
75
  onChange: handleColorChange,
67
- defaultColors: [...recentColors, ...defaultColors] || []
76
+ recentColors: recentColors,
77
+ closeDrawer: closeDrawer,
78
+ hideThemeColors: hideThemeColors,
79
+ disableEditTheme: disableEditTheme
68
80
  })
69
81
  }), /*#__PURE__*/_jsxs("div", {
70
82
  style: {
71
83
  display: "flex",
72
- justifyContent: "end",
73
- margin: "8px"
84
+ justifyContent: "flex-end",
85
+ padding: "8px",
86
+ background: "white",
87
+ position: "sticky",
88
+ bottom: 0,
89
+ boxShadow: "0 -1px 5px rgba(0,0,0,0.1)"
74
90
  },
75
91
  children: [/*#__PURE__*/_jsx(Button, {
76
92
  onClick: handleClose,
@@ -0,0 +1,106 @@
1
+ import { Box, Button, Typography, useTheme } from "@mui/material";
2
+ import ColorPickerTool from "react-gcolor-picker";
3
+ import customColorPickerStyles from "./style";
4
+ import { colors } from "../../Elements/Color Picker/defaultColors";
5
+ import { useContext, useMemo } from "react";
6
+ import { ThemeContext } from "../../CommonEditor";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ function CustomColorPicker(props) {
10
+ const {
11
+ gradient,
12
+ color,
13
+ onChange,
14
+ defaultColors,
15
+ recentColors = [],
16
+ closeDrawer,
17
+ hideThemeColors,
18
+ disableEditTheme
19
+ } = props;
20
+ const {
21
+ setOpenTheme
22
+ } = useContext(ThemeContext);
23
+ const classes = customColorPickerStyles();
24
+ const theme = useTheme();
25
+ const colorVars = theme?.vars?.colors || {};
26
+ const colorTabs = useMemo(() => {
27
+ const otherColors = {
28
+ title: "Recent colours",
29
+ colors: [...recentColors, ...defaultColors],
30
+ onChange: onChange
31
+ };
32
+ const themeColors = Object.values(colorVars);
33
+ const tabs = [];
34
+ if (themeColors?.length && !hideThemeColors) {
35
+ tabs.push({
36
+ title: "Theme colour",
37
+ onEdit: () => {
38
+ setOpenTheme("editThemeColor");
39
+ closeDrawer();
40
+ },
41
+ colors: Object.values(colorVars),
42
+ onChange: onChange
43
+ });
44
+ }
45
+ tabs.push(otherColors);
46
+ return tabs;
47
+ }, [recentColors, defaultColors, onChange, colorVars]);
48
+ return /*#__PURE__*/_jsxs(Box, {
49
+ component: "div",
50
+ sx: classes.customColorPickerContainer,
51
+ children: [/*#__PURE__*/_jsx(ColorPickerTool, {
52
+ gradient: gradient,
53
+ value: color?.startsWith("var") ? "" : color,
54
+ onChange: onChange,
55
+ defaultColors: [],
56
+ popupWidth: "300"
57
+ }), colorTabs.map((tab, i) => {
58
+ const {
59
+ title,
60
+ onEdit,
61
+ colors = [],
62
+ onChange
63
+ } = tab;
64
+ return /*#__PURE__*/_jsxs(Box, {
65
+ component: "div",
66
+ className: "customColorPickerWrapper",
67
+ children: [/*#__PURE__*/_jsxs(Box, {
68
+ component: "div",
69
+ className: "colorTitleWrapper",
70
+ children: [/*#__PURE__*/_jsx(Typography, {
71
+ variant: "subtitle2",
72
+ children: title
73
+ }), onEdit && !disableEditTheme ? /*#__PURE__*/_jsx(Button, {
74
+ variant: "text",
75
+ className: "editBtn",
76
+ onClick: () => onEdit(tab),
77
+ children: "Edit"
78
+ }) : null]
79
+ }), /*#__PURE__*/_jsx(Box, {
80
+ component: "div",
81
+ className: "colorPickerBtnContainer",
82
+ children: colors.map((colorVar, i) => {
83
+ const isSelected = colorVar === color;
84
+ return /*#__PURE__*/_jsx(Box, {
85
+ className: isSelected ? "colorPicketBtnActive" : "",
86
+ component: "div",
87
+ children: /*#__PURE__*/_jsx("button", {
88
+ style: {
89
+ background: colorVar
90
+ },
91
+ onClick: () => onChange(colorVar),
92
+ className: `colorPicketBtn`,
93
+ type: "button"
94
+ })
95
+ }, i);
96
+ })
97
+ })]
98
+ }, i);
99
+ })]
100
+ });
101
+ }
102
+ CustomColorPicker.defaultProps = {
103
+ defaultColors: [...colors],
104
+ closeDrawer: () => {}
105
+ };
106
+ export default CustomColorPicker;
@@ -0,0 +1,53 @@
1
+ const styles = () => ({
2
+ customColorPickerContainer: {
3
+ background: "white",
4
+ width: "300px",
5
+ "& .popup_tabs": {
6
+ boxShadow: "none"
7
+ },
8
+ ".customColorPickerWrapper": {
9
+ padding: "10px 0px",
10
+ margin: "0px 16px",
11
+ borderTop: "1px solid #DCE4EC"
12
+ },
13
+ ".colorTitleWrapper": {
14
+ display: "flex",
15
+ justifyContent: "space-between",
16
+ alignItems: "center",
17
+ paddingBottom: "10px",
18
+ ".MuiTypography-root": {
19
+ fontWeight: "600"
20
+ },
21
+ ".editBtn": {
22
+ textTransform: "none",
23
+ color: "#2563EB",
24
+ textDecoration: "underline",
25
+ padding: "0px",
26
+ minWidth: "unset"
27
+ }
28
+ },
29
+ ".colorPickerBtnContainer": {
30
+ display: "flex",
31
+ flexWrap: "wrap",
32
+ gap: "10px"
33
+ },
34
+ ".colorPicketBtn": {
35
+ width: "26px",
36
+ height: "26px",
37
+ outline: "none",
38
+ borderRadius: "50%",
39
+ cursor: "pointer",
40
+ border: "1.5px solid #DCE4EC"
41
+ },
42
+ ".colorPicketBtnActive": {
43
+ borderRadius: "50%",
44
+ padding: "1px",
45
+ border: "1.5px solid rgb(83, 83, 249)",
46
+ width: "fit-content",
47
+ height: "fit-content",
48
+ display: "flex",
49
+ justifyContent: "center"
50
+ }
51
+ }
52
+ });
53
+ export default styles;
@@ -0,0 +1,94 @@
1
+ import Dialog from "@mui/material/Dialog";
2
+ import DialogTitle from "@mui/material/DialogTitle";
3
+ import DialogContent from "@mui/material/DialogContent";
4
+ import DialogActions from "@mui/material/DialogActions";
5
+ import IconButton from "@mui/material/IconButton";
6
+ import CloseIcon from "@mui/icons-material/Close";
7
+ import { Box, Typography, Button } from "@mui/material";
8
+ import SwipeableDrawer from "../SwipeableDrawer";
9
+ import customDialogStyles from "./style";
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { Fragment as _Fragment } from "react/jsx-runtime";
13
+ function CustomDialog(props) {
14
+ const {
15
+ handleClose,
16
+ customProps,
17
+ children,
18
+ onSubmit
19
+ } = props;
20
+ const {
21
+ isMobile
22
+ } = customProps;
23
+ const classes = customDialogStyles();
24
+ if (isMobile) {
25
+ return /*#__PURE__*/_jsx(Box, {
26
+ sx: classes.dialogContainer,
27
+ children: /*#__PURE__*/_jsxs(SwipeableDrawer, {
28
+ onClose: handleClose,
29
+ children: [/*#__PURE__*/_jsx(Typography, {
30
+ variant: "subtitle1",
31
+ gutterBottom: true,
32
+ sx: {
33
+ fontWeight: 600
34
+ },
35
+ children: "What do you want to link to?"
36
+ }), /*#__PURE__*/_jsx(Box, {
37
+ sx: classes.mobileDialogContent,
38
+ children: children
39
+ }), /*#__PURE__*/_jsx(Box, {
40
+ component: "div",
41
+ sx: classes.mobileActionBtns,
42
+ children: /*#__PURE__*/_jsx(ActionsButtons, {
43
+ classes: classes,
44
+ onCancel: handleClose,
45
+ onSave: onSubmit
46
+ })
47
+ })]
48
+ })
49
+ });
50
+ } else {
51
+ return /*#__PURE__*/_jsxs(Dialog, {
52
+ onClose: handleClose,
53
+ open: true,
54
+ sx: classes.dialogContainer,
55
+ fullWidth: true,
56
+ maxWidth: "sm",
57
+ children: [/*#__PURE__*/_jsx(DialogTitle, {
58
+ children: "What do you want to link to?"
59
+ }), /*#__PURE__*/_jsx(IconButton, {
60
+ "aria-label": "close",
61
+ onClick: handleClose,
62
+ sx: classes.closeIcon,
63
+ children: /*#__PURE__*/_jsx(CloseIcon, {})
64
+ }), /*#__PURE__*/_jsx(DialogContent, {
65
+ dividers: true,
66
+ children: children
67
+ }), /*#__PURE__*/_jsx(DialogActions, {
68
+ children: /*#__PURE__*/_jsx(ActionsButtons, {
69
+ classes: classes,
70
+ onCancel: handleClose,
71
+ onSave: onSubmit
72
+ })
73
+ })]
74
+ });
75
+ }
76
+ }
77
+ export default CustomDialog;
78
+ function ActionsButtons({
79
+ classes,
80
+ onCancel,
81
+ onSave
82
+ }) {
83
+ return /*#__PURE__*/_jsxs(_Fragment, {
84
+ children: [/*#__PURE__*/_jsx(Button, {
85
+ onClick: onCancel,
86
+ sx: classes.closeBtn,
87
+ children: "Cancel"
88
+ }), /*#__PURE__*/_jsx(Button, {
89
+ onClick: onSave,
90
+ sx: classes.saveBtn,
91
+ children: "Save"
92
+ })]
93
+ });
94
+ }
@@ -0,0 +1,67 @@
1
+ const styles = () => ({
2
+ dialogContainer: {
3
+ "& .MuiDialogContent-root": {
4
+ padding: "0px 20px"
5
+ },
6
+ "& .MuiDialogActions-root": {
7
+ padding: "10px"
8
+ },
9
+ "& .MuiTypography-h6": {
10
+ fontWeight: 600,
11
+ fontSize: "16px",
12
+ paddingRight: "20px"
13
+ },
14
+ "& .MuiGrid-container": {
15
+ marginTop: "0px"
16
+ },
17
+ "& .MuiGrid-item": {
18
+ padding: "14px"
19
+ }
20
+ },
21
+ saveBtn: {
22
+ color: "#fff",
23
+ background: "#2563EB",
24
+ fontSize: "14px",
25
+ fontWeight: 500,
26
+ padding: "4px 24px",
27
+ textTransform: "none",
28
+ "&:hover": {
29
+ color: "#fff",
30
+ background: "#2563EB"
31
+ }
32
+ },
33
+ closeBtn: {
34
+ backgroundColor: "#F4F6F9",
35
+ color: "#64748B",
36
+ fontSize: "14px",
37
+ fontWeight: 500,
38
+ padding: "4px 22px",
39
+ textTransform: "none",
40
+ border: "1px solid #D8DDE1",
41
+ "&:hover": {
42
+ border: "1px solid #64748B"
43
+ }
44
+ },
45
+ closeIcon: {
46
+ position: "absolute",
47
+ right: 8,
48
+ top: 8,
49
+ color: theme => theme.palette.grey[500]
50
+ },
51
+ gridDivider: {
52
+ borderRight: "1px solid rgba(0, 0, 0, 0.12)"
53
+ },
54
+ mobileActionBtns: {
55
+ display: "flex",
56
+ justifyContent: "flex-end",
57
+ gap: "8px",
58
+ paddingTop: "14px",
59
+ marginTop: "14px",
60
+ borderTop: theme => `1px solid ${theme.palette.grey[300]}`
61
+ },
62
+ mobileDialogContent: {
63
+ borderTop: theme => `1px solid ${theme.palette.grey[300]}`,
64
+ paddingTop: "14px"
65
+ }
66
+ });
67
+ export default styles;
@@ -0,0 +1,33 @@
1
+ import { MenuItem, Select } from "@mui/material";
2
+ import { fontFamilyMap } from "../utils/font";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ function CustomSelect(props) {
5
+ const {
6
+ onChange,
7
+ options = [],
8
+ value
9
+ } = props;
10
+ return /*#__PURE__*/_jsx(Select, {
11
+ fullWidth: true,
12
+ value: value,
13
+ onChange: onChange,
14
+ className: "editor-dd",
15
+ style: {
16
+ fontFamily: fontFamilyMap[value],
17
+ width: "100%",
18
+ height: "36px",
19
+ borderRadius: "10px",
20
+ fontSize: "14px"
21
+ },
22
+ children: options.map((option, i) => {
23
+ return /*#__PURE__*/_jsx(MenuItem, {
24
+ value: option.value,
25
+ style: {
26
+ fontFamily: option.text
27
+ },
28
+ children: option?.label || option?.text
29
+ }, i);
30
+ })
31
+ });
32
+ }
33
+ export default CustomSelect;
@@ -7,59 +7,68 @@ import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import { Transforms } from "slate";
8
8
  import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
- const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "grid"];
11
- const DragHandleStyle = () => ({
12
- dragHandle: {
13
- opacity: 0,
14
- content: '" "',
10
+ const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree", "grid"];
11
+ const DragHandleStyle = fromPopper => {
12
+ const handleDragStyle = fromPopper ? {
13
+ position: "absolute",
14
+ top: "6px",
15
+ left: "4px"
16
+ } : {
15
17
  position: "absolute",
16
18
  top: "3px",
17
- left: "-52px",
18
- borderRadius: "0px",
19
- padding: "0px",
20
- width: "20px",
21
- height: "20px",
22
- border: 0,
23
- display: "flex",
24
- alignItems: "center",
25
- justifyContent: "center",
26
- cursor: "grab",
27
- color: "#D7D7D6",
28
- background: "rgb(221, 221, 221, 0.1)",
29
- "& svg": {
30
- width: "20px"
19
+ left: "-52px"
20
+ };
21
+ return {
22
+ dragHandle: {
23
+ opacity: 0,
24
+ content: '" "',
25
+ ...handleDragStyle,
26
+ borderRadius: "0px",
27
+ padding: "0px",
28
+ width: "20px",
29
+ height: "20px",
30
+ border: 0,
31
+ display: "flex",
32
+ alignItems: "center",
33
+ justifyContent: "center",
34
+ cursor: "grab",
35
+ color: "#D7D7D6",
36
+ background: "rgb(221, 221, 221, 0.1)",
37
+ "& svg": {
38
+ width: "20px"
39
+ },
40
+ "&:hover": {
41
+ opacity: 1,
42
+ background: "rgb(221, 221, 221, 0.8)"
43
+ },
44
+ "&.active": {
45
+ opacity: 1,
46
+ cursor: "grabbing"
47
+ }
31
48
  },
32
- "&:hover": {
33
- opacity: 1,
34
- background: "rgb(221, 221, 221, 0.8)"
49
+ dropArea: {
50
+ position: "absolute",
51
+ left: 0,
52
+ top: 0,
53
+ width: "100%",
54
+ height: "100%",
55
+ pointerEvents: "none",
56
+ zIndex: -1,
57
+ "&.dragging": {
58
+ backgroundColor: "#def4ff"
59
+ }
35
60
  },
36
- "&.active": {
37
- opacity: 1,
38
- cursor: "grabbing"
61
+ dropAreaOver: {
62
+ position: "absolute",
63
+ left: 0,
64
+ top: 0,
65
+ width: "100%",
66
+ height: "4px"
39
67
  }
40
- },
41
- dropArea: {
42
- position: "absolute",
43
- left: 0,
44
- top: 0,
45
- width: "100%",
46
- height: "100%",
47
- pointerEvents: "none",
48
- zIndex: -1,
49
- "&.dragging": {
50
- backgroundColor: "#def4ff"
51
- }
52
- },
53
- dropAreaOver: {
54
- position: "absolute",
55
- left: 0,
56
- top: 0,
57
- width: "100%",
58
- height: "4px"
59
- }
60
- });
68
+ };
69
+ };
61
70
  const DragHandle = props => {
62
- const classes = DragHandleStyle();
71
+ const classes = DragHandleStyle(props.fromPopper);
63
72
  const editor = useSlateStatic();
64
73
  const [dragging, setDragging] = useState(false);
65
74
  const {
@@ -0,0 +1,35 @@
1
+ import { Editor, Transforms } from "slate";
2
+ const selectAll = (event, {
3
+ editor,
4
+ needLayout
5
+ }) => {
6
+ try {
7
+ if (needLayout) {
8
+ event.preventDefault();
9
+ // Select the entire document
10
+ const {
11
+ selection
12
+ } = editor;
13
+ const [firstNode] = Editor.nodes(editor, {
14
+ at: [0]
15
+ }); // First node
16
+ const [lastNode] = Editor.nodes(editor, {
17
+ at: [editor.children.length - 1]
18
+ }); // Last node
19
+
20
+ if (firstNode && lastNode) {
21
+ Transforms.select(editor, {
22
+ anchor: Editor.start(editor, [0]),
23
+ // Start at the first node
24
+ focus: Editor.end(editor, [editor.children.length - 1]) // End at the last node
25
+ });
26
+ }
27
+ }
28
+ } catch (err) {
29
+ console.log(err);
30
+ }
31
+ };
32
+ const EDITORCMDS = {
33
+ a: selectAll
34
+ };
35
+ export default EDITORCMDS;
@@ -10,10 +10,26 @@ import { IoIosImage } from "react-icons/io";
10
10
  import { GridIcon, AccordionIcon, SignatureIcon, ButtonIcon, Carousal, FormIcon, BoldIcon, FontFamilyIcon, FontSizeIcon, ImageIcon, ItalicIcon, LinkIcon, StrikethroughIcon, TableIcon, UnderLineIcon, VideoIcon, CheckboxIcon, AppHeader, MoreHorizontal, UploadImage, DocsUpload, LeftArrow, RightArrow, CheckListButton, CheckListButtonActive, ExcelIcon, CsvIcon, DividerIcon, CloseIcon, SearchIcon, ExpandIcon, CalendarIconNew, Text, TextAreaIcon, Phone, BriefCase, Bank, CalendarTick, DollarSquare, Checkbox, Description, RadioButtonIcon, CheckedIcon, UncheckedIcon, InfinityIcon, ResetIcon } from "./iconslist";
11
11
  import ArrowRightIcon from "@mui/icons-material/ArrowRight";
12
12
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
13
- import EmailRoundedIcon from '@mui/icons-material/EmailRounded';
14
- import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
13
+ import EmailRoundedIcon from "@mui/icons-material/EmailRounded";
14
+ import InfoOutlinedIcon from "@mui/icons-material/InfoOutlined";
15
+ import SettingsIcon from "../assets/svg/SettingsIcon";
16
+ import UndoIcon from "../assets/svg/UndoIcon";
17
+ import RedoIcon from "../assets/svg/RedoIcon";
18
+ import TextIcon from "../assets/svg/TextIcon";
19
+ import AddElementIcon from "../assets/svg/AddElementIcon";
20
+ import AddTemplateIcon from "../assets/svg/AddTemplateIcon";
15
21
  import { jsx as _jsx } from "react/jsx-runtime";
16
22
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
+ const HeadingIcon = ({
24
+ variant
25
+ }) => {
26
+ return /*#__PURE__*/_jsx("div", {
27
+ style: {
28
+ color: "#64748B"
29
+ },
30
+ children: variant
31
+ });
32
+ };
17
33
  const iconList = {
18
34
  fontFamily: /*#__PURE__*/_jsx(FontFamilyIcon, {
19
35
  size: 20
@@ -49,6 +65,24 @@ const iconList = {
49
65
  size: 18,
50
66
  fill: "#64748B"
51
67
  }),
68
+ headingFour: /*#__PURE__*/_jsx(HeadingIcon, {
69
+ variant: "H4"
70
+ }),
71
+ headingFive: /*#__PURE__*/_jsx(HeadingIcon, {
72
+ variant: "H5"
73
+ }),
74
+ headingSix: /*#__PURE__*/_jsx(HeadingIcon, {
75
+ variant: "H6"
76
+ }),
77
+ paragraphOne: /*#__PURE__*/_jsx(HeadingIcon, {
78
+ variant: "P1"
79
+ }),
80
+ paragraphTwo: /*#__PURE__*/_jsx(HeadingIcon, {
81
+ variant: "P2"
82
+ }),
83
+ paragraphThree: /*#__PURE__*/_jsx(HeadingIcon, {
84
+ variant: "P3"
85
+ }),
52
86
  blockquote: /*#__PURE__*/_jsx(MdFormatQuote, {
53
87
  size: 20,
54
88
  fill: "#64748B"
@@ -244,7 +278,13 @@ const iconList = {
244
278
  checkedIcon: /*#__PURE__*/_jsx(CheckedIcon, {}),
245
279
  uncheckedIcon: /*#__PURE__*/_jsx(UncheckedIcon, {}),
246
280
  infinityIcon: /*#__PURE__*/_jsx(InfinityIcon, {}),
247
- resetIcon: /*#__PURE__*/_jsx(ResetIcon, {})
281
+ resetIcon: /*#__PURE__*/_jsx(ResetIcon, {}),
282
+ pagesSettings: /*#__PURE__*/_jsx(SettingsIcon, {}),
283
+ undoIcon: /*#__PURE__*/_jsx(UndoIcon, {}),
284
+ redoIcon: /*#__PURE__*/_jsx(RedoIcon, {}),
285
+ textIcon: /*#__PURE__*/_jsx(TextIcon, {}),
286
+ addElement: /*#__PURE__*/_jsx(AddElementIcon, {}),
287
+ addTemplate: /*#__PURE__*/_jsx(AddTemplateIcon, {})
248
288
  };
249
289
  const Icon = props => {
250
290
  const {
@@ -134,10 +134,13 @@ export const SelectPage = props => {
134
134
  });
135
135
  };
136
136
  export const Trigger = props => {
137
- return /*#__PURE__*/_jsx(Typography, {
137
+ const {
138
+ nav
139
+ } = props;
140
+ return /*#__PURE__*/_jsxs(Typography, {
138
141
  variant: "subtitle1",
139
142
  gutterBottom: true,
140
- children: "Choosing this will trigger the next step"
143
+ children: ["Choosing this will trigger the ", nav.type, " step"]
141
144
  });
142
145
  };
143
146
  const scrollToOptions = [{
@@ -18,7 +18,8 @@ const MAP_COMPONENT = {
18
18
  webAddress: TextInput,
19
19
  email: TextInput,
20
20
  phone: TextInput,
21
- actionTrigger: Trigger,
21
+ nextTrigger: Trigger,
22
+ prevTrigger: Trigger,
22
23
  scrollTopOrBottom: ScrollTopBottom,
23
24
  page: SelectPage
24
25
  };
@@ -35,11 +36,12 @@ export default function LinkSettings(props) {
35
36
  customProps,
36
37
  navType
37
38
  } = props;
39
+ const themeType = localStorage.getItem("themeType");
38
40
  const {
39
41
  isMobile
40
42
  } = customProps;
41
43
  const navOptions = getNavOptions(customProps.hideTools);
42
- const classes = LinkSettingsStyles();
44
+ const classes = LinkSettingsStyles(themeType);
43
45
  const [nav, setNav] = useState(getNav(navType, navOptions));
44
46
  const [navValue, setNavValue] = useState(props?.navValue || "");
45
47
  const [openInNewTab, setOpenInNewTab] = useState(props.openInNewTab || false);