@newskit-render/core 1.90.1 → 1.91.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/CHANGELOG.md +16 -0
- package/__tests__/pages/__snapshots__/[articleSlug].test.tsx.snap +129 -106
- package/__tests__/pages/__snapshots__/brightcove.test.tsx.snap +1 -1
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +78 -77
- package/__tests__/pages/__snapshots__/relatedArticles.test.tsx.snap +15 -14
- package/app-context/InstrumentationContextProvider.tsx +1 -0
- package/components/ErrorPage/ErrorPage.tsx +4 -1
- package/components/article/Highlights.tsx +1 -3
- package/components/article/RelatedArticles.tsx +3 -11
- package/components/article/RelatedTopics.tsx +2 -2
- package/components/article/ShareBarComponent.tsx +9 -7
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +155 -132
- package/components/article/index.tsx +2 -3
- package/components/common/ShareButton.tsx +5 -1
- package/components/common/ViewMoreButton.tsx +5 -1
- package/components/common/icons/IconFilledTwitter.tsx +14 -0
- package/components/common/icons/StyledIconFilledChevronRight.tsx +5 -1
- package/components/footer/__snapshots__/index.test.tsx.snap +8 -8
- package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +12 -12
- package/components/section/layouts/__tests__/__snapshots__/SectionTitle.test.tsx.snap +15 -12
- package/context/multi-tenancy/index.tsx +1 -0
- package/cypress/e2e/account/payment-failer.spec.js +3 -0
- package/cypress/support/commands.js +4 -1
- package/helpers/__tests__/getRecommendation.test.ts +8 -10
- package/helpers/mocks/getRecommendationsMock.ts +1 -1
- package/jest.config.js +3 -0
- package/package.json +27 -22
- package/pages/_app.tsx +2 -1
- package/pages/_document.tsx +41 -39
- package/pages/preview/[articleId]/version/[versionId]/index.tsx +4 -1
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
VideoPlayer,
|
|
8
8
|
Visible,
|
|
9
9
|
Stack,
|
|
10
|
-
AlignSelfValues,
|
|
11
10
|
styled,
|
|
12
11
|
StackChild,
|
|
13
12
|
Headline,
|
|
@@ -221,7 +220,7 @@ const ArticlePage: React.FC<ArticleProps> = ({
|
|
|
221
220
|
updatedDateTime={updatedDateTime}
|
|
222
221
|
topics={topics}
|
|
223
222
|
/>
|
|
224
|
-
<StackChild alignSelf=
|
|
223
|
+
<StackChild alignSelf="flex-end">
|
|
225
224
|
<ShareBarComponent />
|
|
226
225
|
</StackChild>
|
|
227
226
|
</Stack>
|
|
@@ -303,7 +302,7 @@ const ArticlePage: React.FC<ArticleProps> = ({
|
|
|
303
302
|
<Block spaceStack="space100">
|
|
304
303
|
<Stack
|
|
305
304
|
flow="horizontal-bottom"
|
|
306
|
-
stackDistribution=
|
|
305
|
+
stackDistribution="flex-end"
|
|
307
306
|
wrap="nowrap"
|
|
308
307
|
spaceInline="space060"
|
|
309
308
|
>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Button,
|
|
2
|
+
import { Button, toNewsKitIcon } from 'newskit'
|
|
3
|
+
|
|
4
|
+
import { Share as FilledShare } from '@emotion-icons/material/Share'
|
|
5
|
+
|
|
6
|
+
const IconFilledShare = toNewsKitIcon(FilledShare)
|
|
3
7
|
|
|
4
8
|
const ShareButton = () => (
|
|
5
9
|
<Button
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Button,
|
|
2
|
+
import { Button, toNewsKitIcon } from 'newskit'
|
|
3
|
+
|
|
4
|
+
import { ChevronRight as FilledChevronRight } from '@emotion-icons/material/ChevronRight'
|
|
5
|
+
|
|
6
|
+
const IconFilledChevronRight = toNewsKitIcon(FilledChevronRight)
|
|
3
7
|
|
|
4
8
|
const ViewMoreButton: React.FC<{ href: string }> = ({ href }) => (
|
|
5
9
|
<Button
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Svg, customToNewsKitIcon } from 'newskit'
|
|
3
|
+
|
|
4
|
+
export const IconFilledTwitter = customToNewsKitIcon(
|
|
5
|
+
'IconFilledTwitter',
|
|
6
|
+
(props) => (
|
|
7
|
+
<Svg {...props} viewBox="0 0 24 24">
|
|
8
|
+
<path
|
|
9
|
+
fillRule="nonzero"
|
|
10
|
+
d="M8.28984,21 C15.83736,21 19.96472,14.4602319 19.96472,8.78946539 C19.96472,8.60363327 19.96112,8.41863784 19.95296,8.23464647 C20.75408,7.62895589 21.45056,6.87316048 22,6.01260963 C21.26472,6.35415252 20.47352,6.58441367 19.64352,6.68816506 C20.49072,6.15702487 21.14112,5.31630393 21.44784,4.31426631 C20.65488,4.80583036 19.77704,5.1633543 18.8424,5.35588007 C18.09368,4.52176909 17.02728,4 15.84728,4 C13.58104,4 11.74336,5.92199451 11.74336,8.29129138 C11.74336,8.62814872 11.77944,8.95555129 11.84976,9.2698176 C8.4396,9.09051177 5.4156,7.38271368 3.392,4.78600045 C3.03928,5.42005532 2.83632,6.15702487 2.83632,6.94294166 C2.83632,8.43194145 3.56072,9.74632096 4.66224,10.5152526 C3.98928,10.493582 3.35688,10.3001358 2.80384,9.97833919 C2.80288,9.99624467 2.80288,10.0142338 2.80288,10.0330597 C2.80288,12.111769 4.21752,13.8469273 6.09488,14.2404296 C5.75032,14.3384914 5.3876,14.3913711 5.0132,14.3913711 C4.74888,14.3913711 4.49176,14.3640109 4.24184,14.3139759 C4.76424,16.0190129 6.27896,17.2597624 8.07512,17.2947366 C6.67048,18.4457914 4.90136,19.1317219 2.97888,19.1317219 C2.64776,19.1317219 2.3212,19.1119757 2,19.0723159 C3.81608,20.2894703 5.97224,21 8.28984,21"
|
|
11
|
+
/>
|
|
12
|
+
</Svg>
|
|
13
|
+
)
|
|
14
|
+
)
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { styled, toNewsKitIcon } from 'newskit'
|
|
2
|
+
|
|
3
|
+
import { ChevronRight as FilledChevronRight } from '@emotion-icons/material/ChevronRight'
|
|
4
|
+
|
|
5
|
+
const IconFilledChevronRight = toNewsKitIcon(FilledChevronRight)
|
|
2
6
|
|
|
3
7
|
const StyledIconFilledChevronRight = styled(IconFilledChevronRight)`
|
|
4
8
|
top: 1px;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`Footer tests should render footer 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
<div
|
|
6
|
-
class="css-
|
|
6
|
+
class="css-sxhtf1"
|
|
7
7
|
>
|
|
8
8
|
<div
|
|
9
9
|
class="css-8atxkm"
|
|
@@ -67,7 +67,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
67
67
|
class="css-17x5lw"
|
|
68
68
|
>
|
|
69
69
|
<span
|
|
70
|
-
class="css-
|
|
70
|
+
class="css-yk25sg"
|
|
71
71
|
>
|
|
72
72
|
NavLink One
|
|
73
73
|
</span>
|
|
@@ -86,7 +86,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
86
86
|
class="css-17x5lw"
|
|
87
87
|
>
|
|
88
88
|
<span
|
|
89
|
-
class="css-
|
|
89
|
+
class="css-yk25sg"
|
|
90
90
|
>
|
|
91
91
|
NavLink Two
|
|
92
92
|
</span>
|
|
@@ -105,7 +105,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
105
105
|
class="css-17x5lw"
|
|
106
106
|
>
|
|
107
107
|
<span
|
|
108
|
-
class="css-
|
|
108
|
+
class="css-yk25sg"
|
|
109
109
|
>
|
|
110
110
|
NavLink Three
|
|
111
111
|
</span>
|
|
@@ -124,7 +124,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
124
124
|
class="css-17x5lw"
|
|
125
125
|
>
|
|
126
126
|
<span
|
|
127
|
-
class="css-
|
|
127
|
+
class="css-yk25sg"
|
|
128
128
|
>
|
|
129
129
|
NavLink Four
|
|
130
130
|
</span>
|
|
@@ -143,7 +143,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
143
143
|
class="css-17x5lw"
|
|
144
144
|
>
|
|
145
145
|
<span
|
|
146
|
-
class="css-
|
|
146
|
+
class="css-yk25sg"
|
|
147
147
|
>
|
|
148
148
|
NavLink Five
|
|
149
149
|
</span>
|
|
@@ -162,7 +162,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
162
162
|
class="css-17x5lw"
|
|
163
163
|
>
|
|
164
164
|
<span
|
|
165
|
-
class="css-
|
|
165
|
+
class="css-yk25sg"
|
|
166
166
|
>
|
|
167
167
|
NavLink Six
|
|
168
168
|
</span>
|
|
@@ -180,7 +180,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
180
180
|
/>
|
|
181
181
|
</div>
|
|
182
182
|
<p
|
|
183
|
-
class="css-
|
|
183
|
+
class="css-tiln3q"
|
|
184
184
|
>
|
|
185
185
|
Copyright © YYYY News Corp. All rights reserved.
|
|
186
186
|
</p>
|
|
@@ -11,7 +11,7 @@ exports[`Lead should render Lead 1`] = `
|
|
|
11
11
|
data-testid="featureVerticalCell"
|
|
12
12
|
>
|
|
13
13
|
<div
|
|
14
|
-
class="css-
|
|
14
|
+
class="css-1v4r5rv"
|
|
15
15
|
>
|
|
16
16
|
<div
|
|
17
17
|
class="css-x4egtb"
|
|
@@ -36,14 +36,14 @@ exports[`Lead should render Lead 1`] = `
|
|
|
36
36
|
class="css-7q4xyp"
|
|
37
37
|
>
|
|
38
38
|
<a
|
|
39
|
-
class="nk-card-link css-
|
|
39
|
+
class="nk-card-link css-j3tblu"
|
|
40
40
|
href="catagory-one/demo-1/test-headline"
|
|
41
41
|
>
|
|
42
42
|
<section
|
|
43
|
-
class="css-
|
|
43
|
+
class="css-1jxtwhc"
|
|
44
44
|
>
|
|
45
45
|
<h3
|
|
46
|
-
class="nk-headline-heading css-
|
|
46
|
+
class="nk-headline-heading css-l6hs79"
|
|
47
47
|
>
|
|
48
48
|
test headline
|
|
49
49
|
</h3>
|
|
@@ -62,7 +62,7 @@ exports[`Lead should render Lead 1`] = `
|
|
|
62
62
|
data-testid="titleVerticalCell-0"
|
|
63
63
|
>
|
|
64
64
|
<div
|
|
65
|
-
class="css-
|
|
65
|
+
class="css-1z995g"
|
|
66
66
|
>
|
|
67
67
|
<div
|
|
68
68
|
class="css-1rsw0n0"
|
|
@@ -87,14 +87,14 @@ exports[`Lead should render Lead 1`] = `
|
|
|
87
87
|
class="css-165k7dq"
|
|
88
88
|
>
|
|
89
89
|
<a
|
|
90
|
-
class="nk-card-link css-
|
|
90
|
+
class="nk-card-link css-j3tblu"
|
|
91
91
|
href="catagory-two/demo-2/test-headline-2"
|
|
92
92
|
>
|
|
93
93
|
<section
|
|
94
|
-
class="css-
|
|
94
|
+
class="css-4kc5mr"
|
|
95
95
|
>
|
|
96
96
|
<h3
|
|
97
|
-
class="nk-headline-heading css-
|
|
97
|
+
class="nk-headline-heading css-l6hs79"
|
|
98
98
|
>
|
|
99
99
|
test headline 2
|
|
100
100
|
</h3>
|
|
@@ -110,7 +110,7 @@ exports[`Lead should render Lead 1`] = `
|
|
|
110
110
|
data-testid="titleVerticalCell-1"
|
|
111
111
|
>
|
|
112
112
|
<div
|
|
113
|
-
class="css-
|
|
113
|
+
class="css-1z995g"
|
|
114
114
|
>
|
|
115
115
|
<div
|
|
116
116
|
class="css-1rsw0n0"
|
|
@@ -135,14 +135,14 @@ exports[`Lead should render Lead 1`] = `
|
|
|
135
135
|
class="css-165k7dq"
|
|
136
136
|
>
|
|
137
137
|
<a
|
|
138
|
-
class="nk-card-link css-
|
|
138
|
+
class="nk-card-link css-j3tblu"
|
|
139
139
|
href="catagory-three/demo-3/test-headline-3"
|
|
140
140
|
>
|
|
141
141
|
<section
|
|
142
|
-
class="css-
|
|
142
|
+
class="css-4kc5mr"
|
|
143
143
|
>
|
|
144
144
|
<h3
|
|
145
|
-
class="nk-headline-heading css-
|
|
145
|
+
class="nk-headline-heading css-l6hs79"
|
|
146
146
|
>
|
|
147
147
|
test headline 3
|
|
148
148
|
</h3>
|
|
@@ -13,10 +13,10 @@ exports[`SectionTitle SectionTitle alternative titlebar 1`] = `
|
|
|
13
13
|
class="css-krscqv"
|
|
14
14
|
>
|
|
15
15
|
<section
|
|
16
|
-
class="css-
|
|
16
|
+
class="css-3bvy7k"
|
|
17
17
|
>
|
|
18
18
|
<h3
|
|
19
|
-
class="nk-headline-heading css-
|
|
19
|
+
class="nk-headline-heading css-b3iww6"
|
|
20
20
|
>
|
|
21
21
|
Section 1
|
|
22
22
|
</h3>
|
|
@@ -26,7 +26,7 @@ exports[`SectionTitle SectionTitle alternative titlebar 1`] = `
|
|
|
26
26
|
class="css-1h0bvuz"
|
|
27
27
|
>
|
|
28
28
|
<a
|
|
29
|
-
class="css-
|
|
29
|
+
class="css-3gj75m"
|
|
30
30
|
href="/section-one"
|
|
31
31
|
>
|
|
32
32
|
<span
|
|
@@ -36,7 +36,7 @@ exports[`SectionTitle SectionTitle alternative titlebar 1`] = `
|
|
|
36
36
|
class="css-1o99qvy"
|
|
37
37
|
>
|
|
38
38
|
<span
|
|
39
|
-
class="css-
|
|
39
|
+
class="css-14vfegn"
|
|
40
40
|
>
|
|
41
41
|
Link
|
|
42
42
|
</span>
|
|
@@ -46,9 +46,10 @@ exports[`SectionTitle SectionTitle alternative titlebar 1`] = `
|
|
|
46
46
|
>
|
|
47
47
|
<svg
|
|
48
48
|
aria-hidden="true"
|
|
49
|
-
class="css-
|
|
49
|
+
class="css-19o8to0-EmotionIconBase ex0cdmw0"
|
|
50
50
|
fill="currentColor"
|
|
51
51
|
focusable="false"
|
|
52
|
+
overrides="[object Object]"
|
|
52
53
|
viewBox="0 0 24 24"
|
|
53
54
|
xmlns="http://www.w3.org/2000/svg"
|
|
54
55
|
>
|
|
@@ -82,7 +83,7 @@ exports[`SectionTitle SectionTitle with title 1`] = `
|
|
|
82
83
|
class="css-krscqv"
|
|
83
84
|
>
|
|
84
85
|
<section
|
|
85
|
-
class="css-
|
|
86
|
+
class="css-3bvy7k"
|
|
86
87
|
>
|
|
87
88
|
<h3
|
|
88
89
|
class="nk-headline-heading css-4eltk5"
|
|
@@ -105,7 +106,7 @@ exports[`SectionTitle SectionTitle with title 1`] = `
|
|
|
105
106
|
class="css-1o99qvy"
|
|
106
107
|
>
|
|
107
108
|
<span
|
|
108
|
-
class="css-
|
|
109
|
+
class="css-14vfegn"
|
|
109
110
|
>
|
|
110
111
|
Link
|
|
111
112
|
</span>
|
|
@@ -115,9 +116,10 @@ exports[`SectionTitle SectionTitle with title 1`] = `
|
|
|
115
116
|
>
|
|
116
117
|
<svg
|
|
117
118
|
aria-hidden="true"
|
|
118
|
-
class="css-
|
|
119
|
+
class="css-19o8to0-EmotionIconBase ex0cdmw0"
|
|
119
120
|
fill="currentColor"
|
|
120
121
|
focusable="false"
|
|
122
|
+
overrides="[object Object]"
|
|
121
123
|
viewBox="0 0 24 24"
|
|
122
124
|
xmlns="http://www.w3.org/2000/svg"
|
|
123
125
|
>
|
|
@@ -146,7 +148,7 @@ exports[`SectionTitle SectionTitle without extra space 1`] = `
|
|
|
146
148
|
>
|
|
147
149
|
<hr
|
|
148
150
|
aria-hidden="true"
|
|
149
|
-
class="css-
|
|
151
|
+
class="css-90bet9"
|
|
150
152
|
data-testid="divider"
|
|
151
153
|
/>
|
|
152
154
|
</div>
|
|
@@ -161,7 +163,7 @@ exports[`SectionTitle SectionTitle without extra space 1`] = `
|
|
|
161
163
|
class="css-krscqv"
|
|
162
164
|
>
|
|
163
165
|
<section
|
|
164
|
-
class="css-
|
|
166
|
+
class="css-3bvy7k"
|
|
165
167
|
>
|
|
166
168
|
<h3
|
|
167
169
|
class="nk-headline-heading css-4eltk5"
|
|
@@ -184,7 +186,7 @@ exports[`SectionTitle SectionTitle without extra space 1`] = `
|
|
|
184
186
|
class="css-1o99qvy"
|
|
185
187
|
>
|
|
186
188
|
<span
|
|
187
|
-
class="css-
|
|
189
|
+
class="css-14vfegn"
|
|
188
190
|
>
|
|
189
191
|
Link
|
|
190
192
|
</span>
|
|
@@ -194,9 +196,10 @@ exports[`SectionTitle SectionTitle without extra space 1`] = `
|
|
|
194
196
|
>
|
|
195
197
|
<svg
|
|
196
198
|
aria-hidden="true"
|
|
197
|
-
class="css-
|
|
199
|
+
class="css-19o8to0-EmotionIconBase ex0cdmw0"
|
|
198
200
|
fill="currentColor"
|
|
199
201
|
focusable="false"
|
|
202
|
+
overrides="[object Object]"
|
|
200
203
|
viewBox="0 0 24 24"
|
|
201
204
|
xmlns="http://www.w3.org/2000/svg"
|
|
202
205
|
>
|
|
@@ -2,16 +2,6 @@ import { Publisher } from '@newskit-render/api'
|
|
|
2
2
|
import { getRecommendations, fetcher } from '../getRecommendations'
|
|
3
3
|
import { recomendationsMock } from '../mocks/getRecommendationsMock'
|
|
4
4
|
|
|
5
|
-
jest.mock('../getRecommendations', () => {
|
|
6
|
-
return {
|
|
7
|
-
fetcher: jest.fn().mockImplementationOnce(() => {
|
|
8
|
-
return recomendationsMock
|
|
9
|
-
}),
|
|
10
|
-
getRecommendations: jest.fn().mockImplementationOnce(() => {
|
|
11
|
-
return recomendationsMock
|
|
12
|
-
}),
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
5
|
jest.mock('@newskit-render/standalone-components', () => {
|
|
16
6
|
return {
|
|
17
7
|
recommendationsProvider: jest.fn().mockResolvedValueOnce([
|
|
@@ -54,10 +44,18 @@ describe('getRecommendations function', () => {
|
|
|
54
44
|
})
|
|
55
45
|
describe('fetcher function', () => {
|
|
56
46
|
it('should retun json object', async () => {
|
|
47
|
+
global.fetch = jest.fn().mockImplementation(() => {
|
|
48
|
+
return {
|
|
49
|
+
json: () => recomendationsMock,
|
|
50
|
+
}
|
|
51
|
+
})
|
|
57
52
|
const result = await fetcher({
|
|
58
53
|
url: 'http://localhost:3000',
|
|
59
54
|
args: { articleId: 'test-2' },
|
|
60
55
|
})
|
|
61
56
|
expect(result).toEqual(recomendationsMock)
|
|
57
|
+
// @ts-ignore
|
|
58
|
+
global.fetch.mockClear()
|
|
59
|
+
delete global.fetch
|
|
62
60
|
})
|
|
63
61
|
})
|
package/jest.config.js
CHANGED
|
@@ -32,6 +32,9 @@ const customJestConfig = {
|
|
|
32
32
|
'<rootDir>/node_modules/',
|
|
33
33
|
'<rootDir>/.next/'
|
|
34
34
|
],
|
|
35
|
+
coveragePathIgnorePatterns: [
|
|
36
|
+
'<rootDir>/config/environment.ts'
|
|
37
|
+
]
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.91.0-alpha.0",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -34,23 +34,27 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@apollo/client": "3.4.16",
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@newskit-render/
|
|
42
|
-
"@newskit-render/
|
|
43
|
-
"@newskit-render/
|
|
44
|
-
"@newskit-render/
|
|
45
|
-
"@newskit-render/
|
|
37
|
+
"@emotion-icons/material": "3.14.0",
|
|
38
|
+
"@emotion-icons/material-outlined": "3.14.0",
|
|
39
|
+
"@emotion/react": "11.10.4",
|
|
40
|
+
"@emotion/styled": "11.10.4",
|
|
41
|
+
"@newskit-render/api": "^0.38.0-alpha.0",
|
|
42
|
+
"@newskit-render/auth": "^0.46.0-alpha.0",
|
|
43
|
+
"@newskit-render/checkout": "^0.55.0-alpha.0",
|
|
44
|
+
"@newskit-render/feature-flags": "^0.26.0-alpha.0",
|
|
45
|
+
"@newskit-render/feed": "^0.28.0-alpha.0",
|
|
46
|
+
"@newskit-render/my-account": "^2.10.0-alpha.0",
|
|
47
|
+
"@newskit-render/shared-components": "^0.75.0-alpha.0",
|
|
48
|
+
"@newskit-render/standalone-components": "^0.37.0-alpha.0",
|
|
49
|
+
"@newskit-render/validation": "^0.55.0-alpha.0",
|
|
46
50
|
"cross-fetch": "3.1.5",
|
|
47
51
|
"graphql": "15.6.0",
|
|
48
52
|
"lodash.get": "4.4.2",
|
|
49
53
|
"newrelic": "7.1.0",
|
|
50
|
-
"newskit": "
|
|
51
|
-
"next": "12.
|
|
52
|
-
"react": "
|
|
53
|
-
"react-dom": "
|
|
54
|
+
"newskit": "6.0.0",
|
|
55
|
+
"next": "12.3.0",
|
|
56
|
+
"react": "18.2.0",
|
|
57
|
+
"react-dom": "18.2.0",
|
|
54
58
|
"react-helmet": "6.1.0",
|
|
55
59
|
"swr": "1.3.0"
|
|
56
60
|
},
|
|
@@ -60,10 +64,11 @@
|
|
|
60
64
|
"@emotion/jest": "11.3.0",
|
|
61
65
|
"@next/bundle-analyzer": "12.0.8",
|
|
62
66
|
"@pact-foundation/pact": "9.12.1",
|
|
63
|
-
"@testing-library/jest-dom": "5.
|
|
64
|
-
"@testing-library/react": "
|
|
67
|
+
"@testing-library/jest-dom": "5.16.5",
|
|
68
|
+
"@testing-library/react": "13.4.0",
|
|
65
69
|
"@types/newrelic": "7.0.0",
|
|
66
|
-
"@types/react": "
|
|
70
|
+
"@types/react": "18.0.19",
|
|
71
|
+
"@types/react-dom": "18.0.6",
|
|
67
72
|
"@types/react-helmet": "6.1.0",
|
|
68
73
|
"@typescript-eslint/eslint-plugin": "3.7.1",
|
|
69
74
|
"@typescript-eslint/parser": "3.7.1",
|
|
@@ -94,7 +99,7 @@
|
|
|
94
99
|
"prettier-eslint": "11.0.0",
|
|
95
100
|
"prettier-eslint-cli": "5.0.0",
|
|
96
101
|
"ts-jest": "27.1.3",
|
|
97
|
-
"typescript": "4.
|
|
102
|
+
"typescript": "4.8.3",
|
|
98
103
|
"wait-on": "5.3.0"
|
|
99
104
|
},
|
|
100
105
|
"precommit": [
|
|
@@ -109,11 +114,11 @@
|
|
|
109
114
|
"access": "public"
|
|
110
115
|
},
|
|
111
116
|
"resolutions": {
|
|
112
|
-
"@types/react": "
|
|
113
|
-
"@types/react-dom": "
|
|
117
|
+
"@types/react": "18.0.19",
|
|
118
|
+
"@types/react-dom": "18.0.6"
|
|
114
119
|
},
|
|
115
120
|
"overrides": {
|
|
116
|
-
"@types/react": "
|
|
117
|
-
"@types/react-dom": "
|
|
121
|
+
"@types/react": "18.0.19",
|
|
122
|
+
"@types/react-dom": "18.0.6"
|
|
118
123
|
}
|
|
119
124
|
}
|
package/pages/_app.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import React from 'react'
|
|
2
3
|
import { AppContext as AppContextType, AppProps } from 'next/app'
|
|
3
4
|
import Head from 'next/head'
|
|
@@ -58,7 +59,7 @@ function MyApp({ Component, pageProps, featureFlags, tenant }: MyAppProps) {
|
|
|
58
59
|
</Head>
|
|
59
60
|
<InstrumentationContextProvider>
|
|
60
61
|
<FeatureFlagsContextProvider context={featureFlags}>
|
|
61
|
-
<SessionProvider pageProps={pageProps}>
|
|
62
|
+
<SessionProvider pageProps={(pageProps as unknown) as any}>
|
|
62
63
|
<AppContext.Consumer>
|
|
63
64
|
{({ theme }) => (
|
|
64
65
|
<ThemeProvider theme={theme}>
|
package/pages/_document.tsx
CHANGED
|
@@ -57,48 +57,50 @@ export default class MyDocument extends Document {
|
|
|
57
57
|
return (
|
|
58
58
|
<Html lang="en">
|
|
59
59
|
<Head>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
/>
|
|
72
|
-
{experimentationWeb &&
|
|
73
|
-
featureFlags &&
|
|
74
|
-
featureFlags.experimentation_web_flag && (
|
|
75
|
-
<ExperimentationWeb
|
|
76
|
-
optimizelyWebConfig={{ scriptCdn: experimentationWeb }}
|
|
77
|
-
reactHelmet={Helmet}
|
|
78
|
-
/>
|
|
79
|
-
)}
|
|
80
|
-
{helmet.script.toComponent()}
|
|
81
|
-
{sourcepointAccountId && (
|
|
82
|
-
<Consent
|
|
83
|
-
sourcePointConfigTCFV2={{
|
|
84
|
-
accountId: Number(sourcepointAccountId),
|
|
85
|
-
propertyHref: sourcepointPropertyHref,
|
|
60
|
+
<>
|
|
61
|
+
{fontList.map((font) => generateFontLink(font))}
|
|
62
|
+
<Script
|
|
63
|
+
type="text/javascript"
|
|
64
|
+
data-attribute="nr-browser"
|
|
65
|
+
dangerouslySetInnerHTML={{
|
|
66
|
+
__html: getSubStringBetween(
|
|
67
|
+
"<script type='text/javascript' >",
|
|
68
|
+
'</script>',
|
|
69
|
+
newrelic.getBrowserTimingHeader()
|
|
70
|
+
),
|
|
86
71
|
}}
|
|
87
72
|
/>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
73
|
+
{experimentationWeb &&
|
|
74
|
+
featureFlags &&
|
|
75
|
+
featureFlags.experimentation_web_flag && (
|
|
76
|
+
<ExperimentationWeb
|
|
77
|
+
optimizelyWebConfig={{ scriptCdn: experimentationWeb }}
|
|
78
|
+
reactHelmet={Helmet}
|
|
79
|
+
/>
|
|
80
|
+
)}
|
|
81
|
+
{helmet.script.toComponent()}
|
|
82
|
+
{sourcepointAccountId && (
|
|
83
|
+
<Consent
|
|
84
|
+
sourcePointConfigTCFV2={{
|
|
85
|
+
accountId: Number(sourcepointAccountId),
|
|
86
|
+
propertyHref: sourcepointPropertyHref,
|
|
87
|
+
}}
|
|
99
88
|
/>
|
|
100
|
-
|
|
101
|
-
|
|
89
|
+
)}
|
|
90
|
+
<meta name="robots" content="noindex" />
|
|
91
|
+
{showAds && (
|
|
92
|
+
<>
|
|
93
|
+
<Script
|
|
94
|
+
type="text/javascript"
|
|
95
|
+
src="https://ads.newskit.co.uk/prebid.newskit.min.js"
|
|
96
|
+
/>
|
|
97
|
+
<Script
|
|
98
|
+
type="text/javascript"
|
|
99
|
+
src="https://ads.newskit.co.uk/ads.newskit.min.js"
|
|
100
|
+
/>
|
|
101
|
+
</>
|
|
102
|
+
)}
|
|
103
|
+
</>
|
|
102
104
|
</Head>
|
|
103
105
|
<body>
|
|
104
106
|
{tealiumAccountId && (
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
Headline,
|
|
6
6
|
Button,
|
|
7
7
|
Banner,
|
|
8
|
-
|
|
8
|
+
toNewsKitIcon,
|
|
9
9
|
} from 'newskit'
|
|
10
10
|
import {
|
|
11
11
|
PageWithAuth,
|
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
} from '@newskit-render/auth'
|
|
17
17
|
import { createApolloClient, ClientTypes } from '@newskit-render/api'
|
|
18
18
|
import { getHost } from '@newskit-render/shared-components'
|
|
19
|
+
import { Info } from '@emotion-icons/material/Info'
|
|
19
20
|
import { GET_UNIVERSAL_ARTICLE } from '../../../../../queries'
|
|
20
21
|
import ArticlePage from '../../../../../components/article'
|
|
21
22
|
import {
|
|
@@ -28,6 +29,8 @@ import {
|
|
|
28
29
|
gscId as configGscId,
|
|
29
30
|
} from '../../../../../config'
|
|
30
31
|
|
|
32
|
+
const IconFilledInfo = toNewsKitIcon(Info)
|
|
33
|
+
|
|
31
34
|
const PreviewArticle = ({
|
|
32
35
|
universalArticle,
|
|
33
36
|
section,
|