@newskit-render/core 0.131.1 → 0.138.1
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 +169 -0
- package/README.md +1 -1
- package/__pacts__/client.ts +10 -6
- package/__tests__/pages/[articleSlug].test.tsx +20 -7
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +599 -690
- package/__tests__/pages/home.test.tsx +22 -10
- package/components/404/404.tsx +9 -5
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +650 -687
- package/components/common/NavLink.tsx +4 -3
- package/components/footer/__snapshots__/index.test.tsx.snap +15 -23
- package/components/header/index.tsx +4 -3
- package/components/section/__tests__/ArticleSlice.test.tsx +2 -2
- package/components/section/layouts/FallBack.tsx +3 -3
- package/components/section/layouts/SectionRow.tsx +4 -3
- package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +152 -167
- package/components/section/layouts/__tests__/__snapshots__/SectionRow.test.tsx.snap +857 -952
- package/helpers/addCacheHeaders.ts +8 -0
- package/infrastructure/.circleci/config.yml +2 -2
- package/jest.config.js +4 -0
- package/jest.config.pact.js +3 -2
- package/package.json +11 -9
- package/pages/[section]/[articleId]/[articleSlug].tsx +11 -4
- package/pages/[section]/index.tsx +11 -4
- package/pages/api/account/zuora/generate-rsa.ts +5 -0
- package/pages/index.tsx +11 -4
- package/pages/preview/[articleId]/version/[versionId]/index.tsx +4 -2
- package/temp/header.tsx +4 -3
- package/tsconfig.json +3 -2
- package/helpers/createApolloClient.tsx +0 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LinkStandalone } from 'newskit'
|
|
2
1
|
import React from 'react'
|
|
2
|
+
import { NextLink } from '@newskit-render/shared-components'
|
|
3
3
|
|
|
4
4
|
const NavLink = ({
|
|
5
5
|
href,
|
|
@@ -10,7 +10,8 @@ const NavLink = ({
|
|
|
10
10
|
href: string
|
|
11
11
|
ariaLabel?: string
|
|
12
12
|
}) => (
|
|
13
|
-
<
|
|
13
|
+
<NextLink
|
|
14
|
+
type="standalone"
|
|
14
15
|
overrides={{
|
|
15
16
|
typographyPreset: 'utilityMeta020',
|
|
16
17
|
stylePreset: 'linkStandaloneInverse',
|
|
@@ -19,7 +20,7 @@ const NavLink = ({
|
|
|
19
20
|
aria-label={ariaLabel}
|
|
20
21
|
>
|
|
21
22
|
{buttonText}
|
|
22
|
-
</
|
|
23
|
+
</NextLink>
|
|
23
24
|
)
|
|
24
25
|
|
|
25
26
|
export default NavLink
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
exports[`Footer tests should render footer 1`] = `
|
|
4
4
|
<DocumentFragment>
|
|
5
5
|
.emotion-0 {
|
|
6
|
-
background-color: #
|
|
6
|
+
background-color: #0A0A0A;
|
|
7
7
|
width: 100%;
|
|
8
8
|
bottom: 0;
|
|
9
9
|
display: block;
|
|
@@ -88,8 +88,8 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
88
88
|
|
|
89
89
|
.emotion-5 {
|
|
90
90
|
display: inline-block;
|
|
91
|
-
fill: #
|
|
92
|
-
color: #
|
|
91
|
+
fill: #FFFFFF;
|
|
92
|
+
color: #FFFFFF;
|
|
93
93
|
width: 160px;
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -150,41 +150,33 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
150
150
|
transition-property: color;
|
|
151
151
|
transition-duration: 200ms;
|
|
152
152
|
transition-timing-function: cubic-bezier(0, 0, .5, 1);
|
|
153
|
-
color: #
|
|
153
|
+
color: #FFFFFF;
|
|
154
154
|
-webkit-text-decoration: none;
|
|
155
155
|
text-decoration: none;
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
.emotion-10 svg {
|
|
159
|
-
fill: #
|
|
159
|
+
fill: #FFFFFF;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
.emotion-10:hover:not(:disabled) {
|
|
163
|
-
color: #
|
|
163
|
+
color: #FFFFFF;
|
|
164
164
|
-webkit-text-decoration: underline;
|
|
165
165
|
text-decoration: underline;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
.emotion-10:hover:not(:disabled) svg {
|
|
169
|
-
fill: #
|
|
169
|
+
fill: #FFFFFF;
|
|
170
170
|
}
|
|
171
171
|
|
|
172
172
|
.emotion-10:active:not(:disabled) {
|
|
173
|
-
color: #
|
|
173
|
+
color: #FFFFFF;
|
|
174
174
|
-webkit-text-decoration: underline;
|
|
175
175
|
text-decoration: underline;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
.emotion-10:active:not(:disabled) svg {
|
|
179
|
-
fill: #
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.emotion-10:visited:not(:disabled) {
|
|
183
|
-
color: rgba(255,255,255,0.8);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
.emotion-10:visited:not(:disabled) svg {
|
|
187
|
-
fill: rgba(255,255,255,0.8);
|
|
179
|
+
fill: #FFFFFF;
|
|
188
180
|
}
|
|
189
181
|
|
|
190
182
|
.emotion-11 {
|
|
@@ -209,11 +201,11 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
209
201
|
.emotion-12 {
|
|
210
202
|
margin: 0;
|
|
211
203
|
padding: 1px 0;
|
|
212
|
-
font-family: "
|
|
204
|
+
font-family: "DM Sans",sans-serif;
|
|
213
205
|
font-size: 14px;
|
|
214
206
|
line-height: 1.4285714285714286;
|
|
215
207
|
font-weight: 500;
|
|
216
|
-
letter-spacing: 0;
|
|
208
|
+
letter-spacing: -0.5px;
|
|
217
209
|
display: inline-block;
|
|
218
210
|
display: block;
|
|
219
211
|
}
|
|
@@ -223,7 +215,7 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
223
215
|
display: block;
|
|
224
216
|
height: 0;
|
|
225
217
|
width: 0;
|
|
226
|
-
margin-bottom: -0.
|
|
218
|
+
margin-bottom: -0.3955357142857143em;
|
|
227
219
|
}
|
|
228
220
|
|
|
229
221
|
.emotion-12::after {
|
|
@@ -231,17 +223,17 @@ exports[`Footer tests should render footer 1`] = `
|
|
|
231
223
|
display: block;
|
|
232
224
|
height: 0;
|
|
233
225
|
width: 0;
|
|
234
|
-
margin-top: -0.
|
|
226
|
+
margin-top: -0.3955357142857143em;
|
|
235
227
|
}
|
|
236
228
|
|
|
237
229
|
.emotion-35 {
|
|
238
230
|
margin: 0;
|
|
239
231
|
color: #535353;
|
|
240
|
-
font-family: "
|
|
232
|
+
font-family: "DM Sans",sans-serif;
|
|
241
233
|
font-size: 14px;
|
|
242
234
|
line-height: 1.4285714285714286;
|
|
243
235
|
font-weight: 500;
|
|
244
|
-
letter-spacing: 0;
|
|
236
|
+
letter-spacing: -0.5px;
|
|
245
237
|
}
|
|
246
238
|
|
|
247
239
|
.emotion-35 svg {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { useContext, useState } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
Cell,
|
|
4
|
-
LinkStandalone,
|
|
5
4
|
styled,
|
|
6
5
|
getColorCssFromTheme,
|
|
7
6
|
getSizingCssFromTheme,
|
|
@@ -13,6 +12,7 @@ import {
|
|
|
13
12
|
IconFilledMenu,
|
|
14
13
|
} from 'newskit'
|
|
15
14
|
import { PastDueBannerExternal } from '@newskit-render/my-account'
|
|
15
|
+
import { NextLink } from '@newskit-render/shared-components'
|
|
16
16
|
import {
|
|
17
17
|
renderCustomLightTheme as LightTheme,
|
|
18
18
|
renderCustomDarkTheme as DarkTheme,
|
|
@@ -180,7 +180,8 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
180
180
|
stackDistribution="space-between"
|
|
181
181
|
wrap="nowrap"
|
|
182
182
|
>
|
|
183
|
-
<
|
|
183
|
+
<NextLink
|
|
184
|
+
type="standalone"
|
|
184
185
|
overrides={{ stylePreset: 'linkStandaloneInverse' }}
|
|
185
186
|
href="/"
|
|
186
187
|
aria-label="Home Page"
|
|
@@ -191,7 +192,7 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
|
|
|
191
192
|
<Visible xs sm>
|
|
192
193
|
<NewsKitLogoShort color="white" size="sizing120" />
|
|
193
194
|
</Visible>
|
|
194
|
-
</
|
|
195
|
+
</NextLink>
|
|
195
196
|
<Stack
|
|
196
197
|
flow="horizontal-center"
|
|
197
198
|
stackDistribution="flex-end"
|
|
@@ -94,11 +94,11 @@ describe('ArticleSlice', () => {
|
|
|
94
94
|
expect(getByText('Layout: LEAD_1_AND_1')).toBeInTheDocument()
|
|
95
95
|
expect(getByText('test headline').closest('a')).toHaveAttribute(
|
|
96
96
|
'href',
|
|
97
|
-
'catagory-one/demo-1/test-headline'
|
|
97
|
+
'/catagory-one/demo-1/test-headline'
|
|
98
98
|
)
|
|
99
99
|
expect(getByText('test headline 2').closest('a')).toHaveAttribute(
|
|
100
100
|
'href',
|
|
101
|
-
'catagory-two/demo-2/test-headline-2'
|
|
101
|
+
'/catagory-two/demo-2/test-headline-2'
|
|
102
102
|
)
|
|
103
103
|
})
|
|
104
104
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { NextLink } from '@newskit-render/shared-components'
|
|
3
3
|
import { getBlockProps } from './Block'
|
|
4
4
|
import { teaserURL } from '../sectionUtils'
|
|
5
5
|
import { LayoutProps } from './types'
|
|
@@ -14,9 +14,9 @@ export const FallBack: React.FC<LayoutProps> = ({ slice }) => (
|
|
|
14
14
|
const { id, headline } = teaserProps
|
|
15
15
|
return (
|
|
16
16
|
<p key={id || i}>
|
|
17
|
-
<
|
|
17
|
+
<NextLink href={teaserURL(teaserProps)} type="standalone">
|
|
18
18
|
{headline}
|
|
19
|
-
</
|
|
19
|
+
</NextLink>
|
|
20
20
|
</p>
|
|
21
21
|
)
|
|
22
22
|
})}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import {
|
|
3
|
-
LinkStandalone,
|
|
4
3
|
styled,
|
|
5
4
|
getColorCssFromTheme,
|
|
6
5
|
Block,
|
|
7
6
|
Divider,
|
|
8
7
|
BlockProps,
|
|
9
8
|
} from 'newskit'
|
|
9
|
+
import { NextLink } from '@newskit-render/shared-components'
|
|
10
10
|
import { LayoutProps } from './types'
|
|
11
11
|
import { CollectionBlock } from '../../../helpers/global-types'
|
|
12
12
|
import StyledIconFilledChevronRight from '../../common/icons/StyledIconFilledChevronRight'
|
|
@@ -30,7 +30,8 @@ const StyledDivider = styled(Divider)`
|
|
|
30
30
|
`
|
|
31
31
|
|
|
32
32
|
const link = (href: string, stylePreset?: string) => (
|
|
33
|
-
<
|
|
33
|
+
<NextLink
|
|
34
|
+
type="standalone"
|
|
34
35
|
href={href}
|
|
35
36
|
overrides={{
|
|
36
37
|
stylePreset: stylePreset || 'inkInverse',
|
|
@@ -40,7 +41,7 @@ const link = (href: string, stylePreset?: string) => (
|
|
|
40
41
|
>
|
|
41
42
|
Link
|
|
42
43
|
<StyledIconFilledChevronRight overrides={{ size: 'iconSize020' }} />
|
|
43
|
-
</
|
|
44
|
+
</NextLink>
|
|
44
45
|
)
|
|
45
46
|
|
|
46
47
|
type SectionRowProps = {
|