@flozy/editor 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. package/.eslintignore +4 -0
  2. package/.eslintrc.json +6 -0
  3. package/.github/workflows/npm-publish.yml +33 -0
  4. package/.husky/pre-commit +1 -0
  5. package/.storybook/main.js +20 -0
  6. package/.storybook/preview.js +14 -0
  7. package/.vscode/extensions.json +7 -0
  8. package/.vscode/launch.json +15 -0
  9. package/.vscode/settings.json +22 -0
  10. package/README.md +2 -0
  11. package/craco.config.js +16 -0
  12. package/package.json +107 -0
  13. package/public/favicon.ico +0 -0
  14. package/public/index.html +43 -0
  15. package/public/logo192.png +0 -0
  16. package/public/logo512.png +0 -0
  17. package/public/manifest.json +25 -0
  18. package/public/robots.txt +3 -0
  19. package/src/components/Editor/CollaborativeEditor.js +119 -0
  20. package/src/components/Editor/CommonEditor.js +549 -0
  21. package/src/components/Editor/Editor.css +115 -0
  22. package/src/components/Editor/Elements/CodeToText/CodeToText.css +57 -0
  23. package/src/components/Editor/Elements/CodeToText/CodeToText.jsx +115 -0
  24. package/src/components/Editor/Elements/CodeToText/CodeToTextButton.jsx +16 -0
  25. package/src/components/Editor/Elements/CodeToText/HtmlCode.jsx +59 -0
  26. package/src/components/Editor/Elements/CodeToText/HtmlContextMenu.jsx +39 -0
  27. package/src/components/Editor/Elements/Color Picker/ColorPicker.css +38 -0
  28. package/src/components/Editor/Elements/Color Picker/ColorPicker.jsx +110 -0
  29. package/src/components/Editor/Elements/Color Picker/defaultColors.js +34 -0
  30. package/src/components/Editor/Elements/Embed/Embed.css +14 -0
  31. package/src/components/Editor/Elements/Embed/Embed.jsx +74 -0
  32. package/src/components/Editor/Elements/Embed/Image.jsx +82 -0
  33. package/src/components/Editor/Elements/Embed/Video.jsx +65 -0
  34. package/src/components/Editor/Elements/Equation/Equation.jsx +19 -0
  35. package/src/components/Editor/Elements/Equation/EquationButton.jsx +59 -0
  36. package/src/components/Editor/Elements/Equation/styles.css +4 -0
  37. package/src/components/Editor/Elements/Grid/Grid.js +48 -0
  38. package/src/components/Editor/Elements/Grid/GridButton.js +21 -0
  39. package/src/components/Editor/Elements/Grid/GridItem.js +57 -0
  40. package/src/components/Editor/Elements/ID/Id.jsx +56 -0
  41. package/src/components/Editor/Elements/Link/Link.jsx +24 -0
  42. package/src/components/Editor/Elements/Link/LinkButton.jsx +71 -0
  43. package/src/components/Editor/Elements/Link/styles.css +20 -0
  44. package/src/components/Editor/Elements/Mentions/Mentions.jsx +37 -0
  45. package/src/components/Editor/Elements/NewLine/NewLineButton.js +29 -0
  46. package/src/components/Editor/Elements/Table/Table.jsx +13 -0
  47. package/src/components/Editor/Elements/Table/TableSelector.css +18 -0
  48. package/src/components/Editor/Elements/Table/TableSelector.jsx +76 -0
  49. package/src/components/Editor/Elements/TableContextMenu/TableContextMenu.jsx +97 -0
  50. package/src/components/Editor/Elements/TableContextMenu/styles.css +18 -0
  51. package/src/components/Editor/RemoteCursorOverlay/Overlay.js +78 -0
  52. package/src/components/Editor/Toolbar/Toolbar.jsx +167 -0
  53. package/src/components/Editor/Toolbar/styles.css +28 -0
  54. package/src/components/Editor/Toolbar/toolbarGroups.js +167 -0
  55. package/src/components/Editor/Toolbar/toolbarIcons/align-center.svg +1 -0
  56. package/src/components/Editor/Toolbar/toolbarIcons/align-left.svg +1 -0
  57. package/src/components/Editor/Toolbar/toolbarIcons/align-right.svg +1 -0
  58. package/src/components/Editor/Toolbar/toolbarIcons/blockquote.svg +1 -0
  59. package/src/components/Editor/Toolbar/toolbarIcons/bold.png +0 -0
  60. package/src/components/Editor/Toolbar/toolbarIcons/fontColor.svg +4 -0
  61. package/src/components/Editor/Toolbar/toolbarIcons/headingOne.svg +3 -0
  62. package/src/components/Editor/Toolbar/toolbarIcons/headingTwo.svg +3 -0
  63. package/src/components/Editor/Toolbar/toolbarIcons/italic.png +0 -0
  64. package/src/components/Editor/Toolbar/toolbarIcons/link.svg +1 -0
  65. package/src/components/Editor/Toolbar/toolbarIcons/orderedList.svg +1 -0
  66. package/src/components/Editor/Toolbar/toolbarIcons/strikethrough.png +0 -0
  67. package/src/components/Editor/Toolbar/toolbarIcons/subscript.svg +1 -0
  68. package/src/components/Editor/Toolbar/toolbarIcons/superscript.svg +1 -0
  69. package/src/components/Editor/Toolbar/toolbarIcons/textColor.png +0 -0
  70. package/src/components/Editor/Toolbar/toolbarIcons/underline.png +0 -0
  71. package/src/components/Editor/Toolbar/toolbarIcons/unlink.svg +1 -0
  72. package/src/components/Editor/Toolbar/toolbarIcons/unorderedList.svg +1 -0
  73. package/src/components/Editor/YjsProvider.js +11 -0
  74. package/src/components/Editor/common/Button.jsx +12 -0
  75. package/src/components/Editor/common/Icon.jsx +82 -0
  76. package/src/components/Editor/common/MentionsPopup.jsx +56 -0
  77. package/src/components/Editor/hooks/useMentions.js +44 -0
  78. package/src/components/Editor/hooks/withCollaborative.js +15 -0
  79. package/src/components/Editor/hooks/withCommon.js +17 -0
  80. package/src/components/Editor/plugins/withEmbeds.js +36 -0
  81. package/src/components/Editor/plugins/withEquation.js +8 -0
  82. package/src/components/Editor/plugins/withLinks.js +9 -0
  83. package/src/components/Editor/plugins/withMentions.js +19 -0
  84. package/src/components/Editor/plugins/withTable.js +74 -0
  85. package/src/components/Editor/utils/SlateUtilityFunctions.js +273 -0
  86. package/src/components/Editor/utils/customHooks/useContextMenu.js +42 -0
  87. package/src/components/Editor/utils/customHooks/useFormat.js +26 -0
  88. package/src/components/Editor/utils/customHooks/usePopup.jsx +26 -0
  89. package/src/components/Editor/utils/customHooks/useResize.js +41 -0
  90. package/src/components/Editor/utils/draftToSlate.js +104 -0
  91. package/src/components/Editor/utils/embed.js +18 -0
  92. package/src/components/Editor/utils/equation.js +22 -0
  93. package/src/components/Editor/utils/events.js +56 -0
  94. package/src/components/Editor/utils/grid.js +12 -0
  95. package/src/components/Editor/utils/gridItem.js +19 -0
  96. package/src/components/Editor/utils/link.js +53 -0
  97. package/src/components/Editor/utils/mentions.js +11 -0
  98. package/src/components/Editor/utils/paragraph.js +4 -0
  99. package/src/components/Editor/utils/serializer.js +32 -0
  100. package/src/components/Editor/utils/table.js +151 -0
  101. package/src/components/index.js +5 -0
  102. package/src/index.js +1 -0
  103. package/src/stories/CollaborativeEditor.stories.js +30 -0
  104. package/src/stories/Editor.stories.js +24 -0
  105. package/src/stories/EditorSampleProps/ChatSample.js +43 -0
  106. package/src/stories/EditorSampleProps/LayoutOne.js +551 -0
