@meowdown/react 0.79.0 → 0.80.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/dist/index.d.ts +83 -89
- package/dist/index.js +1 -8
- package/package.json +9 -9
package/dist/index.d.ts
CHANGED
|
@@ -135,7 +135,7 @@ interface SlashMenuItem {
|
|
|
135
135
|
/**
|
|
136
136
|
* Stable row key; defaults to `label`.
|
|
137
137
|
*/
|
|
138
|
-
id?: string;
|
|
138
|
+
id?: string | undefined;
|
|
139
139
|
/**
|
|
140
140
|
* Display text, matched against the typed query like the built-in items.
|
|
141
141
|
*/
|
|
@@ -143,11 +143,11 @@ interface SlashMenuItem {
|
|
|
143
143
|
/**
|
|
144
144
|
* Extra match terms beyond the label; never displayed.
|
|
145
145
|
*/
|
|
146
|
-
keywords?: string[];
|
|
146
|
+
keywords?: string[] | undefined;
|
|
147
147
|
/**
|
|
148
148
|
* Secondary text shown beside the label.
|
|
149
149
|
*/
|
|
150
|
-
detail?: string;
|
|
150
|
+
detail?: string | undefined;
|
|
151
151
|
/**
|
|
152
152
|
* Runs after the menu closes and the typed `/query` text is removed.
|
|
153
153
|
*/
|
|
@@ -170,15 +170,15 @@ interface TagItem {
|
|
|
170
170
|
/**
|
|
171
171
|
* Display text; defaults to `#tag`.
|
|
172
172
|
*/
|
|
173
|
-
label?: string;
|
|
173
|
+
label?: string | undefined;
|
|
174
174
|
/**
|
|
175
175
|
* Secondary text shown beside the label.
|
|
176
176
|
*/
|
|
177
|
-
detail?: string;
|
|
177
|
+
detail?: string | undefined;
|
|
178
178
|
/**
|
|
179
179
|
* Side effect run after the tag is inserted (e.g. create the tag).
|
|
180
180
|
*/
|
|
181
|
-
onSelect?: () => void;
|
|
181
|
+
onSelect?: (() => void) | undefined;
|
|
182
182
|
}
|
|
183
183
|
/**
|
|
184
184
|
* Searches tags for the tag menu. Receives the query typed after `#`
|
|
@@ -197,15 +197,15 @@ interface WikilinkItem {
|
|
|
197
197
|
/**
|
|
198
198
|
* Display text; defaults to `target`.
|
|
199
199
|
*/
|
|
200
|
-
label?: string;
|
|
200
|
+
label?: string | undefined;
|
|
201
201
|
/**
|
|
202
202
|
* Secondary text shown beside the label.
|
|
203
203
|
*/
|
|
204
|
-
detail?: string;
|
|
204
|
+
detail?: string | undefined;
|
|
205
205
|
/**
|
|
206
206
|
* Side effect run after the link is inserted (e.g. create the note).
|
|
207
207
|
*/
|
|
208
|
-
onSelect?: () => void;
|
|
208
|
+
onSelect?: (() => void) | undefined;
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
211
|
* Searches notes for the wikilink menu. Receives the query typed after
|
|
@@ -246,7 +246,7 @@ interface SelectionMenuItem {
|
|
|
246
246
|
/**
|
|
247
247
|
* Secondary text shown beside the label.
|
|
248
248
|
*/
|
|
249
|
-
detail?: string;
|
|
249
|
+
detail?: string | undefined;
|
|
250
250
|
/**
|
|
251
251
|
* Runs when the row is picked, with the selection the menu was opened over.
|
|
252
252
|
*/
|
|
@@ -270,25 +270,25 @@ interface EditorProps {
|
|
|
270
270
|
* The editor mode ('focus', 'show', 'hide'), controlling how much Markdown
|
|
271
271
|
* syntax stays in view. Defaults to 'focus'.
|
|
272
272
|
*/
|
|
273
|
-
mode?: EditorMode;
|
|
273
|
+
mode?: EditorMode | undefined;
|
|
274
274
|
/**
|
|
275
275
|
* The initial Markdown text of the editor. Only the value provided on the
|
|
276
276
|
* first render is used; later changes are ignored.
|
|
277
277
|
*/
|
|
278
|
-
initialMarkdown?: string;
|
|
278
|
+
initialMarkdown?: string | undefined;
|
|
279
279
|
/**
|
|
280
280
|
* Edit a single paragraph of inline Markdown. Read on mount.
|
|
281
281
|
*/
|
|
282
|
-
singleParagraph?: boolean;
|
|
282
|
+
singleParagraph?: boolean | undefined;
|
|
283
283
|
/**
|
|
284
284
|
* Definitions supplied by the containing document.
|
|
285
285
|
*/
|
|
286
|
-
referenceDefinitions?: EditorConfig['referenceDefinitions'];
|
|
286
|
+
referenceDefinitions?: EditorConfig['referenceDefinitions'] | undefined;
|
|
287
287
|
/**
|
|
288
288
|
* Called on every user-driven document change. Programmatic `setMarkdown` and
|
|
289
289
|
* `setState` on the handle do not fire it.
|
|
290
290
|
*/
|
|
291
|
-
onDocChange?: VoidFunction;
|
|
291
|
+
onDocChange?: VoidFunction | undefined;
|
|
292
292
|
/**
|
|
293
293
|
* Searches host items for the slash menu, which opens when typing `/`.
|
|
294
294
|
* Receives the query (lowercased, punctuation stripped, may be empty) and
|
|
@@ -298,14 +298,14 @@ interface EditorProps {
|
|
|
298
298
|
* handle's `insertMarkdown`). Pass a stable function (e.g. from
|
|
299
299
|
* `useCallback`). Omit to show only the built-in items.
|
|
300
300
|
*/
|
|
301
|
-
onSlashMenuSearch?: SlashMenuSearchHandler;
|
|
301
|
+
onSlashMenuSearch?: SlashMenuSearchHandler | undefined;
|
|
302
302
|
/**
|
|
303
303
|
* Searches tags for the tag menu, which opens when typing `#` followed by
|
|
304
304
|
* text. Receives the query (lowercased, punctuation stripped) and returns the
|
|
305
305
|
* tags to show, synchronously or as a promise. Pass a stable function (e.g.
|
|
306
306
|
* from `useCallback`). Omit to disable the tag menu.
|
|
307
307
|
*/
|
|
308
|
-
onTagSearch?: TagSearchHandler;
|
|
308
|
+
onTagSearch?: TagSearchHandler | undefined;
|
|
309
309
|
/**
|
|
310
310
|
* Searches notes for the wikilink menu, which opens as soon as `[[` or `@`
|
|
311
311
|
* is typed. Receives the query (trimmed, with casing and punctuation
|
|
@@ -313,7 +313,7 @@ interface EditorProps {
|
|
|
313
313
|
* or as a promise. Pass a stable function (e.g. from `useCallback`). Omit to
|
|
314
314
|
* disable the wikilink menu.
|
|
315
315
|
*/
|
|
316
|
-
onWikilinkSearch?: WikilinkSearchHandler;
|
|
316
|
+
onWikilinkSearch?: WikilinkSearchHandler | undefined;
|
|
317
317
|
/**
|
|
318
318
|
* Searches commands for the selection menu, which opens over a non-empty
|
|
319
319
|
* selection via `EditorHandle.openSelectionMenu()` or the selection
|
|
@@ -323,55 +323,55 @@ interface EditorProps {
|
|
|
323
323
|
* re-sort. Pass a stable function (e.g. from `useCallback`). Omit to disable
|
|
324
324
|
* the selection menu.
|
|
325
325
|
*/
|
|
326
|
-
onSelectionMenuSearch?: SelectionMenuSearchHandler;
|
|
326
|
+
onSelectionMenuSearch?: SelectionMenuSearchHandler | undefined;
|
|
327
327
|
/**
|
|
328
328
|
* Shows a small floating button on a non-empty text selection that opens the
|
|
329
329
|
* selection menu. On by default; only relevant when `onSelectionMenuSearch`
|
|
330
330
|
* is set. Ignored when `readOnly` is set.
|
|
331
331
|
*/
|
|
332
|
-
selectionMenuAffordance?: boolean;
|
|
332
|
+
selectionMenuAffordance?: boolean | undefined;
|
|
333
333
|
/**
|
|
334
334
|
* Extra controls rendered in the pending-replacement preview footer, next to
|
|
335
335
|
* the built-in accept ("Replace selection" / "Insert below", per the staged
|
|
336
336
|
* mode) and Discard buttons (e.g. a retry button).
|
|
337
337
|
*/
|
|
338
|
-
pendingReplacementActions?: ReactNode;
|
|
338
|
+
pendingReplacementActions?: ReactNode | undefined;
|
|
339
339
|
/**
|
|
340
340
|
* Called when a pending replacement ends, with the outcome ('accepted' or
|
|
341
341
|
* 'discarded') and the final staged value. Use it to stop a stream that is
|
|
342
342
|
* still appending. Pass a stable function (e.g. from `useCallback`).
|
|
343
343
|
*/
|
|
344
|
-
onPendingReplacementResolve?: PendingReplacementResolveHandler;
|
|
344
|
+
onPendingReplacementResolve?: PendingReplacementResolveHandler | undefined;
|
|
345
345
|
/**
|
|
346
346
|
* Called with the link target on click of a rendered wiki link, or on
|
|
347
347
|
* `Mod-Enter` with the caret on one. Pass a stable function (e.g. from
|
|
348
348
|
* `useCallback`).
|
|
349
349
|
*/
|
|
350
|
-
onWikilinkClick?: WikilinkClickHandler;
|
|
350
|
+
onWikilinkClick?: WikilinkClickHandler | undefined;
|
|
351
351
|
/**
|
|
352
352
|
* Called with the link `href` on click of a rendered Markdown link
|
|
353
353
|
* (`[text](url)`), or on `Mod-Enter` with the caret on one. Pass a stable
|
|
354
354
|
* function (e.g. from `useCallback`).
|
|
355
355
|
*/
|
|
356
|
-
onLinkClick?: LinkClickHandler;
|
|
356
|
+
onLinkClick?: LinkClickHandler | undefined;
|
|
357
357
|
/**
|
|
358
358
|
* Called after a link is copied from the link menu, with its `href`. Useful
|
|
359
359
|
* for a toast. Pass a stable function (e.g. from `useCallback`).
|
|
360
360
|
*/
|
|
361
|
-
onLinkCopy?: LinkCopyHandler;
|
|
361
|
+
onLinkCopy?: LinkCopyHandler | undefined;
|
|
362
362
|
/**
|
|
363
363
|
* Resolves optional display metadata for the link popup. Failures should be
|
|
364
364
|
* represented by `undefined`; the popup keeps its URL and actions available.
|
|
365
365
|
* May be called repeatedly for the same `href`, so cache expensive work in
|
|
366
366
|
* the host. Pass a stable function (e.g. from `useCallback`).
|
|
367
367
|
*/
|
|
368
|
-
resolveLinkPreview?: LinkPreviewResolver$1;
|
|
368
|
+
resolveLinkPreview?: LinkPreviewResolver$1 | undefined;
|
|
369
369
|
/**
|
|
370
370
|
* Called with the tag name (without the leading `#`) on click of a rendered
|
|
371
371
|
* `#tag`, or on `Mod-Enter` with the caret on one. Pass a stable function
|
|
372
372
|
* (e.g. from `useCallback`).
|
|
373
373
|
*/
|
|
374
|
-
onTagClick?: TagClickHandler;
|
|
374
|
+
onTagClick?: TagClickHandler | undefined;
|
|
375
375
|
/**
|
|
376
376
|
* Called when the caret can move no further in the pressed arrow direction
|
|
377
377
|
* and leaves the document boundary: ArrowUp on the first visual line,
|
|
@@ -381,7 +381,7 @@ interface EditorProps {
|
|
|
381
381
|
* editor handle the key normally; any other return value consumes it. Pass a
|
|
382
382
|
* stable function (e.g. from `useCallback`).
|
|
383
383
|
*/
|
|
384
|
-
onExitBoundary?: ExitBoundaryHandler;
|
|
384
|
+
onExitBoundary?: ExitBoundaryHandler | undefined;
|
|
385
385
|
/**
|
|
386
386
|
* Maps an image `src` to a displayable URL, or `undefined` to skip that image.
|
|
387
387
|
* May return a `Promise` when the answer depends on data that has not loaded
|
|
@@ -389,7 +389,7 @@ interface EditorProps {
|
|
|
389
389
|
* when one exists. Defaults to showing http(s) URLs as-is. Pass a stable
|
|
390
390
|
* function (e.g. from `useCallback`).
|
|
391
391
|
*/
|
|
392
|
-
resolveImageUrl?: ImageOptions['resolveImageUrl'];
|
|
392
|
+
resolveImageUrl?: ImageOptions['resolveImageUrl'] | undefined;
|
|
393
393
|
/**
|
|
394
394
|
* Claims a `[label](url)` link as a file: a claimed link renders as an
|
|
395
395
|
* inline pill (file icon, name, size) instead of a link, behaves as one
|
|
@@ -397,13 +397,13 @@ interface EditorProps {
|
|
|
397
397
|
* `onLinkClick`. The markdown text is untouched. Must be pure (same link,
|
|
398
398
|
* same answer). Changing the resolver reparses existing content.
|
|
399
399
|
*/
|
|
400
|
-
resolveFileLink?: FileLinkResolver;
|
|
400
|
+
resolveFileLink?: FileLinkResolver | undefined;
|
|
401
401
|
/**
|
|
402
402
|
* Classifies `![[target]]` as an image, file, or note atom. Return
|
|
403
403
|
* `undefined` for missing or ambiguous targets to leave the source literal
|
|
404
404
|
* and editable. Must be pure; changing it reparses existing content.
|
|
405
405
|
*/
|
|
406
|
-
resolveWikiEmbed?: WikiEmbedResolver;
|
|
406
|
+
resolveWikiEmbed?: WikiEmbedResolver | undefined;
|
|
407
407
|
/**
|
|
408
408
|
* Resolves a `[[...]]` wikilink into the target its click and hover
|
|
409
409
|
* handlers receive and the label its chip shows. Meowdown reads no syntax
|
|
@@ -412,7 +412,7 @@ interface EditorProps {
|
|
|
412
412
|
* both; the markdown text is untouched either way. Must be pure; changing
|
|
413
413
|
* it reparses existing content.
|
|
414
414
|
*/
|
|
415
|
-
resolveWikilink?: WikilinkResolver;
|
|
415
|
+
resolveWikilink?: WikilinkResolver | undefined;
|
|
416
416
|
/**
|
|
417
417
|
* Resolves the metadata (file size in bytes) shown on a file pill, directly
|
|
418
418
|
* or as a promise; the pill renders immediately and fills the size in when
|
|
@@ -420,47 +420,47 @@ interface EditorProps {
|
|
|
420
420
|
* cache in the host when resolving is expensive. Pass a stable function
|
|
421
421
|
* (e.g. from `useCallback`).
|
|
422
422
|
*/
|
|
423
|
-
resolveFileInfo?: FileViewOptions['resolveFileInfo'];
|
|
423
|
+
resolveFileInfo?: FileViewOptions['resolveFileInfo'] | undefined;
|
|
424
424
|
/**
|
|
425
425
|
* Resolve the data behind an X post URL.
|
|
426
426
|
* Keep the function stable (for example, with `useCallback`). When omitted, public
|
|
427
427
|
* posts use `defaultResolveXPost` through react-tweet's hosted proxy.
|
|
428
428
|
*/
|
|
429
|
-
resolveXPost?: XPostResolver$1;
|
|
429
|
+
resolveXPost?: XPostResolver$1 | undefined;
|
|
430
430
|
/**
|
|
431
431
|
* Additional trusted protocols for X media URLs, such as `reflect-asset:`.
|
|
432
432
|
*/
|
|
433
|
-
mediaUrlProtocols?: string[];
|
|
433
|
+
mediaUrlProtocols?: string[] | undefined;
|
|
434
434
|
/**
|
|
435
435
|
* Resolves the data behind a YouTube video URL, directly or as a promise;
|
|
436
436
|
* the video renders as a `meowdown-embed-youtube` card. Defaults to
|
|
437
437
|
* `defaultResolveYouTubeVideo`, which reads YouTube's oEmbed endpoint. Pass
|
|
438
438
|
* a stable function (e.g. from `useCallback`).
|
|
439
439
|
*/
|
|
440
|
-
resolveYouTubeVideo?: YouTubeVideoResolver$1;
|
|
440
|
+
resolveYouTubeVideo?: YouTubeVideoResolver$1 | undefined;
|
|
441
441
|
/**
|
|
442
442
|
* Called when the user clicks a rendered file pill (or presses `Mod-Enter`
|
|
443
443
|
* with the caret on one), with its `href`, `name`, and the originating
|
|
444
444
|
* event. The host decides what a click does (e.g. open the file in the OS
|
|
445
445
|
* default app). Pass a stable function (e.g. from `useCallback`).
|
|
446
446
|
*/
|
|
447
|
-
onFileClick?: FileClickHandler;
|
|
447
|
+
onFileClick?: FileClickHandler | undefined;
|
|
448
448
|
/**
|
|
449
449
|
* Persists a pasted/dropped file and returns its markdown destination,
|
|
450
450
|
* inserted as `` for an image and as a `[name](src)` link for any
|
|
451
451
|
* other file. Return `undefined` to decline. Pass a stable function.
|
|
452
452
|
*/
|
|
453
|
-
onFilePaste?: FilePasteOptions['onFilePaste'];
|
|
453
|
+
onFilePaste?: FilePasteOptions['onFilePaste'] | undefined;
|
|
454
454
|
/**
|
|
455
455
|
* Called when persisting a pasted/dropped file throws.
|
|
456
456
|
*/
|
|
457
|
-
onFileSaveError?: FilePasteOptions['onFileSaveError'];
|
|
457
|
+
onFileSaveError?: FilePasteOptions['onFileSaveError'] | undefined;
|
|
458
458
|
/**
|
|
459
459
|
* Called when the user clicks a rendered image (or presses `Enter` on a
|
|
460
460
|
* selected one), with its markdown `src`, `alt`, and the originating event.
|
|
461
461
|
* Pass a stable function (e.g. from `useCallback`).
|
|
462
462
|
*/
|
|
463
|
-
onImageClick?: ImageClickHandler;
|
|
463
|
+
onImageClick?: ImageClickHandler | undefined;
|
|
464
464
|
/**
|
|
465
465
|
* Called with the `meowdown-embed-media-click` event when the user
|
|
466
466
|
* activates a photo or video inside an X post card. Its `detail` holds the
|
|
@@ -469,7 +469,7 @@ interface EditorProps {
|
|
|
469
469
|
* playing the video in place, then show the media yourself, for example in
|
|
470
470
|
* a lightbox. Pass a stable function (e.g. from `useCallback`).
|
|
471
471
|
*/
|
|
472
|
-
onXPostMediaClick?: XPostMediaClickHandler;
|
|
472
|
+
onXPostMediaClick?: XPostMediaClickHandler | undefined;
|
|
473
473
|
/**
|
|
474
474
|
* Called with the `meowdown-embed-youtube-click` event when the user
|
|
475
475
|
* activates the poster of a YouTube card. Its `detail` holds the video, the
|
|
@@ -478,38 +478,38 @@ interface EditorProps {
|
|
|
478
478
|
* place, then play it yourself, for example in a lightbox. Pass a stable
|
|
479
479
|
* function (e.g. from `useCallback`).
|
|
480
480
|
*/
|
|
481
|
-
onYouTubeVideoClick?: YouTubeVideoClickHandler;
|
|
481
|
+
onYouTubeVideoClick?: YouTubeVideoClickHandler | undefined;
|
|
482
482
|
/**
|
|
483
483
|
* Auto-embeds a pasted tweet or YouTube link as a rich embed; one undo turns
|
|
484
484
|
* the embed back into the raw link. On by default.
|
|
485
485
|
*/
|
|
486
|
-
embedPaste?: boolean;
|
|
486
|
+
embedPaste?: boolean | undefined;
|
|
487
487
|
/**
|
|
488
488
|
* Pasting a URL over selected text wraps the selection as a Markdown link
|
|
489
489
|
* `[selected text](url)`; one undo restores the plain text. On by default.
|
|
490
490
|
*/
|
|
491
|
-
linkPaste?: boolean;
|
|
491
|
+
linkPaste?: boolean | undefined;
|
|
492
492
|
/**
|
|
493
493
|
* Pressing Enter at the end of the document's first heading (the title line)
|
|
494
494
|
* starts a fresh empty bullet on the next line instead of a plain paragraph.
|
|
495
495
|
* Off by default.
|
|
496
496
|
*/
|
|
497
|
-
bulletAfterHeading?: boolean;
|
|
497
|
+
bulletAfterHeading?: boolean | undefined;
|
|
498
498
|
/**
|
|
499
499
|
* Pressing Backspace in an empty paragraph that is the document's first
|
|
500
500
|
* block deletes that paragraph, so the rest of the document moves up one
|
|
501
501
|
* line. The block after it keeps its type. Off by default.
|
|
502
502
|
*/
|
|
503
|
-
backspaceDeletesEmptyFirstBlock?: boolean;
|
|
503
|
+
backspaceDeletesEmptyFirstBlock?: boolean | undefined;
|
|
504
504
|
/**
|
|
505
505
|
* Replaces typed character sequences with their typographic equivalents,
|
|
506
506
|
* e.g. `->` with `→` and `(c)` with `©`. On by default.
|
|
507
507
|
*/
|
|
508
|
-
substitution?: boolean;
|
|
508
|
+
substitution?: boolean | undefined;
|
|
509
509
|
/**
|
|
510
510
|
* Handles a leading `---` frontmatter block (off by default).
|
|
511
511
|
*/
|
|
512
|
-
frontmatter?: boolean;
|
|
512
|
+
frontmatter?: boolean | undefined;
|
|
513
513
|
/**
|
|
514
514
|
* Shows the per-block gutter handle: a drag grip for reordering blocks and a
|
|
515
515
|
* "+" add button, plus the drop indicator that visualizes where a dragged
|
|
@@ -517,52 +517,52 @@ interface EditorProps {
|
|
|
517
517
|
* affordance entirely, e.g. when the host does not want block reordering.
|
|
518
518
|
* Ignored when `readOnly` is set.
|
|
519
519
|
*/
|
|
520
|
-
blockHandle?: boolean;
|
|
520
|
+
blockHandle?: boolean | undefined;
|
|
521
521
|
/**
|
|
522
522
|
* Glides the caret between positions instead of jumping instantly. On by
|
|
523
523
|
* default. Set to `false` to disable the movement animation; equivalent to
|
|
524
524
|
* setting the `--meowdown-caret-glide` CSS variable to `0ms`.
|
|
525
525
|
*/
|
|
526
|
-
caretGlide?: boolean;
|
|
526
|
+
caretGlide?: boolean | undefined;
|
|
527
527
|
/**
|
|
528
528
|
* Placeholder text shown when the whole document is empty. A function
|
|
529
529
|
* receives the editor state. Pass a stable function.
|
|
530
530
|
*/
|
|
531
|
-
placeholder?: PlaceholderOptions['placeholder'];
|
|
531
|
+
placeholder?: PlaceholderOptions['placeholder'] | undefined;
|
|
532
532
|
/**
|
|
533
533
|
* Makes the editor read-only.
|
|
534
534
|
*/
|
|
535
|
-
readOnly?: boolean;
|
|
535
|
+
readOnly?: boolean | undefined;
|
|
536
536
|
/**
|
|
537
537
|
* Enables the browser's native spell checking. Defaults to the browser's
|
|
538
538
|
* behavior.
|
|
539
539
|
*/
|
|
540
|
-
spellCheck?: boolean;
|
|
540
|
+
spellCheck?: boolean | undefined;
|
|
541
541
|
/**
|
|
542
542
|
* The search query. Every match is highlighted, and the first match at or
|
|
543
543
|
* after the caret is selected whenever the query changes. An empty string
|
|
544
544
|
* (the default) clears the highlights and leaves the selection alone. A match
|
|
545
545
|
* that the current mode hides reveals itself while it is the selected one.
|
|
546
546
|
*/
|
|
547
|
-
searchQuery?: string;
|
|
547
|
+
searchQuery?: string | undefined;
|
|
548
548
|
/**
|
|
549
549
|
* Called when the number of matches or the selected match changes. Pass a
|
|
550
550
|
* stable function (e.g. from `useCallback`).
|
|
551
551
|
*/
|
|
552
|
-
onSearchChange?: SearchStatusHandler;
|
|
552
|
+
onSearchChange?: SearchStatusHandler | undefined;
|
|
553
553
|
/**
|
|
554
554
|
* Clock format the `/now` slash command inserts: '12' for "3:45pm" or '24'
|
|
555
555
|
* for "15:45". Defaults to '12'.
|
|
556
556
|
*/
|
|
557
|
-
timeFormat?: TimeFormat;
|
|
557
|
+
timeFormat?: TimeFormat | undefined;
|
|
558
558
|
/**
|
|
559
559
|
* Class on the editable root (the contenteditable).
|
|
560
560
|
*/
|
|
561
|
-
editorClassName?: string;
|
|
561
|
+
editorClassName?: string | undefined;
|
|
562
562
|
/**
|
|
563
563
|
* Class on the outer `.meowdown` wrapper div.
|
|
564
564
|
*/
|
|
565
|
-
wrapperClassName?: string;
|
|
565
|
+
wrapperClassName?: string | undefined;
|
|
566
566
|
/**
|
|
567
567
|
* React component that renders code blocks in place of the built-in one.
|
|
568
568
|
* `false` disables the React code block view.
|
|
@@ -571,11 +571,11 @@ interface EditorProps {
|
|
|
571
571
|
/**
|
|
572
572
|
* Imperative handle for the editor.
|
|
573
573
|
*/
|
|
574
|
-
handleRef?: Ref<EditorHandle
|
|
574
|
+
handleRef?: Ref<EditorHandle> | undefined;
|
|
575
575
|
/**
|
|
576
576
|
* Nodes rendered inside the editor's ProseKit context.
|
|
577
577
|
*/
|
|
578
|
-
children?: ReactNode;
|
|
578
|
+
children?: ReactNode | undefined;
|
|
579
579
|
}
|
|
580
580
|
/**
|
|
581
581
|
* A hybrid live-preview Markdown editor: the document stays Markdown text,
|
|
@@ -631,106 +631,106 @@ interface MarkdownViewProps {
|
|
|
631
631
|
/**
|
|
632
632
|
* Interpret content as one paragraph, without block syntax.
|
|
633
633
|
*/
|
|
634
|
-
singleParagraph?: boolean;
|
|
634
|
+
singleParagraph?: boolean | undefined;
|
|
635
635
|
/**
|
|
636
636
|
* Reference definitions available outside this fragment.
|
|
637
637
|
*/
|
|
638
|
-
referenceDefinitions?: ReferenceDefinitions;
|
|
638
|
+
referenceDefinitions?: ReferenceDefinitions | undefined;
|
|
639
639
|
/**
|
|
640
640
|
* Mark mode for the read-only view. Defaults to `'hide'`.
|
|
641
641
|
*/
|
|
642
|
-
markMode?: MarkMode;
|
|
642
|
+
markMode?: MarkMode | undefined;
|
|
643
643
|
/**
|
|
644
644
|
* Peel a leading YAML frontmatter block before rendering. Off by default.
|
|
645
645
|
*/
|
|
646
|
-
frontmatter?: boolean;
|
|
646
|
+
frontmatter?: boolean | undefined;
|
|
647
647
|
/**
|
|
648
648
|
* Whether rendered links, images, file pills, and task checkboxes can be activated.
|
|
649
649
|
* Defaults to `true`. When `false`, callbacks are ignored, the rendered tree
|
|
650
650
|
* contains no anchors or focusable task controls, and recognized tweet and
|
|
651
651
|
* YouTube embeds are omitted before any image resolver runs.
|
|
652
652
|
*/
|
|
653
|
-
interactive?: boolean;
|
|
653
|
+
interactive?: boolean | undefined;
|
|
654
654
|
/**
|
|
655
655
|
* Render collapsed (`+`) bullets expanded, ignoring their fold state at any
|
|
656
656
|
* depth. Off by default. For views that show slices of a note (e.g. a
|
|
657
657
|
* backlinks panel), where the source's fold state must not hide the content
|
|
658
658
|
* the view exists to show.
|
|
659
659
|
*/
|
|
660
|
-
expandCollapsed?: boolean;
|
|
660
|
+
expandCollapsed?: boolean | undefined;
|
|
661
661
|
/**
|
|
662
662
|
* Map an image `src` to a displayable URL, or `undefined` to skip it. May
|
|
663
663
|
* return a `Promise`; the image appears once it resolves, in a box of its
|
|
664
664
|
* persisted size when both dimensions are known.
|
|
665
665
|
*/
|
|
666
|
-
resolveImageUrl?: ImageUrlResolver;
|
|
666
|
+
resolveImageUrl?: ImageUrlResolver | undefined;
|
|
667
667
|
/**
|
|
668
668
|
* Claim a `[label](url)` link as a file pill instead of a regular link.
|
|
669
669
|
* Must be pure; return `false` for links that should render normally.
|
|
670
670
|
*/
|
|
671
|
-
resolveFileLink?: FileLinkResolver;
|
|
671
|
+
resolveFileLink?: FileLinkResolver | undefined;
|
|
672
672
|
/**
|
|
673
673
|
* Classify `![[target]]` as an image, file, or note; unresolved source stays literal.
|
|
674
674
|
*/
|
|
675
|
-
resolveWikiEmbed?: WikiEmbedResolver;
|
|
675
|
+
resolveWikiEmbed?: WikiEmbedResolver | undefined;
|
|
676
676
|
/**
|
|
677
677
|
* Resolve a `[[...]]` wikilink into its target and chip label; the bracketed
|
|
678
678
|
* text is both by default. Must be pure.
|
|
679
679
|
*/
|
|
680
|
-
resolveWikilink?: WikilinkResolver;
|
|
680
|
+
resolveWikilink?: WikilinkResolver | undefined;
|
|
681
681
|
/**
|
|
682
682
|
* Resolve metadata shown on a file pill.
|
|
683
683
|
*/
|
|
684
|
-
resolveFileInfo?: FileInfoResolver;
|
|
684
|
+
resolveFileInfo?: FileInfoResolver | undefined;
|
|
685
685
|
/**
|
|
686
686
|
* Resolve the data behind an X post URL, rendered as a `meowdown-embed-x`
|
|
687
687
|
* card. Defaults to `defaultResolveXPost`.
|
|
688
688
|
*/
|
|
689
|
-
resolveXPost?: XPostResolver$1;
|
|
689
|
+
resolveXPost?: XPostResolver$1 | undefined;
|
|
690
690
|
/**
|
|
691
691
|
* Additional trusted protocols for X media URLs, such as `reflect-asset:`.
|
|
692
692
|
*/
|
|
693
|
-
mediaUrlProtocols?: string[];
|
|
693
|
+
mediaUrlProtocols?: string[] | undefined;
|
|
694
694
|
/**
|
|
695
695
|
* Resolve the data behind a YouTube video URL, rendered as a
|
|
696
696
|
* `meowdown-embed-youtube` card. Defaults to `defaultResolveYouTubeVideo`.
|
|
697
697
|
*/
|
|
698
|
-
resolveYouTubeVideo?: YouTubeVideoResolver$1;
|
|
698
|
+
resolveYouTubeVideo?: YouTubeVideoResolver$1 | undefined;
|
|
699
699
|
/**
|
|
700
700
|
* Called when a rendered wikilink is clicked. Pass a stable function.
|
|
701
701
|
*/
|
|
702
|
-
onWikilinkClick?: WikilinkClickHandler;
|
|
702
|
+
onWikilinkClick?: WikilinkClickHandler | undefined;
|
|
703
703
|
/**
|
|
704
704
|
* Called when a rendered Markdown link is clicked. Pass a stable function.
|
|
705
705
|
*/
|
|
706
|
-
onLinkClick?: LinkClickHandler;
|
|
706
|
+
onLinkClick?: LinkClickHandler | undefined;
|
|
707
707
|
/**
|
|
708
708
|
* Called when a rendered image is clicked. Pass a stable function.
|
|
709
709
|
*/
|
|
710
|
-
onImageClick?: ImageClickHandler;
|
|
710
|
+
onImageClick?: ImageClickHandler | undefined;
|
|
711
711
|
/**
|
|
712
712
|
* Called when a photo or video inside an X post card is activated. Call
|
|
713
713
|
* `event.preventDefault()` to stop the card from opening the photo URL or
|
|
714
714
|
* playing the video in place.
|
|
715
715
|
*/
|
|
716
|
-
onXPostMediaClick?: XPostMediaClickHandler;
|
|
716
|
+
onXPostMediaClick?: XPostMediaClickHandler | undefined;
|
|
717
717
|
/**
|
|
718
718
|
* Called when the poster of a YouTube card is activated. Call
|
|
719
719
|
* `event.preventDefault()` to stop the card from playing the video in place.
|
|
720
720
|
*/
|
|
721
|
-
onYouTubeVideoClick?: YouTubeVideoClickHandler;
|
|
721
|
+
onYouTubeVideoClick?: YouTubeVideoClickHandler | undefined;
|
|
722
722
|
/**
|
|
723
723
|
* Called when a rendered file pill is clicked. Pass a stable function.
|
|
724
724
|
*/
|
|
725
|
-
onFileClick?: FileClickHandler;
|
|
725
|
+
onFileClick?: FileClickHandler | undefined;
|
|
726
726
|
/**
|
|
727
727
|
* Called when a rendered task checkbox is clicked. Pass a stable function.
|
|
728
728
|
*/
|
|
729
|
-
onTaskClick?: TaskClickHandler;
|
|
729
|
+
onTaskClick?: TaskClickHandler | undefined;
|
|
730
730
|
/**
|
|
731
731
|
* Extra class on the content root (alongside `ProseMirror meowdown-content`).
|
|
732
732
|
*/
|
|
733
|
-
className?: string;
|
|
733
|
+
className?: string | undefined;
|
|
734
734
|
}
|
|
735
735
|
/**
|
|
736
736
|
* Render Markdown to a read-only React tree that looks exactly like the editor
|
|
@@ -922,7 +922,7 @@ interface WikilinkHoverCardProps {
|
|
|
922
922
|
/**
|
|
923
923
|
* Optional class applied to the popup, after the default card surface.
|
|
924
924
|
*/
|
|
925
|
-
readonly className?: string;
|
|
925
|
+
readonly className?: string | undefined;
|
|
926
926
|
}
|
|
927
927
|
/**
|
|
928
928
|
* Show host-rendered content for the wiki link the pointer rests on. The
|
|
@@ -930,10 +930,4 @@ interface WikilinkHoverCardProps {
|
|
|
930
930
|
*/
|
|
931
931
|
export declare function WikilinkHoverCard({ children, className }: WikilinkHoverCardProps): ReactNode;
|
|
932
932
|
//#endregion
|
|
933
|
-
//#region src/index.d.ts
|
|
934
|
-
/**
|
|
935
|
-
* @deprecated Use `MarkdownEditor` instead.
|
|
936
|
-
*/
|
|
937
|
-
export declare const MeowdownEditor: typeof MarkdownEditor;
|
|
938
|
-
//#endregion
|
|
939
933
|
export { type EditorHandle, type EditorMode, type EditorProps, type EditorStateSnapshot, type LightboxCloseOptions, type LightboxController, type LightboxFrameItem, type LightboxFrameProps, type LightboxImageItem, type LightboxImageProps, type LightboxItem, type LightboxRootProps, type LightboxVideoItem, type LightboxVideoProps, type LinkPreview, type LinkPreviewResolver, type MarkdownViewProps, type PendingReplacementResolveHandler, type ReactNodeViewComponent, type SelectionHint, type SelectionJSON, type SelectionMenuContext, type SelectionMenuItem, type SelectionMenuSearchHandler, type SlashMenuItem, type SlashMenuSearchHandler, type TagItem, type TagSearchHandler, type TaskClickHandler, type TaskClickPayload, type TimeFormat, type WikilinkHoverCardProps, type WikilinkItem, type WikilinkSearchHandler, type XPostResolver, type YouTubeVideoResolver, useEditor, useExtension, useKeymap };
|
package/dist/index.js
CHANGED
|
@@ -3302,11 +3302,4 @@ function WikilinkHoverCard({ children, className }) {
|
|
|
3302
3302
|
}
|
|
3303
3303
|
|
|
3304
3304
|
//#endregion
|
|
3305
|
-
|
|
3306
|
-
/**
|
|
3307
|
-
* @deprecated Use `MarkdownEditor` instead.
|
|
3308
|
-
*/
|
|
3309
|
-
const MeowdownEditor = MarkdownEditor;
|
|
3310
|
-
|
|
3311
|
-
//#endregion
|
|
3312
|
-
export { LightboxFrame, LightboxImage, LightboxRoot, LightboxVideo, MarkdownEditor, MarkdownView, MeowdownEditor, WikilinkHoverCard, useEditor, useExtension, useKeymap, useLightbox };
|
|
3305
|
+
export { LightboxFrame, LightboxImage, LightboxRoot, LightboxVideo, MarkdownEditor, MarkdownView, WikilinkHoverCard, useEditor, useExtension, useKeymap, useLightbox };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meowdown/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.80.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,16 +21,16 @@
|
|
|
21
21
|
"./dist/**/*.css"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@base-ui/react": "^1.
|
|
25
|
-
"@meowdown/core": "0.
|
|
24
|
+
"@base-ui/react": "^1.9.0",
|
|
25
|
+
"@meowdown/core": "0.81.0",
|
|
26
26
|
"@meowdown/embed": "0.3.1",
|
|
27
|
-
"@meowdown/markdown": "0.76.
|
|
28
|
-
"@ocavue/utils": "^1.
|
|
27
|
+
"@meowdown/markdown": "0.76.1",
|
|
28
|
+
"@ocavue/utils": "^1.9.0",
|
|
29
29
|
"@post-embed/types": "^0.5.0",
|
|
30
30
|
"@prosekit/core": "^0.13.3",
|
|
31
31
|
"@prosekit/pm": "^0.1.20",
|
|
32
|
-
"@prosekit/react": "^0.8.
|
|
33
|
-
"@prosekit/web": "^0.9.
|
|
32
|
+
"@prosekit/react": "^0.8.4",
|
|
33
|
+
"@prosekit/web": "^0.9.4",
|
|
34
34
|
"beautiful-mermaid": "^1.1.3",
|
|
35
35
|
"clsx": "^2.1.1",
|
|
36
36
|
"github-slugger": "^2.0.0",
|
|
@@ -53,14 +53,14 @@
|
|
|
53
53
|
"@css-modules-kit/codegen": "^1.4.0",
|
|
54
54
|
"@meowdown/vitest": "0.0.0",
|
|
55
55
|
"@ocavue/tsconfig": "^0.7.1",
|
|
56
|
-
"@tsdown/css": "^0.23.
|
|
56
|
+
"@tsdown/css": "^0.23.1",
|
|
57
57
|
"@types/react": "^19.3.0",
|
|
58
58
|
"@types/react-dom": "^19.3.0",
|
|
59
59
|
"@vitest/browser-playwright": "^5.0.3",
|
|
60
60
|
"dedent": "^1.7.2",
|
|
61
61
|
"react": "^19.3.0",
|
|
62
62
|
"react-dom": "^19.3.0",
|
|
63
|
-
"tsdown": "^0.23.
|
|
63
|
+
"tsdown": "^0.23.1",
|
|
64
64
|
"vitest": "^5.0.3",
|
|
65
65
|
"vitest-browser-commands": "^0.5.0",
|
|
66
66
|
"vitest-browser-react": "^2.3.0"
|