-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add timeline and event nodes #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
218b159
92150dd
c01e9aa
1d6046f
77fdb27
4ed8a70
cbc49ba
3db9f64
bd88a84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -106,6 +106,7 @@ type BodyBlock = | |||||||
| | Video | ||||||||
| | YoutubeVideo | ||||||||
| | Text | ||||||||
| | Timeline | ||||||||
| ``` | ||||||||
|
|
||||||||
| `BodyBlock` nodes are the only things that are valid as the top level of a `Body`. | ||||||||
|
|
@@ -736,24 +737,24 @@ interface Table extends Parent { | |||||||
|
|
||||||||
| ```ts | ||||||||
| type CustomCodeComponentAttributes = { | ||||||||
| [key: string]: string | boolean | undefined | ||||||||
| [key: string]: string | boolean | undefined | ||||||||
| } | ||||||||
|
|
||||||||
| interface CustomCodeComponent extends Node { | ||||||||
| /** Component type */ | ||||||||
| type: "custom-code-component" | ||||||||
| /** Id taken from the CAPI url */ | ||||||||
| id: string | ||||||||
| /** How the component should be presented in the article page according to the column layout system */ | ||||||||
| layoutWidth: LayoutWidth | ||||||||
| /** Repository for the code of the component in the format "[github org]/[github repo]/[component name]". */ | ||||||||
| external path: string | ||||||||
| /** Semantic version of the code of the component, e.g. "^0.3.5". */ | ||||||||
| external versionRange: string | ||||||||
| /** Last date-time when the attributes for this block were modified, in ISO-8601 format. */ | ||||||||
| external attributesLastModified: string | ||||||||
| /** Configuration data to be passed to the component. */ | ||||||||
| external attributes: CustomCodeComponentAttributes | ||||||||
| /** Component type */ | ||||||||
| type: "custom-code-component" | ||||||||
| /** Id taken from the CAPI url */ | ||||||||
| id: string | ||||||||
| /** How the component should be presented in the article page according to the column layout system */ | ||||||||
| layoutWidth: LayoutWidth | ||||||||
| /** Repository for the code of the component in the format "[github org]/[github repo]/[component name]". */ | ||||||||
| external path: string | ||||||||
| /** Semantic version of the code of the component, e.g. "^0.3.5". */ | ||||||||
| external versionRange: string | ||||||||
| /** Last date-time when the attributes for this block were modified, in ISO-8601 format. */ | ||||||||
| external attributesLastModified: string | ||||||||
| /** Configuration data to be passed to the component. */ | ||||||||
| external attributes: CustomCodeComponentAttributes | ||||||||
| } | ||||||||
| ``` | ||||||||
|
|
||||||||
|
|
@@ -762,6 +763,36 @@ 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`). | ||||||||
|
|
||||||||
| ### Timeline | ||||||||
|
|
||||||||
| ```ts | ||||||||
| /** | ||||||||
| * Allowed layout widths for a Timeline. | ||||||||
| */ | ||||||||
| type TimelineLayoutWidth = Extract<LayoutWidth, "full-width" | "full-grid"> | ||||||||
|
|
||||||||
| /** | ||||||||
| * Timeline nodes display a timeline of events in arbitrary order. | ||||||||
| */ | ||||||||
| interface Timeline extends Parent { | ||||||||
| type: "timeline" | ||||||||
| /** The title for the timeline */ | ||||||||
| title: string | ||||||||
| /** The layout width for the timeline */ | ||||||||
| layoutWidth: TimelineLayoutWidth | ||||||||
| children: TimelineEvent[] | ||||||||
| } | ||||||||
|
|
||||||||
| /** | ||||||||
| * TimelineEvent is the representation of a single event in a Timeline. | ||||||||
| */ | ||||||||
| interface TimelineEvent extends Parent { | ||||||||
| type: "timeline-event" | ||||||||
| /** The title of the event */ | ||||||||
| title: string | ||||||||
| children: (Paragraph | ImageSet)[] | ||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adgad @nadiasuleyman @todor-videv1 This would be more accurate. Same for L783
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hey @nadiasuleyman , @umbobabo, it's a typo at our end. we will fix it and make it timeline-event(s). Apologies! |
||||||||
| } | ||||||||
| ``` | ||||||||
|
|
||||||||
| ## License | ||||||||
|
|
||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below comment