@newskit-render/feed 1.3.0-alpha.0 → 1.4.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/helpers/createSitemap/buildSiteMapVideos.d.ts +1 -1
- package/dist/cjs/helpers/queryArticleList.js +1 -1
- package/dist/cjs/helpers/queryPages.js +1 -1
- package/dist/cjs/helpers/types.d.ts +11 -11
- package/dist/cjs/rss/RSSFeedResolver.js +1 -1
- package/dist/cjs/rss/types.d.ts +22 -22
- package/dist/cjs/sitemap/resolvers/genericSitemapResolver.js +1 -1
- package/dist/cjs/sitemap/resolvers/newsSitemapResolver.js +1 -1
- package/dist/esm/helpers/createSitemap/buildSiteMapVideos.d.ts +1 -1
- package/dist/esm/helpers/queryArticleList.js +1 -1
- package/dist/esm/helpers/queryPages.js +1 -1
- package/dist/esm/helpers/types.d.ts +11 -11
- package/dist/esm/rss/RSSFeedResolver.js +1 -1
- package/dist/esm/rss/types.d.ts +22 -22
- package/dist/esm/sitemap/resolvers/genericSitemapResolver.js +1 -1
- package/dist/esm/sitemap/resolvers/newsSitemapResolver.js +1 -1
- package/package.json +5 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Article, ArticleBody } from '../types';
|
|
2
|
-
export declare const buildSiteMapVideos: ({ domain, body, headline, publishedDateTime, id, publisher, articleCategory, }: {
|
|
2
|
+
export declare const buildSiteMapVideos: ({ domain, body, headline, publishedDateTime, id: articleId, publisher, articleCategory, }: {
|
|
3
3
|
domain: string;
|
|
4
4
|
body: ArticleBody[];
|
|
5
5
|
headline: Article['headline'];
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
import { NextApiResponse } from 'next';
|
|
3
3
|
import { ParsedUrlQuery } from 'querystring';
|
|
4
4
|
import { Publisher } from '@newskit-render/api';
|
|
5
|
-
export
|
|
5
|
+
export type ImageBlock = {
|
|
6
6
|
url: string;
|
|
7
7
|
caption?: string;
|
|
8
8
|
credit?: string;
|
|
9
9
|
alt?: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type VideoBrightcoveBlock = {
|
|
12
12
|
accountId: string;
|
|
13
13
|
id: string;
|
|
14
14
|
playerId: string;
|
|
15
15
|
type: string;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type ArticleBody = ImageBlock | VideoBrightcoveBlock;
|
|
18
18
|
export declare enum BlockTypes {
|
|
19
19
|
ImageBlock = "ImageBlock",
|
|
20
20
|
VideoBrightcoveBlock = "VideoBrightcoveBlock"
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type Category = {
|
|
23
23
|
id: string;
|
|
24
24
|
parentId?: string;
|
|
25
25
|
slug: string;
|
|
26
26
|
title: string;
|
|
27
27
|
type: string;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type Article = {
|
|
30
30
|
id: string | number;
|
|
31
31
|
headline: string;
|
|
32
32
|
publishedDateTime: string;
|
|
@@ -35,8 +35,8 @@ export declare type Article = {
|
|
|
35
35
|
body: ArticleBody[];
|
|
36
36
|
categories: Category[];
|
|
37
37
|
};
|
|
38
|
-
export
|
|
39
|
-
export
|
|
38
|
+
export type ChangeFreq = 'never' | 'yearly' | 'monthly' | 'weekly' | 'daily' | 'hourly' | 'always';
|
|
39
|
+
export type Priority = '1.0' | '0.9' | '0.8' | '0.7' | '0.6' | '0.5' | '0.4' | '0.3' | '0.2' | '0.1' | '0.0';
|
|
40
40
|
export interface CustomStaticPage {
|
|
41
41
|
slug: string;
|
|
42
42
|
url?: string;
|
|
@@ -61,7 +61,7 @@ export interface StaticPageQueryResponse {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
export
|
|
64
|
+
export type SitemapConfig = {
|
|
65
65
|
res: NextApiResponse;
|
|
66
66
|
publisher: Publisher;
|
|
67
67
|
domain: string;
|
|
@@ -70,10 +70,10 @@ export declare type SitemapConfig = {
|
|
|
70
70
|
changefreq?: ChangeFreq;
|
|
71
71
|
priority?: Priority;
|
|
72
72
|
};
|
|
73
|
-
export
|
|
74
|
-
export
|
|
73
|
+
export type DataType = 'articles' | 'pages' | 'competitions';
|
|
74
|
+
export type GenericSitemapConfig = SitemapConfig & {
|
|
75
75
|
dataType?: DataType;
|
|
76
76
|
firstArticleDate?: string;
|
|
77
77
|
query?: ParsedUrlQuery;
|
|
78
78
|
};
|
|
79
|
-
export
|
|
79
|
+
export type ArticleList = Article[];
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
package/dist/cjs/rss/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NextApiResponse } from 'next';
|
|
2
2
|
import { Publisher } from '@newskit-render/api';
|
|
3
3
|
import { VideoBrightcoveBlock } from 'helpers/types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type UpdatePeriod = 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
5
|
+
export type TiteAttributes = {
|
|
6
6
|
title: string;
|
|
7
7
|
link: string;
|
|
8
8
|
description: string;
|
|
@@ -18,7 +18,7 @@ export interface RssFeedProps {
|
|
|
18
18
|
domain: string;
|
|
19
19
|
titeAttributes: TiteAttributes;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type TextBlock = {
|
|
22
22
|
bold: boolean;
|
|
23
23
|
italic: boolean;
|
|
24
24
|
monospace: boolean;
|
|
@@ -26,22 +26,22 @@ export declare type TextBlock = {
|
|
|
26
26
|
type: 'text';
|
|
27
27
|
underline: boolean;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type HyperlinkBlock = {
|
|
30
30
|
text: string;
|
|
31
31
|
type: 'hyperlink';
|
|
32
32
|
url: string;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
35
|
-
export
|
|
34
|
+
export type ParagraphBlockChildren = TextBlock | HyperlinkBlock;
|
|
35
|
+
export type ParagraphBlock = {
|
|
36
36
|
type: 'paragraph';
|
|
37
37
|
paragraphs: ParagraphBlockChildren[];
|
|
38
38
|
};
|
|
39
|
-
export
|
|
39
|
+
export type HeadingBlock = {
|
|
40
40
|
type: 'heading';
|
|
41
41
|
level: number;
|
|
42
42
|
children: TextBlock[];
|
|
43
43
|
};
|
|
44
|
-
export
|
|
44
|
+
export type ImageBlock = {
|
|
45
45
|
alt: string;
|
|
46
46
|
caption: string;
|
|
47
47
|
credit: string;
|
|
@@ -50,42 +50,42 @@ export declare type ImageBlock = {
|
|
|
50
50
|
url: string;
|
|
51
51
|
type: 'image';
|
|
52
52
|
};
|
|
53
|
-
export
|
|
53
|
+
export type TweetBlock = {
|
|
54
54
|
id: string;
|
|
55
55
|
type: 'tweet';
|
|
56
56
|
};
|
|
57
|
-
export
|
|
57
|
+
export type FormStackBlock = {
|
|
58
58
|
id: string;
|
|
59
59
|
type: string;
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type EmbedBlock = {
|
|
62
62
|
type: 'embed';
|
|
63
63
|
url: string;
|
|
64
64
|
};
|
|
65
|
-
export
|
|
65
|
+
export type InstagramBlock = {
|
|
66
66
|
id: string;
|
|
67
67
|
type: 'instagram';
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type YoutubeBlock = {
|
|
70
70
|
id: 'youtube';
|
|
71
71
|
type: string;
|
|
72
72
|
};
|
|
73
|
-
export
|
|
74
|
-
export
|
|
73
|
+
export type Body = TextBlock | ParagraphBlock | ImageBlock | HeadingBlock | EmbedBlock | FormStackBlock | InstagramBlock | VideoBrightcoveBlock | UnorderedList | OrderedList;
|
|
74
|
+
export type Summary = {
|
|
75
75
|
children: {
|
|
76
76
|
text: string;
|
|
77
77
|
}[];
|
|
78
78
|
};
|
|
79
|
-
export
|
|
79
|
+
export type ListItem = UnorderedList | OrderedList | TextBlock | HyperlinkBlock;
|
|
80
80
|
export declare enum ListTypes {
|
|
81
81
|
UnorderedList = "unordered-list",
|
|
82
82
|
OrderedList = "ordered-list"
|
|
83
83
|
}
|
|
84
|
-
export
|
|
84
|
+
export type UnorderedList = {
|
|
85
85
|
type: 'unordered-list';
|
|
86
86
|
items: [ListItem];
|
|
87
87
|
};
|
|
88
|
-
export
|
|
88
|
+
export type OrderedList = {
|
|
89
89
|
type: 'ordered-list';
|
|
90
90
|
items: [ListItem];
|
|
91
91
|
};
|
|
@@ -107,10 +107,10 @@ export declare enum ListItemTypes {
|
|
|
107
107
|
we're cirrently only using slug, but we might need to use more in the future.
|
|
108
108
|
I have exported the type as it is used now to be able to type an argument in the code properly
|
|
109
109
|
*/
|
|
110
|
-
export
|
|
110
|
+
export type ArticleCategory = {
|
|
111
111
|
slug: string;
|
|
112
112
|
};
|
|
113
|
-
export
|
|
113
|
+
export type Article = {
|
|
114
114
|
id: string | number;
|
|
115
115
|
headline: string;
|
|
116
116
|
categories: ArticleCategory[];
|
|
@@ -122,7 +122,7 @@ export declare type Article = {
|
|
|
122
122
|
updatedDateTime: string;
|
|
123
123
|
body: Body[];
|
|
124
124
|
};
|
|
125
|
-
export
|
|
125
|
+
export type ArticleList = Article[];
|
|
126
126
|
export declare enum BodyBlockTypes {
|
|
127
127
|
Paragraph = "paragraph",
|
|
128
128
|
Image = "image",
|
|
@@ -135,7 +135,7 @@ export declare enum BodyBlockTypes {
|
|
|
135
135
|
UnorderedListBlock = "unordered-list",
|
|
136
136
|
OrderedListBlock = "ordered-list"
|
|
137
137
|
}
|
|
138
|
-
export
|
|
138
|
+
export type BodyDataTypesMap = {
|
|
139
139
|
[BodyBlockTypes.Paragraph]: (data: ParagraphBlock) => string;
|
|
140
140
|
[BodyBlockTypes.Image]: (data: ImageBlock, imageSourceSizes?: string[]) => string;
|
|
141
141
|
[BodyBlockTypes.UnorderedListBlock]: (list: UnorderedList) => string;
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (_) try {
|
|
17
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Article, ArticleBody } from '../types';
|
|
2
|
-
export declare const buildSiteMapVideos: ({ domain, body, headline, publishedDateTime, id, publisher, articleCategory, }: {
|
|
2
|
+
export declare const buildSiteMapVideos: ({ domain, body, headline, publishedDateTime, id: articleId, publisher, articleCategory, }: {
|
|
3
3
|
domain: string;
|
|
4
4
|
body: ArticleBody[];
|
|
5
5
|
headline: Article['headline'];
|
|
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
|
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
import { NextApiResponse } from 'next';
|
|
3
3
|
import { ParsedUrlQuery } from 'querystring';
|
|
4
4
|
import { Publisher } from '@newskit-render/api';
|
|
5
|
-
export
|
|
5
|
+
export type ImageBlock = {
|
|
6
6
|
url: string;
|
|
7
7
|
caption?: string;
|
|
8
8
|
credit?: string;
|
|
9
9
|
alt?: string;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type VideoBrightcoveBlock = {
|
|
12
12
|
accountId: string;
|
|
13
13
|
id: string;
|
|
14
14
|
playerId: string;
|
|
15
15
|
type: string;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
17
|
+
export type ArticleBody = ImageBlock | VideoBrightcoveBlock;
|
|
18
18
|
export declare enum BlockTypes {
|
|
19
19
|
ImageBlock = "ImageBlock",
|
|
20
20
|
VideoBrightcoveBlock = "VideoBrightcoveBlock"
|
|
21
21
|
}
|
|
22
|
-
export
|
|
22
|
+
export type Category = {
|
|
23
23
|
id: string;
|
|
24
24
|
parentId?: string;
|
|
25
25
|
slug: string;
|
|
26
26
|
title: string;
|
|
27
27
|
type: string;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type Article = {
|
|
30
30
|
id: string | number;
|
|
31
31
|
headline: string;
|
|
32
32
|
publishedDateTime: string;
|
|
@@ -35,8 +35,8 @@ export declare type Article = {
|
|
|
35
35
|
body: ArticleBody[];
|
|
36
36
|
categories: Category[];
|
|
37
37
|
};
|
|
38
|
-
export
|
|
39
|
-
export
|
|
38
|
+
export type ChangeFreq = 'never' | 'yearly' | 'monthly' | 'weekly' | 'daily' | 'hourly' | 'always';
|
|
39
|
+
export type Priority = '1.0' | '0.9' | '0.8' | '0.7' | '0.6' | '0.5' | '0.4' | '0.3' | '0.2' | '0.1' | '0.0';
|
|
40
40
|
export interface CustomStaticPage {
|
|
41
41
|
slug: string;
|
|
42
42
|
url?: string;
|
|
@@ -61,7 +61,7 @@ export interface StaticPageQueryResponse {
|
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
63
|
}
|
|
64
|
-
export
|
|
64
|
+
export type SitemapConfig = {
|
|
65
65
|
res: NextApiResponse;
|
|
66
66
|
publisher: Publisher;
|
|
67
67
|
domain: string;
|
|
@@ -70,10 +70,10 @@ export declare type SitemapConfig = {
|
|
|
70
70
|
changefreq?: ChangeFreq;
|
|
71
71
|
priority?: Priority;
|
|
72
72
|
};
|
|
73
|
-
export
|
|
74
|
-
export
|
|
73
|
+
export type DataType = 'articles' | 'pages' | 'competitions';
|
|
74
|
+
export type GenericSitemapConfig = SitemapConfig & {
|
|
75
75
|
dataType?: DataType;
|
|
76
76
|
firstArticleDate?: string;
|
|
77
77
|
query?: ParsedUrlQuery;
|
|
78
78
|
};
|
|
79
|
-
export
|
|
79
|
+
export type ArticleList = Article[];
|
|
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
package/dist/esm/rss/types.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NextApiResponse } from 'next';
|
|
2
2
|
import { Publisher } from '@newskit-render/api';
|
|
3
3
|
import { VideoBrightcoveBlock } from 'helpers/types';
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export type UpdatePeriod = 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly';
|
|
5
|
+
export type TiteAttributes = {
|
|
6
6
|
title: string;
|
|
7
7
|
link: string;
|
|
8
8
|
description: string;
|
|
@@ -18,7 +18,7 @@ export interface RssFeedProps {
|
|
|
18
18
|
domain: string;
|
|
19
19
|
titeAttributes: TiteAttributes;
|
|
20
20
|
}
|
|
21
|
-
export
|
|
21
|
+
export type TextBlock = {
|
|
22
22
|
bold: boolean;
|
|
23
23
|
italic: boolean;
|
|
24
24
|
monospace: boolean;
|
|
@@ -26,22 +26,22 @@ export declare type TextBlock = {
|
|
|
26
26
|
type: 'text';
|
|
27
27
|
underline: boolean;
|
|
28
28
|
};
|
|
29
|
-
export
|
|
29
|
+
export type HyperlinkBlock = {
|
|
30
30
|
text: string;
|
|
31
31
|
type: 'hyperlink';
|
|
32
32
|
url: string;
|
|
33
33
|
};
|
|
34
|
-
export
|
|
35
|
-
export
|
|
34
|
+
export type ParagraphBlockChildren = TextBlock | HyperlinkBlock;
|
|
35
|
+
export type ParagraphBlock = {
|
|
36
36
|
type: 'paragraph';
|
|
37
37
|
paragraphs: ParagraphBlockChildren[];
|
|
38
38
|
};
|
|
39
|
-
export
|
|
39
|
+
export type HeadingBlock = {
|
|
40
40
|
type: 'heading';
|
|
41
41
|
level: number;
|
|
42
42
|
children: TextBlock[];
|
|
43
43
|
};
|
|
44
|
-
export
|
|
44
|
+
export type ImageBlock = {
|
|
45
45
|
alt: string;
|
|
46
46
|
caption: string;
|
|
47
47
|
credit: string;
|
|
@@ -50,42 +50,42 @@ export declare type ImageBlock = {
|
|
|
50
50
|
url: string;
|
|
51
51
|
type: 'image';
|
|
52
52
|
};
|
|
53
|
-
export
|
|
53
|
+
export type TweetBlock = {
|
|
54
54
|
id: string;
|
|
55
55
|
type: 'tweet';
|
|
56
56
|
};
|
|
57
|
-
export
|
|
57
|
+
export type FormStackBlock = {
|
|
58
58
|
id: string;
|
|
59
59
|
type: string;
|
|
60
60
|
};
|
|
61
|
-
export
|
|
61
|
+
export type EmbedBlock = {
|
|
62
62
|
type: 'embed';
|
|
63
63
|
url: string;
|
|
64
64
|
};
|
|
65
|
-
export
|
|
65
|
+
export type InstagramBlock = {
|
|
66
66
|
id: string;
|
|
67
67
|
type: 'instagram';
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type YoutubeBlock = {
|
|
70
70
|
id: 'youtube';
|
|
71
71
|
type: string;
|
|
72
72
|
};
|
|
73
|
-
export
|
|
74
|
-
export
|
|
73
|
+
export type Body = TextBlock | ParagraphBlock | ImageBlock | HeadingBlock | EmbedBlock | FormStackBlock | InstagramBlock | VideoBrightcoveBlock | UnorderedList | OrderedList;
|
|
74
|
+
export type Summary = {
|
|
75
75
|
children: {
|
|
76
76
|
text: string;
|
|
77
77
|
}[];
|
|
78
78
|
};
|
|
79
|
-
export
|
|
79
|
+
export type ListItem = UnorderedList | OrderedList | TextBlock | HyperlinkBlock;
|
|
80
80
|
export declare enum ListTypes {
|
|
81
81
|
UnorderedList = "unordered-list",
|
|
82
82
|
OrderedList = "ordered-list"
|
|
83
83
|
}
|
|
84
|
-
export
|
|
84
|
+
export type UnorderedList = {
|
|
85
85
|
type: 'unordered-list';
|
|
86
86
|
items: [ListItem];
|
|
87
87
|
};
|
|
88
|
-
export
|
|
88
|
+
export type OrderedList = {
|
|
89
89
|
type: 'ordered-list';
|
|
90
90
|
items: [ListItem];
|
|
91
91
|
};
|
|
@@ -107,10 +107,10 @@ export declare enum ListItemTypes {
|
|
|
107
107
|
we're cirrently only using slug, but we might need to use more in the future.
|
|
108
108
|
I have exported the type as it is used now to be able to type an argument in the code properly
|
|
109
109
|
*/
|
|
110
|
-
export
|
|
110
|
+
export type ArticleCategory = {
|
|
111
111
|
slug: string;
|
|
112
112
|
};
|
|
113
|
-
export
|
|
113
|
+
export type Article = {
|
|
114
114
|
id: string | number;
|
|
115
115
|
headline: string;
|
|
116
116
|
categories: ArticleCategory[];
|
|
@@ -122,7 +122,7 @@ export declare type Article = {
|
|
|
122
122
|
updatedDateTime: string;
|
|
123
123
|
body: Body[];
|
|
124
124
|
};
|
|
125
|
-
export
|
|
125
|
+
export type ArticleList = Article[];
|
|
126
126
|
export declare enum BodyBlockTypes {
|
|
127
127
|
Paragraph = "paragraph",
|
|
128
128
|
Image = "image",
|
|
@@ -135,7 +135,7 @@ export declare enum BodyBlockTypes {
|
|
|
135
135
|
UnorderedListBlock = "unordered-list",
|
|
136
136
|
OrderedListBlock = "ordered-list"
|
|
137
137
|
}
|
|
138
|
-
export
|
|
138
|
+
export type BodyDataTypesMap = {
|
|
139
139
|
[BodyBlockTypes.Paragraph]: (data: ParagraphBlock) => string;
|
|
140
140
|
[BodyBlockTypes.Image]: (data: ImageBlock, imageSourceSizes?: string[]) => string;
|
|
141
141
|
[BodyBlockTypes.UnorderedListBlock]: (list: UnorderedList) => string;
|
|
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
|
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/feed",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-alpha.0",
|
|
4
4
|
"description": "Newskit Render - Feed package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@apollo/client": "3.3.7",
|
|
28
|
-
"@newskit-render/api": "^1.
|
|
28
|
+
"@newskit-render/api": "^1.5.0-alpha.0",
|
|
29
29
|
"graphql": "15.6.0",
|
|
30
30
|
"lodash.escape": "4.0.1"
|
|
31
31
|
},
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"eslint-plugin-prettier": "4.2.1",
|
|
40
40
|
"jest": "27.4.7",
|
|
41
41
|
"jest-junit": "12.0.0",
|
|
42
|
-
"next": "
|
|
42
|
+
"next": "13.0.5",
|
|
43
43
|
"prettier": "2.2.1",
|
|
44
44
|
"react": "18.2.0",
|
|
45
45
|
"ts-jest": "27.1.3",
|
|
46
|
-
"typescript": "4.
|
|
46
|
+
"typescript": "4.9.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"next": ">= 12.1.0 <=
|
|
49
|
+
"next": ">= 12.1.0 <= 13.0.5",
|
|
50
50
|
"react": ">= 17.0.2 <= 18.2.0"
|
|
51
51
|
},
|
|
52
52
|
"resolutions": {
|