@reuters-graphics/graphics-components 3.0.0 → 3.0.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/dist/components/Scroller/Scroller.stories.svelte +18 -0
- package/dist/components/Scroller/Scroller.svelte +9 -5
- package/dist/components/Scroller/Scroller.svelte.d.ts +7 -1
- package/dist/components/SimpleTimeline/SimpleTimeline.mdx +21 -19
- package/dist/components/SiteHeadline/SiteHeadline.mdx +2 -2
- package/package.json +1 -1
|
@@ -19,6 +19,24 @@
|
|
|
19
19
|
control: 'select',
|
|
20
20
|
options: ['fb', 'bf'],
|
|
21
21
|
},
|
|
22
|
+
index: {
|
|
23
|
+
control: false,
|
|
24
|
+
table: {
|
|
25
|
+
category: 'Bindable states (Read-only)',
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
offset: {
|
|
29
|
+
control: false,
|
|
30
|
+
table: {
|
|
31
|
+
category: 'Bindable states (Read-only)',
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
progress: {
|
|
35
|
+
control: false,
|
|
36
|
+
table: {
|
|
37
|
+
category: 'Bindable states (Read-only)',
|
|
38
|
+
},
|
|
39
|
+
},
|
|
22
40
|
},
|
|
23
41
|
});
|
|
24
42
|
</script>
|
|
@@ -74,6 +74,12 @@
|
|
|
74
74
|
id?: string;
|
|
75
75
|
/** Set a class to target with SCSS */
|
|
76
76
|
class?: string;
|
|
77
|
+
/** The currently active section */
|
|
78
|
+
index?: number;
|
|
79
|
+
/** How far the section has scrolled past the threshold, as a value between 0 and 1 */
|
|
80
|
+
offset?: number;
|
|
81
|
+
/** How far the foreground has travelled, where 0 is the top of the foreground crossing top, and 1 is the bottom crossing bottom */
|
|
82
|
+
progress?: number;
|
|
77
83
|
}
|
|
78
84
|
|
|
79
85
|
let {
|
|
@@ -90,12 +96,10 @@
|
|
|
90
96
|
bottom = 1,
|
|
91
97
|
parallax = false,
|
|
92
98
|
class: cls = '',
|
|
99
|
+
index = $bindable(0),
|
|
100
|
+
offset = $bindable(0),
|
|
101
|
+
progress = $bindable(0),
|
|
93
102
|
}: Props = $props();
|
|
94
|
-
|
|
95
|
-
// Bindable variables passed to ScrollerBase
|
|
96
|
-
let index = $state(0);
|
|
97
|
-
let offset = $state(0);
|
|
98
|
-
let progress = $state(0);
|
|
99
103
|
</script>
|
|
100
104
|
|
|
101
105
|
{#if !embedded}
|
|
@@ -60,8 +60,14 @@ interface Props {
|
|
|
60
60
|
id?: string;
|
|
61
61
|
/** Set a class to target with SCSS */
|
|
62
62
|
class?: string;
|
|
63
|
+
/** The currently active section */
|
|
64
|
+
index?: number;
|
|
65
|
+
/** How far the section has scrolled past the threshold, as a value between 0 and 1 */
|
|
66
|
+
offset?: number;
|
|
67
|
+
/** How far the foreground has travelled, where 0 is the top of the foreground crossing top, and 1 is the bottom crossing bottom */
|
|
68
|
+
progress?: number;
|
|
63
69
|
}
|
|
64
70
|
/** `Scroller` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-graphics-scroller--docs) */
|
|
65
|
-
declare const Scroller: import("svelte").Component<Props, {}, "">;
|
|
71
|
+
declare const Scroller: import("svelte").Component<Props, {}, "progress" | "offset" | "index">;
|
|
66
72
|
type Scroller = ReturnType<typeof Scroller>;
|
|
67
73
|
export default Scroller;
|
|
@@ -40,24 +40,20 @@ With the graphics kit, you'll likely get your text value from an ArchieML doc.
|
|
|
40
40
|
```yaml
|
|
41
41
|
# Archie ML doc
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
[
|
|
57
|
-
title: U.S. House passes $40 bln bill to bolster Ukraine against Russian invasion
|
|
58
|
-
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.
|
|
59
|
-
titleLink: https://www.reuters.com/world/us-house-vote-40-billion-ukraine-aid-package-tuesday-pelosi-2022-05-10/
|
|
60
|
-
[]
|
|
43
|
+
type: timeline
|
|
44
|
+
# Optional
|
|
45
|
+
class: timeline
|
|
46
|
+
id: timeline-1
|
|
47
|
+
symbolColour: var(--theme-colour-brand-rules, grey)
|
|
48
|
+
dateColour: var(--theme-colour-accent, red)
|
|
49
|
+
[.dates]
|
|
50
|
+
# date object with events
|
|
51
|
+
date: May 10
|
|
52
|
+
[.events]
|
|
53
|
+
title: U.S. House passes $40 bln bill to bolster Ukraine against Russian invasion
|
|
54
|
+
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.
|
|
55
|
+
titleLink: https://www.reuters.com/world/us-house-vote-40-billion-ukraine-aid-package-tuesday-pelosi-2022-05-10/
|
|
56
|
+
[]
|
|
61
57
|
|
|
62
58
|
# More dates and events...
|
|
63
59
|
[]
|
|
@@ -72,7 +68,13 @@ titleLink: https://www.reuters.com/world/us-house-vote-40-billion-ukraine-aid-pa
|
|
|
72
68
|
import content from '$locales/en/content.json';
|
|
73
69
|
</script>
|
|
74
70
|
|
|
75
|
-
<
|
|
71
|
+
<SimpleTimeline
|
|
72
|
+
dates={block.dates}
|
|
73
|
+
class={block.class}
|
|
74
|
+
symbolColour={block.symbolColour}
|
|
75
|
+
id={block.id}
|
|
76
|
+
dateColour={block.dateColour}
|
|
77
|
+
/>
|
|
76
78
|
```
|
|
77
79
|
|
|
78
80
|
<Canvas of={SimpleTimelineStories.Demo} />
|
|
@@ -58,8 +58,8 @@ updated:
|
|
|
58
58
|
sectionUrl={content.sectionUrl}
|
|
59
59
|
hed={content.hed}
|
|
60
60
|
authors={content.authors.split(',')}
|
|
61
|
-
publishTime={content.
|
|
62
|
-
updateTime={content.
|
|
61
|
+
publishTime={content.publishTime}
|
|
62
|
+
updateTime={content.updatTime}
|
|
63
63
|
/>
|
|
64
64
|
```
|
|
65
65
|
|