Skip to content

Commit d6d6a60

Browse files
committed
docs: update docs to be accurate
1 parent e4aa122 commit d6d6a60

5 files changed

Lines changed: 104 additions & 43 deletions

File tree

docs/content/docs/features/blocks/code-blocks.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type CodeBlock = {
6565
type: "codeBlock";
6666
props: {
6767
language: string;
68-
} & DefaultProps;
68+
};
6969
content: InlineContent[];
7070
children: Block[];
7171
};

docs/content/docs/features/blocks/embeds.mdx

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,23 @@ type FileBlock = {
1616
id: string;
1717
type: "file";
1818
props: {
19-
name: string = "";
20-
url: string = "";
21-
caption: string = "";
22-
} & DefaultProps;
19+
backgroundColor: string;
20+
name: string;
21+
url: string;
22+
caption: string;
23+
};
2324
content: undefined;
2425
children: Block[];
2526
};
2627
```
2728

28-
`name:` The file name.
29+
`backgroundColor:` The background color of the block. Defaults to `"default"`.
2930

30-
`url:` The file URL.
31+
`name:` The file name. Defaults to `""`.
3132

32-
`caption:` The file caption.
33+
`url:` The file URL. Defaults to `""`.
34+
35+
`caption:` The file caption. Defaults to `""`.
3336

3437
## Image
3538

@@ -50,22 +53,32 @@ type ImageBlock = {
5053
id: string;
5154
type: "image";
5255
props: {
53-
url: string = "";
54-
caption: string = "";
55-
previewWidth: number = 512;
56-
} & DefaultProps;
56+
backgroundColor: string;
57+
textAlignment: "left" | "center" | "right" | "justify";
58+
name: string;
59+
url: string;
60+
caption: string;
61+
showPreview: boolean;
62+
previewWidth: number | undefined;
63+
};
5764
content: undefined;
5865
children: Block[];
5966
};
6067
```
6168

62-
`name:` The image name.
69+
`backgroundColor:` The background color of the block. Defaults to `"default"`.
70+
71+
`textAlignment:` The alignment of the image. Defaults to `"left"`.
72+
73+
`name:` The image file name. Defaults to `""`.
6374

64-
`url:` The image URL.
75+
`url:` The image URL. Defaults to `""`.
6576

66-
`caption:` The image caption.
77+
`caption:` The image caption. Defaults to `""`.
6778

68-
`previewWidth:` The image previewWidth in pixels.
79+
`showPreview:` Whether to show the image preview or a link. Defaults to `true`.
80+
81+
`previewWidth:` The image preview width in pixels. Defaults to `undefined` (no fixed width).
6982

7083
## Video
7184

@@ -86,26 +99,32 @@ type VideoBlock = {
8699
id: string;
87100
type: "video";
88101
props: {
89-
name: string = "";
90-
url: string = "";
91-
caption: string = "";
92-
showPreview: boolean = true;
102+
backgroundColor: string;
103+
textAlignment: "left" | "center" | "right" | "justify";
104+
name: string;
105+
url: string;
106+
caption: string;
107+
showPreview: boolean;
93108
previewWidth: number | undefined;
94-
} & DefaultProps;
109+
};
95110
content: undefined;
96111
children: Block[];
97112
};
98113
```
99114

100-
`name:` The video name.
115+
`backgroundColor:` The background color of the block. Defaults to `"default"`.
116+
117+
`textAlignment:` The alignment of the video. Defaults to `"left"`.
101118

102-
`url:` The video URL.
119+
`name:` The video file name. Defaults to `""`.
103120

104-
`caption:` The video caption.
121+
`url:` The video URL. Defaults to `""`.
105122

106-
`showPreview:` Whether to show the video preview.
123+
`caption:` The video caption. Defaults to `""`.
107124

108-
`previewWidth:` The video preview width in pixels.
125+
`showPreview:` Whether to show the video player or a link. Defaults to `true`.
126+
127+
`previewWidth:` The video preview width in pixels. Defaults to `undefined` (no fixed width).
109128

110129
## Audio
111130

@@ -126,20 +145,23 @@ type AudioBlock = {
126145
id: string;
127146
type: "audio";
128147
props: {
129-
name: string = "";
130-
url: string = "";
131-
caption: string = "";
132-
showPreview: boolean = true;
133-
} & DefaultProps;
148+
backgroundColor: string;
149+
name: string;
150+
url: string;
151+
caption: string;
152+
showPreview: boolean;
153+
};
134154
content: undefined;
135155
children: Block[];
136156
};
137157
```
138158

