@reuters-graphics/graphics-components 0.0.1-beta.16 → 0.0.1-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components/Article/Article.svelte.d.ts +5 -0
- package/dist/@types/components/Scroller/docProps.d.ts +32 -0
- package/dist/@types/index.d.ts +1 -0
- package/dist/components/Article/Article.svelte +5 -0
- package/dist/components/SEO/SEO.svelte +4 -0
- package/dist/components/Scroller/docProps.js +15 -0
- package/dist/index.js +1 -0
- package/package.json +2 -1
|
@@ -27,6 +27,11 @@ 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
|
+
/**
|
|
31
|
+
* The `Article` component contains all the content of our story and also establishes the dimensions of our article well, the default central trunk of our page layout.
|
|
32
|
+
*
|
|
33
|
+
* [Docs](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-article--default)
|
|
34
|
+
*/
|
|
30
35
|
export default class Article extends SvelteComponentTyped<ArticleProps, ArticleEvents, ArticleSlots> {
|
|
31
36
|
}
|
|
32
37
|
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ComponentType, SvelteComponentTyped } 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<SvelteComponentTyped<any, any, any>>;
|
|
26
|
+
backgroundProps: {
|
|
27
|
+
assetsPath: string;
|
|
28
|
+
};
|
|
29
|
+
foreground: string;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
32
|
+
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,8 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component The `Article` component contains all the content of our story and also establishes the dimensions of our article well, the default central trunk of our page layout.
|
|
3
|
+
|
|
4
|
+
[Docs](https://reuters-graphics.github.io/graphics-components/?path=/docs/layout-article--default)
|
|
5
|
+
-->
|
|
1
6
|
<script>/** Set to true for embeddables. */
|
|
2
7
|
export let embedded = false;
|
|
3
8
|
/** Add an id to the article tag to target it with custom CSS. */
|
|
@@ -71,6 +71,10 @@ const getOrigin = (baseUrl) => {
|
|
|
71
71
|
return new URL(baseUrl).origin;
|
|
72
72
|
}
|
|
73
73
|
catch {
|
|
74
|
+
// This handles a weird case where Vite's base path is
|
|
75
|
+
// reset to './' after the app hydrates...
|
|
76
|
+
if (typeof window !== 'undefined')
|
|
77
|
+
return getOrigin(window.location.href);
|
|
74
78
|
return '';
|
|
75
79
|
}
|
|
76
80
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
;
|
|
2
|
+
export const getScrollerPropsFromDoc = (docBlock, aiCharts, assetsPath = '') => {
|
|
3
|
+
return {
|
|
4
|
+
id: docBlock.ID,
|
|
5
|
+
backgroundWidth: docBlock.Width,
|
|
6
|
+
foregroundPosition: docBlock.ForegroundPosition,
|
|
7
|
+
stackBackground: docBlock.StackBackground === 'true' || !docBlock.StackBackground,
|
|
8
|
+
embeddedLayout: docBlock.EmbeddedLayout,
|
|
9
|
+
steps: docBlock.Steps.map((step) => ({
|
|
10
|
+
background: aiCharts[step.Background],
|
|
11
|
+
backgroundProps: { assetsPath },
|
|
12
|
+
foreground: step.Text,
|
|
13
|
+
})),
|
|
14
|
+
};
|
|
15
|
+
};
|
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.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://reuters-graphics.github.io/graphics-components",
|
|
@@ -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",
|