@guardian/ophan-tracker-js 2.1.2-next.3 → 2.1.2-next.5

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.
@@ -1,5 +1,5 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
- import transmit from './transmit';
2
+ import transmit from './transmit.js';
3
3
  import components from './components.js';
4
4
  // The upworthy definition of attention minutes, from
5
5
  // http://upworthy.github.io/2014/06/implementing-attention-minutes-part-1/ :
@@ -1,5 +1,5 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
- import transmit from './transmit';
2
+ import transmit from './transmit.js';
3
3
  import perf from './perf.js';
4
4
  const start = perf?.timing?.domComplete ?? performance.now();
5
5
  // DFP ads
@@ -1,5 +1,5 @@
1
1
  import ophan from './core.js';
2
- import transmit from './transmit';
2
+ import transmit from './transmit.js';
3
3
  /**
4
4
  * Finds the closest ancestor anchor (`<a>`) element of the given element.
5
5
  *
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  import attention from './attention.js';
5
5
  import visibility from './visibility.js';
6
6
  import './click-path-capture.js';
package/NPM-dist/core.js CHANGED
@@ -1,5 +1,5 @@
1
1
  let init, sendInitialEvent, storeDataToSendOnNextEvent, hasProp = {}.hasOwnProperty;
2
- import transmit from './transmit';
2
+ import transmit from './transmit.js';
3
3
  import visibility from './visibility.js';
4
4
  import adblockDetection from './adblock-detection.js';
5
5
  const VERSION = 17;
package/NPM-dist/embed.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  core.init('embed');
5
5
  export default {
6
6
  record: transmit.sendMore,
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  core.init('facebook-instant-article');
5
5
  export default {
6
6
  viewId: transmit.viewId,
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  core.init('holidays');
5
5
  export default {
6
6
  record: transmit.sendMore,
@@ -1,5 +1,5 @@
1
1
  import core from './core.js';
2
- import transmit from './transmit';
2
+ import transmit from './transmit.js';
3
3
  import attention from './attention.js';
4
4
  import './click-path-capture.js';
5
5
  if (window.guardian?.ophan) {
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  core.init('jobs-courses');
5
5
  export default {
6
6
  record: transmit.sendMore,
package/NPM-dist/jobs.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  core.init('jobs');
5
5
  export default {
6
6
  record: transmit.sendMore,
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  import attention from './attention.js';
5
5
  import visibility from './visibility.js';
6
6
  import './click-path-capture.js';
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  import attention from './attention.js';
5
5
  import visibility from './visibility.js';
6
6
  import './click-path-capture.js';
package/NPM-dist/ng.js CHANGED
@@ -1,25 +1,25 @@
1
- import core from './core';
2
- import transmit from './transmit';
3
- import attention from './attention';
4
- import visibility from './visibility';
5
- import privatebrowsing from './privatebrowsing';
6
- import heatmap from './heatmap';
7
- import './click-path-capture';
8
- import './perf';
9
- import './iframe-tracking';
10
- export * from './types/abtest';
11
- export * from './types/acquisition';
12
- export * from './types/subscription';
13
- export * from './types/interaction';
14
- export * from './types/inpageclick';
15
- export * from './types/printproduct';
16
- export * from './types/product';
17
- export * from './types/platform';
18
- export * from './types/media';
19
- export * from './types/consent';
20
- export * from './types/component-type';
21
- export * from './types/component-event';
22
- export * from './types/event';
1
+ import core from './core.js';
2
+ import transmit from './transmit.js';
3
+ import attention from './attention.js';
4
+ import visibility from './visibility.js';
5
+ import privatebrowsing from './privatebrowsing.js';
6
+ import heatmap from './heatmap.js';
7
+ import './click-path-capture.js';
8
+ import './perf.js';
9
+ import './iframe-tracking.js';
10
+ export * from './types/abtest.js';
11
+ export * from './types/acquisition.js';
12
+ export * from './types/subscription.js';
13
+ export * from './types/interaction.js';
14
+ export * from './types/inpageclick.js';
15
+ export * from './types/printproduct.js';
16
+ export * from './types/product.js';
17
+ export * from './types/platform.js';
18
+ export * from './types/media.js';
19
+ export * from './types/consent.js';
20
+ export * from './types/component-type.js';
21
+ export * from './types/component-event.js';
22
+ export * from './types/event.js';
23
23
  let ng;
24
24
  if (window.guardian && window.guardian.ophan) {
25
25
  ng = window.guardian.ophan;
@@ -39,7 +39,7 @@ else {
39
39
  trackComponentAttention: attention.initComponent,
40
40
  record: transmit.sendMore,
41
41
  viewId: transmit.viewId,
42
- pageViewId: transmit.viewId
42
+ pageViewId: transmit.viewId,
43
43
  };
44
44
  ng = window.guardian.ophan;
45
45
  }
@@ -1,4 +1,4 @@
1
- import transmit from './transmit';
1
+ import transmit from './transmit.js';
2
2
  /*
3
3
  TO-DO:
4
4
  This function could probably be simplified with an async function.
package/NPM-dist/r2.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  import attention from './attention.js';
5
5
  import visibility from './visibility.js';
6
6
  import './click-path-capture.js';
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  import attention from './attention.js';
5
5
  import visibility from './visibility.js';
6
6
  core.init('smart-news');
@@ -1,5 +1,5 @@
1
1
  import core from './core.js';
2
- import transmit from './transmit';
2
+ import transmit from './transmit.js';
3
3
  import attention from './attention.js';
4
4
  import visibility from './visibility.js';
5
5
  import './click-path-capture.js';
@@ -94,7 +94,12 @@ const buildQueryString = (obj) => {
94
94
  */
