@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
@@ -1,9 +1,9 @@
1
- import React, { useEffect, useRef, useState } from 'react';
2
- import Icon from '../../common/Icon';
3
- import usePopup from '../../utils/customHooks/usePopup';
4
- import { Transforms } from 'slate';
5
- import { TableUtil } from '../../utils/table.js';
6
- import './TableSelector.css';
1
+ import React, { useRef, useState } from "react";
2
+ import { Grid, Button, Dialog, DialogActions, DialogContent, DialogTitle, IconButton, TextField } from "@mui/material";
3
+ import Icon from "../../common/Icon";
4
+ import { Transforms } from "slate";
5
+ import { TableUtil } from "../../utils/table.js";
6
+ import "./TableSelector.css";
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  import { jsxs as _jsxs } from "react/jsx-runtime";
9
9
  const TableSelector = ({
@@ -11,91 +11,85 @@ const TableSelector = ({
11
11
  }) => {
12
12
  const tableOptionsRef = useRef();
13
13
  const [selection, setSelection] = useState();
14
- const [showOptions, setShowOptions] = usePopup(tableOptionsRef);
14
+ const [showOptions, setShowOptions] = useState(false);
15
15
  const [tableData, setTableData] = useState({
16
- row: 0,
17
- column: 0
16
+ row: 2,
17
+ column: 2
18
18
  });
19
- const [tableInput, setTableInput] = useState(Array.from({
20
- length: 6
21
- }, () => Array.from({
22
- length: 6
23
- }, (v, i) => ({
24
- bg: 'lightGray',
25
- column: i
26
- }))));
27
- useEffect(() => {
28
- const newTable = Array.from({
29
- length: 6
30
- }, (obj, row) => Array.from({
31
- length: 6
32
- }, (v, col) => ({
33
- bg: row + 1 <= tableData.row && col + 1 <= tableData.column ? 'orange' : 'lightgray',
34
- column: col
35
- })));
36
- setTableInput(newTable);
37
- }, [tableData]);
38
- useEffect(() => {
39
- if (!showOptions) {
40
- setTableData({
41
- row: 0,
42
- column: 0
43
- });
44
- }
45
- }, [showOptions]);
46
19
  const table = new TableUtil(editor);
47
20
  const handleButtonClick = () => {
48
21
  setSelection(editor.selection);
49
- setShowOptions(prev => !prev);
22
+ setShowOptions(true);
50
23
  };
51
24
  const handleInsert = () => {
52
25
  selection && Transforms.select(editor, selection);
26
+ table.insertTable(tableData.row, tableData.column);
27
+ setShowOptions(false);
28
+ };
29
+ const handleChange = e => {
53
30
  setTableData({
54
- row: -1,
55
- column: -1
31
+ ...tableData,
32
+ [e.target.name]: e.target.value
56
33
  });
57
- table.insertTable(tableData.row, tableData.column);
34
+ };
35
+ const onCancel = () => {
58
36
  setShowOptions(false);
59
37
  };
60
38
  return /*#__PURE__*/_jsxs("div", {
61
39
  ref: tableOptionsRef,
62
- className: "popup-wrapper",
63
- children: [/*#__PURE__*/_jsx("button", {
40
+ className: "popup-wrapper1",
41
+ children: [/*#__PURE__*/_jsx(IconButton, {
64
42
  style: {
65
- border: showOptions ? '1px solid lightgray' : 'none'
43
+ border: showOptions ? "1px solid lightgray" : "none"
66
44
  },
67
45
  title: "table",
68
46
  onClick: handleButtonClick,
69
47
  children: /*#__PURE__*/_jsx(Icon, {
70
48
  icon: "table"
71
49
  })
72
- }), showOptions && /*#__PURE__*/_jsxs("div", {
73
- className: "popup",
74
- children: [/*#__PURE__*/_jsx("span", {
75
- style: {
76
- fontSize: '0.85em'
77
- },
78
- children: /*#__PURE__*/_jsx("i", {
79
- children: `Insert a ${tableData.row >= 1 ? `${tableData.row} x ${tableData.column}` : ''} table`
50
+ }), showOptions ? /*#__PURE__*/_jsxs(Dialog, {
51
+ open: showOptions,
52
+ children: [/*#__PURE__*/_jsx(DialogTitle, {
53
+ children: "Table"
54
+ }), /*#__PURE__*/_jsx(DialogContent, {
55
+ children: /*#__PURE__*/_jsxs(Grid, {
56
+ container: true,
57
+ padding: 3,
58
+ spacing: 2,
59
+ children: [/*#__PURE__*/_jsx(Grid, {
60
+ item: true,
61
+ xs: 12,
62
+ children: /*#__PURE__*/_jsx(TextField, {
63
+ fullWidth: true,
64
+ name: "row",
65
+ value: tableData?.row,
66
+ onChange: handleChange,
67
+ label: "No.of Rows",
68
+ placeholder: "No.of Rows"
69
+ })
70
+ }), /*#__PURE__*/_jsx(Grid, {
71
+ item: true,
72
+ xs: 12,
73
+ children: /*#__PURE__*/_jsx(TextField, {
74
+ fullWidth: true,
75
+ name: "column",
76
+ value: tableData?.column,
77
+ onChange: handleChange,
78
+ label: "No.of Columns",
79
+ placeholder: "No.of Columns"
80
+ })
81
+ })]
80
82
  })
81
- }), /*#__PURE__*/_jsx("div", {
82
- className: "table-input",
83
- children: tableInput.map((grp, row) => grp.map(({
84
- column,
85
- bg
86
- }, col) => /*#__PURE__*/_jsx("div", {
87
- onClick: () => handleInsert(),
88
- onMouseOver: () => setTableData({
89
- row: row + 1,
90
- column: column + 1
91
- }),
92
- className: "table-unit",
93
- style: {
94
- border: `1px solid ${bg}`
95
- }
96
- }, row + col)))
83
+ }), /*#__PURE__*/_jsxs(DialogActions, {
84
+ children: [/*#__PURE__*/_jsx(Button, {
85
+ onClick: onCancel,
86
+ children: "Cancel"
87
+ }), /*#__PURE__*/_jsx(Button, {
88
+ onClick: handleInsert,
89
+ children: "Save"
90
+ })]
97
91
  })]
98
- })]
92
+ }) : null]
99
93
  });
100
94
  };
101
95
  export default TableSelector;
@@ -1,8 +1,10 @@
1
1
  import React, { useEffect, useState } from "react";
2
+ import { Select, MenuItem } from "@mui/material";
2
3
  import { useSlate } from "slate-react";
3
4
  import Button from "../common/Button";
4
5
  import Icon from "../common/Icon";
5
6
  import { toggleBlock, toggleMark, isMarkActive, addMarkData, isBlockActive, activeMark } from "../utils/SlateUtilityFunctions.js";
7
+ import { fontFamilyMap } from "../utils/font";
6
8
  import useFormat from "../utils/customHooks/useFormat.js";
7
9
  import defaultToolbarGroups from "./toolbarGroups.js";
8
10
  import "./styles.css";
@@ -12,16 +14,21 @@ import Embed from "../Elements/Embed/Embed";
12
14
  import TableSelector from "../Elements/Table/TableSelector";
13
15
  import EquationButton from "../Elements/Equation/EquationButton";
14
16
  import Id from "../Elements/ID/Id";
15
- import TableContextMenu from "../Elements/TableContextMenu/TableContextMenu";
16
17
  import CodeToTextButton from "../Elements/CodeToText/CodeToTextButton";
17
18
  import HtmlContextMenu from "../Elements/CodeToText/HtmlContextMenu";
18
19
  import GridButton from "../Elements/Grid/GridButton";
19
20
  import NewLineButton from "../Elements/NewLine/NewLineButton";
21
+ import AccordionButton from "../Elements/Accordion/AccordionButton";
22
+ import SignatureButton from "../Elements/Signature/SignatureButton";
23
+ import ButtonToolIcon from "../Elements/Button/ButtonToolIcon";
24
+ import PageSettingsButton from "../Elements/PageSettings/PageSettingsButton";
25
+ import CarouselButton from "../Elements/Carousel/CarouselButton";
20
26
  import { jsx as _jsx } from "react/jsx-runtime";
21
27
  import { jsxs as _jsxs } from "react/jsx-runtime";
22
28
  const Toolbar = props => {
23
29
  const {
24
- handleCodeToText
30
+ handleCodeToText,
31
+ customProps
25
32
  } = props;
26
33
  const editor = useSlate();
27
34
  const isTable = useFormat(editor, "table");
@@ -72,10 +79,21 @@ const Toolbar = props => {
72
79
  format,
73
80
  options
74
81
  }) => {
75
- return /*#__PURE__*/_jsx("select", {
76
- value: activeMark(editor, format),
82
+ const value = activeMark(editor, format);
83
+ return /*#__PURE__*/_jsx(Select, {
84
+ value: value,
85
+ className: "editor-dd",
77
86
  onChange: e => changeMarkData(e, format),
78
- children: options.map((item, index) => /*#__PURE__*/_jsx("option", {
87
+ style: {
88
+ fontFamily: fontFamilyMap[value],
89
+ width: "200px",
90
+ height: "40px",
91
+ overflow: "hidden"
92
+ },
93
+ children: options.map((item, index) => /*#__PURE__*/_jsx(MenuItem, {
94
+ style: {
95
+ fontFamily: item.text
96
+ },
79
97
  value: item.value,
80
98
  children: item.text
81
99
  }, index))
@@ -92,7 +110,7 @@ const Toolbar = props => {
92
110
  return /*#__PURE__*/_jsxs("div", {
93
111
  className: "toolbar",
94
112
  children: [toolbarGroups.map((group, index) => /*#__PURE__*/_jsx("span", {
95
- className: "toolbar-grp",
113
+ className: "toolbar-grp1",
96
114
  children: group.map((element, gi) => {
97
115
  switch (element.type) {
98
116
  case "block":
@@ -115,7 +133,8 @@ const Toolbar = props => {
115
133
  case "embed":
116
134
  return /*#__PURE__*/_jsx(Embed, {
117
135
  format: element.format,
118
- editor: editor
136
+ editor: editor,
137
+ customProps: customProps
119
138
  }, element.id);
120
139
  case "color-picker":
121
140
  return /*#__PURE__*/_jsx(ColorPicker, {
@@ -147,13 +166,31 @@ const Toolbar = props => {
147
166
  return /*#__PURE__*/_jsx(NewLineButton, {
148
167
  editor: editor
149
168
  }, element.id);
169
+ case "accordion":
170
+ return /*#__PURE__*/_jsx(AccordionButton, {
171
+ editor: editor
172
+ }, element.id);
173
+ case "signature":
174
+ return /*#__PURE__*/_jsx(SignatureButton, {
175
+ editor: editor
176
+ }, element.id);
177
+ case "button":
178
+ return /*#__PURE__*/_jsx(ButtonToolIcon, {
179
+ editor: editor
180
+ }, element.id);
181
+ case "page-settings":
182
+ return /*#__PURE__*/_jsx(PageSettingsButton, {
183
+ editor: editor
184
+ }, element.id);
185
+ case "carousel":
186
+ return /*#__PURE__*/_jsx(CarouselButton, {
187
+ editor: editor
188
+ }, element.id);
150
189
  default:
151
190
  return null;
152
191
  }
153
192
  })
154
- }, index)), /*#__PURE__*/_jsx(TableContextMenu, {
155
- editor: editor
156
- }), /*#__PURE__*/_jsx(HtmlContextMenu, {
193
+ }, index)), /*#__PURE__*/_jsx(HtmlContextMenu, {
157
194
  editor: editor,
158
195
  handleCodeToText: handleCodeToText
159
196
  })]
@@ -1,28 +1,37 @@
1
- .toolbar{
2
- border-radius: 10px;
3
- background: #ffffff;
4
- box-shadow: -8px 8px 13px #ededed,
5
- 8px -8px 13px #ffffff;
1
+ .toolbar {
2
+ background: #ffffff;
6
3
  margin:4px 0;
7
4
  display:flex;
8
5
  flex-wrap:wrap;
9
6
  align-items:center;
10
- padding: 15px 10px;
7
+ padding: 12px 0px;
11
8
  row-gap: 15px;
12
9
  position: -webkit-sticky;
13
- position: sticky;
14
- top: 0;
15
- z-index: 2;
10
+ position: sticky;
11
+ top: 0;
12
+ z-index: 2;
13
+ margin-bottom: 12px;
14
+ border-bottom: 2px solid #CCC;
16
15
  }
17
- .toolbar-grp>*{
16
+ .toolbar-grp1>*{
18
17
  margin-right: 10px;
19
18
  cursor: pointer;
20
19
  }
21
- .toolbar-grp{
20
+ .toolbar-grp1{
22
21
  margin:0 10px;
22
+ display: flex;
23
+ align-items: center;
23
24
  }
24
25
  select{
25
26
  height: 30px;
26
27
  border: none;
27
28
  width: 6.9rem;
28
29
  }
30
+
31
+ .toolbar .editor-dd {
32
+ width: 200px !important;
33
+ }
34
+
35
+ .toolbar .MuiIconButton-root {
36
+
37
+ }
@@ -1,17 +1,9 @@
1
+ import { fontOptions } from "../utils/font";
1
2
  const toolbarGroups = [[{
2
3
  id: 1,
3
4
  format: "fontFamily",
4
5
  type: "dropdown",
5
- options: [{
6
- text: "Sans Serif",
7
- value: "sans"
8
- }, {
9
- text: "Serif",
10
- value: "serif"
11
- }, {
12
- text: "MonoSpace",
13
- value: "monospace"
14
- }]
6
+ options: fontOptions
15
7
  }, {
16
8
  id: 2,
17
9
  format: "fontSize",
@@ -113,19 +105,25 @@ const toolbarGroups = [[{
113
105
  id: 23,
114
106
  type: "table"
115
107
  }], [{
116
- id: 25,
117
- type: "id"
118
- }, {
119
- id: 26,
120
- type: "equation"
121
- }, {
122
- id: 27,
123
- type: "codeToText"
124
- }, {
125
108
  id: 28,
126
109
  type: "grid"
127
110
  }, {
128
111
  id: 29,
129
112
  type: "newLine"
113
+ }, {
114
+ id: 30,
115
+ type: "accordion"
116
+ }, {
117
+ id: 31,
118
+ type: "signature"
119
+ }, {
120
+ id: 32,
121
+ type: "button"
122
+ }, {
123
+ id: 33,
124
+ type: "page-settings"
125
+ }, {
126
+ id: 34,
127
+ type: "carousel"
130
128
  }]];
131
129
  export default toolbarGroups;
@@ -1,4 +1,5 @@
1
- import React from 'react';
1
+ import React from "react";
2
+ import { IconButton } from "@mui/material";
2
3
  import { jsx as _jsx } from "react/jsx-runtime";
3
4
  const Button = props => {
4
5
  const {
@@ -7,15 +8,10 @@ const Button = props => {
7
8
  active,
8
9
  ...rest
9
10
  } = props;
10
- return /*#__PURE__*/_jsx("button", {
11
- className: active ? 'btnActive' : '',
11
+ return /*#__PURE__*/_jsx(IconButton, {
12
+ className: active ? "btnActive" : "",
12
13
  title: format,
13
14
  ...rest,
14
- style: {
15
- width: '30px',
16
- height: '20px',
17
- margin: '0 2px'
18
- },
19
15
  children: children
20
16
  });
21
17
  };
@@ -0,0 +1,23 @@
1
+ const accordionTitleBtnStyle = [{
2
+ tab: "Colors",
3
+ value: "colors",
4
+ fields: [{
5
+ label: "Text",
6
+ key: "textColor",
7
+ type: "color",
8
+ needPreview: true
9
+ }, {
10
+ label: "Button",
11
+ key: "btnBg",
12
+ type: "color"
13
+ }, {
14
+ label: "Background",
15
+ key: "bgColor",
16
+ type: "color"
17
+ }, {
18
+ label: "Border",
19
+ key: "borderColor",
20
+ type: "color"
21
+ }]
22
+ }];
23
+ export default accordionTitleBtnStyle;
@@ -0,0 +1,35 @@
1
+ const accordionTitleStyle = [{
2
+ tab: "Banner Spacing",
3
+ value: "bannerSpacing",
4
+ fields: [{
5
+ label: "Banner Spacing",
6
+ key: "bannerSpacing",
7
+ type: "bannerSpacing"
8
+ }]
9
+ }, {
10
+ tab: "Border Radius",
11
+ value: "borderRadius",
12
+ fields: [{
13
+ label: "Border Radius",
14
+ key: "borderRadius",
15
+ type: "borderRadius"
16
+ }]
17
+ }, {
18
+ tab: "Colors",
19
+ value: "colors",
20
+ fields: [{
21
+ label: "Text",
22
+ key: "textColor",
23
+ type: "color",
24
+ needPreview: true
25
+ }, {
26
+ label: "Background",
27
+ key: "bgColor",
28
+ type: "color"
29
+ }, {
30
+ label: "Border",
31
+ key: "borderColor",
32
+ type: "color"
33
+ }]
34
+ }];
35
+ export default accordionTitleStyle;
@@ -0,0 +1,47 @@
1
+ const buttonStyle = [{
2
+ tab: "Content",
3
+ value: "content",
4
+ fields: [{
5
+ label: "Button Text",
6
+ key: "label",
7
+ type: "text"
8
+ }, {
9
+ label: "Button URL",
10
+ type: "text",
11
+ key: "url"
12
+ }]
13
+ }, {
14
+ tab: "Banner Spacing",
15
+ value: "bannerSpacing",
16
+ fields: [{
17
+ label: "Banner Spacing",
18
+ key: "bannerSpacing",
19
+ type: "bannerSpacing"
20
+ }]
21
+ }, {
22
+ tab: "Border Radius",
23
+ value: "borderRadius",
24
+ fields: [{
25
+ label: "Border Radius",
26
+ key: "borderRadius",
27
+ type: "borderRadius"
28
+ }]
29
+ }, {
30
+ tab: "Colors",
31
+ value: "colors",
32
+ fields: [{
33
+ label: "Text",
34
+ key: "textColor",
35
+ type: "color",
36
+ needPreview: true
37
+ }, {
38
+ label: "Background",
39
+ key: "bgColor",
40
+ type: "color"
41
+ }, {
42
+ label: "Border",
43
+ key: "borderColor",
44
+ type: "color"
45
+ }]
46
+ }];
47
+ export default buttonStyle;
@@ -0,0 +1,63 @@
1
+ const embedImageStyle = [{
2
+ tab: "Image Texts",
3
+ value: "imageTexts",
4
+ fields: [{
5
+ label: "Image Texts",
6
+ key: "imageTexts",
7
+ type: "imageTexts"
8
+ }]
9
+ }, {
10
+ tab: "Banner Spacing",
11
+ value: "bannerSpacing",
12
+ fields: [{
13
+ label: "Banner Spacing",
14
+ key: "bannerSpacing",
15
+ type: "bannerSpacing"
16
+ }]
17
+ }, {
18
+ tab: "Position",
19
+ value: "position",
20
+ fields: [{
21
+ label: "Set Postion (Vertical & Horizantal)",
22
+ key: "alignment",
23
+ type: "alignment"
24
+ }]
25
+ }, {
26
+ tab: "Colors",
27
+ value: "colors",
28
+ fields: [{
29
+ label: "Text",
30
+ key: "textColor",
31
+ type: "color",
32
+ needPreview: true
33
+ }, {
34
+ label: "Background",
35
+ key: "bgColor",
36
+ type: "color"
37
+ }, {
38
+ label: "Border",
39
+ key: "borderColor",
40
+ type: "color"
41
+ }]
42
+ }, {
43
+ tab: "URL",
44
+ value: "url",
45
+ fields: [{
46
+ label: "URL",
47
+ key: "url",
48
+ type: "text"
49
+ }, {
50
+ label: "File",
51
+ key: "url",
52
+ type: "backgroundImage"
53
+ }]
54
+ }, {
55
+ tab: "Size",
56
+ value: "elementSize",
57
+ fields: [{
58
+ label: "Element Size",
59
+ key: "size",
60
+ type: "elementSize"
61
+ }]
62
+ }];
63
+ export default embedImageStyle;
@@ -0,0 +1,88 @@
1
+ import React from "react";
2
+ import { Grid, Radio, RadioGroup, FormControl, FormLabel, FormControlLabel } from "@mui/material";
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsxs as _jsxs } from "react/jsx-runtime";
5
+ const Alignment = 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]: {
17
+ ...value,
18
+ [e.target.name]: e.target.value
19
+ }
20
+ });
21
+ };
22
+ return /*#__PURE__*/_jsxs(Grid, {
23
+ container: true,
24
+ padding: 3,
25
+ style: {
26
+ paddingTop: "12px"
27
+ },
28
+ spacing: 1,
29
+ children: [/*#__PURE__*/_jsx(Grid, {
30
+ item: true,
31
+ xs: 12,
32
+ children: /*#__PURE__*/_jsxs(FormControl, {
33
+ children: [/*#__PURE__*/_jsx(FormLabel, {
34
+ id: "demo-row-radio-buttons-group-label",
35
+ children: "Horizantal Position"
36
+ }), /*#__PURE__*/_jsxs(RadioGroup, {
37
+ row: true,
38
+ "aria-labelledby": "demo-row-radio-buttons-group-label",
39
+ name: "horizantal",
40
+ value: value?.horizantal || "start",
41
+ onChange: handleChange,
42
+ children: [/*#__PURE__*/_jsx(FormControlLabel, {
43
+ value: "start",
44
+ control: /*#__PURE__*/_jsx(Radio, {}),
45
+ label: "Left"
46
+ }), /*#__PURE__*/_jsx(FormControlLabel, {
47
+ value: "center",
48
+ control: /*#__PURE__*/_jsx(Radio, {}),
49
+ label: "Center"
50
+ }), /*#__PURE__*/_jsx(FormControlLabel, {
51
+ value: "end",
52
+ control: /*#__PURE__*/_jsx(Radio, {}),
53
+ label: "Right"
54
+ })]
55
+ })]
56
+ })
57
+ }), /*#__PURE__*/_jsx(Grid, {
58
+ item: true,
59
+ xs: 12,
60
+ children: /*#__PURE__*/_jsxs(FormControl, {
61
+ children: [/*#__PURE__*/_jsx(FormLabel, {
62
+ id: "demo-row-radio-buttons-group-label",
63
+ children: "Vertical Position"
64
+ }), /*#__PURE__*/_jsxs(RadioGroup, {
65
+ row: true,
66
+ "aria-labelledby": "demo-row-radio-buttons-group-label",
67
+ name: "vertical",
68
+ value: value?.vertical || "start",
69
+ onChange: handleChange,
70
+ children: [/*#__PURE__*/_jsx(FormControlLabel, {
71
+ value: "start",
72
+ control: /*#__PURE__*/_jsx(Radio, {}),
73
+ label: "Top"
74
+ }), /*#__PURE__*/_jsx(FormControlLabel, {
75
+ value: "center",
76
+ control: /*#__PURE__*/_jsx(Radio, {}),
77
+ label: "Middle"
78
+ }), /*#__PURE__*/_jsx(FormControlLabel, {
79
+ value: "end",
80
+ control: /*#__PURE__*/_jsx(Radio, {}),
81
+ label: "Bottom"
82
+ })]
83
+ })]
84
+ })
85
+ })]
86
+ });
87
+ };
88
+ export default Alignment;