@flozy/editor 1.9.4 → 1.9.6

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 (41) hide show
  1. package/dist/Editor/CommonEditor.js +15 -12
  2. package/dist/Editor/Editor.css +0 -6
  3. package/dist/Editor/Elements/Attachments/Attachments.js +9 -2
  4. package/dist/Editor/Elements/Button/EditorButton.js +4 -3
  5. package/dist/Editor/Elements/Color Picker/ColorButtons.js +3 -0
  6. package/dist/Editor/Elements/Color Picker/ColorPicker.js +6 -1
  7. package/dist/Editor/Elements/Color Picker/Styles.js +9 -4
  8. package/dist/Editor/Elements/Embed/Video.js +1 -0
  9. package/dist/Editor/Elements/Form/Workflow/FormWorkflow.js +2 -3
  10. package/dist/Editor/Elements/Form/Workflow/Styles.js +19 -1
  11. package/dist/Editor/Elements/Form/Workflow/UserInputs.js +6 -2
  12. package/dist/Editor/Elements/Form/Workflow/index.js +8 -2
  13. package/dist/Editor/Elements/Link/Link.js +6 -5
  14. package/dist/Editor/Elements/SimpleText.js +5 -1
  15. package/dist/Editor/Styles/EditorStyles.js +11 -2
  16. package/dist/Editor/Toolbar/FormatTools/Dropdown.js +6 -1
  17. package/dist/Editor/Toolbar/FormatTools/TextSize.js +2 -0
  18. package/dist/Editor/Toolbar/Mini/MiniToolbar.js +5 -4
  19. package/dist/Editor/Toolbar/Mini/Styles.js +15 -1
  20. package/dist/Editor/Toolbar/PopupTool/PopperHeader.js +1 -0
  21. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +113 -9
  22. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +3 -0
  23. package/dist/Editor/Toolbar/PopupTool/index.js +4 -1
  24. package/dist/Editor/common/ColorPickerButton.js +6 -8
  25. package/dist/Editor/common/ImageSelector/ImageSelector.js +6 -5
  26. package/dist/Editor/common/ImageSelector/Styles.js +59 -45
  27. package/dist/Editor/common/ImageSelector/UploadStyles.js +10 -10
  28. package/dist/Editor/common/MentionsPopup/Styles.js +16 -7
  29. package/dist/Editor/common/MentionsPopup/index.js +5 -4
  30. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +5 -1
  31. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +6 -4
  32. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +6 -3
  33. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +3 -1
  34. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +3 -1
  35. package/dist/Editor/common/StyleBuilder/index.js +14 -4
  36. package/dist/Editor/common/iconslist.js +0 -2
  37. package/dist/Editor/commonStyle.js +50 -6
  38. package/dist/Editor/helper/index.js +30 -8
  39. package/dist/Editor/hooks/useMouseMove.js +3 -1
  40. package/dist/Editor/utils/draftToSlate.js +3 -1
  41. package/package.json +1 -1
@@ -75,7 +75,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
75
75
  readOnly,
76
76
  toolbarOptions,
77
77
  otherProps,
78
- isIframe
78
+ isIframe,
79
+ theme
79
80
  } = props;
80
81
  const editorWrapper = useRef();
81
82
  const mentionsRef = useRef();
@@ -130,7 +131,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
130
131
  };
131
132
  const classes = editorStyles({
132
133
  padHeight: !fullScreen ? otherProps?.padHeight : 120,
133
- placeHolderColor: invertColor(pageColor || "#FFF")
134
+ placeHolderColor: invertColor(pageColor || "#FFF"),
135
+ theme
134
136
  });
135
137
  const isListItem = useElement(editor, ["list-item", "check-list-item", "accordion-summary"]);
136
138
  useEffect(() => {
@@ -228,7 +230,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
228
230
  });
229
231
  },
230
232
  getPageSettings: {
231
- background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || "#fff"
233
+ background: pageBgImage && pageBgImage !== "none" ? `url(${pageBgImage})` : pageColor || ""
232
234
  }
233
235
  }));
234
236
  const [htmlAction, setHtmlAction] = useState({
@@ -339,6 +341,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
339
341
  }) : null;
340
342
  };
