@flozy/editor 7.0.3 → 7.0.4

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.
@@ -91,7 +91,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
91
91
  otherProps,
92
92
  isIframe,
93
93
  theme,
94
- showViewport = false
94
+ showViewport = false,
95
+ overrideWrapperStyles = {}
95
96
  } = props;
96
97
  const editorWrapper = useRef();
97
98
  const mentionsRef = useRef();
@@ -152,7 +153,8 @@ const CommonEditor = /*#__PURE__*/forwardRef((props, ref) => {
152
153
  const classes = editorStyles({
153
154
  padHeight: !fullScreen ? otherProps?.padHeight : 20,
154
155
  placeHolderColor: invertColor(pageColor || "#FFF"),
155
- theme
156
+ theme,
157
+ overrideWrapperStyles
156
158
  });
157
159
  const isMobile = window.matchMedia("(max-width: 899px)")?.matches || false;
158
160
  useEffect(() => {
@@ -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,325 +1,329 @@
1
1
  const editorStyles = ({
2
2
  padHeight,
3
3
  placeHolderColor,
4
- theme
5
- }) => ({
6
- root: {
7
- display: "flex",
8
- position: "relative",
9
- padding: "0px",
10
- alignItems: "center",
11
- justifyContent: "center",
12
- "*": {
13
- boxSizing: "border-box"
14
- },
15
- "&.iframe-editor": {
16
- "& .mini-tool-wrpr-ei": {
17
- display: "none"
18
- }
19
- },
20
- "& .mobileMiniTextWrapper": {
21
- boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
22
- position: "fixed",
23
- bottom: "env(safe-area-inset-bottom)",
24
- left: 0,
25
- width: "100%",
26
- zIndex: 99999,
27
- backgroundColor: theme?.palette?.editor?.background || "#fff",
28
- color: theme?.palette?.editor?.textColor || "black",
29
- "& .MuiOutlinedInput-input": {
30
- color: theme?.palette?.editor?.textColor || "black"
31
- }
32
- },
33
- "&.stimulate-xs": {
34
- "& .scrollable-content": {
35
- width: "320px"
4
+ theme,
5
+ overrideWrapperStyles = {}
6
+ }) => {
7
+ return {
8
+ root: {
9
+ display: "flex",
10
+ position: "relative",
11
+ padding: "0px",
12
+ alignItems: "center",
13
+ justifyContent: "center",
14
+ "*": {
15
+ boxSizing: "border-box"
36
16
  },
37
- ":before": {
38
- content: '" "',
39
- position: "absolute",
40
- top: 0,
41
- left: 0,
42
- width: "calc(50% - 162px)",
43
- height: "100%",
44
- pointerEvents: "none",
45
- backgroundColor: "#FFF",
46
- zIndex: 10
17
+ "&.iframe-editor": {
18
+ "& .mini-tool-wrpr-ei": {
19
+ display: "none"
20
+ }
47
21
  },
48
- ":after": {
49
- content: '" "',
50
- position: "absolute",
51
- top: 0,
52
- right: 0,
53
- width: "calc(50% - 160px)",
54
- height: "100%",
55
- pointerEvents: "none",
56
- backgroundColor: "#FFF",
57
- zIndex: 10
58
- }
59
- }
60
- },
61
- slateWrapper: {
62
- paddingTop: "0px",
63
- height: `${window.innerHeight - padHeight}px`,
64
- width: "100%",
65
- overflowY: "auto",
66
- overflowX: "hidden",
67
- display: "flex",
68
- flexDirection: "column",
69
- alignItems: "center",
70
- color: "#0f172a",
71
- "& .has-topbanner": {
72
- "& .doc-title-ele-wrpr": {
73
- marginTop: "12px"
74
- }
75
- },
76
- "&.no-color": {
77
- backgroundColor: theme?.palette?.editor?.background,
78
- color: theme?.palette?.editor?.textColor,
79
- "&.pc-page-builder": {
80
- backgroundColor: "#FFF",
81
- color: "#000"
22
+ "& .mobileMiniTextWrapper": {
23
+ boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
24
+ position: "fixed",
25
+ bottom: "env(safe-area-inset-bottom)",
26
+ left: 0,
27
+ width: "100%",
28
+ zIndex: 99999,
29
+ backgroundColor: theme?.palette?.editor?.background || "#fff",
30
+ color: theme?.palette?.editor?.textColor || "black",
31
+ "& .MuiOutlinedInput-input": {
32
+ color: theme?.palette?.editor?.textColor || "black"
33
+ }
82
34
  },
83
- "& .signed-btn": {
84
- "& img": {
85
- backgroundColor: "#FFF"
35
+ "&.stimulate-xs": {
36
+ "& .scrollable-content": {
37
+ width: "320px"
38
+ },
39
+ ":before": {
40
+ content: '" "',
41
+ position: "absolute",
42
+ top: 0,
43
+ left: 0,
44
+ width: "calc(50% - 162px)",
45
+ height: "100%",
46
+ pointerEvents: "none",
47
+ backgroundColor: "#FFF",
48
+ zIndex: 10
49
+ },
50
+ ":after": {
51
+ content: '" "',
52
+ position: "absolute",
53
+ top: 0,
54
+ right: 0,
55
+ width: "calc(50% - 160px)",
56
+ height: "100%",
57
+ pointerEvents: "none",
58
+ backgroundColor: "#FFF",
59
+ zIndex: 10
86
60
  }
87
- }
61
+ },
62
+ ...overrideWrapperStyles
88
63
  },
89
- "& .max-content": {
64
+ slateWrapper: {
65
+ paddingTop: "0px",
66
+ height: `${window.innerHeight - padHeight}px`,
90
67
  width: "100%",
68
+ overflowY: "auto",
69
+ overflowX: "hidden",
91
70
  display: "flex",
92
- flex: 1,
93
71
  flexDirection: "column",
94
- paddingBottom: "25px !important"
95
- },
96
- "& .scroll-area": {
97
- display: "flex",
98
- justifyContent: "center",
99
- flex: 1
100
- },
101
- "& .editor-wrapper": {
102
- maxWidth: "100%",
103
- height: "100%",
104
- overflow: "visible",
105
- "& .section-wrapper-fluid": {
106
- "& .grid-container": {
107
- maxWidth: "1440px"
72
+ alignItems: "center",
73
+ color: "#0f172a",
74
+ "& .has-topbanner": {
75
+ "& .doc-title-ele-wrpr": {
76
+ marginTop: "12px"
108
77
  }
109
- }
110
- },
111
- "& .el-toolbar": {
112
- position: "absolute",
113
- left: 0,
114
- top: 0,
115
- width: "fit-content",
116
- "& button": {
117
- border: "1px solid rgba(37, 99, 235, 0.32)",
118
- borderRadius: "10px",
119
- boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
120
- background: "#fff",
121
- width: "36px",
122
- height: "36px",
123
- "&.mr": {
124
- marginRight: "2px"
78
+ },
79
+ "&.no-color": {
80
+ backgroundColor: theme?.palette?.editor?.background,
81
+ color: theme?.palette?.editor?.textColor,
82
+ "&.pc-page-builder": {
83
+ backgroundColor: "#FFF",
84
+ color: "#000"
125
85
  },
126
- "& svg": {
127
- stroke: "rgb(100, 116, 139);"
128
- }
129
- }
130
- },
131
- "& .accordion-summary-collapse-btn": {
132
- padding: "4px",
133
- width: '5px'
134
- },
135
- "& .workflow-icon-btn": {
136
- pointerEvents: "none",
137
- position: "absolute",
138
- right: "-9px",
139
- top: "-9px",
140
- border: "2px solid #f3b814",
141
- padding: "0px",
142
- background: "#FFF",
143
- "& svg": {
144
- width: "18px",
145
- height: "18px"
146
- }
147
- },
148
- "& .svg-big-btn": {
149
- padding: "2px !important",
150
- "& svg": {
151
- width: "24px !important",
152
- height: "24px !important"
153
- }
154
- },
155
- "& .ed-section-wrapper": {
156
- display: "flex",
157
- width: "100%",
158
- justifyContent: "center",
159
- alignItems: "center",
160
- position: "relative",
161
- "&:hover": {
162
- "& .ed-section-inner": {
163
- "& .element-toolbar.ss": {
164
- display: "block",
165
- left: "8px",
166
- top: "8px",
167
- width: "fit-content",
168
- "& button": {
169
- boxShadow: "none",
170
- color: "#D7D7D6",
171
- background: "rgb(221, 221, 221, 0.1)",
172
- "&:hover": {
173
- background: "rgb(221, 221, 221, 0.8)"
174
- }
175
- }
86
+ "& .signed-btn": {
87
+ "& img": {
88
+ backgroundColor: "#FFF"
176
89
  }
177
- },
178
- "&.hselect:before": {
179
- display: "block"
180
90
  }
181
91
  },
182
- "& .ed-section-inner": {
183
- maxWidth: "1440px",
184
- "& .element-toolbar.ss": {
185
- display: "none"
92
+ "& .max-content": {
93
+ width: "100%",
94
+ display: "flex",
95
+ flex: 1,
96
+ flexDirection: "column",
97
+ paddingBottom: "25px !important"
98
+ },
99
+ "& .scroll-area": {
100
+ display: "flex",
101
+ justifyContent: "center",
102
+ flex: 1
103
+ },
104
+ "& .editor-wrapper": {
105
+ maxWidth: "100%",
106
+ height: "100%",
107
+ overflow: "visible",
108
+ "& .section-wrapper-fluid": {
109
+ "& .grid-container": {
110
+ maxWidth: "1440px"
111
+ }
186
112
  }
187
113
  },
188
- "&.needHover:before": {
189
- content: '" "',
114
+ "& .el-toolbar": {
190
115
  position: "absolute",
191
- width: "calc(100% - 2px)",
192
- height: "calc(100% - 2px)",
193
116
  left: 0,
194
117
  top: 0,
195
- border: "1px solid transparent",
196
- background: "rgba(0,0,0,0.05)",
118
+ width: "fit-content",
119
+ "& button": {
120
+ border: "1px solid rgba(37, 99, 235, 0.32)",
121
+ borderRadius: "10px",
122
+ boxShadow: "0px 0px 10px 0px rgba(0, 0, 0, 0.16)",
123
+ background: "#fff",
124
+ width: "36px",
125
+ height: "36px",
126
+ "&.mr": {
127
+ marginRight: "2px"
128
+ },
129
+ "& svg": {
130
+ stroke: "rgb(100, 116, 139);"
131
+ }
132
+ }
133
+ },
134
+ "& .accordion-summary-collapse-btn": {
135
+ padding: "4px",
136
+ width: '5px'
137
+ },
138
+ "& .workflow-icon-btn": {
197
139
  pointerEvents: "none",
198
- display: "none"
199
- }
200
- },
201
- "& .element-empty-btn": {
202
- backgroundColor: "rgb(242, 241, 238)",
203
- color: "rgba(55, 53, 47, 0.65)",
204
- outline: 0,
205
- border: 0,
206
- padding: "16px 12px",
207
- width: "100%",
208
- cursor: "pointer",
209
- display: "flex",
210
- alignItems: "center",
211
- justifyContent: "center",
212
- borderRadius: "12px",
213
- "& svg": {
214
- marginRight: "8px"
215
- }
216
- },
217
- "& .content-editable.empty": {
218
- "&:after": {
219
- color: theme?.palette?.type === "dark" ? "#99A5B6" : placeHolderColor
220
- }
221
- },
222
- "& .checkbox-edit": {
223
- alignSelf: "flex-start",
224
- "& .MuiFormControlLabel-root": {
225
- marginRight: "0px"
140
+ position: "absolute",
141
+ right: "-9px",
142
+ top: "-9px",
143
+ border: "2px solid #f3b814",
144
+ padding: "0px",
145
+ background: "#FFF",
146
+ "& svg": {
147
+ width: "18px",
148
+ height: "18px"
149
+ }
226
150
  },
227
- "& .MuiCheckbox-root": {
228
- padding: "5px",
151
+ "& .svg-big-btn": {
152
+ padding: "2px !important",
229
153
  "& svg": {
230
- width: "20px",
231
- height: "20px"
154
+ width: "24px !important",
155
+ height: "24px !important"
232
156
  }
233
- }
234
- },
235
- "& .tools-drawer": {
236
- zIndex: 1300,
237
- "& .MuiDrawer-paper": {
238
- backgroundColor: theme?.palette?.editor?.background
239
- }
240
- },
241
- "& .section-tw": {
242
- background: 'transparent !important',
243
- "& button": {
244
- padding: "2px",
245
- borderRadius: "0px",
157
+ },
158
+ "& .ed-section-wrapper": {
159
+ display: "flex",
160
+ width: "100%",
161
+ justifyContent: "center",
162
+ alignItems: "center",
163
+ position: "relative",
164
+ "&:hover": {
165
+ "& .ed-section-inner": {
166
+ "& .element-toolbar.ss": {
167
+ display: "block",
168
+ left: "8px",
169
+ top: "8px",
170
+ width: "fit-content",
171
+ "& button": {
172
+ boxShadow: "none",
173
+ color: "#D7D7D6",
174
+ background: "rgb(221, 221, 221, 0.1)",
175
+ "&:hover": {
176
+ background: "rgb(221, 221, 221, 0.8)"
177
+ }
178
+ }
179
+ }
180
+ },
181
+ "&.hselect:before": {
182
+ display: "block"
183
+ }
184
+ },
185
+ "& .ed-section-inner": {
186
+ maxWidth: "1440px",
187
+ "& .element-toolbar.ss": {
188
+ display: "none"
189
+ }
190
+ },
191
+ "&.needHover:before": {
192
+ content: '" "',
193
+ position: "absolute",
194
+ width: "calc(100% - 2px)",
195
+ height: "calc(100% - 2px)",
196
+ left: 0,
197
+ top: 0,
198
+ border: "1px solid transparent",
199
+ background: "rgba(0,0,0,0.05)",
200
+ pointerEvents: "none",
201
+ display: "none"
202
+ }
203
+ },
204
+ "& .element-empty-btn": {
205
+ backgroundColor: "rgb(242, 241, 238)",
206
+ color: "rgba(55, 53, 47, 0.65)",
207
+ outline: 0,
208
+ border: 0,
209
+ padding: "16px 12px",
210
+ width: "100%",
211
+ cursor: "pointer",
212
+ display: "flex",
213
+ alignItems: "center",
214
+ justifyContent: "center",
215
+ borderRadius: "12px",
246
216
  "& svg": {
247
- width: "17px",
248
- height: "18px",
249
- marginTop: "-1px"
217
+ marginRight: "8px"
250
218
  }
251
- }
252
- },
253
- "& .carousel-item": {
254
- padding: "12px 32px"
255
- },
256
- "& .slick-arrow": {
257
- borderRadius: "50%",
258
- backgroundColor: "#F8FAFF",
259
- textAlign: "center",
260
- border: "1px solid #CFD8F5"
261
- },
262
- "& .embed-image-wrpr .image-frame": {
263
- position: "absolute",
264
- top: 0,
265
- left: 0,
266
- width: "100%",
267
- height: "100%",
268
- padding: "0px",
269
- // pointerEvents: "none",
270
- "& svg": {
219
+ },
220
+ "& .content-editable.empty": {
221
+ "&:after": {
222
+ color: theme?.palette?.type === "dark" ? "#99A5B6" : placeHolderColor
223
+ }
224
+ },
225
+ "& .checkbox-edit": {
226
+ alignSelf: "flex-start",
227
+ "& .MuiFormControlLabel-root": {
228
+ marginRight: "0px"
229
+ },
230
+ "& .MuiCheckbox-root": {
231
+ padding: "5px",
232
+ "& svg": {
233
+ width: "20px",
234
+ height: "20px"
235
+ }
236
+ }
237
+ },
238
+ "& .tools-drawer": {
239
+ zIndex: 1300,
240
+ "& .MuiDrawer-paper": {
241
+ backgroundColor: theme?.palette?.editor?.background
242
+ }
243
+ },
244
+ "& .section-tw": {
245
+ background: 'transparent !important',
246
+ "& button": {
247
+ padding: "2px",
248
+ borderRadius: "0px",
249
+ "& svg": {
250
+ width: "17px",
251
+ height: "18px",
252
+ marginTop: "-1px"
253
+ }
254
+ }
255
+ },
256
+ "& .carousel-item": {
257
+ padding: "12px 32px"
258
+ },
259
+ "& .slick-arrow": {
260
+ borderRadius: "50%",
261
+ backgroundColor: "#F8FAFF",
262
+ textAlign: "center",
263
+ border: "1px solid #CFD8F5"
264
+ },
265
+ "& .embed-image-wrpr .image-frame": {
266
+ position: "absolute",
267
+ top: 0,
268
+ left: 0,
271
269
  width: "100%",
272
270
  height: "100%",
273
- "& .op-zero": {
274
- fillOpacity: 0
271
+ padding: "0px",
272
+ // pointerEvents: "none",
273
+ "& svg": {
274
+ width: "100%",
275
+ height: "100%",
276
+ "& .op-zero": {
277
+ fillOpacity: 0
278
+ }
275
279
  }
276
- }
277
- },
278
- "&.hideScroll": {
279
- overflowAnchor: "none",
280
- "&::-webkit-scrollbar-track": {
281
- background: "none !important"
282
280
  },
283
- "&::-webkit-scrollbar-thumb": {
284
- background: "none !important"
281
+ "&.hideScroll": {
282
+ overflowAnchor: "none",
283
+ "&::-webkit-scrollbar-track": {
284
+ background: "none !important"
285
+ },
286
+ "&::-webkit-scrollbar-thumb": {
287
+ background: "none !important"
288
+ },
289
+ "&::-webkit-scrollbar-thumb:hover": {
290
+ background: "none !important"
291
+ }
285
292
  },
286
- "&::-webkit-scrollbar-thumb:hover": {
287
- background: "none !important"
288
- }
289
- },
290
- "& ::selection": {
291
- background: 'rgba(35, 131, 226, 0.35)!important',
292
- color: 'inherit'
293
- },
294
- "&.readOnlyContainer": {
295
- "& .max-content": {
296
- paddingBottom: "0px !important"
293
+ "& ::selection": {
294
+ background: 'rgba(35, 131, 226, 0.35)!important',
295
+ color: 'inherit'
296
+ },
297
+ "&.readOnlyContainer": {
298
+ "& .max-content": {
299
+ paddingBottom: "0px !important"
300
+ }
297
301
  }
298
- }
299
- },
300
- fullScreenWrapper: {
301
- "& .editor-wrapper": {
302
- paddingTop: '20px'
303
- },
304
- "& .MuiDialog-paper, & .MuiPopover-paper": {
305
- background: `${theme?.palette?.editor?.background} !important`
306
302
  },
307
- "& .MuiPaper-root": {
308
- borderRadius: "0px !important",
309
- "& .MuiDialogTitle-root": {
310
- position: "absolute",
311
- top: 0,
312
- right: "0px",
313
- zIndex: 100
303
+ fullScreenWrapper: {
304
+ "& .editor-wrapper": {
305
+ paddingTop: '20px'
306
+ },
307
+ "& .MuiDialog-paper, & .MuiPopover-paper": {
308
+ background: `${theme?.palette?.editor?.background} !important`
314
309
  },
315
- "& .MuiDialogContent-root": {
316
- padding: "0px"
310
+ "& .MuiPaper-root": {
311
+ borderRadius: "0px !important",
312
+ "& .MuiDialogTitle-root": {
313
+ position: "absolute",
314
+ top: 0,
315
+ right: "0px",
316
+ zIndex: 100
317
+ },
318
+ "& .MuiDialogContent-root": {
319
+ padding: "0px"
320
+ }
317
321
  }
322
+ },
323
+ cardsTypo: {
324
+ color: theme?.palette?.editor?.textColor,
325
+ fontSize: "14px !important"
318
326
  }
319
- },
320
- cardsTypo: {
321
- color: theme?.palette?.editor?.textColor,
322
- fontSize: "14px !important"
323
- }
324
- });
327
+ };
328
+ };
325
329
  export default editorStyles;
@@ -14,7 +14,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
14
14
  const PopupTool = props => {
15
15
  const {
16
16
  theme,
17
- setIsTextSelected,
18
17
  customProps,
19
18
  editorWrapper
20
19
  } = props;
@@ -35,8 +34,12 @@ const PopupTool = props => {
35
34
  const {
36
35
  selectedElement
37
36
  } = useEditorContext();
37
+ console.log("Editor debug ====>", event, open, anchorEl, selection);
38
38
  const updateAnchorEl = useCallback(() => {
39
39
  try {
40
+ const {
41
+ selection
42
+ } = editor;
40
43
  const isHavingSelection = selection && !Range.isCollapsed(selection);
41
44
  if (isHavingSelection) {
42
45
  const domRange = ReactEditor.toDOMRange(editor, editor.selection);
@@ -56,7 +59,7 @@ const PopupTool = props => {
56
59
  } catch (err) {
57
60
  console.log(err);
58
61
  }
59
- }, [selection]);
62
+ }, [editor?.selection]);
60
63
  useEditorScroll(editorWrapper, updateAnchorEl);
61
64
  useEffect(() => {
62
65
  const userStoppedSelection = size?.device === "xs" ? true : event === "end"; // for mobile, when user starts the selection, we are gonna show the popup tool
@@ -71,12 +74,12 @@ const PopupTool = props => {
71
74
  if (!isCarouselEdit) {
72
75
  setOpen(true);
73
76
  setPopupType("textFormat");
74
- setIsTextSelected(true);
77
+ // setIsTextSelected(true);
75
78
  }
76
79
  } else if (!anchorEl) {
77
80
  setOpen(false);
78
81
  setPopupType("");
79
- setIsTextSelected(false);
82
+ // setIsTextSelected(false);
80
83
  }
81
84
  }, [event, anchorEl]);
82
85
  useEffect(() => {
@@ -88,7 +91,12 @@ const PopupTool = props => {
88
91
  }
89
92
  }, [selection]);
90
93
  useEffect(() => {
91
- if (selectedElement?.enable === 1) {
94
+ const {
95
+ path,
96
+ enable
97
+ } = selectedElement || {};
98
+ const isFreeGridElement = path && path.split("|").length > 2;
99
+ if (enable === 1 && isFreeGridElement) {
92
100
  setAnchorEl(null);
93
101
  }
94
102
  }, [selection, selectedElement?.path, selectedElement?.enable]);
@@ -18,7 +18,7 @@ const Upload = props => {
18
18
  item: true,
19
19
  xs: 12,
20
20
  sx: {
21
- padding: "10px",
21
+ padding: '10px',
22
22
  height: '100%'
23
23
  },
24
24
  className: "ims-right",
@@ -7,7 +7,7 @@ const UploadStyles = theme => ({
7
7
  background: theme?.palette?.editor?.uploadFileBg,
8
8
  height: '100%',
9
9
  minHeight: '150px',
10
- height: 'inherit'
10
+ height: "inherit"
11
11
  },
12
12
  uploadField: {
13
13
  width: "100%",
@@ -58,8 +58,8 @@ const useElementSettingsStyle = theme => ({
58
58
  maxHeight: "500px",
59
59
  overflowX: "hidden",
60
60
  overflowY: "auto",
61
- background: theme?.palette?.editor?.background,
62
61
  paddingLeft: "4px",
62
+ background: theme?.palette?.editor?.background,
63
63
  "& .MuiTypography-root, .MuiInputBase-root, input": {
64
64
  color: theme?.palette?.editor?.textColor
65
65
  },
@@ -1,26 +1,20 @@
1
- import { useEffect, useState } from "react";
1
+ import { useCallback, useEffect, useState } from "react";
2
2
  const useDrag = () => {
3
3
  const [event, setEvent] = useState("");
4
- useEffect(() => {
5
- addListener();
6
- return () => {
7
- removeListener();
8
- };
9
- }, []);
10
- const onMouseDown = () => {
4
+ const onMouseDown = useCallback(() => {
11
5
  setEvent("start");
12
- };
13
- const onMouseUp = () => {
6
+ }, []);
7
+ const onMouseUp = useCallback(() => {
14
8
  setEvent("end");
15
- };
16
- const addListener = () => {
9
+ }, []);
10
+ useEffect(() => {
17
11
  document.addEventListener("pointerdown", onMouseDown);
18
12
  document.addEventListener("pointerup", onMouseUp);
19
- };
20
- const removeListener = () => {
21
- document.removeEventListener("pointerdown", onMouseDown);
22
- document.removeEventListener("pointerup", onMouseUp);
23
- };
13
+ return () => {
14
+ document.removeEventListener("pointerdown", onMouseDown);
15
+ document.removeEventListener("pointerup", onMouseUp);
16
+ };
17
+ }, []);
24
18
  return [event];
25
19
  };
26
20
  export default useDrag;
@@ -4,6 +4,7 @@ function useEditorScroll(editorWrapper = {
4
4
  }, callback) {
5
5
  useEffect(() => {
6
6
  const handleScroll = () => {
7
+ console.log("Editor debug useEditorScroll ====>", editorWrapper, callback);
7
8
  if (editorWrapper.current) {
8
9
  callback();
9
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "7.0.3",
3
+ "version": "7.0.4",
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",