@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.
@@ -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
- [timeline]
44
-
45
- # date object with events
46
- date: May 18
47
- [.events]
48
- title: Mariupol defenders surrender to Russia but their fate is uncertain
49
- 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.
50
- titleLink: https://www.reuters.com/world/europe/ukrainian-troops-evacuate-mariupol-ceding-control-russia-2022-05-17/
51
-
52
- # More events...
53
- []
54
-
55
- date: May 10
56
- [.events]
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
- <EndNotes SimpleTimeline={content.timeline} />
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.published}
62
- updateTime={content.updated}
61
+ publishTime={content.publishTime}
62
+ updateTime={content.updatTime}
63
63
  />
64
64
  ```
65
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reuters-graphics/graphics-components",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://reuters-graphics.github.io/graphics-components",