@flozy/editor 6.0.6 → 6.0.7

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 (113) hide show
  1. package/dist/Editor/ChatEditor.js +7 -7
  2. package/dist/Editor/CommonEditor.js +79 -21
  3. package/dist/Editor/DialogWrapper.js +31 -25
  4. package/dist/Editor/Editor.css +21 -16
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +3 -3
  6. package/dist/Editor/Elements/Button/EditorButton.js +25 -9
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +57 -12
  8. package/dist/Editor/Elements/Color Picker/ColorPicker.css +25 -1
  9. package/dist/Editor/Elements/Color Picker/ColorPicker.js +4 -4
  10. package/dist/Editor/Elements/Color Picker/Styles.js +1 -1
  11. package/dist/Editor/Elements/DataView/Providers/DataViewProvider.js +1 -1
  12. package/dist/Editor/Elements/Embed/Image.js +2 -2
  13. package/dist/Editor/Elements/FreeGrid/FreeGrid.js +0 -14
  14. package/dist/Editor/Elements/FreeGrid/styles.js +3 -0
  15. package/dist/Editor/Elements/Grid/GridItem.js +2 -3
  16. package/dist/Editor/Elements/Link/Link.js +70 -43
  17. package/dist/Editor/Elements/SimpleText/index.js +7 -12
  18. package/dist/Editor/Elements/SimpleText/style.js +2 -2
  19. package/dist/Editor/Elements/Table/Table.js +12 -12
  20. package/dist/Editor/Elements/Title/title.js +13 -1
  21. package/dist/Editor/Elements/Variables/Style.js +28 -2
  22. package/dist/Editor/Elements/Variables/VariableButton.js +17 -4
  23. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +27 -3
  24. package/dist/Editor/Toolbar/FormatTools/FontFamilyAutocomplete.js +4 -3
  25. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  26. package/dist/Editor/Toolbar/FormatTools/TextSize.js +7 -15
  27. package/dist/Editor/Toolbar/PopupTool/AddTemplates.js +9 -8
  28. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +6 -13
  29. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +210 -85
  30. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
  31. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +16 -12
  32. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +56 -9
  33. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
  34. package/dist/Editor/Toolbar/PopupTool/index.js +32 -43
  35. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  36. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  37. package/dist/Editor/common/ColorPickerButton.js +32 -9
  38. package/dist/Editor/common/CustomColorPicker/index.js +106 -0
  39. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  40. package/dist/Editor/common/CustomDialog/index.js +94 -0
  41. package/dist/Editor/common/CustomDialog/style.js +67 -0
  42. package/dist/Editor/common/CustomSelect.js +33 -0
  43. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  44. package/dist/Editor/common/DnD/Draggable.js +0 -1
  45. package/dist/Editor/common/FontLoader/FontList.js +3 -11
  46. package/dist/Editor/common/FontLoader/FontLoader.js +74 -42
  47. package/dist/Editor/common/Icon.js +28 -0
  48. package/dist/Editor/common/ImageSelector/Options/Upload.js +1 -1
  49. package/dist/Editor/common/ImageSelector/Styles.js +3 -9
  50. package/dist/Editor/common/ImageSelector/UploadStyles.js +1 -2
  51. package/dist/Editor/common/MentionsPopup/Styles.js +3 -9
  52. package/dist/Editor/common/RnD/ElementSettings/OtherSettings/Settings.js +2 -1
  53. package/dist/Editor/common/RnD/ElementSettings/Settings/AppHeaderSettings.js +3 -2
  54. package/dist/Editor/common/RnD/ElementSettings/Settings/BoxSettings.js +3 -2
  55. package/dist/Editor/common/RnD/ElementSettings/Settings/ButtonSettings.js +3 -2
  56. package/dist/Editor/common/RnD/ElementSettings/Settings/CodeSettings.js +3 -2
  57. package/dist/Editor/common/RnD/ElementSettings/Settings/FormSettings.js +4 -2
  58. package/dist/Editor/common/RnD/ElementSettings/Settings/ImageSettings.js +3 -2
  59. package/dist/Editor/common/RnD/ElementSettings/Settings/TableSettings.js +3 -2
  60. package/dist/Editor/common/RnD/ElementSettings/Settings/VideoSettings.js +3 -2
  61. package/dist/Editor/common/RnD/ElementSettings/styles.js +0 -1
  62. package/dist/Editor/common/RnD/SwitchViewport/SwitchViewport.js +8 -2
  63. package/dist/Editor/common/RnD/Theme/MainThemeProvider.js +17 -0
  64. package/dist/Editor/common/RnD/Theme/ViewportStimulator.js +6 -3
  65. package/dist/Editor/common/RnD/Utils/gridDropItem.js +5 -4
  66. package/dist/Editor/common/RnD/Utils/index.js +40 -0
  67. package/dist/Editor/common/RnD/index.js +23 -3
  68. package/dist/Editor/common/Section/index.js +60 -89
  69. package/dist/Editor/common/Shorthands/elements.js +54 -0
  70. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  71. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -0
  72. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +12 -2
  73. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  74. package/dist/Editor/common/StyleBuilder/fieldTypes/card.js +10 -2
  75. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +35 -11
  76. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
  77. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +15 -7
  78. package/dist/Editor/common/Uploader.js +8 -0
  79. package/dist/Editor/commonStyle.js +55 -65
  80. package/dist/Editor/helper/index.js +2 -2
  81. package/dist/Editor/helper/theme.js +200 -2
  82. package/dist/Editor/hooks/useDrag.js +17 -11
  83. package/dist/Editor/hooks/useEditorScroll.js +1 -2
  84. package/dist/Editor/hooks/useEditorTheme.js +153 -0
  85. package/dist/Editor/hooks/useMouseMove.js +9 -3
  86. package/dist/Editor/plugins/withEmbeds.js +1 -1
  87. package/dist/Editor/plugins/withHTML.js +3 -9
  88. package/dist/Editor/plugins/withLayout.js +1 -1
  89. package/dist/Editor/plugins/withTable.js +1 -1
  90. package/dist/Editor/theme/ThemeList.js +50 -173
  91. package/dist/Editor/theme/index.js +144 -0
  92. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  93. package/dist/Editor/themeSettings/buttons/index.js +283 -0
  94. package/dist/Editor/themeSettings/buttons/style.js +21 -0
  95. package/dist/Editor/themeSettings/colorTheme/index.js +292 -0
  96. package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
  97. package/dist/Editor/themeSettings/fonts/PreviewElement.js +121 -0
  98. package/dist/Editor/themeSettings/fonts/index.js +220 -0
  99. package/dist/Editor/themeSettings/fonts/style.js +44 -0
  100. package/dist/Editor/themeSettings/icons.js +60 -0
  101. package/dist/Editor/themeSettings/index.js +320 -0
  102. package/dist/Editor/themeSettings/style.js +152 -0
  103. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  104. package/dist/Editor/themeSettingsAI/index.js +356 -0
  105. package/dist/Editor/themeSettingsAI/saveTheme.js +197 -0
  106. package/dist/Editor/themeSettingsAI/style.js +250 -0
  107. package/dist/Editor/utils/SlateUtilityFunctions.js +157 -49
  108. package/dist/Editor/utils/button.js +0 -14
  109. package/dist/Editor/utils/draftToSlate.js +3 -2
  110. package/dist/Editor/utils/font.js +40 -37
  111. package/dist/Editor/utils/helper.js +48 -20
  112. package/dist/Editor/utils/link.js +1 -1
  113. package/package.json +6 -3
