@eventuras/scribo 0.8.2 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/App.d.ts +11 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/MarkdownEditor.d.ts +18 -0
- package/dist/MarkdownEditor.d.ts.map +1 -0
- package/dist/MarkdownEditor2.js +111 -0
- package/dist/MarkdownEditor2.js.map +1 -0
- package/dist/MarkdownInput.d.ts +27 -0
- package/dist/MarkdownInput.d.ts.map +1 -0
- package/dist/MarkdownInput.js +57 -0
- package/dist/MarkdownInput.js.map +1 -0
- package/dist/callout.js +5 -0
- package/dist/context/SharedHistoryContext.d.ts +11 -0
- package/dist/context/SharedHistoryContext.d.ts.map +1 -0
- package/dist/context/SharedHistoryContext.js +12 -0
- package/dist/context/SharedHistoryContext.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/main.d.ts +5 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +4 -0
- package/dist/nodes/EditorNodes.d.ts +4 -0
- package/dist/nodes/EditorNodes.d.ts.map +1 -0
- package/dist/nodes/EditorNodes.js +39 -0
- package/dist/nodes/EditorNodes.js.map +1 -0
- package/dist/nodes/callout/CalloutComponent.d.ts +6 -0
- package/dist/nodes/callout/CalloutComponent.d.ts.map +1 -0
- package/dist/nodes/callout/CalloutComponent.js +53 -0
- package/dist/nodes/callout/CalloutComponent.js.map +1 -0
- package/dist/nodes/callout/CalloutNode.d.ts +27 -0
- package/dist/nodes/callout/CalloutNode.d.ts.map +1 -0
- package/dist/nodes/callout/CalloutNode.js +153 -0
- package/dist/nodes/callout/CalloutNode.js.map +1 -0
- package/dist/nodes/callout/CalloutTransformer.d.ts +3 -0
- package/dist/nodes/callout/CalloutTransformer.d.ts.map +1 -0
- package/dist/nodes/callout/CalloutTransformer.js +48 -0
- package/dist/nodes/callout/CalloutTransformer.js.map +1 -0
- package/dist/nodes/callout/calloutPlugin.d.ts +3 -0
- package/dist/nodes/callout/calloutPlugin.d.ts.map +1 -0
- package/dist/nodes/callout/calloutPlugin.js +34 -0
- package/dist/nodes/callout/calloutPlugin.js.map +1 -0
- package/dist/nodes/callout/index.d.ts +6 -0
- package/dist/nodes/callout/index.d.ts.map +1 -0
- package/dist/nodes/schedule/ScheduleItemComponent.d.ts +9 -0
- package/dist/nodes/schedule/ScheduleItemComponent.d.ts.map +1 -0
- package/dist/nodes/schedule/ScheduleItemComponent.js +167 -0
- package/dist/nodes/schedule/ScheduleItemComponent.js.map +1 -0
- package/dist/nodes/schedule/ScheduleItemNode.d.ts +31 -0
- package/dist/nodes/schedule/ScheduleItemNode.d.ts.map +1 -0
- package/dist/nodes/schedule/ScheduleItemNode.js +94 -0
- package/dist/nodes/schedule/ScheduleItemNode.js.map +1 -0
- package/dist/nodes/schedule/ScheduleTransformer.d.ts +22 -0
- package/dist/nodes/schedule/ScheduleTransformer.d.ts.map +1 -0
- package/dist/nodes/schedule/ScheduleTransformer.js +60 -0
- package/dist/nodes/schedule/ScheduleTransformer.js.map +1 -0
- package/dist/nodes/schedule/index.d.ts +5 -0
- package/dist/nodes/schedule/index.d.ts.map +1 -0
- package/dist/nodes/schedule/schedulePlugin.d.ts +3 -0
- package/dist/nodes/schedule/schedulePlugin.d.ts.map +1 -0
- package/dist/nodes/schedule/schedulePlugin.js +33 -0
- package/dist/nodes/schedule/schedulePlugin.js.map +1 -0
- package/dist/plugins/AutoLinkPlugin.d.ts +3 -0
- package/dist/plugins/AutoLinkPlugin.d.ts.map +1 -0
- package/dist/plugins/AutoLinkPlugin.js +22 -0
- package/dist/plugins/AutoLinkPlugin.js.map +1 -0
- package/dist/plugins/FloatingLinkEditorPlugin.d.ts +7 -0
- package/dist/plugins/FloatingLinkEditorPlugin.d.ts.map +1 -0
- package/dist/plugins/FloatingLinkEditorPlugin2.js +302 -0
- package/dist/plugins/FloatingLinkEditorPlugin2.js.map +1 -0
- package/dist/plugins/HistoryPlugin.d.ts +26 -0
- package/dist/plugins/HistoryPlugin.d.ts.map +1 -0
- package/dist/plugins/LinkPlugin.d.ts +3 -0
- package/dist/plugins/LinkPlugin.d.ts.map +1 -0
- package/dist/plugins/LinkPlugin.js +18 -0
- package/dist/plugins/LinkPlugin.js.map +1 -0
- package/dist/plugins/ToolbarPlugin.d.ts +7 -0
- package/dist/plugins/ToolbarPlugin.d.ts.map +1 -0
- package/dist/plugins/ToolbarPlugin.js +372 -0
- package/dist/plugins/ToolbarPlugin.js.map +1 -0
- package/dist/schedule.js +4 -0
- package/dist/scribo.css +1977 -0
- package/dist/themes/EditorTheme.d.ts +4 -0
- package/dist/themes/EditorTheme.d.ts.map +1 -0
- package/dist/themes/EditorTheme2.js +107 -0
- package/dist/themes/EditorTheme2.js.map +1 -0
- package/dist/types.d.ts +26 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/ui/ContentEditable.d.ts +6 -0
- package/dist/ui/ContentEditable.d.ts.map +1 -0
- package/dist/ui/ContentEditable2.js +14 -0
- package/dist/ui/ContentEditable2.js.map +1 -0
- package/dist/ui/DropDown.d.ts +18 -0
- package/dist/ui/DropDown.d.ts.map +1 -0
- package/dist/ui/DropDown.js +162 -0
- package/dist/ui/DropDown.js.map +1 -0
- package/dist/ui/Placeholder.d.ts +6 -0
- package/dist/ui/Placeholder.d.ts.map +1 -0
- package/dist/ui/Placeholder2.js +13 -0
- package/dist/ui/Placeholder2.js.map +1 -0
- package/dist/utils/environment.d.ts +24 -0
- package/dist/utils/environment.d.ts.map +1 -0
- package/dist/utils/environment.js +20 -0
- package/dist/utils/environment.js.map +1 -0
- package/dist/utils/getSelectedNode.d.ts +3 -0
- package/dist/utils/getSelectedNode.d.ts.map +1 -0
- package/dist/utils/getSelectedNode.js +23 -0
- package/dist/utils/getSelectedNode.js.map +1 -0
- package/dist/utils/setFloatingElemPosition.d.ts +2 -0
- package/dist/utils/setFloatingElemPosition.d.ts.map +1 -0
- package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts +2 -0
- package/dist/utils/setFloatingElemPositionForLinkEditor.d.ts.map +1 -0
- package/dist/utils/setFloatingElemPositionForLinkEditor.js +33 -0
- package/dist/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
- package/dist/utils/url.d.ts +11 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +33 -0
- package/dist/utils/url.js.map +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +57 -39
- package/src/MarkdownEditor.css +130 -27
- package/src/MarkdownEditor.tsx +82 -31
- package/src/MarkdownInput.tsx +9 -10
- package/src/context/SharedHistoryContext.tsx +8 -16
- package/src/main.tsx +3 -3
- package/src/nodes/EditorNodes.ts +10 -10
- package/src/nodes/callout/Callout.css +94 -0
- package/src/nodes/callout/CalloutComponent.tsx +61 -0
- package/src/nodes/callout/CalloutNode.ts +197 -0
- package/src/nodes/callout/CalloutTransformer.ts +87 -0
- package/src/nodes/callout/calloutPlugin.ts +37 -0
- package/src/nodes/callout/index.ts +5 -0
- package/src/nodes/schedule/ScheduleItem.css +140 -0
- package/src/nodes/schedule/ScheduleItemComponent.tsx +195 -0
- package/src/nodes/schedule/ScheduleItemNode.ts +135 -0
- package/src/nodes/schedule/ScheduleTransformer.ts +80 -0
- package/src/nodes/schedule/index.ts +4 -0
- package/src/nodes/schedule/schedulePlugin.ts +33 -0
- package/src/plugins/AutoLinkPlugin.tsx +5 -10
- package/src/plugins/FloatingLinkEditorPlugin.tsx +42 -66
- package/src/plugins/HistoryPlugin.tsx +20 -30
- package/src/plugins/LinkPlugin.tsx +2 -3
- package/src/plugins/ToolbarPlugin.tsx +129 -141
- package/src/themes/EditorTheme.css +82 -62
- package/src/themes/EditorTheme.ts +89 -90
- package/src/types.ts +27 -0
- package/src/ui/ContentEditable.tsx +5 -5
- package/src/ui/DropDown.tsx +23 -41
- package/src/ui/Placeholder.tsx +21 -21
- package/src/utils/environment.ts +6 -12
- package/src/utils/getSelectedNode.ts +3 -5
- package/src/utils/setFloatingElemPosition.ts +2 -5
- package/src/utils/setFloatingElemPositionForLinkEditor.ts +1 -1
- package/src/utils/url.ts +4 -10
- package/tsconfig.json +8 -0
- package/CHANGELOG.md +0 -59
- package/README.md +0 -126
- package/RELEASE.md +0 -102
- package/eslint.config.js +0 -4
- package/src/App.css +0 -35
- package/src/App.tsx +0 -42
- package/src/index.tsx +0 -13
- package/tsconfig.node.json +0 -11
- package/vite.config.site.ts +0 -19
- package/vite.config.ts +0 -33
- /package/{src → dist}/vite-env.d.ts +0 -0
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
*/
|
|
9
|
-
.
|
|
9
|
+
.EditorTheme__ltr {
|
|
10
10
|
text-align: left;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.
|
|
13
|
+
.EditorTheme__rtl {
|
|
14
14
|
text-align: right;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.
|
|
17
|
+
.EditorTheme__paragraph {
|
|
18
18
|
margin: 0;
|
|
19
19
|
position: relative;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.
|
|
22
|
+
.EditorTheme__quote {
|
|
23
23
|
margin: 0;
|
|
24
24
|
margin-left: 20px;
|
|
25
25
|
margin-bottom: 10px;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
padding-left: 16px;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.
|
|
34
|
+
.EditorTheme__h1 {
|
|
35
35
|
font-size: 32px;
|
|
36
36
|
line-height: 1.3;
|
|
37
37
|
padding-top: 2rem;
|
|
@@ -41,7 +41,12 @@
|
|
|
41
41
|
margin: 0;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.
|
|
44
|
+
[data-theme="dark"] .EditorTheme__h1,
|
|
45
|
+
[data-color-scheme="dark"] .EditorTheme__h1 {
|
|
46
|
+
color: #ffffff;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.EditorTheme__h2 {
|
|
45
50
|
font-size: 24px;
|
|
46
51
|
color: #406280;
|
|
47
52
|
padding-top: 2rem;
|
|
@@ -50,7 +55,12 @@
|
|
|
50
55
|
margin: 0;
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
.
|
|
58
|
+
[data-theme="dark"] .EditorTheme__h2,
|
|
59
|
+
[data-color-scheme="dark"] .EditorTheme__h2 {
|
|
60
|
+
color: #ffffff;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.EditorTheme__h3 {
|
|
54
64
|
font-size: 24px;
|
|
55
65
|
color: #406280;
|
|
56
66
|
padding-top: 2rem;
|
|
@@ -59,7 +69,12 @@
|
|
|
59
69
|
margin: 0;
|
|
60
70
|
}
|
|
61
71
|
|
|
62
|
-
.
|
|
72
|
+
[data-theme="dark"] .EditorTheme__h3,
|
|
73
|
+
[data-color-scheme="dark"] .EditorTheme__h3 {
|
|
74
|
+
color: #ffffff;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.EditorTheme__h4 {
|
|
63
78
|
font-size: 16px;
|
|
64
79
|
color: #406280;
|
|
65
80
|
padding-top: 1.5rem;
|
|
@@ -68,63 +83,68 @@
|
|
|
68
83
|
margin: 0;
|
|
69
84
|
}
|
|
70
85
|
|
|
71
|
-
.
|
|
86
|
+
[data-theme="dark"] .EditorTheme__h4,
|
|
87
|
+
[data-color-scheme="dark"] .EditorTheme__h4 {
|
|
88
|
+
color: #ffffff;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.EditorTheme__indent {
|
|
72
92
|
--lexical-indent-base-value: 40px;
|
|
73
93
|
}
|
|
74
94
|
|
|
75
|
-
.
|
|
95
|
+
.EditorTheme__textBold {
|
|
76
96
|
font-weight: bold;
|
|
77
97
|
}
|
|
78
98
|
|
|
79
|
-
.
|
|
99
|
+
.EditorTheme__textItalic {
|
|
80
100
|
font-style: italic;
|
|
81
101
|
}
|
|
82
102
|
|
|
83
|
-
.
|
|
103
|
+
.EditorTheme__textUnderline {
|
|
84
104
|
text-decoration: underline;
|
|
85
105
|
}
|
|
86
106
|
|
|
87
|
-
.
|
|
107
|
+
.EditorTheme__textStrikethrough {
|
|
88
108
|
text-decoration: line-through;
|
|
89
109
|
}
|
|
90
110
|
|
|
91
|
-
.
|
|
111
|
+
.EditorTheme__textUnderlineStrikethrough {
|
|
92
112
|
text-decoration: underline line-through;
|
|
93
113
|
}
|
|
94
114
|
|
|
95
|
-
.
|
|
115
|
+
.EditorTheme__textSubscript {
|
|
96
116
|
font-size: 0.8em;
|
|
97
117
|
vertical-align: sub !important;
|
|
98
118
|
}
|
|
99
119
|
|
|
100
|
-
.
|
|
120
|
+
.EditorTheme__textSuperscript {
|
|
101
121
|
font-size: 0.8em;
|
|
102
122
|
vertical-align: super;
|
|
103
123
|
}
|
|
104
124
|
|
|
105
|
-
.
|
|
125
|
+
.EditorTheme__textCode {
|
|
106
126
|
background-color: rgb(240, 242, 245);
|
|
107
127
|
padding: 1px 0.25rem;
|
|
108
128
|
font-family: Menlo, Consolas, Monaco, monospace;
|
|
109
129
|
font-size: 94%;
|
|
110
130
|
}
|
|
111
131
|
|
|
112
|
-
.
|
|
132
|
+
.EditorTheme__hashtag {
|
|
113
133
|
background-color: rgba(88, 144, 255, 0.15);
|
|
114
134
|
border-bottom: 1px solid rgba(88, 144, 255, 0.3);
|
|
115
135
|
}
|
|
116
136
|
|
|
117
|
-
.
|
|
137
|
+
.EditorTheme__link {
|
|
118
138
|
color: rgb(33, 111, 219);
|
|
119
139
|
text-decoration: none;
|
|
120
140
|
}
|
|
121
141
|
|
|
122
|
-
.
|
|
142
|
+
.EditorTheme__link:hover {
|
|
123
143
|
text-decoration: underline;
|
|
124
144
|
cursor: pointer;
|
|
125
145
|
}
|
|
126
146
|
|
|
127
|
-
.
|
|
147
|
+
.EditorTheme__code {
|
|
128
148
|
background-color: rgb(240, 242, 245);
|
|
129
149
|
font-family: Menlo, Consolas, Monaco, monospace;
|
|
130
150
|
display: block;
|
|
@@ -139,7 +159,7 @@
|
|
|
139
159
|
tab-size: 2;
|
|
140
160
|
}
|
|
141
161
|
|
|
142
|
-
.
|
|
162
|
+
.EditorTheme__code:before {
|
|
143
163
|
content: attr(data-gutter);
|
|
144
164
|
position: absolute;
|
|
145
165
|
background-color: #eee;
|
|
@@ -147,63 +167,63 @@
|
|
|
147
167
|
top: 0;
|
|
148
168
|
border-right: 1px solid #ccc;
|
|
149
169
|
padding: 8px;
|
|
150
|
-
color: #
|
|
170
|
+
color: #696969;
|
|
151
171
|
white-space: pre-wrap;
|
|
152
172
|
text-align: right;
|
|
153
173
|
min-width: 25px;
|
|
154
174
|
}
|
|
155
175
|
|
|
156
|
-
.
|
|
176
|
+
.EditorTheme__characterLimit {
|
|
157
177
|
display: inline;
|
|
158
178
|
background-color: #ffbbbb !important;
|
|
159
179
|
}
|
|
160
180
|
|
|
161
|
-
.
|
|
181
|
+
.EditorTheme__ol1 {
|
|
162
182
|
padding: 0;
|
|
163
183
|
margin: 0;
|
|
164
184
|
list-style-position: inside;
|
|
165
185
|
}
|
|
166
186
|
|
|
167
|
-
.
|
|
187
|
+
.EditorTheme__ol2 {
|
|
168
188
|
padding: 0;
|
|
169
189
|
margin: 0;
|
|
170
190
|
list-style-type: upper-alpha;
|
|
171
191
|
list-style-position: inside;
|
|
172
192
|
}
|
|
173
193
|
|
|
174
|
-
.
|
|
194
|
+
.EditorTheme__ol3 {
|
|
175
195
|
padding: 0;
|
|
176
196
|
margin: 0;
|
|
177
197
|
list-style-type: lower-alpha;
|
|
178
198
|
list-style-position: inside;
|
|
179
199
|
}
|
|
180
200
|
|
|
181
|
-
.
|
|
201
|
+
.EditorTheme__ol4 {
|
|
182
202
|
padding: 0;
|
|
183
203
|
margin: 0;
|
|
184
204
|
list-style-type: upper-roman;
|
|
185
205
|
list-style-position: inside;
|
|
186
206
|
}
|
|
187
207
|
|
|
188
|
-
.
|
|
208
|
+
.EditorTheme__ol5 {
|
|
189
209
|
padding: 0;
|
|
190
210
|
margin: 0;
|
|
191
211
|
list-style-type: lower-roman;
|
|
192
212
|
list-style-position: inside;
|
|
193
213
|
}
|
|
194
214
|
|
|
195
|
-
.
|
|
215
|
+
.EditorTheme__ul {
|
|
196
216
|
padding: 0;
|
|
197
217
|
margin: 0;
|
|
198
218
|
list-style-position: inside;
|
|
199
219
|
}
|
|
200
220
|
|
|
201
|
-
.
|
|
221
|
+
.EditorTheme__listItem {
|
|
202
222
|
margin: 0 32px;
|
|
203
223
|
}
|
|
204
224
|
|
|
205
|
-
.
|
|
206
|
-
.
|
|
225
|
+
.EditorTheme__listItemChecked,
|
|
226
|
+
.EditorTheme__listItemUnchecked {
|
|
207
227
|
position: relative;
|
|
208
228
|
margin-left: 8px;
|
|
209
229
|
margin-right: 8px;
|
|
@@ -213,12 +233,12 @@
|
|
|
213
233
|
outline: none;
|
|
214
234
|
}
|
|
215
235
|
|
|
216
|
-
.
|
|
236
|
+
.EditorTheme__listItemChecked {
|
|
217
237
|
text-decoration: line-through;
|
|
218
238
|
}
|
|
219
239
|
|
|
220
|
-
.
|
|
221
|
-
.
|
|
240
|
+
.EditorTheme__listItemUnchecked:before,
|
|
241
|
+
.EditorTheme__listItemChecked:before {
|
|
222
242
|
content: "";
|
|
223
243
|
width: 16px;
|
|
224
244
|
height: 16px;
|
|
@@ -230,31 +250,31 @@
|
|
|
230
250
|
position: absolute;
|
|
231
251
|
}
|
|
232
252
|
|
|
233
|
-
.
|
|
234
|
-
.
|
|
253
|
+
.EditorTheme__listItemUnchecked[dir="rtl"]:before,
|
|
254
|
+
.EditorTheme__listItemChecked[dir="rtl"]:before {
|
|
235
255
|
left: auto;
|
|
236
256
|
right: 0;
|
|
237
257
|
}
|
|
238
258
|
|
|
239
|
-
.
|
|
240
|
-
.
|
|
259
|
+
.EditorTheme__listItemUnchecked:focus:before,
|
|
260
|
+
.EditorTheme__listItemChecked:focus:before {
|
|
241
261
|
box-shadow: 0 0 0 2px #a6cdfe;
|
|
242
262
|
border-radius: 2px;
|
|
243
263
|
}
|
|
244
264
|
|
|
245
|
-
.
|
|
265
|
+
.EditorTheme__listItemUnchecked:before {
|
|
246
266
|
border: 1px solid #999;
|
|
247
267
|
border-radius: 2px;
|
|
248
268
|
}
|
|
249
269
|
|
|
250
|
-
.
|
|
270
|
+
.EditorTheme__listItemChecked:before {
|
|
251
271
|
border: 1px solid rgb(61, 135, 245);
|
|
252
272
|
border-radius: 2px;
|
|
253
273
|
background-color: #3d87f5;
|
|
254
274
|
background-repeat: no-repeat;
|
|
255
275
|
}
|
|
256
276
|
|
|
257
|
-
.
|
|
277
|
+
.EditorTheme__listItemChecked:after {
|
|
258
278
|
content: "";
|
|
259
279
|
cursor: pointer;
|
|
260
280
|
border-color: #fff;
|
|
@@ -270,83 +290,83 @@
|
|
|
270
290
|
border-width: 0 2px 2px 0;
|
|
271
291
|
}
|
|
272
292
|
|
|
273
|
-
.
|
|
293
|
+
.EditorTheme__nestedListItem {
|
|
274
294
|
list-style-type: none;
|
|
275
295
|
}
|
|
276
296
|
|
|
277
|
-
.
|
|
278
|
-
.
|
|
297
|
+
.EditorTheme__nestedListItem:before,
|
|
298
|
+
.EditorTheme__nestedListItem:after {
|
|
279
299
|
display: none;
|
|
280
300
|
}
|
|
281
301
|
|
|
282
|
-
.
|
|
302
|
+
.EditorTheme__tokenComment {
|
|
283
303
|
color: slategray;
|
|
284
304
|
}
|
|
285
305
|
|
|
286
|
-
.
|
|
306
|
+
.EditorTheme__tokenPunctuation {
|
|
287
307
|
color: #999;
|
|
288
308
|
}
|
|
289
309
|
|
|
290
|
-
.
|
|
310
|
+
.EditorTheme__tokenProperty {
|
|
291
311
|
color: #905;
|
|
292
312
|
}
|
|
293
313
|
|
|
294
|
-
.
|
|
314
|
+
.EditorTheme__tokenSelector {
|
|
295
315
|
color: #690;
|
|
296
316
|
}
|
|
297
317
|
|
|
298
|
-
.
|
|
318
|
+
.EditorTheme__tokenOperator {
|
|
299
319
|
color: #9a6e3a;
|
|
300
320
|
}
|
|
301
321
|
|
|
302
|
-
.
|
|
322
|
+
.EditorTheme__tokenAttr {
|
|
303
323
|
color: #07a;
|
|
304
324
|
}
|
|
305
325
|
|
|
306
|
-
.
|
|
326
|
+
.EditorTheme__tokenVariable {
|
|
307
327
|
color: #e90;
|
|
308
328
|
}
|
|
309
329
|
|
|
310
|
-
.
|
|
330
|
+
.EditorTheme__tokenFunction {
|
|
311
331
|
color: #dd4a68;
|
|
312
332
|
}
|
|
313
333
|
|
|
314
|
-
.
|
|
334
|
+
.EditorTheme__mark {
|
|
315
335
|
background: rgba(255, 212, 0, 0.14);
|
|
316
336
|
border-bottom: 2px solid rgba(255, 212, 0, 0.3);
|
|
317
337
|
padding-bottom: 2px;
|
|
318
338
|
}
|
|
319
339
|
|
|
320
|
-
.
|
|
340
|
+
.EditorTheme__markOverlap {
|
|
321
341
|
background: rgba(255, 212, 0, 0.3);
|
|
322
342
|
border-bottom: 2px solid rgba(255, 212, 0, 0.7);
|
|
323
343
|
}
|
|
324
344
|
|
|
325
|
-
.
|
|
345
|
+
.EditorTheme__mark.selected {
|
|
326
346
|
background: rgba(255, 212, 0, 0.5);
|
|
327
347
|
border-bottom: 2px solid rgba(255, 212, 0, 1);
|
|
328
348
|
}
|
|
329
349
|
|
|
330
|
-
.
|
|
350
|
+
.EditorTheme__markOverlap.selected {
|
|
331
351
|
background: rgba(255, 212, 0, 0.7);
|
|
332
352
|
border-bottom: 2px solid rgba(255, 212, 0, 0.7);
|
|
333
353
|
}
|
|
334
354
|
|
|
335
|
-
.
|
|
355
|
+
.EditorTheme__embedBlock {
|
|
336
356
|
user-select: none;
|
|
337
357
|
}
|
|
338
358
|
|
|
339
|
-
.
|
|
359
|
+
.EditorTheme__embedBlockFocus {
|
|
340
360
|
outline: 2px solid rgb(60, 132, 244);
|
|
341
361
|
}
|
|
342
362
|
|
|
343
|
-
.
|
|
363
|
+
.EditorTheme__layoutContaner {
|
|
344
364
|
display: grid;
|
|
345
365
|
gap: 10px;
|
|
346
366
|
margin: 10px 0;
|
|
347
367
|
}
|
|
348
368
|
|
|
349
|
-
.
|
|
369
|
+
.EditorTheme__layoutItem {
|
|
350
370
|
border: 1px dashed #ddd;
|
|
351
371
|
padding: 8px 16px;
|
|
352
372
|
}
|
|
@@ -6,112 +6,111 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import './EditorTheme.css';
|
|
10
10
|
|
|
11
|
-
import type { EditorThemeClasses } from
|
|
11
|
+
import type { EditorThemeClasses } from 'lexical';
|
|
12
12
|
|
|
13
13
|
const theme: EditorThemeClasses = {
|
|
14
|
-
blockCursor:
|
|
15
|
-
characterLimit:
|
|
16
|
-
code:
|
|
14
|
+
blockCursor: 'EditorTheme__blockCursor',
|
|
15
|
+
characterLimit: 'EditorTheme__characterLimit',
|
|
16
|
+
code: 'EditorTheme__code',
|
|
17
17
|
codeHighlight: {
|
|
18
|
-
atrule:
|
|
19
|
-
attr:
|
|
20
|
-
boolean:
|
|
21
|
-
builtin:
|
|
22
|
-
cdata:
|
|
23
|
-
char:
|
|
24
|
-
class:
|
|
25
|
-
|
|
26
|
-
comment:
|
|
27
|
-
constant:
|
|
28
|
-
deleted:
|
|
29
|
-
doctype:
|
|
30
|
-
entity:
|
|
31
|
-
function:
|
|
32
|
-
important:
|
|
33
|
-
inserted:
|
|
34
|
-
keyword:
|
|
35
|
-
namespace:
|
|
36
|
-
number:
|
|
37
|
-
operator:
|
|
38
|
-
prolog:
|
|
39
|
-
property:
|
|
40
|
-
punctuation:
|
|
41
|
-
regex:
|
|
42
|
-
selector:
|
|
43
|
-
string:
|
|
44
|
-
symbol:
|
|
45
|
-
tag:
|
|
46
|
-
url:
|
|
47
|
-
variable:
|
|
18
|
+
atrule: 'EditorTheme__tokenAttr',
|
|
19
|
+
attr: 'EditorTheme__tokenAttr',
|
|
20
|
+
boolean: 'EditorTheme__tokenProperty',
|
|
21
|
+
builtin: 'EditorTheme__tokenSelector',
|
|
22
|
+
cdata: 'EditorTheme__tokenComment',
|
|
23
|
+
char: 'EditorTheme__tokenSelector',
|
|
24
|
+
class: 'EditorTheme__tokenFunction',
|
|
25
|
+
'class-name': 'EditorTheme__tokenFunction',
|
|
26
|
+
comment: 'EditorTheme__tokenComment',
|
|
27
|
+
constant: 'EditorTheme__tokenProperty',
|
|
28
|
+
deleted: 'EditorTheme__tokenProperty',
|
|
29
|
+
doctype: 'EditorTheme__tokenComment',
|
|
30
|
+
entity: 'EditorTheme__tokenOperator',
|
|
31
|
+
function: 'EditorTheme__tokenFunction',
|
|
32
|
+
important: 'EditorTheme__tokenVariable',
|
|
33
|
+
inserted: 'EditorTheme__tokenSelector',
|
|
34
|
+
keyword: 'EditorTheme__tokenAttr',
|
|
35
|
+
namespace: 'EditorTheme__tokenVariable',
|
|
36
|
+
number: 'EditorTheme__tokenProperty',
|
|
37
|
+
operator: 'EditorTheme__tokenOperator',
|
|
38
|
+
prolog: 'EditorTheme__tokenComment',
|
|
39
|
+
property: 'EditorTheme__tokenProperty',
|
|
40
|
+
punctuation: 'EditorTheme__tokenPunctuation',
|
|
41
|
+
regex: 'EditorTheme__tokenVariable',
|
|
42
|
+
selector: 'EditorTheme__tokenSelector',
|
|
43
|
+
string: 'EditorTheme__tokenSelector',
|
|
44
|
+
symbol: 'EditorTheme__tokenProperty',
|
|
45
|
+
tag: 'EditorTheme__tokenProperty',
|
|
46
|
+
url: 'EditorTheme__tokenOperator',
|
|
47
|
+
variable: 'EditorTheme__tokenVariable',
|
|
48
48
|
},
|
|
49
49
|
embedBlock: {
|
|
50
|
-
base:
|
|
51
|
-
focus:
|
|
50
|
+
base: 'EditorTheme__embedBlock',
|
|
51
|
+
focus: 'EditorTheme__embedBlockFocus',
|
|
52
52
|
},
|
|
53
|
-
hashtag:
|
|
53
|
+
hashtag: 'EditorTheme__hashtag',
|
|
54
54
|
heading: {
|
|
55
|
-
h1:
|
|
56
|
-
h2:
|
|
57
|
-
h3:
|
|
58
|
-
h4:
|
|
59
|
-
h5:
|
|
60
|
-
h6:
|
|
55
|
+
h1: 'EditorTheme__h1',
|
|
56
|
+
h2: 'EditorTheme__h2',
|
|
57
|
+
h3: 'EditorTheme__h3',
|
|
58
|
+
h4: 'EditorTheme__h4',
|
|
59
|
+
h5: 'EditorTheme__h5',
|
|
60
|
+
h6: 'EditorTheme__h6',
|
|
61
61
|
},
|
|
62
|
-
image:
|
|
63
|
-
indent:
|
|
64
|
-
inlineImage:
|
|
65
|
-
layoutContainer:
|
|
66
|
-
layoutItem:
|
|
67
|
-
link:
|
|
62
|
+
image: 'editor-image',
|
|
63
|
+
indent: 'EditorTheme__indent',
|
|
64
|
+
inlineImage: 'inline-editor-image',
|
|
65
|
+
layoutContainer: 'EditorTheme__layoutContaner',
|
|
66
|
+
layoutItem: 'EditorTheme__layoutItem',
|
|
67
|
+
link: 'EditorTheme__link',
|
|
68
68
|
list: {
|
|
69
|
-
listitem:
|
|
70
|
-
listitemChecked:
|
|
71
|
-
listitemUnchecked:
|
|
69
|
+
listitem: 'EditorTheme__listItem',
|
|
70
|
+
listitemChecked: 'EditorTheme__listItemChecked',
|
|
71
|
+
listitemUnchecked: 'EditorTheme__listItemUnchecked',
|
|
72
72
|
nested: {
|
|
73
|
-
listitem:
|
|
73
|
+
listitem: 'EditorTheme__nestedListItem',
|
|
74
74
|
},
|
|
75
75
|
olDepth: [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
76
|
+
'EditorTheme__ol1',
|
|
77
|
+
'EditorTheme__ol2',
|
|
78
|
+
'EditorTheme__ol3',
|
|
79
|
+
'EditorTheme__ol4',
|
|
80
|
+
'EditorTheme__ol5',
|
|
81
81
|
],
|
|
82
|
-
ul:
|
|
82
|
+
ul: 'EditorTheme__ul',
|
|
83
83
|
},
|
|
84
|
-
ltr:
|
|
85
|
-
mark:
|
|
86
|
-
markOverlap:
|
|
87
|
-
paragraph:
|
|
88
|
-
quote:
|
|
89
|
-
rtl:
|
|
90
|
-
table:
|
|
91
|
-
tableAddColumns:
|
|
92
|
-
tableAddRows:
|
|
93
|
-
tableCell:
|
|
94
|
-
tableCellActionButton:
|
|
95
|
-
tableCellActionButtonContainer:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
tableSelection: "PlaygroundEditorTheme__tableSelection",
|
|
84
|
+
ltr: 'EditorTheme__ltr',
|
|
85
|
+
mark: 'EditorTheme__mark',
|
|
86
|
+
markOverlap: 'EditorTheme__markOverlap',
|
|
87
|
+
paragraph: 'EditorTheme__paragraph',
|
|
88
|
+
quote: 'EditorTheme__quote',
|
|
89
|
+
rtl: 'EditorTheme__rtl',
|
|
90
|
+
table: 'EditorTheme__table',
|
|
91
|
+
tableAddColumns: 'EditorTheme__tableAddColumns',
|
|
92
|
+
tableAddRows: 'EditorTheme__tableAddRows',
|
|
93
|
+
tableCell: 'EditorTheme__tableCell',
|
|
94
|
+
tableCellActionButton: 'EditorTheme__tableCellActionButton',
|
|
95
|
+
tableCellActionButtonContainer: 'EditorTheme__tableCellActionButtonContainer',
|
|
96
|
+
tableCellEditing: 'EditorTheme__tableCellEditing',
|
|
97
|
+
tableCellHeader: 'EditorTheme__tableCellHeader',
|
|
98
|
+
tableCellPrimarySelected: 'EditorTheme__tableCellPrimarySelected',
|
|
99
|
+
tableCellResizer: 'EditorTheme__tableCellResizer',
|
|
100
|
+
tableCellSelected: 'EditorTheme__tableCellSelected',
|
|
101
|
+
tableCellSortedIndicator: 'EditorTheme__tableCellSortedIndicator',
|
|
102
|
+
tableResizeRuler: 'EditorTheme__tableCellResizeRuler',
|
|
103
|
+
tableSelected: 'EditorTheme__tableSelected',
|
|
104
|
+
tableSelection: 'EditorTheme__tableSelection',
|
|
106
105
|
text: {
|
|
107
|
-
bold:
|
|
108
|
-
code:
|
|
109
|
-
italic:
|
|
110
|
-
strikethrough:
|
|
111
|
-
subscript:
|
|
112
|
-
superscript:
|
|
113
|
-
underline:
|
|
114
|
-
underlineStrikethrough:
|
|
106
|
+
bold: 'EditorTheme__textBold',
|
|
107
|
+
code: 'EditorTheme__textCode',
|
|
108
|
+
italic: 'EditorTheme__textItalic',
|
|
109
|
+
strikethrough: 'EditorTheme__textStrikethrough',
|
|
110
|
+
subscript: 'EditorTheme__textSubscript',
|
|
111
|
+
superscript: 'EditorTheme__textSuperscript',
|
|
112
|
+
underline: 'EditorTheme__textUnderline',
|
|
113
|
+
underlineStrikethrough: 'EditorTheme__textUnderlineStrikethrough',
|
|
115
114
|
},
|
|
116
115
|
};
|
|
117
116
|
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Transformer } from '@lexical/markdown';
|
|
2
|
+
import type { Klass, LexicalNode } from 'lexical';
|
|
3
|
+
import type { ComponentType } from 'react';
|
|
4
|
+
|
|
5
|
+
export interface ScriboToolbarButton {
|
|
6
|
+
/** Unique key */
|
|
7
|
+
key: string;
|
|
8
|
+
/** Tooltip / aria-label */
|
|
9
|
+
label: string;
|
|
10
|
+
/** CSS class for the icon */
|
|
11
|
+
iconClass?: string;
|
|
12
|
+
/** Called when the button is clicked */
|
|
13
|
+
onSelect: (editor: import('lexical').LexicalEditor) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ScriboPlugin {
|
|
17
|
+
/** Unique name for the plugin */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Lexical nodes to register */
|
|
20
|
+
nodes?: Klass<LexicalNode>[];
|
|
21
|
+
/** Markdown transformers (placed before built-in transformers) */
|
|
22
|
+
transformers?: Transformer[];
|
|
23
|
+
/** Buttons to add to the toolbar */
|
|
24
|
+
toolbarButtons?: ScriboToolbarButton[];
|
|
25
|
+
/** React components to render inside the LexicalComposer (must accept no props) */
|
|
26
|
+
editorPlugins?: ComponentType<object>[];
|
|
27
|
+
}
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import type { JSX } from 'react';
|
|
9
|
-
import
|
|
9
|
+
import './ContentEditable.css';
|
|
10
10
|
|
|
11
|
-
import { ContentEditable } from
|
|
11
|
+
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
|
12
12
|
|
|
13
13
|
export default function LexicalContentEditable({
|
|
14
14
|
className,
|
|
15
15
|
id,
|
|
16
|
-
}: {
|
|
16
|
+
}: Readonly<{
|
|
17
17
|
className?: string;
|
|
18
18
|
id?: string;
|
|
19
|
-
}): JSX.Element {
|
|
20
|
-
return <ContentEditable className={className ||
|
|
19
|
+
}>): JSX.Element {
|
|
20
|
+
return <ContentEditable className={className || 'ContentEditable__root'} id={id} />;
|
|
21
21
|
}
|