@flozy/editor 1.1.1 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. package/dist/Editor/CollaborativeEditor.js +7 -2
  2. package/dist/Editor/CommonEditor.js +59 -37
  3. package/dist/Editor/Editor.css +209 -12
  4. package/dist/Editor/Elements/Accordion/Accordion.js +100 -0
  5. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +20 -0
  6. package/dist/Editor/Elements/Accordion/AccordionButton.js +22 -0
  7. package/dist/Editor/Elements/Accordion/AccordionDetails.js +18 -0
  8. package/dist/Editor/Elements/Accordion/AccordionSummary.js +69 -0
  9. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +20 -0
  10. package/dist/Editor/Elements/Button/ButtonPopup.js +20 -0
  11. package/dist/Editor/Elements/Button/ButtonToolIcon.js +19 -0
  12. package/dist/Editor/Elements/Button/EditorButton.js +124 -0
  13. package/dist/Editor/Elements/Carousel/Arrows.js +39 -0
  14. package/dist/Editor/Elements/Carousel/Carousel.js +82 -0
  15. package/dist/Editor/Elements/Carousel/CarouselButton.js +19 -0
  16. package/dist/Editor/Elements/Carousel/CarouselItem.js +13 -0
  17. package/dist/Editor/Elements/Carousel/slick-theme.min.css +143 -0
  18. package/dist/Editor/Elements/Carousel/slick.min.css +83 -0
  19. package/dist/Editor/Elements/Color Picker/ColorPicker.js +1 -1
  20. package/dist/Editor/Elements/Embed/Embed.css +22 -2
  21. package/dist/Editor/Elements/Embed/Embed.js +89 -74
  22. package/dist/Editor/Elements/Embed/EmbedPopup.js +23 -0
  23. package/dist/Editor/Elements/Embed/Image.js +92 -10
  24. package/dist/Editor/Elements/Embed/Video.js +31 -5
  25. package/dist/Editor/Elements/Equation/EquationButton.js +12 -12
  26. package/dist/Editor/Elements/Grid/Grid.js +64 -8
  27. package/dist/Editor/Elements/Grid/GridButton.js +2 -4
  28. package/dist/Editor/Elements/Grid/GridItem.js +59 -5
  29. package/dist/Editor/Elements/Grid/GridItemPopup.js +20 -0
  30. package/dist/Editor/Elements/Grid/GridPopup.js +22 -0
  31. package/dist/Editor/Elements/ID/Id.js +1 -1
  32. package/dist/Editor/Elements/ImageText/ImageText.js +14 -0
  33. package/dist/Editor/Elements/ImageText/ImageTextWrapper.js +14 -0
  34. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  35. package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -1
  36. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +88 -0
  37. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +22 -0
  38. package/dist/Editor/Elements/Signature/Signature.js +50 -0
  39. package/dist/Editor/Elements/Signature/SignatureButton.js +19 -0
  40. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +39 -0
  41. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +84 -0
  42. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +50 -0
  43. package/dist/Editor/Elements/Signature/SignatureOptions/index.js +5 -0
  44. package/dist/Editor/Elements/Signature/SignaturePopup.js +243 -0
  45. package/dist/Editor/Elements/Signature/Signed.js +80 -0
  46. package/dist/Editor/Elements/Table/DeleteCellIcon.js +24 -0
  47. package/dist/Editor/Elements/Table/DeleteRowIcon.js +24 -0
  48. package/dist/Editor/Elements/Table/Table.js +9 -1
  49. package/dist/Editor/Elements/Table/TableCell.js +181 -0
  50. package/dist/Editor/Elements/Table/TablePopup.js +22 -0
  51. package/dist/Editor/Elements/Table/TableRow.js +31 -0
  52. package/dist/Editor/Elements/Table/TableSelector.js +62 -68
  53. package/dist/Editor/Toolbar/Toolbar.js +47 -10
  54. package/dist/Editor/Toolbar/styles.css +20 -11
  55. package/dist/Editor/Toolbar/toolbarGroups.js +17 -19
  56. package/dist/Editor/common/Button.js +4 -8
  57. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +23 -0
  58. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +35 -0
  59. package/dist/Editor/common/StyleBuilder/buttonStyle.js +47 -0
  60. package/dist/Editor/common/StyleBuilder/embedImageStyle.js +63 -0
  61. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +88 -0
  62. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +87 -0
  63. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +136 -0
  64. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +126 -0
  65. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +89 -0
  66. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +110 -0
  67. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +42 -0
  68. package/dist/Editor/common/StyleBuilder/fieldTypes/imageTexts.js +75 -0
  69. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +21 -0
  70. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +46 -0
  71. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +51 -0
  72. package/dist/Editor/common/StyleBuilder/gridStyle.js +51 -0
  73. package/dist/Editor/common/StyleBuilder/index.js +114 -0
  74. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +10 -0
  75. package/dist/Editor/common/StyleBuilder/tableStyle.js +38 -0
  76. package/dist/Editor/common/Uploader.js +87 -0
  77. package/dist/Editor/plugins/withEmbeds.js +12 -5
  78. package/dist/Editor/plugins/withTable.js +5 -4
  79. package/dist/Editor/service/fileupload.js +17 -0
  80. package/dist/Editor/utils/SlateUtilityFunctions.js +72 -23
  81. package/dist/Editor/utils/accordion.js +25 -0
  82. package/dist/Editor/utils/button.js +11 -0
  83. package/dist/Editor/utils/carousel.js +13 -0
  84. package/dist/Editor/utils/carouselItem.js +19 -0
  85. package/dist/Editor/utils/customHooks/useContextMenu.js +8 -8
  86. package/dist/Editor/utils/customHooks/useResize.js +1 -1
  87. package/dist/Editor/utils/font.js +59 -0
  88. package/dist/Editor/utils/helper.js +32 -0
  89. package/dist/Editor/utils/imageText.js +19 -0
  90. package/dist/Editor/utils/signature.js +23 -0
  91. package/dist/Editor/utils/table.js +172 -0
  92. package/package.json +11 -3
