@flozy/editor 4.9.1 → 4.9.2

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.
@@ -1234,7 +1234,5 @@ blockquote {
1234
1234
 
1235
1235
  .settingsHeader {
1236
1236
  font-size: 14px !important;
1237
- font-weight: 600 !important;
1238
- font-family: Inter, sans-serif;
1239
- text-transform: uppercase;
1237
+ font-weight: 500 !important;
1240
1238
  }
@@ -101,6 +101,7 @@ const Video = ({
101
101
  horizantal
102
102
  } = alignment || {};
103
103
  const path = ReactEditor.findPath(editor, element);
104
+ const hasAspect = url && aspectRatio !== "custom" && aspectRatio;
104
105
  const getSize = () => {
105
106
  if (element?.size === undefined) {
106
107
  return {
@@ -190,10 +191,10 @@ const Video = ({
190
191
  width: {
191
192
  ...getBreakPointsValue(getSize(), null, "overrideReSize", true)
192
193
  },
193
- height: url && !aspectRatio ? {
194
+ height: url && (aspectRatio === "custom" || !aspectRatio) ? {
194
195
  ...getBreakPointsValue(getSize(), null, "overrideReSizeH", true)
195
196
  } : "auto",
196
- aspectRatio: aspectRatio ? aspectRatio : "auto"
197
+ aspectRatio: hasAspect ? aspectRatio : "auto"
197
198
  }, theme)
198
199
  };
199
200
  }
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-unused-vars */
2
2
  import React, { useEffect, useState, useRef } from "react";
3
- import { useTheme } from "@mui/material";
3
+ import { Button, Dialog, DialogActions, DialogContent, useTheme } from "@mui/material";
4
4
  import { Node, Path, Transforms } from "slate";
5
5
  import { useSlateStatic, ReactEditor } from "slate-react";
6
6
  import GridItemPopup from "./GridItemPopup";
@@ -83,7 +83,7 @@ const GridItem = props => {
83
83
  initColumnWidth,
84
84
  updateColumnWidth,
85
85
  updateColNodes
86
- } = useGrid();
86
+ } = useGrid() || {};
87
87
  const columnRef = useRef(null);
88
88
  const theme = useTheme();
89
89
  const classes = GridStyles(theme);
@@ -129,6 +129,7 @@ const GridItem = props => {
129
129
  const selected = hoverPath === path.join(",");
130
130
  const [showTool] = useEditorSelection(editor);
131
131
  const [parentDOM, setParentDOM] = useState({});
132
+ const [alert, setAlert] = useState(null);
132
133
  const [size, onMouseDown, resizing, onLoad, isDone] = useTableResize({
133
134
  ...parentDOM
134
135
  });
@@ -216,16 +217,23 @@ const GridItem = props => {
216
217
  try {
217
218
  const gridPath = Path.parent(path);
218
219
  const gridNode = Node.get(editor, gridPath);
219
- onAddGridItem({
220
- editor,
221
- element: gridNode,
222
- children: gridNode?.children || [],
223
- isColumn: gridNode?.equalItems
224
- });
220
+ if (gridNode?.children?.length === 5) {
221
+ setAlert("Maximum column limit exceeded");
222
+ } else {
223
+ onAddGridItem({
224
+ editor,
225
+ element: gridNode,
226
+ children: gridNode?.children || [],
227
+ isColumn: gridNode?.equalItems
228
+ });
229
+ }
225
230
  } catch (err) {
226
231
  console.log(err);
227
232
  }
228
233
  };
234
+ const handleClose = () => {
235
+ setAlert(null);
236
+ };
229
237
  const getBorderColor = () => {
230
238
  return borderColor || "transparent";
231
239
  };
@@ -334,7 +342,18 @@ const GridItem = props => {
334
342
  className: resizing ? "resizing" : "",
335
343
  onMouseDown: onMouseDown,
336
344
  height: "auto"
337
- }) : null]
345
+ }) : null, /*#__PURE__*/_jsxs(Dialog, {
346
+ open: Boolean(alert),
347
+ onClose: handleClose,
348
+ children: [/*#__PURE__*/_jsx(DialogContent, {
349
+ children: alert
350
+ }), /*#__PURE__*/_jsx(DialogActions, {
351
+ children: /*#__PURE__*/_jsx(Button, {
352
+ onClick: handleClose,
353
+ children: "Close"
354
+ })
355
+ })]
356
+ })]
338
357
  });
339
358
  };
340
359
  export default GridItem;
