richkit 0.0.0-stage → 0.2.0
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/LICENSE +21 -0
- package/README.md +204 -2
- package/dist/index.cjs +1564 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +130 -0
- package/dist/index.d.ts +130 -0
- package/dist/index.js +1525 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +901 -0
- package/package.json +84 -4
package/dist/styles.css
ADDED
|
@@ -0,0 +1,901 @@
|
|
|
1
|
+
/* richkit — override any --richkit-* variable on .richkit to theme the editor. */
|
|
2
|
+
|
|
3
|
+
.richkit {
|
|
4
|
+
--richkit-bg: #ffffff;
|
|
5
|
+
--richkit-fg: #1f2328;
|
|
6
|
+
--richkit-muted: #6e7781;
|
|
7
|
+
--richkit-border: #d8dee4;
|
|
8
|
+
--richkit-toolbar-bg: #f8f9fb;
|
|
9
|
+
--richkit-hover: #e9edf1;
|
|
10
|
+
--richkit-active-bg: #dfe9ff;
|
|
11
|
+
--richkit-accent: #2563eb;
|
|
12
|
+
--richkit-danger: #cf222e;
|
|
13
|
+
--richkit-code-bg: #f0f2f5;
|
|
14
|
+
--richkit-shadow: 0 1px 2px rgb(16 24 40 / 0.06), 0 10px 28px rgb(16 24 40 / 0.14);
|
|
15
|
+
--richkit-radius: 10px;
|
|
16
|
+
--richkit-font: "Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", Tahoma, sans-serif;
|
|
17
|
+
--richkit-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
18
|
+
--richkit-min-height: 140px;
|
|
19
|
+
--richkit-max-height: none;
|
|
20
|
+
/** Distance from the top of the page at which the toolbar sticks. */
|
|
21
|
+
--richkit-sticky-top: 0px;
|
|
22
|
+
|
|
23
|
+
position: relative;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
border: 1px solid var(--richkit-border);
|
|
28
|
+
border-radius: var(--richkit-radius);
|
|
29
|
+
background: var(--richkit-bg);
|
|
30
|
+
color: var(--richkit-fg);
|
|
31
|
+
font-family: var(--richkit-font);
|
|
32
|
+
font-size: 15px;
|
|
33
|
+
line-height: 1.6;
|
|
34
|
+
text-align: left;
|
|
35
|
+
transition:
|
|
36
|
+
border-color 0.15s,
|
|
37
|
+
box-shadow 0.15s;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.richkit[data-theme="dark"] {
|
|
41
|
+
--richkit-bg: #0f1318;
|
|
42
|
+
--richkit-fg: #e6edf3;
|
|
43
|
+
--richkit-muted: #8b949e;
|
|
44
|
+
--richkit-border: #2d333b;
|
|
45
|
+
--richkit-toolbar-bg: #161b22;
|
|
46
|
+
--richkit-hover: #262c36;
|
|
47
|
+
--richkit-active-bg: #1b3160;
|
|
48
|
+
--richkit-accent: #6ea8fe;
|
|
49
|
+
--richkit-danger: #ff7b72;
|
|
50
|
+
--richkit-code-bg: #1c2128;
|
|
51
|
+
--richkit-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px rgb(0 0 0 / 0.5);
|
|
52
|
+
color-scheme: dark;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (prefers-color-scheme: dark) {
|
|
56
|
+
.richkit[data-theme="auto"] {
|
|
57
|
+
--richkit-bg: #0f1318;
|
|
58
|
+
--richkit-fg: #e6edf3;
|
|
59
|
+
--richkit-muted: #8b949e;
|
|
60
|
+
--richkit-border: #2d333b;
|
|
61
|
+
--richkit-toolbar-bg: #161b22;
|
|
62
|
+
--richkit-hover: #262c36;
|
|
63
|
+
--richkit-active-bg: #1b3160;
|
|
64
|
+
--richkit-accent: #6ea8fe;
|
|
65
|
+
--richkit-danger: #ff7b72;
|
|
66
|
+
--richkit-code-bg: #1c2128;
|
|
67
|
+
--richkit-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 10px 28px rgb(0 0 0 / 0.5);
|
|
68
|
+
color-scheme: dark;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.richkit *,
|
|
73
|
+
.richkit *::before,
|
|
74
|
+
.richkit *::after {
|
|
75
|
+
box-sizing: border-box;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.richkit:focus-within {
|
|
79
|
+
border-color: var(--richkit-accent);
|
|
80
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--richkit-accent) 20%, transparent);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.richkit[data-fullscreen] {
|
|
84
|
+
position: fixed;
|
|
85
|
+
inset: 0;
|
|
86
|
+
z-index: 9999;
|
|
87
|
+
border: 0;
|
|
88
|
+
border-radius: 0;
|
|
89
|
+
box-shadow: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ---------- Toolbar ---------- */
|
|
93
|
+
|
|
94
|
+
.richkit-head {
|
|
95
|
+
position: sticky;
|
|
96
|
+
top: var(--richkit-sticky-top);
|
|
97
|
+
z-index: 10;
|
|
98
|
+
border-bottom: 1px solid var(--richkit-border);
|
|
99
|
+
border-radius: calc(var(--richkit-radius) - 1px) calc(var(--richkit-radius) - 1px) 0 0;
|
|
100
|
+
background: var(--richkit-toolbar-bg);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.richkit-toolbar {
|
|
104
|
+
display: flex;
|
|
105
|
+
flex-wrap: wrap;
|
|
106
|
+
align-items: center;
|
|
107
|
+
gap: 2px;
|
|
108
|
+
padding: 6px 8px;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.richkit[data-fullscreen] .richkit-head {
|
|
112
|
+
border-radius: 0;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.richkit[data-fullscreen] .richkit-toolbar {
|
|
116
|
+
justify-content: center;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.richkit-item,
|
|
120
|
+
.richkit-pop {
|
|
121
|
+
position: relative;
|
|
122
|
+
display: inline-flex;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.richkit-btn {
|
|
126
|
+
position: relative;
|
|
127
|
+
display: inline-flex;
|
|
128
|
+
align-items: center;
|
|
129
|
+
justify-content: center;
|
|
130
|
+
gap: 4px;
|
|
131
|
+
min-width: 30px;
|
|
132
|
+
height: 30px;
|
|
133
|
+
padding: 0;
|
|
134
|
+
border: 0;
|
|
135
|
+
border-radius: 6px;
|
|
136
|
+
background: transparent;
|
|
137
|
+
color: inherit;
|
|
138
|
+
font: inherit;
|
|
139
|
+
font-size: 13px;
|
|
140
|
+
line-height: 1;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
transition:
|
|
143
|
+
background-color 0.12s,
|
|
144
|
+
color 0.12s;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.richkit-btn[data-wide] {
|
|
148
|
+
padding: 0 8px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.richkit-btn[aria-haspopup][data-wide] {
|
|
152
|
+
justify-content: space-between;
|
|
153
|
+
min-width: 108px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.richkit-btn[aria-label="Ask AI"] {
|
|
157
|
+
color: var(--richkit-accent);
|
|
158
|
+
font-weight: 700;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.richkit-btn-text {
|
|
162
|
+
white-space: nowrap;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.richkit-btn:hover:not(:disabled) {
|
|
166
|
+
background: var(--richkit-hover);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.richkit-btn[data-active] {
|
|
170
|
+
background: var(--richkit-active-bg);
|
|
171
|
+
color: var(--richkit-accent);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
.richkit-btn:disabled {
|
|
175
|
+
opacity: 0.38;
|
|
176
|
+
cursor: not-allowed;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.richkit-btn:focus-visible,
|
|
180
|
+
.richkit-input:focus-visible,
|
|
181
|
+
.richkit-action:focus-visible,
|
|
182
|
+
.richkit-menu-item:focus-visible,
|
|
183
|
+
.richkit-swatch:focus-visible,
|
|
184
|
+
.richkit-grid-cell:focus-visible {
|
|
185
|
+
outline: 2px solid var(--richkit-accent);
|
|
186
|
+
outline-offset: 1px;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* Tooltip */
|
|
190
|
+
.richkit-btn[data-tip]::after {
|
|
191
|
+
content: attr(data-tip);
|
|
192
|
+
position: absolute;
|
|
193
|
+
top: calc(100% + 6px);
|
|
194
|
+
left: 50%;
|
|
195
|
+
z-index: 40;
|
|
196
|
+
padding: 5px 8px;
|
|
197
|
+
border-radius: 6px;
|
|
198
|
+
background: var(--richkit-fg);
|
|
199
|
+
color: var(--richkit-bg);
|
|
200
|
+
font-size: 11.5px;
|
|
201
|
+
font-weight: 500;
|
|
202
|
+
line-height: 1.2;
|
|
203
|
+
white-space: nowrap;
|
|
204
|
+
opacity: 0;
|
|
205
|
+
transform: translate(-50%, -2px);
|
|
206
|
+
pointer-events: none;
|
|
207
|
+
transition:
|
|
208
|
+
opacity 0.12s,
|
|
209
|
+
transform 0.12s;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.richkit-btn[data-tip]:hover:not(:disabled)::after,
|
|
213
|
+
.richkit-btn[data-tip]:focus-visible::after {
|
|
214
|
+
opacity: 1;
|
|
215
|
+
transform: translate(-50%, 0);
|
|
216
|
+
transition-delay: 0.45s;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.richkit-sep {
|
|
220
|
+
width: 1px;
|
|
221
|
+
height: 18px;
|
|
222
|
+
margin: 0 5px;
|
|
223
|
+
background: var(--richkit-border);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/* Colour buttons: icon with a bar showing the current colour */
|
|
227
|
+
.richkit-ink {
|
|
228
|
+
display: inline-flex;
|
|
229
|
+
flex-direction: column;
|
|
230
|
+
align-items: center;
|
|
231
|
+
gap: 1px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.richkit-ink svg {
|
|
235
|
+
width: 14px;
|
|
236
|
+
height: 14px;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.richkit-ink-bar {
|
|
240
|
+
width: 14px;
|
|
241
|
+
height: 3px;
|
|
242
|
+
border-radius: 2px;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/* ---------- Popover panels ---------- */
|
|
246
|
+
|
|
247
|
+
.richkit-panel {
|
|
248
|
+
position: absolute;
|
|
249
|
+
top: calc(100% + 6px);
|
|
250
|
+
left: 0;
|
|
251
|
+
z-index: 30;
|
|
252
|
+
padding: 6px;
|
|
253
|
+
border: 1px solid var(--richkit-border);
|
|
254
|
+
border-radius: 10px;
|
|
255
|
+
background: var(--richkit-bg);
|
|
256
|
+
box-shadow: var(--richkit-shadow);
|
|
257
|
+
font-size: 13px;
|
|
258
|
+
animation: richkit-pop-in 0.12s ease-out;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.richkit-panel[data-align="end"] {
|
|
262
|
+
right: 0;
|
|
263
|
+
left: auto;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
@keyframes richkit-pop-in {
|
|
267
|
+
from {
|
|
268
|
+
opacity: 0;
|
|
269
|
+
transform: translateY(-4px);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.richkit-menu {
|
|
274
|
+
display: flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
min-width: 176px;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.richkit-menu-item {
|
|
280
|
+
display: flex;
|
|
281
|
+
align-items: center;
|
|
282
|
+
width: 100%;
|
|
283
|
+
padding: 6px 10px;
|
|
284
|
+
border: 0;
|
|
285
|
+
border-radius: 6px;
|
|
286
|
+
background: transparent;
|
|
287
|
+
color: inherit;
|
|
288
|
+
font: inherit;
|
|
289
|
+
font-size: 13px;
|
|
290
|
+
line-height: 1.35;
|
|
291
|
+
text-align: left;
|
|
292
|
+
white-space: nowrap;
|
|
293
|
+
cursor: pointer;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.richkit-menu-item:hover {
|
|
297
|
+
background: var(--richkit-hover);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
.richkit-menu-item[data-active] {
|
|
301
|
+
background: var(--richkit-active-bg);
|
|
302
|
+
color: var(--richkit-accent);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.richkit-menu-item[data-danger] {
|
|
306
|
+
color: var(--richkit-danger);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
.richkit-menu-item [data-level="1"] {
|
|
310
|
+
font-size: 19px;
|
|
311
|
+
font-weight: 650;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.richkit-menu-item [data-level="2"] {
|
|
315
|
+
font-size: 16.5px;
|
|
316
|
+
font-weight: 650;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.richkit-menu-item [data-level="3"] {
|
|
320
|
+
font-size: 14.5px;
|
|
321
|
+
font-weight: 650;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.richkit-menu-sep {
|
|
325
|
+
height: 1px;
|
|
326
|
+
margin: 4px 0;
|
|
327
|
+
background: var(--richkit-border);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.richkit-row {
|
|
331
|
+
display: flex;
|
|
332
|
+
gap: 2px;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.richkit-swatches {
|
|
336
|
+
display: grid;
|
|
337
|
+
grid-template-columns: repeat(5, 24px);
|
|
338
|
+
gap: 6px;
|
|
339
|
+
padding: 2px;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.richkit-swatch {
|
|
343
|
+
width: 24px;
|
|
344
|
+
height: 24px;
|
|
345
|
+
padding: 0;
|
|
346
|
+
border: 1px solid rgb(0 0 0 / 0.12);
|
|
347
|
+
border-radius: 50%;
|
|
348
|
+
cursor: pointer;
|
|
349
|
+
transition: transform 0.1s;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.richkit-swatch:hover {
|
|
353
|
+
transform: scale(1.12);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
.richkit-swatch[data-active] {
|
|
357
|
+
box-shadow:
|
|
358
|
+
0 0 0 2px var(--richkit-bg),
|
|
359
|
+
0 0 0 4px var(--richkit-accent);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.richkit-swatch-reset {
|
|
363
|
+
grid-column: 1 / -1;
|
|
364
|
+
justify-content: center;
|
|
365
|
+
margin-top: 2px;
|
|
366
|
+
color: var(--richkit-muted);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.richkit-form {
|
|
370
|
+
display: flex;
|
|
371
|
+
flex-direction: column;
|
|
372
|
+
gap: 6px;
|
|
373
|
+
width: 250px;
|
|
374
|
+
max-width: 70vw;
|
|
375
|
+
padding: 2px;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
.richkit-form-row {
|
|
379
|
+
display: flex;
|
|
380
|
+
gap: 6px;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.richkit-input {
|
|
384
|
+
width: 100%;
|
|
385
|
+
height: 32px;
|
|
386
|
+
padding: 0 10px;
|
|
387
|
+
border: 1px solid var(--richkit-border);
|
|
388
|
+
border-radius: 6px;
|
|
389
|
+
background: var(--richkit-bg);
|
|
390
|
+
color: inherit;
|
|
391
|
+
font: inherit;
|
|
392
|
+
font-size: 13px;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.richkit-input::placeholder {
|
|
396
|
+
color: var(--richkit-muted);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.richkit-action {
|
|
400
|
+
height: 30px;
|
|
401
|
+
padding: 0 12px;
|
|
402
|
+
border: 1px solid var(--richkit-border);
|
|
403
|
+
border-radius: 6px;
|
|
404
|
+
background: transparent;
|
|
405
|
+
color: inherit;
|
|
406
|
+
font: inherit;
|
|
407
|
+
font-size: 13px;
|
|
408
|
+
font-weight: 500;
|
|
409
|
+
white-space: nowrap;
|
|
410
|
+
cursor: pointer;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.richkit-action:hover:not(:disabled) {
|
|
414
|
+
background: var(--richkit-hover);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
.richkit-action[data-primary] {
|
|
418
|
+
border-color: var(--richkit-accent);
|
|
419
|
+
background: var(--richkit-accent);
|
|
420
|
+
color: var(--richkit-bg);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
.richkit-action[data-primary]:hover:not(:disabled) {
|
|
424
|
+
background: color-mix(in srgb, var(--richkit-accent) 88%, var(--richkit-fg));
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.richkit-action:disabled {
|
|
428
|
+
opacity: 0.45;
|
|
429
|
+
cursor: not-allowed;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
.richkit-grid-wrap {
|
|
433
|
+
padding: 4px;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.richkit-grid {
|
|
437
|
+
display: grid;
|
|
438
|
+
grid-template-columns: repeat(6, 18px);
|
|
439
|
+
gap: 3px;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.richkit-grid-cell {
|
|
443
|
+
width: 18px;
|
|
444
|
+
height: 18px;
|
|
445
|
+
padding: 0;
|
|
446
|
+
border: 1px solid var(--richkit-border);
|
|
447
|
+
border-radius: 3px;
|
|
448
|
+
background: transparent;
|
|
449
|
+
cursor: pointer;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.richkit-grid-cell[data-on] {
|
|
453
|
+
border-color: var(--richkit-accent);
|
|
454
|
+
background: var(--richkit-active-bg);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
.richkit-grid-label {
|
|
458
|
+
margin-top: 6px;
|
|
459
|
+
color: var(--richkit-muted);
|
|
460
|
+
font-size: 12px;
|
|
461
|
+
text-align: center;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/* ---------- AI assistant ---------- */
|
|
465
|
+
|
|
466
|
+
.richkit-ai {
|
|
467
|
+
display: flex;
|
|
468
|
+
flex-direction: column;
|
|
469
|
+
gap: 8px;
|
|
470
|
+
padding: 8px;
|
|
471
|
+
border-top: 1px solid var(--richkit-border);
|
|
472
|
+
background: var(--richkit-bg);
|
|
473
|
+
font-size: 13px;
|
|
474
|
+
animation: richkit-pop-in 0.12s ease-out;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
.richkit-head > .richkit-ai:first-child {
|
|
478
|
+
border-top: 0;
|
|
479
|
+
border-radius: calc(var(--richkit-radius) - 1px) calc(var(--richkit-radius) - 1px) 0 0;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.richkit-ai-bar {
|
|
483
|
+
display: flex;
|
|
484
|
+
align-items: center;
|
|
485
|
+
gap: 6px;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.richkit-ai-mark {
|
|
489
|
+
display: inline-flex;
|
|
490
|
+
flex: none;
|
|
491
|
+
margin: 0 2px 0 4px;
|
|
492
|
+
color: var(--richkit-accent);
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
.richkit-ai-input {
|
|
496
|
+
flex: 1;
|
|
497
|
+
min-width: 0;
|
|
498
|
+
height: 32px;
|
|
499
|
+
padding: 0 10px;
|
|
500
|
+
border: 1px solid var(--richkit-border);
|
|
501
|
+
border-radius: 6px;
|
|
502
|
+
background: var(--richkit-bg);
|
|
503
|
+
color: inherit;
|
|
504
|
+
font: inherit;
|
|
505
|
+
font-size: 14px;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
.richkit-ai-input::placeholder {
|
|
509
|
+
color: var(--richkit-muted);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.richkit-ai-input:focus-visible,
|
|
513
|
+
.richkit-chip:focus-visible {
|
|
514
|
+
outline: 2px solid var(--richkit-accent);
|
|
515
|
+
outline-offset: 1px;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
.richkit-ai-chips,
|
|
519
|
+
.richkit-ai-actions {
|
|
520
|
+
display: flex;
|
|
521
|
+
flex-wrap: wrap;
|
|
522
|
+
align-items: center;
|
|
523
|
+
gap: 6px;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.richkit-ai-scope {
|
|
527
|
+
margin: 0 2px 0 4px;
|
|
528
|
+
color: var(--richkit-muted);
|
|
529
|
+
font-size: 12px;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.richkit-chip {
|
|
533
|
+
height: 28px;
|
|
534
|
+
padding: 0 10px;
|
|
535
|
+
border: 1px solid var(--richkit-border);
|
|
536
|
+
border-radius: 999px;
|
|
537
|
+
background: transparent;
|
|
538
|
+
color: inherit;
|
|
539
|
+
font: inherit;
|
|
540
|
+
font-size: 12.5px;
|
|
541
|
+
white-space: nowrap;
|
|
542
|
+
cursor: pointer;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.richkit-chip:hover {
|
|
546
|
+
border-color: var(--richkit-accent);
|
|
547
|
+
background: var(--richkit-active-bg);
|
|
548
|
+
color: var(--richkit-accent);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
.richkit-ai-note {
|
|
552
|
+
margin: 0;
|
|
553
|
+
padding: 2px 6px;
|
|
554
|
+
color: var(--richkit-muted);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.richkit-ai-note[data-error] {
|
|
558
|
+
color: var(--richkit-danger);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.richkit-ai-preview.richkit-content {
|
|
562
|
+
min-height: 0;
|
|
563
|
+
max-height: 240px;
|
|
564
|
+
padding: 10px 12px;
|
|
565
|
+
border: 1px dashed color-mix(in srgb, var(--richkit-accent) 55%, var(--richkit-border));
|
|
566
|
+
border-radius: 8px;
|
|
567
|
+
background: color-mix(in srgb, var(--richkit-accent) 5%, var(--richkit-bg));
|
|
568
|
+
font-size: 14px;
|
|
569
|
+
overflow-y: auto;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
.richkit-ai-preview[aria-busy="true"] > :last-child::after {
|
|
573
|
+
content: "";
|
|
574
|
+
display: inline-block;
|
|
575
|
+
width: 7px;
|
|
576
|
+
height: 1em;
|
|
577
|
+
margin-left: 2px;
|
|
578
|
+
background: var(--richkit-accent);
|
|
579
|
+
vertical-align: text-bottom;
|
|
580
|
+
animation: richkit-blink 1s steps(2, start) infinite;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
/* The content the assistant is working on, kept visible while focus is in the panel. */
|
|
584
|
+
.richkit-ai-range {
|
|
585
|
+
border-radius: 2px;
|
|
586
|
+
background: color-mix(in srgb, var(--richkit-accent) 22%, transparent);
|
|
587
|
+
box-decoration-break: clone;
|
|
588
|
+
-webkit-box-decoration-break: clone;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.richkit-ai-caret {
|
|
592
|
+
display: inline-block;
|
|
593
|
+
width: 2px;
|
|
594
|
+
height: 1.15em;
|
|
595
|
+
margin: 0 -1px;
|
|
596
|
+
background: var(--richkit-accent);
|
|
597
|
+
vertical-align: text-bottom;
|
|
598
|
+
animation: richkit-blink 1s steps(2, start) infinite;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
@keyframes richkit-blink {
|
|
602
|
+
to {
|
|
603
|
+
visibility: hidden;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
/* ---------- Bubble menu ---------- */
|
|
608
|
+
|
|
609
|
+
.richkit-bubble {
|
|
610
|
+
/* Above the content, below the toolbar (10) so open panels cover it. */
|
|
611
|
+
z-index: 5;
|
|
612
|
+
display: flex;
|
|
613
|
+
gap: 2px;
|
|
614
|
+
padding: 4px;
|
|
615
|
+
border: 1px solid var(--richkit-border);
|
|
616
|
+
border-radius: 10px;
|
|
617
|
+
background: var(--richkit-bg);
|
|
618
|
+
box-shadow: var(--richkit-shadow);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/* ---------- Footer ---------- */
|
|
622
|
+
|
|
623
|
+
.richkit-footer {
|
|
624
|
+
display: flex;
|
|
625
|
+
justify-content: space-between;
|
|
626
|
+
gap: 12px;
|
|
627
|
+
padding: 6px 12px;
|
|
628
|
+
border-top: 1px solid var(--richkit-border);
|
|
629
|
+
border-radius: 0 0 calc(var(--richkit-radius) - 1px) calc(var(--richkit-radius) - 1px);
|
|
630
|
+
background: var(--richkit-toolbar-bg);
|
|
631
|
+
color: var(--richkit-muted);
|
|
632
|
+
font-size: 12px;
|
|
633
|
+
font-variant-numeric: tabular-nums;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
.richkit-count[data-full] {
|
|
637
|
+
color: var(--richkit-danger);
|
|
638
|
+
font-weight: 600;
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
/* ---------- Content ---------- */
|
|
642
|
+
|
|
643
|
+
.richkit-body {
|
|
644
|
+
flex: 1;
|
|
645
|
+
min-height: var(--richkit-min-height);
|
|
646
|
+
max-height: var(--richkit-max-height);
|
|
647
|
+
overflow-y: auto;
|
|
648
|
+
cursor: text;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
.richkit[data-fullscreen] .richkit-body {
|
|
652
|
+
max-height: none;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
.richkit[data-readonly] .richkit-body {
|
|
656
|
+
cursor: default;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
.richkit-content {
|
|
660
|
+
min-height: var(--richkit-min-height);
|
|
661
|
+
padding: 14px 18px;
|
|
662
|
+
outline: none;
|
|
663
|
+
overflow-wrap: anywhere;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
.richkit[data-fullscreen] .richkit-content {
|
|
667
|
+
max-width: 820px;
|
|
668
|
+
margin: 0 auto;
|
|
669
|
+
padding: 32px 24px 64px;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.richkit-content > :first-child {
|
|
673
|
+
margin-top: 0;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.richkit-content > :last-child {
|
|
677
|
+
margin-bottom: 0;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
.richkit-content ::selection {
|
|
681
|
+
background: color-mix(in srgb, var(--richkit-accent) 28%, transparent);
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
.richkit-content p {
|
|
685
|
+
margin: 0 0 0.75em;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
.richkit-content h1,
|
|
689
|
+
.richkit-content h2,
|
|
690
|
+
.richkit-content h3 {
|
|
691
|
+
margin: 1.2em 0 0.5em;
|
|
692
|
+
line-height: 1.25;
|
|
693
|
+
font-weight: 650;
|
|
694
|
+
letter-spacing: -0.01em;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
.richkit-content h1 {
|
|
698
|
+
font-size: 1.8em;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
.richkit-content h2 {
|
|
702
|
+
font-size: 1.4em;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.richkit-content h3 {
|
|
706
|
+
font-size: 1.17em;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
.richkit-content ul,
|
|
710
|
+
.richkit-content ol {
|
|
711
|
+
margin: 0 0 0.75em;
|
|
712
|
+
padding-left: 1.6em;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
.richkit-content li > p {
|
|
716
|
+
margin: 0;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.richkit-content li::marker {
|
|
720
|
+
color: var(--richkit-muted);
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
/* Task list */
|
|
724
|
+
.richkit-content ul[data-type="taskList"] {
|
|
725
|
+
padding-left: 0.15em;
|
|
726
|
+
list-style: none;
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
.richkit-content ul[data-type="taskList"] > li {
|
|
730
|
+
display: flex;
|
|
731
|
+
align-items: flex-start;
|
|
732
|
+
gap: 0.55em;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.richkit-content ul[data-type="taskList"] > li > label {
|
|
736
|
+
flex: none;
|
|
737
|
+
margin-top: 0.28em;
|
|
738
|
+
line-height: 1;
|
|
739
|
+
user-select: none;
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
.richkit-content ul[data-type="taskList"] > li > div {
|
|
743
|
+
flex: 1;
|
|
744
|
+
min-width: 0;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.richkit-content ul[data-type="taskList"] input[type="checkbox"] {
|
|
748
|
+
width: 1em;
|
|
749
|
+
height: 1em;
|
|
750
|
+
margin: 0;
|
|
751
|
+
accent-color: var(--richkit-accent);
|
|
752
|
+
cursor: pointer;
|
|
753
|
+
}
|
|
754
|
+
|
|
755
|
+
.richkit-content ul[data-type="taskList"] > li[data-checked="true"] > div {
|
|
756
|
+
color: var(--richkit-muted);
|
|
757
|
+
text-decoration: line-through;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
.richkit-content blockquote {
|
|
761
|
+
margin: 0 0 0.75em;
|
|
762
|
+
padding: 0.1em 0 0.1em 1em;
|
|
763
|
+
border-left: 3px solid var(--richkit-accent);
|
|
764
|
+
color: var(--richkit-muted);
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
.richkit-content a {
|
|
768
|
+
color: var(--richkit-accent);
|
|
769
|
+
text-decoration: underline;
|
|
770
|
+
text-underline-offset: 2px;
|
|
771
|
+
cursor: pointer;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.richkit-content mark {
|
|
775
|
+
padding: 0.05em 0.15em;
|
|
776
|
+
border-radius: 3px;
|
|
777
|
+
background: #fef08a;
|
|
778
|
+
/* Highlights are always light, so keep dark text in every theme
|
|
779
|
+
(the extension sets an inline `color: inherit`). */
|
|
780
|
+
color: #1f2328 !important;
|
|
781
|
+
box-decoration-break: clone;
|
|
782
|
+
-webkit-box-decoration-break: clone;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
.richkit-content code {
|
|
786
|
+
padding: 0.15em 0.4em;
|
|
787
|
+
border-radius: 4px;
|
|
788
|
+
background: var(--richkit-code-bg);
|
|
789
|
+
font-family: var(--richkit-mono);
|
|
790
|
+
font-size: 0.88em;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.richkit-content pre {
|
|
794
|
+
margin: 0 0 0.75em;
|
|
795
|
+
padding: 12px 14px;
|
|
796
|
+
border: 1px solid var(--richkit-border);
|
|
797
|
+
border-radius: 8px;
|
|
798
|
+
background: var(--richkit-code-bg);
|
|
799
|
+
overflow-x: auto;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.richkit-content pre code {
|
|
803
|
+
padding: 0;
|
|
804
|
+
background: none;
|
|
805
|
+
font-size: 0.86em;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
.richkit-content hr {
|
|
809
|
+
margin: 1.3em 0;
|
|
810
|
+
border: 0;
|
|
811
|
+
border-top: 1px solid var(--richkit-border);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.richkit-content hr.ProseMirror-selectednode {
|
|
815
|
+
border-top-color: var(--richkit-accent);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/* Images */
|
|
819
|
+
.richkit-content img {
|
|
820
|
+
display: block;
|
|
821
|
+
max-width: 100%;
|
|
822
|
+
height: auto;
|
|
823
|
+
margin: 0 0 0.75em;
|
|
824
|
+
border-radius: 8px;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
.richkit-content img.ProseMirror-selectednode {
|
|
828
|
+
outline: 3px solid var(--richkit-accent);
|
|
829
|
+
outline-offset: 2px;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
/* Tables */
|
|
833
|
+
.richkit-content .tableWrapper {
|
|
834
|
+
margin: 0 0 0.9em;
|
|
835
|
+
overflow-x: auto;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.richkit-content table {
|
|
839
|
+
width: 100%;
|
|
840
|
+
border-collapse: collapse;
|
|
841
|
+
table-layout: fixed;
|
|
842
|
+
overflow: hidden;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.richkit-content th,
|
|
846
|
+
.richkit-content td {
|
|
847
|
+
position: relative;
|
|
848
|
+
min-width: 3em;
|
|
849
|
+
padding: 6px 10px;
|
|
850
|
+
border: 1px solid var(--richkit-border);
|
|
851
|
+
vertical-align: top;
|
|
852
|
+
text-align: left;
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
.richkit-content th {
|
|
856
|
+
background: var(--richkit-toolbar-bg);
|
|
857
|
+
font-weight: 600;
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
.richkit-content th > p,
|
|
861
|
+
.richkit-content td > p {
|
|
862
|
+
margin: 0;
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
.richkit-content .selectedCell::after {
|
|
866
|
+
content: "";
|
|
867
|
+
position: absolute;
|
|
868
|
+
inset: 0;
|
|
869
|
+
background: color-mix(in srgb, var(--richkit-accent) 16%, transparent);
|
|
870
|
+
pointer-events: none;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.richkit-content .column-resize-handle {
|
|
874
|
+
position: absolute;
|
|
875
|
+
top: 0;
|
|
876
|
+
right: -2px;
|
|
877
|
+
bottom: -2px;
|
|
878
|
+
width: 4px;
|
|
879
|
+
background: var(--richkit-accent);
|
|
880
|
+
pointer-events: none;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.richkit-content.resize-cursor {
|
|
884
|
+
cursor: col-resize;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.richkit-content p.is-editor-empty:first-child::before {
|
|
888
|
+
content: attr(data-placeholder);
|
|
889
|
+
float: left;
|
|
890
|
+
height: 0;
|
|
891
|
+
color: var(--richkit-muted);
|
|
892
|
+
pointer-events: none;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
@media (prefers-reduced-motion: reduce) {
|
|
896
|
+
.richkit,
|
|
897
|
+
.richkit * {
|
|
898
|
+
animation: none !important;
|
|
899
|
+
transition: none !important;
|
|
900
|
+
}
|
|
901
|
+
}
|