@flozy/editor 1.1.2 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/Editor/CollaborativeEditor.js +7 -2
- package/dist/Editor/CommonEditor.js +53 -34
- package/dist/Editor/Editor.css +93 -17
- package/dist/Editor/Elements/Accordion/Accordion.js +67 -2
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +20 -0
- package/dist/Editor/Elements/Accordion/AccordionButton.js +2 -1
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +59 -4
- package/dist/Editor/Elements/Accordion/AccordionTitlePopup.js +20 -0
- package/dist/Editor/Elements/Button/ButtonPopup.js +20 -0
- package/dist/Editor/Elements/Button/ButtonToolIcon.js +19 -0
- package/dist/Editor/Elements/Button/EditorButton.js +124 -0
- package/dist/Editor/Elements/Carousel/Arrows.js +39 -0
- package/dist/Editor/Elements/Carousel/Carousel.js +82 -0
- package/dist/Editor/Elements/Carousel/CarouselButton.js +19 -0
- package/dist/Editor/Elements/Carousel/CarouselItem.js +13 -0
- package/dist/Editor/Elements/Carousel/slick-theme.min.css +143 -0
- package/dist/Editor/Elements/Carousel/slick.min.css +83 -0
- package/dist/Editor/Elements/Color Picker/ColorPicker.js +1 -1
- package/dist/Editor/Elements/Embed/Embed.css +22 -2
- package/dist/Editor/Elements/Embed/Embed.js +89 -74
- package/dist/Editor/Elements/Embed/EmbedPopup.js +23 -0
- package/dist/Editor/Elements/Embed/Image.js +92 -10
- package/dist/Editor/Elements/Embed/Video.js +1 -0
- package/dist/Editor/Elements/Equation/EquationButton.js +12 -12
- package/dist/Editor/Elements/Grid/Grid.js +64 -8
- package/dist/Editor/Elements/Grid/GridButton.js +2 -4
- package/dist/Editor/Elements/Grid/GridItem.js +59 -5
- package/dist/Editor/Elements/Grid/GridItemPopup.js +20 -0
- package/dist/Editor/Elements/Grid/GridPopup.js +22 -0
- package/dist/Editor/Elements/ID/Id.js +1 -1
- package/dist/Editor/Elements/ImageText/ImageText.js +14 -0
- package/dist/Editor/Elements/ImageText/ImageTextWrapper.js +14 -0
- package/dist/Editor/Elements/Link/LinkButton.js +1 -1
- package/dist/Editor/Elements/NewLine/NewLineButton.js +2 -1
- package/dist/Editor/Elements/PageSettings/PageSettingsButton.js +88 -0
- package/dist/Editor/Elements/PageSettings/PageSettingsPopup.js +22 -0
- package/dist/Editor/Elements/Signature/Signature.js +4 -2
- package/dist/Editor/Elements/Signature/SignatureButton.js +2 -1
- package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +7 -2
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +2 -1
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +50 -0
- package/dist/Editor/Elements/Signature/SignatureOptions/index.js +2 -1
- package/dist/Editor/Elements/Signature/SignaturePopup.js +79 -10
- package/dist/Editor/Elements/Table/DeleteCellIcon.js +24 -0
- package/dist/Editor/Elements/Table/DeleteRowIcon.js +24 -0
- package/dist/Editor/Elements/Table/Table.js +9 -1
- package/dist/Editor/Elements/Table/TableCell.js +181 -0
- package/dist/Editor/Elements/Table/TablePopup.js +22 -0
- package/dist/Editor/Elements/Table/TableRow.js +31 -0
- package/dist/Editor/Elements/Table/TableSelector.js +62 -68
- package/dist/Editor/Toolbar/Toolbar.js +22 -7
- package/dist/Editor/Toolbar/styles.css +20 -11
- package/dist/Editor/Toolbar/toolbarGroups.js +9 -9
- package/dist/Editor/common/Button.js +4 -8
- package/dist/Editor/common/StyleBuilder/accordionTitleBtnStyle.js +23 -0
- package/dist/Editor/common/StyleBuilder/accordionTitleStyle.js +35 -0
- package/dist/Editor/common/StyleBuilder/buttonStyle.js +47 -0
- package/dist/Editor/common/StyleBuilder/embedImageStyle.js +63 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/alignment.js +88 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/backgroundImage.js +87 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/bannerSpacing.js +136 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/borderRadius.js +126 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/color.js +89 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/elementSize.js +110 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/gridSize.js +42 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/imageTexts.js +75 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/index.js +21 -0
- package/dist/Editor/common/StyleBuilder/fieldTypes/text.js +46 -0
- package/dist/Editor/common/StyleBuilder/gridItemStyle.js +51 -0
- package/dist/Editor/common/StyleBuilder/gridStyle.js +51 -0
- package/dist/Editor/common/StyleBuilder/index.js +114 -0
- package/dist/Editor/common/StyleBuilder/pageSettingsStyle.js +10 -0
- package/dist/Editor/common/StyleBuilder/tableStyle.js +38 -0
- package/dist/Editor/common/Uploader.js +87 -0
- package/dist/Editor/plugins/withEmbeds.js +12 -5
- package/dist/Editor/plugins/withTable.js +5 -4
- package/dist/Editor/service/fileupload.js +17 -0
- package/dist/Editor/utils/SlateUtilityFunctions.js +46 -12
- package/dist/Editor/utils/button.js +11 -0
- package/dist/Editor/utils/carousel.js +13 -0
- package/dist/Editor/utils/carouselItem.js +19 -0
- package/dist/Editor/utils/customHooks/useContextMenu.js +8 -8
- package/dist/Editor/utils/customHooks/useResize.js +1 -1
- package/dist/Editor/utils/font.js +4 -4
- package/dist/Editor/utils/helper.js +16 -0
- package/dist/Editor/utils/imageText.js +19 -0
- package/dist/Editor/utils/table.js +172 -0
- 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__*/
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
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
|
-
}
|
141
|
-
|
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;
|
package/dist/Editor/Editor.css
CHANGED
@@ -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
|
-
|
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-
|
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:
|
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:
|
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
|
-
|
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-
|
230
|
-
.toolbar-
|
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(
|
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
|
-
|
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
|
-
|
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;
|