notion-to-jsx 1.3.1 → 2.0.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.mts +3 -177
- package/dist/index.d.ts +3 -177
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,181 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
title: string;
|
|
6
|
-
description: string;
|
|
7
|
-
image: string;
|
|
8
|
-
siteName: string;
|
|
9
|
-
url: string;
|
|
10
|
-
favicon?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface RichTextItem {
|
|
14
|
-
type: 'text' | 'mention' | string;
|
|
15
|
-
annotations: {
|
|
16
|
-
bold: boolean;
|
|
17
|
-
italic: boolean;
|
|
18
|
-
strikethrough: boolean;
|
|
19
|
-
underline: boolean;
|
|
20
|
-
code: boolean;
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
bold: boolean;
|
|
24
|
-
italic: boolean;
|
|
25
|
-
strikethrough: boolean;
|
|
26
|
-
underline: boolean;
|
|
27
|
-
code: boolean;
|
|
28
|
-
color: string;
|
|
29
|
-
plain_text: string;
|
|
30
|
-
href: string | null;
|
|
31
|
-
text?: {
|
|
32
|
-
content: string;
|
|
33
|
-
link: {
|
|
34
|
-
url: string | null;
|
|
35
|
-
} | null;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface BaseNotionBlock {
|
|
40
|
-
object: 'block';
|
|
41
|
-
id: string;
|
|
42
|
-
children?: NotionBlock[];
|
|
43
|
-
has_children?: boolean;
|
|
44
|
-
parent?: {
|
|
45
|
-
type: string;
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
interface LinkPreviewBlock extends BaseNotionBlock {
|
|
50
|
-
type: 'link_preview';
|
|
51
|
-
link_preview: {
|
|
52
|
-
url: string;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
interface ParagraphBlock extends BaseNotionBlock {
|
|
56
|
-
type: 'paragraph';
|
|
57
|
-
paragraph: {
|
|
58
|
-
rich_text: RichTextItem[];
|
|
59
|
-
color: string;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
interface Heading1Block extends BaseNotionBlock {
|
|
63
|
-
type: 'heading_1';
|
|
64
|
-
heading_1: {
|
|
65
|
-
rich_text: RichTextItem[];
|
|
66
|
-
color: string;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
interface Heading2Block extends BaseNotionBlock {
|
|
70
|
-
type: 'heading_2';
|
|
71
|
-
heading_2: {
|
|
72
|
-
rich_text: RichTextItem[];
|
|
73
|
-
color: string;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
interface Heading3Block extends BaseNotionBlock {
|
|
77
|
-
type: 'heading_3';
|
|
78
|
-
heading_3: {
|
|
79
|
-
rich_text: RichTextItem[];
|
|
80
|
-
color: string;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
interface CodeBlock extends BaseNotionBlock {
|
|
84
|
-
type: 'code';
|
|
85
|
-
code: {
|
|
86
|
-
rich_text: RichTextItem[];
|
|
87
|
-
language: string;
|
|
88
|
-
caption: RichTextItem[];
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
interface ImageBlock extends BaseNotionBlock {
|
|
92
|
-
type: 'image';
|
|
93
|
-
image: {
|
|
94
|
-
type: 'file' | 'external';
|
|
95
|
-
file?: {
|
|
96
|
-
url: string;
|
|
97
|
-
expiry_time: string;
|
|
98
|
-
};
|
|
99
|
-
external?: {
|
|
100
|
-
url: string;
|
|
101
|
-
};
|
|
102
|
-
caption: RichTextItem[];
|
|
103
|
-
format: {
|
|
104
|
-
block_width: number;
|
|
105
|
-
block_height: number;
|
|
106
|
-
block_aspect_ratio: number;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
interface BookmarkBlock extends BaseNotionBlock {
|
|
111
|
-
type: 'bookmark';
|
|
112
|
-
bookmark: {
|
|
113
|
-
url: string;
|
|
114
|
-
caption: RichTextItem[];
|
|
115
|
-
metadata?: OpenGraphData;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
interface TableBlock extends BaseNotionBlock {
|
|
119
|
-
type: 'table';
|
|
120
|
-
table: {
|
|
121
|
-
table_width: number;
|
|
122
|
-
has_column_header: boolean;
|
|
123
|
-
has_row_header: boolean;
|
|
124
|
-
};
|
|
125
|
-
children?: TableRowBlock[];
|
|
126
|
-
}
|
|
127
|
-
interface TableRowBlock extends BaseNotionBlock {
|
|
128
|
-
type: 'table_row';
|
|
129
|
-
table_row: {
|
|
130
|
-
cells: RichTextItem[][];
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
interface QuoteBlock extends BaseNotionBlock {
|
|
134
|
-
type: 'quote';
|
|
135
|
-
quote: {
|
|
136
|
-
rich_text: RichTextItem[];
|
|
137
|
-
color: string;
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
interface ToggleBlock extends BaseNotionBlock {
|
|
141
|
-
type: 'toggle';
|
|
142
|
-
toggle: {
|
|
143
|
-
rich_text: RichTextItem[];
|
|
144
|
-
color: string;
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
interface BulletedListItemBlock extends BaseNotionBlock {
|
|
148
|
-
type: 'bulleted_list_item';
|
|
149
|
-
bulleted_list_item: {
|
|
150
|
-
rich_text: RichTextItem[];
|
|
151
|
-
color: string;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
interface NumberedListItemBlock extends BaseNotionBlock {
|
|
155
|
-
type: 'numbered_list_item';
|
|
156
|
-
numbered_list_item: {
|
|
157
|
-
rich_text: RichTextItem[];
|
|
158
|
-
color: string;
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
interface ColumnListBlock extends BaseNotionBlock {
|
|
162
|
-
type: 'column_list';
|
|
163
|
-
children?: ColumnBlock[];
|
|
164
|
-
}
|
|
165
|
-
interface ColumnBlock extends BaseNotionBlock {
|
|
166
|
-
type: 'column';
|
|
167
|
-
}
|
|
168
|
-
interface VideoBlock extends BaseNotionBlock {
|
|
169
|
-
type: 'video';
|
|
170
|
-
video: {
|
|
171
|
-
caption: RichTextItem[];
|
|
172
|
-
type: 'external' | 'file';
|
|
173
|
-
external?: {
|
|
174
|
-
url: string;
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
type NotionBlock = LinkPreviewBlock | ParagraphBlock | Heading1Block | Heading2Block | Heading3Block | CodeBlock | ImageBlock | BookmarkBlock | TableBlock | TableRowBlock | QuoteBlock | ToggleBlock | BulletedListItemBlock | NumberedListItemBlock | ColumnListBlock | ColumnBlock | VideoBlock;
|
|
3
|
+
import { NotionBlock } from 'notion-types';
|
|
4
|
+
export { BookmarkBlock, BulletedListItemBlock, CodeBlock, ColumnBlock, ColumnListBlock, Heading1Block, Heading2Block, Heading3Block, ImageBlock, ImageFormatMetadata, LinkPreviewBlock, NotionBlock, NumberedListItemBlock, OpenGraphData, ParagraphBlock, QuoteBlock, RichTextItem, TableBlock, TableRowBlock, ToggleBlock, VideoBlock } from 'notion-types';
|
|
179
5
|
|
|
180
6
|
interface Props {
|
|
181
7
|
blocks: NotionBlock[];
|
|
@@ -185,4 +11,4 @@ interface Props {
|
|
|
185
11
|
}
|
|
186
12
|
declare const Renderer: react.MemoExoticComponent<({ blocks, isDarkMode, title, cover }: Props) => react_jsx_runtime.JSX.Element>;
|
|
187
13
|
|
|
188
|
-
export {
|
|
14
|
+
export { Renderer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,181 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
title: string;
|
|
6
|
-
description: string;
|
|
7
|
-
image: string;
|
|
8
|
-
siteName: string;
|
|
9
|
-
url: string;
|
|
10
|
-
favicon?: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface RichTextItem {
|
|
14
|
-
type: 'text' | 'mention' | string;
|
|
15
|
-
annotations: {
|
|
16
|
-
bold: boolean;
|
|
17
|
-
italic: boolean;
|
|
18
|
-
strikethrough: boolean;
|
|
19
|
-
underline: boolean;
|
|
20
|
-
code: boolean;
|
|
21
|
-
color: string;
|
|
22
|
-
};
|
|
23
|
-
bold: boolean;
|
|
24
|
-
italic: boolean;
|
|
25
|
-
strikethrough: boolean;
|
|
26
|
-
underline: boolean;
|
|
27
|
-
code: boolean;
|
|
28
|
-
color: string;
|
|
29
|
-
plain_text: string;
|
|
30
|
-
href: string | null;
|
|
31
|
-
text?: {
|
|
32
|
-
content: string;
|
|
33
|
-
link: {
|
|
34
|
-
url: string | null;
|
|
35
|
-
} | null;
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
interface BaseNotionBlock {
|
|
40
|
-
object: 'block';
|
|
41
|
-
id: string;
|
|
42
|
-
children?: NotionBlock[];
|
|
43
|
-
has_children?: boolean;
|
|
44
|
-
parent?: {
|
|
45
|
-
type: string;
|
|
46
|
-
[key: string]: any;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
interface LinkPreviewBlock extends BaseNotionBlock {
|
|
50
|
-
type: 'link_preview';
|
|
51
|
-
link_preview: {
|
|
52
|
-
url: string;
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
interface ParagraphBlock extends BaseNotionBlock {
|
|
56
|
-
type: 'paragraph';
|
|
57
|
-
paragraph: {
|
|
58
|
-
rich_text: RichTextItem[];
|
|
59
|
-
color: string;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
interface Heading1Block extends BaseNotionBlock {
|
|
63
|
-
type: 'heading_1';
|
|
64
|
-
heading_1: {
|
|
65
|
-
rich_text: RichTextItem[];
|
|
66
|
-
color: string;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
interface Heading2Block extends BaseNotionBlock {
|
|
70
|
-
type: 'heading_2';
|
|
71
|
-
heading_2: {
|
|
72
|
-
rich_text: RichTextItem[];
|
|
73
|
-
color: string;
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
interface Heading3Block extends BaseNotionBlock {
|
|
77
|
-
type: 'heading_3';
|
|
78
|
-
heading_3: {
|
|
79
|
-
rich_text: RichTextItem[];
|
|
80
|
-
color: string;
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
interface CodeBlock extends BaseNotionBlock {
|
|
84
|
-
type: 'code';
|
|
85
|
-
code: {
|
|
86
|
-
rich_text: RichTextItem[];
|
|
87
|
-
language: string;
|
|
88
|
-
caption: RichTextItem[];
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
interface ImageBlock extends BaseNotionBlock {
|
|
92
|
-
type: 'image';
|
|
93
|
-
image: {
|
|
94
|
-
type: 'file' | 'external';
|
|
95
|
-
file?: {
|
|
96
|
-
url: string;
|
|
97
|
-
expiry_time: string;
|
|
98
|
-
};
|
|
99
|
-
external?: {
|
|
100
|
-
url: string;
|
|
101
|
-
};
|
|
102
|
-
caption: RichTextItem[];
|
|
103
|
-
format: {
|
|
104
|
-
block_width: number;
|
|
105
|
-
block_height: number;
|
|
106
|
-
block_aspect_ratio: number;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
interface BookmarkBlock extends BaseNotionBlock {
|
|
111
|
-
type: 'bookmark';
|
|
112
|
-
bookmark: {
|
|
113
|
-
url: string;
|
|
114
|
-
caption: RichTextItem[];
|
|
115
|
-
metadata?: OpenGraphData;
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
interface TableBlock extends BaseNotionBlock {
|
|
119
|
-
type: 'table';
|
|
120
|
-
table: {
|
|
121
|
-
table_width: number;
|
|
122
|
-
has_column_header: boolean;
|
|
123
|
-
has_row_header: boolean;
|
|
124
|
-
};
|
|
125
|
-
children?: TableRowBlock[];
|
|
126
|
-
}
|
|
127
|
-
interface TableRowBlock extends BaseNotionBlock {
|
|
128
|
-
type: 'table_row';
|
|
129
|
-
table_row: {
|
|
130
|
-
cells: RichTextItem[][];
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
interface QuoteBlock extends BaseNotionBlock {
|
|
134
|
-
type: 'quote';
|
|
135
|
-
quote: {
|
|
136
|
-
rich_text: RichTextItem[];
|
|
137
|
-
color: string;
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
interface ToggleBlock extends BaseNotionBlock {
|
|
141
|
-
type: 'toggle';
|
|
142
|
-
toggle: {
|
|
143
|
-
rich_text: RichTextItem[];
|
|
144
|
-
color: string;
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
interface BulletedListItemBlock extends BaseNotionBlock {
|
|
148
|
-
type: 'bulleted_list_item';
|
|
149
|
-
bulleted_list_item: {
|
|
150
|
-
rich_text: RichTextItem[];
|
|
151
|
-
color: string;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
interface NumberedListItemBlock extends BaseNotionBlock {
|
|
155
|
-
type: 'numbered_list_item';
|
|
156
|
-
numbered_list_item: {
|
|
157
|
-
rich_text: RichTextItem[];
|
|
158
|
-
color: string;
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
interface ColumnListBlock extends BaseNotionBlock {
|
|
162
|
-
type: 'column_list';
|
|
163
|
-
children?: ColumnBlock[];
|
|
164
|
-
}
|
|
165
|
-
interface ColumnBlock extends BaseNotionBlock {
|
|
166
|
-
type: 'column';
|
|
167
|
-
}
|
|
168
|
-
interface VideoBlock extends BaseNotionBlock {
|
|
169
|
-
type: 'video';
|
|
170
|
-
video: {
|
|
171
|
-
caption: RichTextItem[];
|
|
172
|
-
type: 'external' | 'file';
|
|
173
|
-
external?: {
|
|
174
|
-
url: string;
|
|
175
|
-
};
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
type NotionBlock = LinkPreviewBlock | ParagraphBlock | Heading1Block | Heading2Block | Heading3Block | CodeBlock | ImageBlock | BookmarkBlock | TableBlock | TableRowBlock | QuoteBlock | ToggleBlock | BulletedListItemBlock | NumberedListItemBlock | ColumnListBlock | ColumnBlock | VideoBlock;
|
|
3
|
+
import { NotionBlock } from 'notion-types';
|
|
4
|
+
export { BookmarkBlock, BulletedListItemBlock, CodeBlock, ColumnBlock, ColumnListBlock, Heading1Block, Heading2Block, Heading3Block, ImageBlock, ImageFormatMetadata, LinkPreviewBlock, NotionBlock, NumberedListItemBlock, OpenGraphData, ParagraphBlock, QuoteBlock, RichTextItem, TableBlock, TableRowBlock, ToggleBlock, VideoBlock } from 'notion-types';
|
|
179
5
|
|
|
180
6
|
interface Props {
|
|
181
7
|
blocks: NotionBlock[];
|
|
@@ -185,4 +11,4 @@ interface Props {
|
|
|
185
11
|
}
|
|
186
12
|
declare const Renderer: react.MemoExoticComponent<({ blocks, isDarkMode, title, cover }: Props) => react_jsx_runtime.JSX.Element>;
|
|
187
13
|
|
|
188
|
-
export {
|
|
14
|
+
export { Renderer };
|