@flozy/editor 3.6.9 → 3.7.0

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.
Files changed (100) hide show
  1. package/dist/Editor/CommonEditor.js +111 -169
  2. package/dist/Editor/Elements/Accordion/Accordion.js +7 -74
  3. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +2 -3
  4. package/dist/Editor/Elements/Accordion/AccordionSummary.js +60 -4
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +15 -39
  6. package/dist/Editor/Elements/Button/EditorButton.js +18 -34
  7. package/dist/Editor/Elements/ChipText/ChipText.js +3 -3
  8. package/dist/Editor/Elements/Color Picker/ColorButtons.js +17 -60
  9. package/dist/Editor/Elements/Color Picker/ColorPicker.css +1 -25
  10. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  11. package/dist/Editor/Elements/Color Picker/Styles.js +1 -2
  12. package/dist/Editor/Elements/Embed/Frames/ImageFrame.js +0 -1
  13. package/dist/Editor/Elements/Emoji/EmojiButton.js +2 -2
  14. package/dist/Editor/Elements/Emoji/EmojiPicker.js +0 -16
  15. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +1 -2
  16. package/dist/Editor/Elements/Grid/Grid.js +1 -3
  17. package/dist/Editor/Elements/Grid/GridItem.js +2 -4
  18. package/dist/Editor/Elements/InlineIcon/InlineIcon.js +3 -2
  19. package/dist/Editor/Elements/Link/Link.js +1 -6
  20. package/dist/Editor/Elements/Link/LinkButton.js +2 -4
  21. package/dist/Editor/Elements/Link/LinkPopup.js +3 -11
  22. package/dist/Editor/Elements/List/CheckList.js +2 -6
  23. package/dist/Editor/Elements/Table/TableCell.js +1 -1
  24. package/dist/Editor/MiniEditor.js +1 -3
  25. package/dist/Editor/Styles/EditorStyles.js +2 -3
  26. package/dist/Editor/Toolbar/Basic/index.js +2 -4
  27. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +2 -26
  28. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  29. package/dist/Editor/Toolbar/FormatTools/TextSize.js +11 -5
  30. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +11 -4
  31. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +86 -213
  32. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +1 -2
  33. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +13 -20
  34. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +7 -52
  35. package/dist/Editor/Toolbar/PopupTool/index.js +11 -12
  36. package/dist/Editor/Toolbar/toolbarGroups.js +6 -48
  37. package/dist/Editor/common/ColorPickerButton.js +9 -25
  38. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  39. package/dist/Editor/common/Icon.js +2 -30
  40. package/dist/Editor/common/LinkSettings/NavComponents.js +20 -54
  41. package/dist/Editor/common/MentionsPopup/MentionsListCard.js +2 -5
  42. package/dist/Editor/common/MentionsPopup/Styles.js +3 -6
  43. package/dist/Editor/common/Shorthands/elements.js +0 -54
  44. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +7 -7
  45. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +16 -16
  46. package/dist/Editor/common/StyleBuilder/buttonStyle.js +2 -4
  47. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +3 -13
  48. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +7 -15
  49. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -31
  50. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +4 -13
  51. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +28 -12
  52. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +4 -14
  53. package/dist/Editor/common/StyleBuilder/index.js +1 -1
  54. package/dist/Editor/helper/index.js +0 -15
  55. package/dist/Editor/helper/theme.js +4 -190
  56. package/dist/Editor/hooks/useMouseMove.js +6 -15
  57. package/dist/Editor/plugins/withEmbeds.js +1 -1
  58. package/dist/Editor/plugins/withHTML.js +5 -47
  59. package/dist/Editor/plugins/withLayout.js +10 -15
  60. package/dist/Editor/plugins/withTable.js +2 -2
  61. package/dist/Editor/theme/ThemeList.js +173 -50
  62. package/dist/Editor/utils/SlateUtilityFunctions.js +25 -157
  63. package/dist/Editor/utils/button.js +17 -1
  64. package/dist/Editor/utils/events.js +4 -11
  65. package/dist/Editor/utils/font.js +37 -40
  66. package/dist/Editor/utils/helper.js +22 -104
  67. package/dist/Editor/utils/serializeToHTML.js +13 -25
  68. package/dist/index.js +1 -5
  69. package/package.json +4 -4
  70. package/dist/Editor/ChatEditor.js +0 -211
  71. package/dist/Editor/Elements/Link/LinkPopupStyles.js +0 -28
  72. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +0 -438
  73. package/dist/Editor/assets/svg/ThemeIcons.js +0 -291
  74. package/dist/Editor/common/CustomColorPicker/index.js +0 -106
  75. package/dist/Editor/common/CustomColorPicker/style.js +0 -53
  76. package/dist/Editor/common/CustomDialog/index.js +0 -94
  77. package/dist/Editor/common/CustomDialog/style.js +0 -67
  78. package/dist/Editor/common/CustomSelect.js +0 -33
  79. package/dist/Editor/common/EditorCmds.js +0 -35
  80. package/dist/Editor/common/MUIIcon/index.js +0 -48
  81. package/dist/Editor/common/StyleBuilder/fieldTypes/loadIcon.js +0 -13
  82. package/dist/Editor/common/StyleBuilder/fieldTypes/mui_filled_icons.js +0 -2
  83. package/dist/Editor/hooks/useEditorTheme.js +0 -139
  84. package/dist/Editor/theme/index.js +0 -144
  85. package/dist/Editor/themeSettings/ActiveTheme.js +0 -72
  86. package/dist/Editor/themeSettings/buttons/index.js +0 -290
  87. package/dist/Editor/themeSettings/buttons/style.js +0 -21
  88. package/dist/Editor/themeSettings/colorTheme/index.js +0 -290
  89. package/dist/Editor/themeSettings/colorTheme/style.js +0 -77
  90. package/dist/Editor/themeSettings/fonts/PreviewElement.js +0 -123
  91. package/dist/Editor/themeSettings/fonts/index.js +0 -213
  92. package/dist/Editor/themeSettings/fonts/style.js +0 -44
  93. package/dist/Editor/themeSettings/icons.js +0 -60
  94. package/dist/Editor/themeSettings/index.js +0 -320
  95. package/dist/Editor/themeSettings/style.js +0 -152
  96. package/dist/Editor/themeSettingsAI/icons.js +0 -96
  97. package/dist/Editor/themeSettingsAI/index.js +0 -356
  98. package/dist/Editor/themeSettingsAI/saveTheme.js +0 -190
  99. package/dist/Editor/themeSettingsAI/style.js +0 -247
  100. package/dist/Editor/utils/chatEditor/SlateUtilityFunctions.js +0 -361
