@flozy/editor 1.5.1 → 1.5.3

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.
Files changed (38) hide show
  1. package/dist/Editor/CommonEditor.js +14 -3
  2. package/dist/Editor/Editor.css +144 -14
  3. package/dist/Editor/Elements/AppHeader/AppHeader.js +16 -11
  4. package/dist/Editor/Elements/Button/EditorButton.js +16 -7
  5. package/dist/Editor/Elements/Embed/Embed.js +13 -10
  6. package/dist/Editor/Elements/Grid/Grid.js +15 -2
  7. package/dist/Editor/Elements/Grid/GridItem.js +14 -2
  8. package/dist/Editor/Elements/Table/TableSelector.js +6 -4
  9. package/dist/Editor/Toolbar/FormatTools/TextSize.js +73 -0
  10. package/dist/Editor/Toolbar/FormatTools/index.js +2 -1
  11. package/dist/Editor/Toolbar/PopupTool/PopupToolStyle.js +23 -9
  12. package/dist/Editor/Toolbar/PopupTool/TextFormat.js +152 -42
  13. package/dist/Editor/Toolbar/PopupTool/index.js +35 -34
  14. package/dist/Editor/Toolbar/Toolbar.js +6 -1
  15. package/dist/Editor/Toolbar/toolbarGroups.js +9 -9
  16. package/dist/Editor/assets/svg/addGridItem.js +49 -0
  17. package/dist/Editor/common/ColorPickerButton.js +3 -3
  18. package/dist/Editor/common/StyleBuilder/embedImageStyle.js +4 -4
  19. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +32 -15
  20. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +48 -34
  21. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +90 -115
  22. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +93 -101
  23. package/dist/Editor/common/StyleBuilder/fieldTypes/buttonLink.js +24 -5
  24. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +7 -5
  25. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +49 -20
  26. package/dist/Editor/common/StyleBuilder/fieldTypes/icons.js +9 -5
  27. package/dist/Editor/common/StyleBuilder/fieldTypes/menusArray.js +23 -5
  28. package/dist/Editor/common/StyleBuilder/fieldTypes/radiusStyle.js +52 -0
  29. package/dist/Editor/common/StyleBuilder/fieldTypes/saveAsTemplate.js +33 -6
  30. package/dist/Editor/common/StyleBuilder/fieldTypes/selectBox.js +16 -17
  31. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +8 -5
  32. package/dist/Editor/common/StyleBuilder/fieldTypes/textAlign.js +12 -6
  33. package/dist/Editor/common/StyleBuilder/fieldTypes/textOptions.js +28 -23
  34. package/dist/Editor/common/StyleBuilder/gridStyle.js +0 -6
  35. package/dist/Editor/common/StyleBuilder/index.js +70 -44
  36. package/dist/Editor/common/Uploader.js +51 -14
  37. package/dist/Editor/common/iconslist.js +409 -0
  38. package/package.json +1 -1
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
- import { Grid, IconButton, InputAdornment, TextField } from "@mui/material";
2
+ import { Grid, IconButton, InputAdornment, TextField, Typography } from "@mui/material";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { Fragment as _Fragment } from "react/jsx-runtime";
5
6
  const ElementSize = props => {
6
7
  const {
7
8
  value,
@@ -29,19 +30,25 @@ const ElementSize = props => {
29
30
  }
30
31
  });
31
32
  };
