@flozy/editor 3.2.1 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,8 @@ const AccordionBtnPopup = props => {
6
6
  const {
7
7
  element,
8
8
  onSave,
9
- onClose
9
+ onClose,
10
+ customProps
10
11
  } = props;
11
12
  return /*#__PURE__*/_jsx(StyleBuilder, {
12
13
  title: "Accordion Collapse Button",
@@ -14,7 +15,8 @@ const AccordionBtnPopup = props => {
14
15
  element: element,
15
16
  onSave: onSave,
16
17
  onClose: onClose,
17
- renderTabs: accordionTitleBtnStyle
18
+ renderTabs: accordionTitleBtnStyle,
19
+ customProps: customProps
18
20
  });
19
21
  };
20
22
  export default AccordionBtnPopup;
@@ -6,7 +6,8 @@ const AccordionTitlePopup = props => {
6
6
  const {
7
7
  element,
8
8
  onSave,
9
- onClose
9
+ onClose,
10
+ customProps
10
11
  } = props;
11
12
  return /*#__PURE__*/_jsx(StyleBuilder, {
12
13
  title: "Accordion Title",
@@ -14,7 +15,8 @@ const AccordionTitlePopup = props => {
14
15
  element: element,
15
16
  onSave: onSave,
16
17
  onClose: onClose,
17
- renderTabs: accordionTitleStyle
18
+ renderTabs: accordionTitleStyle,
19
+ customProps: customProps
18
20
  });
19
21
  };
20
22
  export default AccordionTitlePopup;
@@ -6,7 +6,8 @@ const FieldPopup = props => {
6
6
  const {
7
7
  element,
8
8
  onSave,
9
- onClose
9
+ onClose,
10
+ customProps
10
11
  } = props;
11
12
  return /*#__PURE__*/_jsx(StyleBuilder, {
12
13
  title: "Form Field",
@@ -14,7 +15,8 @@ const FieldPopup = props => {
14
15
  element: element,
15
16
  onSave: onSave,
16
17
  onClose: onClose,
17
- renderTabs: fieldStyle
18
+ renderTabs: fieldStyle,
19
+ customProps: customProps
18
20
  });
19
21
  };
20
22
  export default FieldPopup;
@@ -97,7 +97,8 @@ const FormField = props => {
97
97
  }), openSetttings ? /*#__PURE__*/_jsx(FieldPopup, {
98
98
  element: element,
99
99
  onSave: onSave,
100
- onClose: onClose
100
+ onClose: onClose,
101
+ customProps: customProps
101
102
  }) : null, /*#__PURE__*/_jsx("span", {
102
103
  style: {
103
104
  display: "none"
@@ -177,7 +177,8 @@ const GridItem = props => {
177
177
  element: element,
178
178
  onSave: onSave,
179
179
  onClose: onClose,
180
- onDelete: onDelete
180
+ onDelete: onDelete,
181
+ customProps: customProps
181
182
  }) : null]
182
183
  });
183
184
  };
@@ -7,7 +7,8 @@ const GridItemPopup = props => {
7
7
  element,
8
8
  onSave,
9
9
  onClose,
10
- onDelete
10
+ onDelete,
11
+ customProps
11
12
  } = props;
12
13
  return /*#__PURE__*/_jsx(StyleBuilder, {
13
14
  title: "Grid Item",
@@ -16,7 +17,8 @@ const GridItemPopup = props => {
16
17
  onSave: onSave,
17
18
  onClose: onClose,
18
19
  renderTabs: gridItemStyle,
19
- onDelete: onDelete
20
+ onDelete: onDelete,
21
+ customProps: customProps
20
22
  });
21
23
  };
22
24
  export default GridItemPopup;
@@ -125,7 +125,7 @@ const TableCell = props => {
125
125
  classes: classes,
126
126
  onMouseDown: onMouseDown,
127
127
  height: tableDOM.getBoundingClientRect()?.height
128
- }) : null, hasSelected ? /*#__PURE__*/_jsx("div", {
128
+ }) : null, hasSelected && !readOnly ? /*#__PURE__*/_jsx("div", {
129
129
  className: "selection-area-tc",
130
130
  contentEditable: false
131
131
  }) : null]
