Preview
@@ -139,26 +167,27 @@
}
}
- div#typeahead-container {
+ div#typeahead-container,
+ div#dropdown-container {
max-width: 660px;
margin: 0 auto 15px;
position: relative;
- }
- div#typeahead-container div.embed-link {
- position: absolute;
- top: 0;
- right: 0;
- display: inline-block;
- z-index: 2;
- }
- div#typeahead-container div.embed-link a {
- font-family: 'Knowledge', 'Source Sans Pro', Arial, sans-serif;
- color: #bbb;
- font-size: 12px;
- text-decoration: none !important;
- }
- div#typeahead-container div.embed-link a:hover {
- color: #666;
+ div.embed-link {
+ position: absolute;
+ top: 0;
+ right: 0;
+ display: inline-block;
+ z-index: 2;
+ a {
+ font-family: 'Knowledge', 'Source Sans Pro', Arial, sans-serif;
+ color: #bbb;
+ font-size: 12px;
+ text-decoration: none !important;
+ &:hover {
+ color: #666;
+ }
+ }
+ }
}
div#preview-label {
diff --git a/src/components/Framer/Resizer/index.svelte b/src/components/Framer/Resizer/index.svelte
index 66942e07..e406ed9b 100644
--- a/src/components/Framer/Resizer/index.svelte
+++ b/src/components/Framer/Resizer/index.svelte
@@ -27,8 +27,7 @@
if ($width > maxWidth) width.set(maxWidth);
});
- // svelte-ignore state_referenced_locally
- let offset = $state(($width - minWidth) / pixelRange);
+ let offset = $derived(($width - minWidth) / pixelRange);
let sliding = $state(false);
let isFocused = $state(false);
@@ -55,7 +54,7 @@
} else if (keyCode === 37) {
offset = Math.max(0, offset - pixelWidth / sliderWidth);
}
- width.set(getPx());
+ $width = getPx();
};
const start = (e: MouseEvent) => {
sliding = true;
@@ -77,17 +76,17 @@
.filter((b) => b <= maxWidth)
.filter((b) => b > $width);
if (availableBreakpoints.length === 0) {
- width.set(maxWidth);
+ $width = maxWidth;
} else {
- width.set(availableBreakpoints[0]);
+ $width = availableBreakpoints[0];
}
};
const decrement = () => {
const availableBreakpoints = breakpoints.filter((b) => b < $width);
if (availableBreakpoints.length === 0) {
- width.set(minWidth);
+ $width = minWidth;
} else {
- width.set(availableBreakpoints.slice(-1)[0]);
+ $width = availableBreakpoints.slice(-1)[0];
}
};
diff --git a/src/components/Framer/Typeahead/index.svelte b/src/components/Framer/Typeahead/index.svelte
index 42e978c7..798f2198 100644
--- a/src/components/Framer/Typeahead/index.svelte
+++ b/src/components/Framer/Typeahead/index.svelte
@@ -177,7 +177,6 @@
{
- console.log('HELLO', !comboboxRef?.contains(target as Node));
if (!hideDropdown && !comboboxRef?.contains(target as Node)) {
close();
}
diff --git a/src/components/Framer/stories/docs/component.md b/src/components/Framer/stories/docs/component.md
deleted file mode 100644
index 05f26772..00000000
--- a/src/components/Framer/stories/docs/component.md
+++ /dev/null
@@ -1,11 +0,0 @@
-An embed tool for development in the graphics kit.
-
-```svelte
-
-
-
-```
diff --git a/src/components/ReferralBlock/ReferralBlock.svelte b/src/components/ReferralBlock/ReferralBlock.svelte
index 889bed68..fe26c887 100644
--- a/src/components/ReferralBlock/ReferralBlock.svelte
+++ b/src/components/ReferralBlock/ReferralBlock.svelte
@@ -67,6 +67,9 @@
let referrals: Article[] = $state([]);
const getReferrals = async () => {
+ if (typeof window === 'undefined') return;
+ // fetch only reliably works on prod sites
+ if (window?.location?.hostname !== 'www.reuters.com') return;
const isCollection = Boolean(collection);
const API = isCollection ? COLLECTION_API : SECTION_API;
try {
diff --git a/src/components/SEO/SEO.svelte b/src/components/SEO/SEO.svelte
index 8ceb2cd5..19bc6940 100644
--- a/src/components/SEO/SEO.svelte
+++ b/src/components/SEO/SEO.svelte
@@ -185,9 +185,11 @@
+
{@html `<${'script'} type="application/ld+json">${JSON.stringify(
orgLdJson
)}`}
+
{@html `<${'script'} type="application/ld+json">${JSON.stringify(
articleLdJson
)}`}
diff --git a/src/components/Scroller/Scroller.stories.svelte b/src/components/Scroller/Scroller.stories.svelte
index 101b4967..ca233b30 100644
--- a/src/components/Scroller/Scroller.stories.svelte
+++ b/src/components/Scroller/Scroller.stories.svelte
@@ -19,6 +19,24 @@
control: 'select',
options: ['fb', 'bf'],
},
+ index: {
+ control: false,
+ table: {
+ category: 'Bindable states (Read-only)',
+ },
+ },
+ offset: {
+ control: false,
+ table: {
+ category: 'Bindable states (Read-only)',
+ },
+ },
+ progress: {
+ control: false,
+ table: {
+ category: 'Bindable states (Read-only)',
+ },
+ },
},
});
diff --git a/src/components/Scroller/Scroller.svelte b/src/components/Scroller/Scroller.svelte
index 777cef59..b6c897b2 100644
--- a/src/components/Scroller/Scroller.svelte
+++ b/src/components/Scroller/Scroller.svelte
@@ -74,6 +74,12 @@
id?: string;
/** Set a class to target with SCSS */
class?: string;
+ /** The currently active section */
+ index?: number;
+ /** How far the section has scrolled past the threshold, as a value between 0 and 1 */
+ offset?: number;
+ /** How far the foreground has travelled, where 0 is the top of the foreground crossing top, and 1 is the bottom crossing bottom */
+ progress?: number;
}
let {
@@ -90,12 +96,10 @@
bottom = 1,
parallax = false,
class: cls = '',
+ index = $bindable(0),
+ offset = $bindable(0),
+ progress = $bindable(0),
}: Props = $props();
-
- // Bindable variables passed to ScrollerBase
- let index = $state(0);
- let offset = $state(0);
- let progress = $state(0);
{#if !embedded}
diff --git a/src/components/SimpleTimeline/SimpleTimeline.mdx b/src/components/SimpleTimeline/SimpleTimeline.mdx
index 7ff74758..7eb4c72b 100644
--- a/src/components/SimpleTimeline/SimpleTimeline.mdx
+++ b/src/components/SimpleTimeline/SimpleTimeline.mdx
@@ -40,24 +40,20 @@ With the graphics kit, you'll likely get your text value from an ArchieML doc.
```yaml
# Archie ML doc
-[timeline]
-
-# date object with events
-date: May 18
-[.events]
-title: Mariupol defenders surrender to Russia but their fate is uncertain
-context: More than 250 Ukrainian fighters surrendered to Russian forces at the Azovstal steelworks in Mariupol after weeks of desperate resistance, bringing an end to the most devastating siege of Russia's war in Ukraine and allowing President Vladimir Putin to claim a rare victory in his faltering campaign.
-titleLink: https://www.reuters.com/world/europe/ukrainian-troops-evacuate-mariupol-ceding-control-russia-2022-05-17/
-
-# More events...
-[]
-
-date: May 10
-[.events]
-title: U.S. House passes $40 bln bill to bolster Ukraine against Russian invasion
-context: The U.S. House of Representatives approved more than $40 billion more aid for Ukraine on Tuesday, as Congress races to keep military aid flowing and boost the government in Kyiv as it grapples with the Russian invasion.
-titleLink: https://www.reuters.com/world/us-house-vote-40-billion-ukraine-aid-package-tuesday-pelosi-2022-05-10/
-[]
+type: timeline
+# Optional
+class: timeline
+id: timeline-1
+symbolColour: var(--theme-colour-brand-rules, grey)
+dateColour: var(--theme-colour-accent, red)
+[.dates]
+ # date object with events
+ date: May 10
+ [.events]
+ title: U.S. House passes $40 bln bill to bolster Ukraine against Russian invasion
+ context: The U.S. House of Representatives approved more than $40 billion more aid for Ukraine on Tuesday, as Congress races to keep military aid flowing and boost the government in Kyiv as it grapples with the Russian invasion.
+ titleLink: https://www.reuters.com/world/us-house-vote-40-billion-ukraine-aid-package-tuesday-pelosi-2022-05-10/
+ []
# More dates and events...
[]
@@ -72,7 +68,13 @@ titleLink: https://www.reuters.com/world/us-house-vote-40-billion-ukraine-aid-pa
import content from '$locales/en/content.json';
-
+
```
diff --git a/src/components/SiteFooter/CompanyLinks.svelte b/src/components/SiteFooter/CompanyLinks.svelte
index e6703d15..4ed6b018 100644
--- a/src/components/SiteFooter/CompanyLinks.svelte
+++ b/src/components/SiteFooter/CompanyLinks.svelte
@@ -25,6 +25,11 @@
}
let { links = {} }: Props = $props();
+
+ const normaliseSocialName = (name: string) => {
+ if (name === 'twitter') return 'X';
+ return name;
+ };
{#if links.social_links}
@@ -42,7 +47,10 @@
{@const SvelteComponent =
symbols[link.type as keyof typeof symbols]}
-
+