@reuters-graphics/graphics-components 0.0.1-beta.12 → 0.0.1-beta.15
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.
|
@@ -2,15 +2,16 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
/**
|
|
5
|
-
* [
|
|
5
|
+
* Base url for the page, which in [Vite-based projects](https://vitejs.dev/guide/build.html#public-base-path)
|
|
6
|
+
* is globally available as `import.meta.env.BASE_URL`.
|
|
6
7
|
* @required
|
|
7
8
|
* @type {string}
|
|
8
|
-
*/
|
|
9
|
+
*/ baseUrl?: string;
|
|
9
10
|
/**
|
|
10
11
|
* [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object for the page.
|
|
11
12
|
* @required
|
|
12
13
|
* @type {URL}
|
|
13
|
-
*/
|
|
14
|
+
*/ pageUrl?: URL | null;
|
|
14
15
|
/**
|
|
15
16
|
* SEO title
|
|
16
17
|
* @required
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
<script>import analytics from './analytics';
|
|
2
2
|
import publisherTags from './publisherTags';
|
|
3
3
|
/**
|
|
4
|
-
* [
|
|
4
|
+
* Base url for the page, which in [Vite-based projects](https://vitejs.dev/guide/build.html#public-base-path)
|
|
5
|
+
* is globally available as `import.meta.env.BASE_URL`.
|
|
5
6
|
* @required
|
|
6
7
|
* @type {string}
|
|
7
8
|
*/
|
|
8
|
-
export let
|
|
9
|
+
export let baseUrl = '';
|
|
9
10
|
/**
|
|
10
11
|
* [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object for the page.
|
|
11
12
|
* @required
|
|
12
13
|
* @type {URL}
|
|
13
14
|
*/
|
|
14
|
-
export let
|
|
15
|
+
export let pageUrl = null;
|
|
15
16
|
/**
|
|
16
17
|
* SEO title
|
|
17
18
|
* @required
|
|
@@ -65,7 +66,16 @@ export let authors = [];
|
|
|
65
66
|
* Whether to inject Google Analytics code for this page.
|
|
66
67
|
*/
|
|
67
68
|
export let includeAnalytics = false;
|
|
68
|
-
|
|
69
|
+
const getOrigin = (baseUrl) => {
|
|
70
|
+
try {
|
|
71
|
+
return new URL(baseUrl).origin;
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return '';
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
$: origin = getOrigin(baseUrl);
|
|
78
|
+
$: canonicalUrl = origin + pageUrl.pathname;
|
|
69
79
|
// Only fire analytics on prod sites
|
|
70
80
|
if (typeof window !== 'undefined' && includeAnalytics) {
|
|
71
81
|
analytics(canonicalUrl, seoTitle);
|
|
@@ -5,8 +5,8 @@ export default {
|
|
|
5
5
|
'text-primary': '#ffffff',
|
|
6
6
|
'text-secondary': 'rgb(255 255 255 / 60%)',
|
|
7
7
|
accent: ' #ef3c2a',
|
|
8
|
-
'brand-logo': '#
|
|
9
|
-
'brand-rules': '
|
|
8
|
+
'brand-logo': '#ffffff',
|
|
9
|
+
'brand-rules': 'rgb(255 255 255 / 25%)',
|
|
10
10
|
'brand-shadow': 'rgb(255 255 255 / 10%)',
|
|
11
11
|
},
|
|
12
12
|
font: {
|