-
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
Open
umbobabo
wants to merge
9
commits into
main
Choose a base branch
from
CI-3097
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
218b159
feat: add timeline and event nodes
umbobabo 92150dd
Update TypeScript definition file
umbobabo c01e9aa
feat: support Imageset in Timeline and title for initial field instea…
umbobabo 1d6046f
Update TypeScript definition file
umbobabo 77fdb27
doc: JSDO doc approach
umbobabo 4ed8a70
Remove heading and use title instead
umbobabo cbc49ba
Update TypeScript definition file
umbobabo 3db9f64
Add title instead of heading
umbobabo bd88a84
Update TypeScript definition file
umbobabo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)[] | ||||||||
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
|
||||||||
} | ||||||||
``` | ||||||||
|
||||||||
## License | ||||||||
|
||||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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