@@ -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(ColorPickerTool, {
98
+ children: /*#__PURE__*/_jsx(CustomColorPicker, {
99
99
  gradient: true,
100
- value: activeColor,
101
- onChange: handleFormSubmit
100
+ onChange: handleFormSubmit,
101
+ color: activeColor
102
102
  })
103
103
  })]
104
104
  });
@@ -21,7 +21,7 @@ const ColorPickerStyles = theme => ({
21
21
  border: `1px solid ${theme?.palette?.editor?.miniToolBarBorder} !important`,
22
22
  borderRadius: "7px !important",
23
23
  padding: "0px 5px",
24
- '@media only screen and (max-width: 600px)': {
24
+ "@media only screen and (max-width: 600px)": {
25
25
  marginTop: "-40px"
26
26
  }
27
27
  }
@@ -1,5 +1,5 @@
1
1
  import React, { createContext, useContext, useEffect, useState } from "react";
2
- import { Editor, Transforms, Node } from "slate";
2
+ import { Transforms, Node } from "slate";
3
3
  import { PROPERTY_DEFAULTS } from "../Layouts/Options/Constants";
4
4
  import multiSortRows from "../Utils/multiSortRows";
5
5
  import globalSearch from "../Utils/globalSearch";
@@ -5,7 +5,7 @@ import AspectRatioIcon from "@mui/icons-material/AspectRatio";
5
5
  import useResize from "../../utils/customHooks/useResize";
6
6
  import EmbedPopup from "./EmbedPopup";
7
7
  import { IconButton, Tooltip, Box, useTheme } from "@mui/material";
8
- import { GridSettingsIcon, LinkIcon } from "../../common/iconslist";
8
+ import { LinkIcon } from "../../common/iconslist";
9
9
  import { useEditorContext } from "../../hooks/useMouseMove";
10
10
  import { getTRBLBreakPoints, getBreakPointsValue, groupByBreakpoint } from "../../helper/theme";
11
11
  import Icon from "../../common/Icon";
@@ -32,7 +32,7 @@ const ToolBar = ({
32
32
  top: "-4px",
33
33
  left: topM ? "35px" : "0px",
34
34
  margin: "0px",
35
- gap: '3px'
35
+ gap: "3px"
36
36
  },
37
37
  children: [/*#__PURE__*/_jsx(Tooltip, {
38
38
  title: "Image Settings",
@@ -180,20 +180,6 @@ const FreeGrid = props => {
180
180
  linkType: "webAddress"
181
181
  },
182
182
  iconPosition: "start",
183
- bgColor: "#2563EB",
184
- textColor: "#FFF",
185
- borderRadius: {
186
- topLeft: 30,
187
- topRight: 30,
188
- bottomLeft: 30,
189
- bottomRight: 30
190
- },
191
- bannerSpacing: {
192
- left: 12,
193
- top: 12,
194
- right: 12,
195
- bottom: 12
196
- },
197
183
  textAlign: "center",
198
184
  label: "Get Started"
199
185
  }],
@@ -338,6 +338,9 @@ const useFreeGridStyles = ({
338
338
  fontSize: "14px",
339
339
  borderRadius: "7px"
340
340
  }
341
+ },
342
+ "& .remove-resize-styles": {
343
+ transform: "none !important"
341
344
  }
342
345
  }
343
346
  },
@@ -50,8 +50,7 @@ const GridItemToolbar = props => {
50
50
  open: true,
51
51
  placement: "top-end",
52
52
  sx: classes.popTools,
53
- className: "gi-tool-pp",
54
- disablePortal: true,
53
+ className: "gi-tool-pp hide-popper-on-overlap",
55
54
  contentEditable: false,
56
55
  children: /*#__PURE__*/_jsxs(Box, {
57
56
  className: "ico-grp-ss",
@@ -288,7 +287,7 @@ const GridItem = props => {
288
287
  ...getBRProps,
289
288
  display: "flex",
290
289
  flexDirection: flexDirection || "column",
291
- background: bgColor || "transparent",
290
+ background: bgColor,
292
291
  borderColor: getBorderColor(),
293
292
  borderWidth: borderWidth || "1px",
294
293
  borderStyle: borderStyle || "solid",
@@ -1,7 +1,7 @@
1
- import React, { useState } from "react";
1
+ import React, { useRef, useState } from "react";
2
2
  import { Node, Transforms } from "slate";
3
- import { ReactEditor, useFocused, useSelected, useSlateStatic } from "slate-react";
4
- import { Box, IconButton, Tooltip } from "@mui/material";
3
+ import { ReactEditor, useSelected, useSlateStatic } from "slate-react";
4
+ import { Box, IconButton, Popper, Tooltip } from "@mui/material";
5
5
  import OpenInNewIcon from "@mui/icons-material/OpenInNew";
6
6
  import EditIcon from "@mui/icons-material/Edit";
7
7
  import LinkOffIcon from "@mui/icons-material/LinkOff";
@@ -11,6 +11,62 @@ import { getLinkType, handleLinkType } from "../../utils/helper";
11
11
  import LinkSettings from "../../common/LinkSettings";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
+ const Toolbar = props => {
15
+ const {
16
+ urlPath,
17
+ linkType,
18
+ showInNewTab,
19
+ selected,
20
+ linkRef,
21
+ onEditLink,
22
+ editor
23
+ } = props;
24
+ const btnProps = handleLinkType(urlPath, linkType, true, showInNewTab === "_blank");
25
+ const navType = getLinkType(linkType, urlPath);
26
+ const hideOpenLink = navType === "page" || !navType;
27
+ return selected ? /*#__PURE__*/_jsx(Popper, {
28
+ anchorEl: linkRef?.current,
29
+ open: true,
30
+ placement: "top-start",
31
+ className: "hide-popper-on-overlap",
32
+ contentEditable: false,
33
+ style: {
34
+ zIndex: 1000
35
+ },
36
+ children: /*#__PURE__*/_jsxs(Box, {
37
+ className: "element-toolbar hr",
38
+ style: {
39
+ width: "150px",
40
+ display: "flex",
41
+ position: "unset"
42
+ },
43
+ component: "div",
44
+ children: [hideOpenLink ? null : /*#__PURE__*/_jsx(Tooltip, {
45
+ title: "Open",
46
+ children: /*#__PURE__*/_jsx(Box, {
47
+ sx: {
48
+ display: "inline-flex",
49
+ color: "rgba(0, 0, 0, 0.54)"
50
+ },
51
+ ...btnProps,
52
+ children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
53
+ })
54
+ }), /*#__PURE__*/_jsx(Tooltip, {
55
+ title: "Edit",
56
+ children: /*#__PURE__*/_jsx(IconButton, {
57
+ onClick: onEditLink,
58
+ children: /*#__PURE__*/_jsx(EditIcon, {})
59
+ })
60
+ }), /*#__PURE__*/_jsx(Tooltip, {
61
+ title: "Remove",
62
+ children: /*#__PURE__*/_jsx(IconButton, {
63
+ onClick: () => removeLink(editor),
64
+ children: /*#__PURE__*/_jsx(LinkOffIcon, {})
65
+ })
66
+ })]
67
+ })
68
+ }) : null;
69
+ };
14
70
  const linkStyles = () => ({
15
71
  linkBtn: {
16
72
  border: "none",
@@ -40,7 +96,6 @@ const Link = props => {
40
96
  } = customProps;
41
97
  const editor = useSlateStatic();
42
98
  const selected = useSelected();
43
- const focused = useFocused();
44
99
  const [showInput, setShowInput] = useState(false);
45
100
  const [linkData, setLinkData] = useState({
46
101
  name: "",
@@ -53,6 +108,7 @@ const Link = props => {
53
108
  const showInNewTab = element?.showInNewTab || element?.target;
54
109
  const linkType = element?.linkType;
55
110
  const classes = linkStyles();
111
+ const linkRef = useRef(null);
56
112
  const updateLink = data => {
57
113
  Transforms.setNodes(editor, data, {
58
114
  at: path
@@ -77,54 +133,25 @@ const Link = props => {
77
133
  const handleClose = () => {
78
134
  setShowInput(false);
79
135
  };
80
- const Toolbar = () => {
81
- const btnProps = handleLinkType(urlPath, linkType, true, showInNewTab === "_blank");
82
- const navType = getLinkType(linkType, urlPath);
83
- const hideOpenLink = navType === "page" || !navType;
84
- return selected && focused ? /*#__PURE__*/_jsxs("div", {
85
- className: "element-toolbar hr",
86
- contentEditable: false,
87
- style: {
88
- width: "150px",
89
- top: "100%",
90
- left: "0px",
91
- display: "flex"
92
- },
93
- children: [hideOpenLink ? null : /*#__PURE__*/_jsx(Tooltip, {
94
- title: "Open",
95
- children: /*#__PURE__*/_jsx(Box, {
96
- sx: {
97
- display: "inline-flex",
98
- color: "rgba(0, 0, 0, 0.54)"
99
- },
100
- ...btnProps,
101
- children: /*#__PURE__*/_jsx(OpenInNewIcon, {})
102
- })
103
- }), /*#__PURE__*/_jsx(Tooltip, {
104
- title: "Edit",
105
- children: /*#__PURE__*/_jsx(IconButton, {
106
- onClick: onEditLink,
107
- children: /*#__PURE__*/_jsx(EditIcon, {})
108
- })
109
- }), /*#__PURE__*/_jsx(Tooltip, {
110
- title: "Remove",
111
- children: /*#__PURE__*/_jsx(IconButton, {
112
- onClick: () => removeLink(editor),
113
- children: /*#__PURE__*/_jsx(LinkOffIcon, {})
114
- })
115
- })]
116
- }) : null;
117
- };
118
136
  const buttonProps = handleLinkType(urlPath, linkType, readOnly, showInNewTab === "_blank");
119
137
  return /*#__PURE__*/_jsxs("div", {
120
138
  className: "link",
139
+ ref: linkRef,
121
140
  children: [/*#__PURE__*/_jsx(Box, {
122
141
  ...attributes,
123
142
  ...element.attr,
124
143
  sx: classes.linkBtn,
125
144
  ...buttonProps,
126
145
  children: children
127
- }), /*#__PURE__*/_jsx(Toolbar, {}), showInput ? /*#__PURE__*/_jsx(LinkSettings, {
146
+ }), /*#__PURE__*/_jsx(Toolbar, {
147
+ urlPath: urlPath,
148
+ linkType: linkType,
149
+ showInNewTab: showInNewTab,
150
+ selected: selected,
151
+ linkRef: linkRef,
152
+ onEditLink: onEditLink,
153
+ editor: editor
154
+ }), showInput ? /*#__PURE__*/_jsx(LinkSettings, {
128
155
  handleClose: handleClose,
129
156
  onSave: ({
130
157
  linkType,
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { useSlateStatic, useSelected, ReactEditor } from "slate-react";
3
3
  import { Box } from "@mui/material";
4
- import { getPageSettings } from "../../utils/pageSettings";
4
+ // import { getPageSettings } from "../../utils/pageSettings";
5
5
  import { isTextSelected } from "../../utils/helper";
6
6
  import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import SimpleTextStyle from "./style";
@@ -12,7 +12,6 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
12
12
  import { createElement as _createElement } from "react";
13
13
  const SimpleText = props => {
14
14
  const {
15
- theme,
16
15
  openAI
17
16
  } = useEditorContext() || {};
18
17
  const editor = useSlateStatic();
@@ -28,19 +27,15 @@ const SimpleText = props => {
28
27
  readOnly,
29
28
  editorPlaceholder
30
29
  } = customProps;
31
- const {
32
- element: pageSt
33
- } = getPageSettings(editor) || {};
34
- const {
35
- pageColor
36
- } = pageSt?.pageProps || {};
30
+ // const { element: pageSt } = getPageSettings(editor) || {};
31
+ // const { pageColor } = pageSt?.pageProps || {};
37
32
  const {
38
33
  activeBreakPoint
39
34
  } = useEditorContext();
40
35
  const lineHeight = element?.children[0]?.lineHeight;
41
36
  const lineH = getBreakpointLineSpacing(lineHeight, activeBreakPoint);
42
37
  const classes = SimpleTextStyle({
43
- pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF",
38
+ pageColor: "#FFFFFF",
44
39
  lineHeight: lineH
45
40
  });
46
41
  const selected = useSelected();
@@ -59,14 +54,14 @@ const SimpleText = props => {
59
54
  contentEditable: false,
60
55
  className: "placeholder-simple-text",
61
56
  children: isEmptyEditor ? editorPlaceholder || "Write Something..." : showPlaceHolder ? opacity && selected ? /*#__PURE__*/_jsxs(_Fragment, {
62
- children: ["Type ", /*#__PURE__*/_jsx("span", {
57
+ children: ["Type", " ", /*#__PURE__*/_jsx("span", {
63
58
  style: {
64
- backgroundColor: '#F2F6FA',
59
+ backgroundColor: "#F2F6FA",
65
60
  padding: "0px 2px",
66
61
  borderRadius: "2px"
67
62
  },
68
63
  children: "/"
69
- }), " to browse elements"]
64
+ }), " ", "to browse elements"]
70
65
  }) : "" : ""
71
66
  }));
72
67
  };
@@ -35,8 +35,8 @@ const SimpleTextStyle = ({
35
35
  height: "24px",
36
36
  overflow: "hidden",
37
37
  fontSize: "14px",
38
- display: 'inline-flex',
39
- alignItems: 'center',
38
+ display: "inline-flex",
39
+ alignItems: "center",
40
40
  "& .bg-pad-sl": {
41
41
  padding: "2px 4px 2px 4px",
42
42
  background: "transparent",
@@ -30,14 +30,16 @@ const ToolTableComponent = props => {
30
30
  const {
31
31
  updateTableSelection
32
32
  } = useTable();
33
- return /*#__PURE__*/_jsx(TableTool, {
34
- theme: editorTheme,
35
- handleToolAction: (type, option) => {
36
- handleAction(type, option);
37
- if (type === "duplicate") {
38
- updateTableSelection(getDefaultTableSelection());
33
+ return /*#__PURE__*/_jsx("div", {
34
+ children: /*#__PURE__*/_jsx(TableTool, {
35
+ theme: editorTheme,
36
+ handleToolAction: (type, option) => {
37
+ handleAction(type, option);
38
+ if (type === "duplicate") {
39
+ updateTableSelection(getDefaultTableSelection());
40
+ }
39
41
  }
40
- }
42
+ })
41
43
  });
42
44
  };
43
45
  const MoreTableSettings = props => {
@@ -72,11 +74,9 @@ const MoreTableSettings = props => {
72
74
  placement: "bottom-start",
73
75
  children: /*#__PURE__*/_jsx(ClickAwayListener, {
74
76
  onClickAway: () => setExpandTools(false),
75
- children: /*#__PURE__*/_jsx("div", {
76
- children: /*#__PURE__*/_jsx(ToolTableComponent, {
77
- handleAction: handleAction,
78
- editorTheme: editorTheme
79
- })
77
+ children: /*#__PURE__*/_jsx(ToolTableComponent, {
78
+ handleAction: handleAction,
79
+ editorTheme: editorTheme
80
80
  })
81
81
  })
82
82
  });
@@ -1,12 +1,24 @@
1
1
  import React from "react";
2
+ import { Text } from "slate";
2
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
+ const isEmptyTextNode = node => {
5
+ if (Text.isText(node)) {
6
+ return !node.text.trim();
7
+ }
8
+ return false;
9
+ };
3
10
  const Title = props => {
4
11
  const {
12
+ element,
5
13
  attributes,
6
- children
14
+ children,
15
+ customProps
7
16
  } = props;
17
+ const isEmpty = !customProps?.readOnly && isEmptyTextNode(element?.children[0]) ? "empty" : "";
8
18
  return /*#__PURE__*/_jsx("div", {
9
19
  ...attributes,
20
+ placeholder: "Title",
21
+ className: `content-editable ${isEmpty}`,
10
22
  style: {
11
23
  fontWeight: "bold",
12
24
  fontSize: "20px"
@@ -1,4 +1,4 @@
1
- const VariableStyles = () => ({
1
+ const VariableStyles = theme => ({
2
2
  variablesItem: {
3
3
  color: "#2563EB",
4
4
  background: "#EEEEEE"
@@ -37,8 +37,34 @@ const VariableStyles = () => ({
37
37
  "& .MuiMenuItem-root": {
38
38
  color: "#64748B"
39
39
  },
40
+ "& .MuiPaper-root": {
41
+ borderRadius: '8px',
42
+ backgroundColor: `${theme?.palette?.editor?.miniToolBarBackground} !important`,
43
+ marginTop: '5px',
44
+ "@media only screen and (max-width: 599px)": {
45
+ padding: '10px 0px'
46
+ }
47
+ },
48
+ "& .MuiList-root": {
49
+ padding: '0px'
50
+ },
51
+ "& .MuiButtonBase-root": {
52
+ margin: '6px',
53
+ borderRadius: '8px',
54
+ padding: '6px 14px',
55
+ fontSize: '14px',
56
+ fontWeight: '400',
57
+ color: theme?.palette?.editor?.deletePopUpButtonTextColor,
58
+ "&:hover": {
59
+ background: `${theme?.palette?.editor?.menuOptionHoverBackground} !important`
60
+ },
61
+ "@media only screen and (max-width: 599px)": {
62
+ minHeight: '30px',
63
+ margin: '0px 6px'
64
+ }
65
+ },
40
66
  "& .Mui-selected": {
41
- backgroundColor: "rgba(0, 0, 0, 0.04) !important"
67
+ backgroundColor: 'unset !important'
42
68
  }
43
69
  }
44
70
  });
@@ -3,11 +3,15 @@ import { useSlateStatic } from "slate-react";
3
3
  import { MenuItem, Select } from "@mui/material";
4
4
  import { insertVariables } from "../../utils/variables";
5
5
  import VariableStyles from "./Style";
6
- import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
6
+ import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
7
+ import { useEditorContext } from "../../hooks/useMouseMove";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
10
  const VariableButton = props => {
10
- const classes = VariableStyles();
11
+ const {
12
+ theme
13
+ } = useEditorContext();
14
+ const classes = VariableStyles(theme);
11
15
  const editor = useSlateStatic();
12
16
  const {
13
17
  options
@@ -24,13 +28,14 @@ const VariableButton = props => {
24
28
  value: "",
25
29
  sx: classes.variableBtn,
26
30
  onChange: updateVariable,
27
- IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {}),
31
+ IconComponent: () => /*#__PURE__*/_jsx(KeyboardArrowDownRoundedIcon, {}),
28
32
  MenuProps: {
29
33
  sx: classes.variableMenuItem,
30
34
  PaperProps: {
31
35
  style: {
32
36
  maxHeight: 300,
33
- overflowY: "auto"
37
+ overflowY: "auto",
38
+ transformOrigin: 'top left'
34
39
  },
35
40
  sx: {
36
41
  "&::-webkit-scrollbar-track": {
@@ -40,6 +45,14 @@ const VariableButton = props => {
40
45
  borderRadius: "16px"
41
46
  }
42
47
  }
48
+ },
49
+ anchorOrigin: {
50
+ vertical: 'bottom',
51
+ horizontal: 'right'
52
+ },
53
+ transformOrigin: {
54
+ vertical: 'top',
55
+ horizontal: 'right'
43
56
  }
44
57
  },
45
58
  children: [/*#__PURE__*/_jsx(MenuItem, {
@@ -1,8 +1,32 @@
1
1
  import React from "react";
2
2
  import { Select, MenuItem } from "@mui/material";
3
- import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
3
+ import { addMarkData, activeMark, getSelectedElementStyle } from "../../utils/SlateUtilityFunctions.js";
4
+ import { toolbarGroups } from "../toolbarGroups.js";
4
5
  import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
6
+ import { googleFontList as defaultFonts } from "../../common/FontLoader/FontList.js";
5
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
+ const allTools = toolbarGroups.flat();
9
+ const fontWeight = allTools.find(f => f.format === "fontWeight");
10
+ export const getValue = (editor, format) => {
11
+ switch (format) {
12
+ case "fontFamily":
13
+ {
14
+ const style = getSelectedElementStyle("font-family", editor);
15
+ return style || defaultFonts[0];
16
+ }
17
+ case "fontWeight":
18
+ {
19
+ const {
20
+ options
21
+ } = fontWeight || {};
22
+ const fontWeightStyle = getSelectedElementStyle("font-weight", editor);
23
+ const selected = options?.find(o => o.value === fontWeightStyle || o.numVal === fontWeightStyle);
24
+ return selected?.value;
25
+ }
26
+ default:
27
+ return activeMark(editor, format);
28
+ }
29
+ };
6
30
  const Dropdown = ({
7
31
  classes,
8
32
  editor,
@@ -10,7 +34,7 @@ const Dropdown = ({
10
34
  options,
11
35
  width
12
36
  }) => {
13
- const value = activeMark(editor, format);
37
+ const value = getValue(editor, format);
14
38
  const changeMarkData = (event, format) => {
15
39
  event.preventDefault();
16
40
  const value = event.target.value;
@@ -20,7 +44,7 @@ const Dropdown = ({
20
44
  });
21
45
  };
22
46
  return /*#__PURE__*/_jsx(Select, {
23
- value: value,
47
+ value: value || options?.[0]?.value,
24
48
  className: "editor-dd",
25
49
  onChange: e => changeMarkData(e, format),
26
50
  MenuProps: {
@@ -1,9 +1,10 @@
1
1
  import React from "react";
2
2
  import { Autocomplete, TextField } from "@mui/material";
3
- import { activeMark, addMarkData } from "../../utils/SlateUtilityFunctions.js";
3
+ import { addMarkData } from "../../utils/SlateUtilityFunctions.js";
4
4
  import usePopupStyle from "../PopupTool/PopupToolStyle.js";
5
5
  import { useEditorContext } from "../../hooks/useMouseMove.js";
6
- import KeyboardArrowDownRoundedIcon from '@mui/icons-material/KeyboardArrowDownRounded';
6
+ import KeyboardArrowDownRoundedIcon from "@mui/icons-material/KeyboardArrowDownRounded";
7
+ import { getValue } from "./Dropdown.js";
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
9
  const FontFamilyAutocomplete = ({
9
10
  editor,
@@ -14,7 +15,7 @@ const FontFamilyAutocomplete = ({
14
15
  val = "",
15
16
  webFont = false
16
17
  }) => {
17
- const markValue = activeMark(editor, format);
18
+ const markValue = getValue(editor, format);
18
19
  const value = !webFont ? markValue : val;
19
20
  const changeMarkData = (event, newValue, format) => {
20
21
  if (!webFont) {
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import Icon from "../../common/Icon";
3
3
  import Button from "../../common/Button";
4
- import { toggleMark, isMarkActive } from "../../utils/SlateUtilityFunctions.js";
4
+ import { toggleMark, isMarkBtnActive } from "../../utils/SlateUtilityFunctions.js";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  const MarkButton = ({
7
7
  editor,
@@ -9,7 +9,7 @@ const MarkButton = ({
9
9
  title
10
10
  }) => {
11
11
  return /*#__PURE__*/_jsx(Button, {
12
- active: isMarkActive(editor, format),
12
+ active: isMarkBtnActive(editor, format),
13
13
  format: format,
14
14
  onMouseDown: e => {
15
15
  e.preventDefault();
@@ -1,10 +1,7 @@
1
1
  import React, { useEffect, useRef, useState } from "react";
2
2
  import { TextField, IconButton } from "@mui/material";
3
- import { addMarkData, activeMark, isBlockActive } from "../../utils/SlateUtilityFunctions.js";
4
- import { headingMap, sizeMap } from "../../utils/font.js";
5
- import ExpandLessRoundedIcon from "@mui/icons-material/ExpandLessRounded";
6
- import ExpandMoreRoundedIcon from "@mui/icons-material/ExpandMoreRounded";
7
- import { getBreakPointsValue } from "../../helper/theme.js";
3
+ import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
4
+ import { getBreakPointsValue, getTextSizeVal } from "../../helper/theme.js";
8
5
  import useWindowResize from "../../hooks/useWindowResize.js";
9
6
  import { BREAKPOINTS_DEVICES } from "../../helper/theme.js";
10
7
  import { TextSizeDownArrow, TextSizeUpArrow } from "../../common/iconListV2.js";
@@ -17,11 +14,12 @@ const TextSize = ({
17
14
  format,
18
15
  fullWidth
19
16
  }) => {
20
- const [size] = useWindowResize();
21
- const val = activeMark(editor, format);
22
- const value = getBreakPointsValue(val, size?.device);
23
17
  const [fontSize, setFontSize] = useState();
24
18
  const timerRef = useRef();
19
+ const [size] = useWindowResize();
20
+ const val = activeMark(editor, format);
21
+ const noFontSize = val === "normal" || typeof val === "object" && !Object.keys(val)?.length;
22
+ const value = noFontSize ? getTextSizeVal(editor) : getBreakPointsValue(val, size?.device);
25
23
  useEffect(() => {
26
24
  setFontSize(getSizeVal());
27
25
  }, [value]);
@@ -57,13 +55,7 @@ const TextSize = ({
57
55
  };
58
56
  const getSizeVal = () => {
59
57
  try {
60
- let size = `${value}`?.indexOf("px") >= 0 ? value : sizeMap[value] || value;
61
- Object.entries(headingMap).forEach(([format, value]) => {
62
- if (isBlockActive(editor, format) && isNaN(parseInt(size))) {
63
- size = value;
64
- }
65
- });
66
- return parseInt(size);
58
+ return parseInt(value);
67
59
  } catch (err) {
68
60
  return "";
69
61
  }