@meowdown/core 0.71.0 → 0.71.2
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/index.js +8 -1
- package/dist/style.css +220 -182
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3113,8 +3113,15 @@ function getLinkUnitAt(state, pos) {
|
|
|
3113
3113
|
//#endregion
|
|
3114
3114
|
//#region src/extensions/image-click.ts
|
|
3115
3115
|
const imageClickKey = new PluginKey("meowdown-image-click");
|
|
3116
|
+
/**
|
|
3117
|
+
* The image preview wrapper around `target`, or nothing when the wrapper holds
|
|
3118
|
+
* a post-embed card: its links and controls have their own click behavior.
|
|
3119
|
+
*/
|
|
3116
3120
|
function getClosestImagePreview(target) {
|
|
3117
|
-
|
|
3121
|
+
if (!(target instanceof HTMLElement)) return;
|
|
3122
|
+
const preview = target.closest(".md-image-view-preview");
|
|
3123
|
+
if (!preview || preview.dataset.postEmbed != null) return;
|
|
3124
|
+
return preview;
|
|
3118
3125
|
}
|
|
3119
3126
|
function findImageAt(state, pos) {
|
|
3120
3127
|
const range = getMarkRangeAt(state, pos, "mdImage");
|
package/dist/style.css
CHANGED
|
@@ -183,224 +183,261 @@
|
|
|
183
183
|
inherits: true
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
-
|
|
187
|
-
:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
--_link: var(--post-embed-link-color, #1d9bf0);
|
|
191
|
-
font: inherit;
|
|
192
|
-
color: var(--post-embed-color, inherit);
|
|
193
|
-
text-decoration-skip-ink: none;
|
|
194
|
-
display: block;
|
|
186
|
+
[data-post-embed="x-post"] [data-root], [data-post-embed="x-post"] [data-root] *, [data-post-embed="x-post"] [data-root] :before, [data-post-embed="x-post"] [data-root] :after {
|
|
187
|
+
all: revert;
|
|
188
|
+
box-sizing: border-box;
|
|
189
|
+
}
|
|
195
190
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
191
|
+
[data-post-embed="x-post"] {
|
|
192
|
+
--_hairline: var(--post-embed-border-color, color-mix(in srgb, currentColor 14%, transparent));
|
|
193
|
+
--_muted: var(--post-embed-muted-color, color-mix(in srgb, currentColor 55%, transparent));
|
|
194
|
+
--_link: var(--post-embed-link-color, #1d9bf0);
|
|
195
|
+
--_tint: color-mix(in srgb, currentColor 5%, transparent);
|
|
196
|
+
font: inherit;
|
|
197
|
+
color: var(--post-embed-color, inherit);
|
|
198
|
+
text-decoration-skip-ink: none;
|
|
199
|
+
display: block;
|
|
200
|
+
}
|
|
205
201
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
202
|
+
[data-post-embed="x-post"] [data-root] {
|
|
203
|
+
color: var(--post-embed-color, inherit);
|
|
204
|
+
background: var(--post-embed-background, transparent);
|
|
205
|
+
border: 1px solid var(--_hairline);
|
|
206
|
+
border-radius: var(--post-embed-radius, .75rem);
|
|
207
|
+
padding: var(--post-embed-padding, 1rem);
|
|
208
|
+
letter-spacing: normal;
|
|
209
|
+
text-align: start;
|
|
210
|
+
text-transform: none;
|
|
211
|
+
text-indent: 0;
|
|
212
|
+
text-shadow: none;
|
|
213
|
+
word-spacing: normal;
|
|
214
|
+
font-variant: normal;
|
|
215
|
+
hyphens: manual;
|
|
216
|
+
white-space: normal;
|
|
217
|
+
overflow-wrap: anywhere;
|
|
218
|
+
cursor: auto;
|
|
219
|
+
font-size: 1em;
|
|
220
|
+
font-style: normal;
|
|
221
|
+
font-weight: 400;
|
|
222
|
+
line-height: 1.45;
|
|
223
|
+
display: block;
|
|
224
|
+
position: relative;
|
|
209
225
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
}
|
|
226
|
+
& [hidden] {
|
|
227
|
+
display: none !important;
|
|
228
|
+
}
|
|
214
229
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
230
|
+
& p {
|
|
231
|
+
margin: 0;
|
|
232
|
+
}
|
|
219
233
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
234
|
+
& a {
|
|
235
|
+
color: var(--_link);
|
|
236
|
+
cursor: pointer;
|
|
237
|
+
text-decoration: none;
|
|
238
|
+
}
|
|
225
239
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
240
|
+
& a:hover {
|
|
241
|
+
text-underline-offset: .15em;
|
|
242
|
+
text-decoration: underline;
|
|
243
|
+
}
|
|
231
244
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
height: 3rem;
|
|
238
|
-
}
|
|
245
|
+
& a:focus-visible {
|
|
246
|
+
outline: 2px solid var(--_link);
|
|
247
|
+
outline-offset: 2px;
|
|
248
|
+
border-radius: 4px;
|
|
249
|
+
}
|
|
239
250
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
251
|
+
& [data-author] {
|
|
252
|
+
align-items: center;
|
|
253
|
+
gap: .625rem;
|
|
254
|
+
min-width: 0;
|
|
255
|
+
display: flex;
|
|
256
|
+
}
|
|
243
257
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
258
|
+
& [data-avatar] {
|
|
259
|
+
object-fit: cover;
|
|
260
|
+
background: var(--_tint);
|
|
261
|
+
border-radius: 50%;
|
|
262
|
+
flex: none;
|
|
263
|
+
width: 2.5rem;
|
|
264
|
+
height: 2.5rem;
|
|
265
|
+
display: block;
|
|
266
|
+
}
|
|
247
267
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
flex: 1;
|
|
252
|
-
line-height: 1.3;
|
|
253
|
-
}
|
|
268
|
+
& [data-avatar][data-shape="square"] {
|
|
269
|
+
border-radius: .5rem;
|
|
270
|
+
}
|
|
254
271
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
align-items: center;
|
|
259
|
-
gap: .25rem;
|
|
260
|
-
font-weight: 700;
|
|
261
|
-
display: flex;
|
|
262
|
-
}
|
|
272
|
+
& [data-avatar][data-shape="hexagon"] {
|
|
273
|
+
clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%);
|
|
274
|
+
}
|
|
263
275
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
276
|
+
& [data-author-details] {
|
|
277
|
+
flex: 1;
|
|
278
|
+
min-width: 0;
|
|
279
|
+
line-height: 1.3;
|
|
280
|
+
display: block;
|
|
281
|
+
}
|
|
267
282
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
283
|
+
& [data-author-name] {
|
|
284
|
+
flex-wrap: wrap;
|
|
285
|
+
align-items: center;
|
|
286
|
+
gap: .25rem;
|
|
287
|
+
font-weight: 600;
|
|
288
|
+
display: flex;
|
|
289
|
+
}
|
|
273
290
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
line-height: 1.45;
|
|
278
|
-
}
|
|
291
|
+
& [data-author-details] > bdi {
|
|
292
|
+
color: var(--_muted);
|
|
293
|
+
}
|
|
279
294
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
295
|
+
& [data-author-details] > bdi > a {
|
|
296
|
+
color: inherit;
|
|
297
|
+
}
|
|
283
298
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
display: grid;
|
|
291
|
-
overflow: hidden;
|
|
292
|
-
}
|
|
299
|
+
& [data-reply-to] {
|
|
300
|
+
color: var(--_muted);
|
|
301
|
+
margin-block-start: .625rem;
|
|
302
|
+
font-size: .9375em;
|
|
303
|
+
display: block;
|
|
304
|
+
}
|
|
293
305
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
306
|
+
& [data-body] {
|
|
307
|
+
margin-block: .625rem 0;
|
|
308
|
+
font-size: 1em;
|
|
309
|
+
line-height: 1.5;
|
|
310
|
+
display: block;
|
|
311
|
+
}
|
|
297
312
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
313
|
+
& [data-text] {
|
|
314
|
+
white-space: pre-wrap;
|
|
315
|
+
}
|
|
302
316
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
317
|
+
& [data-media] {
|
|
318
|
+
background: var(--_hairline);
|
|
319
|
+
border-radius: .5rem;
|
|
320
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
321
|
+
gap: 2px;
|
|
322
|
+
margin-block-start: .75rem;
|
|
323
|
+
display: grid;
|
|
324
|
+
overflow: hidden;
|
|
325
|
+
}
|
|
307
326
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
width: 100%;
|
|
312
|
-
height: auto;
|
|
313
|
-
max-height: 36rem;
|
|
314
|
-
display: block;
|
|
315
|
-
}
|
|
327
|
+
& [data-media][data-count="1"] {
|
|
328
|
+
grid-template-columns: minmax(0, 1fr);
|
|
329
|
+
}
|
|
316
330
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
331
|
+
& [data-media-item] {
|
|
332
|
+
min-width: 0;
|
|
333
|
+
display: block;
|
|
334
|
+
overflow: hidden;
|
|
335
|
+
}
|
|
322
336
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
337
|
+
& [data-media-item] > a {
|
|
338
|
+
height: 100%;
|
|
339
|
+
display: block;
|
|
340
|
+
}
|
|
326
341
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
342
|
+
& [data-media-item] img, & [data-media-item] video {
|
|
343
|
+
object-fit: contain;
|
|
344
|
+
background: var(--_tint);
|
|
345
|
+
width: 100%;
|
|
346
|
+
height: auto;
|
|
347
|
+
max-height: 32rem;
|
|
348
|
+
display: block;
|
|
349
|
+
}
|
|
332
350
|
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
}
|
|
351
|
+
& [data-media]:not([data-count="1"]) [data-media-item] img {
|
|
352
|
+
aspect-ratio: 1;
|
|
353
|
+
object-fit: cover;
|
|
354
|
+
height: 100%;
|
|
355
|
+
}
|
|
339
356
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
357
|
+
& [data-media][data-count="3"] [data-media-item]:first-child {
|
|
358
|
+
grid-row: span 2;
|
|
359
|
+
}
|
|
343
360
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
361
|
+
& [data-media-unavailable], & [data-media-error] {
|
|
362
|
+
color: var(--_muted);
|
|
363
|
+
background: var(--_tint);
|
|
364
|
+
padding: .75rem 1rem;
|
|
365
|
+
display: block;
|
|
366
|
+
}
|
|
348
367
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
368
|
+
& [data-quoted] {
|
|
369
|
+
border: 1px solid var(--_hairline);
|
|
370
|
+
border-radius: .5rem;
|
|
371
|
+
margin-block-start: .75rem;
|
|
372
|
+
padding: .75rem;
|
|
373
|
+
display: block;
|
|
374
|
+
}
|
|
355
375
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
376
|
+
& [data-quoted] [data-author] {
|
|
377
|
+
gap: .5rem;
|
|
378
|
+
}
|
|
360
379
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
380
|
+
& [data-quoted] [data-avatar] {
|
|
381
|
+
width: 1.375rem;
|
|
382
|
+
height: 1.375rem;
|
|
383
|
+
}
|
|
364
384
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
385
|
+
& [data-quoted] [data-author-details] {
|
|
386
|
+
flex-wrap: wrap;
|
|
387
|
+
align-items: baseline;
|
|
388
|
+
gap: 0 .35rem;
|
|
389
|
+
display: flex;
|
|
390
|
+
}
|
|
369
391
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
gap: .25rem 0;
|
|
375
|
-
margin-block-start: .75rem;
|
|
376
|
-
font-size: .9375em;
|
|
377
|
-
display: flex;
|
|
378
|
-
}
|
|
392
|
+
& [data-quoted] [data-body] {
|
|
393
|
+
margin-block-start: .375rem;
|
|
394
|
+
font-size: .9375em;
|
|
395
|
+
}
|
|
379
396
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
397
|
+
& [data-quoted] [data-media] {
|
|
398
|
+
border-radius: .375rem;
|
|
399
|
+
}
|
|
383
400
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
border-radius: 50%;
|
|
389
|
-
width: 3px;
|
|
390
|
-
height: 3px;
|
|
391
|
-
margin-inline: .45rem;
|
|
392
|
-
display: inline-block;
|
|
393
|
-
}
|
|
401
|
+
& [data-quoted] [data-footer] {
|
|
402
|
+
margin-block-start: .5rem;
|
|
403
|
+
font-size: .8125em;
|
|
404
|
+
}
|
|
394
405
|
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
406
|
+
& [data-footer] {
|
|
407
|
+
color: var(--_muted);
|
|
408
|
+
flex-wrap: wrap;
|
|
409
|
+
align-items: center;
|
|
410
|
+
gap: .25rem 0;
|
|
411
|
+
margin-block-start: .625rem;
|
|
412
|
+
font-size: .875em;
|
|
413
|
+
display: flex;
|
|
414
|
+
}
|
|
398
415
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
416
|
+
& [data-footer] > a {
|
|
417
|
+
color: inherit;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
& [data-footer] > [data-edited]:before {
|
|
421
|
+
content: "";
|
|
422
|
+
vertical-align: middle;
|
|
423
|
+
background: currentColor;
|
|
424
|
+
border-radius: 50%;
|
|
425
|
+
width: 3px;
|
|
426
|
+
height: 3px;
|
|
427
|
+
margin-inline: .45rem;
|
|
428
|
+
display: inline-block;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
& [data-edited] {
|
|
432
|
+
font-style: normal;
|
|
402
433
|
}
|
|
403
434
|
|
|
435
|
+
& [data-fallback] [data-body] {
|
|
436
|
+
color: var(--_muted);
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
@layer post-embed {
|
|
404
441
|
:where([data-post-embed="youtube-video"]) {
|
|
405
442
|
--_hairline: var(--post-embed-border-color, color-mix(in srgb, currentColor 15%, transparent));
|
|
406
443
|
--_muted: var(--post-embed-muted-color, color-mix(in srgb, currentColor 58%, transparent));
|
|
@@ -1209,7 +1246,8 @@
|
|
|
1209
1246
|
}
|
|
1210
1247
|
|
|
1211
1248
|
& .md-image-view-preview[data-post-embed] {
|
|
1212
|
-
border-radius: var(--post-embed-radius,
|
|
1249
|
+
border-radius: var(--post-embed-radius, .75rem);
|
|
1250
|
+
overflow: visible;
|
|
1213
1251
|
}
|
|
1214
1252
|
|
|
1215
1253
|
& .md-image-resizable {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meowdown/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.71.
|
|
4
|
+
"version": "0.71.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"@floating-ui/dom": "^1.8.0",
|
|
27
27
|
"@lezer/highlight": "^1.2.3",
|
|
28
28
|
"@ocavue/utils": "^1.8.0",
|
|
29
|
-
"@post-embed/elements": "^0.
|
|
30
|
-
"@post-embed/exporter": "^0.4.
|
|
31
|
-
"@post-embed/schema": "^0.
|
|
29
|
+
"@post-embed/elements": "^0.5.0",
|
|
30
|
+
"@post-embed/exporter": "^0.4.1",
|
|
31
|
+
"@post-embed/schema": "^0.5.0",
|
|
32
32
|
"@post-embed/types": "^0.4.0",
|
|
33
33
|
"@prosekit/core": "^0.13.2",
|
|
34
34
|
"@prosekit/extensions": "^0.18.2",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"unicode-by-name": "^0.2.0",
|
|
50
50
|
"unified": "^11.0.5",
|
|
51
51
|
"valibot": "^1.5.0",
|
|
52
|
-
"@meowdown/markdown": "^0.71.
|
|
52
|
+
"@meowdown/markdown": "^0.71.2"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@ocavue/tsconfig": "^0.7.1",
|