@flozy/editor 3.7.2 → 3.7.3

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 (85) hide show
  1. package/dist/Editor/CommonEditor.js +169 -111
  2. package/dist/Editor/Elements/Accordion/Accordion.js +74 -7
  3. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +3 -2
  4. package/dist/Editor/Elements/Accordion/AccordionSummary.js +4 -60
  5. package/dist/Editor/Elements/AppHeader/AppHeader.js +26 -4
  6. package/dist/Editor/Elements/Button/EditorButton.js +25 -14
  7. package/dist/Editor/Elements/Color Picker/ColorButtons.js +60 -17
  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 +2 -1
  11. package/dist/Editor/Elements/Embed/Frames/ImageFrame.js +1 -0
  12. package/dist/Editor/Elements/Embed/Image.js +28 -20
  13. package/dist/Editor/Elements/Embed/Video.js +15 -11
  14. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +2 -1
  15. package/dist/Editor/Elements/Grid/Grid.js +2 -0
  16. package/dist/Editor/Elements/Grid/GridItem.js +3 -1
  17. package/dist/Editor/Elements/Link/Link.js +6 -1
  18. package/dist/Editor/Elements/Link/LinkButton.js +4 -2
  19. package/dist/Editor/Elements/Link/LinkPopup.js +11 -3
  20. package/dist/Editor/Elements/Link/LinkPopupStyles.js +28 -0
  21. package/dist/Editor/Elements/Table/TableCell.js +1 -1
  22. package/dist/Editor/MiniEditor.js +3 -1
  23. package/dist/Editor/Toolbar/Basic/index.js +4 -2
  24. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +26 -2
  25. package/dist/Editor/Toolbar/FormatTools/MarkButton.js +2 -2
  26. package/dist/Editor/Toolbar/FormatTools/TextSize.js +5 -11
  27. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectFontSize.js +4 -11
  28. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/SelectTypography.js +213 -86
  29. package/dist/Editor/Toolbar/PopupTool/MiniTextFormat/index.js +2 -1
  30. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +20 -13
  31. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +52 -7
  32. package/dist/Editor/Toolbar/PopupTool/ThemeTextFormat.js +438 -0
  33. package/dist/Editor/Toolbar/PopupTool/index.js +4 -2
  34. package/dist/Editor/Toolbar/toolbarGroups.js +48 -6
  35. package/dist/Editor/assets/svg/ThemeIcons.js +291 -0
  36. package/dist/Editor/common/ColorPickerButton.js +25 -9
  37. package/dist/Editor/common/CustomColorPicker/index.js +106 -0
  38. package/dist/Editor/common/CustomColorPicker/style.js +53 -0
  39. package/dist/Editor/common/CustomDialog/index.js +94 -0
  40. package/dist/Editor/common/CustomDialog/style.js +67 -0
  41. package/dist/Editor/common/CustomSelect.js +33 -0
  42. package/dist/Editor/common/DnD/DragHandleButton.js +1 -1
  43. package/dist/Editor/common/EditorCmds.js +35 -0
  44. package/dist/Editor/common/Icon.js +30 -2
  45. package/dist/Editor/common/MentionsPopup/Styles.js +5 -2
  46. package/dist/Editor/common/Shorthands/elements.js +54 -0
  47. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +7 -7
  48. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +16 -16
  49. package/dist/Editor/common/StyleBuilder/buttonStyle.js +4 -2
  50. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +13 -3
  51. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +15 -7
  52. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +31 -7
  53. package/dist/Editor/common/StyleBuilder/fieldTypes/fontSize.js +13 -4
  54. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +14 -4
  55. package/dist/Editor/common/StyleBuilder/index.js +1 -1
  56. package/dist/Editor/helper/theme.js +190 -4
  57. package/dist/Editor/hooks/useEditorTheme.js +139 -0
  58. package/dist/Editor/hooks/useMouseMove.js +4 -2
  59. package/dist/Editor/plugins/withEmbeds.js +1 -1
  60. package/dist/Editor/plugins/withHTML.js +47 -5
  61. package/dist/Editor/plugins/withLayout.js +15 -10
  62. package/dist/Editor/plugins/withTable.js +2 -2
  63. package/dist/Editor/theme/ThemeList.js +50 -173
  64. package/dist/Editor/theme/index.js +144 -0
  65. package/dist/Editor/themeSettings/ActiveTheme.js +72 -0
  66. package/dist/Editor/themeSettings/buttons/index.js +290 -0
  67. package/dist/Editor/themeSettings/buttons/style.js +21 -0
  68. package/dist/Editor/themeSettings/colorTheme/index.js +290 -0
  69. package/dist/Editor/themeSettings/colorTheme/style.js +77 -0
  70. package/dist/Editor/themeSettings/fonts/PreviewElement.js +123 -0
  71. package/dist/Editor/themeSettings/fonts/index.js +213 -0
  72. package/dist/Editor/themeSettings/fonts/style.js +44 -0
  73. package/dist/Editor/themeSettings/icons.js +60 -0
  74. package/dist/Editor/themeSettings/index.js +320 -0
  75. package/dist/Editor/themeSettings/style.js +152 -0
  76. package/dist/Editor/themeSettingsAI/icons.js +96 -0
  77. package/dist/Editor/themeSettingsAI/index.js +356 -0
  78. package/dist/Editor/themeSettingsAI/saveTheme.js +190 -0
  79. package/dist/Editor/themeSettingsAI/style.js +247 -0
  80. package/dist/Editor/utils/SlateUtilityFunctions.js +157 -25
  81. package/dist/Editor/utils/button.js +1 -17
  82. package/dist/Editor/utils/events.js +11 -4
  83. package/dist/Editor/utils/font.js +40 -37
  84. package/dist/Editor/utils/helper.js +71 -12
  85. package/package.json +1 -1
