@newskit-render/core 2.32.1 → 2.32.2

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 CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [2.32.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@2.32.1-alpha.0...@newskit-render/core@2.32.1) (2022-12-12)
7
+
8
+ **Note:** Version bump only for package @newskit-render/core
9
+
10
+
11
+
12
+
13
+
6
14
  # [2.32.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@2.32.0-alpha.0...@newskit-render/core@2.32.0) (2022-12-12)
7
15
 
8
16
  **Note:** Version bump only for package @newskit-render/core
@@ -65,8 +65,7 @@ const interactUniversalArticle = ({
65
65
  },
66
66
  media: {
67
67
  crops: eachLike({
68
- url:
69
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/iphone-in-rice.jpg?strip=all&w=620&h=413&crop=1',
68
+ url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/iphone-in-rice.jpg?strip=all&w=620&h=413&crop=1',
70
69
  alt: null,
71
70
  aspectRatio: 'landscape',
72
71
  }),
@@ -106,11 +106,9 @@ describe('Recommendation', () => {
106
106
  swrMock.mockReturnValueOnce({
107
107
  data: [
108
108
  {
109
- href:
110
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
109
+ href: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
111
110
  tag: 'FOOT ON THE GAZ',
112
- text:
113
- 'Bale considering short deal with new club before RETIRING after World Cup',
111
+ text: 'Bale considering short deal with new club before RETIRING after World Cup',
114
112
  title: 'FOOT ON THE GAZ',
115
113
  },
116
114
  ],
@@ -16,10 +16,9 @@ interface InstrumentationContextProviderProps {
16
16
  handlers?: Record<keyof typeof defaultEventHandlers, EventHandler>
17
17
  }
18
18
 
19
- export const InstrumentationContextProvider: React.FC<InstrumentationContextProviderProps> = ({
20
- children,
21
- handlers = {},
22
- }) => {
19
+ export const InstrumentationContextProvider: React.FC<
20
+ InstrumentationContextProviderProps
21
+ > = ({ children, handlers = {} }) => {
23
22
  const eventHandlers = useMemo(() => {
24
23
  const uniqueHandlers = Object.values<EventHandler>({
25
24
  ...defaultEventHandlers,
@@ -148,8 +148,7 @@ describe('Article', () => {
148
148
  posterImage: {
149
149
  crops: [
150
150
  {
151
- url:
152
- 'https://www.thesun.co.uk/wp-content/uploads/2021/12/image-5923b09d66.jpg?strip=all&w=600&h=338&crop=1',
151
+ url: 'https://www.thesun.co.uk/wp-content/uploads/2021/12/image-5923b09d66.jpg?strip=all&w=600&h=338&crop=1',
153
152
  alt: null,
154
153
  aspectRatio: null,
155
154
  },
@@ -1,41 +1,35 @@
1
1
  export const pastDueBanner = {
2
2
  firstNotice: {
3
3
  title: "We haven't been able to take payment",
4
- text:
5
- 'You may need to update your payment details to keep your subscription.',
4
+ text: 'You may need to update your payment details to keep your subscription.',
6
5
  button: 'Update payment details',
7
6
  },
8
7
  secondNotice: {
9
8
  title: 'Act now to keep your subscription',
10
- text:
11
- 'We’ve tried several times, but haven’t been able to take payment. Please update your payment details to keep your subscription.',
9
+ text: 'We’ve tried several times, but haven’t been able to take payment. Please update your payment details to keep your subscription.',
12
10
  button: 'Update payment details',
13
11
  },
14
12
  terminated: {
15
13
  title: 'Your subscription has been terminated',
16
14
  phoneNumber: 'XXXX-XXX-XXXX',
17
- text:
18
- 'We didn’t receive payment for your subscription. To reactivate it, please call ##PHONE_NUMBER##.',
15
+ text: 'We didn’t receive payment for your subscription. To reactivate it, please call ##PHONE_NUMBER##.',
19
16
  dismissDays: 7,
20
17
  },
21
18
  cancelled: {
22
19
  title: 'Your subscription has been cancelled.',
23
20
  phoneNumber: 'XXXX-XXX-XXXX',
24
- text:
25
- 'You’ll no longer have access to subscription benefits. To re-activate call ##PHONE_NUMBER##.',
21
+ text: 'You’ll no longer have access to subscription benefits. To re-activate call ##PHONE_NUMBER##.',
26
22
  dismissDays: 7,
27
23
  },
28
24
  toBeCancelled: {
29
25
  title: 'Your subscription will end soon.',
30
26
  phoneNumber: 'XXXX-XXX-XXXX',
31
- text:
32
- 'You have cancelled your subscription and will lose access to all benefits on ##DATE##. To re-activate your subscription call ##PHONE_NUMBER##.',
27
+ text: 'You have cancelled your subscription and will lose access to all benefits on ##DATE##. To re-activate your subscription call ##PHONE_NUMBER##.',
33
28
  },
34
29
  toBeCancelledWithRefund: {
35
30
  title: 'Your subscription will end soon.',
36
31
  phoneNumber: '0800 xxxx xxxxx',
37
- text:
38
- 'We have successfully cancelled your subscription and will be processing your refund shortly. If you have any question please call ##PHONE_NUMBER##.',
32
+ text: 'We have successfully cancelled your subscription and will be processing your refund shortly. If you have any question please call ##PHONE_NUMBER##.',
39
33
  dismissDays: 7,
40
34
  },
41
35
  treshold: {
@@ -72,7 +72,8 @@ describe('Payment Failer', () => {
72
72
  startDate: date.toISOString(),
73
73
  }
74
74
  // eslint-disable-next-line no-param-reassign
75
- o.props.pageProps.user.subscriptions[0].serviceCancellationDate = date.toISOString()
75
+ o.props.pageProps.user.subscriptions[0].serviceCancellationDate =
76
+ date.toISOString()
76
77
  nextData = o
77
78
  },
78
79
  get() {
@@ -6,26 +6,21 @@ jest.mock('@newskit-render/standalone-components', () => {
6
6
  return {
7
7
  recommendationsProvider: jest.fn().mockResolvedValueOnce([
8
8
  {
9
- href:
10
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
9
+ href: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
11
10
  tag: 'FOOT ON THE GAZ',
12
- text:
13
- 'Bale considering short deal with new club before RETIRING after World Cup',
11
+ text: 'Bale considering short deal with new club before RETIRING after World Cup',
14
12
  title: 'FOOT ON THE GAZ',
15
13
  },
16
14
  {
17
- href:
18
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-a21f115694-1.jpg?strip=all&w=600&h=338&crop=1',
15
+ href: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-a21f115694-1.jpg?strip=all&w=600&h=338&crop=1',
19
16
  tag: 'TOUGH TIMES',
20
- text:
21
- 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
17
+ text: 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
22
18
  title: 'TOUGH TIMES',
23
19
  },
24
20
  {
25
21
  href: null,
26
22
  tag: 'TOUGH TIMES',
27
- text:
28
- 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
23
+ text: 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
29
24
  title: 'TOUGH TIMES',
30
25
  },
31
26
  ]),
package/helpers/a11y.ts CHANGED
@@ -1,9 +1,7 @@
1
- export const handleEnterKeyPress = (onClick: () => void) => ({
2
- key,
3
- }: {
4
- key: string
5
- }) => {
6
- if (key === 'Enter') {
7
- onClick()
1
+ export const handleEnterKeyPress =
2
+ (onClick: () => void) =>
3
+ ({ key }: { key: string }) => {
4
+ if (key === 'Enter') {
5
+ onClick()
6
+ }
8
7
  }
9
- }
@@ -26,29 +26,25 @@ export const relatedArticles = [
26
26
  {
27
27
  title: 'Prince Harry',
28
28
  tag: 'NEWS',
29
- text:
30
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
29
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
31
30
  href: imagePlaceholderHref('70x50'),
32
31
  },
33
32
  {
34
33
  title: 'Meghan Markle',
35
34
  tag: 'SPORT',
36
- text:
37
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
35
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
38
36
  href: imagePlaceholderHref('70x50'),
39
37
  },
40
38
  {
41
39
  title: 'Royal Family',
42
40
  tag: 'CULTURE',
43
- text:
44
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
41
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
45
42
  href: imagePlaceholderHref('70x50'),
46
43
  },
47
44
  {
48
45
  title: 'Royal',
49
46
  tag: 'CORONAVIRUS',
50
- text:
51
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
47
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
52
48
  href: imagePlaceholderHref('70x50'),
53
49
  },
54
50
  ]
@@ -83,8 +83,7 @@ const data = {
83
83
  media: {
84
84
  crops: [
85
85
  {
86
- url:
87
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
86
+ url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
88
87
  alt: 'image alt',
89
88
  },
90
89
  ],
@@ -112,8 +111,7 @@ const data = {
112
111
  media: {
113
112
  crops: [
114
113
  {
115
- url:
116
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
114
+ url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
117
115
  alt: 'image alt 2',
118
116
  },
119
117
  ],
@@ -141,8 +139,7 @@ const data = {
141
139
  media: [
142
140
  {
143
141
  crops: {
144
- url:
145
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
142
+ url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
146
143
  alt: 'image alt 3',
147
144
  },
148
145
  },
@@ -170,8 +167,7 @@ const data = {
170
167
  media: {
171
168
  crops: [
172
169
  {
173
- url:
174
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
170
+ url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
175
171
  alt: 'image alt 3',
176
172
  },
177
173
  ],
@@ -327,8 +323,7 @@ const data = {
327
323
  media: {
328
324
  crops: [
329
325
  {
330
- url:
331
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
326
+ url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
332
327
  alt: 'image alt',
333
328
  },
334
329
  ],
@@ -356,8 +351,7 @@ const data = {
356
351
  media: {
357
352
  crops: [
358
353
  {
359
- url:
360
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
354
+ url: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/SPORT-PREVIEW-Amadou-Onana-to-WHU.jpg?strip=all&w=620&h=413&crop=1',
361
355
  alt: 'image alt 2',
362
356
  },
363
357
  ],
@@ -29,8 +29,7 @@ export default [
29
29
  italic: false,
30
30
  underline: false,
31
31
  monospace: false,
32
- text:
33
- 'Proin eget tortor risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; ',
32
+ text: 'Proin eget tortor risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; ',
34
33
  },
35
34
  {
36
35
  type: 'text',
@@ -46,8 +45,7 @@ export default [
46
45
  italic: false,
47
46
  underline: false,
48
47
  monospace: false,
49
- text:
50
- ', auctor sit amet aliquam vel, ullamcorper sit amet ligula. Donec rutrum congue leo eget malesuada. Proin eget tortor risus. Sed porttitor lectus nibh. Donec sollicitudin molestie malesuada.',
48
+ text: ', auctor sit amet aliquam vel, ullamcorper sit amet ligula. Donec rutrum congue leo eget malesuada. Proin eget tortor risus. Sed porttitor lectus nibh. Donec sollicitudin molestie malesuada.',
51
49
  },
52
50
  ],
53
51
  },
@@ -1,25 +1,20 @@
1
1
  export const recomendationsMock = [
2
2
  {
3
- href:
4
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
3
+ href: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-656eaa885d.jpg?strip=all&w=600&h=338&crop=1',
5
4
  tag: 'FOOT ON THE GAZ',
6
- text:
7
- 'Bale considering short deal with new club before RETIRING after World Cup',
5
+ text: 'Bale considering short deal with new club before RETIRING after World Cup',
8
6
  title: 'FOOT ON THE GAZ',
9
7
  },
10
8
  {
11
- href:
12
- 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-a21f115694-1.jpg?strip=all&w=600&h=338&crop=1',
9
+ href: 'https://www.thesun.co.uk/wp-content/uploads/2022/03/image-a21f115694-1.jpg?strip=all&w=600&h=338&crop=1',
13
10
  tag: 'TOUGH TIMES',
14
- text:
15
- 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
11
+ text: 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
16
12
  title: 'TOUGH TIMES',
17
13
  },
18
14
  {
19
15
  href: null,
20
16
  tag: 'TOUGH TIMES',
21
- text:
22
- 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
17
+ text: 'I only made £5k last year - I sold £801k villa for cash, says Claire Sweeney',
23
18
  title: 'TOUGH TIMES',
24
19
  },
25
20
  ]
@@ -51,21 +51,17 @@ export default [
51
51
  summary: {
52
52
  children: [
53
53
  {
54
- text:
55
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
54
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
56
55
  },
57
56
  {
58
- text:
59
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
57
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
60
58
  },
61
59
  {
62
60
  url: 'http://this-is-a-url/',
63
- text:
64
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
61
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
65
62
  },
66
63
  {
67
- text:
68
- 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
64
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
69
65
  },
70
66
  ],
71
67
  },
@@ -77,8 +73,7 @@ export default [
77
73
  posterImage: {
78
74
  crops: [
79
75
  {
80
- url:
81
- 'https://localhost:3000/video-thumbnail-artwork-mock.jpg',
76
+ url: 'https://localhost:3000/video-thumbnail-artwork-mock.jpg',
82
77
  alt: null,
83
78
  aspectRatio: null,
84
79
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/core",
3
- "version": "2.32.1",
3
+ "version": "2.32.2",
4
4
  "description": "Newskit Render - Core package",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -39,15 +39,15 @@
39
39
  "@emotion-icons/material-outlined": "3.14.0",
40
40
  "@emotion/react": "11.10.4",
41
41
  "@emotion/styled": "11.10.4",
42
- "@newskit-render/api": "^1.5.3",
43
- "@newskit-render/auth": "^1.3.3",
44
- "@newskit-render/checkout": "^1.9.0",
45
- "@newskit-render/feature-flags": "^1.4.3",
46
- "@newskit-render/feed": "^1.4.5",
47
- "@newskit-render/my-account": "^3.23.0",
48
- "@newskit-render/shared-components": "^1.24.0",
49
- "@newskit-render/standalone-components": "^1.15.0",
50
- "@newskit-render/validation": "^1.5.4",
42
+ "@newskit-render/api": "^1.5.4",
43
+ "@newskit-render/auth": "^1.3.4",
44
+ "@newskit-render/checkout": "^1.9.1",
45
+ "@newskit-render/feature-flags": "^1.4.4",
46
+ "@newskit-render/feed": "^1.4.6",
47
+ "@newskit-render/my-account": "^3.23.1",
48
+ "@newskit-render/shared-components": "^1.24.1",
49
+ "@newskit-render/standalone-components": "^1.15.1",
50
+ "@newskit-render/validation": "^1.5.5",
51
51
  "cross-fetch": "3.1.5",
52
52
  "graphql": "15.6.0",
53
53
  "lodash.get": "4.4.2",
@@ -74,7 +74,7 @@
74
74
  "@types/react-dom": "18.0.9",
75
75
  "@types/react-helmet": "6.1.0",
76
76
  "@typescript-eslint/eslint-plugin": "5.44.0",
77
- "@typescript-eslint/parser": "5.44.0",
77
+ "@typescript-eslint/parser": "5.45.1",
78
78
  "axe-core": "4.3.4",
79
79
  "babel-jest": "26.3.0",
80
80
  "cypress": "9.0.0",
@@ -96,9 +96,9 @@
96
96
  "jest": "27.4.7",
97
97
  "jest-junit": "12.0.0",
98
98
  "jest-watch-typeahead": "0.6.3",
99
- "lint-staged": "12.1.7",
99
+ "lint-staged": "13.1.0",
100
100
  "next-transpile-modules": "10.0.0",
101
- "prettier": "2.0.5",
101
+ "prettier": "2.8.1",
102
102
  "prettier-eslint": "11.0.0",
103
103
  "prettier-eslint-cli": "5.0.0",
104
104
  "ts-jest": "27.1.3",
@@ -94,7 +94,7 @@ const PreviewArticle = ({
94
94
 
95
95
  return (
96
96
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
97
- <SessionProvider pageProps={(props as unknown) as any}>
97
+ <SessionProvider pageProps={props as unknown as any}>
98
98
  <PageWithAuth onDenied={accessDeniedPage} isLoading={showOnLoading}>
99
99
  <>
100
100
  <CookieView>