Skip to content

Commit 6119c99

Browse files
Support crosswords in Safari 13 (#13648)
* fix for safari 13 as the * revert changes to packages * Update Source and crossword packages and fix imports * Update Source packages in apps rendering and fix imports * Update `braze-components` This updates the Source dependencies to 9.0.0, matching DCAR, and fixes icon imports that have changed in the latest Source release. --------- Co-authored-by: oliverabrahams <[email protected]>
1 parent da4a6f7 commit 6119c99

File tree

10 files changed

+63
-100
lines changed

10 files changed

+63
-100
lines changed

apps-rendering/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@
4848
"@guardian/content-atom-model": "4.0.1",
4949
"@guardian/eslint-config": "7.0.1",
5050
"@guardian/eslint-config-typescript": "9.0.1",
51-
"@guardian/libs": "16.1.0",
51+
"@guardian/libs": "22.0.0",
5252
"@guardian/renditions": "0.2.0",
53-
"@guardian/source": "8.0.0",
54-
"@guardian/source-development-kitchen": "8.0.0",
53+
"@guardian/source": "9.0.0",
54+
"@guardian/source-development-kitchen": "17.0.0",
5555
"@smithy/property-provider": "2.0.16",
5656
"@storybook/addon-essentials": "8.4.2",
5757
"@storybook/addon-webpack5-compiler-babel": "3.0.5",

apps-rendering/src/components/Deadline/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { SvgClock } from '@guardian/source/react-components';
1+
import { SvgClockFilled } from '@guardian/source/react-components';
22
import { isValidDate } from 'date';
33
import React from 'react';
44
import { highlight } from './styles';
@@ -50,7 +50,7 @@ const DeadlineDate = ({ until }: { until?: number }) => {
5050
if (!deadlineText) return null;
5151
return (
5252
<Highlight>
53-
<SvgClock size="xsmall" />
53+
<SvgClockFilled size="xsmall" />
5454
{deadlineText}
5555
</Highlight>
5656
);

apps-rendering/src/components/Layout/NewsletterSignUpLayout.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import {
1010
textSansBold14,
1111
until,
1212
} from '@guardian/source/foundations';
13-
import { SvgClock, SvgNewsletter } from '@guardian/source/react-components';
13+
import {
14+
SvgClockFilled,
15+
SvgNewsletterFilled,
16+
} from '@guardian/source/react-components';
1417
import { OptionKind } from '../../../vendor/@guardian/types/index';
1518
import ArticleBody from 'components/ArticleBody';
1619
import Footer from 'components/Footer';
@@ -112,7 +115,7 @@ const NewsletterSignUpLayout = ({ item }: Props) => {
112115
<>
113116
{newsletter.regionFocus && (
114117
<div css={detailBlockStyles}>
115-
<SvgNewsletter size="small" />
118+
<SvgNewsletterFilled size="small" />
116119
<b>{newsletter.regionFocus} Focused</b>
117120
</div>
118121
)}
@@ -125,7 +128,7 @@ const NewsletterSignUpLayout = ({ item }: Props) => {
125128
{maybeRender(item.promotedNewsletter, (newsletter) => (
126129
<>
127130
<div css={frequencyBlockStyles}>
128-
<SvgClock size="xsmall" />
131+
<SvgClockFilled size="xsmall" />
129132

130133
<span>
131134
You&apos;ll receive this newsletter

apps-rendering/src/components/NewsletterSignup/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
textSans14,
1717
textSansBold14,
1818
} from '@guardian/source/foundations';
19-
import { SvgNewsletter } from '@guardian/source/react-components';
19+
import { SvgNewsletterFilled } from '@guardian/source/react-components';
2020
import type { NewsletterSignUp } from 'bodyElement';
2121
import { background, border, text } from 'palette';
2222
import { darkModeCss } from 'styles';
@@ -151,7 +151,7 @@ const NewsletterSignup = ({
151151

152152
<div css={noHeightFromTabletStyles}>
153153
<div css={iconHolderStyles}>
154-
<SvgNewsletter size="small" />
154+
<SvgNewsletterFilled size="small" />
155155
<b>{frequency}</b>
156156
</div>
157157
</div>

dotcom-rendering/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"@emotion/react": "11.11.3",
3838
"@emotion/server": "11.11.0",
3939
"@guardian/ab-core": "8.0.0",
40-
"@guardian/braze-components": "21.0.0",
40+
"@guardian/braze-components": "22.0.0",
4141
"@guardian/bridget": "8.1.0",
4242
"@guardian/browserslist-config": "6.1.0",
4343
"@guardian/cdk": "50.13.0",
@@ -50,10 +50,10 @@
5050
"@guardian/libs": "22.0.0",
5151
"@guardian/ophan-tracker-js": "2.2.5",
5252
"@guardian/react-crossword": "2.0.2",
53-
"@guardian/react-crossword-next": "npm:@guardian/react-crossword@4.1.0",
53+
"@guardian/react-crossword-next": "npm:@guardian/react-crossword@5.0.0",
5454
"@guardian/shimport": "1.0.2",
55-
"@guardian/source": "8.0.0",
56-
"@guardian/source-development-kitchen": "12.0.0",
55+
"@guardian/source": "9.0.0",
56+
"@guardian/source-development-kitchen": "17.0.0",
5757
"@guardian/support-dotcom-components": "6.1.0",
5858
"@guardian/tsconfig": "0.2.0",
5959
"@playwright/test": "1.45.3",

dotcom-rendering/src/components/Callout/Deadline.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { css } from '@emotion/react';
22
import { isUndefined } from '@guardian/libs';
33
import { space, textSans12 } from '@guardian/source/foundations';
4-
import { SvgClock } from '@guardian/source/react-components';
4+
import { SvgClockFilled } from '@guardian/source/react-components';
55
import { palette } from '../../palette';
66

77
type Props = {
@@ -50,7 +50,7 @@ export const Deadline = ({ until }: Props) => {
5050

5151
return (
5252
<span css={deadlineStyles}>
53-
<SvgClock size="xsmall" />
53+
<SvgClockFilled size="xsmall" />
5454
{deadlineText}
5555
</span>
5656
);

dotcom-rendering/src/components/NewsletterDetail.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
space,
55
textSansBold14,
66
} from '@guardian/source/foundations';
7-
import { SvgNewsletter } from '@guardian/source/react-components';
7+
import { SvgNewsletterFilled } from '@guardian/source/react-components';
88

99
type Props = {
1010
text: string;
@@ -41,7 +41,7 @@ const spanStyle = css`
4141
export const NewsletterDetail = ({ text, iconSize = 'normal' }: Props) => (
4242
<div css={containerStyle}>
4343
<div css={svgStyle(iconSize)}>
44-
<SvgNewsletter />
44+
<SvgNewsletterFilled />
4545
</div>
4646
<span css={spanStyle}>{text}</span>
4747
</div>

dotcom-rendering/src/components/NewsletterFrequency.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
textSans14,
55
textSansBold14,
66
} from '@guardian/source/foundations';
7-
import { SvgClock } from '@guardian/source/react-components';
7+
import { SvgClockFilled } from '@guardian/source/react-components';
88

99
type Props = {
1010
frequency: string;
@@ -29,7 +29,7 @@ export const NewsletterFrequency = ({ frequency }: Props) => {
2929

3030
return (
3131
<div css={mainStyles}>
32-
<SvgClock size="xsmall" />
32+
<SvgClockFilled size="xsmall" />
3333

3434
<span css={spanStyles}>
3535
You'll receive this newsletter <strong>{freq}</strong>

dotcom-rendering/src/lib/useMatchMedia.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@ const useMatchMedia = (query: string): boolean => {
3131
/** @see https://react.dev/reference/react/useSyncExternalStore */
3232
return useSyncExternalStore(
3333
(callback) => {
34-
mediaQuery?.addEventListener('change', callback);
35-
36-
return () => {
37-
mediaQuery?.removeEventListener('change', callback);
38-
};
34+
if (mediaQuery && 'onchange' in mediaQuery) {
35+
mediaQuery.addEventListener('change', callback);
36+
return () => {
37+
mediaQuery.removeEventListener('change', callback);
38+
};
39+
}
40+
return () => undefined;
3941
},
4042
() => !!mediaQuery?.matches,
4143
() => false, // we cannot have media queries on the server

pnpm-lock.yaml

Lines changed: 33 additions & 75 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)