@meowdown/react 0.55.0 → 0.56.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/README.md +2 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +11 -2
- package/dist/style.css +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -58,6 +58,8 @@ Slash menu host items can include `keywords` to match hidden terms without chang
|
|
|
58
58
|
|
|
59
59
|
The caret glides between positions by default; pass `caretGlide={false}` to move it instantly (hosts can also tune the duration via the `--meowdown-caret-glide` CSS variable).
|
|
60
60
|
|
|
61
|
+
`MarkdownView` folds collapsed (`+`) bullets like the editor; pass `expandCollapsed` to render them expanded at every depth, for views that show slices of a note (e.g. a backlinks panel) where the source's fold state must not hide the content the view exists to show.
|
|
62
|
+
|
|
61
63
|
### Wiki embeds
|
|
62
64
|
|
|
63
65
|
Obsidian-style wiki embeds (`![[path]]`, with optional `|width` or
|
package/dist/index.d.ts
CHANGED
|
@@ -444,6 +444,13 @@ interface MarkdownViewProps {
|
|
|
444
444
|
* YouTube embeds are omitted before any image resolver runs.
|
|
445
445
|
*/
|
|
446
446
|
interactive?: boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Render collapsed (`+`) bullets expanded, ignoring their fold state at any
|
|
449
|
+
* depth. Off by default. For views that show slices of a note (e.g. a
|
|
450
|
+
* backlinks panel), where the source's fold state must not hide the content
|
|
451
|
+
* the view exists to show.
|
|
452
|
+
*/
|
|
453
|
+
expandCollapsed?: boolean;
|
|
447
454
|
/** Map an image `src` to a displayable URL, or `undefined` to skip it. */
|
|
448
455
|
resolveImageUrl?: (src: string) => string | undefined;
|
|
449
456
|
/**
|
|
@@ -479,7 +486,7 @@ interface MarkdownViewProps {
|
|
|
479
486
|
* Callbacks (`onWikilinkClick`, etc.) and resolvers should be stable; pass them via
|
|
480
487
|
* `useCallback` to avoid re-rendering the whole tree.
|
|
481
488
|
*/
|
|
482
|
-
declare function MarkdownView({ markdown, markMode, frontmatter, interactive, resolveImageUrl, resolveFileLink, resolveWikiEmbed, resolveFileInfo, onWikilinkClick, onLinkClick, onImageClick, onFileClick, onTaskClick, className }: MarkdownViewProps): ReactElement;
|
|
489
|
+
declare function MarkdownView({ markdown, markMode, frontmatter, interactive, expandCollapsed, resolveImageUrl, resolveFileLink, resolveWikiEmbed, resolveFileInfo, onWikilinkClick, onLinkClick, onImageClick, onFileClick, onTaskClick, className }: MarkdownViewProps): ReactElement;
|
|
483
490
|
//#endregion
|
|
484
491
|
//#region src/components/wikilink-hover-card.d.ts
|
|
485
492
|
/** Props for {@link WikilinkHoverCard}. */
|
package/dist/index.js
CHANGED
|
@@ -2455,7 +2455,14 @@ function renderBlock(node, context) {
|
|
|
2455
2455
|
const typeName = node.type.name;
|
|
2456
2456
|
let handleTaskClick;
|
|
2457
2457
|
if (typeName === "list") {
|
|
2458
|
-
|
|
2458
|
+
let attrs = node.attrs;
|
|
2459
|
+
if (context.expandCollapsed && attrs.collapsed) {
|
|
2460
|
+
attrs = {
|
|
2461
|
+
...attrs,
|
|
2462
|
+
collapsed: false
|
|
2463
|
+
};
|
|
2464
|
+
node = node.type.create(attrs, node.content, node.marks);
|
|
2465
|
+
}
|
|
2459
2466
|
const { onTaskClick } = context;
|
|
2460
2467
|
if (attrs.kind === "task" && onTaskClick) {
|
|
2461
2468
|
const index = context.taskCounter.value++;
|
|
@@ -2505,11 +2512,12 @@ function renderBlock(node, context) {
|
|
|
2505
2512
|
* Callbacks (`onWikilinkClick`, etc.) and resolvers should be stable; pass them via
|
|
2506
2513
|
* `useCallback` to avoid re-rendering the whole tree.
|
|
2507
2514
|
*/
|
|
2508
|
-
function MarkdownView({ markdown, markMode = "hide", frontmatter = false, interactive = true, resolveImageUrl, resolveFileLink, resolveWikiEmbed, resolveFileInfo, onWikilinkClick, onLinkClick, onImageClick, onFileClick, onTaskClick, className }) {
|
|
2515
|
+
function MarkdownView({ markdown, markMode = "hide", frontmatter = false, interactive = true, expandCollapsed = false, resolveImageUrl, resolveFileLink, resolveWikiEmbed, resolveFileInfo, onWikilinkClick, onLinkClick, onImageClick, onFileClick, onTaskClick, className }) {
|
|
2509
2516
|
const content = useMemo(() => {
|
|
2510
2517
|
const doc = markdownToDoc(markdown, { frontmatter });
|
|
2511
2518
|
const context = {
|
|
2512
2519
|
interactive,
|
|
2520
|
+
expandCollapsed,
|
|
2513
2521
|
resolveImageUrl,
|
|
2514
2522
|
resolveFileLink,
|
|
2515
2523
|
resolveWikiEmbed,
|
|
@@ -2527,6 +2535,7 @@ function MarkdownView({ markdown, markMode = "hide", frontmatter = false, intera
|
|
|
2527
2535
|
markdown,
|
|
2528
2536
|
frontmatter,
|
|
2529
2537
|
interactive,
|
|
2538
|
+
expandCollapsed,
|
|
2530
2539
|
resolveImageUrl,
|
|
2531
2540
|
resolveFileLink,
|
|
2532
2541
|
resolveWikiEmbed,
|
package/dist/style.css
CHANGED
|
@@ -783,9 +783,9 @@
|
|
|
783
783
|
}
|
|
784
784
|
.meow_Positioner_HMEwgW {
|
|
785
785
|
z-index: 50;
|
|
786
|
+
width: var(--positioner-width);
|
|
787
|
+
height: var(--positioner-height);
|
|
786
788
|
pointer-events: none;
|
|
787
|
-
max-width: calc(100vw - 1rem);
|
|
788
|
-
max-height: calc(100vh - 1rem);
|
|
789
789
|
transition-property: top, left, right, bottom, transform;
|
|
790
790
|
transition-duration: .35s;
|
|
791
791
|
transition-timing-function: cubic-bezier(.22, 1, .36, 1);
|
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.56.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"github-slugger": "^2.0.0",
|
|
32
32
|
"lucide-react": "^1.24.0",
|
|
33
33
|
"react-property": "^2.0.2",
|
|
34
|
-
"@meowdown/core": "0.
|
|
34
|
+
"@meowdown/core": "0.56.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"react": "^19.0.0",
|