notion-to-jsx 1.2.9 → 1.2.11
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 +86 -65
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +106 -28
- package/dist/index.d.ts +106 -28
- package/dist/index.js +180 -195
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +180 -195
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
interface OpenGraphData {
|
|
5
|
+
title: string;
|
|
6
|
+
description: string;
|
|
7
|
+
image: string;
|
|
8
|
+
siteName: string;
|
|
9
|
+
url: string;
|
|
10
|
+
favicon?: string;
|
|
11
|
+
}
|
|
2
12
|
|
|
3
13
|
interface RichTextItem {
|
|
4
14
|
type: 'text' | 'mention' | string;
|
|
@@ -26,40 +36,61 @@ interface RichTextItem {
|
|
|
26
36
|
};
|
|
27
37
|
}
|
|
28
38
|
|
|
29
|
-
interface
|
|
39
|
+
interface BaseNotionBlock {
|
|
30
40
|
object: 'block';
|
|
31
41
|
id: string;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
children?: NotionBlock[];
|
|
43
|
+
has_children?: boolean;
|
|
44
|
+
parent?: {
|
|
45
|
+
type: string;
|
|
46
|
+
[key: string]: any;
|
|
36
47
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
}
|
|
49
|
+
interface LinkPreviewBlock extends BaseNotionBlock {
|
|
50
|
+
type: 'link_preview';
|
|
51
|
+
link_preview: {
|
|
52
|
+
url: string;
|
|
40
53
|
};
|
|
41
|
-
|
|
54
|
+
}
|
|
55
|
+
interface ParagraphBlock extends BaseNotionBlock {
|
|
56
|
+
type: 'paragraph';
|
|
57
|
+
paragraph: {
|
|
42
58
|
rich_text: RichTextItem[];
|
|
43
59
|
color: string;
|
|
44
60
|
};
|
|
45
|
-
|
|
61
|
+
}
|
|
62
|
+
interface Heading1Block extends BaseNotionBlock {
|
|
63
|
+
type: 'heading_1';
|
|
64
|
+
heading_1: {
|
|
46
65
|
rich_text: RichTextItem[];
|
|
47
66
|
color: string;
|
|
48
67
|
};
|
|
49
|
-
|
|
68
|
+
}
|
|
69
|
+
interface Heading2Block extends BaseNotionBlock {
|
|
70
|
+
type: 'heading_2';
|
|
71
|
+
heading_2: {
|
|
50
72
|
rich_text: RichTextItem[];
|
|
51
73
|
color: string;
|
|
52
74
|
};
|
|
53
|
-
|
|
75
|
+
}
|
|
76
|
+
interface Heading3Block extends BaseNotionBlock {
|
|
77
|
+
type: 'heading_3';
|
|
78
|
+
heading_3: {
|
|
54
79
|
rich_text: RichTextItem[];
|
|
55
80
|
color: string;
|
|
56
81
|
};
|
|
57
|
-
|
|
82
|
+
}
|
|
83
|
+
interface CodeBlock extends BaseNotionBlock {
|
|
84
|
+
type: 'code';
|
|
85
|
+
code: {
|
|
58
86
|
rich_text: RichTextItem[];
|
|
59
87
|
language: string;
|
|
60
88
|
caption: RichTextItem[];
|
|
61
89
|
};
|
|
62
|
-
|
|
90
|
+
}
|
|
91
|
+
interface ImageBlock extends BaseNotionBlock {
|
|
92
|
+
type: 'image';
|
|
93
|
+
image: {
|
|
63
94
|
type: 'file' | 'external';
|
|
64
95
|
file?: {
|
|
65
96
|
url: string;
|
|
@@ -69,42 +100,89 @@ interface NotionBlock {
|
|
|
69
100
|
url: string;
|
|
70
101
|
};
|
|
71
102
|
caption: RichTextItem[];
|
|
103
|
+
format: {
|
|
104
|
+
block_width: number;
|
|
105
|
+
block_height: number;
|
|
106
|
+
block_aspect_ratio: number;
|
|
107
|
+
};
|
|
72
108
|
};
|
|
73
|
-
|
|
109
|
+
}
|
|
110
|
+
interface BookmarkBlock extends BaseNotionBlock {
|
|
111
|
+
type: 'bookmark';
|
|
112
|
+
bookmark: {
|
|
74
113
|
url: string;
|
|
75
114
|
caption: RichTextItem[];
|
|
115
|
+
metadata?: OpenGraphData;
|
|
76
116
|
};
|
|
77
|
-
|
|
117
|
+
}
|
|
118
|
+
interface TableBlock extends BaseNotionBlock {
|
|
119
|
+
type: 'table';
|
|
120
|
+
table: {
|
|
78
121
|
table_width: number;
|
|
79
122
|
has_column_header: boolean;
|
|
80
123
|
has_row_header: boolean;
|
|
81
124
|
};
|
|
82
|
-
|
|
125
|
+
children?: TableRowBlock[];
|
|
126
|
+
}
|
|
127
|
+
interface TableRowBlock extends BaseNotionBlock {
|
|
128
|
+
type: 'table_row';
|
|
129
|
+
table_row: {
|
|
83
130
|
cells: RichTextItem[][];
|
|
84
131
|
};
|
|
85
|
-
|
|
132
|
+
}
|
|
133
|
+
interface QuoteBlock extends BaseNotionBlock {
|
|
134
|
+
type: 'quote';
|
|
135
|
+
quote: {
|
|
86
136
|
rich_text: RichTextItem[];
|
|
87
137
|
color: string;
|
|
88
138
|
};
|
|
89
|
-
|
|
139
|
+
}
|
|
140
|
+
interface ToggleBlock extends BaseNotionBlock {
|
|
141
|
+
type: 'toggle';
|
|
142
|
+
toggle: {
|
|
90
143
|
rich_text: RichTextItem[];
|
|
91
144
|
color: string;
|
|
92
145
|
};
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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
|
+
};
|
|
98
176
|
};
|
|
99
177
|
}
|
|
178
|
+
type NotionBlock = LinkPreviewBlock | ParagraphBlock | Heading1Block | Heading2Block | Heading3Block | CodeBlock | ImageBlock | BookmarkBlock | TableBlock | TableRowBlock | QuoteBlock | ToggleBlock | BulletedListItemBlock | NumberedListItemBlock | ColumnListBlock | ColumnBlock | VideoBlock;
|
|
100
179
|
|
|
101
180
|
interface Props {
|
|
102
181
|
blocks: NotionBlock[];
|
|
103
182
|
title?: string;
|
|
104
183
|
cover?: string;
|
|
105
184
|
isDarkMode?: boolean;
|
|
106
|
-
onBlockFocus?: (index: number) => void;
|
|
107
185
|
}
|
|
108
|
-
declare const Renderer:
|
|
186
|
+
declare const Renderer: react.MemoExoticComponent<({ blocks, isDarkMode, title, cover }: Props) => react_jsx_runtime.JSX.Element>;
|
|
109
187
|
|
|
110
|
-
export { type NotionBlock, Renderer };
|
|
188
|
+
export { type BulletedListItemBlock, type ColumnBlock, type ColumnListBlock, type NotionBlock, type NumberedListItemBlock, Renderer, type TableBlock, type TableRowBlock, type ToggleBlock, type VideoBlock };
|