341
343
  return /*#__PURE__*/_jsx(EditorProvider, {
344
+ theme: theme,
342
345
  children: /*#__PURE__*/_jsx(DialogWrapper, {
343
346
  ...props,
344
347
  fullScreen: fullScreen,
@@ -357,21 +360,18 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
357
360
  children: [/*#__PURE__*/_jsx(DragAndDrop, {
358
361
  children: /*#__PURE__*/_jsx(Overlay, {
359
362
  children: /*#__PURE__*/_jsx(Box, {
360
- className: `${hasTopBanner() ? "has-topbanner" : ""}`,
363
+ className: `${hasTopBanner() ? "has-topbanner" : ""} ${!pageColor ? "no-color" : ""}`,
361
364
  sx: classes.slateWrapper,
362
365
  id: "slate-wrapper-scroll-container",
363
366
  style: {
364
- background: pageColor || "#FFF"
367
+ background: pageColor || "",
368
+ color: pageTextColor || ""
365
369
  },
366
370
  children: /*#__PURE__*/_jsxs(Box, {
367
371
  component: "div",
368
372
  className: "max-content",
369
373
  children: [renderTopBanner(), /*#__PURE__*/_jsx("div", {
370
374
  className: "scroll-area",
371
- style: {
372
- // background: pageColor || "#FFF",
373
- color: pageTextColor || "#000000"
374
- },
375
375
  children: /*#__PURE__*/_jsxs(Box, {
376
376
  component: "div",
377
377
  ref: editorWrapper,
@@ -390,7 +390,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
390
390
  maxWidth: pageMaxWidth ? `${parseInt(pageMaxWidth)}px !important` : "auto"
391
391
  },
392
392
  children: [!readOnly ? /*#__PURE__*/_jsx(PopupTool, {
393
- onDrawerOpen: onDrawerOpen
393
+ onDrawerOpen: onDrawerOpen,
394
+ theme: theme
394
395
  }) : null, /*#__PURE__*/_jsx(Editable, {
395
396
  className: "innert-editor-textbox",
396
397
  readOnly: isReadOnly,
@@ -406,12 +407,14 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
406
407
  target: target,
407
408
  index: index,
408
409
  chars: chars,
409
- type: type
410
+ type: type,
411
+ theme: theme
410
412
  }) : null]
411
413
  })
412
414
  }), !readOnly ? /*#__PURE__*/_jsx(MiniToolbar, {
413
415
  customProps: customProps,
414
- toolbarOptions: toolbarOptions
416
+ toolbarOptions: toolbarOptions,
417
+ theme: theme
415
418
  }) : null, footer && /*#__PURE__*/_jsx(Typography, {
416
419
  sx: {
417
420
  color: "rgb(100, 116, 139)",
@@ -1,6 +1,5 @@
1
1
  .editor-wrapper {
2
2
  font-family: "Inter", sans-serif;
3
- color: #0f172a;
4
3
  line-height: 1.43;
5
4
  font-weight: 400;
6
5
  letter-spacing: 0.01071em;
@@ -248,7 +247,6 @@ blockquote {
248
247
  }
249
248
 
250
249
  .close-popupbtn {
251
- background-color: #f8fafc !important;
252
250
  border-radius: 4px !important;
253
251
  width: 24px;
254
252
  height: 24px;
@@ -779,10 +777,6 @@ blockquote {
779
777
  font-weight: 500;
780
778
  }
781
779
 
782
- .dialogComp .MuiOutlinedInput-notchedOutline {
783
- border: 1px solid #ececec;
784
- }
785
-
786
780
  .iconRadioButton .MuiRadio-root {
787
781
  visibility: hidden;
788
782
  width: 0px;
@@ -4,6 +4,8 @@ import PictureAsPdfIcon from "@mui/icons-material/PictureAsPdf";
4
4
  import TextSnippetIcon from "@mui/icons-material/TextSnippet";
5
5
  import { formatDate } from "../../utils/helper";
6
6
  import Icon from "../../common/Icon";
7
+ import { getEmbedURL } from "../../helper";
8
+ import Video from "../Embed/Video";
7
9
  import { jsx as _jsx } from "react/jsx-runtime";
8
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
11
  const Attachments = props => {
@@ -17,15 +19,18 @@ const Attachments = props => {
17
19
  type,
18
20
  date
19
21
  } = element;
22
+ const {
23
+ isEmbed
24
+ } = getEmbedURL(element, true);
20
25
  const getLastName = url?.split("/").pop();
21
26
  const fileName = `${decodeURIComponent(getLastName)}`;
22
- return /*#__PURE__*/_jsxs(Box, {
27
+ return !isEmbed ? /*#__PURE__*/_jsxs(Box, {
23
28
  component: "div",
24
29
  className: "attachment-wrpr-ev2",
25
30
  ...attributes,
26
31
  contentEditable: false,
27
32
  style: {
28
- display: "inline-flex"
33
+ display: "block"
29
34
  },
30
35
  children: [/*#__PURE__*/_jsxs(Card, {
31
36
  style: {
@@ -95,6 +100,8 @@ const Attachments = props => {
95
100
  contentEditable: false,
96
101
  children: children
97
102
  })]
103
+ }) : /*#__PURE__*/_jsx(Video, {
104
+ ...props
98
105
  });
99
106
  };
100
107
  export default Attachments;
@@ -43,7 +43,8 @@ const EditorButton = props => {
43
43
  iconPosition = "start",
44
44
  borderStyle,
45
45
  borderWidth,
46
- borderColor
46
+ borderColor,
47
+ alignment
47
48
  } = element;
48
49
  const {
49
50
  linkType,
@@ -145,7 +146,7 @@ const EditorButton = props => {
145
146
  className: "editor-btn-wrapper",
146
147
  ...attributes,
147
148
  style: {
148
- textAlign: textAlign || "left"
149
+ textAlign: alignment || textAlign || "left"
149
150
  },
150
151
  contentEditable: false,
151
152
  children: [/*#__PURE__*/_jsx("div", {
@@ -201,7 +202,7 @@ const EditorButton = props => {
201
202
  }), /*#__PURE__*/_jsx("div", {
202
203
  contentEditable: false,
203
204
  style: {
204
- display: "inline"
205
+ display: "none"
205
206
  },
206
207
  children: children
207
208
  }), edit && /*#__PURE__*/_jsx(ButtonPopup, {
@@ -72,6 +72,7 @@ export const AllColors = props => {
72
72
  horizontal: "center"
73
73
  },
74
74
  onClose: onClose,
75
+ sx: classes.colorPopper,
75
76
  children: /*#__PURE__*/_jsx(Box, {
76
77
  component: "div",
77
78
  sx: classes.allColor,
@@ -145,6 +146,8 @@ const ColorButtons = props => {
145
146
  vertical: "top",
146
147
  horizontal: "right"
147
148
  },
149
+ sx: classes.colorPopper,
150
+ className: "colorPopper",
148
151
  children: /*#__PURE__*/_jsx(Box, {
149
152
  sx: classes.colorButtonsInner,
150
153
  children: restRows.map((m, i) => {
@@ -8,6 +8,7 @@ import ColorButtons from "./ColorButtons";
8
8
  import ColorPickerStyles from "./Styles";
9
9
  import colorWheel from "./colorWheel.png";
10
10
  import "./ColorPicker.css";
11
+ import { useEditorContext } from "../../hooks/useMouseMove";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  import { Fragment as _Fragment } from "react/jsx-runtime";
13
14
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -23,10 +24,13 @@ const ColorPicker = ({
23
24
  title,
24
25
  classes
25
26
  }) => {
27
+ const {
28
+ theme
29
+ } = useEditorContext();
26
30
  const [selection, setSelection] = useState();
27
31
  const [anchorEl, setAnchorEl] = useState(null);
28
32
  const open = Boolean(anchorEl);
29
- const pickerStyles = ColorPickerStyles();
33
+ const pickerStyles = ColorPickerStyles(theme);
30
34
  const onOpen = e => {
31
35
  e.preventDefault();
32
36
  setAnchorEl(e.currentTarget);
@@ -82,6 +86,7 @@ const ColorPicker = ({
82
86
  vertical: "bottom",
83
87
  horizontal: "top"
84
88
  },
89
+ sx: classes.colorPickerPopup,
85
90
  children: /*#__PURE__*/_jsx(ColorPickerTool, {
86
91
  gradient: true,
87
92
  value: activeColor,
@@ -1,4 +1,4 @@
1
- const ColorPickerStyles = () => ({
1
+ const ColorPickerStyles = theme => ({
2
2
  colorButtons: {
3
3
  padding: "0px",
4
4
  "& .buttonsWrpr": {
@@ -12,6 +12,11 @@ const ColorPickerStyles = () => ({
12
12
  border: "1px solid #ccc"
13
13
  }
14
14
  },
15
+ colorPopper: {
16
+ "& .MuiPaper-root": {
17
+ backgroundColor: theme?.palette?.editor?.background
18
+ }
19
+ },
15
20
  colorButtonSingle: {
16
21
  "&.active": {
17
22
  "&:before": {
@@ -49,9 +54,9 @@ const ColorPickerStyles = () => ({
49
54
  }
50
55
  },
51
56
  colorPickerIcon: {
52
- '& img': {
53
- width: '24px',
54
- height: '24px'
57
+ "& img": {
58
+ width: "24px",
59
+ height: "24px"
55
60
  }
56
61
  }
57
62
  });
@@ -155,6 +155,7 @@ const Video = ({
155
155
  className: "embed has-hover video",
156
156
  style: {
157
157
  display: "flex",
158
+ flexDirection: "column",
158
159
  width: `100%`,
159
160
  justifyContent: horizantal,
160
161
  alignContent: vertical
@@ -1,6 +1,5 @@
1
1
  import React, { useState } from "react";
2
2
  import { Grid, Radio, RadioGroup, Typography, FormControlLabel, Select, MenuItem, FormControl, TextField, Button, Menu } from "@mui/material";
3
- import FormStyles from "./Styles";
4
3
  import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
5
4
  import UserInputs from "./UserInputs";
6
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -21,9 +20,9 @@ const FormWorkflow = props => {
21
20
  bodyData,
22
21
  setBodyData,
23
22
  handleSelectedVariables,
24
- handleInputReset
23
+ handleInputReset,
24
+ classes
25
25
  } = props;
26
- const classes = FormStyles();
27
26
  const [anchorEl, setAnchorEl] = useState(null);
28
27
  const variables = element?.children;
29
28
  const type = 1;
@@ -1,4 +1,4 @@
1
- const FormStyles = () => ({
1
+ const FormStyles = theme => ({
2
2
  addButton: {
3
3
  display: "flex",
4
4
  justifyContent: "flex-end"
@@ -224,6 +224,24 @@ const FormStyles = () => ({
224
224
  color: "#fff",
225
225
  padding: "8px",
226
226
  marginLeft: "8px"
227
+ },
228
+ formWorkflow: {
229
+ "& .MuiPaper-root": {
230
+ backgroundColor: theme?.palette?.editor?.background
231
+ },
232
+ "& .MuiTypography-root": {
233
+ color: theme?.palette?.editor?.textColor
234
+ },
235
+ "& svg": {
236
+ color: theme?.palette?.editor?.activeColor
237
+ },
238
+ "& input": {
239
+ color: theme?.palette?.editor?.textColor
240
+ },
241
+ "& textarea": {
242
+ backgroundColor: theme?.palette?.editor?.background,
243
+ color: theme?.palette?.editor?.textColor
244
+ }
227
245
  }
228
246
  });
229
247
  export default FormStyles;
@@ -6,6 +6,7 @@ import { RestRight } from "../../../common/iconslist";
6
6
  import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
7
7
  import { AllColors } from "../../Color Picker/ColorButtons";
8
8
  import PopupToolStyle from "../../../Toolbar/PopupTool/PopupToolStyle";
9
+ import { useEditorContext } from "../../../hooks/useMouseMove";
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
12
  const UserInputs = props => {
@@ -18,8 +19,11 @@ const UserInputs = props => {
18
19
  handleInputReset
19
20
  } = props;
20
21
  const variables = element?.children;
21
- const classes = FormStyles();
22
- const popupClasses = PopupToolStyle();
22
+ const {
23
+ theme
24
+ } = useEditorContext();
25
+ const classes = FormStyles(theme);
26
+ const popupClasses = PopupToolStyle(theme);
23
27
  const [activeColor, setActiveColor] = useState(["#000000"]);
24
28
  //state
25
29
  const [anchorEl, setAnchorEl] = useState(null);
@@ -8,6 +8,7 @@ import FormWorkflow from "./FormWorkflow";
8
8
  import { minutes, hours, days } from "./constant";
9
9
  import ListWorkflow from "./ListWorkflow";
10
10
  import { PlusIcon } from "../../../common/iconslist";
11
+ import { useEditorContext } from "../../../hooks/useMouseMove";
11
12
  import { jsx as _jsx } from "react/jsx-runtime";
12
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
13
14
  const Workflow = props => {
@@ -20,7 +21,10 @@ const Workflow = props => {
20
21
  const {
21
22
  workflow
22
23
  } = element;
23
- const classes = FormStyles();
24
+ const {
25
+ theme
26
+ } = useEditorContext();
27
+ const classes = FormStyles(theme);
24
28
  const [workflowList, setWorkflowList] = useState([]);
25
29
  const [formData, setFormData] = useState(false);
26
30
  const [schedule, setSchedule] = useState("immediately");
@@ -111,6 +115,7 @@ const Workflow = props => {
111
115
  }
112
116
  };
113
117
  return /*#__PURE__*/_jsxs(Dialog, {
118
+ sx: classes?.formWorkflow,
114
119
  open: openWorkflow,
115
120
  onClose: closeWorkflow,
116
121
  fullWidth: true,
@@ -155,7 +160,8 @@ const Workflow = props => {
155
160
  setScheduleEvery: setScheduleEvery,
156
161
  setScheduleOn: setScheduleOn,
157
162
  handleSelectedVariables: handleSelectedVariables,
158
- handleInputReset: handleInputReset
163
+ handleInputReset: handleInputReset,
164
+ classes: classes
159
165
  })]
160
166
  }), /*#__PURE__*/_jsxs(DialogActions, {
161
167
  sx: classes.dialogFooter,
@@ -11,11 +11,12 @@ import "./styles.css";
11
11
  import { absoluteLink } from "../../utils/helper";
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { jsxs as _jsxs } from "react/jsx-runtime";
14
- const Link = ({
15
- attributes,
16
- element,
17
- children
18
- }) => {
14
+ const Link = props => {
15
+ const {
16
+ attributes,
17
+ element,
18
+ children
19
+ } = props;
19
20
  const editor = useSlateStatic();
20
21
  const selected = useSelected();
21
22
  const focused = useFocused();
@@ -4,6 +4,7 @@ import { Box } from "@mui/material";
4
4
  import { getPageSettings } from "../utils/pageSettings";
5
5
  import { invertColor } from "../helper";
6
6
  import { isTextSelected } from "../utils/helper";
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 SimpleTextStyle = ({
@@ -45,6 +46,9 @@ const SimpleTextStyle = ({
45
46
  }
46
47
  });
47
48
  const SimpleText = props => {
49
+ const {
50
+ theme
51
+ } = useEditorContext();
48
52
  const editor = useSlateStatic();
49
53
  const {
50
54
  element,
@@ -64,7 +68,7 @@ const SimpleText = props => {
64
68
  pageColor
65
69
  } = pageSt?.pageProps || {};
66
70
  const classes = SimpleTextStyle({
67
- pageColor: pageColor || "rgba(255,255,255,1)"
71
+ pageColor: pageColor || theme?.palette?.editor?.background
68
72
  });
69
73
  const selected = useSelected();
70
74
  const path = ReactEditor.findPath(editor, element);
@@ -1,6 +1,7 @@
1
1
  const editorStyles = ({
2
2
  padHeight,
3
- placeHolderColor
3
+ placeHolderColor,
4
+ theme
4
5
  }) => ({
5
6
  root: {
6
7
  display: "flex",
@@ -26,6 +27,11 @@ const editorStyles = ({
26
27
  display: "flex",
27
28
  flexDirection: "column",
28
29
  alignItems: "center",
30
+ color: "#0f172a",
31
+ "&.no-color": {
32
+ backgroundColor: theme?.palette?.editor?.background,
33
+ color: theme?.palette?.editor?.textColor
34
+ },
29
35
  "& .max-content": {
30
36
  width: "100%",
31
37
  display: "flex",
@@ -171,7 +177,10 @@ const editorStyles = ({
171
177
  }
172
178
  },
173
179
  "& .tools-drawer": {
174
- zIndex: 1300
180
+ zIndex: 1300,
181
+ "& .MuiDrawer-paper": {
182
+ backgroundColor: theme?.palette?.editor?.background
183
+ }
175
184
  },
176
185
  "& .section-tw": {
177
186
  "& button": {
@@ -4,6 +4,7 @@ import { addMarkData, activeMark } from "../../utils/SlateUtilityFunctions.js";
4
4
  import { fontFamilyMap } from "../../utils/font";
5
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
6
  const Dropdown = ({
7
+ classes,
7
8
  editor,
8
9
  format,
9
10
  options,
@@ -26,10 +27,14 @@ const Dropdown = ({
26
27
  fontFamily: fontFamilyMap[value],
27
28
  width: width || "100%",
28
29
  height: "36px",
29
- overflow: "hidden",
30
30
  borderRadius: "10px",
31
31
  fontSize: "14px"
32
32
  },
33
+ MenuProps: {
34
+ PaperProps: {
35
+ sx: classes?.textOptions
36
+ }
37
+ },
33
38
  children: options.map((item, index) => /*#__PURE__*/_jsx(MenuItem, {
34
39
  style: {
35
40
  fontFamily: item.text
@@ -10,6 +10,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
11
11
  import { Fragment as _Fragment } from "react/jsx-runtime";
12
12
  const TextSize = ({
13
+ classes,
13
14
  editor,
14
15
  format,
15
16
  fullWidth
@@ -63,6 +64,7 @@ const TextSize = ({
63
64
  };
64
65
  return /*#__PURE__*/_jsx(_Fragment, {
65
66
  children: /*#__PURE__*/_jsx(TextField, {
67
+ sx: classes?.textSize,
66
68
  value: combinedOldVal,
67
69
  onChange: onChangeSize,
68
70
  size: "small",
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import { useSlate } from "slate-react";
3
- import { Box, Dialog, IconButton, Paper, Popper, Tooltip } from "@mui/material";
3
+ import { Box, Dialog, IconButton, Paper, Popper, Tooltip, useTheme } from "@mui/material";
4
4
  import MENU_OPTIONS from "./Options/Options";
5
5
  import TextFormat from "../PopupTool/TextFormat";
6
6
  import AddElements from "../PopupTool/AddElements";
@@ -27,10 +27,11 @@ const POPUP_TITLE = {
27
27
  };
28
28
  const MiniToolbar = props => {
29
29
  const {
30
- customProps
30
+ customProps,
31
+ theme
31
32
  } = props;
32
- const classes = miniToolbarStyles();
33
- const popupStyles = usePopupStyle();
33
+ const classes = miniToolbarStyles(theme);
34
+ const popupStyles = usePopupStyle(theme);
34
35
  const editor = useSlate();
35
36
  const [popper, setPopper] = useState(null);
36
37
  const [anchorEl, setAnchorEl] = useState(null);
@@ -1,4 +1,4 @@
1
- const miniToolbarStyles = () => ({
1
+ const miniToolbarStyles = theme => ({
2
2
  root: {
3
3
  display: "flex",
4
4
  flexDirection: "row",
@@ -26,6 +26,20 @@ const miniToolbarStyles = () => ({
26
26
  stroke: "#2563EB"
27
27
  }
28
28
  }
29
+ },
30
+ "&.mini-tool-wrpr-ei": {
31
+ background: theme?.palette?.editor?.background,
32
+ borderColor: theme?.palette?.editor?.borderColor,
33
+ "& button": {
34
+ "& svg": {
35
+ stroke: theme?.palette?.editor?.textColor
36
+ },
37
+ "&.active": {
38
+ "& svg": {
39
+ stroke: theme?.palette?.editor?.activeColor
40
+ }
41
+ }
42
+ }
29
43
  }
30
44
  }
31
45
  });
@@ -80,6 +80,7 @@ const PopperHeader = props => {
80
80
  title: "Close",
81
81
  arrow: true,
82
82
  children: /*#__PURE__*/_jsx(IconButton, {
83
+ sx: classes.closeBtn,
83
84
  className: "close-popupbtn",
84
85
  onClick: onClose,
85
86
  children: /*#__PURE__*/_jsx(CloseIcon, {})