@reuters-graphics/graphics-components 0.1.4 → 0.1.6
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/Scroller/docProps.d.ts +2 -0
- package/dist/components/ReferralBlock/ReferralBlock.svelte +9 -4
- package/dist/components/Scroller/docProps.js +1 -0
- package/dist/components/SiteFooter/Referrals/Link.svelte +6 -2
- package/dist/components/Video/Controls.svelte +7 -2
- package/package.json +13 -3
|
@@ -7,6 +7,7 @@ interface BlockStep {
|
|
|
7
7
|
interface Block {
|
|
8
8
|
Type: string;
|
|
9
9
|
Width: string;
|
|
10
|
+
Preload?: string;
|
|
10
11
|
ForegroundPosition: string;
|
|
11
12
|
StackBackground?: string;
|
|
12
13
|
EmbeddedLayout?: string;
|
|
@@ -22,6 +23,7 @@ export declare const getScrollerPropsFromDoc: (docBlock: Block, aiCharts: AiChar
|
|
|
22
23
|
foregroundPosition: string;
|
|
23
24
|
stackBackground: boolean;
|
|
24
25
|
embeddedLayout: string;
|
|
26
|
+
preload: number;
|
|
25
27
|
steps: {
|
|
26
28
|
background: ComponentType;
|
|
27
29
|
backgroundProps: {
|
|
@@ -67,7 +67,7 @@ getTime();
|
|
|
67
67
|
class="referral-container"
|
|
68
68
|
class:stacked="{clientWidth && clientWidth < 750}"
|
|
69
69
|
class:xs="{clientWidth && clientWidth < 450}"
|
|
70
|
-
bind:clientWidth
|
|
70
|
+
bind:clientWidth="{clientWidth}"
|
|
71
71
|
>
|
|
72
72
|
{#each $referrals as referral}
|
|
73
73
|
<div class="referral">
|
|
@@ -81,9 +81,13 @@ getTime();
|
|
|
81
81
|
class="headline"
|
|
82
82
|
class:xs="{clientWidth && clientWidth < 450}"
|
|
83
83
|
>
|
|
84
|
-
<div class="kicker">
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
<div class="kicker" data-chromatic="ignore">
|
|
85
|
+
{referral.kicker.name}
|
|
86
|
+
</div>
|
|
87
|
+
<div class="title" data-chromatic="ignore">
|
|
88
|
+
{referral.title}
|
|
89
|
+
</div>
|
|
90
|
+
<div class="publish-time" data-chromatic="ignore">
|
|
87
91
|
{getTime(new Date(referral.display_time))}
|
|
88
92
|
</div>
|
|
89
93
|
</div>
|
|
@@ -92,6 +96,7 @@ getTime();
|
|
|
92
96
|
class:xs="{clientWidth && clientWidth < 450}"
|
|
93
97
|
>
|
|
94
98
|
<img
|
|
99
|
+
data-chromatic="ignore"
|
|
95
100
|
src="{referral.thumbnail.renditions.landscape['240w']}"
|
|
96
101
|
alt="{referral.thumbnail.caption ||
|
|
97
102
|
referral.thumbnail.alt_text}"
|
|
@@ -5,6 +5,7 @@ export const getScrollerPropsFromDoc = (docBlock, aiCharts, assetsPath = '') =>
|
|
|
5
5
|
foregroundPosition: docBlock.ForegroundPosition,
|
|
6
6
|
stackBackground: docBlock.StackBackground === 'true' || !docBlock.StackBackground,
|
|
7
7
|
embeddedLayout: docBlock.EmbeddedLayout,
|
|
8
|
+
preload: docBlock.Preload ? parseInt(docBlock.Preload) || 1 : 1,
|
|
8
9
|
steps: docBlock.Steps.map((step) => ({
|
|
9
10
|
background: aiCharts[step.Background],
|
|
10
11
|
backgroundProps: { assetsPath },
|
|
@@ -10,12 +10,16 @@
|
|
|
10
10
|
<a href="{url.replace('index.html', '')}">
|
|
11
11
|
<IntersectionObserver let:intersecting top="{600}" once="{true}">
|
|
12
12
|
{#if intersecting}
|
|
13
|
-
<div
|
|
13
|
+
<div
|
|
14
|
+
data-chromatic="ignore"
|
|
15
|
+
class="image"
|
|
16
|
+
style="{`background-image: url(${image});`}"
|
|
17
|
+
></div>
|
|
14
18
|
{:else}
|
|
15
19
|
<div class="image"></div>
|
|
16
20
|
{/if}
|
|
17
21
|
</IntersectionObserver>
|
|
18
|
-
<p>{title}</p>
|
|
22
|
+
<p data-chromatic="ignore">{title}</p>
|
|
19
23
|
</a>
|
|
20
24
|
</div>
|
|
21
25
|
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
paused = !paused;
|
|
21
21
|
clickedOnPauseBtn = paused === true; // so video doesn't autoplay when coming into view again if paused previously
|
|
22
22
|
dispatch('pausePlayEvent', {
|
|
23
|
-
paused
|
|
24
|
-
clickedOnPauseBtn
|
|
23
|
+
paused,
|
|
24
|
+
clickedOnPauseBtn,
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
</script>
|
|
@@ -32,9 +32,14 @@
|
|
|
32
32
|
opacity: {controlsOpacity};
|
|
33
33
|
top: {controlsPosition === 'top left' || controlsPosition === 'top right'
|
|
34
34
|
? `${10}px`
|
|
35
|
+
: controlsPosition === 'center'
|
|
36
|
+
? `${(heightVideoContainer - controlsBorderOffset) / 2}px`
|
|
35
37
|
: `${heightVideoContainer - controlsBorderOffset}px`};
|
|
38
|
+
|
|
36
39
|
left: {controlsPosition === 'top left' || controlsPosition === 'bottom left'
|
|
37
40
|
? `${10}px`
|
|
41
|
+
: controlsPosition === 'center'
|
|
42
|
+
? `${(widthVideoContainer - controlsBorderOffset) / 2}px`
|
|
38
43
|
: `${widthVideoContainer - controlsBorderOffset}px`};
|
|
39
44
|
"
|
|
40
45
|
>
|
package/package.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reuters-graphics/graphics-components",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": false,
|
|
6
6
|
"homepage": "https://reuters-graphics.github.io/graphics-components",
|
|
7
|
-
"repository":
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/reuters-graphics/graphics-components.git"
|
|
10
|
+
},
|
|
8
11
|
"scripts": {
|
|
9
12
|
"start": "storybook dev -p 3000",
|
|
10
13
|
"new": "node ./bin/newComponent/index.cjs",
|
|
11
14
|
"build:package": "node ./bin/buildPackage/index.js",
|
|
15
|
+
"build:chromatic": "storybook build -o docs",
|
|
12
16
|
"build:docs": "storybook build -o docs && touch ./docs/.nojekyll",
|
|
13
17
|
"build": "npm-run-all build:package build:docs",
|
|
14
18
|
"prepublishOnly": "npm run build:package",
|
|
@@ -54,6 +58,7 @@
|
|
|
54
58
|
"autoprefixer": "^10.4.14",
|
|
55
59
|
"babel-loader": "^9.1.2",
|
|
56
60
|
"change-case": "^4.1.2",
|
|
61
|
+
"chromatic": "^6.19.9",
|
|
57
62
|
"eslint": "^8.42.0",
|
|
58
63
|
"eslint-config-prettier": "^8.8.0",
|
|
59
64
|
"eslint-plugin-n": "^16.0.0",
|
|
@@ -70,6 +75,7 @@
|
|
|
70
75
|
"react": "^18.2.0",
|
|
71
76
|
"react-dom": "^18.2.0",
|
|
72
77
|
"react-syntax-highlighter": "^15.5.0",
|
|
78
|
+
"remark-gfm": "^3.0.1",
|
|
73
79
|
"rimraf": "^5.0.0",
|
|
74
80
|
"sass": "^1.63.0",
|
|
75
81
|
"storybook": "^7.0.20",
|
|
@@ -244,5 +250,9 @@
|
|
|
244
250
|
"./scss/typography/variables": "./dist/scss/typography/_variables.scss",
|
|
245
251
|
".": "./dist/index.js"
|
|
246
252
|
},
|
|
247
|
-
"svelte": "./dist/index.js"
|
|
253
|
+
"svelte": "./dist/index.js",
|
|
254
|
+
"bugs": {
|
|
255
|
+
"url": "https://github.com/reuters-graphics/graphics-components/issues"
|
|
256
|
+
},
|
|
257
|
+
"readme": "ERROR: No README data found!"
|
|
248
258
|
}
|