@reuters-graphics/graphics-components 0.0.1-beta.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/README.md +7 -0
- package/dist/@types/actions/cssVariables/index.d.ts +4 -0
- package/dist/@types/actions/resizeObserver/index.d.ts +4 -0
- package/dist/@types/components/@types/global.d.ts +28 -0
- package/dist/@types/components/Article/Article.svelte.d.ts +32 -0
- package/dist/@types/components/BeforeAfter/BeforeAfter.svelte.d.ts +57 -0
- package/dist/@types/components/Block/Block.svelte.d.ts +24 -0
- package/dist/@types/components/BodyText/BodyText.svelte.d.ts +20 -0
- package/dist/@types/components/DatawrapperChart/DatawrapperChart.svelte.d.ts +52 -0
- package/dist/@types/components/EmbedPreviewerLink/EmbedPreviewerLink.svelte.d.ts +16 -0
- package/dist/@types/components/FeaturePhoto/FeaturePhoto.svelte.d.ts +43 -0
- package/dist/@types/components/Framer/Framer.svelte.d.ts +29 -0
- package/dist/@types/components/Framer/Resizer/index.svelte.d.ts +27 -0
- package/dist/@types/components/Framer/stores.d.ts +1 -0
- package/dist/@types/components/Framer/uniqNames.d.ts +2 -0
- package/dist/@types/components/GraphicBlock/AriaHidden.svelte.d.ts +20 -0
- package/dist/@types/components/GraphicBlock/GraphicBlock.svelte.d.ts +64 -0
- package/dist/@types/components/GraphicBlock/TextBlock.svelte.d.ts +19 -0
- package/dist/@types/components/Headline/Headline.svelte.d.ts +29 -0
- package/dist/@types/components/Hero/Hero.svelte.d.ts +41 -0
- package/dist/@types/components/NoteText/NoteText.svelte.d.ts +20 -0
- package/dist/@types/components/PaddingReset/index.svelte.d.ts +27 -0
- package/dist/@types/components/PhotoPack/PhotoPack.svelte.d.ts +50 -0
- package/dist/@types/components/PhotoPack/docProps.d.ts +38 -0
- package/dist/@types/components/PymChild/PymChild.svelte.d.ts +16 -0
- package/dist/@types/components/ReutersLogo/ReutersLogo.svelte.d.ts +18 -0
- package/dist/@types/components/SEO/SEO.svelte.d.ts +66 -0
- package/dist/@types/components/SEO/analytics.d.ts +2 -0
- package/dist/@types/components/SEO/publisherTags.d.ts +2 -0
- package/dist/@types/components/Scroller/Background.svelte.d.ts +20 -0
- package/dist/@types/components/Scroller/Embedded/Background.svelte.d.ts +19 -0
- package/dist/@types/components/Scroller/Embedded/Foreground.svelte.d.ts +18 -0
- package/dist/@types/components/Scroller/Embedded/index.svelte.d.ts +19 -0
- package/dist/@types/components/Scroller/Foreground.svelte.d.ts +17 -0
- package/dist/@types/components/Scroller/Scroller.svelte.d.ts +76 -0
- package/dist/@types/components/Sharer/Sharer.svelte.d.ts +19 -0
- package/dist/@types/components/Sharer/utils/copyToClipboard.d.ts +2 -0
- package/dist/@types/components/Sharer/utils/facebook.d.ts +2 -0
- package/dist/@types/components/Sharer/utils/meta.d.ts +2 -0
- package/dist/@types/components/Sharer/utils/twitter.d.ts +2 -0
- package/dist/@types/components/SiteFooter/CompanyLinks.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/LegalLinks.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/QuickLinks.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/Referrals/IntersectionObserver.svelte.d.ts +39 -0
- package/dist/@types/components/SiteFooter/Referrals/Link.svelte.d.ts +29 -0
- package/dist/@types/components/SiteFooter/Referrals/Referrals.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/Referrals/index.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/SiteFooter.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/Facebook.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/Graphics.svelte.d.ts +19 -0
- package/dist/@types/components/SiteFooter/svgs/Instagram.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/LinkedIn.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/Pictures.svelte.d.ts +19 -0
- package/dist/@types/components/SiteFooter/svgs/Twitter.svelte.d.ts +23 -0
- package/dist/@types/components/SiteFooter/svgs/Videos.svelte.d.ts +19 -0
- package/dist/@types/components/SiteFooter/svgs/YouTube.svelte.d.ts +23 -0
- package/dist/@types/components/SiteHeader/MobileMenu/index.svelte.d.ts +27 -0
- package/dist/@types/components/SiteHeader/NavBar/DownArrow.svelte.d.ts +23 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/MoreDropdown.svelte.d.ts +23 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/SectionDropdown.svelte.d.ts +25 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/Spinner/index.svelte.d.ts +19 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte.d.ts +25 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/StoryCard/time.d.ts +1 -0
- package/dist/@types/components/SiteHeader/NavBar/NavDropdown/index.svelte.d.ts +27 -0
- package/dist/@types/components/SiteHeader/NavBar/index.svelte.d.ts +23 -0
- package/dist/@types/components/SiteHeader/NavBar/utils/index.d.ts +1 -0
- package/dist/@types/components/SiteHeader/SiteHeader.svelte.d.ts +14 -0
- package/dist/@types/components/SiteHeader/svgs/Close.svelte.d.ts +19 -0
- package/dist/@types/components/SiteHeader/svgs/Menu.svelte.d.ts +23 -0
- package/dist/@types/components/Spinner/Spinner.svelte.d.ts +28 -0
- package/dist/@types/components/Theme/@types/component.d.ts +28 -0
- package/dist/@types/components/Theme/Theme.svelte.d.ts +54 -0
- package/dist/@types/components/Theme/themes/dark.d.ts +2 -0
- package/dist/@types/components/Theme/themes/light.d.ts +22 -0
- package/dist/@types/components/Theme/utils/flatten.d.ts +1 -0
- package/dist/@types/components/Theme/utils/merge.d.ts +4 -0
- package/dist/@types/components/Video/Controls.svelte.d.ts +45 -0
- package/dist/@types/components/Video/Video.svelte.d.ts +46 -0
- package/dist/@types/components/Visible/Visible.svelte.d.ts +29 -0
- package/dist/@types/index.d.ts +24 -0
- package/dist/actions/cssVariables/index.js +20 -0
- package/dist/actions/resizeObserver/index.js +25 -0
- package/dist/components/@types/global.js +1 -0
- package/dist/components/Article/Article.svelte +47 -0
- package/dist/components/BeforeAfter/BeforeAfter.svelte +341 -0
- package/dist/components/Block/Block.svelte +177 -0
- package/dist/components/BodyText/BodyText.svelte +193 -0
- package/dist/components/DatawrapperChart/DatawrapperChart.svelte +105 -0
- package/dist/components/EmbedPreviewerLink/EmbedPreviewerLink.svelte +26 -0
- package/dist/components/FeaturePhoto/FeaturePhoto.svelte +113 -0
- package/dist/components/Framer/Framer.svelte +136 -0
- package/dist/components/Framer/Resizer/index.svelte +223 -0
- package/dist/components/Framer/stores.js +3 -0
- package/dist/components/Framer/uniqNames.js +54 -0
- package/dist/components/GraphicBlock/AriaHidden.svelte +13 -0
- package/dist/components/GraphicBlock/GraphicBlock.svelte +269 -0
- package/dist/components/GraphicBlock/TextBlock.svelte +12 -0
- package/dist/components/Headline/Headline.svelte +109 -0
- package/dist/components/Hero/Hero.svelte +78 -0
- package/dist/components/NoteText/NoteText.svelte +124 -0
- package/dist/components/PaddingReset/index.svelte +17 -0
- package/dist/components/PhotoPack/PhotoPack.svelte +156 -0
- package/dist/components/PhotoPack/docProps.js +20 -0
- package/dist/components/PymChild/PymChild.svelte +10 -0
- package/dist/components/ReutersLogo/ReutersLogo.svelte +21 -0
- package/dist/components/SEO/SEO.svelte +179 -0
- package/dist/components/SEO/analytics.js +332 -0
- package/dist/components/SEO/publisherTags.js +26 -0
- package/dist/components/Scroller/Background.svelte +30 -0
- package/dist/components/Scroller/Embedded/Background.svelte +14 -0
- package/dist/components/Scroller/Embedded/Foreground.svelte +203 -0
- package/dist/components/Scroller/Embedded/index.svelte +18 -0
- package/dist/components/Scroller/Foreground.svelte +42 -0
- package/dist/components/Scroller/Scroller.svelte +210 -0
- package/dist/components/Sharer/Sharer.svelte +157 -0
- package/dist/components/Sharer/utils/copyToClipboard.js +10 -0
- package/dist/components/Sharer/utils/facebook.js +22 -0
- package/dist/components/Sharer/utils/meta.js +7 -0
- package/dist/components/Sharer/utils/twitter.js +22 -0
- package/dist/components/SiteFooter/CompanyLinks.svelte +173 -0
- package/dist/components/SiteFooter/LegalLinks.svelte +202 -0
- package/dist/components/SiteFooter/QuickLinks.svelte +259 -0
- package/dist/components/SiteFooter/Referrals/IntersectionObserver.svelte +45 -0
- package/dist/components/SiteFooter/Referrals/Link.svelte +73 -0
- package/dist/components/SiteFooter/Referrals/Referrals.svelte +56 -0
- package/dist/components/SiteFooter/Referrals/index.svelte +53 -0
- package/dist/components/SiteFooter/SiteFooter.svelte +41 -0
- package/dist/components/SiteFooter/data.json +210 -0
- package/dist/components/SiteFooter/svgs/Facebook.svelte +18 -0
- package/dist/components/SiteFooter/svgs/Graphics.svelte +18 -0
- package/dist/components/SiteFooter/svgs/Instagram.svelte +20 -0
- package/dist/components/SiteFooter/svgs/LinkedIn.svelte +18 -0
- package/dist/components/SiteFooter/svgs/Pictures.svelte +14 -0
- package/dist/components/SiteFooter/svgs/Twitter.svelte +18 -0
- package/dist/components/SiteFooter/svgs/Videos.svelte +14 -0
- package/dist/components/SiteFooter/svgs/YouTube.svelte +18 -0
- package/dist/components/SiteHeader/MobileMenu/index.svelte +199 -0
- package/dist/components/SiteHeader/NavBar/DownArrow.svelte +26 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/MoreDropdown.svelte +112 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/SectionDropdown.svelte +118 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/Spinner/index.svelte +49 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte +99 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/time.js +70 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/index.svelte +277 -0
- package/dist/components/SiteHeader/NavBar/index.svelte +234 -0
- package/dist/components/SiteHeader/NavBar/utils/index.js +2 -0
- package/dist/components/SiteHeader/SiteHeader.svelte +235 -0
- package/dist/components/SiteHeader/data.json +1 -0
- package/dist/components/SiteHeader/scss/_breakpoints.scss +59 -0
- package/dist/components/SiteHeader/scss/_colors.scss +25 -0
- package/dist/components/SiteHeader/scss/_eases.scss +9 -0
- package/dist/components/SiteHeader/scss/_grids.scss +126 -0
- package/dist/components/SiteHeader/scss/_z-indexes.scss +15 -0
- package/dist/components/SiteHeader/svgs/Close.svelte +14 -0
- package/dist/components/SiteHeader/svgs/Menu.svelte +19 -0
- package/dist/components/Spinner/Spinner.svelte +91 -0
- package/dist/components/Theme/@types/component.js +3 -0
- package/dist/components/Theme/Theme.svelte +37 -0
- package/dist/components/Theme/themes/dark.js +23 -0
- package/dist/components/Theme/themes/light.js +22 -0
- package/dist/components/Theme/utils/flatten.js +39 -0
- package/dist/components/Theme/utils/merge.js +23 -0
- package/dist/components/Video/Controls.svelte +68 -0
- package/dist/components/Video/Video.svelte +278 -0
- package/dist/components/Visible/Visible.svelte +54 -0
- package/dist/index.js +31 -0
- package/dist/scss/_mixins.scss +6 -0
- package/dist/scss/_variables.scss +2 -0
- package/dist/scss/bootstrap/_main.scss +34 -0
- package/dist/scss/bootstrap/_variables.scss +10 -0
- package/dist/scss/colours/thematic/_nord.scss +40 -0
- package/dist/scss/colours/thematic/_tr.scss +27 -0
- package/dist/scss/components/_hero-title.scss +118 -0
- package/dist/scss/fonts/_font-faces.scss +129 -0
- package/dist/scss/fonts/_mixins.scss +25 -0
- package/dist/scss/fonts/_rules.scss +19 -0
- package/dist/scss/fonts/_variables.scss +26 -0
- package/dist/scss/main.scss +16 -0
- package/dist/scss/mixins/_block.scss +62 -0
- package/dist/scss/mixins/_body-text.scss +113 -0
- package/dist/scss/mixins/_graphic.scss +66 -0
- package/dist/scss/mixins/_note-text.scss +34 -0
- package/dist/scss/mixins/_visually-hidden.scss +12 -0
- package/dist/scss/spacers/_rules.scss +65 -0
- package/dist/scss/spacers/_variables.scss +19 -0
- package/dist/scss/typography/_box-shadow.scss +11 -0
- package/dist/scss/typography/_font-size.scss +81 -0
- package/dist/scss/typography/_letter-spacing.scss +15 -0
- package/dist/scss/typography/_main.scss +5 -0
- package/dist/scss/typography/_mixins.scss +26 -0
- package/dist/scss/typography/_rules.scss +83 -0
- package/dist/scss/typography/_text-shadow.scss +13 -0
- package/dist/scss/typography/_transform.scss +7 -0
- package/dist/scss/typography/_variables.scss +39 -0
- package/package.json +210 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<script>/**
|
|
2
|
+
* Headline
|
|
3
|
+
*/
|
|
4
|
+
export let hed = 'Reuters Graphics Interactive';
|
|
5
|
+
/**
|
|
6
|
+
* Hedline colour
|
|
7
|
+
*/
|
|
8
|
+
export let hedColour = 'white';
|
|
9
|
+
/**
|
|
10
|
+
* Dek
|
|
11
|
+
*/
|
|
12
|
+
export let dek = null;
|
|
13
|
+
/**
|
|
14
|
+
* Section title
|
|
15
|
+
*/
|
|
16
|
+
export let section = null;
|
|
17
|
+
/**
|
|
18
|
+
* Section colour
|
|
19
|
+
*/
|
|
20
|
+
export let sectionColour = 'red';
|
|
21
|
+
export let imgSrc;
|
|
22
|
+
export let imgAltText;
|
|
23
|
+
export let overlay = true;
|
|
24
|
+
export let top = false;
|
|
25
|
+
export let bottom = false;
|
|
26
|
+
export let left = false;
|
|
27
|
+
export let right = false;
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<section class="hero-title">
|
|
32
|
+
<figure>
|
|
33
|
+
{#if $$slots.image}
|
|
34
|
+
<slot name='image'></slot>
|
|
35
|
+
{:else}
|
|
36
|
+
<img src="{imgSrc}" alt="{imgAltText}" />
|
|
37
|
+
{/if}
|
|
38
|
+
{#if overlay}
|
|
39
|
+
<div
|
|
40
|
+
class="overlay"
|
|
41
|
+
class:lightest={overlay === 'lightest'}
|
|
42
|
+
class:lighter={overlay === 'lighter'}
|
|
43
|
+
class:light={overlay === 'light'}
|
|
44
|
+
class:dark={overlay === 'dark'}
|
|
45
|
+
class:darker={overlay === 'darker'}
|
|
46
|
+
class:darkest={overlay === 'darkest'}
|
|
47
|
+
></div>
|
|
48
|
+
{/if}
|
|
49
|
+
</figure>
|
|
50
|
+
<div
|
|
51
|
+
class="title color-white"
|
|
52
|
+
class:top={top}
|
|
53
|
+
class:bottom={bottom}
|
|
54
|
+
class:left={left}
|
|
55
|
+
class:right={right}
|
|
56
|
+
>
|
|
57
|
+
{#if section}
|
|
58
|
+
<p class={`section-title color-${sectionColour} text-shadow`}>{section}</p>
|
|
59
|
+
{/if}
|
|
60
|
+
|
|
61
|
+
{#if $$slots.hed}
|
|
62
|
+
<slot name="hed"></slot>
|
|
63
|
+
{:else}
|
|
64
|
+
<h2
|
|
65
|
+
class={`text-shadow-darker color-${hedColour} important`}
|
|
66
|
+
>{hed}</h2>
|
|
67
|
+
{/if}
|
|
68
|
+
|
|
69
|
+
{#if $$slots.dek}
|
|
70
|
+
<slot name="dek"></slot>
|
|
71
|
+
{:else}
|
|
72
|
+
{#if dek}
|
|
73
|
+
<p class="text-shadow-darkest">{dek}</p>
|
|
74
|
+
{/if}
|
|
75
|
+
{/if}
|
|
76
|
+
</div>
|
|
77
|
+
</section>
|
|
78
|
+
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
<script>/**
|
|
2
|
+
* A markdown text string.
|
|
3
|
+
* @type {string}
|
|
4
|
+
* @required
|
|
5
|
+
*/
|
|
6
|
+
export let text;
|
|
7
|
+
import { marked } from 'marked';
|
|
8
|
+
import Block from '../Block/Block.svelte';
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<Block cls="notes">
|
|
12
|
+
{#if text}
|
|
13
|
+
{@html marked.parse(text)}
|
|
14
|
+
{/if}
|
|
15
|
+
</Block>
|
|
16
|
+
|
|
17
|
+
<!-- svelte-ignore css-unused-selector -->
|
|
18
|
+
<style global>:global(.paragraph-size) {
|
|
19
|
+
font-size: 1.3rem;
|
|
20
|
+
line-height: 2.1rem;
|
|
21
|
+
}
|
|
22
|
+
:global(.paragraph-size.font-sans) {
|
|
23
|
+
font-size: 1.1rem;
|
|
24
|
+
line-height: 1.75rem;
|
|
25
|
+
}
|
|
26
|
+
@media (max-width: 540px) {
|
|
27
|
+
:global(.paragraph-size) {
|
|
28
|
+
font-size: 1.1rem;
|
|
29
|
+
line-height: 1.8rem;
|
|
30
|
+
}
|
|
31
|
+
:global(.paragraph-size.font-sans) {
|
|
32
|
+
font-size: 1rem;
|
|
33
|
+
line-height: 1.6rem;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
:global(.paragraph-size.important) {
|
|
37
|
+
font-size: 1.3rem !important;
|
|
38
|
+
line-height: 2.1rem !important;
|
|
39
|
+
}
|
|
40
|
+
:global(.paragraph-size.important.font-sans) {
|
|
41
|
+
font-size: 1.1rem !important;
|
|
42
|
+
line-height: 1.8rem !important;
|
|
43
|
+
}
|
|
44
|
+
@media (max-width: 540px) {
|
|
45
|
+
:global(.paragraph-size.important) {
|
|
46
|
+
font-size: 1.1rem !important;
|
|
47
|
+
line-height: 1.8rem !important;
|
|
48
|
+
}
|
|
49
|
+
:global(.paragraph-size.important.font-sans) {
|
|
50
|
+
font-size: 1rem !important;
|
|
51
|
+
line-height: 1.6rem !important;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
:global(.small-size) {
|
|
56
|
+
font-size: 0.9rem;
|
|
57
|
+
line-height: 1.2rem;
|
|
58
|
+
}
|
|
59
|
+
@media (max-width: 540px) {
|
|
60
|
+
:global(.small-size) {
|
|
61
|
+
font-size: 0.8rem;
|
|
62
|
+
line-height: 1.1rem;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
:global(.small-size.important) {
|
|
66
|
+
font-size: 0.9rem !important;
|
|
67
|
+
line-height: 1.2rem !important;
|
|
68
|
+
}
|
|
69
|
+
@media (max-width: 540px) {
|
|
70
|
+
:global(.small-size.important) {
|
|
71
|
+
font-size: 0.8rem !important;
|
|
72
|
+
line-height: 1.1rem !important;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
:global(.blockquote-size) {
|
|
77
|
+
font-size: 1.6rem;
|
|
78
|
+
line-height: 2.1rem;
|
|
79
|
+
}
|
|
80
|
+
@media (max-width: 540px) {
|
|
81
|
+
:global(.blockquote-size) {
|
|
82
|
+
font-size: 1.3rem;
|
|
83
|
+
line-height: 1.9rem;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
:global(.blockquote-size.important) {
|
|
87
|
+
font-size: 1.6rem !important;
|
|
88
|
+
line-height: 2rem !important;
|
|
89
|
+
}
|
|
90
|
+
@media (max-width: 540px) {
|
|
91
|
+
:global(.blockquote-size.important) {
|
|
92
|
+
font-size: 1.3rem !important;
|
|
93
|
+
line-height: 1.8rem !important;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:global(div.article-block.notes) :global(h2),
|
|
98
|
+
:global(div.article-block.notes) :global(h3),
|
|
99
|
+
:global(div.article-block.notes) :global(h4),
|
|
100
|
+
:global(div.article-block.notes) :global(h5),
|
|
101
|
+
:global(div.article-block.notes) :global(h6) {
|
|
102
|
+
font-family: var(--theme-font-family-note, "Knowledge", "Source Sans Pro", Arial, sans-serif);
|
|
103
|
+
color: var(--theme-colour-text-primary);
|
|
104
|
+
margin: 1rem 0 0;
|
|
105
|
+
font-size: 1rem;
|
|
106
|
+
letter-spacing: 0.5px;
|
|
107
|
+
}
|
|
108
|
+
:global(div.article-block.notes) :global(p) {
|
|
109
|
+
font-family: var(--theme-font-family-note, "Knowledge", "Source Sans Pro", Arial, sans-serif);
|
|
110
|
+
font-size: 1rem;
|
|
111
|
+
font-weight: 200;
|
|
112
|
+
color: var(--theme-colour-text-primary);
|
|
113
|
+
}
|
|
114
|
+
:global(div.article-block.notes) :global(p) :global(a) {
|
|
115
|
+
color: currentColor;
|
|
116
|
+
background-size: 1px 1px;
|
|
117
|
+
background-image: url('data:image/svg+xml;utf8,<svg preserveAspectRatio="none" viewBox="0 0 1 1" xmlns="http://www.w3.org/2000/svg"><line x1="0" y1="0" x2="2" y2="2" stroke="rgba(0, 0, 0, 0.8)" /></svg>');
|
|
118
|
+
background-position: 0 1.1rem;
|
|
119
|
+
background-repeat: repeat-x;
|
|
120
|
+
text-decoration: none;
|
|
121
|
+
}
|
|
122
|
+
:global(div.article-block.notes) :global(p) :global(a:hover) {
|
|
123
|
+
text-decoration: none;
|
|
124
|
+
}</style>
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
<script>/**
|
|
2
|
+
* Array of image objects
|
|
3
|
+
* @required
|
|
4
|
+
*/
|
|
5
|
+
export let images = [];
|
|
6
|
+
/**
|
|
7
|
+
* Array of layout objects
|
|
8
|
+
* @required
|
|
9
|
+
*/
|
|
10
|
+
export let layouts = [];
|
|
11
|
+
/**
|
|
12
|
+
* Gap between images.
|
|
13
|
+
* @type {number}
|
|
14
|
+
*/
|
|
15
|
+
export let gap = 10;
|
|
16
|
+
const random4 = () => Math.floor((1 + Math.random()) * 0x10000)
|
|
17
|
+
.toString(16)
|
|
18
|
+
.substring(1);
|
|
19
|
+
/**
|
|
20
|
+
* Add an ID to target with SCSS. Should be unique from all other elements.
|
|
21
|
+
* @type {string}
|
|
22
|
+
*/
|
|
23
|
+
export let id = 'photopack-' + random4() + random4();
|
|
24
|
+
/**
|
|
25
|
+
* Add a class to target with SCSS.
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
28
|
+
export let cls = '';
|
|
29
|
+
/** Width of the component within the text well. */
|
|
30
|
+
export let width = 'normal';
|
|
31
|
+
/**
|
|
32
|
+
* Set a different width for captions within the text well, for example,
|
|
33
|
+
* "normal" to keep captions inline with the rest of the text well.
|
|
34
|
+
* Can't ever be wider than `width`.
|
|
35
|
+
* @type {string}
|
|
36
|
+
*/
|
|
37
|
+
export let captionWidth = 'normal';
|
|
38
|
+
import Block from '../Block/Block.svelte';
|
|
39
|
+
import PaddingReset from '../PaddingReset/index.svelte';
|
|
40
|
+
import { marked } from 'marked';
|
|
41
|
+
let containerWidth;
|
|
42
|
+
const groupRows = (images, layout) => {
|
|
43
|
+
// Default layout, one img per row
|
|
44
|
+
if (!layout)
|
|
45
|
+
return images.map((img) => [img]);
|
|
46
|
+
// Otherwise, chunk into rows according to layout scheme
|
|
47
|
+
let i = 0;
|
|
48
|
+
const rows = [];
|
|
49
|
+
for (const rowLength of layout.rows) {
|
|
50
|
+
const row = [];
|
|
51
|
+
for (const imgI of [...Array(rowLength).keys()]) {
|
|
52
|
+
row.push(images[imgI + i]);
|
|
53
|
+
}
|
|
54
|
+
rows.push(row);
|
|
55
|
+
i += rowLength;
|
|
56
|
+
}
|
|
57
|
+
return rows;
|
|
58
|
+
};
|
|
59
|
+
// Sort so breakpoints always descend
|
|
60
|
+
$: layouts.sort((a, b) => (a.breakpoint < b.breakpoint ? 1 : -1));
|
|
61
|
+
$: layout = layouts.find((l) =>
|
|
62
|
+
// Must have valid rows schema, i.e., adds to the total number of images
|
|
63
|
+
l.rows.reduce((a, b) => a + b, 0) === images.length &&
|
|
64
|
+
// Breakpoint is higher than container width
|
|
65
|
+
(containerWidth || 0) >= l.breakpoint);
|
|
66
|
+
$: rows = groupRows(images, layout);
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<Block width="{width}" id="{id}" cls="photopack {cls}">
|
|
70
|
+
<div class="photopack-container" bind:clientWidth="{containerWidth}">
|
|
71
|
+
{#each rows as row, ri}
|
|
72
|
+
<div
|
|
73
|
+
class="photopack-row"
|
|
74
|
+
style:gap="0 {gap}px"
|
|
75
|
+
style:margin-bottom="{gap + 'px'}"
|
|
76
|
+
>
|
|
77
|
+
{#each row as img, i}
|
|
78
|
+
<figure aria-labelledby="{id}-figure-{ri}-{i}">
|
|
79
|
+
<img
|
|
80
|
+
src="{img.src}"
|
|
81
|
+
alt="{img.altText}"
|
|
82
|
+
style:max-height="{img.maxHeight ? img.maxHeight + 'px' : ''}"
|
|
83
|
+
/>
|
|
84
|
+
{#if !img.altText}
|
|
85
|
+
<div class="alt-warning">altText</div>
|
|
86
|
+
{/if}
|
|
87
|
+
</figure>
|
|
88
|
+
{/each}
|
|
89
|
+
</div>
|
|
90
|
+
{/each}
|
|
91
|
+
</div>
|
|
92
|
+
<PaddingReset width="{width}">
|
|
93
|
+
<Block width="{captionWidth}">
|
|
94
|
+
<div class="captions-container">
|
|
95
|
+
{#each rows as row, ri}
|
|
96
|
+
{#each row as img, i}
|
|
97
|
+
{#if img.caption}
|
|
98
|
+
<div id="{id}-figure-{ri}-{i}" class="caption">
|
|
99
|
+
{@html marked(img.caption)}
|
|
100
|
+
</div>
|
|
101
|
+
{/if}
|
|
102
|
+
{/each}
|
|
103
|
+
{/each}
|
|
104
|
+
</div>
|
|
105
|
+
</Block>
|
|
106
|
+
</PaddingReset>
|
|
107
|
+
</Block>
|
|
108
|
+
|
|
109
|
+
<style>div.photopack-container {
|
|
110
|
+
display: block;
|
|
111
|
+
width: 100%;
|
|
112
|
+
margin-bottom: 10px;
|
|
113
|
+
}
|
|
114
|
+
div.photopack-container div.photopack-row {
|
|
115
|
+
display: flex;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
}
|
|
118
|
+
div.photopack-container div.photopack-row figure {
|
|
119
|
+
flex: 1;
|
|
120
|
+
margin: 0;
|
|
121
|
+
padding: 0;
|
|
122
|
+
position: relative;
|
|
123
|
+
}
|
|
124
|
+
div.photopack-container div.photopack-row figure img {
|
|
125
|
+
margin: 0;
|
|
126
|
+
width: 100%;
|
|
127
|
+
height: 100%;
|
|
128
|
+
-o-object-fit: cover;
|
|
129
|
+
object-fit: cover;
|
|
130
|
+
}
|
|
131
|
+
div.photopack-container div.photopack-row figure div.alt-warning {
|
|
132
|
+
font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
|
|
133
|
+
padding: 5px 10px;
|
|
134
|
+
background-color: red;
|
|
135
|
+
color: white;
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 0;
|
|
138
|
+
right: 0;
|
|
139
|
+
font-size: 14px;
|
|
140
|
+
line-height: 16px;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
div.captions-container div.caption {
|
|
144
|
+
margin: 0 0 0.6rem;
|
|
145
|
+
}
|
|
146
|
+
div.captions-container div.caption:last-of-type {
|
|
147
|
+
margin-bottom: 0;
|
|
148
|
+
}
|
|
149
|
+
div.captions-container div.caption :global(p) {
|
|
150
|
+
font-size: 0.85rem;
|
|
151
|
+
line-height: 1.1rem;
|
|
152
|
+
font-family: var(--theme-font-family-note, "Knowledge", "Source Sans Pro", Arial, sans-serif);
|
|
153
|
+
color: var(--theme-colour-text-secondary, #666666);
|
|
154
|
+
margin: 0;
|
|
155
|
+
font-weight: 300;
|
|
156
|
+
}</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import urlJoin from 'proper-url-join';
|
|
2
|
+
export const getPhotoPackPropsFromDoc = (docBlock, assetsPath = '') => {
|
|
3
|
+
return {
|
|
4
|
+
id: docBlock.ID,
|
|
5
|
+
cls: docBlock.Class,
|
|
6
|
+
width: docBlock.Width,
|
|
7
|
+
captionWidth: docBlock.CaptionWidth,
|
|
8
|
+
gap: docBlock.Gap && isNaN(docBlock.Gap) ? null : parseInt(docBlock.Gap),
|
|
9
|
+
images: docBlock.Images.map((img) => ({
|
|
10
|
+
src: /^https?:\/\/|^\/\//i.test(img.Src) ? img.Src : urlJoin(assetsPath, img.Src),
|
|
11
|
+
altText: img.AltText,
|
|
12
|
+
caption: img.Caption,
|
|
13
|
+
maxHeight: img.MaxHeight && isNaN(img.MaxHeight) ? null : parseFloat(img.MaxHeight),
|
|
14
|
+
})),
|
|
15
|
+
layouts: docBlock.Layouts.map((layout) => ({
|
|
16
|
+
breakpoint: isNaN(layout.Breakpoint) ? null : parseFloat(layout.Breakpoint),
|
|
17
|
+
rows: layout.Rows.split(',').map(r => parseInt(r.trim())),
|
|
18
|
+
})),
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script>/** "Kinesis" colour */
|
|
2
|
+
export let logoColour = '#FA6400';
|
|
3
|
+
/** Text colour */
|
|
4
|
+
export let textColour = '#404040';
|
|
5
|
+
/** CSS width value */
|
|
6
|
+
export let width = '100%';
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<svg
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
focusable="false"
|
|
12
|
+
viewBox="0 0 301 72"
|
|
13
|
+
style="width: {width};"
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d="M79.231 36.006a4.171 4.171 0 11-8.342 0 4.171 4.171 0 018.342 0zm-12.81-7.292a2.506 2.506 0 100 5.011 2.506 2.506 0 000-5.01zm-2.959-8.744a3.187 3.187 0 100 6.373 3.187 3.187 0 000-6.373zm-5.165-6.632a2.944 2.944 0 100 5.888 2.944 2.944 0 000-5.888zM51.8 9.387a2.51 2.51 0 100 5.02 2.51 2.51 0 000-5.02zm-6.882-1.626a2.123 2.123 0 100 4.245 2.123 2.123 0 000-4.245zm-6.745.297a1.637 1.637 0 100 3.273 1.637 1.637 0 000-3.273zm-5.868 1.416a1.408 1.408 0 100 2.816 1.408 1.408 0 000-2.816zm-5.015 2.238a1.214 1.214 0 100 2.43 1.214 1.214 0 000-2.43zm-4.426 2.904a1.41 1.41 0 100 2.82 1.41 1.41 0 000-2.82zm-4.182 4.064a1.633 1.633 0 100 3.265 1.633 1.633 0 000-3.265zm-3.501 5.452a1.94 1.94 0 100 3.881 1.94 1.94 0 000-3.88zm-2.023 7.008a2.058 2.058 0 100 4.116 2.058 2.058 0 000-4.116zm.143 7.139a2.508 2.508 0 100 5.016 2.508 2.508 0 000-5.016zm2.956 7.387a3.185 3.185 0 100 6.37 3.185 3.185 0 000-6.37zm5.203 7.099a2.942 2.942 0 100 5.883 2.942 2.942 0 000-5.883zm6.27 4.703a2.505 2.505 0 100 5.01 2.505 2.505 0 000-5.01zm7.08 2.544a2.12 2.12 0 100 4.241 2.12 2.12 0 000-4.24zm6.733.666a1.63 1.63 0 100 3.26 1.63 1.63 0 000-3.26zm5.885-.96a1.41 1.41 0 100 2.821 1.41 1.41 0 000-2.82zm5.01-1.86a1.212 1.212 0 100 2.425 1.212 1.212 0 000-2.424zm4.425-3.29a1.415 1.415 0 100 2.829 1.415 1.415 0 000-2.83zm4.189-4.51a1.637 1.637 0 100 3.274 1.637 1.637 0 000-3.273zm3.492-6.07a1.939 1.939 0 100 3.879 1.939 1.939 0 000-3.878zm2.03-7.231a2.048 2.048 0 100 4.096 2.048 2.048 0 000-4.096zm-8.018-2.354a1.943 1.943 0 100 3.887 1.943 1.943 0 000-3.886zm-7.522-1.729a1.1 1.1 0 100 2.201 1.1 1.1 0 000-2.201zm-2.08-5.232a1.513 1.513 0 100 3.026 1.513 1.513 0 000-3.027zm-4.94-4.396a2.066 2.066 0 100 4.13 2.066 2.066 0 000-4.13zm-6.704-.742a2.33 2.33 0 100 4.66 2.33 2.33 0 000-4.66zm-5.678 3.236a2.216 2.216 0 100 4.432 2.216 2.216 0 000-4.432zm-2.91 6.09a1.492 1.492 0 100 2.984 1.492 1.492 0 000-2.985zm.116 5.686a1.098 1.098 0 100 2.197 1.098 1.098 0 000-2.197zm1.971 4.365a1.514 1.514 0 100 3.028 1.514 1.514 0 000-3.028zm4.97 3.369a2.064 2.064 0 100 4.128 2.064 2.064 0 000-4.128zm6.685.171a2.326 2.326 0 100 4.653 2.326 2.326 0 000-4.653zm5.712-3.023a2.222 2.222 0 100 4.444 2.222 2.222 0 000-4.444zm2.9-4.616a1.494 1.494 0 100 2.988 1.494 1.494 0 000-2.988zM57.58 26.61a2.498 2.498 0 100 4.996 2.498 2.498 0 000-4.996zm-4.232-7.013a2.986 2.986 0 100 5.972 2.986 2.986 0 000-5.972zm-6.385-3.924a2.676 2.676 0 100 5.353 2.676 2.676 0 000-5.353zm-7.088-.78a2.35 2.35 0 100 4.7 2.35 2.35 0 000-4.7zm-7.085 2.27a1.758 1.758 0 100 3.516 1.758 1.758 0 000-3.517zm-5.984 4.16a1.618 1.618 0 100 3.234 1.618 1.618 0 000-3.235zm-4.045 5.94a1.624 1.624 0 100 3.248 1.624 1.624 0 000-3.249zm-1.704 6.503a1.936 1.936 0 100 3.873 1.936 1.936 0 000-3.873zm.991 6.655a2.501 2.501 0 100 5.002 2.501 2.501 0 000-5.002zm4.229 6.055a2.98 2.98 0 100 5.96 2.98 2.98 0 000-5.96zm6.416 4.522a2.686 2.686 0 100 5.372 2.686 2.686 0 000-5.372zm7.066 1.415a2.366 2.366 0 100 4.733 2.366 2.366 0 000-4.733zm7.09-1.05a1.758 1.758 0 100 3.516 1.758 1.758 0 000-3.516zm5.992-3.852a1.62 1.62 0 100 3.238 1.62 1.62 0 000-3.238zm4.042-6a1.62 1.62 0 100 3.239 1.62 1.62 0 000-3.238zm16.53-20.253a3.603 3.603 0 100 7.205 3.603 3.603 0 000-7.205zm-4.581-8.281a3.066 3.066 0 100 6.133 3.066 3.066 0 000-6.133zm-6.8-6.497a2.642 2.642 0 100 5.284 2.642 2.642 0 000-5.284zm-7.626-3.932a2.14 2.14 0 100 4.279 2.14 2.14 0 000-4.28zM46.907.534a1.842 1.842 0 100 3.685 1.842 1.842 0 000-3.685zM39.855 0a1.585 1.585 0 100 3.17 1.585 1.585 0 000-3.17zm-7.03.526a1.847 1.847 0 100 3.694 1.847 1.847 0 000-3.693zm-7.5 2.022a2.141 2.141 0 100 4.282 2.141 2.141 0 000-4.282zm-7.633 3.924a2.644 2.644 0 100 5.288 2.644 2.644 0 000-5.288zm-6.801 6.505a3.064 3.064 0 100 6.127 3.064 3.064 0 000-6.127zM6.315 21.27a3.603 3.603 0 100 7.205 3.603 3.603 0 000-7.205zM4.662 31.835a4.171 4.171 0 100 8.342 4.171 4.171 0 000-8.342zm1.655 11.696a3.606 3.606 0 100 7.21 3.606 3.606 0 000-7.21zm4.578 9.374a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm6.792 7.34a2.644 2.644 0 100 5.288 2.644 2.644 0 000-5.288zm7.638 4.927a2.142 2.142 0 100 4.284 2.142 2.142 0 000-4.284zm7.505 2.616a1.845 1.845 0 100 3.69 1.845 1.845 0 000-3.69zm7.041 1.036a1.588 1.588 0 100 3.176 1.588 1.588 0 000-3.176zm7.03-1.038a1.845 1.845 0 100 3.69 1.845 1.845 0 000-3.69zm7.505-2.61a2.148 2.148 0 100 4.297 2.148 2.148 0 000-4.297zm7.632-4.938a2.646 2.646 0 100 5.292 2.646 2.646 0 000-5.292zm6.8-7.335a3.059 3.059 0 100 6.118 3.059 3.059 0 000-6.118zm4.578-9.366a3.609 3.609 0 100 7.217 3.609 3.609 0 000-7.217z"
|
|
17
|
+
style="fill: {logoColour};"></path>
|
|
18
|
+
<path
|
|
19
|
+
d="M121.865 50.29c0 .287-.167.497-.498.497h-5.085c-.455 0-.624-.422-.83-.833l-5.997-10.096h-.922c-1.087 0-4.451-.119-5.41-.168v10.264c0 .456-.336.833-.793.833h-4.165a.837.837 0 01-.83-.833V22.667c0-.833.494-1.125 1.333-1.248 2.166-.331 6.82-.537 9.864-.537 6.41 0 12.331 2.291 12.331 9.407v.378c0 4.407-2.204 6.82-5.616 8.146l6.532 11.141a.543.543 0 01.086.336zm-6.746-20c0-3.123-2.422-4.456-6.586-4.456-.878 0-4.666.084-5.41.168v9.026c.661.043 4.695.127 5.41.127 4.284 0 6.586-.826 6.586-4.488v-.378zm144.946 20c0 .287-.166.497-.498.497h-5.084c-.456 0-.625-.422-.83-.833l-5.998-10.096h-.922c-1.087 0-4.45-.119-5.41-.168v10.264c0 .456-.335.833-.793.833h-4.165a.837.837 0 01-.83-.833V22.667c0-.833.494-1.125 1.333-1.248 2.167-.331 6.82-.537 9.865-.537 6.41 0 12.33 2.291 12.33 9.407v.378c0 4.407-2.204 6.82-5.615 8.146l6.532 11.141a.544.544 0 01.085.336zm-6.745-20c0-3.123-2.423-4.456-6.587-4.456-.878 0-4.666.084-5.41.168v9.026c.661.043 4.695.127 5.41.127 4.284 0 6.587-.826 6.587-4.488v-.378zm-121.253 7.603h13.327a.835.835 0 00.833-.827V34.06a.837.837 0 00-.833-.829h-13.327v-3.818c0-3.482.134-3.578 3.284-3.578h10.54a.842.842 0 00.835-.836v-2.66c0-.585-.21-.796-.835-.876-1.332-.204-4.045-.58-8.995-.58-6.912 0-10.578-.048-10.578 8.53v13.174c0 8.579 3.666 8.531 10.578 8.531 4.95 0 7.663-.372 8.995-.583.625-.08.835-.288.835-.875v-2.66a.837.837 0 00-.835-.83h-10.54c-3.15 0-3.284-.094-3.284-3.583v-4.693zm82.266 0h13.326a.835.835 0 00.834-.827V34.06a.837.837 0 00-.834-.829h-13.326v-3.818c0-3.482.133-3.578 3.283-3.578h10.54a.842.842 0 00.836-.836v-2.66c0-.585-.21-.796-.835-.876-1.333-.204-4.045-.58-8.996-.58-6.912 0-10.578-.048-10.578 8.53v13.174c0 8.579 3.666 8.531 10.578 8.531 4.95 0 7.663-.372 8.996-.583.625-.08.835-.288.835-.875v-2.66a.837.837 0 00-.835-.83h-10.541c-3.15 0-3.284-.094-3.284-3.583v-4.693zM177 39.331V22.004c0-.462-.374-.791-.837-.791h-4.121c-.458 0-.83.329-.83.79v17.328c0 4.749-2.192 7-6.69 7-4.489 0-6.685-2.251-6.685-7V22.004c0-.462-.372-.791-.834-.791h-4.114c-.457 0-.836.329-.836.79v17.328c0 8.873 5.77 11.786 12.47 11.786 6.705 0 12.477-2.913 12.477-11.786zm26.923-13.292h-8.304v23.915a.84.84 0 01-.839.833h-4.117a.834.834 0 01-.83-.833V26.04h-8.315c-.455 0-.834-.288-.834-.745v-3.29c0-.462.379-.791.834-.791h22.404c.458 0 .835.33.835.791v3.29c0 .457-.377.745-.834.745zm81.586 16.38c0-3.994-2.27-6.06-5.788-7.48-2.766-1.112-5.196-2.057-7.046-2.785-1.842-.73-3.41-1.993-3.41-3.364 0-1.87 2.319-2.955 5.392-2.955 3.626 0 6.477.506 9.227.757h.084c.414 0 .703-.338.703-.75V22.76c0-.413-.327-.706-.746-.787-1.411-.339-5.044-1.094-9.015-1.094-7.74 0-11.432 3.33-11.432 7.912 0 2.911 1.283 5.781 4.912 7.279 3.636 1.5 11.08 3.228 11.08 6.35 0 2.414-1.124 3.741-4.833 3.741-3.848 0-7.745-.545-9.412-.754h-.083a.793.793 0 00-.789.793v3c0 .458.375.745.79.828 2.002.46 5.735 1.094 9.41 1.094 8.335 0 10.956-4.5 10.956-8.703zm3.039-15.501c0 3.27 2.412 6.038 6.092 6.038 3.68 0 6.119-2.769 6.119-6.038 0-3.296-2.44-6.006-6.12-6.006-3.679 0-6.091 2.71-6.091 6.006zm.887 0c0-2.908 2.049-5.23 5.205-5.23 3.183 0 5.23 2.322 5.23 5.23 0 2.909-2.047 5.263-5.23 5.263-3.156 0-5.204-2.354-5.204-5.263zm7.97 2.69l-1.321-2.25c.69-.267 1.136-.754 1.136-1.644v-.075c0-1.438-1.196-1.9-2.491-1.9-.612 0-1.553.042-1.99.11-.169.023-.269.082-.269.25v5.51a.17.17 0 00.169.167h.84c.091 0 .158-.076.158-.167v-2.073c.195.01.875.035 1.092.035h.187l1.213 2.038c.04.082.074.167.166.167h1.027c.065 0 .1-.043.1-.1 0-.019 0-.043-.017-.067zm-1.345-3.893c0 .738-.464.905-1.331.905-.14 0-.955-.017-1.092-.026v-1.821a21.3 21.3 0 011.092-.034c.842 0 1.331.269 1.331.9v.076z"
|
|
20
|
+
style="fill: {textColour};"></path>
|
|
21
|
+
</svg>
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
<script>import analytics from './analytics';
|
|
2
|
+
import publisherTags from './publisherTags';
|
|
3
|
+
/**
|
|
4
|
+
* [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object for the page.
|
|
5
|
+
* @required
|
|
6
|
+
* @type {URL}
|
|
7
|
+
*/
|
|
8
|
+
export let url = null;
|
|
9
|
+
/**
|
|
10
|
+
* SEO title
|
|
11
|
+
* @required
|
|
12
|
+
* @type {string}
|
|
13
|
+
*/
|
|
14
|
+
export let seoTitle;
|
|
15
|
+
/**
|
|
16
|
+
* SEO description
|
|
17
|
+
* @required
|
|
18
|
+
* @type {string}
|
|
19
|
+
*/
|
|
20
|
+
export let seoDescription;
|
|
21
|
+
/**
|
|
22
|
+
* Share title
|
|
23
|
+
* @required
|
|
24
|
+
* @type {string}
|
|
25
|
+
*/
|
|
26
|
+
export let shareTitle;
|
|
27
|
+
/**
|
|
28
|
+
* Share description
|
|
29
|
+
* @required
|
|
30
|
+
* @type {string}
|
|
31
|
+
*/
|
|
32
|
+
export let shareDescription;
|
|
33
|
+
/**
|
|
34
|
+
* Share image path. **Must be an absolute path.**
|
|
35
|
+
* @required
|
|
36
|
+
* @type {string}
|
|
37
|
+
*/
|
|
38
|
+
export let shareImgPath;
|
|
39
|
+
/**
|
|
40
|
+
* [HTML lang attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang). **Two-letter code only.**
|
|
41
|
+
* @type {string}
|
|
42
|
+
*/
|
|
43
|
+
export let lang = 'en';
|
|
44
|
+
/**
|
|
45
|
+
* Publish time as an [ISO string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
46
|
+
* @type {string}
|
|
47
|
+
*/
|
|
48
|
+
export let publishTime = '';
|
|
49
|
+
/**
|
|
50
|
+
* Updated time as an [ISO string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
|
|
51
|
+
* @type {string}
|
|
52
|
+
*/
|
|
53
|
+
export let updateTime = '';
|
|
54
|
+
/**
|
|
55
|
+
* Array of authors for the piece. Each author object must have `name` and `url` attributes.
|
|
56
|
+
*/
|
|
57
|
+
export let authors = [];
|
|
58
|
+
/**
|
|
59
|
+
* Whether to inject Google Analytics code for this page.
|
|
60
|
+
*/
|
|
61
|
+
export let includeAnalytics = false;
|
|
62
|
+
// Only fire analytics on prod sites
|
|
63
|
+
if (typeof window !== 'undefined' && includeAnalytics) {
|
|
64
|
+
analytics(url, seoTitle);
|
|
65
|
+
publisherTags();
|
|
66
|
+
}
|
|
67
|
+
const orgLdJson = {
|
|
68
|
+
'@context': 'http://schema.org',
|
|
69
|
+
'@type': 'NewsMediaOrganization',
|
|
70
|
+
'@id': 'https://www.reuters.com/#publisher',
|
|
71
|
+
name: 'Reuters',
|
|
72
|
+
logo: {
|
|
73
|
+
'@type': 'ImageObject',
|
|
74
|
+
url: 'https://s3.reutersmedia.net/resources_v2/images/reuters_social_logo.png',
|
|
75
|
+
width: '200',
|
|
76
|
+
height: '200',
|
|
77
|
+
},
|
|
78
|
+
url: 'https://www.reuters.com/',
|
|
79
|
+
};
|
|
80
|
+
const articleLdJson = {
|
|
81
|
+
'@context': 'http://schema.org',
|
|
82
|
+
'@type': 'NewsArticle',
|
|
83
|
+
headline: seoTitle,
|
|
84
|
+
url: url.href,
|
|
85
|
+
mainEntityOfPage: {
|
|
86
|
+
'@type': 'WebPage',
|
|
87
|
+
'@id': url.href,
|
|
88
|
+
},
|
|
89
|
+
thumbnailUrl: shareImgPath,
|
|
90
|
+
image: [
|
|
91
|
+
{
|
|
92
|
+
'@context': 'http://schema.org',
|
|
93
|
+
'@type': 'ImageObject',
|
|
94
|
+
url: shareImgPath,
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
publisher: { '@id': 'https://www.reuters.com/#publisher' },
|
|
98
|
+
copyrightHolder: { '@id': 'https://www.reuters.com/#publisher' },
|
|
99
|
+
sourceOrganization: { '@id': 'https://www.reuters.com/#publisher' },
|
|
100
|
+
copyrightYear: new Date().getFullYear(),
|
|
101
|
+
dateCreated: publishTime,
|
|
102
|
+
datePublished: publishTime,
|
|
103
|
+
dateModified: updateTime,
|
|
104
|
+
author: authors.map(({ name, url }) => ({
|
|
105
|
+
'@type': 'Person',
|
|
106
|
+
name,
|
|
107
|
+
url,
|
|
108
|
+
})),
|
|
109
|
+
articleSection: 'Graphics',
|
|
110
|
+
isAccessibleForFree: true,
|
|
111
|
+
creator: ['Reuters Graphics'],
|
|
112
|
+
keywords: ['Reuters graphics', 'Reuters', 'graphics', 'Interactives'],
|
|
113
|
+
};
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<svelte:head>
|
|
117
|
+
<html lang="{lang}"></html>
|
|
118
|
+
<title>{seoTitle}</title>
|
|
119
|
+
<meta name="description" content="{seoDescription}" />
|
|
120
|
+
<link rel="canonical" href="{url.href}" />
|
|
121
|
+
<link
|
|
122
|
+
rel="shortcut icon"
|
|
123
|
+
type="image/x-icon"
|
|
124
|
+
href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon.ico"
|
|
125
|
+
/>
|
|
126
|
+
<link
|
|
127
|
+
rel="icon"
|
|
128
|
+
type="image/png"
|
|
129
|
+
href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon-16x16.png"
|
|
130
|
+
sizes="16x16"
|
|
131
|
+
/>
|
|
132
|
+
<link
|
|
133
|
+
rel="icon"
|
|
134
|
+
type="image/png"
|
|
135
|
+
href="https://s1.reutersmedia.net/resources_v2/images/favicon/favicon-32x32.png"
|
|
136
|
+
sizes="32x32"
|
|
137
|
+
/>
|
|
138
|
+
<link
|
|
139
|
+
rel="icon"
|
|
140
|
+
type="image/png"
|
|
141
|
+
href="https://s3.reutersmedia.net/resources_v2/images/favicon/favicon-96x96.png"
|
|
142
|
+
sizes="96x96"
|
|
143
|
+
/>
|
|
144
|
+
|
|
145
|
+
<meta property="og:url" content="{url.href}" />
|
|
146
|
+
<meta property="og:type" content="article" />
|
|
147
|
+
<meta property="og:title" content="{shareTitle}" itemprop="name" />
|
|
148
|
+
<meta
|
|
149
|
+
property="og:description"
|
|
150
|
+
content="{shareDescription}"
|
|
151
|
+
itemprop="description"
|
|
152
|
+
/>
|
|
153
|
+
<meta
|
|
154
|
+
property="og:image"
|
|
155
|
+
content="{shareImgPath}"
|
|
156
|
+
itemprop="image"
|
|
157
|
+
/>
|
|
158
|
+
<meta property="og:site_name" content="Reuters" />
|
|
159
|
+
|
|
160
|
+
<meta name="twitter:card" content="summary_large_image" />
|
|
161
|
+
<meta name="twitter:site" content="@ReutersGraphics" />
|
|
162
|
+
<meta name="twitter:creator" content="@ReutersGraphics" />
|
|
163
|
+
<meta name="twitter:domain" content="{url.origin}" />
|
|
164
|
+
<meta name="twitter:title" content="{shareTitle}" />
|
|
165
|
+
<meta name="twitter:description" content="{shareDescription}" />
|
|
166
|
+
<meta name="twitter:image:src" content="{shareImgPath}" />
|
|
167
|
+
|
|
168
|
+
<meta property="fb:app_id" content="319194411438328" />
|
|
169
|
+
<meta property="fb:admins" content="616167736" />
|
|
170
|
+
<meta property="fb:admins" content="625796953" />
|
|
171
|
+
<meta property="fb:admins" content="571759798" />
|
|
172
|
+
|
|
173
|
+
{@html `<${'script'} type="application/ld+json">${JSON.stringify(
|
|
174
|
+
orgLdJson
|
|
175
|
+
)}</script>`}
|
|
176
|
+
{@html `<${'script'} type="application/ld+json">${JSON.stringify(
|
|
177
|
+
articleLdJson
|
|
178
|
+
)}</script>`}
|
|
179
|
+
</svelte:head>
|