@flozy/editor 1.1.2 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. package/dist/Editor/CollaborativeEditor.js +7 -2
  2. package/dist/Editor/CommonEditor.js +53 -34
  3. package/dist/Editor/Editor.css +93 -17
  4. package/dist/Editor/Elements/Accordion/Accordion.js +67 -2
  5. package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +20 -0
  6. package/dist/Editor/Elements/Accordion/AccordionButton.js +2 -1
  7. package/dist/Editor/Elements/Accordion/AccordionSummary.js +59 -4
  8. package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +20 -0
  9. package/dist/Editor/Elements/Button/ButtonPopup.js +20 -0
  10. package/dist/Editor/Elements/Button/ButtonToolIcon.js +19 -0
  11. package/dist/Editor/Elements/Button/EditorButton.js +124 -0
  12. package/dist/Editor/Elements/Carousel/Arrows.js +39 -0
  13. package/dist/Editor/Elements/Carousel/Carousel.js +82 -0
  14. package/dist/Editor/Elements/Carousel/CarouselButton.js +19 -0
  15. package/dist/Editor/Elements/Carousel/CarouselItem.js +13 -0
  16. package/dist/Editor/Elements/Carousel/slick-theme.min.css +143 -0
  17. package/dist/Editor/Elements/Carousel/slick.min.css +83 -0
  18. package/dist/Editor/Elements/Color Picker/ColorPicker.js +1 -1
  19. package/dist/Editor/Elements/Embed/Embed.css +22 -2
  20. package/dist/Editor/Elements/Embed/Embed.js +89 -74
  21. package/dist/Editor/Elements/Embed/EmbedPopup.js +23 -0
  22. package/dist/Editor/Elements/Embed/Image.js +92 -10
  23. package/dist/Editor/Elements/Embed/Video.js +1 -0
  24. package/dist/Editor/Elements/Equation/EquationButton.js +12 -12
  25. package/dist/Editor/Elements/Grid/Grid.js +64 -8
  26. package/dist/Editor/Elements/Grid/GridButton.js +2 -4
  27. package/dist/Editor/Elements/Grid/GridItem.js +59 -5
  28. package/dist/Editor/Elements/Grid/GridItemPopup.js +20 -0
  29. package/dist/Editor/Elements/Grid/GridPopup.js +22 -0
  30. package/dist/Editor/Elements/ID/Id.js +1 -1
  31. package/dist/Editor/Elements/ImageText/ImageText.js +14 -0
  32. package/dist/Editor/Elements/ImageText/ImageTextWrapper.js +14 -0
  33. package/dist/Editor/Elements/Link/LinkButton.js +1 -1
  34. package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -1
  35. package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +88 -0
  36. package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +22 -0
  37. package/dist/Editor/Elements/Signature/Signature.js +4 -2
  38. package/dist/Editor/Elements/Signature/SignatureButton.js +2 -1
  39. package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +7 -2
  40. package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -1
  41. package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +50 -0
  42. package/dist/Editor/Elements/Signature/SignatureOptions/index.js +2 -1
  43. package/dist/Editor/Elements/Signature/SignaturePopup.js +79 -10
  44. package/dist/Editor/Elements/Table/DeleteCellIcon.js +24 -0
  45. package/dist/Editor/Elements/Table/DeleteRowIcon.js +24 -0
  46. package/dist/Editor/Elements/Table/Table.js +9 -1
  47. package/dist/Editor/Elements/Table/TableCell.js +181 -0
  48. package/dist/Editor/Elements/Table/TablePopup.js +22 -0
  49. package/dist/Editor/Elements/Table/TableRow.js +31 -0
  50. package/dist/Editor/Elements/Table/TableSelector.js +62 -68
  51. package/dist/Editor/Toolbar/Toolbar.js +22 -7
  52. package/dist/Editor/Toolbar/styles.css +20 -11
  53. package/dist/Editor/Toolbar/toolbarGroups.js +9 -9
  54. package/dist/Editor/common/Button.js +4 -8
  55. package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +23 -0
  56. package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +35 -0
  57. package/dist/Editor/common/StyleBuilder/buttonStyle.js +47 -0
  58. package/dist/Editor/common/StyleBuilder/embedImageStyle.js +63 -0
  59. package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +88 -0
  60. package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +87 -0
  61. package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +136 -0
  62. package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +126 -0
  63. package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +89 -0
  64. package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +110 -0
  65. package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +42 -0
  66. package/dist/Editor/common/StyleBuilder/fieldTypes/imageTexts.js +75 -0
  67. package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +21 -0
  68. package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +46 -0
  69. package/dist/Editor/common/StyleBuilder/gridItemStyle.js +51 -0
  70. package/dist/Editor/common/StyleBuilder/gridStyle.js +51 -0
  71. package/dist/Editor/common/StyleBuilder/index.js +114 -0
  72. package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +10 -0
  73. package/dist/Editor/common/StyleBuilder/tableStyle.js +38 -0
  74. package/dist/Editor/common/Uploader.js +87 -0
  75. package/dist/Editor/plugins/withEmbeds.js +12 -5
  76. package/dist/Editor/plugins/withTable.js +5 -4
  77. package/dist/Editor/service/fileupload.js +17 -0
  78. package/dist/Editor/utils/SlateUtilityFunctions.js +46 -12
  79. package/dist/Editor/utils/button.js +11 -0
  80. package/dist/Editor/utils/carousel.js +13 -0
  81. package/dist/Editor/utils/carouselItem.js +19 -0
  82. package/dist/Editor/utils/customHooks/useContextMenu.js +8 -8
  83. package/dist/Editor/utils/customHooks/useResize.js +1 -1
  84. package/dist/Editor/utils/font.js +4 -4
  85. package/dist/Editor/utils/helper.js +16 -0
  86. package/dist/Editor/utils/imageText.js +19 -0
  87. package/dist/Editor/utils/table.js +172 -0
  88. package/package.json +2 -1
