@flozy/editor 1.6.7 → 1.6.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,7 +30,7 @@ const editorStyles = ({
30
30
  flex: 1
31
31
  },
32
32
  "& .editor-wrapper": {
33
- maxWidth: "1440px",
33
+ maxWidth: "100%",
34
34
  height: "100%",
35
35
  backgroundColor: "#FFF",
36
36
  overflow: "visible"
@@ -7,7 +7,7 @@ import { AiFillEdit, AiOutlineInsertRowBelow, AiOutlineInsertRowRight, AiOutline
7
7
  import { SiLatex } from "react-icons/si";
8
8
  import { RiDeleteColumn, RiDeleteRow } from "react-icons/ri";
9
9
  import { IoIosImage, IoIosLink, IoMdArrowDroprightCircle, IoMdArrowDropdownCircle } from "react-icons/io";
10
- import { GridIcon, AccordionIcon, SignatureIcon, ButtonIcon, Carousal, FormIcon, BoldIcon, FontFamilyIcon, FontSizeIcon, ImageIcon, ItalicIcon, LinkIcon, StrikethroughIcon, TableIcon, UnderLineIcon, VideoIcon, CheckboxIcon, AppHeader, MoreHorizontal } from "./iconslist";
10
+ import { GridIcon, AccordionIcon, SignatureIcon, ButtonIcon, Carousal, FormIcon, BoldIcon, FontFamilyIcon, FontSizeIcon, ImageIcon, ItalicIcon, LinkIcon, StrikethroughIcon, TableIcon, UnderLineIcon, VideoIcon, CheckboxIcon, AppHeader, MoreHorizontal, UploadImage } from "./iconslist";
11
11
  import { jsx as _jsx } from "react/jsx-runtime";
12
12
  const iconList = {
13
13
  fontFamily: /*#__PURE__*/_jsx(FontFamilyIcon, {
@@ -170,9 +170,7 @@ const iconList = {
170
170
  size: 20,
171
171
  fill: "#64748B"
172
172
  }),
173
- fileUpload: /*#__PURE__*/_jsx(MdOutlineFileUpload, {
174
- size: 20
175
- }),
173
+ fileUpload: /*#__PURE__*/_jsx(UploadImage, {}),
176
174
  media: /*#__PURE__*/_jsx(MdOutlinePermMedia, {
177
175
  size: 20
178
176
  }),
@@ -30,12 +30,10 @@ const QuiltedImageList = props => {
30
30
  width: "100%",
31
31
  height: "100%"
32
32
  },
33
- variant: "quilted",
34
- cols: cols || 4,
35
- rowHeight: rowHeight || 121,
36
- style: {
37
- marginTop: "0px"
38
- },
33
+ cols: cols
34
+ // rowHeight={rowHeight || 121}
35
+ // style={{ marginTop: "0px" }}
36
+ ,
39
37
  children: [UploaderComp ? /*#__PURE__*/_jsx(ImageListItem, {
40
38
  className: "img_upload_btn_list",
41
39
  cols: 2,
@@ -47,8 +45,6 @@ const QuiltedImageList = props => {
47
45
  }, `img_upload_btn`) : null, (itemData || []).map(item => {
48
46
  const isSelected = (selected || []).find(f => f.img === item.img);
49
47
  return /*#__PURE__*/_jsxs(ImageListItem, {
50
- cols: item.cols || 1,
51
- rows: item.rows || 1,
52
48
  children: [/*#__PURE__*/_jsx("img", {
53
49
  ...srcset(item.img, rowHeight || 121, item.rows, item.cols),
54
50
  alt: item.title,
@@ -1,5 +1,5 @@
1
1
  import React, { useState } from "react";
2
- import { Button, Grid, Tab, Tabs, Dialog, DialogContent, DialogActions, DialogTitle, Typography } from "@mui/material";
2
+ import { Button, Grid, Tab, Tabs, Dialog, DialogContent, DialogActions, DialogTitle, Typography, Divider } from "@mui/material";
3
3
  import Upload from "./Options/Upload";
4
4
  import ChooseAssets from "./Options/ChooseAssets";
5
5
  import AddLink from "./Options/AddLink";
@@ -42,25 +42,15 @@ const ImageSelector = props => {
42
42
  sx: classes.dialogWrapper,
43
43
  children: [/*#__PURE__*/_jsx(DialogTitle, {
44
44
  children: /*#__PURE__*/_jsxs(Typography, {
45
- variant: "body1",
46
45
  sx: {
47
46
  fontSize: "16px",
48
- fontWeight: 600
47
+ fontWeight: 500
49
48
  },
50
49
  children: ["Add ", title]
51
50
  })
52
- }), /*#__PURE__*/_jsx(DialogContent, {
53
- style: {
54
- background: "#F0F5FA",
55
- padding: "0px"
56
- },
51
+ }), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx(DialogContent, {
57
52
  children: /*#__PURE__*/_jsxs(Grid, {
58
53
  container: true,
59
- spacing: 0,
60
- style: {
61
- width: "100%",
62
- padding: "8px"
63
- },
64
54
  children: [/*#__PURE__*/_jsx(Grid, {
65
55
  item: true,
66
56
  xs: 4,
@@ -70,15 +60,6 @@ const ImageSelector = props => {
70
60
  orientation: "vertical",
71
61
  value: tabValue,
72
62
  children: [/*#__PURE__*/_jsx(Tab, {
73
- className: `${isActive("addLink")}`,
74
- sx: classes.tab,
75
- icon: /*#__PURE__*/_jsx(Icon, {
76
- icon: "link"
77
- }),
78
- iconPosition: "start",
79
- value: "addLink",
80
- label: `Add ${title} Link`
81
- }), /*#__PURE__*/_jsx(Tab, {
82
63
  className: `${isActive("upload")} ${title !== "Image" ? "hidden" : ""}`,
83
64
  sx: classes.tab,
84
65
  icon: /*#__PURE__*/_jsx(Icon, {
@@ -96,6 +77,15 @@ const ImageSelector = props => {
96
77
  iconPosition: "start",
97
78
  value: "choose",
98
79
  label: "Choose Media"
80
+ }), /*#__PURE__*/_jsx(Tab, {
81
+ className: `${isActive("addLink")}`,
82
+ sx: classes.tab,
83
+ icon: /*#__PURE__*/_jsx(Icon, {
84
+ icon: "link"
85
+ }),
86
+ iconPosition: "start",
87
+ value: "addLink",
88
+ label: `Add ${title} Link`
99
89
  })]
100
90
  })
101
91
  }), /*#__PURE__*/_jsx(Grid, {
@@ -104,28 +94,24 @@ const ImageSelector = props => {
104
94
  sx: classes.imsRightWrpr,
105
95
  children: /*#__PURE__*/_jsx(Comp, {
106
96
  ...props,
97
+ classes: classes,
107
98
  onUploaded: onUploaded
108
99
  })
109
100
  })]
110
101
  })
111
- }), /*#__PURE__*/_jsxs(DialogActions, {
102
+ }), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsxs(DialogActions, {
112
103
  sx: {
113
104
  p: 2
114
105
  },
115
106
  children: [/*#__PURE__*/_jsx(Button, {
116
107
  onClick: onClose,
117
108
  variant: "outlined",
118
- color: "secondary",
119
- className: "secondaryBtn",
109
+ sx: classes.closeBtn,
120
110
  children: "Cancel"
121
111
  }), /*#__PURE__*/_jsx(Button, {
122
112
  onClick: onSave,
123
113
  variant: "contained",
124
- color: "primary",
125
- className: " primaryBtn",
126
- sx: {
127
- ml: 0
128
- },
114
+ sx: classes.saveBtn,
129
115
  children: "Save"
130
116
  })]
131
117
  })]
@@ -4,6 +4,7 @@ import CheckIcon from "@mui/icons-material/Check";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const AddLink = props => {
6
6
  const {
7
+ classes,
7
8
  onUploaded,
8
9
  title
9
10
  } = props;
@@ -25,11 +26,13 @@ const AddLink = props => {
25
26
  value: url,
26
27
  onChange: handleChange,
27
28
  helperText: "Click Check Icon and Save...",
29
+ sx: classes.addLinkField,
28
30
  InputProps: {
29
31
  endAdornment: /*#__PURE__*/_jsx(Tooltip, {
30
- title: `Add ${Image} URL`,
32
+ title: `Add ${title} URL`,
31
33
  arrow: true,
32
34
  children: /*#__PURE__*/_jsx(IconButton, {
35
+ sx: classes.addLinkBtn,
33
36
  onClick: handleSave,
34
37
  children: /*#__PURE__*/_jsx(CheckIcon, {})
35
38
  })
@@ -4,6 +4,7 @@ import Uploader from "../../Uploader";
4
4
  import { jsx as _jsx } from "react/jsx-runtime";
5
5
  const Upload = props => {
6
6
  const {
7
+ classes,
7
8
  value,
8
9
  onUploaded,
9
10
  customProps,
@@ -15,8 +16,12 @@ const Upload = props => {
15
16
  return /*#__PURE__*/_jsx(Grid, {
16
17
  item: true,
17
18
  xs: 12,
19
+ sx: {
20
+ padding: 0
21
+ },
18
22
  className: "ims-right",
19
23
  children: /*#__PURE__*/_jsx(Uploader, {
24
+ classes: classes,
20
25
  value: value,
21
26
  data: {
22
27
  key: "url"
@@ -2,17 +2,24 @@ const ImageSelectorStyles = () => ({
2
2
  root: {},
3
3
  tabs: {
4
4
  "& button": {
5
- fontSize: "14px",
5
+ fontSize: "12px",
6
+ fontWeight: "500",
6
7
  textTransform: "capitalize",
7
- padding: "12px",
8
- alignItems: "start",
9
- justifyContent: "start",
10
- minHeight: "auto",
8
+ minHeight: '40px',
9
+ padding: '10px',
10
+ marginRight: '24px',
11
11
  "&.hidden": {
12
12
  display: "none"
13
13
  },
14
14
  "&.active": {
15
- backgroundColor: "#FFF"
15
+ backgroundColor: "#FFF",
16
+ border: '1px solid #2563EB',
17
+ borderRadius: '7px',
18
+ '& svg': {
19
+ '& path': {
20
+ stroke: '#2563EB'
21
+ }
22
+ }
16
23
  },
17
24
  "&:hover": {
18
25
  backgroundColor: "#ECECEC"
@@ -24,7 +31,7 @@ const ImageSelectorStyles = () => ({
24
31
  }
25
32
  },
26
33
  "& .MuiTabs-indicator": {
27
- left: 0
34
+ display: 'none'
28
35
  }
29
36
  },
30
37
  tab: {},
@@ -32,12 +39,15 @@ const ImageSelectorStyles = () => ({
32
39
  height: "300px",
33
40
  overflow: "auto",
34
41
  backgroundColor: "#fff",
35
- padding: "8px",
42
+ padding: "0 8px",
36
43
  "& .MuiFormHelperText-root": {
37
44
  marginLeft: "0px"
38
45
  }
39
46
  },
40
47
  dialogWrapper: {
48
+ '& .MuiDialog-paper': {
49
+ borderRadius: '12px'
50
+ },
41
51
  "& .primaryBtn": {
42
52
  background: "#2563eb !important",
43
53
  boxShadow: "0px 8px 24px rgba(30, 64, 175, 0.08)",
@@ -62,6 +72,55 @@ const ImageSelectorStyles = () => ({
62
72
  width: "auto !important",
63
73
  marginRight: "8px !important"
64
74
  }
75
+ },
76
+ addLinkField: {
77
+ "& .MuiOutlinedInput-input": {
78
+ fontSize: '12px',
79
+ fontWeight: 500
80
+ },
81
+ '& .MuiOutlinedInput-root': {
82
+ boxShadow: '0px 4px 10px rgba(0, 0, 0, 0.16)',
83
+ borderRadius: '7px',
84
+ '& fieldset': {
85
+ borderColor: '#D8DDE1'
86
+ },
87
+ '&:hover fieldset': {
88
+ borderColor: '#64748B'
89
+ },
90
+ '&.Mui-focused fieldset': {
91
+ borderColor: '#2563EB'
92
+ },
93
+ '& .MuiFormLabel-root': {}
94
+ }
95
+ },
96
+ addLinkBtn: {
97
+ borderRadius: '5px',
98
+ background: "#E7EDF7",
99
+ width: '20px',
100
+ height: '20px',
101
+ '& svg': {
102
+ width: '16px',
103
+ height: '16px'
104
+ }
105
+ },
106
+ closeBtn: {
107
+ background: '#F4F6F9',
108
+ color: '#64748B',
109
+ fontSize: '14px',
110
+ fontWeight: 500,
111
+ padding: '4px 22px',
112
+ textTransform: 'none',
113
+ border: '1px solid #D8DDE1',
114
+ '&:hover': {
115
+ border: '1px solid #64748B'
116
+ }
117
+ },
118
+ saveBtn: {
119
+ background: '#2563EB',
120
+ fontSize: '14px',
121
+ fontWeight: 500,
122
+ padding: '4px 24px',
123
+ textTransform: 'none'
65
124
  }
66
125
  });
67
126
  export default ImageSelectorStyles;
@@ -0,0 +1,27 @@
1
+ const UploadStyles = () => ({
2
+ uploadContainer: {
3
+ border: '1px solid #2563EB',
4
+ padding: '10px',
5
+ borderRadius: "7px",
6
+ boxShadow: '0px 4px 10px rgba(0, 0, 0, 0.16)'
7
+ },
8
+ uploadField: {
9
+ width: "100%",
10
+ backgroundSize: "contain",
11
+ backgroundRepeat: "no-repeat",
12
+ backgroundPosition: "center",
13
+ height: "250px",
14
+ position: "relative",
15
+ backgroundColor: "#EFF4FF",
16
+ borderRadius: "9px",
17
+ border: '1px dashed #2563EB'
18
+ },
19
+ uploadIcon: {
20
+ '& svg': {
21
+ '& path': {
22
+ stroke: '#2563EB'
23
+ }
24
+ }
25
+ }
26
+ });
27
+ export default UploadStyles;
@@ -11,19 +11,24 @@ const embedImageStyle = [{
11
11
  key: "url",
12
12
  type: "backgroundImage"
13
13
  }]
14
- }, {
15
- tab: "Image List Settings",
16
- value: "imageListSettings",
17
- fields: [{
18
- label: "Image List Columns",
19
- key: "cols",
20
- type: "text"
21
- }, {
22
- label: "Row Height",
23
- key: "rowHeight",
24
- type: "text"
25
- }]
26
- }, {
14
+ },
15
+ // {
16
+ // tab: "Image List Settings",
17
+ // value: "imageListSettings",
18
+ // fields: [
19
+ // {
20
+ // label: "Image List Columns",
21
+ // key: "cols",
22
+ // type: "text",
23
+ // },
24
+ // {
25
+ // label: "Row Height",
26
+ // key: "rowHeight",
27
+ // type: "text",
28
+ // },
29
+ // ],
30
+ // },
31
+ {
27
32
  tab: "Banner Spacing",
28
33
  value: "bannerSpacing",
29
34
  fields: [{
@@ -63,6 +68,11 @@ const embedImageStyle = [{
63
68
  label: "Border Color",
64
69
  key: "borderColor",
65
70
  type: "color"
71
+ }, {
72
+ label: "Box Shadow",
73
+ key: "boxShadow",
74
+ type: "text",
75
+ placeholder: "Enter Box Shadow Code"
66
76
  }]
67
77
  }, {
68
78
  tab: "Size",
@@ -1,7 +1,8 @@
1
1
  import React, { useState } from "react";
2
2
  import { Grid, Button, Typography } from "@mui/material";
3
- import { UploadBtnIcon } from "../../iconslist";
4
3
  import ImageSelector from "../../ImageSelector/ImageSelector";
4
+ import UploadStyles from "../../ImageSelector/UploadStyles";
5
+ import Icon from "../../Icon";
5
6
  import { jsx as _jsx } from "react/jsx-runtime";
6
7
  import { jsxs as _jsxs } from "react/jsx-runtime";
7
8
  const BackgroundImage = props => {
@@ -16,6 +17,7 @@ const BackgroundImage = props => {
16
17
  } = data;
17
18
  const [base64, setBase64] = useState(value);
18
19
  const [open, setOpen] = useState(false);
20
+ const classes = UploadStyles();
19
21
  const onRemoveBG = () => {
20
22
  setBase64(null);
21
23
  onChange({
@@ -36,7 +38,7 @@ const BackgroundImage = props => {
36
38
  handleClose();
37
39
  };
38
40
  return /*#__PURE__*/_jsxs(Grid, {
39
- container: true,
41
+ item: true,
40
42
  children: [/*#__PURE__*/_jsx(Typography, {
41
43
  variant: "body1",
42
44
  color: "primary",
@@ -47,42 +49,41 @@ const BackgroundImage = props => {
47
49
  },
48
50
  children: "Upload Image"
49
51
  }), /*#__PURE__*/_jsx(Grid, {
50
- item: true,
51
- xs: 12,
52
- style: {
53
- position: "relative",
54
- marginTop: "12px",
55
- marginBottom: "12px",
56
- width: "100%",
57
- backgroundImage: base64 ? `url(${base64})` : "none",
58
- height: "200px",
59
- borderRadius: "10px",
60
- backgroundPosition: "center",
61
- backgroundSize: "contain",
62
- backgroundRepeat: "no-repeat",
63
- backgroundColor: "rgba(0,0,0,0.5)"
64
- },
52
+ container: true,
53
+ sx: classes.uploadContainer,
65
54
  children: /*#__PURE__*/_jsx(Grid, {
66
- className: "uploadImageSection",
67
- children: base64 ? /*#__PURE__*/_jsx(Grid, {
68
- className: "removeImageText",
69
- onClick: onRemoveBG,
70
- children: "REMOVE"
71
- }) : /*#__PURE__*/_jsx(Grid, {
72
- className: "uploadImageText",
73
- children: /*#__PURE__*/_jsxs(Button, {
74
- component: "label",
75
- variant: "contained",
76
- style: {
77
- background: "none"
78
- },
79
- onClick: handleClick,
80
- children: [/*#__PURE__*/_jsx(UploadBtnIcon, {}), /*#__PURE__*/_jsx("span", {
55
+ item: true,
56
+ xs: 12,
57
+ style: {
58
+ backgroundImage: base64 ? `url(${base64})` : "none",
59
+ height: "200px"
60
+ },
61
+ sx: classes.uploadField,
62
+ children: /*#__PURE__*/_jsx(Grid, {
63
+ className: "uploadImageSection",
64
+ children: base64 ? /*#__PURE__*/_jsx(Grid, {
65
+ className: "removeImageText",
66
+ onClick: onRemoveBG,
67
+ children: "REMOVE"
68
+ }) : /*#__PURE__*/_jsx(Grid, {
69
+ className: "uploadImageText",
70
+ children: /*#__PURE__*/_jsxs(Button, {
71
+ component: "label",
72
+ variant: "text",
81
73
  style: {
82
- paddingLeft: "8px"
74
+ background: "none"
83
75
  },
84
- children: "UPLOAD"
85
- })]
76
+ onClick: handleClick,
77
+ sx: classes.uploadIcon,
78
+ children: [/*#__PURE__*/_jsx(Icon, {
79
+ icon: "fileUpload"
80
+ }), /*#__PURE__*/_jsx("span", {
81
+ style: {
82
+ paddingLeft: "8px"
83
+ },
84
+ children: "upload your image"
85
+ })]
86
+ })
86
87
  })
87
88
  })
88
89
  })
@@ -125,7 +125,7 @@ const StyleBuilder = props => {
125
125
  open: true,
126
126
  className: ` dialogComp tools-drawer`,
127
127
  anchor: "right",
128
- hideBackdrop: true,
128
+ onClose: onClose,
129
129
  children: /*#__PURE__*/_jsxs(Grid, {
130
130
  item: true,
131
131
  xs: 12,
@@ -2,7 +2,8 @@ import React, { useState } from "react";
2
2
  import { Grid, Button } from "@mui/material";
3
3
  import { convertBase64 } from "../utils/helper";
4
4
  import { uploadFile } from "../service/fileupload";
5
- import { UploadBtnIcon } from "./iconslist";
5
+ import Icon from "./Icon";
6
+ import UploadStyles from "../common/ImageSelector/UploadStyles";
6
7
  import { jsx as _jsx } from "react/jsx-runtime";
7
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
8
9
  const Uploader = props => {
@@ -12,6 +13,7 @@ const Uploader = props => {
12
13
  onUploaded,
13
14
  customProps
14
15
  } = props;
16
+ const classes = UploadStyles();
15
17
  const {
16
18
  key
17
19
  } = data;
@@ -33,22 +35,16 @@ const Uploader = props => {
33
35
  const result = await uploadFile(formData, customProps);
34
36
  setUploading(false);
35
37
  if (result && result?.imageURL) {
36
- onUploaded({
37
- [key]: result?.imageURL
38
- });
38
+ onUploaded(result?.imageURL[0]);
39
39
  }
40
40
  };
41
41
  const onRemoveBG = () => {
42
42
  setBase64(null);
43
- onUploaded({
44
- [key]: "none"
45
- });
43
+ onUploaded("none");
46
44
  };
47
45
  return /*#__PURE__*/_jsxs(Grid, {
48
46
  container: true,
49
- sx: {
50
- pt: 1
51
- },
47
+ sx: classes.uploadContainer,
52
48
  children: [/*#__PURE__*/_jsx(Grid, {
53
49
  item: true,
54
50
  xs: 12,
@@ -58,17 +54,9 @@ const Uploader = props => {
58
54
  xs: 12,
59
55
  className: "btn--wrpr",
60
56
  style: {
61
- marginTop: "12px",
62
- width: "100%",
63
- backgroundImage: base64 ? `url(${base64})` : "none",
64
- backgroundSize: "contain",
65
- backgroundRepeat: "no-repeat",
66
- backgroundPosition: "center",
67
- height: "200px",
68
- position: "relative",
69
- backgroundColor: "rgba(0,0,0,0.5)",
70
- borderRadius: "10px"
57
+ backgroundImage: base64 ? `url(${base64})` : "none"
71
58
  },
59
+ sx: classes.uploadField,
72
60
  children: !uploading ? /*#__PURE__*/_jsx(Grid, {
73
61
  className: "uploadImageSection",
74
62
  children: base64 ? /*#__PURE__*/_jsx(Grid, {
@@ -79,10 +67,11 @@ const Uploader = props => {
79
67
  className: "uploadImageText",
80
68
  children: /*#__PURE__*/_jsxs(Button, {
81
69
  component: "label",
82
- variant: "contained",
70
+ variant: "text",
83
71
  style: {
84
72
  background: "none"
85
73
  },
74
+ sx: classes.uploadIcon,
86
75
  children: [/*#__PURE__*/_jsx("input", {
87
76
  type: "file",
88
77
  style: {
@@ -90,11 +79,13 @@ const Uploader = props => {
90
79
  width: "0px"
91
80
  },
92
81
  onChange: handleChange
93
- }), /*#__PURE__*/_jsx(UploadBtnIcon, {}), /*#__PURE__*/_jsx("span", {
82
+ }), /*#__PURE__*/_jsx(Icon, {
83
+ icon: "fileUpload"
84
+ }), /*#__PURE__*/_jsx("span", {
94
85
  style: {
95
86
  paddingLeft: "8px"
96
87
  },
97
- children: "UPLOAD"
88
+ children: "upload your image"
98
89
  })]
99
90
  })
100
91
  })
@@ -1517,4 +1517,16 @@ export const PlusIcon = props => /*#__PURE__*/_jsxs("svg", {
1517
1517
  strokeLinecap: "round",
1518
1518
  strokeLinejoin: "round"
1519
1519
  })]
1520
+ });
1521
+ export const UploadImage = () => /*#__PURE__*/_jsx("svg", {
1522
+ width: "38",
1523
+ height: "32",
1524
+ viewBox: "0 0 38 32",
1525
+ fill: "none",
1526
+ xmlns: "http://www.w3.org/2000/svg",
1527
+ children: /*#__PURE__*/_jsx("path", {
1528
+ d: "M29.8163 9.58251L29.8806 9.91219L30.2101 9.97734C34.3518 10.7964 37.5 14.4866 37.5 18.9474C37.5 24.0138 33.4469 28.1316 28.5 28.1316H23.9565V28.1315L23.9493 28.1316C23.8527 28.133 23.7566 28.1148 23.6665 28.0779C23.5763 28.041 23.4936 27.9859 23.4234 27.9153C23.3532 27.8448 23.2969 27.7601 23.2583 27.6661C23.2197 27.5721 23.1997 27.4709 23.1997 27.3684C23.1997 27.2659 23.2197 27.1647 23.2583 27.0707C23.2969 26.9767 23.3532 26.8921 23.4234 26.8215C23.4936 26.751 23.5763 26.6959 23.6665 26.6589C23.7566 26.622 23.8527 26.6038 23.9493 26.6052V26.6053H23.9565H28.5C32.6778 26.6053 36.0217 23.1825 36.0217 18.9474C36.0217 14.9479 33.0358 11.6747 29.1933 11.3181C29.0288 11.3014 28.8731 11.2281 28.7524 11.1079C28.6315 10.9874 28.553 10.8271 28.532 10.6527C28.2917 8.54527 27.3763 6.49581 25.7849 4.87354L25.428 5.22368L25.7849 4.87354C23.908 2.9603 21.4566 2.02632 19 2.02632C16.5427 2.02632 14.1061 2.95891 12.228 4.87355C10.0597 7.08383 9.14397 10.0853 9.48097 12.9531L9.48133 12.956C9.49474 13.0646 9.48534 13.1749 9.45388 13.2793C9.42242 13.3836 9.36977 13.4793 9.29996 13.5602C9.23016 13.6411 9.1449 13.7053 9.05021 13.7491C8.95574 13.7928 8.85366 13.8154 8.75058 13.8158H8.26087C4.75072 13.8158 1.97826 16.6559 1.97826 20.2105C1.97826 23.7651 4.75072 26.6053 8.26087 26.6053H14.0435V26.6053L14.0507 26.6052C14.1473 26.6038 14.2434 26.622 14.3335 26.6589C14.4237 26.6959 14.5064 26.751 14.5766 26.8215C14.6468 26.8921 14.7031 26.9767 14.7417 27.0707C14.7803 27.1647 14.8003 27.2659 14.8003 27.3684C14.8003 27.4709 14.7803 27.5721 14.7417 27.6661C14.7031 27.7601 14.6468 27.8448 14.5766 27.9153C14.5064 27.9859 14.4237 28.041 14.3335 28.0779C14.2434 28.1148 14.1473 28.133 14.0507 28.1316L14.0507 28.1316H14.0435H8.26087C3.99094 28.1316 0.5 24.5869 0.5 20.2105C0.5 16.0852 3.61641 12.7343 7.55871 12.3663L8.01514 12.3236L8.01222 11.8652C7.99355 8.93435 9.01416 6.01183 11.1864 3.79752L11.1864 3.7975C13.3418 1.60027 16.1735 0.5 19 0.5C21.8271 0.5 24.6696 1.59883 26.8265 3.79751L27.1834 3.44737L26.8265 3.79752C28.4274 5.42941 29.4021 7.45776 29.8163 9.58251ZM19.498 15.0104L19.4991 15.0115L24.0388 19.2184C24.0393 19.2189 24.0399 19.2194 24.0404 19.2199C24.3569 19.521 24.3533 20.0152 24.088 20.3106C23.838 20.5888 23.3218 20.6127 23.0442 20.3568C23.0441 20.3566 23.0439 20.3565 23.0438 20.3564L20.5794 18.0678L19.7391 17.2875V18.4342V30.7368C19.7391 31.1674 19.3993 31.5 19 31.5C18.6007 31.5 18.2609 31.1674 18.2609 30.7368V18.4342V17.2875L17.4206 18.0678L14.9562 20.3564C14.9561 20.3565 14.956 20.3566 14.9558 20.3568C14.6953 20.5969 14.1897 20.5869 13.8934 20.291C13.6373 20.0351 13.6548 19.5086 13.9591 19.2204C13.9595 19.22 13.96 19.2196 13.9604 19.2191L18.5009 15.0115L18.5022 15.0102C18.609 14.9106 18.6645 14.875 18.7115 14.8552C18.7568 14.8362 18.833 14.8158 19 14.8158C19.1494 14.8158 19.2369 14.8398 19.2955 14.8655C19.3563 14.8922 19.4156 14.9336 19.498 15.0104Z",
1529
+ fill: "#64748B",
1530
+ stroke: "#64748B"
1531
+ })
1520
1532
  });
@@ -2,7 +2,8 @@ import { useState } from "react";
2
2
  const useResize = ({
3
3
  parentDOM,
4
4
  size: defaultSize,
5
- isGrid
5
+ isGrid,
6
+ onChange
6
7
  }) => {
7
8
  const {
8
9
  width,
@@ -16,6 +17,9 @@ const useResize = ({
16
17
  ...defaultSize
17
18
  });
18
19
  const [resizing, setResizing] = useState(false);
20
+ let latest = {
21
+ ...size
22
+ };
19
23
  const onLoad = defaultSize => {
20
24
  setSize({
21
25
  widthInPercent: 100,
@@ -31,16 +35,21 @@ const useResize = ({
31
35
  const onMouseUp = () => {
32
36
  document.removeEventListener("pointermove", onMouseMove);
33
37
  document.removeEventListener("pointerup", onMouseUp);
38
+ if (onChange) {
39
+ onChange(latest);
40
+ }
34
41
  setResizing(false);
35
42
  };
36
43
  const onMouseMove = e => {
37
44
  setSize(currentSize => {
38
45
  const calcWidth = (currentSize.width || width) + e.movementX;
39
- return {
46
+ const calc = {
40
47
  width: calcWidth,
41
- height: (currentSize.height || height) + e.movementY,
48
+ height: (parseInt(currentSize.height) || height) + e.movementY,
42
49
  widthInPercent: calcWidth / width * 100
43
50
  };
51
+ latest = calc;
52
+ return calc;
44
53
  });
45
54
  };
46
55
  return [size, onMouseDown, resizing, onLoad];
@@ -20,8 +20,8 @@ export const createEmbedNode = (type, {
20
20
  text: " "
21
21
  }],
22
22
  size: {
23
- widthInPercent: "100%",
24
- height: "auto"
23
+ widthInPercent: "100",
24
+ height: type === "image" ? "auto" : 300
25
25
  },
26
26
  alignment: {
27
27
  horizantal: "center"