@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
- * [URL origin](https://developer.mozilla.org/en-US/docs/Web/API/URL/origin) for the page.
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
- */ origin?: string;
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
- */ url?: URL | null;
14
+ */ pageUrl?: URL | null;
14
15
  /**
15
16
  * SEO title
16
17
  * @required
@@ -8,7 +8,7 @@ import { marked } from 'marked';
8
8
  import Block from '../Block/Block.svelte';
9
9
  </script>
10
10
 
11
- <Block cls="notes mb-4">
11
+ <Block cls="notes mb-6">
12
12
  {#if text}
13
13
  {@html marked.parse(text)}
14
14
  {/if}
@@ -1,17 +1,18 @@
1
1
  <script>import analytics from './analytics';
2
2
  import publisherTags from './publisherTags';
3
3
  /**
4
- * [URL origin](https://developer.mozilla.org/en-US/docs/Web/API/URL/origin) for the page.
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 origin = '';
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 url = null;
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
- $: canonicalUrl = origin + url.pathname;
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': '#fa6400',
9
- 'brand-rules': '#999999',
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reuters-graphics/graphics-components",
3
- "version": "0.0.1-beta.12",
3
+ "version": "0.0.1-beta.15",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://reuters-graphics.github.io/graphics-components",