@flozy/editor 1.4.6 → 1.4.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -32,7 +32,6 @@ const EditorButton = props => {
32
32
  bannerSpacing,
33
33
  textColor,
34
34
  url,
35
- borderColor,
36
35
  buttonLink,
37
36
  textSize,
38
37
  textAlign,
@@ -40,7 +39,10 @@ const EditorButton = props => {
40
39
  textColorHover,
41
40
  bgColorHover,
42
41
  buttonIcon,
43
- iconPosition
42
+ iconPosition,
43
+ borderStyle,
44
+ borderWidth,
45
+ borderColor
44
46
  } = element;
45
47
  const {
46
48
  linkType,
@@ -119,7 +121,7 @@ const EditorButton = props => {
119
121
  const onClose = () => {
120
122
  setEdit(false);
121
123
  };
122
- const borderStyle = borderColor?.indexOf("linear") >= 0 ? {
124
+ const borderStyleColor = borderColor?.indexOf("linear") >= 0 ? {
123
125
  borderImageSource: borderColor,
124
126
  borderImageSlice: 1
125
127
  } : {
@@ -142,10 +144,12 @@ const EditorButton = props => {
142
144
  component: "button",
143
145
  sx: {
144
146
  background: bgColor || "rgb(30, 75, 122)",
145
- borderWidth: "1px",
146
147
  borderBlockStyle: "solid",
147
- ...borderStyle,
148
+ // ...borderStyleColor,
149
+ borderColor: borderColor || "transparent",
150
+ borderWidth: borderWidth || "1px",
148
151
  borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
152
+ borderStyle: borderStyle || "solid",
149
153
  paddingLeft: `${left || 8}px`,
150
154
  paddingRight: `${right || 8}px`,
151
155
  paddingTop: `${top || 8}px`,
@@ -27,8 +27,30 @@ const Form = props => {
27
27
  const {
28
28
  buttonProps,
29
29
  textColor,
30
- formName
30
+ formName,
31
+ borderWidth,
32
+ borderColor,
33
+ borderStyle,
34
+ borderRadius,
35
+ bannerSpacing,
36
+ bgColor,
37
+ formTitle,
38
+ textSize,
39
+ fontFamily,
40
+ textAlign
31
41
  } = element;
42
+ const {
43
+ left,
44
+ top,
45
+ right,
46
+ bottom
47
+ } = bannerSpacing || {};
48
+ const {
49
+ topLeft,
50
+ topRight,
51
+ bottomLeft,
52
+ bottomRight
53
+ } = borderRadius || {};
32
54
  const btnR = buttonProps?.borderRadius || {};
33
55
  const btnSpacing = buttonProps?.bannerSpacing || {};
34
56
  const btnAlign = buttonProps?.alignment || {};
@@ -152,6 +174,10 @@ const Form = props => {
152
174
  return /*#__PURE__*/_jsxs("div", {
153
175
  className: "",
154
176
  contentEditable: false,
177
+ style: {
178
+ backgroundColor: "#ccc",
179
+ width: "fit-content"
180
+ },
155
181
  children: [/*#__PURE__*/_jsx(Tooltip, {
156
182
  title: "Form Settings",
157
183
  arrow: true,
@@ -187,47 +213,71 @@ const Form = props => {
187
213
  id: `${formName}`,
188
214
  onSubmit: handleSubmit,
189
215
  style: {
190
- color: textColor || "#FFF"
216
+ color: textColor || "#FFF",
217
+ borderColor: borderColor || "transparent",
218
+ borderWidth: borderWidth || "1px",
219
+ borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
220
+ borderStyle: borderStyle || "solid",
221
+ background: bgColor || "transparent",
222
+ paddingLeft: `${left}px`,
223
+ paddingRight: `${right}px`,
224
+ paddingTop: `${top}px`,
225
+ paddingBottom: `${bottom}px`
191
226
  },
192
227
  ref: formEle,
193
- children: [/*#__PURE__*/_jsxs(Grid, {
194
- container: true,
228
+ children: [/*#__PURE__*/_jsx(Grid, {
229
+ className: "form-grid",
230
+ item: true,
231
+ xs: 12,
195
232
  spacing: 2,
196
- children: [children, /*#__PURE__*/_jsx(Grid, {
197
- item: true,
198
- xs: buttonProps?.grid || 6,
199
- className: "form-btn-wrpr",
200
- contentEditable: false,
201
- style: {
202
- display: "flex",
203
- justifyContent: btnAlign?.horizantal || "start",
204
- alignItems: btnAlign?.vertical || "start"
205
- },
206
- children: /*#__PURE__*/_jsx("button", {
207
- onClick: onSubmitClick,
208
- disabled: loading,
233
+ children: /*#__PURE__*/_jsxs(Grid, {
234
+ container: true,
235
+ spacing: 2,
236
+ children: [/*#__PURE__*/_jsx("legend", {
209
237
  style: {
210
- background: buttonProps?.bgColor || "rgb(30, 75, 122)",
211
- borderWidth: "1px",
212
- borderBlockStyle: "solid",
213
- ...btnBorderStyle,
214
- borderRadius: `${btnR?.topLeft}px ${btnR?.topRight}px ${btnR?.bottomLeft}px ${btnR?.bottomRight}px`,
215
- paddingLeft: `${btnSpacing?.left || 8}px`,
216
- paddingRight: `${btnSpacing?.right || 8}px`,
217
- paddingTop: `${btnSpacing?.top || 8}px`,
218
- paddingBottom: `${btnSpacing?.bottom || 8}px`,
219
- marginLeft: `${btnM?.left || 0}px`,
220
- marginRight: `${btnM?.right || 0}px`,
221
- marginTop: `${btnM?.top || 0}px`,
222
- marginBottom: `${btnM?.bottom || 0}px`,
223
- color: `${buttonProps?.textColor || "#FFFFFF"}`,
224
- fontSize: buttonProps?.textSize || "inherit",
225
- height: "fit-content",
226
- fontFamily: buttonProps?.fontFamily || "PoppinsRegular"
238
+ fontSize: textSize || "inherit",
239
+ fontFamily: fontFamily || "PoppinsRegular",
240
+ textAlign: textAlign || "left",
241
+ width: "100%"
227
242
  },
228
- children: buttonProps?.label || "Submit"
229
- })
230
- })]
243
+ children: formTitle
244
+ }), children, /*#__PURE__*/_jsx(Grid, {
245
+ item: true,
246
+ xs: buttonProps?.grid || 6,
247
+ className: "form-btn-wrpr",
248
+ contentEditable: false,
249
+ style: {
250
+ display: "flex",
251
+ justifyContent: btnAlign?.horizantal || "start",
252
+ alignItems: btnAlign?.vertical || "start"
253
+ },
254
+ children: /*#__PURE__*/_jsx("button", {
255
+ onClick: onSubmitClick,
256
+ disabled: loading,
257
+ style: {
258
+ background: buttonProps?.bgColor || "rgb(30, 75, 122)",
259
+ borderWidth: "1px",
260
+ borderBlockStyle: "solid",
261
+ ...btnBorderStyle,
262
+ borderRadius: `${btnR?.topLeft}px ${btnR?.topRight}px ${btnR?.bottomLeft}px ${btnR?.bottomRight}px`,
263
+ paddingLeft: `${btnSpacing?.left || 8}px`,
264
+ paddingRight: `${btnSpacing?.right || 8}px`,
265
+ paddingTop: `${btnSpacing?.top || 8}px`,
266
+ paddingBottom: `${btnSpacing?.bottom || 8}px`,
267
+ marginLeft: `${btnM?.left || 0}px`,
268
+ marginRight: `${btnM?.right || 0}px`,
269
+ marginTop: `${btnM?.top || 0}px`,
270
+ marginBottom: `${btnM?.bottom || 0}px`,
271
+ color: `${buttonProps?.textColor || "#FFFFFF"}`,
272
+ fontSize: buttonProps?.textSize || "inherit",
273
+ height: "fit-content",
274
+ fontFamily: buttonProps?.fontFamily || "PoppinsRegular",
275
+ width: buttonProps?.fullWidth ? "100%" : "auto"
276
+ },
277
+ children: buttonProps?.label || "Submit"
278
+ })
279
+ })]
280
+ })
231
281
  }), loading && /*#__PURE__*/_jsx("div", {
232
282
  style: {
233
283
  position: "absolute",
@@ -5,10 +5,14 @@ const FormText = props => {
5
5
  fieldProps
6
6
  } = props;
7
7
  const {
8
- borderColor,
9
8
  bannerSpacing,
9
+ height,
10
10
  borderRadius,
11
- height
11
+ borderStyle,
12
+ borderWidth,
13
+ borderColor,
14
+ textColor,
15
+ bgColor
12
16
  } = fieldProps;
13
17
  const {
14
18
  left,
@@ -37,12 +41,17 @@ const FormText = props => {
37
41
  style: {
38
42
  width: "100%",
39
43
  border: `1px solid ${borderColor || "#FFF"}`,
40
- borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
41
44
  paddingLeft: `${left || 8}px`,
42
45
  paddingRight: `${right || 8}px`,
43
46
  paddingTop: `${top || 8}px`,
44
47
  paddingBottom: `${bottom || 8}px`,
45
- height: height || "auto"
48
+ height: height || "auto",
49
+ borderColor: borderColor || "transparent",
50
+ borderWidth: borderWidth || "1px",
51
+ borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
52
+ borderStyle: borderStyle || "solid",
53
+ color: textColor || "#000",
54
+ background: bgColor || "transparent"
46
55
  }
47
56
  })
48
57
  });
@@ -5,10 +5,14 @@ const FormTextArea = props => {
5
5
  fieldProps
6
6
  } = props;
7
7
  const {
8
- borderColor,
9
8
  bannerSpacing,
9
+ height,
10
10
  borderRadius,
11
- height
11
+ borderStyle,
12
+ borderWidth,
13
+ borderColor,
14
+ textColor,
15
+ bgColor
12
16
  } = fieldProps;
13
17
  const {
14
18
  left,
@@ -22,7 +26,6 @@ const FormTextArea = props => {
22
26
  bottomLeft,
23
27
  bottomRight
24
28
  } = borderRadius || {};
25
- console.log(fieldProps);
26
29
  const onChange = e => {
27
30
  e.preventDefault();
28
31
  };
@@ -38,12 +41,17 @@ const FormTextArea = props => {
38
41
  style: {
39
42
  width: "100%",
40
43
  border: `1px solid ${borderColor || "#FFF"}`,
41
- borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
42
44
  paddingLeft: `${left || 8}px`,
43
45
  paddingRight: `${right || 8}px`,
44
46
  paddingTop: `${top || 8}px`,
45
47
  paddingBottom: `${bottom || 8}px`,
46
- height: height || "150px"
48
+ height: height || "150px",
49
+ borderColor: borderColor || "transparent",
50
+ borderWidth: borderWidth || "1px",
51
+ borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
52
+ borderStyle: borderStyle || "solid",
53
+ color: textColor || "#000",
54
+ background: bgColor || "transparent"
47
55
  }
48
56
  })
49
57
  });
@@ -31,9 +31,12 @@ const Grid = props => {
31
31
  bgColor,
32
32
  alignment,
33
33
  backgroundImage,
34
- borderColor,
35
34
  size: elSize,
36
- fgColor
35
+ fgColor,
36
+ borderWidth,
37
+ borderColor,
38
+ borderStyle,
39
+ borderRadius
37
40
  } = element;
38
41
  const {
39
42
  left,
@@ -46,6 +49,12 @@ const Grid = props => {
46
49
  horizantal,
47
50
  flexDirection
48
51
  } = alignment || {};
52
+ const {
53
+ topLeft,
54
+ topRight,
55
+ bottomLeft,
56
+ bottomRight
57
+ } = borderRadius || {};
49
58
  const {
50
59
  height: elHeight
51
60
  } = elSize || {};
@@ -217,7 +226,10 @@ const Grid = props => {
217
226
  background: bgColor,
218
227
  alignContent: vertical,
219
228
  backgroundImage: backgroundImage && backgroundImage !== "none" ? `url(${backgroundImage})` : "none",
220
- border: `1px solid ${borderColor}`
229
+ borderColor: borderColor || "transparent",
230
+ borderWidth: borderWidth || "1px",
231
+ borderRadius: `${topLeft}px ${topRight}px ${bottomLeft}px ${bottomRight}px`,
232
+ borderStyle: borderStyle || "solid"
221
233
  },
222
234
  children: [fgColor && /*#__PURE__*/_jsx("div", {
223
235
  style: {
@@ -83,12 +83,39 @@ const buttonStyle = [{
83
83
  type: "bannerSpacing"
84
84
  }]
85
85
  }, {
86
- tab: "Border Radius",
87
- value: "borderRadius",
86
+ tab: "Border",
87
+ value: "border",
88
88
  fields: [{
89
89
  label: "Border Radius",
90
90
  key: "borderRadius",
91
91
  type: "borderRadius"
92
+ }, {
93
+ label: "Border Width",
94
+ key: "borderWidth",
95
+ type: "text",
96
+ placeholder: "1px"
97
+ }, {
98
+ label: "Border Style",
99
+ key: "borderStyle",
100
+ type: "textOptions",
101
+ options: [{
102
+ text: "Solid",
103
+ value: "solid"
104
+ }, {
105
+ text: "Dotted",
106
+ value: "dotted"
107
+ }, {
108
+ text: "Dashed",
109
+ value: "dashed"
110
+ }],
111
+ renderOption: option => {
112
+ return /*#__PURE__*/_jsx("span", {
113
+ style: {
114
+ fontFamily: option.value
115
+ },
116
+ children: option.text
117
+ });
118
+ }
92
119
  }]
93
120
  }, {
94
121
  tab: "Colors",
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  const fieldStyle = [{
2
3
  tab: "General",
3
4
  value: "general",
@@ -30,12 +31,39 @@ const fieldStyle = [{
30
31
  type: "bannerSpacing"
31
32
  }]
32
33
  }, {
33
- tab: "Border Radius",
34
- value: "borderRadius",
34
+ tab: "Border",
35
+ value: "border",
35
36
  fields: [{
36
37
  label: "Border Radius",
37
38
  key: "borderRadius",
38
39
  type: "borderRadius"
40
+ }, {
41
+ label: "Border Width",
42
+ key: "borderWidth",
43
+ type: "text",
44
+ placeholder: "1px"
45
+ }, {
46
+ label: "Border Style",
47
+ key: "borderStyle",
48
+ type: "textOptions",
49
+ options: [{
50
+ text: "Solid",
51
+ value: "solid"
52
+ }, {
53
+ text: "Dotted",
54
+ value: "dotted"
55
+ }, {
56
+ text: "Dashed",
57
+ value: "dashed"
58
+ }],
59
+ renderOption: option => {
60
+ return /*#__PURE__*/_jsx("span", {
61
+ style: {
62
+ fontFamily: option.value
63
+ },
64
+ children: option.text
65
+ });
66
+ }
39
67
  }]
40
68
  }, {
41
69
  tab: "Colors",
@@ -72,7 +72,7 @@ const Color = props => {
72
72
  color: "textSecondary",
73
73
  sx: {
74
74
  fontSize: "14px",
75
- marginBottom: '5px'
75
+ marginBottom: "5px"
76
76
  },
77
77
  children: label
78
78
  }), /*#__PURE__*/_jsx(TextField, {
@@ -30,6 +30,11 @@ const formButtonStyle = [{
30
30
  key: "textAlign",
31
31
  type: "textAlign",
32
32
  placeholder: "16px or 1em"
33
+ }, {
34
+ label: "Full Width",
35
+ key: "fullWidth",
36
+ type: "selectBox",
37
+ placeholder: "Set Button Width to full"
33
38
  }]
34
39
  }, {
35
40
  tab: "Position",
@@ -1,3 +1,5 @@
1
+ import { fontOptions } from "../../utils/font";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
1
3
  const formStyle = [{
2
4
  tab: "General",
3
5
  value: "general",
@@ -16,6 +18,37 @@ const formStyle = [{
16
18
  type: "selectBox",
17
19
  placeholder: "Save Response"
18
20
  }]
21
+ }, {
22
+ tab: "Form Title",
23
+ value: "formTitle",
24
+ fields: [{
25
+ label: "Title",
26
+ key: "formTitle",
27
+ type: "text"
28
+ }, {
29
+ label: "Font Size",
30
+ key: "textSize",
31
+ type: "text",
32
+ placeholder: "16px or 1em"
33
+ }, {
34
+ label: "Font Family",
35
+ key: "fontFamily",
36
+ type: "textOptions",
37
+ options: fontOptions,
38
+ renderOption: option => {
39
+ return /*#__PURE__*/_jsx("span", {
40
+ style: {
41
+ fontFamily: option.value
42
+ },
43
+ children: option.text
44
+ });
45
+ }
46
+ }, {
47
+ label: "Text Align",
48
+ key: "textAlign",
49
+ type: "textAlign",
50
+ placeholder: "16px or 1em"
51
+ }]
19
52
  }, {
20
53
  tab: "Banner Spacing",
21
54
  value: "bannerSpacing",
@@ -25,12 +58,39 @@ const formStyle = [{
25
58
  type: "bannerSpacing"
26
59
  }]
27
60
  }, {
28
- tab: "Border Radius",
29
- value: "borderRadius",
61
+ tab: "Border",
62
+ value: "border",
30
63
  fields: [{
31
64
  label: "Border Radius",
32
65
  key: "borderRadius",
33
66
  type: "borderRadius"
67
+ }, {
68
+ label: "Border Width",
69
+ key: "borderWidth",
70
+ type: "text",
71
+ placeholder: "1px"
72
+ }, {
73
+ label: "Border Style",
74
+ key: "borderStyle",
75
+ type: "textOptions",
76
+ options: [{
77
+ text: "Solid",
78
+ value: "solid"
79
+ }, {
80
+ text: "Dotted",
81
+ value: "dotted"
82
+ }, {
83
+ text: "Dashed",
84
+ value: "dashed"
85
+ }],
86
+ renderOption: option => {
87
+ return /*#__PURE__*/_jsx("span", {
88
+ style: {
89
+ fontFamily: option.value
90
+ },
91
+ children: option.text
92
+ });
93
+ }
34
94
  }]
35
95
  }, {
36
96
  tab: "Colors",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flozy/editor",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "description": "An Editor for flozy app brain",
5
5
  "files": [
6
6
  "dist"