139-
`name:` The audio name.
159+
`backgroundColor:` The background color of the block. Defaults to `"default"`.
160+
161+
`name:` The audio file name. Defaults to `""`.
140162

141-
`url:` The audio URL.
163+
`url:` The audio URL. Defaults to `""`.
142164

143-
`caption:` The audio caption.
165+
`caption:` The audio caption. Defaults to `""`.
144166

145-
`showPreview:` Whether to show the audio preview.
167+
`showPreview:` Whether to show the audio player or a link. Defaults to `true`.

docs/content/docs/features/blocks/inline-content.mdx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Styles = {
2222
italic: boolean;
2323
underline: boolean;
2424
strike: boolean;
25+
code: boolean;
2526
textColor: string;
2627
backgroundColor: string;
2728
};
@@ -50,6 +51,7 @@ type Styles = {
5051
italic: boolean;
5152
underline: boolean;
5253
strike: boolean;
54+
code: boolean;
5355
textColor: string;
5456
backgroundColor: string;
5557
};
@@ -103,15 +105,20 @@ type Styles = {
103105
* @default false
104106
*/
105107
strike: boolean;
108+
/**
109+
* Whether the text is rendered as inline code.
110+
* @default false
111+
*/
112+
code: boolean;
106113
/**
107114
* The text color.
108115
* @default "default"
109116
*/
110117
textColor: string;
111118
/**
112-
* Whether the text is code.
113-
* @default false
119+
* The background color of the text.
120+
* @default "default"
114121
*/
115-
code: boolean;
122+
backgroundColor: string;
116123
};
117124
```

docs/content/docs/features/blocks/tables.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ This describes the shape of a table block in BlockNote.
4242
type TableBlock = {
4343
id: string;
4444
type: "table";
45-
props: DefaultProps;
45+
props: {
46+
textColor: string;
47+
};
4648
content: TableContent;
4749
children: Block[];
4850
};
@@ -61,11 +63,13 @@ type TableCell = {
6163
props: {
6264
colspan?: number;
6365
rowspan?: number;
64-
} & DefaultProps;
66+
};
6567
content: InlineContent[];
6668
};
6769
```
6870

71+
`textColor:` The text color of the table block. Defaults to `"default"`.
72+
6973
## Options
7074

7175
### Cell background color

docs/content/docs/features/blocks/typography.mdx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type HeadingBlockOptions = Partial<{
3535

3636
`defaultLevel:` The default level for headings which are created/inserted without a set level, which is `1` by default.
3737

38-
`levels:` The heading levels that the block supports, or '1'-'6' by default.
38+
`levels:` The heading levels that the block supports, which is `[1, 2, 3, 4, 5, 6]` by default.
3939

4040
`allowToggleHeadings:` Whether toggle headings should be supported, `true` by default. Toggle headings have a button which toggles between hiding and showing the block's children.
4141

@@ -47,13 +47,16 @@ type HeadingBlock = {
4747
type: "heading";
4848
props: {
4949
level: 1 | 2 | 3 | 4 | 5 | 6 = 1;
50+
isToggleable?: boolean;
5051
} & DefaultProps;
5152
content: InlineContent[];
5253
children: Block[];
5354
};
5455
```
5556

56-
`level:` The heading level, representing a title (`level: 1`), heading (`level: 2`), and subheadings (`level: 3`, `level: 4`, `level: 5`, `level: 6`).
57+
`level:` The heading level, representing a title (`level: 1`), heading (`level: 2`), and subheadings (`level: 3`, `level: 4`, `level: 5`, `level: 6`). Defaults to `1`.
58+
59+
`isToggleable:` Whether the heading is toggled (children hidden). Only present when `allowToggleHeadings` is `true` (the default). Defaults to `false`.
5760

5861
## Quote
5962

@@ -63,8 +66,33 @@ type HeadingBlock = {
6366
type QuoteBlock = {
6467
id: string;
6568
type: "quote";
66-
props: DefaultProps;
69+
props: {
70+
backgroundColor: string;
71+
textColor: string;
72+
};
6773
content: InlineContent[];
6874
children: Block[];
6975
};
7076
```
77+
78+
`backgroundColor:` The background color of the block. Defaults to `"default"`.
79+
80+
`textColor:` The text color of the block. Defaults to `"default"`.
81+
82+
## Divider
83+
84+
A horizontal rule used to separate content.
85+
86+
**Type & Props**
87+
88+
```typescript
89+
type DividerBlock = {
90+
id: string;
91+
type: "divider";
92+
props: {};
93+
content: undefined;
94+
children: Block[];
95+
};
96+
```
97+
98+
The divider block has no props and no content. It can be inserted by typing `---` on an empty line.

0 commit comments

Comments
 (0)