Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ type BodyBlock =
| Recommended
| RecommendedList
| Tweet
| Audio
| Video
| YoutubeVideo
| Text
Expand Down Expand Up @@ -562,6 +563,17 @@ interface BigNumber extends Node {

**BigNumber** represents a big number.

### `Audio`

```ts
interface Audio extends Node {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Similarly to my PRs we should start documenting the fields with their purpose

type: "audio"
src: string
title: string
Copy link
Contributor

@umbobabo umbobabo Dec 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Move this before src. In other components the title is always the first field for clarity

}
```
**Audio** represents an audio clip.

### `Video`

```ts
Expand Down
28 changes: 24 additions & 4 deletions content-tree.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export declare namespace ContentTree {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | ImagePair;
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Audio | Video | YoutubeVideo | Text | ImagePair;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
type Phrasing = Text | Break | Strong | Emphasis | Strikethrough | Link;
interface Node {
Expand Down Expand Up @@ -173,6 +173,11 @@ export declare namespace ContentTree {
number: string;
description: string;
}
interface Audio extends Node {
type: "audio";
src: string;
title: string;
}
interface Video extends Node {
type: "video";
id: string;
Expand Down Expand Up @@ -290,7 +295,7 @@ export declare namespace ContentTree {
children: [ImageSet, ImageSet];
}
namespace full {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | ImagePair;
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Audio | Video | YoutubeVideo | Text | ImagePair;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
type Phrasing = Text | Break | Strong | Emphasis | Strikethrough | Link;
interface Node {
Expand Down Expand Up @@ -464,6 +469,11 @@ export declare namespace ContentTree {
number: string;
description: string;
}
interface Audio extends Node {
type: "audio";
src: string;
title: string;
}
interface Video extends Node {
type: "video";
id: string;
Expand Down Expand Up @@ -582,7 +592,7 @@ export declare namespace ContentTree {
}
}
namespace transit {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | ImagePair;
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Audio | Video | YoutubeVideo | Text | ImagePair;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
type Phrasing = Text | Break | Strong | Emphasis | Strikethrough | Link;
interface Node {
Expand Down Expand Up @@ -752,6 +762,11 @@ export declare namespace ContentTree {
number: string;
description: string;
}
interface Audio extends Node {
type: "audio";
src: string;
title: string;
}
interface Video extends Node {
type: "video";
id: string;
Expand Down Expand Up @@ -859,7 +874,7 @@ export declare namespace ContentTree {
}
}
namespace loose {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Video | YoutubeVideo | Text | ImagePair;
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | RecommendedList | Tweet | Audio | Video | YoutubeVideo | Text | ImagePair;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
type Phrasing = Text | Break | Strong | Emphasis | Strikethrough | Link;
interface Node {
Expand Down Expand Up @@ -1033,6 +1048,11 @@ export declare namespace ContentTree {
number: string;
description: string;
}
interface Audio extends Node {
type: "audio";
src: string;
title: string;
}
interface Video extends Node {
type: "video";
id: string;
Expand Down
25 changes: 25 additions & 0 deletions schemas/body-tree.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"definitions": {
"ContentTree.transit.Audio": {
"additionalProperties": false,
"properties": {
"data": {},
"src": {
"type": "string"
},
"title": {
"type": "string"
},
"type": {
"const": "audio",
"type": "string"
}
},
"required": [
"src",
"title",
"type"
],
"type": "object"
},
"ContentTree.transit.BigNumber": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -117,6 +139,9 @@
{
"$ref": "#/definitions/ContentTree.transit.Tweet"
},
{
"$ref": "#/definitions/ContentTree.transit.Audio"
},
{
"$ref": "#/definitions/ContentTree.transit.Video"
},
Expand Down
25 changes: 25 additions & 0 deletions schemas/content-tree.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"definitions": {
"ContentTree.full.Audio": {
"additionalProperties": false,
"properties": {
"data": {},
"src": {
"type": "string"
},
"title": {
"type": "string"
},
"type": {
"const": "audio",
"type": "string"
}
},
"required": [
"src",
"title",
"type"
],
"type": "object"
},
"ContentTree.full.BigNumber": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -142,6 +164,9 @@
{
"$ref": "#/definitions/ContentTree.full.Tweet"
},
{
"$ref": "#/definitions/ContentTree.full.Audio"
},
{
"$ref": "#/definitions/ContentTree.full.Video"
},
Expand Down
25 changes: 25 additions & 0 deletions schemas/transit-tree.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"definitions": {
"ContentTree.transit.Audio": {
"additionalProperties": false,
"properties": {
"data": {},
"src": {
"type": "string"
},
"title": {
"type": "string"
},
"type": {
"const": "audio",
"type": "string"
}
},
"required": [
"src",
"title",
"type"
],
"type": "object"
},
"ContentTree.transit.BigNumber": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -142,6 +164,9 @@
{
"$ref": "#/definitions/ContentTree.transit.Tweet"
},
{
"$ref": "#/definitions/ContentTree.transit.Audio"
},
{
"$ref": "#/definitions/ContentTree.transit.Video"
},
Expand Down
Loading