32
- return /*#__PURE__*/_jsxs(Grid, {
33
- container: true,
34
- padding: 3,
35
- spacing: 2,
36
- className: "input-adorn",
37
- children: [/*#__PURE__*/_jsx(Grid, {
33
+ return /*#__PURE__*/_jsxs(_Fragment, {
34
+ children: [/*#__PURE__*/_jsxs(Grid, {
38
35
  item: true,
39
36
  xs: 12,
40
- md: 6,
41
- children: /*#__PURE__*/_jsx(TextField, {
37
+ style: {
38
+ marginBottom: "12px"
39
+ },
40
+ children: [/*#__PURE__*/_jsx(Typography, {
41
+ variant: "body1",
42
+ color: "primary",
43
+ sx: {
44
+ fontSize: "14px",
45
+ fontWeight: "500",
46
+ marginBottom: "5px"
47
+ },
48
+ children: "Width"
49
+ }), /*#__PURE__*/_jsx(TextField, {
42
50
  fullWidth: true,
43
51
  name: wkey,
44
- label: "Width",
45
52
  size: "small",
46
53
  value: value ? value[wkey] : "100",
47
54
  placeholder: "Width",
@@ -57,7 +64,10 @@ const ElementSize = props => {
57
64
  widthInPercent: null,
58
65
  width: isNaN(value?.width) ? 100 : value?.width || 100
59
66
  }),
60
- children: "PX"
67
+ children: /*#__PURE__*/_jsx(Typography, {
68
+ variant: "body2",
69
+ children: "PX"
70
+ })
61
71
  }), /*#__PURE__*/_jsx(IconButton, {
62
72
  className: widthType === "%" ? "active" : "",
63
73
  size: "small",
@@ -65,20 +75,33 @@ const ElementSize = props => {
65
75
  widthType: "%",
66
76
  widthInPercent: value?.widthInPercent || 100
67
77
  }),
68
- children: "%"
78
+ children: /*#__PURE__*/_jsx(Typography, {
79
+ variant: "body2",
80
+ children: "%"
81
+ })
69
82
  })]
70
83
  })
71
84
  }
72
- })
73
- }), /*#__PURE__*/_jsx(Grid, {
85
+ })]
86
+ }), /*#__PURE__*/_jsxs(Grid, {
74
87
  item: true,
75
88
  xs: 12,
76
- md: 6,
77
- children: /*#__PURE__*/_jsx(TextField, {
89
+ sx: {
90
+ paddingTop: "12px"
91
+ },
92
+ children: [/*#__PURE__*/_jsx(Typography, {
93
+ variant: "body1",
94
+ color: "primary",
95
+ sx: {
96
+ fontSize: "14px",
97
+ fontWeight: "500",
98
+ marginBottom: "5px"
99
+ },
100
+ children: "Height"
101
+ }), /*#__PURE__*/_jsx(TextField, {
78
102
  fullWidth: true,
79
103
  name: "height",
80
104
  size: "small",
81
- label: "Height",
82
105
  value: value?.height,
83
106
  placeholder: "Height",
84
107
  helperText: "Leave it to auto if width is in % ",
@@ -92,18 +115,24 @@ const ElementSize = props => {
92
115
  onClick: onSizeType({
93
116
  height: value?.height || ""
94
117
  }),
95
- children: "PX"
118
+ children: /*#__PURE__*/_jsx(Typography, {
119
+ variant: "body2",
120
+ children: "PX"
121
+ })
96
122
  }), /*#__PURE__*/_jsx(IconButton, {
97
123
  className: value?.height === "" ? "active" : "",
98
124
  size: "small",
99
125
  onClick: onSizeType({
100
126
  height: ""
101
127
  }),
102
- children: "auto"
128
+ children: /*#__PURE__*/_jsx(Typography, {
129
+ variant: "body2",
130
+ children: "auto"
131
+ })
103
132
  })]
104
133
  })
105
134
  }
106
- })
135
+ })]
107
136
  })]
108
137
  });
109
138
  };
