@flozy/editor 7.0.5 → 7.0.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.
@@ -54,14 +54,13 @@ const Item = /*#__PURE__*/forwardRef(({
54
54
  });
55
55
  });
56
56
  Item.displayName = "Item";
57
- const Element = /*#__PURE__*/React.memo(props => {
57
+ const Element = props => {
58
58
  return /*#__PURE__*/_jsx(Section, {
59
59
  ...props,
60
60
  children: getBlock(props)
61
61
  });
62
- });
63
- Element.displayName = "Element";
64
- const Leaf = /*#__PURE__*/React.memo(({
62
+ };
63
+ const Leaf = ({
65
64
  attributes,
66
65
  children,
67
66
  leaf
@@ -72,8 +71,7 @@ const Leaf = /*#__PURE__*/React.memo(({
72
71
  ...attributes,
73
72
  children: children
74
73
  });
75
- });
76
- Leaf.displayName = "Leaf";
74
+ };
77
75
  const updateTopBanner = (content = [], setTopBanner) => {
78
76
  setTopBanner(() => {
79
77
  const firstNode = content ? content[0] : {};
@@ -93,7 +91,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
93
91
  otherProps,
94
92
  isIframe,
95
93
  theme,
96
- showViewport = false
94
+ showViewport = false,
95
+ overrideWrapperStyles = {}
97
96
  } = props;
98
97
  const editorWrapper = useRef();
99
98
  const mentionsRef = useRef();
@@ -154,7 +153,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
154
153
  const classes = editorStyles({
155
154
  padHeight: !fullScreen ? otherProps?.padHeight : 20,
156
155
  placeHolderColor: invertColor(pageColor || "#FFF"),
157
- theme
156
+ theme,
157
+ overrideWrapperStyles
158
158
  });
159
159
  const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
160
160
  useEffect(() => {
@@ -314,7 +314,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
314
314
  updateTopBanner(newValue, setTopBanner);
315
315
  debounced(newValue);
316
316
  if (!isInteracted) {
317
- // setIsInteracted(true);
317
+ setIsInteracted(true);
318
318
  }
319
319
  }
320
320
  };
@@ -495,7 +495,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
495
495
  ...props,
496
496
  fullScreen: fullScreen,
497
497
  footer: footer || "",
498
- children: /*#__PURE__*/_jsxs(Box, {
498
+ children: /*#__PURE__*/_jsx(Box, {
499
499
  component: "div",
500
500
  className: `et-wrpr stimulate-${breakpoint} ${editorClass || ""} ${isIframe ? "iframe-editor" : ""}`,
501
501
  sx: classes.root,
@@ -505,7 +505,7 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
505
505
  "data-breakpoint": breakpoint
506
506
  // onContextMenu={handleContextMenu}
507
507
  ,
508
- children: [/*#__PURE__*/_jsxs(Slate, {
508
+ children: /*#__PURE__*/_jsxs(Slate, {
509
509
  editor: editor,
510
510
  initialValue: getInitialValue(debouncedValue?.current, readOnly),
511
511
  onChange: handleEditorChange,
@@ -606,13 +606,10 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
606
606
  }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
607
607
  ...htmlAction,
608
608
  handleCodeToText: handleCodeToText
609
+ }), /*#__PURE__*/_jsx(FontLoader, {
610
+ ...props
609
611
  })]
610
- }, id), /*#__PURE__*/_jsx(FontLoader, {
611
- otherProps: {
612
- services: otherProps?.services
613
- },
614
- readOnly: readOnly
615
- })]
612
+ }, id)
616
613
  })
617
614
  })
618
615
  });
@@ -1279,9 +1279,10 @@ blockquote {
1279
1279
  background: none !important;
1280
1280
  }
1281
1281
  @media (max-width: 899px) {
1282
- .MuiPopover-root {
1282
+ /* Qa validation required */
1283
+ /* .MuiPopover-root {
1283
1284
  z-index: 1302 !important;
1284
- }
1285
+ } */
1285
1286
 
1286
1287
  canvas {
1287
1288
  max-width: 100% !important;
@@ -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,6 +12,7 @@ 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,
15
16
  openAI
16
17
  } = useEditorContext() || {};
17
18
  const editor = useSlateStatic();
@@ -27,15 +28,19 @@ const SimpleText = props => {
27
28
  readOnly,
28
29
  editorPlaceholder
29
30
  } = customProps;
30
- // const { element: pageSt } = getPageSettings(editor) || {};
31
- // const { pageColor } = pageSt?.pageProps || {};
31
+ const {
32
+ element: pageSt
33
+ } = getPageSettings(editor) || {};
34
+ const {
35
+ pageColor
36
+ } = pageSt?.pageProps || {};
32
37
  const {
33
38
  activeBreakPoint
34
39
  } = useEditorContext();
35
40
  const lineHeight = element?.children[0]?.lineHeight;
36
41
  const lineH = getBreakpointLineSpacing(lineHeight, activeBreakPoint);
37
42
  const classes = SimpleTextStyle({
38
- pageColor: "#FFFFFF",
43
+ pageColor: pageColor || theme?.palette?.editor?.background || "#FFFFFF",
39
44
  lineHeight: lineH
40
45
  });
41
46
  const selected = useSelected();
@@ -54,14 +59,14 @@ const SimpleText = props => {
54
59
  contentEditable: false,
55
60
  className: "placeholder-simple-text",
56
61
  children: isEmptyEditor ? editorPlaceholder || "Write Something..." : showPlaceHolder ? opacity && selected ? /*#__PURE__*/_jsxs(_Fragment, {
57
- children: ["Type", " ", /*#__PURE__*/_jsx("span", {
62
+ children: ["Type ", /*#__PURE__*/_jsx("span", {
58
63
  style: {
59
- backgroundColor: "#F2F6FA",
64
+ backgroundColor: '#F2F6FA',
60
65
  padding: "0px 2px",
61
66
  borderRadius: "2px"
62
67
  },
63
68
  children: "/"
64
- }), " ", "to browse elements"]
69
+ }), " to browse elements"]
65
70
  }) : "" : ""
66
71
  }));
67
72
  };