@reuters-graphics/graphics-components 1.1.1 → 1.1.3
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/AdSlot/AdSlot.svelte +6 -0
- package/dist/components/AdSlot/LeaderboardAd.svelte +1 -1
- package/dist/components/AdSlot/adScripts/bootstrap.js +14 -0
- package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte +1 -11
- package/dist/components/SiteHeader/NavBar/NavDropdown/StoryCard/index.svelte.d.ts +0 -2
- package/dist/components/SiteHeader/NavBar/NavDropdown/index.svelte +1 -4
- package/dist/docs/styles/intro.mdx +1 -1
- package/package.json +1 -1
|
@@ -45,6 +45,20 @@ export const loadBootstrap = () => {
|
|
|
45
45
|
// @ts-ignore window global
|
|
46
46
|
window.googletag.pubads().enableAsyncRendering();
|
|
47
47
|
window.googletag.pubads().collapseEmptyDivs(true);
|
|
48
|
+
window.googletag
|
|
49
|
+
.pubads()
|
|
50
|
+
.addEventListener('slotRenderEnded', function (event) {
|
|
51
|
+
const adDiv = document.getElementById(event.slot.getSlotElementId());
|
|
52
|
+
if (!adDiv)
|
|
53
|
+
return;
|
|
54
|
+
// If the ad slot is empty
|
|
55
|
+
if (event.isEmpty) {
|
|
56
|
+
adDiv.classList.add('unfulfilled-ad');
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
adDiv.classList.remove('unfulfilled-ad');
|
|
60
|
+
}
|
|
61
|
+
});
|
|
48
62
|
});
|
|
49
63
|
// Set page-level key-values
|
|
50
64
|
// cf: https://help.freestar.com/help/using-key-values
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { getTime } from './time';
|
|
4
4
|
|
|
5
5
|
export let story;
|
|
6
|
-
export let withSection = false;
|
|
7
6
|
|
|
8
7
|
$: thumbnail = story.thumbnail;
|
|
9
8
|
</script>
|
|
@@ -11,17 +10,8 @@
|
|
|
11
10
|
<div class="story-card">
|
|
12
11
|
<a href="{normalizeUrl(story.canonical_url)}">
|
|
13
12
|
<div class="story-text" class:has-thumbnail="{thumbnail}">
|
|
14
|
-
{#if withSection}
|
|
15
|
-
<a href="{normalizeUrl(story.primary_section.id)}">
|
|
16
|
-
<span class="label">{story.primary_section.name}</span>
|
|
17
|
-
</a>
|
|
18
|
-
{/if}
|
|
19
13
|
<span>{story.title}</span>
|
|
20
|
-
{
|
|
21
|
-
<time datetime="{story.display_time}"
|
|
22
|
-
>{getTime(story.display_time)}</time
|
|
23
|
-
>
|
|
24
|
-
{/if}
|
|
14
|
+
<time datetime="{story.display_time}">{getTime(story.display_time)}</time>
|
|
25
15
|
</div>
|
|
26
16
|
{#if thumbnail}
|
|
27
17
|
<div class="thumbnail">
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} IndexSlots */
|
|
4
4
|
export default class Index extends SvelteComponent<{
|
|
5
5
|
story: any;
|
|
6
|
-
withSection?: boolean | undefined;
|
|
7
6
|
}, {
|
|
8
7
|
[evt: string]: CustomEvent<any>;
|
|
9
8
|
}, {}> {
|
|
@@ -15,7 +14,6 @@ import { SvelteComponent } from "svelte";
|
|
|
15
14
|
declare const __propDef: {
|
|
16
15
|
props: {
|
|
17
16
|
story: any;
|
|
18
|
-
withSection?: boolean | undefined;
|
|
19
17
|
};
|
|
20
18
|
events: {
|
|
21
19
|
[evt: string]: CustomEvent<any>;
|
|
@@ -18,6 +18,6 @@ Import the SCSS directly in your top-level component. (This is done for you in t
|
|
|
18
18
|
<script>
|
|
19
19
|
// other imports and stuffs ...
|
|
20
20
|
|
|
21
|
-
import '@reuters-graphics/graphics-components/scss/main';
|
|
21
|
+
import '@reuters-graphics/graphics-components/scss/main.scss';
|
|
22
22
|
</script>
|
|
23
23
|
```
|