@@ -0,0 +1,87 @@
1
+ import React, { useState } from "react";
2
+ import { Grid, Button } from "@mui/material";
3
+ import CloudUploadIcon from "@mui/icons-material/CloudUpload";
4
+ import { convertBase64 } from "../../../utils/helper";
5
+ import { uploadFile } from "../../../service/fileupload";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ const BackgroundImage = props => {
9
+ const {
10
+ value,
11
+ data,
12
+ customProps,
13
+ onChange
14
+ } = props;
15
+ const {
16
+ key
17
+ } = data;
18
+ const [base64, setBase64] = useState(value);
19
+ const [uploading, setUploading] = useState(false);
20
+ const handleChange = async e => {
21
+ const file = e.target.files[0];
22
+ const strImage = await convertBase64(file);
23
+ setBase64(strImage);
24
+ doUpload(strImage);
25
+ };
26
+ const doUpload = async strImage => {
27
+ setUploading(true);
28
+ const result = await uploadFile({
29
+ image: strImage
30
+ }, customProps);
31
+ setUploading(false);
32
+ if (result && result?.imageURL) {
33
+ onChange({
34
+ [key]: result?.imageURL
35
+ });
36
+ }
37
+ };
38
+ const onRemoveBG = () => {
39
+ setBase64(null);
40
+ onChange({
41
+ [key]: "none"
42
+ });
43
+ };
44
+ return /*#__PURE__*/_jsxs(Grid, {
45
+ container: true,
46
+ padding: 3,
47
+ children: [/*#__PURE__*/_jsxs(Grid, {
48
+ item: true,
49
+ xs: 12,
50
+ style: {
51
+ display: "flex"
52
+ },
53
+ justifyContent: "center",
54
+ alignItems: "center",
55
+ children: [/*#__PURE__*/_jsxs(Button, {
56
+ component: "label",
57
+ variant: "contained",
58
+ startIcon: /*#__PURE__*/_jsx(CloudUploadIcon, {}),
59
+ children: ["Upload file", /*#__PURE__*/_jsx("input", {
60
+ type: "file",
61
+ style: {
62
+ opacity: 0
63
+ },
64
+ onChange: handleChange
65
+ })]
66
+ }), /*#__PURE__*/_jsx("input", {
67
+ type: "checkbox",
68
+ value: "none",
69
+ checked: value === "none",
70
+ onChange: onRemoveBG
71
+ }), " ", "None"]
72
+ }), uploading ? "Uploading..." : "", /*#__PURE__*/_jsx(Grid, {
73
+ item: true,
74
+ xs: 12,
75
+ style: {
76
+ marginTop: "12px",
77
+ width: "100%",
78
+ backgroundImage: base64 ? `url(${base64})` : "none",
79
+ height: "100px",
80
+ backgroundPosition: "center",
81
+ backgroundSize: "contain",
82
+ backgroundRepeat: "no-repeat"
83
+ }
84
+ })]
85
+ });
86
+ };
87
+ export default BackgroundImage;
@@ -0,0 +1,136 @@
1
+ import React from "react";
2
+ import { Grid } from "@mui/material";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ const BANNER_SPACING_KEYS = ["top", "left", "right", "bottom"];
6
+ const BannerSpacing = props => {
7
+ const {
8
+ value,
9
+ data,
10
+ onChange,
11
+ elementProps
12
+ } = props;
13
+ const {
14
+ lockSpacing
15
+ } = elementProps || {};
16
+ const {
17
+ key
18
+ } = data;
19
+ const handleChange = e => {
20
+ let changeAll = {};
21
+ if (lockSpacing) {
22
+ BANNER_SPACING_KEYS.forEach(m => {
23
+ changeAll[m] = e.target.value;
24
+ });
25
+ }
26
+ onChange({
27
+ [key]: {
28
+ ...value,
29
+ [e.target.name]: e.target.value,
30
+ ...changeAll
31
+ }
32
+ });
33
+ };
34
+ const onLockSpacing = () => {
35
+ onChange({
36
+ lockSpacing: !lockSpacing
37
+ });
38
+ };
39
+ return /*#__PURE__*/_jsx(Grid, {
40
+ container: true,
41
+ padding: 4,
42
+ children: /*#__PURE__*/_jsx(Grid, {
43
+ item: true,
44
+ xs: 12,
45
+ style: {
46
+ display: "flex"
47
+ },
48
+ justifyContent: "center",
49
+ children: /*#__PURE__*/_jsxs("div", {
50
+ style: {
51
+ width: "100px",
52
+ height: "100px",
53
+ border: "1px solid blue",
54
+ backgroundColor: "antiquewhite",
55
+ position: "relative",
56
+ display: "flex",
57
+ padding: `${value?.top}px ${value?.right}px ${value?.bottom}px ${value?.left}px`
58
+ },
59
+ children: [/*#__PURE__*/_jsx("div", {
60
+ style: {
61
+ border: "1px solid blue",
62
+ width: "100%"
63
+ }
64
+ }), /*#__PURE__*/_jsx("input", {
65
+ type: "text",
66
+ name: "left",
67
+ value: value?.left,
68
+ style: {
69
+ position: "absolute",
70
+ left: "-28px",
71
+ top: 0,
72
+ bottom: 0,
73
+ width: "16px",
74
+ height: "16px",
75
+ margin: "auto"
76
+ },
77
+ onChange: handleChange
78
+ }), /*#__PURE__*/_jsx("input", {
79
+ type: "text",
80
+ name: "top",
81
+ value: value?.top,
82
+ style: {
83
+ position: "absolute",
84
+ right: 0,
85
+ left: 0,
86
+ top: "-28px",
87
+ width: "16px",
88
+ height: "16px",
89
+ margin: "auto"
90
+ },
91
+ onChange: handleChange
92
+ }), /*#__PURE__*/_jsx("input", {
93
+ type: "text",
94
+ name: "right",
95
+ value: value?.right,
96
+ style: {
97
+ position: "absolute",
98
+ right: "-28px",
99
+ top: 0,
100
+ bottom: 0,
101
+ width: "16px",
102
+ height: "16px",
103
+ margin: "auto"
104
+ },
105
+ onChange: handleChange
106
+ }), /*#__PURE__*/_jsx("input", {
107
+ type: "text",
108
+ name: "bottom",
109
+ value: value?.bottom,
110
+ style: {
111
+ position: "absolute",
112
+ right: 0,
113
+ left: 0,
114
+ bottom: "-28px",
115
+ width: "16px",
116
+ height: "16px",
117
+ margin: "auto"
118
+ },
119
+ onChange: handleChange
120
+ }), /*#__PURE__*/_jsx("button", {
121
+ style: {
122
+ position: "absolute",
123
+ right: 0,
124
+ left: 0,
125
+ top: 0,
126
+ bottom: 0,
127
+ background: "none"
128
+ },
129
+ onClick: onLockSpacing,
130
+ children: lockSpacing ? "Un-Lock" : "Lock"
131
+ })]
132
+ })
133
+ })
134
+ });
135
+ };
136
+ export default BannerSpacing;
@@ -0,0 +1,126 @@
1
+ import React from "react";
2
+ import { Grid } from "@mui/material";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ const BORDER_RADIUS_KEYS = ["topLeft", "topRight", "bottomLeft", "bottomRight"];
6
+ const BorderRadius = props => {
7
+ const {
8
+ value,
9
+ data,
10
+ onChange,
11
+ elementProps
12
+ } = props;
13
+ const {
14
+ lockRadius,
15
+ borderColor
16
+ } = elementProps;
17
+ const {
18
+ key
19
+ } = data;
20
+ const handleChange = e => {
21
+ let changeAll = {};
22
+ if (lockRadius) {
23
+ BORDER_RADIUS_KEYS.forEach(m => {
24
+ changeAll[m] = e.target.value;
25
+ });
26
+ }
27
+ onChange({
28
+ [key]: {
29
+ ...value,
30
+ [e.target.name]: e.target.value,
31
+ ...changeAll
32
+ }
33
+ });
34
+ };
35
+ const onLockRadius = () => {
36
+ onChange({
37
+ lockRadius: !lockRadius
38
+ });
39
+ };
40
+ return /*#__PURE__*/_jsx(Grid, {
41
+ container: true,
42
+ padding: 4,
43
+ children: /*#__PURE__*/_jsx(Grid, {
44
+ item: true,
45
+ xs: 12,
46
+ style: {
47
+ display: "flex"
48
+ },
49
+ justifyContent: "center",
50
+ alignContent: "center",
51
+ children: /*#__PURE__*/_jsxs("div", {
52
+ style: {
53
+ width: "100px",
54
+ height: "100px",
55
+ border: "1px solid blue",
56
+ position: "relative",
57
+ display: "flex",
58
+ borderColor: `${borderColor}`,
59
+ borderRadius: `${value?.topLeft}px ${value?.topRight}px ${value?.bottomLeft}px ${value?.bottomRight}px`
60
+ },
61
+ children: [/*#__PURE__*/_jsx("input", {
62
+ type: "text",
63
+ name: "topLeft",
64
+ value: value?.topLeft,
65
+ style: {
66
+ position: "absolute",
67
+ left: "-25px",
68
+ top: "-28px",
69
+ width: "16px",
70
+ height: "16px",
71
+ margin: "auto"
72
+ },
73
+ onChange: handleChange
74
+ }), /*#__PURE__*/_jsx("input", {
75
+ type: "text",
76
+ name: "topRight",
77
+ value: value?.topRight,
78
+ style: {
79
+ position: "absolute",
80
+ top: "-28px",
81
+ right: "-25px",
82
+ width: "16px",
83
+ height: "16px"
84
+ },
85
+ onChange: handleChange
86
+ }), /*#__PURE__*/_jsx("input", {
87
+ type: "text",
88
+ name: "bottomLeft",
89
+ value: value?.bottomLeft,
90
+ style: {
91
+ position: "absolute",
92
+ left: "-25px",
93
+ bottom: "-28px",
94
+ width: "16px",
95
+ height: "16px"
96
+ },
97
+ onChange: handleChange
98
+ }), /*#__PURE__*/_jsx("input", {
99
+ type: "text",
100
+ name: "bottomRight",
101
+ value: value?.bottomRight,
102
+ style: {
103
+ position: "absolute",
104
+ bottom: "-28px",
105
+ right: "-25px",
106
+ width: "16px",
107
+ height: "16px"
108
+ },
109
+ onChange: handleChange
110
+ }), /*#__PURE__*/_jsx("button", {
111
+ style: {
112
+ position: "absolute",
113
+ right: 0,
114
+ left: 0,
115
+ top: 0,
116
+ bottom: 0,
117
+ background: "none"
118
+ },
119
+ onClick: onLockRadius,
120
+ children: lockRadius ? "Un-Lock" : "Lock"
121
+ })]
122
+ })
123
+ })
124
+ });
125
+ };
126
+ export default BorderRadius;
@@ -0,0 +1,89 @@
1
+ import React from "react";
2
+ import { Grid, TextField, InputAdornment } from "@mui/material";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ const Color = props => {
6
+ const {
7
+ value,
8
+ data,
9
+ onChange,
10
+ elementProps
11
+ } = props;
12
+ const {
13
+ key,
14
+ label,
15
+ needPreview
16
+ } = data;
17
+ const {
18
+ textColor,
19
+ bgColor,
20
+ borderColor
21
+ } = elementProps;
22
+ const handleChange = e => {
23
+ onChange({
24
+ [key]: e.target.value
25
+ });
26
+ };
27
+ return /*#__PURE__*/_jsxs(Grid, {
28
+ container: true,
29
+ children: [needPreview && /*#__PURE__*/_jsxs(Grid, {
30
+ container: true,
31
+ padding: 3,
32
+ children: [/*#__PURE__*/_jsx(Grid, {
33
+ item: true,
34
+ xs: 12,
35
+ style: {
36
+ padding: "8px",
37
+ color: textColor,
38
+ backgroundColor: bgColor,
39
+ border: `1px solid ${borderColor}`
40
+ },
41
+ children: "Text Content"
42
+ }), /*#__PURE__*/_jsx("span", {
43
+ style: {
44
+ color: "#CCC"
45
+ },
46
+ children: "*Select Checkbox for no color"
47
+ })]
48
+ }), /*#__PURE__*/_jsx(Grid, {
49
+ item: true,
50
+ xs: 12,
51
+ style: {
52
+ margin: "12px",
53
+ display: "flex",
54
+ alignItems: "cente",
55
+ justifyContent: "space-between"
56
+ },
57
+ children: /*#__PURE__*/_jsx(Grid, {
58
+ item: true,
59
+ xs: 12,
60
+ children: /*#__PURE__*/_jsx(TextField, {
61
+ fullWidth: true,
62
+ value: value,
63
+ label: label,
64
+ placeholder: label,
65
+ InputLabelProps: {
66
+ shrink: true
67
+ },
68
+ InputProps: {
69
+ endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
70
+ position: "end",
71
+ children: [/*#__PURE__*/_jsx("input", {
72
+ type: "color",
73
+ value: value,
74
+ name: "textColor",
75
+ onChange: handleChange
76
+ }), /*#__PURE__*/_jsx("input", {
77
+ type: "checkbox",
78
+ onChange: handleChange,
79
+ value: "rgba(0,0,0,0)",
80
+ checked: value === "rgba(0,0,0,0)"
81
+ })]
82
+ })
83
+ }
84
+ })
85
+ })
86
+ })]
87
+ });
88
+ };
89
+ export default Color;
@@ -0,0 +1,110 @@
1
+ import React from "react";
2
+ import { Grid, IconButton, InputAdornment, TextField } from "@mui/material";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ const ElementSize = props => {
6
+ const {
7
+ value,
8
+ data,
9
+ onChange
10
+ } = props;
11
+ const {
12
+ key
13
+ } = data;
14
+ const widthType = value?.widthType ? value?.widthType : value?.widthInPercent ? "%" : "px";
15
+ const wkey = widthType === "%" ? "widthInPercent" : "width";
16
+ const handleChange = e => {
17
+ onChange({
18
+ [key]: {
19
+ ...(value || {}),
20
+ [e.target.name]: isNaN(e.target.value) ? "" : parseInt(e.target.value)
21
+ }
22
+ });
23
+ };
24
+ const onSizeType = cData => () => {
25
+ onChange({
26
+ [key]: {
27
+ ...(value || {}),
28
+ ...cData
29
+ }
30
+ });
31
+ };
32
+ return /*#__PURE__*/_jsxs(Grid, {
33
+ container: true,
34
+ padding: 3,
35
+ spacing: 2,
36
+ className: "input-adorn",
37
+ children: [/*#__PURE__*/_jsx(Grid, {
38
+ item: true,
39
+ xs: 12,
40
+ md: 6,
41
+ children: /*#__PURE__*/_jsx(TextField, {
42
+ fullWidth: true,
43
+ name: wkey,
44
+ label: "Width",
45
+ size: "small",
46
+ value: value ? value[wkey] : "100",
47
+ placeholder: "Width",
48
+ onChange: handleChange,
49
+ InputProps: {
50
+ endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
51
+ position: "end",
52
+ children: [/*#__PURE__*/_jsx(IconButton, {
53
+ className: widthType === "px" ? "active" : "",
54
+ size: "small",
55
+ onClick: onSizeType({
56
+ widthType: "px",
57
+ widthInPercent: null,
58
+ width: isNaN(value?.width) ? 100 : value?.width || 100
59
+ }),
60
+ children: "PX"
61
+ }), /*#__PURE__*/_jsx(IconButton, {
62
+ className: widthType === "%" ? "active" : "",
63
+ size: "small",
64
+ onClick: onSizeType({
65
+ widthType: "%",
66
+ widthInPercent: value?.widthInPercent || 100
67
+ }),
68
+ children: "%"
69
+ })]
70
+ })
71
+ }
72
+ })
73
+ }), /*#__PURE__*/_jsx(Grid, {
74
+ item: true,
75
+ xs: 12,
76
+ md: 6,
77
+ children: /*#__PURE__*/_jsx(TextField, {
78
+ fullWidth: true,
79
+ name: "height",
80
+ size: "small",
81
+ label: "Height",
82
+ value: value?.height,
83
+ placeholder: "Height",
84
+ helperText: "Leave it to auto if width is in % ",
85
+ onChange: handleChange,
86
+ InputProps: {
87
+ endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
88
+ position: "end",
89
+ children: [/*#__PURE__*/_jsx(IconButton, {
90
+ className: value?.height !== "" ? "active" : "",
91
+ size: "small",
92
+ onClick: onSizeType({
93
+ height: value?.height || ""
94
+ }),
95
+ children: "PX"
96
+ }), /*#__PURE__*/_jsx(IconButton, {
97
+ className: value?.height === "" ? "active" : "",
98
+ size: "small",
99
+ onClick: onSizeType({
100
+ height: ""
101
+ }),
102
+ children: "auto"
103
+ })]
104
+ })
105
+ }
106
+ })
107
+ })]
108
+ });
109
+ };
110
+ export default ElementSize;
@@ -0,0 +1,42 @@
1
+ import React from "react";
2
+ import { Grid, Slider } from "@mui/material";
3
+ import { jsxs as _jsxs } from "react/jsx-runtime";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const GridSize = props => {
6
+ const {
7
+ value,
8
+ data,
9
+ onChange
10
+ } = props;
11
+ const {
12
+ key
13
+ } = data;
14
+ const handleChange = e => {
15
+ onChange({
16
+ [key]: e.target.value
17
+ });
18
+ };
19
+ return /*#__PURE__*/_jsx(Grid, {
20
+ container: true,
21
+ padding: 3,
22
+ children: /*#__PURE__*/_jsxs(Grid, {
23
+ item: true,
24
+ xs: 12,
25
+ children: [/*#__PURE__*/_jsxs("label", {
26
+ style: {
27
+ marginBottom: "12px",
28
+ fontWeight: "bold"
29
+ },
30
+ children: ["Grid Size: ", value || 12, " "]
31
+ }), /*#__PURE__*/_jsx(Slider, {
32
+ defaultValue: 12,
33
+ value: value || 12,
34
+ step: 1,
35
+ min: 1,
36
+ max: 12,
37
+ onChange: handleChange
38
+ })]
39
+ })
40
+ });
41
+ };
42
+ export default GridSize;
@@ -0,0 +1,75 @@
1
+ import React from "react";
2
+ import { Button, Grid, IconButton, InputAdornment, TextField } from "@mui/material";
3
+ import DeleteIcon from "@mui/icons-material/Delete";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import { jsxs as _jsxs } from "react/jsx-runtime";
6
+ const ImageTexts = props => {
7
+ const {
8
+ value,
9
+ data,
10
+ onChange
11
+ } = props;
12
+ const texts = value || [""];
13
+ const {
14
+ key
15
+ } = data;
16
+ const handleChange = e => {
17
+ const updatedTexts = texts?.map((m, i) => {
18
+ if (`text-${i}` === e.target.name) {
19
+ return e.target.value;
20
+ }
21
+ return m;
22
+ });
23
+ onChange({
24
+ [key]: updatedTexts
25
+ });
26
+ };
27
+ const onAddText = () => {
28
+ onChange({
29
+ [key]: [...texts, ""]
30
+ });
31
+ };
32
+ const handleDelete = deleteIndex => () => {
33
+ const updatedTexts = texts?.filter((m, i) => {
34
+ return `text=${deleteIndex}` !== i;
35
+ });
36
+ onChange({
37
+ [key]: updatedTexts
38
+ });
39
+ };
40
+ return /*#__PURE__*/_jsxs(Grid, {
41
+ container: true,
42
+ padding: 3,
43
+ spacing: 2,
44
+ className: "input-adorn",
45
+ children: [texts?.map((m, i) => {
46
+ return /*#__PURE__*/_jsx(Grid, {
47
+ item: true,
48
+ xs: 12,
49
+ children: /*#__PURE__*/_jsx(TextField, {
50
+ fullWidth: true,
51
+ name: `text-${i}`,
52
+ placeholder: "Enter Image Text",
53
+ onChange: handleChange,
54
+ InputProps: {
55
+ endAdornment: /*#__PURE__*/_jsx(InputAdornment, {
56
+ position: "end",
57
+ children: /*#__PURE__*/_jsx(IconButton, {
58
+ onClick: handleDelete(i),
59
+ children: /*#__PURE__*/_jsx(DeleteIcon, {})
60
+ })
61
+ })
62
+ }
63
+ })
64
+ }, `imt_${i}`);
65
+ }), /*#__PURE__*/_jsx(Grid, {
66
+ item: true,
67
+ xs: 12,
68
+ children: /*#__PURE__*/_jsx(Button, {
69
+ onClick: onAddText,
70
+ children: "Add Text"
71
+ })
72
+ })]
73
+ });
74
+ };
75
+ export default ImageTexts;
@@ -0,0 +1,21 @@
1
+ import Text from "./text";
2
+ import BannerSpacing from "./bannerSpacing";
3
+ import BorderRadius from "./borderRadius";
4
+ import Color from "./color";
5
+ import Alignment from "./alignment";
6
+ import BackgroundImage from "./backgroundImage";
7
+ import GridSize from "./gridSize";
8
+ import ElementSize from "./elementSize";
9
+ import ImageTexts from "./imageTexts";
10
+ const FieldMap = {
11
+ text: Text,
12
+ bannerSpacing: BannerSpacing,
13
+ borderRadius: BorderRadius,
14
+ color: Color,
15
+ alignment: Alignment,
16
+ backgroundImage: BackgroundImage,
17
+ gridSize: GridSize,
18
+ elementSize: ElementSize,
19
+ imageTexts: ImageTexts
20
+ };
21
+ export default FieldMap;