@reuters-graphics/graphics-components 1.1.5 → 1.1.7

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.
Files changed (23) hide show
  1. package/dist/components/Analytics/Analytics.svelte +4 -1
  2. package/dist/components/Analytics/providers/index.d.ts +1 -0
  3. package/dist/components/Analytics/providers/index.js +1 -0
  4. package/dist/components/Analytics/providers/parsely.d.ts +3 -0
  5. package/dist/components/Analytics/providers/parsely.js +29 -0
  6. package/dist/components/SEO/SEO.svelte +2 -2
  7. package/dist/components/Video/stories/videos/silent-video.mp4 +0 -0
  8. package/dist/components/Video/stories/videos/sound-video.mp4 +0 -0
  9. package/dist/docs/docs-components/CopyColourTable/ImportSnippet.d.ts +1 -2
  10. package/dist/docs/docs-components/CopyColourTable/Table.d.ts +1 -2
  11. package/dist/docs/docs-components/CopyTable/Table.d.ts +1 -2
  12. package/dist/docs/docs-components/MdxTheme/Theme.d.ts +1 -2
  13. package/dist/docs/docs-components/Mermaid/Mermaid.d.ts +1 -2
  14. package/dist/docs/docs-components/ThemeBuilder/CSSVariables/VariableTable.d.ts +1 -2
  15. package/dist/docs/docs-components/ThemeBuilder/Customiser/ColourPicker.d.ts +1 -2
  16. package/dist/docs/docs-components/ThemeBuilder/Customiser/Customiser.d.ts +1 -2
  17. package/dist/docs/docs-components/ThemeBuilder/Customiser/Key.d.ts +1 -2
  18. package/dist/docs/docs-components/ThemeBuilder/Customiser/Value.d.ts +1 -2
  19. package/dist/docs/docs-components/ThemeBuilder/NewTheme/NewTheme.d.ts +1 -2
  20. package/dist/docs/docs-components/ThemeBuilder/ThemeBuilder.d.ts +1 -2
  21. package/dist/docs/docs-components/ThemeBuilder/ThemeSwitch/Switch.d.ts +1 -2
  22. package/dist/globals.d.ts +8 -0
  23. package/package.json +13 -17
@@ -1,20 +1,23 @@
1
1
  <script context="module">
2
2
  import { registerPageview as registerChartbeatPageview } from './providers/chartbeat';
3
3
  import { registerPageview as registerGAPageview } from './providers/ga';
4
+ import { registerPageview as registerParselyPageview } from './providers/parsely';
4
5
 
5
6
  /** Register virtual pageviews when using client-side routing in multipage applications. */
6
7
  export function registerPageview() {
7
8
  registerChartbeatPageview();
8
9
  registerGAPageview();
10
+ registerParselyPageview();
9
11
  }
10
12
  </script>
11
13
 
12
14
  <!-- @component `Analytics` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-Analytics--default) -->
13
15
  <script>export let authors = [];
14
16
  import { onMount } from "svelte";
15
- import { ga, chartbeat } from "./providers";
17
+ import { ga, chartbeat, parsely } from "./providers";
16
18
  onMount(() => {
17
19
  ga();
18
20
  chartbeat(authors);
21
+ parsely();
19
22
  });
20
23
  </script>
@@ -1,2 +1,3 @@
1
1
  export { default as ga } from './ga';
2
2
  export { default as chartbeat } from './chartbeat';
3
+ export { default as parsely } from './parsely';
@@ -1,2 +1,3 @@
1
1
  export { default as ga } from './ga';
2
2
  export { default as chartbeat } from './chartbeat';
