@reuters-graphics/graphics-components 3.0.17 → 3.0.19
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/AdSlot/AdScripts.svelte +1 -1
- package/dist/components/Analytics/Analytics.svelte +3 -22
- package/dist/components/Analytics/GTM.svelte +30 -0
- package/dist/components/Analytics/GTM.svelte.d.ts +18 -0
- package/dist/components/ScrollerVideo/ScrollerVideo.mdx +5 -2
- package/dist/components/ScrollerVideo/ScrollerVideo.svelte +4 -1
- package/dist/components/ScrollerVideo/demo/AdvancedUsecases.svelte +0 -29
- package/dist/components/ScrollerVideo/demo/WithScrollerBase.svelte +1 -27
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
onMount(() => {
|
|
8
8
|
window.graphicsAdQueue = window.graphicsAdQueue || [];
|
|
9
9
|
loadScript(
|
|
10
|
-
'https://
|
|
10
|
+
'https://www.reuters.com/static/js/bootstrap/v1.1.2/bootstrap.static.js',
|
|
11
11
|
{ onload: loadBootstrap, async: false }
|
|
12
12
|
);
|
|
13
13
|
// Load Freestar script
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
<!-- @component `Analytics` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-ads-analytics-analytics--docs) -->
|
|
2
|
-
|
|
3
2
|
<script module>
|
|
4
|
-
// GTM configuration
|
|
5
|
-
const GTM_ID = 'GTM-P9TTSWG2';
|
|
6
|
-
const GTM_SCRIPT = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','${GTM_ID}');`;
|
|
7
|
-
|
|
8
3
|
import { registerPageview as registerChartbeatPageview } from './providers/chartbeat';
|
|
9
4
|
import { registerPageview as registerGAPageview } from './providers/ga';
|
|
10
5
|
|
|
@@ -24,6 +19,8 @@
|
|
|
24
19
|
|
|
25
20
|
import { onMount } from 'svelte';
|
|
26
21
|
import { ga, chartbeat } from './providers';
|
|
22
|
+
import GoogleTagManager from './GTM.svelte';
|
|
23
|
+
|
|
27
24
|
interface Props {
|
|
28
25
|
/**
|
|
29
26
|
* Used to associate a page with its author(s) in Chartbeat.
|
|
@@ -39,20 +36,4 @@
|
|
|
39
36
|
});
|
|
40
37
|
</script>
|
|
41
38
|
|
|
42
|
-
<
|
|
43
|
-
<!-- Google Tag Manager -->
|
|
44
|
-
{@html `<${'script'}>${GTM_SCRIPT}</script>`}
|
|
45
|
-
<!-- End Google Tag Manager -->
|
|
46
|
-
</svelte:head>
|
|
47
|
-
|
|
48
|
-
<!-- Google Tag Manager (noscript) -->
|
|
49
|
-
<noscript>
|
|
50
|
-
<iframe
|
|
51
|
-
src="https://www.googletagmanager.com/ns.html?id={GTM_ID}"
|
|
52
|
-
height="0"
|
|
53
|
-
width="0"
|
|
54
|
-
style="display:none;visibility:hidden"
|
|
55
|
-
title=""
|
|
56
|
-
></iframe>
|
|
57
|
-
</noscript>
|
|
58
|
-
<!-- End Google Tag Manager (noscript) -->
|
|
39
|
+
<GoogleTagManager />
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
const GTM_ID = 'GTM-P9TTSWG2';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<svelte:head>
|
|
6
|
+
<!-- Google Tag Manager -->
|
|
7
|
+
<link href="https://www.googletagmanager.com" rel="preconnect" />
|
|
8
|
+
<script>
|
|
9
|
+
window.dataLayer = window.dataLayer || [];
|
|
10
|
+
window.dataLayer.push({
|
|
11
|
+
'gtm.start': new Date().getTime(),
|
|
12
|
+
event: 'gtm.js',
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
<script async src={`https://www.googletagmanager.com/gtm.js?id=${GTM_ID}`}>
|
|
16
|
+
</script>
|
|
17
|
+
<!-- End Google Tag Manager -->
|
|
18
|
+
</svelte:head>
|
|
19
|
+
|
|
20
|
+
<!-- Google Tag Manager (noscript) -->
|
|
21
|
+
<noscript>
|
|
22
|
+
<iframe
|
|
23
|
+
src={`https://www.googletagmanager.com/ns.html?id=${GTM_ID}`}
|
|
24
|
+
height="0"
|
|
25
|
+
width="0"
|
|
26
|
+
style="display:none;visibility:hidden"
|
|
27
|
+
title=""
|
|
28
|
+
></iframe>
|
|
29
|
+
</noscript>
|
|
30
|
+
<!-- End Google Tag Manager (noscript) -->
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
11
|
+
};
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
13
|
+
}
|
|
14
|
+
declare const Gtm: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {}, {}, string>;
|
|
17
|
+
type Gtm = InstanceType<typeof Gtm>;
|
|
18
|
+
export default Gtm;
|
|
@@ -172,7 +172,7 @@ With the graphics kit, you'll likely get your text and prop values from an Archi
|
|
|
172
172
|
{#if block.type == 'scroller-video'}
|
|
173
173
|
<ScrollerVideo
|
|
174
174
|
id={block.id}
|
|
175
|
-
src={`${assets}/${block.src}
|
|
175
|
+
src={`${assets}/${block.src}`}
|
|
176
176
|
height={block.height}
|
|
177
177
|
>
|
|
178
178
|
<!-- Loop through foregrounds to add text blurbs that appear/disappear at specific times -->
|
|
@@ -348,8 +348,11 @@ The `ScrollerVideo` component can be used inside the [ScrollerBase](?path=/story
|
|
|
348
348
|
<!-- Pass bindable prop `progress` as `videoPercentage` and set `trackScroll` to `false` -->
|
|
349
349
|
<ScrollerVideo
|
|
350
350
|
src="my-video.mp4"
|
|
351
|
-
|
|
351
|
+
height="100lvh"
|
|
352
352
|
trackScroll={false}
|
|
353
|
+
videoPercentage={progress}
|
|
354
|
+
transitionSpeed={40}
|
|
355
|
+
showDebugInfo
|
|
353
356
|
/>
|
|
354
357
|
{/snippet}
|
|
355
358
|
{#snippet foregroundSnippet()}
|
|
@@ -200,7 +200,10 @@
|
|
|
200
200
|
videoPercentage >= 0 &&
|
|
201
201
|
videoPercentage <= 1
|
|
202
202
|
) {
|
|
203
|
-
scrollerVideo.setVideoPercentage(videoPercentage
|
|
203
|
+
scrollerVideo.setVideoPercentage(videoPercentage, {
|
|
204
|
+
jump: false,
|
|
205
|
+
transitionSpeed: restProps.transitionSpeed || 8,
|
|
206
|
+
});
|
|
204
207
|
}
|
|
205
208
|
}
|
|
206
209
|
});
|
|
@@ -67,35 +67,6 @@ https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5
|
|
|
67
67
|
https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12
|
|
68
68
|
*/
|
|
69
69
|
/* Scales by 1.125 */
|
|
70
|
-
#progress-bar {
|
|
71
|
-
background-color: rgba(0, 0, 0, 0.8);
|
|
72
|
-
position: absolute;
|
|
73
|
-
z-index: 4;
|
|
74
|
-
right: 0;
|
|
75
|
-
padding: 1rem;
|
|
76
|
-
top: 0;
|
|
77
|
-
}
|
|
78
|
-
#progress-bar progress {
|
|
79
|
-
height: 6px;
|
|
80
|
-
background-color: rgba(255, 0, 0, 0.2666666667); /* Background color of the entire bar */
|
|
81
|
-
margin: 0;
|
|
82
|
-
}
|
|
83
|
-
#progress-bar progress::-webkit-progress-value {
|
|
84
|
-
background-color: white;
|
|
85
|
-
border-radius: 10px;
|
|
86
|
-
}
|
|
87
|
-
#progress-bar progress::-webkit-progress-bar {
|
|
88
|
-
background-color: #444444;
|
|
89
|
-
border-radius: 10px;
|
|
90
|
-
}
|
|
91
|
-
#progress-bar p {
|
|
92
|
-
font-family: var(--theme-font-family-sans-serif);
|
|
93
|
-
color: white;
|
|
94
|
-
font-size: var(--theme-font-size-xs);
|
|
95
|
-
padding: 0;
|
|
96
|
-
margin: 0;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
70
|
.step-foreground-container {
|
|
100
71
|
height: 100lvh;
|
|
101
72
|
width: 50%;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
height="100lvh"
|
|
15
15
|
trackScroll={false}
|
|
16
16
|
videoPercentage={progress}
|
|
17
|
+
transitionSpeed={40}
|
|
17
18
|
showDebugInfo
|
|
18
19
|
/>
|
|
19
20
|
{/snippet}
|
|
@@ -38,33 +39,6 @@ https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5
|
|
|
38
39
|
https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12
|
|
39
40
|
*/
|
|
40
41
|
/* Scales by 1.125 */
|
|
41
|
-
#progress-bar {
|
|
42
|
-
background-color: rgba(0, 0, 0, 0.8);
|
|
43
|
-
position: absolute;
|
|
44
|
-
z-index: 2;
|
|
45
|
-
right: 0;
|
|
46
|
-
padding: 1rem;
|
|
47
|
-
}
|
|
48
|
-
#progress-bar progress {
|
|
49
|
-
height: 6px;
|
|
50
|
-
background-color: rgba(255, 0, 0, 0.2666666667); /* Background color of the entire bar */
|
|
51
|
-
}
|
|
52
|
-
#progress-bar progress::-webkit-progress-value {
|
|
53
|
-
background-color: white;
|
|
54
|
-
border-radius: 10px;
|
|
55
|
-
}
|
|
56
|
-
#progress-bar progress::-webkit-progress-bar {
|
|
57
|
-
background-color: #444444;
|
|
58
|
-
border-radius: 10px;
|
|
59
|
-
}
|
|
60
|
-
#progress-bar p {
|
|
61
|
-
font-family: var(--theme-font-family-sans-serif);
|
|
62
|
-
color: white;
|
|
63
|
-
font-size: var(--theme-font-size-xs);
|
|
64
|
-
padding: 0;
|
|
65
|
-
margin: 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
42
|
.step-foreground-container {
|
|
69
43
|
height: 100lvh;
|
|
70
44
|
width: 50%;
|