@reuters-graphics/graphics-components 3.2.1 → 3.3.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/dist/components/BlogPost/BlogPost.svelte +101 -0
- package/dist/components/BlogPost/BlogPost.svelte.d.ts +33 -0
- package/dist/components/BlogPost/CopyLink.svelte +131 -0
- package/dist/components/BlogPost/CopyLink.svelte.d.ts +17 -0
- package/dist/components/BlogPost/PostHeadline.svelte +184 -0
- package/dist/components/BlogPost/PostHeadline.svelte.d.ts +26 -0
- package/dist/components/BlogPost/utils.d.ts +6 -0
- package/dist/components/BlogPost/utils.js +6 -0
- package/dist/components/BlogTOC/BlogTOC.svelte +270 -0
- package/dist/components/BlogTOC/BlogTOC.svelte.d.ts +17 -0
- package/dist/components/BlogTOC/TOCList.svelte +134 -0
- package/dist/components/BlogTOC/TOCList.svelte.d.ts +22 -0
- package/dist/components/Byline/Byline.svelte +2 -2
- package/dist/components/Byline/Byline.svelte.d.ts +1 -1
- package/dist/components/ClockWall/Clock.svelte +266 -0
- package/dist/components/ClockWall/Clock.svelte.d.ts +28 -0
- package/dist/components/ClockWall/ClockWall.svelte +65 -0
- package/dist/components/ClockWall/ClockWall.svelte.d.ts +17 -0
- package/dist/components/KinesisLogo/KinesisLogo.svelte +140 -0
- package/dist/components/KinesisLogo/KinesisLogo.svelte.d.ts +10 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/journalize.d.ts +9 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/index.js +9 -2
- package/package.json +1 -1
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { onDestroy, onMount } from 'svelte';
|
|
3
|
+
|
|
4
|
+
const CLOCK_WEIGHT = { Light: 1, Normal: 2, Bold: 4 } as const;
|
|
5
|
+
type ClockWeight = keyof typeof CLOCK_WEIGHT;
|
|
6
|
+
|
|
7
|
+
const CLOCK_SIZE = { XS: 48, MD: 80, LG: 120, XL: 160 } as const;
|
|
8
|
+
type ClockSize = keyof typeof CLOCK_SIZE;
|
|
9
|
+
|
|
10
|
+
interface Props {
|
|
11
|
+
/**
|
|
12
|
+
* The name of the clock (to be displayed), e.g. "New York"
|
|
13
|
+
*/
|
|
14
|
+
name: string;
|
|
15
|
+
/**
|
|
16
|
+
* The UTC time to display, defaults to current time
|
|
17
|
+
*/
|
|
18
|
+
UTCTime?: Date;
|
|
19
|
+
/**
|
|
20
|
+
* The timezone identifier, e.g. "America/New_York"
|
|
21
|
+
*/
|
|
22
|
+
tzIdentifier: string;
|
|
23
|
+
/**
|
|
24
|
+
* Whether to show the clock, defaults to true
|
|
25
|
+
*/
|
|
26
|
+
showClock?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* The weight of the clock, either "normal" or "bold"
|
|
29
|
+
*/
|
|
30
|
+
clockWeight?: ClockWeight;
|
|
31
|
+
/**
|
|
32
|
+
* The size of the clock, either "XS", "MD", "LG", or "XL"
|
|
33
|
+
*/
|
|
34
|
+
clockSize?: ClockSize;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const {
|
|
38
|
+
name,
|
|
39
|
+
UTCTime = new Date(new Date().toUTCString()),
|
|
40
|
+
tzIdentifier,
|
|
41
|
+
showClock = true,
|
|
42
|
+
clockWeight = 'Normal',
|
|
43
|
+
clockSize = 'MD',
|
|
44
|
+
}: Props = $props();
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Converts a UTC date to a specified timezone and formats it to a.m./p.m. style.
|
|
48
|
+
*
|
|
49
|
+
* @param utcDate - The UTC date to convert.
|
|
50
|
+
* @param timezone - The timezone identifier.
|
|
51
|
+
* @returns The formatted time string.
|
|
52
|
+
*
|
|
53
|
+
*/
|
|
54
|
+
function convertUTCToTimezone(utcDate: Date, timezone: string) {
|
|
55
|
+
const time = new Date(utcDate).toLocaleString('en-US', {
|
|
56
|
+
timeZone: timezone,
|
|
57
|
+
hour: 'numeric',
|
|
58
|
+
minute: '2-digit',
|
|
59
|
+
hour12: true,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// Convert AM/PM to a.m./p.m. format
|
|
63
|
+
return time.replace('AM', 'a.m.').replace('PM', 'p.m.');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let clockInterval: ReturnType<typeof setInterval> | null = null;
|
|
67
|
+
let time: string = $state(convertUTCToTimezone(UTCTime, tzIdentifier));
|
|
68
|
+
|
|
69
|
+
onMount(() => {
|
|
70
|
+
clockInterval = setInterval(() => {
|
|
71
|
+
time = convertUTCToTimezone(
|
|
72
|
+
new Date(new Date().toUTCString()),
|
|
73
|
+
tzIdentifier
|
|
74
|
+
);
|
|
75
|
+
}, 1000 * 10); // Update every 10 seconds
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
let minute: number = $derived(
|
|
79
|
+
parseFloat(time?.split(' ')[0].split(':')[1]) || 0
|
|
80
|
+
);
|
|
81
|
+
let hour: number = $derived(
|
|
82
|
+
parseFloat(time?.split(' ')[0].split(':')[0]) || 0
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
onDestroy(() => {
|
|
86
|
+
if (clockInterval) {
|
|
87
|
+
clearInterval(clockInterval);
|
|
88
|
+
clockInterval = null;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
</script>
|
|
92
|
+
|
|
93
|
+
<div class="clock-container" style="--clock-size: {CLOCK_SIZE[clockSize]}px;">
|
|
94
|
+
{#if showClock}
|
|
95
|
+
<svg class="clock-svg" width="100%" height="100%" viewBox="0 0 120 120">
|
|
96
|
+
<defs>
|
|
97
|
+
<filter id="inset-shadow">
|
|
98
|
+
<!-- Shadow offset -->
|
|
99
|
+
<feOffset dx="0" dy="4" />
|
|
100
|
+
<!-- Shadow blur -->
|
|
101
|
+
<feGaussianBlur stdDeviation="8" result="offset-blur" />
|
|
102
|
+
<!-- Invert drop shadow to make an inset shadow-->
|
|
103
|
+
<feComposite
|
|
104
|
+
operator="out"
|
|
105
|
+
in="SourceGraphic"
|
|
106
|
+
in2="offset-blur"
|
|
107
|
+
result="inverse"
|
|
108
|
+
/>
|
|
109
|
+
<!-- Cut colour inside shadow -->
|
|
110
|
+
<feFlood flood-color="black" flood-opacity=".2" result="color" />
|
|
111
|
+
<feComposite operator="in" in="color" in2="inverse" result="shadow" />
|
|
112
|
+
<!-- Placing shadow over element -->
|
|
113
|
+
<feComposite operator="over" in="shadow" in2="SourceGraphic" />
|
|
114
|
+
</filter>
|
|
115
|
+
</defs>
|
|
116
|
+
<circle
|
|
117
|
+
class="clock-outer-border"
|
|
118
|
+
cx="50%"
|
|
119
|
+
cy="50%"
|
|
120
|
+
r="58"
|
|
121
|
+
fill="transparent"
|
|
122
|
+
stroke="#cccccc"
|
|
123
|
+
stroke-width="2"
|
|
124
|
+
></circle>
|
|
125
|
+
<circle
|
|
126
|
+
class="clock-inner-shadow"
|
|
127
|
+
cx="50%"
|
|
128
|
+
cy="50%"
|
|
129
|
+
r="54"
|
|
130
|
+
fill="#ffffff"
|
|
131
|
+
filter="url(#inset-shadow)"
|
|
132
|
+
></circle>
|
|
133
|
+
<g id="clock-ticks" style="mix-blend-mode: multiply;">
|
|
134
|
+
{#each Array(12) as _, i (i)}
|
|
135
|
+
<line
|
|
136
|
+
class="clock-hour-mark"
|
|
137
|
+
x1="50%"
|
|
138
|
+
y1="56"
|
|
139
|
+
x2="50%"
|
|
140
|
+
y2="64"
|
|
141
|
+
stroke="var(--tr-light-grey)"
|
|
142
|
+
stroke-width="2"
|
|
143
|
+
transform-origin="50% 50%"
|
|
144
|
+
transform="rotate({i * 30}) translate(0, -46)"
|
|
145
|
+
></line>
|
|
146
|
+
{/each}
|
|
147
|
+
</g>
|
|
148
|
+
<g
|
|
149
|
+
id="clock-hand-minute"
|
|
150
|
+
transform-origin="50% 50%"
|
|
151
|
+
transform="rotate({(minute / 60) * 360})"
|
|
152
|
+
>
|
|
153
|
+
<circle
|
|
154
|
+
cx="50%"
|
|
155
|
+
cy="50%"
|
|
156
|
+
r="4"
|
|
157
|
+
fill="transparent"
|
|
158
|
+
stroke="var(--tr-light-grey)"
|
|
159
|
+
stroke-width={CLOCK_WEIGHT[clockWeight]}
|
|
160
|
+
></circle>
|
|
161
|
+
<line
|
|
162
|
+
x1="50%"
|
|
163
|
+
y1={60 - 4 - 36}
|
|
164
|
+
x2="50%"
|
|
165
|
+
y2={60 - 4}
|
|
166
|
+
stroke="var(--tr-light-grey)"
|
|
167
|
+
stroke-width={CLOCK_WEIGHT[clockWeight]}
|
|
168
|
+
transform-origin="50% 50%"
|
|
169
|
+
></line>
|
|
170
|
+
<line
|
|
171
|
+
x1="50%"
|
|
172
|
+
y1={60 + 4}
|
|
173
|
+
x2="50%"
|
|
174
|
+
y2={60 + 4 + 4}
|
|
175
|
+
stroke="var(--tr-light-grey)"
|
|
176
|
+
stroke-width={CLOCK_WEIGHT[clockWeight]}
|
|
177
|
+
transform-origin="50% 50%"
|
|
178
|
+
></line>
|
|
179
|
+
</g>
|
|
180
|
+
<g
|
|
181
|
+
id="clock-hand-hour"
|
|
182
|
+
transform-origin="50% 50%"
|
|
183
|
+
transform="rotate({(hour / 12) * 360 + (360 / 12) * (minute / 60)})"
|
|
184
|
+
>
|
|
185
|
+
<circle
|
|
186
|
+
cx="50%"
|
|
187
|
+
cy="50%"
|
|
188
|
+
r="4"
|
|
189
|
+
fill="transparent"
|
|
190
|
+
stroke="var(--tr-dark-grey)"
|
|
191
|
+
stroke-width={CLOCK_WEIGHT[clockWeight]}
|
|
192
|
+
></circle>
|
|
193
|
+
<line
|
|
194
|
+
x1="50%"
|
|
195
|
+
y1={60 - 4 - 24}
|
|
196
|
+
x2="50%"
|
|
197
|
+
y2={60 - 4}
|
|
198
|
+
stroke="var(--tr-dark-grey)"
|
|
199
|
+
stroke-width={CLOCK_WEIGHT[clockWeight]}
|
|
200
|
+
transform-origin="50% 50%"
|
|
201
|
+
></line>
|
|
202
|
+
<line
|
|
203
|
+
x1="50%"
|
|
204
|
+
y1={60 + 4}
|
|
205
|
+
x2="50%"
|
|
206
|
+
y2={60 + 4 + 4}
|
|
207
|
+
stroke="var(--tr-dark-grey)"
|
|
208
|
+
stroke-width={CLOCK_WEIGHT[clockWeight]}
|
|
209
|
+
transform-origin="50% 50%"
|
|
210
|
+
></line>
|
|
211
|
+
</g>
|
|
212
|
+
<circle
|
|
213
|
+
class="clock-origin"
|
|
214
|
+
cx="50%"
|
|
215
|
+
cy="50%"
|
|
216
|
+
r="2"
|
|
217
|
+
fill="var(--tr-dark-grey)"
|
|
218
|
+
></circle>
|
|
219
|
+
</svg>
|
|
220
|
+
{/if}
|
|
221
|
+
<div class="clock-info">
|
|
222
|
+
<p class="m-0 p-0 font-sans font-medium leading-none text-sm">
|
|
223
|
+
{name}
|
|
224
|
+
</p>
|
|
225
|
+
<p
|
|
226
|
+
class="m-0 p-0 font-sans text-xs leading-none"
|
|
227
|
+
style="color: var(--tr-medium-grey);"
|
|
228
|
+
>
|
|
229
|
+
{time}
|
|
230
|
+
</p>
|
|
231
|
+
</div>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<style>/* Generated from
|
|
235
|
+
https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12
|
|
236
|
+
*/
|
|
237
|
+
/* Generated from
|
|
238
|
+
https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12
|
|
239
|
+
*/
|
|
240
|
+
/* Scales by 1.125 */
|
|
241
|
+
.clock-container {
|
|
242
|
+
height: var(--clock-size);
|
|
243
|
+
display: flex;
|
|
244
|
+
justify-content: center;
|
|
245
|
+
align-items: center;
|
|
246
|
+
gap: 8px;
|
|
247
|
+
flex: 1 1 0px;
|
|
248
|
+
}
|
|
249
|
+
@media (max-width: 659px) {
|
|
250
|
+
.clock-container {
|
|
251
|
+
height: 48px;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
.clock-container .clock-info {
|
|
255
|
+
display: flex;
|
|
256
|
+
flex-direction: column;
|
|
257
|
+
gap: 2px;
|
|
258
|
+
}
|
|
259
|
+
.clock-container .clock-info p {
|
|
260
|
+
text-wrap: nowrap;
|
|
261
|
+
}
|
|
262
|
+
.clock-container svg {
|
|
263
|
+
aspect-ratio: 1/1;
|
|
264
|
+
width: auto;
|
|
265
|
+
height: 100%;
|
|
266
|
+
}</style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const Clock: import("svelte").Component<{
|
|
2
|
+
/**
|
|
3
|
+
* The name of the clock (to be displayed), e.g. "New York"
|
|
4
|
+
*/
|
|
5
|
+
name: string;
|
|
6
|
+
/**
|
|
7
|
+
* The UTC time to display, defaults to current time
|
|
8
|
+
*/
|
|
9
|
+
UTCTime?: Date;
|
|
10
|
+
/**
|
|
11
|
+
* The timezone identifier, e.g. "America/New_York"
|
|
12
|
+
*/
|
|
13
|
+
tzIdentifier: string;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to show the clock, defaults to true
|
|
16
|
+
*/
|
|
17
|
+
showClock?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The weight of the clock, either "normal" or "bold"
|
|
20
|
+
*/
|
|
21
|
+
clockWeight?: "Light" | "Normal" | "Bold";
|
|
22
|
+
/**
|
|
23
|
+
* The size of the clock, either "XS", "MD", "LG", or "XL"
|
|
24
|
+
*/
|
|
25
|
+
clockSize?: "XS" | "MD" | "LG" | "XL";
|
|
26
|
+
}, {}, "">;
|
|
27
|
+
type Clock = ReturnType<typeof Clock>;
|
|
28
|
+
export default Clock;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { ComponentProps } from 'svelte';
|
|
3
|
+
import type { ContainerWidth } from '../@types/global';
|
|
4
|
+
import Block from '../Block/Block.svelte';
|
|
5
|
+
import Clock from './Clock.svelte';
|
|
6
|
+
|
|
7
|
+
type ClockProps = ComponentProps<typeof Clock>;
|
|
8
|
+
|
|
9
|
+
interface City {
|
|
10
|
+
name: string;
|
|
11
|
+
tzIdentifier: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Props {
|
|
15
|
+
cities?: City[];
|
|
16
|
+
width?: ContainerWidth;
|
|
17
|
+
clockSize?: ClockProps['clockSize'];
|
|
18
|
+
clockWeight?: ClockProps['clockWeight'];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let {
|
|
22
|
+
cities = [
|
|
23
|
+
{ name: 'Tehran', tzIdentifier: 'Asia/Tehran' },
|
|
24
|
+
{ name: 'Tel Aviv', tzIdentifier: 'Asia/Tel_Aviv' },
|
|
25
|
+
{ name: 'Washington D.C.', tzIdentifier: 'America/New_York' },
|
|
26
|
+
],
|
|
27
|
+
width = 'normal',
|
|
28
|
+
clockSize = 'XS',
|
|
29
|
+
clockWeight = 'Bold',
|
|
30
|
+
}: Props = $props();
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<Block {width} class="my-6">
|
|
34
|
+
<div id="clock-group">
|
|
35
|
+
{#each cities as city (city.tzIdentifier)}
|
|
36
|
+
<Clock
|
|
37
|
+
name={city.name}
|
|
38
|
+
tzIdentifier={city.tzIdentifier}
|
|
39
|
+
{clockSize}
|
|
40
|
+
{clockWeight}
|
|
41
|
+
/>
|
|
42
|
+
{/each}
|
|
43
|
+
</div>
|
|
44
|
+
</Block>
|
|
45
|
+
|
|
46
|
+
<style>/* Generated from
|
|
47
|
+
https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12
|
|
48
|
+
*/
|
|
49
|
+
/* Generated from
|
|
50
|
+
https://utopia.fyi/space/calculator/?c=320,18,1.125,1280,21,1.25,7,3,&s=0.75|0.5|0.25,1.5|2|3|4|6,s-l&g=s,l,xl,12
|
|
51
|
+
*/
|
|
52
|
+
/* Scales by 1.125 */
|
|
53
|
+
div#clock-group {
|
|
54
|
+
width: 100%;
|
|
55
|
+
margin: 0px auto;
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-wrap: wrap;
|
|
58
|
+
gap: 10px 1rem;
|
|
59
|
+
justify-content: space-around;
|
|
60
|
+
}
|
|
61
|
+
@media (max-width: 659px) {
|
|
62
|
+
div#clock-group {
|
|
63
|
+
justify-content: center;
|
|
64
|
+
}
|
|
65
|
+
}</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps } from 'svelte';
|
|
2
|
+
import type { ContainerWidth } from '../@types/global';
|
|
3
|
+
import Clock from './Clock.svelte';
|
|
4
|
+
type ClockProps = ComponentProps<typeof Clock>;
|
|
5
|
+
interface City {
|
|
6
|
+
name: string;
|
|
7
|
+
tzIdentifier: string;
|
|
8
|
+
}
|
|
9
|
+
interface Props {
|
|
10
|
+
cities?: City[];
|
|
11
|
+
width?: ContainerWidth;
|
|
12
|
+
clockSize?: ClockProps['clockSize'];
|
|
13
|
+
clockWeight?: ClockProps['clockWeight'];
|
|
14
|
+
}
|
|
15
|
+
declare const ClockWall: import("svelte").Component<Props, {}, "">;
|
|
16
|
+
type ClockWall = ReturnType<typeof ClockWall>;
|
|
17
|
+
export default ClockWall;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<!-- @component `ReutersLogo` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-logos-reuterslogo--docs) -->
|
|
2
|
+
<script lang="ts">
|
|
3
|
+
interface Props {
|
|
4
|
+
/** "Kinesis" colour */
|
|
5
|
+
colour?: string;
|
|
6
|
+
/** CSS width value */
|
|
7
|
+
width?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
let { colour = '#D64000', width = '100%' }: Props = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<svg
|
|
14
|
+
aria-hidden="true"
|
|
15
|
+
focusable="false"
|
|
16
|
+
viewBox="0 0 558.7 558.7"
|
|
17
|
+
style="width: {width}; --logoColour: {colour};"
|
|
18
|
+
>
|
|
19
|
+
<g id="Primary_Logo" data-name="Primary Logo">
|
|
20
|
+
<path
|
|
21
|
+
class="cls-1"
|
|
22
|
+
d="M483,75c7.1,7.1,11,16.6,11,26.7s-3.9,19.6-11,26.7c-14.7,14.7-38.6,14.7-53.3,0-7.1-7.1-11-16.6-11-26.7s3.9-19.6,11-26.7c7.4-7.4,17-11.1,26.7-11.1s19.3,3.7,26.7,11.1Z"
|
|
23
|
+
></path>
|
|
24
|
+
<path
|
|
25
|
+
class="cls-1"
|
|
26
|
+
d="M75.1,483.6c-14.7-14.7-14.7-38.7,0-53.4,7.1-7.1,16.6-11.1,26.7-11.1s19.6,3.9,26.7,11.1c14.7,14.7,14.7,38.7,0,53.4-7.1,7.1-16.6,11.1-26.7,11.1s-19.6-3.9-26.7-11.1Z"
|
|
27
|
+
></path>
|
|
28
|
+
<path
|
|
29
|
+
class="cls-1"
|
|
30
|
+
d="M362.6,77.9h-.3c-8-3.5-14.3-9.8-17.6-17.9-3.4-8.1-3.4-17.1,0-25.3,3.4-8.1,9.7-14.5,17.9-17.9,4.1-1.7,8.4-2.5,12.6-2.5s8.6.9,12.6,2.5c16.8,7,24.8,26.3,17.9,43.2-7,16.8-26.3,24.8-43.1,17.9h0Z"
|
|
31
|
+
></path>
|
|
32
|
+
<path
|
|
33
|
+
class="cls-1"
|
|
34
|
+
d="M183.1,478.3c4.3,0,8.5.9,12.6,2.5,16.8,7,24.8,26.3,17.9,43.2-3.4,8.2-9.7,14.5-17.9,17.9-8.1,3.4-17.1,3.4-25.3,0-16.8-7-24.8-26.3-17.9-43.2,3.4-8.1,9.7-14.5,17.9-17.9,4.1-1.7,8.4-2.5,12.6-2.5h0s0,0,0,0Z"
|
|
35
|
+
></path>
|
|
36
|
+
<path
|
|
37
|
+
class="cls-1"
|
|
38
|
+
d="M307.4,28.3c0,15.2-12,27.6-27,28.3h-1.3c-15.6,0-28.3-12.7-28.3-28.3S263.5,0,279.1,0s28.3,12.8,28.3,28.4h0s0,0,0,0Z"
|
|
39
|
+
></path>
|
|
40
|
+
<path
|
|
41
|
+
class="cls-1"
|
|
42
|
+
d="M250.8,530.4c0-15.6,12.7-28.3,28.3-28.3s28.3,12.7,28.3,28.3-12.7,28.3-28.3,28.3-28.3-12.7-28.3-28.3Z"
|
|
43
|
+
></path>
|
|
44
|
+
<path
|
|
45
|
+
class="cls-1"
|
|
46
|
+
d="M192.2,69.2c-5.8,2.4-12.2,2.4-18,0-5.9-2.4-10.4-7-12.8-12.8-5-12.1.7-25.9,12.8-30.9,2.9-1.2,6-1.8,9-1.8,9.3,0,18.1,5.5,21.8,14.6,2.4,5.9,2.4,12.3,0,18.1-2.4,5.9-6.9,10.4-12.8,12.8h0Z"
|
|
47
|
+
></path>
|
|
48
|
+
<path
|
|
49
|
+
class="cls-1"
|
|
50
|
+
d="M365.9,489.5c3-1.2,6-1.8,9.1-1.8s6.1.6,9,1.8c5.9,2.4,10.4,7,12.8,12.8,2.4,5.9,2.4,12.3,0,18.1-2.4,5.9-6.9,10.4-12.8,12.8-5.9,2.4-12.2,2.4-18.1,0-5.9-2.4-10.4-6.9-12.8-12.8-2.4-5.9-2.4-12.2,0-18.1,2.4-5.8,6.9-10.4,12.8-12.8h0Z"
|
|
51
|
+
></path>
|
|
52
|
+
<path
|
|
53
|
+
class="cls-1"
|
|
54
|
+
d="M115.1,88.6c7.2,7.3,7.4,18.9.4,26.4l-.4.4c-7.4,7.4-19.4,7.4-26.7,0-7.4-7.4-7.4-19.4,0-26.8,3.7-3.7,8.5-5.5,13.4-5.5s9.7,1.8,13.4,5.5h0,0Z"
|
|
55
|
+
></path>
|
|
56
|
+
<path
|
|
57
|
+
class="cls-1"
|
|
58
|
+
d="M442.8,443.5c3.6-3.7,8.5-5.5,13.3-5.5s9.7,1.8,13.4,5.5c3.6,3.5,5.5,8.3,5.5,13.4s-2,9.8-5.5,13.4c-7.4,7.4-19.3,7.4-26.7,0-3.6-3.6-5.5-8.4-5.5-13.4s2-9.8,5.5-13.4h0Z"
|
|
59
|
+
></path>
|
|
60
|
+
<path
|
|
61
|
+
class="cls-1"
|
|
62
|
+
d="M38.4,205.1c-12-5-17.8-18.8-12.8-30.9,2.4-5.9,6.9-10.4,12.8-12.8,3-1.2,6-1.8,9.1-1.8s6.1.6,9,1.8c12,5,17.7,18.8,12.8,30.9-2.4,5.9-6.9,10.4-12.8,12.8-5.9,2.4-12.3,2.4-18,0h0Z"
|
|
63
|
+
></path>
|
|
64
|
+
<path
|
|
65
|
+
class="cls-1"
|
|
66
|
+
d="M519.8,353.7c5.8,2.4,10.4,6.9,12.8,12.8,2.4,5.9,2.4,12.2,0,18.1-5,12-18.8,17.8-30.8,12.8-5.9-2.4-10.4-6.9-12.8-12.8-2.4-5.9-2.4-12.2,0-18.1,3.8-9.1,12.6-14.6,21.8-14.6s6,.6,9,1.8h0Z"
|
|
67
|
+
></path>
|
|
68
|
+
<path
|
|
69
|
+
class="cls-1"
|
|
70
|
+
d="M0,279.5c0-15.6,12.7-28.3,28.3-28.3s28.3,12.7,28.3,28.3-12.7,28.3-28.3,28.3S0,295.1,0,279.5Z"
|
|
71
|
+
></path>
|
|
72
|
+
<path
|
|
73
|
+
class="cls-1"
|
|
74
|
+
d="M501.6,279.5c0-15.6,12.7-28.3,28.3-28.3s28.3,12.7,28.3,28.3-12.7,28.3-28.3,28.3-28.3-12.7-28.3-28.3Z"
|
|
75
|
+
></path>
|
|
76
|
+
<path
|
|
77
|
+
class="cls-1"
|
|
78
|
+
d="M16.8,388.1c-7-16.9,1-36.2,17.9-43.2,8.1-3.4,17.1-3.4,25.3,0,8.1,3.4,14.5,9.7,17.9,17.9s3.4,17.1,0,25.3c-3.4,8.1-9.7,14.5-17.9,17.9s-17.1,3.4-25.3,0c-8.1-3.4-14.5-9.7-17.9-17.9Z"
|
|
79
|
+
></path>
|
|
80
|
+
<path
|
|
81
|
+
class="cls-1"
|
|
82
|
+
d="M480.1,195.9c-3.4-8.1-3.4-17.1,0-25.2,3.4-8.1,9.7-14.5,17.9-17.9,4.1-1.7,8.4-2.5,12.6-2.5,13,0,25.3,7.7,30.5,20.4,7,16.9-1,36.2-17.9,43.2-8.1,3.4-17.1,3.4-25.3,0-8.1-3.4-14.5-9.7-17.9-17.9h0,0Z"
|
|
83
|
+
></path>
|
|
84
|
+
<path
|
|
85
|
+
class="cls-1"
|
|
86
|
+
d="M359.3,359.7c-10.4,10.3-10.4,27.2,0,37.5,10.4,10.4,27.1,10.4,37.5,0,5-5,7.8-11.6,7.8-18.7s-2.8-13.8-7.8-18.7c-5.2-5.2-11.9-7.7-18.7-7.7s-13.6,2.6-18.8,7.7h0Z"
|
|
87
|
+
></path>
|
|
88
|
+
<path
|
|
89
|
+
class="cls-1"
|
|
90
|
+
d="M138.3,263.3c-11.2-3-17.8-14.5-14.8-25.7,1.5-5.4,4.9-9.9,9.8-12.8,3.2-1.9,6.8-2.8,10.4-2.8s3.6.2,5.4.7c5.4,1.5,9.9,4.9,12.7,9.8s3.5,10.5,2.1,16c-3,11.2-14.5,17.9-25.7,14.9h0,0Z"
|
|
91
|
+
></path>
|
|
92
|
+
<path
|
|
93
|
+
class="cls-1"
|
|
94
|
+
d="M408.9,335.9c-5.4-1.5-9.9-4.9-12.7-9.8s-3.5-10.5-2.1-16c1.5-5.4,4.9-10,9.8-12.8,3.2-1.9,6.9-2.8,10.5-2.8s3,.1,4.5.5l1,.3c11.2,3,17.8,14.6,14.8,25.7-1.5,5.4-4.9,10-9.8,12.8-4.9,2.8-10.5,3.6-16,2.1h0s0,0,0,0Z"
|
|
95
|
+
></path>
|
|
96
|
+
<path
|
|
97
|
+
class="cls-1"
|
|
98
|
+
d="M127.6,320c-2.3-8.7,2.5-17.5,10.9-20.4l1-.3c8.9-2.4,18.2,3,20.6,11.9,1.2,4.4.6,8.9-1.7,12.8-2.2,3.9-5.9,6.7-10.2,7.9-4.4,1.2-8.8.6-12.8-1.7-3.9-2.2-6.7-5.9-7.8-10.2h0s0,0,0,0Z"
|
|
99
|
+
></path>
|
|
100
|
+
<path
|
|
101
|
+
class="cls-1"
|
|
102
|
+
d="M405.9,257.8l-.7-.4c-3.5-2.3-6-5.7-7.1-9.8-2.4-9,2.9-18.2,11.9-20.6,8.9-2.4,18.2,2.9,20.6,11.9,2.4,9-2.9,18.2-11.9,20.6-4.3,1.2-8.8.5-12.8-1.7h0Z"
|
|
103
|
+
></path>
|
|
104
|
+
<path
|
|
105
|
+
class="cls-1"
|
|
106
|
+
d="M189.4,386.7l-.5.5c-4.9,4.9-13,4.9-17.9,0-4.9-4.9-4.9-12.9,0-17.9s13-4.9,17.9,0c2.4,2.4,3.7,5.6,3.7,9s-1.1,6.1-3.2,8.4Z"
|
|
107
|
+
></path>
|
|
108
|
+
<path
|
|
109
|
+
class="cls-1"
|
|
110
|
+
d="M386.9,171.2c2.4,2.4,3.7,5.6,3.7,9s-1.3,6.6-3.7,9c-4.9,4.9-13,4.9-17.9,0-2.4-2.4-3.7-5.6-3.7-9s1.3-6.6,3.7-9c2.4-2.4,5.6-3.7,9-3.7s6.6,1.3,9,3.7h0s0,0,0,0Z"
|
|
111
|
+
></path>
|
|
112
|
+
<path
|
|
113
|
+
class="cls-1"
|
|
114
|
+
d="M257.3,406.3c2.2,3.9,2.8,8.4,1.7,12.8-1.2,4.4-3.9,8-7.8,10.2s-8.4,2.8-12.8,1.7c-8.9-2.4-14.3-11.6-11.9-20.6,1.2-4.4,3.9-8,7.8-10.2,3.9-2.2,8.4-2.8,12.8-1.7,4.4,1.2,7.9,4,10.2,7.9h0s0,0,0,0Z"
|
|
115
|
+
></path>
|
|
116
|
+
<path
|
|
117
|
+
class="cls-1"
|
|
118
|
+
d="M300.6,152.5c-2.2-3.9-2.8-8.4-1.7-12.8,1.2-4.4,3.9-8,7.8-10.2,2.6-1.5,5.5-2.2,8.4-2.2s2.9.2,4.4.6c4.4,1.2,8,3.9,10.2,7.9,2.2,3.9,2.8,8.4,1.7,12.8-2.4,9-11.6,14.3-20.6,11.9-4.4-1.2-8-3.9-10.2-7.9h0Z"
|
|
119
|
+
></path>
|
|
120
|
+
<path
|
|
121
|
+
class="cls-1"
|
|
122
|
+
d="M325.9,396.6l.9.5c4.4,2.8,7.5,7.1,8.9,12.2,3,11.2-3.6,22.8-14.8,25.7-5.5,1.5-11.1.7-16-2.1-4.9-2.8-8.3-7.3-9.8-12.8-1.5-5.4-.7-11.1,2.1-16,2.8-4.9,7.3-8.3,12.7-9.8,1.8-.5,3.7-.7,5.5-.7,3.6,0,7.2,1,10.5,2.8h0Z"
|
|
123
|
+
></path>
|
|
124
|
+
<path
|
|
125
|
+
class="cls-1"
|
|
126
|
+
d="M248.2,164.3c-11.2,3-22.7-3.7-25.7-14.9-3-11.2,3.6-22.8,14.8-25.7,1.8-.5,3.6-.7,5.4-.7,9.3,0,17.8,6.2,20.3,15.6,3,11.2-3.6,22.8-14.8,25.7Z"
|
|
127
|
+
></path>
|
|
128
|
+
<path
|
|
129
|
+
class="cls-1"
|
|
130
|
+
d="M180,206.5c14.6,0,26.4-11.9,26.4-26.5s-11.8-26.5-26.4-26.5-26.4,11.9-26.4,26.5,11.8,26.5,26.4,26.5Z"
|
|
131
|
+
></path>
|
|
132
|
+
</g>
|
|
133
|
+
</svg>
|
|
134
|
+
|
|
135
|
+
<style>
|
|
136
|
+
.cls-1 {
|
|
137
|
+
fill: var(--logoColour);
|
|
138
|
+
stroke-width: 0px;
|
|
139
|
+
}
|
|
140
|
+
</style>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** "Kinesis" colour */
|
|
3
|
+
colour?: string;
|
|
4
|
+
/** CSS width value */
|
|
5
|
+
width?: string;
|
|
6
|
+
}
|
|
7
|
+
/** `ReutersLogo` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-logos-reuterslogo--docs) */
|
|
8
|
+
declare const KinesisLogo: import("svelte").Component<Props, {}, "">;
|
|
9
|
+
type KinesisLogo = ReturnType<typeof KinesisLogo>;
|
|
10
|
+
export default KinesisLogo;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,9 +3,12 @@ export { default as resizeObserver } from './actions/resizeObserver/index';
|
|
|
3
3
|
export { prettifyDate } from './utils/index';
|
|
4
4
|
export { default as Analytics, registerPageview, } from './components/Analytics/Analytics.svelte';
|
|
5
5
|
export { default as Article } from './components/Article/Article.svelte';
|
|
6
|
+
export { default as BlogPost } from './components/BlogPost/BlogPost.svelte';
|
|
7
|
+
export { default as BlogTOC } from './components/BlogTOC/BlogTOC.svelte';
|
|
6
8
|
export { default as AdScripts } from './components/AdSlot/AdScripts.svelte';
|
|
7
9
|
export { default as BeforeAfter } from './components/BeforeAfter/BeforeAfter.svelte';
|
|
8
10
|
export { default as Block } from './components/Block/Block.svelte';
|
|
11
|
+
export { default as ClockWall } from './components/ClockWall/ClockWall.svelte';
|
|
9
12
|
export { default as BodyText } from './components/BodyText/BodyText.svelte';
|
|
10
13
|
export { default as Byline } from './components/Byline/Byline.svelte';
|
|
11
14
|
export { default as DatawrapperChart } from './components/DatawrapperChart/DatawrapperChart.svelte';
|
|
@@ -21,6 +24,7 @@ export { default as HorizontalScroller } from './components/HorizontalScroller/H
|
|
|
21
24
|
export { default as EndNotes } from './components/EndNotes/EndNotes.svelte';
|
|
22
25
|
export { default as InfoBox } from './components/InfoBox/InfoBox.svelte';
|
|
23
26
|
export { default as InlineAd } from './components/AdSlot/InlineAd.svelte';
|
|
27
|
+
export { default as KinesisLogo } from './components/KinesisLogo/KinesisLogo.svelte';
|
|
24
28
|
export { default as LeaderboardAd } from './components/AdSlot/LeaderboardAd.svelte';
|
|
25
29
|
export { default as TileMap } from './components/TileMap/TileMap.svelte';
|
|
26
30
|
export { default as TileMapLayer } from './components/TileMap/TileMapLayer.svelte';
|
package/dist/index.js
CHANGED
|
@@ -6,9 +6,12 @@ export { prettifyDate } from './utils/index';
|
|
|
6
6
|
// Components
|
|
7
7
|
export { default as Analytics, registerPageview, } from './components/Analytics/Analytics.svelte';
|
|
8
8
|
export { default as Article } from './components/Article/Article.svelte';
|
|
9
|
+
export { default as BlogPost } from './components/BlogPost/BlogPost.svelte';
|
|
10
|
+
export { default as BlogTOC } from './components/BlogTOC/BlogTOC.svelte';
|
|
9
11
|
export { default as AdScripts } from './components/AdSlot/AdScripts.svelte';
|
|
10
12
|
export { default as BeforeAfter } from './components/BeforeAfter/BeforeAfter.svelte';
|
|
11
13
|
export { default as Block } from './components/Block/Block.svelte';
|
|
14
|
+
export { default as ClockWall } from './components/ClockWall/ClockWall.svelte';
|
|
12
15
|
export { default as BodyText } from './components/BodyText/BodyText.svelte';
|
|
13
16
|
export { default as Byline } from './components/Byline/Byline.svelte';
|
|
14
17
|
export { default as DatawrapperChart } from './components/DatawrapperChart/DatawrapperChart.svelte';
|
|
@@ -24,6 +27,7 @@ export { default as HorizontalScroller } from './components/HorizontalScroller/H
|
|
|
24
27
|
export { default as EndNotes } from './components/EndNotes/EndNotes.svelte';
|
|
25
28
|
export { default as InfoBox } from './components/InfoBox/InfoBox.svelte';
|
|
26
29
|
export { default as InlineAd } from './components/AdSlot/InlineAd.svelte';
|
|
30
|
+
export { default as KinesisLogo } from './components/KinesisLogo/KinesisLogo.svelte';
|
|
27
31
|
export { default as LeaderboardAd } from './components/AdSlot/LeaderboardAd.svelte';
|
|
28
32
|
export { default as TileMap } from './components/TileMap/TileMap.svelte';
|
|
29
33
|
export { default as TileMapLayer } from './components/TileMap/TileMapLayer.svelte';
|
package/dist/journalize.d.ts
CHANGED
|
@@ -16,4 +16,13 @@ declare module 'journalize' {
|
|
|
16
16
|
* @returns The converted value
|
|
17
17
|
*/
|
|
18
18
|
export function intcomma(val: number | string): string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Returns an AP-formatted month string that corresponds with the supplied
|
|
22
|
+
* Date. If an `input` is not passed, it will use the result of `new Date();`.
|
|
23
|
+
*
|
|
24
|
+
* @param date - The supplied Date
|
|
25
|
+
* @returns The converted date as a string
|
|
26
|
+
*/
|
|
27
|
+
export function apmonth(date?: Date): string;
|
|
19
28
|
}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -24,3 +24,10 @@ export declare const getAuthorPageUrl: (author: string) => string;
|
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
26
|
export declare const prettifyDate: (input: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Converts a string into a URL-friendly slug.
|
|
29
|
+
*
|
|
30
|
+
* @param str The string to be slugified.
|
|
31
|
+
* @returns The slugified string.
|
|
32
|
+
*/
|
|
33
|
+
export declare const slugify: (str: string) => string;
|
package/dist/utils/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import slug from 'slugify';
|
|
2
2
|
/** Helper function to generate a random 4-character string */
|
|
3
3
|
export const random4 = () => Math.floor((1 + Math.random()) * 0x10000)
|
|
4
4
|
.toString(16)
|
|
@@ -7,7 +7,7 @@ export const random4 = () => Math.floor((1 + Math.random()) * 0x10000)
|
|
|
7
7
|
* Custom function that returns an author page URL.
|
|
8
8
|
*/
|
|
9
9
|
export const getAuthorPageUrl = (author) => {
|
|
10
|
-
const authorSlug =
|
|
10
|
+
const authorSlug = slug(author.trim(), { lower: true });
|
|
11
11
|
return `https://www.reuters.com/authors/${authorSlug}/`;
|
|
12
12
|
};
|
|
13
13
|
/** Formats a string containing a full or 3-letter abbreviated month, AM/PM, and am/pm to match the Reuters style.
|
|
@@ -79,3 +79,10 @@ const prettifyAmPm = (text) => {
|
|
|
79
79
|
return `${digit} ${formattedDesignator}`;
|
|
80
80
|
});
|
|
81
81
|
};
|
|
82
|
+
/**
|
|
83
|
+
* Converts a string into a URL-friendly slug.
|
|
84
|
+
*
|
|
85
|
+
* @param str The string to be slugified.
|
|
86
|
+
* @returns The slugified string.
|
|
87
|
+
*/
|
|
88
|
+
export const slugify = (str) => slug(str, { lower: true, strict: true });
|