3
+ export { default as parsely } from './parsely';
@@ -0,0 +1,3 @@
1
+ declare const _default: () => void;
2
+ export default _default;
3
+ export declare const registerPageview: () => void;
@@ -0,0 +1,29 @@
1
+ const SITE_ID = 'reuters.com';
2
+ const attachScript = () => {
3
+ const b = document.body;
4
+ const e = document.createElement('script');
5
+ e.id = 'parsely-cfg';
6
+ e.src = `//cdn.parsely.com/keys/${SITE_ID}/p.js`;
7
+ e.setAttribute('async', '');
8
+ e.setAttribute('defer', '');
9
+ b.appendChild(e);
10
+ };
11
+ export default () => {
12
+ window.PARSELY = window.PARSELY || {
13
+ autotrack: false,
14
+ onReady() {
15
+ window.PARSELY.updateDefaults({
16
+ data: {
17
+ is_logged_in: false,
18
+ },
19
+ });
20
+ window.PARSELY.beacon.trackPageView();
21
+ },
22
+ };
23
+ attachScript();
24
+ };
25
+ export const registerPageview = () => {
26
+ if (typeof window === 'undefined' || !window.PARSELY)
27
+ return;
28
+ window.PARSELY.beacon.trackPageView();
29
+ };
@@ -19,7 +19,7 @@ const getOrigin = (baseUrl2) => {
19
19
  }
20
20
  };
21
21
  $: origin = getOrigin(baseUrl);
22
- $: canonicalUrl = (origin + pageUrl.pathname).replace(/index\.html\/$/, "");
22
+ $: canonicalUrl = (origin + pageUrl?.pathname).replace(/index\.html\/$/, "");
23
23
  const orgLdJson = {
24
24
  "@context": "http://schema.org",
25
25
  "@type": "NewsMediaOrganization",
@@ -62,9 +62,9 @@ $: articleLdJson = {
62
62
  name,
63
63
  url
64
64
  })),
65
+ creator: authors.map(({ name }) => name),
65
66
  articleSection: "Graphics",
66
67
  isAccessibleForFree: true,
67
- creator: ["Reuters Graphics"],
68
68
  keywords: ["Reuters graphics", "Reuters", "graphics", "Interactives"]
69
69
  };
70
70
  </script>
@@ -2,5 +2,4 @@ export default ImportSnippet;
2
2
  declare function ImportSnippet({ included, partial }: {
3
3
  included?: boolean | undefined;
4
4
  partial?: string | undefined;
5
- }): React.JSX.Element;
6
- import React from 'react';
5
+ }): JSX.Element;
@@ -6,5 +6,4 @@ declare function CopyTable({ title, body, copyable, mdnLink, included, partial,
6
6
  mdnLink?: null | undefined;
7
7
  included?: boolean | undefined;
8
8
  partial: any;
9
- }): React.JSX.Element;
10
- import React from 'react';
9
+ }): JSX.Element;
@@ -6,5 +6,4 @@ declare function CopyTable({ title, note, header, body, copyable, mdnLink, }: {
6
6
  body: any;
7
7
  copyable: any;
8
8
  mdnLink?: null | undefined;
9
- }): React.JSX.Element;
10
- import React from 'react';
9
+ }): JSX.Element;
@@ -1,3 +1,2 @@
1
1
  export default ThemeWrapper;
2
- declare function ThemeWrapper(props: any): React.JSX.Element;
3
- import React from 'react';
2
+ declare function ThemeWrapper(props: any): JSX.Element;
@@ -1,2 +1 @@
1
- export default function Mermaid(props: any): React.JSX.Element;
2
- import React from 'react';
1
+ export default function Mermaid(props: any): JSX.Element;
@@ -1,3 +1,2 @@
1
1
  export default VariableTable;
