@nuucognition/ncm-ui 0.1.0-dev.1
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 +129 -0
- package/dist/blocks/admonition/index.d.ts +13 -0
- package/dist/blocks/admonition/index.js +1713 -0
- package/dist/blocks/aside/index.d.ts +13 -0
- package/dist/blocks/aside/index.js +1713 -0
- package/dist/blocks/attribution/index.d.ts +13 -0
- package/dist/blocks/attribution/index.js +32 -0
- package/dist/blocks/blockquote/index.d.ts +15 -0
- package/dist/blocks/blockquote/index.js +609 -0
- package/dist/blocks/chart/index.d.ts +14 -0
- package/dist/blocks/chart/index.js +29 -0
- package/dist/blocks/code/index.d.ts +15 -0
- package/dist/blocks/code/index.js +163 -0
- package/dist/blocks/container/index.d.ts +17 -0
- package/dist/blocks/container/index.js +633 -0
- package/dist/blocks/custom-code/index.d.ts +15 -0
- package/dist/blocks/custom-code/index.js +31 -0
- package/dist/blocks/dataview/index.d.ts +14 -0
- package/dist/blocks/dataview/index.js +29 -0
- package/dist/blocks/definition/index.d.ts +13 -0
- package/dist/blocks/definition/index.js +1713 -0
- package/dist/blocks/embed/index.d.ts +12 -0
- package/dist/blocks/embed/index.js +46 -0
- package/dist/blocks/embedding/index.d.ts +13 -0
- package/dist/blocks/embedding/index.js +763 -0
- package/dist/blocks/figure/index.d.ts +13 -0
- package/dist/blocks/figure/index.js +656 -0
- package/dist/blocks/footnote/index.d.ts +13 -0
- package/dist/blocks/footnote/index.js +1713 -0
- package/dist/blocks/frontmatter/index.d.ts +16 -0
- package/dist/blocks/frontmatter/index.js +38 -0
- package/dist/blocks/header/index.d.ts +9 -0
- package/dist/blocks/header/index.js +610 -0
- package/dist/blocks/horizontal-rule/index.d.ts +9 -0
- package/dist/blocks/horizontal-rule/index.js +19 -0
- package/dist/blocks/html/index.d.ts +31 -0
- package/dist/blocks/html/index.js +52 -0
- package/dist/blocks/index.d.ts +32 -0
- package/dist/blocks/index.js +1736 -0
- package/dist/blocks/latex/index.d.ts +9 -0
- package/dist/blocks/latex/index.js +107 -0
- package/dist/blocks/link/index.d.ts +14 -0
- package/dist/blocks/link/index.js +27 -0
- package/dist/blocks/list/index.d.ts +9 -0
- package/dist/blocks/list/index.js +675 -0
- package/dist/blocks/math/index.d.ts +13 -0
- package/dist/blocks/math/index.js +88 -0
- package/dist/blocks/mermaid/index.d.ts +14 -0
- package/dist/blocks/mermaid/index.js +29 -0
- package/dist/blocks/page-breaker/index.d.ts +16 -0
- package/dist/blocks/page-breaker/index.js +21 -0
- package/dist/blocks/paragraph/index.d.ts +9 -0
- package/dist/blocks/paragraph/index.js +608 -0
- package/dist/blocks/spoiler/index.d.ts +13 -0
- package/dist/blocks/spoiler/index.js +1713 -0
- package/dist/blocks/table/index.d.ts +9 -0
- package/dist/blocks/table/index.js +619 -0
- package/dist/blocks/task-list/index.d.ts +13 -0
- package/dist/blocks/task-list/index.js +670 -0
- package/dist/components/index.d.ts +599 -0
- package/dist/components/index.js +1840 -0
- package/dist/components/ncm-block.d.ts +28 -0
- package/dist/components/ncm-block.js +1712 -0
- package/dist/components/ncm-document.d.ts +48 -0
- package/dist/components/ncm-document.js +1839 -0
- package/dist/context/index.d.ts +7 -0
- package/dist/context/index.js +284 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +1731 -0
- package/dist/hooks/use-block-renderer.d.ts +28 -0
- package/dist/hooks/use-block-renderer.js +1731 -0
- package/dist/hooks/use-ncm-config.d.ts +6 -0
- package/dist/hooks/use-ncm-config.js +11 -0
- package/dist/index.d.ts +43 -0
- package/dist/index.js +1887 -0
- package/dist/inline/index.d.ts +108 -0
- package/dist/inline/index.js +598 -0
- package/dist/inline-DwUYUmk4.d.ts +75 -0
- package/dist/lib/defaults.d.ts +24 -0
- package/dist/lib/defaults.js +1713 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.js +10 -0
- package/dist/lib/katex.d.ts +3 -0
- package/dist/lib/katex.js +45 -0
- package/dist/lib/utils.d.ts +8 -0
- package/dist/lib/utils.js +10 -0
- package/dist/references-Bs5wJybr.d.ts +63 -0
- package/dist/renderers-C5f41FCy.d.ts +99 -0
- package/dist/styles/fonts/OpenDyslexic3-Bold.woff +0 -0
- package/dist/styles/fonts/OpenDyslexic3-Bold.woff2 +0 -0
- package/dist/styles/fonts/OpenDyslexic3-Regular.woff +0 -0
- package/dist/styles/fonts/OpenDyslexic3-Regular.woff2 +0 -0
- package/dist/styles/nuu.css +364 -0
- package/dist/styles/paper.css +332 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +2 -0
- package/dist/use-ncm-config-D0doMYTH.d.ts +114 -0
- package/package.json +99 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline token types for parsed markdown content
|
|
3
|
+
*/
|
|
4
|
+
type InlineToken = TextToken | BoldToken | ItalicToken | CodeToken | LinkToken | ImageToken | WikiLinkToken | WikiEmbedToken | LatexToken | StrikethroughToken | InlineRefToken;
|
|
5
|
+
interface TextToken {
|
|
6
|
+
type: "text";
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
interface BoldToken {
|
|
10
|
+
type: "bold";
|
|
11
|
+
children: InlineToken[];
|
|
12
|
+
}
|
|
13
|
+
interface ItalicToken {
|
|
14
|
+
type: "italic";
|
|
15
|
+
children: InlineToken[];
|
|
16
|
+
}
|
|
17
|
+
interface CodeToken {
|
|
18
|
+
type: "code";
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
interface LinkToken {
|
|
22
|
+
type: "link";
|
|
23
|
+
href: string;
|
|
24
|
+
title?: string;
|
|
25
|
+
children: InlineToken[];
|
|
26
|
+
}
|
|
27
|
+
interface ImageToken {
|
|
28
|
+
type: "image";
|
|
29
|
+
src: string;
|
|
30
|
+
alt: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
}
|
|
33
|
+
interface WikiLinkToken {
|
|
34
|
+
type: "wiki_link";
|
|
35
|
+
target: string;
|
|
36
|
+
display: string | null;
|
|
37
|
+
anchor: string | null;
|
|
38
|
+
}
|
|
39
|
+
interface WikiEmbedToken {
|
|
40
|
+
type: "wiki_embed";
|
|
41
|
+
target: string;
|
|
42
|
+
display: string | null;
|
|
43
|
+
anchor: string | null;
|
|
44
|
+
}
|
|
45
|
+
interface LatexToken {
|
|
46
|
+
type: "latex";
|
|
47
|
+
content: string;
|
|
48
|
+
}
|
|
49
|
+
interface StrikethroughToken {
|
|
50
|
+
type: "strikethrough";
|
|
51
|
+
children: InlineToken[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Inline reference token — Obsidian-style self-contained inline reference.
|
|
55
|
+
*
|
|
56
|
+
* Two kinds, counted independently when numbered across a document:
|
|
57
|
+
* - `ref` → bibliography / citation. Syntax: `^[ref: ...]`. Rendered as a
|
|
58
|
+
* baseline bracketed number `[1]`, `[2]`, …
|
|
59
|
+
* - `footnote` → footnote aside. Syntax: `^[footnote: ...]` (or a bare
|
|
60
|
+
* `^[...]` with no recognised prefix). Rendered as a superscript
|
|
61
|
+
* number `¹`, `²`, …
|
|
62
|
+
*
|
|
63
|
+
* Distinct from the `ncm` package's reference-style footnotes (`[^label]` +
|
|
64
|
+
* `[^label]: …`): the content here lives inside the marker itself.
|
|
65
|
+
*
|
|
66
|
+
* `content` is the raw inner text after the kind prefix and may itself contain
|
|
67
|
+
* inline markdown (links, bold, etc.) — it is re-parsed when the popover renders.
|
|
68
|
+
*/
|
|
69
|
+
interface InlineRefToken {
|
|
70
|
+
type: "inline_ref";
|
|
71
|
+
kind: "ref" | "footnote";
|
|
72
|
+
content: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type { BoldToken as B, CodeToken as C, ImageToken as I, LatexToken as L, StrikethroughToken as S, TextToken as T, WikiEmbedToken as W, InlineRefToken as a, InlineToken as b, ItalicToken as c, LinkToken as d, WikiLinkToken as e };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { Block } from '@nuucognition/ncm';
|
|
3
|
+
import { C as CompleteBlockRendererRegistry, a as BlockRendererProps } from '../renderers-C5f41FCy.js';
|
|
4
|
+
|
|
5
|
+
declare function FallbackBlock({ block, className }: BlockRendererProps<Block>): react.DetailedReactHTMLElement<{
|
|
6
|
+
"data-ncm-block": string;
|
|
7
|
+
"data-ncm-stable": string | undefined;
|
|
8
|
+
"data-ncm-type": "blockquote" | "code" | "container" | "custom_code" | "embed" | "embedding" | "frontmatter" | "header" | "horizontal_rule" | "html" | "latex_display" | "list_unordered" | "list_ordered" | "paragraph" | "table" | "page_breaker" | "link" | "figure" | "admonition" | "footnote" | "task_list" | "definition" | "spoiler" | "aside" | "attribution" | "mermaid" | "dataview" | "math" | "chart";
|
|
9
|
+
"data-block-id": string;
|
|
10
|
+
"data-ncm-fallback": string;
|
|
11
|
+
className: string;
|
|
12
|
+
}, HTMLElement>;
|
|
13
|
+
/**
|
|
14
|
+
* Default block renderers for every NCM block type.
|
|
15
|
+
*
|
|
16
|
+
* Typed as {@link CompleteBlockRendererRegistry}: this object must provide a
|
|
17
|
+
* renderer for every `block.type` the parser can emit (the `custom_code`
|
|
18
|
+
* sub-registry is language-keyed and ships empty). If the parser gains a new
|
|
19
|
+
* block type, this assignment fails to typecheck until a renderer is added —
|
|
20
|
+
* that is the guard keeping the block→UI mapping 1:1.
|
|
21
|
+
*/
|
|
22
|
+
declare const defaultRenderers: CompleteBlockRendererRegistry;
|
|
23
|
+
|
|
24
|
+
export { FallbackBlock, defaultRenderers };
|