@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,193 @@
|
|
|
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="body-text">
|
|
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), :global(div.article-block.body-text) :global(p), :global(div.article-block.body-text) :global(ul) :global(li), :global(div.article-block.body-text) :global(ul) :global(li) :global(p), :global(div.article-block.body-text) :global(ol) :global(li), :global(div.article-block.body-text) :global(ol) :global(li) :global(p) {
|
|
19
|
+
font-size: 1.3rem;
|
|
20
|
+
line-height: 2.1rem;
|
|
21
|
+
}
|
|
22
|
+
:global(.paragraph-size.font-sans), :global(div.article-block.body-text) :global(p.font-sans), :global(div.article-block.body-text) :global(ul) :global(li.font-sans), :global(div.article-block.body-text) :global(ol) :global(li.font-sans) {
|
|
23
|
+
font-size: 1.1rem;
|
|
24
|
+
line-height: 1.75rem;
|
|
25
|
+
}
|
|
26
|
+
@media (max-width: 540px) {
|
|
27
|
+
:global(.paragraph-size), :global(div.article-block.body-text) :global(p), :global(div.article-block.body-text) :global(ul) :global(li), :global(div.article-block.body-text) :global(ul) :global(li) :global(p), :global(div.article-block.body-text) :global(ol) :global(li), :global(div.article-block.body-text) :global(ol) :global(li) :global(p) {
|
|
28
|
+
font-size: 1.1rem;
|
|
29
|
+
line-height: 1.8rem;
|
|
30
|
+
}
|
|
31
|
+
:global(.paragraph-size.font-sans), :global(div.article-block.body-text) :global(p.font-sans), :global(div.article-block.body-text) :global(ul) :global(li.font-sans), :global(div.article-block.body-text) :global(ol) :global(li.font-sans) {
|
|
32
|
+
font-size: 1rem;
|
|
33
|
+
line-height: 1.6rem;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
:global(.paragraph-size.important), :global(div.article-block.body-text) :global(p.important), :global(div.article-block.body-text) :global(ul) :global(li.important), :global(div.article-block.body-text) :global(ol) :global(li.important) {
|
|
37
|
+
font-size: 1.3rem !important;
|
|
38
|
+
line-height: 2.1rem !important;
|
|
39
|
+
}
|
|
40
|
+
:global(.paragraph-size.important.font-sans), :global(div.article-block.body-text) :global(p.important.font-sans), :global(div.article-block.body-text) :global(ul) :global(li.important.font-sans), :global(div.article-block.body-text) :global(ol) :global(li.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), :global(div.article-block.body-text) :global(p.important), :global(div.article-block.body-text) :global(ul) :global(li.important), :global(div.article-block.body-text) :global(ol) :global(li.important) {
|
|
46
|
+
font-size: 1.1rem !important;
|
|
47
|
+
line-height: 1.8rem !important;
|
|
48
|
+
}
|
|
49
|
+
:global(.paragraph-size.important.font-sans), :global(div.article-block.body-text) :global(p.important.font-sans), :global(div.article-block.body-text) :global(ul) :global(li.important.font-sans), :global(div.article-block.body-text) :global(ol) :global(li.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), :global(div.article-block.body-text) :global(blockquote) :global(p) {
|
|
77
|
+
font-size: 1.6rem;
|
|
78
|
+
line-height: 2.1rem;
|
|
79
|
+
}
|
|
80
|
+
@media (max-width: 540px) {
|
|
81
|
+
:global(.blockquote-size), :global(div.article-block.body-text) :global(blockquote) :global(p) {
|
|
82
|
+
font-size: 1.3rem;
|
|
83
|
+
line-height: 1.9rem;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
:global(.blockquote-size.important), :global(div.article-block.body-text) :global(blockquote) :global(p.important) {
|
|
87
|
+
font-size: 1.6rem !important;
|
|
88
|
+
line-height: 2rem !important;
|
|
89
|
+
}
|
|
90
|
+
@media (max-width: 540px) {
|
|
91
|
+
:global(.blockquote-size.important), :global(div.article-block.body-text) :global(blockquote) :global(p.important) {
|
|
92
|
+
font-size: 1.3rem !important;
|
|
93
|
+
line-height: 1.8rem !important;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:global(div.article-block.body-text) :global(h2),
|
|
98
|
+
:global(div.article-block.body-text) :global(h3),
|
|
99
|
+
:global(div.article-block.body-text) :global(h4),
|
|
100
|
+
:global(div.article-block.body-text) :global(h5),
|
|
101
|
+
:global(div.article-block.body-text) :global(h6),
|
|
102
|
+
:global(div.article-block.body-text) :global(p),
|
|
103
|
+
:global(div.article-block.body-text) :global(li),
|
|
104
|
+
:global(div.article-block.body-text) :global(blockquote) {
|
|
105
|
+
color: var(--theme-colour-text-primary, #404040);
|
|
106
|
+
}
|
|
107
|
+
:global(div.article-block.body-text) :global(p),
|
|
108
|
+
:global(div.article-block.body-text) :global(ul) :global(li),
|
|
109
|
+
:global(div.article-block.body-text) :global(ul) :global(li) :global(p),
|
|
110
|
+
:global(div.article-block.body-text) :global(ol) :global(li),
|
|
111
|
+
:global(div.article-block.body-text) :global(ol) :global(li) :global(p) {
|
|
112
|
+
-webkit-font-smoothing: antialiased;
|
|
113
|
+
font-family: var(--theme-font-family-body, var(--theme-font-family-serif, "freight-book", serif));
|
|
114
|
+
color: var(--theme-colour-text-primary, #404040);
|
|
115
|
+
}
|
|
116
|
+
:global(div.article-block.body-text) :global(p) :global(a),
|
|
117
|
+
:global(div.article-block.body-text) :global(ul) :global(li) :global(a),
|
|
118
|
+
:global(div.article-block.body-text) :global(ul) :global(li) :global(p) :global(a),
|
|
119
|
+
:global(div.article-block.body-text) :global(ol) :global(li) :global(a),
|
|
120
|
+
:global(div.article-block.body-text) :global(ol) :global(li) :global(p) :global(a) {
|
|
121
|
+
color: currentColor;
|
|
122
|
+
background-size: 1px 1px;
|
|
123
|
+
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" style="stroke: currentColor; opacity: 0.8;" /></svg>');
|
|
124
|
+
background-position: 0 1.3rem;
|
|
125
|
+
background-repeat: repeat-x;
|
|
126
|
+
text-decoration: none;
|
|
127
|
+
text-shadow: 1px 1px var(--theme-colour-background, #ffffff), 1px -1px var(--theme-colour-background, #ffffff), -1px 1px var(--theme-colour-background, #ffffff), -1px -1px var(--theme-colour-background, #ffffff);
|
|
128
|
+
}
|
|
129
|
+
@media (max-width: 540px) {
|
|
130
|
+
:global(div.article-block.body-text) :global(p) :global(a),
|
|
131
|
+
:global(div.article-block.body-text) :global(ul) :global(li) :global(a),
|
|
132
|
+
:global(div.article-block.body-text) :global(ul) :global(li) :global(p) :global(a),
|
|
133
|
+
:global(div.article-block.body-text) :global(ol) :global(li) :global(a),
|
|
134
|
+
:global(div.article-block.body-text) :global(ol) :global(li) :global(p) :global(a) {
|
|
135
|
+
background-position: 0 1.1rem;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
:global(div.article-block.body-text) :global(p) :global(a:hover),
|
|
139
|
+
:global(div.article-block.body-text) :global(ul) :global(li) :global(a:hover),
|
|
140
|
+
:global(div.article-block.body-text) :global(ul) :global(li) :global(p) :global(a:hover),
|
|
141
|
+
:global(div.article-block.body-text) :global(ol) :global(li) :global(a:hover),
|
|
142
|
+
:global(div.article-block.body-text) :global(ol) :global(li) :global(p) :global(a:hover) {
|
|
143
|
+
text-decoration: none;
|
|
144
|
+
}
|
|
145
|
+
:global(div.article-block.body-text) :global(h2) {
|
|
146
|
+
margin: 4rem 0 2rem;
|
|
147
|
+
text-align: center;
|
|
148
|
+
font-weight: 600;
|
|
149
|
+
}
|
|
150
|
+
:global(div.article-block.body-text) :global(h2::after) {
|
|
151
|
+
display: block;
|
|
152
|
+
content: "";
|
|
153
|
+
background: var(--theme-colour-text-secondary, #666666);
|
|
154
|
+
height: 3px;
|
|
155
|
+
width: 100px;
|
|
156
|
+
margin: 10px auto 2rem;
|
|
157
|
+
}
|
|
158
|
+
:global(div.article-block.body-text) :global(ul) {
|
|
159
|
+
padding-left: 1.75rem;
|
|
160
|
+
list-style-type: square;
|
|
161
|
+
}
|
|
162
|
+
:global(div.article-block.body-text) :global(p) + :global(ul) {
|
|
163
|
+
margin-top: -0.75rem;
|
|
164
|
+
}
|
|
165
|
+
:global(div.article-block.body-text) :global(blockquote) {
|
|
166
|
+
margin: 30px 0;
|
|
167
|
+
border-left: 2px solid var(--theme-colour-text-secondary, #666666);
|
|
168
|
+
padding-left: 15px;
|
|
169
|
+
}
|
|
170
|
+
:global(div.article-block.body-text) :global(blockquote) :global(p) {
|
|
171
|
+
font-family: var(--theme-font-family-body, var(--theme-font-family-serif, "freight-book", serif));
|
|
172
|
+
}
|
|
173
|
+
:global(div.article-block.body-text) :global(blockquote) :global(blockquote) {
|
|
174
|
+
border: 0;
|
|
175
|
+
padding: 0;
|
|
176
|
+
margin: -5px 0 0;
|
|
177
|
+
}
|
|
178
|
+
:global(div.article-block.body-text) :global(blockquote) :global(blockquote) :global(p) {
|
|
179
|
+
font-family: var(--theme-font-family-body, var(--theme-font-family-serif, "freight-book", serif));
|
|
180
|
+
color: var(--theme-colour-text-primary, #404040);
|
|
181
|
+
font-size: 1rem;
|
|
182
|
+
}
|
|
183
|
+
@media (max-width: 540px) {
|
|
184
|
+
:global(div.article-block.body-text) :global(blockquote) :global(blockquote) :global(p) {
|
|
185
|
+
font-size: 0.9rem;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
:global(div.article-block.body-text) :global(blockquote) :global(blockquote) :global(blockquote) {
|
|
189
|
+
display: none;
|
|
190
|
+
}
|
|
191
|
+
:global(div.article-block.body-text.font-sans) {
|
|
192
|
+
font-family: var(--theme-font-family-sans-serif, var(--theme-font-family-sans-serif, "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif)) !important;
|
|
193
|
+
}</style>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<script>import { onMount, onDestroy } from 'svelte';
|
|
2
|
+
import GraphicBlock from '../GraphicBlock/GraphicBlock.svelte';
|
|
3
|
+
/**
|
|
4
|
+
* Title of the graphic
|
|
5
|
+
* @type {string}
|
|
6
|
+
*/
|
|
7
|
+
export let title = null;
|
|
8
|
+
/**
|
|
9
|
+
* Description of the graphic, passed in as a markdown string.
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
export let description = null;
|
|
13
|
+
/**
|
|
14
|
+
* iframe title
|
|
15
|
+
* @required
|
|
16
|
+
*/
|
|
17
|
+
export let frameTitle = '';
|
|
18
|
+
/**
|
|
19
|
+
* Notes to the graphic, passed in as a markdown string.
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
export let notes = null;
|
|
23
|
+
/**
|
|
24
|
+
* iframe aria label
|
|
25
|
+
* @required
|
|
26
|
+
*/
|
|
27
|
+
export let ariaLabel = '';
|
|
28
|
+
/** iframe id */
|
|
29
|
+
export let id = '';
|
|
30
|
+
/**
|
|
31
|
+
* Datawrapper embed URL
|
|
32
|
+
* @required
|
|
33
|
+
*/
|
|
34
|
+
export let src;
|
|
35
|
+
/** iframe scrolling option */
|
|
36
|
+
export let scrolling = 'no';
|
|
37
|
+
/** Width of the chart within the text well. */
|
|
38
|
+
export let width = 'normal'; // options: wide, wider, widest, fluid
|
|
39
|
+
/**
|
|
40
|
+
* Set a different width for the text within the text well, for example,
|
|
41
|
+
* "normal" to keep the title, description and notes inline with the rest
|
|
42
|
+
* of the text well. Can't ever be wider than `width`.
|
|
43
|
+
* @type {string}
|
|
44
|
+
*/
|
|
45
|
+
export let textWidth = null;
|
|
46
|
+
let frameElement;
|
|
47
|
+
$: frameFiller = (e) => {
|
|
48
|
+
/* eslint-disable */
|
|
49
|
+
if (void 0 !== e.data['datawrapper-height']) {
|
|
50
|
+
const t = [frameElement];
|
|
51
|
+
for (const a in e.data['datawrapper-height']) {
|
|
52
|
+
for (let r = 0; r < t.length; r++) {
|
|
53
|
+
if (t[r].contentWindow === e.source) {
|
|
54
|
+
t[r].style.height = e.data['datawrapper-height'][a] + 'px';
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/* eslint-enable */
|
|
60
|
+
};
|
|
61
|
+
onMount(() => {
|
|
62
|
+
if (typeof window !== 'undefined') {
|
|
63
|
+
window.addEventListener('message', frameFiller);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
onDestroy(() => {
|
|
67
|
+
if (typeof window !== 'undefined') {
|
|
68
|
+
window.removeEventListener('message', frameFiller);
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<GraphicBlock
|
|
74
|
+
width="{width}"
|
|
75
|
+
textWidth="{textWidth}"
|
|
76
|
+
title="{title}"
|
|
77
|
+
description="{description}"
|
|
78
|
+
notes="{notes}"
|
|
79
|
+
>
|
|
80
|
+
{#if $$slots.title}
|
|
81
|
+
<!-- Custom headline and chatter slot -->
|
|
82
|
+
<slot name="title" />
|
|
83
|
+
{/if}
|
|
84
|
+
|
|
85
|
+
<div class="datawrapper-chart">
|
|
86
|
+
<iframe
|
|
87
|
+
bind:this="{frameElement}"
|
|
88
|
+
title="{frameTitle}"
|
|
89
|
+
aria-label="{ariaLabel}"
|
|
90
|
+
id="{id}"
|
|
91
|
+
src="{src}"
|
|
92
|
+
scrolling="{scrolling}"
|
|
93
|
+
frameborder="0"
|
|
94
|
+
style="width: 0; min-width: 100% !important; border: none;"></iframe>
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
{#if $$slots.notes}
|
|
98
|
+
<!-- Custom notes and source slot -->
|
|
99
|
+
<slot name="notes" />
|
|
100
|
+
{/if}
|
|
101
|
+
</GraphicBlock>
|
|
102
|
+
|
|
103
|
+
<style>.datawrapper-chart {
|
|
104
|
+
margin: auto;
|
|
105
|
+
}</style>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>export let dev = false;
|
|
2
|
+
import Fa from 'svelte-fa/src/fa.svelte';
|
|
3
|
+
import { faWindowRestore } from '@fortawesome/free-regular-svg-icons';
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
{#if dev}
|
|
7
|
+
<div>
|
|
8
|
+
<a rel="external" href="/embed-previewer">
|
|
9
|
+
<Fa icon={faWindowRestore} />
|
|
10
|
+
</a>
|
|
11
|
+
</div>
|
|
12
|
+
{/if}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
<style>div {
|
|
16
|
+
position: fixed;
|
|
17
|
+
bottom: 5px;
|
|
18
|
+
left: 10px;
|
|
19
|
+
font-size: 18px;
|
|
20
|
+
}
|
|
21
|
+
div a {
|
|
22
|
+
color: #ccc;
|
|
23
|
+
}
|
|
24
|
+
div a:hover {
|
|
25
|
+
color: #666;
|
|
26
|
+
}</style>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script>import { onMount } from 'svelte';
|
|
2
|
+
import Block from '../Block/Block.svelte';
|
|
3
|
+
/**
|
|
4
|
+
* Photo src
|
|
5
|
+
* @type {string}
|
|
6
|
+
* @required
|
|
7
|
+
*/
|
|
8
|
+
export let src;
|
|
9
|
+
/**
|
|
10
|
+
* Photo altText
|
|
11
|
+
* @type {string}
|
|
12
|
+
* @required
|
|
13
|
+
*/
|
|
14
|
+
export let altText;
|
|
15
|
+
/**
|
|
16
|
+
* Caption below the photo
|
|
17
|
+
* @type {string}
|
|
18
|
+
*/
|
|
19
|
+
export let caption;
|
|
20
|
+
/**
|
|
21
|
+
* Height of the photo placeholder when lazy-loading
|
|
22
|
+
*/
|
|
23
|
+
export let height = 100;
|
|
24
|
+
/**
|
|
25
|
+
* Width of the container, one of: normal, wide, wider, widest or fluid
|
|
26
|
+
*/
|
|
27
|
+
export let width = 'normal';
|
|
28
|
+
/**
|
|
29
|
+
* Whether to lazy load the photo using the [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)
|
|
30
|
+
*/
|
|
31
|
+
export let lazy = false;
|
|
32
|
+
/** Set Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) `top` when lazy loading. */
|
|
33
|
+
export let top = 0;
|
|
34
|
+
/** Set Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) `bottom` when lazy loading. */
|
|
35
|
+
export let bottom = 0;
|
|
36
|
+
/** Set Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) `left` when lazy loading. */
|
|
37
|
+
export let left = 0;
|
|
38
|
+
/** Set Intersection Observer [rootMargin](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#rootmargin) `right` when lazy loading. */
|
|
39
|
+
export let right = 0;
|
|
40
|
+
let intersecting = false;
|
|
41
|
+
let container;
|
|
42
|
+
const intersectable = typeof IntersectionObserver !== 'undefined';
|
|
43
|
+
onMount(() => {
|
|
44
|
+
if (!lazy)
|
|
45
|
+
return;
|
|
46
|
+
if (intersectable) {
|
|
47
|
+
const rootMargin = `${bottom}px ${left}px ${top}px ${right}px`;
|
|
48
|
+
const observer = new IntersectionObserver((entries) => {
|
|
49
|
+
intersecting = entries[0].isIntersecting;
|
|
50
|
+
if (intersecting) {
|
|
51
|
+
observer.unobserve(container);
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
rootMargin,
|
|
55
|
+
});
|
|
56
|
+
observer.observe(container);
|
|
57
|
+
return () => observer.unobserve(container);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<Block width="{width}" cls="photo">
|
|
63
|
+
<figure
|
|
64
|
+
bind:this="{container}"
|
|
65
|
+
aria-label="media"
|
|
66
|
+
class:fluid="{width === 'fluid'}"
|
|
67
|
+
>
|
|
68
|
+
{#if !lazy || (intersectable && intersecting)}
|
|
69
|
+
<img src="{src}" alt="{altText}" />
|
|
70
|
+
{:else}
|
|
71
|
+
<div class="placeholder" height="{`${height}px`}"></div>
|
|
72
|
+
{/if}
|
|
73
|
+
{#if caption}
|
|
74
|
+
<figcaption>{caption}</figcaption>
|
|
75
|
+
{/if}
|
|
76
|
+
{#if !altText}
|
|
77
|
+
<div class="alt-warning">altText</div>
|
|
78
|
+
{/if}
|
|
79
|
+
</figure>
|
|
80
|
+
</Block>
|
|
81
|
+
|
|
82
|
+
<style>figure {
|
|
83
|
+
width: 100%;
|
|
84
|
+
position: relative;
|
|
85
|
+
}
|
|
86
|
+
figure img {
|
|
87
|
+
width: 100%;
|
|
88
|
+
margin: 0;
|
|
89
|
+
}
|
|
90
|
+
figure .placeholder {
|
|
91
|
+
background-color: #ccc;
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
figure div.alt-warning {
|
|
95
|
+
font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
|
|
96
|
+
padding: 5px 10px;
|
|
97
|
+
background-color: red;
|
|
98
|
+
color: white;
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: 0;
|
|
101
|
+
right: 0;
|
|
102
|
+
font-size: 14px;
|
|
103
|
+
line-height: 16px;
|
|
104
|
+
}
|
|
105
|
+
figure figcaption {
|
|
106
|
+
font-weight: 400;
|
|
107
|
+
font-size: 0.8rem;
|
|
108
|
+
font-family: var(--theme-font-family-note, "Knowledge", "Source Sans Pro", Arial, sans-serif);
|
|
109
|
+
color: var(--theme-colour-text-secondary, #666666);
|
|
110
|
+
}
|
|
111
|
+
figure.fluid figcaption {
|
|
112
|
+
padding-left: 15px;
|
|
113
|
+
}</style>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import Fa from 'svelte-fa/src/fa.svelte';
|
|
3
|
+
import { faDesktop, faLink } from '@fortawesome/free-solid-svg-icons';
|
|
4
|
+
import { onMount, afterUpdate } from 'svelte';
|
|
5
|
+
import pym from 'pym.js';
|
|
6
|
+
import urljoin from 'proper-url-join';
|
|
7
|
+
import Resizer from './Resizer/index.svelte';
|
|
8
|
+
import { width } from './stores.js';
|
|
9
|
+
import getUniqNames from './uniqNames.js';
|
|
10
|
+
|
|
11
|
+
export let embeds;
|
|
12
|
+
export let breakpoints = [330, 510, 660, 930, 1200];
|
|
13
|
+
export let minFrameWidth = 320;
|
|
14
|
+
export let maxFrameWidth = 1200;
|
|
15
|
+
|
|
16
|
+
let activeEmbed = embeds[0];
|
|
17
|
+
|
|
18
|
+
$: embedTitles = getUniqNames(embeds);
|
|
19
|
+
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
let pymParent;
|
|
22
|
+
|
|
23
|
+
const reframe = (embed) => {
|
|
24
|
+
pymParent = new pym.Parent(
|
|
25
|
+
'frame-parent',
|
|
26
|
+
/^http/.test(embed)
|
|
27
|
+
? embed
|
|
28
|
+
: urljoin(window.location.origin, embed, { trailingSlash: true })
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
onMount(() => {
|
|
33
|
+
reframe(activeEmbed);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
afterUpdate(() => {
|
|
37
|
+
reframe(activeEmbed);
|
|
38
|
+
});
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<div class="container">
|
|
42
|
+
<header>
|
|
43
|
+
<img
|
|
44
|
+
src="https://graphics.thomsonreuters.com/style-assets/images/logos/reuters-graphics-logo/svg/graphics-logo-dark.svg"
|
|
45
|
+
alt=""
|
|
46
|
+
/>
|
|
47
|
+
</header>
|
|
48
|
+
|
|
49
|
+
<nav>
|
|
50
|
+
{#each embeds as embed, i}
|
|
51
|
+
<button
|
|
52
|
+
on:click="{() => {
|
|
53
|
+
activeEmbed = embed;
|
|
54
|
+
}}"
|
|
55
|
+
class:active="{activeEmbed === embed}"
|
|
56
|
+
>
|
|
57
|
+
{embedTitles[i]}
|
|
58
|
+
<a rel="external" target="_blank" href="{embed}" title="{embed}">
|
|
59
|
+
<Fa icon="{faLink}" />
|
|
60
|
+
</a>
|
|
61
|
+
</button>
|
|
62
|
+
{/each}
|
|
63
|
+
</nav>
|
|
64
|
+
|
|
65
|
+
<div id="frame-parent" style="width:{$width}px;"></div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<div id="home-link">
|
|
69
|
+
<a rel="external" href="./../">
|
|
70
|
+
<Fa icon="{faDesktop}" />
|
|
71
|
+
</a>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<Resizer
|
|
75
|
+
breakpoints="{breakpoints}"
|
|
76
|
+
minFrameWidth="{minFrameWidth}"
|
|
77
|
+
maxFrameWidth="{maxFrameWidth}"
|
|
78
|
+
/>
|
|
79
|
+
|
|
80
|
+
<style>header {
|
|
81
|
+
font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
|
|
82
|
+
font-size: 50px;
|
|
83
|
+
text-align: center;
|
|
84
|
+
text-transform: uppercase;
|
|
85
|
+
font-weight: 700;
|
|
86
|
+
margin: 20px 0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
nav {
|
|
90
|
+
text-align: center;
|
|
91
|
+
margin: 0 auto 20px;
|
|
92
|
+
max-width: 900px;
|
|
93
|
+
}
|
|
94
|
+
nav button {
|
|
95
|
+
margin: 0 4px 5px;
|
|
96
|
+
background-color: transparent;
|
|
97
|
+
border: 0;
|
|
98
|
+
color: #999;
|
|
99
|
+
padding: 2px 2px;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
font-family: "Knowledge", "Source Sans Pro", Arial, sans-serif;
|
|
102
|
+
font-weight: 400;
|
|
103
|
+
}
|
|
104
|
+
nav button.active {
|
|
105
|
+
border-bottom: 2px solid #666;
|
|
106
|
+
color: #666;
|
|
107
|
+
}
|
|
108
|
+
nav button:focus {
|
|
109
|
+
outline: none;
|
|
110
|
+
}
|
|
111
|
+
nav button a {
|
|
112
|
+
color: #bbb;
|
|
113
|
+
font-size: 12px;
|
|
114
|
+
}
|
|
115
|
+
nav button a:hover {
|
|
116
|
+
color: #666;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
#frame-parent {
|
|
120
|
+
border: 1px solid #ddd;
|
|
121
|
+
margin: 0 auto;
|
|
122
|
+
width: var(--width);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
div#home-link {
|
|
126
|
+
position: fixed;
|
|
127
|
+
bottom: 5px;
|
|
128
|
+
left: 10px;
|
|
129
|
+
font-size: 18px;
|
|
130
|
+
}
|
|
131
|
+
div#home-link a {
|
|
132
|
+
color: #ccc;
|
|
133
|
+
}
|
|
134
|
+
div#home-link a:hover {
|
|
135
|
+
color: #666;
|
|
136
|
+
}</style>
|