@newskit-render/feed 0.20.0 → 0.21.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/rss/__tests__/mocks.d.ts +161 -39
- package/dist/cjs/rss/__tests__/mocks.js +178 -11
- package/dist/cjs/rss/__tests__/mocks.js.map +1 -1
- package/dist/cjs/rss/contentEncodedUtils/createBlockElements.d.ts +9 -0
- package/dist/cjs/rss/contentEncodedUtils/createBlockElements.js +47 -0
- package/dist/cjs/rss/contentEncodedUtils/createBlockElements.js.map +1 -0
- package/dist/cjs/rss/contentEncodedUtils/createContentEncoded.js +9 -11
- package/dist/cjs/rss/contentEncodedUtils/createContentEncoded.js.map +1 -1
- package/dist/cjs/rss/contentEncodedUtils/createParagraph.js +3 -9
- package/dist/cjs/rss/contentEncodedUtils/createParagraph.js.map +1 -1
- package/dist/cjs/rss/contentEncodedUtils/createSummary.js +1 -1
- package/dist/cjs/rss/contentEncodedUtils/createSummary.js.map +1 -1
- package/dist/cjs/rss/contentEncodedUtils/index.d.ts +1 -0
- package/dist/cjs/rss/contentEncodedUtils/index.js +1 -0
- package/dist/cjs/rss/contentEncodedUtils/index.js.map +1 -1
- package/dist/cjs/rss/helpers/articleHelper.d.ts +4 -5
- package/dist/cjs/rss/helpers/articleHelper.js +3 -5
- package/dist/cjs/rss/helpers/articleHelper.js.map +1 -1
- package/dist/cjs/rss/helpers/buildBodyDataTypesMap.d.ts +2 -0
- package/dist/cjs/rss/helpers/buildBodyDataTypesMap.js +33 -0
- package/dist/cjs/rss/helpers/buildBodyDataTypesMap.js.map +1 -0
- package/dist/cjs/rss/helpers/buildLists.d.ts +4 -0
- package/dist/cjs/rss/helpers/buildLists.js +33 -0
- package/dist/cjs/rss/helpers/buildLists.js.map +1 -0
- package/dist/cjs/rss/helpers/index.d.ts +2 -0
- package/dist/cjs/rss/helpers/index.js +2 -0
- package/dist/cjs/rss/helpers/index.js.map +1 -1
- package/dist/cjs/rss/queries/getArticleList.js +1 -1
- package/dist/cjs/rss/queries/getArticleList.js.map +1 -1
- package/dist/cjs/rss/types.d.ts +87 -5
- package/dist/cjs/rss/types.js +26 -0
- package/dist/cjs/rss/types.js.map +1 -1
- package/dist/esm/rss/__tests__/mocks.d.ts +161 -39
- package/dist/esm/rss/__tests__/mocks.js +177 -10
- package/dist/esm/rss/__tests__/mocks.js.map +1 -1
- package/dist/esm/rss/contentEncodedUtils/createBlockElements.d.ts +9 -0
- package/dist/esm/rss/contentEncodedUtils/createBlockElements.js +36 -0
- package/dist/esm/rss/contentEncodedUtils/createBlockElements.js.map +1 -0
- package/dist/esm/rss/contentEncodedUtils/createContentEncoded.js +9 -11
- package/dist/esm/rss/contentEncodedUtils/createContentEncoded.js.map +1 -1
- package/dist/esm/rss/contentEncodedUtils/createParagraph.js +1 -7
- package/dist/esm/rss/contentEncodedUtils/createParagraph.js.map +1 -1
- package/dist/esm/rss/contentEncodedUtils/createRSSFeed.js +1 -1
- package/dist/esm/rss/contentEncodedUtils/createRSSFeed.js.map +1 -1
- package/dist/esm/rss/contentEncodedUtils/createSummary.js +1 -1
- package/dist/esm/rss/contentEncodedUtils/createSummary.js.map +1 -1
- package/dist/esm/rss/contentEncodedUtils/index.d.ts +1 -0
- package/dist/esm/rss/contentEncodedUtils/index.js +1 -0
- package/dist/esm/rss/contentEncodedUtils/index.js.map +1 -1
- package/dist/esm/rss/helpers/articleHelper.d.ts +4 -5
- package/dist/esm/rss/helpers/articleHelper.js +3 -5
- package/dist/esm/rss/helpers/articleHelper.js.map +1 -1
- package/dist/esm/rss/helpers/buildBodyDataTypesMap.d.ts +2 -0
- package/dist/esm/rss/helpers/buildBodyDataTypesMap.js +30 -0
- package/dist/esm/rss/helpers/buildBodyDataTypesMap.js.map +1 -0
- package/dist/esm/rss/helpers/buildLists.d.ts +4 -0
- package/dist/esm/rss/helpers/buildLists.js +27 -0
- package/dist/esm/rss/helpers/buildLists.js.map +1 -0
- package/dist/esm/rss/helpers/index.d.ts +2 -0
- package/dist/esm/rss/helpers/index.js +2 -0
- package/dist/esm/rss/helpers/index.js.map +1 -1
- package/dist/esm/rss/queries/getArticleList.js +1 -1
- package/dist/esm/rss/queries/getArticleList.js.map +1 -1
- package/dist/esm/rss/types.d.ts +87 -5
- package/dist/esm/rss/types.js +25 -1
- package/dist/esm/rss/types.js.map +1 -1
- package/package.json +4 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TiteAttributes } from '../types';
|
|
1
|
+
import { Body, TiteAttributes } from '../types';
|
|
2
2
|
export declare const domainMock = "https://demo.com";
|
|
3
3
|
export declare const lastBuildDateMock: string;
|
|
4
4
|
export declare const updatedDateTimeMock = "Tue, 12 Apr 2022 11:17:09 GMT";
|
|
@@ -17,6 +17,7 @@ export declare const articleListMock: ({
|
|
|
17
17
|
updatedDateTime: string;
|
|
18
18
|
headline: string;
|
|
19
19
|
id: string;
|
|
20
|
+
body: Body[];
|
|
20
21
|
} | {
|
|
21
22
|
categories: {
|
|
22
23
|
slug: string;
|
|
@@ -34,6 +35,7 @@ export declare const articleListMock: ({
|
|
|
34
35
|
updatedDateTime: string;
|
|
35
36
|
headline: string;
|
|
36
37
|
id: string;
|
|
38
|
+
body: Body[];
|
|
37
39
|
} | {
|
|
38
40
|
categories: {
|
|
39
41
|
name: string;
|
|
@@ -49,6 +51,7 @@ export declare const articleListMock: ({
|
|
|
49
51
|
updatedDateTime: string;
|
|
50
52
|
headline: string;
|
|
51
53
|
id: string;
|
|
54
|
+
body: Body[];
|
|
52
55
|
})[];
|
|
53
56
|
export declare const rssMock: string;
|
|
54
57
|
export declare const articleListWithBodyMock: {
|
|
@@ -64,47 +67,166 @@ export declare const articleListWithBodyMock: {
|
|
|
64
67
|
updatedDateTime: string;
|
|
65
68
|
headline: string;
|
|
66
69
|
id: string;
|
|
67
|
-
body:
|
|
70
|
+
body: Body[];
|
|
71
|
+
}[];
|
|
72
|
+
export declare const rssWithBodyMock: string;
|
|
73
|
+
export declare const mockBodyBlocks: ({
|
|
74
|
+
type: string;
|
|
75
|
+
paragraphs: ({
|
|
76
|
+
bold: boolean;
|
|
77
|
+
italic: boolean;
|
|
78
|
+
underline: boolean;
|
|
79
|
+
text: string;
|
|
68
80
|
type: string;
|
|
69
|
-
|
|
70
|
-
bold: boolean;
|
|
71
|
-
italic: boolean;
|
|
72
|
-
underline: boolean;
|
|
73
|
-
text: string;
|
|
74
|
-
type: string;
|
|
75
|
-
url?: undefined;
|
|
76
|
-
} | {
|
|
77
|
-
url: string;
|
|
78
|
-
text: string;
|
|
79
|
-
type: string;
|
|
80
|
-
bold?: undefined;
|
|
81
|
-
italic?: undefined;
|
|
82
|
-
underline?: undefined;
|
|
83
|
-
})[];
|
|
84
|
-
alt?: undefined;
|
|
85
|
-
caption?: undefined;
|
|
86
|
-
credit?: undefined;
|
|
87
|
-
height?: undefined;
|
|
88
|
-
width?: undefined;
|
|
81
|
+
monospace: boolean;
|
|
89
82
|
url?: undefined;
|
|
90
83
|
} | {
|
|
91
|
-
type: string;
|
|
92
|
-
alt: string;
|
|
93
|
-
caption: string;
|
|
94
|
-
credit: string;
|
|
95
|
-
height: string;
|
|
96
|
-
width: string;
|
|
97
84
|
url: string;
|
|
98
|
-
|
|
99
|
-
} | {
|
|
85
|
+
text: string;
|
|
100
86
|
type: string;
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
width: string;
|
|
106
|
-
url: string;
|
|
107
|
-
children?: undefined;
|
|
87
|
+
bold?: undefined;
|
|
88
|
+
italic?: undefined;
|
|
89
|
+
underline?: undefined;
|
|
90
|
+
monospace?: undefined;
|
|
108
91
|
})[];
|
|
109
|
-
|
|
110
|
-
|
|
92
|
+
alt?: undefined;
|
|
93
|
+
caption?: undefined;
|
|
94
|
+
credit?: undefined;
|
|
95
|
+
height?: undefined;
|
|
96
|
+
width?: undefined;
|
|
97
|
+
url?: undefined;
|
|
98
|
+
id?: undefined;
|
|
99
|
+
playerId?: undefined;
|
|
100
|
+
accountId?: undefined;
|
|
101
|
+
level?: undefined;
|
|
102
|
+
children?: undefined;
|
|
103
|
+
items?: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
type: string;
|
|
106
|
+
alt: string;
|
|
107
|
+
caption: string;
|
|
108
|
+
credit: string;
|
|
109
|
+
height: number;
|
|
110
|
+
width: number;
|
|
111
|
+
url: string;
|
|
112
|
+
paragraphs?: undefined;
|
|
113
|
+
id?: undefined;
|
|
114
|
+
playerId?: undefined;
|
|
115
|
+
accountId?: undefined;
|
|
116
|
+
level?: undefined;
|
|
117
|
+
children?: undefined;
|
|
118
|
+
items?: undefined;
|
|
119
|
+
} | {
|
|
120
|
+
type: string;
|
|
121
|
+
id: string;
|
|
122
|
+
paragraphs?: undefined;
|
|
123
|
+
alt?: undefined;
|
|
124
|
+
caption?: undefined;
|
|
125
|
+
credit?: undefined;
|
|
126
|
+
height?: undefined;
|
|
127
|
+
width?: undefined;
|
|
128
|
+
url?: undefined;
|
|
129
|
+
playerId?: undefined;
|
|
130
|
+
accountId?: undefined;
|
|
131
|
+
level?: undefined;
|
|
132
|
+
children?: undefined;
|
|
133
|
+
items?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
type: string;
|
|
136
|
+
url: string;
|
|
137
|
+
paragraphs?: undefined;
|
|
138
|
+
alt?: undefined;
|
|
139
|
+
caption?: undefined;
|
|
140
|
+
credit?: undefined;
|
|
141
|
+
height?: undefined;
|
|
142
|
+
width?: undefined;
|
|
143
|
+
id?: undefined;
|
|
144
|
+
playerId?: undefined;
|
|
145
|
+
accountId?: undefined;
|
|
146
|
+
level?: undefined;
|
|
147
|
+
children?: undefined;
|
|
148
|
+
items?: undefined;
|
|
149
|
+
} | {
|
|
150
|
+
type: string;
|
|
151
|
+
id: string;
|
|
152
|
+
playerId: string;
|
|
153
|
+
accountId: string;
|
|
154
|
+
paragraphs?: undefined;
|
|
155
|
+
alt?: undefined;
|
|
156
|
+
caption?: undefined;
|
|
157
|
+
credit?: undefined;
|
|
158
|
+
height?: undefined;
|
|
159
|
+
width?: undefined;
|
|
160
|
+
url?: undefined;
|
|
161
|
+
level?: undefined;
|
|
162
|
+
children?: undefined;
|
|
163
|
+
items?: undefined;
|
|
164
|
+
} | {
|
|
165
|
+
type: string;
|
|
166
|
+
level: number;
|
|
167
|
+
children: {
|
|
168
|
+
type: string;
|
|
169
|
+
text: string;
|
|
170
|
+
bold: boolean;
|
|
171
|
+
italic: boolean;
|
|
172
|
+
}[];
|
|
173
|
+
paragraphs?: undefined;
|
|
174
|
+
alt?: undefined;
|
|
175
|
+
caption?: undefined;
|
|
176
|
+
credit?: undefined;
|
|
177
|
+
height?: undefined;
|
|
178
|
+
width?: undefined;
|
|
179
|
+
url?: undefined;
|
|
180
|
+
id?: undefined;
|
|
181
|
+
playerId?: undefined;
|
|
182
|
+
accountId?: undefined;
|
|
183
|
+
items?: undefined;
|
|
184
|
+
} | {
|
|
185
|
+
type: string;
|
|
186
|
+
items: {
|
|
187
|
+
type: string;
|
|
188
|
+
text: string;
|
|
189
|
+
bold: boolean;
|
|
190
|
+
italic: boolean;
|
|
191
|
+
}[];
|
|
192
|
+
paragraphs?: undefined;
|
|
193
|
+
alt?: undefined;
|
|
194
|
+
caption?: undefined;
|
|
195
|
+
credit?: undefined;
|
|
196
|
+
height?: undefined;
|
|
197
|
+
width?: undefined;
|
|
198
|
+
url?: undefined;
|
|
199
|
+
id?: undefined;
|
|
200
|
+
playerId?: undefined;
|
|
201
|
+
accountId?: undefined;
|
|
202
|
+
level?: undefined;
|
|
203
|
+
children?: undefined;
|
|
204
|
+
})[];
|
|
205
|
+
export declare const expectedBodyBlocks: string[];
|
|
206
|
+
export declare const mockList: ({
|
|
207
|
+
type: string;
|
|
208
|
+
text: string;
|
|
209
|
+
bold: boolean;
|
|
210
|
+
italic: boolean;
|
|
211
|
+
url?: undefined;
|
|
212
|
+
items?: undefined;
|
|
213
|
+
} | {
|
|
214
|
+
url: string;
|
|
215
|
+
text: string;
|
|
216
|
+
type: string;
|
|
217
|
+
bold?: undefined;
|
|
218
|
+
italic?: undefined;
|
|
219
|
+
items?: undefined;
|
|
220
|
+
} | {
|
|
221
|
+
type: string;
|
|
222
|
+
items: {
|
|
223
|
+
type: string;
|
|
224
|
+
text: string;
|
|
225
|
+
bold: boolean;
|
|
226
|
+
italic: boolean;
|
|
227
|
+
}[];
|
|
228
|
+
text?: undefined;
|
|
229
|
+
bold?: undefined;
|
|
230
|
+
italic?: undefined;
|
|
231
|
+
url?: undefined;
|
|
232
|
+
})[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rssWithBodyMock = exports.articleListWithBodyMock = exports.rssMock = exports.articleListMock = exports.titeAttributesdefaultMock = exports.titeAttributesMock = exports.updatedDateTimeMock = exports.lastBuildDateMock = exports.domainMock = void 0;
|
|
3
|
+
exports.mockList = exports.expectedBodyBlocks = exports.mockBodyBlocks = exports.rssWithBodyMock = exports.articleListWithBodyMock = exports.rssMock = exports.articleListMock = exports.titeAttributesdefaultMock = exports.titeAttributesMock = exports.updatedDateTimeMock = exports.lastBuildDateMock = exports.domainMock = void 0;
|
|
4
4
|
exports.domainMock = 'https://demo.com';
|
|
5
|
-
exports.lastBuildDateMock = new Date().toUTCString();
|
|
5
|
+
exports.lastBuildDateMock = new Date('2022-06-07T00:00:00Z').toUTCString();
|
|
6
6
|
exports.updatedDateTimeMock = 'Tue, 12 Apr 2022 11:17:09 GMT';
|
|
7
7
|
exports.titeAttributesMock = {
|
|
8
8
|
title: 'Demo Site',
|
|
@@ -29,6 +29,7 @@ exports.articleListMock = [
|
|
|
29
29
|
updatedDateTime: '2022-04-12T11:17:09.000Z',
|
|
30
30
|
headline: 'It has survived not only five centuries',
|
|
31
31
|
id: '32596',
|
|
32
|
+
body: [],
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
35
|
categories: [],
|
|
@@ -45,6 +46,7 @@ exports.articleListMock = [
|
|
|
45
46
|
publishedDateTime: '2022-04-04T08:31:44.000Z',
|
|
46
47
|
headline: 'Testing Image Credits',
|
|
47
48
|
id: '32594',
|
|
49
|
+
body: [],
|
|
48
50
|
},
|
|
49
51
|
{
|
|
50
52
|
categories: [{ slug: 'tv-film' }, { slug: 'entertainment' }],
|
|
@@ -61,6 +63,7 @@ exports.articleListMock = [
|
|
|
61
63
|
updatedDateTime: '2022-03-30T10:25:09.000Z',
|
|
62
64
|
headline: 'test publish article after fix deployed',
|
|
63
65
|
id: '32579',
|
|
66
|
+
body: [],
|
|
64
67
|
},
|
|
65
68
|
{
|
|
66
69
|
categories: [{ name: 'test' }],
|
|
@@ -77,6 +80,7 @@ exports.articleListMock = [
|
|
|
77
80
|
updatedDateTime: '2022-03-28T12:15:09.000Z',
|
|
78
81
|
headline: 'Another Test Article',
|
|
79
82
|
id: '32591',
|
|
83
|
+
body: [],
|
|
80
84
|
},
|
|
81
85
|
];
|
|
82
86
|
exports.rssMock = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\"\n xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n xmlns:wfw=\"http://wellformedweb.org/CommentAPI/\"\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:atom=\"http://www.w3.org/2005/Atom\"\n xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n xmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\"\t\n xmlns:georss=\"http://www.georss.org/georss\"\n xmlns:geo=\"http://www.w3.org/2003/01/geo/wgs84_pos#\"\n>\n<channel>\n <title>" + exports.titeAttributesMock.title + "</title>\n <atom:link href=\"" + exports.domainMock + exports.titeAttributesMock.link + "\" rel=\"self\" type=\"application/rss+xml\" />\n <link>" + exports.domainMock + exports.titeAttributesMock.link + "</link>\n <description>" + exports.titeAttributesMock.description + "</description>\n <lastBuildDate>" + exports.lastBuildDateMock + "</lastBuildDate>\n <pubDate>" + exports.updatedDateTimeMock + "</pubDate>\n <language>" + exports.titeAttributesMock.language + "</language>\n <sy:updatePeriod>" + exports.titeAttributesMock.updatePeriod + "</sy:updatePeriod>\n <sy:updateFrequency>" + exports.titeAttributesMock.updateFrequency + "</sy:updateFrequency>\n <generator>Newskit Render</generator>\n <image>\n <url>" + exports.domainMock + exports.titeAttributesMock.logoUrl + "</url>\n <title>" + exports.titeAttributesMock.title + "</title>\n <link>" + exports.domainMock + exports.titeAttributesMock.link + "</link>\n <width>32</width>\n <height>32</height>\n </image>\n <item>\n <title>It has survived not only five centuries</title>\n <link>https://demo.com/entertainment/32596/it-has-survived-not-only-five-centuries</link>\n <pubDate>Mon, 04 Apr 2022 08:50:29 GMT</pubDate>\n <dc:creator><![CDATA[Jim Morrison]]></dc:creator>\n <category><![CDATA[entertainment]]></category>\n <description><![CDATA[]]></description>\n <guid isPermaLink=\"false\">Post 32596 at Demo Site</guid>\n <content:encoded><![CDATA[]]></content:encoded>\n </item>\n <item>\n <title>Testing Image Credits</title>\n <link>https://demo.com/uncategorized/32594/testing-image-credits</link>\n <pubDate>Mon, 04 Apr 2022 08:31:44 GMT</pubDate>\n <dc:creator><![CDATA[Demo Site]]></dc:creator>\n <category><![CDATA[uncategorized]]></category>\n <description><![CDATA[Some test description]]></description>\n <guid isPermaLink=\"false\">Post 32594 at Demo Site</guid>\n <content:encoded><![CDATA[]]></content:encoded>\n </item>\n <item>\n <title>test publish article after fix deployed</title>\n <link>https://demo.com/tv-film/32579/test-publish-article-after-fix-deployed</link>\n <pubDate>Fri, 25 Mar 2022 23:59:00 GMT</pubDate>\n <dc:creator><![CDATA[Janis Joplin]]></dc:creator>\n <category><![CDATA[tv-film]]></category><category><![CDATA[entertainment]]></category>\n <description><![CDATA[Some test description 2]]></description>\n <guid isPermaLink=\"false\">Post 32579 at Demo Site</guid>\n <content:encoded><![CDATA[]]></content:encoded>\n </item>\n <item>\n <title>Another Test Article</title>\n <link>https://demo.com/uncategorized/32591/another-test-article</link>\n <pubDate>Fri, 25 Mar 2022 22:59:00 GMT</pubDate>\n <dc:creator><![CDATA[Demo Site]]></dc:creator>\n <category><![CDATA[uncategorized]]></category>\n <description><![CDATA[Some test description 3]]></description>\n <guid isPermaLink=\"false\">Post 32591 at Demo Site</guid>\n <content:encoded><![CDATA[]]></content:encoded>\n </item>\n \n</channel>\n</rss>\n";
|
|
@@ -93,13 +97,14 @@ exports.articleListWithBodyMock = [
|
|
|
93
97
|
body: [
|
|
94
98
|
{
|
|
95
99
|
type: 'paragraph',
|
|
96
|
-
|
|
100
|
+
paragraphs: [
|
|
97
101
|
{
|
|
98
102
|
bold: true,
|
|
99
103
|
italic: false,
|
|
100
104
|
underline: false,
|
|
101
105
|
text: 'Bold',
|
|
102
106
|
type: 'text',
|
|
107
|
+
monospace: false,
|
|
103
108
|
},
|
|
104
109
|
{
|
|
105
110
|
bold: false,
|
|
@@ -107,6 +112,7 @@ exports.articleListWithBodyMock = [
|
|
|
107
112
|
underline: false,
|
|
108
113
|
text: 'Italic',
|
|
109
114
|
type: 'text',
|
|
115
|
+
monospace: false,
|
|
110
116
|
},
|
|
111
117
|
{
|
|
112
118
|
bold: false,
|
|
@@ -114,6 +120,7 @@ exports.articleListWithBodyMock = [
|
|
|
114
120
|
underline: true,
|
|
115
121
|
text: 'Underline',
|
|
116
122
|
type: 'text',
|
|
123
|
+
monospace: false,
|
|
117
124
|
},
|
|
118
125
|
{
|
|
119
126
|
bold: false,
|
|
@@ -121,6 +128,7 @@ exports.articleListWithBodyMock = [
|
|
|
121
128
|
underline: false,
|
|
122
129
|
text: 'None',
|
|
123
130
|
type: 'text',
|
|
131
|
+
monospace: false,
|
|
124
132
|
},
|
|
125
133
|
{
|
|
126
134
|
bold: true,
|
|
@@ -128,18 +136,20 @@ exports.articleListWithBodyMock = [
|
|
|
128
136
|
underline: true,
|
|
129
137
|
text: 'All',
|
|
130
138
|
type: 'text',
|
|
139
|
+
monospace: false,
|
|
131
140
|
},
|
|
132
141
|
],
|
|
133
142
|
},
|
|
134
143
|
{
|
|
135
144
|
type: 'paragraph',
|
|
136
|
-
|
|
145
|
+
paragraphs: [
|
|
137
146
|
{
|
|
138
147
|
bold: false,
|
|
139
148
|
italic: false,
|
|
140
149
|
underline: false,
|
|
141
150
|
text: 'Something was said ',
|
|
142
151
|
type: 'text',
|
|
152
|
+
monospace: false,
|
|
143
153
|
},
|
|
144
154
|
{
|
|
145
155
|
url: 'htttps://somelink',
|
|
@@ -152,6 +162,7 @@ exports.articleListWithBodyMock = [
|
|
|
152
162
|
underline: false,
|
|
153
163
|
text: 'and then something else',
|
|
154
164
|
type: 'text',
|
|
165
|
+
monospace: false,
|
|
155
166
|
},
|
|
156
167
|
],
|
|
157
168
|
},
|
|
@@ -160,21 +171,177 @@ exports.articleListWithBodyMock = [
|
|
|
160
171
|
alt: 'alt test',
|
|
161
172
|
caption: 'A caption',
|
|
162
173
|
credit: 'A credit',
|
|
163
|
-
height:
|
|
164
|
-
width:
|
|
174
|
+
height: 300,
|
|
175
|
+
width: 500,
|
|
165
176
|
url: 'https://some/image/url',
|
|
166
177
|
},
|
|
167
178
|
{
|
|
168
179
|
type: 'image',
|
|
169
|
-
alt:
|
|
170
|
-
caption:
|
|
171
|
-
credit:
|
|
172
|
-
height:
|
|
173
|
-
width:
|
|
180
|
+
alt: '',
|
|
181
|
+
caption: '',
|
|
182
|
+
credit: '',
|
|
183
|
+
height: 300,
|
|
184
|
+
width: 500,
|
|
174
185
|
url: 'https://some/image/url',
|
|
175
186
|
},
|
|
176
187
|
],
|
|
177
188
|
},
|
|
178
189
|
];
|
|
179
190
|
exports.rssWithBodyMock = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<rss version=\"2.0\"\n xmlns:content=\"http://purl.org/rss/1.0/modules/content/\"\n xmlns:wfw=\"http://wellformedweb.org/CommentAPI/\"\n xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\n xmlns:atom=\"http://www.w3.org/2005/Atom\"\n xmlns:sy=\"http://purl.org/rss/1.0/modules/syndication/\"\n xmlns:slash=\"http://purl.org/rss/1.0/modules/slash/\"\t\n xmlns:georss=\"http://www.georss.org/georss\"\n xmlns:geo=\"http://www.w3.org/2003/01/geo/wgs84_pos#\"\n>\n<channel>\n <title>" + exports.titeAttributesMock.title + "</title>\n <atom:link href=\"" + exports.domainMock + exports.titeAttributesMock.link + "\" rel=\"self\" type=\"application/rss+xml\" />\n <link>" + exports.domainMock + exports.titeAttributesMock.link + "</link>\n <description>" + exports.titeAttributesMock.description + "</description>\n <lastBuildDate>" + exports.lastBuildDateMock + "</lastBuildDate>\n <pubDate>" + exports.updatedDateTimeMock + "</pubDate>\n <language>" + exports.titeAttributesMock.language + "</language>\n <sy:updatePeriod>" + exports.titeAttributesMock.updatePeriod + "</sy:updatePeriod>\n <sy:updateFrequency>" + exports.titeAttributesMock.updateFrequency + "</sy:updateFrequency>\n <generator>Newskit Render</generator>\n <image>\n <url>" + exports.domainMock + exports.titeAttributesMock.logoUrl + "</url>\n <title>" + exports.titeAttributesMock.title + "</title>\n <link>" + exports.domainMock + exports.titeAttributesMock.link + "</link>\n <width>32</width>\n <height>32</height>\n </image>\n <item>\n <title>test publish article after fix deployed</title>\n <link>https://demo.com/tv-film/32579/test-publish-article-after-fix-deployed</link>\n <pubDate>Fri, 25 Mar 2022 23:59:00 GMT</pubDate>\n <dc:creator><![CDATA[Janis Joplin]]></dc:creator>\n <category><![CDATA[tv-film]]></category><category><![CDATA[entertainment]]></category>\n <description><![CDATA[<p><strong>Bold</strong><em>Italic</em><u>Underline</u>None<strong><em><u>All</u></em></strong></p>]]></description>\n <guid isPermaLink=\"false\">Post 32579 at Demo Site</guid>\n <content:encoded><![CDATA[<p><strong>Bold</strong><em>Italic</em><u>Underline</u>None<strong><em><u>All</u></em></strong></p>\n\n<p>Something was said <a href=\"htttps://somelink\">find ourt what here </a>and then something else</p>\n\n<figure><picture><source media=\"screen and (max-width: 479px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 480px) and (max-width: 767px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 768px) and (max-width: 1023px)\" srcset=\"https://some/image/url?w=719&strip=all&crop=1\"><source media=\"screen and (min-width: 1024px) and (max-width: 1439px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 1440px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><img alt='alt test' src='https://some/image/url' width='500' height='300' /><picture><figcaption>A caption</figcaption><figcredit>A credit</figcredit></figure>\n\n<picture><source media=\"screen and (max-width: 479px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 480px) and (max-width: 767px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 768px) and (max-width: 1023px)\" srcset=\"https://some/image/url?w=719&strip=all&crop=1\"><source media=\"screen and (min-width: 1024px) and (max-width: 1439px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 1440px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><img src='https://some/image/url' width='500' height='300' /><picture>]]></content:encoded>\n </item>\n \n</channel>\n</rss>\n";
|
|
191
|
+
exports.mockBodyBlocks = [
|
|
192
|
+
{
|
|
193
|
+
type: 'paragraph',
|
|
194
|
+
paragraphs: [
|
|
195
|
+
{
|
|
196
|
+
bold: false,
|
|
197
|
+
italic: false,
|
|
198
|
+
underline: false,
|
|
199
|
+
text: 'Something was said ',
|
|
200
|
+
type: 'text',
|
|
201
|
+
monospace: false,
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
url: 'htttps://somelink',
|
|
205
|
+
text: 'find ourt what here ',
|
|
206
|
+
type: 'hyperlink',
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
type: 'image',
|
|
212
|
+
alt: '',
|
|
213
|
+
caption: '',
|
|
214
|
+
credit: '',
|
|
215
|
+
height: 300,
|
|
216
|
+
width: 500,
|
|
217
|
+
url: 'https://some/image/url',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
type: 'tweet',
|
|
221
|
+
id: '123456789',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
type: 'instagram',
|
|
225
|
+
id: '123456789',
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
type: 'youtube',
|
|
229
|
+
id: '123456789',
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
type: 'embed',
|
|
233
|
+
url: '/something',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
type: 'video-brightcove',
|
|
237
|
+
id: '123456789',
|
|
238
|
+
playerId: 'default',
|
|
239
|
+
accountId: '456',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
type: 'heading',
|
|
243
|
+
level: 3,
|
|
244
|
+
children: [
|
|
245
|
+
{
|
|
246
|
+
type: 'text',
|
|
247
|
+
text: 'A heading level 3',
|
|
248
|
+
bold: false,
|
|
249
|
+
italic: false,
|
|
250
|
+
},
|
|
251
|
+
],
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
type: 'unordered-list',
|
|
255
|
+
items: [
|
|
256
|
+
{
|
|
257
|
+
type: 'text',
|
|
258
|
+
text: 'Eos et accusamus',
|
|
259
|
+
bold: false,
|
|
260
|
+
italic: false,
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
type: 'text',
|
|
264
|
+
text: 'Expedita distinctio',
|
|
265
|
+
bold: false,
|
|
266
|
+
italic: false,
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
type: 'text',
|
|
270
|
+
text: 'Libero tempore, cum soluta nobis',
|
|
271
|
+
bold: false,
|
|
272
|
+
italic: false,
|
|
273
|
+
},
|
|
274
|
+
],
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
type: 'ordered-list',
|
|
278
|
+
items: [
|
|
279
|
+
{
|
|
280
|
+
type: 'text',
|
|
281
|
+
text: 'Eos ordered',
|
|
282
|
+
bold: false,
|
|
283
|
+
italic: false,
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
type: 'text',
|
|
287
|
+
text: 'Expedita distinctio order',
|
|
288
|
+
bold: false,
|
|
289
|
+
italic: false,
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
type: 'text',
|
|
293
|
+
text: 'Libero tempore, cum soluta nobis order',
|
|
294
|
+
bold: false,
|
|
295
|
+
italic: false,
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
},
|
|
299
|
+
];
|
|
300
|
+
exports.expectedBodyBlocks = [
|
|
301
|
+
"<p>Something was said <a href=\"htttps://somelink\">find ourt what here </a></p>",
|
|
302
|
+
"<picture><source media=\"screen and (max-width: 479px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 480px) and (max-width: 767px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 768px) and (max-width: 1023px)\" srcset=\"https://some/image/url?w=719&strip=all&crop=1\"><source media=\"screen and (min-width: 1024px) and (max-width: 1439px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><source media=\"screen and (min-width: 1440px)\" srcset=\"https://some/image/url?w=0&strip=all&crop=1\"><img src='https://some/image/url' width='500' height='300' /><picture>",
|
|
303
|
+
"<blockquote class=\"twitter-tweet\"><a href=\"https://twitter.com/x/status/123456789\"></a></blockquote> <script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>",
|
|
304
|
+
"<blockquote className=\"instagram-media\" data-instgrm-captioned data-instgrm-version=\"4\"><a href=\"https://instagram.com/p/123456789/\"></a></blockquote>",
|
|
305
|
+
"<iframe src=\"https://www.youtube.com/embed/123456789\"></iframe>",
|
|
306
|
+
'<iframe src=/something></iframe>',
|
|
307
|
+
"<iframe src=\"https://players.brightcove.net/456/default_default/index.html?videoId=123456789\" allow=\"encrypted-media\"></iframe>",
|
|
308
|
+
'<h3>A heading level 3</h3>',
|
|
309
|
+
'<ul><li>Eos et accusamus</li><li>Expedita distinctio</li><li>Libero tempore, cum soluta nobis</li></ul>',
|
|
310
|
+
"<ol><li>Eos ordered</li><li>Expedita distinctio order</li><li>Libero tempore, cum soluta nobis order</li></ol>",
|
|
311
|
+
];
|
|
312
|
+
exports.mockList = [
|
|
313
|
+
{
|
|
314
|
+
type: 'text',
|
|
315
|
+
text: 'Libero tempore, cum soluta nobis order',
|
|
316
|
+
bold: false,
|
|
317
|
+
italic: false,
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
url: 'htttps://somelink',
|
|
321
|
+
text: 'find ourt what here ',
|
|
322
|
+
type: 'hyperlink',
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
type: 'ordered-list',
|
|
326
|
+
items: [
|
|
327
|
+
{
|
|
328
|
+
type: 'text',
|
|
329
|
+
text: 'Eos et accusamus',
|
|
330
|
+
bold: false,
|
|
331
|
+
italic: false,
|
|
332
|
+
},
|
|
333
|
+
],
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
type: 'unordered-list',
|
|
337
|
+
items: [
|
|
338
|
+
{
|
|
339
|
+
type: 'text',
|
|
340
|
+
text: 'Eos et accusamus ordered',
|
|
341
|
+
bold: false,
|
|
342
|
+
italic: false,
|
|
343
|
+
},
|
|
344
|
+
],
|
|
345
|
+
},
|
|
346
|
+
];
|
|
180
347
|
//# sourceMappingURL=mocks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../../../src/rss/__tests__/mocks.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,kBAAkB,CAAA;AAC/B,QAAA,iBAAiB,GAAG,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"mocks.js","sourceRoot":"","sources":["../../../../src/rss/__tests__/mocks.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,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}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HeadingBlock, HyperlinkBlock, TextBlock } from '../types';
|
|
2
|
+
export declare const createTextBlock: (textBlock: TextBlock) => string;
|
|
3
|
+
export declare const createHyperlinkBlock: (hyperlinkBlock: HyperlinkBlock) => string;
|
|
4
|
+
export declare const createHeadingBlock: (heading: HeadingBlock) => string;
|
|
5
|
+
export declare const createTweetBlock: (id: string) => string;
|
|
6
|
+
export declare const createYoutubeBlock: (id: string) => string;
|
|
7
|
+
export declare const createInstagramBlock: (id: string) => string;
|
|
8
|
+
export declare const createEmbedBlock: (url: string) => string;
|
|
9
|
+
export declare const createVideoBrightcoveBlock: (id: string, accountId: string, playerId: string) => string;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createVideoBrightcoveBlock = exports.createEmbedBlock = exports.createInstagramBlock = exports.createYoutubeBlock = exports.createTweetBlock = exports.createHeadingBlock = exports.createHyperlinkBlock = exports.createTextBlock = void 0;
|
|
4
|
+
var createTextBlock = function (textBlock) {
|
|
5
|
+
var bold = textBlock.bold, italic = textBlock.italic, underline = textBlock.underline, text = textBlock.text;
|
|
6
|
+
var buildOpeningTags = function () {
|
|
7
|
+
return "" + (bold ? '<strong>' : '') + (italic ? "<em>" : '') + (underline ? '<u>' : '');
|
|
8
|
+
};
|
|
9
|
+
var buildClosingTags = function () {
|
|
10
|
+
return "" + (underline ? '</u>' : '') + (italic ? "</em>" : '') + (bold ? '</strong>' : '');
|
|
11
|
+
};
|
|
12
|
+
var result = "" + buildOpeningTags() + text + buildClosingTags();
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
exports.createTextBlock = createTextBlock;
|
|
16
|
+
var createHyperlinkBlock = function (hyperlinkBlock) {
|
|
17
|
+
return "<a href=\"" + hyperlinkBlock.url + "\">" + hyperlinkBlock.text + "</a>";
|
|
18
|
+
};
|
|
19
|
+
exports.createHyperlinkBlock = createHyperlinkBlock;
|
|
20
|
+
var renderChildren = function (children) {
|
|
21
|
+
return children.map(function (child) { return (0, exports.createTextBlock)(child); });
|
|
22
|
+
};
|
|
23
|
+
var createHeadingBlock = function (heading) {
|
|
24
|
+
return "<h" + heading.level + ">" + renderChildren(heading.children) + "</h" + heading.level + ">";
|
|
25
|
+
};
|
|
26
|
+
exports.createHeadingBlock = createHeadingBlock;
|
|
27
|
+
var createTweetBlock = function (id) {
|
|
28
|
+
return "<blockquote class=\"twitter-tweet\"><a href=\"https://twitter.com/x/status/" + id + "\"></a></blockquote> <script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>";
|
|
29
|
+
};
|
|
30
|
+
exports.createTweetBlock = createTweetBlock;
|
|
31
|
+
var createYoutubeBlock = function (id) {
|
|
32
|
+
return "<iframe src=\"https://www.youtube.com/embed/" + id + "\"></iframe>";
|
|
33
|
+
};
|
|
34
|
+
exports.createYoutubeBlock = createYoutubeBlock;
|
|
35
|
+
var createInstagramBlock = function (id) {
|
|
36
|
+
return "<blockquote className=\"instagram-media\" data-instgrm-captioned data-instgrm-version=\"4\"><a href=\"https://instagram.com/p/" + id + "/\"></a></blockquote>";
|
|
37
|
+
};
|
|
38
|
+
exports.createInstagramBlock = createInstagramBlock;
|
|
39
|
+
var createEmbedBlock = function (url) {
|
|
40
|
+
return "<iframe src=" + url + "></iframe>";
|
|
41
|
+
};
|
|
42
|
+
exports.createEmbedBlock = createEmbedBlock;
|
|
43
|
+
var createVideoBrightcoveBlock = function (id, accountId, playerId) {
|
|
44
|
+
return "<iframe src=\"https://players.brightcove.net/" + accountId + "/" + playerId + "_default/index.html?videoId=" + id + "\" allow=\"encrypted-media\"></iframe>";
|
|
45
|
+
};
|
|
46
|
+
exports.createVideoBrightcoveBlock = createVideoBrightcoveBlock;
|
|
47
|
+
//# sourceMappingURL=createBlockElements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createBl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,kBAAkB,GAAG,UAAC,OAAqB;IACtD,OAAA,OAAK,OAAO,CAAC,KAAK,SAAI,cAAc,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAM,OAAO,CAAC,KAAK,MAAG;AAA5E,CAA4E,CAAA;AADjE,QAAA,kBAAkB,sBAC+C;AAEvE,IAAM,gBAAgB,GAAG,UAAC,EAAU;IACzC,OAAA,gFAA2E,EAAE,mHAA2G;AAAxL,CAAwL,CAAA;AAD7K,QAAA,gBAAgB,oBAC6J;AAEnL,IAAM,kBAAkB,GAAG,UAAC,EAAU;IAC3C,OAAA,iDAA8C,EAAE,iBAAa;AAA7D,CAA6D,CAAA;AADlD,QAAA,kBAAkB,sBACgC;AAExD,IAAM,oBAAoB,GAAG,UAAC,EAAU;IAC7C,OAAA,mIAA4H,EAAE,0BAAsB;AAApJ,CAAoJ,CAAA;AADzI,QAAA,oBAAoB,wBACqH;AAE/I,IAAM,gBAAgB,GAAG,UAAC,GAAW;IAC1C,OAAA,iBAAe,GAAG,eAAY;AAA9B,CAA8B,CAAA;AADnB,QAAA,gBAAgB,oBACG;AAEzB,IAAM,0BAA0B,GAAG,UACxC,EAAU,EACV,SAAiB,EACjB,QAAgB;IAEhB,OAAA,kDAA+C,SAAS,SAAI,QAAQ,oCAA+B,EAAE,2CAAqC;AAA1I,CAA0I,CAAA;AAL/H,QAAA,0BAA0B,8BAKqG"}
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createContentEncoded = void 0;
|
|
4
|
-
var
|
|
4
|
+
var buildBodyDataTypesMap_1 = require("../helpers/buildBodyDataTypesMap");
|
|
5
5
|
var createContentEncoded = function (body, imageSourceSizes) {
|
|
6
|
-
var contentArray =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
});
|
|
6
|
+
var contentArray = body.map(function (bodyItem) {
|
|
7
|
+
if (bodyItem.type === 'image') {
|
|
8
|
+
return buildBodyDataTypesMap_1.bodyDataTypesMap.image(bodyItem, imageSourceSizes);
|
|
9
|
+
}
|
|
10
|
+
if (buildBodyDataTypesMap_1.bodyDataTypesMap[bodyItem.type]) {
|
|
11
|
+
return buildBodyDataTypesMap_1.bodyDataTypesMap[bodyItem.type](bodyItem);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
16
14
|
return contentArray;
|
|
17
15
|
};
|
|
18
16
|
exports.createContentEncoded = createContentEncoded;
|