@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.
- package/dist/Editor/CollaborativeEditor.js +7 -2
- package/dist/Editor/CommonEditor.js +59 -37
- package/dist/Editor/Editor.css +209 -12
- package/dist/Editor/Elements/Accordion/Accordion.js +100 -0
- package/dist/Editor/Elements/Accordion/AccordionBtnPopup.js +20 -0
- package/dist/Editor/Elements/Accordion/AccordionButton.js +22 -0
- package/dist/Editor/Elements/Accordion/AccordionDetails.js +18 -0
- package/dist/Editor/Elements/Accordion/AccordionSummary.js +69 -0
- 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 +31 -5
- 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 +50 -0
- package/dist/Editor/Elements/Signature/SignatureButton.js +19 -0
- package/dist/Editor/Elements/Signature/SignatureOptions/DrawSignature.js +39 -0
- package/dist/Editor/Elements/Signature/SignatureOptions/TypeSignature.js +84 -0
- package/dist/Editor/Elements/Signature/SignatureOptions/UploadSignature.js +50 -0
- package/dist/Editor/Elements/Signature/SignatureOptions/index.js +5 -0
- package/dist/Editor/Elements/Signature/SignaturePopup.js +243 -0
- package/dist/Editor/Elements/Signature/Signed.js +80 -0
- 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 +47 -10
- package/dist/Editor/Toolbar/styles.css +20 -11
- package/dist/Editor/Toolbar/toolbarGroups.js +17 -19
- 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 +72 -23
- package/dist/Editor/utils/accordion.js +25 -0
- 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 +59 -0
- package/dist/Editor/utils/helper.js +32 -0
- package/dist/Editor/utils/imageText.js +19 -0
- package/dist/Editor/utils/signature.js +23 -0
- package/dist/Editor/utils/table.js +172 -0
- package/package.json +11 -3
@@ -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,12 +77,19 @@ const CommonEditor = props => {
|
|
72
77
|
onSave(JSON.stringify(value));
|
73
78
|
}
|
74
79
|
};
|
75
|
-
const
|
76
|
-
...
|
77
|
-
}
|
80
|
+
const customProps = {
|
81
|
+
...(otherProps || {})
|
82
|
+
};
|
83
|
+
const renderElement = useCallback(props => {
|
84
|
+
return /*#__PURE__*/_jsx(Element, {
|
85
|
+
...props,
|
86
|
+
customProps: customProps
|
87
|
+
});
|
88
|
+
}, []);
|
78
89
|
const renderLeaf = useCallback(props => {
|
79
90
|
return /*#__PURE__*/_jsx(Leaf, {
|
80
|
-
...props
|
91
|
+
...props,
|
92
|
+
customProps: customProps
|
81
93
|
});
|
82
94
|
}, []);
|
83
95
|
const handleCodeToText = partialState => {
|
@@ -87,7 +99,8 @@ const CommonEditor = props => {
|
|
87
99
|
}));
|
88
100
|
};
|
89
101
|
const onKeyDown = useCallback(event => {
|
90
|
-
const
|
102
|
+
const isMetaKey = event.metaKey && event.keyCode >= 65 && event.keyCode <= 90;
|
103
|
+
const isCtrlKey = event.ctrlKey || isMetaKey;
|
91
104
|
if (target && chars.length > 0 && !isCtrlKey) {
|
92
105
|
mentionsEvent({
|
93
106
|
event,
|
@@ -106,39 +119,48 @@ const CommonEditor = props => {
|
|
106
119
|
}, [chars, editor, target, mentions, setMentions]);
|
107
120
|
const isReadOnly = readOnly === "readonly";
|
108
121
|
const Overlay = collaborativeEditor && !isReadOnly ? RemoteCursorOverlay : React.Fragment;
|
109
|
-
return /*#__PURE__*/
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
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
|
+
})]
|
135
157
|
})]
|
158
|
+
}), htmlAction.showInput && /*#__PURE__*/_jsx(CodeToText, {
|
159
|
+
...htmlAction,
|
160
|
+
handleCodeToText: handleCodeToText
|
136
161
|
})]
|
137
|
-
}
|
138
|
-
|
139
|
-
handleCodeToText: handleCodeToText
|
140
|
-
})]
|
141
|
-
}, id);
|
162
|
+
}, id)
|
163
|
+
});
|
142
164
|
};
|
143
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"];
|
144
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 {
|
@@ -99,14 +109,201 @@ html{
|
|
99
109
|
position: relative;
|
100
110
|
}
|
101
111
|
|
112
|
+
.accordion-container {
|
113
|
+
padding: 0px;
|
114
|
+
}
|
115
|
+
|
116
|
+
.accordion-title {
|
117
|
+
position: relative;
|
118
|
+
background-color: #CCC;
|
119
|
+
display: flex;
|
120
|
+
align-items: center;
|
121
|
+
}
|
122
|
+
|
123
|
+
.accordion-content {
|
124
|
+
padding-left: 32px;
|
125
|
+
background-color: #eee;
|
126
|
+
border: 1px solid #CCC;
|
127
|
+
}
|
128
|
+
|
129
|
+
.accordion-summary-container {
|
130
|
+
padding: 8px 0px;
|
131
|
+
margin: 0px;
|
132
|
+
position: relative;
|
133
|
+
padding-left: 16px;
|
134
|
+
}
|
135
|
+
|
136
|
+
.accordion-summary-collapse-btn {
|
137
|
+
width: 32px;
|
138
|
+
height: 32px;
|
139
|
+
z-index: 1;
|
140
|
+
border-radius: 50%;
|
141
|
+
display: flex;
|
142
|
+
justify-content: center;
|
143
|
+
align-items: center;
|
144
|
+
margin-left: 12px;
|
145
|
+
margin-right: 12px;
|
146
|
+
position: relative;
|
147
|
+
}
|
148
|
+
|
149
|
+
.accordion-details-container {
|
150
|
+
margin: 0px;
|
151
|
+
padding: 8px;
|
152
|
+
}
|
153
|
+
|
154
|
+
.signature-btn-container button {
|
155
|
+
background-color: #0052CC;
|
156
|
+
padding: 8px 12px;
|
157
|
+
color: #FFFFFF;
|
158
|
+
font-weight: bold;
|
159
|
+
border-radius: 12px;
|
160
|
+
opacity: 1;
|
161
|
+
}
|
162
|
+
|
163
|
+
.signature-btn-grps {
|
164
|
+
display: flex;
|
165
|
+
justify-content: space-around;
|
166
|
+
}
|
167
|
+
|
168
|
+
.signature-btn-grps .MuiButtonBase-root {
|
169
|
+
border: 1px solid #2563eb;
|
170
|
+
color: #0f172a;
|
171
|
+
opacity: 1;
|
172
|
+
}
|
173
|
+
|
174
|
+
.signature-btn-grps .MuiButtonBase-root.active {
|
175
|
+
background-color: #0052CC;
|
176
|
+
color: #FFFFFF;
|
177
|
+
}
|
178
|
+
|
179
|
+
.signature-tab-content {
|
180
|
+
display: flex;
|
181
|
+
margin: 12px 16px;
|
182
|
+
padding: 0px;
|
183
|
+
border: 0px solid #CCC;
|
184
|
+
min-height: 100px;
|
185
|
+
}
|
186
|
+
|
187
|
+
.signature-signed-wrapper {
|
188
|
+
position: relative;
|
189
|
+
display: flex;
|
190
|
+
}
|
191
|
+
.signature-signed-span {
|
192
|
+
position: relative;
|
193
|
+
}
|
194
|
+
.signature-signed-wrapper .signed-btn-del {
|
195
|
+
position: absolute;
|
196
|
+
right: -20px;
|
197
|
+
top: -20px;
|
198
|
+
opacity: 1;
|
199
|
+
z-index: 1;
|
200
|
+
}
|
201
|
+
.signed-btn {
|
202
|
+
text-align: center;
|
203
|
+
opacity: 1;
|
204
|
+
}
|
205
|
+
|
206
|
+
.signed-text {
|
207
|
+
display: flex;
|
208
|
+
justify-content: center;
|
209
|
+
margin-bottom: 8px;
|
210
|
+
padding-bottom: 8px;
|
211
|
+
border-bottom: 1px solid #000;
|
212
|
+
}
|
213
|
+
|
214
|
+
.typesignature-fontfamily .MuiButtonBase-root {
|
215
|
+
opacity: 1;
|
216
|
+
border: 1px solid #ccc;
|
217
|
+
}
|
218
|
+
.typesignature-fontfamily .MuiButtonBase-root.active {
|
219
|
+
border: 1px solid #0052CC;
|
220
|
+
}
|
221
|
+
|
222
|
+
.signature-canvas{
|
223
|
+
height: 100%;
|
224
|
+
width: 100%;
|
225
|
+
border: 1px solid #0052CC;
|
226
|
+
border-radius: 12px;
|
227
|
+
}
|
228
|
+
|
229
|
+
.react-datepicker__input-container {
|
230
|
+
display: flex !important;
|
231
|
+
align-items: center;
|
232
|
+
}
|
233
|
+
.react-datepicker__input-container input {
|
234
|
+
height: 36px;
|
235
|
+
border: 1px solid #ccc;
|
236
|
+
border-radius: 5px;
|
237
|
+
width: 100%;
|
238
|
+
}
|
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
|
+
|
102
299
|
@media (max-width: 480px) {
|
103
300
|
.toolbar {
|
104
301
|
display: flex;
|
105
302
|
flex-wrap: nowrap;
|
106
303
|
overflow-x: scroll;
|
107
304
|
}
|
108
|
-
.toolbar-
|
109
|
-
.toolbar-
|
305
|
+
.toolbar-grp1,
|
306
|
+
.toolbar-grp1 > div {
|
110
307
|
display: flex;
|
111
308
|
}
|
112
309
|
.grid-item {
|
@@ -0,0 +1,100 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Transforms } from "slate";
|
3
|
+
import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
|
4
|
+
import KeyboardArrowRightIcon from "@mui/icons-material/KeyboardArrowRight";
|
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";
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
+
const Accordion = props => {
|
12
|
+
const {
|
13
|
+
attributes,
|
14
|
+
children,
|
15
|
+
element,
|
16
|
+
customProps
|
17
|
+
} = props;
|
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;
|
28
|
+
const onToggle = () => {
|
29
|
+
setToggle(!toggle);
|
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
|
+
};
|
65
|
+
return /*#__PURE__*/_jsxs("div", {
|
66
|
+
className: `accordion-container`,
|
67
|
+
...attributes,
|
68
|
+
style: {
|
69
|
+
position: "relative"
|
70
|
+
},
|
71
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
72
|
+
className: "accordion-title",
|
73
|
+
style: {
|
74
|
+
backgroundColor: bgColor
|
75
|
+
},
|
76
|
+
children: [/*#__PURE__*/_jsx("button", {
|
77
|
+
className: "accordion-summary-collapse-btn",
|
78
|
+
contentEditable: false,
|
79
|
+
onClick: onToggle,
|
80
|
+
style: {
|
81
|
+
backgroundColor: btnBg,
|
82
|
+
color: textColor
|
83
|
+
},
|
84
|
+
children: toggle ? /*#__PURE__*/_jsx(KeyboardArrowDownIcon, {}) : /*#__PURE__*/_jsx(KeyboardArrowRightIcon, {})
|
85
|
+
}), children[0]]
|
86
|
+
}), /*#__PURE__*/_jsx("div", {
|
87
|
+
className: "accordion-content",
|
88
|
+
style: {
|
89
|
+
display: toggle ? "block" : "none"
|
90
|
+
},
|
91
|
+
children: children[1]
|
92
|
+
}), /*#__PURE__*/_jsx(ToolBar, {}), openSetttings ? /*#__PURE__*/_jsx(AccordionBtnPopup, {
|
93
|
+
element: element,
|
94
|
+
onSave: onSave,
|
95
|
+
onClose: onClose,
|
96
|
+
customProps: customProps
|
97
|
+
}) : null]
|
98
|
+
});
|
99
|
+
};
|
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;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { IconButton } from "@mui/material";
|
3
|
+
import ExpandCircleDownIcon from "@mui/icons-material/ExpandCircleDown";
|
4
|
+
import { insertAccordion } from "../../utils/accordion";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
const AccordionButton = props => {
|
7
|
+
const {
|
8
|
+
editor
|
9
|
+
} = props;
|
10
|
+
const handleInsertAccordion = () => {
|
11
|
+
insertAccordion(editor);
|
12
|
+
};
|
13
|
+
return /*#__PURE__*/_jsx(IconButton, {
|
14
|
+
onClick: handleInsertAccordion,
|
15
|
+
title: "Accordion",
|
16
|
+
style: {
|
17
|
+
marginLeft: "0px"
|
18
|
+
},
|
19
|
+
children: /*#__PURE__*/_jsx(ExpandCircleDownIcon, {})
|
20
|
+
});
|
21
|
+
};
|
22
|
+
export default AccordionButton;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
3
|
+
const AccordionDetails = props => {
|
4
|
+
const {
|
5
|
+
attributes,
|
6
|
+
children
|
7
|
+
} = props;
|
8
|
+
return /*#__PURE__*/_jsx("div", {
|
9
|
+
className: `accordion-details-container`,
|
10
|
+
...attributes,
|
11
|
+
style: {
|
12
|
+
height: "auto",
|
13
|
+
overflow: "hidden"
|
14
|
+
},
|
15
|
+
children: children
|
16
|
+
});
|
17
|
+
};
|
18
|
+
export default AccordionDetails;
|
@@ -0,0 +1,69 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { Transforms } from "slate";
|
3
|
+
import { useSelected, useSlateStatic, ReactEditor } from "slate-react";
|
4
|
+
import AccordionTitlePopup from "./AccordionTitlePopup";
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
6
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
7
|
+
const AccordionSummary = props => {
|
8
|
+
const {
|
9
|
+
attributes,
|
10
|
+
children,
|
11
|
+
element,
|
12
|
+
customProps
|
13
|
+
} = props;
|
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", {
|
52
|
+
className: `accordion-summary-container`,
|
53
|
+
...attributes,
|
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]
|
67
|
+
});
|
68
|
+
};
|
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;
|