@reuters-graphics/graphics-components 0.0.1-beta.8 → 0.0.2
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/@types/components/Article/Article.svelte.d.ts +1 -0
- package/dist/@types/components/BeforeAfter/BeforeAfter.svelte.d.ts +1 -0
- package/dist/@types/components/Block/Block.svelte.d.ts +1 -0
- package/dist/@types/components/BodyText/BodyText.svelte.d.ts +1 -0
- package/dist/@types/components/DatawrapperChart/DatawrapperChart.svelte.d.ts +1 -0
- package/dist/@types/components/FeaturePhoto/FeaturePhoto.svelte.d.ts +1 -0
- package/dist/@types/components/GraphicBlock/GraphicBlock.svelte.d.ts +1 -0
- package/dist/@types/components/Headline/Headline.svelte.d.ts +1 -0
- package/dist/@types/components/NoteText/NoteText.svelte.d.ts +1 -0
- package/dist/@types/components/PhotoPack/PhotoPack.svelte.d.ts +1 -0
- package/dist/@types/components/PymChild/PymChild.svelte.d.ts +1 -0
- package/dist/@types/components/ReutersLogo/ReutersLogo.svelte.d.ts +1 -0
- package/dist/@types/components/SEO/SEO.svelte.d.ts +8 -1
- package/dist/@types/components/Scroller/Scroller.svelte.d.ts +1 -0
- package/dist/@types/components/Scroller/docProps.d.ts +32 -0
- package/dist/@types/components/SiteFooter/SiteFooter.svelte.d.ts +1 -0
- package/dist/@types/components/SiteHeader/SiteHeader.svelte.d.ts +1 -0
- package/dist/@types/components/Spinner/Spinner.svelte.d.ts +1 -0
- package/dist/@types/components/Theme/Theme.svelte.d.ts +1 -0
- package/dist/@types/components/Video/Video.svelte.d.ts +1 -0
- package/dist/@types/components/Visible/Visible.svelte.d.ts +1 -0
- package/dist/@types/index.d.ts +1 -0
- package/dist/components/Article/Article.svelte +1 -0
- package/dist/components/BeforeAfter/BeforeAfter.svelte +1 -0
- package/dist/components/Block/Block.svelte +1 -0
- package/dist/components/BodyText/BodyText.svelte +2 -1
- package/dist/components/DatawrapperChart/DatawrapperChart.svelte +1 -0
- package/dist/components/FeaturePhoto/FeaturePhoto.svelte +1 -0
- package/dist/components/GraphicBlock/GraphicBlock.svelte +1 -0
- package/dist/components/Headline/Headline.svelte +1 -0
- package/dist/components/NoteText/NoteText.svelte +2 -1
- package/dist/components/PhotoPack/PhotoPack.svelte +1 -0
- package/dist/components/PymChild/PymChild.svelte +2 -1
- package/dist/components/ReutersLogo/ReutersLogo.svelte +1 -0
- package/dist/components/SEO/SEO.svelte +30 -12
- package/dist/components/Scroller/Scroller.svelte +3 -2
- package/dist/components/Scroller/docProps.js +14 -0
- package/dist/components/SiteFooter/SiteFooter.svelte +3 -1
- package/dist/components/SiteHeader/MobileMenu/index.svelte +1 -1
- package/dist/components/SiteHeader/SiteHeader.svelte +2 -1
- package/dist/components/Spinner/Spinner.svelte +2 -1
- package/dist/components/Theme/Theme.svelte +5 -6
- package/dist/components/Theme/themes/dark.js +2 -2
- package/dist/components/Video/Video.svelte +3 -2
- package/dist/components/Visible/Visible.svelte +1 -0
- package/dist/index.js +1 -0
- package/package.json +3 -2
|
@@ -27,6 +27,7 @@ declare const __propDef: {
|
|
|
27
27
|
export declare type ArticleProps = typeof __propDef.props;
|
|
28
28
|
export declare type ArticleEvents = typeof __propDef.events;
|
|
29
29
|
export declare type ArticleSlots = typeof __propDef.slots;
|
|
30
|
+
/** `Article` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-article--default) */
|
|
30
31
|
export default class Article extends SvelteComponentTyped<ArticleProps, ArticleEvents, ArticleSlots> {
|
|
31
32
|
}
|
|
32
33
|
export {};
|
|
@@ -52,6 +52,7 @@ declare const __propDef: {
|
|
|
52
52
|
export declare type BeforeAfterProps = typeof __propDef.props;
|
|
53
53
|
export declare type BeforeAfterEvents = typeof __propDef.events;
|
|
54
54
|
export declare type BeforeAfterSlots = typeof __propDef.slots;
|
|
55
|
+
/** `BeforeAfter` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-beforeafter--default) */
|
|
55
56
|
export default class BeforeAfter extends SvelteComponentTyped<BeforeAfterProps, BeforeAfterEvents, BeforeAfterSlots> {
|
|
56
57
|
}
|
|
57
58
|
export {};
|
|
@@ -19,6 +19,7 @@ declare const __propDef: {
|
|
|
19
19
|
export declare type BlockProps = typeof __propDef.props;
|
|
20
20
|
export declare type BlockEvents = typeof __propDef.events;
|
|
21
21
|
export declare type BlockSlots = typeof __propDef.slots;
|
|
22
|
+
/** `Block` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-block--default) */
|
|
22
23
|
export default class Block extends SvelteComponentTyped<BlockProps, BlockEvents, BlockSlots> {
|
|
23
24
|
}
|
|
24
25
|
export {};
|
|
@@ -15,6 +15,7 @@ declare const __propDef: {
|
|
|
15
15
|
export declare type BodyTextProps = typeof __propDef.props;
|
|
16
16
|
export declare type BodyTextEvents = typeof __propDef.events;
|
|
17
17
|
export declare type BodyTextSlots = typeof __propDef.slots;
|
|
18
|
+
/** `BodyText` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-bodytext--default) */
|
|
18
19
|
export default class BodyText extends SvelteComponentTyped<BodyTextProps, BodyTextEvents, BodyTextSlots> {
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -47,6 +47,7 @@ declare const __propDef: {
|
|
|
47
47
|
export declare type DatawrapperChartProps = typeof __propDef.props;
|
|
48
48
|
export declare type DatawrapperChartEvents = typeof __propDef.events;
|
|
49
49
|
export declare type DatawrapperChartSlots = typeof __propDef.slots;
|
|
50
|
+
/** `DatawrapperChart` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-DatawrapperChart--default) */
|
|
50
51
|
export default class DatawrapperChart extends SvelteComponentTyped<DatawrapperChartProps, DatawrapperChartEvents, DatawrapperChartSlots> {
|
|
51
52
|
}
|
|
52
53
|
export {};
|
|
@@ -38,6 +38,7 @@ declare const __propDef: {
|
|
|
38
38
|
export declare type FeaturePhotoProps = typeof __propDef.props;
|
|
39
39
|
export declare type FeaturePhotoEvents = typeof __propDef.events;
|
|
40
40
|
export declare type FeaturePhotoSlots = typeof __propDef.slots;
|
|
41
|
+
/** `FeaturePhoto` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-FeaturePhoto--default) */
|
|
41
42
|
export default class FeaturePhoto extends SvelteComponentTyped<FeaturePhotoProps, FeaturePhotoEvents, FeaturePhotoSlots> {
|
|
42
43
|
}
|
|
43
44
|
export {};
|
|
@@ -59,6 +59,7 @@ declare const __propDef: {
|
|
|
59
59
|
export declare type GraphicBlockProps = typeof __propDef.props;
|
|
60
60
|
export declare type GraphicBlockEvents = typeof __propDef.events;
|
|
61
61
|
export declare type GraphicBlockSlots = typeof __propDef.slots;
|
|
62
|
+
/** `GraphicBlock` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-GraphicBlock--default) */
|
|
62
63
|
export default class GraphicBlock extends SvelteComponentTyped<GraphicBlockProps, GraphicBlockEvents, GraphicBlockSlots> {
|
|
63
64
|
}
|
|
64
65
|
export {};
|
|
@@ -24,6 +24,7 @@ declare const __propDef: {
|
|
|
24
24
|
export declare type HeadlineProps = typeof __propDef.props;
|
|
25
25
|
export declare type HeadlineEvents = typeof __propDef.events;
|
|
26
26
|
export declare type HeadlineSlots = typeof __propDef.slots;
|
|
27
|
+
/** `Headline` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Headline--default) */
|
|
27
28
|
export default class Headline extends SvelteComponentTyped<HeadlineProps, HeadlineEvents, HeadlineSlots> {
|
|
28
29
|
}
|
|
29
30
|
export {};
|
|
@@ -15,6 +15,7 @@ declare const __propDef: {
|
|
|
15
15
|
export declare type NoteTextProps = typeof __propDef.props;
|
|
16
16
|
export declare type NoteTextEvents = typeof __propDef.events;
|
|
17
17
|
export declare type NoteTextSlots = typeof __propDef.slots;
|
|
18
|
+
/** `NoteText` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-NoteText--default) */
|
|
18
19
|
export default class NoteText extends SvelteComponentTyped<NoteTextProps, NoteTextEvents, NoteTextSlots> {
|
|
19
20
|
}
|
|
20
21
|
export {};
|
|
@@ -45,6 +45,7 @@ declare const __propDef: {
|
|
|
45
45
|
export declare type PhotoPackProps = typeof __propDef.props;
|
|
46
46
|
export declare type PhotoPackEvents = typeof __propDef.events;
|
|
47
47
|
export declare type PhotoPackSlots = typeof __propDef.slots;
|
|
48
|
+
/** `PhotoPack` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-PhotoPack--default) */
|
|
48
49
|
export default class PhotoPack extends SvelteComponentTyped<PhotoPackProps, PhotoPackEvents, PhotoPackSlots> {
|
|
49
50
|
}
|
|
50
51
|
export {};
|
|
@@ -11,6 +11,7 @@ declare const __propDef: {
|
|
|
11
11
|
export declare type PymChildProps = typeof __propDef.props;
|
|
12
12
|
export declare type PymChildEvents = typeof __propDef.events;
|
|
13
13
|
export declare type PymChildSlots = typeof __propDef.slots;
|
|
14
|
+
/** `PymChild` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/utilities-PymChild--default) */
|
|
14
15
|
export default class PymChild extends SvelteComponentTyped<PymChildProps, PymChildEvents, PymChildSlots> {
|
|
15
16
|
}
|
|
16
17
|
export {};
|
|
@@ -13,6 +13,7 @@ declare const __propDef: {
|
|
|
13
13
|
export declare type ReutersLogoProps = typeof __propDef.props;
|
|
14
14
|
export declare type ReutersLogoEvents = typeof __propDef.events;
|
|
15
15
|
export declare type ReutersLogoSlots = typeof __propDef.slots;
|
|
16
|
+
/** `ReutersLogo` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-ReutersLogo--default) */
|
|
16
17
|
export default class ReutersLogo extends SvelteComponentTyped<ReutersLogoProps, ReutersLogoEvents, ReutersLogoSlots> {
|
|
17
18
|
}
|
|
18
19
|
export {};
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
+
/**
|
|
5
|
+
* Base url for the page, which in [Vite-based projects](https://vitejs.dev/guide/build.html#public-base-path)
|
|
6
|
+
* is globally available as `import.meta.env.BASE_URL`.
|
|
7
|
+
* @required
|
|
8
|
+
* @type {string}
|
|
9
|
+
*/ baseUrl?: string;
|
|
4
10
|
/**
|
|
5
11
|
* [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object for the page.
|
|
6
12
|
* @required
|
|
7
13
|
* @type {URL}
|
|
8
|
-
*/
|
|
14
|
+
*/ pageUrl?: URL | null;
|
|
9
15
|
/**
|
|
10
16
|
* SEO title
|
|
11
17
|
* @required
|
|
@@ -61,6 +67,7 @@ declare const __propDef: {
|
|
|
61
67
|
export declare type SeoProps = typeof __propDef.props;
|
|
62
68
|
export declare type SeoEvents = typeof __propDef.events;
|
|
63
69
|
export declare type SeoSlots = typeof __propDef.slots;
|
|
70
|
+
/** `SEO` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-SEO--default) */
|
|
64
71
|
export default class Seo extends SvelteComponentTyped<SeoProps, SeoEvents, SeoSlots> {
|
|
65
72
|
}
|
|
66
73
|
export {};
|
|
@@ -71,6 +71,7 @@ declare const __propDef: {
|
|
|
71
71
|
export declare type ScrollerProps = typeof __propDef.props;
|
|
72
72
|
export declare type ScrollerEvents = typeof __propDef.events;
|
|
73
73
|
export declare type ScrollerSlots = typeof __propDef.slots;
|
|
74
|
+
/** `Scroller` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Scroller--default) */
|
|
74
75
|
export default class Scroller extends SvelteComponentTyped<ScrollerProps, ScrollerEvents, ScrollerSlots> {
|
|
75
76
|
}
|
|
76
77
|
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ComponentType } from 'svelte';
|
|
2
|
+
interface BlockStep {
|
|
3
|
+
Background: string;
|
|
4
|
+
Text: string;
|
|
5
|
+
}
|
|
6
|
+
interface Block {
|
|
7
|
+
Type: string;
|
|
8
|
+
Width: string;
|
|
9
|
+
ForegroundPosition: string;
|
|
10
|
+
StackBackground?: string;
|
|
11
|
+
EmbeddedLayout?: string;
|
|
12
|
+
ID?: string;
|
|
13
|
+
Steps: BlockStep[];
|
|
14
|
+
}
|
|
15
|
+
interface AiCharts {
|
|
16
|
+
[key: string]: ComponentType;
|
|
17
|
+
}
|
|
18
|
+
export declare const getScrollerPropsFromDoc: (docBlock: Block, aiCharts: AiCharts, assetsPath?: string) => {
|
|
19
|
+
id: string;
|
|
20
|
+
backgroundWidth: string;
|
|
21
|
+
foregroundPosition: string;
|
|
22
|
+
stackBackground: boolean;
|
|
23
|
+
embeddedLayout: string;
|
|
24
|
+
steps: {
|
|
25
|
+
background: ComponentType<import("svelte").SvelteComponentTyped<any, any, any>>;
|
|
26
|
+
backgroundProps: {
|
|
27
|
+
assetsPath: string;
|
|
28
|
+
};
|
|
29
|
+
foreground: string;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -18,6 +18,7 @@ declare const __propDef: {
|
|
|
18
18
|
export declare type SiteFooterProps = typeof __propDef.props;
|
|
19
19
|
export declare type SiteFooterEvents = typeof __propDef.events;
|
|
20
20
|
export declare type SiteFooterSlots = typeof __propDef.slots;
|
|
21
|
+
/** `SiteFooter` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-SiteFooter--default) */
|
|
21
22
|
export default class SiteFooter extends SvelteComponentTyped<SiteFooterProps, SiteFooterEvents, SiteFooterSlots> {
|
|
22
23
|
}
|
|
23
24
|
export {};
|
|
@@ -9,6 +9,7 @@ declare const __propDef: {
|
|
|
9
9
|
export declare type SiteHeaderProps = typeof __propDef.props;
|
|
10
10
|
export declare type SiteHeaderEvents = typeof __propDef.events;
|
|
11
11
|
export declare type SiteHeaderSlots = typeof __propDef.slots;
|
|
12
|
+
/** `SiteHeader` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-SiteHeader--default) */
|
|
12
13
|
export default class SiteHeader extends SvelteComponentTyped<SiteHeaderProps, SiteHeaderEvents, SiteHeaderSlots> {
|
|
13
14
|
}
|
|
14
15
|
export {};
|
|
@@ -23,6 +23,7 @@ declare const __propDef: {
|
|
|
23
23
|
export declare type SpinnerProps = typeof __propDef.props;
|
|
24
24
|
export declare type SpinnerEvents = typeof __propDef.events;
|
|
25
25
|
export declare type SpinnerSlots = typeof __propDef.slots;
|
|
26
|
+
/** `Spinner` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Spinner--default) */
|
|
26
27
|
export default class Spinner extends SvelteComponentTyped<SpinnerProps, SpinnerEvents, SpinnerSlots> {
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -49,6 +49,7 @@ declare const __propDef: {
|
|
|
49
49
|
export declare type ThemeProps = typeof __propDef.props;
|
|
50
50
|
export declare type ThemeEvents = typeof __propDef.events;
|
|
51
51
|
export declare type ThemeSlots = typeof __propDef.slots;
|
|
52
|
+
/** `Theme` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/theming-Theme--default) */
|
|
52
53
|
export default class Theme extends SvelteComponentTyped<ThemeProps, ThemeEvents, ThemeSlots> {
|
|
53
54
|
}
|
|
54
55
|
export {};
|
|
@@ -41,6 +41,7 @@ declare const __propDef: {
|
|
|
41
41
|
export declare type VideoProps = typeof __propDef.props;
|
|
42
42
|
export declare type VideoEvents = typeof __propDef.events;
|
|
43
43
|
export declare type VideoSlots = typeof __propDef.slots;
|
|
44
|
+
/** `Video` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Video--default) */
|
|
44
45
|
export default class Video extends SvelteComponentTyped<VideoProps, VideoEvents, VideoSlots> {
|
|
45
46
|
}
|
|
46
47
|
export {};
|
|
@@ -24,6 +24,7 @@ declare const __propDef: {
|
|
|
24
24
|
export declare type VisibleProps = typeof __propDef.props;
|
|
25
25
|
export declare type VisibleEvents = typeof __propDef.events;
|
|
26
26
|
export declare type VisibleSlots = typeof __propDef.slots;
|
|
27
|
+
/** `Visible` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Visible--default) */
|
|
27
28
|
export default class Visible extends SvelteComponentTyped<VisibleProps, VisibleEvents, VisibleSlots> {
|
|
28
29
|
}
|
|
29
30
|
export {};
|
package/dist/@types/index.d.ts
CHANGED
|
@@ -23,4 +23,5 @@ export { default as Spinner } from "./components/Spinner/Spinner.svelte";
|
|
|
23
23
|
export { default as Video } from "./components/Video/Video.svelte";
|
|
24
24
|
export { default as Visible } from "./components/Visible/Visible.svelte";
|
|
25
25
|
export { getPhotoPackPropsFromDoc } from "./components/PhotoPack/docProps.js";
|
|
26
|
+
export { getScrollerPropsFromDoc } from "./components/Scroller/docProps.js";
|
|
26
27
|
export { default as Theme, themes } from "./components/Theme/Theme.svelte";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `Article` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-article--default) -->
|
|
1
2
|
<script>/** Set to true for embeddables. */
|
|
2
3
|
export let embedded = false;
|
|
3
4
|
/** Add an id to the article tag to target it with custom CSS. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `BeforeAfter` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-beforeafter--default) -->
|
|
1
2
|
<script>import { throttle } from 'lodash-es';
|
|
2
3
|
import { onMount } from 'svelte';
|
|
3
4
|
import Block from '../Block/Block.svelte';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `Block` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-block--default) -->
|
|
1
2
|
<script>/** Width of the block within the article well. */
|
|
2
3
|
export let width = 'normal';
|
|
3
4
|
/** Add an id to the block tag to target it with custom CSS. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `BodyText` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-bodytext--default) -->
|
|
1
2
|
<script>/**
|
|
2
3
|
* A markdown text string.
|
|
3
4
|
* @type {string}
|
|
@@ -190,4 +191,4 @@ import Block from '../Block/Block.svelte';
|
|
|
190
191
|
}
|
|
191
192
|
:global(div.article-block.body-text.font-sans) {
|
|
192
193
|
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>
|
|
194
|
+
}</style>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `DatawrapperChart` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-DatawrapperChart--default) -->
|
|
1
2
|
<script>import { onMount, onDestroy } from 'svelte';
|
|
2
3
|
import GraphicBlock from '../GraphicBlock/GraphicBlock.svelte';
|
|
3
4
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `FeaturePhoto` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-FeaturePhoto--default) -->
|
|
1
2
|
<script>import { onMount } from 'svelte';
|
|
2
3
|
import Block from '../Block/Block.svelte';
|
|
3
4
|
import PaddingReset from '../PaddingReset/PaddingReset.svelte';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `NoteText` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-NoteText--default) -->
|
|
1
2
|
<script>/**
|
|
2
3
|
* A markdown text string.
|
|
3
4
|
* @type {string}
|
|
@@ -8,7 +9,7 @@ import { marked } from 'marked';
|
|
|
8
9
|
import Block from '../Block/Block.svelte';
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
|
-
<Block cls="notes">
|
|
12
|
+
<Block cls="notes mb-6">
|
|
12
13
|
{#if text}
|
|
13
14
|
{@html marked.parse(text)}
|
|
14
15
|
{/if}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `PymChild` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/utilities-PymChild--default) -->
|
|
1
2
|
<script>/** Pym.js polling interval */
|
|
2
3
|
export let polling = 500;
|
|
3
4
|
import { onMount } from 'svelte';
|
|
@@ -7,4 +8,4 @@ let pymChild;
|
|
|
7
8
|
onMount(() => {
|
|
8
9
|
pymChild = new pym.Child({ polling });
|
|
9
10
|
});
|
|
10
|
-
</script>
|
|
11
|
+
</script>
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
+
<!-- @component `SEO` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-SEO--default) -->
|
|
1
2
|
<script>import analytics from './analytics';
|
|
2
3
|
import publisherTags from './publisherTags';
|
|
4
|
+
/**
|
|
5
|
+
* Base url for the page, which in [Vite-based projects](https://vitejs.dev/guide/build.html#public-base-path)
|
|
6
|
+
* is globally available as `import.meta.env.BASE_URL`.
|
|
7
|
+
* @required
|
|
8
|
+
* @type {string}
|
|
9
|
+
*/
|
|
10
|
+
export let baseUrl = '';
|
|
3
11
|
/**
|
|
4
12
|
* [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object for the page.
|
|
5
13
|
* @required
|
|
6
14
|
* @type {URL}
|
|
7
15
|
*/
|
|
8
|
-
export let
|
|
16
|
+
export let pageUrl = null;
|
|
9
17
|
/**
|
|
10
18
|
* SEO title
|
|
11
19
|
* @required
|
|
@@ -59,9 +67,23 @@ export let authors = [];
|
|
|
59
67
|
* Whether to inject Google Analytics code for this page.
|
|
60
68
|
*/
|
|
61
69
|
export let includeAnalytics = false;
|
|
70
|
+
const getOrigin = (baseUrl) => {
|
|
71
|
+
try {
|
|
72
|
+
return new URL(baseUrl).origin;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
// This handles a weird case where Vite's base path is
|
|
76
|
+
// reset to './' after the app hydrates...
|
|
77
|
+
if (typeof window !== 'undefined')
|
|
78
|
+
return getOrigin(window.location.href);
|
|
79
|
+
return '';
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
$: origin = getOrigin(baseUrl);
|
|
83
|
+
$: canonicalUrl = origin + pageUrl.pathname;
|
|
62
84
|
// Only fire analytics on prod sites
|
|
63
85
|
if (typeof window !== 'undefined' && includeAnalytics) {
|
|
64
|
-
analytics(
|
|
86
|
+
analytics(canonicalUrl, seoTitle);
|
|
65
87
|
publisherTags();
|
|
66
88
|
}
|
|
67
89
|
const orgLdJson = {
|
|
@@ -81,10 +103,10 @@ const articleLdJson = {
|
|
|
81
103
|
'@context': 'http://schema.org',
|
|
82
104
|
'@type': 'NewsArticle',
|
|
83
105
|
headline: seoTitle,
|
|
84
|
-
url:
|
|
106
|
+
url: canonicalUrl,
|
|
85
107
|
mainEntityOfPage: {
|
|
86
108
|
'@type': 'WebPage',
|
|
87
|
-
'@id':
|
|
109
|
+
'@id': canonicalUrl,
|
|
88
110
|
},
|
|
89
111
|
thumbnailUrl: shareImgPath,
|
|
90
112
|
image: [
|
|
@@ -117,7 +139,7 @@ const articleLdJson = {
|
|
|
117
139
|
<html lang="{lang}"></html>
|
|
118
140
|
<title>{seoTitle}</title>
|
|
119
141
|
<meta name="description" content="{seoDescription}" />
|
|
120
|
-
<link rel="canonical" href="{
|
|
142
|
+
<link rel="canonical" href="{canonicalUrl}" />
|
|
121
143
|
<link
|
|
122
144
|
rel="shortcut icon"
|
|
123
145
|
type="image/x-icon"
|
|
@@ -142,7 +164,7 @@ const articleLdJson = {
|
|
|
142
164
|
sizes="96x96"
|
|
143
165
|
/>
|
|
144
166
|
|
|
145
|
-
<meta property="og:url" content="{
|
|
167
|
+
<meta property="og:url" content="{canonicalUrl}" />
|
|
146
168
|
<meta property="og:type" content="article" />
|
|
147
169
|
<meta property="og:title" content="{shareTitle}" itemprop="name" />
|
|
148
170
|
<meta
|
|
@@ -150,17 +172,13 @@ const articleLdJson = {
|
|
|
150
172
|
content="{shareDescription}"
|
|
151
173
|
itemprop="description"
|
|
152
174
|
/>
|
|
153
|
-
<meta
|
|
154
|
-
property="og:image"
|
|
155
|
-
content="{shareImgPath}"
|
|
156
|
-
itemprop="image"
|
|
157
|
-
/>
|
|
175
|
+
<meta property="og:image" content="{shareImgPath}" itemprop="image" />
|
|
158
176
|
<meta property="og:site_name" content="Reuters" />
|
|
159
177
|
|
|
160
178
|
<meta name="twitter:card" content="summary_large_image" />
|
|
161
179
|
<meta name="twitter:site" content="@ReutersGraphics" />
|
|
162
180
|
<meta name="twitter:creator" content="@ReutersGraphics" />
|
|
163
|
-
<meta name="twitter:domain" content="{
|
|
181
|
+
<meta name="twitter:domain" content="{origin}" />
|
|
164
182
|
<meta name="twitter:title" content="{shareTitle}" />
|
|
165
183
|
<meta name="twitter:description" content="{shareDescription}" />
|
|
166
184
|
<meta name="twitter:image:src" content="{shareImgPath}" />
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `Scroller` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Scroller--default) -->
|
|
1
2
|
<script>/**
|
|
2
3
|
* ID of the scroller container
|
|
3
4
|
* @type {string}
|
|
@@ -101,7 +102,7 @@ let progress;
|
|
|
101
102
|
>
|
|
102
103
|
<div class="scroller-graphic-well">
|
|
103
104
|
<Block
|
|
104
|
-
width={backgroundWidth}
|
|
105
|
+
width="{backgroundWidth}"
|
|
105
106
|
cls="background-container step-{index + 1}"
|
|
106
107
|
>
|
|
107
108
|
<Background
|
|
@@ -110,7 +111,7 @@ let progress;
|
|
|
110
111
|
preload="{preload}"
|
|
111
112
|
stackBackground="{stackBackground}"
|
|
112
113
|
/>
|
|
113
|
-
|
|
114
|
+
</Block>
|
|
114
115
|
</div>
|
|
115
116
|
</div>
|
|
116
117
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const getScrollerPropsFromDoc = (docBlock, aiCharts, assetsPath = '') => {
|
|
2
|
+
return {
|
|
3
|
+
id: docBlock.ID,
|
|
4
|
+
backgroundWidth: docBlock.Width,
|
|
5
|
+
foregroundPosition: docBlock.ForegroundPosition,
|
|
6
|
+
stackBackground: docBlock.StackBackground === 'true' || !docBlock.StackBackground,
|
|
7
|
+
embeddedLayout: docBlock.EmbeddedLayout,
|
|
8
|
+
steps: docBlock.Steps.map((step) => ({
|
|
9
|
+
background: aiCharts[step.Background],
|
|
10
|
+
backgroundProps: { assetsPath },
|
|
11
|
+
foreground: step.Text,
|
|
12
|
+
})),
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `SiteFooter` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-SiteFooter--default) -->
|
|
1
2
|
<script>import QuickLinks from './QuickLinks.svelte';
|
|
2
3
|
import CompanyLinks from './CompanyLinks.svelte';
|
|
3
4
|
import LegalLinks from './LegalLinks.svelte';
|
|
@@ -10,6 +11,7 @@ export let referrals = [];
|
|
|
10
11
|
</script>
|
|
11
12
|
|
|
12
13
|
<footer
|
|
14
|
+
class="my-0"
|
|
13
15
|
style="{`
|
|
14
16
|
--nav-background: var(--theme-colour-background, #fff);
|
|
15
17
|
--nav-primary: var(--theme-colour-text-primary, #404040);
|
|
@@ -26,7 +28,7 @@ export let referrals = [];
|
|
|
26
28
|
|
|
27
29
|
<!-- svelte-ignore css-unused-selector -->
|
|
28
30
|
<style>footer {
|
|
29
|
-
margin-top:
|
|
31
|
+
margin-top: 0;
|
|
30
32
|
background-color: var(--nav-background, #fff);
|
|
31
33
|
}
|
|
32
34
|
footer div {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- @component `SiteHeader` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-SiteHeader--default) -->
|
|
2
|
+
<script>import ReutersLogo from '../ReutersLogo/ReutersLogo.svelte';
|
|
2
3
|
import NavBar from './NavBar/index.svelte';
|
|
3
4
|
import data from './data.json';
|
|
4
5
|
import { setContext } from 'svelte';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `Spinner` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Spinner--default) -->
|
|
1
2
|
<script>/** Primary colour of the spinner. */
|
|
2
3
|
export let colour = '#666';
|
|
3
4
|
/**
|
|
@@ -20,7 +21,7 @@ export let containerPadding = 10;
|
|
|
20
21
|
|
|
21
22
|
<div
|
|
22
23
|
style:width="100%"
|
|
23
|
-
style:height={`${
|
|
24
|
+
style:height="{`${width + containerPadding * 2}px`}"
|
|
24
25
|
class="component-container"
|
|
25
26
|
>
|
|
26
27
|
<div
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `Theme` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/theming-Theme--default) -->
|
|
1
2
|
<script context="module">import light from './themes/light.js';
|
|
2
3
|
import dark from './themes/dark.js';
|
|
3
4
|
/**
|
|
@@ -17,18 +18,16 @@ export let theme = {};
|
|
|
17
18
|
* explicitly set.
|
|
18
19
|
*/
|
|
19
20
|
export let base = 'light';
|
|
20
|
-
import cssVariables from '../../actions/cssVariables';
|
|
21
21
|
import flatten from './utils/flatten';
|
|
22
22
|
import mergeThemes from './utils/merge';
|
|
23
23
|
/** @type {Theme} */
|
|
24
24
|
$: mergedTheme = mergeThemes({}, themes[base] || themes.light, theme);
|
|
25
|
+
$: cssVariables = Object.entries(flatten({ theme: mergedTheme }))
|
|
26
|
+
.map(([key, value]) => `--${key}: ${value};`)
|
|
27
|
+
.join(' ');
|
|
25
28
|
</script>
|
|
26
29
|
|
|
27
|
-
<div
|
|
28
|
-
class="theme"
|
|
29
|
-
style="display: contents;"
|
|
30
|
-
use:cssVariables="{flatten({ theme: mergedTheme })}"
|
|
31
|
-
>
|
|
30
|
+
<div class="theme" style="{cssVariables}" style:display="contents">
|
|
32
31
|
<!-- Clients can override the theme above by attaching custom properties to this element. -->
|
|
33
32
|
<div class="theme-client-override" style="display: contents;">
|
|
34
33
|
<!-- Themed content -->
|
|
@@ -5,8 +5,8 @@ export default {
|
|
|
5
5
|
'text-primary': '#ffffff',
|
|
6
6
|
'text-secondary': 'rgb(255 255 255 / 60%)',
|
|
7
7
|
accent: ' #ef3c2a',
|
|
8
|
-
'brand-logo': '#
|
|
9
|
-
'brand-rules': '
|
|
8
|
+
'brand-logo': '#ffffff',
|
|
9
|
+
'brand-rules': 'rgb(255 255 255 / 25%)',
|
|
10
10
|
'brand-shadow': 'rgb(255 255 255 / 10%)',
|
|
11
11
|
},
|
|
12
12
|
font: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- @component `Video` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Video--default) -->
|
|
1
2
|
<script>import IntersectionObserver from 'svelte-intersection-observer';
|
|
2
3
|
import Controls from './Controls.svelte';
|
|
3
4
|
import Block from '../Block/Block.svelte';
|
|
@@ -238,7 +239,7 @@ if (ariaHidden && !ariaDescription) {
|
|
|
238
239
|
</div>
|
|
239
240
|
{/if}
|
|
240
241
|
{#if caption}
|
|
241
|
-
<
|
|
242
|
+
<div class="caption">{caption}</div>
|
|
242
243
|
{/if}
|
|
243
244
|
{/if}
|
|
244
245
|
</div>
|
|
@@ -265,7 +266,7 @@ if (ariaHidden && !ariaDescription) {
|
|
|
265
266
|
border: 0 !important;
|
|
266
267
|
}
|
|
267
268
|
|
|
268
|
-
|
|
269
|
+
div.caption {
|
|
269
270
|
font-size: 0.8rem;
|
|
270
271
|
color: var(--theme-colour-text-secondary, #666666);
|
|
271
272
|
}
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reuters-graphics/graphics-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://reuters-graphics.github.io/graphics-components",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"postversion": "git push origin && git push origin --tags"
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|
|
18
|
-
"types": "dist/@types/index.d.ts",
|
|
18
|
+
"types": "./dist/@types/index.d.ts",
|
|
19
19
|
"files": [
|
|
20
20
|
"dist"
|
|
21
21
|
],
|
|
@@ -127,6 +127,7 @@
|
|
|
127
127
|
"./components/Scroller/Embedded/index.svelte": "./dist/components/Scroller/Embedded/index.svelte",
|
|
128
128
|
"./components/Scroller/Foreground.svelte": "./dist/components/Scroller/Foreground.svelte",
|
|
129
129
|
"./components/Scroller/Scroller.svelte": "./dist/components/Scroller/Scroller.svelte",
|
|
130
|
+
"./components/Scroller/docProps.ts": "./dist/components/Scroller/docProps.ts",
|
|
130
131
|
"./components/Sharer/Sharer.svelte": "./dist/components/Sharer/Sharer.svelte",
|
|
131
132
|
"./components/Sharer/utils/copyToClipboard": "./dist/components/Sharer/utils/copyToClipboard.js",
|
|
132
133
|
"./components/Sharer/utils/facebook": "./dist/components/Sharer/utils/facebook.js",
|