@@ -1,11 +1,12 @@
1
1
  import React, { useEffect, useState } from "react";
2
- import { DialogTitle, DialogContent, DialogActions, Button, Grid, IconButton, Typography, Drawer } from "@mui/material";
2
+ import { DialogTitle, DialogContent, DialogActions, Button, Grid, IconButton, Typography, Drawer, SwipeableDrawer } from "@mui/material";
3
3
  import FieldMap from "./fieldTypes";
4
4
  import CloseIcon from "@mui/icons-material/Close";
5
5
  import useCommonStyle from "../../commonStyle";
6
6
  import { useEditorContext } from "../../hooks/useMouseMove";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
9
10
  const StyleContent = props => {
10
11
  const {
11
12
  value,
@@ -61,6 +62,7 @@ const StyleBuilder = props => {
61
62
  theme
62
63
  } = useEditorContext();
63
64
  const classes = useCommonStyle(theme);
65
+ const isMobile = customProps?.isMobile || false;
64
66
  const [elementProps, setElementProps] = useState(element);
65
67
  const [tab] = useState(renderTabs[0]?.value);
66
68
  const tabVal = renderTabs?.find(f => f.value === tab);
@@ -100,21 +102,13 @@ const StyleBuilder = props => {
100
102
  const handleClose = () => {
101
103
  onClose();
102
104
  };
103
- return /*#__PURE__*/_jsx(Drawer, {
104
- open: true,
105
- className: ` dialogComp tools-drawer`,
106
- anchor: "right",
107
- onClose: onClose,
108
- style: {
109
- zIndex: "1300"
110
- },
111
- sx: classes.sideBarDrawer,
112
- children: /*#__PURE__*/_jsxs(Grid, {
105
+ const renderDrawerMenu = () => {
106
+ return /*#__PURE__*/_jsxs(Grid, {
113
107
  item: true,
114
108
  xs: 12,
115
109
  sx: {
116
110
  p: 2,
117
- width: "350px"
111
+ width: isMobile ? "100%" : "350px"
118
112
  },
119
113
  children: [/*#__PURE__*/_jsx(DialogTitle, {
120
114
  sx: {
@@ -143,7 +137,7 @@ const StyleBuilder = props => {
143
137
  })
144
138
  }), /*#__PURE__*/_jsx(DialogContent, {
145
139
  sx: {
146
- maxHeight: `${window.innerHeight - 125}px`,
140
+ maxHeight: isMobile ? `500px` : `${window.innerHeight - 125}px`,
147
141
  padding: "8px"
148
142
  },
149
143
  children: renderTabs.map((m, i) => {
@@ -173,6 +167,29 @@ const StyleBuilder = props => {
173
167
  children: "Save"
174
168
  })]
175
169
  }) : null]
170
+ });
171
+ };
172
+ return /*#__PURE__*/_jsx(_Fragment, {
173
+ children: isMobile ? /*#__PURE__*/_jsx(SwipeableDrawer, {
174
+ open: true,
175
+ className: ` dialogComp tools-drawer`,
176
+ anchor: "bottom",
177
+ onClose: onClose,
178
+ style: {
179
+ zIndex: "1300"
180
+ },
181
+ sx: classes.bottomBarDrawer,
182
+ children: renderDrawerMenu()
183
+ }) : /*#__PURE__*/_jsx(Drawer, {
184
+ open: true,
185
+ className: ` dialogComp tools-drawer`,
186
+ anchor: "right",
187
+ onClose: onClose,
188
+ style: {
189
+ zIndex: "1300"
190
+ },
191
+ sx: classes.sideBarDrawer,
192
+ children: renderDrawerMenu()
176
193
  })
177
194
  });
178
195
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"