@@ -14,9 +14,6 @@ import { getPageSettings, updatePageSettings } from "../../utils/pageSettings";
14
14
  import { AllColors } from "../../Elements/Color Picker/ColorButtons";
15
15
  import { fontFamilyMap } from "../../utils/font";
16
16
  import { getBorderColor } from "../../utils/helper";
17
- import SelectTypography from "./MiniTextFormat/SelectTypography";
18
- import { isTextCustomized, saveToTheme } from "../../helper/theme";
19
- import { useEditorTheme } from "../../hooks/useEditorTheme";
20
17
  import { jsx as _jsx } from "react/jsx-runtime";
21
18
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
19
  const allTools = toolbarGroups.flat();
@@ -37,6 +34,7 @@ const TextFormat = props => {
37
34
  const fontAlign = allTools.filter(f => f.format?.indexOf("align") >= 0);
38
35
  const link = allTools.find(f => f.format?.indexOf("link") >= 0);
39
36
  const lists = allTools.filter(f => f.group?.indexOf("list") >= 0);
37
+ const typo = allTools.filter(f => f.group?.indexOf("typography") >= 0);
40
38
  const {
41
39
  pageProps
42
40
  } = getPageSettings(editor)?.element || {};
@@ -54,11 +52,6 @@ const TextFormat = props => {
54
52
  color: "",
55
53
  bgColor: ""
56
54
  };
57
- const {
58
- theme,
59
- updateTheme
60
- } = useEditorTheme();
61
- const customized = isTextCustomized(editor);
62
55
  const handlePageWidth = width => () => {
63
56
  updatePageSettings(editor, {
64
57
  ...(pageProps || {}),
@@ -108,49 +101,6 @@ const TextFormat = props => {
108
101
  container: true,
109
102
  sx: classes.textFormatWrapper,
110
103
  children: [/*#__PURE__*/_jsxs(Grid, {
111
- item: true,
112
- xs: 12,
113
- children: [/*#__PURE__*/_jsxs(Grid, {
114
- container: true,
115
- justifyContent: "space-between",
116
- alignItems: "center",
117
- children: [/*#__PURE__*/_jsx(Grid, {
118
- item: true,
119
- children: /*#__PURE__*/_jsx(Typography, {
120
- variant: "body1",
121
- color: "primary",
122
- sx: classes.typoLabel,
123
- children: "Theme Style"
124
- })
125
- }), /*#__PURE__*/_jsx(Grid, {
126
- item: true,
127
- children: theme?.id ? /*#__PURE__*/_jsx(Button, {
128
- sx: classes.defaultBtn,
129
- onClick: () => {
130
- const {
131
- field,
132
- theme
133
- } = saveToTheme(editor) || {};
134
- updateTheme(theme, {
135
- action: "ELEMENT_PROPS_CHANGE",
136
- fieldName: field
137
- });
138
- },
139
- disabled: !customized,
140
- children: "Save to theme"
141
- }) : null
142
- })]
143
- }), /*#__PURE__*/_jsx(Grid, {
144
- item: true,
145
- xs: 12,
146
- sx: classes.textFormatField,
147
- children: /*#__PURE__*/_jsx(SelectTypography, {
148
- editor: editor,
149
- classes: classes,
150
- closeMainPopup: () => {}
151
- })
152
- })]
153
- }), /*#__PURE__*/_jsxs(Grid, {
154
104
  item: true,
155
105
  xs: 12,
156
106
  children: [/*#__PURE__*/_jsxs(Grid, {
@@ -369,7 +319,12 @@ const TextFormat = props => {
369
319
  xs: 12,
370
320
  className: "typo-icons",
371
321
  sx: classes.evenSpace,
372
- children: [fontStyle?.map((m, i) => {
322
+ children: [typo?.map((m, i) => {
323
+ return /*#__PURE__*/_jsx(BlockButton, {
324
+ editor: editor,
325
+ ...m
326
+ }, `pptool_mark_${i}_${m.id}`);
327
+ }), fontStyle?.map((m, i) => {
373
328
  return /*#__PURE__*/_jsx(MarkButton, {
374
329
  editor: editor,
375
330
  ...m
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from "react";
2
- import { Popper, Fade, Paper } from "@mui/material";
2
+ import { Popper, Fade, Paper, ClickAwayListener } from "@mui/material";
3
3
  import { Editor, Range } from "slate";
4
4
  import { useSlate, useFocused } from "slate-react";
5
5
  import useDrag from "../../hooks/useDrag";
@@ -9,7 +9,6 @@ import MiniTextFormat from "./MiniTextFormat";
9
9
  import { useEditorContext } from "../../hooks/useMouseMove";
10
10
  import usePopupStyles from "../PopupTool/PopupToolStyle";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
- import { Fragment as _Fragment } from "react/jsx-runtime";
13
12
  const PopupTool = props => {
14
13
  const {
15
14
  theme,
@@ -32,11 +31,6 @@ const PopupTool = props => {
32
31
  const id = open ? "popup-edit-tool" : "";
33
32
  const table = new TableUtil(editor);
34
33
  const [size] = useWindowResize();
35
- useEffect(() => {
36
- if (!inFocus) {
37
- setAnchorEl(null);
38
- }
39
- }, [inFocus]);
40
34
  useEffect(() => {
41
35
  if (event === "end" && anchorEl && !open) {
42
36
  // for table cell selection
@@ -84,15 +78,21 @@ const PopupTool = props => {
84
78
  setOpen(false);
85
79
  setPopupType("");
86
80
  };
87
- return open && !openAI ? /*#__PURE__*/_jsx(_Fragment, {
81
+ return open && !openAI ? /*#__PURE__*/_jsx(ClickAwayListener, {
82
+ onClickAway: e => {
83
+ // close the mini toolbar, if user clicks outside the editor (in Flozy app.)
84
+ if (e.target !== document.body) {
85
+ // e.target returns body, if the user clicks material ui select popup inside the tool bar, on that time, we don't need to close
86
+ handleClose();
87
+ }
88
+ },
88
89
  children: size.device === "xs" ? /*#__PURE__*/_jsx("div", {
89
90
  className: "mobileMiniTextWrapper",
90
91
  children: /*#__PURE__*/_jsx(MiniTextFormat, {
91
92
  editor: editor,
92
93
  classes: classes,
93
94
  closeMainPopup: handleClose,
94
- customProps: customProps,
95
- theme: theme
95
+ customProps: customProps
96
96
  })
97
97
  }) : /*#__PURE__*/_jsx(Popper, {
98
98
  id: id,
@@ -114,8 +114,7 @@ const PopupTool = props => {
114
114
  editor: editor,
115
115
  classes: classes,
116
116
  closeMainPopup: handleClose,
117
- customProps: customProps,
118
- theme: theme
117
+ customProps: customProps
119
118
  })
120
119
  })
121
120
  })
@@ -28,20 +28,16 @@ export const toolbarGroups = [[{
28
28
  type: "dropdown",
29
29
  options: [{
30
30
  text: "Normal",
31
- value: "normal",
32
- numVal: "400"
31
+ value: "normal"
33
32
  }, {
34
33
  text: "Bold",
35
- value: "bold",
36
- numVal: "700"
34
+ value: "bold"
37
35
  }, {
38
36
  text: "Bolder",
39
- value: "bolder",
40
- numVal: "700"
37
+ value: "bolder"
41
38
  }, {
42
39
  text: "Lighter",
43
- value: "lighter",
44
- numVal: "100"
40
+ value: "lighter"
45
41
  }],
46
42
  icon: FormatBoldIcon,
47
43
  width: "100px"
@@ -50,15 +46,13 @@ export const toolbarGroups = [[{
50
46
  format: "bold",
51
47
  type: "mark",
52
48
  title: "Bold",
53
- basic: true,
54
- themeEnabled: true
49
+ basic: true
55
50
  }, {
56
51
  id: 4,
57
52
  format: "italic",
58
53
  type: "mark",
59
54
  title: "Italic",
60
- basic: true,
61
- themeEnabled: true
55
+ basic: true
62
56
  }, {
63
57
  id: 5,
64
58
  format: "underline",
@@ -107,42 +101,6 @@ export const toolbarGroups = [[{
107
101
  type: "block",
108
102
  title: "H3",
109
103
  group: "typography"
110
- }, {
111
- id: 39,
112
- format: "headingFour",
113
- type: "block",
114
- title: "H4",
115
- group: "typography"
116
- }, {
117
- id: 40,
118
- format: "headingFive",
119
- type: "block",
120
- title: "H5",
121
- group: "typography"
122
- }, {
123
- id: 41,
124
- format: "headingSix",
125
- type: "block",
126
- title: "H6",
127
- group: "typography"
128
- }, {
129
- id: 42,
130
- format: "paragraphOne",
131
- type: "block",
132
- title: "Paragraph 1",
133
- group: "typography"
134
- }, {
135
- id: 43,
136
- format: "paragraphTwo",
137
- type: "block",
138
- title: "Paragraph 2",
139
- group: "typography"
140
- }, {
141
- id: 44,
142
- format: "paragraphThree",
143
- type: "block",
144
- title: "Paragraph 3",
145
- group: "typography"
146
104
  }, {
147
105
  id: 14,
148
106
  format: "doublequote",
@@ -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";
3
4
  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,12 +9,9 @@ const ColorPickerButton = props => {
9
9
  const {
10
10
  value,
11
11
  onSave,
12
+ defaultColors = [],
12
13
  classes = {},
13
- recentColors = [],
14
- children,
15
- handleClose: closeDrawer,
16
- hideThemeColors,
17
- disableEditTheme
14
+ recentColors = []
18
15
  } = props;
19
16
  const [anchorEl, setAnchorEl] = useState(null);
20
17
  const [color, setColor] = useState(value);
@@ -33,13 +30,7 @@ const ColorPickerButton = props => {
33
30
  setColor(color);
34
31
  };
35
32
  return /*#__PURE__*/_jsxs(_Fragment, {
36
- children: [children ? /*#__PURE__*/_jsx("div", {
37
- onClick: handleColorPicker,
38
- style: {
39
- cursor: "pointer"
40
- },
41
- children: children
42
- }) : /*#__PURE__*/_jsx(Button, {
33
+ children: [/*#__PURE__*/_jsx(Button, {
43
34
  style: {
44
35
  background: value,
45
36
  height: "22px",
@@ -69,24 +60,17 @@ const ColorPickerButton = props => {
69
60
  item: true,
70
61
  xs: 12,
71
62
  children: [/*#__PURE__*/_jsx("div", {
72
- children: /*#__PURE__*/_jsx(CustomColorPicker, {
63
+ children: /*#__PURE__*/_jsx(ColorPickerTool, {
73
64
  gradient: true,
74
- color: color,
65
+ value: color,
75
66
  onChange: handleColorChange,
76
- recentColors: recentColors,
77
- closeDrawer: closeDrawer,
78
- hideThemeColors: hideThemeColors,
79
- disableEditTheme: disableEditTheme
67
+ defaultColors: [...recentColors, ...defaultColors] || []
80
68
  })
81
69
  }), /*#__PURE__*/_jsxs("div", {
82
70
  style: {
83
71
  display: "flex",
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)"
72
+ justifyContent: "end",
73
+ margin: "8px"
90
74
  },
91
75
  children: [/*#__PURE__*/_jsx(Button, {
92
76
  onClick: handleClose,
@@ -7,7 +7,7 @@ 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", "headingFour", "headingFive", "headingSix", "paragraphOne", "paragraphTwo", "paragraphThree", "grid"];
10
+ const DRAGGABLE_TYPES = ["paragraph", "headingOne", "headingTwo", "headingThree", "grid"];
11
11
  const DragHandleStyle = () => ({
12
12
  dragHandle: {
13
13
  opacity: 0,
@@ -10,20 +10,10 @@ 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
15
  import { jsx as _jsx } from "react/jsx-runtime";
16
16
  import { jsxs as _jsxs } from "react/jsx-runtime";
17
- const HeadingIcon = ({
18
- variant
19
- }) => {
20
- return /*#__PURE__*/_jsx("div", {
21
- style: {
22
- color: "#64748B"
23
- },
24
- children: variant
25
- });
26
- };
27
17
  const iconList = {
28
18
  fontFamily: /*#__PURE__*/_jsx(FontFamilyIcon, {
29
19
  size: 20
@@ -59,24 +49,6 @@ const iconList = {
59
49
  size: 18,
60
50
  fill: "#64748B"
61
51
  }),
62
- headingFour: /*#__PURE__*/_jsx(HeadingIcon, {
63
- variant: "H4"
64
- }),
65
- headingFive: /*#__PURE__*/_jsx(HeadingIcon, {
66
- variant: "H5"
67
- }),
68
- headingSix: /*#__PURE__*/_jsx(HeadingIcon, {
69
- variant: "H6"
70
- }),
71
- paragraphOne: /*#__PURE__*/_jsx(HeadingIcon, {
72
- variant: "P1"
73
- }),
74
- paragraphTwo: /*#__PURE__*/_jsx(HeadingIcon, {
75
- variant: "P2"
76
- }),
77
- paragraphThree: /*#__PURE__*/_jsx(HeadingIcon, {
78
- variant: "P3"
79
- }),
80
52
  blockquote: /*#__PURE__*/_jsx(MdFormatQuote, {
81
53
  size: 20,
82
54
  fill: "#64748B"
@@ -1,24 +1,8 @@
1
1
  import { Autocomplete, Checkbox, FormControlLabel, MenuItem, Select, TextField, Typography, createFilterOptions } from "@mui/material";
2
2
  import { useEffect, useMemo, useState } from "react";
3
- import { useSlate } from "slate-react";
4
3
  import { jsx as _jsx } from "react/jsx-runtime";
5
4
  import { Fragment as _Fragment } from "react/jsx-runtime";
6
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
- const sectionTypes = ["grid"];
8
- const loopChildren = (children = [], sections) => {
9
- if (!children?.length) {
10
- return sections;
11
- }
12
- for (let child of children) {
13
- if (sectionTypes.includes(child?.type)) {
14
- if (child.id) {
15
- sections.push(child.id);
16
- }
17
- }
18
- sections = loopChildren(child.children, sections);
19
- }
20
- return sections;
21
- };
22
6
  const OpenInNewTab = props => {
23
7
  const {
24
8
  nav,
@@ -58,35 +42,21 @@ export const SelectPage = props => {
58
42
  services
59
43
  } = props;
60
44
  const [pages, setPages] = useState([]);
61
- const editor = useSlate();
62
45
  const getPages = async () => {
63
46
  const result = await services("getPages", {});
64
- if (result?.data?.length) {
65
- const refactor = result?.data?.map(r => {
66
- const {
67
- title,
68
- url_name,
69
- ...rest
70
- } = r;
71
- return {
72
- label: url_name,
73
- value: url_name,
74
- ...rest
75
- };
76
- });
77
- setPages(refactor);
78
- } else {
79
- const currentPage = {
80
- label: "Current Page",
81
- value: "_currentPage",
82
- is_current_page: 1,
83
- sections: loopChildren(editor.children, [])
47
+ const refactor = result?.data?.map(r => {
48
+ const {
49
+ title,
50
+ url_name,
51
+ ...rest
52
+ } = r;
53
+ return {
54
+ label: url_name,
55
+ value: url_name,
56
+ ...rest
84
57
  };
85
- setPages([currentPage]);
86
- if (!value) {
87
- onChange(currentPage.value);
88
- }
89
- }
58
+ });
59
+ setPages(refactor);
90
60
  };
91
61
  useEffect(() => {
92
62
  getPages();
@@ -106,14 +76,12 @@ export const SelectPage = props => {
106
76
  }
107
77
  return [];
108
78
  }, [value, pages]);
109
- const isCurrentPage = page?.value === "_currentPage";
110
79
  return /*#__PURE__*/_jsxs("div", {
111
80
  children: [/*#__PURE__*/_jsx(FreeSoloCreateOption, {
112
81
  label: page?.label,
113
- setValue: val => onChange(val?.value || ""),
82
+ setValue: val => onChange(val?.value),
114
83
  placeholder: "Select Page",
115
- options: pages,
116
- disabled: isCurrentPage
84
+ options: pages
117
85
  }), /*#__PURE__*/_jsx(FreeSoloCreateOption, {
118
86
  label: section?.label,
119
87
  setValue: val => {
@@ -128,7 +96,7 @@ export const SelectPage = props => {
128
96
  label: p,
129
97
  value: p
130
98
  }))
131
- }), isCurrentPage ? null : /*#__PURE__*/_jsx(OpenInNewTab, {
99
+ }), /*#__PURE__*/_jsx(OpenInNewTab, {
132
100
  ...props
133
101
  })]
134
102
  });
@@ -181,8 +149,7 @@ export function FreeSoloCreateOption({
181
149
  label,
182
150
  setValue,
183
151
  options = [],
184
- placeholder = "",
185
- disabled = false
152
+ placeholder = ""
186
153
  }) {
187
154
  return /*#__PURE__*/_jsx(Autocomplete, {
188
155
  freeSolo: true,
@@ -197,7 +164,7 @@ export function FreeSoloCreateOption({
197
164
  children: option.label
198
165
  }),
199
166
  onChange: (event, newValue) => {
200
- if (typeof newValue === "string") {
167
+ if (typeof newValue === 'string') {
201
168
  setValue({
202
169
  value: newValue
203
170
  });
@@ -222,7 +189,7 @@ export function FreeSoloCreateOption({
222
189
  } = params;
223
190
  // Suggest the creation of a new value
224
191
  const isExisting = options.some(option => inputValue === option.label);
225
- if (inputValue !== "" && !isExisting) {
192
+ if (inputValue !== '' && !isExisting) {
226
193
  filtered.push({
227
194
  inputValue,
228
195
  label: `Add "${inputValue}"`
@@ -235,7 +202,7 @@ export function FreeSoloCreateOption({
235
202
  handleHomeEndKeys: true,
236
203
  getOptionLabel: option => {
237
204
  // Value selected with enter, right from the input
238
- if (typeof option === "string") {
205
+ if (typeof option === 'string') {
239
206
  return option;
240
207
  }
241
208
  // Add "xxx" option created dynamically
@@ -247,7 +214,6 @@ export function FreeSoloCreateOption({
247
214
  },
248
215
  sx: {
249
216
  marginTop: "10px"
250
- },
251
- disabled: disabled
217
+ }
252
218
  });
253
219
  }
@@ -13,8 +13,7 @@ const MentionsListCard = props => {
13
13
  } = props;
14
14
  const {
15
15
  name,
16
- email,
17
- avatar_filename = null
16
+ email
18
17
  } = data;
19
18
  return /*#__PURE__*/_jsxs(Card, {
20
19
  sx: {
@@ -38,9 +37,7 @@ const MentionsListCard = props => {
38
37
  alignItems: "center"
39
38
  },
40
39
  alt: name,
41
- children: /*#__PURE__*/_jsx(Avatar, {
42
- src: avatar_filename
43
- })
40
+ children: /*#__PURE__*/_jsx(Avatar, {})
44
41
  }), /*#__PURE__*/_jsx(Box, {
45
42
  sx: {
46
43
  display: "flex",
@@ -10,7 +10,7 @@ const usePopupStyles = theme => ({
10
10
  papper: {
11
11
  boxShadow: "none",
12
12
  width: "300px",
13
- height: "auto",
13
+ height: "300px",
14
14
  overflow: "auto",
15
15
  padding: "8px",
16
16
  margin: "0px",
@@ -39,13 +39,10 @@ const usePopupStyles = theme => ({
39
39
  color: theme?.palette?.editor?.textColor
40
40
  },
41
41
  "&.active": {
42
- background: `#2563EB2B`,
43
- "& .MuiTypography-root": {
44
- color: `${theme?.palette?.editor?.activeColor} !important`
45
- }
42
+ background: `${theme?.palette?.containers?.bg3 || "#E9F3FE"}`
46
43
  },
47
44
  "&:hover": {
48
- background: theme?.palette?.action?.hover || `#F4F4F4`
45
+ background: `${theme?.palette?.containers?.bg3 || "#E9F3FE"}`
49
46
  },
50
47
  "&.renderComp": {
51
48
  padding: "0px",
@@ -40,60 +40,6 @@ const ELEMENTS_LIST = [{
40
40
  icon: "headingThree"
41
41
  }),
42
42
  onInsert: editor => toggleBlock(editor, "headingThree", false)
43
- }, {
44
- name: "Heading 4",
45
- desc: "",
46
- group: "Text",
47
- type: "headingFour",
48
- icon: /*#__PURE__*/_jsx(Icon, {
49
- icon: "headingFour"
50
- }),
51
- onInsert: editor => toggleBlock(editor, "headingFour", false)
52
- }, {
53
- name: "Heading 5",
54
- desc: "",
55
- group: "Text",
56
- type: "headingFive",
57
- icon: /*#__PURE__*/_jsx(Icon, {
58
- icon: "headingFive"
59
- }),
60
- onInsert: editor => toggleBlock(editor, "headingFive", false)
61
- }, {
62
- name: "Heading 6",
63
- desc: "",
64
- group: "Text",
65
- type: "headingSix",
66
- icon: /*#__PURE__*/_jsx(Icon, {
67
- icon: "headingSix"
68
- }),
69
- onInsert: editor => toggleBlock(editor, "headingSix", false)
70
- }, {
71
- name: "Paragraph 1",
72
- desc: "",
73
- group: "Text",
74
- type: "paragraphOne",
75
- icon: /*#__PURE__*/_jsx(Icon, {
76
- icon: "paragraphOne"
77
- }),
78
- onInsert: editor => toggleBlock(editor, "paragraphOne", false)
79
- }, {
80
- name: "Paragraph 2",
81
- desc: "",
82
- group: "Text",
83
- type: "paragraphTwo",
84
- icon: /*#__PURE__*/_jsx(Icon, {
85
- icon: "paragraphTwo"
86
- }),
87
- onInsert: editor => toggleBlock(editor, "paragraphTwo", false)
88
- }, {
89
- name: "Paragraph 3",
90
- desc: "",
91
- group: "Text",
92
- type: "paragraphThree",
93
- icon: /*#__PURE__*/_jsx(Icon, {
94
- icon: "paragraphThree"
95
- }),
96
- onInsert: editor => toggleBlock(editor, "paragraphThree", false)
97
43
  }, {
98
44
  name: "Quote",
99
45
  desc: "",
@@ -1,18 +1,18 @@
1
1
  const accordionTitleBtnStyle = [{
2
2
  tab: "Colors",
3
- value: "accordionColor",
3
+ value: "colors",
4
4
  fields: [{
5
- label: "Accordion Color",
6
- key: "accordionTextColor",
5
+ label: "Text Color",
6
+ key: "textColor",
7
7
  type: "color",
8
8
  needPreview: true
9
9
  }, {
10
- label: "Accordion Background Color",
11
- key: "accordionBgColor",
10
+ label: "Background Color",
11
+ key: "bgColor",
12
12
  type: "color"
13
13
  }, {
14
- label: "Accordion Border Color",
15
- key: "accordionBorderColor",
14
+ label: "Border Color",
15
+ key: "borderColor",
16
16
  type: "color"
17
17
  }]
18
18
  }];
@@ -1,4 +1,20 @@
1
1
  const accordionTitleStyle = [{
2
+ tab: "Banner Spacing",
3
+ value: "bannerSpacing",
4
+ fields: [{
5
+ label: "Banner Spacing",
6
+ key: "bannerSpacing",
7
+ type: "bannerSpacing"
8
+ }]
9
+ }, {
10
+ tab: "Border Radius",
11
+ value: "borderRadius",
12
+ fields: [{
13
+ label: "Border Radius",
14
+ key: "borderRadius",
15
+ type: "borderRadius"
16
+ }]
17
+ }, {
2
18
  tab: "Colors",
3
19
  value: "colors",
4
20
  fields: [{
@@ -15,21 +31,5 @@ const accordionTitleStyle = [{
15
31
  key: "borderColor",
16
32
  type: "color"
17
33
  }]
18
- }, {
19
- tab: "Banner Spacing",
20
- value: "bannerSpacing",
21
- fields: [{
22
- label: "Banner Spacing",
23
- key: "bannerSpacing",
24
- type: "bannerSpacing"
25
- }]
26
- }, {
27
- tab: "Border Radius",
28
- value: "borderRadius",
29
- fields: [{
30
- label: "Border Radius",
31
- key: "borderRadius",
32
- type: "borderRadius"
33
- }]
34
34
  }];
35
35
  export default accordionTitleStyle;