@@ -60,12 +60,14 @@ const Icons = props => {
60
60
  container: true,
61
61
  style: {
62
62
  display: "flex",
63
- alignItems: "center",
64
- padding: "12px"
63
+ alignItems: "center"
65
64
  },
66
65
  children: [/*#__PURE__*/_jsx(Grid, {
67
66
  item: true,
68
- xs: 10,
67
+ xs: SelectedIcon ? 10 : 12,
68
+ style: {
69
+ paddingRight: "5px"
70
+ },
69
71
  children: /*#__PURE__*/_jsx(TextField, {
70
72
  fullWidth: true,
71
73
  size: "small",
@@ -73,9 +75,10 @@ const Icons = props => {
73
75
  value: val,
74
76
  onChange: handleChange
75
77
  })
76
- }), /*#__PURE__*/_jsx(Grid, {
78
+ }), SelectedIcon && /*#__PURE__*/_jsx(Grid, {
77
79
  item: true,
78
80
  xs: 2,
81
+ className: "selctedBtnIcon",
79
82
  style: {
80
83
  paddingLeft: "8px"
81
84
  },
@@ -88,7 +91,8 @@ const Icons = props => {
88
91
  textAlign: "center",
89
92
  style: {
90
93
  maxHeight: "200px",
91
- overflowY: "auto"
94
+ overflowY: "auto",
95
+ paddingTop: "5px"
92
96
  },
93
97
  children: list.map(m => {
94
98
  const Ico = fIcons[m];
@@ -43,13 +43,13 @@ const MenusArray = props => {
43
43
  });
44
44
  };
45
45
  const handleVariant = e => {
46
+ console.log(e.target.name);
46
47
  onChange({
47
48
  [e.target.name]: e.target.value
48
49
  });
49
50
  };
50
51
  return /*#__PURE__*/_jsxs(Grid, {
51
52
  container: true,
52
- padding: 1,
53
53
  spacing: 2,
54
54
  children: [/*#__PURE__*/_jsx(Grid, {
55
55
  item: true,
@@ -59,9 +59,10 @@ const MenusArray = props => {
59
59
  id: "demo-radio-buttons-group-label",
60
60
  children: /*#__PURE__*/_jsx(Typography, {
61
61
  variant: "body1",
62
- color: "textSecondary",
62
+ color: "primary",
63
63
  sx: {
64
- fontSize: "14px"
64
+ fontSize: "14px",
65
+ fontWeight: "500"
65
66
  },
66
67
  children: "Menu Variant"
67
68
  })
@@ -76,12 +77,26 @@ const MenusArray = props => {
76
77
  value: "stacked",
77
78
  checked: menuStyle === "stacked",
78
79
  control: /*#__PURE__*/_jsx(Radio, {}),
79
- label: "Stacked"
80
+ label: /*#__PURE__*/_jsx(Typography, {
81
+ variant: "body1",
82
+ color: "primary",
83
+ sx: {
84
+ fontSize: "14px"
85
+ },
86
+ children: "Stacked"
87
+ })
80
88
  }), /*#__PURE__*/_jsx(FormControlLabel, {
81
89
  value: "drawer",
82
90
  checked: menuStyle === "drawer",
83
91
  control: /*#__PURE__*/_jsx(Radio, {}),
84
- label: "Drawer"
92
+ label: /*#__PURE__*/_jsx(Typography, {
93
+ variant: "body1",
94
+ color: "primary",
95
+ sx: {
96
+ fontSize: "14px"
97
+ },
98
+ children: "Drawer"
99
+ })
85
100
  })]
86
101
  })]
87
102
  })
@@ -123,6 +138,9 @@ const MenusArray = props => {
123
138
  xs: 12,
124
139
  children: /*#__PURE__*/_jsx(Button, {
125
140
  onClick: onAddMenu,
141
+ sx: {
142
+ fontWeight: 700
143
+ },
126
144
  children: "+ Add"
127
145
  })
128
146
  })]
@@ -0,0 +1,52 @@
1
+ export const radiusStyle = {
2
+ topLeft: {
3
+ position: "absolute",
4
+ left: "-25px",
5
+ top: "-28px",
6
+ width: "30px",
7
+ height: "30px",
8
+ margin: "auto",
9
+ borderTop: `1px solid #64748B`,
10
+ borderLeft: `1px solid #64748B`,
11
+ borderRight: `none`,
12
+ borderBottom: `none`,
13
+ fontSize: "14px",
14
+ textAlign: "center"
15
+ },
16
+ topRight: {
17
+ position: "absolute",
18
+ top: "-28px",
19
+ right: "-25px",
20
+ width: "30px",
21
+ height: "30px",
22
+ borderTop: `1px solid #64748B`,
23
+ borderRight: `1px solid #64748B`,
24
+ borderBottom: `none`,
25
+ borderLeft: `none`,
26
+ fontSize: "14px"
27
+ },
28
+ bottomLeft: {
29
+ position: "absolute",
30
+ left: "-25px",
31
+ bottom: "-28px",
32
+ width: "30px",
33
+ height: "30px",
34
+ borderBottom: `1px solid #64748B`,
35
+ borderLeft: `1px solid #64748B`,
36
+ borderRight: `none`,
37
+ borderTop: `none`,
38
+ fontSize: "14px"
39
+ },
40
+ bottomRight: {
41
+ position: "absolute",
42
+ bottom: "-28px",
43
+ right: "-25px",
44
+ width: "30px",
45
+ height: "30px",
46
+ borderBottom: `1px solid #64748B`,
47
+ borderRight: `1px solid #64748B`,
48
+ borderTop: "none",
49
+ borderLeft: "none",
50
+ fontSize: "14px"
51
+ }
52
+ };
@@ -75,14 +75,15 @@ const SaveAsTemplate = props => {
75
75
  container: true,
76
76
  spacing: 2,
77
77
  children: [/*#__PURE__*/_jsx(Grid, {
78
- itemx: true,
78
+ item: true,
79
79
  xs: 12,
80
80
  children: /*#__PURE__*/_jsx(TextField, {
81
81
  name: "title",
82
82
  value: template?.title,
83
83
  onChange: onChange,
84
84
  placeholder: "Template Title",
85
- fullWidth: true
85
+ fullWidth: true,
86
+ size: "small"
86
87
  })
87
88
  }), /*#__PURE__*/_jsx(Grid, {
88
89
  item: true,
@@ -92,15 +93,37 @@ const SaveAsTemplate = props => {
92
93
  value: template?.type,
93
94
  name: "type",
94
95
  onChange: onChange,
96
+ size: "small",
95
97
  children: [/*#__PURE__*/_jsx(MenuItem, {
96
98
  value: "Element",
97
- children: "Element"
99
+ children: /*#__PURE__*/_jsx(Typography, {
100
+ variant: "body1",
101
+ color: "primary",
102
+ sx: {
103
+ fontSize: "14px"
104
+ },
105
+ children: "Element"
106
+ })
98
107
  }), /*#__PURE__*/_jsx(MenuItem, {
99
108
  value: "Section",
100
- children: "Section"
109
+ children: /*#__PURE__*/_jsx(Typography, {
110
+ variant: "body1",
111
+ color: "primary",
112
+ sx: {
113
+ fontSize: "14px"
114
+ },
115
+ children: "Section"
116
+ })
101
117
  }), /*#__PURE__*/_jsx(MenuItem, {
102
118
  value: "Templates",
103
- children: "Templates"
119
+ children: /*#__PURE__*/_jsx(Typography, {
120
+ variant: "body1",
121
+ color: "primary",
122
+ sx: {
123
+ fontSize: "14px"
124
+ },
125
+ children: "Templates"
126
+ })
104
127
  })]
105
128
  })
106
129
  }), /*#__PURE__*/_jsx(Grid, {
@@ -110,7 +133,8 @@ const SaveAsTemplate = props => {
110
133
  fullWidth: true,
111
134
  name: "category",
112
135
  value: template?.category,
113
- onChange: onChange
136
+ onChange: onChange,
137
+ size: "small"
114
138
  })
115
139
  }), /*#__PURE__*/_jsxs(Grid, {
116
140
  item: true,
@@ -166,6 +190,9 @@ const SaveAsTemplate = props => {
166
190
  },
167
191
  children: /*#__PURE__*/_jsx(Button, {
168
192
  onClick: handleSave,
193
+ sx: {
194
+ fontWeight: 700
195
+ },
169
196
  children: "Save As Template"
170
197
  })
171
198
  })]
@@ -17,23 +17,22 @@ const SelectBox = props => {
17
17
  [key]: e.target.checked
18
18
  });
19
19
  };
