@flozy/editor 3.2.1 → 3.2.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.
@@ -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,9 @@ const StyleBuilder = props => {
61
62
  theme
62
63
  } = useEditorContext();
63
64
  const classes = useCommonStyle(theme);
65
+ const {
66
+ isMobile = false
67
+ } = customProps;
64
68
  const [elementProps, setElementProps] = useState(element);
65
69
  const [tab] = useState(renderTabs[0]?.value);
66
70
  const tabVal = renderTabs?.find(f => f.value === tab);
@@ -100,16 +104,8 @@ const StyleBuilder = props => {
100
104
  const handleClose = () => {
101
105
  onClose();
102
106
  };
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, {
107
+ const renderDrawerMenu = () => {
108
+ return /*#__PURE__*/_jsxs(Grid, {
113
109
  item: true,
114
110
  xs: 12,
115
111
  sx: {
@@ -143,7 +139,7 @@ const StyleBuilder = props => {
143
139
  })
144
140
  }), /*#__PURE__*/_jsx(DialogContent, {
145
141
  sx: {
146
- maxHeight: `${window.innerHeight - 125}px`,
142
+ maxHeight: isMobile ? `500px` : `${window.innerHeight - 125}px`,
147
143
  padding: "8px"
148
144
  },
149
145
  children: renderTabs.map((m, i) => {
@@ -173,6 +169,29 @@ const StyleBuilder = props => {
173
169
  children: "Save"
174
170
  })]
175
171
  }) : null]
172
+ });
173
+ };
174
+ return /*#__PURE__*/_jsx(_Fragment, {
175
+ children: isMobile ? /*#__PURE__*/_jsx(SwipeableDrawer, {
176
+ open: true,
177
+ className: ` dialogComp tools-drawer`,
178
+ anchor: "bottom",
179
+ onClose: onClose,
180
+ style: {
181
+ zIndex: "1300"
182
+ },
183
+ sx: classes.bottomBarDrawer,
184
+ children: renderDrawerMenu()
185
+ }) : /*#__PURE__*/_jsx(Drawer, {
186
+ open: true,
187
+ className: ` dialogComp tools-drawer`,
188
+ anchor: "right",
189
+ onClose: onClose,
190
+ style: {
191
+ zIndex: "1300"
192
+ },
193
+ sx: classes.sideBarDrawer,
194
+ children: renderDrawerMenu()
176
195
  })
177
196
  });
178
197
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"