diff --git a/package.json b/package.json index 7f153fc7..297457b4 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "bootstrap": "^5.2.0", "classnames": "^2.3.1", "dayjs": "^1.11.3", + "journalize": "^2.5.1", "lodash-es": "^4.17.21", "lottie-web": "^5.7.13", "marked": "^4.0.8", @@ -214,4 +215,4 @@ ".": "./dist/index.js" }, "svelte": "./dist/index.js" -} \ No newline at end of file +} diff --git a/src/components/HeadlineBreakingNews/HeadlineBreakingNews.svelte b/src/components/HeadlineBreakingNews/HeadlineBreakingNews.svelte new file mode 100644 index 00000000..6869e28b --- /dev/null +++ b/src/components/HeadlineBreakingNews/HeadlineBreakingNews.svelte @@ -0,0 +1,153 @@ + + + +
+
+ {#if section} +

+ {#if sectionUrl} + {section} + {:else} + {section} + {/if} +

+ {/if} + {#if hed} +

{@html marked.parseInline(hed)}

+ {/if} +
+ {#if $$slots.byline || $$slots.dateline} + + {/if} +
+
+ + diff --git a/src/components/HeadlineBreakingNews/HeadlineNreakingNews.stories.svelte b/src/components/HeadlineBreakingNews/HeadlineNreakingNews.stories.svelte new file mode 100644 index 00000000..c1dff89a --- /dev/null +++ b/src/components/HeadlineBreakingNews/HeadlineNreakingNews.stories.svelte @@ -0,0 +1,93 @@ + + + + + + + + + + + + By Peppa Pig + + Published + + + + + + By {@html marked.parseInline(content.Byline)} +
+ Published + {#if content.Updated} +
Updated + + {/if} +
+
+
+ + diff --git a/src/components/HeadlineBreakingNews/stories/docs/component.md b/src/components/HeadlineBreakingNews/stories/docs/component.md new file mode 100644 index 00000000..6b70611c --- /dev/null +++ b/src/components/HeadlineBreakingNews/stories/docs/component.md @@ -0,0 +1,12 @@ +Reuters Graphics headline for breaking news pages + +This is a simplified version of the `Headline` component. It doesn't allow for the addition of crown, the dek is removed, and the styles are +simplified. It is meant to serve as a unifying style for quick turnaround pages. + +```svelte + + + +``` diff --git a/src/components/HeadlineBreakingNews/stories/docs/quickit.md b/src/components/HeadlineBreakingNews/stories/docs/quickit.md new file mode 100644 index 00000000..1c60d0a0 --- /dev/null +++ b/src/components/HeadlineBreakingNews/stories/docs/quickit.md @@ -0,0 +1,47 @@ +Setup your Google Doc to work with the `HeadlineBreakingNews` component. + +```yaml +# Beginning of your Google doc +Kicker: Global News +KickerUrl: +Hed: A beautiful page +Byline: Sherlock Holmes +Published: 2022-09-12T08:30:00.000Z +Updated: +MarginBottom: 2rem +``` + +Note that this works in exactly the same way as the `Headline` component, but for the extra prop of `KickerUrl` which you need to add if +you don't want your kicker to be a link to Reuters Graphics. You can also additionally have a `MarginBottom` prop. + +```svelte + + + + + By {@html marked.parseInline(content.Byline)} +
+ Published + {#if content.Updated} +
Updated + + {/if} +
+
+``` diff --git a/src/components/HeadlineBreakingNews/stories/docs/withByline.md b/src/components/HeadlineBreakingNews/stories/docs/withByline.md new file mode 100644 index 00000000..1d25c4dc --- /dev/null +++ b/src/components/HeadlineBreakingNews/stories/docs/withByline.md @@ -0,0 +1,20 @@ +Add a byline and dateline with `byline` and `dateline` named slots. +If you don't want to display 'Global Graphics' with a link to graphics.reuters.com at the top, you can +replace with a section title using the `section` prop and leaving the `sectionUrl` blank. + +```svelte + + + + + By Peppa Pig + + Published Jan. 1, 2020 + +``` diff --git a/yarn.lock b/yarn.lock index 44bbb63a..ef3cfe67 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7748,6 +7748,11 @@ jest-worker@^27.4.5: merge-stream "^2.0.0" supports-color "^8.0.0" +journalize@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/journalize/-/journalize-2.5.1.tgz#d9c70452566e2b40f99b02b0263281c493c8c9b0" + integrity sha512-ha19m4ZiRitEsdMuwk0QMyjqTVicsJUJxz9TNkWBFJHIKAgEmXBJ8A6XR/GM1oW9fpRoGCBNLYej5U7ZdnDBMg== + js-string-escape@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/js-string-escape/-/js-string-escape-1.0.1.tgz#e2625badbc0d67c7533e9edc1068c587ae4137ef"