20
- return /*#__PURE__*/_jsx(Grid, {
21
- container: true,
22
- padding: 1,
23
- children: /*#__PURE__*/_jsxs(Grid, {
24
- item: true,
25
- xs: 12,
26
- children: [/*#__PURE__*/_jsx(FormControlLabel, {
27
- control: /*#__PURE__*/_jsx(Checkbox, {
28
- value: value,
29
- checked: value,
30
- onChange: handleChange
31
- }),
32
- label: placeholder
33
- }), /*#__PURE__*/_jsx(FormHelperText, {
34
- children: data?.helperText
35
- })]
36
- })
20
+ return /*#__PURE__*/_jsxs(Grid, {
21
+ item: true,
22
+ xs: 12,
23
+ style: {
24
+ marginBottom: "12px"
25
+ },
26
+ children: [/*#__PURE__*/_jsx(FormControlLabel, {
27
+ control: /*#__PURE__*/_jsx(Checkbox, {
28
+ value: value,
29
+ checked: value,
30
+ onChange: handleChange
31
+ }),
32
+ label: placeholder
33
+ }), /*#__PURE__*/_jsx(FormHelperText, {
34
+ children: data?.helperText
35
+ })]
37
36
  });
38
37
  };
39
38
  export default SelectBox;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import { Grid, TextField, Typography } from "@mui/material";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { Fragment as _Fragment } from "react/jsx-runtime";
4
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
5
6
  const Text = props => {
6
7
  const {
@@ -17,9 +18,7 @@ const Text = props => {
17
18
  [key]: e.target.value
18
19
  });
19
20
  };
20
- return /*#__PURE__*/_jsxs(Grid, {
21
- container: true,
22
- padding: 1,
21
+ return /*#__PURE__*/_jsxs(_Fragment, {
23
22
  children: [/*#__PURE__*/_jsx(Grid, {
24
23
  item: true,
25
24
  xs: 12,
@@ -28,15 +27,19 @@ const Text = props => {
28
27
  },
29
28
  children: /*#__PURE__*/_jsx(Typography, {
30
29
  variant: "body1",
31
- color: "textSecondary",
30
+ color: "primary",
32
31
  sx: {
33
- fontSize: "14px"
32
+ fontSize: "14px",
33
+ fontWeight: "500"
34
34
  },
35
35
  children: data?.label
36
36
  })
37
37
  }), /*#__PURE__*/_jsx(Grid, {
38
38
  item: true,
39
39
  xs: 12,
40
+ style: {
41
+ marginBottom: "16px"
42
+ },
40
43
  children: /*#__PURE__*/_jsx(TextField, {
41
44
  name: key,
42
45
  placeholder: placeholder || "",
@@ -1,5 +1,6 @@
1
1
  import React from "react";
2
2
  import { Grid, Radio, RadioGroup, FormControl, FormLabel, FormControlLabel, Typography } from "@mui/material";
3
+ import { TextCenterAlign, TextLeftAlign, TextRightAlign } from "../../iconslist";
3
4
  import { jsx as _jsx } from "react/jsx-runtime";
4
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
5
6
  const TextAlign = props => {
@@ -18,9 +19,6 @@ const TextAlign = props => {
18
19
  };
19
20
  return /*#__PURE__*/_jsx(Grid, {
20
21
  container: true,
21
- style: {
22
- paddingTop: "12px"
23
- },
24
22
  spacing: 1,
25
23
  children: /*#__PURE__*/_jsx(Grid, {
26
24
  item: true,
@@ -31,6 +29,10 @@ const TextAlign = props => {
31
29
  children: /*#__PURE__*/_jsx(Typography, {
32
30
  variant: "body1",
33
31
  color: "primary",
32
+ style: {
33
+ fontWeight: 500,
34
+ fontSize: "14px"
35
+ },
34
36
  children: "Text Alignment"
35
37
  })
36
38
  }), /*#__PURE__*/_jsxs(RadioGroup, {
@@ -39,18 +41,22 @@ const TextAlign = props => {
39
41
  name: "textAlign",
40
42
  value: value || "left",
41
43
  onChange: handleChange,
44
+ className: "iconRadioButton",
42
45
  children: [/*#__PURE__*/_jsx(FormControlLabel, {
43
46
  value: "left",
47
+ className: `${value === "left" && "active"}`,
44
48
  control: /*#__PURE__*/_jsx(Radio, {}),
45
- label: "Left"
49
+ label: /*#__PURE__*/_jsx(TextLeftAlign, {})
46
50
  }), /*#__PURE__*/_jsx(FormControlLabel, {
47
51
  value: "center",
52
+ className: `${value === "center" && "active"}`,
48
53
  control: /*#__PURE__*/_jsx(Radio, {}),
49
- label: "Center"
54
+ label: /*#__PURE__*/_jsx(TextCenterAlign, {})
50
55
  }), /*#__PURE__*/_jsx(FormControlLabel, {
51
56
  value: "right",
57
+ className: `${value === "right" && "active"}`,
52
58
  control: /*#__PURE__*/_jsx(Radio, {}),
53
- label: "Right"
59
+ label: /*#__PURE__*/_jsx(TextRightAlign, {})
54
60
  })]
55
61
  })]
56
62
  })
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
- import { Grid, MenuItem, Select } from "@mui/material";
2
+ import { Grid, MenuItem, Select, Typography } from "@mui/material";
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { Fragment as _Fragment } from "react/jsx-runtime";
4
5
  import { jsxs as _jsxs } from "react/jsx-runtime";
5
6
  const TextOptions = props => {
6
7
  const {
@@ -18,34 +19,38 @@ const TextOptions = props => {
18
19
  [key]: e.target.value
19
20
  });
20
21
  };
21
- return /*#__PURE__*/_jsx(Grid, {
22
- container: true,
23
- children: /*#__PURE__*/_jsxs(Grid, {
22
+ return /*#__PURE__*/_jsxs(_Fragment, {
23
+ children: [/*#__PURE__*/_jsx(Grid, {
24
24
  item: true,
25
25
  xs: 12,
26
26
  style: {
27
- padding: "10px"
27
+ marginBottom: "5px"
28
28
  },
29
- children: [/*#__PURE__*/_jsx("label", {
30
- style: {
31
- marginBottom: "8px",
32
- display: "flex"
29
+ children: /*#__PURE__*/_jsx(Typography, {
30
+ variant: "body1",
31
+ color: "primary",
32
+ sx: {
33
+ fontSize: "14px",
34
+ fontWeight: "500"
33
35
  },
34
36
  children: data?.label
35
- }), /*#__PURE__*/_jsx(Select, {
36
- onChange: handleChange,
37
- value: value || options[0]?.value,
38
- placeholder: data?.label,
39
- fullWidth: true,
40
- size: "small",
41
- children: options.map(m => {
42
- return /*#__PURE__*/_jsx(MenuItem, {
43
- value: m.value,
44
- children: renderOption ? renderOption(m) : m.label || m.text
45
- }, `${key}_${m.value}`);
46
- })
47
- })]
48
- })
37
+ })
38
+ }), /*#__PURE__*/_jsx(Select, {
39
+ onChange: handleChange,
40
+ value: value || options[0]?.value,
41
+ placeholder: data?.label,
42
+ fullWidth: true,
43
+ size: "small",
44
+ style: {
45
+ marginBottom: "16px"
46
+ },
47
+ children: options.map(m => {
48
+ return /*#__PURE__*/_jsx(MenuItem, {
49
+ value: m.value,
50
+ children: renderOption ? renderOption(m) : m.label || m.text
51
+ }, `${key}_${m.value}`);
52
+ })
53
+ })]
49
54
  });
50
55
  };
51
56
  export default TextOptions;
@@ -7,12 +7,6 @@ const gridStyle = [{
7
7
  key: "id",
8
8
  type: "text",
9
9
  placeholder: "Id should be unique for the page..."
10
- }, {
11
- label: "Copy Grid",
12
- key: "copyGrid",
13
- type: "selectBox",
14
- placeholder: "Copy Grid",
15
- helperText: "This Grid will get copied when creating a new page from this page."
16
10
  }]
17
11
  }, {
18
12
  tab: "Padding",