Skip to content

Commit

Permalink
update custom code component
Browse files Browse the repository at this point in the history
  • Loading branch information
leannecornish-ft committed Jul 19, 2024
1 parent abdc26b commit 99baf3f
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 17 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,11 @@ interface Table extends Parent {
### CustomCodeComponent

```ts
interface CccFallbackText extends Node {
type: 'ccc-fallback-text'
children: Paragraph[]
}

interface CustomCodeComponent extends Parent {
type: "custom-code-component"
/** Repository for the code of the component in the format "[github org]/[github repo]/[component name]". */
Expand All @@ -736,7 +741,7 @@ interface CustomCodeComponent extends Parent {
attributes: {
[key: string]: string | boolean | undefined
}
children: (ImageSet | Paragraph | CustomCodeComponent)[]
children: (ImageSet | CccFallbackText)[]
}
```

Expand Down
24 changes: 20 additions & 4 deletions content-tree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,10 @@ export declare namespace ContentTree {
children: [TableCaption, TableBody, TableFooter] | [TableCaption, TableBody] | [TableBody, TableFooter] | [TableBody];
columnSettings: TableColumnSettings[];
}
interface CccFallbackText extends Node {
type: 'ccc-fallback-text';
children: Paragraph[];
}
interface CustomCodeComponent extends Parent {
type: "custom-code-component";
/** Repository for the code of the component in the format "[github org]/[github repo]/[component name]". */
Expand All @@ -268,7 +272,7 @@ export declare namespace ContentTree {
attributes: {
[key: string]: string | boolean | undefined;
};
children: (ImageSet | Paragraph | CustomCodeComponent)[];
children: (ImageSet | CccFallbackText)[];
}
namespace full {
type BodyBlock = Paragraph | Heading | ImageSet | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | Tweet | Video | YoutubeVideo;
Expand Down Expand Up @@ -524,6 +528,10 @@ export declare namespace ContentTree {
children: [TableCaption, TableBody, TableFooter] | [TableCaption, TableBody] | [TableBody, TableFooter] | [TableBody];
columnSettings: TableColumnSettings[];
}
interface CccFallbackText extends Node {
type: 'ccc-fallback-text';
children: Paragraph[];
}
interface CustomCodeComponent extends Parent {
type: "custom-code-component";
/** Repository for the code of the component in the format "[github org]/[github repo]/[component name]". */
Expand All @@ -540,7 +548,7 @@ export declare namespace ContentTree {
attributes: {
[key: string]: string | boolean | undefined;
};
children: (ImageSet | Paragraph | CustomCodeComponent)[];
children: (ImageSet | CccFallbackText)[];
}
}
namespace transit {
Expand Down Expand Up @@ -792,6 +800,10 @@ export declare namespace ContentTree {
children: [TableCaption, TableBody, TableFooter] | [TableCaption, TableBody] | [TableBody, TableFooter] | [TableBody];
columnSettings: TableColumnSettings[];
}
interface CccFallbackText extends Node {
type: 'ccc-fallback-text';
children: Paragraph[];
}
interface CustomCodeComponent extends Parent {
type: "custom-code-component";
/** Repository for the code of the component in the format "[github org]/[github repo]/[component name]". */
Expand All @@ -808,7 +820,7 @@ export declare namespace ContentTree {
attributes: {
[key: string]: string | boolean | undefined;
};
children: (ImageSet | Paragraph | CustomCodeComponent)[];
children: (ImageSet | CccFallbackText)[];
}
}
namespace loose {
Expand Down Expand Up @@ -1065,6 +1077,10 @@ export declare namespace ContentTree {
children: [TableCaption, TableBody, TableFooter] | [TableCaption, TableBody] | [TableBody, TableFooter] | [TableBody];
columnSettings: TableColumnSettings[];
}
interface CccFallbackText extends Node {
type: 'ccc-fallback-text';
children: Paragraph[];
}
interface CustomCodeComponent extends Parent {
type: "custom-code-component";
/** Repository for the code of the component in the format "[github org]/[github repo]/[component name]". */
Expand All @@ -1081,7 +1097,7 @@ export declare namespace ContentTree {
attributes: {
[key: string]: string | boolean | undefined;
};
children: (ImageSet | Paragraph | CustomCodeComponent)[];
children: (ImageSet | CccFallbackText)[];
}
}
}
21 changes: 17 additions & 4 deletions schemas/body-tree.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,22 @@
},
"type": "object"
},
"ContentTree.transit.CccFallbackText": {
"properties": {
"children": {
"items": {
"$ref": "#/definitions/ContentTree.transit.Paragraph"
},
"type": "array"
},
"data": {},
"type": {
"const": "ccc-fallback-text",
"type": "string"
}
},
"type": "object"
},
"ContentTree.transit.CustomCodeComponent": {
"properties": {
"attributes": {
Expand All @@ -136,14 +152,11 @@
"children": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/ContentTree.transit.Paragraph"
},
{
"$ref": "#/definitions/ContentTree.transit.ImageSet"
},
{
"$ref": "#/definitions/ContentTree.transit.CustomCodeComponent"
"$ref": "#/definitions/ContentTree.transit.CccFallbackText"
}
]
},
Expand Down
21 changes: 17 additions & 4 deletions schemas/content-tree.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,22 @@
},
"type": "object"
},
"ContentTree.full.CccFallbackText": {
"properties": {
"children": {
"items": {
"$ref": "#/definitions/ContentTree.full.Paragraph"
},
"type": "array"
},
"data": {},
"type": {
"const": "ccc-fallback-text",
"type": "string"
}
},
"type": "object"
},
"ContentTree.full.CustomCodeComponent": {
"properties": {
"attributes": {
Expand All @@ -155,14 +171,11 @@
"children": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/ContentTree.full.Paragraph"
},
{
"$ref": "#/definitions/ContentTree.full.ImageSet"
},
{
"$ref": "#/definitions/ContentTree.full.CustomCodeComponent"
"$ref": "#/definitions/ContentTree.full.CccFallbackText"
}
]
},
Expand Down
21 changes: 17 additions & 4 deletions schemas/transit-tree.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,22 @@
},
"type": "object"
},
"ContentTree.transit.CccFallbackText": {
"properties": {
"children": {
"items": {
"$ref": "#/definitions/ContentTree.transit.Paragraph"
},
"type": "array"
},
"data": {},
"type": {
"const": "ccc-fallback-text",
"type": "string"
}
},
"type": "object"
},
"ContentTree.transit.CustomCodeComponent": {
"properties": {
"attributes": {
Expand All @@ -155,14 +171,11 @@
"children": {
"items": {
"anyOf": [
{
"$ref": "#/definitions/ContentTree.transit.Paragraph"
},
{
"$ref": "#/definitions/ContentTree.transit.ImageSet"
},
{
"$ref": "#/definitions/ContentTree.transit.CustomCodeComponent"
"$ref": "#/definitions/ContentTree.transit.CccFallbackText"
}
]
},
Expand Down

0 comments on commit 99baf3f

Please sign in to comment.