Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
18 changes: 14 additions & 4 deletions SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -1016,20 +1016,24 @@ interface CarouselCard extends Node {
* @description unique identifier required for component tracking
*/
id: string
/**
* @description Heading (60 characters recommended)
*/
title: string
/**
* @description Image
* @sparkMapNodeType image
*/
children: [ImageSet]
/**
* @description Heading (60 characters recommended)
* @sparkMapNodeType textInput
*/
title: string
/**
* @description Body text (200 characters recommended)
* @sparkMapNodeType textInput
*/
copy: string
/**
* @description Details (optional, 60 characters recommended)
* @sparkMapNodeType textInput
*/
additionalInfo?: string
}
Expand All @@ -1052,7 +1056,13 @@ type CarouselChildren = CarouselCard[]
```ts
interface CarouselHeading extends Node {
type: "carousel-heading"
/**
@sparkMapNodeType textInput
*/
title: string
/**
@sparkMapNodeType textInput
*/
standfirst?: string
}
```
Expand Down
3 changes: 2 additions & 1 deletion build.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
node tools/maketypes <SPEC.md> content-tree.ts
tsc -d content-tree.ts
typescript-json-schema --noExtraProps --required content-tree.ts ContentTree.full.Root > schemas/content-tree.schema.json
typescript-json-schema --validationKeywords sparkGenerateStoryblock sparkRepeater minItem maxItem --noExtraProps --required content-tree.ts ContentTree.transit.Root > schemas/transit-tree.schema.json
typescript-json-schema --noExtraProps --required content-tree.ts ContentTree.transit.Root > schemas/transit-tree.schema.json
typescript-json-schema --noExtraProps --required content-tree.ts ContentTree.transit.Body > schemas/body-tree.schema.json
typescript-json-schema --validationKeywords sparkMapNodeType sparkGenerateStoryblock sparkRepeater minItem maxItem --propOrder --noExtraProps --required content-tree.ts ContentTree.transit.Root > schemas/spark-transit-tree.schema.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

☝️ We want to retain field order in Spark so that title appears near the top and not near the bottom of the generated story blocks. To do that, we need to preserve property order in the schema for Spark.

rm content-tree.ts
rm content-tree.js
72 changes: 56 additions & 16 deletions content-tree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -445,20 +445,24 @@ export declare namespace ContentTree {
* @description unique identifier required for component tracking
*/
id: string;
/**
* @description Heading (60 characters recommended)
*/
title: string;
/**
* @description Image
* @sparkMapNodeType image
*/
children: [ImageSet];
/**
* @description Heading (60 characters recommended)
* @sparkMapNodeType textInput
*/
title: string;
/**
* @description Body text (200 characters recommended)
* @sparkMapNodeType textInput
*/
copy: string;
/**
* @description Details (optional, 60 characters recommended)
* @sparkMapNodeType textInput
*/
additionalInfo?: string;
}
Expand All @@ -471,7 +475,13 @@ export declare namespace ContentTree {
type CarouselChildren = CarouselCard[];
interface CarouselHeading extends Node {
type: "carousel-heading";
/**
@sparkMapNodeType textInput
*/
title: string;
/**
@sparkMapNodeType textInput
*/
standfirst?: string;
}
/**
Expand Down Expand Up @@ -933,20 +943,24 @@ export declare namespace ContentTree {
* @description unique identifier required for component tracking
*/
id: string;
/**
* @description Heading (60 characters recommended)
*/
title: string;
/**
* @description Image
* @sparkMapNodeType image
*/
children: [ImageSet];
/**
* @description Heading (60 characters recommended)
* @sparkMapNodeType textInput
*/
title: string;
/**
* @description Body text (200 characters recommended)
* @sparkMapNodeType textInput
*/
copy: string;
/**
* @description Details (optional, 60 characters recommended)
* @sparkMapNodeType textInput
*/
additionalInfo?: string;
}
Expand All @@ -959,7 +973,13 @@ export declare namespace ContentTree {
type CarouselChildren = CarouselCard[];
interface CarouselHeading extends Node {
type: "carousel-heading";
/**
@sparkMapNodeType textInput
*/
title: string;
/**
@sparkMapNodeType textInput
*/
standfirst?: string;
}
/**
Expand Down Expand Up @@ -1395,20 +1415,24 @@ export declare namespace ContentTree {
* @description unique identifier required for component tracking
*/
id: string;
/**
* @description Heading (60 characters recommended)
*/
title: string;
/**
* @description Image
* @sparkMapNodeType image
*/
children: [ImageSet];
/**
* @description Heading (60 characters recommended)
* @sparkMapNodeType textInput
*/
title: string;
/**
* @description Body text (200 characters recommended)
* @sparkMapNodeType textInput
*/
copy: string;
/**
* @description Details (optional, 60 characters recommended)
* @sparkMapNodeType textInput
*/
additionalInfo?: string;
}
Expand All @@ -1421,7 +1445,13 @@ export declare namespace ContentTree {
type CarouselChildren = CarouselCard[];
interface CarouselHeading extends Node {
type: "carousel-heading";
/**
@sparkMapNodeType textInput
*/
title: string;
/**
@sparkMapNodeType textInput
*/
standfirst?: string;
}
/**
Expand Down Expand Up @@ -1884,20 +1914,24 @@ export declare namespace ContentTree {
* @description unique identifier required for component tracking
*/
id: string;
/**
* @description Heading (60 characters recommended)
*/
title: string;
/**
* @description Image
* @sparkMapNodeType image
*/
children: [ImageSet];
/**
* @description Heading (60 characters recommended)
* @sparkMapNodeType textInput
*/
title: string;
/**
* @description Body text (200 characters recommended)
* @sparkMapNodeType textInput
*/
copy: string;
/**
* @description Details (optional, 60 characters recommended)
* @sparkMapNodeType textInput
*/
additionalInfo?: string;
}
Expand All @@ -1910,7 +1944,13 @@ export declare namespace ContentTree {
type CarouselChildren = CarouselCard[];
interface CarouselHeading extends Node {
type: "carousel-heading";
/**
@sparkMapNodeType textInput
*/
title: string;
/**
@sparkMapNodeType textInput
*/
standfirst?: string;
}
/**
Expand Down
Loading