2
- declare function VariableTable(props: any): React.JSX.Element;
3
- import React from 'react';
2
+ declare function VariableTable(props: any): JSX.Element;
@@ -2,5 +2,4 @@ export default ColourPicker;
2
2
  declare function ColourPicker({ colour, onChange }: {
3
3
  colour: any;
4
4
  onChange: any;
5
- }): React.JSX.Element;
6
- import React from 'react';
5
+ }): JSX.Element;
@@ -3,5 +3,4 @@ declare function Customiser({ theme, themeName, setTheme }: {
3
3
  theme: any;
4
4
  themeName: any;
5
5
  setTheme: any;
6
- }): React.JSX.Element;
7
- import React from 'react';
6
+ }): JSX.Element;
@@ -6,5 +6,4 @@ declare function Key({ value, name, map, themeName, setTheme, theme }: {
6
6
  themeName: any;
7
7
  setTheme: any;
8
8
  theme: any;
9
- }): React.JSX.Element;
10
- import React from 'react';
9
+ }): JSX.Element;
@@ -6,5 +6,4 @@ declare function Value({ value, name, map, themeName, theme, setTheme }: {
6
6
  themeName: any;
7
7
  theme: any;
8
8
  setTheme: any;
9
- }): React.JSX.Element;
10
- import React from 'react';
9
+ }): JSX.Element;
@@ -2,5 +2,4 @@ export default NewTheme;
2
2
  declare function NewTheme({ theme, themeName }: {
3
3
  theme: any;
4
4
  themeName: any;
5
- }): React.JSX.Element;
6
- import React from 'react';
5
+ }): JSX.Element;
@@ -1,3 +1,2 @@
1
1
  export default ThemeBuilder;
2
- declare function ThemeBuilder(_props: any): React.JSX.Element;
3
- import React from 'react';
2
+ declare function ThemeBuilder(_props: any): JSX.Element;
@@ -2,5 +2,4 @@ export default ThemeSwitch;
2
2
  declare function ThemeSwitch({ themeName, setThemeName }: {
3
3
  themeName: any;
4
4
  setThemeName: any;
5
- }): React.JSX.Element;
6
- import React from 'react';
5
+ }): JSX.Element;
package/dist/globals.d.ts CHANGED
@@ -21,6 +21,14 @@ declare global {
21
21
  };
22
22
  /** Graphics ads */
23
23
  graphicsAdQueue: any[];
24
+ /** Parsely */
25
+ PARSELY: {
26
+ onLoad: () => void;
27
+ beacon: {
28
+ trackPageView: () => void;
29
+ };
30
+ updateDefaults: (params: any) => void;
31
+ };
24
32
  }
25
33
  }
26
34
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reuters-graphics/graphics-components",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "homepage": "https://reuters-graphics.github.io/graphics-components",
@@ -12,21 +12,6 @@
12
12
  "registry": "https://registry.npmjs.org/",
13
13
  "access": "public"
14
14
  },
15
- "scripts": {
16
- "start": "storybook dev -p 3000",
17
- "new": "node ./bin/newComponent/index.cjs",
18
- "lint": "eslint --fix",
19
- "lint:check": "eslint",
20
- "format": "prettier . --write",
21
- "format:check": "prettier . --check",
22
- "build:package": "rimraf ./dist && svelte-package -i ./src && publint",
23
- "build:chromatic": "storybook build -o docs",
24
- "build:docs": "storybook build -o docs && touch ./docs/.nojekyll",
25
- "build": "npm-run-all build:package build:docs",
26
- "changeset:version": "changeset version",
27
- "changeset:publish": "git add --all && changeset publish",
28
- "knip": "knip"
29
- },
30
15
  "license": "MIT",
31
16
  "files": [
32
17
  "dist"
@@ -133,5 +118,16 @@
133
118
  "types": "./dist/index.d.ts",
134
119
  "bugs": {
135
120
  "url": "https://github.com/reuters-graphics/graphics-components/issues"
121
+ },
122
+ "scripts": {
123
+ "start": "storybook dev -p 3000",
124
+ "new": "node ./bin/newComponent/index.cjs",
125
+ "lint": "eslint --fix",
126
+ "format": "prettier . --write",
127
+ "build": "rimraf ./dist && svelte-package -i ./src && publint",
128
+ "build:docs": "storybook build -o docs",
129
+ "changeset:version": "changeset version",
130
+ "changeset:publish": "git add --all && changeset publish",
131
+ "knip": "knip"
136
132
  }
137
- }
133
+ }