@@ -51,6 +51,7 @@ const GridStyles = theme => ({
51
51
  },
52
52
  "& .gi-inner-cw": {
53
53
  overflowX: "auto",
54
+ wordBreak: "break-word",
54
55
  "& .tableToolBar": {
55
56
  display: "flex",
56
57
  maxWidth: "100%",
@@ -5,6 +5,7 @@ import { StyleContent } from "../../../StyleBuilder";
5
5
  import { formStyle } from "../../../StyleBuilder/formStyle";
6
6
  import { ReactEditor } from "slate-react";
7
7
  import { ExpandMoreOutlined } from "@mui/icons-material";
8
+ import { useEditorContext } from "../../../../hooks/useMouseMove";
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
10
11
  const FormSettings = props => {
@@ -20,6 +21,9 @@ const FormSettings = props => {
20
21
  const {
21
22
  hideTools
22
23
  } = customProps || {};
24
+ const {
25
+ theme
26
+ } = useEditorContext();
23
27
  const onChange = data => {
24
28
  const currentPath = ReactEditor.findPath(editor, element);
25
29
  const updateData = {
@@ -58,6 +62,17 @@ const FormSettings = props => {
58
62
  MuiAccordion: {
59
63
  styleOverrides: {
60
64
  root: {
65
+ "& .MuiAccordionSummary-root": {
66
+ flexDirection: "row-reverse",
67
+ "& .MuiSvgIcon-root": {
68
+ color: theme?.palette?.primary?.main
69
+ },
70
+ "& .Mui-expanded": {
71
+ "& .MuiSvgIcon-root": {
72
+ color: theme?.palette?.text?.blueText
73
+ }
74
+ }
75
+ },
61
76
  padding: "0px",
62
77
  "&.Mui-expanded": {
63
78
  margin: "0"
@@ -85,7 +100,7 @@ const FormSettings = props => {
85
100
  padding: "0px"
86
101
  },
87
102
  children: /*#__PURE__*/_jsx(Typography, {
88
- variant: "h3",
103
+ variant: "body1",
89
104
  className: "settingsHeader",
90
105
  color: "primary",
91
106
  style: {
@@ -99,41 +114,15 @@ const FormSettings = props => {
99
114
  padding: "5px"
100
115
  },
101
116
  children: m?.fields.filter(f => (hideTools || []).indexOf(f.value) === -1).map((field, index) => {
102
- return /*#__PURE__*/_jsx(ThemeProvider, {
103
- theme: muiTheme,
104
- children: /*#__PURE__*/_jsxs(Accordion, {
105
- defaultExpanded: true,
106
- children: [/*#__PURE__*/_jsx(AccordionSummary, {
107
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreOutlined, {}),
108
- sx: {
109
- padding: "0px"
110
- },
111
- children: /*#__PURE__*/_jsx(Typography, {
112
- variant: "h3",
113
- className: "settingsHeader",
114
- color: "primary",
115
- style: {
116
- fontSize: "14px !important",
117
- fontWeight: "400"
118
- },
119
- children: field?.tab
120
- })
121
- }), /*#__PURE__*/_jsx(AccordionDetails, {
122
- sx: {
123
- padding: "0px"
124
- },
125
- children: /*#__PURE__*/_jsx(StyleContent, {
126
- renderTabs: [field],
127
- value: field.value,
128
- element: element,
129
- onChange: onChange,
130
- customElement: element?.children?.[0] || null,
131
- customProps: customProps,
132
- handleClose: handleClose
133
- }, `tab_${field.value}_${index}`)
134
- })]
135
- }, `accordion_${index}`)
136
- }, index);
117
+ return /*#__PURE__*/_jsx(StyleContent, {
118
+ renderTabs: [field],
119
+ value: field.value,
120
+ element: element,
121
+ onChange: onChange,
122
+ customElement: element?.children?.[0] || null,
123
+ customProps: customProps,
124
+ handleClose: handleClose
125
+ }, `tab_${field.value}_${index}`);
137
126
  })
138
127
  })]
139
128
  }, `accordion_${i}`)
@@ -146,10 +135,10 @@ const FormSettings = props => {
146
135
  children: [/*#__PURE__*/_jsx(AccordionSummary, {
147
136
  expandIcon: /*#__PURE__*/_jsx(ExpandMoreOutlined, {}),
148
137
  sx: {
149
- padding: "0px"
138
+ padding: "5px"
150
139
  },
151
140
  children: /*#__PURE__*/_jsx(Typography, {
152
- variant: "h3",
141
+ variant: "body1",
153
142
  className: "settingsHeader",
154
143
  color: "primary",
155
144
  style: {
@@ -23,7 +23,7 @@ const embedVideoStyle = [{
23
23
  value: "9 / 16"
24
24
  }, {
25
25
  text: "Custom",
26
- value: ""
26
+ value: "custom"
27
27
  }],
28
28
  renderOption: option => {
29
29
  return /*#__PURE__*/_jsx("span", {
@@ -5,27 +5,10 @@ import CloseIcon from "@mui/icons-material/Close";
5
5
  import useCommonStyle from "../../commonStyle";
6
6
  import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import { ThemeProvider } from "@mui/material/styles";
8
- import { ExpandMoreOutlined, Height } from "@mui/icons-material";
8
+ import { ExpandMoreOutlined, ExpandMoreSharp } from "@mui/icons-material";
9
9
  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
- const muiTheme = createTheme({
13
- components: {
14
- MuiAccordion: {
15
- styleOverrides: {
16
- root: {
17
- padding: "0px",
18
- "&.Mui-expanded": {
19
- margin: "0"
20
- }
21
- }
22
- },
23
- defaultProps: {
24
- elevation: 0
25
- }
26
- }
27
- }
28
- });
29
12
  export const StyleContent = props => {
30
13
  const {
31
14
  value,
@@ -95,6 +78,34 @@ const StyleBuilder = props => {
95
78
  const {
96
79
  hideTools
97
80
  } = customProps || {};
81
+ const muiTheme = createTheme({
82
+ components: {
83
+ MuiAccordion: {
84
+ styleOverrides: {
85
+ root: {
86
+ "& .MuiAccordionSummary-root": {
87
+ flexDirection: "row-reverse",
88
+ "& .MuiSvgIcon-root": {
89
+ color: theme?.palette?.primary?.main
90
+ },
91
+ "& .Mui-expanded": {
92
+ "& .MuiSvgIcon-root": {
93
+ color: theme?.palette?.text?.blueText
94
+ }
95
+ }
96
+ },
97
+ padding: "0px",
98
+ "&.Mui-expanded": {
99
+ margin: "0"
100
+ }
101
+ }
102
+ },
103
+ defaultProps: {
104
+ elevation: 0
105
+ }
106
+ }
107
+ }
108
+ });
98
109
  useEffect(() => {
99
110
  if (customProps?.onDrawerOpen) {
100
111
  customProps?.onDrawerOpen(true);
@@ -171,17 +182,17 @@ const StyleBuilder = props => {
171
182
  children: /*#__PURE__*/_jsxs(Accordion, {
172
183
  defaultExpanded: true,
173
184
  children: [/*#__PURE__*/_jsx(AccordionSummary, {
174
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreOutlined, {}),
185
+ expandIcon: /*#__PURE__*/_jsx(ExpandMoreSharp, {}),
175
186
  sx: {
176
187
  padding: "0px"
177
188
  },
178
189
  children: /*#__PURE__*/_jsx(Typography, {
179
- variant: "h3",
190
+ variant: "body1",
180
191
  className: "settingsHeader",
181
192
  color: "primary",
182
193
  style: {
183
194
  fontSize: "14px !important",
184
- fontWeight: "400"
195
+ fontWeight: "400 !important"
185
196
  },
186
197
  children: m?.tab
187
198
  })
@@ -190,40 +201,14 @@ const StyleBuilder = props => {
190
201
  padding: "5px"
191
202
  },
192
203
  children: m?.fields.filter(f => (hideTools || []).indexOf(f.value) === -1).map((field, index) => {
193
- return /*#__PURE__*/_jsx(ThemeProvider, {
194
- theme: muiTheme,
195
- children: /*#__PURE__*/_jsxs(Accordion, {
196
- defaultExpanded: true,
197
- children: [/*#__PURE__*/_jsx(AccordionSummary, {
198
- expandIcon: /*#__PURE__*/_jsx(ExpandMoreOutlined, {}),
199
- sx: {
200
- padding: "0px"
201
- },
202
- children: /*#__PURE__*/_jsx(Typography, {
203
- variant: "h3",
204
- className: "settingsHeader",
205
- color: "primary",
206
- style: {
207
- fontSize: "14px !important",
208
- fontWeight: "400"
209
- },
210
- children: field?.tab
211
- })
212
- }), /*#__PURE__*/_jsx(AccordionDetails, {
213
- sx: {
214
- padding: "0px"
215
- },
216
- children: /*#__PURE__*/_jsx(StyleContent, {
217
- renderTabs: [field],
218
- value: field.value,
219
- element: elementProps,
220
- onChange: onElementPropsChange,
221
- customProps: customProps,
222
- handleClose: handleClose
223
- }, `tab_${field.value}_${index}`)
224
- })]
225
- }, `accordion_${index}`)
226
- }, index);
204
+ return /*#__PURE__*/_jsx(StyleContent, {
205
+ renderTabs: [field],
206
+ value: field.value,
207
+ element: elementProps,
208
+ onChange: onElementPropsChange,
209
+ customProps: customProps,
210
+ handleClose: handleClose
211
+ }, `tab_${field.value}_${index}`);
227
212
  })
228
213
  })]
229
214
  }, `accordion_${i}`)
@@ -239,7 +224,7 @@ const StyleBuilder = props => {
239
224
  padding: "0px"
240
225
  },
241
226
  children: /*#__PURE__*/_jsx(Typography, {
242
- variant: "h3",
227
+ variant: "body1",
243
228
  className: "settingsHeader",
244
229
  color: "primary",
245
230
  style: {
@@ -250,7 +235,7 @@ const StyleBuilder = props => {
250
235
  })
251
236
  }), /*#__PURE__*/_jsx(AccordionDetails, {
252
237
  sx: {
253
- padding: "0px"
238
+ padding: "5px"
254
239
  },
255
240
  children: /*#__PURE__*/_jsx(StyleContent, {
256
241
  renderTabs: renderTabs,
@@ -269,6 +254,7 @@ const StyleBuilder = props => {
269
254
  sx: {
270
255
  p: 0,
271
256
  pt: 2,
257
+ pl: 1,
272
258
  justifyContent: "space-between"
273
259
  },
274
260
  children: [onDelete ? /*#__PURE__*/_jsx(Button, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "4.9.1",
3
+ "version": "4.9.2",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"