@@ -13,6 +13,9 @@ import { WorkflowIcon } from "../../common/iconslist";
13
13
  import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
14
14
  import { handleLinkType, windowVar } from "../../utils/helper";
15
15
  import LinkSettings from "../../common/LinkSettings";
16
+ import { useEditorTheme } from "../../hooks/useEditorTheme";
17
+ import { getTheme } from "../../theme";
18
+ import { fontFamilyMap } from "../../utils/font";
16
19
  import { jsx as _jsx } from "react/jsx-runtime";
17
20
  import { jsxs as _jsxs } from "react/jsx-runtime";
18
21
  const EditorButton = props => {
@@ -30,6 +33,12 @@ const EditorButton = props => {
30
33
  const path = ReactEditor.findPath(editor, element);
31
34
  const [edit, setEdit] = useState(false);
32
35
  const [openNav, setOpenNav] = useState(false);
36
+ const {
37
+ theme
38
+ } = useEditorTheme();
39
+ const {
40
+ buttonTheme
41
+ } = getTheme(theme);
33
42
  const {
34
43
  label,
35
44
  bgColor,
@@ -43,7 +52,7 @@ const EditorButton = props => {
43
52
  fontFamily,
44
53
  textColorHover,
45
54
  bgColorHover,
46
- buttonIcon,
55
+ // buttonIcon,
47
56
  iconPosition = "start",
48
57
  borderStyle,
49
58
  borderWidth,
@@ -64,6 +73,7 @@ const EditorButton = props => {
64
73
  };
65
74
  const isTrigger = linkType === "actionTrigger";
66
75
  const refURl = isTrigger ? buttonLink?.url : url;
76
+ const buttonIcon = element?.buttonIcon || buttonTheme?.buttonIcon;
67
77
  const BtnIcon = buttonIcon ? buttonIcon : null;
68
78
  windowVar.lastButtonProps = element;
69
79
  const handleTrigger = async () => {
@@ -186,20 +196,9 @@ const EditorButton = props => {
186
196
  children: [/*#__PURE__*/_jsxs(Box, {
187
197
  sx: {
188
198
  textDecoration: "none",
189
- background: bgColor || "rgb(30, 75, 122)",
190
199
  borderBlockStyle: "solid",
191
- borderColor: borderColor || "transparent",
192
200
  borderWidth: borderWidth !== undefined ? borderWidth : borderColor ? "1px" : "0px",
193
- borderRadius: {
194
- ...getBreakPointsValue(borderRadius || {}, null, "overrideBorderRadius", true)
195
- },
196
201
  borderStyle: borderStyle || "solid",
197
- padding: {
198
- ...getTRBLBreakPoints(bannerSpacing)
199
- },
200
- color: `${textColor || "#FFFFFF"}`,
201
- fontSize: textSize || "inherit",
202
- fontFamily: fontFamily || "PoppinsRegular",
203
202
  display: "inline-flex",
204
203
  alignItems: "center",
205
204
  position: "relative",
@@ -207,14 +206,26 @@ const EditorButton = props => {
207
206
  display: "none"
208
207
  },
209
208
  "&:hover": {
210
- color: `${textColorHover || textColor || "#FFFFFF"}`,
211
- background: bgColorHover || bgColor || "rgb(30, 75, 122)",
209
+ color: `${textColorHover || textColor}`,
210
+ background: bgColorHover || bgColor,
212
211
  "& .element-toolbar": {
213
212
  display: "flex"
214
213
  }
214
+ },
215
+ color: `${textColor} !important`,
216
+ fontSize: `${textSize}px !important`,
217
+ fontFamily: `${fontFamilyMap[fontFamily] || ""} !important`,
218
+ background: `${bgColor} !important`,
219
+ borderColor: `${borderColor} !important`,
220
+ borderRadius: {
221
+ ...getBreakPointsValue(borderRadius || buttonTheme?.borderRadius || {}, null, "overrideBorderRadius", true)
222
+ },
223
+ padding: {
224
+ ...getTRBLBreakPoints(bannerSpacing || buttonTheme?.bannerSpacing || {})
215
225
  }
216
226
  },
217
227
  ...buttonProps,
228
+ className: "button theme-element",
218
229
  children: [BtnIcon && iconPosition === "start" && /*#__PURE__*/_jsx(MUIIcon, {
219
230
  iconName: buttonIcon,
220
231
  style: {
@@ -1,11 +1,15 @@
1
- import React, { useState } from "react";
2
- import { Box, IconButton, Popover } from "@mui/material";
1
+ import React, { useContext, useState } from "react";
2
+ import { Box, IconButton, Popover, Typography, useTheme } from "@mui/material";
3
3
  import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
4
4
  import Button from "../../common/Button";
5
5
  import { colors } from "./defaultColors";
6
6
  import ColorPicker from "./colorPicker.svg";
7
+ import { ThemeContext } from "../../CommonEditor";
8
+ import { useSlateStatic } from "slate-react";
9
+ import { Transforms } from "slate";
7
10
  import { jsx as _jsx } from "react/jsx-runtime";
8
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
12
+ import { Fragment as _Fragment } from "react/jsx-runtime";
9
13
  let c = [];
10
14
  const ColorChunks = (recentColors = []) => [...recentColors, ...colors].reduce((a, b, i) => {
11
15
  if (i % 7 === 0) {
@@ -31,9 +35,7 @@ const SingleColorButton = ({
31
35
  style: {
32
36
  width: "100%",
33
37
  display: "flex",
34
- alignItems: "center",
35
- padding: padding || "8px",
36
- justifyContent: "center"
38
+ padding: padding || "8px"
37
39
  },
38
40
  children: [crs.map(m => /*#__PURE__*/_jsx(Button, {
39
41
  onClick: handleSelect(m),
@@ -109,11 +111,17 @@ const ColorButtons = props => {
109
111
  forMiniTool,
110
112
  openColorTool,
111
113
  onClose,
112
- onColorPickerClick
114
+ onColorPickerClick,
115
+ disableEditTheme
113
116
  } = props;
114
117
  const [row1, ...restRows] = ColorChunks([]);
115
118
  const [anchorEl, setAnchorEl] = useState(null);
116
119
  const open = Boolean(anchorEl);
120
+ const theme = useTheme();
121
+ const editor = useSlateStatic();
122
+ const {
123
+ setOpenTheme
124
+ } = useContext(ThemeContext);
117
125
  const handleMore = e => {
118
126
  setAnchorEl(e.currentTarget);
119
127
  };
@@ -126,6 +134,7 @@ const ColorButtons = props => {
126
134
  const handleSelect = color => () => {
127
135
  onSelect(color);
128
136
  };
137
+ const colorVars = theme?.vars?.colors || {};
129
138
  return /*#__PURE__*/_jsxs(Box, {
130
139
  component: "span",
131
140
  sx: classes.colorButtons,
@@ -142,7 +151,7 @@ const ColorButtons = props => {
142
151
  activeColor: activeColor
143
152
  }, `si_btn_row1_${m}_${i}`);
144
153
  })
145
- }), /*#__PURE__*/_jsxs(Popover, {
154
+ }), /*#__PURE__*/_jsx(Popover, {
146
155
  open: open || openColorTool,
147
156
  anchorEl: anchorEl || openColorTool,
148
157
  onClose: handleClose,
@@ -156,9 +165,39 @@ const ColorButtons = props => {
156
165
  },
157
166
  sx: classes.colorPopper,
158
167
  className: "colorPopper",
159
- children: [/*#__PURE__*/_jsx(Box, {
168
+ children: /*#__PURE__*/_jsxs(Box, {
160
169
  sx: classes.colorButtonsInner,
161
- children: restRows.map((m, i) => {
170
+ children: [Object.values(colorVars)?.length ? /*#__PURE__*/_jsxs(_Fragment, {
171
+ children: [/*#__PURE__*/_jsxs(Box, {
172
+ component: "div",
173
+ className: "singleColorTitleWrapper",
174
+ children: [/*#__PURE__*/_jsx(Typography, {
175
+ variant: "subtitle2",
176
+ children: "Theme colour"
177
+ }), disableEditTheme ? null : /*#__PURE__*/_jsx("div", {
178
+ className: "editBtn",
179
+ onClick: () => {
180
+ Transforms.deselect(editor, {
181
+ at: editor.selection
182
+ });
183
+ setOpenTheme("editThemeColor");
184
+ },
185
+ children: "Edit"
186
+ })]
187
+ }), /*#__PURE__*/_jsx(SingleColorButton, {
188
+ crs: Object.values(colorVars),
189
+ handleSelect: handleSelect,
190
+ classes: classes,
191
+ activeColor: activeColor
192
+ })]
193
+ }) : null, /*#__PURE__*/_jsx(Box, {
194
+ component: "div",
195
+ className: "singleColorTitleWrapper",
196
+ children: /*#__PURE__*/_jsx(Typography, {
197
+ variant: "subtitle2",
198
+ children: "Custom colour"
199
+ })
200
+ }), restRows.map((m, i) => {
162
201
  return /*#__PURE__*/_jsx(SingleColorButton, {
163
202
  id: `p2_${id}`,
164
203
  crs: m,
@@ -167,14 +206,18 @@ const ColorButtons = props => {
167
206
  classes: classes,
168
207
  activeColor: activeColor
169
208
  }, `si_btn_${m}_${i}`);
170
- })
171
- }), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
172
- onClick: onColorPickerClick,
173
- children: /*#__PURE__*/_jsx("img", {
174
- src: ColorPicker,
175
- alt: "color wheel"
176
- })
177
- }) : null]
209
+ }), forMiniTool ? /*#__PURE__*/_jsx(IconButton, {
210
+ onClick: onColorPickerClick,
211
+ style: {
212
+ alignSelf: "start",
213
+ margin: "6px"
214
+ },
215
+ children: /*#__PURE__*/_jsx("img", {
216
+ src: ColorPicker,
217
+ alt: "color wheel"
218
+ })
219
+ }) : null]
220
+ })
178
221
  })]
179
222
  });
180
223
  };
@@ -60,4 +60,28 @@
60
60
  padding: 0 15px !important;
61
61
  width: 60px !important;
62
62
  flex-shrink: 0;
63
- }
63
+ }
64
+
65
+
66
+ .singleColorTitleWrapper {
67
+ display: flex;
68
+ justify-content: space-between;
69
+ align-items: center;
70
+ padding: 10px;
71
+ width: 100%;
72
+ border-bottom: 1px solid #DCE4EC;
73
+ }
74
+
75
+ .singleColorTitleWrapper .MuiTypography-root {
76
+ font-weight: 600;
77
+ }
78
+
79
+ .singleColorTitleWrapper .editBtn {
80
+ text-transform: none;
81
+ color: #2563EB;
82
+ text-decoration: underline;
83
+ padding: 0px;
84
+ min-width: unset;
85
+ cursor: pointer;
86
+ font-size: 14px;
87
+ }
@@ -1,7 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import { ReactEditor } from "slate-react";
3
3
  import { Transforms } from "slate";
4
- import ColorPickerTool from "react-gcolor-picker";
5
4
  import { IconButton, Tooltip, Box, Popover } from "@mui/material";
6
5
  import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions";
7
6
  import ColorButtons from "./ColorButtons";
@@ -9,6 +8,7 @@ import ColorPickerStyles from "./Styles";
9
8
  import colorWheel from "./colorWheel.png";
10
9
  import "./ColorPicker.css";
11
10
  import { useEditorContext } from "../../hooks/useMouseMove";
11
+ import CustomColorPicker from "../../common/CustomColorPicker";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
14
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -95,10 +95,10 @@ const ColorPicker = props => {
95
95
  horizontal: "top"
96
96
  },
97
97
  sx: classes.colorPickerPopup,
98
- children: /*#__PURE__*/_jsx(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
  });
@@ -15,7 +15,8 @@ const ColorPickerStyles = theme => ({
15
15
  colorPopper: {
16
16
  "& .MuiPaper-root": {
17
17
  backgroundColor: theme?.palette?.editor?.background,
18
- '@media only screen and (max-width: 600px)': {
18
+ padding: "4px 14px",
19
+ "@media only screen and (max-width: 600px)": {
19
20
  marginTop: "-40px"
20
21
  }
21
22
  }
@@ -119,6 +119,7 @@ const ImageFrame = props => {
119
119
  zIndex: 100
120
120
  },
121
121
  placement: "top",
122
+ disablePortal: true,
122
123
  children: /*#__PURE__*/_jsxs(Box, {
123
124
  sx: classes?.sliderContainer,
124
125
  children: [/*#__PURE__*/_jsx(ContinuousSlider, {
@@ -167,15 +167,19 @@ const Image = ({
167
167
  onTouchEnd
168
168
  } = handleLinkType(webAddress, linkType, readOnly, isNewTab);
169
169
  const handleImageClick = () => {
170
- Transforms.select(editor, {
171
- anchor: Editor.start(editor, path),
172
- focus: Editor.end(editor, path)
173
- });
174
- if (onClick) {
175
- onClick();
176
- }
177
- if (onTouchEnd) {
178
- onTouchEnd();
170
+ try {
171
+ Transforms.select(editor, {
172
+ anchor: Editor.start(editor, path),
173
+ focus: Editor.end(editor, path)
174
+ });
175
+ if (onClick) {
176
+ onClick();
177
+ }
178
+ if (onTouchEnd) {
179
+ onTouchEnd();
180
+ }
181
+ } catch (err) {
182
+ console.log(err);
179
183
  }
180
184
  };
181
185
  useEffect(() => {
@@ -189,16 +193,20 @@ const Image = ({
189
193
  setOpenSettings(true);
190
194
  };
191
195
  const onSave = data => {
192
- const updateData = {
193
- ...data
194
- };
195
- delete updateData.children;
196
- Transforms.setNodes(editor, {
197
- ...updateData
198
- }, {
199
- at: path
200
- });
201
- onClose();
196
+ try {
197
+ const updateData = {
198
+ ...data
199
+ };
200
+ delete updateData.children;
201
+ Transforms.setNodes(editor, {
202
+ ...updateData
203
+ }, {
204
+ at: path
205
+ });
206
+ onClose();
207
+ } catch (err) {
208
+ console.log(err);
209
+ }
202
210
  };
203
211
  const onClose = () => {
204
212
  setOpenSettings(false);
@@ -231,7 +239,7 @@ const Image = ({
231
239
  return /*#__PURE__*/_jsxs(Box, {
232
240
  ...attributes,
233
241
  component: "div",
234
- className: "embed has-hover",
242
+ className: "embed has-hover dpath",
235
243
  sx: {
236
244
  display: {
237
245
  lg: "flex",
@@ -95,16 +95,20 @@ const Video = ({
95
95
  setOpenSettings(true);
96
96
  };
97
97
  const onSave = data => {
98
- const updateData = {
99
- ...data
100
- };
101
- delete updateData.children;
102
- Transforms.setNodes(editor, {
103
- ...updateData
104
- }, {
105
- at: path
106
- });
107
- onClose();
98
+ try {
99
+ const updateData = {
100
+ ...data
101
+ };
102
+ delete updateData.children;
103
+ Transforms.setNodes(editor, {
104
+ ...updateData
105
+ }, {
106
+ at: path
107
+ });
108
+ onClose();
109
+ } catch (err) {
110
+ console.log(err);
111
+ }
108
112
  };
109
113
  const onClose = () => {
110
114
  setOpenSettings(false);
@@ -178,7 +182,7 @@ const Video = ({
178
182
  };
179
183
  return /*#__PURE__*/_jsxs(Box, {
180
184
  ...attributes,
181
- className: "embed has-hover video",
185
+ className: "embed has-hover video dpath",
182
186
  sx: {
183
187
  display: {
184
188
  lg: "flex",
@@ -39,7 +39,8 @@ const UserInputs = props => {
39
39
  fontStyleOptions: ['underline'],
40
40
  hideLink: true,
41
41
  hideTextColor: true
42
- }
42
+ },
43
+ theme: theme
43
44
  })
44
45
  })
45
46
  });
@@ -15,6 +15,7 @@ import { gridItem } from "../../utils/gridItem";
15
15
  import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
16
16
  import { getTRBLBreakPoints, getBreakPointsValue } from "../../helper/theme";
17
17
  import useWindowResize from "../../hooks/useWindowResize";
18
+ import { useTheme } from "@emotion/react";
18
19
  import { jsx as _jsx } from "react/jsx-runtime";
19
20
  import { Fragment as _Fragment } from "react/jsx-runtime";
20
21
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -75,6 +76,7 @@ const GridToolBar = ({
75
76
  }) : null;
76
77
  };
77
78
  const Grid = props => {
79
+ const theme = useTheme();
78
80
  const {
79
81
  attributes,
80
82
  children,
@@ -8,6 +8,7 @@ import { GridSettingsIcon } from "../../common/iconslist";
8
8
  import { useEditorContext, useEditorSelection } from "../../hooks/useMouseMove";
9
9
  import { getBreakPointsValue, getTRBLBreakPoints } from "../../helper/theme";
10
10
  import { isEmptyNode } from "../../utils/helper";
11
+ import { useTheme } from "@emotion/react";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
14
  const GridItemToolbar = ({
@@ -34,6 +35,7 @@ const GridItemToolbar = ({
34
35
  }) : null;
35
36
  };
36
37
  const GridItem = props => {
38
+ const theme = useTheme();
37
39
  const {
38
40
  attributes,
39
41
  children,
@@ -119,7 +121,7 @@ const GridItem = props => {
119
121
  xs: xsHidden ? "none" : "flex"
120
122
  },
121
123
  flexDirection: flexDirection || "column",
122
- background: bgColor || "transparent",
124
+ background: bgColor,
123
125
  borderColor: getBorderColor(),
124
126
  borderWidth: borderWidth || "1px",
125
127
  borderRadius: {
@@ -9,6 +9,7 @@ import { removeLink } from "../../utils/link";
9
9
  import LinkPopup from "./LinkPopup";
10
10
  import "./styles.css";
11
11
  import { absoluteLink } from "../../utils/helper";
12
+ import { useEditorContext } from "../../hooks/useMouseMove";
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
15
  const Link = props => {
@@ -29,6 +30,9 @@ const Link = props => {
29
30
  const path = ReactEditor.findPath(editor, element);
30
31
  const urlPath = element.url || element.href;
31
32
  const absLink = absoluteLink(urlPath);
33
+ const {
34
+ theme
35
+ } = useEditorContext();
32
36
  const updateLink = () => {
33
37
  Transforms.setNodes(editor, {
34
38
  href: linkData?.url,
@@ -107,7 +111,8 @@ const Link = props => {
107
111
  linkData: linkData,
108
112
  handleClose: handleClose,
109
113
  handleInputChange: handleInputChange,
110
- handleInsertLink: updateLink
114
+ handleInsertLink: updateLink,
115
+ theme: theme
111
116
  })]
112
117
  });
113
118
  };
@@ -9,7 +9,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
10
  const LinkButton = props => {
11
11
  const {
12
- editor
12
+ editor,
13
+ theme
13
14
  } = props;
14
15
  const linkInputRef = useRef(null);
15
16
  const [showInput, setShowInput] = useState(false);
@@ -77,7 +78,8 @@ const LinkButton = props => {
77
78
  linkData: linkData,
78
79
  handleClose: handleClose,
79
80
  handleInputChange: handleInputChange,
80
- handleInsertLink: handleInsertLink
81
+ handleInsertLink: handleInsertLink,
82
+ theme: theme
81
83
  })]
82
84
  });
83
85
  };
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { Dialog, DialogActions, DialogContent, DialogTitle, FormControl, FormControlLabel, Grid, TextField, Button, IconButton, Typography, Checkbox } from "@mui/material";
3
3
  import CloseIcon from "@mui/icons-material/Close";
4
+ import LinkPopupStyles from "./LinkPopupStyles";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
5
6
  import { jsxs as _jsxs } from "react/jsx-runtime";
6
7
  const LinkPopup = props => {
@@ -9,8 +10,10 @@ const LinkPopup = props => {
9
10
  handleClose,
10
11
  linkData,
11
12
  handleInputChange,
12
- handleInsertLink
13
+ handleInsertLink,
14
+ theme
13
15
  } = props;
16
+ const classes = LinkPopupStyles(theme);
14
17
  return /*#__PURE__*/_jsxs(Dialog, {
15
18
  fullWidth: true,
16
19
  open: open,
@@ -44,13 +47,16 @@ const LinkPopup = props => {
44
47
  style: {
45
48
  paddingTop: "12px"
46
49
  },
50
+ className: classes.titleTypo,
47
51
  children: /*#__PURE__*/_jsx(TextField, {
48
52
  size: "small",
49
53
  fullWidth: true,
50
54
  value: linkData?.name,
51
55
  name: "name",
52
56
  placeholder: "Link Title",
53
- onChange: handleInputChange
57
+ onChange: handleInputChange,
58
+ sx: classes.addLinkField,
59
+ className: classes.addLinkField
54
60
  })
55
61
  }), /*#__PURE__*/_jsx(Grid, {
56
62
  item: true,
@@ -64,7 +70,9 @@ const LinkPopup = props => {
64
70
  name: "url",
65
71
  value: linkData?.url,
66
72
  placeholder: "https://google.com",
67
- onChange: handleInputChange
73
+ onChange: handleInputChange,
74
+ sx: classes.addLinkField,
75
+ className: classes.addLinkField
68
76
  })
69
77
  }), /*#__PURE__*/_jsx(Grid, {
70
78
  item: true,
@@ -0,0 +1,28 @@
1
+ const LinkPopupStyles = theme => ({
2
+ addLinkField: {
3
+ "& .MuiOutlinedInput-input": {
4
+ fontSize: "12px",
5
+ fontWeight: 500,
6
+ color: `${theme?.palette?.editor?.textColor} !important`
7
+ },
8
+ "& .MuiFormHelperText-root": {
9
+ color: `${theme?.palette?.editor?.textColor} !important`
10
+ },
11
+ "& .MuiOutlinedInput-root": {
12
+ boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.16)",
13
+ color: `${theme?.palette?.editor?.textColor} !important`,
14
+ borderRadius: "7px",
15
+ "& fieldset": {
16
+ borderColor: "#D8DDE1"
17
+ },
18
+ "&:hover fieldset": {
19
+ borderColor: "#64748B"
20
+ },
21
+ "&.Mui-focused fieldset": {
22
+ borderColor: "#2563EB"
23
+ },
24
+ "& .MuiFormLabel-root": {}
25
+ }
26
+ }
27
+ });
28
+ export default LinkPopupStyles;
@@ -117,7 +117,7 @@ const TableCell = props => {
117
117
  className: `editor-table-cell ${hasSelected ? "selection" : ""}`,
118
118
  style: {
119
119
  position: "relative",
120
- backgroundColor: bgColor || entireBgColor,
120
+ background: bgColor || entireBgColor,
121
121
  border: `3px solid ${cellBorderColor}`,
122
122
  ...(sizeProps || {})
123
123
  },
@@ -23,7 +23,8 @@ const MiniEditor = props => {
23
23
  miniEditorPlaceholder,
24
24
  className,
25
25
  otherProps,
26
- onSave
26
+ onSave,
27
+ theme
27
28
  } = props;
28
29
  const {
29
30
  CHARACTERS = []
@@ -132,6 +133,7 @@ const MiniEditor = props => {
132
133
  editor: editor,
133
134
  initialValue: content,
134
135
  onChange: onChange,
136
+ theme: theme,
135
137
  children: [/*#__PURE__*/_jsx(BasicToolbar, {
136
138
  ...props
137
139
  }), /*#__PURE__*/_jsx(Editable, {
@@ -25,7 +25,8 @@ const BasicToolbar = props => {
25
25
  hideTextColor = false,
26
26
  hideResetIcon = true,
27
27
  onResetClick = () => {}
28
- }
28
+ },
29
+ theme
29
30
  } = props;
30
31
  // state
31
32
  const [activeColor, setActiveColor] = useState("#000000");
@@ -65,7 +66,8 @@ const BasicToolbar = props => {
65
66
  item: true,
66
67
  children: /*#__PURE__*/_jsx(LinkButton, {
67
68
  active: isBlockActive(editor, link.format),
68
- editor: editor
69
+ editor: editor,
70
+ theme: theme
69
71
  }, link.id)
70
72
  }), !hideTextColor && /*#__PURE__*/_jsx(Grid, {
71
73
  item: true,