@@ -15,7 +15,8 @@ const CollaborativeEditor = props => {
15
15
  content,
16
16
  onSave,
17
17
  user,
18
- socketURL
18
+ socketURL,
19
+ apiHOST
19
20
  } = props;
20
21
  const convertedContent = draftToSlate({
21
22
  data: content
@@ -112,7 +113,11 @@ const CollaborativeEditor = props => {
112
113
  id: id,
113
114
  content: [],
114
115
  onSave: onSave,
115
- readOnly: authenticated.scope
116
+ readOnly: authenticated.scope,
117
+ otherProps: {
118
+ token: user?.token,
119
+ API_HOST: apiHOST
120
+ }
116
121
  });
117
122
  };
118
123
  export default CollaborativeEditor;
@@ -33,7 +33,8 @@ const CommonEditor = props => {
33
33
  content,
34
34
  onSave,
35
35
  editor: collaborativeEditor,
36
- readOnly
36
+ readOnly,
37
+ otherProps
37
38
  } = props;
38
39
  const convertedContent = draftToSlate({
39
40
  data: content
@@ -43,6 +44,10 @@ const CommonEditor = props => {
43
44
  if (collaborativeEditor) return collaborativeEditor;
44
45
  return withCommon(createEditor());
45
46
  }, [collaborativeEditor]);
47
+ const pageSettings = editor?.children?.find(f => f.type === "page-settings");
48
+ const {
49
+ pageProps
50
+ } = pageSettings || {};
46
51
  useEffect(() => {
47
52
  setValue(draftToSlate({
48
53
  data: content
@@ -72,14 +77,19 @@ const CommonEditor = props => {
72
77
  onSave(JSON.stringify(value));
73
78
  }
74
79
  };
80
+ const customProps = {
81
+ ...(otherProps || {})
82
+ };
75
83
  const renderElement = useCallback(props => {
76
84
  return /*#__PURE__*/_jsx(Element, {
77
- ...props
85
+ ...props,
86
+ customProps: customProps
78
87
  });
79
88
  }, []);
80
89
  const renderLeaf = useCallback(props => {
81
90
  return /*#__PURE__*/_jsx(Leaf, {
82
- ...props
91
+ ...props,
92
+ customProps: customProps
83
93
  });
84
94
  }, []);
85
95
  const handleCodeToText = partialState => {
@@ -109,39 +119,48 @@ const CommonEditor = props => {
109
119
  }, [chars, editor, target, mentions, setMentions]);
110
120
  const isReadOnly = readOnly === "readonly";
111
121
  const Overlay = collaborativeEditor && !isReadOnly ? RemoteCursorOverlay : React.Fragment;
112
- return /*#__PURE__*/_jsxs(Slate, {
113
- editor: editor,
114
- initialValue: value,
115
- onChange: handleEditorChange,
116
- children: [/*#__PURE__*/_jsxs(Overlay, {
117
- children: [!isReadOnly ? /*#__PURE__*/_jsx(Toolbar, {
118
- handleCodeToText: handleCodeToText
119
- }) : null, /*#__PURE__*/_jsxs("div", {
120
- className: "editor-wrapper",
121
- style: {
122
- border: "1px solid #f3f3f3",
123
- padding: "0 10px"
124
- },
125
- children: [/*#__PURE__*/_jsx(Editable, {
126
- readOnly: isReadOnly,
127
- placeholder: "Write something",
128
- renderElement: renderElement,
129
- renderLeaf: renderLeaf,
130
- onKeyDown: onKeyDown
131
- }), /*#__PURE__*/_jsx(MentionsPopup, {
132
- mentions: mentions,
133
- setMentions: setMentions,
134
- editor: editor,
135
- target: target,
136
- index: index,
137
- chars: chars
122
+ return /*#__PURE__*/_jsx("div", {
123
+ style: {
124
+ display: "flex",
125
+ flexDirection: "column",
126
+ padding: "0 8px"
127
+ },
128
+ children: /*#__PURE__*/_jsxs(Slate, {
129
+ editor: editor,
130
+ initialValue: value,
131
+ onChange: handleEditorChange,
132
+ children: [/*#__PURE__*/_jsxs(Overlay, {
133
+ children: [!isReadOnly ? /*#__PURE__*/_jsx(Toolbar, {
134
+ handleCodeToText: handleCodeToText,
135
+ customProps: customProps
136
+ }) : null, /*#__PURE__*/_jsxs("div", {
137
+ className: "editor-wrapper",
138
+ style: {
139
+ border: "1px solid #f3f3f3",
140
+ backgroundColor: pageProps?.pageColor || "#FFF",
141
+ padding: "8px 8px"
142
+ },
143
+ children: [/*#__PURE__*/_jsx(Editable, {
144
+ readOnly: isReadOnly,
145
+ placeholder: "Write something",
146
+ renderElement: renderElement,
147
+ renderLeaf: renderLeaf,
148
+ onKeyDown: onKeyDown
149
+ }), /*#__PURE__*/_jsx(MentionsPopup, {
150
+ mentions: mentions,
151
+ setMentions: setMentions,
152
+ editor: editor,
153
+ target: target,
154
+ index: index,
155
+ chars: chars
156
+ })]
138
157
  })]
158
+ }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
159
+ ...htmlAction,
160
+ handleCodeToText: handleCodeToText
139
161
  })]
140
- }), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
141
- ...htmlAction,
142
- handleCodeToText: handleCodeToText
143
- })]
144
- }, id);
162
+ }, id)
163
+ });
145
164
  };
146
165
  const CHARACTERS = ["Aayla Secura", "Adi Gallia", "Admiral Dodd Rancit", "Admiral Firmus Piett", "Admiral Gial Ackbar", "Admiral Ozzel", "Admiral Raddus", "Admiral Terrinald Screed", "Admiral Trench", "Admiral U.O. Statura", "Agen Kolar", "Agent Kallus", "Aiolin and Morit Astarte", "Aks Moe", "Almec", "Alton Kastle", "Amee", "AP-5", "Armitage Hux", "Artoo", "Arvel Crynyd", "Asajj Ventress", "Aurra Sing", "AZI-3", "Bala-Tik", "Barada", "Bargwill Tomder", "Baron Papanoida", "Barriss Offee", "Baze Malbus", "Bazine Netal", "BB-8", "BB-9E", "Ben Quadinaros", "Berch Teller", "Beru Lars", "Bib Fortuna", "Biggs Darklighter", "Black Krrsantan", "Bo-Katan Kryze", "Boba Fett", "Bobbajo", "Bodhi Rook", "Borvo the Hutt", "Boss Nass", "Bossk", "Breha Antilles-Organa", "Bren Derlin", "Brendol Hux", "BT-1", "C-3PO", "C1-10P", "Cad Bane", "Caluan Ematt", "Captain Gregor", "Captain Phasma", "Captain Quarsh Panaka", "Captain Rex", "Carlist Rieekan", "Casca Panzoro", "Cassian Andor", "Cassio Tagge", "Cham Syndulla", "Che Amanwe Papanoida", "Chewbacca", "Chi Eekway Papanoida", "Chief Chirpa", "Chirrut Îmwe", "Ciena Ree", "Cin Drallig", "Clegg Holdfast", "Cliegg Lars", "Coleman Kcaj", "Coleman Trebor", "Colonel Kaplan", "Commander Bly", "Commander Cody (CC-2224)", "Commander Fil (CC-3714)", "Commander Fox", "Commander Gree", "Commander Jet", "Commander Wolffe", "Conan Antonio Motti", "Conder Kyl", "Constable Zuvio", "Cordé", "Cpatain Typho", "Crix Madine", "Cut Lawquane", "Dak Ralter", "Dapp", "Darth Bane", "Darth Maul", "Darth Tyranus", "Daultay Dofine", "Del Meeko", "Delian Mors", "Dengar", "Depa Billaba", "Derek Klivian", "Dexter Jettster", "Dineé Ellberger", "DJ", "Doctor Aphra", "Doctor Evazan", "Dogma", "Dormé", "Dr. Cylo", "Droidbait", "Droopy McCool", "Dryden Vos", "Dud Bolt", "Ebe E. Endocott", "Echuu Shen-Jon", "Eeth Koth", "Eighth Brother", "Eirtaé", "Eli Vanto", "Ellé", "Ello Asty", "Embo", "Eneb Ray", "Enfys Nest", "EV-9D9", "Evaan Verlaine", "Even Piell", "Ezra Bridger", "Faro Argyus", "Feral", "Fifth Brother", "Finis Valorum", "Finn", "Fives", "FN-1824", "FN-2003", "Fodesinbeed Annodue", "Fulcrum", "FX-7", "GA-97", "Galen Erso", "Gallius Rax", 'Garazeb "Zeb" Orrelios', "Gardulla the Hutt", "Garrick Versio", "Garven Dreis", "Gavyn Sykes", "Gideon Hask", "Gizor Dellso", "Gonk droid", "Grand Inquisitor", "Greeata Jendowanian", "Greedo", "Greer Sonnel", "Grievous", "Grummgar", "Gungi", "Hammerhead", "Han Solo", "Harter Kalonia", "Has Obbit", "Hera Syndulla", "Hevy", "Hondo Ohnaka", "Huyang", "Iden Versio", "IG-88", "Ima-Gun Di", "Inquisitors", "Inspector Thanoth", "Jabba", "Jacen Syndulla", "Jan Dodonna", "Jango Fett", "Janus Greejatus", "Jar Jar Binks", "Jas Emari", "Jaxxon", "Jek Tono Porkins", "Jeremoch Colton", "Jira", "Jobal Naberrie", "Jocasta Nu", "Joclad Danva", "Joh Yowza", "Jom Barell", "Joph Seastriker", "Jova Tarkin", "Jubnuk", "Jyn Erso", "K-2SO", "Kanan Jarrus", "Karbin", "Karina the Great", "Kes Dameron", "Ketsu Onyo", "Ki-Adi-Mundi", "King Katuunko", "Kit Fisto", "Kitster Banai", "Klaatu", "Klik-Klak", "Korr Sella", "Kylo Ren", "L3-37", "Lama Su", "Lando Calrissian", "Lanever Villecham", "Leia Organa", "Letta Turmond", "Lieutenant Kaydel Ko Connix", "Lieutenant Thire", "Lobot", "Logray", "Lok Durd", "Longo Two-Guns", "Lor San Tekka", "Lorth Needa", "Lott Dod", "Luke Skywalker", "Lumat", "Luminara Unduli", "Lux Bonteri", "Lyn Me", "Lyra Erso", "Mace Windu", "Malakili", "Mama the Hutt", "Mars Guo", "Mas Amedda", "Mawhonic", "Max Rebo", "Maximilian Veers", "Maz Kanata", "ME-8D9", "Meena Tills", "Mercurial Swift", "Mina Bonteri", "Miraj Scintel", "Mister Bones", "Mod Terrik", "Moden Canady", "Mon Mothma", "Moradmin Bast", "Moralo Eval", "Morley", "Mother Talzin", "Nahdar Vebb", "Nahdonnis Praji", "Nien Nunb", "Niima the Hutt", "Nines", "Norra Wexley", "Nute Gunray", "Nuvo Vindi", "Obi-Wan Kenobi", "Odd Ball", "Ody Mandrell", "Omi", "Onaconda Farr", "Oola", "OOM-9", "Oppo Rancisis", "Orn Free Taa", "Oro Dassyne", "Orrimarko", "Osi Sobeck", "Owen Lars", "Pablo-Jill", "Padmé Amidala", "Pagetti Rook", "Paige Tico", "Paploo", "Petty Officer Thanisson", "Pharl McQuarrie", "Plo Koon", "Po Nudo", "Poe Dameron", "Poggle the Lesser", "Pong Krell", "Pooja Naberrie", "PZ-4CO", "Quarrie", "Quay Tolsite", "Queen Apailana", "Queen Jamillia", "Queen Neeyutnee", "Qui-Gon Jinn", "Quiggold", "Quinlan Vos", "R2-D2", "R2-KT", "R3-S6", "R4-P17", "R5-D4", "RA-7", "Rabé", "Rako Hardeen", "Ransolm Casterfo", "Rappertunie", "Ratts Tyerell", "Raymus Antilles", "Ree-Yees", "Reeve Panzoro", "Rey", "Ric Olié", "Riff Tamson", "Riley", "Rinnriyin Di", "Rio Durant", "Rogue Squadron", "Romba", "Roos Tarpals", "Rose Tico", "Rotta the Hutt", "Rukh", "Rune Haako", "Rush Clovis", "Ruwee Naberrie", "Ryoo Naberrie", "Sabé", "Sabine Wren", "Saché", "Saelt-Marae", "Saesee Tiin", "Salacious B. Crumb", "San Hill", "Sana Starros", "Sarco Plank", "Sarkli", "Satine Kryze", "Savage Opress", "Sebulba", "Senator Organa", "Sergeant Kreel", "Seventh Sister", "Shaak Ti", "Shara Bey", "Shmi Skywalker", "Shu Mai", "Sidon Ithano", "Sifo-Dyas", "Sim Aloo", "Siniir Rath Velus", "Sio Bibble", "Sixth Brother", "Slowen Lo", "Sly Moore", "Snaggletooth", "Snap Wexley", "Snoke", "Sola Naberrie", "Sora Bulq", "Strono Tuggs", "Sy Snootles", "Tallissan Lintra", "Tarfful", "Tasu Leech", "Taun We", "TC-14", "Tee Watt Kaa", "Teebo", "Teedo", "Teemto Pagalies", "Temiri Blagg", "Tessek", "Tey How", "Thane Kyrell", "The Bendu", "The Smuggler", "Thrawn", "Tiaan Jerjerrod", "Tion Medon", "Tobias Beckett", "Tulon Voidgazer", "Tup", "U9-C4", "Unkar Plutt", "Val Beckett", "Vanden Willard", "Vice Admiral Amilyn Holdo", "Vober Dand", "WAC-47", "Wag Too", "Wald", "Walrus Man", "Warok", "Wat Tambor", "Watto", "Wedge Antilles", "Wes Janson", "Wicket W. Warrick", "Wilhuff Tarkin", "Wollivan", "Wuher", "Wullf Yularen", "Xamuel Lennox", "Yaddle", "Yarael Poof", "Yoda", "Zam Wesell", "Zev Senesca", "Ziro the Hutt", "Zuckuss"];
147
166
  export default CommonEditor;
@@ -15,24 +15,19 @@ table{
15
15
  button{
16
16
  background-color: white;
17
17
  border:none;
18
- opacity: 0.5;
19
18
  }
20
19
  .btnActive{
21
20
  opacity: 1;
22
21
  }
23
22
  .editor-wrapper{
24
23
  font-family:'Helvetica','Arial', sans-serif;
25
- border-radius: 10px;
26
- background: #ffffff;
27
- box-shadow: -8px 8px 13px #ededed,
28
- 8px -8px 13px #ffffff;
24
+ background: #ffffff;
29
25
  min-height: 400px;
30
- min-width: 100%;
31
- width: fit-content;
32
26
  height: fit-content;
33
- padding: 12px 10px;
34
27
  max-width: 100%;
28
+ border: none !important
35
29
  }
30
+
36
31
  table{
37
32
  width:100%;
38
33
  }
@@ -40,7 +35,7 @@ td{
40
35
  height: 50px;
41
36
  padding:0 5px;
42
37
  }
43
- .popup-wrapper{
38
+ .popup-wrapper1 {
44
39
  display: inline;
45
40
  position: relative;
46
41
  }
@@ -90,7 +85,22 @@ html{
90
85
  .grid-item-toolbar {
91
86
  position: absolute;
92
87
  right: 0;
93
- top: 0;
88
+ top: -25px;
89
+ }
90
+
91
+ .element-toolbar {
92
+ position: absolute;
93
+ right: 0;
94
+ top: -14px;
95
+ z-index: 1000;
96
+ }
97
+
98
+ .grid-container-toolbar button,
99
+ .grid-item-toolbar button,
100
+ .element-toolbar button {
101
+ margin-right: 8px;
102
+ background-color: rgba(0, 0, 0, 0.8);
103
+ color: #FFF;
94
104
  }
95
105
 
96
106
  .grid-item {
@@ -105,28 +115,35 @@ html{
105
115
 
106
116
  .accordion-title {
107
117
  position: relative;
118
+ background-color: #CCC;
119
+ display: flex;
120
+ align-items: center;
108
121
  }
109
122
 
110
123
  .accordion-content {
111
124
  padding-left: 32px;
125
+ background-color: #eee;
126
+ border: 1px solid #CCC;
112
127
  }
113
128
 
114
129
  .accordion-summary-container {
115
130
  padding: 8px 0px;
116
131
  margin: 0px;
117
132
  position: relative;
118
- padding-left: 40px;
133
+ padding-left: 16px;
119
134
  }
120
135
 
121
136
  .accordion-summary-collapse-btn {
122
- position: absolute;
123
- top: 12px;
124
- left: 0;
125
137
  width: 32px;
126
138
  height: 32px;
127
139
  z-index: 1;
128
140
  border-radius: 50%;
129
- line-height: 1px;
141
+ display: flex;
142
+ justify-content: center;
143
+ align-items: center;
144
+ margin-left: 12px;
145
+ margin-right: 12px;
146
+ position: relative;
130
147
  }
131
148
 
132
149
  .accordion-details-container {
@@ -220,14 +237,73 @@ html{
220
237
  width: 100%;
221
238
  }
222
239
 
240
+ .brushcolorpic {
241
+
242
+ }
243
+ .sizeIcons .MuiButtonBase-root {
244
+ opacity: 1;
245
+ }
246
+ .sizeIcons .MuiButtonBase-root.active .MuiSvgIcon-root {
247
+ fill: #0052CC;
248
+ }
249
+
250
+ .dialog-actions-si .MuiButtonBase-root {
251
+ opacity: 1;
252
+ }
253
+
254
+ .signature-tab {
255
+ display: flex;
256
+ align-items: center;
257
+ justify-content: center;
258
+ flex-direction: column;
259
+ width: 100%;
260
+ }
261
+
262
+ .upload-sign-img-wrapper {
263
+ text-align: center;
264
+ }
265
+
266
+ .signature-tab img {
267
+ width: 150px;
268
+ height: auto;
269
+ }
270
+
271
+ .editor-btn-wrapper {
272
+ position: relative;
273
+ }
274
+
275
+ .editor-btn {
276
+ opacity: 1;
277
+ }
278
+
279
+ .editor-btn-options .MuiList-root {
280
+ display: flex;
281
+ }
282
+
283
+ .input-adorn .MuiInputAdornment-root .MuiIconButton-root.active {
284
+ background-color: #CCC;
285
+ }
286
+
287
+ .empty-carousel-wrapper {
288
+ display: flex;
289
+ flex-direction: row;
290
+ overflow-x: auto;
291
+ }
292
+ .empty-carousel-wrapper > div{
293
+ display: flex;
294
+ flex-direction: column;
295
+ width: 100%;
296
+ flex-shrink: 0;
297
+ }
298
+
223
299
  @media (max-width: 480px) {
224
300
  .toolbar {
225
301
  display: flex;
226
302
  flex-wrap: nowrap;
227
303
  overflow-x: scroll;
228
304
  }
229
- .toolbar-grp,
230
- .toolbar-grp > div {
305
+ .toolbar-grp1,
306
+ .toolbar-grp1 > div {
231
307
  display: flex;
232
308
  }
233
309
  .grid-item {
@@ -1,26 +1,86 @@
1
1
  import React, { useState } from "react";
2
+ import { Transforms } from "slate";
3
+ import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
2
4
  import KeyboardArrowRightIcon from "@mui/icons-material/KeyboardArrowRight";
3
5
  import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
6
+ import SettingsIcon from "@mui/icons-material/Settings";
7
+ import AccordionBtnPopup from "./AccordionBtnPopup";
8
+ import { IconButton } from "@mui/material";
4
9
  import { jsx as _jsx } from "react/jsx-runtime";
5
10
  import { jsxs as _jsxs } from "react/jsx-runtime";
6
11
  const Accordion = props => {
7
12
  const {
8
13
  attributes,
9
- children
14
+ children,
15
+ element,
16
+ customProps
10
17
  } = props;
11
18
  const [toggle, setToggle] = useState(false);
19
+ const [openSetttings, setOpenSettings] = useState(false);
20
+ const editor = useSlateStatic();
21
+ const selected = useSelected();
22
+ const path = ReactEditor.findPath(editor, element);
23
+ const {
24
+ textColor,
25
+ btnBg,
26
+ bgColor
27
+ } = element;
12
28
  const onToggle = () => {
13
29
  setToggle(!toggle);
14
30
  };
31
+ const ToolBar = () => {
32
+ return selected ? /*#__PURE__*/_jsx("div", {
33
+ className: "grid-container-toolbar",
34
+ contentEditable: false,
35
+ style: {
36
+ left: "0px",
37
+ display: "flex",
38
+ width: "fit-content"
39
+ },
40
+ children: /*#__PURE__*/_jsx(IconButton, {
41
+ size: "small",
42
+ onClick: onSettings,
43
+ children: /*#__PURE__*/_jsx(SettingsIcon, {})
44
+ })
45
+ }) : null;
46
+ };
47
+ const onSettings = () => {
48
+ setOpenSettings(true);
49
+ };
50
+ const onSave = data => {
51
+ const updateData = {
52
+ ...data
53
+ };
54
+ delete updateData.children;
55
+ Transforms.setNodes(editor, {
56
+ ...updateData
57
+ }, {
58
+ at: path
59
+ });
60
+ onClose();
61
+ };
62
+ const onClose = () => {
63
+ setOpenSettings(false);
64
+ };
15
65
  return /*#__PURE__*/_jsxs("div", {
16
66
  className: `accordion-container`,
17
67
  ...attributes,
68
+ style: {
69
+ position: "relative"
70
+ },
18
71
  children: [/*#__PURE__*/_jsxs("div", {
19
72
  className: "accordion-title",
73
+ style: {
74
+ backgroundColor: bgColor
75
+ },
20
76
  children: [/*#__PURE__*/_jsx("button", {
21
77
  className: "accordion-summary-collapse-btn",
22
78
  contentEditable: false,
23
79
  onClick: onToggle,
80
+ style: {
81
+ backgroundColor: btnBg,
82
+ color: textColor
83
+ },
24
84
  children: toggle ? /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {}) : /*#__PURE__*/_jsx(KeyboardArrowRightIcon, {})
25
85
  }), children[0]]
26
86
  }), /*#__PURE__*/_jsx("div", {
@@ -29,7 +89,12 @@ const Accordion = props => {
29
89
  display: toggle ? "block" : "none"
30
90
  },
31
91
  children: children[1]
32
- })]
92
+ }), /*#__PURE__*/_jsx(ToolBar, {}), openSetttings ? /*#__PURE__*/_jsx(AccordionBtnPopup, {
93
+ element: element,
94
+ onSave: onSave,
95
+ onClose: onClose,
96
+ customProps: customProps
97
+ }) : null]
33
98
  });
34
99
  };
35
100
  export default Accordion;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import StyleBuilder from "../../common/StyleBuilder";
3
+ import accordionTitleBtnStyle from "../../common/StyleBuilder/accordionTitleBtnStyle";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const AccordionBtnPopup = props => {
6
+ const {
7
+ element,
8
+ onSave,
9
+ onClose
10
+ } = props;
11
+ return /*#__PURE__*/_jsx(StyleBuilder, {
12
+ title: "Accordion Collapse Button",
13
+ type: "accordionTitleBtnStyle",
14
+ element: element,
15
+ onSave: onSave,
16
+ onClose: onClose,
17
+ renderTabs: accordionTitleBtnStyle
18
+ });
19
+ };
20
+ export default AccordionBtnPopup;
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { IconButton } from "@mui/material";
2
3
  import ExpandCircleDownIcon from "@mui/icons-material/ExpandCircleDown";
3
4
  import { insertAccordion } from "../../utils/accordion";
4
5
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -9,7 +10,7 @@ const AccordionButton = props => {
9
10
  const handleInsertAccordion = () => {
10
11
  insertAccordion(editor);
11
12
  };
12
- return /*#__PURE__*/_jsx("button", {
13
+ return /*#__PURE__*/_jsx(IconButton, {
13
14
  onClick: handleInsertAccordion,
14
15
  title: "Accordion",
15
16
  style: {
@@ -1,14 +1,69 @@
1
- import React from "react";
1
+ import React, { useState } from "react";
2
+ import { Transforms } from "slate";
3
+ import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
4
+ import AccordionTitlePopup from "./AccordionTitlePopup";
2
5
  import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
3
7
  const AccordionSummary = props => {
4
8
  const {
5
9
  attributes,
6
- children
10
+ children,
11
+ element,
12
+ customProps
7
13
  } = props;
8
- return /*#__PURE__*/_jsx("div", {
14
+ const [openSetttings, setOpenSettings] = useState(false);
15
+ const editor = useSlateStatic();
16
+ const selected = useSelected();
17
+ const path = ReactEditor.findPath(editor, element);
18
+ const {
19
+ textColor,
20
+ bgColor,
21
+ borderColor
22
+ } = element;
23
+ const ToolBar = () => {
24
+ return selected ? /*#__PURE__*/_jsx("div", {
25
+ className: "grid-container-toolbar",
26
+ contentEditable: false,
27
+ children: /*#__PURE__*/_jsx("button", {
28
+ onClick: onSettings,
29
+ children: "Settings"
30
+ })
31
+ }) : null;
32
+ };
33
+ const onSettings = () => {
34
+ setOpenSettings(true);
35
+ };
36
+ const onSave = data => {
37
+ const updateData = {
38
+ ...data
39
+ };
40
+ delete updateData.children;
41
+ Transforms.setNodes(editor, {
42
+ ...updateData
43
+ }, {
44
+ at: path
45
+ });
46
+ onClose();
47
+ };
48
+ const onClose = () => {
49
+ setOpenSettings(false);
50
+ };
51
+ return /*#__PURE__*/_jsxs("div", {
9
52
  className: `accordion-summary-container`,
10
53
  ...attributes,
11
- children: children
54
+ style: {
55
+ width: "100%",
56
+ position: "relative",
57
+ backgroundColor: bgColor,
58
+ border: `1px solid ${borderColor}`,
59
+ color: textColor
60
+ },
61
+ children: [children, /*#__PURE__*/_jsx(ToolBar, {}), openSetttings ? /*#__PURE__*/_jsx(AccordionTitlePopup, {
62
+ element: element,
63
+ onSave: onSave,
64
+ onClose: onClose,
65
+ customProps: customProps
66
+ }) : null]
12
67
  });
13
68
  };
14
69
  export default AccordionSummary;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import StyleBuilder from "../../common/StyleBuilder";
3
+ import accordionTitleStyle from "../../common/StyleBuilder/accordionTitleStyle";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const AccordionTitlePopup = props => {
6
+ const {
7
+ element,
8
+ onSave,
9
+ onClose
10
+ } = props;
11
+ return /*#__PURE__*/_jsx(StyleBuilder, {
12
+ title: "Accordion Title",
13
+ type: "accordionTitleStyle",
14
+ element: element,
15
+ onSave: onSave,
16
+ onClose: onClose,
17
+ renderTabs: accordionTitleStyle
18
+ });
19
+ };
20
+ export default AccordionTitlePopup;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import StyleBuilder from "../../common/StyleBuilder";
3
+ import buttonStyle from "../../common/StyleBuilder/buttonStyle";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ const ButtonPopup = props => {
6
+ const {
7
+ element,
8
+ onSave,
9
+ onClose
10
+ } = props;
11
+ return /*#__PURE__*/_jsx(StyleBuilder, {
12
+ title: "Button",
13
+ type: "buttonStyle",
14
+ element: element,
15
+ onSave: onSave,
16
+ onClose: onClose,
17
+ renderTabs: buttonStyle
18
+ });
19
+ };
20
+ export default ButtonPopup;
@@ -0,0 +1,19 @@
1
+ import React from "react";
2
+ import { IconButton } from "@mui/material";
3
+ import ViewStreamIcon from "@mui/icons-material/ViewStream";
4
+ import { insertButton } from "../../utils/button";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ const ButtonToolIcon = props => {
7
+ const {
8
+ editor
9
+ } = props;
10
+ const handleInsertButton = () => {
11
+ insertButton(editor);
12
+ };
13
+ return /*#__PURE__*/_jsx(IconButton, {
14
+ onClick: handleInsertButton,
15
+ title: "Button",
16
+ children: /*#__PURE__*/_jsx(ViewStreamIcon, {})
17
+ });
18
+ };
19
+ export default ButtonToolIcon;