95
95
  const send = (url, f) => {
96
96
  if (typeof fetch === 'function') {
97
- fetch(url, { method: 'GET', mode: 'no-cors', keepalive: true, credentials: 'include' }).then(() => f?.());
97
+ fetch(url, {
98
+ method: 'GET',
99
+ mode: 'no-cors',
100
+ keepalive: true,
101
+ credentials: 'include',
102
+ }).then(() => f?.());
98
103
  }
99
104
  else {
100
105
  const image = new Image();
@@ -1,20 +1,20 @@
1
- import './click-path-capture';
2
- import './perf';
3
- import './iframe-tracking';
4
- export * from './types/abtest';
5
- export * from './types/acquisition';
6
- export * from './types/subscription';
7
- export * from './types/interaction';
8
- export * from './types/inpageclick';
9
- export * from './types/printproduct';
10
- export * from './types/product';
11
- export * from './types/platform';
12
- export * from './types/media';
13
- export * from './types/consent';
14
- export * from './types/component-type';
15
- export * from './types/component-event';
16
- export * from './types/event';
17
- import { EventPayload } from "./types/event";
1
+ import './click-path-capture.js';
2
+ import './perf.js';
3
+ import './iframe-tracking.js';
4
+ export * from './types/abtest.js';
5
+ export * from './types/acquisition.js';
6
+ export * from './types/subscription.js';
7
+ export * from './types/interaction.js';
8
+ export * from './types/inpageclick.js';
9
+ export * from './types/printproduct.js';
10
+ export * from './types/product.js';
11
+ export * from './types/platform.js';
12
+ export * from './types/media.js';
13
+ export * from './types/consent.js';
14
+ export * from './types/component-type.js';
15
+ export * from './types/component-event.js';
16
+ export * from './types/event.js';
17
+ import { EventPayload } from './types/event.js';
18
18
  interface NG {
19
19
  record: (event: EventPayload, callback?: Function) => void;
20
20
  pageViewId: string;
@@ -1,4 +1,4 @@
1
- import { EventPayload } from "./types/event";
1
+ import { EventPayload } from './types/event.js';
2
2
  declare const _default: {
3
3
  sendInitial: (obj: Record<string, any>) => void;
4
4
  sendMore: (obj: EventPayload, f?: (() => void) | undefined) => void;
@@ -1,8 +1,8 @@
1
- import type { AbTestInfo } from "./abtest";
2
- import type { PrintOptions } from "./printproduct";
3
- import type { TComponentType } from "./component-type";
4
- import type { TPlatform } from "./platform";
5
- import type { Product } from "./product";
1
+ import type { AbTestInfo } from './abtest.js';
2
+ import type { PrintOptions } from './printproduct.js';
3
+ import type { TComponentType } from './component-type.js';
4
+ import type { TPlatform } from './platform.js';
5
+ import type { Product } from './product.js';
6
6
  /**
7
7
  * A query string parameter
8
8
  */
@@ -16,13 +16,13 @@ export type QueryParameter = {
16
16
  */
17
17
  value: string;
18
18
  };
19
- export type TPaymentFrequency = "ONE_OFF" | "MONTHLY" | "ANNUALLY" | "QUARTERLY" | "SIX_MONTHLY";
20
- export type TPaymentProvider = "STRIPE" | "PAYPAL" | "GOCARDLESS" | "IN_APP_PURCHASE" | "STRIPE_APPLE_PAY" | "STRIPE_PAYMENT_REQUEST_BUTTON" | "SUBSCRIBE_WITH_GOOGLE" | "AMAZON_PAY" | "STRIPE_SEPA";
21
- export type TAcquisitionSource = "GUARDIAN_WEB" |
19
+ export type TPaymentFrequency = 'ONE_OFF' | 'MONTHLY' | 'ANNUALLY' | 'QUARTERLY' | 'SIX_MONTHLY';
20
+ export type TPaymentProvider = 'STRIPE' | 'PAYPAL' | 'GOCARDLESS' | 'IN_APP_PURCHASE' | 'STRIPE_APPLE_PAY' | 'STRIPE_PAYMENT_REQUEST_BUTTON' | 'SUBSCRIBE_WITH_GOOGLE' | 'AMAZON_PAY' | 'STRIPE_SEPA';
21
+ export type TAcquisitionSource = 'GUARDIAN_WEB'
22
22
  /**
23
23
  * @deprecated DO NOT USE
24
24
  */
25
- "GUARDIAN_APPS" | "EMAIL" | "SOCIAL" | "SEARCH" | "PPC" | "DIRECT" | "GUARDIAN_APP_IOS" | "GUARDIAN_APP_ANDROID" | "APPLE_NEWS" | "GOOGLE_AMP" | "YOUTUBE";
25
+ | 'GUARDIAN_APPS' | 'EMAIL' | 'SOCIAL' | 'SEARCH' | 'PPC' | 'DIRECT' | 'GUARDIAN_APP_IOS' | 'GUARDIAN_APP_ANDROID' | 'APPLE_NEWS' | 'GOOGLE_AMP' | 'YOUTUBE';
26
26
  /**
27
27
  * Represents monetary contribution made by a reader via this page.
28
28
  */
@@ -1,69 +1,69 @@
1
- import type { AbTest } from "./abtest";
2
- import type { Product } from "./product";
3
- import { TComponentType } from "./component-type";
1
+ import type { AbTest } from './abtest.js';
2
+ import type { Product } from './product.js';
3
+ import { TComponentType } from './component-type.js';
4
4
  export type TAction =
5
5
  /**
6
6
  * The component was inserted into its container (e.g. a web page or view in an app)
7
7
  **/
8
- "INSERT"
8
+ 'INSERT'
9
9
  /**
10
10
  * The component was in view on screen
11
11
  **/
12
- | "VIEW"
12
+ | 'VIEW'
13
13
  /**
14
14
  * The component was expanded (e.g. "see more").
15
15
  * Not a navigation away to another page
16
16
  **/
17
- | "EXPAND"
17
+ | 'EXPAND'
18
18
  /**
19
19
  * A "like", thumbs up, etc.
20
20
  **/
21
- | "LIKE"
21
+ | 'LIKE'
22
22
  /**
23
23
  * A "dislike", thumbs down, etc.
24
24
  **/
25
- | "DISLIKE"
25
+ | 'DISLIKE'
26
26
  /**
27
27
  * A subscription to a service, newsletter, etc.
28
28
  **/
29
- | "SUBSCRIBE"
29
+ | 'SUBSCRIBE'
30
30
  /**
31
31
  * Selection of an answer in a quiz
32
32
  **/
33
- | "ANSWER"
33
+ | 'ANSWER'
34
34
  /**
35
35
  * A vote in a poll
36
36
  **/
37
- | "VOTE"
37
+ | 'VOTE'
38
38
  /**
39
39
  * A single click on the component which is not covered by
40
40
  * any of the existing Actions.
41
41
  **/
42
- | "CLICK"
42
+ | 'CLICK'
43
43
  /**
44
44
  * User sign in to Guardian Identity account
45
45
  **/
46
- | "SIGN_IN"
46
+ | 'SIGN_IN'
47
47
  /**
48
48
  * User creates a Guardian Identity account
49
49
  **/
50
- | "CREATE_ACCOUNT"
50
+ | 'CREATE_ACCOUNT'
51
51
  /**
52
52
  * User Consent
53
53
  **/
54
- | "ACCEPT_DEFAULT_CONSENT" | "MANAGE_CONSENT" | "CONSENT_ACCEPT_ALL" | "CONSENT_REJECT_ALL"
54
+ | 'ACCEPT_DEFAULT_CONSENT' | 'MANAGE_CONSENT' | 'CONSENT_ACCEPT_ALL' | 'CONSENT_REJECT_ALL'
55
55
  /**
56
56
  * The component sticks in the screen
57
57
  **/
58
- | "STICK"
58
+ | 'STICK'
59
59
  /**
60
60
  * The component is closed
61
61
  **/
62
- | "CLOSE"
62
+ | 'CLOSE'
63
63
  /**
64
64
  * The component is returned to its original location
65
65
  **/
66
- | "RETURN";
66
+ | 'RETURN';
67
67
  export interface Component {
68
68
  name: string;
69
69
  loadTimeMs?: number;
@@ -1,12 +1,12 @@
1
- import type { Consent } from "./consent";
2
- import type { ComponentEvent } from "./component-event";
3
- import type { InPageClick } from "./inpageclick";
4
- import type { AbTestInfo } from "./abtest";
5
- import type { AudioEvent, VideoEvent } from "./media";
6
- import type { TMembershipTier, TSubscriptionType } from "./subscription";
7
- import type { TPlatform } from "./platform";
8
- import type { Acquisition } from "./acquisition";
9
- import { Interaction } from "./interaction";
1
+ import type { Consent } from './consent.js';
2
+ import type { ComponentEvent } from './component-event.js';
3
+ import type { InPageClick } from './inpageclick.js';
4
+ import type { AbTestInfo } from './abtest.js';
5
+ import type { AudioEvent, VideoEvent } from './media.js';
6
+ import type { TMembershipTier, TSubscriptionType } from './subscription.js';
7
+ import type { TPlatform } from './platform.js';
8
+ import type { Acquisition } from './acquisition.js';
9
+ import { Interaction } from './interaction.js';
10
10
  /**
11
11
  * Details about a page view - only populated for _PAGE_VIEW
12
12
  * event types
@@ -30,7 +30,7 @@ interface PageView {
30
30
  regular?: boolean;
31
31
  subscriptionType?: TSubscriptionType;
32
32
  membershipTier?: TMembershipTier;
33
- navigationType?: PerformanceNavigationTiming["type"];
33
+ navigationType?: PerformanceNavigationTiming['type'];
34
34
  from?: string;
35
35
  to?: string;
36
36
  tz?: string;
@@ -80,7 +80,7 @@ interface LazyComponents {
80
80
  /** The set of components that were loaded lazily on this page */
81
81
  components: Component[];
82
82
  }
83
- export type TEdition = "UK" | "US" | "AU" | "International" | "Europe";
83
+ export type TEdition = 'UK' | 'US' | 'AU' | 'International' | 'Europe';
84
84
  export interface EventPayload extends Partial<Consent> {
85
85
  /** If the user is logged in, the identity user id */
86
86
  userId?: string;
@@ -1,4 +1,4 @@
1
- import { LinkName } from "./link";
1
+ import { LinkName } from './link.js';
2
2
  export interface InPageClick {
3
3
  /**
4
4
  * the component that contained the item clicked on
@@ -1,6 +1,6 @@
1
1
  // Generated by CoffeeScript 2.7.0
2
2
  import core from './core.js';
3
- import transmit from './transmit';
3
+ import transmit from './transmit.js';
4
4
  core.init('witness');
5
5
  export default {
6
6
  record: transmit.sendMore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guardian/ophan-tracker-js",
3
- "version": "2.1.2-next.3",
3
+ "version": "2.1.2-next.5",
4
4
  "type": "module",
5
5
  "engines": {
6
6
  "node": ">=16"