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
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,38 @@ interface CustomCodeComponent extends Node {
- The basic interface in Spark to make reference to this system above (eg. the git repo URL or a public S3 bucket), and provide some data for it if necessary. This will be the Custom Component storyblock.
- The data Spark receives from entering a specific ID will be used to render dynamic fields (the `attributes`).

### Info

```ts
interface Info extends Parent {
type: "info"
children: [Heading, ImageSet, Paragraph]
}
```
An **Info** is an atomic information that can be optionally associated with other information

### InfoBox

```ts
type InfoBoxLayoutWidth = Extract<LayoutWidth, "full-width" | "inset-left">
interface InfoBox extends Parent {
type: "info-box"
layoutWidth: InfoBoxLayoutWidth
children: Info
}
```
An **InfoBox** positions a single **Info** inside the content whilst setting an appropriate presentation

### Comparison

```ts
interface Comparison extends Parent {
type: "comparison"
children: [Heading, Info, Info]
}
```

A **Comparison** compares two information

## License

Expand Down
56 changes: 56 additions & 0 deletions content-tree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,20 @@ export declare namespace ContentTree {
/** Configuration data to be passed to the component. */
attributes: CustomCodeComponentAttributes;
}
interface Info extends Parent {
type: "info";
children: [Heading, ImageSet, Paragraph];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
children: [Heading, ImageSet, Paragraph];
children: [Heading?, ImageSet?, Paragraph];

}
type InfoBoxLayoutWidth = Extract<LayoutWidth, "full-width" | "inset-left">;
interface InfoBox extends Parent {
type: "info-box";
layoutWidth: InfoBoxLayoutWidth;
children: Info;
}
interface Comparison extends Parent {
type: "comparison";
children: [Heading, Info, Info];
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
children: [Heading, Info, Info];
children: [Heading?, Info, Info];

}
namespace full {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | Tweet | Video | YoutubeVideo | Text;
type LayoutWidth = "auto" | "in-line" | "inset-left" | "inset-right" | "full-bleed" | "full-grid" | "mid-grid" | "full-width";
Expand Down Expand Up @@ -558,6 +572,20 @@ export declare namespace ContentTree {
/** Configuration data to be passed to the component. */
attributes: CustomCodeComponentAttributes;
}
interface Info extends Parent {
type: "info";
children: [Heading, ImageSet, Paragraph];
}
type InfoBoxLayoutWidth = Extract<LayoutWidth, "full-width" | "inset-left">;
interface InfoBox extends Parent {
type: "info-box";
layoutWidth: InfoBoxLayoutWidth;
children: Info;
}
interface Comparison extends Parent {
type: "comparison";
children: [Heading, Info, Info];
}
}
namespace transit {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | Tweet | Video | YoutubeVideo | Text;
Expand Down Expand Up @@ -824,6 +852,20 @@ export declare namespace ContentTree {
/** How the component should be presented in the article page according to the column layout system */
layoutWidth: LayoutWidth;
}
interface Info extends Parent {
type: "info";
children: [Heading, ImageSet, Paragraph];
}
type InfoBoxLayoutWidth = Extract<LayoutWidth, "full-width" | "inset-left">;
interface InfoBox extends Parent {
type: "info-box";
layoutWidth: InfoBoxLayoutWidth;
children: Info;
}
interface Comparison extends Parent {
type: "comparison";
children: [Heading, Info, Info];
}
}
namespace loose {
type BodyBlock = Paragraph | Heading | ImageSet | Flourish | BigNumber | CustomCodeComponent | Layout | List | Blockquote | Pullquote | ScrollyBlock | ThematicBreak | Table | Recommended | Tweet | Video | YoutubeVideo | Text;
Expand Down Expand Up @@ -1105,5 +1147,19 @@ export declare namespace ContentTree {
/** Configuration data to be passed to the component. */
attributes?: CustomCodeComponentAttributes;
}
interface Info extends Parent {
type: "info";
children: [Heading, ImageSet, Paragraph];
}
type InfoBoxLayoutWidth = Extract<LayoutWidth, "full-width" | "inset-left">;
interface InfoBox extends Parent {
type: "info-box";
layoutWidth: InfoBoxLayoutWidth;
children: Info;
}
interface Comparison extends Parent {
type: "comparison";
children: [Heading, Info, Info];
}
}
}
Loading