@flozy/editor 9.2.1 → 9.2.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.
@@ -1280,8 +1280,8 @@ blockquote {
1280
1280
  }
1281
1281
  @media (max-width: 899px) {
1282
1282
  /* Qa validation required */
1283
- /* .MuiPopover-root {
1284
- z-index: 1302 !important;
1283
+ /* .MuiPopover-root {
1284
+ z-index: 1302 !important;
1285
1285
  } */
1286
1286
 
1287
1287
  canvas {
@@ -5,7 +5,7 @@ import { Box } from "@mui/material";
5
5
  import { isTextSelected } from "../../utils/helper";
6
6
  import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import SimpleTextStyle from "./style";
8
- // import { getBreakpointLineSpacing } from "../../helper/theme";
8
+ import { getBreakpointLineSpacing } from "../../helper/theme";
9
9
  import { jsx as _jsx } from "react/jsx-runtime";
10
10
  import { Fragment as _Fragment } from "react/jsx-runtime";
11
11
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -33,14 +33,17 @@ const TextFormat = props => {
33
33
  const [anchorEl, setAnchorEl] = useState(null);
34
34
  const [type, setType] = useState(null);
35
35
  const open = Boolean(anchorEl);
36
-
37
- // const { element: pageSt } = getPageSettings(editor) || {};
36
+ const {
37
+ element: pageSt
38
+ } = getPageSettings(editor) || {};
38
39
  // const pageSettingLine = pageSt?.pageProps?.lineHeight;
39
40
  const {
40
41
  fontFamilies,
41
42
  theme
42
43
  } = useEditorContext();
43
- // const { activeBreakPoint } = useEditorContext();
44
+ const {
45
+ activeBreakPoint
46
+ } = useEditorContext();
44
47
  // const breakpoint = activeBreakPoint === "" ? "lg" : activeBreakPoint;
45
48
  const fontWeight = allTools.find(f => f.format === "fontWeight");
46
49
  const fontStyle = allTools.filter(f => f.type === "mark" && f.format !== "strikethrough" && f.format !== "superscript" && f.format !== "subscript");
@@ -14,6 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  const PopupTool = props => {
15
15
  const {
16
16
  theme,
17
+ setIsTextSelected,
17
18
  customProps,
18
19
  editorWrapper
19
20
  } = props;
@@ -34,9 +35,6 @@ const PopupTool = props => {
34
35
  const [size] = useWindowResize();
35
36
  const updateAnchorEl = isScroll => {
36
37
  try {
37
- const {
38
- selection
39
- } = editor;
40
38
  const isHavingSelection = selection && !Range.isCollapsed(selection);
41
39
  if (isHavingSelection && event === "end") {
42
40
  const domRange = ReactEditor.toDOMRange(editor, editor.selection);
@@ -76,16 +74,15 @@ const PopupTool = props => {
76
74
  if (!isCarouselEdit) {
77
75
  setOpen(true);
78
76
  setPopupType("textFormat");
79
- // setIsTextSelected(true);
77
+ setIsTextSelected(true);
80
78
  }
81
79
  } else if (!anchorEl) {
82
80
  setOpen(false);
83
81
  setPopupType("");
84
- // setIsTextSelected(false);
82
+ setIsTextSelected(false);
85
83
  }
86
84
  }, [event, anchorEl]);
87
85
  useEffect(() => {
88
- console.log("Editor useEffect", selection);
89
86
  const {
90
87
  path,
91
88
  enable
@@ -95,20 +92,17 @@ const PopupTool = props => {
95
92
  if (!selection || Range.isCollapsed(selection) || Editor.string(editor, selection) === "" || isFreeGridEnabled) {
96
93
  setAnchorEl(null);
97
94
  } else {
98
- console.log("Editor updateAnchorEl", selection);
99
95
  updateAnchorEl();
100
96
  hideSlateSelection(); // removes slate selection background, when there is no selection
101
97
  }
102
98
  }, [selection, event, selectedElement?.enable]);
103
99
  const handleClose = () => {
104
- console.log("Editor closing");
105
100
  // setAnchorEl(null);
106
101
  setOpen(false);
107
102
  setPopupType("");
108
103
  };
109
104
  return open && !openAI ? /*#__PURE__*/_jsx(ClickAwayListener, {
110
105
  onClickAway: e => {
111
- console.log("ClickAwayListener", e.target, document.body, e.target !== document.body);
112
106
  // close the mini toolbar, if user clicks outside the editor (in Flozy app.)
113
107
  if (e.target !== document.body) {
114
108
  // 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
@@ -19,7 +19,7 @@ const Upload = props => {
19
19
  xs: 12,
20
20
  sx: {
21
21
  padding: "10px",
22
- height: "100%"
22
+ height: '100%'
23
23
  },
24
24
  className: "ims-right",
25
25
  children: /*#__PURE__*/_jsx(Uploader, {
@@ -5,9 +5,9 @@ const UploadStyles = theme => ({
5
5
  borderRadius: "11px",
6
6
  boxShadow: "0px 4px 10px rgba(0, 0, 0, 0.16)",
7
7
  background: theme?.palette?.editor?.uploadFileBg,
8
- height: "100%",
9
- minHeight: "150px",
10
- height: "inherit"
8
+ height: '100%',
9
+ minHeight: '150px',
10
+ height: 'inherit'
11
11
  },
12
12
  uploadField: {
13
13
  width: "100%",
@@ -19,21 +19,21 @@ const UploadStyles = theme => ({
19
19
  backgroundColor: theme?.palette?.editor?.uploadFileInnerBg,
20
20
  borderRadius: "9px",
21
21
  border: "1px dashed #2563EB",
22
- minHeight: "150px"
22
+ minHeight: '150px'
23
23
  },
24
24
  uploadIcon: {
25
25
  display: "grid !important",
26
26
  "& svg": {
27
- display: "flex",
28
- width: "100%",
27
+ display: 'flex',
28
+ width: '100%',
29
29
  "& path": {
30
30
  stroke: "#2563EB"
31
31
  }
32
32
  },
33
- "& span": {
34
- display: "flex",
35
- width: "100%",
36
- marginTop: "5px"
33
+ '& span': {
34
+ display: 'flex',
35
+ width: '100%',
36
+ marginTop: '5px'
37
37
  }
38
38
  }
39
39
  });
@@ -58,7 +58,6 @@ const useElementSettingsStyle = theme => ({
58
58
  maxHeight: "500px",
59
59
  overflowX: "hidden",
60
60
  overflowY: "auto",
61
- paddingLeft: "4px",
62
61
  background: theme?.palette?.editor?.background,
63
62
  paddingLeft: "4px",
64
63
  "& .MuiTypography-root, .MuiInputBase-root, input": {
@@ -1,4 +1,4 @@
1
- import { useCallback, useEffect, useState } from "react";
1
+ import { useEffect, useState } from "react";
2
2
  const useDrag = () => {
3
3
  const [event, setEvent] = useState("");
4
4
  useEffect(() => {
@@ -5,7 +5,6 @@ function useEditorScroll(editorWrapper = {
5
5
  useEffect(() => {
6
6
  if (!editorWrapper?.current) return;
7
7
  const handleScroll = () => {
8
- console.log("Editor debug useEditorScroll ====>", editorWrapper, callback);
9
8
  callback("scroll");
10
9
  };
11
10
  const currentEditorWrapper = editorWrapper.current;
@@ -149,7 +149,6 @@ const getFocusedNode = (editor, nodeType = "") => {
149
149
  console.log(err);
150
150
  }
151
151
  };
152
- const voidTypes = ["image", "page-settings"];
153
152
  const withHtml = editor => {
154
153
  const {
155
154
  insertData,
@@ -160,7 +159,7 @@ const withHtml = editor => {
160
159
  return element.type === "link" ? true : isInline(element);
161
160
  };
162
161
  editor.isVoid = element => {
163
- return voidTypes.includes(element.type) ? true : isVoid(element);
162
+ return element.type === "image" ? true : isVoid(element);
164
163
  };
165
164
  editor.insertData = data => {
166
165
  const slateHTML = data?.getData("application/x-slate-fragment");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "9.2.1",
3
+ "version": "9.2.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"
@@ -61,7 +61,7 @@
61
61
  "scripts": {
62
62
  "prepare": "husky install .husky",
63
63
  "analyze": "source-map-explorer build/static/js/*.js",
64
- "lint": "./node_modules/. bin/eslint --ignore-path .gitignore .",
64
+ "lint": "./node_modules/.bin/eslint --ignore-path .gitignore .",
65
65
  "start": "craco start",
66
66
  "build": "NODE_OPTIONS='--max_old_space_size=4096' craco build",
67
67
  "test": "craco test --passWithNoTests",