notion-to-jsx 0.0.0 → 0.3.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.css +588 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.mts +88 -0
- package/dist/index.d.ts +88 -0
- package/dist/index.js +777 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +740 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +43 -5
- package/.turbo/turbo-test.log +0 -7
- package/tsconfig.json +0 -8
- package/tsconfig.lint.json +0 -8
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface RichTextItem {
|
|
4
|
+
type: 'text';
|
|
5
|
+
text: {
|
|
6
|
+
content: string;
|
|
7
|
+
link: string | null;
|
|
8
|
+
};
|
|
9
|
+
content: string;
|
|
10
|
+
link: string | null;
|
|
11
|
+
annotations: {
|
|
12
|
+
bold: boolean;
|
|
13
|
+
italic: boolean;
|
|
14
|
+
strikethrough: boolean;
|
|
15
|
+
underline: boolean;
|
|
16
|
+
code: boolean;
|
|
17
|
+
color: string;
|
|
18
|
+
};
|
|
19
|
+
bold: boolean;
|
|
20
|
+
italic: boolean;
|
|
21
|
+
strikethrough: boolean;
|
|
22
|
+
underline: boolean;
|
|
23
|
+
code: boolean;
|
|
24
|
+
color: string;
|
|
25
|
+
plain_text: string;
|
|
26
|
+
href: string | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface NotionBlock {
|
|
30
|
+
object: 'block';
|
|
31
|
+
id: string;
|
|
32
|
+
type: 'paragraph' | 'heading_1' | 'heading_2' | 'heading_3' | 'bulleted_list_item' | 'numbered_list_item' | 'code' | 'image' | 'bookmark';
|
|
33
|
+
paragraph?: {
|
|
34
|
+
rich_text: RichTextItem[];
|
|
35
|
+
color: string;
|
|
36
|
+
};
|
|
37
|
+
heading_1?: {
|
|
38
|
+
rich_text: RichTextItem[];
|
|
39
|
+
color: string;
|
|
40
|
+
};
|
|
41
|
+
heading_2?: {
|
|
42
|
+
rich_text: RichTextItem[];
|
|
43
|
+
color: string;
|
|
44
|
+
};
|
|
45
|
+
heading_3?: {
|
|
46
|
+
rich_text: RichTextItem[];
|
|
47
|
+
color: string;
|
|
48
|
+
};
|
|
49
|
+
bulleted_list_item?: {
|
|
50
|
+
rich_text: RichTextItem[];
|
|
51
|
+
color: string;
|
|
52
|
+
};
|
|
53
|
+
numbered_list_item?: {
|
|
54
|
+
rich_text: RichTextItem[];
|
|
55
|
+
color: string;
|
|
56
|
+
};
|
|
57
|
+
code?: {
|
|
58
|
+
rich_text: RichTextItem[];
|
|
59
|
+
language: string;
|
|
60
|
+
caption: RichTextItem[];
|
|
61
|
+
};
|
|
62
|
+
image?: {
|
|
63
|
+
type: 'file' | 'external';
|
|
64
|
+
file?: {
|
|
65
|
+
url: string;
|
|
66
|
+
expiry_time: string;
|
|
67
|
+
};
|
|
68
|
+
external?: {
|
|
69
|
+
url: string;
|
|
70
|
+
};
|
|
71
|
+
caption: RichTextItem[];
|
|
72
|
+
};
|
|
73
|
+
bookmark?: {
|
|
74
|
+
url: string;
|
|
75
|
+
caption: RichTextItem[];
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface Props {
|
|
80
|
+
blocks: NotionBlock[];
|
|
81
|
+
title?: string;
|
|
82
|
+
cover?: string;
|
|
83
|
+
isDarkMode?: boolean;
|
|
84
|
+
onBlockFocus?: (index: number) => void;
|
|
85
|
+
}
|
|
86
|
+
declare const Renderer: React.FC<Props>;
|
|
87
|
+
|
|
88
|
+
export { type NotionBlock, Renderer };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface RichTextItem {
|
|
4
|
+
type: 'text';
|
|
5
|
+
text: {
|
|
6
|
+
content: string;
|
|
7
|
+
link: string | null;
|
|
8
|
+
};
|
|
9
|
+
content: string;
|
|
10
|
+
link: string | null;
|
|
11
|
+
annotations: {
|
|
12
|
+
bold: boolean;
|
|
13
|
+
italic: boolean;
|
|
14
|
+
strikethrough: boolean;
|
|
15
|
+
underline: boolean;
|
|
16
|
+
code: boolean;
|
|
17
|
+
color: string;
|
|
18
|
+
};
|
|
19
|
+
bold: boolean;
|
|
20
|
+
italic: boolean;
|
|
21
|
+
strikethrough: boolean;
|
|
22
|
+
underline: boolean;
|
|
23
|
+
code: boolean;
|
|
24
|
+
color: string;
|
|
25
|
+
plain_text: string;
|
|
26
|
+
href: string | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface NotionBlock {
|
|
30
|
+
object: 'block';
|
|
31
|
+
id: string;
|
|
32
|
+
type: 'paragraph' | 'heading_1' | 'heading_2' | 'heading_3' | 'bulleted_list_item' | 'numbered_list_item' | 'code' | 'image' | 'bookmark';
|
|
33
|
+
paragraph?: {
|
|
34
|
+
rich_text: RichTextItem[];
|
|
35
|
+
color: string;
|
|
36
|
+
};
|
|
37
|
+
heading_1?: {
|
|
38
|
+
rich_text: RichTextItem[];
|
|
39
|
+
color: string;
|
|
40
|
+
};
|
|
41
|
+
heading_2?: {
|
|
42
|
+
rich_text: RichTextItem[];
|
|
43
|
+
color: string;
|
|
44
|
+
};
|
|
45
|
+
heading_3?: {
|
|
46
|
+
rich_text: RichTextItem[];
|
|
47
|
+
color: string;
|
|
48
|
+
};
|
|
49
|
+
bulleted_list_item?: {
|
|
50
|
+
rich_text: RichTextItem[];
|
|
51
|
+
color: string;
|
|
52
|
+
};
|
|
53
|
+
numbered_list_item?: {
|
|
54
|
+
rich_text: RichTextItem[];
|
|
55
|
+
color: string;
|
|
56
|
+
};
|
|
57
|
+
code?: {
|
|
58
|
+
rich_text: RichTextItem[];
|
|
59
|
+
language: string;
|
|
60
|
+
caption: RichTextItem[];
|
|
61
|
+
};
|
|
62
|
+
image?: {
|
|
63
|
+
type: 'file' | 'external';
|
|
64
|
+
file?: {
|
|
65
|
+
url: string;
|
|
66
|
+
expiry_time: string;
|
|
67
|
+
};
|
|
68
|
+
external?: {
|
|
69
|
+
url: string;
|
|
70
|
+
};
|
|
71
|
+
caption: RichTextItem[];
|
|
72
|
+
};
|
|
73
|
+
bookmark?: {
|
|
74
|
+
url: string;
|
|
75
|
+
caption: RichTextItem[];
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
interface Props {
|
|
80
|
+
blocks: NotionBlock[];
|
|
81
|
+
title?: string;
|
|
82
|
+
cover?: string;
|
|
83
|
+
isDarkMode?: boolean;
|
|
84
|
+
onBlockFocus?: (index: number) => void;
|
|
85
|
+
}
|
|
86
|
+
declare const Renderer: React.FC<Props>;
|
|
87
|
+
|
|
88
|
+
export { type NotionBlock, Renderer };
|