@@ -0,0 +1,549 @@
1
+ import React, { useCallback, useEffect, useMemo, useState } from "react";
2
+ import { Slate, Editable } from "slate-react";
3
+ import Toolbar from "./Toolbar/Toolbar";
4
+ import { getMarked, getBlock } from "./utils/SlateUtilityFunctions";
5
+ import "./Editor.css";
6
+ import CodeToText from "./Elements/CodeToText/CodeToText";
7
+ import { draftToSlate } from "./utils/draftToSlate";
8
+ import useMentions from "./hooks/useMentions";
9
+ import MentionsPopup from "./common/MentionsPopup";
10
+ import { RemoteCursorOverlay } from "./RemoteCursorOverlay/Overlay";
11
+ import { mentionsEvent, commands } from "./utils/events";
12
+ import withCommon from "./hooks/withCommon";
13
+ import { createEditor } from "slate";
14
+
15
+ const Element = (props) => {
16
+ return getBlock(props);
17
+ };
18
+
19
+ const Leaf = ({ attributes, children, leaf }) => {
20
+ children = getMarked(leaf, children);
21
+ return <span {...attributes}>{children}</span>;
22
+ };
23
+
24
+ const CommonEditor = (props) => {
25
+ const { id, content, onSave, editor: collaborativeEditor, readOnly } = props;
26
+ const convertedContent = draftToSlate({ data: content });
27
+ const [value, setValue] = useState(convertedContent);
28
+
29
+ const editor = useMemo(() => {
30
+ if (collaborativeEditor) return collaborativeEditor;
31
+ return withCommon(createEditor());
32
+ }, [collaborativeEditor]);
33
+
34
+ useEffect(() => {
35
+ setValue(draftToSlate({ data: content }));
36
+ }, [id, content]);
37
+
38
+ const [htmlAction, setHtmlAction] = useState({
39
+ showInput: false,
40
+ html: "",
41
+ action: "",
42
+ location: "",
43
+ });
44
+ const [mentions, setMentions] = useMentions({
45
+ editor,
46
+ selection: editor?.selection,
47
+ });
48
+
49
+ const { search, target, index } = mentions;
50
+ const chars = CHARACTERS.filter((c) =>
51
+ c.toLowerCase().startsWith(search?.toLowerCase())
52
+ ).slice(0, 10);
53
+
54
+ const handleEditorChange = (newValue) => {
55
+ setValue(newValue);
56
+ const isAstChange = editor.operations.some(
57
+ (op) => "set_selection" !== op.type
58
+ );
59
+ if (isAstChange && onSave) {
60
+ // send the value to onSave api
61
+ onSave(JSON.stringify(value));
62
+ }
63
+ };
64
+
65
+ const renderElement = useCallback((props) => <Element {...props} />, []);
66
+
67
+ const renderLeaf = useCallback((props) => {
68
+ return <Leaf {...props} />;
69
+ }, []);
70
+
71
+ const handleCodeToText = (partialState) => {
72
+ setHtmlAction((prev) => ({
73
+ ...prev,
74
+ ...partialState,
75
+ }));
76
+ };
77
+
78
+ const onKeyDown = useCallback(
79
+ (event) => {
80
+ const isCtrlKey =
81
+ event.ctrlKey ||
82
+ (event.metaKey && event.keyCode >= 65 && event.keyCode <= 90);
83
+ if (target && chars.length > 0 && !isCtrlKey) {
84
+ mentionsEvent({
85
+ event,
86
+ mentions,
87
+ setMentions,
88
+ chars,
89
+ target,
90
+ editor,
91
+ });
92
+ } else if (isCtrlKey) {
93
+ commands({
94
+ event,
95
+ editor,
96
+ });
97
+ }
98
+ },
99
+ [chars, editor, target, mentions, setMentions]
100
+ );
101
+
102
+ const isReadOnly = readOnly === "readonly";
103
+ const Overlay =
104
+ collaborativeEditor && !isReadOnly ? RemoteCursorOverlay : React.Fragment;
105
+
106
+ return (
107
+ <Slate
108
+ key={id}
109
+ editor={editor}
110
+ initialValue={value}
111
+ onChange={handleEditorChange}
112
+ >
113
+ <Overlay>
114
+ {!isReadOnly ? <Toolbar handleCodeToText={handleCodeToText} /> : null}
115
+ <div
116
+ className="editor-wrapper"
117
+ style={{ border: "1px solid #f3f3f3", padding: "0 10px" }}
118
+ >
119
+ <Editable
120
+ readOnly={isReadOnly}
121
+ placeholder="Write something"
122
+ renderElement={renderElement}
123
+ renderLeaf={renderLeaf}
124
+ onKeyDown={onKeyDown}
125
+ />
126
+ <MentionsPopup
127
+ mentions={mentions}
128
+ setMentions={setMentions}
129
+ editor={editor}
130
+ target={target}
131
+ index={index}
132
+ chars={chars}
133
+ />
134
+ </div>
135
+ </Overlay>
136
+ {htmlAction.showInput && (
137
+ <CodeToText {...htmlAction} handleCodeToText={handleCodeToText} />
138
+ )}
139
+ </Slate>
140
+ );
141
+ };
142
+
143
+ const CHARACTERS = [
144
+ "Aayla Secura",
145
+ "Adi Gallia",
146
+ "Admiral Dodd Rancit",
147
+ "Admiral Firmus Piett",
148
+ "Admiral Gial Ackbar",
149
+ "Admiral Ozzel",
150
+ "Admiral Raddus",
151
+ "Admiral Terrinald Screed",
152
+ "Admiral Trench",
153
+ "Admiral U.O. Statura",
154
+ "Agen Kolar",
155
+ "Agent Kallus",
156
+ "Aiolin and Morit Astarte",
157
+ "Aks Moe",
158
+ "Almec",
159
+ "Alton Kastle",
160
+ "Amee",
161
+ "AP-5",
162
+ "Armitage Hux",
163
+ "Artoo",
164
+ "Arvel Crynyd",
165
+ "Asajj Ventress",
166
+ "Aurra Sing",
167
+ "AZI-3",
168
+ "Bala-Tik",
169
+ "Barada",
170
+ "Bargwill Tomder",
171
+ "Baron Papanoida",
172
+ "Barriss Offee",
173
+ "Baze Malbus",
174
+ "Bazine Netal",
175
+ "BB-8",
176
+ "BB-9E",
177
+ "Ben Quadinaros",
178
+ "Berch Teller",
179
+ "Beru Lars",
180
+ "Bib Fortuna",
181
+ "Biggs Darklighter",
182
+ "Black Krrsantan",
183
+ "Bo-Katan Kryze",
184
+ "Boba Fett",
185
+ "Bobbajo",
186
+ "Bodhi Rook",
187
+ "Borvo the Hutt",
188
+ "Boss Nass",
189
+ "Bossk",
190
+ "Breha Antilles-Organa",
191
+ "Bren Derlin",
192
+ "Brendol Hux",
193
+ "BT-1",
194
+ "C-3PO",
195
+ "C1-10P",
196
+ "Cad Bane",
197
+ "Caluan Ematt",
198
+ "Captain Gregor",
199
+ "Captain Phasma",
200
+ "Captain Quarsh Panaka",
201
+ "Captain Rex",
202
+ "Carlist Rieekan",
203
+ "Casca Panzoro",
204
+ "Cassian Andor",
205
+ "Cassio Tagge",
206
+ "Cham Syndulla",
207
+ "Che Amanwe Papanoida",
208
+ "Chewbacca",
209
+ "Chi Eekway Papanoida",
210
+ "Chief Chirpa",
211
+ "Chirrut Îmwe",
212
+ "Ciena Ree",
213
+ "Cin Drallig",
214
+ "Clegg Holdfast",
215
+ "Cliegg Lars",
216
+ "Coleman Kcaj",
217
+ "Coleman Trebor",
218
+ "Colonel Kaplan",
219
+ "Commander Bly",
220
+ "Commander Cody (CC-2224)",
221
+ "Commander Fil (CC-3714)",
222
+ "Commander Fox",
223
+ "Commander Gree",
224
+ "Commander Jet",
225
+ "Commander Wolffe",
226
+ "Conan Antonio Motti",
227
+ "Conder Kyl",
228
+ "Constable Zuvio",
229
+ "Cordé",
230
+ "Cpatain Typho",
231
+ "Crix Madine",
232
+ "Cut Lawquane",
233
+ "Dak Ralter",
234
+ "Dapp",
235
+ "Darth Bane",
236
+ "Darth Maul",
237
+ "Darth Tyranus",
238
+ "Daultay Dofine",
239
+ "Del Meeko",
240
+ "Delian Mors",
241
+ "Dengar",
242
+ "Depa Billaba",
243
+ "Derek Klivian",
244
+ "Dexter Jettster",
245
+ "Dineé Ellberger",
246
+ "DJ",
247
+ "Doctor Aphra",
248
+ "Doctor Evazan",
249
+ "Dogma",
250
+ "Dormé",
251
+ "Dr. Cylo",
252
+ "Droidbait",
253
+ "Droopy McCool",
254
+ "Dryden Vos",
255
+ "Dud Bolt",
256
+ "Ebe E. Endocott",
257
+ "Echuu Shen-Jon",
258
+ "Eeth Koth",
259
+ "Eighth Brother",
260
+ "Eirtaé",
261
+ "Eli Vanto",
262
+ "Ellé",
263
+ "Ello Asty",
264
+ "Embo",
265
+ "Eneb Ray",
266
+ "Enfys Nest",
267
+ "EV-9D9",
268
+ "Evaan Verlaine",
269
+ "Even Piell",
270
+ "Ezra Bridger",
271
+ "Faro Argyus",
272
+ "Feral",
273
+ "Fifth Brother",
274
+ "Finis Valorum",
275
+ "Finn",
276
+ "Fives",
277
+ "FN-1824",
278
+ "FN-2003",
279
+ "Fodesinbeed Annodue",
280
+ "Fulcrum",
281
+ "FX-7",
282
+ "GA-97",
283
+ "Galen Erso",
284
+ "Gallius Rax",
285
+ 'Garazeb "Zeb" Orrelios',
286
+ "Gardulla the Hutt",
287
+ "Garrick Versio",
288
+ "Garven Dreis",
289
+ "Gavyn Sykes",
290
+ "Gideon Hask",
291
+ "Gizor Dellso",
292
+ "Gonk droid",
293
+ "Grand Inquisitor",
294
+ "Greeata Jendowanian",
295
+ "Greedo",
296
+ "Greer Sonnel",
297
+ "Grievous",
298
+ "Grummgar",
299
+ "Gungi",
300
+ "Hammerhead",
301
+ "Han Solo",
302
+ "Harter Kalonia",
303
+ "Has Obbit",
304
+ "Hera Syndulla",
305
+ "Hevy",
306
+ "Hondo Ohnaka",
307
+ "Huyang",
308
+ "Iden Versio",
309
+ "IG-88",
310
+ "Ima-Gun Di",
311
+ "Inquisitors",
312
+ "Inspector Thanoth",
313
+ "Jabba",
314
+ "Jacen Syndulla",
315
+ "Jan Dodonna",
316
+ "Jango Fett",
317
+ "Janus Greejatus",
318
+ "Jar Jar Binks",
319
+ "Jas Emari",
320
+ "Jaxxon",
321
+ "Jek Tono Porkins",
322
+ "Jeremoch Colton",
323
+ "Jira",
324
+ "Jobal Naberrie",
325
+ "Jocasta Nu",
326
+ "Joclad Danva",
327
+ "Joh Yowza",
328
+ "Jom Barell",
329
+ "Joph Seastriker",
330
+ "Jova Tarkin",
331
+ "Jubnuk",
332
+ "Jyn Erso",
333
+ "K-2SO",
334
+ "Kanan Jarrus",
335
+ "Karbin",
336
+ "Karina the Great",
337
+ "Kes Dameron",
338
+ "Ketsu Onyo",
339
+ "Ki-Adi-Mundi",
340
+ "King Katuunko",
341
+ "Kit Fisto",
342
+ "Kitster Banai",
343
+ "Klaatu",
344
+ "Klik-Klak",
345
+ "Korr Sella",
346
+ "Kylo Ren",
347
+ "L3-37",
348
+ "Lama Su",
349
+ "Lando Calrissian",
350
+ "Lanever Villecham",
351
+ "Leia Organa",
352
+ "Letta Turmond",
353
+ "Lieutenant Kaydel Ko Connix",
354
+ "Lieutenant Thire",
355
+ "Lobot",
356
+ "Logray",
357
+ "Lok Durd",
358
+ "Longo Two-Guns",
359
+ "Lor San Tekka",
360
+ "Lorth Needa",
361
+ "Lott Dod",
362
+ "Luke Skywalker",
363
+ "Lumat",
364
+ "Luminara Unduli",
365
+ "Lux Bonteri",
366
+ "Lyn Me",
367
+ "Lyra Erso",
368
+ "Mace Windu",
369
+ "Malakili",
370
+ "Mama the Hutt",
371
+ "Mars Guo",
372
+ "Mas Amedda",
373
+ "Mawhonic",
374
+ "Max Rebo",
375
+ "Maximilian Veers",
376
+ "Maz Kanata",
377
+ "ME-8D9",
378
+ "Meena Tills",
379
+ "Mercurial Swift",
380
+ "Mina Bonteri",
381
+ "Miraj Scintel",
382
+ "Mister Bones",
383
+ "Mod Terrik",
384
+ "Moden Canady",
385
+ "Mon Mothma",
386
+ "Moradmin Bast",
387
+ "Moralo Eval",
388
+ "Morley",
389
+ "Mother Talzin",
390
+ "Nahdar Vebb",
391
+ "Nahdonnis Praji",
392
+ "Nien Nunb",
393
+ "Niima the Hutt",
394
+ "Nines",
395
+ "Norra Wexley",
396
+ "Nute Gunray",
397
+ "Nuvo Vindi",
398
+ "Obi-Wan Kenobi",
399
+ "Odd Ball",
400
+ "Ody Mandrell",
401
+ "Omi",
402
+ "Onaconda Farr",
403
+ "Oola",
404
+ "OOM-9",
405
+ "Oppo Rancisis",
406
+ "Orn Free Taa",
407
+ "Oro Dassyne",
408
+ "Orrimarko",
409
+ "Osi Sobeck",
410
+ "Owen Lars",
411
+ "Pablo-Jill",
412
+ "Padmé Amidala",
413
+ "Pagetti Rook",
414
+ "Paige Tico",
415
+ "Paploo",
416
+ "Petty Officer Thanisson",
417
+ "Pharl McQuarrie",
418
+ "Plo Koon",
419
+ "Po Nudo",
420
+ "Poe Dameron",
421
+ "Poggle the Lesser",
422
+ "Pong Krell",
423
+ "Pooja Naberrie",
424
+ "PZ-4CO",
425
+ "Quarrie",
426
+ "Quay Tolsite",
427
+ "Queen Apailana",
428
+ "Queen Jamillia",
429
+ "Queen Neeyutnee",
430
+ "Qui-Gon Jinn",
431
+ "Quiggold",
432
+ "Quinlan Vos",
433
+ "R2-D2",
434
+ "R2-KT",
435
+ "R3-S6",
436
+ "R4-P17",
437
+ "R5-D4",
438
+ "RA-7",
439
+ "Rabé",
440
+ "Rako Hardeen",
441
+ "Ransolm Casterfo",
442
+ "Rappertunie",
443
+ "Ratts Tyerell",
444
+ "Raymus Antilles",
445
+ "Ree-Yees",
446
+ "Reeve Panzoro",
447
+ "Rey",
448
+ "Ric Olié",
449
+ "Riff Tamson",
450
+ "Riley",
451
+ "Rinnriyin Di",
452
+ "Rio Durant",
453
+ "Rogue Squadron",
454
+ "Romba",
455
+ "Roos Tarpals",
456
+ "Rose Tico",
457
+ "Rotta the Hutt",
458
+ "Rukh",
459
+ "Rune Haako",
460
+ "Rush Clovis",
461
+ "Ruwee Naberrie",
462
+ "Ryoo Naberrie",
463
+ "Sabé",
464
+ "Sabine Wren",
465
+ "Saché",
466
+ "Saelt-Marae",
467
+ "Saesee Tiin",
468
+ "Salacious B. Crumb",
469
+ "San Hill",
470
+ "Sana Starros",
471
+ "Sarco Plank",
472
+ "Sarkli",
473
+ "Satine Kryze",
474
+ "Savage Opress",
475
+ "Sebulba",
476
+ "Senator Organa",
477
+ "Sergeant Kreel",
478
+ "Seventh Sister",
479
+ "Shaak Ti",
480
+ "Shara Bey",
481
+ "Shmi Skywalker",
482
+ "Shu Mai",
483
+ "Sidon Ithano",
484
+ "Sifo-Dyas",
485
+ "Sim Aloo",
486
+ "Siniir Rath Velus",
487
+ "Sio Bibble",
488
+ "Sixth Brother",
489
+ "Slowen Lo",
490
+ "Sly Moore",
491
+ "Snaggletooth",
492
+ "Snap Wexley",
493
+ "Snoke",
494
+ "Sola Naberrie",
495
+ "Sora Bulq",
496
+ "Strono Tuggs",
497
+ "Sy Snootles",
498
+ "Tallissan Lintra",
499
+ "Tarfful",
500
+ "Tasu Leech",
501
+ "Taun We",
502
+ "TC-14",
503
+ "Tee Watt Kaa",
504
+ "Teebo",
505
+ "Teedo",
506
+ "Teemto Pagalies",
507
+ "Temiri Blagg",
508
+ "Tessek",
509
+ "Tey How",
510
+ "Thane Kyrell",
511
+ "The Bendu",
512
+ "The Smuggler",
513
+ "Thrawn",
514
+ "Tiaan Jerjerrod",
515
+ "Tion Medon",
516
+ "Tobias Beckett",
517
+ "Tulon Voidgazer",
518
+ "Tup",
519
+ "U9-C4",
520
+ "Unkar Plutt",
521
+ "Val Beckett",
522
+ "Vanden Willard",
523
+ "Vice Admiral Amilyn Holdo",
524
+ "Vober Dand",
525
+ "WAC-47",
526
+ "Wag Too",
527
+ "Wald",
528
+ "Walrus Man",
529
+ "Warok",
530
+ "Wat Tambor",
531
+ "Watto",
532
+ "Wedge Antilles",
533
+ "Wes Janson",
534
+ "Wicket W. Warrick",
535
+ "Wilhuff Tarkin",
536
+ "Wollivan",
537
+ "Wuher",
538
+ "Wullf Yularen",
539
+ "Xamuel Lennox",
540
+ "Yaddle",
541
+ "Yarael Poof",
542
+ "Yoda",
543
+ "Zam Wesell",
544
+ "Zev Senesca",
545
+ "Ziro the Hutt",
546
+ "Zuckuss",
547
+ ];
548
+
549
+ export default CommonEditor;
@@ -0,0 +1,115 @@
1
+ blockquote{
2
+ border-left: 2px solid #ddd;
3
+ margin-left: 0;
4
+ margin-right: 0;
5
+ padding-left: 10px;
6
+ color: #aaa;
7
+ font-style: italic;
8
+ }
9
+ table, th, td {
10
+ border: 1px solid black;
11
+ }
12
+ table{
13
+ border-collapse: collapse;
14
+ }
15
+ button{
16
+ background-color: white;
17
+ border:none;
18
+ opacity: 0.5;
19
+ }
20
+ .btnActive{
21
+ opacity: 1;
22
+ }
23
+ .editor-wrapper{
24
+ 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;
29
+ min-height: 400px;
30
+ min-width: 100%;
31
+ width: fit-content;
32
+ height: fit-content;
33
+ padding: 12px 10px;
34
+ max-width: 100%;
35
+ }
36
+ table{
37
+ width:100%;
38
+ }
39
+ td{
40
+ height: 50px;
41
+ padding:0 5px;
42
+ }
43
+ .popup-wrapper{
44
+ display: inline;
45
+ position: relative;
46
+ }
47
+ .popup{
48
+ position: fixed;
49
+ left: 0;
50
+ right: 0;
51
+ top: 0;
52
+ bottom: 0;
53
+ margin: auto;
54
+ background-color: white;
55
+ padding: 6px 10px;
56
+ border: 1px solid lightgray;
57
+ height: fit-content;
58
+ z-index: 1;
59
+ width: 300px;
60
+
61
+ }
62
+ button{
63
+ cursor: pointer;
64
+ }
65
+ code {
66
+ font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
67
+ monospace;
68
+ }
69
+ [data-slate-node="element"] {
70
+ margin: 10px 0;
71
+ }
72
+ html{
73
+ scroll-behavior: smooth;
74
+ }
75
+ .editor-wrapper *:focus-visible {
76
+ outline: none;
77
+ }
78
+
79
+ .grid-container {
80
+ display: flex;
81
+ border-radius: 12px;
82
+ background-color: #F3F6F9;
83
+ border: 1px solid #E5EAF2;
84
+ padding: 16px;
85
+ position: relative;
86
+ flex-wrap: wrap;
87
+ }
88
+
89
+ .grid-container-toolbar,
90
+ .grid-item-toolbar {
91
+ position: absolute;
92
+ right: 0;
93
+ top: 0;
94
+ }
95
+
96
+ .grid-item {
97
+ padding: 16px;
98
+ background-color: #fff;
99
+ position: relative;
100
+ }
101
+
102
+ @media (max-width: 480px) {
103
+ .toolbar {
104
+ display: flex;
105
+ flex-wrap: nowrap;
106
+ overflow-x: scroll;
107
+ }
108
+ .toolbar-grp,
109
+ .toolbar-grp > div {
110
+ display: flex;
111
+ }
112
+ .grid-item {
113
+ width: 100% !important;
114
+ }
115
+ }
@@ -0,0 +1,57 @@
1
+
2
+ .code-wrapper{
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100vw;
7
+ height: 100vh;
8
+ background:rgba(0,0, 0,0.9);
9
+ z-index:2;
10
+ display: flex;
11
+ justify-content: center;
12
+ align-items: center;
13
+
14
+ }
15
+ .codeToTextWrapper{
16
+ width: 80%;
17
+ height: 80%;
18
+ grid-template-columns: 45% 10% 45%;
19
+ }
20
+ .codeToText{
21
+ width: 100%;
22
+ height: 90%;
23
+ display: grid;
24
+ grid-template-columns: 45% 10% 45%;
25
+ }
26
+ .codeToText textarea,.textOutput{
27
+ border-radius: 15px;
28
+ padding: 10px;
29
+ }
30
+
31
+ .codeToText textarea{
32
+ resize: none;
33
+ }
34
+ .codeToText textarea:focus{
35
+ outline: none;
36
+ }
37
+ .textOutput{
38
+ background: #fff;
39
+ overflow: scroll;
40
+ }
41
+ .codeToTextWrapper button{
42
+ margin: 3% 1%;
43
+ padding: 10px 37px;
44
+ cursor: pointer;
45
+ border-radius: 5px;
46
+ opacity: 1;
47
+ font-weight: bolder;
48
+ }
49
+ .done{
50
+ background: #44c767;
51
+ color:#fff;
52
+ }
53
+ .clear{
54
+ background: #fff;
55
+ color:#a9a4a4;
56
+ border:1px solid lightgray;
57
+ }